protected theorem Decidable.le_iff_eq_or_lt [PartialOrder α] [@DecidableRel α (· ≤ ·)] {a b : α} :
    a ≤ b ↔ a = b ∨ a < b

{α : Type u_2}
[PartialOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{a b : α}


@[elab_as_elim]
theorem inductionOn (f : Germ l β) {p : Germ l β → Prop} (h : ∀ f : α → β, p f) : p f

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
(f : l.Germ β)
{p : l.Germ β → Prop}
(h : ∀ (f : α → β), p ↑f)


/-- A presheaf isomorphic to the Yoneda embedding of
the `V`-object of natural transformations from `F` to `G`.
-/
@[simps]
def enrichedNatTransYoneda (F G : EnrichedFunctor V C D) : Vᵒᵖ ⥤ Type max u₁ w

(F G : CategoryTheory.EnrichedFunctor V C D)

∀ {X Y : Vᵒᵖ} (f : X ⟶ Y)
  (σ : CategoryTheory.GradedNatTrans ((CategoryTheory.Center.ofBraided V).obj (Opposite.unop X)) F G) (X_1 : C),
  ((CategoryTheory.enrichedNatTransYoneda F G).map f σ).app X_1 = CategoryTheory.CategoryStruct.comp f.unop (σ.app X_1)


/-- The distance equals the norm of subtracting two points. In this
lemma, it is necessary to have `V` as an explicit argument; otherwise
`rw dist_eq_norm_vsub` sometimes doesn't work. -/
theorem dist_eq_norm_vsub (x y : P) : dist x y = ‖x -ᵥ y‖

(V : Type u_2)
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x y : P)


theorem lt_mul_self [ZeroLEOneClass α] [MulPosStrictMono α]
    (hn : 1 < a) : a < a * a

{α : Type u}
[Semiring α]
[PartialOrder α]
{a : α}
[ZeroLEOneClass α]
[MulPosStrictMono α]
(hn : 1 < a)


/-- The measure of an a.e. disjoint union (even uncountable) of null-measurable sets is at least
the sum of the measures of the sets. -/
theorem tsum_meas_le_meas_iUnion_of_disjoint₀ {ι : Type*} [MeasurableSpace α] (μ : Measure α)
    {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) : (∑' i, μ (As i)) ≤ μ (⋃ i, As i)

(As_mble : ∀ (i : ι), MeasureTheory.NullMeasurableSet (As i) μ)

(As_disj : Pairwise (MeasureTheory.AEDisjoint μ on As))


@[simp]
theorem pullbackConeOfRightIso_fst : (pullbackConeOfRightIso f g).fst = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)
[CategoryTheory.IsIso g]

(CategoryTheory.Limits.pullbackConeOfRightIso f g).fst = 𝟙 (CategoryTheory.Limits.pullbackConeOfRightIso f g).pt


theorem range_smul_pow_stabilizes (r : R) :
    ∃ n : ℕ, ∀ m, n ≤ m →
      LinearMap.range (r ^ n • LinearMap.id : M →ₗ[R] M) =
      LinearMap.range (r ^ m • LinearMap.id : M →ₗ[R] M)

{R : Type u_1}
(M : Type u_2)
[CommRing R]
[AddCommGroup M]
[Module R M]
[IsArtinian R M]
(r : R)

∃ n, ∀ (m : ℕ), n ≤ m → LinearMap.range (r ^ n • LinearMap.id) = LinearMap.range (r ^ m • LinearMap.id)


/-- For any circle integrable function `f`, the power series `cauchyPowerSeries f c R`, `R > 0`,
converges to the Cauchy integral `(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z` on the open
disc `Metric.ball c R`. -/
theorem hasFPowerSeriesOn_cauchy_integral {f : ℂ → E} {c : ℂ} {R : ℝ≥0}
    (hf : CircleIntegrable f c R) (hR : 0 < R) :
    HasFPowerSeriesOnBall (fun w => (2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z)
      (cauchyPowerSeries f c R) c R

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : ℂ → E}
{c : ℂ}
{R : ℝ≥0}
(hf : CircleIntegrable f c ↑R)
(hR : 0 < R)

HasFPowerSeriesOnBall (fun w => (2 * ↑π * Complex.I)⁻¹ • ∮ (z : ℂ) in C(c, ↑R), (z - w)⁻¹ • f z)
  (cauchyPowerSeries f c ↑R) c ↑R


@[bv_toNat] theorem getLsb_succ_last (x : BitVec (w + 1)) :
    x.getLsb w = decide (2 ^ w ≤ x.toNat)


theorem fieldRange_comp_val : (f.comp L.val).fieldRange = L.map f

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{K : Type u_3}
[Field K]
[Algebra F K]
(L : IntermediateField F E)
(f : E →ₐ[F] K)

(f.comp L.val).fieldRange = IntermediateField.map f L


theorem Rat.invOf_denom_swap [Ring α] (n₁ n₂ : ℤ) (a₁ a₂ : α)
    [Invertible a₁] [Invertible a₂] : n₁ * ⅟a₁ = n₂ * ⅟a₂ ↔ n₁ * a₂ = n₂ * a₁

{α : Type u_1}
[Ring α]
(n₁ n₂ : ℤ)
(a₁ a₂ : α)
[Invertible a₁]
[Invertible a₂]

↑n₁ * ⅟a₁ = ↑n₂ * ⅟a₂ ↔ ↑n₁ * a₂ = ↑n₂ * a₁


theorem sphere_ext_iff (u v : sphere (0 : E) 1) : u = v ↔ ⟪(u : E), v⟫_ℝ = 1

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(u v : ↑(Metric.sphere 0 1))


theorem Functor.Initial.exists_eq [IsCofilteredOrEmpty C] [Initial F] {d : D} {c : C}
    (s s' : F.obj c ⟶ d) : ∃ (c' : C) (t : c' ⟶ c), F.map t ≫ s = F.map t ≫ s'

{C : Type v₁}
[CategoryTheory.Category.{v₁, v₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₂} D]
(F : CategoryTheory.Functor C D)
[CategoryTheory.IsCofilteredOrEmpty C]
[F.Initial]
{d : D}
{c : C}
(s s' : F.obj c ⟶ d)

∃ c' t, CategoryTheory.CategoryStruct.comp (F.map t) s = CategoryTheory.CategoryStruct.comp (F.map t) s'


lemma last_mem (x : RelSeries r) : x.last ∈ x

{α : Type u_1}
{r : Rel α α}
(x : RelSeries r)


theorem cos_add_pi_div_two (x : ℂ) : cos (x + π / 2) = -sin x

Complex.cos (x + ↑Real.pi / 2) = -Complex.sin x


/-- If two rings are isomorphic, and the second is a domain, then so is the first. -/
protected theorem isDomain {A : Type*} (B : Type*) [Semiring A] [Semiring B] [IsDomain B]
    (e : A ≃* B) : IsDomain A

{A : Type u_7}
(B : Type u_8)
[Semiring A]
[Semiring B]
[IsDomain B]
(e : A ≃* B)


@[to_additive]
lemma le_centralizer_centralizer {s : Submonoid M} : s ≤ centralizer (centralizer (s : Set M))

(M : Type u_1)
[Monoid M]
{s : Submonoid M}

s ≤ Submonoid.centralizer ↑(Submonoid.centralizer ↑s)


theorem Periodic.const_add [AddSemigroup α] (h : Periodic f c) (a : α) :
    Periodic (fun x => f (a + x)) c

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddSemigroup α]
(h : Function.Periodic f c)
(a : α)

Function.Periodic (fun x => f (a + x)) c


lemma iff_spectrum_nonneg {𝕜 A : Type*} [LinearOrderedSemifield 𝕜] [Ring A] [PartialOrder A]
    [Algebra 𝕜 A] : NonnegSpectrumClass 𝕜 A ↔ ∀ a : A, 0 ≤ a → ∀ x ∈ spectrum 𝕜 a, 0 ≤ x

{𝕜 : Type u_3}
{A : Type u_4}
[LinearOrderedSemifield 𝕜]
[Ring A]
[PartialOrder A]
[Algebra 𝕜 A]

NonnegSpectrumClass 𝕜 A ↔ ∀ (a : A), 0 ≤ a → ∀ x ∈ spectrum 𝕜 a, 0 ≤ x


/-- The monomials `fourier n` are an orthonormal set with respect to normalised Haar measure. -/
theorem orthonormal_fourier : Orthonormal ℂ (@fourierLp T _ 2 _)


protected theorem neg_mul_neg (a b : Int) : -a * -b = a * b


/-- A measure `μ : Measure α` is invariant under a multiplicative action of `M` on `α` if for any
measurable set `s : Set α` and `c : M`, the measure of its preimage under `fun x => c • x` is equal
to the measure of `s`. -/
@[to_additive]
class SMulInvariantMeasure (M α : Type*) [SMul M α] {_ : MeasurableSpace α} (μ : Measure α) :
  Prop where
  measure_preimage_smul : ∀ (c : M) ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c • x) ⁻¹' s) = μ s

{M : Type u_1}
{α : Type u_2}
[SMul M α]

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [self : MeasureTheory.SMulInvariantMeasure M α μ] (c : M)
  ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c • x) ⁻¹' s) = μ s


theorem contractNth_apply_of_eq (j : Fin (n + 1)) (op : α → α → α) (g : Fin (n + 1) → α) (k : Fin n)
    (h : (k : ℕ) = j) : contractNth j op g k = op (g (Fin.castSucc k)) (g k.succ)

{n : ℕ}
{α : Type u_1}
(j : Fin (n + 1))
(op : α → α → α)
(g : Fin (n + 1) → α)
(k : Fin n)
(h : ↑k = ↑j)

j.contractNth op g k = op (g k.castSucc) (g k.succ)


/-- Constructor for embeddings between complex shapes when we have an equivalence
`∀ (i₁ i₂ : ι), c.Rel i₁ i₂ ↔ c'.Rel (f i₁) (f i₂)`. -/
@[simps]
def mk' : Embedding c c'

