@[to_additive (attr := simp)]
theorem mulEquivOfMulEquiv_eq_map_apply {k : LocalizationMap T Q} {j : M ≃* P}
    (H : S.map j.toMonoidHom = T) (x) :
    f.mulEquivOfMulEquiv k H x =
      f.map (fun y : S ↦ show j.toMonoidHom y ∈ T from H ▸ Set.mem_image_of_mem j y.2) k x

(H : AddSubmonoid.map j.toAddMonoidHom S = T)

(f.addEquivOfAddEquiv k H) x = (f.map ⋯ k) x


@[simp]
theorem i_mul_k : q.i * q.k = c₁ • q.j

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)


theorem eLpNorm_sum_le {ι} {f : ι → α → E} {s : Finset ι}
    (hfs : ∀ i, i ∈ s → AEStronglyMeasurable (f i) μ) (hp1 : 1 ≤ p) :
    eLpNorm (∑ i ∈ s, f i) p μ ≤ ∑ i ∈ s, eLpNorm (f i) p μ

(hfs : ∀ i ∈ s, MeasureTheory.AEStronglyMeasurable (f i) μ)

MeasureTheory.eLpNorm (∑ i ∈ s, f i) p μ ≤ ∑ i ∈ s, MeasureTheory.eLpNorm (f i) p μ


/-- The inclusion map (i.e., `coe`) from the sphere in `E` to `E` is smooth.  -/
theorem contMDiff_coe_sphere {n : ℕ} [Fact (finrank ℝ E = n + 1)] :
    ContMDiff (𝓡 n) 𝓘(ℝ, E) ∞ ((↑) : sphere (0 : E) 1 → E)

[Fact (FiniteDimensional.finrank ℝ E = n + 1)]

ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) ⊤ Subtype.val


theorem isLUB_ciSup_set {f : β → α} {s : Set β} (H : BddAbove (f '' s)) (Hne : s.Nonempty) :
    IsLUB (f '' s) (⨆ i : s, f i)

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
{f : β → α}
{s : Set β}
(H : BddAbove (f '' s))
(Hne : s.Nonempty)


@[simp]
theorem bind_add : (s.bind fun a => f a + g a) = s.bind f + s.bind g

{α : Type u_1}
{β : Type v}
(s : Multiset α)
(f g : α → Multiset β)


@[simp]
theorem coe_equivToUnitHom (χ : MulChar R R') (a : Rˣ) : ↑(equivToUnitHom χ a) = χ a

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ : MulChar R R')
(a : Rˣ)


theorem EqvGen.mono {r p : α → α → Prop} (hrp : ∀ a b, r a b → p a b) (h : EqvGen r a b) :
    EqvGen p a b

{α : Type u_1}
{a b : α}
{r p : α → α → Prop}
(hrp : ∀ (a b : α), r a b → p a b)
(h : EqvGen r a b)


theorem conjugateEquiv_comp (α : L₂ ⟶ L₁) (β : L₃ ⟶ L₂) :
    conjugateEquiv adj₁ adj₂ α ≫ conjugateEquiv adj₂ adj₃ β =
      conjugateEquiv adj₁ adj₃ (β ≫ α)

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{L₁ L₂ L₃ : CategoryTheory.Functor C D}
{R₁ R₂ R₃ : CategoryTheory.Functor D C}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(adj₃ : L₃ ⊣ R₃)
(α : L₂ ⟶ L₁)
(β : L₃ ⟶ L₂)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.conjugateEquiv adj₁ adj₂) α)
    ((CategoryTheory.conjugateEquiv adj₂ adj₃) β) =
  (CategoryTheory.conjugateEquiv adj₁ adj₃) (CategoryTheory.CategoryStruct.comp β α)


@[simp] lemma map_loopyOn (f : α → β) (hf) : (loopyOn E).map f hf = loopyOn (f '' E)

(hf : Set.InjOn f (Matroid.loopyOn E).E)

(Matroid.loopyOn E).map f hf = Matroid.loopyOn (f '' E)


theorem mem_of_mem_permsOfList :
    -- Porting note: was `∀ {x}` but need to capture the `x`
    ∀ {l : List α} {f : Perm α}, f ∈ permsOfList l → (x : α ) → f x ≠ x → x ∈ l

{α : Type u_1}
[DecidableEq α]
{l : List α}
{f : Equiv.Perm α}

f ∈ permsOfList l → ∀ (x : α), f x ≠ x → x ∈ l


@[simp] lemma counit_algebraMap (r : R) : counit (R := R) (algebraMap R A r) = r

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

Coalgebra.counit ((algebraMap R A) r) = r


theorem top_add (x : PartENat) : ⊤ + x = ⊤


theorem lt_ediv_add_one_mul_self (a : Int) {b : Int} (H : 0 < b) : a < (a / b + 1) * b


theorem integral_def {_ : MeasurableSpace α} (μ : Measure α) (f : α →ₛ F) :
    f.integral μ = f.setToSimpleFunc (weightedSMul μ)

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α) (f : MeasureTheory.SimpleFunc α F),
  MeasureTheory.SimpleFunc.integral μ f = MeasureTheory.SimpleFunc.setToSimpleFunc (MeasureTheory.weightedSMul μ) f


theorem derivBFamily_eq_derivFamily {o : Ordinal} (f : ∀ b < o, Ordinal → Ordinal) :
    derivBFamily.{u, v} o f = derivFamily.{u, v} (familyOfBFamily o f)

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

o.derivBFamily f = Ordinal.derivFamily (o.familyOfBFamily f)


theorem StarConvex.union (hs : StarConvex 𝕜 x s) (ht : StarConvex 𝕜 x t) :
    StarConvex 𝕜 x (s ∪ t)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{x : E}
{s t : Set E}
(hs : StarConvex 𝕜 x s)
(ht : StarConvex 𝕜 x t)


theorem mul_lt_sin {x : ℝ} (hx : 0 < x) (hx' : x < π / 2) : 2 / π * x < sin x


theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (√(1 + x ^ 2))⁻¹

Real.arctan x = Real.arccos (√(1 + x ^ 2))⁻¹


/-- `lpTrimToLpMeasSubgroup` is a right inverse of `lpMeasSubgroupToLpTrim`. -/
theorem lpMeasSubgroupToLpTrim_right_inv (hm : m ≤ m0) :
    Function.RightInverse (lpTrimToLpMeasSubgroup F p μ hm) (lpMeasSubgroupToLpTrim F p μ hm)

{α : Type u_1}
{F : Type u_3}
{p : ℝ≥0∞}
[NormedAddCommGroup F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)

Function.RightInverse (MeasureTheory.lpTrimToLpMeasSubgroup F p μ hm) (MeasureTheory.lpMeasSubgroupToLpTrim F p μ hm)


@[simp]
theorem coeff_C_mul (n : σ →₀ ℕ) (φ : MvPowerSeries σ R) (a : R) :
    coeff R n (C σ R a * φ) = a * coeff R n φ

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

(MvPowerSeries.coeff R n) ((MvPowerSeries.C σ R) a * φ) = a * (MvPowerSeries.coeff R n) φ


theorem Invariant.def (hκ : Invariant κ μ) : μ.bind κ = μ

{α : Type u_1}
{mα : MeasurableSpace α}
{κ : ProbabilityTheory.Kernel α α}
{μ : MeasureTheory.Measure α}
(hκ : κ.Invariant μ)


theorem map_pullback [HasPullbacks C] {X Y Z W : C} {f : X ⟶ Y} {g : X ⟶ Z} {h : Y ⟶ W} {k : Z ⟶ W}
    [Mono h] [Mono g] (comm : f ≫ h = g ≫ k) (t : IsLimit (PullbackCone.mk f g comm))
    (p : Subobject Y) : (map g).obj ((pullback f).obj p) = (pullback k).obj ((map h).obj p)

(comm : CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g k)

(t : CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.PullbackCone.mk f g comm))

(CategoryTheory.Subobject.map g).obj ((CategoryTheory.Subobject.pullback f).obj p) =
  (CategoryTheory.Subobject.pullback k).obj ((CategoryTheory.Subobject.map h).obj p)


theorem StrictMono.codRestrict [Preorder α] [Preorder β] {f : α → β} (hf : StrictMono f)
    {s : Set β} (hs : ∀ x, f x ∈ s) : StrictMono (Set.codRestrict f s hs)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : StrictMono f)
{s : Set β}
(hs : ∀ (x : α), f x ∈ s)


theorem reprW_app_hom (X : Cᵒᵖ) (f : unop X ⟶ F.reprX) :
    (F.reprW.app X).hom f = F.map f.op F.reprx

(F : CategoryTheory.Functor Cᵒᵖ (Type v₁))


theorem toSquareBlock_def (M : Matrix m m α) (b : m → β) (k : β) :
    -- Porting note: added missing `of`
    toSquareBlock M b k = of (fun i j : { a // b a = k } => M ↑i ↑j)

{m : Type u_2}
{α : Type u_12}
{β : Type u_13}
(M : Matrix m m α)
(b : m → β)
(k : β)

M.toSquareBlock b k = Matrix.of fun i j => M ↑i ↑j


@[simp] theorem map_coe_atTop : map toReal atTop = atTop

Filter.map NNReal.toReal Filter.atTop = Filter.atTop


@[simp]
theorem diag_sum {ι} [AddCommMonoid α] (s : Finset ι) (f : ι → Matrix n n α) :
    diag (∑ i ∈ s, f i) = ∑ i ∈ s, diag (f i)

{n : Type u_3}
{α : Type v}
{ι : Type u_10}
[AddCommMonoid α]
(s : Finset ι)
(f : ι → Matrix n n α)

(∑ i ∈ s, f i).diag = ∑ i ∈ s, (f i).diag


@[simp]
theorem toDFinsupp_neg [AddGroup M] (f : ι →₀ M) : (-f).toDFinsupp = -f.toDFinsupp

{ι : Type u_1}
{M : Type u_3}
[AddGroup M]
(f : ι →₀ M)


theorem rpow_inv_lt_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ^ z⁻¹ < y ↔ x < y ^ z


/-- The product over `Fin 2` of some rings is just the cartesian product of these rings. -/
@[simps]
def RingEquiv.piFinTwo (R : Fin 2 → Type*) [∀ i, Semiring (R i)] :
    (∀ i : Fin 2, R i) ≃+* R 0 × R 1

(R : Fin 2 → Type u_1)
[(i : Fin 2) → Semiring (R i)]
(a : (i : Fin 2) → R i)

(RingEquiv.piFinTwo R) a = (piFinTwoEquiv R) a


/-- Transfer an embedding along a pair of equivalences. -/
@[simps! (config := { fullyApplied := false, simpRhs := true })]
protected def congr {α : Sort u} {β : Sort v} {γ : Sort w} {δ : Sort x} (e₁ : α ≃ β) (e₂ : γ ≃ δ)
    (f : α ↪ γ) : β ↪ δ

⇑(Function.Embedding.congr e₁ e₂ f) = ⇑(f.trans e₂.toEmbedding) ∘ ⇑e₁.symm


lemma lowerClosure_subset_closure : ↑(lowerClosure s) ⊆ closure s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScott α]
{s : Set α}


@[simp, norm_cast]
theorem coe_zero : ((0 : s) : R) = (0 : R)

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)


lemma diffs_union_right : s \\ (t₁ ∪ t₂) = s \\ t₁ ∪ s \\ t₂

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

s.diffs (t₁ ∪ t₂) = s.diffs t₁ ∪ s.diffs t₂


@[simp]
theorem Fintype.card_fin (n : ℕ) : Fintype.card (Fin n) = n


@[simp]
theorem cancel_counitInv_right {X Y : D} (f f' : X ⟶ Y) :
    f ≫ e.counitInv.app Y = f' ≫ e.counitInv.app Y ↔ f = f'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
{X Y : D}
(f f' : X ⟶ Y)

CategoryTheory.CategoryStruct.comp f (e.counitInv.app Y) = CategoryTheory.CategoryStruct.comp f' (e.counitInv.app Y) ↔
  f = f'


protected theorem Adj.reachable {u v : V} (h : G.Adj u v) : G.Reachable u v

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(h : G.Adj u v)


lemma functor_additive_iff {E : Type*} [Category E] [Preadditive E] [Preadditive D] [L.Additive]
    (G : D ⥤ E) :
    G.Additive ↔ (L ⋙ G).Additive

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Preadditive C]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{E : Type u_3}
[CategoryTheory.Category.{u_4, u_3} E]
[CategoryTheory.Preadditive E]
[CategoryTheory.Preadditive D]
[L.Additive]
(G : CategoryTheory.Functor D E)


@[to_additive]
theorem mul_inv_of_eq {a : α} (h : ↑u = a) : a * ↑u⁻¹ = 1

{α : Type u}
[Monoid α]
{u : αˣ}
{a : α}
(h : ↑u = a)


theorem lintegral_strict_mono_of_ae_le_of_frequently_ae_lt {f g : α → ℝ≥0∞} (hg : AEMeasurable g μ)
    (hfi : ∫⁻ x, f x ∂μ ≠ ∞) (h_le : f ≤ᵐ[μ] g) (h : ∃ᵐ x ∂μ, f x ≠ g x) :
    ∫⁻ x, f x ∂μ < ∫⁻ x, g x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
(hg : AEMeasurable g μ)
(hfi : ∫⁻ (x : α), f x ∂μ ≠ ⊤)
(h_le : f ≤ᵐ[μ] g)
(h : ∃ᵐ (x : α) ∂μ, f x ≠ g x)


@[simp]
lemma Algebra.intNorm_zero : Algebra.intNorm A B 0 = 0

[Algebra.IsSeparable (FractionRing A) (FractionRing B)]


@[to_additive (attr := simp)]
theorem inv_empty : (∅ : Finset α)⁻¹ = ∅


theorem set_smul_sphere_zero {s : Set 𝕜} (hs : 0 ∉ s) (r : ℝ) :
    s • sphere (0 : E) r = (‖·‖) ⁻¹' ((‖·‖ * r) '' s)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set 𝕜}
(hs : 0 ∉ s)
(r : ℝ)

s • Metric.sphere 0 r = (fun x => ‖x‖) ⁻¹' ((fun x => ‖x‖ * r) '' s)


theorem top_div : ∞ / a = if a = ∞ then 0 else ∞


theorem Embedding.t5Space [TopologicalSpace Y] [T5Space Y] {e : X → Y} (he : Embedding e) :
    T5Space X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T5Space Y]
{e : X → Y}
(he : Embedding e)


theorem cot_conj : cot (conj x) = conj (cot x)

((starRingEnd ℂ) x).cot = (starRingEnd ℂ) x.cot


lemma LSeriesSummable_congr {f g : ℕ → ℂ} (s : ℂ) (h : ∀ {n}, n ≠ 0 → f n = g n) :
    LSeriesSummable f s ↔ LSeriesSummable g s

{f g : ℕ → ℂ}
(s : ℂ)
(h : ∀ {n : ℕ}, n ≠ 0 → f n = g n)


/-- The alternating coface map complex, as a functor -/
@[simps]
def alternatingCofaceMapComplex : CosimplicialObject C ⥤ CochainComplex C ℕ

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]

∀ {X Y : CategoryTheory.CosimplicialObject C} (f : X ⟶ Y),
  (AlgebraicTopology.alternatingCofaceMapComplex C).map f = AlgebraicTopology.AlternatingCofaceMapComplex.map f


/-- If `L` is a finite separable extension of `K = Frac(A)`, where `A` is
integrally closed and Noetherian, the integral closure of `A` in `L` is
Noetherian. -/
theorem integralClosure.isNoetherianRing [IsIntegrallyClosed A] [IsNoetherianRing A] :
    IsNoetherianRing (integralClosure A L)

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
(L : Type u_4)
[Field L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsNoetherianRing A]


@[simp]
theorem bot_smul : (⊥ : Ideal R) • N = ⊥

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(N : Submodule R M)


