theorem isClosed_symm_image_closedBall :
    IsClosed ((extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I))

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
[T2Space M]

IsClosed (↑(extChartAt I c).symm '' (Metric.closedBall (↑(extChartAt I c) c) f.rOut ∩ Set.range ↑I))


/-- If the affine span of an affine independent finset is strictly contained in the affine span of
another finset, then its cardinality is strictly less than the cardinality of that finset. -/
lemma AffineIndependent.card_lt_card_of_affineSpan_lt_affineSpan {s t : Finset V}
    (hs : AffineIndependent k ((↑) : s → V))
    (hst : affineSpan k (s : Set V) < affineSpan k (t : Set V)) : s.card < t.card

(hst : affineSpan k ↑s < affineSpan k ↑t)


theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s s' : Set α}
{t : Set β}

Set.image2 f (s ∩ s') t ⊆ Set.image2 f s t ∩ Set.image2 f s' t


theorem iUnion_eq_dif {p : Prop} [Decidable p] (s : p → Set α) :
    ⋃ h : p, s h = if h : p then s h else ∅

{α : Type u_1}
{p : Prop}
[Decidable p]
(s : p → Set α)

⋃ (h : p), s h = if h : p then s h else ∅


@[simp]
lemma _root_.LieAlgebra.IsKilling.coroot_neg (α : Weight K H L) : coroot (-α) = -coroot α

{K : Type u_2}
{L : Type u_3}
[LieRing L]
[Field K]
[LieAlgebra K L]
[FiniteDimensional K L]
[LieAlgebra.IsKilling K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
[CharZero K]
(α : LieModule.Weight K (↥H) L)

LieAlgebra.IsKilling.coroot (-α) = -LieAlgebra.IsKilling.coroot α


@[simp]
theorem swap_rightInverse : Function.RightInverse (@swap α β) swap


@[simp]
theorem mem_smoothFiberwiseLinear_iff (e : PartialHomeomorph (B × F) (B × F)) :
    e ∈ smoothFiberwiseLinear B F IB ↔
      ∃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U) (hφ :
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U) (h2φ :
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)

{𝕜 : Type u_1}
(B : Type u_2)
(F : Type u_3)
[TopologicalSpace B]
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{EB : Type u_4}
[NormedAddCommGroup EB]
[NormedSpace 𝕜 EB]
{HB : Type u_5}
[TopologicalSpace HB]
[ChartedSpace HB B]
(IB : ModelWithCorners 𝕜 EB HB)
(e : PartialHomeomorph (B × F) (B × F))

e ∈ smoothFiberwiseLinear B F IB ↔
  ∃ φ U,
    ∃ (hU : IsOpen U) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U) (h2φ :
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x).symm) U), e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU ⋯ ⋯)


theorem norm_eq_of_norm_add_lt_right {z1 z2 : ℤ_[p]} (h : ‖z1 + z2‖ < ‖z2‖) : ‖z1‖ = ‖z2‖

{p : ℕ}
[Fact (Nat.Prime p)]
{z1 z2 : ℤ_[p]}
(h : ‖z1 + z2‖ < ‖z2‖)


@[simp]
theorem integrableAtFilter_top : IntegrableAtFilter f ⊤ μ ↔ Integrable f μ

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

MeasureTheory.IntegrableAtFilter f ⊤ μ ↔ MeasureTheory.Integrable f μ


