/-- Given a normal subgroup `Γ` of a topological group `G` with Haar measure `μ`, which is also
  right-invariant, and a finite volume fundamental domain `𝓕`, the quotient map to `G ⧸ Γ`,
  properly normalized, satisfies `QuotientMeasureEqMeasurePreimage`. -/
@[to_additive "Given a normal
subgroup `Γ` of an additive topological group `G` with Haar measure `μ`, which is also
right-invariant, and a finite volume fundamental domain `𝓕`, the quotient map to `G ⧸ Γ`,
properly normalized, satisfies `AddQuotientMeasureEqMeasurePreimage`."]
theorem IsFundamentalDomain.QuotientMeasureEqMeasurePreimage_HaarMeasure {𝓕 : Set G}
    (h𝓕 : IsFundamentalDomain Γ.op 𝓕 ν) [IsMulLeftInvariant μ] [SigmaFinite μ]
    {V : Set (G ⧸ Γ)} (hV : (interior V).Nonempty) (meas_V : MeasurableSet V)
    (hμK : μ V = ν ((π ⁻¹' V) ∩ 𝓕)) (neTopV : μ V ≠ ⊤) :
    QuotientMeasureEqMeasurePreimage ν μ

(h𝓕 : MeasureTheory.IsAddFundamentalDomain (↥Γ.op) 𝓕 ν)

(hμK : μ V = ν (QuotientAddGroup.mk ⁻¹' V ∩ 𝓕))


theorem sin_neg_of_neg_of_neg_pi_lt {x : ℝ} (hx0 : x < 0) (hpx : -π < x) : sin x < 0

{x : ℝ}
(hx0 : x < 0)
(hpx : -Real.pi < x)


@[to_additive (attr := simp) relindex_eq_one]
theorem relindex_eq_one : H.relindex K = 1 ↔ K ≤ H

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


/-- Given stopping times `τ` and `η` which are bounded below, `Set.piecewise s τ η` is also
a stopping time with respect to the same filtration. -/
theorem IsStoppingTime.piecewise_of_le (hτ_st : IsStoppingTime 𝒢 τ) (hη_st : IsStoppingTime 𝒢 η)
    (hτ : ∀ ω, i ≤ τ ω) (hη : ∀ ω, i ≤ η ω) (hs : MeasurableSet[𝒢 i] s) :
    IsStoppingTime 𝒢 (s.piecewise τ η)

{τ η : Ω → ι}

(hτ_st : MeasureTheory.IsStoppingTime 𝒢 τ)

(hη_st : MeasureTheory.IsStoppingTime 𝒢 η)

MeasureTheory.IsStoppingTime 𝒢 (s.piecewise τ η)


protected theorem tsub_le_tsub_iff_left (ha : AddLECancellable a) (hc : AddLECancellable c)
    (h : c ≤ a) : a - b ≤ a - c ↔ c ≤ b

{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
{a b c : α}
(ha : AddLECancellable a)
(hc : AddLECancellable c)
(h : c ≤ a)


theorem iInf_ge_eq_iInf_nat_add (u : ℕ → α) (n : ℕ) : ⨅ i ≥ n, u i = ⨅ i, u (i + n)

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

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


theorem le_add_caratheodory (m₁ m₂ : OuterMeasure α) :
    m₁.caratheodory ⊓ m₂.caratheodory ≤ (m₁ + m₂ : OuterMeasure α).caratheodory

{α : Type u_1}
(m₁ m₂ : MeasureTheory.OuterMeasure α)

m₁.caratheodory ⊓ m₂.caratheodory ≤ (m₁ + m₂).caratheodory


@[simp]
theorem connectedComponentEquiv_trans (φ : G ≃g G') (φ' : G' ≃g G'') :
    connectedComponentEquiv (φ.trans φ') =
    φ.connectedComponentEquiv.trans φ'.connectedComponentEquiv

{V : Type u}
{V' : Type v}
{V'' : Type w}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{G'' : SimpleGraph V''}
(φ : G ≃g G')
(φ' : G' ≃g G'')

SimpleGraph.Iso.connectedComponentEquiv (RelIso.trans φ φ') = φ.connectedComponentEquiv.trans φ'.connectedComponentEquiv


@[simp]
theorem coeff_monomial_same (n : σ →₀ ℕ) (a : R) : coeff R n (monomial R n a) = a

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(n : σ →₀ ℕ)
(a : R)

(MvPowerSeries.coeff R n) ((MvPowerSeries.monomial R n) a) = a


theorem fix_eq_ωSup : Part.fix f = ωSup (approxChain f)

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))

Part.fix ⇑f = OmegaCompletePartialOrder.ωSup (Part.Fix.approxChain f)


theorem nhdsWithin_Iic_eq'' [TopologicalSpace α] [Preorder α] [OrderTopology α] (a : α) :
    𝓝[≤] a = (⨅ l < a, 𝓟 (Ioi l)) ⊓ 𝓟 (Iic a)

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

𝓝[≤] a = (⨅ l, ⨅ (_ : l < a), 𝓟 (Set.Ioi l)) ⊓ 𝓟 (Set.Iic a)


theorem nodalWeight_ne_zero (hvs : Set.InjOn v s) (hi : i ∈ s) : nodalWeight s v i ≠ 0

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
{i : ι}
(hvs : Set.InjOn v ↑s)
(hi : i ∈ s)


@[to_additive]
theorem MulAction.dense_orbit [IsMinimal M α] (x : α) : Dense (orbit M x)

(M : Type u_1)
{α : Type u_3}
[Monoid M]
[TopologicalSpace α]
[MulAction M α]
[MulAction.IsMinimal M α]
(x : α)


theorem Units.embed_product_star [Monoid R] [StarMul R] (u : Rˣ) :
    Units.embedProduct R (star u) = star (Units.embedProduct R u)

{R : Type u}
[Monoid R]
[StarMul R]
(u : Rˣ)

(Units.embedProduct R) (star u) = star ((Units.embedProduct R) u)


@[to_additive]
theorem image_op_smul : (op '' s) • t = t * s


@[simp] protected theorem add_zero : ∀ a : Int, a + 0 = a


theorem lt_add_one_of_lt (h : a < b) : a < b + 1


@[simp]
theorem ofAdd_toAdd (x : Multiplicative α) : ofAdd (toAdd x) = x

Multiplicative.ofAdd (Multiplicative.toAdd x) = x


@[reassoc (attr := simp)]
theorem underlyingIso_inv_top_arrow {B : C} :
    (underlyingIso _).inv ≫ (⊤ : Subobject B).arrow = 𝟙 B

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{B : C}

(CategoryTheory.Subobject.underlyingIso (𝟙 B)).inv ≫ ⊤.arrow = 𝟙 B


theorem nhds_zero : 𝓝 (0 : ℝ≥0∞) = ⨅ (a) (_ : a ≠ 0), 𝓟 (Iio a)


theorem unbounded_lt_inter_lt [LinearOrder α] [NoMaxOrder α] (a : α) :
    Unbounded (· < ·) (s ∩ { b | a < b }) ↔ Unbounded (· < ·) s

{α : Type u_1}
{s : Set α}
[LinearOrder α]
[NoMaxOrder α]
(a : α)

Set.Unbounded (fun x x_1 => x < x_1) (s ∩ {b | a < b}) ↔ Set.Unbounded (fun x x_1 => x < x_1) s


/-- `annIdealGenerator 𝕜 a` is indeed a generator. -/
@[simp]
theorem span_singleton_annIdealGenerator (a : A) :
    Ideal.span {annIdealGenerator 𝕜 a} = annIdeal 𝕜 a

(𝕜 : Type u_1)
{A : Type u_2}
[Field 𝕜]
[Ring A]
[Algebra 𝕜 A]
(a : A)

Ideal.span {Polynomial.annIdealGenerator 𝕜 a} = Polynomial.annIdeal 𝕜 a


/-- Subtracting the first vector passed to `oangle` from the second vector negates the sign of
the angle. -/
theorem oangle_sign_sub_left_eq_neg (x y : V) :
    (o.oangle (y - x) y).sign = -(o.oangle x y).sign

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


protected theorem zsmul_mem {x : L} (hx : x ∈ S) (n : ℤ) : n • x ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{x : L}
(hx : x ∈ S)
(n : ℤ)


theorem measure_preimage_equiv {f : α ≃ᵐ β} (hf : MeasurePreserving f μa μb) (s : Set β) :
    μa (f ⁻¹' s) = μb s

{f : α ≃ᵐ β}

(hf : MeasureTheory.MeasurePreserving (⇑f) μa μb)


theorem Action_ρ_eq_ρ {A : Rep k G} : Action.ρ A = A.ρ

{k G : Type u}
[CommRing k]
[Monoid G]
{A : Rep k G}


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

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


lemma UniformEquicontinuous.uniformEquicontinuousOn {F : ι → β → α} (H : UniformEquicontinuous F)
    (S : Set β) : UniformEquicontinuousOn F S

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{F : ι → β → α}
(H : UniformEquicontinuous F)
(S : Set β)


theorem lipschitz_compContinuous {δ : Type*} [TopologicalSpace δ] (g : C(δ, α)) :
    LipschitzWith 1 fun f : α →ᵇ β => f.compContinuous g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{δ : Type u_2}
[TopologicalSpace δ]
(g : C(δ, α))

LipschitzWith 1 fun f => f.compContinuous g


theorem ball_smul_closedBall (p : Seminorm 𝕜 E) (r₁ : ℝ) {r₂ : ℝ} (hr₂ : r₂ ≠ 0) :
    Metric.ball (0 : 𝕜) r₁ • p.closedBall 0 r₂ ⊆ p.ball 0 (r₁ * r₂)

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
(r₁ : ℝ)
{r₂ : ℝ}
(hr₂ : r₂ ≠ 0)

Metric.ball 0 r₁ • p.closedBall 0 r₂ ⊆ p.ball 0 (r₁ * r₂)


protected theorem Antiperiodic.neg [AddGroup α] [InvolutiveNeg β] (h : Antiperiodic f c) :
    Antiperiodic f (-c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddGroup α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)


theorem sub_zero {X Y : C} (a : X ⟶ Y) : a - 0 = a


/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.

See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (𝕜 E : Type*) [NormedLinearOrderedField 𝕜] [NormedAddCommGroup E]
  [NormedSpace 𝕜 E] : Prop where
  strictConvex_closedBall : ∀ r : ℝ, 0 < r → StrictConvex 𝕜 (closedBall (0 : E) r)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedLinearOrderedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[self : StrictConvexSpace 𝕜 E]
(r : ℝ)

0 < r → StrictConvex 𝕜 (Metric.closedBall 0 r)


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

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

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


lemma MonovaryOn.mul_left₀ (hf₁ : ∀ i ∈ s, 0 ≤ f₁ i) (hf₂ : ∀ i ∈ s, 0 ≤ f₂ i)
    (h₁ : MonovaryOn f₁ g s) (h₂ : MonovaryOn f₂ g s) : MonovaryOn (f₁ * f₂) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedSemiring α]
[OrderedSemiring β]
{s : Set ι}
{f₁ f₂ : ι → α}
{g : ι → β}
(hf₁ : ∀ i ∈ s, 0 ≤ f₁ i)
(hf₂ : ∀ i ∈ s, 0 ≤ f₂ i)
(h₁ : MonovaryOn f₁ g s)
(h₂ : MonovaryOn f₂ g s)


lemma booleanGenerators : BooleanGenerators {I : LieIdeal R L | IsAtom I}

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

IsCompactlyGenerated.BooleanGenerators {I | IsAtom I}


@[to_additive (attr := simp)]
theorem unop_op (S : Subgroup G) : S.op.unop = S

{G : Type u_2}
[AddGroup G]
(S : AddSubgroup G)


theorem Filter.Tendsto.congr_dist {f₁ f₂ : ι → α} {p : Filter ι} {a : α}
    (h₁ : Tendsto f₁ p (𝓝 a)) (h : Tendsto (fun x => dist (f₁ x) (f₂ x)) p (𝓝 0)) :
    Tendsto f₂ p (𝓝 a)

{f₁ f₂ : ι → α}

(h : Filter.Tendsto (fun x => dist (f₁ x) (f₂ x)) p (𝓝 0))


@[simp, reassoc]
lemma homOfLE_op_comp_eqToHom {a b c : X} (hab : b ≤ a) (hbc : op b = op c) :
    (homOfLE hab).op ≫ eqToHom hbc = (homOfLE ((le_of_eq (op_injective hbc.symm)).trans hab)).op

{X : Type u}
[Preorder X]
{a b c : X}
(hab : b ≤ a)
(hbc : Opposite.op b = Opposite.op c)

CategoryTheory.CategoryStruct.comp (CategoryTheory.homOfLE hab).op (CategoryTheory.eqToHom hbc) =
  (CategoryTheory.homOfLE ⋯).op


@[to_additive]
theorem hasProd_lt (h : f ≤ g) (hi : f i < g i) (hf : HasProd f a₁) (hg : HasProd g a₂) :
    a₁ < a₂

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
[OrderClosedTopology α]
{f g : ι → α}
{a₁ a₂ : α}
{i : ι}
(h : f ≤ g)
(hi : f i < g i)
(hf : HasSum f a₁)
(hg : HasSum g a₂)


@[deprecated get_toList (since := "2024-05-08")]
theorem nthLe_toList (n : ℕ) (hn : n < length (toList p x)) :
    (toList p x).nthLe n hn = (p ^ n) x

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(p : Equiv.Perm α)
(x : α)
(n : ℕ)
(hn : n < (p.toList x).length)


/-- `LieSubmodule.Quotient.mk` as a `LieModuleHom`. -/
@[simps]
def mk' : M →ₗ⁅R,L⁆ M ⧸ N

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(N : LieSubmodule R L M)

∀ (a : M), (LieSubmodule.Quotient.mk' N) a = LieSubmodule.Quotient.mk a


/-- Change of variables. If `f` has continuous derivative `f'` on `[a, b]`,
and `g` is continuous on `f '' [a, b]`, then we can substitute `u = f x` to get
`∫ x in a..b, f' x • (g ∘ f) x = ∫ u in f a..f b, g u`.
Compared to `intervalIntegral.integral_comp_smul_deriv` we only require that `g` is continuous on
`f '' [a, b]`.
-/
theorem integral_comp_smul_deriv' {f f' : ℝ → ℝ} {g : ℝ → G}
    (h : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x) (h' : ContinuousOn f' (uIcc a b))
    (hg : ContinuousOn g (f '' [[a, b]])) :
    (∫ x in a..b, f' x • (g ∘ f) x) = ∫ x in f a..f b, g x

(h : ∀ x ∈ [[a, b]], HasDerivAt f (f' x) x)

∫ (x : ℝ) in a..b, f' x • (g ∘ f) x = ∫ (x : ℝ) in f a..f b, g x


theorem X_sub_C_mul_divByMonic_eq_sub_modByMonic {K : Type*} [Field K] (f : K[X]) (a : K) :
    (X - C a) * (f /ₘ (X - C a)) = f - f %ₘ (X - C a)

{K : Type u_1}
[Field K]
(f : K[X])
(a : K)

(Polynomial.X - Polynomial.C a) * (f /ₘ (Polynomial.X - Polynomial.C a)) = f - f %ₘ (Polynomial.X - Polynomial.C a)


@[simp]
theorem compl_eq_empty_iff (s : Finset α) : sᶜ = ∅ ↔ s = univ

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(s : Finset α)


theorem rev_involutive : Involutive (rev : Fin n → Fin n)


theorem exists_algHom_of_splits : ∃ φ : E →ₐ[F] K, φ.comp L.val = f

(hK' : ∀ (s : E), IsIntegral F s ∧ Polynomial.Splits (algebraMap F K) (minpoly F s))


@[simp]
theorem WalkingPair.equivBool_apply_right : WalkingPair.equivBool right = false

CategoryTheory.Limits.WalkingPair.equivBool CategoryTheory.Limits.WalkingPair.right = false


/-- Each element of the monoid defines an algebra homomorphism.

This is a stronger version of `MulSemiringAction.toRingHom` and
`DistribMulAction.toLinearMap`. -/
@[simps]
def toAlgHom (m : M) : A →ₐ[R] A

{M : Type u_1}
(R : Type u_3)
(A : Type u_4)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Monoid M]
[MulSemiringAction M A]
[SMulCommClass M R A]
(m : M)
(a : A)

(MulSemiringAction.toAlgHom R A m) a = m • a


theorem inverse_one_sub_nth_order (n : ℕ) :
    ∀ᶠ t in 𝓝 0, inverse ((1 : R) - t) = (∑ i ∈ range n, t ^ i) + t ^ n * inverse (1 - t)

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(n : ℕ)

∀ᶠ (t : R) in 𝓝 0, Ring.inverse (1 - t) = ∑ i ∈ Finset.range n, t ^ i + t ^ n * Ring.inverse (1 - t)


theorem Perm.subperm {l₁ l₂ : List α} (p : l₁ ~ l₂) : l₁ <+~ l₂

{α : Type u_1}
{l₁ l₂ : List α}
(p : l₁ ~ l₂)


/-- Whiskering on the left by `E : K ⥤ J` gives a functor from `Cocone F` to `Cocone (E ⋙ F)`.
-/
@[simps]
def whiskering (E : K ⥤ J) : Cocone F ⥤ Cocone (E ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(E : K ⥤ J)
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.Cocones.whiskering E).obj c = CategoryTheory.Limits.Cocone.whisker E c


/-- Associator for the vertical composition of oplax natural transformations. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
def associator (η : F ⟶ G) (θ : G ⟶ H) (ι : H ⟶ I) : (η ≫ θ) ≫ ι ≅ η ≫ θ ≫ ι

{F G H I : CategoryTheory.OplaxFunctor B C}

(CategoryTheory.OplaxNatTrans.associator η θ ι).hom.app a =
  (CategoryTheory.Bicategory.associator (η.app a) (θ.app a) (ι.app a)).hom


theorem mul_finset_sup {α} (r : ℝ≥0) (s : Finset α) (f : α → ℝ≥0) :
    r * s.sup f = s.sup fun a => r * f a

{α : Type u_1}
(r : ℝ≥0)
(s : Finset α)
(f : α → ℝ≥0)


@[to_additive (attr := continuity)]
theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n

{M : Type u_3}
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
(n : ℕ)


theorem Nontrivial.not_subset_empty (hs : s.Nontrivial) : ¬s ⊆ ∅

{α : Type u}
{s : Set α}
(hs : s.Nontrivial)


lemma pow_eq_mkRat (q : ℚ) (n : ℕ) : q ^ n = mkRat (q.num ^ n) (q.den ^ n)


theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
    (s.sup f).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r

{ι : Type u_1}
{α : Type u_2}
{r : α → α → Prop}
(s : Finset ι)
{f : ι → Set α}


theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B]
    {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤

{A : Type u}
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
{n : ℕ+}
[IsDomain B]
[h : IsCyclotomicExtension {n} A B]
{ζ : B}
(hζ : IsPrimitiveRoot ζ ↑n)


/-- If `b` is not linear independent, then `Algebra.discr A b = 0`. -/
theorem discr_zero_of_not_linearIndependent [IsDomain A] {b : ι → B}
    (hli : ¬LinearIndependent A b) : discr A b = 0

(A : Type u)
{B : Type v}
{ι : Type w}
[DecidableEq ι]
[CommRing A]
[CommRing B]
[Algebra A B]
[Fintype ι]
[IsDomain A]
{b : ι → B}
(hli : ¬LinearIndependent A b)


theorem hasLimit_iff_hasTerminal_cone (F : J ⥤ C) : HasLimit F ↔ HasTerminal (Cone F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : CategoryTheory.Functor J C)

CategoryTheory.Limits.HasLimit F ↔ CategoryTheory.Limits.HasTerminal (CategoryTheory.Limits.Cone F)


lemma WellFounded.prod_lex {ra : α → α → Prop} {rb : β → β → Prop} (ha : WellFounded ra)
    (hb : WellFounded rb) : WellFounded (Prod.Lex ra rb)

{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop}
(ha : WellFounded ra)
(hb : WellFounded rb)


@[simp]
theorem toDualTopEquiv_coe [LE α] (a : α) :
    WithBot.toDualTopEquiv ↑(toDual a) = toDual (a : WithTop α)

WithBot.toDualTopEquiv ↑(OrderDual.toDual a) = OrderDual.toDual ↑a


/-- Definition of `IsLittleO` in terms of filters. -/
theorem isLittleO_iff : f =o[l] g ↔ ∀ ⦃c : ℝ⦄, 0 < c → ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l : Filter α}

f =o[l] g ↔ ∀ ⦃c : ℝ⦄, 0 < c → ∀ᶠ (x : α) in l, ‖f x‖ ≤ c * ‖g x‖


/-- Evaluation as an `AlgHom` -/
@[simps!]
def evalₐ (R : Type*) [CommSemiring R] [Semiring Y] [Algebra R Y] (x : X) :
    LocallyConstant X Y →ₐ[R] Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(R : Type u_6)
[CommSemiring R]
[Semiring Y]
[Algebra R Y]
(x : X)

∀ (a : LocallyConstant X Y), (LocallyConstant.evalₐ R x) a = a x


lemma isCoprime_col (A : SL(2, R)) (j : Fin 2) : IsCoprime (A 0 j) (A 1 j)

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


theorem mul_nonneg_iff_left_nonneg_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hb : 0 < b) : 0 ≤ a * b ↔ 0 ≤ a

{α : Type u}
[Semiring α]
[LinearOrder α]
{a b : α}
[PosMulStrictMono α]
[MulPosStrictMono α]
(hb : 0 < b)


/-- Let `n : ℤ` and `s` a subset of a commutative group `G` that is invariant under preimage for
the map `x ↦ x^n`. Then `s` is invariant under the pointwise action of the subgroup of elements
`g : G` such that `g^(n^j) = 1` for some `j : ℕ`. (This subgroup is called the Prüfer subgroup when
 `G` is the `Circle` and `n` is prime.) -/
@[to_additive
      "Let `n : ℤ` and `s` a subset of an additive commutative group `G` that is invariant
      under preimage for the map `x ↦ n • x`. Then `s` is invariant under the pointwise action of
      the additive subgroup of elements `g : G` such that `(n^j) • g = 0` for some `j : ℕ`.
      (This additive subgroup is called the Prüfer subgroup when `G` is the `AddCircle` and `n` is
      prime.)"]
theorem smul_eq_self_of_preimage_zpow_eq_self {G : Type*} [CommGroup G] {n : ℤ} {s : Set G}
    (hs : (fun x => x ^ n) ⁻¹' s = s) {g : G} {j : ℕ} (hg : g ^ n ^ j = 1) : g • s = s

{G : Type u_1}
[CommGroup G]
{n : ℤ}
{s : Set G}
(hs : (fun x => x ^ n) ⁻¹' s = s)
{g : G}
{j : ℕ}
(hg : g ^ n ^ j = 1)


protected theorem IsCoveringMap.isCoveringMapOn (hf : IsCoveringMap f) :
    IsCoveringMapOn f Set.univ

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
(hf : IsCoveringMap f)


@[simp]
theorem coe_restrictScalars (V : Submodule R M) : (V.restrictScalars S : Set M) = V

(S : Type u_1)
{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Semiring S]
[Module S M]
[Module R M]
[SMul S R]
[IsScalarTower S R M]
(V : Submodule R M)


@[to_additive]
theorem mulSupport_comp_eq_preimage (g : β → M) (f : α → β) :
    mulSupport (g ∘ f) = f ⁻¹' mulSupport g

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[One M]
(g : β → M)
(f : α → β)

Function.mulSupport (g ∘ f) = f ⁻¹' Function.mulSupport g


@[to_additive (attr := simp high)]
theorem singleton_smul_singleton : ({a} : Set α) • ({b} : Set β) = {a • b}

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{a : α}
{b : β}


theorem exists_ne_of_one_lt_card (hs : 1 < s.card) (a : α) : ∃ b, b ∈ s ∧ b ≠ a

{α : Type u_1}
{s : Finset α}
(hs : 1 < s.card)
(a : α)


@[simp]
protected theorem «forall» {p : αᵒᵈ → Prop} : (∀ a, p a) ↔ ∀ a, p (toDual a)

(∀ (a : αᵒᵈ), p a) ↔ ∀ (a : α), p (OrderDual.toDual a)


@[deprecated getD_eq_getElem? (since := "2024-06-12")]
theorem getD_eq_get? : ∀ l n (a : α), getD l n a = (get? l n).getD a

{α : Type u_1}
(l : List α)
(n : Nat)
(a : α)


@[simp] lemma coe_toSupBotHom (f : BoundedLatticeHom α β) : ⇑f.toSupBotHom = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(f : BoundedLatticeHom α β)


theorem le_pi {m : ∀ i, OuterMeasure (α i)} {n : OuterMeasure (∀ i, α i)} :
    n ≤ OuterMeasure.pi m ↔
      ∀ s : ∀ i, Set (α i), (pi univ s).Nonempty → n (pi univ s) ≤ ∏ i, m i (s i)

{m : (i : ι) → MeasureTheory.OuterMeasure (α i)}

{n : MeasureTheory.OuterMeasure ((i : ι) → α i)}

n ≤ MeasureTheory.OuterMeasure.pi m ↔
  ∀ (s : (i : ι) → Set (α i)), (Set.univ.pi s).Nonempty → n (Set.univ.pi s) ≤ ∏ i : ι, (m i) (s i)


/-- Given a multiset which sums to `n`, construct a partition of `n` with the same multiset, but
without the zeros.
-/
@[simps]
def ofSums (n : ℕ) (l : Multiset ℕ) (hl : l.sum = n) : Partition n

(Nat.Partition.ofSums n l hl).parts = Multiset.filter (fun x => x ≠ 0) l


theorem continuousWithinAt_pi {ι : Type*} {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    {f : α → ∀ i, π i} {s : Set α} {x : α} :
    ContinuousWithinAt f s x ↔ ∀ i, ContinuousWithinAt (fun y => f y i) s x

{α : Type u_1}
[TopologicalSpace α]
{ι : Type u_7}
{π : ι → Type u_8}
[(i : ι) → TopologicalSpace (π i)]
{f : α → (i : ι) → π i}
{s : Set α}
{x : α}

ContinuousWithinAt f s x ↔ ∀ (i : ι), ContinuousWithinAt (fun y => f y i) s x


@[simp, mfld_simps]
theorem trans_refl : e.trans (PartialEquiv.refl β) = e

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


theorem exists_inv {I : Ideal R} [hI : I.IsMaximal] :
    ∀ {a : R ⧸ I}, a ≠ 0 → ∃ b : R ⧸ I, a * b = 1

{R : Type u}
[CommRing R]
{I : Ideal R}
[hI : I.IsMaximal]
{a : R ⧸ I}


/-- We say that `R` satisfies the rank condition if `(Fin n → R) →ₗ[R] (Fin m → R)` surjective
    implies `m ≤ n`. -/
class RankCondition : Prop where
  /-- Any surjective linear map from `Rⁿ` to `Rᵐ` guarantees `m ≤ n`. -/
  le_of_fin_surjective : ∀ {n m : ℕ} (f : (Fin n → R) →ₗ[R] Fin m → R), Surjective f → m ≤ n

{R : Type u}
[Semiring R]
[self : RankCondition R]
{n m : ℕ}
(f : (Fin n → R) →ₗ[R] Fin m → R)


theorem Fin.circulant_mul_comm [CommSemigroup α] [AddCommMonoid α] :
    ∀ {n} (v w : Fin n → α), circulant v * circulant w = circulant w * circulant v

{α : Type u_1}
[CommSemigroup α]
[AddCommMonoid α]
{n : ℕ}
(v w : Fin n → α)

Matrix.circulant v * Matrix.circulant w = Matrix.circulant w * Matrix.circulant v


/-- Every coequalizer of `(f, f)` is an isomorphism. -/
theorem isIso_colimit_cocone_parallelPair_of_self {c : Cofork f f} (h : IsColimit c) : IsIso c.π

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : X ⟶ Y}
{c : CategoryTheory.Limits.Cofork f f}
(h : CategoryTheory.Limits.IsColimit c)


/-- `Polynomial.derivative` as a derivation. -/
@[simps]
def derivative' : Derivation R R[X] R[X]

{R : Type u_1}
[CommSemiring R]
(a : Polynomial R)

Polynomial.derivative' a = Polynomial.derivative a


theorem up_injective : Injective (@up α)


@[simp]
theorem star_apply [∀ i, Star (f i)] (x : ∀ i, f i) (i : I) : star x i = star (x i)

{I : Type u}
{f : I → Type v}
[(i : I) → Star (f i)]
(x : (i : I) → f i)
(i : I)


@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
    ∏ x ∈ s, f x = s.fold ((· * ·) : β → β → β) 1 f

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
(s : Finset α)
(f : α → β)

∏ x ∈ s, f x = Finset.fold (fun x x_1 => x * x_1) 1 f s


theorem Ico_mem_nhdsWithin_Iic (H : b ∈ Ioo a c) : Ico a c ∈ 𝓝[≤] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b c : α}
(H : b ∈ Set.Ioo a c)


@[simp]
theorem toBoolRing_top : toBoolRing (⊤ : α) = 1


theorem eq_of_suffix_of_length_eq (h : l₁ <:+ l₂) : l₁.length = l₂.length → l₁ = l₂

{α : Type u_1}
{l₁ l₂ : List α}
(h : l₁ <:+ l₂)


/-- A proper map is closed. -/
lemma IsProperMap.isClosedMap (h : IsProperMap f) : IsClosedMap f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(h : IsProperMap f)


/-- The strong pigeonhole principle for finitely many pigeons and pigeonholes.  Given a function `f`
between finite types `α` and `β` and a number `n` such that `card β * n ≤ card α`, there exists an
element `y : β` such that its preimage has at least `n` elements. See also
`Fintype.exists_lt_card_fiber_of_mul_lt_card` for a stronger statement. -/
theorem exists_le_card_fiber_of_mul_le_card [Nonempty β] (hn : card β * n ≤ card α) :
    ∃ y : β, n ≤ (univ.filter fun x => f x = y).card

(hn : Fintype.card β * n ≤ Fintype.card α)

∃ y, n ≤ (Finset.filter (fun x => f x = y) Finset.univ).card


@[to_additive (attr := simp)]
theorem map_comp_map {I : Type*} [Group I] (M : Subgroup H) (O : Subgroup I) [M.Normal] [O.Normal]
    (f : G →* H) (g : H →* I) (hf : N ≤ Subgroup.comap f M) (hg : M ≤ Subgroup.comap g O)
    (hgf : N ≤ Subgroup.comap (g.comp f) O :=
      hf.trans ((Subgroup.comap_mono hg).trans_eq (Subgroup.comap_comap _ _ _))) :
    (map M O g hg).comp (map N M f hf) = map N O (g.comp f) hgf

(hgf : N ≤ AddSubgroup.comap (g.comp f) O := ⋯)

(QuotientAddGroup.map M O g hg).comp (QuotientAddGroup.map N M f hf) = QuotientAddGroup.map N O (g.comp f) hgf


theorem le_ndunion_right (s t : Multiset α) : t ≤ ndunion s t

{α : Type u_1}
[DecidableEq α]
(s t : Multiset α)


theorem comp_sup'_eq_sup'_comp [SemilatticeSup γ] {s : Finset β} (H : s.Nonempty) {f : β → α}
    (g : α → γ) (g_sup : ∀ x y, g (x ⊔ y) = g x ⊔ g y) : g (s.sup' H f) = s.sup' H (g ∘ f)

(g_sup : ∀ (x y : α), g (x ⊔ y) = g x ⊔ g y)


@[ext]
theorem CuspForm.ext {f g : CuspForm Γ k} (h : ∀ x, f x = g x) : f = g

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
{f g : CuspForm Γ k}
(h : ∀ (x : ℍ), f x = g x)


theorem not_not_em (a : Prop) : ¬¬(a ∨ ¬a)


/-- An auxiliary typeclass for the Fundamental theorem of calculus, part 1. It is used to formulate
theorems that work simultaneously for left and right one-sided derivatives of `∫ x in u..v, f x`. -/
class FTCFilter (a : outParam ℝ) (outer : Filter ℝ) (inner : outParam <| Filter ℝ) extends
    TendstoIxxClass Ioc outer inner : Prop where
  pure_le : pure a ≤ outer
  le_nhds : inner ≤ 𝓝 a
  [meas_gen : IsMeasurablyGenerated inner]

[self : intervalIntegral.FTCFilter a outer inner]


theorem chain_map {β : Type*} {r : α → α → Prop} (f : β → α) {s : Cycle β} :
    Chain r (s.map f) ↔ Chain (fun a b => r (f a) (f b)) s

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
(f : β → α)
{s : Cycle β}

Cycle.Chain r (Cycle.map f s) ↔ Cycle.Chain (fun a b => r (f a) (f b)) s


theorem hasStrictFDerivAt_exp_smul_const_of_mem_ball (x : 𝔸) (t : 𝕊)
    (htx : t • x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    HasStrictFDerivAt (fun u : 𝕊 => exp 𝕂 (u • x))
      (exp 𝕂 (t • x) • (1 : 𝕊 →L[𝕂] 𝕊).smulRight x) t

(htx : t • x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

HasStrictFDerivAt (fun u => NormedSpace.exp 𝕂 (u • x)) (NormedSpace.exp 𝕂 (t • x) • ContinuousLinearMap.smulRight 1 x) t


/-- The functor `(W.Localization ⥤ D) ⥤ (W.FunctorsInverting D)` induced by the
composition with `W.Q : C ⥤ W.Localization`. -/
@[simps!]
def functor : (W.Localization ⥤ D) ⥤ W.FunctorsInverting D

(X : CategoryTheory.Functor W.Localization D)

∀ {X_1 Y : C} (f : X_1 ⟶ Y),
  ((CategoryTheory.Localization.Construction.WhiskeringLeftEquivalence.functor W D).obj X).obj.map f = X.map (W.Q.map f)


@[simp] theorem top_mul (h : a ≠ 0) : ∞ * a = ∞


/-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
integrable on `s` and continuous at `x₀`.

Version assuming that `μ` gives positive mass to all neighborhoods of `x₀` within `s`.
For a less precise but more usable version, see
`tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
 -/
theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] (hs : IsCompact s)
    (hμ : ∀ u, IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s)) {c : α → ℝ} (hc : ContinuousOn c s)
    (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ s)
    (hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
    Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ)
      atTop (𝓝 (g x₀))

(hμ : ∀ (u : Set α), IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s))

(hmg : MeasureTheory.IntegrableOn g s μ)

Filter.Tendsto (fun n => (∫ (x : α) in s, c x ^ n ∂μ)⁻¹ • ∫ (x : α) in s, c x ^ n • g x ∂μ) Filter.atTop (𝓝 (g x₀))


theorem mem_map_equiv {f : R ≃+* S} {K : Subring R} {x : S} :
    x ∈ K.map (f : R →+* S) ↔ f.symm x ∈ K

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{f : R ≃+* S}
{K : Subring R}
{x : S}


theorem range_extend {f : α → β} (hf : Injective f) (g : α → γ) (g' : β → γ) :
    range (extend f g g') = range g ∪ g' '' (range f)ᶜ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
(hf : Function.Injective f)
(g : α → γ)
(g' : β → γ)

Set.range (Function.extend f g g') = Set.range g ∪ g' '' (Set.range f)ᶜ


@[to_additive (attr := simp)]
theorem eventuallyConst_smul_set_ae (c : G) {s : Set α} :
    EventuallyConst (c • s : Set α) (ae μ) ↔ EventuallyConst s (ae μ)

[MeasureTheory.SMulInvariantMeasure G α μ]

Filter.EventuallyConst (c • s) (MeasureTheory.ae μ) ↔ Filter.EventuallyConst s (MeasureTheory.ae μ)


lemma toMvPolynomial_map (f : R →+* S) (M : Matrix m n R) (i : m) :
    (M.map f).toMvPolynomial i = MvPolynomial.map f (M.toMvPolynomial i)

{m : Type u_1}
{n : Type u_2}
{R : Type u_4}
{S : Type u_5}
[Fintype n]
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(M : Matrix m n R)
(i : m)

(M.map ⇑f).toMvPolynomial i = (MvPolynomial.map f) (M.toMvPolynomial i)


/--
`And a b`, or `a ∧ b`, is the conjunction of propositions. It can be
constructed and destructed like a pair: if `ha : a` and `hb : b` then
`⟨ha, hb⟩ : a ∧ b`, and if `h : a ∧ b` then `h.left : a` and `h.right : b`.
-/
@[pp_using_anonymous_constructor]
structure And (a b : Prop) : Prop where
  /-- `And.intro : a → b → a ∧ b` is the constructor for the And operation. -/
  intro ::
  /-- Extract the left conjunct from a conjunction. `h : a ∧ b` then
  `h.left`, also notated as `h.1`, is a proof of `a`. -/
  left : a
  /-- Extract the right conjunct from a conjunction. `h : a ∧ b` then
  `h.right`, also notated as `h.2`, is a proof of `b`. -/
  right : b


/-- Entries of the incidence matrix can be computed given additional decidable instances. -/
theorem incMatrix_apply' [Zero R] [One R] [DecidableEq α] [DecidableRel G.Adj] {a : α}
    {e : Sym2 α} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0

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

SimpleGraph.incMatrix R G a e = if e ∈ G.incidenceSet a then 1 else 0


theorem mul_eq_left_iff {a b : Cardinal} : a * b = a ↔ max ℵ₀ b ≤ a ∧ b ≠ 0 ∨ b = 1 ∨ a = 0


@[simp]
theorem map_nat_add (n : ℕ) (x : ℝ) : f (n + x) = n + f x


theorem IsAntichain.bot_mem_iff [OrderBot α] (hs : IsAntichain (· ≤ ·) s) : ⊥ ∈ s ↔ s = {⊥}

(hs : IsAntichain (fun x x_1 => x ≤ x_1) s)


/-- The finite separable degree multiply by the finite inseparable degree is equal
to the (finite) field extension degree. -/
theorem finSepDegree_mul_finInsepDegree : finSepDegree F E * finInsepDegree F E = finrank F E

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]

Field.finSepDegree F E * Field.finInsepDegree F E = FiniteDimensional.finrank F E


/-- If `s ×ˢ t` is a null measurable set and `μ s ≠ 0`, then `t` is a null measurable set. -/
lemma _root_.MeasureTheory.NullMeasurableSet.right_of_prod {s : Set α} {t : Set β}
    (h : NullMeasurableSet (s ×ˢ t) (μ.prod ν)) (hs : μ s ≠ 0) : NullMeasurableSet t ν

(h : MeasureTheory.NullMeasurableSet (s ×ˢ t) (μ.prod ν))


theorem trans_eq_some (f : α ≃. β) (g : β ≃. γ) (a : α) (c : γ) :
    f.trans g a = some c ↔ ∃ b, f a = some b ∧ g b = some c

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α ≃. β)
(g : β ≃. γ)
(a : α)
(c : γ)

(f.trans g) a = some c ↔ ∃ b, f a = some b ∧ g b = some c


@[simp]
theorem tail_eval : tail.eval = fun v => pure v.tail

Turing.ToPartrec.Code.tail.eval = fun v => pure v.tail


@[simp]
theorem ascPochhammer_natDegree (n : ℕ) [NoZeroDivisors S] [Nontrivial S] :
    (ascPochhammer S n).natDegree = n

(S : Type u)
[Semiring S]
(n : ℕ)
[NoZeroDivisors S]
[Nontrivial S]


@[simp]
theorem dotProduct_single (x : α) (i : m) : v ⬝ᵥ Pi.single i x = v i * x

{m : Type u_2}
{α : Type v}
[Fintype m]
[DecidableEq m]
[NonUnitalNonAssocSemiring α]
(v : m → α)
(x : α)
(i : m)


@[simp, norm_cast]
theorem coe_indicator {α} (s : Set α) (f : α → ℝ≥0) (a : α) :
    ((s.indicator f a : ℝ≥0) : ℝ≥0∞) = s.indicator (fun x => ↑(f x)) a

{α : Type u_2}
(s : Set α)
(f : α → ℝ≥0)
(a : α)

↑(s.indicator f a) = s.indicator (fun x => ↑(f x)) a


/-- The `vectorSpan` of collinear points is finite-dimensional. -/
theorem Collinear.finiteDimensional_vectorSpan {s : Set P} (h : Collinear k s) :
    FiniteDimensional k (vectorSpan k s)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
(h : Collinear k s)


theorem injective_arg : Injective fun z : circle => arg z


theorem length_pos_of_nontrivial (h : {x | x ∈ s}.Nontrivial) : 0 < s.length

{α : Type u_1}
{r : Rel α α}
{s : RelSeries r}
(h : {x | x ∈ s}.Nontrivial)


@[to_additive]
theorem mul [Mul Y] ⦃f g : X → Y⦄ (hf : IsLocallyConstant f) (hg : IsLocallyConstant g) :
    IsLocallyConstant (f * g)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[Mul Y]
⦃f g : X → Y⦄
(hf : IsLocallyConstant f)
(hg : IsLocallyConstant g)


theorem ext_of_adjoin_eq_top {s : Set A} (h : adjoin R s = ⊤) ⦃φ₁ φ₂ : A →ₐ[R] B⦄
    (hs : s.EqOn φ₁ φ₂) : φ₁ = φ₂

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
{s : Set A}
(h : Algebra.adjoin R s = ⊤)
⦃φ₁ φ₂ : A →ₐ[R] B⦄
(hs : Set.EqOn (⇑φ₁) (⇑φ₂) s)


@[to_additive (attr := ext)]
theorem ext' {f g : GroupTopology α} (h : f.IsOpen = g.IsOpen) : f = g

(h : TopologicalSpace.IsOpen = TopologicalSpace.IsOpen)


@[simp]
lemma sumLexLift_inr_inl (a : α₂) (b : β₁) : sumLexLift f₁ f₂ g₁ g₂ (inr a) (inl b) = ∅

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
(f₁ : α₁ → β₁ → Finset γ₁)
(f₂ : α₂ → β₂ → Finset γ₂)
(g₁ : α₁ → β₂ → Finset γ₁)
(g₂ : α₁ → β₂ → Finset γ₂)
(a : α₂)
(b : β₁)

Finset.sumLexLift f₁ f₂ g₁ g₂ (Sum.inr a) (Sum.inl b) = ∅


/-- Morphisms from a single object chain complex with `X` concentrated in degree 0
to an `ℕ`-indexed chain complex `C` are the same as morphisms `f : X → C.X 0`.
-/
@[simps apply]
noncomputable def fromSingle₀Equiv (C : ChainComplex V ℕ) (X : V) :
    ((single₀ V).obj X ⟶ C) ≃ (X ⟶ C.X 0)

(f : (ChainComplex.single₀ V).obj X ⟶ C)


/-- A constant size neighborhood of the diagonal is an entourage. -/
theorem dist_mem_uniformity {ε : ℝ} (ε0 : 0 < ε) : { p : α × α | dist p.1 p.2 < ε } ∈ 𝓤 α

{α : Type u}
[PseudoMetricSpace α]
{ε : ℝ}
(ε0 : 0 < ε)


protected theorem eq : #α = #β ↔ Nonempty (α ≃ β)

Cardinal.mk α = Cardinal.mk β ↔ Nonempty (α ≃ β)


theorem basis_ne_zero (hvs : Set.InjOn v s) (hi : i ∈ s) : Lagrange.basis s v i ≠ 0

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
{i : ι}
(hvs : Set.InjOn v ↑s)
(hi : i ∈ s)


/-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
structure PrincipalSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where
  /-- The supremum of the principal segment -/
  top : β
  /-- The image of the order embedding is the set of elements `b` such that `s b top` -/
  down' : ∀ b, s b top ↔ ∃ a, toRelEmbedding a = b

{α : Type u_4}
{β : Type u_5}
{r : α → α → Prop}
{s : β → β → Prop}
(self : r ≺i s)
(b : β)

s b self.top ↔ ∃ a, self.toRelEmbedding a = b


@[to_additive]
theorem period_bounded_of_exponent_pos (exp_pos : 0 < Monoid.exponent M) (m : M) :
    BddAbove (Set.range (fun a : α => period m a))

(α : Type v)
{M : Type u}
[AddMonoid M]
[AddAction M α]
(exp_pos : 0 < AddMonoid.exponent M)
(m : M)

BddAbove (Set.range fun a => AddAction.period m a)


theorem uniformContinuous₂_def (f : α → β → γ) :
    UniformContinuous₂ f ↔ UniformContinuous (uncurry f)

{α : Type ua}
{β : Type ub}
{γ : Type uc}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
(f : α → β → γ)

UniformContinuous₂ f ↔ UniformContinuous (Function.uncurry f)


@[simp]
theorem cosh_lt_cosh : cosh x < cosh y ↔ |x| < |y|


theorem integral_neg {f : α →ₛ E} (hf : Integrable f μ) : integral μ (-f) = -integral μ f

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
{f : MeasureTheory.SimpleFunc α E}
(hf : MeasureTheory.Integrable (↑f) μ)

MeasureTheory.SimpleFunc.integral μ (-f) = -MeasureTheory.SimpleFunc.integral μ f


@[simp]
theorem fract_sub_int (a : α) (m : ℤ) : fract (a - m) = fract a

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)
(m : ℤ)


theorem lt_pred_iff_succ_lt : ∀ {n m}, n < pred m ↔ succ n < m


theorem Real.uniformContinuous_const_mul {x : ℝ} : UniformContinuous (x * ·)


@[simp]
theorem rtakeWhile_nil : rtakeWhile p ([] : List α) = []


theorem coeff_zero_eq_constantCoeff_apply (φ : MvPowerSeries σ R) :
    coeff R (0 : σ →₀ ℕ) φ = constantCoeff σ R φ

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(φ : MvPowerSeries σ R)

(MvPowerSeries.coeff R 0) φ = (MvPowerSeries.constantCoeff σ R) φ


@[simp]
theorem Biprod.ofComponents_eq (f : X₁ ⊞ X₂ ⟶ Y₁ ⊞ Y₂) :
    Biprod.ofComponents (biprod.inl ≫ f ≫ biprod.fst) (biprod.inl ≫ f ≫ biprod.snd)
        (biprod.inr ≫ f ≫ biprod.fst) (biprod.inr ≫ f ≫ biprod.snd) =
      f

CategoryTheory.Biprod.ofComponents (CategoryTheory.Limits.biprod.inl ≫ f ≫ CategoryTheory.Limits.biprod.fst)
    (CategoryTheory.Limits.biprod.inl ≫ f ≫ CategoryTheory.Limits.biprod.snd)
    (CategoryTheory.Limits.biprod.inr ≫ f ≫ CategoryTheory.Limits.biprod.fst)
    (CategoryTheory.Limits.biprod.inr ≫ f ≫ CategoryTheory.Limits.biprod.snd) =
  f


@[fun_prop]
theorem DifferentiableAt.const_add (hf : DifferentiableAt 𝕜 f x) (c : F) :
    DifferentiableAt 𝕜 (fun y => c + f y) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(hf : DifferentiableAt 𝕜 f x)
(c : F)


theorem iInter_or {p q : Prop} (s : p ∨ q → Set α) :
    ⋂ h, s h = (⋂ h : p, s (Or.inl h)) ∩ ⋂ h : q, s (Or.inr h)

{α : Type u_1}
{p q : Prop}
(s : p ∨ q → Set α)

⋂ (h : p ∨ q), s h = (⋂ (h : p), s ⋯) ∩ ⋂ (h : q), s ⋯


@[simp] lemma inter_univ (s : Finset α) : s ∩ univ = s

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(s : Finset α)


theorem Zigzag.of_inv_inv {j₁ j₂ j₃ : J} (f₂₁ : j₂ ⟶ j₁) (f₃₂ : j₃ ⟶ j₂) : Zigzag j₁ j₃

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{j₁ j₂ j₃ : J}
(f₂₁ : j₂ ⟶ j₁)
(f₃₂ : j₃ ⟶ j₂)


theorem DifferentiableWithinAt.hasDerivWithinAt (h : DifferentiableWithinAt 𝕜 f s x) :
    HasDerivWithinAt f (derivWithin f s x) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(h : DifferentiableWithinAt 𝕜 f s x)


@[simp] theorem mul_emod_right (a b : Int) : (a * b) % a = 0


theorem IsLUB.iUnion_Iio_eq (h : IsLUB (range f) a) : ⋃ x, Iio (f x) = Iio a

{ι : Sort u}
{α : Type v}
[LinearOrder α]
{a : α}
{f : ι → α}
(h : IsLUB (Set.range f) a)


theorem gcd_dvd_iff_exists (a b : R) {z} : gcd a b ∣ z ↔ ∃ x y, z = a * x + b * y

{R : Type u}
[CommRing R]
[IsDomain R]
[IsBezout R]
[GCDMonoid R]
(a b : R)
{z : R}


/-- The diagram sending each pointed Galois object to its automorphism group
as an object of `C`. -/
@[simps]
noncomputable def autGaloisSystem : PointedGaloisObject F ⥤ Grp.{u₂}

(F : CategoryTheory.Functor C FintypeCat)

{A B : CategoryTheory.PreGaloisCategory.PointedGaloisObject F}

(CategoryTheory.PreGaloisCategory.autGaloisSystem F).map f = CategoryTheory.PreGaloisCategory.autMapHom f.val


@[simp]
theorem essSup_eq_zero_iff : essSup f μ = 0 ↔ f =ᵐ[μ] 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}


@[simp] lemma diracProba_toMeasure_apply' (x : X) {A : Set X} (A_mble : MeasurableSet A) :
    (diracProba x).toMeasure A = A.indicator 1 x

{X : Type u_1}
[MeasurableSpace X]
(x : X)
{A : Set X}
(A_mble : MeasurableSet A)

↑(MeasureTheory.diracProba x) A = A.indicator 1 x


/-- If the singleton `{x}` has non-zero mass for `μ.map X`, then for all `s : Set Ω`,
`condDistrib Y X μ x s = (μ.map X {x})⁻¹ * μ.map (fun a => (X a, Y a)) ({x} ×ˢ s)` . -/
lemma condDistrib_apply_of_ne_zero [MeasurableSingletonClass β]
    (hY : Measurable Y) (x : β) (hX : μ.map X {x} ≠ 0) (s : Set Ω) :
    condDistrib Y X μ x s = (μ.map X {x})⁻¹ * μ.map (fun a => (X a, Y a)) ({x} ×ˢ s)

(hX : (MeasureTheory.Measure.map X μ) {x} ≠ 0)

((ProbabilityTheory.condDistrib Y X μ) x) s =
  ((MeasureTheory.Measure.map X μ) {x})⁻¹ * (MeasureTheory.Measure.map (fun a => (X a, Y a)) μ) ({x} ×ˢ s)


@[to_additive (attr := simp)]
theorem smul_iterate [MulAction G H] : (a • · : H → H)^[n] = (a ^ n • ·)

{G : Type u_3}
{H : Type u_4}
[Monoid G]
(a : G)
(n : ℕ)
[MulAction G H]

(fun x => a • x)^[n] = fun x => a ^ n • x


theorem pow_mul_pow_lcm {ζ' : M} {k' : ℕ} (hζ : IsPrimitiveRoot ζ k) (hζ' : IsPrimitiveRoot ζ' k')
    (hk : k ≠ 0) (hk' : k' ≠ 0) :
    IsPrimitiveRoot
      (ζ ^ (k / Nat.factorizationLCMLeft k k') * ζ' ^ (k' / Nat.factorizationLCMRight k k'))
      (Nat.lcm k k')

{M : Type u_1}
[CommMonoid M]
{k : ℕ}
{ζ ζ' : M}
{k' : ℕ}
(hζ : IsPrimitiveRoot ζ k)
(hζ' : IsPrimitiveRoot ζ' k')
(hk : k ≠ 0)
(hk' : k' ≠ 0)

IsPrimitiveRoot (ζ ^ (k / k.factorizationLCMLeft k') * ζ' ^ (k' / k.factorizationLCMRight k')) (k.lcm k')


@[simp]
protected theorem _root_.Complex.rotation (θ : Real.Angle) (z : ℂ) :
    Complex.orientation.rotation θ z = θ.expMapCircle * z

(Complex.orientation.rotation θ) z = ↑θ.expMapCircle * z


@[to_additive]
theorem exists_list_of_mem_closure {s : Set G} {a : G} (h : a ∈ closure s) :
    ∃ l : List G, (∀ x ∈ l, x ∈ s ∨ x⁻¹ ∈ s) ∧ l.prod = a

{G : Type u_1}
[AddGroup G]
{s : Set G}
{a : G}
(h : a ∈ AddGroup.closure s)

∃ l, (∀ x ∈ l, x ∈ s ∨ -x ∈ s) ∧ l.sum = a


theorem get_odd : ∀ (n : ℕ) (s : Stream' α), get (odd s) n = get s (2 * n + 1)


theorem nth_monotone (hf : (setOf p).Infinite) : Monotone (nth p)

{p : ℕ → Prop}
(hf : (setOf p).Infinite)


/-- A product over `n.factorization` can be written as a product over `n.primeFactors`; -/
lemma prod_factorization_eq_prod_primeFactors {β : Type*} [CommMonoid β] (f : ℕ → ℕ → β) :
    n.factorization.prod f = ∏ p ∈ n.primeFactors, f p (n.factorization p)

{n : ℕ}
{β : Type u_1}
[CommMonoid β]
(f : ℕ → ℕ → β)


lemma Indep.closure_eq_setOf_basis_insert (hI : M.Indep I) :
    M.closure I = {x | M.Basis I (insert x I)}

{α : Type u_2}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)


@[to_additive]
theorem isSubgroup_iUnion_of_directed {ι : Type*} [Nonempty ι] {s : ι → Set G}
    (hs : ∀ i, IsSubgroup (s i)) (directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
    IsSubgroup (⋃ i, s i)

(directed : ∀ (i j : ι), ∃ k, s i ⊆ s k ∧ s j ⊆ s k)


/-- A homomorphism from a uniform group to a discrete uniform group is continuous if and only if
its kernel is open. -/
@[to_additive "A homomorphism from a uniform additive group to a discrete uniform additive group is
continuous if and only if its kernel is open."]
theorem UniformGroup.uniformContinuous_iff_open_ker {hom : Type*} [UniformSpace β]
    [DiscreteTopology β] [Group β] [UniformGroup β] [FunLike hom α β] [MonoidHomClass hom α β]
    {f : hom} :
    UniformContinuous f ↔ IsOpen ((f : α →* β).ker : Set α)

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
{hom : Type u_3}
[UniformSpace β]
[DiscreteTopology β]
[AddGroup β]
[UniformAddGroup β]
[FunLike hom α β]
[AddMonoidHomClass hom α β]
{f : hom}


theorem doubleFactorial_add_one (n : ℕ) : (n + 1)‼ = (n + 1) * (n - 1)‼


theorem swap_then (o₁ o₂ : Ordering) : (o₁.then o₂).swap = o₁.swap.then o₂.swap


theorem inseparable_iff : Inseparable x y ↔ edist x y = 0

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}


theorem completeSpace (h : RestrictGenTopology {s : Set (Π i, E i) | IsVonNBounded 𝕜 s}) :
    CompleteSpace (ContinuousMultilinearMap 𝕜 E F)

(h : RestrictGenTopology {s | Bornology.IsVonNBounded 𝕜 s})


@[simp]
theorem mem_inter {x y z : ZFSet.{u}} : z ∈ x ∩ y ↔ z ∈ x ∧ z ∈ y


theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
    wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i)

(p : ℕ)
(R : Type u_1)
[CommRing R]
(n : ℕ)

W_ R n = ∑ i ∈ Finset.range (n + 1), MvPolynomial.C (↑p ^ i) * MvPolynomial.X i ^ p ^ (n - i)


theorem memℒp_finset_sum {ι} (s : Finset ι) {f : ι → α → E} (hf : ∀ i ∈ s, Memℒp (f i) p μ) :
    Memℒp (fun a => ∑ i ∈ s, f i a) p μ

(hf : ∀ i ∈ s, MeasureTheory.Memℒp (f i) p μ)

MeasureTheory.Memℒp (fun a => ∑ i ∈ s, f i a) p μ


lemma linearIndependent_algHom_toLinearMap
    (K M L) [CommSemiring K] [Semiring M] [Algebra K M] [CommRing L] [IsDomain L] [Algebra K L] :
    LinearIndependent L (AlgHom.toLinearMap : (M →ₐ[K] L) → M →ₗ[K] L)

(K : Type u_8)
(M : Type u_9)
(L : Type u_10)
[CommSemiring K]
[Semiring M]
[Algebra K M]
[CommRing L]
[IsDomain L]
[Algebra K L]


theorem tangentMapWithin_id {p : TangentBundle I M} (hs : UniqueMDiffWithinAt I s p.proj) :
    tangentMapWithin I I (id : M → M) s p = p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{s : Set M}
{p : TangentBundle I M}
(hs : UniqueMDiffWithinAt I s p.proj)


/-- An ideal `P` of a ring `R` is prime if `P ≠ R` and `xy ∈ P → x ∈ P ∨ y ∈ P` -/
class IsPrime (I : Ideal α) : Prop where
  /-- The prime ideal is not the entire ring. -/
  ne_top' : I ≠ ⊤
  /-- If a product lies in the prime ideal, then at least one element lies in the prime ideal. -/
  mem_or_mem' : ∀ {x y : α}, x * y ∈ I → x ∈ I ∨ y ∈ I

{α : Type u}
[Semiring α]
{I : Ideal α}
[self : I.IsPrime]


theorem isSheaf_iff_isSheaf_comp {C : Type u₁} [Category.{v} C] {D : Type u₂} [Category.{v} D]
    (G : C ⥤ D) [G.ReflectsIsomorphisms] [HasLimits C] [PreservesLimits G]
    {X : TopCat.{v}} (F : Presheaf C X) : Presheaf.IsSheaf F ↔ Presheaf.IsSheaf (F ⋙ G)

F.IsSheaf ↔ TopCat.Presheaf.IsSheaf (F ⋙ G)


lemma GeneralizingMap.stableUnderGeneralization_range (h : GeneralizingMap f) :
    StableUnderGeneralization (range f)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(h : GeneralizingMap f)


@[reassoc (attr := simp)]
lemma ιFunctorObj_naturality :
    ιFunctorObj f πX ≫ functorMap f πX πY φ hφ = φ ≫ ιFunctorObj f πY

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX)) C]

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πY)) C]

(hφ : CategoryTheory.CategoryStruct.comp φ πY = πX)

[CategoryTheory.Limits.HasPushout (CategoryTheory.SmallObject.functorObjTop f πX)
    (CategoryTheory.SmallObject.functorObjLeft f πX)]

[CategoryTheory.Limits.HasPushout (CategoryTheory.SmallObject.functorObjTop f πY)
    (CategoryTheory.SmallObject.functorObjLeft f πY)]

CategoryTheory.CategoryStruct.comp (CategoryTheory.SmallObject.ιFunctorObj f πX)
    (CategoryTheory.SmallObject.functorMap f πX πY φ hφ) =
  CategoryTheory.CategoryStruct.comp φ (CategoryTheory.SmallObject.ιFunctorObj f πY)


@[simp]
theorem coe_rootSpaceWeightSpaceProduct_tmul (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃)
    (x : rootSpace H χ₁) (m : weightSpace M χ₂) :
    (rootSpaceWeightSpaceProduct R L H M χ₁ χ₂ χ₃ hχ (x ⊗ₜ m) : M) = ⁅(x : L), (m : M)⁆

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)
[LieAlgebra.IsNilpotent R ↥H]
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(χ₁ χ₂ χ₃ : ↥H → R)
(hχ : χ₁ + χ₂ = χ₃)
(x : ↥(LieAlgebra.rootSpace H χ₁))
(m : ↥(LieModule.weightSpace M χ₂))

↑((LieAlgebra.rootSpaceWeightSpaceProduct R L H M χ₁ χ₂ χ₃ hχ) (x ⊗ₜ[R] m)) = ⁅↑x, ↑m⁆


@[to_additive (attr := simp)] theorem fst_apply_inl (x : M) : fst (inl x : M ∗ N) = x

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]
(x : M)

Monoid.Coprod.fst (Monoid.Coprod.inl x) = x


theorem lowerCentralSeries_eq_lcs_comap : lowerCentralSeries R L N k = (N.lcs k).comap N.incl

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(k : ℕ)
(N : LieSubmodule R L M)

LieModule.lowerCentralSeries R L (↥↑N) k = LieSubmodule.comap N.incl (LieSubmodule.lcs k N)


@[simp, push_cast] theorem coe_one : ⇑(1 : G →+c[a, a] G) = id


/-- The proposition that a morphism `φ : a ⟶ b` in `𝒳` lying over `f : R ⟶ S` in `𝒮` is a
cartesian morphism.

See SGA 1 VI 5.1. -/
class IsCartesian extends IsHomLift p f φ : Prop where
  universal_property {a' : 𝒳} (φ' : a' ⟶ b) [IsHomLift p f φ'] :
      ∃! χ : a' ⟶ a, IsHomLift p (𝟙 R) χ ∧ χ ≫ φ = φ'

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
[CategoryTheory.Category.{v₂, u₂} 𝒳]
{p : 𝒳 ⥤ 𝒮}
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
{φ : a ⟶ b}
[self : p.IsCartesian f φ]
{a' : 𝒳}
(φ' : a' ⟶ b)
[p.IsHomLift f φ']


@[simp]
lemma leftHomologyMap'_add :
    leftHomologyMap' (φ + φ') h₁ h₂ = leftHomologyMap' φ h₁ h₂ +
      leftHomologyMap' φ' h₁ h₂

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
{φ φ' : S₁ ⟶ S₂}
(h₁ : S₁.LeftHomologyData)
(h₂ : S₂.LeftHomologyData)

CategoryTheory.ShortComplex.leftHomologyMap' (φ + φ') h₁ h₂ =
  CategoryTheory.ShortComplex.leftHomologyMap' φ h₁ h₂ + CategoryTheory.ShortComplex.leftHomologyMap' φ' h₁ h₂


lemma isIso_cyclesMap_of_isIso_of_mono' (φ : S₁ ⟶ S₂) (h₂ : IsIso φ.τ₂) (h₃ : Mono φ.τ₃)
    [S₁.HasLeftHomology] [S₂.HasLeftHomology] :
    IsIso (cyclesMap φ)


theorem eval₂_mul_monomial :
    ∀ {s a}, (p * monomial s a).eval₂ f g = p.eval₂ f g * f a * s.prod fun n e => g n ^ e

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
{p : MvPolynomial σ R}
(f : R →+* S₁)
(g : σ → S₁)
{s : σ →₀ ℕ}
{a : R}

MvPolynomial.eval₂ f g (p * (MvPolynomial.monomial s) a) = MvPolynomial.eval₂ f g p * f a * s.prod fun n e => g n ^ e


@[simp] theorem rev_last (n : Nat) : rev (last n) = 0


theorem comm [IsSymm α r] {a b : α} : r a b ↔ r b a

{α : Type u}
{r : α → α → Prop}
[IsSymm α r]
{a b : α}


/-- The open neighborhoods of `x` are a basis for the neighborhood filter. See `nhds_basis_opens`
for a variant using open sets around `x` instead. -/
theorem nhds_basis_opens' (x : X) :
    (𝓝 x).HasBasis (fun s : Set X => s ∈ 𝓝 x ∧ IsOpen s) fun x => x

{X : Type u}
[TopologicalSpace X]
(x : X)

(𝓝 x).HasBasis (fun s => s ∈ 𝓝 x ∧ IsOpen s) fun x => x


lemma Surjective.comp_exact_iff_exact {p : M' →ₗ[R] M} (h : Surjective p) :
    Exact (f ∘ₗ p) g ↔ Exact f g

{R : Type u_1}
{M : Type u_2}
{M' : Type u_3}
{N : Type u_4}
{P : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M']
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R M']
[Module R N]
[Module R P]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
{p : M' →ₗ[R] M}
(h : Function.Surjective ⇑p)

Function.Exact ⇑(f ∘ₗ p) ⇑g ↔ Function.Exact ⇑f ⇑g


protected theorem div_nonpos {a b : Int} (Ha : 0 ≤ a) (Hb : b ≤ 0) : a.div b ≤ 0


theorem sup_sets_eq {f g : Filter α} : (f ⊔ g).sets = f.sets ∩ g.sets


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

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

(AddLocalization.mk a b).liftOn₂ (AddLocalization.mk c d) f H = f a b c d


lemma mk₅_surjective (X : ComposableArrows C 5) :
    ∃ (X₀ X₁ X₂ X₃ X₄ X₅ : C) (f₀ : X₀ ⟶ X₁) (f₁ : X₁ ⟶ X₂) (f₂ : X₂ ⟶ X₃)
      (f₃ : X₃ ⟶ X₄) (f₄ : X₄ ⟶ X₅), X = mk₅ f₀ f₁ f₂ f₃ f₄

(X : CategoryTheory.ComposableArrows C 5)

∃ X₀ X₁ X₂ X₃ X₄ X₅ f₀ f₁ f₂ f₃ f₄, X = CategoryTheory.ComposableArrows.mk₅ f₀ f₁ f₂ f₃ f₄


/-- An additive character maps `0` to `1`. -/
@[simp] lemma map_zero_eq_one (ψ : AddChar A M) : ψ 0 = 1

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)


protected theorem map_add (f : R →ₑ+*[φ] S) (x y : R) : f (x + y) = f x + f y

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
(f : R →ₑ+*[φ] S)
(x y : R)


theorem one_lt_rpow_iff (hx : 0 ≤ x) : 1 < x ^ y ↔ 1 < x ∧ 0 < y ∨ 0 < x ∧ x < 1 ∧ y < 0


@[to_additive]
theorem list_prod_singleton {M : Type*} [CommMonoid M] (s : List M) :
    (s.map fun i ↦ ({i} : Set M)).prod = {s.prod}

{M : Type u_5}
[CommMonoid M]
(s : List M)

(List.map (fun i => {i}) s).prod = {s.prod}


theorem product_image_snd [DecidableEq β] (ht : s.Nonempty) : (s ×ˢ t).image Prod.snd = t

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
[DecidableEq β]
(ht : s.Nonempty)


theorem Submodule.isHilbertSumOrthogonal (K : Submodule 𝕜 E) [hK : CompleteSpace K] :
    IsHilbertSum 𝕜 (fun b => ↥(cond b K Kᗮ)) fun b => (cond b K Kᗮ).subtypeₗᵢ

{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
(K : Submodule 𝕜 E)
[hK : CompleteSpace ↥K]

IsHilbertSum 𝕜 (fun b => ↥(bif b then K else Kᗮ)) fun b => (bif b then K else Kᗮ).subtypeₗᵢ


lemma Equivalence.symmetric {r : β → β → Prop} (h : Equivalence r) : Symmetric r

{β : Sort v}
{r : β → β → Prop}
(h : Equivalence r)


/-- The span of a finite subset is compact in the lattice of submodules. -/
theorem finset_span_isCompactElement (S : Finset M) :
    CompleteLattice.IsCompactElement (span R S : Submodule R M)

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(S : Finset M)

CompleteLattice.IsCompactElement (Submodule.span R ↑S)


@[to_additive (attr := simp)]
theorem tail_mul (x y : FreeSemigroup α) : (x * y).2 = x.2 ++ y.1 :: y.2

(x + y).tail = x.tail ++ y.head :: y.tail


/-- A function between topological spaces is continuous if the preimage
  of every open set is open. Registered as a structure to make sure it is not unfolded by Lean. -/
@[fun_prop]
structure Continuous (f : X → Y) : Prop where
  /-- The preimage of an open set under a continuous function is an open set. Use `IsOpen.preimage`
  instead. -/
  isOpen_preimage : ∀ s, IsOpen s → IsOpen (f ⁻¹' s)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(self : Continuous f)
(s : Set Y)


protected theorem sup_inf_distrib_left (a b c : CauSeq α abs) : a ⊔ b ⊓ c = (a ⊔ b) ⊓ (a ⊔ c)

{α : Type u_1}
[LinearOrderedField α]
(a b c : CauSeq α abs)


/-- Taking the product of two maps with the same codomain is equivalent to taking the product of
their domains.

See note [bundled maps over different rings] for why separate `R` and `S` semirings are used. -/
@[simps]
def coprodEquiv [Module S M₃] [SMulCommClass R S M₃] :
    ((M →ₗ[R] M₃) × (M₂ →ₗ[R] M₃)) ≃ₗ[S] M × M₂ →ₗ[R] M₃

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
(S : Type u_3)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module S M₃]
[SMulCommClass R S M₃]
(f : (M →ₗ[R] M₃) × (M₂ →ₗ[R] M₃))

(LinearMap.coprodEquiv S) f = f.1.coprod f.2


/-- The linter message "error: SetLike.GradeZero.coe_pow.{u_3, u_2, u_1} Left-hand side does
  not simplify, when using the simp lemma on itself." is wrong. The LHS does simplify. -/
@[nolint simpNF, simp, norm_cast] theorem coe_pow (a : A 0) (n : ℕ) : ↑(a ^ n) = (↑a : R) ^ n

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[Monoid R]
[AddMonoid ι]
{A : ι → S}
[SetLike.GradedMonoid A]
(a : ↥(A 0))
(n : ℕ)


theorem next_toList_eq_apply (p : Perm α) (x y : α) (hy : y ∈ toList p x) :
    next (toList p x) y hy = p y

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(p : Equiv.Perm α)
(x y : α)
(hy : y ∈ p.toList x)


theorem ne_rat (h : Irrational x) (q : ℚ) : x ≠ q


@[simp]
theorem ker_le_comap {p : Submodule R₂ M₂} (f : M →ₛₗ[τ₁₂] M₂) :
    ker f ≤ p.comap f

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{p : Submodule R₂ M₂}
(f : M →ₛₗ[τ₁₂] M₂)


theorem card_edgeFinset_replaceVertex_of_adj (ha : G.Adj s t) :
    (G.replaceVertex s t).edgeFinset.card = G.edgeFinset.card + G.degree s - G.degree t - 1

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


theorem curry_id_eq_coev (A X : C) [Exponentiable A] : curry (𝟙 _) = (exp.coev A).app X

CategoryTheory.CartesianClosed.curry (CategoryTheory.CategoryStruct.id (A ⨯ (CategoryTheory.Functor.id C).obj X)) =
  (CategoryTheory.exp.coev A).app X


/-- `WalkingParallelPair` as a category is equivalent to a special case of
`WalkingParallelFamily`.  -/
@[simps!]
def walkingParallelFamilyEquivWalkingParallelPair :
    WalkingParallelFamily.{w} (ULift Bool) ≌ WalkingParallelPair

CategoryTheory.Limits.walkingParallelFamilyEquivWalkingParallelPair.inverse.obj x =
  match x with
  | CategoryTheory.Limits.WalkingParallelPair.zero => CategoryTheory.Limits.WalkingParallelFamily.zero
  | CategoryTheory.Limits.WalkingParallelPair.one => CategoryTheory.Limits.WalkingParallelFamily.one


theorem independent_def' : Independent t ↔ ∀ i, Disjoint (t i) (sSup (t '' { j | j ≠ i }))

{α : Type u_1}
{ι : Type u_3}
[CompleteLattice α]
{t : ι → α}

CompleteLattice.Independent t ↔ ∀ (i : ι), Disjoint (t i) (sSup (t '' {j | j ≠ i}))


/-- `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)

TensorProduct.map ↑f ↑f ∘ₗ Coalgebra.comul = Coalgebra.comul ∘ₗ ↑f


/-- `OrderDual` as a functor. -/
@[simps]
def dual : Preord ⥤ Preord

∀ {X Y : Preord} (a : ↑X →o ↑Y), Preord.dual.map a = OrderHom.dual a


@[simp]
theorem single_apply {i i' b} :
    (single i b : Π₀ i, β i) i' = if h : i = i' then Eq.recOn h b else 0

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{i i' : ι}
{b : β i}

(DFinsupp.single i b) i' = if h : i = i' then Eq.recOn h b else 0


theorem vonMangoldt_apply {n : ℕ} : Λ n = if IsPrimePow n then Real.log (minFac n) else 0

ArithmeticFunction.vonMangoldt n = if IsPrimePow n then Real.log ↑n.minFac else 0


theorem continuousAt_add_top_coe (a : ℝ) :
    ContinuousAt (fun p : EReal × EReal => p.1 + p.2) (⊤, a)

ContinuousAt (fun p => p.1 + p.2) (⊤, ↑a)


theorem lsub_eq_lsub {ι ι' : Type u} (r : ι → ι → Prop) (r' : ι' → ι' → Prop) [IsWellOrder ι r]
    [IsWellOrder ι' r'] {o} (ho : type r = o) (ho' : type r' = o)
    (f : ∀ a < o, Ordinal.{max u v}) :
    lsub.{_, v} (familyOfBFamily' r ho f) = lsub.{_, v} (familyOfBFamily' r' ho' f)

(f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v})

Ordinal.lsub (Ordinal.familyOfBFamily' r ho f) = Ordinal.lsub (Ordinal.familyOfBFamily' r' ho' f)


theorem map_lt_map_iff {x y : R} (h : abv.IsEuclidean) : abv x < abv y ↔ x ≺ y

{R : Type u_1}
{S : Type u_2}
[EuclideanDomain R]
[OrderedSemiring S]
{abv : AbsoluteValue R S}
{x y : R}
(h : abv.IsEuclidean)


/-- The ring equiv between the top element of `Subsemiring R` and `R`. -/
@[simps]
def topEquiv : (⊤ : Subsemiring R) ≃+* R

{R : Type u}
[NonAssocSemiring R]
(r : ↥⊤)


@[simp]
theorem lift_isLimit (o : Ordinal.{v}) : IsLimit (lift.{u,v} o) ↔ IsLimit o

(Ordinal.lift.{u, v} o).IsLimit ↔ o.IsLimit


@[simp, mfld_simps]
lemma mem_chart_source (H : Type*) {M : Type*} [TopologicalSpace H] [TopologicalSpace M]
    [ChartedSpace H M] (x : M) : x ∈ (chartAt H x).source

(H : Type u_5)
{M : Type u_6}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
(x : M)


@[ext]
theorem ext (h : ∀ J, J ∈ π₁ ↔ J ∈ π₂) : π₁ = π₂

(h : ∀ (J : BoxIntegral.Box ι), J ∈ π₁ ↔ J ∈ π₂)


lemma IsCondKernelCDF.integral
    {f : α × β → StieltjesFunction} (hf : IsCondKernelCDF f κ ν) (a : α) (x : ℝ) :
    ∫ b, f (a, b) x ∂(ν a) = (κ a (univ ×ˢ Iic x)).toReal

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

(hf : ProbabilityTheory.IsCondKernelCDF f κ ν)

∫ (b : β), ↑(f (a, b)) x ∂ν a = ((κ a) (Set.univ ×ˢ Set.Iic x)).toReal


theorem Nontrivial.sdiff_singleton_nonempty {c : α} {s : Finset α} (hS : s.Nontrivial) :
    (s \ {c}).Nonempty

{α : Type u_1}
[DecidableEq α]
{c : α}
{s : Finset α}
(hS : s.Nontrivial)


theorem OrderIso.complementedLattice [ComplementedLattice α] (f : α ≃o β) : ComplementedLattice β

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
[ComplementedLattice α]
(f : α ≃o β)


theorem Basis.algebraMap_injective {ι : Type*} [NoZeroDivisors R] [Nontrivial S]
    (b : @Basis ι R S _ _ Algebra.toModule) : Function.Injective (algebraMap R S)

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{ι : Type u_1}
[NoZeroDivisors R]
[Nontrivial S]
(b : Basis ι R S)


lemma subset_exterior_iff : s ⊆ exterior t ↔ ∀ U, IsOpen U → t ⊆ U → s ⊆ U

{α : Type u_3}
[TopologicalSpace α]
{s t : Set α}

s ⊆ exterior t ↔ ∀ (U : Set α), IsOpen U → t ⊆ U → s ⊆ U


lemma nontrivial {rs : List R} (h : IsRegular M rs) : Nontrivial M

(h : RingTheory.Sequence.IsRegular M rs)


/-- A coequalizer that is a monomorphism is an isomorphism. -/
theorem isIso_limit_cocone_parallelPair_of_epi {c : Cofork f g} (h : IsColimit c) [Mono c.π] :
    IsIso c.π

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f g : X ⟶ Y}
{c : CategoryTheory.Limits.Cofork f g}
(h : CategoryTheory.Limits.IsColimit c)
[CategoryTheory.Mono c.π]


theorem blsub_lt_ord_lift_of_isRegular {o : Ordinal} {f : ∀ a < o, Ordinal} {c} (hc : IsRegular c)
    (ho : Cardinal.lift.{v, u} o.card < c) :
    (∀ i hi, f i hi < c.ord) → Ordinal.blsub.{u, v} o f < c.ord

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v}}

(∀ (i : Ordinal.{u}) (hi : i < o), f i hi < c.ord) → o.blsub f < c.ord


/-- Every element of the π-system generated by an indexed union of a family of π-systems
is a finite intersection of elements from the π-systems.
For a total union version, see `mem_generatePiSystem_iUnion_elim`. -/
theorem mem_generatePiSystem_iUnion_elim' {α β} {g : β → Set (Set α)} {s : Set β}
    (h_pi : ∀ b ∈ s, IsPiSystem (g b)) (t : Set α) (h_t : t ∈ generatePiSystem (⋃ b ∈ s, g b)) :
    ∃ (T : Finset β) (f : β → Set α), ↑T ⊆ s ∧ (t = ⋂ b ∈ T, f b) ∧ ∀ b ∈ T, f b ∈ g b

∃ T f, ↑T ⊆ s ∧ t = ⋂ b ∈ T, f b ∧ ∀ b ∈ T, f b ∈ g b


@[to_additive (attr := measurability)]
theorem AEMeasurable.div_const [MeasurableDiv G] (hf : AEMeasurable f μ) (c : G) :
    AEMeasurable (fun x => f x / c) μ

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Div G]
{m : MeasurableSpace α}
{f : α → G}
{μ : MeasureTheory.Measure α}
[MeasurableDiv G]
(hf : AEMeasurable f μ)
(c : G)


theorem symm_mapsTo (h : e.IsImage s t) : MapsTo e.symm (e.target ∩ t) (e.source ∩ s)

{α : Type u_1}
{β : Type u_2}
{e : PartialEquiv α β}
{s : Set α}
{t : Set β}
(h : e.IsImage s t)

Set.MapsTo (↑e.symm) (e.target ∩ t) (e.source ∩ s)


@[simp]
theorem Ici_diff_Ioi : Ici a \ Ioi b = Icc a b

{α : Type u_1}
[LinearOrder α]
{a b : α}


/-- Composition on the left by a (continuous) homomorphism of topological monoids, as a
`MonoidHom`. Similar to `MonoidHom.compLeft`. -/
@[to_additive (attr := simps)
"Composition on the left by a (continuous) homomorphism of topological `AddMonoid`s, as an
`AddMonoidHom`. Similar to `AddMonoidHom.comp_left`."]
protected def _root_.MonoidHom.compLeftContinuous {γ : Type*} [Monoid β] [ContinuousMul β]
    [TopologicalSpace γ] [Monoid γ] [ContinuousMul γ] (g : β →* γ) (hg : Continuous g) :
    C(α, β) →* C(α, γ)

(α : Type u_1)
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{γ : Type u_3}
[Monoid β]
[ContinuousMul β]
[TopologicalSpace γ]
[Monoid γ]
[ContinuousMul γ]
(g : β →* γ)
(hg : Continuous ⇑g)
(f : C(α, β))

(MonoidHom.compLeftContinuous α g hg) f = { toFun := ⇑g, continuous_toFun := hg }.comp f


@[simp]
theorem cos_sub_int_mul_two_pi (x : ℝ) (n : ℤ) : cos (x - n * (2 * π)) = cos x

Real.cos (x - ↑n * (2 * Real.pi)) = Real.cos x


@[simp]
theorem toBlock_apply (M : Matrix m n α) (p : m → Prop) (q : n → Prop) (i : { a // p a })
    (j : { a // q a }) : toBlock M p q i j = M ↑i ↑j

{m : Type u_2}
{n : Type u_3}
{α : Type u_12}
(M : Matrix m n α)
(p : m → Prop)
(q : n → Prop)
(i : { a // p a })
(j : { a // q a })


@[reassoc (attr := simp)]
theorem inv_hom_whiskerRight {X Y : C} (f : X ≅ Y) (Z : C) :
    f.inv ▷ Z ≫ f.hom ▷ Z = 𝟙 (Y ⊗ Z)

{C : Type u}
[𝒞 : CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{X Y : C}
(f : X ≅ Y)
(Z : C)

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight f.inv Z)
    (CategoryTheory.MonoidalCategory.whiskerRight f.hom Z) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj Y Z)


/-- The bifunctor combining an `I`-indexed family of objects with a `J`-indexed family of objects
to obtain an `I ⊕ J`-indexed family of objects.
-/
@[simps]
def sum : (∀ i, C i) ⥤ (∀ j, D j) ⥤ ∀ s : I ⊕ J, Sum.elim C D s

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

[(j : J) → CategoryTheory.Category.{v₁, u₁} (D j)]

((CategoryTheory.Pi.sum C).map f).app Y s =
  match s with
  | Sum.inl i => f i
  | Sum.inr j => CategoryTheory.CategoryStruct.id (Y j)


protected theorem tsub_eq_of_eq_add (hb : AddLECancellable b) (h : a = c + b) : a - b = c

{α : Type u_1}
[PartialOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b c : α}
(hb : AddLECancellable b)
(h : a = c + b)


theorem DifferentiableWithinAt.csin (hf : DifferentiableWithinAt ℂ f s x) :
    DifferentiableWithinAt ℂ (fun x => Complex.sin (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℂ f s x)


theorem isGreatest_univ [OrderTop α] : IsGreatest (univ : Set α) ⊤


@[simp]
theorem continuousLinearMapOfBilin_apply (v w : E) : ⟪B♯ v, w⟫ = B v w

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
(B : E →L⋆[𝕜] E →L[𝕜] 𝕜)
(v w : E)

⟪(InnerProductSpace.continuousLinearMapOfBilin B) v, w⟫_𝕜 = (B v) w


@[reassoc (attr := simp)]
lemma IsColimit.inl_desc {t : PushoutCocone f g} (ht : IsColimit t) {W : C} (h : Y ⟶ W) (k : Z ⟶ W)
    (w : f ≫ h = g ≫ k) : inl t ≫ IsColimit.desc ht h k w = h

{t : CategoryTheory.Limits.PushoutCocone f g}

(ht : CategoryTheory.Limits.IsColimit t)

t.inl ≫ CategoryTheory.Limits.PushoutCocone.IsColimit.desc ht h k w = h


lemma bi_min_div_two_lt_one : b (min_bi b) / 2 < 1

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

b (AkraBazziRecurrence.min_bi b) / 2 < 1


/-- The **first isomorphism theorem** for algebras. -/
@[simps!]
noncomputable def quotientKerAlgEquivOfSurjective {f : A →ₐ[R₁] B} (hf : Function.Surjective f) :
    (A ⧸ (RingHom.ker f)) ≃ₐ[R₁] B

{R₁ : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
[Semiring B]
[Algebra R₁ B]
{f : A →ₐ[R₁] B}
(hf : Function.Surjective ⇑f)
(a : A ⧸ RingHom.ker f.toRingHom)

(Ideal.quotientKerAlgEquivOfSurjective hf) a = (↑f).kerLift a


@[simp]
theorem removeOp_id (F : C ⥤ D) : NatTrans.removeOp (𝟙 F.op) = 𝟙 F

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

CategoryTheory.NatTrans.removeOp (CategoryTheory.CategoryStruct.id F.op) = CategoryTheory.CategoryStruct.id F


@[csimp] private theorem HeapNode.rankTR_eq : @rankTR = @rank

(s : Batteries.BinomialHeap.Imp.HeapNode α)

Batteries.BinomialHeap.Imp.HeapNode.rankTR.go s n = s.rank + n


/-- If `d` is a positive integer that is not a square, then there exists a nontrivial solution
to the Pell equation `x^2 - d*y^2 = 1`. -/
theorem exists_nontrivial_of_not_isSquare (h₀ : 0 < d) (hd : ¬IsSquare d) :
    ∃ a : Solution₁ d, a ≠ 1 ∧ a ≠ -1


theorem rpow_neg_one (x : ℝ≥0) : x ^ (-1 : ℝ) = x⁻¹


theorem UniqueDiffOn.eq (H : UniqueDiffOn 𝕜 s) (hx : x ∈ s) (h : HasFDerivWithinAt f f' s x)
    (h₁ : HasFDerivWithinAt f f₁' s x) : f' = f₁'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' f₁' : E →L[𝕜] F}
{x : E}
{s : Set E}
(H : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)
(h : HasFDerivWithinAt f f' s x)
(h₁ : HasFDerivWithinAt f f₁' s x)


theorem exists_ideal_over_prime_of_isIntegral [Algebra.IsIntegral R S] (P : Ideal R) [IsPrime P]
    (I : Ideal S) (hIP : I.comap (algebraMap R S) ≤ P) :
    ∃ Q ≥ I, IsPrime Q ∧ Q.comap (algebraMap R S) = P

(hIP : Ideal.comap (algebraMap R S) I ≤ P)

∃ Q ≥ I, Q.IsPrime ∧ Ideal.comap (algebraMap R S) Q = P


lemma lt_of_smul_lt_smul_of_nonpos [PosSMulReflectLT α β] (h : a • b₁ < a • b₂) (ha : a ≤ 0) :
    b₂ < b₁

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[OrderedRing α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulReflectLT α β]
(h : a • b₁ < a • b₂)
(ha : a ≤ 0)


lemma cfcₙ_apply_of_not_map_zero {f : R → R} (a : A) (hf : ¬ f 0 = 0) :
    cfcₙ f a = 0


theorem isIntegral_gen (pb : PowerBasis A S) : IsIntegral A pb.gen

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


@[to_additive]
lemma eq_finset_univ [Fintype G] [DecidableEq G]
    {x y : G} (hx : x ≠ 1) (hy : y ≠ 1) (hxy : x ≠ y) : {x * y, x, y, (1 : G)} = Finset.univ

{G : Type u_1}
[AddGroup G]
[IsAddKleinFour G]
[Fintype G]
[DecidableEq G]
{x y : G}
(hx : x ≠ 0)
(hy : y ≠ 0)
(hxy : x ≠ y)


@[reassoc]
lemma InjectiveResolution.iso_hom_naturality {X Y : C} (f : X ⟶ Y)
    (I : InjectiveResolution X) (J : InjectiveResolution Y)
    (φ : I.cocomplex ⟶ J.cocomplex) (comm : I.ι.f 0 ≫ φ.f 0 = f ≫ J.ι.f 0) :
    (injectiveResolutions C).map f ≫ J.iso.hom =
      I.iso.hom ≫ (HomotopyCategory.quotient _ _).map φ

(I : CategoryTheory.InjectiveResolution X)

(J : CategoryTheory.InjectiveResolution Y)

(CategoryTheory.injectiveResolutions C).map f ≫ J.iso.hom =
  I.iso.hom ≫ (HomotopyCategory.quotient C (ComplexShape.up ℕ)).map φ


theorem diagonal_pow [Fintype n] [DecidableEq n] (v : n → α) (k : ℕ) :
    diagonal v ^ k = diagonal (v ^ k)

{n : Type u_3}
{α : Type v}
[Semiring α]
[Fintype n]
[DecidableEq n]
(v : n → α)
(k : ℕ)

Matrix.diagonal v ^ k = Matrix.diagonal (v ^ k)


/-- Constructs an equivalence between preorders from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : Preord.{u}} (e : α ≃o β) : α ≅ β


theorem bihimp_right_surjective (a : α) : Surjective (a ⇔ ·)

{α : Type u_2}
[BooleanAlgebra α]
(a : α)


/-- We verify that an enriched functor between `Type v` enriched categories
is just the same thing as an honest functor.
-/
@[simps]
def enrichedFunctorTypeEquivFunctor {C : Type u₁} [𝒞 : EnrichedCategory (Type v) C] {D : Type u₂}
    [𝒟 : EnrichedCategory (Type v) D] : EnrichedFunctor (Type v) C D ≃ C ⥤ D

[𝒞 : CategoryTheory.EnrichedCategory (Type v) C]

[𝒟 : CategoryTheory.EnrichedCategory (Type v) D]

(f : CategoryTheory.EnrichedCategory.Hom X Y)

(CategoryTheory.enrichedFunctorTypeEquivFunctor.symm F).map X Y f = F.map f


theorem isGalois_iff_isGalois_top : IsGalois F (⊤ : IntermediateField F E) ↔ IsGalois F E

{F : Type u_1}
{E : Type u_3}
[Field F]
[Field E]
[Algebra F E]


theorem toIcoDiv_eq_floor (a b : α) : toIcoDiv hp a b = ⌊(b - a) / p⌋

{α : Type u_1}
[LinearOrderedField α]
[FloorRing α]
{p : α}
(hp : 0 < p)
(a b : α)


@[to_additive (attr := simp)]
theorem mul_left_inj (a : G) {b c : G} : b * a = c * a ↔ b = c

{G : Type u_3}
[Add G]
[IsRightCancelAdd G]
(a : G)
{b c : G}


/-- If a function defined on a topological group has compact support, then either
the function is trivial or the group is locally compact. -/
@[to_additive
      "If a function defined on a topological additive group has compact support,
      then either the function is trivial or the group is locally compact."]
theorem HasCompactSupport.eq_zero_or_locallyCompactSpace_of_group
    [TopologicalSpace α] [Zero α] [T1Space α]
    {f : G → α} (hf : HasCompactSupport f) (h'f : Continuous f) :
    f = 0 ∨ LocallyCompactSpace G

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[TopologicalSpace α]
[Zero α]
[T1Space α]
{f : G → α}
(hf : HasCompactSupport f)
(h'f : Continuous f)


theorem countP_le_length : countP p l ≤ l.length

{α : Type u_1}
(p : α → Bool)
{l : List α}


@[to_additive]
theorem Group.fg_of_surjective {G' : Type*} [Group G'] [hG : Group.FG G] {f : G →* G'}
    (hf : Function.Surjective f) : Group.FG G'

{G : Type u_3}
[AddGroup G]
{G' : Type u_5}
[AddGroup G']
[hG : AddGroup.FG G]
{f : G →+ G'}
(hf : Function.Surjective ⇑f)


lemma Codisjoint.ne_bot_of_ne_top' (h : Codisjoint a b) (hb : b ≠ ⊤) : a ≠ ⊥

{α : Type u_1}
[PartialOrder α]
[BoundedOrder α]
{a b : α}
(h : Codisjoint a b)
(hb : b ≠ ⊤)


theorem two_nsmul_neg_pi_div_two : (2 : ℕ) • (↑(-π / 2) : Angle) = π


/-- Any three points in a cospherical set are affinely independent. -/
theorem Cospherical.affineIndependent_of_mem_of_ne {s : Set P} (hs : Cospherical s) {p₁ p₂ p₃ : P}
    (h₁ : p₁ ∈ s) (h₂ : p₂ ∈ s) (h₃ : p₃ ∈ s) (h₁₂ : p₁ ≠ p₂) (h₁₃ : p₁ ≠ p₃) (h₂₃ : p₂ ≠ p₃) :
    AffineIndependent ℝ ![p₁, p₂, p₃]

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : Set P}
(hs : EuclideanGeometry.Cospherical s)
{p₁ p₂ p₃ : P}
(h₁ : p₁ ∈ s)
(h₂ : p₂ ∈ s)
(h₃ : p₃ ∈ s)
(h₁₂ : p₁ ≠ p₂)
(h₁₃ : p₁ ≠ p₃)
(h₂₃ : p₂ ≠ p₃)


/-- A conditionally complete linear order with `Bot` is a linear order with least element, in which
every nonempty subset which is bounded above has a supremum, and every nonempty subset (necessarily
bounded below) has an infimum.  A typical example is the natural numbers.

To differentiate the statements from the corresponding statements in (unconditional)
complete linear orders, we prefix `sInf` and `sSup` by a c everywhere. The same statements should
hold in both worlds, sometimes with additional assumptions of nonemptiness or
boundedness. -/
class ConditionallyCompleteLinearOrderBot (α : Type*) extends ConditionallyCompleteLinearOrder α,
  Bot α where
  /-- `⊥` is the least element -/
  bot_le : ∀ x : α, ⊥ ≤ x
  /-- The supremum of the empty set is `⊥` -/
  csSup_empty : sSup ∅ = ⊥

[self : ConditionallyCompleteLinearOrderBot α]


/-- The triangle inequality for `UniformSpace.ball` -/
theorem mem_ball_comp {V W : Set (β × β)} {x y z} (h : y ∈ ball x V) (h' : z ∈ ball y W) :
    z ∈ ball x (V ○ W)

{β : Type ub}
{V W : Set (β × β)}
{x y z : β}
(h : y ∈ UniformSpace.ball x V)
(h' : z ∈ UniformSpace.ball y W)


@[simp]
theorem toIocDiv_add_left' (a b : α) : toIocDiv hp (p + a) b = toIocDiv hp a b - 1

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


@[simp]
theorem measurableSet_image (e : α ≃ᵐ β) :
    MeasurableSet (e '' s) ↔ MeasurableSet s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)

MeasurableSet (⇑e '' s) ↔ MeasurableSet s


@[to_additive (attr := simp)]
theorem coe_smul [SMul K β] (c : K) (f : α →ₛ β) : ⇑(c • f) = c • ⇑f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{K : Type u_5}
[VAdd K β]
(c : K)
(f : MeasureTheory.SimpleFunc α β)


theorem norm_le_norm_of_mem [NormOneClass A] {a : A} {k : 𝕜} (hk : k ∈ σ a) : ‖k‖ ≤ ‖a‖

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
[NormOneClass A]
{a : A}
{k : 𝕜}
(hk : k ∈ spectrum 𝕜 a)


theorem not_integrableOn_of_tendsto_norm_atTop_of_deriv_isBigO_filter
    {f : ℝ → E} {g : ℝ → F}
    {k : Set ℝ} (l : Filter ℝ) [NeBot l] [TendstoIxxClass Icc l l]
    (hl : k ∈ l) (hd : ∀ᶠ x in l, DifferentiableAt ℝ f x) (hf : Tendsto (fun x => ‖f x‖) l atTop)
    (hfg : deriv f =O[l] g) : ¬IntegrableOn g k

(hd : ∀ᶠ (x : ℝ) in l, DifferentiableAt ℝ f x)

(hf : Filter.Tendsto (fun x => ‖f x‖) l Filter.atTop)

¬MeasureTheory.IntegrableOn g k MeasureTheory.volume


theorem add_le_of_le_sub {a b c : Nat} (hle : b ≤ c) (h : a ≤ c - b) : a + b ≤ c


@[simp]
theorem tan_pi_div_four : tan (π / 4) = 1


theorem le_nhds_infty {f : Filter (OnePoint X)} :
    f ≤ 𝓝 ∞ ↔ ∀ s : Set X, IsClosed s → IsCompact s → (↑) '' sᶜ ∪ {∞} ∈ f

{X : Type u_1}
[TopologicalSpace X]
{f : Filter (OnePoint X)}

f ≤ 𝓝 OnePoint.infty ↔ ∀ (s : Set X), IsClosed s → IsCompact s → OnePoint.some '' sᶜ ∪ {OnePoint.infty} ∈ f


@[to_additive]
protected theorem div_le_div_left : g₁ ≤ g₂ → f / g₁ ≤ f / g₂

{α : Type u_2}
[Sub α]
{f g₁ g₂ : Filter α}


@[simp]
theorem mem_range {m n : Nat} : m ∈ range n ↔ m < n


/-- Division `y ↦ y / x` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply toEquiv) "Subtraction `y ↦ y - x` as an `IsometryEquiv`."]
def divRight [IsometricSMul Gᵐᵒᵖ G] (c : G) : G ≃ᵢ G

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul Gᵐᵒᵖ G]
(c : G)

(IsometryEquiv.divRight c).toEquiv = Equiv.divRight c


/-- When `S₁.f`, `S₁.g`, `S₂.f` and `S₂.g` are all zero, the action on left homology of a
morphism `φ : S₁ ⟶ S₂` is given by the action `φ.τ₂` on the middle objects. -/
@[simps]
def ofZeros (φ : S₁ ⟶ S₂) (hf₁ : S₁.f = 0) (hg₁ : S₁.g = 0) (hf₂ : S₂.f = 0) (hg₂ : S₂.g = 0) :
    LeftHomologyMapData φ (LeftHomologyData.ofZeros S₁ hf₁ hg₁)
      (LeftHomologyData.ofZeros S₂ hf₂ hg₂)

(CategoryTheory.ShortComplex.LeftHomologyMapData.ofZeros φ hf₁ hg₁ hf₂ hg₂).φK = φ.τ₂


/-- A restatement of `prod_ite_eq` with the equality test reversed. -/
@[to_additive (attr := simp) "A restatement of `sum_ite_eq` with the equality test reversed."]
theorem prod_ite_eq' [DecidableEq α] (f : α →₀ M) (a : α) (b : α → M → N) :
    (f.prod fun x v => ite (x = a) (b x v) 1) = ite (a ∈ f.support) (b a (f a)) 1

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
[DecidableEq α]
(f : α →₀ M)
(a : α)
(b : α → M → N)

(f.sum fun x v => if x = a then b x v else 0) = if a ∈ f.support then b a (f a) else 0


theorem range_eq_iff (f : α → β) (s : Set β) :
    range f = s ↔ (∀ a, f a ∈ s) ∧ ∀ b ∈ s, ∃ a, f a = b

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

Set.range f = s ↔ (∀ (a : α), f a ∈ s) ∧ ∀ b ∈ s, ∃ a, f a = b


lemma edge_firstDart (p : G.Walk v w) (hp : ¬ p.Nil) :
    (p.firstDart hp).edge = s(v, p.sndOfNotNil hp)

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(p : G.Walk v w)
(hp : ¬p.Nil)


theorem snd_openEmbedding_of_left_openEmbedding {X Y S : TopCat} {f : X ⟶ S} (H : OpenEmbedding f)
    (g : Y ⟶ S) : OpenEmbedding <| ⇑(pullback.snd f g)

{X Y S : TopCat}
{f : X ⟶ S}
(H : OpenEmbedding ⇑f)
(g : Y ⟶ S)

OpenEmbedding ⇑(CategoryTheory.Limits.pullback.snd f g)


theorem dual_eraseMax (t : Ordnode α) : dual (eraseMax t) = eraseMin (dual t)


@[simp] lemma lift_le_ofENat {x : Cardinal.{v}} {m : ℕ∞} : lift.{u} x ≤ m ↔ x ≤ m


lemma equivalence_rel' [Mono f] : _root_.Equivalence (Rel' f g)

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)
[CategoryTheory.Mono f]

Equivalence (CategoryTheory.Limits.Types.Pushout.Rel' f g)


theorem expSeries_div_summable (x : 𝔸) : Summable fun n => x ^ n / n !

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedDivisionRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)


@[gcongr]
theorem prod_mono_left (g : Filter β) {f₁ f₂ : Filter α} (hf : f₁ ≤ f₂) : f₁ ×ˢ g ≤ f₂ ×ˢ g

{α : Type u_1}
{β : Type u_2}
(g : Filter β)
{f₁ f₂ : Filter α}
(hf : f₁ ≤ f₂)

f₁ ×ˢ g ≤ f₂ ×ˢ g


lemma ab_exact_iff_range_eq_ker : S.Exact ↔ S.f.range = S.g.ker

S.Exact ↔ AddMonoidHom.range S.f = AddMonoidHom.ker S.g


@[to_additive]
theorem lift_one : lift f 1 = 1

{α : Type u}
{β : Type v}
[Mul α]
[MulOneClass β]
(f : α →ₙ* β)


@[to_additive (attr := simp, norm_cast)]
theorem coe_mul [Mul M] (f g : α → M) : ↑(f * g) = (f * g : Germ l M)

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[Add M]
(f g : α → M)


@[to_additive]
theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M}
    (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) :
    ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I

(hf : LocallyFinite fun i => Function.support (f i))

∃ I, ∀ᶠ (x : X) in 𝓝 x₀, (Function.support fun i => f i x) ⊆ ↑I


theorem closedBall_compl_subset_of_mem_cocompact {s : Set α} (hs : s ∈ cocompact α) (c : α) :
    ∃ (r : ℝ), (Metric.closedBall c r)ᶜ ⊆ s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(hs : s ∈ Filter.cocompact α)
(c : α)


theorem derivedSeries_lt_top_of_solvable [IsSolvable R L] [Nontrivial L] :
    derivedSeries R L 1 < ⊤

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsSolvable R L]
[Nontrivial L]


/-- Constructor for null homotopic morphisms, see also `Homotopy.ofNullHomotopic`
and `Homotopy.eq_add_nullHomotopic`. -/
@[simps]
def nullHomotopic (h₀ : S₁.X₁ ⟶ S₂.X₁) (h₀_f : h₀ ≫ S₂.f = 0)
    (h₁ : S₁.X₂ ⟶ S₂.X₁) (h₂ : S₁.X₃ ⟶ S₂.X₂) (h₃ : S₁.X₃ ⟶ S₂.X₃) (g_h₃ : S₁.g ≫ h₃ = 0) :
    S₁ ⟶ S₂

(h₀_f : CategoryTheory.CategoryStruct.comp h₀ S₂.f = 0)

(g_h₃ : CategoryTheory.CategoryStruct.comp S₁.g h₃ = 0)

(S₁.nullHomotopic S₂ h₀ h₀_f h₁ h₂ h₃ g_h₃).τ₂ =
  CategoryTheory.CategoryStruct.comp h₁ S₂.f + CategoryTheory.CategoryStruct.comp S₁.g h₂


@[simp]
theorem range_eval (n : ℕ) : LinearMap.range (eval I M n) = ⊤

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(n : ℕ)

LinearMap.range (AdicCompletion.eval I M n) = ⊤


@[simp]
theorem lift_inf {f : Filter α} {g h : Set α → Filter β} :
    (f.lift fun x => g x ⊓ h x) = f.lift g ⊓ f.lift h

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g h : Set α → Filter β}


/-- Given a cocone over `F ⋙ G`, we can construct a `Cocone G` with the same cocone point.
-/
@[simps]
def extendCocone : Cocone (F ⋙ G) ⥤ Cocone G

(c : CategoryTheory.Limits.Cocone (F.comp G))

(CategoryTheory.Functor.Final.extendCocone.obj c).pt = c.pt


theorem IsSt.le {x y : ℝ*} {r s : ℝ} (hrx : IsSt x r) (hsy : IsSt y s) (hxy : x ≤ y) : r ≤ s

{x y : ℝ*}
{r s : ℝ}
(hrx : x.IsSt r)
(hsy : y.IsSt s)
(hxy : x ≤ y)


theorem collapseF.lt [IsWellOrder β s] (f : r ↪r s) {a : α} :
    ∀ {a'}, r a' a → s (collapseF f a').1 (collapseF f a).1

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder β s]
(f : r ↪r s)
{a a' : α}

r a' a → s ↑(f.collapseF a') ↑(f.collapseF a)


theorem HasDerivAt.rpow (hf : HasDerivAt f f' x) (hg : HasDerivAt g g' x) (h : 0 < f x) :
    HasDerivAt (fun x => f x ^ g x)
      (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * Real.log (f x)) x

{f g : ℝ → ℝ}
{f' g' x : ℝ}
(hf : HasDerivAt f f' x)
(hg : HasDerivAt g g' x)
(h : 0 < f x)


/-- An affine-independent family of points in a finite-dimensional affine space is finite. -/
theorem finite_of_fin_dim_affineIndependent [FiniteDimensional k V] {p : ι → P}
    (hi : AffineIndependent k p) : Finite ι

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[FiniteDimensional k V]
{p : ι → P}
(hi : AffineIndependent k p)


theorem Ideal.homogeneousCore'_le : I.homogeneousCore' 𝒜 ≤ I

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[SetLike σ A]
(𝒜 : ι → σ)
(I : Ideal A)


/-- The datum of an extra degeneracy is a technical condition on
augmented simplicial objects. The morphisms `s'` and `s n` of the
structure formally behave like extra degeneracies `σ (-1)`. -/
@[ext]
structure ExtraDegeneracy (X : SimplicialObject.Augmented C) where
  s' : point.obj X ⟶ drop.obj X _[0]
  s : ∀ n : ℕ, drop.obj X _[n] ⟶ drop.obj X _[n + 1]
  s'_comp_ε : s' ≫ X.hom.app (op [0]) = 𝟙 _
  s₀_comp_δ₁ : s 0 ≫ X.left.δ 1 = X.hom.app (op [0]) ≫ s'
  s_comp_δ₀ : ∀ n : ℕ, s n ≫ X.left.δ 0 = 𝟙 _
  s_comp_δ :
    ∀ (n : ℕ) (i : Fin (n + 2)), s (n + 1) ≫ X.left.δ i.succ = X.left.δ i ≫ s n
  s_comp_σ :
    ∀ (n : ℕ) (i : Fin (n + 1)), s n ≫ X.left.σ i.succ = X.left.σ i ≫ s (n + 1)

{X : CategoryTheory.SimplicialObject.Augmented C}

(self : SimplicialObject.Augmented.ExtraDegeneracy X)

self.s n ≫ X.left.σ i.succ = X.left.σ i ≫ self.s (n + 1)


@[to_additive (attr := simp)]
theorem prod_empty : ∏ x ∈ ∅, f x = 1

{α : Type u_3}
{β : Type u_4}
{f : α → β}
[AddCommMonoid β]


theorem neLocus_eq_support_sub : f.neLocus g = (f - g).support

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f g : α →₀ N)


/-- Precomposing `f` with `Prod.fst` is continuous at `(x, y)` -/
theorem ContinuousAt.fst' {f : X → Z} {x : X} {y : Y} (hf : ContinuousAt f x) :
    ContinuousAt (fun x : X × Y => f x.fst) (x, y)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Z}
{x : X}
{y : Y}
(hf : ContinuousAt f x)


/-- A variant of Urysohn's lemma, `ℒ^p` version, for an outer regular measure `μ`:
consider two sets `s ⊆ u` which are respectively closed and open with `μ s < ∞`, and a vector `c`.
Then one may find a continuous function `f` equal to `c` on `s` and to `0` outside of `u`,
bounded by `‖c‖` everywhere, and such that the `ℒ^p` norm of `f - s.indicator (fun y ↦ c)` is
arbitrarily small. Additionally, this function `f` belongs to `ℒ^p`. -/
theorem exists_continuous_eLpNorm_sub_le_of_closed [μ.OuterRegular] (hp : p ≠ ∞) {s u : Set α}
    (s_closed : IsClosed s) (u_open : IsOpen u) (hsu : s ⊆ u) (hs : μ s ≠ ∞) (c : E) {ε : ℝ≥0∞}
    (hε : ε ≠ 0) :
    ∃ f : α → E,
      Continuous f ∧
        eLpNorm (fun x => f x - s.indicator (fun _y => c) x) p μ ≤ ε ∧
          (∀ x, ‖f x‖ ≤ ‖c‖) ∧ Function.support f ⊆ u ∧ Memℒp f p μ

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[MeasurableSpace α]
[BorelSpace α]
{E : Type u_2}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{p : ℝ≥0∞}
[NormedSpace ℝ E]
[μ.OuterRegular]
(hp : p ≠ ⊤)
{s u : Set α}
(s_closed : IsClosed s)
(u_open : IsOpen u)
(hsu : s ⊆ u)
(hs : μ s ≠ ⊤)
(c : E)
{ε : ℝ≥0∞}
(hε : ε ≠ 0)

∃ f,
  Continuous f ∧
    MeasureTheory.eLpNorm (fun x => f x - s.indicator (fun _y => c) x) p μ ≤ ε ∧
      (∀ (x : α), ‖f x‖ ≤ ‖c‖) ∧ Function.support f ⊆ u ∧ MeasureTheory.Memℒp f p μ


theorem singleton_perm_singleton {a b : α} : [a] ~ [b] ↔ a = b


theorem add_one_lt_add_one_iff : a + 1 < b + 1 ↔ a < b


@[simp] theorem truncate_xor {x y : BitVec w} :
    (x ^^^ y).truncate k = x.truncate k ^^^ y.truncate k

BitVec.truncate k (x ^^^ y) = BitVec.truncate k x ^^^ BitVec.truncate k y


lemma ih4 (ih' : ∀ a, ArgsRel a (Args.P24 x₁ x₂ y) → P124 a) : IH4 x₁ x₂ y

(ih' :
  ∀ (a : Surreal.Multiplication.Args),
    Surreal.Multiplication.ArgsRel a (Surreal.Multiplication.Args.P24 x₁ x₂ y) → Surreal.Multiplication.P124 a)


theorem CofiniteTopology.continuous_of [T1Space X] : Continuous (@CofiniteTopology.of X)

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]


lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i ∈ S, (μ⟦s i | m'⟧)

{Ω : Type u_1}
{ι : Type u_2}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
(s : ι → Set Ω)
(hπ : ∀ (i : ι), MeasurableSet (s i))
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.iCondIndepSets m' hm' (fun i => {s i}) μ ↔
  ∀ (S : Finset ι), μ[(⋂ i ∈ S, s i).indicator fun ω => 1|m'] =ᵐ[μ] ∏ i ∈ S, μ[(s i).indicator fun ω => 1|m']


/-- A presheaf `(opens X)ᵒᵖ ⥤ C` on a topological space `X` is a sheaf on the site `opens X` iff
    it satisfies the `IsSheafOpensLeCover` sheaf condition. The latter is not the
    official definition of sheaves on spaces, but has the advantage that it does not
    require `has_products C`. -/
theorem isSheaf_iff_isSheafOpensLeCover : F.IsSheaf ↔ F.IsSheafOpensLeCover

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(F : TopCat.Presheaf C X)


theorem isPreconnected_singleton {x} : IsPreconnected ({x} : Set α)

{α : Type u}
[TopologicalSpace α]
{x : α}


theorem comp_symm_equiv' {π : P →+* R} (m : PerfectionMap p π) :
    π.comp ↑m.equiv.symm = Perfection.coeff R p 0

{p : ℕ}
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
{P : Type u₃}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
{π : P →+* R}
(m : PerfectionMap p π)


@[simp]
theorem associated_linMulLin (f g : M →ₗ[R] R) :
    associated (R := R) (linMulLin f g) =
      ⅟ (2 : R) • ((mul R R).compl₁₂ f g + (mul R R).compl₁₂ g f)

{R : Type u_3}
{M : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Invertible 2]
(f g : M →ₗ[R] R)

QuadraticMap.associated (QuadraticMap.linMulLin f g) =
  ⅟2 • ((LinearMap.mul R R).compl₁₂ f g + (LinearMap.mul R R).compl₁₂ g f)


@[simp, norm_cast]
theorem coe_sub (f g : M →SL[σ₁₂] M₂) : (↑(f - g) : M →ₛₗ[σ₁₂] M₂) = f - g

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
[TopologicalAddGroup M₂]
(f g : M →SL[σ₁₂] M₂)


@[to_additive]
theorem list_prod_singleton {M : Type*} [CommMonoid M] (s : List M) :
    (s.map fun i ↦ ({i} : Set M)).prod = {s.prod}

{M : Type u_5}
[AddCommMonoid M]
(s : List M)

(List.map (fun i => {i}) s).sum = {s.sum}


theorem Prod.isMin_iff : IsMin x ↔ IsMin x.1 ∧ IsMin x.2

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{x : α × β}


theorem uniformity_setCoe {s : Set α} [UniformSpace α] :
    𝓤 s = comap (Prod.map ((↑) : s → α) ((↑) : s → α)) (𝓤 α)

{α : Type ua}
{s : Set α}
[UniformSpace α]

𝓤 ↑s = Filter.comap (Prod.map Subtype.val Subtype.val) (𝓤 α)


/-- The left adjoint of evaluation. -/
@[simps]
def evaluationLeftAdjoint (c : C) : D ⥤ C ⥤ D

[∀ (a b : C), CategoryTheory.Limits.HasCoproductsOfShape (a ⟶ b) D]

∀ {x d₂ : D} (f : x ⟶ d₂) (e : C),
  ((CategoryTheory.evaluationLeftAdjoint D c).map f).app e =
    CategoryTheory.Limits.Sigma.desc fun h =>
      CategoryTheory.CategoryStruct.comp f (CategoryTheory.Limits.Sigma.ι (fun x => d₂) h)


theorem aeval_modByMonic_eq_self_of_root [Algebra R S] {p q : R[X]} (hq : q.Monic) {x : S}
    (hx : aeval x q = 0) : aeval x (p %ₘ q) = aeval x p

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{p q : R[X]}
(hq : q.Monic)
{x : S}
(hx : (Polynomial.aeval x) q = 0)

(Polynomial.aeval x) (p %ₘ q) = (Polynomial.aeval x) p


@[to_additive (attr := fun_prop)]
theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) :
    ContinuousAt (fun x => f x * g x) x

{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[Add M]
[ContinuousAdd M]
{f g : X → M}
{x : X}
(hf : ContinuousAt f x)
(hg : ContinuousAt g x)


@[to_additive]
protected lemma div_eq_of_eq_mul (h : IsUnit b) : a = c * b → a / b = c

{α : Type u}
[DivisionMonoid α]
{a b c : α}
(h : IsUnit b)


/-- This is used as the ext lemma instead of `MonoidHom.functions_ext` for reasons explained in
note [partially-applied ext lemmas]. -/
@[to_additive (attr := ext)
      "\nThis is used as the ext lemma instead of `AddMonoidHom.functions_ext` for reasons
      explained in note [partially-applied ext lemmas]."]
theorem MonoidHom.functions_ext' [Finite I] (M : Type*) [CommMonoid M] (g h : (∀ i, Z i) →* M)
    (H : ∀ i, g.comp (MonoidHom.mulSingle Z i) = h.comp (MonoidHom.mulSingle Z i)) : g = h

(H : ∀ (i : I), g.comp (MonoidHom.mulSingle Z i) = h.comp (MonoidHom.mulSingle Z i))


theorem lift_def (F : Multiplicative G →* A) :
    ⇑(lift k G A F) = liftNC ((algebraMap k A : k →+* A) : k →+ A) F

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[AddMonoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : Multiplicative G →* A)

⇑((AddMonoidAlgebra.lift k G A) F) = ⇑(AddMonoidAlgebra.liftNC ↑(algebraMap k A) ⇑F)


@[to_additive]
theorem singleton_mul_inter : {a} * (s ∩ t) = {a} * s ∩ ({a} * t)

{α : Type u_2}
[Mul α]
[IsLeftCancelMul α]
[DecidableEq α]
(s t : Finset α)
(a : α)


theorem inter_mem_measurableCylinders (hs : s ∈ measurableCylinders α)
    (ht : t ∈ measurableCylinders α) :
    s ∩ t ∈ measurableCylinders α

(hs : s ∈ MeasureTheory.measurableCylinders α)

(ht : t ∈ MeasureTheory.measurableCylinders α)

s ∩ t ∈ MeasureTheory.measurableCylinders α


/-- The closed thickening of a compact set `E` is the union of the balls `Metric.closedBall x δ`
over `x ∈ E`.

See also `Metric.cthickening_eq_biUnion_closedBall`. -/
theorem _root_.IsCompact.cthickening_eq_biUnion_closedBall {α : Type*} [PseudoMetricSpace α]
    {δ : ℝ} {E : Set α} (hE : IsCompact E) (hδ : 0 ≤ δ) :
    cthickening δ E = ⋃ x ∈ E, closedBall x δ

{α : Type u_2}
[PseudoMetricSpace α]
{δ : ℝ}
{E : Set α}
(hE : IsCompact E)
(hδ : 0 ≤ δ)

Metric.cthickening δ E = ⋃ x ∈ E, Metric.closedBall x δ


@[simp]
theorem coe_comap (I : Ideal S) : (comap f I : Set R) = f ⁻¹' I

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(I : Ideal S)


theorem fast_fib_aux_eq (n : ℕ) : fastFibAux n = (fib n, fib (n + 1))

n.fastFibAux = (Nat.fib n, Nat.fib (n + 1))


@[to_additive]
protected theorem div_le_div_right : f₁ ≤ f₂ → f₁ / g ≤ f₂ / g

{α : Type u_2}
[Sub α]
{f₁ f₂ g : Filter α}


@[simp] theorem forall_eq_apply_imp_iff {f : α → β} {p : β → Prop} :
    (∀ b a, b = f a → p b) ↔ ∀ a, p (f a)

{α : Sort u_2}
{β : Sort u_1}
{f : α → β}
{p : β → Prop}

(∀ (b : β) (a : α), b = f a → p b) ↔ ∀ (a : α), p (f a)


/-- Given a non-unital star `ℝ≥0`-algebra homomorphism `φ` from `C(X, ℝ≥0)₀` into a non-unital
`ℝ`-algebra `A`, this is the unique extension of `φ` from `C(X, ℝ)₀` to `A` as a non-unital
star `ℝ`-algebra homomorphism. -/
@[simps]
noncomputable def realContinuousMapZeroOfNNReal (φ : C(X, ℝ≥0)₀ →⋆ₙₐ[ℝ≥0] A) :
    C(X, ℝ)₀ →⋆ₙₐ[ℝ] A

(φ : ContinuousMapZero X NNReal →⋆ₙₐ[NNReal] A)

φ.realContinuousMapZeroOfNNReal f = φ f.toNNReal - φ (-f).toNNReal


{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommGroup R]
{α : Type u_3}
{s : HahnSeries.SummableFamily Γ R α}
{a : α}


theorem Equiv.lieModule_isNilpotent_iff (f : L ≃ₗ⁅R⁆ L₂) (g : M ≃ₗ[R] M₂)
    (hfg : ∀ x m, ⁅f x, g m⁆ = g ⁅x, m⁆) : IsNilpotent R L M ↔ IsNilpotent R L₂ M₂

(hfg : ∀ (x : L) (m : M), ⁅f x, g m⁆ = g ⁅x, m⁆)

LieModule.IsNilpotent R L M ↔ LieModule.IsNilpotent R L₂ M₂


@[simp]
theorem run_monadLift {n} [MonadLiftT n m] (x : n α) :
    (monadLift x : ExceptT ε m α).run = Except.ok <$> (monadLift x : m α)

{α ε : Type u}
{m : Type u → Type v}
[Monad m]
{n : Type u → Type u_1}
[MonadLiftT n m]
(x : n α)

(monadLift x).run = Except.ok <$> monadLift x


@[simp, norm_cast]
theorem unop_coe (S : Subsemiring Rᵐᵒᵖ) : S.unop = MulOpposite.op ⁻¹' (S : Set Rᵐᵒᵖ)

{R : Type u_2}
[NonAssocSemiring R]
(S : Subsemiring Rᵐᵒᵖ)


@[to_additive (attr := simp)]
theorem prod_map_inv : (m.map fun i => (f i)⁻¹).prod = (m.map f).prod⁻¹

{ι : Type u_2}
{α : Type u_3}
[SubtractionCommMonoid α]
{m : Multiset ι}
{f : ι → α}

(Multiset.map (fun i => -f i) m).sum = -(Multiset.map f m).sum


theorem tendsto_addHaar_inter_smul_zero_of_density_zero_aux2 (s : Set E) (x : E)
    (h : Tendsto (fun r => μ (s ∩ closedBall x r) / μ (closedBall x r)) (𝓝[>] 0) (𝓝 0)) (t : Set E)
    (u : Set E) (h'u : μ u ≠ 0) (R : ℝ) (Rpos : 0 < R) (t_bound : t ⊆ closedBall 0 R) :
    Tendsto (fun r : ℝ => μ (s ∩ ({x} + r • t)) / μ ({x} + r • u)) (𝓝[>] 0) (𝓝 0)

(h : Filter.Tendsto (fun r => μ (s ∩ Metric.closedBall x r) / μ (Metric.closedBall x r)) (𝓝[>] 0) (𝓝 0))

Filter.Tendsto (fun r => μ (s ∩ ({x} + r • t)) / μ ({x} + r • u)) (𝓝[>] 0) (𝓝 0)


/-- A random variable that `HasPDF` transformed under a `QuasiMeasurePreserving`
map also `HasPDF` if `(map g (map X ℙ)).HaveLebesgueDecomposition μ`.

`quasiMeasurePreserving_hasPDF` is more useful in the case we are working with a
probability measure and a real-valued random variable. -/
theorem quasiMeasurePreserving_hasPDF {X : Ω → E} [HasPDF X ℙ μ] (hX : AEMeasurable X ℙ) {g : E → F}
    (hg : QuasiMeasurePreserving g μ ν) (hmap : (map g (map X ℙ)).HaveLebesgueDecomposition ν) :
    HasPDF (g ∘ X) ℙ ν

(hg : MeasureTheory.Measure.QuasiMeasurePreserving g μ ν)

(hmap : (MeasureTheory.Measure.map g (MeasureTheory.Measure.map X ℙ)).HaveLebesgueDecomposition ν)


@[simp]
theorem range_empty (u : Fin 0 → α) : Set.range u = ∅


lemma Odd.sub_odd (ha : Odd a) (hb : Odd b) : Even (a - b)

{α : Type u_2}
[Ring α]
{a b : α}
(ha : Odd a)
(hb : Odd b)


theorem pow_dvd_pow_iff_pow_le_pow {k l : Nat} :
    ∀ {x : Nat}, 0 < x → (x ^ k ∣ x ^ l ↔ x ^ k ≤ x ^ l)


/-- A set of points is concyclic if it is cospherical and coplanar. (Most results are stated
directly in terms of `Cospherical` instead of using `Concyclic`.) -/
structure Concyclic (ps : Set P) : Prop where
  Cospherical : Cospherical ps
  Coplanar : Coplanar ℝ ps

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{ps : Set P}
(self : EuclideanGeometry.Concyclic ps)


/-- When a right homology data `h` of a short complex `S` is preserved by a functor `F`,
this is the induced right homology data `h.map F` for the short complex `S.map F`. -/
@[simps]
noncomputable def map : (S.map F).RightHomologyData


/-- Converse to the mean value inequality: if `f` is `C`-lipschitz on a neighborhood of `x₀`
then its line derivative at `x₀` in the direction `v` has norm bounded by `C * ‖v‖`.
Version using `lineDeriv`. -/
theorem norm_lineDeriv_le_of_lipschitzOn {f : E → F} {x₀ : E} {s : Set E} (hs : s ∈ 𝓝 x₀)
    {C : ℝ≥0} (hlip : LipschitzOnWith C f s) : ‖lineDeriv 𝕜 f x₀ v‖ ≤ C * ‖v‖

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{v : E}
{f : E → F}
{x₀ : E}
{s : Set E}
(hs : s ∈ 𝓝 x₀)
{C : ℝ≥0}
(hlip : LipschitzOnWith C f s)


lemma pred_eq_self_iff : n.pred = n ↔ n = 0


theorem Injective.exists_unique_of_mem_range (hf : Injective f) {b : β} (hb : b ∈ range f) :
    ∃! a, f a = b

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Injective f)
{b : β}
(hb : b ∈ Set.range f)


@[simp]
theorem embeddingCongr_symm {α₁ β₁ α₂ β₂ : Sort*} (e₁ : α₁ ≃ α₂) (e₂ : β₁ ≃ β₂) :
    (embeddingCongr e₁ e₂).symm = embeddingCongr e₁.symm e₂.symm

{α₁ : Sort u_1}
{β₁ : Sort u_2}
{α₂ : Sort u_3}
{β₂ : Sort u_4}
(e₁ : α₁ ≃ α₂)
(e₂ : β₁ ≃ β₂)

(e₁.embeddingCongr e₂).symm = e₁.symm.embeddingCongr e₂.symm


@[to_additive (attr := simp)]
theorem map_bot (f : M →ₙ* N) : (⊥ : Subsemigroup M).map f = ⊥

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : AddHom M N)