lemma _root_.IsSl2Triple.h_eq_coroot {α : Weight K H L} (hα : α.IsNonZero)
    {h e f : L} (ht : IsSl2Triple h e f) (heα : e ∈ rootSpace H α) (hfα : f ∈ rootSpace H (- α)) :
    h = coroot α

(hfα : f ∈ LieAlgebra.rootSpace H (-⇑α))


@[reassoc (attr := simp)] lemma f'_i : h.f' ≫ h.i = S.f

CategoryTheory.CategoryStruct.comp h.f' h.i = S.f


/-- The multiplicative equivalence between the type of units of `M` and the submonoid of unit
elements of `M`. -/
@[to_additive (attr := simps!) " The additive equivalence between the type of additive units of `M`
  and the additive submonoid whose elements are the additive units of `M`. "]
noncomputable def unitsTypeEquivIsUnitSubmonoid [Monoid M] : Mˣ ≃* IsUnit.submonoid M

{M : Type u_1}
[AddMonoid M]
(x : AddUnits M)

↑(AddSubmonoid.addUnitsTypeEquivIsAddUnitAddSubmonoid x) = ↑x


/-- The direction of the affine span of a finite set is
finite-dimensional. -/
theorem finiteDimensional_direction_affineSpan_of_finite {s : Set P} (h : Set.Finite s) :
    FiniteDimensional k (affineSpan k s).direction

(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 : s.Finite)

FiniteDimensional k ↥(affineSpan k s).direction


@[simp]
theorem tensorRightHomEquiv_symm_coevaluation_comp_whiskerRight {Y Y' Z : C} [ExactPairing Y Y']
    (f : Y ⟶ Z) : (tensorRightHomEquiv _ Y _ _).symm (η_ Y Y' ≫ f ▷ Y') = (λ_ _).hom ≫ f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{Y Y' Z : C}
[CategoryTheory.ExactPairing Y Y']
(f : Y ⟶ Z)

(CategoryTheory.tensorRightHomEquiv (𝟙_ C) Y Y' Z).symm (η_ Y Y' ≫ f ▷ Y') = (λ_ Y).hom ≫ f


@[simp]
theorem coe_ofMapMidpoint (f : E → F) (h0 : f 0 = 0)
    (hm : ∀ x y, f (midpoint R x y) = midpoint R' (f x) (f y)) :
    ⇑(ofMapMidpoint R R' f h0 hm) = f

(hm : ∀ (x y : E), f (midpoint R x y) = midpoint R' (f x) (f y))

⇑(AddMonoidHom.ofMapMidpoint R R' f h0 hm) = f


/-- The natural `ℝ`-linear isometry equivalence between `𝕜` satisfying `RCLike 𝕜` and `ℝ` when
`RCLike.I = 0`. -/
@[simps]
noncomputable def realLinearIsometryEquiv (h : I = (0 : K)) : K ≃ₗᵢ[ℝ] ℝ

{K : Type u_1}
[RCLike K]
(h : RCLike.I = 0)

∀ (a : ℝ), (RCLike.realLinearIsometryEquiv h).symm a = (RCLike.realRingEquiv h).invFun a


theorem Nonempty.mul_zero (hs : s.Nonempty) : s * 0 = 0

{α : Type u_2}
[MulZeroClass α]
{s : Set α}
(hs : s.Nonempty)


@[to_additive]
theorem mem_norm_comm_iff {s : Set G} (hs : IsNormalSubgroup s) {a b : G} : a * b ∈ s ↔ b * a ∈ s

{G : Type u_1}
[Group G]
{s : Set G}
(hs : IsNormalSubgroup s)
{a b : G}


/-- Constructor for `Set.Finite` using a `Finite` instance. -/
theorem toFinite (s : Set α) [Finite s] : s.Finite


@[simp]
theorem card_pair (h : a ≠ b) : ({a, b} : Finset α).card = 2

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


theorem mem_Lp_iff_memℒp {f : α →ₘ[μ] E} : f ∈ Lp E p μ ↔ Memℒp f p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α →ₘ[μ] E}

f ∈ MeasureTheory.Lp E p μ ↔ MeasureTheory.Memℒp (↑f) p μ


/-- Local instance for `OrientedOrd (oα.lex' oβ)`. -/
theorem OrientedOrd.instOrdLex' (ord₁ ord₂ : Ord α) [@OrientedOrd _ ord₁] [@OrientedOrd _ ord₂] :
    @OrientedOrd _ (ord₁.lex' ord₂)

{α : Type u_1}
(ord₁ ord₂ : Ord α)
[Batteries.OrientedOrd α]
[Batteries.OrientedOrd α]


lemma range_enumerateCountable_of_mem {s : Set α} (h : s.Countable) {default : α}
    (h_mem : default ∈ s) :
    range (enumerateCountable h default) = s

{α : Type u}
{s : Set α}
(h : s.Countable)
{default : α}
(h_mem : default ∈ s)

Set.range (Set.enumerateCountable h default) = s


@[simp]
theorem midpoint_pointReflection_left (x y : P) :
    midpoint R (Equiv.pointReflection x y) y = x

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x y : P)

midpoint R ((Equiv.pointReflection x) y) y = x


@[simp]
theorem colimit_carrier (F : J ⥤ PresheafedSpace.{_, _, v} C) :
    (colimit F).carrier = Limits.colimit (F ⋙ PresheafedSpace.forget C)

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

↑(AlgebraicGeometry.PresheafedSpace.colimit F) =
  CategoryTheory.Limits.colimit (F ⋙ AlgebraicGeometry.PresheafedSpace.forget C)


@[to_additive]
protected theorem hasFiniteIntegral_on_iff (hs : IsFundamentalDomain G s μ)
    (ht : IsFundamentalDomain G t μ) {f : α → E} (hf : ∀ (g : G) (x), f (g • x) = f x) :
    HasFiniteIntegral f (μ.restrict s) ↔ HasFiniteIntegral f (μ.restrict t)

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.IsAddFundamentalDomain G s μ)

(ht : MeasureTheory.IsAddFundamentalDomain G t μ)

MeasureTheory.HasFiniteIntegral f (μ.restrict s) ↔ MeasureTheory.HasFiniteIntegral f (μ.restrict t)


@[to_additive]
lemma IsMulFreimanHom.prod (h₁ : IsMulFreimanHom n A₁ B₁ f₁) (h₂ : IsMulFreimanHom n A₂ B₂ f₂) :
    IsMulFreimanHom n (A₁ ×ˢ A₂) (B₁ ×ˢ B₂) (Prod.map f₁ f₂)

{α₁ : Type u_5}
{α₂ : Type u_6}
{β₁ : Type u_7}
{β₂ : Type u_8}
[AddCommMonoid α₁]
[AddCommMonoid α₂]
[AddCommMonoid β₁]
[AddCommMonoid β₂]
{A₁ : Set α₁}
{A₂ : Set α₂}
{B₁ : Set β₁}
{B₂ : Set β₂}
{f₁ : α₁ → β₁}
{f₂ : α₂ → β₂}
{n : ℕ}
(h₁ : IsAddFreimanHom n A₁ B₁ f₁)
(h₂ : IsAddFreimanHom n A₂ B₂ f₂)

IsAddFreimanHom n (A₁ ×ˢ A₂) (B₁ ×ˢ B₂) (Prod.map f₁ f₂)


lemma isProbabilityMeasure_tilted [NeZero μ] (hf : Integrable (fun x ↦ exp (f x)) μ) :
    IsProbabilityMeasure (μ.tilted f)

(hf : MeasureTheory.Integrable (fun x => rexp (f x)) μ)


/-- Given a valuation v : R → Γ₀ and a ring homomorphism O →+* R, we say that O is the integers of v
if f is injective, and its range is exactly `v.integer`. -/
structure Integers : Prop where
  hom_inj : Function.Injective (algebraMap O R)
  map_le_one : ∀ x, v (algebraMap O R x) ≤ 1
  exists_of_le_one : ∀ ⦃r⦄, v r ≤ 1 → ∃ x, algebraMap O R x = r

{R : Type u}
{Γ₀ : Type v}
[CommRing R]
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation R Γ₀}
{O : Type w}
[CommRing O]
[Algebra O R]
(self : v.Integers O)
(x : O)


theorem RegularSpace.of_hasBasis {ι : X → Sort*} {p : ∀ a, ι a → Prop} {s : ∀ a, ι a → Set X}
    (h₁ : ∀ a, (𝓝 a).HasBasis (p a) (s a)) (h₂ : ∀ a i, p a i → IsClosed (s a i)) :
    RegularSpace X

(h₁ : ∀ (a : X), (𝓝 a).HasBasis (p a) (s a))

(h₂ : ∀ (a : X) (i : ι a), p a i → IsClosed (s a i))


theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(I : FractionalIdeal S P)


lemma map_image_indep_iff {hf} {I : Set α} (hI : I ⊆ M.E) :
    (M.map f hf).Indep (f '' I) ↔ M.Indep I

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{M : Matroid α}
{hf : Set.InjOn f M.E}
{I : Set α}
(hI : I ⊆ M.E)


theorem fix {f : α →. σ ⊕ α} (hf : Partrec f) : Partrec (PFun.fix f)

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{f : α →. σ ⊕ α}
(hf : Partrec f)


/-- The multiplicity of `a` as root of `(X - a) ^ n` is `n`. -/
theorem rootMultiplicity_X_sub_C_pow [Nontrivial R] (a : R) (n : ℕ) :
    rootMultiplicity a ((X - C a) ^ n) = n

{R : Type u}
[CommRing R]
[Nontrivial R]
(a : R)
(n : ℕ)

Polynomial.rootMultiplicity a ((Polynomial.X - Polynomial.C a) ^ n) = n


@[simp]
theorem convolution_zero : f ⋆[L, μ] 0 = 0

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
{L : E →L[𝕜] E' →L[𝕜] F}
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[AddGroup G]


nonrec theorem cos_sub_cos : cos x - cos y = -2 * sin ((x + y) / 2) * sin ((x - y) / 2)

Real.cos x - Real.cos y = -2 * Real.sin ((x + y) / 2) * Real.sin ((x - y) / 2)


@[simp]
theorem cospanExt_hom_app_left :
    (cospanExt iX iY iZ wf wg).hom.app WalkingCospan.left = iX.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Z}
{g : Y ⟶ Z}
{f' : X' ⟶ Z'}
{g' : Y' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iZ.hom)
(wg : iY.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.cospanExt iX iY iZ wf wg).hom.app CategoryTheory.Limits.WalkingCospan.left = iX.hom


@[simp high, norm_cast]
theorem of_to_int (n : ZNum) : ((n : ℤ) : ZNum) = n


@[simp]
theorem comap_symm (e : P₁ ≃ᵃ[k] P₂) (s : AffineSubspace k P₁) :
    s.comap (e.symm : P₂ →ᵃ[k] P₁) = s.map e

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(e : P₁ ≃ᵃ[k] P₂)
(s : AffineSubspace k P₁)

AffineSubspace.comap (↑e.symm) s = AffineSubspace.map (↑e) s


@[to_additive (attr := simp)] theorem snd_apply_inr (x : N) : snd (inr x : M ∗ N) = x

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

Monoid.Coprod.snd (Monoid.Coprod.inr x) = x


theorem sum_moebius_mul_log_eq {n : ℕ} : (∑ d ∈ n.divisors, (μ d : ℝ) * log d) = -Λ n

∑ d ∈ n.divisors, ↑(ArithmeticFunction.moebius d) * ArithmeticFunction.log d = -ArithmeticFunction.vonMangoldt n


@[to_additive]
theorem tprod_eq_prod' {s : Finset β} (hf : mulSupport f ⊆ s) :
    ∏' b, f b = ∏ b ∈ s, f b

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{s : Finset β}
(hf : Function.support f ⊆ ↑s)


@[to_additive]
theorem nontrivial_iff_exists_ne_one (S : Submonoid M) : Nontrivial S ↔ ∃ x ∈ S, x ≠ (1 : M)

{M : Type u_1}
[AddZeroClass M]
(S : AddSubmonoid M)


theorem ExprCnstr.denote_toPoly (ctx : Context) (c : ExprCnstr) : c.toPoly.denote ctx = c.denote ctx

(ctx : Nat.Linear.Context)
(c : Nat.Linear.ExprCnstr)

Nat.Linear.PolyCnstr.denote ctx c.toPoly = Nat.Linear.ExprCnstr.denote ctx c


private lemma continuousAt_mul_swap {a b : EReal}
    (h : ContinuousAt (fun p : EReal × EReal ↦ p.1 * p.2) (a, b)) :
    ContinuousAt (fun p : EReal × EReal ↦ p.1 * p.2) (b, a)

(h : ContinuousAt (fun p => p.1 * p.2) (a, b))

ContinuousAt (fun p => p.1 * p.2) (b, a)


theorem hasLimitsOfShape_of_hasColimitsOfShape_op [HasColimitsOfShape Jᵒᵖ Cᵒᵖ] :
    HasLimitsOfShape J C


/-- If `g : ℝ → ℝ` is periodic with period `T > 0` and `∀ x, 0 < g x`, then `t ↦ ∫ x in 0..t, g x`
tends to `-∞` as `t` tends to `-∞`. -/
theorem tendsto_atBot_intervalIntegral_of_pos' (h₀ : ∀ x, 0 < g x) (hT : 0 < T) :
    Tendsto (fun t => ∫ x in (0)..t, g x) atBot atBot

(h_int : ∀ (t₁ t₂ : ℝ), IntervalIntegrable g MeasureTheory.volume t₁ t₂)

Filter.Tendsto (fun t => ∫ (x : ℝ) in 0 ..t, g x) Filter.atBot Filter.atBot


@[simp]
theorem snd_himp [HImp α] [HImp β] (a b : α × β) : (a ⇨ b).2 = a.2 ⇨ b.2

{α : Type u_2}
{β : Type u_3}
[HImp α]
[HImp β]
(a b : α × β)


/-- The equivalence between `Lat` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : Lat ≌ Lat


theorem iInf_lcs_le_of_isNilpotent_quot (h : IsNilpotent R L (M ⧸ N)) :
    ⨅ k, lowerCentralSeries R L M k ≤ 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)
(h : LieModule.IsNilpotent R L (M ⧸ N))

⨅ k, LieModule.lowerCentralSeries R L M k ≤ N


theorem sub_ediv_of_dvd (a : Int) {b c : Int}
    (hcb : c ∣ b) : (a - b) / c = a / c - b / c


@[simp]
theorem eq_bot_iff (I : HomogeneousIdeal 𝒜) : I = ⊥ ↔ I.toIdeal = ⊥

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
(I : HomogeneousIdeal 𝒜)


/-- If `T` is a flat `S`-algebra and `S` is a flat `R`-algebra,
then `T` is a flat `R`-algebra. -/
theorem comp (T : Type w) [CommRing T] [Algebra R S] [Algebra R T] [Algebra S T]
    [IsScalarTower R S T] [Algebra.Flat R S] [Algebra.Flat S T] : Algebra.Flat R T

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
(T : Type w)
[CommRing T]
[Algebra R S]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[Algebra.Flat R S]
[Algebra.Flat S T]


theorem comp_left_triangle_aux (adj₁ : f₁ ⊣ g₁) (adj₂ : f₂ ⊣ g₂) :
    leftZigzag (compUnit adj₁ adj₂) (compCounit adj₁ adj₂) = (λ_ _).hom ≫ (ρ_ _).inv

(adj₁ : CategoryTheory.Bicategory.Adjunction f₁ g₁)

(adj₂ : CategoryTheory.Bicategory.Adjunction f₂ g₂)

CategoryTheory.Bicategory.leftZigzag (adj₁.compUnit adj₂) (adj₁.compCounit adj₂) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.leftUnitor (CategoryTheory.CategoryStruct.comp f₁ f₂)).hom
    (CategoryTheory.Bicategory.rightUnitor (CategoryTheory.CategoryStruct.comp f₁ f₂)).inv


@[simp]
theorem of_isoOfHomeo {X Y : TopCat.{u}} (f : X ≃ₜ Y) : homeoOfIso (isoOfHomeo f) = f

TopCat.homeoOfIso (TopCat.isoOfHomeo f) = f


theorem exists_measure_closedBall_le_mul' :
    ∀ᶠ ε in 𝓝[>] 0, ∀ x, μ (closedBall x (2 * ε)) ≤ doublingConstant μ * μ (closedBall x ε)

{α : Type u_1}
[MetricSpace α]
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
[IsUnifLocDoublingMeasure μ]

∀ᶠ (ε : ℝ) in 𝓝[>] 0,
  ∀ (x : α),
    μ (Metric.closedBall x (2 * ε)) ≤ ↑(IsUnifLocDoublingMeasure.doublingConstant μ) * μ (Metric.closedBall x ε)


/-- Another version of `sum_range_pow`. -/
theorem sum_range_pow_eq_bernoulli_sub (n p : ℕ) :
    ((p + 1 : ℚ) * ∑ k ∈ range n, (k : ℚ) ^ p) = (bernoulli p.succ).eval (n : ℚ) -
    _root_.bernoulli p.succ

(↑p + 1) * ∑ k ∈ Finset.range n, ↑k ^ p = Polynomial.eval (↑n) (Polynomial.bernoulli p.succ) - bernoulli p.succ


/-- `OrthonormalBasis.adjustToOrientation`, applied to an orthonormal basis, preserves the
property of orthonormality. -/
theorem orthonormal_adjustToOrientation : Orthonormal ℝ (e.toBasis.adjustToOrientation x)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
[ne : Nonempty ι]
(e : OrthonormalBasis ι ℝ E)
(x : Orientation ℝ E ι)

Orthonormal ℝ ⇑(e.toBasis.adjustToOrientation x)


/-- Given a sheaf `S`, construct an isomorphism `S ≅ [-, S(*)]`. -/
@[simps!]
noncomputable def equivYoneda (S : Type uᵒᵖ ⥤ Type u) (hs : IsSheaf typesGrothendieckTopology S) :
    S ≅ yoneda.obj (S.obj (op PUnit))

(S : CategoryTheory.Functor Type uᵒᵖ (Type u))

(hs : CategoryTheory.Presieve.IsSheaf CategoryTheory.typesGrothendieckTopology S)

∀ (a : (CategoryTheory.yoneda.obj (S.obj (Opposite.op PUnit.{u + 1}))).obj X),
  (CategoryTheory.equivYoneda S hs).inv.app X a = (CategoryTheory.evalEquiv S hs (Opposite.unop X)).symm a


@[simp]
lemma map₂_inv {f g : a ⟶ b} (η : f ⟶ g) [IsIso η] : F.map₂ (inv η) = inv (F.map₂ η)

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.PrelaxFunctor B C)
{a b : B}
{f g : a ⟶ b}
(η : f ⟶ g)
[CategoryTheory.IsIso η]

F.map₂ (CategoryTheory.inv η) = CategoryTheory.inv (F.map₂ η)


@[simp]
lemma rightHomologyMap'_nullHomotopic
    (H₁ : S₁.RightHomologyData) (H₂ : S₂.RightHomologyData)
    (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) :
    rightHomologyMap' (nullHomotopic _ _ h₀ h₀_f h₁ h₂ h₃ g_h₃) H₁ H₂ = 0

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

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

CategoryTheory.ShortComplex.rightHomologyMap' (S₁.nullHomotopic S₂ h₀ h₀_f h₁ h₂ h₃ g_h₃) H₁ H₂ = 0


theorem swap [IsSymm α r] (hs : IsStrongAntichain r s) : IsStrongAntichain (swap r) s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsSymm α r]
(hs : IsStrongAntichain r s)


theorem Coloring.mem_colorClasses {v : V} : C.colorClass (C v) ∈ C.colorClasses

{V : Type u}
{G : SimpleGraph V}
{α : Type u_1}
(C : G.Coloring α)
{v : V}


/-- If `f` tends to infinity along a filter, then `f` multiplied by a positive
constant (on the left) also tends to infinity. For a version working in `ℕ` or `ℤ`, use
`Filter.Tendsto.const_mul_atTop'` instead. -/
theorem Tendsto.const_mul_atTop (hr : 0 < r) (hf : Tendsto f l atTop) :
    Tendsto (fun x => r * f x) l atTop

{α : Type u_3}
{β : Type u_4}
[LinearOrderedSemifield α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => r * f x) l Filter.atTop


@[simp]
theorem mem_add {a : α} {s t : Multiset α} : a ∈ s + t ↔ a ∈ s ∨ a ∈ t

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


theorem Set.Subsingleton.isStrongAntichain (hs : s.Subsingleton) (r : α → α → Prop) :
    IsStrongAntichain r s

{α : Type u_1}
{s : Set α}
(hs : s.Subsingleton)
(r : α → α → Prop)


/-- Unramified is stable under composition. -/
theorem comp [Algebra A B] [IsScalarTower R A B] [Unramified R A] [Unramified A B] :
    Unramified R B

(R : Type u)
[CommRing R]
(A B : Type u)
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
[Algebra.Unramified R A]
[Algebra.Unramified A B]


@[simp]
theorem mem_selfAdjointSubmodule (f : Module.End R M) :
    f ∈ B.selfAdjointSubmodule ↔ B.IsSelfAdjoint f

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(B : LinearMap.BilinForm R M)
(f : Module.End R M)


@[simp]
theorem intersection_covering_iff : R ⊓ S ∈ J X ↔ R ∈ J X ∧ S ∈ J X

(J : CategoryTheory.GrothendieckTopology C)

R ⊓ S ∈ J.sieves X ↔ R ∈ J.sieves X ∧ S ∈ J.sieves X


@[simp] theorem ofNat_mul_negSucc (m n : Nat) : (m : Int) * -[n+1] = -↑(m * succ n)


protected theorem Chain.sublist [IsTrans α R] (hl : l₂.Chain R a) (h : l₁ <+ l₂) :
    l₁.Chain R a

{α : Type u}
{R : α → α → Prop}
{l₁ l₂ : List α}
{a : α}
[IsTrans α R]
(hl : List.Chain R a l₂)
(h : l₁.Sublist l₂)


@[simp] lemma one_le_sq_iff_one_le_abs (a : α) : 1 ≤ a ^ 2 ↔ 1 ≤ |a|

{α : Type u_1}
[LinearOrderedRing α]
(a : α)


@[simp, norm_cast]
theorem coe_zero : ((0 : s) : K) = 0

{K : Type u}
[DivisionRing K]
(s : Subfield K)


/-- If `f₀ ≤ f₁ ≤ f₂ ≤ ⋯` is a sorted `m`-tuple of elements of `α`, then for any `j : Fin m` and
`a : α` we have `j < #{i | fᵢ ≤ a}` iff `fⱼ ≤ a`. -/
theorem lt_card_le_iff_apply_le_of_monotone [PartialOrder α] [DecidableRel (α := α) LE.le]
    {m : ℕ} (f : Fin m → α) (a : α) (h_sorted : Monotone f) (j : Fin m) :
    j < Fintype.card {i // f i ≤ a} ↔ f j ≤ a

{α : Type u_1}
[PartialOrder α]
[DecidableRel LE.le]
{m : ℕ}
(f : Fin m → α)
(a : α)
(h_sorted : Monotone f)
(j : Fin m)

↑j < Fintype.card { i // f i ≤ a } ↔ f j ≤ a


/-- If `i` is an `F`-algebra isomorphism of `E` and `K`, then the image of `separableClosure F E`
under the map `i` is equal to `separableClosure F K`. -/
theorem separableClosure.map_eq_of_algEquiv (i : E ≃ₐ[F] K) :
    (separableClosure F E).map i = separableClosure F K

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
{K : Type w}
[Field K]
[Algebra F K]
(i : E ≃ₐ[F] K)

IntermediateField.map (↑i) (separableClosure F E) = separableClosure F K


/-- Multiplicative congruence relations preserve finite product. -/
@[to_additive "Additive congruence relations preserve finite sum."]
protected theorem finset_prod {ι M : Type*} [CommMonoid M] (c : Con M) (s : Finset ι)
    {f g : ι → M} (h : ∀ i ∈ s, c (f i) (g i)) :
    c (s.prod f) (s.prod g)

{ι : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
(c : AddCon M)
(s : Finset ι)
{f g : ι → M}
(h : ∀ i ∈ s, c (f i) (g i))


theorem iterate_pos_lt_iff_map_lt' (h : Commute f g) (hf : StrictMono f) (hg : Monotone g) {x n}
    (hn : 0 < n) : f^[n] x < g^[n] x ↔ f x < g x

{α : Type u_1}
[LinearOrder α]
{f g : α → α}
(h : Function.Commute f g)
(hf : StrictMono f)
(hg : Monotone g)
{x : α}
{n : ℕ}
(hn : 0 < n)


/-- Canonical prefunctor from `B` to `free_bicategory B`. -/
@[simps]
def of : Prefunctor B (FreeBicategory B)

CategoryTheory.FreeBicategory.of.obj a = id a


theorem induction_on {motive : PushoutI φ → Prop}
    (x : PushoutI φ)
    (of : ∀ (i : ι) (g : G i), motive (of i g))
    (base : ∀ h, motive (base φ h))
    (mul : ∀ x y, motive x → motive y → motive (x * y)) : motive x

(of : ∀ (i : ι) (g : G i), motive ((Monoid.PushoutI.of i) g))

(base : ∀ (h : H), motive ((Monoid.PushoutI.base φ) h))

(mul : ∀ (x y : Monoid.PushoutI φ), motive x → motive y → motive (x * y))


theorem le_of_forall_le_of_dense [LinearOrder α] [DenselyOrdered α] {a₁ a₂ : α}
    (h : ∀ a, a₂ < a → a₁ ≤ a) : a₁ ≤ a₂

{α : Type u_2}
[LinearOrder α]
[DenselyOrdered α]
{a₁ a₂ : α}
(h : ∀ (a : α), a₂ < a → a₁ ≤ a)


theorem join_concat (L : List (List α)) (l : List α) : join (L.concat l) = join L ++ l

{α : Type u_1}
(L : List (List α))
(l : List α)


theorem closedBall_sub_ball (hε : 0 ≤ ε) (hδ : 0 < δ) (a b : E) :
    closedBall a ε - ball b δ = ball (a - b) (ε + δ)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
(hε : 0 ≤ ε)
(hδ : 0 < δ)
(a b : E)

Metric.closedBall a ε - Metric.ball b δ = Metric.ball (a - b) (ε + δ)


/-- An auxiliary lemma that can be used to prove that coercion `Mˣ → M` is a topological embedding.
Use `Units.embedding_val₀`, `Units.embedding_val`, or `toUnits_homeomorph` instead. -/
@[to_additive "An auxiliary lemma that can be used to prove that coercion `AddUnits M → M` is a
topological embedding. Use `AddUnits.embedding_val` or `toAddUnits_homeomorph` instead."]
lemma embedding_val_mk' {M : Type*} [Monoid M] [TopologicalSpace M] {f : M → M}
    (hc : ContinuousOn f {x : M | IsUnit x}) (hf : ∀ u : Mˣ, f u.1 = ↑u⁻¹) :
    Embedding (val : Mˣ → M)

{M : Type u_3}
[AddMonoid M]
[TopologicalSpace M]
{f : M → M}
(hc : ContinuousOn f {x | IsAddUnit x})
(hf : ∀ (u : AddUnits M), f ↑u = ↑(-u))


theorem bound_of_antilipschitz (f : E →SL[σ] F) {K : ℝ≥0} (h : AntilipschitzWith K f) (x) :
    ‖x‖ ≤ K * ‖f x‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Ring 𝕜]
[Ring 𝕜₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜₂ F]
{σ : 𝕜 →+* 𝕜₂}
(f : E →SL[σ] F)
{K : ℝ≥0}
(h : AntilipschitzWith K ⇑f)
(x : E)

‖x‖ ≤ ↑K * ‖f x‖


/-- **Abel's limit theorem**. Given a power series converging at 1, the corresponding function
is continuous at 1 when approaching 1 within a fixed Stolz set. -/
theorem tendsto_tsum_powerSeries_nhdsWithin_stolzSet
    (h : Tendsto (fun n ↦ ∑ i ∈ range n, f i) atTop (𝓝 l)) {M : ℝ} :
    Tendsto (fun z ↦ ∑' n, f n * z ^ n) (𝓝[stolzSet M] 1) (𝓝 l)

(h : Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 l))

Filter.Tendsto (fun z => ∑' (n : ℕ), f n * z ^ n) (𝓝[Complex.stolzSet M] 1) (𝓝 l)


theorem totient_even {n : ℕ} (hn : 2 < n) : Even n.totient


theorem right_le_iff (h : IsCompl x y) : y ≤ z ↔ Codisjoint z x

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(h : IsCompl x y)


@[simp]
theorem smeval_neg : (-p).smeval x = - p.smeval x

(R : Type u_1)
[Ring R]
{S : Type u_2}
[AddCommGroup S]
[Pow S ℕ]
[Module R S]
(p : Polynomial R)
(x : S)


/-- If `E` is a vector space over a division ring `R` and has a monoid action by `α`, then that
action commutes by scalar multiplication of inverses of integers in `R` -/
theorem inv_intCast_smul_comm {α E : Type*} (R : Type*) [AddCommGroup E] [DivisionRing R]
    [Monoid α] [Module R E] [DistribMulAction α E] (n : ℤ) (s : α) (x : E) :
    (n⁻¹ : R) • s • x = s • (n⁻¹ : R) • x

{α : Type u_5}
{E : Type u_6}
(R : Type u_7)
[AddCommGroup E]
[DivisionRing R]
[Monoid α]
[Module R E]
[DistribMulAction α E]
(n : ℤ)
(s : α)
(x : E)


@[to_additive (attr := simp)]
theorem swap_inj {x y : M ∗ N} : swap M N x = swap M N y ↔ x = y

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{x y : AddMonoid.Coprod M N}

(AddMonoid.Coprod.swap M N) x = (AddMonoid.Coprod.swap M N) y ↔ x = y


theorem preimage_inter (s t : Set β) : f.preimage (s ∩ t) ⊆ f.preimage s ∩ f.preimage t

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


@[norm_cast]
theorem coe_codRestrict (f : M₁ →SL[σ₁₂] M₂) (p : Submodule R₂ M₂) (h : ∀ x, f x ∈ p) :
    (f.codRestrict p h : M₁ →ₛₗ[σ₁₂] p) = (f : M₁ →ₛₗ[σ₁₂] M₂).codRestrict p h

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(f : M₁ →SL[σ₁₂] M₂)
(p : Submodule R₂ M₂)
(h : ∀ (x : M₁), f x ∈ p)

↑(f.codRestrict p h) = LinearMap.codRestrict p (↑f) h


theorem toNNReal_pos_iff : 0 < a.toNNReal ↔ 0 < a ∧ a < ∞


theorem coe_injective : Function.Injective ((fun B x y => B x y) : BilinForm R M → M → M → R)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]


theorem pairwise_disjoint_on_bool [SemilatticeInf α] [OrderBot α] {a b : α} :
    Pairwise (Disjoint on fun c => cond c a b) ↔ Disjoint a b

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{a b : α}

Pairwise (Disjoint on fun c => bif c then a else b) ↔ Disjoint a b


/-- `IsAsymm X r` means that the binary relation `r` on `X` is asymmetric, that is,
`r a b → ¬ r b a`. -/
class IsAsymm (α : Sort u) (r : α → α → Prop) : Prop where
  asymm : ∀ a b, r a b → ¬r b a

{α : Sort u}
{r : α → α → Prop}
[self : IsAsymm α r]
(a b : α)


/-- The smallest ideal containing a given element. -/
@[simps]
def principal (p : P) : Ideal P

(Order.Ideal.principal p).toLowerSet = LowerSet.Iic p


theorem le_iff_atom_le_imp {a b : α} : a ≤ b ↔ ∀ c : α, IsAtom c → c ≤ a → c ≤ b

{α : Type u_2}
[CompleteLattice α]
[IsAtomistic α]
{a b : α}

a ≤ b ↔ ∀ (c : α), IsAtom c → c ≤ a → c ≤ b


@[to_additive]
lemma prodAux_eq : ∀ l : List M, FreeMonoid.prodAux l = l.prod

{M : Type u_4}
[AddMonoid M]
(l : List M)


lemma count_ne_zero {a : α} : count a s ≠ 0 ↔ a ∈ s

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


protected theorem traverse_eq_map_id (f : α → β) (x : t' α) :
    Equiv.traverse eqv ((pure : β → Id β) ∘ f) x = pure (Equiv.map eqv f x)

{t t' : Type u → Type u}
(eqv : (α : Type u) → t α ≃ t' α)
[Traversable t]
[LawfulTraversable t]
{α β : Type u}
(f : α → β)
(x : t' α)

Equiv.traverse eqv (pure ∘ f) x = pure (Equiv.map eqv f x)


theorem End_algebraMap_isUnit_inv_apply_eq_iff {x : R}
    (h : IsUnit (algebraMap R (Module.End S M) x)) (m m' : M) :
    (↑(h.unit⁻¹) : Module.End S M) m = m' ↔ m = x • m'

(h : IsUnit ((algebraMap R (Module.End S M)) x))


/-- Given `(S : Solution)`, we have that `λ ^ 2` does not divide `S.a + η ^ 2 * S.b`. -/
lemma lambda_sq_not_dvd_a_add_eta_sq_mul_b : ¬ λ ^ 2 ∣ (S.a + η ^ 2 * S.b)

(S : FermatLastTheoremForThreeGen.Solution hζ)

¬(hζ.toInteger - 1) ^ 2 ∣ S.a + ↑⋯.unit ^ 2 * S.b


theorem l_injective [PartialOrder α] [Preorder β] (gi : GaloisCoinsertion l u) : Injective l

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[PartialOrder α]
[Preorder β]
(gi : GaloisCoinsertion l u)


private lemma min_ne_of_ne_of_lt (ha : a ≠ c) (hb : c < b) : min a b ≠ c

{R : Type u_2}
[LinearOrder R]
{a b c : R}
(ha : a ≠ c)
(hb : c < b)


theorem Integrable.mono {l'} (h : Integrable I l f vol) (hle : l' ≤ l) : Integrable I l' f vol

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
{l' : BoxIntegral.IntegrationParams}
(h : BoxIntegral.Integrable I l f vol)
(hle : l' ≤ l)


theorem content_eq_gcd_range_succ (p : R[X]) :
    p.content = (Finset.range p.natDegree.succ).gcd p.coeff

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
(p : Polynomial R)


/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g

{ι : Type u_1}
(f g : ι → Cardinal.{u_2})
(H : ∀ (i : ι), f i < g i)


@[simp]
theorem map_mk {f : S.obj Y ⟶ T} (g : T ⟶ T') : (map g).obj (mk f) = mk (f ≫ g)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{T T' : D}
{Y : C}
{S : CategoryTheory.Functor C D}
{f : S.obj Y ⟶ T}
(g : T ⟶ T')

(CategoryTheory.CostructuredArrow.map g).obj (CategoryTheory.CostructuredArrow.mk f) =
  CategoryTheory.CostructuredArrow.mk (CategoryTheory.CategoryStruct.comp f g)


@[simp]
protected theorem mk_get (x : Comp F G α) : Comp.mk (Comp.get x) = x

{n m : ℕ}
{F : TypeVec.{u} n → Type u_1}
{G : Fin2 n → TypeVec.{u} m → Type u}
{α : TypeVec.{u} m}
(x : MvQPF.Comp F G α)


theorem continuous_nnreal_sub {a : ℝ≥0} : Continuous fun x : ℝ≥0∞ => (a : ℝ≥0∞) - x


theorem ext_iff_degree_le {p q : R[X]} {n : ℕ} (hp : p.degree ≤ n) (hq : q.degree ≤ n) :
    p = q ↔ ∀ i ≤ n, p.coeff i = q.coeff i

{R : Type u}
[Semiring R]
{p q : R[X]}
{n : ℕ}
(hp : p.degree ≤ ↑n)
(hq : q.degree ≤ ↑n)


theorem to_unit_cont (f : Part α →o Part α) (hc : Continuous f) : Continuous (toUnitMono f)

(hc : OmegaCompletePartialOrder.Continuous f)


theorem ext_of_toZModPow {x y : ℤ_[p]} : (∀ n, toZModPow n x = toZModPow n y) ↔ x = y

{p : ℕ}
[hp_prime : Fact (Nat.Prime p)]
{x y : ℤ_[p]}

(∀ (n : ℕ), (PadicInt.toZModPow n) x = (PadicInt.toZModPow n) y) ↔ x = y


theorem card_rootsOfUnity {ζ : R} {n : ℕ+} (h : IsPrimitiveRoot ζ n) :
    Fintype.card (rootsOfUnity n R) = n

{R : Type u_4}
[CommRing R]
[IsDomain R]
{ζ : R}
{n : ℕ+}
(h : IsPrimitiveRoot ζ ↑n)


@[reassoc]
theorem id_tensor_rightUnitor_inv (X Y : C) : 𝟙 X ⊗ (ρ_ Y).inv = (ρ_ _).inv ≫ (α_ _ _ _).hom

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.MonoidalCategory C]
(X Y : C)

CategoryTheory.MonoidalCategory.tensorHom (𝟙 X) (CategoryTheory.MonoidalCategory.rightUnitor Y).inv =
  (CategoryTheory.MonoidalCategory.rightUnitor (CategoryTheory.MonoidalCategory.tensorObj X Y)).inv ≫
    (CategoryTheory.MonoidalCategory.associator X Y (𝟙_ C)).hom


theorem source_subset_preimage_target : e.source ⊆ e ⁻¹' e.target

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


@[simp]
theorem coe_inclusion (m : N) : (inclusion h m : M) = m

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{N N' : LieSubmodule R L M}
(h : N ≤ N')
(m : ↥N)


theorem map_id {α : Type*} {n : ℕ} (s : Sym α n) : Sym.map id s = s


theorem isSuccLimit_bot [OrderBot α] : IsSuccLimit (⊥ : α)

{α : Type u_1}
[Preorder α]
[OrderBot α]


protected theorem differentiable_aeval : Differentiable 𝕜 fun x : 𝕜 => aeval x q

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])

Differentiable 𝕜 fun x => (Polynomial.aeval x) q


theorem take_take : ∀ (n m) (l : List α), take n (take m l) = take (min n m) l

List.take n (List.take m l) = List.take (min n m) l


protected theorem injective (h : X ≃ₜ Y) : Function.Injective h

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


/--
An algebra homomorphism `f : A →ₐ[R] B` such that `f x` commutes with `f y` for all `x, y` defines
an algebra homomorphism to `Bᵐᵒᵖ`. -/
@[simps (config := .asFn)]
def toOpposite (f : A →ₐ[R] B) (hf : ∀ x y, Commute (f x) (f y)) : A →ₐ[R] Bᵐᵒᵖ

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : ∀ (x y : A), Commute (f x) (f y))

⇑(f.toOpposite hf) = MulOpposite.op ∘ ⇑f


@[simp]
theorem rotate'_length (l : List α) : rotate' l l.length = l


theorem eq_of_mem_minimals (ha : a ∈ minimals r s) (hb : b ∈ s) (h : r b a) : a = b

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a b : α}
[IsAntisymm α r]
(ha : a ∈ minimals r s)
(hb : b ∈ s)
(h : r b a)


lemma withDensity_rnDerivAux (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    withDensity (κ + η) (fun a x ↦ Real.toNNReal (rnDerivAux κ (κ + η) a x)) = κ

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

((κ + η).withDensity fun a x => ↑(κ.rnDerivAux (κ + η) a x).toNNReal) = κ


/-- If a family of complete sets with diameter tending to `0` is such that each finite intersection
is nonempty, then the total intersection is also nonempty. -/
theorem _root_.IsComplete.nonempty_iInter_of_nonempty_biInter {s : ℕ → Set α}
    (h0 : IsComplete (s 0)) (hs : ∀ n, IsClosed (s n)) (h's : ∀ n, IsBounded (s n))
    (h : ∀ N, (⋂ n ≤ N, s n).Nonempty) (h' : Tendsto (fun n => diam (s n)) atTop (𝓝 0)) :
    (⋂ n, s n).Nonempty

(h's : ∀ (n : ℕ), Bornology.IsBounded (s n))

(h : ∀ (N : ℕ), (⋂ n, ⋂ (_ : n ≤ N), s n).Nonempty)

(h' : Filter.Tendsto (fun n => Metric.diam (s n)) Filter.atTop (𝓝 0))


@[simp] theorem filter_sublist {p : α → Bool} : ∀ (l : List α), filter p l <+ l

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


@[simp, nolint simpNF]
theorem card_typein {r : α → α → Prop} [IsWellOrder α r] (x : α) :
    #{ y // r y x } = (typein r x).card

{α : Type u}
{r : α → α → Prop}
[IsWellOrder α r]
(x : α)

#{ y // r y x } = (Ordinal.typein r x).card


/-- A function that is complex differentiable on the open ball of radius `r ≤ ∞` around `c`
is given by evaluating its Taylor series at `c` on this open ball. -/
lemma hasSum_taylorSeries_on_emetric_ball :
    HasSum (fun n : ℕ ↦ (n ! : ℂ)⁻¹ • (z - c) ^ n • iteratedDeriv n f c) (f z)

(hf : DifferentiableOn ℂ f (EMetric.ball c r))

HasSum (fun n => (↑n.factorial)⁻¹ • (z - c) ^ n • iteratedDeriv n f c) (f z)


@[simp]
theorem coe_eval₂Hom (f : R →+* S₁) (g : σ → S₁) : ⇑(eval₂Hom f g) = eval₂ f g

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
(f : R →+* S₁)
(g : σ → S₁)

⇑(MvPolynomial.eval₂Hom f g) = MvPolynomial.eval₂ f g


theorem leibniz_of_mul_eq_one {a b : A} (h : a * b = 1) : D a = -a ^ 2 • D b

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
(D : Derivation R A M)
{a b : A}
(h : a * b = 1)


/-- A family indexed by a type with a unique element
is `MulEquiv` to the element at the single index. -/
@[to_additive (attr := simps!)
  "A family indexed by a type with a unique element
  is `AddEquiv` to the element at the single index."]
def piUnique {ι : Type*} (M : ι → Type*) [∀ j, Mul (M j)] [Unique ι] :
    (∀ j, M j) ≃* M default

{ι : Type u_12}
(M : ι → Type u_13)
[(j : ι) → Add (M j)]
[Unique ι]
(f : (i : ι) → M i)


theorem UInt16.toNat_mod (x y : UInt16) : (x % y).toNat = x.toNat % y.toNat


theorem LSeries.eq_zero_of_not_LSeriesSummable (f : ℕ → ℂ) (s : ℂ) :
    ¬ LSeriesSummable f s → LSeries f s = 0


{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


theorem FG.mul (hm : M.FG) (hn : N.FG) : (M * N).FG

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{M N : Submodule R A}
(hm : M.FG)
(hn : N.FG)


theorem image.fac : factorThruImage f ≫ image.ι f = f

AddCommGrp.factorThruImage f ≫ AddCommGrp.image.ι f = f


@[to_additive (attr := measurability)]
protected theorem smul_const {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
    (hf : StronglyMeasurable f) (c : β) : StronglyMeasurable fun x => f x • c

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => f x • c


/-- Each element of the group defines a multiplicative monoid isomorphism.

This is a stronger version of `MulAction.toPerm`. -/
@[simps (config := { simpRhs := true })]
def MulDistribMulAction.toMulEquiv (x : α) : β ≃* β

{α : Type u}
(β : Type v)
[Group α]
[Monoid β]
[MulDistribMulAction α β]
(x : α)

∀ (a : β), (MulDistribMulAction.toMulEquiv β x) a = x • a


@[to_additive]
theorem noncommProd_mem (K : Subgroup G) {ι : Type*} {t : Finset ι} {f : ι → G} (comm) :
    (∀ c ∈ t, f c ∈ K) → t.noncommProd f comm ∈ K

(comm : (↑t).Pairwise fun a b => Commute (f a) (f b))


/-- **Halmos' theorem: Haar measure is completion regular.** More precisely, any finite measure
set can be approximated from inside by a level set of a continuous function with compact support. -/
@[to_additive innerRegularWRT_preimage_one_hasCompactSupport_measure_ne_top_of_addGroup]
theorem innerRegularWRT_preimage_one_hasCompactSupport_measure_ne_top_of_group :
    InnerRegularWRT μ (fun s ↦ ∃ (f : G → ℝ), Continuous f ∧ HasCompactSupport f ∧ s = f ⁻¹' {1})
    (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)

μ.InnerRegularWRT (fun s => ∃ f, Continuous f ∧ HasCompactSupport f ∧ s = f ⁻¹' {1}) fun s => MeasurableSet s ∧ μ s ≠ ⊤


@[simp]
theorem LinearMap.toMatrixAlgEquiv'_toLinAlgEquiv' (M : Matrix n n R) :
    LinearMap.toMatrixAlgEquiv' (Matrix.toLinAlgEquiv' M) = M

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R)


@[to_additive]
lemma mulSupport_min [LinearOrder M] (f g : α → M) :
    mulSupport (fun x ↦ min (f x) (g x)) ⊆ mulSupport f ∪ mulSupport g

{α : Type u_2}
{M : Type u_4}
[Zero M]
[LinearOrder M]
(f g : α → M)

(Function.support fun x => min (f x) (g x)) ⊆ Function.support f ∪ Function.support g


/-- Every expression $\sum_i m_i \otimes n_i$ which vanishes also vanishes trivially if and only if
for every finitely generated submodule $M' \subseteq M$, the map $M' \otimes N \to M \otimes N$ is
injective. -/
theorem forall_vanishesTrivially_iff_forall_FG_rTensor_injective :
    (∀ {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N},
      ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) → VanishesTrivially R m n) ↔
    ∀ (M' : Submodule R M) (_ : M'.FG), Injective (rTensor N M'.subtype)

(R : Type u)
[CommRing R]
{M : Type u}
[AddCommGroup M]
[Module R M]
{N : Type u}
[AddCommGroup N]
[Module R N]

(∀ {ι : Type u} [inst : Fintype ι] {m : ι → M} {n : ι → N},
    ∑ i : ι, m i ⊗ₜ[R] n i = 0 → TensorProduct.VanishesTrivially R m n) ↔
  ∀ (M' : Submodule R M), M'.FG → Function.Injective ⇑(LinearMap.rTensor N M'.subtype)


/-- If a map `f : α → β` sends any two distinct points to point that are **not** related by a fixed
`s ∈ 𝓤 β`, then `f` is uniform inducing with respect to the discrete uniformity on `α`:
the preimage of `𝓤 β` under `Prod.map f f` is the principal filter generated by the diagonal in
`α × α`. -/
theorem comap_uniformity_of_spaced_out {α} {f : α → β} {s : Set (β × β)} (hs : s ∈ 𝓤 β)
    (hf : Pairwise fun x y => (f x, f y) ∉ s) : comap (Prod.map f f) (𝓤 β) = 𝓟 idRel

Filter.comap (Prod.map f f) (𝓤 β) = 𝓟 idRel


@[simp]
theorem compLeft_compRight (B : BilinForm R M) (l r : M →ₗ[R] M) :
    (B.compLeft l).compRight r = B.comp l r

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


/-- The `componentCompl`s chosen by an end are all infinite. -/
lemma end_componentCompl_infinite (e : G.end) (K : (Finset V)ᵒᵖ) :
    ((e : (j : (Finset V)ᵒᵖ) → G.componentComplFunctor.obj j) K).supp.Infinite

{V : Type}
(G : SimpleGraph V)
(e : ↑G.end)
(K : (Finset V)ᵒᵖ)


theorem generateFrom_sUnion {S : Set (Set (Set α))} :
    generateFrom (⋃₀ S) = ⨅ s ∈ S, generateFrom s

TopologicalSpace.generateFrom (⋃₀ S) = ⨅ s ∈ S, TopologicalSpace.generateFrom s


theorem countP_of' (x : α) :
    countP p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(x : α)

(FreeMonoid.countP p) (FreeMonoid.of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0


theorem card_le_card {s t : Multiset α} (h : s ≤ t) : card s ≤ card t

{α : Type u_1}
{s t : Multiset α}
(h : s ≤ t)


theorem contDiffOn_euclidean {n : ℕ∞} :
    ContDiffOn 𝕜 n f t ↔ ∀ i, ContDiffOn 𝕜 n (fun x => f x i) t

{𝕜 : Type u_1}
{ι : Type u_2}
{H : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
[Fintype ι]
{f : H → EuclideanSpace 𝕜 ι}
{t : Set H}
{n : ℕ∞}

ContDiffOn 𝕜 n f t ↔ ∀ (i : ι), ContDiffOn 𝕜 n (fun x => f x i) t


/-- If `f` is a continuous alternating map, then `f.toContinuousLinearMap m i` is the continuous
linear map obtained by fixing all coordinates but `i` equal to those of `m`, and varying the
`i`-th coordinate. -/
@[simps! apply]
def toContinuousLinearMap [DecidableEq ι] (m : ι → M) (i : ι) : M →L[R] N

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
[DecidableEq ι]
(m : ι → M)
(i : ι)
(x : M)

(f.toContinuousLinearMap m i) x = f (Function.update m i x)


/-- A side of a right-angled triangle divided by the cosine of the adjacent angle equals the
hypotenuse. -/
theorem norm_div_cos_oangle_add_right_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : ‖x‖ / Real.Angle.cos (o.oangle x (x + y)) = ‖x + y‖

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

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


theorem supports_run (S : Finset Λ) {k : K} (s : StAct₂ k) (q : Stmt₂) :
    TM2.SupportsStmt S (stRun s q) ↔ TM2.SupportsStmt S q

{K : Type u_1}
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
(S : Finset Λ)
{k : K}
(s : Turing.TM2to1.StAct k)
(q : Turing.TM2.Stmt Γ Λ σ)

Turing.TM2.SupportsStmt S (Turing.TM2to1.stRun s q) ↔ Turing.TM2.SupportsStmt S q


@[to_additive le_of_add_le_add_right]
theorem le_of_mul_le_mul_right' [i : ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α}
    (bc : b * a ≤ c * a) :
    b ≤ c

[i : ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[simp]
theorem inf_map (s : Finset γ) (f : γ ↪ β) (g : β → α) : (s.map f).inf g = s.inf (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeInf α]
[OrderTop α]
(s : Finset γ)
(f : γ ↪ β)
(g : β → α)


theorem SemilatticeInf.ext {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B

{α : Type u_1}
{A B : SemilatticeInf α}
(H : ∀ (x y : α), x ≤ y ↔ x ≤ y)


theorem of_comp_finiteType {f : A →+* B} {g : B →+* C} (h : (g.comp f).FiniteType) :
    g.FiniteType

{A : Type u_1}
{B : Type u_2}
{C : Type u_3}
[CommRing A]
[CommRing B]
[CommRing C]
{f : A →+* B}
{g : B →+* C}
(h : (g.comp f).FiniteType)


@[to_additive]
theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t)

{M : Type u_3}
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
{s t : Set M}
(hs : IsCompact s)
(ht : IsCompact t)


theorem lineDifferentiableAt_zero : LineDifferentiableAt 𝕜 f x 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{x : E}


theorem sigma_subset_preimage_fst (s : Set ι) (t : ∀ i, Set (α i)) : s.sigma t ⊆ Sigma.fst ⁻¹' s

{ι : Type u_1}
{α : ι → Type u_3}
(s : Set ι)
(t : (i : ι) → Set (α i))


@[simp] theorem dist_left_pointReflection (p q : P) :
    dist p (Equiv.pointReflection p q) = dist p q

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(p q : P)

dist p ((Equiv.pointReflection p) q) = dist p q


theorem get!_of_get? [Inhabited α] : ∀ {l : List α} {n}, get? l n = some a → get! l n = a

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


@[simp]
theorem mem_map (x : L₂) : x ∈ K.map f ↔ ∃ y : L, y ∈ K ∧ f y = x

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{L₂ : Type w}
[LieRing L₂]
[LieAlgebra R L₂]
(f : L →ₗ⁅R⁆ L₂)
(K : LieSubalgebra R L)
(x : L₂)

x ∈ LieSubalgebra.map f K ↔ ∃ y ∈ K, f y = x


/-- The explicit left homology data of a short complex of abelian group that is
given by a kernel and a quotient given by the `AddMonoidHom` API. -/
@[simps]
def abLeftHomologyData : S.LeftHomologyData

S.abLeftHomologyData.i = (AddMonoidHom.ker S.g).subtype


theorem le_sub_one_of_lt : a < b → a ≤ b - 1


theorem Bornology.relativelyCompact.isBounded_iff {s : Set X} :
    @Bornology.IsBounded _ (Bornology.relativelyCompact X) s ↔ IsCompact (closure s)

{X : Type u_1}
[TopologicalSpace X]
[R0Space X]
{s : Set X}

Bornology.IsBounded s ↔ IsCompact (closure s)


theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i))

(p : ℝ≥0∞)
{ι : Type u_2}
(β : ι → Type u_4)
[Fact (1 ≤ p)]
[(i : ι) → PseudoEMetricSpace (β i)]
[Fintype ι]

AntilipschitzWith (↑(Fintype.card ι) ^ (1 / p).toReal) ⇑(WithLp.equiv p ((i : ι) → β i))


lemma two_mul_odd_div_two (hn : n % 2 = 1) : 2 * (n / 2) = n - 1


@[simp]
lemma baseChange_one : (1 : Module.End R M).baseChange A = 1

(R : Type u_1)
{A : Type u_2}
(M : Type u_4)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]


@[to_additive]
theorem measure_smul_eq_zero_iff {s} (c : G) : μ (c • s) = 0 ↔ μ s = 0

[MeasureTheory.SMulInvariantMeasure G α μ]


theorem Finset.isLindelof_biUnion (s : Finset ι) {f : ι → Set X} (hf : ∀ i ∈ s, IsLindelof (f i)) :
    IsLindelof (⋃ i ∈ s, f i)

{X : Type u}
{ι : Type u_1}
[TopologicalSpace X]
(s : Finset ι)
{f : ι → Set X}
(hf : ∀ i ∈ s, IsLindelof (f i))


@[to_additive]
theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _)
    (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _

{M : Type u_3}
[Add M]
{t₁ t₂ : TopologicalSpace M}
(h₁ : ContinuousAdd M)
(h₂ : ContinuousAdd M)


@[to_additive]
theorem MonoidHom.map_mulIndicator {M N : Type*} [MulOneClass M] [MulOneClass N] (f : M →* N)
    (s : Set α) (g : α → M) (x : α) : f (s.mulIndicator g x) = s.mulIndicator (f ∘ g) x

{α : Type u_1}
{M : Type u_6}
{N : Type u_7}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)
(s : Set α)
(g : α → M)
(x : α)

f (s.mulIndicator g x) = s.mulIndicator (⇑f ∘ g) x


lemma mem_sup {I J : TwoSidedIdeal R} {x : R} :
    x ∈ I ⊔ J ↔ ∃ y ∈ I, ∃ z ∈ J, y + z = x

{R : Type u_1}
[NonUnitalNonAssocRing R]
{I J : TwoSidedIdeal R}
{x : R}


@[to_additive norm_lt_of_mem_ball]
theorem norm_lt_of_mem_ball' (h : b ∈ ball a r) : ‖b‖ < ‖a‖ + r

{E : Type u_6}
[SeminormedGroup E]
{a b : E}
{r : ℝ}
(h : b ∈ Metric.ball a r)


/-- A proposition is true on a set neighborhood of `s` iff it is true on a larger open set -/
theorem eventually_nhdsSet_iff_exists {p : X → Prop} :
    (∀ᶠ x in 𝓝ˢ s, p x) ↔ ∃ t, IsOpen t ∧ s ⊆ t ∧ ∀ x, x ∈ t → p x

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
{p : X → Prop}

(∀ᶠ (x : X) in 𝓝ˢ s, p x) ↔ ∃ t, IsOpen t ∧ s ⊆ t ∧ ∀ x ∈ t, p x


theorem ne_of_apply_ne {α β : Sort _} (f : α → β) {x y : α} : f x ≠ f y → x ≠ y

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


@[simp]
theorem mem_openSegment_translate (a : E) {x b c : E} :
    a + x ∈ openSegment 𝕜 (a + b) (a + c) ↔ x ∈ openSegment 𝕜 b c

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(a : E)
{x b c : E}


@[simp]
theorem entries_toAList (xs : List (Sigma β)) : (List.toAList xs).entries = dedupKeys xs

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(xs : List (Sigma β))


@[to_additive (attr := simp)]
theorem coe_copy (K : Subgroup G) (s : Set G) (hs : s = ↑K) : (K.copy s hs : Set G) = s

{G : Type u_1}
[Group G]
(K : Subgroup G)
(s : Set G)
(hs : s = ↑K)


/-- Proof that `f(p) = H(0 ⟶ 0, p)`, with the appropriate casts -/
theorem apply_zero_path : (πₘ f).map p = hcast (H.apply_zero x₀).symm ≫
    (πₘ H.uliftMap).map (prodToProdTopI (𝟙 (@fromTop (TopCat.of _) (ULift.up 0))) p) ≫
    hcast (H.apply_zero x₁)

(p : FundamentalGroupoid.fromTop x₀ ⟶ FundamentalGroupoid.fromTop x₁)

(π.map f).map p =
  ContinuousMap.Homotopy.hcast ⋯ ≫
    (π.map H.uliftMap).map (ContinuousMap.Homotopy.prodToProdTopI (𝟙 (FundamentalGroupoid.fromTop { down := 0 })) p) ≫
      ContinuousMap.Homotopy.hcast ⋯


@[to_additive]
theorem prehaar_pos (K₀ : PositiveCompacts G) {U : Set G} (hU : (interior U).Nonempty) {K : Set G}
    (h1K : IsCompact K) (h2K : (interior K).Nonempty) : 0 < prehaar (K₀ : Set G) U ⟨K, h1K⟩

(K₀ : TopologicalSpace.PositiveCompacts G)

0 < MeasureTheory.Measure.haar.addPrehaar (↑K₀) U { carrier := K, isCompact' := h1K }


@[simp]
theorem card_toMultiset (f : α →₀ ℕ) : Multiset.card (toMultiset f) = f.sum fun _ => id

Multiset.card (Finsupp.toMultiset f) = f.sum fun x => id


/-- The additive character on `ZMod n` defined using `ζ` sends `a` to `ζ^a`. -/
theorem zmodChar_apply {n : ℕ} [NeZero n] {ζ : C} (hζ : ζ ^ n = 1) (a : ZMod n) :
    zmodChar n hζ a = ζ ^ a.val

{C : Type v}
[CommMonoid C]
{n : ℕ}
[NeZero n]
{ζ : C}
(hζ : ζ ^ n = 1)
(a : ZMod n)


/-- Pullback a `NoZeroSMulDivisors` instance along an injective function. -/
theorem Function.Injective.noZeroSMulDivisors {R M N : Type*} [Zero R] [Zero M] [Zero N]
    [SMul R M] [SMul R N] [NoZeroSMulDivisors R N] (f : M → N) (hf : Function.Injective f)
    (h0 : f 0 = 0) (hs : ∀ (c : R) (x : M), f (c • x) = c • f x) : NoZeroSMulDivisors R M


/-- The natural transformation in each degree that is induced by `natTransPInfty`. -/
@[simps!]
noncomputable def natTransPInfty_f (n : ℕ)

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n : ℕ)
(X : CategoryTheory.SimplicialObject C)

(AlgebraicTopology.DoldKan.natTransPInfty_f C n).app X = AlgebraicTopology.DoldKan.PInfty.f n


theorem upperSemicontinuousAt_iff_limsup_le {f : α → γ} :
    UpperSemicontinuousAt f x ↔ limsup f (𝓝 x) ≤ f x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{γ : Type u_3}
[CompleteLinearOrder γ]
[DenselyOrdered γ]
{f : α → γ}

UpperSemicontinuousAt f x ↔ Filter.limsup f (𝓝 x) ≤ f x


theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
    normAtPlace w (x + y) ≤ normAtPlace w x + normAtPlace w y

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

(NumberField.mixedEmbedding.normAtPlace w) (x + y) ≤
  (NumberField.mixedEmbedding.normAtPlace w) x + (NumberField.mixedEmbedding.normAtPlace w) y


@[simp]
lemma zsmul_eq_zsmul (n : ℤ) (x : X[S⁻¹]) :
    letI inst := OreLocalization.instModuleOfIsScalarTower (R₀ := ℤ) (R := R) (X := X) (S := S)
    HSMul.hSMul (self := @instHSMul _ _ inst.toSMul) n x = n • x

{R : Type u_1}
[Ring R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[AddCommGroup X]
[Module R X]
(n : ℤ)
(x : OreLocalization S X)


theorem finsuppTotal_apply_eq_of_fintype [Fintype ι] (f : ι →₀ I) :
    finsuppTotal ι M I v f = ∑ i, (f i : R) • v i

{ι : Type u_1}
{M : Type u_2}
[AddCommGroup M]
{R : Type u_3}
[CommRing R]
[Module R M]
(I : Ideal R)
{v : ι → M}
[Fintype ι]
(f : ι →₀ ↥I)

(Ideal.finsuppTotal ι M I v) f = ∑ i : ι, ↑(f i) • v i


theorem degree_sum_eq_of_disjoint (f : S → R[X]) (s : Finset S)
    (h : Set.Pairwise { i | i ∈ s ∧ f i ≠ 0 } (Ne on degree ∘ f)) :
    degree (s.sum f) = s.sup fun i => degree (f i)

(h : {i | i ∈ s ∧ f i ≠ 0}.Pairwise (Ne on Polynomial.degree ∘ f))

(s.sum f).degree = s.sup fun i => (f i).degree


lemma fin3_def_ext (X Y Z : R) : ![X, Y, Z] x = X ∧ ![X, Y, Z] y = Y ∧ ![X, Y, Z] z = Z


theorem apply_none {α ι} (l : Line α ι) (x : α) (i : ι) (h : l.idxFun i = none) : l x i = x

{α : Type u_5}
{ι : Type u_6}
(l : Combinatorics.Line α ι)
(x : α)
(i : ι)
(h : l.idxFun i = none)

(fun x i => (l.idxFun i).getD x) x i = x


theorem zipWith_neLocus_eq_right [DecidableEq M] [Zero M] [DecidableEq P] [Zero P] [Zero N]
    {F : M → N → P} (F0 : F 0 0 = 0) (f₁ f₂ : α →₀ M) (g : α →₀ N)
    (hF : ∀ g, Function.Injective fun f => F f g) :
    (zipWith F F0 f₁ g).neLocus (zipWith F F0 f₂ g) = f₁.neLocus f₂

(hF : ∀ (g : N), Function.Injective fun f => F f g)

(Finsupp.zipWith F F0 f₁ g).neLocus (Finsupp.zipWith F F0 f₂ g) = f₁.neLocus f₂


@[to_additive (attr := simp)]
theorem freeGroupCongr_symm {α β} (e : α ≃ β) : (freeGroupCongr e).symm = freeGroupCongr e.symm

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

(FreeAddGroup.freeAddGroupCongr e).symm = FreeAddGroup.freeAddGroupCongr e.symm


theorem edges_dropUntil_subset {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.dropUntil u h).edges ⊆ p.edges

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v w : V}
(p : G.Walk v w)
(h : u ∈ p.support)


/-- Assemble an `I`-indexed family of functors into a functor between the pi types.
-/
@[simps]
def pi (F : ∀ i, C i ⥤ D i) : (∀ i, C i) ⥤ ∀ i, D i

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

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

(F : (i : I) → CategoryTheory.Functor (C i) (D i))

(CategoryTheory.Functor.pi F).obj f i = (F i).obj (f i)


@[simp]
theorem relabel_imp (g : α → β ⊕ (Fin n)) {k} (φ ψ : L.BoundedFormula α k) :
    (φ.imp ψ).relabel g = (φ.relabel g).imp (ψ.relabel g)

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{n : ℕ}
(g : α → β ⊕ Fin n)
{k : ℕ}
(φ ψ : L.BoundedFormula α k)

FirstOrder.Language.BoundedFormula.relabel g (φ.imp ψ) =
  (FirstOrder.Language.BoundedFormula.relabel g φ).imp (FirstOrder.Language.BoundedFormula.relabel g ψ)


@[norm_cast, simp]
theorem coe_nsmul (n : ℕ) (f : M →ₗ⁅R,L⁆ N) : ⇑(n • f) = n • (⇑f)

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(n : ℕ)
(f : M →ₗ⁅R,L⁆ N)


theorem J_det_mul_J_det : det (J l R) * det (J l R) = 1

(l : Type u_1)
(R : Type u_2)
[DecidableEq l]
[CommRing R]
[Fintype l]

(Matrix.J l R).det * (Matrix.J l R).det = 1


lemma mul_div_mul_cancel {a b c : EReal} (h₁ : c ≠ ⊥) (h₂ : c ≠ ⊤) (h₃ : c ≠ 0) :
    (a * c) / (b * c) = a / b


theorem contDiffWithinAt_prod' {t : Finset ι} {f : ι → E → 𝔸'}
    (h : ∀ i ∈ t, ContDiffWithinAt 𝕜 n (f i) s x) : ContDiffWithinAt 𝕜 n (∏ i ∈ t, f i) s x


@[simp, norm_cast]
theorem cast_bit1 [AddGroupWithOne α] : ∀ n : ZNum, (n.bit1 : α) = ((n : α) + n) + 1

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


@[simp]
theorem neg_left_iff {M : Type*} [AddCommGroup M] [TopologicalSpace M] [TopologicalAddGroup M]
    {v : VectorMeasure α M} {w : VectorMeasure α N} : -v ⟂ᵥ w ↔ v ⟂ᵥ w

{α : Type u_1}
{m : MeasurableSpace α}
{N : Type u_5}
[AddCommMonoid N]
[TopologicalSpace N]
{M : Type u_6}
[AddCommGroup M]
[TopologicalSpace M]
[TopologicalAddGroup M]
{v : MeasureTheory.VectorMeasure α M}
{w : MeasureTheory.VectorMeasure α N}

-v ⟂ᵥ w ↔ v ⟂ᵥ w


theorem to_sup_of_normal_left {H K : Subgroup G} (hH : IsPGroup p H) (hK : IsPGroup p K)
    [H.Normal] : IsPGroup p (H ⊔ K : Subgroup G)

{p : ℕ}
{G : Type u_1}
[Group G]
{H K : Subgroup G}
(hH : IsPGroup p ↥H)
(hK : IsPGroup p ↥K)
[H.Normal]


@[simp]
theorem mul_apply {g₁ g₂ : α →₀ β} {a : α} : (g₁ * g₂) a = g₁ a * g₂ a

{α : Type u₁}
{β : Type u₂}
[MulZeroClass β]
{g₁ g₂ : α →₀ β}
{a : α}


theorem le_fib_self {n : ℕ} (five_le_n : 5 ≤ n) : n ≤ fib n


theorem embDomain_notin_range {f : Γ ↪o Γ'} {x : HahnSeries Γ R} {b : Γ'} (hb : b ∉ Set.range f) :
    (embDomain f x).coeff b = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{Γ' : Type u_3}
[PartialOrder Γ']
{f : Γ ↪o Γ'}
{x : HahnSeries Γ R}
{b : Γ'}
(hb : b ∉ Set.range ⇑f)


theorem drop_take : ∀ (m n : Nat) (l : List α), drop n (take m l) = take (m - n) (drop n l)

List.drop n (List.take m l) = List.take (m - n) (List.drop n l)


/-- **Von Neumann Mean Ergodic Theorem** for an operator in a Hilbert space.
For a contracting continuous linear self-map `f : E →L[𝕜] E` of a Hilbert space, `‖f‖ ≤ 1`,
the Birkhoff averages
```
birkhoffAverage 𝕜 f id N x = (N : 𝕜)⁻¹ • ∑ n ∈ Finset.range N, f^[n] x
```
converge to the orthogonal projection of `x` to the subspace of fixed points of `f`. -/
theorem ContinuousLinearMap.tendsto_birkhoffAverage_orthogonalProjection (f : E →L[𝕜] E)
    (hf : ‖f‖ ≤ 1) (x : E) :
    Tendsto (birkhoffAverage 𝕜 f _root_.id · x) atTop
      (𝓝 <| orthogonalProjection (LinearMap.eqLocus f 1) x)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
(f : E →L[𝕜] E)
(hf : ‖f‖ ≤ 1)
(x : E)

Filter.Tendsto (fun x_1 => birkhoffAverage 𝕜 (⇑f) id x_1 x) Filter.atTop
  (𝓝 ↑((orthogonalProjection (LinearMap.eqLocus f 1)) x))


@[to_additive]
theorem continuousWithinAt_inv {s : Set G} {x : G} : ContinuousWithinAt Inv.inv s x

{G : Type w}
[TopologicalSpace G]
[Inv G]
[ContinuousInv G]
{s : Set G}
{x : G}


theorem inf_eq_of_isDetecting [HasPullbacks C] {𝒢 : Set C} (h𝒢 : IsDetecting 𝒢) {X : C}
    (P Q : Subobject X) (h : ∀ G ∈ 𝒢, ∀ {f : G ⟶ X}, P.Factors f → Q.Factors f) : P ⊓ Q = P


@[simp]
theorem preimage_Ioo {a b : α} : ((↑) : ℤ → α) ⁻¹' Set.Ioo a b = Set.Ioo ⌊a⌋ ⌈b⌉

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a b : α}

Int.cast ⁻¹' Set.Ioo a b = Set.Ioo ⌊a⌋ ⌈b⌉


/-- Test for convergence of the `p`-series: the real-valued series `∑' n : ℕ, 1 / n ^ p` converges
if and only if `1 < p`. -/
theorem summable_one_div_nat_rpow {p : ℝ} :
    Summable (fun n => 1 / (n : ℝ) ^ p : ℕ → ℝ) ↔ 1 < p


@[to_additive (attr := simp)]
lemma forget_map {X Y : CommMonCat} (f : X ⟶ Y) :
    (forget CommMonCat).map f = (f : X → Y)

(CategoryTheory.forget CommMonCat).map f = ⇑f


theorem toWithTop_zero :
    have : Decidable (0 : PartENat).Dom := someDecidable 0
    toWithTop 0 = 0

let_fun this := Part.someDecidable 0;
PartENat.toWithTop 0 = 0


@[simp]
theorem map₂_vsub : map₂ (· -ᵥ ·) f g = f -ᵥ g

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{f g : Filter β}

Filter.map₂ (fun x x_1 => x -ᵥ x_1) f g = f -ᵥ g


@[to_additive (attr := simp)]
theorem bot_toSubmonoid : (⊥ : Subgroup G).toSubmonoid = ⊥


lemma Real.dist_right_le_of_mem_uIcc {x y z : ℝ} (h : y ∈ uIcc x z) : dist y z ≤ dist x z


theorem ne_zero_of_trailingDegree_lt {n : ℕ∞} (h : trailingDegree p < n) : p ≠ 0

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ∞}
(h : p.trailingDegree < n)


/-- The category of R-algebras has all limits. -/
lemma hasLimitsOfSize [UnivLE.{v, w}] : HasLimitsOfSize.{t, v} (AlgebraCat.{w} R)

{R : Type u}
[CommRing R]
[UnivLE.{v, w}]

CategoryTheory.Limits.HasLimitsOfSize.{t, v, w, max (w + 1) u} (AlgebraCat R)


@[to_additive (attr := simp)]
theorem MonoidHom.one_apply [MulOneClass M] [MulOneClass N] (x : M) : (1 : M →* N) x = 1

{M : Type u_4}
{N : Type u_5}
[MulOneClass M]
[MulOneClass N]
(x : M)


theorem subset_accumulate [Preorder α] {x : α} : s x ⊆ Accumulate s x

{α : Type u_1}
{β : Type u_2}
{s : α → Set β}
[Preorder α]
{x : α}


theorem disjoint_nhds_pure [T1Space X] {x y : X} (h : x ≠ y) : Disjoint (𝓝 x) (pure y)

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{x y : X}
(h : x ≠ y)


@[to_additive]
theorem apply_abs_le_mul_of_one_le' {β : Type*} [MulOneClass β] [Preorder β]
    [CovariantClass β β (· * ·) (· ≤ ·)] [CovariantClass β β (swap (· * ·)) (· ≤ ·)] {f : α → β}
    {a : α} (h₁ : 1 ≤ f a) (h₂ : 1 ≤ f (-a)) : f |a| ≤ f a * f (-a)

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

[CovariantClass β β (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


theorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{a : Aˣ}
{r : R}
(hr : r ∈ spectrum R ↑a)


@[to_additive]
theorem mem_fixedPoints' {a : α} : a ∈ fixedPoints M α ↔ ∀ a', a' ∈ orbit M a → a' = a

{M : Type u}
[Monoid M]
{α : Type v}
[MulAction M α]
{a : α}

a ∈ MulAction.fixedPoints M α ↔ ∀ a' ∈ MulAction.orbit M a, a' = a


/-- A special case of `iInf_principal` that is safe to mark `simp`. -/
@[simp]
theorem iInf_principal' {ι : Type w} [Finite ι] (f : ι → Set α) : ⨅ i, 𝓟 (f i) = 𝓟 (⋂ i, f i)

{α : Type u}
{ι : Type w}
[Finite ι]
(f : ι → Set α)


lemma ringHomComp_pow (χ : MulChar R R') (f : R' →+* R'') (n : ℕ) :
    χ.ringHomComp f ^ n = (χ ^ n).ringHomComp f

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{R'' : Type u_3}
[CommRing R'']
(χ : MulChar R R')
(f : R' →+* R'')
(n : ℕ)


/-- A charted space has an atlas in a groupoid `G` if the change of coordinates belong to the
groupoid. -/
class HasGroupoid {H : Type*} [TopologicalSpace H] (M : Type*) [TopologicalSpace M]
    [ChartedSpace H M] (G : StructureGroupoid H) : Prop where
  compatible : ∀ {e e' : PartialHomeomorph M H}, e ∈ atlas H M → e' ∈ atlas H M → e.symm ≫ₕ e' ∈ G

{H : Type u_5}
[TopologicalSpace H]
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{G : StructureGroupoid H}
[self : HasGroupoid M G]
{e e' : PartialHomeomorph M H}


theorem one_div_pow_strictAnti (a1 : 1 < a) : StrictAnti fun n : ℕ => 1 / a ^ n

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(a1 : 1 < a)


theorem imageSubobject_mono (f : X ⟶ Y) [Mono f] : imageSubobject f = Subobject.mk f

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

CategoryTheory.Limits.imageSubobject f = CategoryTheory.Subobject.mk f


/-- The functor `(F ⋙ L, R) ⥤ (L, R)` -/
@[simps]
def preRight (L : A ⥤ T) (F : C ⥤ B) (R : B ⥤ T) : Comma L (F ⋙ R) ⥤ Comma L R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{C : Type u₄}
[CategoryTheory.Category.{v₄, u₄} C]
(L : CategoryTheory.Functor A T)
(F : CategoryTheory.Functor C B)
(R : CategoryTheory.Functor B T)
(X : CategoryTheory.Comma L (F.comp R))

((CategoryTheory.Comma.preRight L F R).obj X).hom = X.hom


@[simp]
theorem isMin_grade_iff : IsMin (grade 𝕆 a) ↔ IsMin a

{𝕆 : Type u_1}
{α : Type u_3}
[Preorder 𝕆]
[Preorder α]
[GradeMinOrder 𝕆 α]
{a : α}


theorem tan_nat_mul_pi (n : ℕ) : tan (n * π) = 0


@[to_additive (attr := simp)]
theorem div_eq_self : a / b = a ↔ b = 1


@[to_additive]
theorem Filter.Tendsto.const_smul {f : β → α} {l : Filter β} {a : α} (hf : Tendsto f l (𝓝 a))
    (c : M) : Tendsto (fun x => c • f x) l (𝓝 (c • a))

{M : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[VAdd M α]
[ContinuousConstVAdd M α]
{f : β → α}
{l : Filter β}
{a : α}
(hf : Filter.Tendsto f l (𝓝 a))
(c : M)

Filter.Tendsto (fun x => c +ᵥ f x) l (𝓝 (c +ᵥ a))


@[simp]
theorem ratio_pow (e : X ≃ᵈ X) (n : ℕ) : ratio (e ^ n) = ratio e ^ n

{X : Type u_1}
[PseudoEMetricSpace X]
(e : X ≃ᵈ X)
(n : ℕ)

Dilation.ratio (e ^ n) = Dilation.ratio e ^ n


theorem IsCompact.prod_nhdsSet_eq_biSup {K : Set Y} (hK : IsCompact K) (l : Filter X) :
    l ×ˢ (𝓝ˢ K) = ⨆ y ∈ K, l ×ˢ 𝓝 y

{X : Type u}
{Y : Type v}
[TopologicalSpace Y]
{K : Set Y}
(hK : IsCompact K)
(l : Filter X)

l ×ˢ 𝓝ˢ K = ⨆ y ∈ K, l ×ˢ 𝓝 y


theorem subset_lieSpan : s ⊆ lieSpan R L s

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{s : Set M}


theorem sub_subst {α} [Ring α] {n e1 e2 t1 t2 : α} (h1 : n * e1 = t1) (h2 : n * e2 = t2) :
    n * (e1 - e2) = t1 - t2


theorem IsTrail.of_append_right {u v w : V} {p : G.Walk u v} {q : G.Walk v w}
    (h : (p.append q).IsTrail) : q.IsTrail

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
{p : G.Walk u v}
{q : G.Walk v w}
(h : (p.append q).IsTrail)


theorem one_apply (a : A) : (1 : A →⋆ₙₐ[R] A) a = a

{R : Type u_1}
{A : Type u_2}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
(a : A)


@[symm]
theorem IsCoprime.symm (H : IsCoprime x y) : IsCoprime y x

{R : Type u}
[CommSemiring R]
{x y : R}
(H : IsCoprime x y)


theorem iInf_subtype'' {ι} (s : Set ι) (f : ι → α) : ⨅ i : s, f i = ⨅ (t : ι) (_ : t ∈ s), f t

{α : Type u_1}
[CompleteLattice α]
{ι : Type u_9}
(s : Set ι)
(f : ι → α)


theorem Perm.filterMap (f : α → Option β) {l₁ l₂ : List α} (p : l₁ ~ l₂) :
    filterMap f l₁ ~ filterMap f l₂

{α : Type u_1}
{β : Type u_2}
(f : α → Option β)
{l₁ l₂ : List α}
(p : l₁ ~ l₂)

List.filterMap f l₁ ~ List.filterMap f l₂


theorem getLast_concat : getLast (concat l a) h = a

∀ {α : Type u_1} {l : List α} {a : α} {h : l.concat a ≠ []}, (l.concat a).getLast h = a


theorem zmod_congr_of_sub_mem_span_aux (n : ℕ) (x : ℤ_[p]) (a b : ℤ)
    (ha : x - a ∈ (Ideal.span {(p : ℤ_[p]) ^ n}))
    (hb : x - b ∈ (Ideal.span {(p : ℤ_[p]) ^ n})) : (a : ZMod (p ^ n)) = b

{p : ℕ}
[hp_prime : Fact (Nat.Prime p)]
(n : ℕ)
(x : ℤ_[p])
(a b : ℤ)
(ha : x - ↑a ∈ Ideal.span {↑p ^ n})
(hb : x - ↑b ∈ Ideal.span {↑p ^ n})


@[to_additive]
theorem toMonoidHom_injective : Injective (toMonoidHom : _ → α →* β)

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulOneClass α]
[MulOneClass β]


@[gcongr]
theorem union_subset_union_right (h : t₁ ⊆ t₂) : s ∪ t₁ ⊆ s ∪ t₂

{α : Type u_1}
[DecidableEq α]
{s t₁ t₂ : Finset α}
(h : t₁ ⊆ t₂)

s ∪ t₁ ⊆ s ∪ t₂


@[simp]
theorem toSet_sdiff (x y : ZFSet.{u}) : (x \ y).toSet = x.toSet \ y.toSet


@[simp]
theorem torsion'_torsion'_eq_top : torsion' R (torsion' R M S) S = ⊤

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(S : Type u_3)
[CommMonoid S]
[DistribMulAction S M]
[SMulCommClass S R M]

Submodule.torsion' R (↥(Submodule.torsion' R M S)) S = ⊤


@[simps]
instance tensor_right' (X Y : C) [MonoidalCoherence Y (𝟙_ C)] :
    MonoidalCoherence (X ⊗ Y) X

[CategoryTheory.MonoidalCoherence Y (𝟙_ C)]


theorem concat_ne_nil (a : α) (l : List α) : concat l a ≠ []


theorem find_le (n : ℕ) (h : P n) : find P ≤ n

(P : ℕ → Prop)
[DecidablePred P]
(n : ℕ)
(h : P n)


lemma finiteCoproduct.ι_injective (a : α) : Function.Injective (finiteCoproduct.ι X a)

Function.Injective ⇑(CompHausLike.finiteCoproduct.ι X a)


@[simp]
theorem unop_toSubring (S : Subalgebra R Aᵐᵒᵖ) : S.unop.toSubring = S.toSubring.unop

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
(S : Subalgebra R Aᵐᵒᵖ)


@[simp] theorem foldr_append (f : α → β → β) (b) (l l' : List α) :
    (l ++ l').foldr f b = l.foldr f (l'.foldr f b)

{α : Type u_1}
{β : Type u_2}
(f : α → β → β)
(b : β)
(l l' : List α)

List.foldr f b (l ++ l') = List.foldr f (List.foldr f b l') l


theorem isPrime_of_isPrime_prod_top {I : Ideal R} (h : (Ideal.prod I (⊤ : Ideal S)).IsPrime) :
    I.IsPrime

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{I : Ideal R}
(h : (I.prod ⊤).IsPrime)


theorem integral_eq_zero_of_ae {f : α → G} (hf : f =ᵐ[μ] 0) : ∫ a, f a ∂μ = 0

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → G}
(hf : f =ᵐ[μ] 0)


lemma inf_nhds' [Inf L] [ContinuousInf L] (hf : Tendsto f l (𝓝 x)) (hg : Tendsto g l (𝓝 y)) :
    Tendsto (f ⊓ g) l (𝓝 (x ⊓ y))

{L : Type u_1}
[TopologicalSpace L]
{α : Type u_3}
{l : Filter α}
{f g : α → L}
{x y : L}
[Inf L]
[ContinuousInf L]
(hf : Filter.Tendsto f l (𝓝 x))
(hg : Filter.Tendsto g l (𝓝 y))


theorem isUnit_iff_forall_isUnit (f : C(X, R)) : IsUnit f ↔ ∀ x, IsUnit (f x)

{X : Type u_1}
{R : Type u_3}
[TopologicalSpace X]
[NormedRing R]
[CompleteSpace R]
(f : C(X, R))


/-- A (preadditive) category `C` is called abelian if it has all finite products,
all kernels and cokernels, and if every monomorphism is the kernel of some morphism
and every epimorphism is the cokernel of some morphism.

(This definition implies the existence of zero objects:
finite products give a terminal object, and in a preadditive category
any terminal object is a zero object.)
-/
class Abelian extends Preadditive C, NormalMonoCategory C, NormalEpiCategory C where
  [has_finite_products : HasFiniteProducts C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[self : CategoryTheory.Abelian C]


/-- If `f ≫ g` is a closed immersion, then `f` is a closed immersion. -/
theorem of_comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsClosedImmersion g]
    [IsClosedImmersion (f ≫ g)] : IsClosedImmersion f

[AlgebraicGeometry.IsClosedImmersion (f ≫ g)]


/-- Ring isomorphism between `R[X]` and `R[ℕ]`. This is just an
implementation detail, but it can be useful to transfer results from `Finsupp` to polynomials. -/
@[simps apply symm_apply]
def toFinsuppIso : R[X] ≃+* R[ℕ]

(Polynomial.toFinsuppIso R) self = self.toFinsupp


theorem comap_op_mul (M N : Submodule R Aᵐᵒᵖ) :
    comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (M * N) =
      comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) N *
        comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M N : Submodule R Aᵐᵒᵖ)

Submodule.comap (↑(MulOpposite.opLinearEquiv R)) (M * N) =
  Submodule.comap (↑(MulOpposite.opLinearEquiv R)) N * Submodule.comap (↑(MulOpposite.opLinearEquiv R)) M


@[ext]
theorem Hom.ext {a b : SimplexCategory} (f g : a ⟶ b) :
    f.toOrderHom = g.toOrderHom → f = g

SimplexCategory.Hom.toOrderHom f = SimplexCategory.Hom.toOrderHom g → f = g


theorem map_sup (s t : NonUnitalSubsemiring R) (f : F) :
    (map f (s ⊔ t) : NonUnitalSubsemiring S) = map f s ⊔ map f t

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(s t : NonUnitalSubsemiring R)
(f : F)

NonUnitalSubsemiring.map f (s ⊔ t) = NonUnitalSubsemiring.map f s ⊔ NonUnitalSubsemiring.map f t


/-- Being in the essential image is a "hygienic" property: it is preserved under isomorphism. -/
theorem essImage.ofIso {Y Y' : D} (h : Y ≅ Y') (hY : Y ∈ essImage F) : Y' ∈ essImage F

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{Y Y' : D}
(h : Y ≅ Y')
(hY : Y ∈ F.essImage)


theorem biInter_empty (u : α → Set β) : ⋂ x ∈ (∅ : Set α), u x = univ

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


@[to_additive]
theorem integral_eq_tsum_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) (f : α → E)
    (hf : Integrable f ν) : ∫ x, f x ∂ν = ∑' g : G, ∫ x in g • s, f x ∂ν

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

(hν : ν ≪ μ)

∫ (x : α), f x ∂ν = ∑' (g : G), ∫ (x : α) in g • s, f x ∂ν


@[to_additive (attr := simp)]
theorem bot_subgroupOf : (⊥ : Subgroup G).subgroupOf H = ⊥

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)


/-- A functor between categories induces a functor between
the categories of `G`-actions within those categories. -/
@[simps]
def mapAction (F : V ⥤ W) (G : MonCat.{u}) : Action V G ⥤ Action W G

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{W : Type (u + 1)}
[CategoryTheory.LargeCategory W]
(F : V ⥤ W)
(G : MonCat)

∀ {X Y : Action V G} (f : X ⟶ Y), ((F.mapAction G).map f).hom = F.map f.hom


@[nolint unusedArguments]
lemma zero_mul_eq {α} {R : α → α → Prop} [Semiring α] {a b : α} (h : a = 0) (_ : R b 0) :
    a * b = 0

{α : Type u_1}
{R : α → α → Prop}
[Semiring α]
{a b : α}
(h : a = 0)


@[simp]
theorem bind_add (μ ν : Measure α) (κ : Kernel α β) : (μ + ν).bind κ = μ.bind κ + ν.bind κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(μ ν : MeasureTheory.Measure α)
(κ : ProbabilityTheory.Kernel α β)


theorem monomial_neg (n : ℕ) (a : R) : monomial n (-a) = -monomial n a

(Polynomial.monomial n) (-a) = -(Polynomial.monomial n) a


@[to_additive]
theorem op_sSup (S : Set (Submonoid M)) : (sSup S).op = sSup (.unop ⁻¹' S)

{M : Type u_2}
[AddZeroClass M]
(S : Set (AddSubmonoid M))

(sSup S).op = sSup (AddSubmonoid.unop ⁻¹' S)


theorem pointwise_vadd_direction (v : V) (s : AffineSubspace k P) :
    (v +ᵥ s).direction = s.direction

{k : Type u_1}
[Ring k]
{V : Type u_2}
{P : Type u_3}
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(v : V)
(s : AffineSubspace k P)


@[simp]
theorem toBoolRing_inf (a b : α) : toBoolRing (a ⊓ b) = toBoolRing a * toBoolRing b

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


theorem powersetAux_perm_powersetAux' {l : List α} : powersetAux l ~ powersetAux' l

(Multiset.powersetAux l).Perm (Multiset.powersetAux' l)


theorem dist_eq' (m n : ℤ) : dist m n = |m - n|


theorem toDual_ker : LinearMap.ker b.toDual = ⊥

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
(b : Basis ι R M)


protected theorem LinearIndependent.eventually {ι} [Finite ι] {f : ι → E}
    (hf : LinearIndependent 𝕜 f) : ∀ᶠ g in 𝓝 f, LinearIndependent 𝕜 g

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace 𝕜]
{ι : Type u_1}
[Finite ι]
{f : ι → E}
(hf : LinearIndependent 𝕜 f)

∀ᶠ (g : ι → E) in 𝓝 f, LinearIndependent 𝕜 g


/-- Type product is associative up to an equivalence. -/
@[simps]
def prodAssoc (α β γ) : (α × β) × γ ≃ α × β × γ

(α : Type u_1)
(β : Type u_2)
(γ : Type u_3)
(p : (α × β) × γ)

(Equiv.prodAssoc α β γ) p = (p.1.1, p.1.2, p.2)


@[gcongr]
theorem Ioc_subset_Ioc (h₁ : a₂ ≤ a₁) (h₂ : b₁ ≤ b₂) : Ioc a₁ b₁ ⊆ Ioc a₂ b₂

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


theorem map_rootOfSplits {f : K[X]} (hf : f.Splits i) (hfd) :
    f.eval₂ i (rootOfSplits i hf hfd) = 0

{K : Type v}
{L : Type w}
[Field K]
[Field L]
(i : K →+* L)
{f : K[X]}
(hf : Polynomial.Splits i f)
(hfd : f.degree ≠ 0)

Polynomial.eval₂ i (Polynomial.rootOfSplits i hf hfd) f = 0


@[simp]
theorem average_neg (f : α → E) : ⨍ x, -f x ∂μ = -⨍ x, f x ∂μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(μ : MeasureTheory.Measure α)
(f : α → E)


theorem two_dvd_centralBinom_succ (n : ℕ) : 2 ∣ centralBinom (n + 1)


@[simp, norm_cast]
theorem coe_zero : ((0 : s) : R) = (0 : R)

{R : Type u}
[NonUnitalNonAssocSemiring R]
(s : NonUnitalSubsemiring R)


/-- If `S / R` and `S' / R'` are algebras, `i : R ≃+* R'` and `j : S ≃+* S'` are
ring isomorphisms, such that `R → R' → S'` and `R → S → S'` commute,
then the rank of `S / R` is equal to the rank of `S' / R'`. -/
theorem lift_rank_eq_of_equiv_equiv (i : R ≃+* R') (j : S ≃+* S')
    (hc : (algebraMap R' S').comp i.toRingHom = j.toRingHom.comp (algebraMap R S)) :
    lift.{v'} (Module.rank R S) = lift.{v} (Module.rank R' S')

Cardinal.lift.{v', v} (Module.rank R S) = Cardinal.lift.{v, v'} (Module.rank R' S')


@[simp]
theorem testBit_ldiff : ∀ m n k, testBit (ldiff m n) k = (testBit m k && not (testBit n k))

(m.ldiff n).testBit k = (m.testBit k && !n.testBit k)


/-- The polynomial `X` lifts. -/
theorem X_mem_lifts (f : R →+* S) : (X : S[X]) ∈ lifts f

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
(f : R →+* S)


theorem resolvent_isBigO_inv (a : A) : resolvent a =O[cobounded 𝕜] Inv.inv

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
(a : A)

resolvent a =O[Bornology.cobounded 𝕜] Inv.inv


theorem isUnit_toMatrix : IsUnit (b.toMatrix b₂)

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
[Fintype ι]
(b₂ : AffineBasis ι k P)
[DecidableEq ι]


theorem pairwise_coprime_iff_coprime_prod [DecidableEq I] :
    Pairwise (IsCoprime on fun i : t ↦ s i) ↔ ∀ i ∈ t, IsCoprime (s i) (∏ j ∈ t \ {i}, s j)

{R : Type u}
{I : Type v}
[CommSemiring R]
{s : I → R}
{t : Finset I}
[DecidableEq I]

Pairwise (IsCoprime on fun i => s ↑i) ↔ ∀ i ∈ t, IsCoprime (s i) (∏ j ∈ t \ {i}, s j)


@[simp] theorem associator_hom_apply_1 {X Y Z : Type u} {x} :
    (((α_ X Y Z).hom : (X ⊗ Y) ⊗ Z → X ⊗ Y ⊗ Z) x).1 = x.1.1


lemma summable_f_int (k : ℕ) (a : ℝ) {t : ℝ} (ht : 0 < t) : Summable (f_int k a t)

Summable (HurwitzKernelBounds.f_int k a t)


@[simp, norm_cast]
theorem coe_sInf (S : Set (NonUnitalSubalgebra R A)) : (↑(sInf S) : Set A) = ⋂ s ∈ S, ↑s

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(S : Set (NonUnitalSubalgebra R A))


/-- `ιInvApp` is the inverse of `D.ι i` on `U`. -/
theorem π_ιInvApp_eq_id (i : D.J) (U : Opens (D.U i).carrier) :
    D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U = 𝟙 _

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U = 𝟙 (CategoryTheory.Limits.limit (D.diagramOverOpen U))


theorem iterateFrobenius_add :
    iterateFrobenius R p (m + n) = (iterateFrobenius R p m).comp (iterateFrobenius R p n)

(R : Type u)
[CommSemiring R]
(p m n : ℕ)
[ExpChar R p]


theorem ContMDiffWithinAt.fst {f : N → M × M'} {s : Set N} {x : N}
    (hf : ContMDiffWithinAt J (I.prod I') n f s x) :
    ContMDiffWithinAt J I n (fun x => (f x).1) s x


theorem imageBasicOpen_image_open :
    IsOpen ((coequalizer.π f.1 g.1).base '' (imageBasicOpen f g U s).1)

{X Y : AlgebraicGeometry.LocallyRingedSpace}

(U : TopologicalSpace.Opens ↑↑(CategoryTheory.Limits.coequalizer f.val g.val).toPresheafedSpace)

(s : ↑((CategoryTheory.Limits.coequalizer f.val g.val).presheaf.obj (Opposite.op U)))

IsOpen
  (⇑(CategoryTheory.Limits.coequalizer.π f.val g.val).base ''
    (AlgebraicGeometry.LocallyRingedSpace.HasCoequalizer.imageBasicOpen f g U s).carrier)


@[to_additive (attr := simp)]
theorem map_id : map (@id α) = MonoidHom.id (FreeMonoid α)

FreeMonoid.map id = MonoidHom.id (FreeMonoid α)


/-- Symmetric statement to `Finset.image_image₂_distrib_left`. -/
theorem image₂_image_left_comm {f : α' → β → γ} {g : α → α'} {f' : α → β → δ} {g' : δ → γ}
    (h_left_comm : ∀ a b, f (g a) b = g' (f' a b)) :
    image₂ f (s.image g) t = (image₂ f' s t).image g'

{f : α' → β → γ}

{f' : α → β → δ}

(h_left_comm : ∀ (a : α) (b : β), f (g a) b = g' (f' a b))

Finset.image₂ f (Finset.image g s) t = Finset.image g' (Finset.image₂ f' s t)


/-- `Complex.conj` is analogous to `CliffordAlgebra.involute`. -/
@[simp]
theorem ofComplex_conj (c : ℂ) : ofComplex (conj c) = involute (ofComplex c)

CliffordAlgebraComplex.ofComplex ((starRingEnd ℂ) c) = CliffordAlgebra.involute (CliffordAlgebraComplex.ofComplex c)


/-- val_v(0) = 0. -/
lemma count_zero : count K v (0 : FractionalIdeal R⁰ K) = 0

(v : IsDedekindDomain.HeightOneSpectrum R)


@[to_additive]
theorem Infinite.of_smul_set : (a • s).Infinite → s.Infinite

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s : Set β}
{a : α}


@[simp] protected theorem mul_one (a : Rat) : a * 1 = a


theorem mul_X_pow_eq_zero {p : R[X]} {n : ℕ} (H : p * X ^ n = 0) : p = 0

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}
(H : p * Polynomial.X ^ n = 0)


@[to_additive (attr := gcongr) sub_le_sub]
theorem div_le_div'' (hab : a ≤ b) (hcd : c ≤ d) : a / d ≤ b / c

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


theorem hasBasis_cobounded_compl_closedBall (c : α) :
    (cobounded α).HasBasis (fun _ ↦ True) (fun r ↦ (closedBall c r)ᶜ)

{α : Type u}
[PseudoMetricSpace α]
(c : α)

(Bornology.cobounded α).HasBasis (fun x => True) fun r => (Metric.closedBall c r)ᶜ


/-- The tangent of an angle in a right-angled triangle multiplied by the adjacent side equals
the opposite side. -/
theorem tan_angle_mul_dist_of_angle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∠ p₁ p₂ p₃ = π / 2)
    (h0 : p₁ = p₂ ∨ p₃ ≠ p₂) : Real.tan (∠ p₂ p₃ p₁) * dist p₃ p₂ = dist p₁ p₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ∠ p₁ p₂ p₃ = π / 2)
(h0 : p₁ = p₂ ∨ p₃ ≠ p₂)


theorem finish_v (hr : u.r = 0) : u.finish.v = u.v


theorem unop_sup (S₁ S₂ : Subalgebra R Aᵐᵒᵖ) : (S₁ ⊔ S₂).unop = S₁.unop ⊔ S₂.unop

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S₁ S₂ : Subalgebra R Aᵐᵒᵖ)


protected theorem tsub_lt_self_iff (ha : AddLECancellable a) : a - b < a ↔ 0 < a ∧ 0 < b


theorem lintegral_eq_of_subset (f : α →ₛ ℝ≥0∞) {s : Finset ℝ≥0∞}
    (hs : ∀ x, f x ≠ 0 → μ (f ⁻¹' {f x}) ≠ 0 → f x ∈ s) :
    f.lintegral μ = ∑ x ∈ s, x * μ (f ⁻¹' {x})

(hs : ∀ (x : α), ↑f x ≠ 0 → μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s)

f.lintegral μ = ∑ x ∈ s, x * μ (↑f ⁻¹' {x})


@[to_additive]
lemma iIndepFun.indepFun_div_right (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hij : i ≠ j) (hik : i ≠ k) :
    IndepFun (f i) (f j / f k) κ μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.Kernel.iIndepFun (fun x => m) f κ μ)

ProbabilityTheory.Kernel.IndepFun (f i) (f j - f k) κ μ


@[simp]
protected theorem cast_refl {α : Type u} {r : α → α → Prop} (h₁ : α = α := rfl)
    (h₂ : HEq r r := HEq.rfl) : RelIso.cast h₁ h₂ = RelIso.refl r

{α : Type u}
{r : α → α → Prop}
(h₁ : α = α := ⋯)
(h₂ : HEq r r := ⋯)


theorem  _root_.DomMulAct.coe_smul_linearMap (a : S'ᵈᵐᵃ) (f : M →ₛₗ[σ₁₂] M₂) :
    (a • f : M →ₛₗ[σ₁₂] M₂) = a • (f : M → M₂)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{S' : Type u_17}
[Monoid S']
[DistribMulAction S' M]
[SMulCommClass R S' M]
(a : S'ᵈᵐᵃ)
(f : M →ₛₗ[σ₁₂] M₂)


theorem sub_one_add_one {a : Nat} (h : a ≠ 0) : a - 1 + 1 = a


@[simp]
theorem coe_fin_one (a : Fin 1) : (a : ℕ) = 0


@[simp] lemma arrowCongr_apply (e₁ : E ≃L[𝕜] F) (e₂ : H ≃L[𝕜] G) (f : E →L[𝕜] H) (x : F) :
    e₁.arrowCongr e₂ f x = e₂ (f (e₁.symm x))

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
{H : Type u_5}
[AddCommGroup E]
[AddCommGroup F]
[AddCommGroup G]
[AddCommGroup H]
[NontriviallyNormedField 𝕜]
[Module 𝕜 E]
[Module 𝕜 F]
[Module 𝕜 G]
[Module 𝕜 H]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalSpace G]
[TopologicalSpace H]
[TopologicalAddGroup G]
[TopologicalAddGroup H]
[ContinuousConstSMul 𝕜 G]
[ContinuousConstSMul 𝕜 H]
(e₁ : E ≃L[𝕜] F)
(e₂ : H ≃L[𝕜] G)
(f : E →L[𝕜] H)
(x : F)

((e₁.arrowCongr e₂) f) x = e₂ (f (e₁.symm x))


@[simp]
theorem ae_zero {_m0 : MeasurableSpace α} : ae (0 : Measure α) = ⊥

{α : Type u_1}
{_m0 : MeasurableSpace α}


theorem continuousAt_sign {θ : Angle} (h0 : θ ≠ 0) (hpi : θ ≠ π) : ContinuousAt sign θ

{θ : Real.Angle}
(h0 : θ ≠ 0)
(hpi : θ ≠ ↑π)


/-- In a weakly locally compact space,
convergence in the compact-open topology is the same as locally uniform convergence.

The right-to-left implication holds in any topological space,
see `ContinuousMap.tendsto_of_tendstoLocallyUniformly`. -/
theorem tendsto_iff_tendstoLocallyUniformly [WeaklyLocallyCompactSpace α] :
    Tendsto F p (𝓝 f) ↔ TendstoLocallyUniformly (fun i a => F i a) f p

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]
{f : C(α, β)}
{ι : Type u₃}
{p : Filter ι}
{F : ι → C(α, β)}
[WeaklyLocallyCompactSpace α]

Filter.Tendsto F p (𝓝 f) ↔ TendstoLocallyUniformly (fun i a => (F i) a) (⇑f) p


lemma mem_sInf {S : Set (TwoSidedIdeal R)} {x : R} :
    x ∈ sInf S ↔ ∀ I ∈ S, x ∈ I

(R : Type u_1)
[NonUnitalNonAssocRing R]
{S : Set (TwoSidedIdeal R)}
{x : R}


@[to_additive]
theorem map_map (g : N →* P) (f : G →* N) : (K.map f).map g = K.map (g.comp f)

{G : Type u_1}
[Group G]
(K : Subgroup G)
{N : Type u_5}
[Group N]
{P : Type u_6}
[Group P]
(g : N →* P)
(f : G →* N)

Subgroup.map g (Subgroup.map f K) = Subgroup.map (g.comp f) K


@[simp]
theorem pi_univ_Icc : (pi univ fun i ↦ Icc (x i) (y i)) = Icc x y

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
(x y : (i : ι) → α i)

(Set.univ.pi fun i => Set.Icc (x i) (y i)) = Set.Icc x y


theorem mem_support_ofFinset_iff (a : α) : a ∈ (ofFinset f s h h').support ↔ a ∈ s ∧ f a ≠ 0

{α : Type u_1}
{f : α → ENNReal}
{s : Finset α}
(h : ∑ a ∈ s, f a = 1)
(h' : ∀ a ∉ s, f a = 0)
(a : α)

a ∈ (PMF.ofFinset f s h h').support ↔ a ∈ s ∧ f a ≠ 0


@[simp]
theorem swap_obj_inr (X : D) : (swap C D).obj (inr X) = inl X

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

(CategoryTheory.Sum.swap C D).obj (Sum.inr X) = Sum.inl X


@[simp]
lemma toMvPolynomial_zero : (0 : Matrix m n R).toMvPolynomial = 0

{m : Type u_1}
{n : Type u_2}
{R : Type u_4}
[Fintype n]
[CommSemiring R]


@[to_additive (attr := simp 1100, nolint simpNF)]
theorem mem_map_iff_mem {f : F} (hf : Function.Injective f) {S : Submonoid M} {x : M} :
    f x ∈ S.map f ↔ x ∈ S

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}
(hf : Function.Injective ⇑f)
{S : Submonoid M}
{x : M}


@[to_additive]
theorem prod_range_mul {f : ℕ → M} {k : ℕ} (h : HasProd (fun n ↦ f (n + k)) m) :
    HasProd f ((∏ i ∈ range k, f i) * m)

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
{m : M}
[ContinuousMul M]
{f : ℕ → M}
{k : ℕ}
(h : HasProd (fun n => f (n + k)) m)

HasProd f ((∏ i ∈ Finset.range k, f i) * m)


@[to_additive (attr := simp 500)]
theorem isUnit_iff : IsUnit s ↔ ∃ a, s = {a} ∧ IsUnit a

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

IsAddUnit s ↔ ∃ a, s = {a} ∧ IsAddUnit a


@[to_additive]
lemma mul_prod_Ioc_eq_prod_Icc (h : a ≤ b) : f a * ∏ x ∈ Ioc a b, f x = ∏ x ∈ Icc a b, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[CommMonoid M]
{f : α → M}
{a b : α}
[LocallyFiniteOrder α]
(h : a ≤ b)

f a * ∏ x ∈ Finset.Ioc a b, f x = ∏ x ∈ Finset.Icc a b, f x


lemma reflGen_minimal {r' : α → α → Prop} (hr' : Reflexive r') (h : ∀ x y, r x y → r' x y) {x y : α}
    (hxy : ReflGen r x y) : r' x y

{α : Type u_1}
{r r' : α → α → Prop}
(hr' : Reflexive r')
(h : ∀ (x y : α), r x y → r' x y)
{x y : α}
(hxy : Relation.ReflGen r x y)


@[simp]
theorem toDual_covBy_toDual_iff : toDual b ⋖ toDual a ↔ a ⋖ b

OrderDual.toDual b ⋖ OrderDual.toDual a ↔ a ⋖ b


lemma Finite.of_surjOn {s : Set α} {t : Set β} (f : α → β) (hf : SurjOn f s t) (hs : s.Finite) :
    t.Finite

{α : Type u}
{β : Type v}
{s : Set α}
{t : Set β}
(f : α → β)
(hf : Set.SurjOn f s t)
(hs : s.Finite)


/-- If `ι` has a unique element, then `ι → X` is homeomorphic to `X`. -/
@[simps! (config := .asFn)]
def funUnique (ι X : Type*) [Unique ι] [TopologicalSpace X] : (ι → X) ≃ₜ X

(ι : Type u_6)
(X : Type u_7)
[Unique ι]
[TopologicalSpace X]

⇑(Homeomorph.funUnique ι X).symm = uniqueElim


theorem factors_of_factors_right {X Y Z : C} {P : Subobject Z} (f : X ⟶ Y) {g : Y ⟶ Z}
    (h : P.Factors g) : P.Factors (f ≫ g)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
{P : CategoryTheory.Subobject Z}
(f : X ⟶ Y)
{g : Y ⟶ Z}
(h : P.Factors g)


theorem eq_zero_of_mul_eq_zero_of_smul (P : R[X]) (h : ∀ r : R, r • P = 0 → r = 0) :
    ∀ (Q : R[X]), P * Q = 0 → Q = 0

{R : Type u}
[CommSemiring R]
(P : R[X])
(h : ∀ (r : R), r • P = 0 → r = 0)
(Q : R[X])


@[simp]
nonrec theorem comap_id (f : Ultrafilter α) (h₀ : Injective (id : α → α) := injective_id)
    (h₁ : range id ∈ f := (by rw [range_id]; exact univ_mem)) :
    f.comap h₀ h₁ = f

{α : Type u}
(f : Ultrafilter α)
(h₀ : Function.Injective id := ⋯)
(h₁ : Set.range id ∈ f := ⋯)


nonrec theorem _root_.DenseRange.exists_dist_lt {β : Type*} {f : β → α} (hf : DenseRange f) (x : α)
    {ε : ℝ} (hε : 0 < ε) : ∃ y, dist x (f y) < ε

{α : Type u}
[PseudoMetricSpace α]
{β : Type u_3}
{f : β → α}
(hf : DenseRange f)
(x : α)
{ε : ℝ}
(hε : 0 < ε)


theorem rank_eq [CommRing R] [Nontrivial R] :
    Module.rank R (FreeAlgebra R X) = Cardinal.lift.{u} (Cardinal.mk (List X))

(R : Type u)
(X : Type v)
[CommRing R]
[Nontrivial R]

Module.rank R (FreeAlgebra R X) = Cardinal.lift.{u, v} (Cardinal.mk (List X))


theorem liftOfRightInverse_comp (hf : Function.RightInverse f_inv f)
    (g : { g : A →+* C // RingHom.ker f ≤ RingHom.ker g }) :
    (f.liftOfRightInverse f_inv hf g).comp f = g

(g : { g // RingHom.ker f ≤ RingHom.ker g })

((f.liftOfRightInverse f_inv hf) g).comp f = ↑g


lemma mem_ae_iff_prob_eq_one (hs : MeasurableSet s) : s ∈ ae μ ↔ μ s = 1

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.IsProbabilityMeasure μ]
(hs : MeasurableSet s)


@[to_additive]
theorem prod_Ioi_zero {M : Type*} [CommMonoid M] {n : ℕ} {v : Fin n.succ → M} :
    ∏ i ∈ Ioi 0, v i = ∏ j : Fin n, v j.succ

{M : Type u_3}
[CommMonoid M]
{n : ℕ}
{v : Fin n.succ → M}

∏ i ∈ Finset.Ioi 0, v i = ∏ j : Fin n, v j.succ


@[to_additive]
theorem mul_iInter_subset (s : Set α) (t : ι → Set α) : (s * ⋂ i, t i) ⊆ ⋂ i, s * t i

{α : Type u_2}
{ι : Sort u_5}
[Add α]
(s : Set α)
(t : ι → Set α)


theorem subset_product [DecidableEq α] [DecidableEq β] {s : Finset (α × β)} :
    s ⊆ s.image Prod.fst ×ˢ s.image Prod.snd

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
{s : Finset (α × β)}

s ⊆ Finset.image Prod.fst s ×ˢ Finset.image Prod.snd s


@[to_additive of_add_neg]
theorem IsSubgroup.of_div (s : Set G) (one_mem : (1 : G) ∈ s)
    (div_mem : ∀ {a b : G}, a ∈ s → b ∈ s → a * b⁻¹ ∈ s) : IsSubgroup s