theorem comp_continuous [TopologicalSpace Y] {g : Y → Z} {f : X → Y} (hg : IsLocallyConstant g)
    (hf : Continuous f) : IsLocallyConstant (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{g : Y → Z}
{f : X → Y}
(hg : IsLocallyConstant g)
(hf : Continuous f)


@[simp]
lemma add_app (f g : P ⟶ Q) (X : Cᵒᵖ) : (f + g).app X = f.app X + g.app X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
{P Q : PresheafOfModules R}
(f g : P ⟶ Q)
(X : Cᵒᵖ)

PresheafOfModules.Hom.app (f + g) X = PresheafOfModules.Hom.app f X + PresheafOfModules.Hom.app g X


theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ

(hf_meas : MeasureTheory.StronglyMeasurable f)


/-- An equivalence of types yields an order isomorphism between their lattices of subsets. -/
@[simps]
def Equiv.toOrderIsoSet (e : α ≃ β) : Set α ≃o Set β

{α : Type u_2}
{β : Type u_3}
(e : α ≃ β)
(s : Set α)


@[to_additive (attr := simp) index_eq_one]
theorem index_eq_one : H.index = 1 ↔ H = ⊤

{G : Type u_1}
[Group G]
{H : Subgroup G}


@[simp]
theorem X_mul_divMonomial (i : σ) (x : MvPolynomial σ R) :
    X i * x /ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1 = x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(i : σ)
(x : MvPolynomial σ R)

(MvPolynomial.X i * x).divMonomial (Finsupp.single i 1) = x


theorem numeric_of_isEmpty_leftMoves (x : PGame) [IsEmpty x.LeftMoves] :
    (∀ j, Numeric (x.moveRight j)) → Numeric x

(x : SetTheory.PGame)
[IsEmpty x.LeftMoves]

(∀ (j : x.RightMoves), (x.moveRight j).Numeric) → x.Numeric


@[reassoc]
lemma leftRightHomologyComparison_fac [S.HasHomology] :
    S.leftRightHomologyComparison = S.leftHomologyIso.hom ≫ S.rightHomologyIso.inv

S.leftRightHomologyComparison = CategoryTheory.CategoryStruct.comp S.leftHomologyIso.hom S.rightHomologyIso.inv


lemma mk'_eq_divInt {n d h c} : (⟨n, d, h, c⟩ : ℚ) = n /. d

{n : ℤ}
{d : ℕ}
{h : d ≠ 0}
{c : n.natAbs.Coprime d}

{ num := n, den := d, den_nz := h, reduced := c } = Rat.divInt n ↑d


/-- The inner product on an inner product space of dimension 2 can be evaluated in terms
of a complex-number representation of the space. -/
theorem inner_map_complex [NormedAddCommGroup G] [InnerProductSpace ℝ G] (f : G ≃ₗᵢ[ℝ] ℂ)
    (x y : G) : ⟪x, y⟫_ℝ = (conj (f x) * f y).re

{G : Type u_4}
[NormedAddCommGroup G]
[InnerProductSpace ℝ G]
(f : G ≃ₗᵢ[ℝ] ℂ)
(x y : G)

⟪x, y⟫_ℝ = ((starRingEnd ℂ) (f x) * f y).re


@[simp]
theorem mem_nonUnitalSubalgebraOfNonUnitalSubring {x : R} {S : NonUnitalSubring R} :
    x ∈ nonUnitalSubalgebraOfNonUnitalSubring S ↔ x ∈ S

{R : Type u_1}
[NonUnitalNonAssocRing R]
{x : R}
{S : NonUnitalSubring R}


@[simp]
theorem snd_map (f : M →ₗ[R'] N) (x : TrivSqZeroExt R' M) : snd (map f x) = f (snd x)

{R' : Type u}
{M : Type v}
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]
{N : Type u_3}
[AddCommMonoid N]
[Module R' N]
[Module R'ᵐᵒᵖ N]
[IsCentralScalar R' N]
(f : M →ₗ[R'] N)
(x : tsze R' M)


theorem disjoint_left : Disjoint s t ↔ ∀ ⦃a⦄, a ∈ s → a ∉ t


@[gcongr]
theorem Icc_subset_Icc_right (h : b₁ ≤ b₂) : Icc a b₁ ⊆ Icc a b₂

{α : Type u_1}
[Preorder α]
{a b₁ b₂ : α}
(h : b₁ ≤ b₂)


theorem sups_infs_subset_left : s ⊻ t ⊼ u ⊆ (s ⊻ t) ⊼ (s ⊻ u)

{α : Type u_2}
[DistribLattice α]
(s t u : Set α)


@[simp]
theorem alternatingFaceMapComplex_map_f {X Y : SimplicialObject C} (f : X ⟶ Y) (n : ℕ) :
    ((alternatingFaceMapComplex C).map f).f n = f.app (op [n])

{X Y : CategoryTheory.SimplicialObject C}

((AlgebraicTopology.alternatingFaceMapComplex C).map f).f n = f.app (Opposite.op [n])


/--
Explicit formula for `toCircle j`. Note that this is "evil" because it uses `ZMod.val`. Where
possible, it is recommended to lift `j` to `ℤ` and use `toAddCircle_intCast` instead.
-/
lemma toAddCircle_apply (j : ZMod N) :
    toAddCircle j = ↑(j.val / N : ℝ)


theorem iteratedFDeriv_zero_apply_diag : iteratedFDeriv 𝕜 0 f x = p 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{f : E → F}
{x : E}
{r : ℝ≥0∞}
(h : HasFPowerSeriesOnBall f p x r)


@[to_additive]
theorem mono (h : IsFundamentalDomain G s μ) {ν : Measure α} (hle : ν ≪ μ) :
    IsFundamentalDomain G s ν

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

MeasureTheory.IsAddFundamentalDomain G s ν


@[to_additive]
theorem infinite_mul : (s * t).Infinite ↔ s.Infinite ∧ t.Nonempty ∨ t.Infinite ∧ s.Nonempty

{α : Type u_2}
[Mul α]
[IsLeftCancelMul α]
[IsRightCancelMul α]
{s t : Set α}


theorem mem_inv_smul_finset_iff₀ (ha : a ≠ 0) : b ∈ a⁻¹ • s ↔ a • b ∈ s

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[GroupWithZero α]
[MulAction α β]
{s : Finset β}
{a : α}
{b : β}
(ha : a ≠ 0)

b ∈ a⁻¹ • s ↔ a • b ∈ s


theorem integrable_finset_sum_measure {ι} {m : MeasurableSpace α} {f : α → β} {μ : ι → Measure α}
    {s : Finset ι} : Integrable f (∑ i ∈ s, μ i) ↔ ∀ i ∈ s, Integrable f (μ i)

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{ι : Type u_5}
{m : MeasurableSpace α}
{f : α → β}
{μ : ι → MeasureTheory.Measure α}
{s : Finset ι}

MeasureTheory.Integrable f (∑ i ∈ s, μ i) ↔ ∀ i ∈ s, MeasureTheory.Integrable f (μ i)


theorem exp_def_of_smul_comm (x : tsze R M) (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd) :
    exp 𝕜 x = inl (exp 𝕜 x.fst) + inr (exp 𝕜 x.fst • x.snd)

NormedSpace.exp 𝕜 x = TrivSqZeroExt.inl (NormedSpace.exp 𝕜 x.fst) + TrivSqZeroExt.inr (NormedSpace.exp 𝕜 x.fst • x.snd)


theorem Squarefree.dvd_pow_iff_dvd {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
    x ∣ y ^ n ↔ x ∣ y

{R : Type u_1}
[CommMonoidWithZero R]
[DecompositionMonoid R]
{x y : R}
{n : ℕ}
(hsq : Squarefree x)
(h0 : n ≠ 0)


@[to_additive]
lemma prod_fiberwise_of_maps_to {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : ι → α) :
    ∏ j ∈ t, ∏ i ∈ s.filter fun i ↦ g i = j, f i = ∏ i ∈ s, f i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[CommMonoid α]
{s : Finset ι}
{t : Finset κ}
[DecidableEq κ]
{g : ι → κ}
(h : ∀ i ∈ s, g i ∈ t)
(f : ι → α)

∏ j ∈ t, ∏ i ∈ Finset.filter (fun i => g i = j) s, f i = ∏ i ∈ s, f i


@[to_additive]
theorem HasProd.mul_disjoint {s t : Set β} (hs : Disjoint s t) (ha : HasProd (f ∘ (↑) : s → α) a)
    (hb : HasProd (f ∘ (↑) : t → α) b) : HasProd (f ∘ (↑) : (s ∪ t : Set β) → α) (a * b)

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a b : α}
[ContinuousAdd α]
{s t : Set β}
(hs : Disjoint s t)
(ha : HasSum (f ∘ Subtype.val) a)
(hb : HasSum (f ∘ Subtype.val) b)


lemma cosZeta_apply_zero (a : UnitAddCircle) : cosZeta a 0 = -1 / 2


theorem convex_iInter {ι : Sort*} {s : ι → Set E} (h : ∀ i, Convex 𝕜 (s i)) :
    Convex 𝕜 (⋂ i, s i)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{ι : Sort u_5}
{s : ι → Set E}
(h : ∀ (i : ι), Convex 𝕜 (s i))


protected theorem subset_space (hs : s ∈ K.faces) : (s : Set E) ⊆ K.space

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{K : Geometry.SimplicialComplex 𝕜 E}
{s : Finset E}
(hs : s ∈ K.faces)


/-- The complex hyperbolic cosine function is everywhere strictly differentiable, with the
derivative `sinh x`. -/
theorem hasStrictDerivAt_cosh (x : ℂ) : HasStrictDerivAt cosh (sinh x) x

HasStrictDerivAt Complex.cosh (Complex.sinh x) x


theorem smoothWithinAt_pi_space :
    SmoothWithinAt I 𝓘(𝕜, ∀ i, Fi i) φ s x ↔
      ∀ i, SmoothWithinAt I 𝓘(𝕜, Fi i) (fun x => φ x i) s 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]
{s : Set M}
{x : M}
{ι : Type u_21}
[Fintype ι]
{Fi : ι → Type u_22}
[(i : ι) → NormedAddCommGroup (Fi i)]
[(i : ι) → NormedSpace 𝕜 (Fi i)]
{φ : M → (i : ι) → Fi i}

SmoothWithinAt I 𝓘(𝕜, (i : ι) → Fi i) φ s x ↔ ∀ (i : ι), SmoothWithinAt I 𝓘(𝕜, Fi i) (fun x => φ x i) s x


/-- Construct an isomorphism `G ≅ F ⋙ H.inverse` from an isomorphism `G ⋙ H.functor ≅ F`. -/
@[simps!]
def isoCompInverse {H : D ≌ E} (i : G ⋙ H.functor ≅ F) : G ≅ F ⋙ H.inverse

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F : CategoryTheory.Functor C E}
{G : CategoryTheory.Functor C D}
{H : D ≌ E}
(i : G.comp H.functor ≅ F)
(X : C)

i.isoCompInverse.hom.app X =
  CategoryTheory.CategoryStruct.comp (H.unitIso.hom.app (G.obj X)) (H.inverse.map (i.hom.app X))


/--
Another variant of the opposite of functor, turning a functor `Cᵒᵖ ⥤ D` into a functor `C ⥤ Dᵒᵖ`.
In informal mathematics no distinction is made.
-/
@[simps]
protected def rightOp (F : Cᵒᵖ ⥤ D) : C ⥤ Dᵒᵖ

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

F.rightOp.obj X = Opposite.op (F.obj (Opposite.op X))


@[simp]
theorem coe_orderMonoidHom (f : α →*₀o β) : ⇑(f : α →*o β) = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulZeroOneClass α]
[MulZeroOneClass β]
(f : α →*₀o β)


/-- The `r` argument to `permutationsAux2` is the same as appending. -/
theorem permutationsAux2_append (t : α) (ts : List α) (r : List β) (ys : List α) (f : List α → β) :
    (permutationsAux2 t ts nil ys f).2 ++ r = (permutationsAux2 t ts r ys f).2

{α : Type u_1}
{β : Type u_2}
(t : α)
(ts : List α)
(r : List β)
(ys : List α)
(f : List α → β)

(List.permutationsAux2 t ts [] ys f).2 ++ r = (List.permutationsAux2 t ts r ys f).2


@[simp, norm_cast]
theorem of_to_nat' : ∀ n : Num, Num.ofNat' (n : ℕ) = n


@[simp]
theorem fold_singleton : ({a} : Finset α).fold op b f = f a * b

{α : Type u_1}
{β : Type u_2}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{b : β}
{a : α}


/-- The (Bochner) integral of the product of two independent random
  variables is the product of their integrals. -/
theorem IndepFun.integral_mul (hXY : IndepFun X Y μ) (hX : AEStronglyMeasurable X μ)
    (hY : AEStronglyMeasurable Y μ) : integral μ (X * Y) = integral μ X * integral μ Y

(hXY : ProbabilityTheory.IndepFun X Y μ)

(hX : MeasureTheory.AEStronglyMeasurable X μ)

(hY : MeasureTheory.AEStronglyMeasurable Y μ)

MeasureTheory.integral μ (X * Y) = MeasureTheory.integral μ X * MeasureTheory.integral μ Y


@[simp] lemma den_ne_zero (q : ℚ) : q.den ≠ 0


@[simp]
theorem cast_bitm1 [AddGroupWithOne α] (n : ZNum) : (n.bitm1 : α) = (n : α) + n - 1

{α : Type u_1}
[AddGroupWithOne α]
(n : ZNum)


lemma of_op (W : MorphismProperty C) [IsMultiplicative W.op] : IsMultiplicative W

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(W : CategoryTheory.MorphismProperty C)
[W.op.IsMultiplicative]


/-- Construct a homeomorphism from an isomorphism. -/
@[simps]
def homeoOfIso {X Y : CompactlyGenerated.{u, w}} (f : X ≅ Y) : X ≃ₜ Y

(a : (CategoryTheory.forget CompactlyGenerated).obj X)

(CompactlyGenerated.homeoOfIso f) a = f.hom a


/-- This is the functor `F ↦ X ↦ YonedaCollection F X`. -/
@[simps]
def yonedaCollectionFunctor (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Cᵒᵖ ⥤ Type v

(A : CategoryTheory.Functor Cᵒᵖ (Type v))

(F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))

(CategoryTheory.OverPresheafAux.yonedaCollectionFunctor A).obj F =
  CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A F


theorem depth_lt_depth_mk (a : α) (f : β a → WType β) (i : β a) : depth (f i) < depth ⟨a, f⟩

{α : Type u_1}
{β : α → Type u_2}
[(a : α) → Fintype (β a)]
(a : α)
(f : β a → WType β)
(i : β a)


@[to_additive]
theorem image_mulSingle_Ico (i : ι) (a b : α i) :
    Pi.mulSingle i '' Ico a b = Ico (Pi.mulSingle i a) (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → One (α i)]
(i : ι)
(a b : α i)

Pi.mulSingle i '' Set.Ico a b = Set.Ico (Pi.mulSingle i a) (Pi.mulSingle i b)


theorem inseparable_iff_forall_closed : (x ~ᵢ y) ↔ ∀ s : Set X, IsClosed s → (x ∈ s ↔ y ∈ s)

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

(x ~ᵢ y) ↔ ∀ (s : Set X), IsClosed s → (x ∈ s ↔ y ∈ s)


theorem SetCoe.ext {s : Set α} {a b : s} : (a : α) = b → a = b


/-- `CoalgHomClass F R A B` asserts `F` is a type of bundled coalgebra homomorphisms
from `A` to `B`.  -/
class CoalgHomClass (F : Type*) (R A B : outParam Type*)
    [CommSemiring R] [AddCommMonoid A] [Module R A] [AddCommMonoid B] [Module R B]
    [CoalgebraStruct R A] [CoalgebraStruct R B] [FunLike F A B]
    extends SemilinearMapClass F (RingHom.id R) A B : Prop where
  counit_comp : ∀ f : F, counit ∘ₗ (f : A →ₗ[R] B) = counit
  map_comp_comul : ∀ f : F, TensorProduct.map (f : A →ₗ[R] B)
    (f : A →ₗ[R] B) ∘ₗ comul = comul ∘ₗ (f : A →ₗ[R] B)

{F : Type u_1}
{R : outParam (Type u_2)}
{A : outParam (Type u_3)}
{B : outParam (Type u_4)}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[FunLike F A B]
[self : CoalgHomClass F R A B]
(f : F)

Coalgebra.counit ∘ₗ ↑f = Coalgebra.counit


theorem Finite.subset {s : Set α} (hs : s.Finite) {t : Set α} (ht : t ⊆ s) : t.Finite

{α : Type u}
{s : Set α}
(hs : s.Finite)
{t : Set α}
(ht : t ⊆ s)


/-- Converting a monoid object in `ModuleCat R` to a bundled algebra.
-/
@[simps!]
def functor : Mon_ (ModuleCat.{u} R) ⥤ AlgebraCat R

{R : Type u}
[CommRing R]
(A : Mon_ (ModuleCat R))

↑(ModuleCat.MonModuleEquivalenceAlgebra.functor.obj A) = ↑A.X


@[simp]
theorem add_apply (m : ∀ i, M₁ i) : (f + f') m = f m + f' m

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f f' : MultilinearMap R M₁ M₂)
(m : (i : ι) → M₁ i)


lemma dNext_eq_zero (f : ∀ i j, C.X i ⟶ D.X j) (i : ι) (hi : ¬ c.Rel i (c.next i)) :
    dNext i f = 0

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
(f : (i j : ι) → C.X i ⟶ D.X j)
(i : ι)
(hi : ¬c.Rel i (c.next i))


/-- Interpret a natural isomorphism of the underlying monoidal functors as an
isomorphism of the braided monoidal functors.
-/
@[simps]
def mkIso {F G : BraidedFunctor C D} (i : F.toMonoidalFunctor ≅ G.toMonoidalFunctor) : F ≅ G

{F G : CategoryTheory.BraidedFunctor C D}

(CategoryTheory.BraidedFunctor.mkIso i).inv = i.inv


/-- 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 aecover_Ici : AECover μ l fun i => Ici (a i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[Preorder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a : ι → α}
(ha : Filter.Tendsto a l Filter.atBot)

MeasureTheory.AECover μ l fun i => Set.Ici (a i)


/-- The measure `μ.restrict μ.sigmaFiniteSetᶜ` takes only two values: 0 and ∞ . -/
lemma restrict_compl_sigmaFiniteSet_eq_zero_or_top (μ : Measure α) [SFinite μ] (s : Set α) :
    μ.restrict μ.sigmaFiniteSetᶜ s = 0 ∨ μ.restrict μ.sigmaFiniteSetᶜ s = ∞

{α : Type u_1}
{mα : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SFinite μ]
(s : Set α)

(μ.restrict μ.sigmaFiniteSetᶜ) s = 0 ∨ (μ.restrict μ.sigmaFiniteSetᶜ) s = ⊤


theorem continuous_extend [T3Space γ] {f : α → γ} (di : DenseInducing i)
    (hf : ∀ b, ∃ c, Tendsto f (comap i (𝓝 b)) (𝓝 c)) : Continuous (di.extend f)

(hf : ∀ (b : β), ∃ c, Filter.Tendsto f (Filter.comap i (𝓝 b)) (𝓝 c))


@[simp]
theorem comp_assoc {U V W Z : Type*} [Quiver U] [Quiver V] [Quiver W] [Quiver Z]
    (F : Prefunctor U V) (G : Prefunctor V W) (H : Prefunctor W Z) :
    (F.comp G).comp H = F.comp (G.comp H)

{U : Type u_1}
{V : Type u_2}
{W : Type u_3}
{Z : Type u_4}
[Quiver U]
[Quiver V]
[Quiver W]
[Quiver Z]
(F : U ⥤q V)
(G : V ⥤q W)
(H : W ⥤q Z)


theorem smooth_pi_space : Smooth I 𝓘(𝕜, ∀ i, Fi i) φ ↔ ∀ i, Smooth I 𝓘(𝕜, Fi i) fun x => φ x i

{𝕜 : 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]
{ι : Type u_21}
[Fintype ι]
{Fi : ι → Type u_22}
[(i : ι) → NormedAddCommGroup (Fi i)]
[(i : ι) → NormedSpace 𝕜 (Fi i)]
{φ : M → (i : ι) → Fi i}

Smooth I 𝓘(𝕜, (i : ι) → Fi i) φ ↔ ∀ (i : ι), Smooth I 𝓘(𝕜, Fi i) fun x => φ x i


@[to_additive Iic_add_Iio_subset]
theorem Iic_mul_Iio_subset' [LocallyFiniteOrderBot α] (a b : α) : Iic a * Iio b ⊆ Iio (a * b)

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

[CovariantClass α α (Function.swap HAdd.hAdd) LT.lt]

Finset.Iic a + Finset.Iio b ⊆ Finset.Iio (a + b)


theorem tan_div_sqrt_one_add_tan_sq {x : ℝ} (hx : 0 < cos x) :
    tan x / √(1 + tan x ^ 2) = sin x

Real.tan x / √(1 + Real.tan x ^ 2) = Real.sin x


theorem pos_iff_ne_zero {a : Fin (n + 1)} : 0 < a ↔ a ≠ 0


theorem signBijAux_surj {n : ℕ} {f : Perm (Fin n)} :
    ∀ a ∈ finPairsLT n, ∃ b ∈ finPairsLT n, signBijAux f b = a

{n : ℕ}
{f : Equiv.Perm (Fin n)}
(a : (_ : Fin n) × Fin n)

a ∈ Equiv.Perm.finPairsLT n → ∃ b ∈ Equiv.Perm.finPairsLT n, f.signBijAux b = a


@[simp]
theorem preimage_const_mul_Iio_of_neg (a : α) {c : α} (h : c < 0) :
    (c * ·) ⁻¹' Iio a = Ioi (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a : α)
{c : α}
(h : c < 0)

(fun x => c * x) ⁻¹' Set.Iio a = Set.Ioi (a / c)


lemma chainTop_isNonZero' (hα' : weightSpace M α ≠ ⊥) :
    (chainTop α β).IsNonZero

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(α : L → R)
(β : LieModule.Weight R L M)
(hα : α ≠ 0)
(hα' : LieModule.weightSpace M α ≠ ⊥)


theorem coeff_zero_X_mul (φ : R⟦X⟧) : coeff R 0 (X * φ) = 0

{R : Type u_1}
[Semiring R]
(φ : PowerSeries R)

(PowerSeries.coeff R 0) (PowerSeries.X * φ) = 0


@[csimp] theorem dropLast_eq_dropLastTR : @dropLast = @dropLastTR


theorem Countable.of_diff {s t : Set α} (h : (s \ t).Countable) (ht : t.Countable) : s.Countable

{α : Type u}
{s t : Set α}
(h : (s \ t).Countable)
(ht : t.Countable)


@[to_additive (attr := simp, to_additive) (reorder := 5 6) smul_apply]
theorem pow_apply [∀ i, Pow (f i) β] (x : ∀ i, f i) (b : β) (i : I) : (x ^ b) i = x i ^ b

{I : Type u}
{β : Type u_2}
{f : I → Type v₁}
[(i : I) → SMul β (f i)]
(b : β)
(x : (i : I) → f i)
(i : I)


lemma singularPart_of_not_haveLebesgueDecomposition (h : ¬ HaveLebesgueDecomposition μ ν) :
    μ.singularPart ν = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : ¬μ.HaveLebesgueDecomposition ν)


@[simp]
theorem reindexAlgEquiv_symm (e : m ≃ n) : (reindexAlgEquiv R A e).symm =
    reindexAlgEquiv R A e.symm

{m : Type u_2}
{n : Type u_3}
(R : Type u_11)
(A : Type u_12)
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq m]
[DecidableEq n]
[Semiring A]
[Algebra R A]
(e : m ≃ n)

(Matrix.reindexAlgEquiv R A e).symm = Matrix.reindexAlgEquiv R A e.symm


/-- The frontier of a closed set has no interior point. -/
theorem interior_frontier (h : IsClosed s) : interior (frontier s) = ∅

{X : Type u}
{s : Set X}
[TopologicalSpace X]
(h : IsClosed s)


@[to_additive (attr := simp)]
theorem length_toFreeSemigroup (x : FreeMagma α) : (toFreeSemigroup x).length = x.length

(FreeMagma.toFreeSemigroup x).length = x.length


@[simp]
theorem bernoulli_eval_zero (n : ℕ) : (bernoulli n).eval 0 = _root_.bernoulli n

Polynomial.eval 0 (Polynomial.bernoulli n) = bernoulli n


theorem setToSimpleFunc_smul_left {m : MeasurableSpace α} (T : Set α → F →L[ℝ] F') (c : ℝ)
    (f : α →ₛ F) : setToSimpleFunc (fun s => c • T s) f = c • setToSimpleFunc T f

{α : Type u_1}
{F : Type u_3}
{F' : Type u_4}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedAddCommGroup F']
[NormedSpace ℝ F']
{m : MeasurableSpace α}
(T : Set α → F →L[ℝ] F')
(c : ℝ)
(f : MeasureTheory.SimpleFunc α F)

MeasureTheory.SimpleFunc.setToSimpleFunc (fun s => c • T s) f = c • MeasureTheory.SimpleFunc.setToSimpleFunc T f


theorem prime_pow_dvd_iff_le {m p : Associates α} (h₁ : m ≠ 0) (h₂ : Irreducible p) {k : ℕ} :
    p ^ k ≤ m ↔ k ≤ count p m.factors

[(p : Associates α) → Decidable (Irreducible p)]


/-- The norm of the sum of two non-zero vectors equals the sum of their norms
if and only the angle between the two vectors is 0. -/
theorem norm_add_eq_add_norm_iff_angle_eq_zero {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    ‖x + y‖ = ‖x‖ + ‖y‖ ↔ angle x y = 0

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(hx : x ≠ 0)
(hy : y ≠ 0)

‖x + y‖ = ‖x‖ + ‖y‖ ↔ InnerProductGeometry.angle x y = 0


theorem edist_smul₀ (s : α) (x y : β) : edist (s • x) (s • y) = ‖s‖₊ • edist x y

{α : Type u_1}
{β : Type u_2}
[NormedDivisionRing α]
[SeminormedAddCommGroup β]
[Module α β]
[BoundedSMul α β]
(s : α)
(x y : β)


@[congr]
theorem ofFn_congr {m n : ℕ} (h : m = n) (f : Fin m → α) :
    ofFn f = ofFn fun i : Fin n => f (Fin.cast h.symm i)

{α : Type u}
{m n : ℕ}
(h : m = n)
(f : Fin m → α)

List.ofFn f = List.ofFn fun i => f (Fin.cast ⋯ i)


theorem neg_pi_lt_arg (x : ℂ) : -π < arg x


theorem forall_mem_target {p : β → Prop} : (∀ y ∈ e.target, p y) ↔ ∀ x ∈ e.source, p (e x)

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
{p : β → Prop}

(∀ y ∈ e.target, p y) ↔ ∀ x ∈ e.source, p (↑e x)


private lemma stolzCone_subset_stolzSet_aux' (s : ℝ) :
    ∃ M ε, 0 < M ∧ 0 < ε ∧ ∀ x y, 0 < x → x < ε → |y| < s * x →
      sqrt (x ^ 2 + y ^ 2) < M * (1 - sqrt ((1 - x) ^ 2 + y ^ 2))


/-- A multiplicative morphism between monoids gives a monoidal functor between the corresponding
discrete monoidal categories.
-/
@[to_additive (attr := simps) Discrete.addMonoidalFunctor]
def Discrete.monoidalFunctor (F : M →* N) : MonoidalFunctor (Discrete M) (Discrete N)

{M : Type u}
[AddMonoid M]
{N : Type u'}
[AddMonoid N]
(F : M →+ N)

(CategoryTheory.Discrete.addMonoidalFunctor F).ε = CategoryTheory.Discrete.eqToHom ⋯


theorem approx_mem_Icc_right_left (c : CU P) (n : ℕ) (x : X) :
    c.approx n x ∈ Icc (c.right.approx n x) (c.left.approx n x)

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(n : ℕ)
(x : X)

Urysohns.CU.approx n c x ∈ Set.Icc (Urysohns.CU.approx n c.right x) (Urysohns.CU.approx n c.left x)


@[simp]
theorem rightZigzagIso_hom : (rightZigzagIso η ε).hom = rightZigzag η.hom ε.hom

(η : CategoryTheory.CategoryStruct.id a ≅ CategoryTheory.CategoryStruct.comp f g)

(ε : CategoryTheory.CategoryStruct.comp g f ≅ CategoryTheory.CategoryStruct.id b)

(CategoryTheory.Bicategory.rightZigzagIso η ε).hom = CategoryTheory.Bicategory.rightZigzag η.hom ε.hom


@[to_additive eq_sub_iff_add_eq]
theorem eq_div_iff_mul_eq' : a = b / c ↔ a * c = b


@[simp]
theorem affineCombinationLineMapWeights_self [DecidableEq ι] (i : ι) (c : k) :
    affineCombinationLineMapWeights i i c = affineCombinationSingleWeights k i

{k : Type u_1}
[Ring k]
{ι : Type u_4}
[DecidableEq ι]
(i : ι)
(c : k)

Finset.affineCombinationLineMapWeights i i c = Finset.affineCombinationSingleWeights k i


theorem tendstoIxxClass_principal {s t : Set α} {Ixx : α → α → Set α} :
    TendstoIxxClass Ixx (𝓟 s) (𝓟 t) ↔ ∀ᵉ (x ∈ s) (y ∈ s), Ixx x y ⊆ t

{α : Type u_1}
{s t : Set α}
{Ixx : α → α → Set α}

Filter.TendstoIxxClass Ixx (𝓟 s) (𝓟 t) ↔ ∀ x ∈ s, ∀ y ∈ s, Ixx x y ⊆ t


theorem Decidable.or_iff_not_imp_left [Decidable a] : a ∨ b ↔ (¬a → b)

a ∨ b ↔ ¬a → b


@[simp]
theorem range_zero [RingHomSurjective τ₁₂] : range (0 : M →ₛₗ[τ₁₂] M₂) = ⊥

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]


@[simp]
theorem coeFn_sum {ι : Type*} (Q : ι → QuadraticMap R M N) (s : Finset ι) :
    ⇑(∑ i ∈ s, Q i) = ∑ i ∈ s, ⇑(Q i)

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
{ι : Type u_8}
(Q : ι → QuadraticMap R M N)
(s : Finset ι)


theorem memℒp_indicator_iff_restrict (hs : MeasurableSet s) :
    Memℒp (s.indicator f) p μ ↔ Memℒp f p (μ.restrict s)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
{s : Set α}
(hs : MeasurableSet s)

MeasureTheory.Memℒp (s.indicator f) p μ ↔ MeasureTheory.Memℒp f p (μ.restrict s)


theorem stronglyMeasurable_lineDeriv_uncurry (hf : Continuous f) :
    StronglyMeasurable (fun (p : E × E) ↦ lineDeriv 𝕜 f p.1 p.2)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[LocallyCompactSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[OpensMeasurableSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
[SecondCountableTopology E]
(hf : Continuous f)

MeasureTheory.StronglyMeasurable fun p => lineDeriv 𝕜 f p.1 p.2


@[mono]
theorem natPred_strictMono : StrictMono natPred


theorem ofReal_le_of_le_toReal {a : ℝ} {b : ℝ≥0∞} (h : a ≤ ENNReal.toReal b) :
    ENNReal.ofReal a ≤ b


theorem prod_mono_right (s : Subring R) : Monotone fun t : Subring S => s.prod t

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(s : Subring R)


theorem isReduced_take {ω : List B} (hω : cs.IsReduced ω) (j : ℕ) : cs.IsReduced (ω.take j)

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
{ω : List B}
(hω : cs.IsReduced ω)
(j : ℕ)


@[simp]
lemma zero_inv_app_obj (X : C) :
    (zero F s i).inv.app (F.obj X) =
      F.map ((shiftFunctorZero C A).inv.app X) ≫ (i 0).inv.app X

(i : (a : A) → F.comp (s a) ≅ (CategoryTheory.shiftFunctor C a).comp F)

[((CategoryTheory.whiskeringLeft C D D).obj F).Full]

[((CategoryTheory.whiskeringLeft C D D).obj F).Faithful]

(CategoryTheory.HasShift.Induced.zero F s i).inv.app (F.obj X) =
  CategoryTheory.CategoryStruct.comp (F.map ((CategoryTheory.shiftFunctorZero C A).inv.app X)) ((i 0).inv.app X)


/-- `Opens.map f` and `OpenNhds.map f` form a commuting square (up to natural isomorphism)
with the inclusion functors into `Opens X`. -/
@[simps! hom_app inv_app]
def inclusionMapIso (x : X) : inclusion (f x) ⋙ Opens.map f ≅ map f x ⋙ inclusion x

∀ (X_1 : TopologicalSpace.OpenNhds (f x)),
  (TopologicalSpace.OpenNhds.inclusionMapIso f x).inv.app X_1 =
    𝟙 ((TopologicalSpace.OpenNhds.inclusion x).obj ((TopologicalSpace.OpenNhds.map f x).obj X_1))


theorem ofNat_mul_negOfNat (m n : Nat) : (m : Nat) * negOfNat n = negOfNat (m * n)

↑m * Int.negOfNat n = Int.negOfNat (m * n)


@[simp]
theorem coe_top [Preorder α] : (⊤ : Iic a) = a


protected theorem le_max_left (a b : Int) : a ≤ max a b


theorem mul_add_div {m : Nat} (m_pos : m > 0) (x y : Nat) : (m * x + y) / m = x + y / m


@[simp]
theorem inclusion_rfl : inclusion (le_refl S₁) = AffineMap.id k S₁

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
{S₁ : AffineSubspace k P₁}
[Nonempty ↥S₁]

AffineSubspace.inclusion ⋯ = AffineMap.id k ↥S₁


/-- The pigeonhole principle for finitely many pigeons counted by heads: there is a pigeonhole with
at most as many pigeons as the floor of the average number of pigeons across all pigeonholes.  ("The
minimum is at most the mean" specialized to integers.)

More formally, given a function `f`, a finite sets `s` in its domain, a finite set `t` in its
codomain, and a natural number `n` such that `card s < card t * n`, there exists `y ∈ t` such that
its preimage in `s` has less than `n` elements. -/
theorem exists_card_fiber_lt_of_card_lt_mul (hn : s.card < t.card * n) :
    ∃ y ∈ t, (s.filter fun x => f x = y).card < n

{α : Type u}
{β : Type v}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}
{n : ℕ}
(hn : s.card < t.card * n)

∃ y ∈ t, (Finset.filter (fun x => f x = y) s).card < n


protected theorem memℒp {f : ι → α → β} {p : ℝ≥0∞} (hf : UniformIntegrable f p μ) (i : ι) :
    Memℒp (f i) p μ

{f : ι → α → β}

(hf : MeasureTheory.UniformIntegrable f p μ)


@[simp]
theorem coe_neg (v : VectorMeasure α M) : ⇑(-v) = -v

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommGroup M]
[TopologicalSpace M]
[TopologicalAddGroup M]
(v : MeasureTheory.VectorMeasure α M)


/-- The minimal polynomial of an element `x` is uniquely characterized by its defining property:
if there is another monic polynomial of minimal degree that has `x` as a root, then this polynomial
is equal to the minimal polynomial of `x`. See also `minpoly.unique` which relaxes the
assumptions on `S` in exchange for stronger assumptions on `R`. -/
theorem _root_.IsIntegrallyClosed.minpoly.unique {s : S} {P : R[X]} (hmo : P.Monic)
    (hP : Polynomial.aeval s P = 0)
    (Pmin : ∀ Q : R[X], Q.Monic → Polynomial.aeval s Q = 0 → degree P ≤ degree Q) :
    P = minpoly R s

(Pmin : ∀ (Q : R[X]), Q.Monic → (Polynomial.aeval s) Q = 0 → P.degree ≤ Q.degree)


lemma coe_injective [Nontrivial α] : Injective ((⇑) : Subspace η α ι → (η → α) → ι → α)

{η : Type u_5}
{α : Type u_6}
{ι : Type u_7}
[Nontrivial α]


@[simp]
theorem mk_coe (n h) : (PNat.val (⟨n, h⟩ : ℕ+) : ℕ) = n


@[simp]
theorem map_out {α β} {f : α → β} (a : Erased α) : (a.map f).out = f a.out

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(a : Erased α)


theorem mul_divByMonic_eq_iff_isRoot : (X - C a) * (p /ₘ (X - C a)) = p ↔ IsRoot p a

{R : Type u}
{a : R}
[CommRing R]
{p : R[X]}

(Polynomial.X - Polynomial.C a) * (p /ₘ (Polynomial.X - Polynomial.C a)) = p ↔ p.IsRoot a


theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1)

Real.Gamma s = ∫ (x : ℝ) in Set.Ioi 0, rexp (-x) * x ^ (s - 1)


@[to_additive Ioi_add_Ici_subset]
theorem Ioi_mul_Ici_subset' [LocallyFiniteOrderTop α] (a b : α) : Ioi a * Ici b ⊆ Ioi (a * b)

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

[CovariantClass α α (Function.swap HMul.hMul) LT.lt]

Finset.Ioi a * Finset.Ici b ⊆ Finset.Ioi (a * b)


theorem get!_eq_getD [Inhabited α] (a : Array α) : a.get! n = a.getD n default

{α : Type u_1}
{n : Nat}
[Inhabited α]
(a : Array α)


/-- Baire theorem: a countable intersection of dense open sets is dense. Formulated here with ⋂₀. -/
theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : ∀ s ∈ S, IsOpen s) (hS : S.Countable)
    (hd : ∀ s ∈ S, Dense s) : Dense (⋂₀ S)

{X : Type u_1}
[TopologicalSpace X]
[BaireSpace X]
{S : Set (Set X)}
(ho : ∀ s ∈ S, IsOpen s)
(hS : S.Countable)
(hd : ∀ s ∈ S, Dense s)


theorem intDegree_mul {x y : RatFunc K} (hx : x ≠ 0) (hy : y ≠ 0) :
    intDegree (x * y) = intDegree x + intDegree y

{K : Type u}
[Field K]
{x y : RatFunc K}
(hx : x ≠ 0)
(hy : y ≠ 0)

(x * y).intDegree = x.intDegree + y.intDegree


@[ext]
theorem ext {s t : UpperSet α} : (s : Set α) = t → s = t

{α : Type u_1}
[LE α]
{s t : UpperSet α}


lemma OpenEmbedding.functor_obj_injective {X Y : TopCat} {f : X ⟶ Y} (hf : OpenEmbedding f) :
    Function.Injective hf.isOpenMap.functor.obj

{X Y : TopCat}
{f : X ⟶ Y}
(hf : OpenEmbedding ⇑f)


/-- Given a basis `v` indexed by `ι`, the canonical linear equivalence between `ι → R` and `M` maps
a function `x : ι → R` to the linear combination `∑_i x i • v i`. -/
@[simp]
theorem Basis.equivFun_symm_apply [Fintype ι] (b : Basis ι R M) (x : ι → R) :
    b.equivFun.symm x = ∑ i, x i • b i

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]
(b : Basis ι R M)
(x : ι → R)


theorem neighborFinset_compl [DecidableEq V] [DecidableRel G.Adj] (v : V) :
    Gᶜ.neighborFinset v = (G.neighborFinset v)ᶜ \ {v}

{V : Type u_1}
(G : SimpleGraph V)
[Fintype V]
[DecidableEq V]
[DecidableRel G.Adj]
(v : V)


theorem add_mul_right_left {x y : R} (h : IsCoprime x y) (z : R) : IsCoprime (x + z * y) y

{R : Type u}
[CommRing R]
{x y : R}
(h : IsCoprime x y)
(z : R)


/-- This is used as the ext lemma instead of `AffineMap.pi_ext_nonempty` for reasons explained in
note [partially-applied ext lemmas]. Analogous to `LinearMap.pi_ext'`-/
@[ext]
theorem pi_ext_nonempty' [Nonempty ι] (h : ∀ i, f.comp (LinearMap.single i).toAffineMap =
    g.comp (LinearMap.single i).toAffineMap) : f = g

(h : ∀ (i : ι), f.comp (LinearMap.single i).toAffineMap = g.comp (LinearMap.single i).toAffineMap)


@[simp]
theorem compMultilinearMap_apply (g : M₂ →ₗ[R] M₃) (f : MultilinearMap R M₁ M₂) (m : ∀ i, M₁ i) :
    g.compMultilinearMap f m = g (f m)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
{M₃ : Type v₃}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[Module R M₃]
(g : M₂ →ₗ[R] M₃)
(f : MultilinearMap R M₁ M₂)
(m : (i : ι) → M₁ i)


lemma sheafAdjunctionCocontinuous_unit_app_val (F : Sheaf K A) :
    ((G.sheafAdjunctionCocontinuous A J K).unit.app F).val =
      (G.op.ranAdjunction A).unit.app F.val

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[∀ (F : Cᵒᵖ ⥤ A), G.op.HasPointwiseRightKanExtension F]


@[to_additive (attr := simp)]
theorem Set.range_one {α β : Type*} [One β] [Nonempty α] : Set.range (1 : α → β) = {1}

{α : Type u_3}
{β : Type u_4}
[One β]
[Nonempty α]


lemma iInter_congr {s t : ι → Set α} (h : ∀ i, s i = t i) : ⋂ i, s i = ⋂ i, t i

{α : Type u_1}
{ι : Sort u_4}
{s t : ι → Set α}
(h : ∀ (i : ι), s i = t i)


@[simp]
lemma piecewise_eq_of_not_mem {i : ι} (hi : i ∉ s) : s.piecewise f g i = g i

{ι : Type u_1}
{π : ι → Sort u_2}
(s : Finset ι)
(f g : (i : ι) → π i)
[(j : ι) → Decidable (j ∈ s)]
{i : ι}
(hi : i ∉ s)


theorem Restriction.subset (h : N ≤r M) : N.E ⊆ M.E

{α : Type u_1}
{M N : Matroid α}
(h : N.Restriction M)


@[simp] theorem Bool.not_beq_to_not_eq (a b : Bool) :
  (!(a == b)) = ¬(a = b)


theorem subset_ordConnectedComponent {t} [h : OrdConnected s] (hs : x ∈ s) (ht : s ⊆ t) :
    s ⊆ ordConnectedComponent t x

{α : Type u_1}
[LinearOrder α]
{s : Set α}
{x : α}
{t : Set α}
[h : s.OrdConnected]
(hs : x ∈ s)
(ht : s ⊆ t)


/-- The scalar multiplication of a constant and a `C^n` function is `C^n`. -/
theorem ContDiff.const_smul {f : E → F} (c : R) (hf : ContDiff 𝕜 n f) :
    ContDiff 𝕜 n fun y => c • f y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{R : Type u_3}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
{f : E → F}
(c : R)
(hf : ContDiff 𝕜 n f)


theorem exists_locallyConstant_fin_two (hC : IsLimit C) (f : LocallyConstant C.pt (Fin 2)) :
    ∃ (j : J) (g : LocallyConstant (F.obj j) (Fin 2)), f = g.comap (C.π.app _)

{F : CategoryTheory.Functor J Profinite}

(f : LocallyConstant (↑C.pt.toTop) (Fin 2))

∃ j g, f = LocallyConstant.comap (C.π.app j) g


@[to_additive]
theorem uniformContinuous_div : UniformContinuous fun p : α × α => p.1 / p.2

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]


theorem geom_sum_pos [StrictOrderedSemiring α] (hx : 0 ≤ x) (hn : n ≠ 0) :
    0 < ∑ i ∈ range n, x ^ i

{α : Type u}
{n : ℕ}
{x : α}
[StrictOrderedSemiring α]
(hx : 0 ≤ x)
(hn : n ≠ 0)


@[reassoc (attr := simp)]
lemma ι_sigmaIsoGlued_hom (i) :
    Sigma.ι f i ≫ (sigmaIsoGlued f).hom = (disjointGlueData f).ι i

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)
(i : ι)

CategoryTheory.Limits.Sigma.ι f i ≫ (AlgebraicGeometry.sigmaIsoGlued f).hom = (AlgebraicGeometry.disjointGlueData f).ι i


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ : CategoryTheory.Functor A T}
(i : L₁ ≅ L₂)

∀ {X Y : CategoryTheory.Comma L₂ R} (f : X ⟶ Y), ((CategoryTheory.Comma.mapLeftIso R i).inverse.map f).right = f.right


theorem sInf_gc :
    GaloisConnection (fun x => toDual (principal x)) fun F => sInf (ofDual F : PFilter P)

{P : Type u_1}
[CompleteSemilatticeInf P]

GaloisConnection (fun x => OrderDual.toDual (Order.PFilter.principal x)) fun F => sInf ↑(OrderDual.ofDual F)


@[simp]
theorem mem_top (x : K) : x ∈ (⊤ : Subfield K)


theorem inCompact.isBounded_iff : @IsBounded _ (inCompact X) s ↔ ∃ t, IsCompact t ∧ s ⊆ t

{X : Type u}
[TopologicalSpace X]
{s : Set X}

Bornology.IsBounded s ↔ ∃ t, IsCompact t ∧ s ⊆ t


/-- `count p n` can be expressed as the cardinality of `{k // k < n ∧ p k}`. -/
theorem count_eq_card_fintype (n : ℕ) : count p n = Fintype.card { k : ℕ // k < n ∧ p k }

(p : ℕ → Prop)
[DecidablePred p]
(n : ℕ)

Nat.count p n = Fintype.card { k // k < n ∧ p k }


/-- A morphism in `Type` is an epimorphism if and only if it is surjective.

See <https://stacks.math.columbia.edu/tag/003C>.
-/
theorem epi_iff_surjective {X Y : Type u} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f

CategoryTheory.Epi f ↔ Function.Surjective f


theorem HomogeneousIdeal.ext' {I J : HomogeneousIdeal 𝒜} (h : ∀ i, ∀ x ∈ 𝒜 i, x ∈ I ↔ x ∈ J) :
    I = J

(h : ∀ (i : ι), ∀ x ∈ 𝒜 i, x ∈ I ↔ x ∈ J)


lemma cauchy_pi_iff' {l : Filter (∀ i, α i)} [l.NeBot] :
    Cauchy l ↔ ∀ i, Cauchy (map (eval i) l)

{ι : Type u_1}
(α : ι → Type u)
[U : (i : ι) → UniformSpace (α i)]
{l : Filter ((i : ι) → α i)}
[l.NeBot]

Cauchy l ↔ ∀ (i : ι), Cauchy (Filter.map (Function.eval i) l)


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


@[to_additive]
theorem inv_mul_eq_one : a⁻¹ * b = 1 ↔ a = b


theorem nonneg_cases : ∀ {a : ℤ√d}, Nonneg a → ∃ x y : ℕ, a = ⟨x, y⟩ ∨ a = ⟨x, -y⟩ ∨ a = ⟨-x, y⟩

a.Nonneg → ∃ x y, a = { re := ↑x, im := ↑y } ∨ a = { re := ↑x, im := -↑y } ∨ a = { re := -↑x, im := ↑y }


theorem monotone_le {x : α} : Monotone (x ≤ ·)


@[to_additive]
theorem smul_finset_inter : a • (s ∩ t) = a • s ∩ a • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[Group α]
[MulAction α β]
{s t : Finset β}
{a : α}


@[to_additive subset_add_normalizer]
theorem subset_normalizer {s : Set G} (hs : IsSubgroup s) : s ⊆ normalizer s

{G : Type u_1}
[Group G]
{s : Set G}
(hs : IsSubgroup s)


@[to_additive exponent_eq_zero_addOrder_zero]
theorem exponent_eq_zero_of_order_zero {g : G} (hg : orderOf g = 0) : exponent G = 0

{G : Type u}
[Monoid G]
{g : G}
(hg : orderOf g = 0)


@[to_additive (attr := simp)]
theorem smul_apply [Group G] [MulAction G β] (g : G) (f : α ↪ β) (a : α) : (g • f) a = g • f a

{G : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Group G]
[MulAction G β]
(g : G)
(f : α ↪ β)
(a : α)


@[to_additive]
theorem union_div_inter_subset_union : (s₁ ∪ s₂) / (t₁ ∩ t₂) ⊆ s₁ / t₁ ∪ s₂ / t₂

{α : Type u_2}
[DecidableEq α]
[Sub α]
{s₁ s₂ t₁ t₂ : Finset α}


(A : Matrix.SpecialLinearGroup (Fin 2) R)


/-- The algebra isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyAlgEquiv [he : IsEmpty σ] : MvPolynomial σ R ≃ₐ[R] R

(R : Type u)
(σ : Type u_1)
[CommSemiring R]
[he : IsEmpty σ]
(a : R)

((MvPolynomial.isEmptyAlgEquiv R σ).symm a).support = if a = 0 then ∅ else {0}


@[simp]
theorem dickson_one : dickson k a 1 = X

{R : Type u_1}
[CommRing R]
(k : ℕ)
(a : R)


@[simp]
theorem sInf_apply [CompleteLattice β] (s : Set (α →o β)) (x : α) :
    sInf s x = ⨅ f ∈ s, (f : _) x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[CompleteLattice β]
(s : Set (α →o β))
(x : α)


/-- A linear equivalence between `Dual M ⊗ Dual N` and `Dual (M ⊗ N)` given bases for `M` and `N`.
It sends `f ⊗ g` to the composition of `TensorProduct.map f g` with the natural
isomorphism `R ⊗ R ≃ R`.
-/
@[simps!]
noncomputable def dualDistribEquivOfBasis (b : Basis ι R M) (c : Basis κ R N) :
    Dual R M ⊗[R] Dual R N ≃ₗ[R] Dual R (M ⊗[R] N)

{R : Type u_1}
{M : Type u_3}
{N : Type u_4}
{ι : Type u_5}
{κ : Type u_6}
[DecidableEq ι]
[DecidableEq κ]
[Fintype ι]
[Fintype κ]
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(b : Basis ι R M)
(c : Basis κ R N)

∀ (a : TensorProduct R (Module.Dual R M) (Module.Dual R N)) (a_1 : TensorProduct R M N),
  ((TensorProduct.dualDistribEquivOfBasis b c) a) a_1 =
    (TensorProduct.lid R R) (((TensorProduct.homTensorHomMap R M N R R) a) a_1)


@[simp]
theorem aroots_pow [CommRing S] [IsDomain S] [Algebra T S] (p : T[X]) (n : ℕ) :
    (p ^ n).aroots S = n • p.aroots S

{S : Type v}
{T : Type w}
[CommRing T]
[CommRing S]
[IsDomain S]
[Algebra T S]
(p : Polynomial T)
(n : ℕ)


/-- If `F` has odd characteristic, then `quadraticChar F` takes the value `-1`. -/
theorem quadraticChar_exists_neg_one (hF : ringChar F ≠ 2) : ∃ a, quadraticChar F a = -1

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
(hF : ringChar F ≠ 2)


lemma succAbove_last_apply (i : Fin n) : succAbove (last n) i = castSucc i


theorem diam_image_le (hf : LipschitzWith K f) (s : Set α) (hs : IsBounded s) :
    Metric.diam (f '' s) ≤ K * Metric.diam s

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
(s : Set α)
(hs : Bornology.IsBounded s)

Metric.diam (f '' s) ≤ ↑K * Metric.diam s


/-- The **Lusin-Souslin theorem**: the range of a continuous injective function defined on a Polish
space is Borel-measurable. -/
theorem measurableSet_range_of_continuous_injective {β : Type*} [TopologicalSpace γ]
    [PolishSpace γ] [TopologicalSpace β] [T2Space β] [MeasurableSpace β] [OpensMeasurableSpace β]
    {f : γ → β} (f_cont : Continuous f) (f_inj : Injective f) :
    MeasurableSet (range f)

{γ : Type u_3}
{β : Type u_4}
[TopologicalSpace γ]
[PolishSpace γ]
[TopologicalSpace β]
[T2Space β]
[MeasurableSpace β]
[OpensMeasurableSpace β]
{f : γ → β}
(f_cont : Continuous f)
(f_inj : Function.Injective f)


/-- If a sequence of bounded continuous functions tends to the indicator of a measurable set and
the functions are uniformly bounded, then their integrals against a finite measure tend to the
measure of the set.

A similar result with more general assumptions is
`MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator`.
-/
theorem measure_of_cont_bdd_of_tendsto_indicator [OpensMeasurableSpace Ω]
    (μ : Measure Ω) [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E)
    (fs : ℕ → Ω →ᵇ ℝ≥0) (fs_bdd : ∀ n ω, fs n ω ≤ c)
    (fs_lim : Tendsto (fun n ω ↦ fs n ω) atTop (𝓝 (indicator E fun _ ↦ (1 : ℝ≥0)))) :
    Tendsto (fun n ↦ lintegral μ fun ω ↦ fs n ω) atTop (𝓝 (μ E))

(fs : ℕ → Ω →ᵇ ℝ≥0)

(fs_bdd : ∀ (n : ℕ) (ω : Ω), (fs n) ω ≤ c)

(fs_lim : Filter.Tendsto (fun n ω => (fs n) ω) Filter.atTop (𝓝 (E.indicator fun x => 1)))

Filter.Tendsto (fun n => ∫⁻ (ω : Ω), ↑((fs n) ω) ∂μ) Filter.atTop (𝓝 (μ E))


@[to_additive (attr := simp)]
theorem liftOn₂_mk' {p : Sort*} (f : M → S → M → S → p) (H) (a c : M) (b d : S) :
    liftOn₂ ((monoidOf S).mk' a b) ((monoidOf S).mk' c d) f H = f a b c d

(H :
  ∀ {a a' : M} {b b' : ↥S} {c c' : M} {d d' : ↥S},
    (Localization.r S) (a, b) (a', b') → (Localization.r S) (c, d) (c', d') → f a b c d = f a' b' c' d')

((Localization.monoidOf S).mk' a b).liftOn₂ ((Localization.monoidOf S).mk' c d) f H = f a b c d


/-- Right component of the associator as a natural isomorphism. -/
@[simps!]
def associatorNatIsoRight (f : a ⟶ b) (g : b ⟶ c) (d : B) :
    (precomposing _ _ d).obj (f ≫ g) ≅ (precomposing ..).obj g ⋙ (precomposing ..).obj f

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
(f : a ⟶ b)
(g : b ⟶ c)
(d : B)
(X : c ⟶ d)

(CategoryTheory.Bicategory.associatorNatIsoRight f g d).hom.app X = (CategoryTheory.Bicategory.associator f g X).hom


theorem toPEquiv_symm (f : α ≃ β) : f.symm.toPEquiv = f.toPEquiv.symm

{α : Type u_1}
{β : Type u_2}
(f : α ≃ β)


@[simp]
theorem length_bind (s : Computation α) (f : α → Computation β) [_T1 : Terminates s]
    [_T2 : Terminates (f (get s))] : length (bind s f) = length (f (get s)) + length s

{α : Type u}
{β : Type v}
(s : Computation α)
(f : α → Computation β)
[_T1 : s.Terminates]
[_T2 : (f s.get).Terminates]

(s.bind f).length = (f s.get).length + s.length


/-- The existence of a left Kan extension of `g` along `f`. -/
class HasLeftKanExtension (f : a ⟶ b) (g : a ⟶ c) : Prop where
  hasInitial : HasInitial <| LeftExtension f g

[self : CategoryTheory.Bicategory.HasLeftKanExtension f g]

CategoryTheory.Limits.HasInitial (CategoryTheory.Bicategory.LeftExtension f g)


@[to_additive (attr := gcongr) sub_le_sub_left]
theorem div_le_div_left' (h : a ≤ b) (c : α) : c / b ≤ c / a

[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]


/-- A global integer is in the local integers. -/
lemma coe_mem_adicCompletionIntegers (r : R) :
    (r : adicCompletion K v) ∈ adicCompletionIntegers K v

(v : IsDedekindDomain.HeightOneSpectrum R)

↑r ∈ IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers K v


@[to_additive]
theorem mulLeftEmbedding_eq_mulRightEmbedding [CommSemigroup G] [IsCancelMul G] (g : G) :
    mulLeftEmbedding g = mulRightEmbedding g

{G : Type u_1}
[AddCommSemigroup G]
[IsCancelAdd G]
(g : G)

addLeftEmbedding g = addRightEmbedding g


lemma map_rightHomologyMap' : F.map (ShortComplex.rightHomologyMap' φ hr₁ hr₂) =
    ShortComplex.rightHomologyMap' (F.mapShortComplex.map φ) (hr₁.map F) (hr₂.map F)

F.map (CategoryTheory.ShortComplex.rightHomologyMap' φ hr₁ hr₂) =
  CategoryTheory.ShortComplex.rightHomologyMap' (F.mapShortComplex.map φ) (hr₁.map F) (hr₂.map F)


@[simp]
theorem invFun_eq_symm {e : A ≃⋆+* B} : EquivLike.inv e = e.symm

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
{e : A ≃⋆+* B}


theorem elim_eq_iff {u u' : α → γ} {v v' : β → γ} :
    Sum.elim u v = Sum.elim u' v' ↔ u = u' ∧ v = v'

{α : Type u_1}
{γ : Sort u_2}
{β : Type u_3}
{u u' : α → γ}
{v v' : β → γ}


@[simp]
theorem inf'_singleton {b : β} : ({b} : Finset β).inf' (singleton_nonempty _) f = f b

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
(f : β → α)
{b : β}


@[simp] theorem foldlM_eq [Monad m] (f : δ → α → β → m δ) (init l) :
    foldlM f init l = l.toList.foldlM (fun d (a, b) => f d a b) init

{m : Type u_1 → Type u_2}
{δ : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Monad m]
(f : δ → α → β → m δ)
(init : δ)
(l : Batteries.AssocList α β)

Batteries.AssocList.foldlM f init l =
  List.foldlM
    (fun d x =>
      match x with
      | (a, b) => f d a b)
    init l.toList


theorem iSup₂_mono' {f : ∀ i, κ i → α} {g : ∀ i', κ' i' → α} (h : ∀ i j, ∃ i' j', f i j ≤ g i' j') :
    ⨆ (i) (j), f i j ≤ ⨆ (i) (j), g i j

(h : ∀ (i : ι) (j : κ i), ∃ i' j', f i j ≤ g i' j')


theorem sum_incMatrix_apply_of_not_mem_edgeSet [Fintype α] (h : e ∉ G.edgeSet) :
    ∑ a, G.incMatrix R a e = 0

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[NonAssocSemiring R]
{e : Sym2 α}
[Fintype α]
(h : e ∉ G.edgeSet)

∑ a : α, SimpleGraph.incMatrix R G a e = 0


@[simp] theorem bne_left_inj  : ∀ (x y z : Bool), (x != y) = (x != z) ↔ y = z


protected lemma exists_congr' (h : ∀ b, p (e.symm b) ↔ q b) : (∃ a, p a) ↔ ∃ b, q b

{α : Sort u}
{β : Sort v}
{p : α → Prop}
{q : β → Prop}
(e : α ≃ β)
(h : ∀ (b : β), p (e.symm b) ↔ q b)


@[simp]
theorem aeval_map_algebraMap (x : B) (p : R[X]) : aeval x (map (algebraMap R A) p) = aeval x p

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
[CommSemiring R]
[CommSemiring A]
[Semiring B]
[Algebra R A]
[Algebra A B]
[Algebra R B]
[IsScalarTower R A B]
(x : B)
(p : R[X])

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


@[simp]
lemma preimage_coe_Ioi (x : ℝ) : Real.toEReal ⁻¹' Ioi x = Ioi x


lemma cfc_sum_univ {ι : Type*} [Fintype ι] (f : ι → R → R) (a : A)
    (hf : ∀ i, ContinuousOn (f i) (spectrum R a) := by cfc_cont_tac) :
    cfc (∑ i, f i) a = ∑ i, cfc (f i) a

(hf : ∀ (i : ι), ContinuousOn (f i) (spectrum R a) := by cfc_cont_tac)

cfc (∑ i : ι, f i) a = ∑ i : ι, cfc (f i) a


protected theorem Tendsto.const_mul {f : Filter α} {m : α → ℝ≥0∞} {a b : ℝ≥0∞}
    (hm : Tendsto m f (𝓝 b)) (hb : b ≠ 0 ∨ a ≠ ∞) : Tendsto (fun b => a * m b) f (𝓝 (a * b))

{α : Type u_1}
{f : Filter α}
{m : α → ℝ≥0∞}
{a b : ℝ≥0∞}
(hm : Filter.Tendsto m f (𝓝 b))
(hb : b ≠ 0 ∨ a ≠ ⊤)

Filter.Tendsto (fun b => a * m b) f (𝓝 (a * b))


@[simp]
theorem coe_toOrthonormalBasis [Fintype ι] (b : HilbertBasis ι 𝕜 E) :
    (b.toOrthonormalBasis : ι → E) = b

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
(b : HilbertBasis ι 𝕜 E)

⇑b.toOrthonormalBasis = fun i => b.repr.symm (lp.single 2 i 1)


/-- If two morphisms on `G` coincide on the elements of a basis, then they coincide. -/
lemma ext_hom (b : FreeGroupBasis ι G) (f g : G →* H) (h : ∀ i, f (b i) = g (b i)) : f = g

{ι : Type u_1}
{G : Type u_3}
{H : Type u_4}
[Group G]
[Group H]
(b : FreeGroupBasis ι G)
(f g : G →* H)
(h : ∀ (i : ι), f (b i) = g (b i))


theorem range_pow_padicValNat_subset_divisors {n : ℕ} (hn : n ≠ 0) :
    (Finset.range (padicValNat p n + 1)).image (p ^ ·) ⊆ n.divisors

Finset.image (fun x => p ^ x) (Finset.range (padicValNat p n + 1)) ⊆ n.divisors


/-- The gamma pdf is measurable. -/
@[measurability]
lemma measurable_gammaPDFReal (a r : ℝ) : Measurable (gammaPDFReal a r)

Measurable (ProbabilityTheory.gammaPDFReal a r)


theorem map_pow : ∀ (x) (n : ℕ), v (x ^ n) = v x ^ n

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
(x : R)
(n : ℕ)


/-- The matrix built from `Matrix.kronecker` corresponds to the linear map built from
`TensorProduct.map`. -/
theorem Matrix.toLin_kronecker (A : Matrix ι' ι R) (B : Matrix κ' κ R) :
    toLin (bM.tensorProduct bN) (bM'.tensorProduct bN') (A ⊗ₖ B) =
      TensorProduct.map (toLin bM bM' A) (toLin bN bN' B)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{M' : Type u_5}
{N' : Type u_6}
{ι : Type u_7}
{κ : Type u_8}
{ι' : Type u_10}
{κ' : Type u_11}
[DecidableEq ι]
[DecidableEq κ]
[Fintype ι]
[Fintype κ]
[Finite ι']
[Finite κ']
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup M']
[AddCommGroup N']
[Module R M]
[Module R N]
[Module R M']
[Module R N']
(bM : Basis ι R M)
(bN : Basis κ R N)
(bM' : Basis ι' R M')
(bN' : Basis κ' R N')
(A : Matrix ι' ι R)
(B : Matrix κ' κ R)

(Matrix.toLin (bM.tensorProduct bN) (bM'.tensorProduct bN')) (Matrix.kroneckerMap (fun x x_1 => x * x_1) A B) =
  TensorProduct.map ((Matrix.toLin bM bM') A) ((Matrix.toLin bN bN') B)


theorem _root_.Set.algebraMap_mem_center (r : R) : algebraMap R A r ∈ Set.center A

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


/-- A variant of `limitIsoFlipCompLim` where the arguments of `F` are flipped. -/
@[simps!]
def limitFlipIsoCompLim [HasLimitsOfShape J C] (F : K ⥤ J ⥤ C) : limit F.flip ≅ F ⋙ lim

(CategoryTheory.Limits.limitFlipIsoCompLim F).hom.app X =
  (CategoryTheory.Limits.limitObjIsoLimitCompEvaluation F.flip X).hom ≫
    (CategoryTheory.Limits.HasLimit.isoOfNatIso (CategoryTheory.flipCompEvaluation F X)).hom


theorem tan_two_mul {z : ℂ} : tan (2 * z) = (2 : ℂ) * tan z / ((1 : ℂ) - tan z ^ 2)

Complex.tan (2 * z) = 2 * Complex.tan z / (1 - Complex.tan z ^ 2)


theorem pow_bit1 {k : ℕ} {d : R} (_ : (a : R) ^ k = b) (_ : b * b = c) (_ : c * a = d) :
    a ^ (Nat.add (Nat.mul (nat_lit 2) k) (nat_lit 1)) = d

{R : Type u_1}
[CommSemiring R]
{a b c : R}
{k : ℕ}
{d : R}

a ^ k = b → b * b = c → c * a = d → a ^ (Nat.mul 2 k).add 1 = d


/-- Note that most of the lemmas about powers of two refer to it as `sq`. -/
@[to_additive two_nsmul] lemma pow_two (a : M) : a ^ 2 = a * a


theorem inv {f : Perm α} (h : IsThreeCycle f) : IsThreeCycle f⁻¹

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{f : Equiv.Perm α}
(h : f.IsThreeCycle)


@[simp] lemma ofEpiOfIsIsoOfMono'_H : (ofEpiOfIsIsoOfMono' φ h).H = h.H

(CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono' φ h).H = h.H


@[simp]
theorem coe_mk (f : A →ₐ[R] B) (h) : (mk f h : A →ₐ[R] B) = f

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(h : Continuous (↑↑f.toRingHom).toFun)


@[simp]
theorem norm_changeOriginSeriesTerm (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l) :
    ‖p.changeOriginSeriesTerm k l s hs‖ = ‖p (k + l)‖

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(k l : ℕ)
(s : Finset (Fin (k + l)))
(hs : s.card = l)


@[simp] lemma castAdd_inj {a b : Fin m} : castAdd n a = castAdd n b ↔ a = b

Fin.castAdd n a = Fin.castAdd n b ↔ a = b


theorem prod_comp (f : M₂ →ₗ[R] M₃) (g : M₂ →ₗ[R] M₄)
    (h : M →ₗ[R] M₂) : (f.prod g).comp h = (f.comp h).prod (g.comp h)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
(f : M₂ →ₗ[R] M₃)
(g : M₂ →ₗ[R] M₄)
(h : M →ₗ[R] M₂)


@[simp] theorem AlgHom.id_algebraCat_comp
    {R} [CommRing R] {G : Type u} [Ring G] [Algebra R G] {H : AlgebraCat.{u} R} (f : G →ₐ[R] H) :
    AlgHom.comp (𝟙 H) f = f

{R : Type u_1}
[CommRing R]
{G : Type u}
[Ring G]
[Algebra R G]
{H : AlgebraCat R}
(f : G →ₐ[R] ↑H)


theorem toFinsupp_apply_fin (n : Fin l.length) : l.toFinsupp n = l.get n

{M : Type u_1}
[Zero M]
(l : List M)
[DecidablePred fun x => l.getD x 0 ≠ 0]
(n : Fin l.length)


@[simp] theorem exists_eq_right : (∃ a, p a ∧ a = a') ↔ p a'


theorem isSuccLimit_iff_succ_ne : IsSuccLimit a ↔ ∀ b, succ b ≠ a

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}
[NoMaxOrder α]

Order.IsSuccLimit a ↔ ∀ (b : α), Order.succ b ≠ a


/-- Scaling by an inverse unit is the same as scaling by itself. -/
@[simp]
theorem units_inv_smul (u : Rˣ) (v : Module.Ray R M) : u⁻¹ • v = u • v

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(u : Rˣ)
(v : Module.Ray R M)


theorem Ideal.mem_homogeneousCore_of_homogeneous_of_mem {x : A} (h : SetLike.Homogeneous 𝒜 x)
    (hmem : x ∈ I) : x ∈ I.homogeneousCore 𝒜

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[DecidableEq ι]
[AddMonoid ι]
[GradedRing 𝒜]
{I : Ideal A}
{x : A}
(h : SetLike.Homogeneous 𝒜 x)
(hmem : x ∈ I)


theorem doublingGamma_add_one (s : ℝ) (hs : s ≠ 0) :
    doublingGamma (s + 1) = s * doublingGamma s

(s + 1).doublingGamma = s * s.doublingGamma


/-- Any non-zero natural number `m` is greater than
b^((number of digits in the base b representation of m) - 1)
-/
theorem base_pow_length_digits_le (b m : ℕ) (hb : 1 < b) :
    m ≠ 0 → b ^ (digits b m).length ≤ b * m


theorem cast_proof_irrel {β : Sort u} (h₁ h₂ : α = β) (a : α) : cast h₁ a = cast h₂ a


lemma subset_shatterer (h : IsLowerSet (𝒜 : Set (Finset α))) : 𝒜 ⊆ 𝒜.shatterer

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
(h : IsLowerSet ↑𝒜)


/-- A variant of `mul_inv_eq_iff_eq_mul₀` that moves the nonzero hypothesis to another variable. -/
lemma eq_mul_of_mul_inv_eq₀ (hb : b ≠ 0) (h : a * c⁻¹ = b) : a = b * c

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(hb : b ≠ 0)
(h : a * c⁻¹ = b)


@[simp]
theorem realize_top : (⊤ : L.BoundedFormula α l).Realize v xs ↔ True

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{v : α → M}
{xs : Fin l → M}


theorem closedBall_rpow_sub_one_eq_empty_aux {r t : ℝ} (hr : 0 < r) (ht : 1 < t) :
    Metric.closedBall (0 : E) (t ^ (-r⁻¹) - 1) = ∅

(E : Type u_1)
[NormedAddCommGroup E]
{r t : ℝ}
(hr : 0 < r)
(ht : 1 < t)

Metric.closedBall 0 (t ^ (-r⁻¹) - 1) = ∅


@[simp] lemma divInt_self' {n : ℤ} (hn : n ≠ 0) : n /. n = 1


@[to_additive]
theorem mulSupport_extend_one_subset {f : α → M'} {g : α → N} :
    mulSupport (f.extend g 1) ⊆ f '' mulSupport g

{α : Type u_1}
{M' : Type u_6}
{N : Type u_7}
[Zero N]
{f : α → M'}
{g : α → N}

Function.support (Function.extend f g 0) ⊆ f '' Function.support g


theorem inner_self_eq_norm_sq (x : E) : re ⟪x, x⟫ = ‖x‖ ^ 2

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x : E)


lemma nonsingular_zero_of_Δ_ne_zero (h : W.Equation 0 0) (hΔ : W.Δ ≠ 0) : W.Nonsingular 0 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
(h : W.Equation 0 0)
(hΔ : WeierstrassCurve.Δ W ≠ 0)


protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [InnerRegular μ] (f : α ≃ₜ β) : (Measure.map f μ).InnerRegular

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[BorelSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
[μ.InnerRegular]
(f : α ≃ₜ β)


theorem isClosed_range_comap_of_surjective (hf : Surjective f) :
    IsClosed (Set.range (comap f))

{R : Type u}
(S : Type v)
[CommRing R]
[CommRing S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)

IsClosed (Set.range ⇑(PrimeSpectrum.comap f))


theorem aemeasurable_restrict_of_antitoneOn [LinearOrder β] [OrderClosedTopology β] {μ : Measure β}
    {s : Set β} (hs : MeasurableSet s) {f : β → α} (hf : AntitoneOn f s) :
    AEMeasurable f (μ.restrict s)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[TopologicalSpace β]
[MeasurableSpace β]
[BorelSpace β]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
[LinearOrder β]
[OrderClosedTopology β]
{μ : MeasureTheory.Measure β}
{s : Set β}
(hs : MeasurableSet s)
{f : β → α}
(hf : AntitoneOn f s)


/-- The arrow `A --dZero--> Fun(G, A)` is isomorphic to the differential
`(inhomogeneousCochains A).d 0 1` of the complex of inhomogeneous cochains of `A`. -/
@[simps! hom_left hom_right inv_left inv_right]
def dZeroArrowIso : Arrow.mk ((inhomogeneousCochains A).d 0 1) ≅
    Arrow.mk (ModuleCat.ofHom (dZero A))

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

(groupCohomology.dZeroArrowIso A).inv.right = ↑(groupCohomology.oneCochainsLequiv A).symm


@[simp high]
theorem iterate_one : f^[1] = f


lemma card_ne_zero : s.card ≠ 0 ↔ s.Nonempty


@[simp]
theorem zero_eq_ofReal {p : ℝ} : 0 = ENNReal.ofReal p ↔ p ≤ 0


/-- The adjoint is unique: a map `A` is the adjoint of `B` iff it satisfies `⟪A x, y⟫ = ⟪x, B y⟫`
for all `x` and `y`. -/
theorem eq_adjoint_iff (A : E →ₗ[𝕜] F) (B : F →ₗ[𝕜] E) :
    A = LinearMap.adjoint B ↔ ∀ x y, ⟪A x, y⟫ = ⟪x, B y⟫

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[FiniteDimensional 𝕜 E]
[FiniteDimensional 𝕜 F]
(A : E →ₗ[𝕜] F)
(B : F →ₗ[𝕜] E)

A = LinearMap.adjoint B ↔ ∀ (x : E) (y : F), ⟪A x, y⟫_𝕜 = ⟪x, B y⟫_𝕜


theorem eq_lim_at_left_extendFrom_Ioo [TopologicalSpace α] [LinearOrder α] [DenselyOrdered α]
    [OrderTopology α] [TopologicalSpace β] [T2Space β] {f : α → β} {a b : α} {la : β} (hab : a < b)
    (ha : Tendsto f (𝓝[>] a) (𝓝 la)) : extendFrom (Ioo a b) f a = la

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[DenselyOrdered α]
[OrderTopology α]
[TopologicalSpace β]
[T2Space β]
{f : α → β}
{a b : α}
{la : β}
(hab : a < b)
(ha : Filter.Tendsto f (𝓝[>] a) (𝓝 la))


theorem map_div_atTop_eq_nat (k : ℕ) (hk : 0 < k) : map (fun a => a / k) atTop = atTop

Filter.map (fun a => a / k) Filter.atTop = Filter.atTop


theorem isLeast_Icc (h : a ≤ b) : IsLeast (Icc a b) a

{α : Type u}
[Preorder α]
{a b : α}
(h : a ≤ b)


/-- Assemble an `I`-indexed family of natural transformations into a single natural transformation.
-/
@[simps]
def pi' {E : Type*} [Category E] {F G : E ⥤ ∀ i, C i}
    (τ : ∀ i, F ⋙ Pi.eval C i ⟶ G ⋙ Pi.eval C i) : F ⟶ G

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

{F G : CategoryTheory.Functor E ((i : I) → C i)}

(τ : (i : I) → F.comp (CategoryTheory.Pi.eval C i) ⟶ G.comp (CategoryTheory.Pi.eval C i))

(CategoryTheory.NatTrans.pi' τ).app X i = (τ i).app X


@[simp]
theorem mem_attach (s : Sym α n) (x : { x // x ∈ s }) : x ∈ s.attach

{α : Type u_1}
{n : ℕ}
(s : Sym α n)
(x : { x // x ∈ s })


/-- The span of a union of an indexed family of sets is the sup of their spans. -/
theorem span_iUnion {ι : Type*} (s : ι → Set P) :
    affineSpan k (⋃ i, s i) = ⨆ i, affineSpan k (s i)

(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 : ι → Set P)


theorem nhds_left_sup_nhds_right (a : α) : 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
(a : α)


theorem mapsTo_extend (hs : s ⊆ f.source) :
    MapsTo (f.extend I) s ((f.extend I).symm ⁻¹' s ∩ range I)

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{s : Set M}
(hs : s ⊆ f.source)

Set.MapsTo (↑(f.extend I)) s (↑(f.extend I).symm ⁻¹' s ∩ Set.range ↑I)


@[to_additive]
theorem monotone_comap {f : M →ₙ* N} : Monotone (comap f)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}


theorem isAlgebraic_adjoin_simple {x : L} (hx : IsIntegral K x) : Algebra.IsAlgebraic K K⟮x⟯

{K : Type u}
[Field K]
{L : Type u_3}
[Field L]
[Algebra K L]
{x : L}
(hx : IsIntegral K x)


@[to_additive mem_closedBall_iff_norm]
theorem mem_closedBall_iff_norm'' : b ∈ closedBall a r ↔ ‖b / a‖ ≤ r

{E : Type u_6}
[SeminormedAddGroup E]
{a b : E}
{r : ℝ}


private theorem compRel_gen_gen_subset_gen_compRel {s t : Set (α × α)} :
    compRel (gen s) (gen t) ⊆ (gen (compRel s t) : Set (CauchyFilter α × CauchyFilter α))

{α : Type u}
[UniformSpace α]
{s t : Set (α × α)}

CauchyFilter.gen s ○ CauchyFilter.gen t ⊆ CauchyFilter.gen (s ○ t)


/-- When applied to `ε`, `DualNumber.lift` produces the element of `B` that squares to 0. -/
@[simp] theorem lift_apply_eps
    (fe : {fe : (A →ₐ[R] B) × B // fe.2 * fe.2 = 0 ∧ ∀ a, Commute fe.2 (fe.1 a)}) :
    lift fe (ε : A[ε]) = fe.val.2

(fe : { fe // fe.2 * fe.2 = 0 ∧ ∀ (a : A), Commute fe.2 (fe.1 a) })


theorem norm_integral_le_of_norm_le_const' {f : ℂ → E} {c : ℂ} {R C : ℝ}
    (hf : ∀ z ∈ sphere c |R|, ‖f z‖ ≤ C) : ‖∮ z in C(c, R), f z‖ ≤ 2 * π * |R| * C

(hf : ∀ z ∈ Metric.sphere c |R|, ‖f z‖ ≤ C)

‖∮ (z : ℂ) in C(c, R), f z‖ ≤ 2 * π * |R| * C


theorem liftp_iff' {α : Type u} (p : α → Prop) (a : P.A) (f : P.B a → α) :
    @Liftp.{u} P.Obj _ α p ⟨a, f⟩ ↔ ∀ i, p (f i)

{P : PFunctor.{u}}
{α : Type u}
(p : α → Prop)
(a : P.A)
(f : P.B a → α)

Functor.Liftp p ⟨a, f⟩ ↔ ∀ (i : P.B a), p (f i)


theorem trace_mul_comm [AddCommMonoid R] [CommSemigroup R] (A : Matrix m n R) (B : Matrix n m R) :
    trace (A * B) = trace (B * A)

{m : Type u_2}
{n : Type u_3}
{R : Type u_6}
[Fintype m]
[Fintype n]
[AddCommMonoid R]
[CommSemigroup R]
(A : Matrix m n R)
(B : Matrix n m R)


@[simp]
theorem associator_hom_apply {M N K : ModuleCat.{u} R} (m : M) (n : N) (k : K) :
    ((α_ M N K).hom : (M ⊗ N) ⊗ K ⟶ M ⊗ N ⊗ K) (m ⊗ₜ n ⊗ₜ k) = m ⊗ₜ (n ⊗ₜ k)

{R : Type u}
[CommRing R]
{M N K : ModuleCat R}
(m : ↑M)
(n : ↑N)
(k : ↑K)

(CategoryTheory.MonoidalCategory.associator M N K).hom ((m ⊗ₜ[R] n) ⊗ₜ[R] k) = m ⊗ₜ[R] n ⊗ₜ[R] k


@[simp] lemma map_bijective : Bijective (PLift.map f) ↔ Bijective f

Function.Bijective (PLift.map f) ↔ Function.Bijective f


@[simp]
theorem toDualTopEquiv_bot [LE α] : WithBot.toDualTopEquiv (⊥ : WithBot αᵒᵈ) = ⊥


@[to_additive]
theorem finprod_mem_congr (h₀ : s = t) (h₁ : ∀ x ∈ t, f x = g x) :
    ∏ᶠ i ∈ s, f i = ∏ᶠ i ∈ t, g i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f g : α → M}
{s t : Set α}
(h₀ : s = t)
(h₁ : ∀ x ∈ t, f x = g x)

∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ᶠ (i : α) (_ : i ∈ t), g i


@[simp] theorem getElem!_cons_succ [Inhabited α] {l : List α} : (a::l)[n+1]! = l[n]!

{α : Type u_1}
{a : α}
{n : Nat}
[Inhabited α]
{l : List α}


lemma IsHamiltonianCycle.map {H : SimpleGraph β} (f : G →g H) (hf : Bijective f)
    (hp : p.IsHamiltonianCycle) : (p.map f).IsHamiltonianCycle

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
{G : SimpleGraph α}
{a : α}
{p : G.Walk a a}
{H : SimpleGraph β}
(f : G →g H)
(hf : Function.Bijective ⇑f)
(hp : p.IsHamiltonianCycle)


theorem lift'_inf (f g : Filter α) {s : Set α → Set β} (hs : ∀ t₁ t₂, s (t₁ ∩ t₂) = s t₁ ∩ s t₂) :
    (f ⊓ g).lift' s = f.lift' s ⊓ g.lift' s

(hs : ∀ (t₁ t₂ : Set α), s (t₁ ∩ t₂) = s t₁ ∩ s t₂)


theorem OneOneReducible.of_equiv {α β} [Primcodable α] [Primcodable β] {e : α ≃ β} (q : β → Prop)
    (h : Computable e) : (q ∘ e) ≤₁ q

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{e : α ≃ β}
(q : β → Prop)
(h : Computable ⇑e)


@[simp]
theorem rank_ulift : Module.rank R (ULift.{w} M) = Cardinal.lift.{w} (Module.rank R M)

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]

Module.rank R (ULift.{w, v} M) = Cardinal.lift.{w, v} (Module.rank R M)


@[simp]
theorem realize_term_substructure {α : Type*} {S : L.Substructure M} (v : α → S) (t : L.Term α) :
    t.realize ((↑) ∘ v) = (↑(t.realize v) : M)

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{α : Type u_5}
{S : L.Substructure M}
(v : α → ↥S)
(t : L.Term α)

FirstOrder.Language.Term.realize (Subtype.val ∘ v) t = ↑(FirstOrder.Language.Term.realize v t)


/-- If `C` has all colimits of diagrams `parallelFamily f`, then it has all wide coequalizers -/
theorem hasWideCoequalizers_of_hasColimit_parallelFamily
    [∀ {J : Type w} {X Y : C} {f : J → (X ⟶ Y)}, HasColimit (parallelFamily f)] :
    HasWideCoequalizers.{w} C

[∀ {J : Type w} {X Y : C} {f : J → (X ⟶ Y)}, CategoryTheory.Limits.HasColimit (CategoryTheory.Limits.parallelFamily f)]


/-- `E.mkSol init`'s first `E.order` terms are `init`. -/
theorem mkSol_eq_init (init : Fin E.order → α) : ∀ n : Fin E.order, E.mkSol init n = init n

{α : Type u_1}
[CommSemiring α]
(E : LinearRecurrence α)
(init : Fin E.order → α)
(n : Fin E.order)


@[simp]
theorem star_eq_neg {a : ℍ[R]} : star a = -a ↔ a.re = 0

{R : Type u_3}
[CommRing R]
[NoZeroDivisors R]
[CharZero R]
{a : ℍ[R]}


@[simp]
theorem comp_id (f : CocompactMap α β) : f.comp (CocompactMap.id _) = f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : CocompactMap α β)


theorem genEigenspace_le_maximal (f : End R M) (μ : R) (k : ℕ) :
    f.genEigenspace μ k ≤ f.maxGenEigenspace μ

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f : Module.End R M)
(μ : R)
(k : ℕ)

(f.genEigenspace μ) k ≤ f.maxGenEigenspace μ


lemma frontier_ball_eq_empty : frontier (ball x r) = ∅

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
(x : X)
(r : ℝ)


@[simp]
theorem preimage_const_mul_Ioo (a b : α) {c : α} (h : 0 < c) :
    (c * ·) ⁻¹' Ioo a b = Ioo (a / c) (b / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : 0 < c)

(fun x => c * x) ⁻¹' Set.Ioo a b = Set.Ioo (a / c) (b / c)


@[to_additive]
theorem uniformGroup_iInf {ι : Sort*} {us' : ι → UniformSpace β}
    (h' : ∀ i, @UniformGroup β (us' i) _) : @UniformGroup β (⨅ i, us' i) _

{β : Type u_2}
[AddGroup β]
{ι : Sort u_3}
{us' : ι → UniformSpace β}
(h' : ∀ (i : ι), UniformAddGroup β)


/-- The map `fun t ↦ exp (t * I)` from `ℝ` to the unit circle in `ℂ` is smooth. -/
theorem contMDiff_expMapCircle : ContMDiff 𝓘(ℝ, ℝ) (𝓡 1) ∞ expMapCircle

ContMDiff 𝓘(ℝ, ℝ) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) ⊤ ⇑expMapCircle


theorem IsSemisimple.add_of_commute : (f + g).IsSemisimple

{M : Type u_2}
[AddCommGroup M]
{K : Type u_3}
[Field K]
[Module K M]
{f g : Module.End K M}
[FiniteDimensional K M]
[PerfectField K]
(comm : Commute f g)
(hf : f.IsSemisimple)
(hg : g.IsSemisimple)


theorem dfinsupp_sumAddHom_mem {β : ι → Type*} [∀ i, AddZeroClass (β i)] (S : Submodule R N)
    (f : Π₀ i, β i) (g : ∀ i, β i →+ N) (h : ∀ c, f c ≠ 0 → g c (f c) ∈ S) :
    DFinsupp.sumAddHom g f ∈ S

(h : ∀ (c : ι), f c ≠ 0 → (g c) (f c) ∈ S)


lemma covBy_iff_exists_cons : s ⋖ t ↔ ∃ a, ∃ ha : a ∉ s, s.cons a ha = t

s ⋖ t ↔ ∃ a, ∃ (ha : a ∉ s), Finset.cons a s ha = t


/-- If `n ≠ 0` in `F`, then `X ^ n - a` is separable for any `a ≠ 0`. -/
theorem separable_X_pow_sub_C {n : ℕ} (a : F) (hn : (n : F) ≠ 0) (ha : a ≠ 0) :
    Separable (X ^ n - C a)

{F : Type u}
[Field F]
{n : ℕ}
(a : F)
(hn : ↑n ≠ 0)
(ha : a ≠ 0)

(Polynomial.X ^ n - Polynomial.C a).Separable


@[simp]
theorem aleph0_add_nat (n : ℕ) : ℵ₀ + n = ℵ₀


@[to_additive]
theorem zero_mul {f : ℕ → M} (h : HasProd (fun n ↦ f (n + 1)) m) :
    HasProd f (f 0 * m)

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
{m : M}
[ContinuousAdd M]
{f : ℕ → M}
(h : HasSum (fun n => f (n + 1)) m)


theorem neg_norm_le_apply (f : C(α, ℝ)) (x : α) : -‖f‖ ≤ f x

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


@[to_additive rightAddCoset_zero]
theorem rightCoset_one : op (1 : α) • s = s

{α : Type u_1}
[AddMonoid α]
(s : Set α)


/--
A presheaf on a category which is `FinitaryExtensive` is a sheaf iff it preserves finite products.
-/
theorem Presheaf.isSheaf_iff_preservesFiniteProducts (F : Cᵒᵖ ⥤ D) :
    IsSheaf (extensiveTopology C) F ↔ Nonempty (PreservesFiniteProducts F)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.FinitaryPreExtensive C]
[CategoryTheory.FinitaryExtensive C]
(F : CategoryTheory.Functor Cᵒᵖ D)

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.extensiveTopology C) F ↔
  Nonempty (CategoryTheory.Limits.PreservesFiniteProducts F)


lemma Codisjoint.ne_iff (hab : Codisjoint a b) : a ≠ b ↔ a ≠ ⊤ ∨ b ≠ ⊤

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

a ≠ b ↔ a ≠ ⊤ ∨ b ≠ ⊤


@[simp]
theorem mem_inf {p p' : L.Substructure M} {x : M} : x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p'

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{p p' : L.Substructure M}
{x : M}


theorem UniformIntegrable.spec (hp : p ≠ 0) (hp' : p ≠ ∞) (hfu : UniformIntegrable f p μ) {ε : ℝ}
    (hε : 0 < ε) :
    ∃ C : ℝ≥0, ∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε

{f : ι → α → β}

(hfu : MeasureTheory.UniformIntegrable f p μ)

∃ C, ∀ (i : ι), MeasureTheory.eLpNorm ({x | C ≤ ‖f i x‖₊}.indicator (f i)) p μ ≤ ENNReal.ofReal ε


theorem subset_of_cons_subset {a : α} {l₁ l₂ : List α} : a :: l₁ ⊆ l₂ → l₁ ⊆ l₂

a :: l₁ ⊆ l₂ → l₁ ⊆ l₂


@[simp] lemma star_apply (f : CentroidHom α) (a : α) : (star f) a = star (f (star a))

{α : Type u_1}
[NonUnitalNonAssocSemiring α]
[StarRing α]
(f : CentroidHom α)
(a : α)


@[to_additive]
theorem map_comap_eq_self {f : M →ₙ* N} {S : Subsemigroup N} (h : S ≤ f.srange) :
    (S.comap f).map f = S

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
{S : Subsemigroup N}
(h : S ≤ f.srange)

Subsemigroup.map f (Subsemigroup.comap f S) = S


@[to_additive (attr := simp)]
theorem mem_mulSupport {f : α → M} {x : α} : x ∈ mulSupport f ↔ f x ≠ 1

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α → M}
{x : α}


@[simp]
theorem elim_of_ne (hj : j ∈ i :: l) (hji : j ≠ i) (v : TProd α (i :: l)) :
    v.elim hj = TProd.elim v.2 ((List.mem_cons.mp hj).resolve_left hji)

{ι : Type u}
{α : ι → Type v}
{i j : ι}
{l : List ι}
[DecidableEq ι]
(hj : j ∈ i :: l)
(hji : j ≠ i)
(v : List.TProd α (i :: l))


/-- Non-unital star algebra homomorphisms from `A` into a unital star `R`-algebra `C` lift uniquely
to `Unitization R A →⋆ₐ[R] C`. This is the universal property of the unitization. -/
@[simps! apply symm_apply apply_apply]
def starLift : (A →⋆ₙₐ[R] C) ≃ (Unitization R A →⋆ₐ[R] C)

{R : Type u_1}
{A : Type u_2}
{C : Type u_3}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
[Semiring C]
[Algebra R C]
[StarRing C]
[StarModule R C]
(φ : A →⋆ₙₐ[R] C)

Unitization.starLift φ = { toAlgHom := φ.toAlgHom, map_star' := ⋯ }


theorem IsBigOWith.comp_tendsto (hcfg : IsBigOWith c l f g) {k : β → α} {l' : Filter β}
    (hk : Tendsto k l' l) : IsBigOWith c l' (f ∘ k) (g ∘ k)

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{l : Filter α}
(hcfg : Asymptotics.IsBigOWith c l f g)
{k : β → α}
{l' : Filter β}
(hk : Filter.Tendsto k l' l)

Asymptotics.IsBigOWith c l' (f ∘ k) (g ∘ k)


@[simp]
theorem isPWO_union : IsPWO (s ∪ t) ↔ IsPWO s ∧ IsPWO t

{α : Type u_2}
[Preorder α]
{s t : Set α}


theorem stereo_right_inv (hv : ‖v‖ = 1) (w : (ℝ ∙ v)ᗮ) : stereoToFun v (stereoInvFun hv w) = w

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{v : E}
(hv : ‖v‖ = 1)
(w : ↥(Submodule.span ℝ {v})ᗮ)


theorem comp_inf'_eq_inf'_comp [SemilatticeInf γ] {s : Finset β} (H : s.Nonempty) {f : β → α}
    (g : α → γ) (g_inf : ∀ x y, g (x ⊓ y) = g x ⊓ g y) : g (s.inf' H f) = s.inf' H (g ∘ f)

(g_inf : ∀ (x y : α), g (x ⊓ y) = g x ⊓ g y)


@[to_additive tsum_pos]
theorem one_lt_tprod (hsum : Multipliable g) (hg : ∀ i, 1 ≤ g i) (i : ι) (hi : 1 < g i) :
    1 < ∏' i, g i

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
[OrderClosedTopology α]
{g : ι → α}
(hsum : Summable g)
(hg : ∀ (i : ι), 0 ≤ g i)
(i : ι)
(hi : 0 < g i)


@[simp]
lemma add_of_Y_ne {x₁ x₂ y₁ y₂ : F} {h₁ : W.Nonsingular x₁ y₁} {h₂ : W.Nonsingular x₂ y₂}
    (hy : y₁ ≠ W.negY x₂ y₂) :
    some h₁ + some h₂ = some (nonsingular_add h₁ h₂ fun _ ↦ hy)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
{h₁ : W.Nonsingular x₁ y₁}
{h₂ : W.Nonsingular x₂ y₂}
(hy : y₁ ≠ W.negY x₂ y₂)

WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ = WeierstrassCurve.Affine.Point.some ⋯


theorem wcovBy_iff_Ioo_eq : a ⩿ b ↔ a ≤ b ∧ Ioo a b = ∅


theorem subset_lowerBounds_upperBounds (s : Set α) : s ⊆ lowerBounds (upperBounds s)


theorem degree_minpolyGen [Nontrivial A] (pb : PowerBasis A S) :
    degree (minpolyGen pb) = pb.dim

{S : Type u_2}
[Ring S]
{A : Type u_4}
[CommRing A]
[Algebra A S]
[Nontrivial A]
(pb : PowerBasis A S)


theorem hasTrivialRadical_iff_no_abelian_ideals :
    HasTrivialRadical R L ↔ ∀ I : LieIdeal R L, IsLieAbelian I → I = ⊥

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]

LieAlgebra.HasTrivialRadical R L ↔ ∀ (I : LieIdeal R L), IsLieAbelian ↥↑I → I = ⊥


@[reassoc]
theorem map_on_summand₀ {Δ Δ' : SimplexCategoryᵒᵖ} (A : Splitting.IndexSet Δ) {θ : Δ ⟶ Δ'}
    {Δ'' : SimplexCategory} {e : Δ'.unop ⟶ Δ''} {i : Δ'' ⟶ A.1.unop} [Epi e] [Mono i]
    (fac : e ≫ i = θ.unop ≫ A.e) :
    Sigma.ι (summand K Δ) A ≫ map K θ =
      Termwise.mapMono K i ≫ Sigma.ι (summand K Δ') (Splitting.IndexSet.mk e)

(A : SimplicialObject.Splitting.IndexSet Δ)

{θ : Δ ⟶ Δ'}

CategoryTheory.Limits.Sigma.ι (AlgebraicTopology.DoldKan.Γ₀.Obj.summand K Δ) A ≫
    AlgebraicTopology.DoldKan.Γ₀.Obj.map K θ =
  AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K i ≫
    CategoryTheory.Limits.Sigma.ι (AlgebraicTopology.DoldKan.Γ₀.Obj.summand K Δ')
      (SimplicialObject.Splitting.IndexSet.mk e)


theorem mul_one_div_le_one {I : FractionalIdeal R₁⁰ K} : I * (1 / I) ≤ 1

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{I : FractionalIdeal R₁⁰ K}


lemma nextCoeff_eq_zero :
    p.nextCoeff = 0 ↔ p.natDegree = 0 ∨ 0 < p.natDegree ∧ p.coeff (p.natDegree - 1) = 0


theorem zero_def (α : Type*) : (0 : Language.ring.Term α) = Constants.term zeroFunc

0 = FirstOrder.Language.Constants.term FirstOrder.Ring.zeroFunc


/-- **Tietze extension theorem** for real-valued bounded continuous maps, a version for a closed
embedding. Let `e` be a closed embedding of a nonempty topological space `X` into a normal
topological space `Y`. Let `f` be a bounded continuous real-valued function on `X`. Let `t` be
a nonempty convex set of real numbers (we use `OrdConnected` instead of `Convex` to automatically
deduce this argument by typeclass search) such that `f x ∈ t` for all `x`. Then there exists
a bounded continuous real-valued function `g : Y →ᵇ ℝ` such that `g y ∈ t` for all `y` and
`g ∘ e = f`. -/
theorem exists_extension_forall_mem_of_closedEmbedding (f : X →ᵇ ℝ) {t : Set ℝ} {e : X → Y}
    [hs : OrdConnected t] (hf : ∀ x, f x ∈ t) (hne : t.Nonempty) (he : ClosedEmbedding e) :
    ∃ g : Y →ᵇ ℝ, (∀ y, g y ∈ t) ∧ g ∘ e = f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[NormalSpace Y]
(f : X →ᵇ ℝ)
{t : Set ℝ}
{e : X → Y}
[hs : t.OrdConnected]
(hf : ∀ (x : X), f x ∈ t)
(hne : t.Nonempty)
(he : ClosedEmbedding e)


theorem associated_mul_unit_right {β : Type*} [Monoid β] (a u : β) (hu : IsUnit u) :
    Associated a (a * u)

{β : Type u_5}
[Monoid β]
(a u : β)
(hu : IsUnit u)


@[simp]
theorem neg_div_self {a : K} (h : a ≠ 0) : -a / a = -1

{K : Type u_3}
[DivisionRing K]
{a : K}
(h : a ≠ 0)


@[simp] theorem reverse_suffix : reverse l₁ <:+ reverse l₂ ↔ l₁ <+: l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.reverse <:+ l₂.reverse ↔ l₁ <+: l₂


@[to_additive]
theorem image_eq_one_of_nmem_mulTSupport {f : X → α} {x : X} (hx : x ∉ mulTSupport f) : f x = 1

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


theorem uniformEquicontinuous_unique [Unique ι] {F : ι → β → α} :
    UniformEquicontinuous F ↔ UniformContinuous (F default)

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
[Unique ι]
{F : ι → β → α}


@[to_additive]
theorem dist_prod_prod_le_of_le (s : Finset ι) {f a : ι → E} {d : ι → ℝ}
    (h : ∀ b ∈ s, dist (f b) (a b) ≤ d b) :
    dist (∏ b ∈ s, f b) (∏ b ∈ s, a b) ≤ ∑ b ∈ s, d b

{ι : Type u_4}
{E : Type u_6}
[SeminormedCommGroup E]
(s : Finset ι)
{f a : ι → E}
{d : ι → ℝ}
(h : ∀ b ∈ s, dist (f b) (a b) ≤ d b)


theorem intCast_apply (n : ℤ) (i : ι) : (n : ∀ i, π i) i = n

{ι : Type u_2}
{π : ι → Type u_5}
[(i : ι) → IntCast (π i)]
(n : ℤ)
(i : ι)


lemma Monovary.div_right₀ (hg₁ : 0 ≤ g₁) (hg₂ : StrongLT 0 g₂) (h₁ : Monovary f g₁)
    (h₂ : Antivary f g₂) : Monovary f (g₁ / g₂)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{f : ι → α}
{g₁ g₂ : ι → β}
(hg₁ : 0 ≤ g₁)
(hg₂ : StrongLT 0 g₂)
(h₁ : Monovary f g₁)
(h₂ : Antivary f g₂)


theorem image (hs : IsStrongAntichain r s) {f : α → β} (hf : Surjective f)
    (h : ∀ a b, r' (f a) (f b) → r a b) : IsStrongAntichain r' (f '' s)

(h : ∀ (a b : α), r' (f a) (f b) → r a b)


theorem neg_ediv_of_dvd : ∀ {a b : Int}, b ∣ a → (-a) / b = -(a / b)


theorem map_fieldRange : f.fieldRange.map g = (g.comp f).fieldRange

{K : Type u}
{L : Type v}
{M : Type w}
[DivisionRing K]
[DivisionRing L]
[DivisionRing M]
(g : L →+* M)
(f : K →+* L)

Subfield.map g f.fieldRange = (g.comp f).fieldRange


theorem principal_zero {op : Ordinal → Ordinal → Ordinal} : Principal op 0

{op : Ordinal.{u_1} → Ordinal.{u_1} → Ordinal.{u_1}}


/-- Right multiplication by a unit of a monoid is a permutation of the underlying type. -/
@[to_additive (attr := simps (config := .asFn) apply)
"Right addition of an additive unit is a permutation of the underlying type."]
def mulRight (u : Mˣ) : Equiv.Perm M


@[to_additive (attr := simp, norm_cast)]
theorem coe_iInf {ι : Sort*} {S : ι → Submonoid M} : (↑(⨅ i, S i) : Set M) = ⋂ i, S i

{M : Type u_1}
[AddZeroClass M]
{ι : Sort u_4}
{S : ι → AddSubmonoid M}


theorem ae_restrict_iUnion_iff [Countable ι] (s : ι → Set α) (p : α → Prop) :
    (∀ᵐ x ∂μ.restrict (⋃ i, s i), p x) ↔ ∀ i, ∀ᵐ x ∂μ.restrict (s i), p x

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable ι]
(s : ι → Set α)
(p : α → Prop)

(∀ᵐ (x : α) ∂μ.restrict (⋃ i, s i), p x) ↔ ∀ (i : ι), ∀ᵐ (x : α) ∂μ.restrict (s i), p x


theorem inv_injective : Function.Injective (EquivLike.inv : E → β → α)

{E : Sort u_1}
{α : Sort u_3}
{β : Sort u_4}
[iE : EquivLike E α β]


@[simp]
theorem contMDiffAt_comp_diffeomorph_iff {m} (h : M ≃ₘ^n⟮I, J⟯ N) {f : N → M'} {x} (hm : m ≤ n) :
    ContMDiffAt I I' m (f ∘ h) x ↔ ContMDiffAt J I' m f (h x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n m : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)
{f : N → M'}
{x : M}
(hm : m ≤ n)

ContMDiffAt I I' m (f ∘ ⇑h) x ↔ ContMDiffAt J I' m f (h x)


theorem option_map {f : α → Option β} {g : α → β → σ} (hf : Computable f) (hg : Computable₂ g) :
    Computable fun a => (f a).map (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → Option β}
{g : α → β → σ}
(hf : Computable f)
(hg : Computable₂ g)

Computable fun a => Option.map (g a) (f a)


/--
`HasAffineProperty P Q` is a type class asserting that `P` is local at the target, and over affine
schemes, it is equivalent to `Q : AffineTargetMorphismProperty`.
To make the proofs easier, we state it instead as
1. `Q` is local at the target
2. `P f` if and only if `∀ U, Q (f ∣_ U)` ranging over all affine opens of `U`.
See `HasAffineProperty.iff`.
-/
class HasAffineProperty (P : MorphismProperty Scheme)
    (Q : outParam AffineTargetMorphismProperty) : Prop where
  isLocal_affineProperty : Q.IsLocal
  eq_targetAffineLocally' : P = targetAffineLocally Q

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

{Q : outParam AlgebraicGeometry.AffineTargetMorphismProperty}

[self : AlgebraicGeometry.HasAffineProperty P Q]

P = AlgebraicGeometry.targetAffineLocally Q


theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂


theorem add (hφ : IsSymmetric φ) (hψ : IsSymmetric ψ) : IsSymmetric (φ + ψ)

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{φ ψ : MvPolynomial σ R}
(hφ : φ.IsSymmetric)
(hψ : ψ.IsSymmetric)


/-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
sum of squares with the weights being ±1, `SignType` version. -/
theorem equivalent_sign_ne_zero_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R := ℝ) Q).SeparatingLeft) :
    ∃ w : Fin (FiniteDimensional.finrank ℝ M) → SignType,
      (∀ i, w i ≠ 0) ∧ Equivalent Q (weightedSumSquares ℝ fun i ↦ (w i : ℝ))

(hQ : LinearMap.SeparatingLeft (QuadraticMap.associated Q))

∃ w,
  (∀ (i : Fin (FiniteDimensional.finrank ℝ M)), w i ≠ 0) ∧
    QuadraticMap.Equivalent Q (QuadraticMap.weightedSumSquares ℝ fun i => ↑(w i))


/-- `MeasureTheory.Lp.const` as a `LinearMap`. -/
@[simps] protected def Lp.constₗ (𝕜 : Type*) [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E] :
    E →ₗ[𝕜] Lp E p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[MeasureTheory.IsFiniteMeasure μ]
(𝕜 : Type u_5)
[NormedRing 𝕜]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
(a : E)

(MeasureTheory.Lp.constₗ p μ 𝕜) a = (MeasureTheory.Lp.const p μ) a


theorem changeForm_ι_mul (m : M) (x : CliffordAlgebra Q) :
    changeForm h (ι (M := M) Q m * x) = ι (M := M) Q' m * changeForm h x
    - contractLeft (Q := Q') (B m) (changeForm h x)

(h : LinearMap.BilinMap.toQuadraticMap B = Q' - Q)

(CliffordAlgebra.changeForm h) ((CliffordAlgebra.ι Q) m * x) =
  (CliffordAlgebra.ι Q') m * (CliffordAlgebra.changeForm h) x -
    (CliffordAlgebra.contractLeft (B m)) ((CliffordAlgebra.changeForm h) x)


theorem ContDiffAt.ccos {n} (hf : ContDiffAt ℂ n f x) :
    ContDiffAt ℂ n (fun x => Complex.cos (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{n : ℕ∞}
(hf : ContDiffAt ℂ n f x)


/-- If the image of a morphism under a fully faithful functor in an isomorphism,
then the original morphisms is also an isomorphism.
-/
theorem isIso_of_fully_faithful (f : X ⟶ Y) [IsIso (F.map f)] : IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
[F.Full]
[F.Faithful]
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.IsIso (F.map f)]


/-- A multiplicative analogue of `Equiv.arrowCongr`,
where the equivalence between the targets is multiplicative.
-/
@[to_additive (attr := simps apply) "An additive analogue of `Equiv.arrowCongr`,
  where the equivalence between the targets is additive."]
def arrowCongr {M N P Q : Type*} [Mul P] [Mul Q] (f : M ≃ N) (g : P ≃* Q) :
    (M → P) ≃* (N → Q)

{M : Type u_12}
{N : Type u_13}
{P : Type u_14}
{Q : Type u_15}
[Add P]
[Add Q]
(f : M ≃ N)
(g : P ≃+ Q)
(h : M → P)
(n : N)

(AddEquiv.arrowCongr f g) h n = g (h (f.symm n))


@[to_additive]
theorem ThreeGPFree.image' [FunLike F α β] [MulHomClass F α β] (f : F) (hf : (s * s).InjOn f)
    (h : ThreeGPFree s) : ThreeGPFree (f '' s)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{s : Set α}
[FunLike F α β]
[AddHomClass F α β]
(f : F)
(hf : Set.InjOn (⇑f) (s + s))
(h : ThreeAPFree s)


theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0


/-- The cosine of an angle in a right-angled triangle as a ratio of sides. -/
theorem cos_oangle_add_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.cos (o.oangle (x + y) y) = ‖y‖ / ‖x + y‖

[hd2 : Fact (FiniteDimensional.finrank ℝ V = 2)]

(o.oangle (x + y) y).cos = ‖y‖ / ‖x + y‖


@[reassoc (attr := simp)]
theorem OplaxMonoidalFunctor.associativity_inv (F : OplaxMonoidalFunctor C D) (X Y Z : C) :
    F.δ X (Y ⊗ Z) ≫ F.obj X ◁ F.δ Y Z ≫ (α_ (F.obj X) (F.obj Y) (F.obj Z)).inv =
      F.map (α_ X Y Z).inv ≫ F.δ (X ⊗ Y) Z ≫ F.δ X Y ▷ F.obj Z

(F : CategoryTheory.OplaxMonoidalFunctor C D)

F.δ X (CategoryTheory.MonoidalCategory.tensorObj Y Z) ≫
    CategoryTheory.MonoidalCategory.whiskerLeft (F.obj X) (F.δ Y Z) ≫
      (CategoryTheory.MonoidalCategory.associator (F.obj X) (F.obj Y) (F.obj Z)).inv =
  F.map (CategoryTheory.MonoidalCategory.associator X Y Z).inv ≫
    F.δ (CategoryTheory.MonoidalCategory.tensorObj X Y) Z ≫
      CategoryTheory.MonoidalCategory.whiskerRight (F.δ X Y) (F.obj Z)


theorem localization_away_map_finiteType (r : R) [IsLocalization.Away r R']
    [IsLocalization.Away (f r) S'] (hf : f.FiniteType) :
    (IsLocalization.Away.map R' S' f r).FiniteType

{R S : Type u}
[CommRing R]
[CommRing S]
(R' S' : Type u)
[CommRing R']
[CommRing S']
(f : R →+* S)
[Algebra R R']
[Algebra S S']
(r : R)
[IsLocalization.Away r R']
[IsLocalization.Away (f r) S']
(hf : f.FiniteType)


lemma HasFPowerSeriesAt.prod {e : E} {f : E → F} {g : E → G}
    {p : FormalMultilinearSeries 𝕜 E F} {q : FormalMultilinearSeries 𝕜 E G}
    (hf : HasFPowerSeriesAt f p e) (hg : HasFPowerSeriesAt g q e) :
    HasFPowerSeriesAt (fun x ↦ (f x, g x)) (p.prod q) e

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{e : E}
{f : E → F}
{g : E → G}
{p : FormalMultilinearSeries 𝕜 E F}
{q : FormalMultilinearSeries 𝕜 E G}
(hf : HasFPowerSeriesAt f p e)
(hg : HasFPowerSeriesAt g q e)

HasFPowerSeriesAt (fun x => (f x, g x)) (p.prod q) e


theorem coeff_pow_eq_ite_of_natDegree_le_of_le {o : ℕ}
    (pn : natDegree p ≤ n) (mno : m * n ≤ o) :
    coeff (p ^ m) o = if o = m * n then (coeff p n) ^ m else 0

{R : Type u}
{m n : ℕ}
[Semiring R]
{p : R[X]}
{o : ℕ}
(pn : p.natDegree ≤ n)
(mno : m * n ≤ o)

(p ^ m).coeff o = if o = m * n then p.coeff n ^ m else 0


@[simp] theorem mem_reverse {x : α} {as : List α} : x ∈ reverse as ↔ x ∈ as


@[simp]
theorem orderLHom_order : orderLHom Language.order = LHom.id Language.order

FirstOrder.Language.order.orderLHom = FirstOrder.Language.LHom.id FirstOrder.Language.order


theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} :
    G.incMatrix R a e = (G.incidenceSet a).indicator 1 e

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[Zero R]
[One R]
{a : α}
{e : Sym2 α}

SimpleGraph.incMatrix R G a e = (G.incidenceSet a).indicator 1 e


/-- When a list of the form `[...xs, sep, ...as]` is split on `p`, the first element is `xs`,
  assuming no element in `xs` satisfies `p` but `sep` does satisfy `p` -/
theorem splitOnP_first (h : ∀ x ∈ xs, ¬p x) (sep : α) (hsep : p sep) (as : List α) :
    (xs ++ sep :: as).splitOnP p = xs :: as.splitOnP p

{α : Type u}
(p : α → Bool)
(xs : List α)
(h : ∀ (x : α), x ∈ xs → ¬p x = true)
(sep : α)
(hsep : p sep = true)
(as : List α)

List.splitOnP p (xs ++ sep :: as) = xs :: List.splitOnP p as


@[simp]
theorem includeLeft_apply [SMulCommClass R S A] (a : A) :
    (includeLeft : A →ₐ[S] A ⊗[R] B) a = a ⊗ₜ 1

{R : Type uR}
{S : Type uS}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CommSemiring S]
[Algebra S A]
[SMulCommClass R S A]
(a : A)

Algebra.TensorProduct.includeLeft a = a ⊗ₜ[R] 1


@[to_additive] lemma Antivary.mul_right (h₁ : Antivary f g₁) (h₂ : Antivary f g₂) :
    Antivary f (g₁ * g₂)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[LinearOrderedAddCommGroup β]
{f : ι → α}
{g₁ g₂ : ι → β}
(h₁ : Antivary f g₁)
(h₂ : Antivary f g₂)


@[simp]
theorem normSq_ofReal (r : ℝ) : normSq r = r * r


@[simp]
theorem vadd_right_cancel_iff {g₁ g₂ : G} (p : P) : g₁ +ᵥ p = g₂ +ᵥ p ↔ g₁ = g₂

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
{g₁ g₂ : G}
(p : P)


@[to_additive]
theorem inv_mem_inv : a⁻¹ ∈ s⁻¹ ↔ a ∈ s

{α : Type u_2}
[InvolutiveInv α]
{s : Set α}
{a : α}

a⁻¹ ∈ s⁻¹ ↔ a ∈ s


theorem iInter₂_eq_empty_iff {s : ∀ i, κ i → Set α} :
    ⋂ (i) (j), s i j = ∅ ↔ ∀ a, ∃ i j, a ∉ s i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}

⋂ i, ⋂ j, s i j = ∅ ↔ ∀ (a : α), ∃ i j, a ∉ s i j


@[simp]
theorem isBounded_iUnion [Finite ι] {s : ι → Set α} :
    IsBounded (⋃ i, s i) ↔ ∀ i, IsBounded (s i)

{ι : Type u_1}
{α : Type u_2}
[Bornology α]
[Finite ι]
{s : ι → Set α}

Bornology.IsBounded (⋃ i, s i) ↔ ∀ (i : ι), Bornology.IsBounded (s i)


theorem card_Ioc : (Ioc f g).card = (∏ i ∈ f.support ∪ g.support, (Icc (f i) (g i)).card) - 1

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
[(i : ι) → LocallyFiniteOrder (α i)]
(f g : Π₀ (i : ι), α i)

(Finset.Ioc f g).card = ∏ i ∈ f.support ∪ g.support, (Finset.Icc (f i) (g i)).card - 1


/-- The induced linear map from `I` to the span of `I` in an `R`-algebra `S`. -/
@[simps!]
def idealMap (I : Ideal R) : I →ₗ[R] I.map (algebraMap R S)

{R : Type u_1}
[CommSemiring R]
(S : Type u_2)
[Semiring S]
[Algebra R S]
(I : Ideal R)
(c : ↥I)

↑((Algebra.idealMap S I) c) = (algebraMap R S) ↑c


@[to_additive]
theorem le_centralizer_iff_isCommutative : K ≤ centralizer K ↔ K.IsCommutative

{G : Type u_1}
[Group G]
{K : Subgroup G}

K ≤ Subgroup.centralizer ↑K ↔ K.IsCommutative


theorem involutory_invAct_eq_act {R : Type*} [Rack R] (h : IsInvolutory R) (x y : R) :
    x ◃⁻¹ y = x ◃ y

{R : Type u_2}
[Rack R]
(h : Rack.IsInvolutory R)
(x y : R)


theorem isIso_of_hom_comp_eq_id (g : X ⟶ Y) [IsIso g] {f : Y ⟶ X} (h : g ≫ f = 𝟙 X) : IsIso f

(h : CategoryTheory.CategoryStruct.comp g f = CategoryTheory.CategoryStruct.id X)


@[to_additive le_posPart] lemma le_oneLePart (a : α) : a ≤ a⁺ᵐ

{α : Type u_1}
[Lattice α]
[AddGroup α]
(a : α)


@[to_additive (attr := simp)] -- TODO: make this a scoped instance in the `Pointwise` namespace
lemma mul_neBot_iff : (f * g).NeBot ↔ f.NeBot ∧ g.NeBot


@[simp]
theorem cospanCompIso_hom_app_right : (cospanCompIso F f g).hom.app WalkingCospan.right = 𝟙 _

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

(CategoryTheory.Limits.cospanCompIso F f g).hom.app CategoryTheory.Limits.WalkingCospan.right =
  𝟙 ((CategoryTheory.Limits.cospan f g ⋙ F).obj CategoryTheory.Limits.WalkingCospan.right)


theorem inter_eq_compl_compl_union_compl (s t : Set α) : s ∩ t = (sᶜ ∪ tᶜ)ᶜ


theorem Continuous.mul {β : Type*} [TopologicalSpace β] {f g : β → Completion α}
    (hf : Continuous f) (hg : Continuous g) : Continuous fun b => f b * g b

{α : Type u_1}
[Ring α]
[UniformSpace α]
[TopologicalRing α]
[UniformAddGroup α]
{β : Type u_2}
[TopologicalSpace β]
{f g : β → UniformSpace.Completion α}
(hf : Continuous f)
(hg : Continuous g)


/-- `sigmaFiberEquiv f` for `f : α → β` is the natural equivalence between
the type of all fibres of `f` and the total space `α`. -/
@[simps]
def sigmaFiberEquiv {α β : Type*} (f : α → β) : (Σ y : β, { x // f x = y }) ≃ α

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(x : α)

((Equiv.sigmaFiberEquiv f).symm x).fst = f x


@[reassoc]
theorem inv_comp_image_ι_map {X Y : A} (f : X ⟶ Y) :
    (iso L f).inv ≫ image.ι (L.map f) = L.map (image.ι f)

[{X Y Z : A} → (f : X ⟶ Z) → (g : Y ⟶ Z) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) L]

[{X Y Z : A} → (f : X ⟶ Y) → (g : X ⟶ Z) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.span f g) L]

CategoryTheory.CategoryStruct.comp (CategoryTheory.PreservesImage.iso L f).inv
    (CategoryTheory.Limits.image.ι (L.map f)) =
  L.map (CategoryTheory.Limits.image.ι f)


theorem circleMap_zero (R θ : ℝ) : circleMap 0 R θ = R * exp (θ * I)

circleMap 0 R θ = ↑R * cexp (↑θ * Complex.I)


{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
{t : ℝ}


@[simp]
theorem coeFn_zero : ⇑(0 : QuadraticMap R M N) = 0

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]


@[simp]
theorem neg_eq_bot_iff {x : EReal} : -x = ⊥ ↔ x = ⊤


lemma addZ_smul (P Q : Fin 3 → R) (u v : R) : addZ (u • P) (v • Q) = (u * v) ^ 2 * addZ P Q

{R : Type u}
[CommRing R]
(P Q : Fin 3 → R)
(u v : R)

WeierstrassCurve.Jacobian.addZ (u • P) (v • Q) = (u * v) ^ 2 * WeierstrassCurve.Jacobian.addZ P Q


theorem HasGradientAt.hasDerivAt (h : HasGradientAt g g' u) :
    HasDerivAt g (starRingEnd 𝕜 g') u

{𝕜 : Type u_1}
[RCLike 𝕜]
{g : 𝕜 → 𝕜}
{g' u : 𝕜}
(h : HasGradientAt g g' u)


theorem Disjoint.mul_right (H1 : Disjoint f g) (H2 : Disjoint f h) : Disjoint f (g * h)

{α : Type u_1}
{f g h : Equiv.Perm α}
(H1 : f.Disjoint g)
(H2 : f.Disjoint h)


@[simp]
theorem id_comp (f : LatticeHom α β) : (LatticeHom.id β).comp f = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)


theorem sub_apply : (f - g) x = f x - g x

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α)
[AddGroup β]
[TopologicalAddGroup β]
(f g : α →C_c β)


/-- Implementation of `CommMon_.equivLaxBraidedFunctorPUnit`. -/
@[simps!]
def unitIso :
    𝟭 (LaxBraidedFunctor (Discrete PUnit.{u + 1}) C) ≅
      laxBraidedToCommMon C ⋙ commMonToLaxBraided C

(X : CategoryTheory.LaxBraidedFunctor (CategoryTheory.Discrete PUnit.{u + 1}) C)

∀ (X_1 : CategoryTheory.Discrete PUnit.{u + 1}),
  ((CommMon_.EquivLaxBraidedFunctorPUnit.unitIso C).hom.app X).app X_1 = 𝟙 (X.obj X_1)


@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a))

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{β : Type v'}
{γ : Type u_3}
[Finite γ]
{f : α → β ⊕ γ}
{φ : L.Formula α}
{v : β → M}

(FirstOrder.Language.Formula.iExs f φ).Realize v ↔ ∃ i, φ.Realize fun a => Sum.elim v i (f a)


theorem of_reverse_eq {l : List α} : reverse l = l → Palindrome l


theorem image_eq_target_inter_inv_preimage {s : Set X} (h : s ⊆ e.source) :
    e '' s = e.target ∩ e.symm ⁻¹' s

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{s : Set X}
(h : s ⊆ e.source)