(iff : ∀ (i₁ i₂ : ι), c.Rel i₁ i₂ ↔ c'.Rel (f i₁) (f i₂))

∀ (a : ι), (ComplexShape.Embedding.mk' c c' f hf iff).f a = f a


/-- Given any distinguished triangle `T`, then we know `T.inv_rotate` is also distinguished.
-/
theorem inv_rot_of_distTriang (T : Triangle C) (H : T ∈ distTriang C) :
    T.invRotate ∈ distTriang C

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(H : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem Codisjoint.eq_top_of_le (hab : Codisjoint a b) (h : b ≤ a) : a = ⊤

{α : Type u_1}
[PartialOrder α]
[OrderTop α]
{a b : α}
(hab : Codisjoint a b)
(h : b ≤ a)


theorem mkSpanSingleton_apply (K : Type*) {E F : Type*} [DivisionRing K] [AddCommGroup E]
    [Module K E] [AddCommGroup F] [Module K F] {x : E} (hx : x ≠ 0) (y : F) :
    mkSpanSingleton x y hx ⟨x, (Submodule.mem_span_singleton_self x : x ∈ Submodule.span K {x})⟩ =
      y

(K : Type u_5)
{E : Type u_6}
{F : Type u_7}
[DivisionRing K]
[AddCommGroup E]
[Module K E]
[AddCommGroup F]
[Module K F]
{x : E}
(hx : x ≠ 0)
(y : F)

↑(LinearPMap.mkSpanSingleton x y hx) ⟨x, ⋯⟩ = y


{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{z : ℤ}
{a : α}

⌈a⌉ ≤ z ↔ a ≤ ↑z


/-- The set of points which are isolated on the left is countable when the space is
second-countable. -/
theorem countable_setOf_isolated_left [SecondCountableTopology α] :
    { x : α | 𝓝[<] x = ⊥ }.Countable

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]


theorem toSimpleFunc_eq_toFun (f : Lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f

(f : ↥(MeasureTheory.Lp.simpleFunc E p μ))

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f) =ᵐ[μ] ↑↑↑f


theorem lt_irrefl {f : CauSeq α abs} : ¬f < f

{α : Type u_1}
[LinearOrderedField α]
{f : CauSeq α abs}


@[to_additive]
theorem interior_smul (c : G) (s : Set α) : interior (c • s) = c • interior s

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[AddGroup G]
[AddAction G α]
[ContinuousConstVAdd G α]
(c : G)
(s : Set α)


@[simp]
theorem iteratedFDeriv_zero_fun {n : ℕ} : (iteratedFDeriv 𝕜 n fun _ : E ↦ (0 : F)) = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}


theorem Injective.isExpansionOn_default {ϕ : L →ᴸ L'}
    [∀ (n) (f : L'.Functions n), Decidable (f ∈ Set.range fun f : L.Functions n => ϕ.onFunction f)]
    [∀ (n) (r : L'.Relations n), Decidable (r ∈ Set.range fun r : L.Relations n => ϕ.onRelation r)]
    (h : ϕ.Injective) (M : Type*) [Inhabited M] [L.Structure M] :
    @IsExpansionOn L L' ϕ M _ (ϕ.defaultExpansion M)

[(n : ℕ) → (f : L'.Functions n) → Decidable (f ∈ Set.range fun f => ϕ.onFunction f)]

[(n : ℕ) → (r : L'.Relations n) → Decidable (r ∈ Set.range fun r => ϕ.onRelation r)]


theorem lintegral_mul_const (r : ℝ≥0∞) {f : α → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ a, f a * r ∂μ = (∫⁻ a, f a ∂μ) * r

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(r : ℝ≥0∞)
{f : α → ℝ≥0∞}
(hf : Measurable f)

∫⁻ (a : α), f a * r ∂μ = (∫⁻ (a : α), f a ∂μ) * r


theorem compress_mem_compression_of_mem_compression (ha : a ∈ 𝓒 u v s) :
    compress u v a ∈ 𝓒 u v s

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{u v a : α}
[DecidableEq α]
(ha : a ∈ UV.compression u v s)

UV.compress u v a ∈ UV.compression u v s


/-- If a function vanishes almost everywhere on `t \ s` with `s ⊆ t`, then its integrals on `s`
and `t` coincide if `t` is null-measurable. -/
theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero (ht : NullMeasurableSet t μ) (hts : s ⊆ t)
    (h't : ∀ᵐ x ∂μ, x ∈ t \ s → f x = 0) : ∫ x in t, f x ∂μ = ∫ x in s, f x ∂μ

(ht : MeasureTheory.NullMeasurableSet t μ)

(h't : ∀ᵐ (x : X) ∂μ, x ∈ t \ s → f x = 0)

∫ (x : X) in t, f x ∂μ = ∫ (x : X) in s, f x ∂μ


/-- A uniformly Cauchy sequence converges uniformly to its limit -/
theorem UniformCauchySeqOn.tendstoUniformlyOn_of_tendsto [NeBot p] (hF : UniformCauchySeqOn F p s)
    (hF' : ∀ x : α, x ∈ s → Tendsto (fun n => F n x) p (𝓝 (f x))) : TendstoUniformlyOn F f p s

{F : ι → α → β}

(hF' : ∀ x ∈ s, Filter.Tendsto (fun n => F n x) p (𝓝 (f x)))


lemma comp_fin3 {S} (f : R → S) (X Y Z : R) : f ∘ ![X, Y, Z] = ![f X, f Y, f Z]

{R : Type u}
{S : Type u_1}
(f : R → S)
(X Y Z : R)


protected theorem toFinset_compl [DecidableEq α] [Fintype α] (hs : s.Finite) (h : sᶜ.Finite) :
    h.toFinset = hs.toFinsetᶜ

{α : Type u}
{s : Set α}
[DecidableEq α]
[Fintype α]
(hs : s.Finite)
(h : sᶜ.Finite)


@[to_additive]
theorem lt_mul_of_lt_mul_left [CovariantClass α α (· * ·) (· ≤ ·)] {a b c d : α} (h : a < b * c)
    (hle : c ≤ d) :
    a < b * d

[CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


@[to_additive (attr := simp)]
theorem MulHom.toMulEquiv_symm_apply [Mul M] [Mul N] (f : M →ₙ* N) (g : N →ₙ* M)
    (h₁ : g.comp f = MulHom.id _) (h₂ : f.comp g = MulHom.id _) :
    (MulEquiv.symm (MulHom.toMulEquiv f g h₁ h₂) : N → M) = ↑g

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(f : AddHom M N)
(g : AddHom N M)
(h₁ : g.comp f = AddHom.id M)
(h₂ : f.comp g = AddHom.id N)


protected theorem _root_.Measurable.quasiMeasurePreserving
    {_m0 : MeasurableSpace α} (hf : Measurable f) (μ : Measure α) :
    QuasiMeasurePreserving f μ (μ.map f)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace β]
{f : α → β}
{_m0 : MeasurableSpace α}
(hf : Measurable f)
(μ : MeasureTheory.Measure α)

MeasureTheory.Measure.QuasiMeasurePreserving f μ (MeasureTheory.Measure.map f μ)


@[to_additive]
protected lemma MulAction.surjective (g : α) : Function.Surjective (g • · : β → β)

{α : Type u_1}
{β : Type u_2}
[Group α]
[MulAction α β]
(g : α)


/-- A sieve induces a presheaf. -/
@[simps]
def functor (S : Sieve X) : Cᵒᵖ ⥤ Type v₁

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
(S : CategoryTheory.Sieve X)
(Y : Cᵒᵖ)


@[to_additive]
theorem mulIndicator_empty' (f : α → M) : mulIndicator (∅ : Set α) f = 1

{α : Type u_1}
{M : Type u_4}
[Zero M]
(f : α → M)


theorem eq_of_forall_lt_rat_iff_lt (h : ∀ q : ℚ, x < q ↔ y < q) : x = y

{α : Type u_1}
[LinearOrderedField α]
[Archimedean α]
{x y : α}
(h : ∀ (q : ℚ), x < ↑q ↔ y < ↑q)


@[measurability]
theorem measurable_log : Measurable log


@[to_additive (attr := simp)]
lemma card_smul_set (a : α) (s : Set β) : Nat.card ↥(a • s) = Nat.card s

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
(a : α)
(s : Set β)


@[simp]
theorem lt_le_apply (f : r ≺i s) (g : s ≼i t) (a : α) : (f.ltLe g) a = g (f a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
(f : r ≺i s)
(g : s ≼i t)
(a : α)

(f.ltLe g).toRelEmbedding a = g (f.toRelEmbedding a)


theorem shift_shiftFunctorCompIsoId_add_neg_self_hom_app (n : A) (X : C) :
    ((shiftFunctorCompIsoId C n (-n) (add_neg_self n)).hom.app X)⟦n⟧' =
    (shiftFunctorCompIsoId C (-n) n (neg_add_self n)).hom.app (X⟦n⟧)

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddGroup A]
[CategoryTheory.HasShift C A]
(n : A)
(X : C)

(CategoryTheory.shiftFunctor C n).map ((CategoryTheory.shiftFunctorCompIsoId C n (-n) ⋯).hom.app X) =
  (CategoryTheory.shiftFunctorCompIsoId C (-n) n ⋯).hom.app ((CategoryTheory.shiftFunctor C n).obj X)


@[simp]
theorem get?_mk (f hf) : @get? α ⟨f, hf⟩ = f

{α : Type u}
(f : Stream' (Option α))
(hf : f.IsSeq)


@[simp]
theorem coe_smul (f : SlashInvariantForm Γ k) (n : α) : ⇑(n • f) = n • ⇑f

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
{α : Type u_2}
[SMul α ℂ]
[IsScalarTower α ℂ ℂ]
(f : SlashInvariantForm Γ k)
(n : α)


/-- The product of two dense sets is a dense set. -/
theorem Dense.prod {s : Set X} {t : Set Y} (hs : Dense s) (ht : Dense t) : Dense (s ×ˢ t)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{t : Set Y}
(hs : Dense s)
(ht : Dense t)


@[to_additive (attr := ext)]
theorem ext (h : ∀ x, x ∈ U ↔ x ∈ V) : U = V

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{U V : OpenSubgroup G}
(h : ∀ (x : G), x ∈ U ↔ x ∈ V)


theorem continuous_proj : @Continuous _ _ a.totalSpaceTopology _ (π F E)

{B : Type u_2}
{F : Type u_3}
{E : B → Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
[(x : B) → TopologicalSpace (E x)]
(a : FiberPrebundle F E)


@[to_additive (attr := simp)]
theorem add_apply (x : E) : (p + q) x = p x + q x

{E : Type u_4}
[Group E]
(p q : GroupNorm E)
(x : E)


theorem one_div_lt_of_neg (ha : a < 0) (hb : b < 0) : 1 / a < b ↔ 1 / b < a

{α : Type u_2}
[LinearOrderedField α]
{a b : α}
(ha : a < 0)
(hb : b < 0)


/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R

[DirectedSystem G fun i j h => ⇑(f i j h)]

∀ {X Y : ι} (hij : X ⟶ Y), (ModuleCat.directLimitDiagram G f).map hij = f X Y ⋯


theorem multichoose_succ_succ (n k : ℕ) :
    multichoose (n + 1) (k + 1) = multichoose n (k + 1) + multichoose (n + 1) k

(n + 1).multichoose (k + 1) = n.multichoose (k + 1) + (n + 1).multichoose k


@[to_additive]
protected theorem Inseparable.pow {M : Type*} [Monoid M] [TopologicalSpace M] [ContinuousMul M]
    {a b : M} (h : Inseparable a b) (n : ℕ) : Inseparable (a ^ n) (b ^ n)

{M : Type u_6}
[AddMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
{a b : M}
(h : Inseparable a b)
(n : ℕ)


@[simp]
theorem toIocMod_add_zsmul (a b : α) (m : ℤ) : toIocMod hp a (b + m • p) = toIocMod hp a b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)
(m : ℤ)


@[simp]
theorem sumComm_symm (α β) : (sumComm α β).symm = sumComm β α

(Equiv.sumComm α β).symm = Equiv.sumComm β α


theorem equicontinuousAt_iInf_dom {t : κ → TopologicalSpace X'} {F : ι → X' → α}
    {x₀ : X'} {k : κ} (hk : EquicontinuousAt (tX := t k) F x₀) :
    EquicontinuousAt (tX := ⨅ k, t k) F x₀

{ι : Type u_1}
{κ : Type u_2}
{X' : Type u_4}
{α : Type u_7}
[uα : UniformSpace α]
{t : κ → TopologicalSpace X'}
{F : ι → X' → α}
{x₀ : X'}
{k : κ}
(hk : EquicontinuousAt F x₀)


@[reassoc (attr := simp)]
theorem limit.lift_π_app (H : J ⥤ K ⥤ C) [HasLimit H] (c : Cone H) (j : J) (k : K) :
    (limit.lift H c).app k ≫ (limit.π H j).app k = (c.π.app j).app k

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
(H : J ⥤ K ⥤ C)
[CategoryTheory.Limits.HasLimit H]
(c : CategoryTheory.Limits.Cone H)
(j : J)
(k : K)

(CategoryTheory.Limits.limit.lift H c).app k ≫ (CategoryTheory.Limits.limit.π H j).app k = (c.π.app j).app k


theorem range_eq_iSup {N} [Group N] (f : ∀ i, G i →* N) : (lift f).range = ⨆ i, (f i).range

{ι : Type u_1}
(G : ι → Type u_4)
[(i : ι) → Group (G i)]
{N : Type u_5}
[Group N]
(f : (i : ι) → G i →* N)

(Monoid.CoprodI.lift f).range = ⨆ i, (f i).range


/-- A product of categories indexed by `Option J` identifies to a binary product. -/
@[simps]
def Pi.optionEquivalence (C' : Option J → Type u₁) [∀ i, Category.{v₁} (C' i)] :
    (∀ i, C' i) ≌ C' none × (∀ (j : J), C' (some j))

[(i : Option J) → CategoryTheory.Category.{v₁, u₁} (C' i)]

(CategoryTheory.Pi.optionEquivalence C').inverse =
  CategoryTheory.Functor.pi' fun i =>
    match i with
    | none => CategoryTheory.Prod.fst (C' none) ((j : J) → C' (some j))
    | some i =>
      (CategoryTheory.Prod.snd (C' none) ((j : J) → C' (some j))).comp (CategoryTheory.Pi.eval (fun j => C' (some j)) i)


@[simp]
theorem lift_algebraMap (h : IsAdjoinRoot S f) (a : R) :
    h.lift i x hx (algebraMap R S a) = i a

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[CommRing T]
{i : R →+* T}
{x : T}
(hx : Polynomial.eval₂ i x f = 0)
(h : IsAdjoinRoot S f)
(a : R)

(IsAdjoinRoot.lift i x hx h) ((algebraMap R S) a) = i a


@[simp]
theorem mapEquiv_refl (α) : mapEquiv f (Equiv.refl α) = Equiv.refl (f α)

(f : Type u₀ → Type u₁)
[EquivFunctor f]
(α : Type u₀)

EquivFunctor.mapEquiv f (Equiv.refl α) = Equiv.refl (f α)


/-- An **e-transform**. Turns `(s, t)` into `(s ∪ s • e, t ∩ e⁻¹ • t)`. This reduces the
product of the two sets. -/
@[to_additive (attr := simps) "An **e-transform**.
Turns `(s, t)` into `(s ∪ s +ᵥ e, t ∩ -e +ᵥ t)`. This reduces the sum of the two sets."]
def mulETransformRight : Finset α × Finset α

{α : Type u_1}
[DecidableEq α]
[Group α]
(e : α)
(x : Finset α × Finset α)

(Finset.mulETransformRight e x).1 = x.1 ∪ MulOpposite.op e • x.1


/-- The conditional expectation of `Y` given `X` is almost everywhere equal to the integral
`∫ y, y ∂(condDistrib Y X μ (X a))`. -/
theorem condexp_ae_eq_integral_condDistrib' {Ω} [NormedAddCommGroup Ω] [NormedSpace ℝ Ω]
    [CompleteSpace Ω] [MeasurableSpace Ω] [BorelSpace Ω] [SecondCountableTopology Ω] {Y : α → Ω}
    (hX : Measurable X) (hY_int : Integrable Y μ) :
    μ[Y|mβ.comap X] =ᵐ[μ] fun a => ∫ y, y ∂condDistrib Y X μ (X a)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
{X : α → β}
{mβ : MeasurableSpace β}
{Ω : Type u_5}
[NormedAddCommGroup Ω]
[NormedSpace ℝ Ω]
[CompleteSpace Ω]
[MeasurableSpace Ω]
[BorelSpace Ω]
[SecondCountableTopology Ω]
{Y : α → Ω}
(hX : Measurable X)
(hY_int : MeasureTheory.Integrable Y μ)

μ[Y|MeasurableSpace.comap X mβ] =ᵐ[μ] fun a => ∫ (y : Ω), y ∂(ProbabilityTheory.condDistrib Y X μ) (X a)


theorem Sylow.exists_comap_subtype_eq {H : Subgroup G} (P : Sylow p H) :
    ∃ Q : Sylow p G, (Q : Subgroup G).comap H.subtype = P

{p : ℕ}
{G : Type u_1}
[Group G]
{H : Subgroup G}
(P : Sylow p ↥H)


@[simp]
theorem toEnd_add (x y : CentroidHom α) : (x + y).toEnd = x.toEnd + y.toEnd

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(x y : CentroidHom α)


@[to_additive (attr := simp)]
lemma UniformFun.toFun_mul [Mul β] (f g : α →ᵤ β) : toFun (f * g) = toFun f * toFun g

{α : Type u_1}
{β : Type u_2}
[Mul β]
(f g : α →ᵤ β)

UniformFun.toFun (f * g) = UniformFun.toFun f * UniformFun.toFun g


theorem ker_liftQ_eq_bot' (f : M →ₛₗ[τ₁₂] M₂) (h : p = ker f) :
    ker (p.liftQ f (le_of_eq h)) = ⊥

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{R₂ : Type u_3}
{M₂ : Type u_4}
[Ring R₂]
[AddCommGroup M₂]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
(f : M →ₛₗ[τ₁₂] M₂)
(h : p = LinearMap.ker f)


theorem diagonal_mul_diagonal' [Fintype n] [DecidableEq n] (d₁ d₂ : n → α) :
    diagonal d₁ * diagonal d₂ = diagonal fun i => d₁ i * d₂ i

{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype n]
[DecidableEq n]
(d₁ d₂ : n → α)

Matrix.diagonal d₁ * Matrix.diagonal d₂ = Matrix.diagonal fun i => d₁ i * d₂ i


@[simp]
theorem range_id : (AlgHom.id R A).range = ⊤

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]


lemma disjoint_erase_insert (ha : a ∉ s) : Disjoint (insert a s) (t.erase a) ↔ Disjoint s t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
{a : α}
(ha : a ∉ s)


lemma isSublattice_sInter (hS : ∀ s ∈ S, IsSublattice s) : IsSublattice (⋂₀ S)

{α : Type u_2}
[Lattice α]
{S : Set (Set α)}
(hS : ∀ s ∈ S, IsSublattice s)


theorem integral_withDensity_eq_integral_smul₀ {f : X → ℝ≥0} (hf : AEMeasurable f μ) (g : X → E) :
    ∫ x, g x ∂μ.withDensity (fun x => f x) = ∫ x, f x • g x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → ℝ≥0}
(hf : AEMeasurable f μ)
(g : X → E)

(∫ (x : X), g x ∂μ.withDensity fun x => ↑(f x)) = ∫ (x : X), f x • g x ∂μ


/-- The chain rule. -/
theorem HasDerivAt.scomp_of_eq
    (hg : HasDerivAt g₁ g₁' y) (hh : HasDerivAt h h' x) (hy : y = h x) :
    HasDerivAt (g₁ ∘ h) (h' • g₁') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(x : 𝕜)
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{h : 𝕜 → 𝕜'}
{h' : 𝕜'}
{g₁ : 𝕜' → F}
{g₁' : F}
{y : 𝕜'}
(hg : HasDerivAt g₁ g₁' y)
(hh : HasDerivAt h h' x)
(hy : y = h x)


/-- Bijection between `MulOpposite` of a subring `S` and its opposite. -/
@[simps!]
def mopRingEquivOp (S : Subring R) : Sᵐᵒᵖ ≃+* S.op

∀ (a : (↥S.toSubsemiring)ᵐᵒᵖ), ↑(S.mopRingEquivOp a) = MulOpposite.op ↑(MulOpposite.unop a)


/-- **Weighted Hölder inequality**. -/
lemma inner_le_weight_mul_Lp_of_nonneg (s : Finset ι) {p : ℝ} (hp : 1 ≤ p) (w f : ι → ℝ)
    (hw : ∀ i, 0 ≤ w i) (hf : ∀ i, 0 ≤ f i) :
    ∑ i ∈ s, w i * f i ≤ (∑ i ∈ s, w i) ^ (1 - p⁻¹) * (∑ i ∈ s, w i * f i ^ p) ^ p⁻¹

{ι : Type u}
(s : Finset ι)
{p : ℝ}
(hp : 1 ≤ p)
(w f : ι → ℝ)
(hw : ∀ (i : ι), 0 ≤ w i)
(hf : ∀ (i : ι), 0 ≤ f i)


theorem NeZero.nat_of_neZero {R S} [Semiring R] [Semiring S]
    {F} [FunLike F R S] [RingHomClass F R S] (f : F)
    {n : ℕ} [hn : NeZero (n : S)] : NeZero (n : R)

{R : Type u_6}
{S : Type u_7}
[Semiring R]
[Semiring S]
{F : Type u_8}
[FunLike F R S]
[RingHomClass F R S]
(f : F)
{n : ℕ}
[hn : NeZero ↑n]


theorem dvd_term_of_dvd_eval_of_dvd_terms {z p : S} {f : S[X]} (i : ℕ) (dvd_eval : p ∣ f.eval z)
    (dvd_terms : ∀ j ≠ i, p ∣ f.coeff j * z ^ j) : p ∣ f.coeff i * z ^ i

(dvd_terms : ∀ (j : ℕ), j ≠ i → p ∣ f.coeff j * z ^ j)


/-- A weighted sum may be split into a subtraction of affine combinations over two subsets. -/
theorem affineCombination_sdiff_sub [DecidableEq ι] {s₂ : Finset ι} (h : s₂ ⊆ s) (w : ι → k)
    (p : ι → P) :
    (s \ s₂).affineCombination k p w -ᵥ s₂.affineCombination k p (-w) = s.weightedVSub p w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
[DecidableEq ι]
{s₂ : Finset ι}
(h : s₂ ⊆ s)
(w : ι → k)
(p : ι → P)

(Finset.affineCombination k (s \ s₂) p) w -ᵥ (Finset.affineCombination k s₂ p) (-w) = (s.weightedVSub p) w


lemma eq_num_of_isInt {q : ℚ} (h : q.isInt) : q = q.num


@[fun_prop]
protected theorem continuousOn_aeval {s} : ContinuousOn (fun x : A => aeval x p) s

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[TopologicalSpace A]
[TopologicalSemiring A]
(p : Polynomial R)
{s : Set A}

ContinuousOn (fun x => (Polynomial.aeval x) p) s


@[to_additive (attr := simp)] theorem MonoidHom.comp_id_monCat
    {G : MonCat.{u}} {H : Type u} [Monoid H] (f : G →* H) : f.comp (𝟙 G) = f

{G : AddMonCat}
{H : Type u}
[AddMonoid H]
(f : ↑G →+ H)


lemma le_chromaticNumber_iff_forall_surjective :
    n ≤ G.chromaticNumber ↔ ∀ C : G.Coloring (Fin n), Surjective C

{V : Type u}
{G : SimpleGraph V}
{n : ℕ}

↑n ≤ G.chromaticNumber ↔ ∀ (C : G.Coloring (Fin n)), Function.Surjective ⇑C


theorem one_associator {M N P : Mon_ C} :
    ((λ_ (𝟙_ C)).inv ≫ ((λ_ (𝟙_ C)).inv ≫ (M.one ⊗ N.one) ⊗ P.one)) ≫ (α_ M.X N.X P.X).hom =
      (λ_ (𝟙_ C)).inv ≫ (M.one ⊗ (λ_ (𝟙_ C)).inv ≫ (N.one ⊗ P.one))

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{M N P : Mon_ C}


lemma comap_symm (e : α ≃ᵐ β) : μ.comap e.symm = μ.map e

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
(e : α ≃ᵐ β)

MeasureTheory.Measure.comap (⇑e.symm) μ = MeasureTheory.Measure.map (⇑e) μ


theorem stepNormal_eval (c v) : eval step (stepNormal c Cont.halt v) = Cfg.halt <$> c.eval v

(c : Turing.ToPartrec.Code)
(v : List ℕ)

Turing.eval Turing.ToPartrec.step (Turing.ToPartrec.stepNormal c Turing.ToPartrec.Cont.halt v) =
  Turing.ToPartrec.Cfg.halt <$> c.eval v


@[simp] lemma add_self_div_two (a : R) : (a + a) / 2 = a

{R : Type u_1}
[DivisionSemiring R]
[NeZero 2]
(a : R)


@[deprecated rpow_inv_eq_iff (since := "2024-07-10")]
theorem rpow_one_div_eq_iff {x y : ℝ≥0} {z : ℝ} (hz : z ≠ 0) : x ^ (1 / z) = y ↔ x = y ^ z


lemma absolutelyContinuous_cond_univ [IsFiniteMeasure μ] : μ ≪ μ[|univ]

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]


/-- Given an exact short complex `S` and a colimit cokernel cofork `cc` for `S.f`, this is the
right homology data for `S` with `Q := cc.pt` and `H := 0`. -/
@[simps]
noncomputable def Exact.rightHomologyDataOfIsColimitCokernelCofork
    (hS : S.Exact) [HasZeroObject C] (cc : CokernelCofork S.f) (hcc : IsColimit cc) :
    S.RightHomologyData

(cc : CategoryTheory.Limits.CokernelCofork S.f)

(hcc : CategoryTheory.Limits.IsColimit cc)

(hS.rightHomologyDataOfIsColimitCokernelCofork cc hcc).H = 0


theorem OpenEmbedding.isQuasiSeparated_iff (h : OpenEmbedding f) {s : Set α} :
    IsQuasiSeparated s ↔ IsQuasiSeparated (f '' s)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(h : OpenEmbedding f)
{s : Set α}


@[simp]
lemma lt_toNat {m : ℕ} : m < toNat n ↔ (m : ℤ) < n


theorem isIntegral_of_isOpenImmersion {X Y : Scheme} (f : X ⟶ Y) [H : IsOpenImmersion f]
    [IsIntegral Y] [Nonempty X] : IsIntegral X

[H : AlgebraicGeometry.IsOpenImmersion f]


theorem einfsep_triple (hxy : x ≠ y) (hyz : y ≠ z) (hxz : x ≠ z) :
    einfsep ({x, y, z} : Set α) = edist x y ⊓ edist x z ⊓ edist y z

{α : Type u_1}
[PseudoEMetricSpace α]
{x y z : α}
(hxy : x ≠ y)
(hyz : y ≠ z)
(hxz : x ≠ z)

{x, y, z}.einfsep = edist x y ⊓ edist x z ⊓ edist y z


theorem map_one_snd_of_isMulTwoCocycle {f : G × G → M} (hf : IsMulTwoCocycle f) (g : G) :
    f (g, 1) = g • f (1, 1)

(hf : groupCohomology.IsMulTwoCocycle f)


@[simp]
theorem dist_map (x y : P) : dist (f x) (f y) = dist x y

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(f : P →ᵃⁱ[𝕜] P₂)
(x y : P)


theorem projective_of_map_projective (adj : F ⊣ G) [F.Full] [F.Faithful] (P : C)
    (hP : Projective (F.obj P)) : Projective P

(hP : CategoryTheory.Projective (F.obj P))


@[to_additive (attr := simp)]
theorem lift_symm_apply (f : FreeMonoid α →* M) : lift.symm f = f ∘ of

{α : Type u_1}
{M : Type u_4}
[AddMonoid M]
(f : FreeAddMonoid α →+ M)

FreeAddMonoid.lift.symm f = ⇑f ∘ FreeAddMonoid.of


/-- Sends a topological space to its specialisation order. -/
@[simps]
def alexDiscEquivPreord : AlexDisc ≌ Preord

alexDiscEquivPreord.counitIso =
  CategoryTheory.NatIso.ofComponents (fun X => Preord.Iso.mk (id (orderIsoSpecializationWithUpperSetTopology ↑X).symm))
    @alexDiscEquivPreord.proof_5


@[simp, norm_cast]
theorem coe_re : (x : ℍ[R,c₁,c₂]).re = x

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x : R)


theorem prod_mono_left : s₁ ≤ s₂ → s₁ ×ˢ t ≤ s₂ ×ˢ t

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s₁ s₂ : LowerSet α}
{t : LowerSet β}

s₁ ≤ s₂ → s₁ ×ˢ t ≤ s₂ ×ˢ t


nonrec theorem ContinuousOn.fin_insertNth {n} {π : Fin (n + 1) → Type*}
    [∀ i, TopologicalSpace (π i)] (i : Fin (n + 1)) {f : α → π i} {s : Set α}
    (hf : ContinuousOn f s) {g : α → ∀ j : Fin n, π (i.succAbove j)} (hg : ContinuousOn g s) :
    ContinuousOn (fun a => i.insertNth (f a) (g a)) s

[(i : Fin (n + 1)) → TopologicalSpace (π i)]

{g : α → (j : Fin n) → π (i.succAbove j)}


/-- A `EuclideanDomain` is a non-trivial commutative ring with a division and a remainder,
  satisfying `b * (a / b) + a % b = a`.
  The definition of a Euclidean domain usually includes a valuation function `R → ℕ`.
  This definition is slightly generalised to include a well founded relation
  `r` with the property that `r (a % b) b`, instead of a valuation.  -/
class EuclideanDomain (R : Type u) extends CommRing R, Nontrivial R where
  /-- A division function (denoted `/`) on `R`.
    This satisfies the property `b * (a / b) + a % b = a`, where `%` denotes `remainder`. -/
  protected quotient : R → R → R
  /-- Division by zero should always give zero by convention. -/
  protected quotient_zero : ∀ a, quotient a 0 = 0
  /-- A remainder function (denoted `%`) on `R`.
    This satisfies the property `b * (a / b) + a % b = a`, where `/` denotes `quotient`. -/
  protected remainder : R → R → R
  /-- The property that links the quotient and remainder functions.
    This allows us to compute GCDs and LCMs. -/
  protected quotient_mul_add_remainder_eq : ∀ a b, b * quotient a b + remainder a b = a
  /-- A well-founded relation on `R`, satisfying `r (a % b) b`.
    This ensures that the GCD algorithm always terminates. -/
  protected r : R → R → Prop
  /-- The relation `r` must be well-founded.
    This ensures that the GCD algorithm always terminates. -/
  r_wellFounded : WellFounded r
  /-- The relation `r` satisfies `r (a % b) b`. -/
  protected remainder_lt : ∀ (a) {b}, b ≠ 0 → r (remainder a b) b
  /-- An additional constraint on `r`. -/
  mul_left_not_lt : ∀ (a) {b}, b ≠ 0 → ¬r (a * b) a

{R : Type u}
[self : EuclideanDomain R]
(a b : R)

b * EuclideanDomain.quotient a b + EuclideanDomain.remainder a b = a


theorem Kernel.indep_biSup_limsup (h_le : ∀ n, s n ≤ m0) (h_indep : iIndep s κ μα)
    (hf : ∀ t, p t → tᶜ ∈ f) {t : Set ι} (ht : p t) :
    Indep (⨆ n ∈ t, s n) (limsup s f) κ μα

(h_indep : ProbabilityTheory.Kernel.iIndep s κ μα)

ProbabilityTheory.Kernel.Indep (⨆ n ∈ t, s n) (Filter.limsup s f) κ μα


lemma dual_eq_mul_inv :
    dual A K I = dual A K 1 * I⁻¹

(A : Type u_1)
(K : Type u_2)
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
(I : FractionalIdeal B⁰ L)

FractionalIdeal.dual A K I = FractionalIdeal.dual A K 1 * I⁻¹


/-- A binary bicone morphism between two binary bicones for the same diagram is a morphism of the
binary bicone points which commutes with the cone and cocone legs. -/
structure BinaryBiconeMorphism {P Q : C} (A B : BinaryBicone P Q) where
  /-- A morphism between the two vertex objects of the bicones -/
  hom : A.pt ⟶ B.pt
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wfst : hom ≫ B.fst = A.fst := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wsnd : hom ≫ B.snd = A.snd := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winl : A.inl ≫ hom = B.inl := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winr : A.inr ≫ hom = B.inr := by aesop_cat

{A B : CategoryTheory.Limits.BinaryBicone P Q}

(self : CategoryTheory.Limits.BinaryBiconeMorphism A B)


@[simp]
theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n

(i : (SetTheory.PGame.powHalf (n + 1)).RightMoves)

(SetTheory.PGame.powHalf (n + 1)).moveRight i = SetTheory.PGame.powHalf n


@[simp]
theorem comp_id (f : β →𝒄 γ) : f.comp id = f

{β : Type v}
{γ : Type u_3}
[OmegaCompletePartialOrder β]
[OmegaCompletePartialOrder γ]
(f : β →𝒄 γ)

f.comp OmegaCompletePartialOrder.ContinuousHom.id = f


/-- The equivalence `(ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n` obtained
by reversing the arrows. -/
@[simps!]
def opEquivalence : (ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n

(X : CategoryTheory.ComposableArrows Cᵒᵖ n)

∀ (X_1 : Fin (n + 1)),
  ((CategoryTheory.ComposableArrows.opEquivalence C n).counitIso.hom.app X).app X_1 =
    X.map
      (((CategoryTheory.orderDualEquivalence (Fin (n + 1))).symm.trans Fin.revOrderIso.equivalence).symm.counitInv.app
          (Opposite.op X_1)).unop


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{U : Set 𝕜}
(hf : MeromorphicOn f U)


/-- If `a` is an integer, then the `convs'` of its continued fraction expansion
are all equal to `a`.
-/
theorem convs'_of_int (a : ℤ) : (of (a : K)).convs' n = a

(K : Type u_1)
[LinearOrderedField K]
[FloorRing K]
(n : ℕ)
(a : ℤ)


theorem equiv_congr_left {y₁ y₂ : PGame} : (y₁ ≈ y₂) ↔ ∀ x₁, (x₁ ≈ y₁) ↔ (x₁ ≈ y₂)

y₁ ≈ y₂ ↔ ∀ (x₁ : SetTheory.PGame), x₁ ≈ y₁ ↔ x₁ ≈ y₂


theorem Bounded.mono_left {x y : α} (xy : x ≤ y) :
    ∀ {t : Ordnode α} {o}, Bounded t y o → Bounded t x o

{α : Type u_1}
[Preorder α]
{x y : α}
(xy : x ≤ y)
{t : Ordnode α}
{o : WithTop α}


lemma Iic_sup_erase (ha : a ∈ s) (has : ∀ b ∈ s, a ≤ b → b = a) : Iic a ⊔ s.erase a = s

{α : Type u_1}
[Preorder α]
{s : LowerSet α}
{a : α}
(ha : a ∈ s)
(has : ∀ b ∈ s, a ≤ b → b = a)


/-- A complex number `z` plus its conjugate `conj z` is `2` times its real part. -/
theorem re_eq_add_conj (z : ℂ) : (z.re : ℂ) = (z + conj z) / 2


theorem clog_antitone_left {n : ℕ} : AntitoneOn (fun b : ℕ => clog b n) (Set.Ioi 1)

AntitoneOn (fun b => Nat.clog b n) (Set.Ioi 1)


lemma odd_matches_node_outside {u : Set V} {c : ConnectedComponent (Subgraph.deleteVerts ⊤ u).coe}
    (hM : M.IsPerfectMatching) (codd : Odd (Nat.card c.supp)) :
    ∃ᵉ (w ∈ u) (v : ((⊤ : G.Subgraph).deleteVerts u).verts), M.Adj v w ∧ v ∈ c.supp

{c : (⊤.deleteVerts u).coe.ConnectedComponent}


/-- A positive multiple of a vector is in the same ray as one it is in the same ray as. -/
theorem pos_smul_left (h : SameRay R x y) (hr : 0 < a) : SameRay R (a • x) y

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x y : M}
{S : Type u_5}
[OrderedCommSemiring S]
[Algebra S R]
[Module S M]
[SMulPosMono S R]
[IsScalarTower S R M]
{a : S}
(h : SameRay R x y)
(hr : 0 < a)


theorem setToSimpleFunc_mono {T : Set α → G' →L[ℝ] G''} (h_add : FinMeasAdditive μ T)
    (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α →ₛ G'}
    (hfi : Integrable f μ) (hgi : Integrable g μ) (hfg : f ≤ g) :
    setToSimpleFunc T f ≤ setToSimpleFunc T g

(h_add : MeasureTheory.FinMeasAdditive μ T)

(hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x)

MeasureTheory.SimpleFunc.setToSimpleFunc T f ≤ MeasureTheory.SimpleFunc.setToSimpleFunc T g


theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] :
    IsNoetherian R P

{R : Type u_1}
(M : Type u_2)
{P : Type u_3}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid P]
[Module R M]
[Module R P]
(f : M →ₗ[R] P)
(hf : LinearMap.range f = ⊤)
[IsNoetherian R M]


@[to_additive (attr := continuity)]
theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a

{M : Type u_3}
[TopologicalSpace M]
[Add M]
[ContinuousAdd M]
(a : M)


@[fun_prop]
protected theorem ContinuousLinearMap.differentiableOn : DifferentiableOn 𝕜 e s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(e : E →L[𝕜] F)
{s : Set E}


@[simp, norm_cast]
theorem coe_toPair {a b : α} : (↑(Pair.mk a b) : Pair β) = Pair.mk (a : β) (b : β)

{α : Type u_1}
{β : Type u_2}
[Coe α β]
{a b : α}

↑{ a := a, b := b } = { a := Coe.coe a, b := Coe.coe b }


theorem uniformContinuous_map : UniformContinuous (Completion.map f)

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{f : α → β}


@[to_additive (attr := ext)]
theorem DivInvMonoid.ext {M : Type*} ⦃m₁ m₂ : DivInvMonoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M))
    (h_inv : (letI := m₁; Inv.inv : M → M) = (letI := m₂; Inv.inv : M → M)) : m₁ = m₂

{M : Type u_1}
⦃m₁ m₂ : SubNegMonoid M⦄
(h_mul : HAdd.hAdd = HAdd.hAdd)
(h_inv : Neg.neg = Neg.neg)


/-- A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`. -/
theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : ℕ} :
    ContDiffWithinAt 𝕜 (n + 1 : ℕ) f s x ↔ ∃ u ∈ 𝓝[insert x s] x, ∃ f' : E → E →L[𝕜] F,
      (∀ x ∈ u, HasFDerivWithinAt f (f' x) u x) ∧ ContDiffWithinAt 𝕜 n f' u x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ}

ContDiffWithinAt 𝕜 (↑(n + 1)) f s x ↔
  ∃ u ∈ 𝓝[insert x s] x, ∃ f', (∀ x ∈ u, HasFDerivWithinAt f (f' x) u x) ∧ ContDiffWithinAt 𝕜 (↑n) f' u x


/-- `primitiveRoots n K` is a subset of the roots of the minimal polynomial of a primitive
`n`-th root of unity `μ`. -/
theorem is_roots_of_minpoly [DecidableEq K] :
    primitiveRoots n K ⊆ (map (Int.castRingHom K) (minpoly ℤ μ)).roots.toFinset

{n : ℕ}
{K : Type u_1}
[CommRing K]
{μ : K}
(h : IsPrimitiveRoot μ n)
[IsDomain K]
[CharZero K]
[DecidableEq K]

primitiveRoots n K ⊆ (Polynomial.map (Int.castRingHom K) (minpoly ℤ μ)).roots.toFinset


@[reassoc (attr := simp)]
theorem pentagon_inv_inv_hom_inv_inv :
    (α_ W X (Y ⊗ Z)).inv ≫ (α_ (W ⊗ X) Y Z).inv ≫ (α_ W X Y).hom ▷ Z =
      W ◁ (α_ X Y Z).inv ≫ (α_ W (X ⊗ Y) Z).inv

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{W X Y Z : C}

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).inv
      (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.associator W X Y).hom Z)) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft W (CategoryTheory.MonoidalCategory.associator X Y Z).inv)
    (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).inv


theorem deriv_const_mul (c : 𝔸) (hd : DifferentiableAt 𝕜 d x) :
    deriv (fun y => c * d y) x = c * deriv d x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{d : 𝕜 → 𝔸}
(c : 𝔸)
(hd : DifferentiableAt 𝕜 d x)


theorem contMDiffOn_chart : ContMDiffOn I I n (chartAt H x) (chartAt H x).source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{x : M}
{n : ℕ∞}

ContMDiffOn I I n (↑(chartAt H x)) (chartAt H x).source


@[norm_cast] lemma num_coe (q : ℚ≥0) : (q : ℚ).num = q.num


@[to_additive]
theorem Integrable.comp_inv [IsInvInvariant μ] {f : G → F} (hf : Integrable f μ) :
    Integrable (fun t => f t⁻¹) μ

{G : Type u_4}
{F : Type u_6}
[MeasurableSpace G]
[NormedAddCommGroup F]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[MeasurableNeg G]
[μ.IsNegInvariant]
{f : G → F}
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (fun t => f (-t)) μ


/-- Let `g : γ → β` be an injective function and `f : β → α` be a function from the codomain of `g`
to a commutative monoid. Suppose that `f x = 1` outside of the range of `g`. Then the filters
`atTop.map (fun s ↦ ∏ i ∈ s, f (g i))` and `atTop.map (fun s ↦ ∏ i ∈ s, f i)` coincide.

The additive version of this lemma is used to prove the equality `∑' x, f (g x) = ∑' y, f y` under
the same assumptions. -/
@[to_additive]
theorem Function.Injective.map_atTop_finset_prod_eq [CommMonoid α] {g : γ → β}
    (hg : Function.Injective g) {f : β → α} (hf : ∀ x, x ∉ Set.range g → f x = 1) :
    map (fun s => ∏ i ∈ s, f (g i)) atTop = map (fun s => ∏ i ∈ s, f i) atTop

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddCommMonoid α]
{g : γ → β}
(hg : Function.Injective g)
{f : β → α}
(hf : ∀ x ∉ Set.range g, f x = 0)

Filter.map (fun s => ∑ i ∈ s, f (g i)) Filter.atTop = Filter.map (fun s => ∑ i ∈ s, f i) Filter.atTop


theorem disjoint_Ioi_Iio (a : α) : Disjoint (Ioi a) (Iio a)

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrderTop α]
[LocallyFiniteOrderBot α]
(a : α)


@[to_additive]
theorem ContMDiffWithinAt.mul (hf : ContMDiffWithinAt I' I n f s x)
    (hg : ContMDiffWithinAt I' I n g s x) : ContMDiffWithinAt I' I n (f * g) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
{x : M}
{n : ℕ∞}
(hf : ContMDiffWithinAt I' I n f s x)
(hg : ContMDiffWithinAt I' I n g s x)


/-- Noether's generalization of Hilbert's Theorem 90: given a finite extension of fields and a
function `f : Aut_K(L) → Lˣ` satisfying `f(gh) = g(f(h)) * f(g)` for all `g, h : Aut_K(L)`, there
exists `β : Lˣ` such that `g(β)/β = f(g)` for all `g : Aut_K(L).` -/
theorem isMulOneCoboundary_of_isMulOneCocycle_of_aut_to_units
    (f : (L ≃ₐ[K] L) → Lˣ) (hf : IsMulOneCocycle f) :
    IsMulOneCoboundary f

(hf : groupCohomology.IsMulOneCocycle f)


theorem isEquiv_iff_val_le_one [LinearOrderedCommGroupWithZero Γ₀]
    [LinearOrderedCommGroupWithZero Γ'₀] (v : Valuation K Γ₀) (v' : Valuation K Γ'₀) :
    v.IsEquiv v' ↔ ∀ {x : K}, v x ≤ 1 ↔ v' x ≤ 1

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedCommGroupWithZero Γ₀]
[LinearOrderedCommGroupWithZero Γ'₀]
(v : Valuation K Γ₀)
(v' : Valuation K Γ'₀)


theorem congrArg₂ (f : α → β → γ) {x x' : α} {y y' : β}
    (hx : x = x') (hy : y = y') : f x y = f x' y'

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(f : α → β → γ)
{x x' : α}
{y y' : β}
(hx : x = x')
(hy : y = y')


@[simp]
theorem comp_id_right (B : BilinForm R M) (l : M →ₗ[R] M) :
    B.comp l LinearMap.id = B.compLeft l

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(B : LinearMap.BilinForm R M)
(l : M →ₗ[R] M)


@[continuity]
theorem continuous_univBall (c : P) (r : ℝ) : Continuous (univBall c r)

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{P : Type u_2}
[PseudoMetricSpace P]
[NormedAddTorsor E P]
(c : P)
(r : ℝ)

Continuous ↑(PartialHomeomorph.univBall c r)


theorem arcsin_of_one_le {x : ℝ} (hx : 1 ≤ x) : arcsin x = π / 2


theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b

{V : Type u}
[Quiver V]
{a b : V}
(p : Quiver.Path a b)
(hzero : p.length = 0)


@[simp]
theorem cokernelCoforkOfCofork_ofπ {P : C} (π : Y ⟶ P) (w : f ≫ π = g ≫ π) :
    cokernelCoforkOfCofork (Cofork.ofπ π w) = CokernelCofork.ofπ π (by simp [w])

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{X Y : C}
{f g : X ⟶ Y}
{P : C}
(π : Y ⟶ P)
(w : f ≫ π = g ≫ π)

CategoryTheory.Preadditive.cokernelCoforkOfCofork (CategoryTheory.Limits.Cofork.ofπ π w) =
  CategoryTheory.Limits.CokernelCofork.ofπ π ⋯


/-- Natural identification to a `FiberBundleCore`. -/
@[simps (config := mfld_cfg)]
def toFiberBundleCore : FiberBundleCore ι B F

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)


theorem union_erase (a : α) (s₁ s₂ : AList β) : erase a (s₁ ∪ s₂) = erase a s₁ ∪ erase a s₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s₁ s₂ : AList β)

AList.erase a (s₁ ∪ s₂) = AList.erase a s₁ ∪ AList.erase a s₂


@[simp]
theorem mem_one {x : M} : x ∈ (1 : SubMulAction R M) ↔ ∃ r : R, r • (1 : M) = x

{R : Type u_1}
{M : Type u_2}
[Monoid R]
[MulAction R M]
[One M]
{x : M}


theorem areaForm_le (x y : E) : ω x y ≤ ‖x‖ * ‖y‖

[Fact (FiniteDimensional.finrank ℝ E = 2)]


theorem emod_lt (a : ℤ) {b : ℤ} (H : b ≠ 0) : a % b < |b|


@[to_additive]
theorem range_subset_insert_image_mulTSupport (f : X → α) :
    range f ⊆ insert 1 (f '' mulTSupport f)

{X : Type u_1}
{α : Type u_2}
[One α]
[TopologicalSpace X]
(f : X → α)

Set.range f ⊆ insert 1 (f '' mulTSupport f)


theorem pairwise_disjoint_on [SemilatticeInf α] [OrderBot α] [LinearOrder ι] (f : ι → α) :
    Pairwise (Disjoint on f) ↔ ∀ ⦃m n⦄, m < n → Disjoint (f m) (f n)

{α : Type u_1}
{ι : Type u_4}
[SemilatticeInf α]
[OrderBot α]
[LinearOrder ι]
(f : ι → α)

Pairwise (Disjoint on f) ↔ ∀ ⦃m n : ι⦄, m < n → Disjoint (f m) (f n)


@[to_additive (attr := simp)]
theorem MonoidHom.toOneHom_coe [MulOneClass M] [MulOneClass N] (f : M →* N) :
    (f.toOneHom : M → N) = f

{M : Type u_4}
{N : Type u_5}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)


@[simp]
theorem interior_setOf_le_re (a : ℝ) : interior { z : ℂ | a ≤ z.re } = { z | a < z.re }

interior {z | a ≤ z.re} = {z | a < z.re}


/-- Interpret a `RingEquiv` `f` as an `f`-semilinear equiv. -/
@[simps]
def _root_.RingEquiv.toSemilinearEquiv (f : R ≃+* S) :
    haveI := RingHomInvPair.of_ringEquiv f
    haveI := RingHomInvPair.symm (↑f : R →+* S) (f.symm : S →+* R)
    R ≃ₛₗ[(↑f : R →+* S)] S

{R : Type u_1}
{S : Type u_7}
[Semiring R]
[Semiring S]
(f : R ≃+* S)

∀ (a : S), f.toSemilinearEquiv.symm a = f.invFun a


@[simp]
theorem toNatOrdinal_eq_zero (a) : toNatOrdinal a = 0 ↔ a = 0


@[to_additive]
theorem mul_inv_lt_inv_mul_iff : a * b⁻¹ < d⁻¹ * c ↔ d * a < c * b

[CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1]

[CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x < x_1]


@[simp]
theorem toFinsupp_add (a b : R[X]) : (a + b).toFinsupp = a.toFinsupp + b.toFinsupp


theorem ne_mex {ι : Type u} (f : ι → Ordinal.{max u v}) : ∀ i, f i ≠ mex.{_, v} f

{ι : Type u}
(f : ι → Ordinal.{max u v})
(i : ι)


theorem piCongrLeft'_symm_update [DecidableEq α] [DecidableEq β] (P : α → Sort*) (e : α ≃ β)
    (f : ∀ b, P (e.symm b)) (b : β) (x : P (e.symm b)) :
    (e.piCongrLeft' P).symm (update f b x) = update ((e.piCongrLeft' P).symm f) (e.symm b) x

{α : Sort u_2}
{β : Sort u_3}
[DecidableEq α]
[DecidableEq β]
(P : α → Sort u_1)
(e : α ≃ β)
(f : (b : β) → P (e.symm b))
(b : β)
(x : P (e.symm b))

(Equiv.piCongrLeft' P e).symm (Function.update f b x) = Function.update ((Equiv.piCongrLeft' P e).symm f) (e.symm b) x


/-- One implication of the portmanteau theorem:
Assuming that for all Borel sets E whose boundary ∂E carries no probability mass under a
candidate limit probability measure μ we have convergence of the measures μsᵢ(E) to μ(E),
then for all open sets G we have the limsup condition μ(G) ≤ liminf μsᵢ(G). -/
lemma le_liminf_measure_open_of_forall_tendsto_measure
    {Ω ι : Type*} {L : Filter ι} [NeBot L]
    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ {E}, MeasurableSet E → μ (frontier E) = 0 → Tendsto (fun i ↦ μs i E) L (𝓝 (μ E)))
    (G : Set Ω) (G_open : IsOpen G) :
    μ G ≤ L.liminf (fun i ↦ μs i G)

[∀ (i : ι), MeasureTheory.IsProbabilityMeasure (μs i)]

(h : ∀ {E : Set Ω}, MeasurableSet E → μ (frontier E) = 0 → Filter.Tendsto (fun i => (μs i) E) L (𝓝 (μ E)))

μ G ≤ Filter.liminf (fun i => (μs i) G) L


theorem mk_lf {xl xr} (xL : xl → PGame) (xR : xr → PGame) (j) : mk xl xr xL xR ⧏ xR j

{xl xr : Type u_1}
(xL : xl → SetTheory.PGame)
(xR : xr → SetTheory.PGame)
(j : xr)

(SetTheory.PGame.mk xl xr xL xR).LF (xR j)


@[elab_as_elim] theorem gcd.induction {P : Nat → Nat → Prop} (m n : Nat)
    (H0 : ∀n, P 0 n) (H1 : ∀ m n, 0 < m → P (n % m) m → P m n) : P m n

(H1 : ∀ (m n : Nat), 0 < m → P (n % m) m → P m n)


theorem restrict_Ico_eq_restrict_Ioc : μ.restrict (Ico a b) = μ.restrict (Ioc a b)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.NoAtoms μ]
[PartialOrder α]
{a b : α}

μ.restrict (Set.Ico a b) = μ.restrict (Set.Ioc a b)


/-- When both maps `S.f` and `S.g` of a short complex `S` are zero, this is the homology map
data (for the identity of `S`) which relates the homology data
`HomologyData.ofIsLimitKernelFork` and `ofZeros` . -/
@[simps]
def compatibilityOfZerosOfIsLimitKernelFork (hf : S.f = 0) (hg : S.g = 0)
    (c : KernelFork S.g) (hc : IsLimit c) :
    HomologyMapData (𝟙 S)
      (HomologyData.ofIsLimitKernelFork S hf c hc)
      (HomologyData.ofZeros S hf hg)

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.HomologyMapData.compatibilityOfZerosOfIsLimitKernelFork hf hg c hc).right =
  CategoryTheory.ShortComplex.RightHomologyMapData.compatibilityOfZerosOfIsLimitKernelFork S hf hg c hc


{α : Type u_2}
[SemilatticeInf α]
{s : Set α}


/-- Multiplying by all the matrices in `listTransvecCol M` does not change the last row. -/
theorem listTransvecCol_mul_last_row (i : Fin r ⊕ Unit) :
    ((listTransvecCol M).prod * M) (inr unit) i = M (inr unit) i

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

((Matrix.Pivot.listTransvecCol M).prod * M) (Sum.inr ()) i = M (Sum.inr ()) i


@[simp]
theorem bliminf_sup_le_inf_aux_right :
    (blimsup u f fun x => p x ∧ q x) ≤ blimsup u f q

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}

(Filter.blimsup u f fun x => p x ∧ q x) ≤ Filter.blimsup u f q


@[simp, mfld_simps]
theorem refl_target : (PartialEquiv.refl α).target = univ


@[simp]
theorem coe_coe : ⇑(e : E ≃SL[σ₁₂] E₂) = e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)

⇑{ toLinearEquiv := e.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ } = ⇑e


protected theorem IntegrableAtFilter.eventually (h : IntegrableAtFilter f l μ) :
    ∀ᶠ s in l.smallSets, IntegrableOn f s μ

(h : MeasureTheory.IntegrableAtFilter f l μ)

∀ᶠ (s : Set α) in l.smallSets, MeasureTheory.IntegrableOn f s μ


/-- The `RingHom` between spaces of square matrices induced by a `RingHom` between their
coefficients. This is `Matrix.map` as a `RingHom`. -/
@[simps]
def mapMatrix (f : α →+* β) : Matrix m m α →+* Matrix m m β

{m : Type u_2}
{α : Type v}
{β : Type w}
[Fintype m]
[DecidableEq m]
[NonAssocSemiring α]
[NonAssocSemiring β]
(f : α →+* β)
(M : Matrix m m α)


@[simp]
theorem run_pure (a) : (pure a : OptionT m α).run = pure (some a)

{α : Type u}
{m : Type u → Type v}
[Monad m]
(a : α)


/-- The integral of the conditional expectation `μ[f|hm]` over an `m`-measurable set is equal to
the integral of `f` on that set. -/
theorem setIntegral_condexp (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ)
    (hs : MeasurableSet[m] s) : ∫ x in s, (μ[f|m]) x ∂μ = ∫ x in s, f x ∂μ

{α : Type u_1}
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → F'}
{s : Set α}
(hm : m ≤ m0)
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hf : MeasureTheory.Integrable f μ)
(hs : MeasurableSet s)

∫ (x : α) in s, (μ[f|m]) x ∂μ = ∫ (x : α) in s, f x ∂μ


/-- The natural homeomorphism between nonzero elements of a normed space `E`
and `Metric.sphere (0 : E) 1 × Set.Ioi (0 : ℝ)`.

The forward map sends `⟨x, hx⟩` to `⟨‖x‖⁻¹ • x, ‖x‖⟩`,
the inverse map sends `(x, r)` to `r • x`.

One may think about it as generalization of polar coordinates to any normed space. -/
@[simps apply_fst_coe apply_snd_coe symm_apply_coe]
noncomputable def homeomorphUnitSphereProd :
    ({0}ᶜ : Set E) ≃ₜ (sphere (0 : E) 1 × Ioi (0 : ℝ))

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(x : ↑{0}ᶜ)

↑((homeomorphUnitSphereProd E) x).1 = ‖↑x‖⁻¹ • ↑x


@[reassoc]
theorem Trident.condition (j₁ j₂ : J) (t : Trident f) : t.ι ≫ f j₁ = t.ι ≫ f j₂

{J : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : J → (X ⟶ Y)}
(j₁ j₂ : J)
(t : CategoryTheory.Limits.Trident f)

CategoryTheory.CategoryStruct.comp t.ι (f j₁) = CategoryTheory.CategoryStruct.comp t.ι (f j₂)


/-- A bijective morphism of Lie algebras yields an equivalence of Lie algebras. -/
@[simps!]
noncomputable def ofBijective (f : L₁ →ₗ⁅R⁆ L₂) (h : Function.Bijective f) : L₁ ≃ₗ⁅R⁆ L₂

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
(f : L₁ →ₗ⁅R⁆ L₂)
(h : Function.Bijective ⇑f)
(a : L₁)


lemma locallyRingedSpaceAdjunction_unit :
    locallyRingedSpaceAdjunction.unit = identityToΓSpec


@[simp]
theorem coeff_mul_degree_add_degree (p q : R[X]) :
    coeff (p * q) (natDegree p + natDegree q) = leadingCoeff p * leadingCoeff q

(p * q).coeff (p.natDegree + q.natDegree) = p.leadingCoeff * q.leadingCoeff


theorem cons_dotProduct_cons (x : α) (v : Fin n → α) (y : α) (w : Fin n → α) :
    dotProduct (vecCons x v) (vecCons y w) = x * y + dotProduct v w

{α : Type u}
{n : ℕ}
[AddCommMonoid α]
[Mul α]
(x : α)
(v : Fin n → α)
(y : α)
(w : Fin n → α)

Matrix.dotProduct (Matrix.vecCons x v) (Matrix.vecCons y w) = x * y + Matrix.dotProduct v w


@[simp]
theorem NonlinearRightInverse.right_inv {f : E →SL[σ] F} (fsymm : NonlinearRightInverse f) (y : F) :
    f (fsymm y) = y

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
{f : E →SL[σ] F}
(fsymm : f.NonlinearRightInverse)
(y : F)


@[norm_cast]
theorem coe_inj {f g : LocallyConstant X Y} : (f : X → Y) = g ↔ f = g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{f g : LocallyConstant X Y}


lemma Exact.unop {S : ShortComplex Cᵒᵖ} (h : S.Exact) : S.unop.Exact


theorem exists_norm_eq {c : ℝ} (hc : 0 ≤ c) : ∃ x : E, ‖x‖ = c

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Nontrivial E]
{c : ℝ}
(hc : 0 ≤ c)


@[simp] theorem getLeft?_inr : (inr x : α ⊕ β).getLeft? = none


theorem updateColumn_submatrix_equiv [DecidableEq o] [DecidableEq n] (A : Matrix m n α) (j : o)
    (c : l → α) (e : l ≃ m) (f : o ≃ n) : updateColumn (A.submatrix e f) j c =
    (A.updateColumn (f j) fun i => c (e.symm i)).submatrix e f

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[DecidableEq o]
[DecidableEq n]
(A : Matrix m n α)
(j : o)
(c : l → α)
(e : l ≃ m)
(f : o ≃ n)

(A.submatrix ⇑e ⇑f).updateColumn j c = (A.updateColumn (f j) fun i => c (e.symm i)).submatrix ⇑e ⇑f


theorem Monic.sub_of_left {p q : R[X]} (hp : Monic p) (hpq : degree q < degree p) :
    Monic (p - q)

{R : Type u}
[Ring R]
{p q : R[X]}
(hp : p.Monic)
(hpq : q.degree < p.degree)


@[to_additive (attr := simp, norm_cast)]
theorem coe_prod {ι : Type*} (s : Finset ι) (f : ι → Finset α) :
    ↑(∏ i ∈ s, f i) = ∏ i ∈ s, (f i : Set α)

{α : Type u_2}
[DecidableEq α]
[AddCommMonoid α]
{ι : Type u_5}
(s : Finset ι)
(f : ι → Finset α)


theorem rightAngleRotation_map {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F]
    [hF : Fact (finrank ℝ F = 2)] (φ : E ≃ₗᵢ[ℝ] F) (x : F) :
    (Orientation.map (Fin 2) φ.toLinearEquiv o).rightAngleRotation x =
      φ (o.rightAngleRotation (φ.symm x))

[Fact (FiniteDimensional.finrank ℝ E = 2)]

[hF : Fact (FiniteDimensional.finrank ℝ F = 2)]

((Orientation.map (Fin 2) φ.toLinearEquiv) o).rightAngleRotation x = φ (o.rightAngleRotation (φ.symm x))


protected theorem ContinuousLinearEquiv.map_tsum [T2Space M] [T2Space M₂] {f : ι → M}
    (e : M ≃SL[σ] M₂) : e (∑' z, f z) = ∑' z, e (f z)

{ι : Type u_5}
{R : Type u_7}
{R₂ : Type u_8}
{M : Type u_9}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M₂]
[Module R₂ M₂]
[TopologicalSpace M]
[TopologicalSpace M₂]
{σ : R →+* R₂}
{σ' : R₂ →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[T2Space M]
[T2Space M₂]
{f : ι → M}
(e : M ≃SL[σ] M₂)


/-- Given a `(m × m)` diagonal matrix defined by a map `d : m → α`, if the reindexing map `e` is
  injective, then the resulting matrix is again diagonal. -/
theorem submatrix_diagonal [Zero α] [DecidableEq m] [DecidableEq l] (d : m → α) (e : l → m)
    (he : Function.Injective e) : (diagonal d).submatrix e e = diagonal (d ∘ e)

{l : Type u_1}
{m : Type u_2}
{α : Type v}
[Zero α]
[DecidableEq m]
[DecidableEq l]
(d : m → α)
(e : l → m)
(he : Function.Injective e)

(Matrix.diagonal d).submatrix e e = Matrix.diagonal (d ∘ e)


/-- The region between two a.e.-measurable functions on a null-measurable set is null-measurable;
a version for the region together with the graph of the upper function. -/
lemma nullMeasurableSet_region_between_oc (μ : Measure α)
    {f g : α → ℝ} (f_mble : AEMeasurable f μ) (g_mble : AEMeasurable g μ)
    {s : Set α} (s_mble : NullMeasurableSet s μ) :
    NullMeasurableSet {p : α × ℝ | p.1 ∈ s ∧ p.snd ∈ Ioc (f p.fst) (g p.fst)} (μ.prod volume)

(s_mble : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet {p | p.1 ∈ s ∧ p.2 ∈ Set.Ioc (f p.1) (g p.1)} (μ.prod MeasureTheory.volume)


theorem closure_ball (x : E) {r : ℝ} (hr : r ≠ 0) : closure (ball x r) = closedBall x r

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(x : E)
{r : ℝ}
(hr : r ≠ 0)

closure (Metric.ball x r) = Metric.closedBall x r


theorem antilipschitzWith_iff_le_mul_dist :
    AntilipschitzWith K f ↔ ∀ x y, dist x y ≤ K * dist (f x) (f y)

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}

AntilipschitzWith K f ↔ ∀ (x y : α), dist x y ≤ ↑K * dist (f x) (f y)


theorem radical_eq_sInf (I : Ideal R) : radical I = sInf { J : Ideal R | I ≤ J ∧ IsPrime J }

{R : Type u}
[CommSemiring R]
(I : Ideal R)

I.radical = sInf {J | I ≤ J ∧ J.IsPrime}


theorem locallyIntegrable_iff [LocallyCompactSpace X] :
    LocallyIntegrable f μ ↔ ∀ k : Set X, IsCompact k → IntegrableOn f k μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[LocallyCompactSpace X]

MeasureTheory.LocallyIntegrable f μ ↔ ∀ (k : Set X), IsCompact k → MeasureTheory.IntegrableOn f k μ


theorem Injective.comp_injOn (hg : Injective g) (hf : s.InjOn f) : s.InjOn (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{g : β → γ}
{s : Set α}
(hg : Function.Injective g)
(hf : Set.InjOn f s)


lemma quasispectrum_eq_spectrum_inr (R : Type*) {A : Type*} [CommRing R] [Ring A]
    [Algebra R A] (a : A) : quasispectrum R a = spectrum R (a : Unitization R A)

(R : Type u_3)
{A : Type u_4}
[CommRing R]
[Ring A]
[Algebra R A]
(a : A)


theorem ContinuousMultilinearMap.curry0_uncurry0 (x : G') :
    (ContinuousMultilinearMap.curry0 𝕜 G x).uncurry0 = x

(𝕜 : Type u)
(G : Type wG)
{G' : Type wG'}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[NormedAddCommGroup G']
[NormedSpace 𝕜 G']
(x : G')


theorem associated_one_of_mul_eq_one [CommMonoid α] {a : α} (b : α) (hab : a * b = 1) : a ~ᵤ 1

{α : Type u_1}
[CommMonoid α]
{a : α}
(b : α)
(hab : a * b = 1)


theorem smoothWithinAt_snd {s : Set (M × N)} {p : M × N} :
    SmoothWithinAt (I.prod J) J Prod.snd s p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{s : Set (M × N)}
{p : M × N}


@[simp]
theorem inseparable_pi {f g : ∀ i, π i} : (f ~ᵢ g) ↔ ∀ i, f i ~ᵢ g i

{ι : Type u_5}
{π : ι → Type u_6}
[(i : ι) → TopologicalSpace (π i)]
{f g : (i : ι) → π i}


protected theorem ContDiffOn.fderivWithin (hf : ContDiffOn 𝕜 n f s) (hs : UniqueDiffOn 𝕜 s)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (fun y => fderivWithin 𝕜 f s y) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{m n : ℕ∞}
(hf : ContDiffOn 𝕜 n f s)
(hs : UniqueDiffOn 𝕜 s)
(hmn : m + 1 ≤ n)


lemma smul_nonpos_iff_neg_imp_nonneg : a • b ≤ 0 ↔ (a < 0 → 0 ≤ b) ∧ (0 < b → a ≤ 0)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[PosSMulStrictMono α β]
{a : α}
{b : β}


/-- The pushforward of a measure. It is defined to be `0` if `f` is not an almost everywhere
measurable function. -/
irreducible_def map [MeasurableSpace α] (f : α → β) (μ : Measure α) : Measure β

{α : Type u_8}
{β : Type u_9}
[MeasurableSpace β]
[MeasurableSpace α]
(f : α → β)
(μ : MeasureTheory.Measure α)

MeasureTheory.Measure.map f μ =
  if hf : AEMeasurable f μ then (MeasureTheory.Measure.mapₗ (AEMeasurable.mk f hf)) μ else 0


@[simp]
theorem erase_cons_tail {a b : α} (s : Multiset α) (h : b ≠ a) :
    (b ::ₘ s).erase a = b ::ₘ s.erase a

{α : Type u_1}
[DecidableEq α]
{a b : α}
(s : Multiset α)
(h : b ≠ a)


/-- A version of `WithTop.map` for `AddMonoidHom`s. -/
@[simps (config := .asFn)]
protected def _root_.AddMonoidHom.withTopMap {M N : Type*} [AddZeroClass M] [AddZeroClass N]
    (f : M →+ N) : WithTop M →+ WithTop N

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)


/-- An angle in a right-angled triangle expressed using `arccos`, version subtracting vectors. -/
theorem angle_sub_eq_arccos_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    angle x (x - y) = Real.arccos (‖x‖ / ‖x - y‖)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

InnerProductGeometry.angle x (x - y) = Real.arccos (‖x‖ / ‖x - y‖)


@[to_additive]
theorem eq_iff_eq (g : LocalizationMap S P) {x y} : f.toMap x = f.toMap y ↔ g.toMap x = g.toMap y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
(g : S.LocalizationMap P)
{x y : M}


lemma addMonoidHom_comp_eq_zero (h : Exact f g) : g.comp f = 0

{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
[AddGroup M]
[AddGroup N]
[AddGroup P]
{f : M →+ N}
{g : N →+ P}
(h : Function.Exact ⇑f ⇑g)


@[to_additive]
protected theorem MulHom.map_mul [Mul M] [Mul N] (f : M →ₙ* N) (a b : M) : f (a * b) = f a * f b

{M : Type u_4}
{N : Type u_5}
[Add M]
[Add N]
(f : AddHom M N)
(a b : M)


theorem continuousWithinAt_congr_nhds {f : α → β} {s t : Set α} {x : α} (h : 𝓝[s] x = 𝓝[t] x) :
    ContinuousWithinAt f s x ↔ ContinuousWithinAt f t x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s t : Set α}
{x : α}
(h : 𝓝[s] x = 𝓝[t] x)


lemma cfcₙHom_of_cfcHom_map_quasispectrum {a : A} (ha : p a) :
    ∀ f : C(σₙ R a, R)₀, σₙ R (cfcₙHom_of_cfcHom R ha f) = range f

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[Field R]
[StarRing R]
[MetricSpace R]
[TopologicalRing R]
[ContinuousStar R]
[Ring A]
[StarRing A]
[TopologicalSpace A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
{a : A}
(ha : p a)
(f : C(↑(σₙ R a), R)₀)

σₙ R ((cfcₙHom_of_cfcHom R ha) f) = Set.range ⇑f


theorem ιMulti_apply {n : ℕ} (v : Fin n → M) : ιMulti R n v = (List.ofFn fun i => ι R (v i)).prod

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{n : ℕ}
(v : Fin n → M)

(ExteriorAlgebra.ιMulti R n) v = (List.ofFn fun i => (ExteriorAlgebra.ι R) (v i)).prod


@[to_additive]
theorem closure_eq_of_le (h₁ : s ⊆ S) (h₂ : S ≤ closure s) : closure s = S

{M : Type u_1}
[AddZeroClass M]
{s : Set M}
{S : AddSubmonoid M}
(h₁ : s ⊆ ↑S)
(h₂ : S ≤ AddSubmonoid.closure s)


@[simp] lemma monovary_inv_right₀ (hg : StrongLT 0 g) : Monovary f g⁻¹ ↔ Antivary f g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{f : ι → α}
{g : ι → β}
(hg : StrongLT 0 g)


theorem tendsto_atTop_ciInf (h_anti : Antitone f) (hbdd : BddBelow <| range f) :
    Tendsto f atTop (𝓝 (⨅ i, f i))

{α : Type u_1}
{ι : Type u_3}
[Preorder ι]
[TopologicalSpace α]
[ConditionallyCompleteLattice α]
[InfConvergenceClass α]
{f : ι → α}
(h_anti : Antitone f)
(hbdd : BddBelow (Set.range f))

Filter.Tendsto f Filter.atTop (𝓝 (⨅ i, f i))


@[reassoc]
lemma mapComp_assoc_left_hom {c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) :
    (F.mapComp (f ≫ g) h).hom ≫ (F.mapComp f g).hom ▷ F.map h =
    F.map₂ (α_ f g h).hom ≫ (F.mapComp f (g ≫ h)).hom ≫ F.map f ◁ (F.mapComp g h).hom
    ≫ (α_ (F.map f) (F.map g) (F.map h)).inv

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)
{a b c d : B}
(f : a ⟶ b)
(g : b ⟶ c)
(h : c ⟶ d)

CategoryTheory.CategoryStruct.comp (F.mapComp (CategoryTheory.CategoryStruct.comp f g) h).hom
    (CategoryTheory.Bicategory.whiskerRight (F.mapComp f g).hom (F.map h)) =
  CategoryTheory.CategoryStruct.comp (F.map₂ (CategoryTheory.Bicategory.associator f g h).hom)
    (CategoryTheory.CategoryStruct.comp (F.mapComp f (CategoryTheory.CategoryStruct.comp g h)).hom
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (F.map f) (F.mapComp g h).hom)
        (CategoryTheory.Bicategory.associator (F.map f) (F.map g) (F.map h)).inv))


lemma iSup_countableFiltration (α : Type*) [m : MeasurableSpace α] [CountablyGenerated α] :
    ⨆ n, countableFiltration α n = m

(α : Type u_2)
[m : MeasurableSpace α]
[MeasurableSpace.CountablyGenerated α]

⨆ n, ↑(ProbabilityTheory.countableFiltration α) n = m


/-- Class that expresses that a ring homomorphism is in fact the identity. -/
-- This at first seems not very useful. However we need this when considering
-- modules over some diagram in the category of rings,
-- e.g. when defining presheaves over a presheaf of rings.
-- See `Mathlib.Algebra.Category.ModuleCat.Presheaf`.
class RingHomId {R : Type*} [Semiring R] (σ : R →+* R) : Prop where
  eq_id : σ = RingHom.id R

{R : Type u_4}
[Semiring R]
{σ : R →+* R}
[self : RingHomId σ]


theorem valMinAbs_spec {n : ℕ} [NeZero n] (x : ZMod n) (y : ℤ) :
    x.valMinAbs = y ↔ x = y ∧ y * 2 ∈ Set.Ioc (-n : ℤ) n

x.valMinAbs = y ↔ x = ↑y ∧ y * 2 ∈ Set.Ioc (-↑n) ↑n


@[simp]
theorem norm_mul (a b : α) : ‖a * b‖ = ‖a‖ * ‖b‖

{α : Type u_1}
[NormedDivisionRing α]
(a b : α)


/-- The infimum distance is invariant under isometries. -/
theorem infDist_image (hΦ : Isometry Φ) : infDist (Φ x) (Φ '' t) = infDist x t

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{t : Set α}
{x : α}
{Φ : α → β}
(hΦ : Isometry Φ)

Metric.infDist (Φ x) (Φ '' t) = Metric.infDist x t


/-- For nonzero `I, I'`, `val_v(I*I') = val_v(I) + val_v(I')`. If `I` or `I'` is zero, then
`val_v(I*I') = 0`. -/
theorem count_mul' (I I' : FractionalIdeal R⁰ K) :
    count K v (I * I') = if I ≠ 0 ∧ I' ≠ 0 then count K v I + count K v I' else 0

(v : IsDedekindDomain.HeightOneSpectrum R)

FractionalIdeal.count K v (I * I') =
  if I ≠ 0 ∧ I' ≠ 0 then FractionalIdeal.count K v I + FractionalIdeal.count K v I' else 0


@[simp]
theorem cons_subset {a : α} {s t : Multiset α} : a ::ₘ s ⊆ t ↔ a ∈ t ∧ s ⊆ t

{α : Type u_1}
{a : α}
{s t : Multiset α}


theorem coe_ne_one (z : 𝔻) : (z : ℂ) ≠ 1


@[simp]
lemma mkHomFromSingle_f {K : HomologicalComplex V c} {j : ι} {A : V} (φ : A ⟶ K.X j)
    (hφ : ∀ (k : ι), c.Rel j k → φ ≫ K.d j k = 0) :
    (mkHomFromSingle φ hφ).f j = (singleObjXSelf c j A).hom ≫ φ

(HomologicalComplex.mkHomFromSingle φ hφ).f j = (HomologicalComplex.singleObjXSelf c j A).hom ≫ φ


theorem one_le_count_iff_mem {a : α} {s : Multiset α} : 1 ≤ count a s ↔ a ∈ s

{α : Type u_1}
[DecidableEq α]
{a : α}
{s : Multiset α}


/-- Composition with a fixed additive homomorphism is itself an additive homomorphism on functions.
-/
@[simps]
def mapRange.addMonoidHom (f : M →+ N) : (α →₀ M) →+ α →₀ N

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
(f : M →+ N)
(g : α →₀ M)

(Finsupp.mapRange.addMonoidHom f) g = Finsupp.mapRange ⇑f ⋯ g


@[simp]
theorem support_integralNormalization {f : R[X]} :
    (integralNormalization f).support = f.support

{R : Type u}
[Ring R]
[IsDomain R]
{f : R[X]}


theorem minimum_ne_top_of_length_pos (h : 0 < l.length) : l.minimum ≠ ⊤

{α : Type u_1}
[LinearOrder α]
{l : List α}
(h : 0 < l.length)


theorem sl_non_abelian [Fintype n] [Nontrivial R] (h : 1 < Fintype.card n) :
    ¬IsLieAbelian (sl n R)

(n : Type u_1)
(R : Type u₂)
[DecidableEq n]
[CommRing R]
[Fintype n]
[Nontrivial R]
(h : 1 < Fintype.card n)

¬IsLieAbelian ↥(LieAlgebra.SpecialLinear.sl n R)


@[simp]
theorem mul_le_mul_right [MulPosMono α] [MulPosReflectLE α] (a0 : 0 < a) : b * a ≤ c * a ↔ b ≤ c

{α : Type u_1}
{a b c : α}
[Mul α]
[Zero α]
[Preorder α]
[MulPosMono α]
[MulPosReflectLE α]
(a0 : 0 < a)


@[to_additive]
theorem comap_comap (S : Submonoid P) (g : N →* P) (f : M →* N) :
    (S.comap g).comap f = S.comap (g.comp f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(S : AddSubmonoid P)
(g : N →+ P)
(f : M →+ N)

AddSubmonoid.comap f (AddSubmonoid.comap g S) = AddSubmonoid.comap (g.comp f) S


@[simp]
theorem withDensitySMulLI_apply {f : α → ℝ≥0} (f_meas : Measurable f)
    (u : Lp E 1 (μ.withDensity fun x => f x)) :
    withDensitySMulLI μ (E := E) f_meas u =
      (memℒ1_smul_of_L1_withDensity f_meas u).toLp fun x => f x • u x

(u : ↥(MeasureTheory.Lp E 1 (μ.withDensity fun x => ↑(f x))))

(MeasureTheory.withDensitySMulLI μ f_meas) u = MeasureTheory.Memℒp.toLp (fun x => f x • ↑↑u x) ⋯


theorem UpperSemicontinuous.isClosed_preimage {f : α → γ} (hf : UpperSemicontinuous f) (y : γ) :
    IsClosed (f ⁻¹' Ici y)

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[LinearOrder γ]
{f : α → γ}
(hf : UpperSemicontinuous f)
(y : γ)


@[simp]
theorem inclusionOfMooreComplexMap_f (X : SimplicialObject A) (n : ℕ) :
    (inclusionOfMooreComplexMap X).f n = (NormalizedMooreComplex.objX X n).arrow

{A : Type u_2}
[CategoryTheory.Category.{u_3, u_2} A]
[CategoryTheory.Abelian A]
(X : CategoryTheory.SimplicialObject A)
(n : ℕ)

(AlgebraicTopology.inclusionOfMooreComplexMap X).f n = (AlgebraicTopology.NormalizedMooreComplex.objX X n).arrow


theorem functorPushforward_monotone (X : C) :
    Monotone (Sieve.functorPushforward F : Sieve X → Sieve (F.obj X))

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
(X : C)


/-- The trivial factorisation of a monomorphism satisfies the universal property. -/
@[simps]
def self [Mono f] : IsImage (MonoFactorisation.self f)

(F' : CategoryTheory.Limits.MonoFactorisation f)

(CategoryTheory.Limits.IsImage.self f).lift F' = F'.e


theorem pointwise_smul_le_iff {a : α} {S T : AddSubgroup A} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{α : Type u_1}
{A : Type u_3}
[AddGroup A]
[Group α]
[DistribMulAction α A]
{a : α}
{S T : AddSubgroup A}

a • S ≤ T ↔ S ≤ a⁻¹ • T


theorem iSup_ge_eq_iSup_nat_add (u : ℕ → α) (n : ℕ) : ⨆ i ≥ n, u i = ⨆ i, u (i + n)

{α : Type u_1}
[CompleteLattice α]
(u : ℕ → α)
(n : ℕ)

⨆ i, ⨆ (_ : i ≥ n), u i = ⨆ i, u (i + n)


lemma card_box : ∀ {n}, n ≠ 0 → (box n : Finset (ℤ × ℤ)).card = 8 * n


@[to_additive (attr := simp)]
theorem map_subtype_le_map_subtype {G' : Subgroup G} {H K : Subgroup G'} :
    H.map G'.subtype ≤ K.map G'.subtype ↔ H ≤ K

{G : Type u_1}
[AddGroup G]
{G' : AddSubgroup G}
{H K : AddSubgroup ↥G'}

AddSubgroup.map G'.subtype H ≤ AddSubgroup.map G'.subtype K ↔ H ≤ K


theorem support_sub [DecidableEq α] [AddGroup G] {f g : α →₀ G} :
    support (f - g) ⊆ support f ∪ support g

{α : Type u_1}
{G : Type u_9}
[DecidableEq α]
[AddGroup G]
{f g : α →₀ G}


@[simp]
theorem descFactorial_zero (n : ℕ) : n.descFactorial 0 = 1


@[simp]
theorem preimage_coe_Iio : (some : α → WithTop α) ⁻¹' Iio a = Iio a


@[to_additive (attr := simp)]
theorem subsingleton_iff : Subsingleton (Subgroup G) ↔ Subsingleton G


/-- A linear isometric equivalence, applied with `Basis.map`, preserves the property of being
orthonormal. -/
theorem Orthonormal.mapLinearIsometryEquiv {v : Basis ι 𝕜 E} (hv : Orthonormal 𝕜 v)
    (f : E ≃ₗᵢ[𝕜] E') : Orthonormal 𝕜 (v.map f.toLinearEquiv)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
{v : Basis ι 𝕜 E}
(hv : Orthonormal 𝕜 ⇑v)
(f : E ≃ₗᵢ[𝕜] E')


/-- For an Abelian Lie algebra, characters are just linear forms. -/
@[simps! apply symm_apply]
def lieCharacterEquivLinearDual [IsLieAbelian L] : LieCharacter R L ≃ Module.Dual R L

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[IsLieAbelian L]
(χ : LieAlgebra.LieCharacter R L)

LieAlgebra.lieCharacterEquivLinearDual χ = ↑χ


/-- The supremum of two congruence relations equals the smallest congruence relation containing
    the supremum of the underlying binary operations. -/
@[to_additive "The supremum of two additive congruence relations equals the smallest additive
congruence relation containing the supremum of the underlying binary operations."]
theorem sup_def {c d : Con M} : c ⊔ d = conGen (⇑c ⊔ ⇑d)


theorem indepSet_empty_left {_mΩ : MeasurableSpace Ω} {κ : Kernel α Ω}
    {μ : Measure α} [IsMarkovKernel κ] (s : Set Ω) :
    IndepSet ∅ s κ μ

{α : Type u_1}
{Ω : Type u_2}
{_mα : MeasurableSpace α}
{_mΩ : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μ : MeasureTheory.Measure α}
[ProbabilityTheory.IsMarkovKernel κ]
(s : Set Ω)

ProbabilityTheory.Kernel.IndepSet ∅ s κ μ


@[simp]
theorem mem_univ [Inhabited α] : ∀ a, a ∈ @univ α _


/-- The localizer morphism from `W₁.arrow` to `W₂.arrow` that is induced by
`Φ : LocalizerMorphism W₁ W₂`. -/
@[simps]
def arrow : LocalizerMorphism W₁.arrow W₂.arrow

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)


@[to_additive]
theorem relindex_eq_zero_of_le_right (hKL : K ≤ L) (hHK : H.relindex K = 0) : H.relindex L = 0

{G : Type u_1}
[AddGroup G]
{H K L : AddSubgroup G}
(hKL : K ≤ L)
(hHK : H.relindex K = 0)


/-- An ideal `I` of `R` is equal to its Jacobson radical if and only if
the Jacobson radical of the quotient ring `R/I` is the zero ideal -/
-- Porting note: changed `Quotient.mk'` to ``
theorem jacobson_eq_iff_jacobson_quotient_eq_bot :
    I.jacobson = I ↔ jacobson (⊥ : Ideal (R ⧸ I)) = ⊥


lemma rTensorAlgHom_apply_eq (p : MvPolynomial σ S ⊗[R] N) :
    rTensorAlgHom (S := S) p = rTensor p

(p : TensorProduct R (MvPolynomial σ S) N)

MvPolynomial.rTensorAlgHom p = MvPolynomial.rTensor p


theorem det_traceForm_ne_zero [Algebra.IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0

{K : Type u_4}
{L : Type u_5}
[Field K]
[Field L]
[Algebra K L]
{ι : Type w}
[Fintype ι]
[Algebra.IsSeparable K L]
[DecidableEq ι]
(b : Basis ι K L)

((BilinForm.toMatrix b) (Algebra.traceForm K L)).det ≠ 0


lemma tilted_apply' (μ : Measure α) (f : α → ℝ) {s : Set α} (hs : MeasurableSet s) :
    μ.tilted f s = ∫⁻ a in s, ENNReal.ofReal (exp (f a) / ∫ x, exp (f x) ∂μ) ∂μ

{α : Type u_1}
{mα : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
(f : α → ℝ)
{s : Set α}
(hs : MeasurableSet s)

(μ.tilted f) s = ∫⁻ (a : α) in s, ENNReal.ofReal (rexp (f a) / ∫ (x : α), rexp (f x) ∂μ) ∂μ


theorem Nat.le_step (h : LE.le n m) : LE.le n (succ m)


theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
    {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
    ‖approxOn f hf s y₀ h₀ n x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖

{β : Type u_2}
{E : Type u_4}
[MeasurableSpace β]
[MeasurableSpace E]
[NormedAddCommGroup E]
[OpensMeasurableSpace E]
{f : β → E}
(hf : Measurable f)
{s : Set E}
{y₀ : E}
(h₀ : y₀ ∈ s)
[TopologicalSpace.SeparableSpace ↑s]
(x : β)
(n : ℕ)

‖↑(MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ n) x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖


theorem Coprime.pow {m n : ℕ+} (k l : ℕ) (h : m.Coprime n) : (m ^ k : ℕ).Coprime (n ^ l)


/--
Given an abelian group homomorphism `f : A → B`, `f⋆(L) := L ∘ f` defines a linear map
from `B⋆` to `A⋆`.
-/
@[simps] def dual (f : A →ₗ[R] B) : CharacterModule B →ₗ[R] CharacterModule A

{R : Type uR}
[CommRing R]
{A : Type uA}
[AddCommGroup A]
{B : Type uB}
[AddCommGroup B]
[Module R A]
[Module R B]
(f : A →ₗ[R] B)
(L : CharacterModule B)

(CharacterModule.dual f) L = AddMonoidHom.comp L f.toAddMonoidHom


@[simp]
theorem lie_neg : ⁅x, -m⁆ = -⁅x, m⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
(x : L)
(m : M)


@[elab_as_elim]
theorem numeric_rec {C : PGame → Prop}
    (H : ∀ (l r) (L : l → PGame) (R : r → PGame), (∀ i j, L i < R j) →
      (∀ i, Numeric (L i)) → (∀ i, Numeric (R i)) → (∀ i, C (L i)) → (∀ i, C (R i)) →
      C ⟨l, r, L, R⟩) :
    ∀ x, Numeric x → C x

(H :
  ∀ (l r : Type u_1) (L : l → SetTheory.PGame) (R : r → SetTheory.PGame),
    (∀ (i : l) (j : r), L i < R j) →
      (∀ (i : l), (L i).Numeric) →
        (∀ (i : r), (R i).Numeric) → (∀ (i : l), C (L i)) → (∀ (i : r), C (R i)) → C (SetTheory.PGame.mk l r L R))


@[simp]
theorem algebraMap_eq_apply (e : A₁ ≃ₐ[R] A₂) {y : R} {x : A₁} :
    algebraMap R A₂ y = e x ↔ algebraMap R A₁ y = x

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
{y : R}
{x : A₁}

(algebraMap R A₂) y = e x ↔ (algebraMap R A₁) y = x


@[to_additive]
theorem commute_inl_inr (m : M) (n : N) : Commute (inl M N m) (inr M N n)

{M : Type u_5}
{N : Type u_6}
[MulOneClass M]
[MulOneClass N]
(m : M)
(n : N)

Commute ((MonoidHom.inl M N) m) ((MonoidHom.inr M N) n)


@[higher_order tfst_comp_tsnd]
theorem tfst_tsnd {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) :
    Comp.mk (tfst f <$> tsnd f' x)
      = bitraverse (Comp.mk ∘ pure ∘ f) (Comp.mk ∘ map pure ∘ f') x

{t : Type u → Type u → Type u}
[Bitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulBitraversable t]
[LawfulApplicative F]
[LawfulApplicative G]
{α₀ α₁ β₀ β₁ : Type u}
(f : α₀ → F α₁)
(f' : β₀ → G β₁)
(x : t α₀ β₀)

Functor.Comp.mk (Bitraversable.tfst f <$> Bitraversable.tsnd f' x) =
  bitraverse (Functor.Comp.mk ∘ pure ∘ f) (Functor.Comp.mk ∘ Functor.map pure ∘ f') x


lemma StrictAnti.image_Ico_subset (h : StrictAnti f) : f '' Ico a b ⊆ Ioc (f b) (f a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[PartialOrder α]
[Preorder β]
{a b : α}
(h : StrictAnti f)


@[simp]
theorem GradedRing.proj_apply (i : ι) (r : A) :
    GradedRing.proj 𝒜 i r = (decompose 𝒜 r : ⨁ i, 𝒜 i) i

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddMonoid ι]
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(i : ι)
(r : A)

(GradedRing.proj 𝒜 i) r = ↑(((DirectSum.decompose 𝒜) r) i)


@[to_additive] -- This can be proved by `Submonoid.mk_eq_one`
theorem mk_eq_one {g : G} {h} : (⟨g, h⟩ : H) = 1 ↔ g = 1

{G : Type u_1}
[Group G]
(H : Subgroup G)
{g : G}
{h : g ∈ H}


/-- A braided functor between braided monoidal categories is a monoidal functor
which preserves the braiding.
-/
structure BraidedFunctor extends MonoidalFunctor C D where
  -- Note this is stated differently than for `LaxBraidedFunctor`.
  -- We move the `μ X Y` to the right hand side,
  -- so that this makes a good `@[simp]` lemma.
  braided : ∀ X Y : C, map (β_ X Y).hom = inv (μ X Y) ≫ (β_ (obj X) (obj Y)).hom ≫ μ Y X := by
    aesop_cat

(self : CategoryTheory.BraidedFunctor C D)

self.map (β_ X Y).hom = CategoryTheory.inv (self.μ X Y) ≫ (β_ (self.obj X) (self.obj Y)).hom ≫ self.μ Y X


@[simp]
theorem mem_dual {K : ProperCone ℝ E} {y : E} : y ∈ dual K ↔ ∀ ⦃x⦄, x ∈ K → 0 ≤ ⟪x, y⟫_ℝ

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{K : ProperCone ℝ E}
{y : E}

y ∈ K.dual ↔ ∀ ⦃x : E⦄, x ∈ K → 0 ≤ ⟪x, y⟫_ℝ


/-- The **Triangle Counting Lemma**. If `G` is a graph and `s`, `t`, `u` are disjoint sets of
vertices such that each pair is `ε`-uniform and `2 * ε`-dense, then `G` contains at least
`(1 - 2 * ε) * ε ^ 3 * |s| * |t| * |u|` triangles. -/
lemma triangle_counting
    (dst : 2 * ε ≤ G.edgeDensity s t) (ust : G.IsUniform ε s t) (hst : Disjoint s t)
    (dsu : 2 * ε ≤ G.edgeDensity s u) (usu : G.IsUniform ε s u) (hsu : Disjoint s u)
    (dtu : 2 * ε ≤ G.edgeDensity t u) (utu : G.IsUniform ε t u) (htu : Disjoint t u) :
    (1 - 2 * ε) * ε ^ 3 * s.card * t.card * u.card ≤ (G.cliqueFinset 3).card

{α : Type u_1}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : ℝ}
{s t u : Finset α}
[DecidableEq α]
[Fintype α]
(dst : 2 * ε ≤ ↑(G.edgeDensity s t))
(ust : G.IsUniform ε s t)
(hst : Disjoint s t)
(dsu : 2 * ε ≤ ↑(G.edgeDensity s u))
(usu : G.IsUniform ε s u)
(hsu : Disjoint s u)
(dtu : 2 * ε ≤ ↑(G.edgeDensity t u))
(utu : G.IsUniform ε t u)
(htu : Disjoint t u)

(1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ ↑(G.cliqueFinset 3).card


theorem LowerSemicontinuous.isOpen_preimage (hf : LowerSemicontinuous f) (y : β) :
    IsOpen (f ⁻¹' Ioi y)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}
(hf : LowerSemicontinuous f)
(y : β)


/-- If `f` is `ℝ`-valued and integrable, then for any `c > 0` the set `{x | f x ≥ c}` has finite
measure. -/
lemma Integrable.measure_ge_lt_top {f : α → ℝ} (hf : Integrable f μ) {ε : ℝ} (ε_pos : 0 < ε) :
    μ {a : α | ε ≤ f a} < ∞

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(hf : MeasureTheory.Integrable f μ)
{ε : ℝ}
(ε_pos : 0 < ε)


@[simp]
theorem nonempty_sigma : Nonempty (Σa : α, γ a) ↔ ∃ a : α, Nonempty (γ a)

Nonempty ((a : α) × γ a) ↔ ∃ a, Nonempty (γ a)


@[simp, norm_cast]
theorem coe_eq_zero {x : Icc (0 : α) 1} : (x : α) = 0 ↔ x = 0

{α : Type u_1}
[OrderedSemiring α]
{x : ↑(Set.Icc 0 1)}


/-- If `K / E / F` is a field extension tower, such that `E / F` is purely inseparable and `K / E`
is separable, then the separable degree of `K / F` is equal to the degree of `K / E`.
It is a special case of `Field.lift_sepDegree_mul_lift_sepDegree_of_isAlgebraic`, and is an
intermediate result used to prove it. -/
lemma sepDegree_eq_of_isPurelyInseparable_of_isSeparable
    [IsPurelyInseparable F E] [Algebra.IsSeparable E K] : sepDegree F K = Module.rank E K

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
[IsPurelyInseparable F E]
[Algebra.IsSeparable E K]


theorem specializes_iff_clusterPt : x ⤳ y ↔ ClusterPt y (pure x)

{X : Type u_1}
[TopologicalSpace X]
{x y : X}


@[to_additive]
theorem mulIndicator_congr (h : EqOn f g s) : mulIndicator s f = mulIndicator s g

{α : Type u_1}
{M : Type u_4}
[Zero M]
{s : Set α}
{f g : α → M}
(h : Set.EqOn f g s)


@[simp]
theorem bind_pure' (s : Computation α) : bind s pure = s


theorem derivative_comp (p q : R[X]) :
    derivative (p.comp q) = derivative q * p.derivative.comp q

{R : Type u}
[CommSemiring R]
(p q : R[X])

Polynomial.derivative (p.comp q) = Polynomial.derivative q * (Polynomial.derivative p).comp q


theorem AECover.biInter_Ici_aecover [Preorder ι] {φ : ι → Set α}
    (hφ : AECover μ atTop φ) : AECover μ atTop fun n : ι => ⋂ (k) (_h : k ∈ Ici n), φ k

(hφ : MeasureTheory.AECover μ Filter.atTop φ)

MeasureTheory.AECover μ Filter.atTop fun n => ⋂ k ∈ Set.Ici n, φ k


theorem monotone_nhdsSet : Monotone (𝓝ˢ : Set X → Filter X)


/--
The $S_n^m$ theorem: There is a computable function, namely `Nat.Partrec.Code.curry`, that takes a
program and a ℕ `n`, and returns a new program using `n` as the first argument.
-/
theorem smn :
    ∃ f : Code → ℕ → Code, Computable₂ f ∧ ∀ c n x, eval (f c n) x = eval c (Nat.pair n x)

∃ f, Computable₂ f ∧ ∀ (c : Nat.Partrec.Code) (n x : ℕ), (f c n).eval x = c.eval (Nat.pair n x)


@[simp]
theorem mem_attach (l : List α) : ∀ x, x ∈ l.attach

{α : Type u}
(l : List α)
(x : { x // x ∈ l })


theorem strictMono_iff_map_pos [iamhc : AddMonoidHomClass F α β]  :
    StrictMono (f : α → β) ↔ ∀ a, 0 < a → 0 < f a

[CovariantClass β β (fun x x_1 => x + x_1) fun x x_1 => x < x_1]

StrictMono ⇑f ↔ ∀ (a : α), 0 < a → 0 < f a


lemma ofComplex_d_1_0 :
    (ofComplex Z).d 1 0 = d (Projective.π Z)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.EnoughProjectives C]
(Z : C)

(CategoryTheory.ProjectiveResolution.ofComplex Z).d 1 0 = CategoryTheory.Projective.d (CategoryTheory.Projective.π Z)


theorem IsLowerSet.not_bot_mem (hs : IsLowerSet s) : ⊥ ∉ s ↔ s = ∅

{α : Type u_1}
[Preorder α]
{s : Set α}
[OrderBot α]
(hs : IsLowerSet s)

⊥ ∉ s ↔ s = ∅


theorem isometry_extend (f : α ↪ δ) (h : δ →ᵇ β) : Isometry fun g : α →ᵇ β => extend f g h

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{δ : Type u_2}
[TopologicalSpace δ]
[DiscreteTopology δ]
(f : α ↪ δ)
(h : BoundedContinuousFunction δ β)

Isometry fun g => BoundedContinuousFunction.extend f g h


lemma lieCharpoly_monic : (lieCharpoly R M x y).Monic

(R : Type u_2)
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R L]
[Module.Free R L]
[Module.Finite R M]
[Module.Free R M]
(x y : L)

(LieAlgebra.engel_isBot_of_isMin.lieCharpoly R M x y).Monic


theorem nhdsWithin_Ici_eq'' [TopologicalSpace α] [Preorder α] [OrderTopology α] (a : α) :
    𝓝[≥] a = (⨅ (u) (_ : a < u), 𝓟 (Iio u)) ⊓ 𝓟 (Ici a)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
(a : α)

𝓝[≥] a = (⨅ u, ⨅ (_ : a < u), 𝓟 (Set.Iio u)) ⊓ 𝓟 (Set.Ici a)


theorem sqrtTwoAddSeries_zero_nonneg : ∀ n : ℕ, 0 ≤ sqrtTwoAddSeries 0 n


@[simp]
theorem pure_def (a) : (return a : Computation α) = pure a


theorem isRadical_iff_squarefree_or_zero : IsRadical x ↔ Squarefree x ∨ x = 0

{R : Type u_1}
[CancelCommMonoidWithZero R]
{x : R}
[DecompositionMonoid R]


@[simp]
theorem isPredLimit_iff_of_noMin [NoMinOrder α] : IsPredLimit a ↔ IsMax a

{α : Type u_1}
[Preorder α]
{a : α}
[PredOrder α]
[IsPredArchimedean α]
[NoMinOrder α]


/-- For `1 ≤ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with nonnegative `ℝ`-valued
functions. -/
theorem rpow_sum_le_const_mul_sum_rpow_of_nonneg (hp : 1 ≤ p) (hf : ∀ i ∈ s, 0 ≤ f i) :
    (∑ i ∈ s, f i) ^ p ≤ (card s : ℝ) ^ (p - 1) * ∑ i ∈ s, f i ^ p

{ι : Type u}
(s : Finset ι)
{f : ι → ℝ}
{p : ℝ}
(hp : 1 ≤ p)
(hf : ∀ i ∈ s, 0 ≤ f i)

(∑ i ∈ s, f i) ^ p ≤ ↑s.card ^ (p - 1) * ∑ i ∈ s, f i ^ p


/-- Elementwise intersection of two `AECover`s is an `AECover`. -/
theorem inter {φ ψ : ι → Set α} (hφ : AECover μ l φ) (hψ : AECover μ l ψ) :
    AECover μ l (fun i ↦ φ i ∩ ψ i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
{φ ψ : ι → Set α}
(hφ : MeasureTheory.AECover μ l φ)
(hψ : MeasureTheory.AECover μ l ψ)

MeasureTheory.AECover μ l fun i => φ i ∩ ψ i


theorem le_of_neg_of_one_div_le_one_div (hb : b < 0) (h : 1 / a ≤ 1 / b) : b ≤ a

{α : Type u_2}
[LinearOrderedField α]
{a b : α}
(hb : b < 0)
(h : 1 / a ≤ 1 / b)


lemma cons_map (a : α i) (f : ∀ j ∈ l, α j)
    {α' : ι → Sort*} (φ : ∀ ⦃j⦄, α j → α' j) :
    cons _ _ (φ a) (fun j hj ↦ φ (f j hj)) = (fun j hj ↦ φ ((cons _ _ a f) j hj))

{ι : Type u_1}
[DecidableEq ι]
{α : ι → Sort u_2}
{i : ι}
{l : List ι}
(a : α i)
(f : (j : ι) → j ∈ l → α j)
{α' : ι → Sort u_3}
(φ : ⦃j : ι⦄ → α j → α' j)

(List.Pi.cons i l (φ a) fun j hj => φ (f j hj)) = fun j hj => φ (List.Pi.cons i l a f j hj)


@[simp]
theorem liftNC_one {g_hom : Type*}
    [FunLike g_hom (Multiplicative G) R] [OneHomClass g_hom (Multiplicative G) R]
    (f : k →+* R) (g : g_hom) : liftNC (f : k →+ R) g 1 = 1


@[simp]
theorem brange_bfamilyOfFamily {ι : Type u} (f : ι → α) : brange _ (bfamilyOfFamily f) = range f

(Ordinal.type WellOrderingRel).brange (Ordinal.bfamilyOfFamily f) = Set.range f


/-- Linearly disjoint is preserved by taking multiplicative opposite. -/
theorem linearDisjoint_op :
    M.LinearDisjoint N ↔ (equivOpposite.symm (MulOpposite.op N)).LinearDisjoint
      (equivOpposite.symm (MulOpposite.op M))

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{M N : Submodule R S}

M.LinearDisjoint N ↔
  (Submodule.equivOpposite.symm (MulOpposite.op N)).LinearDisjoint (Submodule.equivOpposite.symm (MulOpposite.op M))


lemma _root_.integrable_cexp_quadratic' (hb : b.re < 0) (c d : ℂ) :
    Integrable (fun (x : ℝ) ↦ cexp (b * x ^ 2 + c * x + d))

MeasureTheory.Integrable (fun x => cexp (b * ↑x ^ 2 + c * ↑x + d)) MeasureTheory.volume


/-- The augmented Čech nerve construction, as a functor from `Arrow C`. -/
@[simps!]
def augmentedCechNerve : Arrow C ⥤ SimplicialObject.Augmented C

[∀ (n : ℕ) (f : CategoryTheory.Arrow C), CategoryTheory.Limits.HasWidePullback f.right (fun x => f.left) fun x => f.hom]

(CategoryTheory.SimplicialObject.augmentedCechNerve.obj f).right = f.right


theorem succ_ne_bot (a : α) : succ a ≠ ⊥

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
[OrderBot α]
[Nontrivial α]
(a : α)


theorem exists_pow_succ_smul_dvd (r : R) (x : M) :
    ∃ (n : ℕ) (y : M), r ^ n.succ • y = r ^ n • x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
[IsArtinian R M]
(r : R)
(x : M)


theorem MDifferentiable.prod_mk_space {f : M → E'} {g : M → E''} (hf : MDifferentiable I 𝓘(𝕜, E') f)
    (hg : MDifferentiable I 𝓘(𝕜, E'') g) : MDifferentiable I 𝓘(𝕜, E' × E'') fun x => (f x, g x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{f : M → E'}
{g : M → E''}
(hf : MDifferentiable I 𝓘(𝕜, E') f)
(hg : MDifferentiable I 𝓘(𝕜, E'') g)


theorem _root_.IsMax.Ici_eq (h : IsMax a) : Ici a = {a}

{α : Type u_1}
[PartialOrder α]
{a : α}
(h : IsMax a)


@[simp]
theorem left_lt_sup : a < a ⊔ b ↔ ¬b ≤ a

{α : Type u}
[SemilatticeSup α]
{a b : α}


theorem eqLocus_toAddSubmonoid (f g : F) :
    (eqLocus f g).toAddSubmonoid = (f : M →+ M₂).eqLocusM g

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_3}
{M₂ : Type u_4}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_5}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
(f g : F)

(LinearMap.eqLocus f g).toAddSubmonoid = (↑f).eqLocusM ↑g


theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K) :
    normAtPlace w x = ‖x.1 ⟨w, hw⟩‖

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

(NumberField.mixedEmbedding.normAtPlace w) x = ‖x.1 ⟨w, hw⟩‖


lemma comp_apply
    {φ : M →* N} {ψ : N →* P} {χ : M →* P} (h : CompTriple φ ψ χ) (x : M) :
    ψ (φ x) = χ x

{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[Monoid M]
[Monoid N]
[Monoid P]
{φ : M →* N}
{ψ : N →* P}
{χ : M →* P}
(h : φ.CompTriple ψ χ)
(x : M)


theorem Function.Surjective.iSup_comp {f : ι → ι'} (hf : Surjective f) (g : ι' → α) :
    ⨆ x, g (f x) = ⨆ y, g y

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[SupSet α]
{f : ι → ι'}
(hf : Function.Surjective f)
(g : ι' → α)


@[simp]
theorem comap_id' (U : Opens (PrimeSpectrum.Top R)) :
    (comap (RingHom.id R) U U fun p hpU => by rwa [PrimeSpectrum.comap_id]) = RingHom.id _

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

AlgebraicGeometry.StructureSheaf.comap (RingHom.id R) U U ⋯ =
  RingHom.id ↑((AlgebraicGeometry.Spec.structureSheaf R).val.obj (Opposite.op U))


lemma mem_of_isSMulRegular_on_quot_of_smul_mem (h1 : IsSMulRegular (M ⧸ N) r)
    {x : M} (h2 : r • x ∈ N) : x ∈ N

{R : Type u_1}
{M : Type u_3}
[Ring R]
[AddCommGroup M]
[Module R M]
{N : Submodule R M}
{r : R}
(h1 : IsSMulRegular (M ⧸ N) r)
{x : M}
(h2 : r • x ∈ N)


@[to_additive]
theorem IsUpperSet.smul (hs : IsUpperSet s) : IsUpperSet (a • s)

{α : Type u_1}
[OrderedAddCommGroup α]
{s : Set α}
{a : α}
(hs : IsUpperSet s)


@[to_additive]
theorem subset_one_iff_eq : s ⊆ 1 ↔ s = ∅ ∨ s = 1


theorem norm_coe_le_norm (x : α) : ‖f x‖ ≤ ‖f‖

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : C(α, E))
(x : α)


theorem map_congr_left (h : ∀ a ∈ l, f a = g a) : map f l = map g l

∀ {α : Type u_1} {l : List α} {α_1 : Type u_2} {f g : α → α_1},
  (∀ (a : α), a ∈ l → f a = g a) → List.map f l = List.map g l


theorem aeval_algebraMap_apply_eq_algebraMap_eval (x : R) (p : R[X]) :
    aeval (algebraMap R A x) p = algebraMap R A (p.eval x)

{R : Type u}
{A : Type z}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(x : R)
(p : R[X])

(Polynomial.aeval ((algebraMap R A) x)) p = (algebraMap R A) (Polynomial.eval x p)


lemma rpow_sub_nat' (hx : 0 ≤ x) (h : y - n ≠ 0) : x ^ (y - n) = x ^ y / x ^ n


lemma bliminf_eq_liminf {f : Filter β} {u : β → α} {p : β → Prop} :
    bliminf u f p = liminf u (f ⊓ 𝓟 {x | p x})

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
{f : Filter β}
{u : β → α}
{p : β → Prop}

Filter.bliminf u f p = Filter.liminf u (f ⊓ 𝓟 {x | p x})


lemma regularityReduced_anti {δ₁ δ₂ : 𝕜} (hδ : δ₁ ≤ δ₂) :
    G.regularityReduced P ε δ₂ ≤ G.regularityReduced P ε δ₁

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
{P : Finpartition A}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε δ₁ δ₂ : 𝕜}
(hδ : δ₁ ≤ δ₂)

SimpleGraph.regularityReduced P G ε δ₂ ≤ SimpleGraph.regularityReduced P G ε δ₁


theorem coe_coordChangeL (e e' : Trivialization F (π F E)) [e.IsLinear R] [e'.IsLinear R] {b : B}
    (hb : b ∈ e.baseSet ∩ e'.baseSet) :
    ⇑(coordChangeL R e e' b) = (e.linearEquivAt R b hb.1).symm.trans (e'.linearEquivAt R b hb.2)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

⇑(Trivialization.coordChangeL R e e' b) =
  ⇑((Trivialization.linearEquivAt R e b ⋯).symm ≪≫ₗ Trivialization.linearEquivAt R e' b ⋯)


/-- The product of two `C^n`functions is `C^n`. -/
theorem ContDiff.mul {f g : E → 𝔸} (hf : ContDiff 𝕜 n f) (hg : ContDiff 𝕜 n g) :
    ContDiff 𝕜 n fun x => f x * g x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{f g : E → 𝔸}
(hf : ContDiff 𝕜 n f)
(hg : ContDiff 𝕜 n g)


@[simp]
theorem _root_.AddMonoidHom.coe_toMultiplicative_map {G G₂ : Type*} [AddGroup G] [AddGroup G₂]
    (f : G →+ G₂) (s : AddSubgroup G) :
    s.toSubgroup.map (AddMonoidHom.toMultiplicative f) = AddSubgroup.toSubgroup (s.map f)

{G : Type u_10}
{G₂ : Type u_11}
[AddGroup G]
[AddGroup G₂]
(f : G →+ G₂)
(s : AddSubgroup G)

Subgroup.map (AddMonoidHom.toMultiplicative f) (AddSubgroup.toSubgroup s) = AddSubgroup.toSubgroup (AddSubgroup.map f s)


@[simp]
lemma autMap_id {A : C} [IsGalois A] : autMap (𝟙 A) = id

CategoryTheory.PreGaloisCategory.autMap (CategoryTheory.CategoryStruct.id A) = id


theorem le_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) {S T : Subgroup G} : S ≤ a • T ↔ a⁻¹ • S ≤ T

{α : Type u_1}
{G : Type u_2}
[Group G]
[GroupWithZero α]
[MulDistribMulAction α G]
{a : α}
(ha : a ≠ 0)
{S T : Subgroup G}

S ≤ a • T ↔ a⁻¹ • S ≤ T


@[to_additive]
theorem comap_comap (K : Subgroup P) (g : N →* P) (f : G →* N) :
    (K.comap g).comap f = K.comap (g.comp f)

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{P : Type u_6}
[AddGroup P]
(K : AddSubgroup P)
(g : N →+ P)
(f : G →+ N)

AddSubgroup.comap f (AddSubgroup.comap g K) = AddSubgroup.comap (g.comp f) K


@[to_additive]
theorem map_sup_comap_of_surjective (S T : Submonoid N) : (S.comap f ⊔ T.comap f).map f = S ⊔ T

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
(hf : Function.Surjective ⇑f)
(S T : AddSubmonoid N)

AddSubmonoid.map f (AddSubmonoid.comap f S ⊔ AddSubmonoid.comap f T) = S ⊔ T


theorem SatisfiesM_mapIdxM [Monad m] [LawfulMonad m] (as : Array α) (f : Fin as.size → α → m β)
    (motive : Nat → Prop) (h0 : motive 0)
    (p : Fin as.size → β → Prop)
    (hs : ∀ i, motive i.1 → SatisfiesM (p i · ∧ motive (i + 1)) (f i as[i])) :
    SatisfiesM
      (fun arr => motive as.size ∧ ∃ eq : arr.size = as.size, ∀ i h, p ⟨i, h⟩ arr[i])
      (Array.mapIdxM as f)

(hs : ∀ (i : Fin as.size), motive ↑i → SatisfiesM (fun x => p i x ∧ motive (↑i + 1)) (f i as[i]))

SatisfiesM (fun arr => motive as.size ∧ ∃ eq, ∀ (i : Nat) (h : i < as.size), p ⟨i, h⟩ arr[i]) (as.mapIdxM f)


@[to_additive]
theorem subset_mul_left (s : Set α) {t : Set α} (ht : (1 : α) ∈ t) : s ⊆ s * t

{α : Type u_2}
[AddZeroClass α]
(s : Set α)
{t : Set α}
(ht : 0 ∈ t)


@[ext] theorem PSigma.ext : {x y : PSigma β} → x.fst = y.fst → HEq x.snd y.snd → x = y

∀ {α : Sort u_1} {β : α → Sort u_2} {x y : PSigma β}, x.fst = y.fst → HEq x.snd y.snd → x = y