theorem mul_kstar_le_self : b * a ≤ b → b * a∗ ≤ b

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


@[to_additive (attr := simp)]
theorem MulHom.coe_mk [Mul M] [Mul N] (f : M → N) (hmul) : (MulHom.mk f hmul : M → N) = f

(hmul : ∀ (x y : M), f (x * y) = f x * f y)


/-- The equivalence from coalgebras for the product comonad to the over category. -/
@[simps]
def coalgebraEquivOver : Coalgebra (prodComonad X) ≌ Over X

(CategoryTheory.coalgebraEquivOver X).unitIso =
  CategoryTheory.NatIso.ofComponents
    (fun A =>
      CategoryTheory.Comonad.Coalgebra.isoMk
        (CategoryTheory.Iso.refl ((CategoryTheory.Functor.id (CategoryTheory.prodComonad X).Coalgebra).obj A).A) ⋯)
    ⋯


@[measurability]
theorem measurable_symm : Measurable symm


theorem div_eq_ediv : ∀ {a b : Int}, 0 ≤ a → 0 ≤ b → a.div b = a / b


{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{t : Finset α}


/-- Make an element of `rootsOfUnity` from a member of the base ring, and a proof that it has
a positive power equal to one. -/
@[simps! coe_val]
def rootsOfUnity.mkOfPowEq (ζ : M) {n : ℕ+} (h : ζ ^ (n : ℕ) = 1) : rootsOfUnity n M

{M : Type u_1}
[CommMonoid M]
(ζ : M)
{n : ℕ+}
(h : ζ ^ ↑n = 1)


theorem Ordering.Compares.cmp_eq [LinearOrder α] {a b : α} {o : Ordering} (h : o.Compares a b) :
    cmp a b = o

{α : Type u_1}
[LinearOrder α]
{a b : α}
{o : Ordering}
(h : o.Compares a b)


theorem inj_of_sep (P : Cᵒᵖ ⥤ D)
    (hsep :
      ∀ (X : C) (S : J.Cover X) (x y : P.obj (op X)),
        (∀ I : S.Arrow, P.map I.f.op x = P.map I.f.op y) → x = y)
    (X : C) : Function.Injective ((J.toPlus P).app (op X))

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.Category.{max v u, w} D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

(hsep :
  ∀ (X : C) (S : J.Cover X) (x y : (CategoryTheory.forget D).obj (P.obj (Opposite.op X))),
    (∀ (I : S.Arrow), (P.map I.f.op) x = (P.map I.f.op) y) → x = y)

Function.Injective ⇑((J.toPlus P).app (Opposite.op X))


theorem Int.associated_iff {a b : ℤ} : Associated a b ↔ a = b ∨ a = -b


@[simp]
theorem signAux_one (n : ℕ) : signAux (1 : Perm (Fin n)) = 1


theorem hasGroupoid_of_pregroupoid (PG : Pregroupoid H) (h : ∀ {e e' : PartialHomeomorph M H},
    e ∈ atlas H M → e' ∈ atlas H M → PG.property (e.symm ≫ₕ e') (e.symm ≫ₕ e').source) :
    HasGroupoid M PG.groupoid

(h :
  ∀ {e e' : PartialHomeomorph M H},
    e ∈ atlas H M → e' ∈ atlas H M → PG.property (↑(e.symm ≫ₕ e')) (e.symm ≫ₕ e').source)


theorem adjoin.range_algebraMap_subset : Set.range (algebraMap F E) ⊆ adjoin F S

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(S : Set E)

Set.range ⇑(algebraMap F E) ⊆ ↑(IntermediateField.adjoin F S)


@[simp]
theorem forall₂_reverse_iff {l₁ l₂} : Forall₂ R (reverse l₁) (reverse l₂) ↔ Forall₂ R l₁ l₂

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{l₁ : List α}
{l₂ : List β}

List.Forall₂ R l₁.reverse l₂.reverse ↔ List.Forall₂ R l₁ l₂


/-- A CHSH tuple in a *-monoid consists of 4 self-adjoint involutions `A₀ A₁ B₀ B₁` such that
the `Aᵢ` commute with the `Bⱼ`.

The physical interpretation is that `A₀` and `A₁` are a pair of boolean observables which
are spacelike separated from another pair `B₀` and `B₁` of boolean observables.
-/
--@[nolint has_nonempty_instance] Porting note(#5171): linter not ported yet
structure IsCHSHTuple {R} [Monoid R] [StarMul R] (A₀ A₁ B₀ B₁ : R) : Prop where
  A₀_inv : A₀ ^ 2 = 1
  A₁_inv : A₁ ^ 2 = 1
  B₀_inv : B₀ ^ 2 = 1
  B₁_inv : B₁ ^ 2 = 1
  A₀_sa : star A₀ = A₀
  A₁_sa : star A₁ = A₁
  B₀_sa : star B₀ = B₀
  B₁_sa : star B₁ = B₁
  A₀B₀_commutes : A₀ * B₀ = B₀ * A₀
  A₀B₁_commutes : A₀ * B₁ = B₁ * A₀
  A₁B₀_commutes : A₁ * B₀ = B₀ * A₁
  A₁B₁_commutes : A₁ * B₁ = B₁ * A₁

{R : Type u_1}
[Monoid R]
[StarMul R]
{A₀ A₁ B₀ B₁ : R}
(self : IsCHSHTuple A₀ A₁ B₀ B₁)


/-- A structure carrying a diagram of cocones over the functors `F.obj j`.
-/
structure DiagramOfCocones where
  /-- For each object, a cocone. -/
  obj : ∀ j : J, Cocone (F.obj j)
  /-- For each map, a map of cocones. -/
  map : ∀ {j j' : J} (f : j ⟶ j'), (obj j) ⟶ (Cocones.precompose (F.map f)).obj (obj j')
  id : ∀ j : J, (map (𝟙 j)).hom = 𝟙 _ := by aesop_cat
  comp : ∀ {j₁ j₂ j₃ : J} (f : j₁ ⟶ j₂) (g : j₂ ⟶ j₃),
    (map (f ≫ g)).hom = (map f).hom ≫ (map g).hom := by aesop_cat

(self : CategoryTheory.Limits.DiagramOfCocones F)

(self.map (f ≫ g)).hom = (self.map f).hom ≫ (self.map g).hom


theorem AntisymmRel.trans_covBy (hab : AntisymmRel (· ≤ ·) a b) (hbc : b ⋖ c) : a ⋖ c

(hab : AntisymmRel (fun x x_1 => x ≤ x_1) a b)


/-- Lift a `OneHom` to `Finset` via `image`. -/
@[to_additive (attr := simps) "Lift a `ZeroHom` to `Finset` via `image`"]
def imageOneHom [DecidableEq β] [One β] [FunLike F α β] [OneHomClass F α β] (f : F) :
    OneHom (Finset α) (Finset β)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[One α]
[DecidableEq β]
[One β]
[FunLike F α β]
[OneHomClass F α β]
(f : F)
(s : Finset α)

(Finset.imageOneHom f) s = Finset.image (⇑f) s


theorem nhdsWithin_extChartAt_target_eq (x : M) :
    𝓝[(extChartAt I x).target] (extChartAt I x) x = 𝓝[range I] (extChartAt I x) x

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
(x : M)

𝓝[(extChartAt I x).target] ↑(extChartAt I x) x = 𝓝[Set.range ↑I] ↑(extChartAt I x) x


theorem span_image [RingHomSurjective σ₁₂] (f : F) :
    span R₂ (f '' s) = map f (span R s)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[AddCommMonoid M₂]
[Module R₂ M₂]
{F : Type u_8}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
{s : Set M}
[RingHomSurjective σ₁₂]
(f : F)

Submodule.span R₂ (⇑f '' s) = Submodule.map f (Submodule.span R s)


/-- For a triangularizable Lie module in finite dimensions, the weight spaces span the entire space.

See also `LieModule.iSup_weightSpace_eq_top'`. -/
lemma iSup_weightSpace_eq_top [IsTriangularizable K L M] :
    ⨆ χ : L → K, weightSpace M χ = ⊤

(K : Type u_1)
(L : Type u_3)
(M : Type u_4)
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
[Field K]
[LieAlgebra K L]
[Module K M]
[LieModule K L M]
[LieAlgebra.IsNilpotent K L]
[FiniteDimensional K M]
[LieModule.IsTriangularizable K L M]


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

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

∀ {X Y : CategoryTheory.ComposableArrows Cᵒᵖ n} (f : X ⟶ Y),
  (CategoryTheory.ComposableArrows.opEquivalence C n).inverse.map f =
    (CategoryTheory.whiskerLeft (⋯.functor.comp (CategoryTheory.orderDualEquivalence (Fin (n + 1))).functor)
        (CategoryTheory.NatTrans.leftOp f)).op


/-- The monoidal functor from the endomorphisms of the single object
when we promote a monoidal category to a single object bicategory,
to the original monoidal category.

We subsequently show this is an equivalence.
-/
@[simps]
def endMonoidalStarFunctor : MonoidalFunctor (EndMonoidal (MonoidalSingleObj.star C)) C

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

∀ {X Y : CategoryTheory.EndMonoidal (CategoryTheory.MonoidalSingleObj.star C)} (f : X ⟶ Y),
  (CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctor C).map f = f


theorem perm_insert_swap (x y : α) (l : List α) :
    List.insert x (List.insert y l) ~ List.insert y (List.insert x l)

{α : Type u_1}
[DecidableEq α]
(x y : α)
(l : List α)


@[simp] lemma mulRingNorm_eq_padic_norm (p : ℕ) [Fact p.Prime] (r : ℚ) :
  mulRingNorm_padic p r = padicNorm p r

(Rat.MulRingNorm.mulRingNorm_padic p) r = ↑(padicNorm p r)


@[to_additive]
lemma prod_eq_pow_single [DecidableEq M] (a : M) (h : ∀ a', a' ≠ a → a' ∈ l → a' = 1) :
    l.prod = a ^ l.count a

(h : ∀ (a' : M), a' ≠ a → a' ∈ l → a' = 1)


/-- Harmonic series is not unconditionally summable. -/
theorem not_summable_natCast_inv : ¬Summable (fun n => n⁻¹ : ℕ → ℝ)


@[to_additive (attr := simp)]
theorem closure_range_inl_union_inr :
    Subgroup.closure (range (inl : G →* G ∗ H) ∪ range inr) = ⊤

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]

AddSubgroup.closure (Set.range ⇑AddMonoid.Coprod.inl ∪ Set.range ⇑AddMonoid.Coprod.inr) = ⊤


theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{n : ℕ}
{σ : Equiv.Perm α}

n ∈ σ.cycleType ↔ ∃ c τ, σ = c * τ ∧ c.Disjoint τ ∧ c.IsCycle ∧ c.support.card = n


theorem norm_le_norm_mul_left (x : ℤ[i]) {y : ℤ[i]} (hy : y ≠ 0) :
    (norm x).natAbs ≤ (norm (x * y)).natAbs

(Zsqrtd.norm x).natAbs ≤ (Zsqrtd.norm (x * y)).natAbs


theorem dvd_gcd_mul_iff_dvd_mul [GCDMonoid α] {m n k : α} : k ∣ gcd k m * n ↔ k ∣ m * n

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{m n k : α}


protected theorem lt_trichotomy (a b : Int) : a < b ∨ a = b ∨ b < a


@[to_additive]
theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M]
    (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1)
    (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1))
    (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M

(hmul : Filter.Tendsto (Function.uncurry fun x x_1 => x + x_1) (𝓝 0 ×ˢ 𝓝 0) (𝓝 0))

(hleft : ∀ (x₀ : M), 𝓝 x₀ = Filter.map (fun x => x₀ + x) (𝓝 0))

(hright : ∀ (x₀ : M), 𝓝 x₀ = Filter.map (fun x => x + x₀) (𝓝 0))


@[simp] lemma head_zero : vecHead (0 : Fin n.succ → α) = 0


@[to_additive le_mul_norm_sub]
theorem le_mul_norm_div {f : E → F} (hf : AntilipschitzWith K f) (x y : E) :
    ‖x / y‖ ≤ K * ‖f x / f y‖

{F : Type u_4}
[SeminormedCommGroup F]
{E : Type u_6}
[SeminormedCommGroup E]
{K : ℝ≥0}
{f : E → F}
(hf : AntilipschitzWith K f)
(x y : E)


theorem continuousLinearMapAt_symmL (e : Trivialization F (π F E)) [e.IsLinear R] {b : B}
    (hb : b ∈ e.baseSet) (y : F) : e.continuousLinearMapAt R b (e.symmL R b y) = y

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.continuousLinearMapAt R e b) ((Trivialization.symmL R e b) y) = y


theorem sSup_image' {s : Set β} {f : β → α} : sSup (f '' s) = ⨆ a : s, f a

{α : Type u_1}
{β : Type u_2}
[SupSet α]
{s : Set β}
{f : β → α}


@[to_additive (attr := simp)]
theorem dist_mul_self_left (a b : E) : dist (a * b) b = ‖a‖

{E : Type u_3}
[SeminormedGroup E]
(a b : E)


theorem exists_mem_ne_zero_of_rank_pos {s : Submodule R M} (h : 0 < Module.rank R s) :
    ∃ b : M, b ∈ s ∧ b ≠ 0

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
{s : Submodule R M}
(h : 0 < Module.rank R ↥s)


@[simp]
theorem vecAppend_apply_zero {α : Type*} {o : ℕ} (ho : o + 1 = m + 1 + n) (u : Fin (m + 1) → α)
    (v : Fin n → α) : vecAppend ho u v 0 = u 0

{m n : ℕ}
{α : Type u_4}
{o : ℕ}
(ho : o + 1 = m + 1 + n)
(u : Fin (m + 1) → α)
(v : Fin n → α)


@[local simp]
private theorem eq_0_of_lt_one (x : Nat) : x < 1 ↔ x = 0


@[to_additive (attr := simp)]
theorem map_apply_inl (f : M →* M') (g : N →* N') (x : M) : map f g (inl x) = inl (f x)

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass M']
[AddZeroClass N']
(f : M →+ M')
(g : N →+ N')
(x : M)

(AddMonoid.Coprod.map f g) (AddMonoid.Coprod.inl x) = AddMonoid.Coprod.inl (f x)


/-- `Finsupp.single a b` is injective in `b`. For the statement that it is injective in `a`, see
`Finsupp.single_left_injective` -/
theorem single_injective (a : α) : Function.Injective (single a : M → α →₀ M)

{α : Type u_1}
{M : Type u_5}
[Zero M]
(a : α)


theorem update_eq_sub_add_single [AddGroup G] (f : α →₀ G) (a : α) (b : G) :
    f.update a b = f - single a (f a) + single a b

{α : Type u_1}
{G : Type u_9}
[AddGroup G]
(f : α →₀ G)
(a : α)
(b : G)

f.update a b = f - Finsupp.single a (f a) + Finsupp.single a b


theorem IsLittleO.symm (h : (fun x => f₁ x - f₂ x) =o[l] g) : (fun x => f₂ x - f₁ x) =o[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}
(h : (fun x => f₁ x - f₂ x) =o[l] g)


theorem ofNat'_succ : ∀ {n}, ofNat' (n + 1) = ofNat' n + 1


nonrec theorem UniqueMDiffWithinAt.prod {x : M} {y : M'} {s t} (hs : UniqueMDiffWithinAt I s x)
    (ht : UniqueMDiffWithinAt I' t y) : UniqueMDiffWithinAt (I.prod I') (s ×ˢ t) (x, y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{x : M}
{y : M'}
{s : Set M}
{t : Set M'}
(hs : UniqueMDiffWithinAt I s x)
(ht : UniqueMDiffWithinAt I' t y)


(κ : ProbabilityTheory.Kernel α (β × Ω))

(κCond : ProbabilityTheory.Kernel (α × β) Ω)


theorem separable_prod' {ι : Sort _} {f : ι → R[X]} {s : Finset ι} :
    (∀ x ∈ s, ∀ y ∈ s, x ≠ y → IsCoprime (f x) (f y)) →
      (∀ x ∈ s, (f x).Separable) → (∏ x ∈ s, f x).Separable

{R : Type u}
[CommRing R]
{ι : Type u_1}
{f : ι → R[X]}
{s : Finset ι}


theorem zero_right : v ⟂ᵥ (0 : VectorMeasure α N)

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[TopologicalSpace M]
[AddCommMonoid N]
[TopologicalSpace N]
{v : MeasureTheory.VectorMeasure α M}


nonrec theorem HasStrictDerivAt.smul (hc : HasStrictDerivAt c c' x) (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : 𝕜 → 𝕜'}
{c' : 𝕜'}
(hc : HasStrictDerivAt c c' x)
(hf : HasStrictDerivAt f f' x)


theorem IsVanKampenColimit.mapCocone_iff (G : C ⥤ D) {F : J ⥤ C} {c : Cocone F}
    [G.IsEquivalence] : IsVanKampenColimit (G.mapCocone c) ↔ IsVanKampenColimit c

{J : Type v'}
[CategoryTheory.Category.{u', v'} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_2} D]
(G : CategoryTheory.Functor C D)
{F : CategoryTheory.Functor J C}
{c : CategoryTheory.Limits.Cocone F}
[G.IsEquivalence]

CategoryTheory.IsVanKampenColimit (G.mapCocone c) ↔ CategoryTheory.IsVanKampenColimit c


@[simp, reassoc]
lemma comp_f {R R' R'' : Φ.RightResolution X₂} (φ : R ⟶ R') (ψ : R' ⟶ R'') :
    (φ ≫ ψ).f = φ.f ≫ ψ.f

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}

(CategoryTheory.CategoryStruct.comp φ ψ).f = CategoryTheory.CategoryStruct.comp φ.f ψ.f


@[to_additive (attr := simp)] theorem fst_comp_inl : (fst : M ∗ N →* M).comp inl = .id _

{M : Type u_1}
{N : Type u_2}
[AddMonoid M]
[AddMonoid N]

AddMonoid.Coprod.fst.comp AddMonoid.Coprod.inl = AddMonoidHom.id M


theorem inf_semanticallyEquivalent_not_sup_not :
    T.SemanticallyEquivalent (φ ⊓ ψ) (φ.not ⊔ ψ.not).not

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
(φ ψ : L.BoundedFormula α n)

T.SemanticallyEquivalent (φ ⊓ ψ) ∼(∼φ ⊔ ∼ψ)


@[to_additive (attr := simp, norm_cast)]
theorem coe_mul (s t : Finset α) : (↑(s * t) : Set α) = ↑s * ↑t

{α : Type u_2}
[DecidableEq α]
[Add α]
(s t : Finset α)


/-- The identity functor on `C`, viewed as a functor from `C` to its monoidal opposite. -/
@[simps obj map] -- need to specify `obj, map` or else we generate `mopFunctor_obj_unmop`
def mopFunctor : C ⥤ Cᴹᵒᵖ

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

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.mopFunctor C).map f = f.mop


@[simp]
theorem continuousWithinAt_Ioo_iff_Ioi (h : a < b) :
    ContinuousWithinAt f (Ioo a b) a ↔ ContinuousWithinAt f (Ioi a) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
[TopologicalSpace β]
{a b : α}
{f : α → β}
(h : a < b)

ContinuousWithinAt f (Set.Ioo a b) a ↔ ContinuousWithinAt f (Set.Ioi a) a


@[simp]
theorem coe_one : ↑(1 : GL n R) = (1 : Matrix n n R)

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]


theorem one_CNF {o : Ordinal} (ho : o ≠ 0) : CNF 1 o = [⟨0, o⟩]


@[simp]
theorem map_zero [Nonempty ι] : f 0 = 0

{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)
[Nonempty ι]


@[simp]
theorem coe_compTendsto (f : α → β) {lc : Filter γ} {g : γ → α} (hg : Tendsto g lc l) :
    (f : Germ l β).compTendsto g hg = f ∘ g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
(f : α → β)
{lc : Filter γ}
{g : γ → α}
(hg : Filter.Tendsto g lc l)


theorem val_le_one_iff (v : Valuation K Γ₀) {x : K} (h : x ≠ 0) : v x ≤ 1 ↔ 1 ≤ v x⁻¹

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation K Γ₀)
{x : K}
(h : x ≠ 0)


protected lemma EventuallyEq.iUnion [Finite ι] {s t : ι → Set α}
    (h : ∀ i, s i =ᶠ[l] t i) : (⋃ i, s i) =ᶠ[l] ⋃ i, t i

{α : Type u}
{ι : Sort x}
{l : Filter α}
[Finite ι]
{s t : ι → Set α}
(h : ∀ (i : ι), s i =ᶠ[l] t i)


/-- A *-subalgebra is a subalgebra of a *-algebra which is closed under *. -/
structure StarSubalgebra (R : Type u) (A : Type v) [CommSemiring R] [StarRing R] [Semiring A]
  [StarRing A] [Algebra R A] [StarModule R A] extends Subalgebra R A : Type v where
  /-- The `carrier` is closed under the `star` operation. -/
  star_mem' {a} : a ∈ carrier → star a ∈ carrier

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(self : StarSubalgebra R A)
{a : A}

a ∈ self.carrier → star a ∈ self.carrier


theorem L1.integral_eq_integral (f : α →₁[μ] E) : L1.integral f = ∫ a, f a ∂μ

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[hE : CompleteSpace E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : ↥(MeasureTheory.Lp E 1 μ))

MeasureTheory.L1.integral f = ∫ (a : α), ↑↑f a ∂μ


theorem add_apply [∀ i, AddZeroClass (β i)] (g₁ g₂ : Π₀ i, β i) (i : ι) :
    (g₁ + g₂) i = g₁ i + g₂ i

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddZeroClass (β i)]
(g₁ g₂ : Π₀ (i : ι), β i)
(i : ι)


@[to_additive]
theorem singleton_div_ball_one : {x} / ball 1 δ = ball x δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x : E)


@[simp] theorem not_eq_not : ∀ {a b : Bool}, ¬a = !b ↔ a = b


/-- The braiding isomorphism `X ⊗ Y ≅ Y ⊗ X` in `Dial C`. -/
@[simps!] def braiding (X Y : Dial C) : tensorObj X Y ≅ tensorObj Y X

(X.braiding Y).inv.F =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd)
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst)


protected theorem Periodic.const_smul₀ [AddCommMonoid α] [DivisionSemiring γ] [Module γ α]
    (h : Periodic f c) (a : γ) : Periodic (fun x => f (a • x)) (a⁻¹ • c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[AddCommMonoid α]
[DivisionSemiring γ]
[Module γ α]
(h : Function.Periodic f c)
(a : γ)

Function.Periodic (fun x => f (a • x)) (a⁻¹ • c)


/-- The same-universe version of `Field.lift_insepDegree_eq_of_equiv`. -/
theorem insepDegree_eq_of_equiv (K : Type v) [Field K] [Algebra F K] (i : E ≃ₐ[F] K) :
    insepDegree F E = insepDegree F K

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

Field.insepDegree F E = Field.insepDegree F K


@[simp, norm_cast]
theorem coe_max [LinearOrder α] (x y : α) : (↑(max x y) : WithTop α) = max (x : WithTop α) y

{α : Type u_1}
[LinearOrder α]
(x y : α)


lemma lex_iff : Prod.Lex r s x y ↔ r x.1 y.1 ∨ x.1 = y.1 ∧ s x.2 y.2

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{x y : α × β}


theorem DifferentiableAt.fderiv_prod (hf₁ : DifferentiableAt 𝕜 f₁ x)
    (hf₂ : DifferentiableAt 𝕜 f₂ x) :
    fderiv 𝕜 (fun x : E => (f₁ x, f₂ x)) x = (fderiv 𝕜 f₁ x).prod (fderiv 𝕜 f₂ x)

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

fderiv 𝕜 (fun x => (f₁ x, f₂ x)) x = (fderiv 𝕜 f₁ x).prod (fderiv 𝕜 f₂ x)


@[simp]
theorem Matrix.lieConj_symm_apply (P A : Matrix n n R) (h : Invertible P) :
    (P.lieConj h).symm A = P⁻¹ * A * P

{R : Type u}
[CommRing R]
{n : Type w}
[DecidableEq n]
[Fintype n]
(P A : Matrix n n R)
(h : Invertible P)


theorem top_eq [IsWellOrder γ t] (e : r ≃r s) (f : r ≺i t) (g : s ≺i t) : f.top = g.top

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
[IsWellOrder γ t]
(e : r ≃r s)
(f : r ≺i t)
(g : s ≺i t)


theorem IsLowerSet.bot_mem (hs : IsLowerSet s) : ⊥ ∈ s ↔ s.Nonempty

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


/-- Part of proving $A_5$ is simple. Shows that the square of any element of $A_5$ with a 3-cycle in
  its cycle decomposition is a 3-cycle, so the normal closure of the original element must be
  $A_5$. -/
theorem isThreeCycle_sq_of_three_mem_cycleType_five {g : Perm (Fin 5)} (h : 3 ∈ cycleType g) :
    IsThreeCycle (g * g)

{g : Equiv.Perm (Fin 5)}
(h : 3 ∈ g.cycleType)


theorem ne_or_eq {α : Sort*} (x y : α) : x ≠ y ∨ x = y


theorem isNilpotent_iterate_newtonMap_sub_of_isNilpotent (h : IsNilpotent <| aeval x P) (n : ℕ) :
    IsNilpotent <| P.newtonMap^[n] x - x

(h : IsNilpotent ((Polynomial.aeval x) P))


@[simp]
theorem ofFractionRing_eq :
    (ofFractionRing : FractionRing K[X] → RatFunc K) = IsLocalization.algEquiv K[X]⁰ _ _

RatFunc.ofFractionRing = ⇑(IsLocalization.algEquiv K[X]⁰ (FractionRing K[X]) (RatFunc K))


theorem epi_of_cokernel_zero {X Y : C} {f : X ⟶ Y} [HasColimit (parallelPair f 0)]
    (w : cokernel.π f = 0) : Epi f

[CategoryTheory.Limits.HasColimit (CategoryTheory.Limits.parallelPair f 0)]

(w : CategoryTheory.Limits.cokernel.π f = 0)


/-- A function to a pseudo-metric-space is `1`-Lipschitz if and only if points in the same cylinder
of length `n` are sent to points within distance `(1/2)^n`.
Not expressed using `LipschitzWith` as we don't have a metric space structure -/
theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type*}
    [PseudoMetricSpace α] {f : (∀ n, E n) → α} :
    (∀ x y : ∀ n, E n, dist (f x) (f y) ≤ dist x y) ↔
      ∀ x y n, y ∈ cylinder x n → dist (f x) (f y) ≤ (1 / 2) ^ n

{E : ℕ → Type u_1}
{α : Type u_2}
[PseudoMetricSpace α]
{f : ((n : ℕ) → E n) → α}

(∀ (x y : (n : ℕ) → E n), dist (f x) (f y) ≤ dist x y) ↔
  ∀ (x y : (n : ℕ) → E n) (n : ℕ), y ∈ PiNat.cylinder x n → dist (f x) (f y) ≤ (1 / 2) ^ n


theorem IsLittleO.const_mul_right {g : α → 𝕜} {c : 𝕜} (hc : c ≠ 0) (h : f =o[l] g) :
    f =o[l] fun x => c * g x

{α : Type u_1}
{E : Type u_3}
{𝕜 : Type u_15}
[Norm E]
[NormedDivisionRing 𝕜]
{f : α → E}
{l : Filter α}
{g : α → 𝕜}
{c : 𝕜}
(hc : c ≠ 0)
(h : f =o[l] g)


@[simp]
theorem mem_toSubring (s : Subfield K) (x : K) : x ∈ s.toSubring ↔ x ∈ s

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


@[simp]
theorem smul_single_apply (i : ℕ) (f : R[X]) (m : M) (n : ℕ) :
    (f • single R i m) n = ite (i ≤ n) (f.coeff (n - i) • m) 0

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(i : ℕ)
(f : R[X])
(m : M)
(n : ℕ)

(f • (PolynomialModule.single R i) m) n = if i ≤ n then f.coeff (n - i) • m else 0


theorem balanced_iff_smul_mem : Balanced 𝕜 s ↔ ∀ ⦃a : 𝕜⦄, ‖a‖ ≤ 1 → ∀ ⦃x : E⦄, x ∈ s → a • x ∈ s

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
{s : Set E}


@[to_additive]
theorem one_rel (y : S) : r S 1 (y, y)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
(y : ↥S)


/-- A binary function is integrable if the function `x ↦ f (x, y)` is integrable for almost every
  `y` and the function `y ↦ ∫ ‖f (x, y)‖ dx` is integrable. -/
theorem integrable_prod_iff' [SFinite μ] ⦃f : α × β → E⦄
    (h1f : AEStronglyMeasurable f (μ.prod ν)) :
    Integrable f (μ.prod ν) ↔
      (∀ᵐ y ∂ν, Integrable (fun x => f (x, y)) μ) ∧ Integrable (fun y => ∫ x, ‖f (x, y)‖ ∂μ) ν

⦃f : α × β → E⦄

(h1f : MeasureTheory.AEStronglyMeasurable f (μ.prod ν))

MeasureTheory.Integrable f (μ.prod ν) ↔
  (∀ᵐ (y : β) ∂ν, MeasureTheory.Integrable (fun x => f (x, y)) μ) ∧
    MeasureTheory.Integrable (fun y => ∫ (x : α), ‖f (x, y)‖ ∂μ) ν


/-- For 0 < x ≤ 1 we have x - x ^ 3 / 4 < sin x.

This is also true for x > 1, but it's nontrivial for x just above 1. This inequality is not
tight; the tighter inequality is sin x > x - x ^ 3 / 6 for all x > 0, but this inequality has
a simpler proof. -/
theorem sin_gt_sub_cube {x : ℝ} (h : 0 < x) (h' : x ≤ 1) : x - x ^ 3 / 4 < sin x


@[to_additive]
theorem pairwise_disjoint_Ico_zpow :
    Pairwise (Disjoint on fun n : ℤ => Ico (b ^ n) (b ^ (n + 1)))

{α : Type u_1}
[OrderedCommGroup α]
(b : α)

Pairwise (Disjoint on fun n => Set.Ico (b ^ n) (b ^ (n + 1)))


@[simp]
theorem id_app (F : C ⥤ D) (X : C) : (𝟙 F : F ⟶ F).app X = 𝟙 (F.obj X)

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

(CategoryTheory.CategoryStruct.id F).app X = CategoryTheory.CategoryStruct.id (F.obj X)


theorem erase_union_of_mem (ha : a ∈ t) (s : Finset α) : s.erase a ∪ t = s ∪ t

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


/-- Write the iterated derivative as the composition of a continuous linear equiv and the iterated
Fréchet derivative -/
theorem iteratedDerivWithin_eq_equiv_comp : iteratedDerivWithin n f s =
    (ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F).symm ∘ iteratedFDerivWithin 𝕜 n f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{s : Set 𝕜}

iteratedDerivWithin n f s = ⇑(ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F).symm ∘ iteratedFDerivWithin 𝕜 n f s


@[to_additive add_neg_le_add_neg_iff]
theorem mul_inv_le_mul_inv_iff' : a * b⁻¹ ≤ c * d⁻¹ ↔ a * d ≤ c * b

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


@[simp]
theorem coe_smul {R} [Semiring R] [SMul R K] [Module R L] [IsScalarTower R K L] (r : R) (x : S) :
    ↑(r • x : S) = (r • (x : L))

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{R : Type u_4}
[Semiring R]
[SMul R K]
[Module R L]
[IsScalarTower R K L]
(r : R)
(x : ↥S)


lemma ne_update_self_iff : f ≠ update f a b ↔ f a ≠ b

{α : Sort u}
{β : α → Sort v}
[DecidableEq α]
{f : (a : α) → β a}
{a : α}
{b : β a}


@[to_additive Icc_add_Icc_subset]
theorem Icc_mul_Icc_subset' [LocallyFiniteOrder α] (a b c d : α) :
    Icc a b * Icc c d ⊆ Icc (a * c) (b * d)

[CovariantClass α α (Function.swap HAdd.hAdd) LE.le]

Finset.Icc a b + Finset.Icc c d ⊆ Finset.Icc (a + c) (b + d)


theorem le_iff_derivFamily (H : ∀ i, IsNormal (f i)) {a} :
    (∀ i, f i a ≤ a) ↔ ∃ o, derivFamily.{u, v} f o = a

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

(∀ (i : ι), f i a ≤ a) ↔ ∃ o, Ordinal.derivFamily f o = a


theorem Ioi_mem_nhds (h : a < b) : Ioi a ∈ 𝓝 b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b : α}
(h : a < b)


@[simp]
theorem top_adj : (⊤ : Subgraph G).Adj a b ↔ G.Adj a b

{V : Type u}
{G : SimpleGraph V}
{a b : V}


@[simp]
theorem sheafifyMap_id (P : Cᵒᵖ ⥤ D) : J.sheafifyMap (𝟙 P) = 𝟙 (J.sheafify P)

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w} D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

J.sheafifyMap (CategoryTheory.CategoryStruct.id P) = CategoryTheory.CategoryStruct.id (J.sheafify P)


@[simp]
theorem lof_apply (i : ι) (b : M i) : ((lof R ι M i) b) i = b

(R : Type u)
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
(i : ι)
(b : M i)


@[gcongr]
theorem iSup_mono (h : ∀ i, f i ≤ g i) : iSup f ≤ iSup g

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{f g : ι → α}
(h : ∀ (i : ι), f i ≤ g i)


/-- If the second of three points is weakly between the other two, the oriented angle at the
third point is zero. -/
theorem _root_.Wbtw.oangle₂₃₁_eq_zero {p₁ p₂ p₃ : P} (h : Wbtw ℝ p₁ p₂ p₃) : ∡ p₂ p₃ p₁ = 0

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


theorem le_innerContent (K : Compacts G) (U : Opens G) (h2 : (K : Set G) ⊆ U) :
    μ K ≤ μ.innerContent U

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
(K : TopologicalSpace.Compacts G)
(U : TopologicalSpace.Opens G)
(h2 : ↑K ⊆ ↑U)

(fun s => ↑(μ.toFun s)) K ≤ μ.innerContent U


@[to_additive succ_nsmul]
theorem pow_succ (a : M) (n : ℕ) : a ^ (n + 1) = a ^ n * a

{M : Type u_2}
[Monoid M]
(a : M)
(n : ℕ)


/-- A finite measure `μ` on `α ⧸ G` satisfying `QuotientMeasureEqMeasurePreimage` has finite
covolume. -/
@[to_additive]
theorem QuotientMeasureEqMeasurePreimage.covolume_ne_top
    (μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] [IsFiniteMeasure μ] :
    covolume G α ν < ∞

[MeasureTheory.SMulInvariantMeasure G α ν]

(μ : MeasureTheory.Measure (Quotient (MulAction.orbitRel G α)))


@[to_additive lipschitzWith_one_nnnorm]
theorem lipschitzWith_one_nnnorm' : LipschitzWith 1 (NNNorm.nnnorm : E → ℝ≥0)


@[simp]
theorem isSymm_neg {B : BilinForm R₁ M₁} : (-B).IsSymm ↔ B.IsSymm

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B : LinearMap.BilinForm R₁ M₁}


theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset

{α : Type u_1}
[DecidableEq α]
(l : List α)


lemma prod_apply (s : Set (α × β)) (s_mble : MeasurableSet s) :
    μ.prod ν s = ENNReal.toNNReal (∫⁻ x, ν.toMeasure (Prod.mk x ⁻¹' s) ∂μ)

(μ : MeasureTheory.ProbabilityMeasure α)

(ν : MeasureTheory.ProbabilityMeasure β)

(μ.prod ν) s = (∫⁻ (x : α), ↑ν (Prod.mk x ⁻¹' s) ∂↑μ).toNNReal


@[csimp] theorem enumFrom_eq_enumFromTR : @enumFrom = @enumFromTR


theorem permutations_append (is ts : List α) :
    permutations (is ++ ts) = (permutations is).map (· ++ ts) ++ permutationsAux ts is.reverse

(is ++ ts).permutations = List.map (fun x => x ++ ts) is.permutations ++ ts.permutationsAux is.reverse


theorem tsub_mul (a b c : α) : (a - b) * c = a * c - b * c

[ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[simp, rclike_simps]
theorem ofRealCLM_norm : ‖(ofRealCLM : ℝ →L[ℝ] K)‖ = 1


lemma defaultRatCDF_le_one (q : ℚ) : defaultRatCDF q ≤ 1


@[to_additive]
theorem prod_eq_mul {f : α → M} (a b : α) (h₁ : a ≠ b) (h₂ : ∀ x, x ≠ a ∧ x ≠ b → f x = 1) :
    ∏ x, f x = f a * f b

(h₂ : ∀ (x : α), x ≠ a ∧ x ≠ b → f x = 0)


theorem Perm.nodup_iff {l₁ l₂ : List α} : l₁ ~ l₂ → (Nodup l₁ ↔ Nodup l₂)


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

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


theorem valuation_ker_eq :
    valuation.ker = K⟮(∅ : Set <| HeightOneSpectrum R),n⟯.subgroupOf (K⟮S,n⟯)

{S : Set (IsDedekindDomain.HeightOneSpectrum R)}

IsDedekindDomain.selmerGroup.valuation.ker = IsDedekindDomain.selmerGroup.subgroupOf IsDedekindDomain.selmerGroup


/-- If matrix A is right invertible, then its inverse equals its right inverse. -/
theorem inv_eq_right_inv (h : A * B = 1) : A⁻¹ = B

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B : Matrix n n α}
(h : A * B = 1)


/-- Duplicate of `Eq.subset'`, which currently has elaboration problems. -/
theorem Eq.subset {α} {s t : Set α} : s = t → s ⊆ t


lemma measure_stieltjesOfMeasurableRat_univ (hf : Measurable f) (a : α) :
    (stieltjesOfMeasurableRat f hf a).measure univ = 1

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℚ → ℝ}
(hf : Measurable f)
(a : α)

(ProbabilityTheory.stieltjesOfMeasurableRat f hf a).measure Set.univ = 1


@[to_additive]
theorem op_sup (S₁ S₂ : Subgroup G) : (S₁ ⊔ S₂).op = S₁.op ⊔ S₂.op

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


@[simp] theorem toReal_nonneg {a : ℝ≥0∞} : 0 ≤ a.toReal


theorem setToL1SCLM_congr_left' (hT : DominatedFinMeasAdditive μ T C)
    (hT' : DominatedFinMeasAdditive μ T' C') (h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s)
    (f : α →₁ₛ[μ] E) : setToL1SCLM α E μ hT f = setToL1SCLM α E μ hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(h : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T s = T' s)

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

(MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT) f = (MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT') f


/-- The canonical linear map from the kernel of an algebra homomorphism to its localization
is localizing. -/
lemma AlgHom.toKerIsLocalization_isLocalizedModule (f : A →ₐ[R] B) :
    IsLocalizedModule (Algebra.algebraMapSubmonoid A M)
      (AlgHom.toKerIsLocalization M Rₚ Aₚ Bₚ f)

[IsLocalization (Algebra.algebraMapSubmonoid A M) Aₚ]

[IsLocalization (Algebra.algebraMapSubmonoid B M) Bₚ]


lemma countablePartitionSet_eq_iff {n : ℕ} (a : α) {s : Set α} (hs : s ∈ countablePartition α n) :
    countablePartitionSet n a = s ↔ a ∈ s

[h : MeasurableSpace.CountablyGenerated α]

(hs : s ∈ MeasurableSpace.countablePartition α n)

MeasurableSpace.countablePartitionSet n a = s ↔ a ∈ s


theorem pow_smul_le (i j : ℕ) : I ^ i • F.N j ≤ F.N (i + j)

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
(F : I.Filtration M)
(i j : ℕ)


/-- Calculate the integral of `(g ∘ f)`, where `g : β → ℝ≥0∞` and `f : α →ₛ β`.  -/
theorem map_lintegral (g : β → ℝ≥0∞) (f : α →ₛ β) :
    (f.map g).lintegral μ = ∑ x ∈ f.range, g x * μ (f ⁻¹' {x})

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(g : β → ℝ≥0∞)
(f : MeasureTheory.SimpleFunc α β)

(MeasureTheory.SimpleFunc.map g f).lintegral μ = ∑ x ∈ f.range, g x * μ (↑f ⁻¹' {x})


/-- When `D` is a monoidal category,
comonoid objects in `C ⥤ D` are the same thing
as functors from `C` into the comonoid objects of `D`.
-/
@[simps]
def comonFunctorCategoryEquivalence : Comon_ (C ⥤ D) ≌ C ⥤ Comon_ D

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

(CategoryTheory.Monoidal.comonFunctorCategoryEquivalence C D).counitIso =
  CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.counitIso


@[simp]
theorem toNat_manyOneReducible {p : Set α} : toNat p ≤₀ p

{α : Type u}
[Primcodable α]
[Inhabited α]
{p : Set α}


/-- An auxiliary definition to be used in defining `CategoryTheory.Sheaf.adjunction` below. -/
@[simps]
def composeEquiv [HasSheafCompose J F] (adj : G ⊣ F) (X : Sheaf J E) (Y : Sheaf J D) :
    ((composeAndSheafify J G).obj X ⟶ Y) ≃ (X ⟶ (sheafCompose J F).obj Y)

(J : CategoryTheory.GrothendieckTopology C)

(η : (CategoryTheory.Sheaf.composeAndSheafify J G).obj X ⟶ Y)

((CategoryTheory.Sheaf.composeEquiv J adj X Y) η).val =
  ((CategoryTheory.Adjunction.whiskerRight Cᵒᵖ adj).homEquiv X.val Y.val)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.toSheafify J (((CategoryTheory.whiskeringRight Cᵒᵖ E D).obj G).obj X.val)) η.val)


theorem sup_le_iff {ι : Type u} {f : ι → Ordinal.{max u v}} {a} : sup.{_, v} f ≤ a ↔ ∀ i, f i ≤ a

{ι : Type u}
{f : ι → Ordinal.{max u v}}
{a : Ordinal.{max u v}}


theorem dist_le_iff_of_nonempty [Nonempty α] : dist f g ≤ C ↔ ∀ x, dist (f x) (g x) ≤ C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}
{C : ℝ}
[Nonempty α]

dist f g ≤ C ↔ ∀ (x : α), dist (f x) (g x) ≤ C


theorem MDifferentiableWithinAt.prod_mk {f : M → M'} {g : M → M''}
    (hf : MDifferentiableWithinAt I I' f s x) (hg : MDifferentiableWithinAt I I'' g s x) :
    MDifferentiableWithinAt I (I'.prod I'') (fun x => (f x, g x)) s x


@[simp]
theorem abs_exp (x : ℝ) : |exp x| = exp x


/-- If `s` is a set in an extended metric space `X` with second countable topology and `f : X → Y`
is Lipschitz in a neighborhood within `s` of every point `x ∈ s`, then the Hausdorff dimension of
the image `f '' s` is at most the Hausdorff dimension of `s`. -/
theorem dimH_image_le_of_locally_lipschitzOn [SecondCountableTopology X] {f : X → Y} {s : Set X}
    (hf : ∀ x ∈ s, ∃ C : ℝ≥0, ∃ t ∈ 𝓝[s] x, LipschitzOnWith C f t) : dimH (f '' s) ≤ dimH s

(hf : ∀ x ∈ s, ∃ C, ∃ t ∈ 𝓝[s] x, LipschitzOnWith C f t)


/-- Rectangles form a π-system. -/
theorem isPiSystem_prod :
    IsPiSystem (image2 (· ×ˢ ·) { s : Set α | MeasurableSet s } { t : Set β | MeasurableSet t })

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]

IsPiSystem (Set.image2 (fun x x_1 => x ×ˢ x_1) {s | MeasurableSet s} {t | MeasurableSet t})


/-- This is the Beck fork. It is a split equalizer, in particular a equalizer. -/
@[simps! pt]
def beckFork : Fork (T.map X.a) (T.δ.app _)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T : CategoryTheory.Comonad C}
(X : T.Coalgebra)

(CategoryTheory.Comonad.beckFork X).pt = X.A


@[simp] lemma greatestFib_lt : greatestFib m < n ↔ m < fib n


theorem Decidable.or_congr_left' [Decidable c] (h : ¬c → (a ↔ b)) : a ∨ c ↔ b ∨ c

{c a b : Prop}
[Decidable c]
(h : ¬c → (a ↔ b))


theorem fold_min_lt : s.fold min b f < c ↔ b < c ∨ ∃ x ∈ s, f x < c

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{b : β}
{s : Finset α}
[LinearOrder β]
(c : β)

Finset.fold min b f s < c ↔ b < c ∨ ∃ x ∈ s, f x < c


theorem one_lt_pow_iff_of_nonneg (ha : 0 ≤ a) (hn : n ≠ 0) : 1 < a ^ n ↔ 1 < a

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
(ha : 0 ≤ a)
(hn : n ≠ 0)


@[simp]
theorem replicate_succ (val : α) :
    replicate (n+1) val = val ::ᵥ (replicate n val)

Mathlib.Vector.replicate (n + 1) val = val ::ᵥ Mathlib.Vector.replicate n val


@[to_additive]
-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it.
theorem pure_mul_pure : (pure a : Filter α) * pure b = pure (a * b)


@[to_additive]
theorem hasProd_le_of_prod_le (hf : HasProd f a) (h : ∀ s, ∏ i ∈ s, f i ≤ a₂) : a ≤ a₂

(h : ∀ (s : Finset ι), ∑ i ∈ s, f i ≤ a₂)


/--
A category has all countable limits if every functor `J ⥤ C` with a `CountableCategory J`
instance and `J : Type` has a limit.
-/
class HasCountableLimits : Prop where
  /-- `C` has all limits over any type `J` whose objects and morphisms lie in the same universe
  and which has countably many objects and morphisms-/
  out (J : Type) [SmallCategory J] [CountableCategory J] : HasLimitsOfShape J C

[self : CategoryTheory.Limits.HasCountableLimits C]


@[simp]
theorem some_get {a : Part α} (ha : a.Dom) : Part.some (Part.get a ha) = a

{α : Type u_1}
{a : Part α}
(ha : a.Dom)


/-- Constructor for `ComposableArrows C 1`. -/
@[simps]
def mk₁ {X₀ X₁ : C} (f : X₀ ⟶ X₁) : ComposableArrows C 1

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X₀ X₁ : C}
(f : X₀ ⟶ X₁)

∀ (a : Fin 2), (CategoryTheory.ComposableArrows.mk₁ f).obj a = CategoryTheory.ComposableArrows.Mk₁.obj X₀ X₁ a


/-- By definition, if `f` is invertible then `inverse f = f.symm`. -/
@[simp]
theorem inverse_equiv (e : M ≃L[R] M₂) : inverse (e : M →L[R] M₂) = e.symm

{R : Type u_1}
{M : Type u_2}
{M₂ : Type u_3}
[TopologicalSpace M]
[TopologicalSpace M₂]
[Semiring R]
[AddCommMonoid M₂]
[Module R M₂]
[AddCommMonoid M]
[Module R M]
(e : M ≃L[R] M₂)


/-- Given `I : S.Arrow` and a morphism `g : Z ⟶ I.Y`, this is the arrow in `S.Arrow`
corresponding to `g ≫ I.f`. -/
@[simps]
def Arrow.precomp {S : J.Cover X} (I : S.Arrow) {Z : C} (g : Z ⟶ I.Y) : S.Arrow

{J : CategoryTheory.GrothendieckTopology C}


theorem _root_.dfinsupp_sumAddHom_mem [∀ i, AddZeroClass (β i)] [AddCommMonoid γ] {S : Type*}
    [SetLike S γ] [AddSubmonoidClass S γ] (s : S) (f : Π₀ i, β i) (g : ∀ i, β i →+ γ)
    (h : ∀ c, f c ≠ 0 → g c (f c) ∈ s) : DFinsupp.sumAddHom g f ∈ s

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


theorem SatisfiesM_anyM [Monad m] [LawfulMonad m] (p : α → m Bool) (as : Array α) (start stop)
    (hstart : start ≤ min stop as.size) (tru : Prop) (fal : Nat → Prop) (h0 : fal start)
    (hp : ∀ i : Fin as.size, i.1 < stop → fal i.1 →
      SatisfiesM (bif · then tru else fal (i + 1)) (p as[i])) :
    SatisfiesM
      (fun res => bif res then tru else fal (min stop as.size))
      (anyM p as start stop)

(hp : ∀ (i : Fin as.size), ↑i < stop → fal ↑i → SatisfiesM (fun x => bif x then tru else fal (↑i + 1)) (p as[i]))

SatisfiesM (fun res => bif res then tru else fal (min stop as.size)) (Array.anyM p as start stop)


theorem HasDerivWithinAt.cos (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun x => Real.cos (f x)) (-Real.sin (f x) * f') s x

{f : ℝ → ℝ}
{f' x : ℝ}
{s : Set ℝ}
(hf : HasDerivWithinAt f f' s x)


@[simp] lemma IsLowerSet.disjoint_upperClosure_right (hs : IsLowerSet s) :
    Disjoint s (upperClosure t) ↔ Disjoint s t

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

Disjoint s ↑(upperClosure t) ↔ Disjoint s t


@[to_additive]
theorem comap_injective_isCommutative {f : G' →* G} (hf : Injective f) [H.IsCommutative] :
    (H.comap f).IsCommutative

{G : Type u_1}
{G' : Type u_2}
[AddGroup G]
[AddGroup G']
(H : AddSubgroup G)
{f : G' →+ G}
(hf : Function.Injective ⇑f)
[H.IsCommutative]


/-- Corresponds to `swap_dist`. -/
theorem swap_hammingDist : swap (@hammingDist _ β _ _) = hammingDist

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]


lemma extensiveTopology.surjective_of_isLocallySurjective_sheafOfTypes [FinitaryPreExtensive C]
    {F G : Cᵒᵖ ⥤ Type w} (f : F ⟶ G) [PreservesFiniteProducts F] [PreservesFiniteProducts G]
      (h : Presheaf.IsLocallySurjective (extensiveTopology C) f) {X : C} :
        Function.Surjective (f.app (op X))

(h : CategoryTheory.Presheaf.IsLocallySurjective (CategoryTheory.extensiveTopology C) f)

Function.Surjective (f.app (Opposite.op X))


theorem Raised.add_right (k) {n m} (H : Raised n m) : Raised (n + k) (m + k)

(k : ℕ)
{n m : ℕ}
(H : Ordnode.Raised n m)


/-- See `not_isPredLimit_iff` for a version that states that `a` is a successor of a value other
than itself. -/
theorem mem_range_pred_of_not_isPredLimit (h : ¬IsPredLimit a) : a ∈ range (@pred α _ _)

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
{a : α}
(h : ¬Order.IsPredLimit a)


@[simp]
lemma rightHomologyMap_comp [HasRightHomology S₁] [HasRightHomology S₂] [HasRightHomology S₃]
    (φ₁ : S₁ ⟶ S₂) (φ₂ : S₂ ⟶ S₃) :
    rightHomologyMap (φ₁ ≫ φ₂) = rightHomologyMap φ₁ ≫ rightHomologyMap φ₂

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁ : S₁ ⟶ S₂)

(φ₂ : S₂ ⟶ S₃)

CategoryTheory.ShortComplex.rightHomologyMap (CategoryTheory.CategoryStruct.comp φ₁ φ₂) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.rightHomologyMap φ₁)
    (CategoryTheory.ShortComplex.rightHomologyMap φ₂)


theorem map₂_le {f : M →ₗ[R] N →ₗ[R] P} {p : Submodule R M} {q : Submodule R N}
    {r : Submodule R P} : map₂ f p q ≤ r ↔ ∀ m ∈ p, ∀ n ∈ q, f m n ∈ r

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N →ₗ[R] P}
{p : Submodule R M}
{q : Submodule R N}
{r : Submodule R P}

Submodule.map₂ f p q ≤ r ↔ ∀ m ∈ p, ∀ n ∈ q, (f m) n ∈ r


/-- In a semigroup, the product of left-regular elements is left-regular. -/
@[to_additive "In an additive semigroup, the sum of add-left-regular elements is add-left.regular."]
theorem IsLeftRegular.mul (lra : IsLeftRegular a) (lrb : IsLeftRegular b) : IsLeftRegular (a * b)

{R : Type u_1}
[Semigroup R]
{a b : R}
(lra : IsLeftRegular a)
(lrb : IsLeftRegular b)


@[elab_as_elim]
theorem induction_on (x : PerfectClosure K p) {q : PerfectClosure K p → Prop}
    (h : ∀ x, q (mk K p x)) : q x

(h : ∀ (x : ℕ × K), q (PerfectClosure.mk K p x))


@[simp] theorem run_bind_lift [Monad m] [LawfulMonad m] (x : m α) (f : α → ExceptT ε m β) : run (ExceptT.lift x >>= f : ExceptT ε m β) = x >>= fun a => run (f a)

{m : Type u_1 → Type u_2}
{α ε β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : m α)
(f : α → ExceptT ε m β)

(ExceptT.lift x >>= f).run = do
  let a ← x
  (f a).run


theorem seq_lt_seq_of_lt_of_le (hf : Monotone f) (n : ℕ) (h₀ : x 0 < y 0)
    (hx : ∀ k < n, x (k + 1) < f (x k)) (hy : ∀ k < n, f (y k) ≤ y (k + 1)) : x n < y n

(hy : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1))


/-- Build an isomorphism in the category `MagmaCat` from a `MulEquiv` between `Mul`s. -/
@[to_additive (attr := simps)
      "Build an isomorphism in the category `AddMagmaCat` from an `AddEquiv` between `Add`s."]
def MulEquiv.toMagmaCatIso (e : X ≃* Y) : MagmaCat.of X ≅ MagmaCat.of Y

{X Y : Type u}
[Mul X]
[Mul Y]
(e : X ≃* Y)

∀ (a : Y), e.toMagmaCatIso.inv a = e.symm.toFun a


theorem swap_orElse (o₁ o₂) : (orElse o₁ o₂).swap = orElse o₁.swap o₂.swap

(o₁.orElse o₂).swap = o₁.swap.orElse o₂.swap


protected theorem mul_le_mul {n₁ m₁ n₂ m₂ : Nat} (h₁ : n₁ ≤ n₂) (h₂ : m₁ ≤ m₂) : n₁ * m₁ ≤ n₂ * m₂


theorem ball_eq_ball (ε : ℝ) (x : α) :
    UniformSpace.ball x { p | dist p.2 p.1 < ε } = Metric.ball x ε

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

UniformSpace.ball x {p | dist p.2 p.1 < ε} = Metric.ball x ε


lemma cfcₙ_smul_id {S : Type*} [SMulZeroClass S R] [ContinuousConstSMul S R]
    [SMulZeroClass S A] [IsScalarTower S R A] [IsScalarTower S R (R → R)]
    (s : S) (a : A) (ha : p a := by cfc_tac) : cfcₙ (s • · : R → R) a = s • a


theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i)

(hb : ∀ (i : ι), TopologicalSpace.IsTopologicalBasis (b i))

TopologicalSpace.IsTopologicalBasis (⋃ i, Set.image Subtype.val '' b i)


theorem gauge_lt_eq' (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ (r : ℝ) (_ : 0 < r) (_ : r < a), r • s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(absorbs : Absorbent ℝ s)
(a : ℝ)

{x | gauge s x < a} = ⋃ r, ⋃ (_ : 0 < r), ⋃ (_ : r < a), r • s


/-- Implementation of `ShrinkHoms.equivalence`. -/
@[simps]
noncomputable def functor : C ⥤ ShrinkHoms C

[CategoryTheory.LocallySmall.{w, v, u} C]

(CategoryTheory.ShrinkHoms.functor C).obj X = CategoryTheory.ShrinkHoms.toShrinkHoms X


@[to_additive]
theorem period_dvd_orderOf (m : M) (a : α) : period m a ∣ orderOf m

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


@[simp]
theorem succ_bot : succ (⊥ : WithBot α) = ↑(⊥ : α)

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


theorem mul_self_inj [PosMulStrictMono α] [MulPosMono α]
    {a b : α} (h1 : 0 ≤ a) (h2 : 0 ≤ b) : a * a = b * b ↔ a = b

{α : Type u}
[Semiring α]
[LinearOrder α]
[PosMulStrictMono α]
[MulPosMono α]
{a b : α}
(h1 : 0 ≤ a)
(h2 : 0 ≤ b)


theorem snd_image_prod {s : Set α} (hs : s.Nonempty) (t : Set β) : Prod.snd '' s ×ˢ t = t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
(hs : s.Nonempty)
(t : Set β)


@[simp]
theorem Tape.move_left_nth {Γ} [Inhabited Γ] :
    ∀ (T : Tape Γ) (i : ℤ), (T.move Dir.left).nth i = T.nth (i - 1)

{Γ : Type u_1}
[Inhabited Γ]
(T : Turing.Tape Γ)
(i : ℤ)

(Turing.Tape.move Turing.Dir.left T).nth i = T.nth (i - 1)


theorem div_tendsto_atBot_of_degree_gt (hdeg : Q.degree < P.degree) (hQ : Q ≠ 0)
    (hnps : P.leadingCoeff / Q.leadingCoeff ≤ 0) :
    Tendsto (fun x => eval x P / eval x Q) atTop atBot

Filter.Tendsto (fun x => Polynomial.eval x P / Polynomial.eval x Q) Filter.atTop Filter.atBot


a → b ↔ ¬a ∨ b


@[simp]
theorem lift_le_ofNat_iff {a : Cardinal.{u}} {n : ℕ} [n.AtLeastTwo] :
    lift.{v} a ≤ (no_index (OfNat.ofNat n)) ↔ a ≤ OfNat.ofNat n

Cardinal.lift.{v, u} a ≤ OfNat.ofNat n ↔ a ≤ OfNat.ofNat n


/-- A point lies in an affine subspace constructed from another point and a direction if and only
if their difference is in that direction. -/
theorem mem_mk'_iff_vsub_mem {p₁ p₂ : P} {direction : Submodule k V} :
    p₂ ∈ mk' p₁ direction ↔ p₂ -ᵥ p₁ ∈ direction

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ : P}
{direction : Submodule k V}

p₂ ∈ AffineSubspace.mk' p₁ direction ↔ p₂ -ᵥ p₁ ∈ direction


theorem Valid'.of_lt {t : Ordnode α} {x : α} {o₁ o₂} (H : Valid' o₁ t o₂) (h₁ : Bounded nil o₁ x)
    (h₂ : All (· < x) t) : Valid' o₁ t x

(h₂ : Ordnode.All (fun x_1 => x_1 < x) t)


/-- A module whose scalars are additively torsion is additively torsion. -/
theorem IsTorsion.module_of_torsion [Semiring R] [Module R M] (tR : IsTorsion R) : IsTorsion M

(R : Type u_3)
(M : Type u_4)
[AddCommMonoid M]
[Semiring R]
[Module R M]
(tR : AddMonoid.IsTorsion R)


@[to_additive] theorem inducing_mk : Inducing (@mk M)


@[to_additive]
theorem codisjoint_subgroupOf_sup (H K : Subgroup G) :
    Codisjoint (H.subgroupOf (H ⊔ K)) (K.subgroupOf (H ⊔ K))

{G : Type u_1}
[Group G]
(H K : Subgroup G)


@[ext]
theorem ext_ring {f g : R →ₑ+[σ] N'} (h : f 1 = g 1) : f = g

{R : Type u_11}
[Semiring R]
{S : Type u_13}
[Semiring S]
{N' : Type u_16}
[AddMonoid N']
[DistribMulAction S N']
{σ : R →* S}
{f g : R →ₑ+[σ] N'}
(h : f 1 = g 1)


theorem radical_sup : radical (I ⊔ J) = radical (radical I ⊔ radical J)

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

(I ⊔ J).radical = (I.radical ⊔ J.radical).radical


/-- `n.descFactorial k = n! / (n - k)!` but without ℕ-division. See `Nat.descFactorial_eq_div`
for the version using ℕ-division. -/
theorem factorial_mul_descFactorial : ∀ {n k : ℕ}, k ≤ n → (n - k)! * n.descFactorial k = n !

k ≤ n → (n - k).factorial * n.descFactorial k = n.factorial


theorem prod_multiset_root_eq_finset_root [DecidableEq R] :
    (p.roots.map fun a => X - C a).prod =
      p.roots.toFinset.prod fun a => (X - C a) ^ rootMultiplicity a p

{R : Type u}
[CommRing R]
[IsDomain R]
{p : Polynomial R}
[DecidableEq R]

(Multiset.map (fun a => Polynomial.X - Polynomial.C a) p.roots).prod =
  ∏ a ∈ p.roots.toFinset, (Polynomial.X - Polynomial.C a) ^ Polynomial.rootMultiplicity a p


/-- Uniform integrability is preserved by restriction of the functions to a set. -/
protected theorem indicator (hf : UnifIntegrable f p μ) (E : Set α) :
    UnifIntegrable (fun i => E.indicator (f i)) p μ

{f : ι → α → β}

(hf : MeasureTheory.UnifIntegrable f p μ)

MeasureTheory.UnifIntegrable (fun i => E.indicator (f i)) p μ


theorem IsLindeof.compl_mem_coclosedLindelof_of_isClosed (hs : IsLindelof s) (hs' : IsClosed s) :
    sᶜ ∈ Filter.coclosedLindelof X

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsLindelof s)
(hs' : IsClosed s)


/-- Any finite-dimensional vector space over a locally compact field is proper.
We do not register this as an instance to avoid an instance loop when trying to prove the
properness of `𝕜`, and the search for `𝕜` as an unknown metavariable. Declare the instance
explicitly when needed. -/
theorem FiniteDimensional.proper [FiniteDimensional 𝕜 E] : ProperSpace E

(𝕜 : Type u)
[NontriviallyNormedField 𝕜]
(E : Type v)
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[LocallyCompactSpace 𝕜]
[FiniteDimensional 𝕜 E]


/--
Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of
`T₂`.
-/
@[simps]
def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra T₁ ⥤ Algebra T₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
(h : T₂ ⟶ T₁)
(A : T₁.Algebra)

((CategoryTheory.Monad.algebraFunctorOfMonadHom h).obj A).a = CategoryTheory.CategoryStruct.comp (h.app A.A) A.a


@[simp]
theorem image2_subset_iff {u : Set γ} : image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u

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

Set.image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u


@[simp]
theorem natCast_shiftRight (n s : Nat) : (n : Int) >>> s = n >>> s


@[simp]
theorem toList_inj {p q : Path a b} : p.toList = q.toList ↔ p = q

{V : Type u}
[Quiver V]
{a b : V}
[∀ (a b : V), Subsingleton (a ⟶ b)]
{p q : Quiver.Path a b}


@[ext]
theorem ext : ∀ {s t : AList β}, s.entries = t.entries → s = t

{α : Type u}
{β : α → Type v}
{s t : AList β}


@[to_additive]
theorem prod_univ_six [CommMonoid β] (f : Fin 6 → β) :
    ∏ i, f i = f 0 * f 1 * f 2 * f 3 * f 4 * f 5

{β : Type u_2}
[CommMonoid β]
(f : Fin 6 → β)


theorem toNat_add {a b : Int} (ha : 0 ≤ a) (hb : 0 ≤ b) : (a + b).toNat = a.toNat + b.toNat


theorem StrictConvexOn.comp (hg : StrictConvexOn 𝕜 (f '' s) g) (hf : StrictConvexOn 𝕜 s f)
    (hg' : StrictMonoOn g (f '' s)) (hf' : s.InjOn f) : StrictConvexOn 𝕜 s (g ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{α : Type u_4}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 α]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
{g : β → α}
(hg : StrictConvexOn 𝕜 (f '' s) g)
(hf : StrictConvexOn 𝕜 s f)
(hg' : StrictMonoOn g (f '' s))
(hf' : Set.InjOn f s)


@[simp] theorem foldr_zero (f : Fin 0 → α → α) (x) :
    foldr 0 f x = x

{α : Sort u_1}
(f : Fin 0 → α → α)
(x : α)


/-- A natural transformation between functors induces a natural transformation
between those functors applied to homological complexes.
-/
@[simps]
def NatTrans.mapHomologicalComplex {F G : W₁ ⥤ W₂}
    [F.PreservesZeroMorphisms] [G.PreservesZeroMorphisms] (α : F ⟶ G)
    (c : ComplexShape ι) : F.mapHomologicalComplex c ⟶ G.mapHomologicalComplex c

((CategoryTheory.NatTrans.mapHomologicalComplex α c).app C).f i = α.app (C.X i)


theorem isFibAux_two_mul_add_one_done {n a b n' a' : ℕ} (H : IsFibAux n a b)
    (hn : 2 * n + 1 = n') (h : a * a + b * b = a') : fib n' = a'

(H : Mathlib.Meta.NormNum.IsFibAux n a b)


/-- The definition of `Cospherical`. -/
theorem cospherical_def (ps : Set P) :
    Cospherical ps ↔ ∃ (center : P) (radius : ℝ), ∀ p ∈ ps, dist p center = radius

{P : Type u_2}
[MetricSpace P]
(ps : Set P)

EuclideanGeometry.Cospherical ps ↔ ∃ center radius, ∀ p ∈ ps, dist p center = radius


@[to_additive]
theorem prod_set :
    ∀ (L : List M) (n : ℕ) (a : M),
      (L.set n a).prod =
        ((L.take n).prod * if n < L.length then a else 1) * (L.drop (n + 1)).prod

{M : Type u_4}
[Monoid M]
(L : List M)
(n : ℕ)
(a : M)

(L.set n a).prod = ((List.take n L).prod * if n < L.length then a else 1) * (List.drop (n + 1) L).prod


theorem mem_coe {a : α} {o : Option α} : a ∈ (o : Part α) ↔ a ∈ o

a ∈ ↑o ↔ a ∈ o


@[simp]
theorem cospanExt_inv_app_right :
    (cospanExt iX iY iZ wf wg).inv.app WalkingCospan.right = iY.inv

{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).inv.app CategoryTheory.Limits.WalkingCospan.right = iY.inv


lemma isInt_emod {a b q m a' : ℤ} {b' r : ℕ}
    (ha : IsInt a a') (hb : IsNat b b')
    (hm : q * b' = m) (h : r + m = a') (h₂ : Nat.blt r b' = true) :
    IsNat (a % b) r

{a b q m a' : ℤ}
{b' r : ℕ}
(ha : Mathlib.Meta.NormNum.IsInt a a')
(hb : Mathlib.Meta.NormNum.IsNat b b')
(hm : q * ↑b' = m)
(h : ↑r + m = a')
(h₂ : r.blt b' = true)


@[to_additive]
theorem norm_prod_le_of_le (s : Finset ι) {f : ι → E} {n : ι → ℝ} (h : ∀ b ∈ s, ‖f b‖ ≤ n b) :
    ‖∏ b ∈ s, f b‖ ≤ ∑ b ∈ s, n b

{ι : Type u_4}
{E : Type u_6}
[SeminormedAddCommGroup E]
(s : Finset ι)
{f : ι → E}
{n : ι → ℝ}
(h : ∀ b ∈ s, ‖f b‖ ≤ n b)


protected theorem IsOpen.connectedComponentIn [LocallyConnectedSpace α] {F : Set α} {x : α}
    (hF : IsOpen F) : IsOpen (connectedComponentIn F x)

{α : Type u}
[TopologicalSpace α]
[LocallyConnectedSpace α]
{F : Set α}
{x : α}
(hF : IsOpen F)


/-- Given a natural transformation `α : F.rightOp ⟶ G.rightOp`, for `F G : Cᵒᵖ ⥤ D`,
taking `unop` of each component gives a natural transformation `G ⟶ F`.
-/
@[simps]
protected def removeRightOp (α : F.rightOp ⟶ G.rightOp) : G ⟶ F

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

(CategoryTheory.NatTrans.removeRightOp α).app X = (α.app (Opposite.unop X)).unop


theorem inf_induction {p : α → Prop} (ht : p ⊤) (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊓ a₂))
    (hs : ∀ b ∈ s, p (f b)) : p (s.inf f)

(hp : ∀ (a₁ : α), p a₁ → ∀ (a₂ : α), p a₂ → p (a₁ ⊓ a₂))


theorem map_ne_zero [Nontrivial R] (hI : I ≠ 0) : I.map h ≠ 0

{R : Type u_1}
[CommRing R]
{K : Type u_3}
{K' : Type u_4}
[Field K]
[Field K']
[Algebra R K]
[IsFractionRing R K]
[Algebra R K']
[IsFractionRing R K']
{I : FractionalIdeal R⁰ K}
(h : K →ₐ[R] K')
[Nontrivial R]
(hI : I ≠ 0)


lemma isLittleO_deriv_one_sub_smoothingFn :
    deriv (fun x => 1 - ε x) =o[atTop] fun (x : ℝ) => x⁻¹

(deriv fun x => 1 - AkraBazziRecurrence.smoothingFn x) =o[Filter.atTop] fun x => x⁻¹


@[nolint synTaut]
theorem evalWhiskerRight_nil (α : f ⟶ g) (h : C) :
    α ▷ h = α ▷ h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{f g : C}
(α : f ⟶ g)
(h : C)

CategoryTheory.MonoidalCategory.whiskerRight α h = CategoryTheory.MonoidalCategory.whiskerRight α h


theorem mulMap_range : LinearMap.range (mulMap M N) = M * N

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


@[to_additive (attr := simp)]
theorem noncommProd_empty (f : α → β) (h) : noncommProd (∅ : Finset α) f h = 1

(h : (↑∅).Pairwise fun a b => Commute (f a) (f b))


/-- The uniqueness part of the universal property of `𝕎 R`. -/
theorem lift_unique (g : S →+* 𝕎 R) (g_compat : ∀ k, (WittVector.truncate k).comp g = f k) :
    lift _ f_compat = g

{f : (k : ℕ) → S →+* TruncatedWittVector p k R}

(f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), (TruncatedWittVector.truncate hk).comp (f k₂) = f k₁)

(g_compat : ∀ (k : ℕ), (WittVector.truncate k).comp g = f k)


@[simp]
theorem support_eq_empty : p.support = ∅ ↔ p = 0


theorem card_eq_of_linearEquiv {α β : Type*} [Fintype α] [Fintype β] (f : (α → R) ≃ₗ[R] β → R) :
    Fintype.card α = Fintype.card β

(R : Type u)
[Semiring R]
[InvariantBasisNumber R]
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : (α → R) ≃ₗ[R] β → R)


@[simp, norm_cast]
theorem ofReal_pow (r : ℝ) (n : ℕ) : ((r ^ n : ℝ) : ℂ) = (r : ℂ) ^ n


lemma hasRightDerivedFunctor_iff_of_iso :
    HasRightDerivedFunctor F W ↔ HasRightDerivedFunctor F' W

{C : Type u_1}
{H : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} H]
{F F' : CategoryTheory.Functor C H}
(e : F ≅ F')
(W : CategoryTheory.MorphismProperty C)

F.HasRightDerivedFunctor W ↔ F'.HasRightDerivedFunctor W


theorem AeStronglyMeasurable.stronglyMeasurableAtFilter_of_mem {s}
    (h : AEStronglyMeasurable f (μ.restrict s)) (hl : s ∈ l) : StronglyMeasurableAtFilter f l μ

(h : MeasureTheory.AEStronglyMeasurable f (μ.restrict s))


theorem projIci_eq_self : projIci a x = ⟨a, le_rfl⟩ ↔ x ≤ a

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


theorem ContinuousOn.preimage_isClopen_of_isClopen {f : X → Y} {s : Set X} {t : Set Y}
    (hf : ContinuousOn f s) (hs : IsClopen s) (ht : IsClopen t) : IsClopen (s ∩ f ⁻¹' t)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{s : Set X}
{t : Set Y}
(hf : ContinuousOn f s)
(hs : IsClopen s)
(ht : IsClopen t)


@[simp]
theorem eventually_or_distrib_right {f : Filter α} {p : α → Prop} {q : Prop} :
    (∀ᶠ x in f, p x ∨ q) ↔ (∀ᶠ x in f, p x) ∨ q

{α : Type u}
{f : Filter α}
{p : α → Prop}
{q : Prop}

(∀ᶠ (x : α) in f, p x ∨ q) ↔ (∀ᶠ (x : α) in f, p x) ∨ q


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

{ι : Type u}
(s : Finset ι)
{p : ℝ}
(hp : 1 ≤ p)
(w f : ι → ℝ≥0∞)


theorem isLUB_ciSup [Nonempty ι] {f : ι → α} (H : BddAbove (range f)) :
    IsLUB (range f) (⨆ i, f i)

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[Nonempty ι]
{f : ι → α}
(H : BddAbove (Set.range f))


theorem sub_conj (z : ℂ) : z - conj z = (2 * z.im : ℝ) * I

z - (starRingEnd ℂ) z = ↑(2 * z.im) * Complex.I


/-- An angle in a right-angled triangle expressed using `arctan`, where one side is a multiple
of a rotation of another by `π / 2`, version subtracting vectors. -/
theorem oangle_sub_left_smul_rotation_pi_div_two {x : V} (h : x ≠ 0) (r : ℝ) :
    o.oangle (x - r • o.rotation (π / 2 : ℝ) x) x = Real.arctan r

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

o.oangle (x - r • (o.rotation ↑(π / 2)) x) x = ↑(Real.arctan r)


theorem stoppedValue_lowerCrossingTime (h : lowerCrossingTime a b f N n ω ≠ N) :
    stoppedValue f (lowerCrossingTime a b f N n) ω ≤ a

{f : ℕ → Ω → ℝ}

(h : MeasureTheory.lowerCrossingTime a b f N n ω ≠ N)

MeasureTheory.stoppedValue f (MeasureTheory.lowerCrossingTime a b f N n) ω ≤ a


theorem condexp_stronglyMeasurable_mul_of_bound (hm : m ≤ m0) [IsFiniteMeasure μ] {f g : α → ℝ}
    (hf : StronglyMeasurable[m] f) (hg : Integrable g μ) (c : ℝ) (hf_bound : ∀ᵐ x ∂μ, ‖f x‖ ≤ c) :
    μ[f * g|m] =ᵐ[μ] f * μ[g|m]

(hf : MeasureTheory.StronglyMeasurable f)


/-- An element of `s` that is not an element of `erase s a` must be`a`. -/
theorem eq_of_mem_of_not_mem_erase (hs : b ∈ s) (hsa : b ∉ s.erase a) : b = a

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a b : α}
(hs : b ∈ s)
(hsa : b ∉ s.erase a)


theorem uniformContinuousOn_iff [PseudoMetricSpace β] {f : α → β} {s : Set α} :
    UniformContinuousOn f s ↔
      ∀ ε > 0, ∃ δ > 0, ∀ x ∈ s, ∀ y ∈ s, dist x y < δ → dist (f x) (f y) < ε

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
{s : Set α}


theorem iSup_le_succ (u : ℕ → α) (n : ℕ) : ⨆ k ≤ n + 1, u k = (⨆ k ≤ n, u k) ⊔ u (n + 1)

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


@[mono]
theorem vsub_subset_vsub : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ -ᵥ t₁ ⊆ s₂ -ᵥ t₂

{α : Type u_2}
{β : Type u_3}
[VSub α β]
[DecidableEq α]
{s₁ s₂ t₁ t₂ : Finset β}

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ -ᵥ t₁ ⊆ s₂ -ᵥ t₂


theorem expSeries_hasSum_exp (x : 𝔸) : HasSum (fun n => expSeries 𝕂 𝔸 n fun _ => x) (exp 𝕂 x)

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

HasSum (fun n => (NormedSpace.expSeries 𝕂 𝔸 n) fun x_1 => x) (NormedSpace.exp 𝕂 x)


@[to_additive]
theorem mul_lt_of_lt_one_of_lt [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c : α} (ha : a < 1)
    (hb : b < c) :
    a * b < c

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


@[simp]
lemma comp_eqToHom_lift_iff {R S : 𝒮} {a' a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) (h : a' = a) :
    p.IsHomLift f (eqToHom h ≫ φ) ↔ p.IsHomLift f φ

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

p.IsHomLift f (CategoryTheory.eqToHom h ≫ φ) ↔ p.IsHomLift f φ


theorem normSq_sub (z w : ℂ) : normSq (z - w) = normSq z + normSq w - 2 * (z * conj w).re

Complex.normSq (z - w) = Complex.normSq z + Complex.normSq w - 2 * (z * (starRingEnd ℂ) w).re


/-- The derivative of `log ∘ f` is the logarithmic derivative provided `f` is differentiable and
we are on the slitPlane. -/
lemma Complex.deriv_log_comp_eq_logDeriv {f : ℂ → ℂ} {x : ℂ} (h₁ : DifferentiableAt ℂ f x)
    (h₂ : f x ∈ Complex.slitPlane) : deriv (Complex.log ∘ f) x = logDeriv f x


theorem exists_prime_mul_pow_lt_factorial [LinearOrderedRing K] [FloorRing K] (n : ℕ) (a c : K) :
    ∃ p > n, p.Prime ∧ a * c ^ p < (p - 1)!

{K : Type u_1}
[LinearOrderedRing K]
[FloorRing K]
(n : ℕ)
(a c : K)

∃ p > n, Nat.Prime p ∧ a * c ^ p < ↑(p - 1).factorial


/-- 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 : S.obj X), (CategoryTheory.equivYoneda S hs).hom.app X a = (CategoryTheory.evalEquiv S hs (Opposite.unop X)) a


/-- [Stacks: Lemma 0052 (3)](https://stacks.math.columbia.edu/tag/0052) -/
theorem NoetherianSpace.exists_open_ne_empty_le_irreducibleComponent [NoetherianSpace α]
    (Z : Set α) (H : Z ∈ irreducibleComponents α) :
    ∃ o : Set α, IsOpen o ∧ o ≠ ∅ ∧ o ≤ Z

{α : Type u_1}
[TopologicalSpace α]
[TopologicalSpace.NoetherianSpace α]
(Z : Set α)
(H : Z ∈ irreducibleComponents α)


theorem leftLim_eq_of_eq_bot [hα : TopologicalSpace α] [h'α : OrderTopology α] (f : α → β) {a : α}
    (h : 𝓝[<] a = ⊥) : leftLim f a = f a

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace β]
[hα : TopologicalSpace α]
[h'α : OrderTopology α]
(f : α → β)
{a : α}
(h : 𝓝[<] a = ⊥)


@[simp]
theorem Multiset.toEmbedding_coeEquiv_trans (m : Multiset α) :
    m.coeEquiv.toEmbedding.trans (Function.Embedding.subtype _) = m.coeEmbedding

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

m.coeEquiv.toEmbedding.trans (Function.Embedding.subtype fun x => x ∈ m.toEnumFinset) = m.coeEmbedding


theorem ne_iff_lt_or_gt {i j : Fin n} : i ≠ j ↔ i < j ∨ i > j


theorem smul_univ₀ [Fintype β] {s : Finset α} (hs : ¬s ⊆ 0) : s • (univ : Finset β) = univ

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[GroupWithZero α]
[MulAction α β]
[Fintype β]
{s : Finset α}
(hs : ¬s ⊆ 0)


@[to_additive (attr := simp)]
theorem top_mul_top : (⊤ : Filter α) * ⊤ = ⊤


theorem sub_inv_antitoneOn_Ioi :
    AntitoneOn (fun x ↦ (x-c)⁻¹) (Set.Ioi c)

{α : Type u_2}
[LinearOrderedField α]
{c : α}

AntitoneOn (fun x => (x - c)⁻¹) (Set.Ioi c)


theorem sep_univ : { x ∈ (univ : Set α) | p x } = { x | p x }


protected theorem compl_iInf (f : ι → LowerSet α) : (⨅ i, f i).compl = ⨅ i, (f i).compl

{α : Type u_1}
{ι : Sort u_4}
[LE α]
(f : ι → LowerSet α)


lemma pow_dvd_pow_of_sub_pow_eq_zero (hp : n + m ≤ p + 1) (h_comm : Commute x y)
    (h : (x - y) ^ n = 0) : x ^ m ∣ y ^ p

{R : Type u_1}
{x y : R}
{n m p : ℕ}
[Ring R]
(hp : n + m ≤ p + 1)
(h_comm : Commute x y)
(h : (x - y) ^ n = 0)


theorem P_corec (i : X) (n : ℕ) : Agree (sCorec f i n) (sCorec f i (succ n))

{F : PFunctor.{u}}
{X : Type w}
(f : X → ↑F X)
(i : X)
(n : ℕ)

PFunctor.Approx.Agree (PFunctor.Approx.sCorec f i n) (PFunctor.Approx.sCorec f i n.succ)


theorem comp_iterate (h : Commute f g) (n : ℕ) : (f ∘ g)^[n] = f^[n] ∘ g^[n]

{α : Type u}
{f g : α → α}
(h : Function.Commute f g)
(n : ℕ)


@[simp]
theorem divp_inv (u : αˣ) : a /ₚ u⁻¹ = a * u

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


@[to_additive (attr := simp)]
lemma mulEquivOfOrderOfEq_apply_gen : mulEquivOfOrderOfEq hg hg' h g = g'

(hg : ∀ (x : G), x ∈ AddSubgroup.zmultiples g)

(hg' : ∀ (x : G'), x ∈ AddSubgroup.zmultiples g')

(addEquivOfAddOrderOfEq hg hg' h) g = g'


@[trans]
theorem IsBigO.trans {f : α → E} {g : α → F'} {k : α → G} (hfg : f =O[l] g) (hgk : g =O[l] k) :
    f =O[l] k

{α : Type u_1}
{E : Type u_3}
{G : Type u_5}
{F' : Type u_7}
[Norm E]
[Norm G]
[SeminormedAddCommGroup F']
{l : Filter α}
{f : α → E}
{g : α → F'}
{k : α → G}
(hfg : f =O[l] g)
(hgk : g =O[l] k)


theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ]

[CategoryTheory.EffectiveEpi π, CategoryTheory.Epi π, Function.Surjective ⇑π].TFAE


theorem algebraMap_apply_div :
    algebraMap (RatFunc F) (LaurentSeries F) (algebraMap _ _ p / algebraMap _ _ q) =
      algebraMap F[X] (LaurentSeries F) p / algebraMap _ _ q

(algebraMap (RatFunc F) (LaurentSeries F)) ((algebraMap F[X] (RatFunc F)) p / (algebraMap F[X] (RatFunc F)) q) =
  (algebraMap F[X] (LaurentSeries F)) p / (algebraMap F[X] (LaurentSeries F)) q


theorem upperCrossingTime_eq_upperCrossingTime_of_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω

{f : ℕ → Ω → ℝ}

(h : MeasureTheory.upperCrossingTime a b f N n ω < N)

MeasureTheory.upperCrossingTime a b f M n ω = MeasureTheory.upperCrossingTime a b f N n ω


theorem not_mem_neLocus {f g : α →₀ N} {a : α} : a ∉ f.neLocus g ↔ f a = g a

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
{f g : α →₀ N}
{a : α}


lemma StrictAnti.mapsTo_Ioc (h : StrictAnti f) : MapsTo f (Ioc a b) (Ico (f b) (f a))

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

Set.MapsTo f (Set.Ioc a b) (Set.Ico (f b) (f a))


@[simp]
theorem closedBall_eq_emptyset (p : Seminorm 𝕜 E) {x : E} {r : ℝ} (hr : r < 0) :
    p.closedBall x r = ∅

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


theorem image_eq_target_inter_inv_preimage {s : Set α} (h : s ⊆ e.source) :
    e '' s = e.target ∩ e.symm ⁻¹' s

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


theorem if_eq_of_eq_false {c : Prop} [d : Decidable c] {α : Sort u} (t e : α) (h : c = False) :
    @ite α c d t e = e


protected theorem LiftRel.lex {a b : α ⊕ β} (h : LiftRel r s a b) : Lex r s a b

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{a b : α ⊕ β}
(h : Sum.LiftRel r s a b)


theorem differentiable_sinh : Differentiable ℝ sinh


theorem finsuppTotal_apply (f : ι →₀ I) :
    finsuppTotal ι M I v f = f.sum fun i x => (x : 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}
(f : ι →₀ ↥I)

(Ideal.finsuppTotal ι M I v) f = f.sum fun i x => ↑x • v i


/-- A set of `finrank K V` vectors forms a basis if they span the whole space. -/
@[simps! repr_apply]
noncomputable def setBasisOfTopLeSpanOfCardEqFinrank {s : Set V} [Fintype s]
    (le_span : ⊤ ≤ span K s) (card_eq : s.toFinset.card = finrank K V) : Basis s K V

(card_eq : s.toFinset.card = FiniteDimensional.finrank K V)

∀ (a : V),
  (setBasisOfTopLeSpanOfCardEqFinrank le_span card_eq).repr a =
    ⋯.repr ((LinearMap.codRestrict (Submodule.span K (Set.range Subtype.val)) LinearMap.id ⋯) a)


/-- The `Generators` containing the whole algebra, which induces the canonical map  `R[S] → S`. -/
@[simps]
noncomputable
def self : Generators R S

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]


/-- An auxiliary induction lemma, which is generalized by `solvableByRad.isSolvable`. -/
theorem induction2 {α β γ : solvableByRad F E} (hγ : γ ∈ F⟮α, β⟯) (hα : P α) (hβ : P β) : P γ

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{α β γ : ↥(solvableByRad F E)}
(hγ : γ ∈ F⟮α, β⟯)
(hα : solvableByRad.P α)
(hβ : solvableByRad.P β)


/-- The categorical equivalence between `C` and `ShrinkHoms C`, when `C` is locally small.
-/
@[simps!]
noncomputable def equivalence : C ≌ ShrinkHoms C

[CategoryTheory.LocallySmall.{w, v, u} C]

(CategoryTheory.ShrinkHoms.equivalence C).inverse.map f = (equivShrink (X.fromShrinkHoms ⟶ Y.fromShrinkHoms)).symm f


@[to_additive] lemma mulDissociated_iff_sum_eq_subsingleton :
    MulDissociated s ↔ ∀ a, {t : Finset α | ↑t ⊆ s ∧ ∏ x in t, x = a}.Subsingleton

{α : Type u_1}
[AddCommGroup α]
{s : Set α}

AddDissociated s ↔ ∀ (a : α), {t | ↑t ⊆ s ∧ ∑ x ∈ t, x = a}.Subsingleton


theorem eq_none_of_isNone {α : Type u} : ∀ {o : Option α}, o.isNone → o = none


theorem _root_.Bornology.IsBounded.cthickening {α : Type*} [PseudoMetricSpace α] {δ : ℝ} {E : Set α}
    (h : IsBounded E) : IsBounded (cthickening δ E)

{α : Type u_2}
[PseudoMetricSpace α]
{δ : ℝ}
{E : Set α}
(h : Bornology.IsBounded E)

Bornology.IsBounded (Metric.cthickening δ E)


@[simp]
theorem card_iUnion_lt_iff_forall_of_isRegular {ι : Type u} {α : Type u} {t : ι → Set α}
    {c : Cardinal} (hc : c.IsRegular) (hι : #ι < c) : #(⋃ i, t i) < c ↔ ∀ i, #(t i) < c

{ι α : Type u}
{t : ι → Set α}
{c : Cardinal.{u}}
(hc : c.IsRegular)
(hι : #ι < c)

#↑(⋃ i, t i) < c ↔ ∀ (i : ι), #↑(t i) < c


theorem MonotoneOn.union [Preorder β] {f g : β → Set α} {s : Set β} (hf : MonotoneOn f s)
    (hg : MonotoneOn g s) : MonotoneOn (fun x => f x ∪ g x) s

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : β → Set α}
{s : Set β}
(hf : MonotoneOn f s)
(hg : MonotoneOn g s)


theorem isPreconnected_setOf_wOppSide (s : AffineSubspace ℝ P) (x : P) :
    IsPreconnected { y | s.WOppSide x y }

{V : Type u_2}
{P : Type u_4}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(s : AffineSubspace ℝ P)
(x : P)


/-- If `R` preserves the appropriate limit, then given a cone for `F ⋙ fst L R : J ⥤ L` and a
limit cone for `F ⋙ snd L R : J ⥤ R` we can build a cone for `F` which will turn out to be a limit
cone.
-/
@[simps]
def coneOfPreserves [PreservesLimit (F ⋙ snd L R) R] (c₁ : Cone (F ⋙ fst L R))
    {c₂ : Cone (F ⋙ snd L R)} (t₂ : IsLimit c₂) : Cone F

(F : CategoryTheory.Functor J (CategoryTheory.Comma L R))

[CategoryTheory.Limits.PreservesLimit (F.comp (CategoryTheory.Comma.snd L R)) R]

(c₁ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.fst L R)))

{c₂ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.snd L R))}

((CategoryTheory.Comma.coneOfPreserves F c₁ t₂).π.app j).right = c₂.π.app j


lemma leRecOn_succ {C : ℕ → Sort*} {n m} (h1 : n ≤ m) {h2 : n ≤ m + 1} {next} (x : C n) :
    (leRecOn h2 next x : C (m + 1)) = next (leRecOn h1 next x : C m)

{C : ℕ → Sort u_1}
{n m : ℕ}
(h1 : n ≤ m)
{h2 : n ≤ m + 1}
{next : {k : ℕ} → C k → C (k + 1)}
(x : C n)

Nat.leRecOn h2 next x = next (Nat.leRecOn h1 (fun {k} => next) x)


theorem coeIdeal_ne_zero {I : Ideal R} : (I : FractionalIdeal R⁰ K) ≠ 0 ↔ I ≠ ⊥

{R : Type u_1}
[CommRing R]
{K : Type u_3}
[Field K]
[Algebra R K]
[IsFractionRing R K]
{I : Ideal R}

↑I ≠ 0 ↔ I ≠ ⊥


@[simp]
theorem minpoly_toLin' : minpoly R (toLin' M) = minpoly R M

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R)

minpoly R (Matrix.toLin' M) = minpoly R M


/-- The equivalence of functor categories induced by `leftOp` and `rightOp`.
-/
@[simps!]
def leftOpRightOpEquiv : (Cᵒᵖ ⥤ D)ᵒᵖ ≌ C ⥤ Dᵒᵖ

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

∀ (X_1 : C),
  ((CategoryTheory.Functor.leftOpRightOpEquiv C D).counitIso.inv.app X).app X_1 =
    CategoryTheory.CategoryStruct.id (X.obj X_1)


@[simp]
theorem preimage_iUnion {f : α → β} {s : ι → Set β} : (f ⁻¹' ⋃ i, s i) = ⋃ i, f ⁻¹' s i

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : α → β}
{s : ι → Set β}


lemma FiniteField.primitiveChar_to_Complex_isPrimitive :
    (primitiveChar_to_Complex F).IsPrimitive


theorem HasFDerivAt.rpow_const (hf : HasFDerivAt f f' x) (h : f x ≠ 0 ∨ 1 ≤ p) :
    HasFDerivAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
{p : ℝ}
(hf : HasFDerivAt f f' x)
(h : f x ≠ 0 ∨ 1 ≤ p)


/-- The homotopy between morphisms in `ShortComplex Cᵒᵖ` that is induced by a homotopy
between morphisms in `ShortComplex C`. -/
@[simps]
def op (h : Homotopy φ₁ φ₂) : Homotopy (opMap φ₁) (opMap φ₂)

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)


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

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

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


/-- If `p` lifts then `p.erase n` lifts. -/
theorem erase_mem_lifts {p : S[X]} (n : ℕ) (h : p ∈ lifts f) : p.erase n ∈ lifts f

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
{f : R →+* S}
{p : S[X]}
(n : ℕ)
(h : p ∈ Polynomial.lifts f)

Polynomial.erase n p ∈ Polynomial.lifts f


@[simp, rclike_simps]
theorem reLm_coe : (reLm : K → ℝ) = re


@[to_additive abs_norm_sub_norm_le]
theorem abs_norm_sub_norm_le' (a b : E) : |‖a‖ - ‖b‖| ≤ ‖a / b‖

{E : Type u_6}
[SeminormedGroup E]
(a b : E)


theorem split_iff_of_iso {X X' : C} (φ : X ≅ X') (p : X ⟶ X) (p' : X' ⟶ X')
    (hpp' : p ≫ φ.hom = φ.hom ≫ p') :
    (∃ (Y : C) (i : Y ⟶ X) (e : X ⟶ Y), i ≫ e = 𝟙 Y ∧ e ≫ i = p) ↔
      ∃ (Y' : C) (i' : Y' ⟶ X') (e' : X' ⟶ Y'), i' ≫ e' = 𝟙 Y' ∧ e' ≫ i' = p'

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X X' : C}
(φ : X ≅ X')
(p : X ⟶ X)
(p' : X' ⟶ X')
(hpp' : p ≫ φ.hom = φ.hom ≫ p')

(∃ Y i e, i ≫ e = 𝟙 Y ∧ e ≫ i = p) ↔ ∃ Y' i' e', i' ≫ e' = 𝟙 Y' ∧ e' ≫ i' = p'


theorem or_all_distrib_right (l : List α) (p : α → Bool) (q : Bool) :
    (l.all p || q) = l.all fun a => p a || q

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


theorem commutator_eq_normalClosure : commutator G = Subgroup.normalClosure (commutatorSet G)


/-- An indeterminate `i : σ` is weighted homogeneous of degree `w i`. -/
theorem isWeightedHomogeneous_X (w : σ → M) (i : σ) :
    IsWeightedHomogeneous w (X i : MvPolynomial σ R) (w i)

(R : Type u_1)
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
(w : σ → M)
(i : σ)

MvPolynomial.IsWeightedHomogeneous w (MvPolynomial.X i) (w i)


@[to_additive Set.AddAntidiagonal.eq_of_fst_eq_fst]
theorem eq_of_fst_eq_fst (h : (x : α × α).fst = (y : α × α).fst) : x = y

{α : Type u_1}
[AddCancelCommMonoid α]
{s t : Set α}
{a : α}
{x y : ↑(s.addAntidiagonal t a)}
(h : (↑x).1 = (↑y).1)


theorem hasMFDerivAt_neg : HasMFDerivAt I 𝓘(𝕜, E') (-f) z (-f') ↔ HasMFDerivAt I 𝓘(𝕜, E') f z f'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{z : M}
{f : M → E'}
{f' : TangentSpace I z →L[𝕜] E'}


@[simp]
lemma gaussianPDFReal_zero_var (m : ℝ) : gaussianPDFReal m 0 = 0

ProbabilityTheory.gaussianPDFReal m 0 = 0


/-- The first element of `scanl` of a vector `v : Vector α n`,
retrieved via `head`, is the starting value `b : β`.
-/
@[simp]
theorem scanl_head : (scanl f b v).head = b

{n : ℕ}
{α : Type u_1}
{β : Type u_2}
(f : β → α → β)
(b : β)
(v : Mathlib.Vector α n)


/-- The product of the prime factors of `n` that are less than `N` is an `N`-smooth number. -/
lemma prod_mem_smoothNumbers (n N : ℕ) :
    (n.primeFactorsList.filter (· < N)).prod ∈ smoothNumbers N

(List.filter (fun x => decide (x < N)) n.primeFactorsList).prod ∈ N.smoothNumbers


/-- See also `geometric_hahn_banach_point_point`. -/
theorem eq_iff_forall_dual_eq {x y : E} : x = y ↔ ∀ g : Dual 𝕜 E, g x = g y

(𝕜 : Type v)
[RCLike 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x y : E}

x = y ↔ ∀ (g : NormedSpace.Dual 𝕜 E), g x = g y


/-- Ad hoc typeclass stating that neighborhoods are eventually bounded below. -/
class BoundedGENhdsClass (α : Type*) [Preorder α] [TopologicalSpace α] : Prop where
  isBounded_ge_nhds (a : α) : (𝓝 a).IsBounded (· ≥ ·)

{α : Type u_7}
[Preorder α]
[TopologicalSpace α]
[self : BoundedGENhdsClass α]
(a : α)

Filter.IsBounded (fun x x_1 => x ≥ x_1) (𝓝 a)


theorem Monotone.imp (hf : Monotone f) (h : a ≤ b) : f a ≤ f b

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{a b : α}
(hf : Monotone f)
(h : a ≤ b)


theorem map_eq_foldr (f : α → β) (l : List α) : map f l = foldr (fun a bs => f a :: bs) [] l

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

List.map f l = List.foldr (fun a bs => f a :: bs) [] l


lemma lt_slope_of_hasDerivWithinAt_Iio (hfc : StrictConcaveOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' (Iio y) y) :
    f' < slope f x y

(hf' : HasDerivWithinAt f f' (Set.Iio y) y)


@[simp, norm_cast]
theorem coe_fst (a : A) : (a : 𝓜(𝕜, A)).fst = ContinuousLinearMap.mul 𝕜 A a

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(a : A)

(↑𝕜 a).toProd.1 = (ContinuousLinearMap.mul 𝕜 A) a


theorem natCast_pow (b n : Nat) : ((b^n : Nat) : Int) = (b : Int) ^ n


theorem toFun_eq_coe (f : P →ᴬ[R] Q) : f.toFun = ⇑f

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
(f : P →ᴬ[R] Q)


/-- `CharacterModule M` is an injective module iff `M` is flat. -/
theorem iff_characterModule_injective [Small.{v} R] :
    Flat R M ↔ Module.Injective R (CharacterModule M)

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Small.{v, u} R]

Module.Flat R M ↔ Module.Injective R (CharacterModule M)


theorem prod_coe_rpow {ι} (s : Finset ι) (f : ι → ℝ≥0) (r : ℝ) :
    ∏ i ∈ s, (f i : ℝ≥0∞) ^ r = ((∏ i ∈ s, f i : ℝ≥0) : ℝ≥0∞) ^ r

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

∏ i ∈ s, ↑(f i) ^ r = ↑(∏ i ∈ s, f i) ^ r


@[simp, nolint simpNF]
lemma one_apply (i : I) : (1 : ZeroCochain G U) i = 1

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(G : CategoryTheory.Functor Cᵒᵖ Grp)
{I : Type w'}
(U : I → C)
(i : I)


@[reassoc (attr := simp)]
lemma toCycles_naturality : S₁.toCycles ≫ cyclesMap φ = φ.τ₁ ≫ S₂.toCycles

CategoryTheory.CategoryStruct.comp S₁.toCycles (CategoryTheory.ShortComplex.cyclesMap φ) =
  CategoryTheory.CategoryStruct.comp φ.τ₁ S₂.toCycles


@[simp] theorem surjective_lift {f : α → γ} (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) :
    Function.Surjective (lift f h) ↔ Function.Surjective f

(h : ∀ (a₁ a₂ : α), r a₁ a₂ → f a₁ = f a₂)

Function.Surjective (Quot.lift f h) ↔ Function.Surjective f


lemma equation_iff (P : Fin 3 → R) : W.Equation P ↔
    P y ^ 2 * P z + W.a₁ * P x * P y * P z + W.a₃ * P y * P z ^ 2
      = P x ^ 3 + W.a₂ * P x ^ 2 * P z + W.a₄ * P x * P z ^ 2 + W.a₆ * P z ^ 3

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(P : Fin 3 → R)


lemma top_eq_ofList_cons_smul_iff :
    (⊤ : Submodule R M) = Ideal.ofList (r :: rs) • ⊤ ↔
      (⊤ : Submodule R (QuotSMulTop r M)) = Ideal.ofList rs • ⊤

{R : Type u_1}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
(r : R)
(rs : List R)

⊤ = Ideal.ofList (r :: rs) • ⊤ ↔ ⊤ = Ideal.ofList rs • ⊤


/-- `TrivSqZeroExt.snd` as a continuous linear map. -/
@[simps]
def sndCLM [CommSemiring R] [AddCommMonoid M] [Module R M] : tsze R M →L[R] M

(R : Type u_3)
(M : Type u_4)
[TopologicalSpace R]
[TopologicalSpace M]
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(x : tsze R M)


@[to_additive (attr := simp)]
theorem Subgroup.topologicalClosure_coe {s : Subgroup G} :
    (s.topologicalClosure : Set G) = _root_.closure s

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{s : Subgroup G}


@[to_additive (attr := simp) comap_norm_atTop]
lemma comap_norm_atTop' : comap norm atTop = cobounded E

Filter.comap norm Filter.atTop = Bornology.cobounded E


/-- An isometry between quadratic forms generated by `QuadraticForm.prod` can be constructed
from a pair of isometries between the left and right parts. -/
@[simps toLinearEquiv]
def IsometryEquiv.prod
    {Q₁ : QuadraticMap R M₁ P} {Q₂ : QuadraticMap R M₂ P}
    {Q₁' : QuadraticMap R N₁ P} {Q₂' : QuadraticMap R N₂ P}
    (e₁ : Q₁.IsometryEquiv Q₁') (e₂ : Q₂.IsometryEquiv Q₂') :
    (Q₁.prod Q₂).IsometryEquiv (Q₁'.prod Q₂')

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{N₁ : Type u_5}
{N₂ : Type u_6}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N₁]
[AddCommMonoid N₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R N₁]
[Module R N₂]
[Module R P]
{Q₁ : QuadraticMap R M₁ P}
{Q₂ : QuadraticMap R M₂ P}
{Q₁' : QuadraticMap R N₁ P}
{Q₂' : QuadraticMap R N₂ P}
(e₁ : Q₁.IsometryEquiv Q₁')
(e₂ : Q₂.IsometryEquiv Q₂')

(e₁.prod e₂).toLinearEquiv = e₁.prod e₂.toLinearEquiv


theorem Mon_tensor_mul_assoc (M N : Mon_ C) :
    ((tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul)) ▷ (M.X ⊗ N.X)) ≫
        tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul) =
      (α_ (M.X ⊗ N.X) (M.X ⊗ N.X) (M.X ⊗ N.X)).hom ≫
        ((M.X ⊗ N.X) ◁ (tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul))) ≫
          tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul)

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

(CategoryTheory.tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul)) ▷ (M.X ⊗ N.X) ≫
    CategoryTheory.tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul) =
  (α_ (M.X ⊗ N.X) (M.X ⊗ N.X) (M.X ⊗ N.X)).hom ≫
    (M.X ⊗ N.X) ◁ (CategoryTheory.tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul)) ≫
      CategoryTheory.tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul)


@[simp] theorem getD_eq_get? (a : Array α) (n d) : a.getD n d = (a[n]?).getD d

{α : Type u_1}
(a : Array α)
(n : Nat)
(d : α)


@[simp]
theorem antivaryOn_id_iff : AntivaryOn f id s ↔ AntitoneOn f s

{ι : Type u_1}
{α : Type u_3}
[Preorder α]
{f : ι → α}
{s : Set ι}
[PartialOrder ι]


protected theorem existsUnique (h : π.IsPartition) (hx : x ∈ I) :
    ∃! J ∈ π, x ∈ J

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π : BoxIntegral.Prepartition I}
{x : ι → ℝ}
(h : π.IsPartition)
(hx : x ∈ I)


/-- If one adds to a vector `m'` another vector `m`, but only for coordinates in a finset `t`, then
the image under a multilinear map `f` is the sum of `f (s.piecewise m m')` along all subsets `s` of
`t`. This is mainly an auxiliary statement to prove the result when `t = univ`, given in
`map_add_univ`, although it can be useful in its own right as it does not require the index set `ι`
to be finite. -/
theorem map_piecewise_add [DecidableEq ι] (m m' : ∀ i, M₁ i) (t : Finset ι) :
    f (t.piecewise (m + m') m') = ∑ s ∈ t.powerset, f (s.piecewise m m')

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


theorem DifferentiableWithinAt.const_cpow (hf : DifferentiableWithinAt ℂ f s x)
    (h0 : c ≠ 0 ∨ f x ≠ 0) : DifferentiableWithinAt ℂ (fun x => c ^ f x) s x

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


/-- Adding a point in the affine span and a vector in the spanning submodule produces a point in the
affine span. -/
theorem vadd_mem_spanPoints_of_mem_spanPoints_of_mem_vectorSpan {s : Set P} {p : P} {v : V}
    (hp : p ∈ spanPoints k s) (hv : v ∈ vectorSpan k s) : v +ᵥ p ∈ spanPoints k s

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
{p : P}
{v : V}
(hp : p ∈ spanPoints k s)
(hv : v ∈ vectorSpan k s)


/-- Two morphisms are conjugate via eqToHom if and only if they are heterogeneously equal. -/
theorem conj_eqToHom_iff_heq {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) (h : W = Y) (h' : X = Z) :
    f = eqToHom h ≫ g ≫ eqToHom h'.symm ↔ HEq f g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{W X Y Z : C}
(f : W ⟶ X)
(g : Y ⟶ Z)
(h : W = Y)
(h' : X = Z)

f =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h)
      (CategoryTheory.CategoryStruct.comp g (CategoryTheory.eqToHom ⋯)) ↔
  HEq f g


protected theorem mul_inv_cancel : a ≠ 0 → a * a⁻¹ = 1


@[simp]
theorem sUnion_singleton {x : ZFSet.{u}} : ⋃₀ ({x} : ZFSet) = x


/-- If `re s` is greater than the abscissa of absolute convergence of `f`, then
the derivative of this L-series at `s` is the negative of the L-series of `log * f`. -/
lemma LSeries_deriv {f : ℕ → ℂ} {s : ℂ} (h : abscissaOfAbsConv f < s.re) :
    deriv (LSeries f) s = - LSeries (logMul f) s

(h : LSeries.abscissaOfAbsConv f < ↑s.re)

deriv (LSeries f) s = -LSeries (LSeries.logMul f) s


/-- 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*} [DivisionMonoid M] [TopologicalSpace M]
    (h : ContinuousOn Inv.inv {x : M | IsUnit x}) : Embedding (val : Mˣ → M)

(h : ContinuousOn Inv.inv {x | IsUnit x})


/-- Morphisms of short complexes are the commutative diagrams of the obvious shape. -/
@[ext]
structure Hom (S₁ S₂ : ShortComplex C) where
  /-- the morphism on the left objects -/
  τ₁ : S₁.X₁ ⟶ S₂.X₁
  /-- the morphism on the middle objects -/
  τ₂ : S₁.X₂ ⟶ S₂.X₂
  /-- the morphism on the right objects -/
  τ₃ : S₁.X₃ ⟶ S₂.X₃
  /-- the left commutative square of a morphism in `ShortComplex` -/
  comm₁₂ : τ₁ ≫ S₂.f = S₁.f ≫ τ₂ := by aesop_cat
  /-- the right commutative square of a morphism in `ShortComplex` -/
  comm₂₃ : τ₂ ≫ S₂.g = S₁.g ≫ τ₃ := by aesop_cat

CategoryTheory.CategoryStruct.comp self.τ₁ S₂.f = CategoryTheory.CategoryStruct.comp S₁.f self.τ₂


@[csimp] theorem eraseP_eq_erasePTR : @eraseP = @erasePTR

(α : Type u_1)
(p : α → Bool)
(l : List α)
(acc : Array α)
(xs : List α)

l = acc.data ++ xs → List.erasePTR.go p l xs acc = acc.data ++ List.eraseP p xs


theorem multiplicity_factor_dvd_iso_eq_multiplicity_of_mem_normalizedFactors {m p : M} {n : N}
    (hm : m ≠ 0) (hn : n ≠ 0) (hp : p ∈ normalizedFactors m)
    {d : { l : M // l ∣ m } ≃ { l : N // l ∣ n }} (hd : ∀ l l', (d l : N) ∣ d l' ↔ (l : M) ∣ l') :
    multiplicity (d ⟨p, dvd_of_mem_normalizedFactors hp⟩ : N) n = multiplicity p m

(hp : p ∈ UniqueFactorizationMonoid.normalizedFactors m)

(hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l')

multiplicity (↑(d ⟨p, ⋯⟩)) n = multiplicity p m


theorem induction (P : solvableByRad F E → Prop)
    (base : ∀ α : F, P (algebraMap F (solvableByRad F E) α))
    (add : ∀ α β : solvableByRad F E, P α → P β → P (α + β))
    (neg : ∀ α : solvableByRad F E, P α → P (-α))
    (mul : ∀ α β : solvableByRad F E, P α → P β → P (α * β))
    (inv : ∀ α : solvableByRad F E, P α → P α⁻¹)
    (rad : ∀ α : solvableByRad F E, ∀ n : ℕ, n ≠ 0 → P (α ^ n) → P α) (α : solvableByRad F E) :
    P α

(base : ∀ (α : F), P ((algebraMap F ↥(solvableByRad F E)) α))

(add : ∀ (α β : ↥(solvableByRad F E)), P α → P β → P (α + β))

(neg : ∀ (α : ↥(solvableByRad F E)), P α → P (-α))

(mul : ∀ (α β : ↥(solvableByRad F E)), P α → P β → P (α * β))

(inv : ∀ (α : ↥(solvableByRad F E)), P α → P α⁻¹)

(rad : ∀ (α : ↥(solvableByRad F E)) (n : ℕ), n ≠ 0 → P (α ^ n) → P α)


theorem toWithTop_one :
    have : Decidable (1 : PartENat).Dom := someDecidable 1
    toWithTop 1 = 1

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


/-- A category is called `R`-linear if `P ⟶ Q` is an `R`-module such that composition is
    `R`-linear in both variables. -/
class Linear (R : Type w) [Semiring R] (C : Type u) [Category.{v} C] [Preadditive C] where
  homModule : ∀ X Y : C, Module R (X ⟶ Y) := by infer_instance
  /-- compatibility of the scalar multiplication with the post-composition -/
  smul_comp : ∀ (X Y Z : C) (r : R) (f : X ⟶ Y) (g : Y ⟶ Z), (r • f) ≫ g = r • f ≫ g := by
    aesop_cat
  /-- compatibility of the scalar multiplication with the pre-composition -/
  comp_smul : ∀ (X Y Z : C) (f : X ⟶ Y) (r : R) (g : Y ⟶ Z), f ≫ (r • g) = r • f ≫ g := by
    aesop_cat

{R : Type w}
[Semiring R]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[self : CategoryTheory.Linear R C]
(X Y Z : C)
(f : X ⟶ Y)
(r : R)
(g : Y ⟶ Z)


theorem eq_inv_iff_eq {f : Perm α} {x y : α} : x = f⁻¹ y ↔ f x = y

{α : Type u}
{f : Equiv.Perm α}
{x y : α}


/-- A monotone function is continuous at a point if and only if its left and right limits
coincide. -/
theorem continuousAt_iff_leftLim_eq_rightLim : ContinuousAt f x ↔ leftLim f x = rightLim f x

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
{x : α}
[TopologicalSpace α]
[OrderTopology α]

ContinuousAt f x ↔ Function.leftLim f x = Function.rightLim f x


@[simp]
theorem taylor_mul {R} [CommSemiring R] (r : R) (p q : R[X]) :
    taylor r (p * q) = taylor r p * taylor r q

{R : Type u_2}
[CommSemiring R]
(r : R)
(p q : Polynomial R)

(Polynomial.taylor r) (p * q) = (Polynomial.taylor r) p * (Polynomial.taylor r) q


theorem map_iSup_comap_of_surjective (S : ι → L.Substructure N) :
    (⨆ i, (S i).comap f).map f = iSup S

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{ι : Type u_3}
{f : L.Hom M N}
(hf : Function.Surjective ⇑f)
(S : ι → L.Substructure N)

FirstOrder.Language.Substructure.map f (⨆ i, FirstOrder.Language.Substructure.comap f (S i)) = iSup S


/-- The shift functor by `n : ℤ` on `CochainComplex C ℤ` which sends a cochain
complex `K` to the complex which is `K.X (i + n)` in degree `i`, and which
multiplies the differentials by `(-1)^n`. -/
@[simps]
def shiftFunctor (n : ℤ) : CochainComplex C ℤ ⥤ CochainComplex C ℤ

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(n : ℤ)

∀ {X Y : CochainComplex C ℤ} (φ : X ⟶ Y) (i : ℤ), ((CochainComplex.shiftFunctor C n).map φ).f i = φ.f (i + n)


@[simp]
theorem degree_basisDivisor_self : (basisDivisor x x).degree = ⊥


protected lemma IsPath.cons {p : Walk G v w} (hp : p.IsPath) (hu : u ∉ p.support) {h : G.Adj u v} :
    (cons h p).IsPath

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
{p : G.Walk v w}
(hp : p.IsPath)
(hu : u ∉ p.support)
{h : G.Adj u v}


lemma jacobiTheta₂''_conj (z τ : ℂ) :
    conj (jacobiTheta₂'' z τ) = jacobiTheta₂'' (conj z) (-conj τ)

(starRingEnd ℂ) (HurwitzZeta.jacobiTheta₂'' z τ) = HurwitzZeta.jacobiTheta₂'' ((starRingEnd ℂ) z) (-(starRingEnd ℂ) τ)


@[simp]
theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) :
    taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x +
      (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
(n : ℕ)
(s : Set ℝ)
(x₀ x : ℝ)

taylorWithinEval f (n + 1) s x₀ x =
  taylorWithinEval f n s x₀ x + (((↑n + 1) * ↑n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀


@[reassoc]
theorem δ_comp_σ_of_gt' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : j.succ < i) :
    X.σ j ≫ X.δ i =
      X.δ (i.pred fun (hi : i = 0) => by simp only [Fin.not_lt_zero, hi] at H) ≫
        X.σ (j.castLT ((add_lt_add_iff_right 1).mp (lt_of_lt_of_le H i.is_le)))

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
{i : Fin (n + 3)}
{j : Fin (n + 2)}
(H : j.succ < i)

X.σ j ≫ X.δ i = X.δ (i.pred ⋯) ≫ X.σ (j.castLT ⋯)


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

{R : Type u}
[NonUnitalNonAssocRing R]
{ι : Sort u_2}
{S : ι → NonUnitalSubring R}


theorem mem_support_bind_iff (b : β) :
    b ∈ (p.bind f).support ↔ ∃ a ∈ p.support, b ∈ (f a).support

{α : Type u_1}
{β : Type u_2}
(p : PMF α)
(f : α → PMF β)
(b : β)


@[simp]
theorem cons_zero (a : α) : a ::ₘ 0 = {a}


/-- The subgroup "multiples of `a`" (`zmultiples a`) is a discrete subgroup of `ℝ`, i.e. its
intersection with compact sets is finite. -/
theorem tendsto_zmultiples_subtype_cofinite (a : ℝ) :
    Tendsto (zmultiples a).subtype cofinite (cocompact ℝ)

Filter.Tendsto (⇑(AddSubgroup.zmultiples a).subtype) Filter.cofinite (Filter.cocompact ℝ)


theorem think_congr {s t : WSeq α} (h : s ~ʷ t) : think s ~ʷ think t

{α : Type u}
{s t : Stream'.WSeq α}
(h : s ~ʷ t)


protected theorem differentiable : Differentiable 𝕜 fun x => p.eval x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(p : 𝕜[X])

Differentiable 𝕜 fun x => Polynomial.eval x p


lemma isLocallyInjective_of_injective (hφ : ∀ (X : Cᵒᵖ), Function.Injective (φ.app X)) :
    IsLocallyInjective J φ

(J : CategoryTheory.GrothendieckTopology C)

(hφ : ∀ (X : Cᵒᵖ), Function.Injective ⇑(φ.app X))


theorem one_minus_le_one (x : I) : 1 - (x : ℝ) ≤ 1


@[simp]
lemma of_counit {X : Type v} [Ring X] [Bialgebra R X] :
    Coalgebra.counit (A := of R X) = Coalgebra.counit (R := R) (A := X)

{R : Type u}
[CommRing R]
{X : Type v}
[Ring X]
[Bialgebra R X]


/-- `gauge s` as a seminorm when `s` is balanced, convex and absorbent. -/
@[simps!]
def gaugeSeminorm (hs₀ : Balanced 𝕜 s) (hs₁ : Convex ℝ s) (hs₂ : Absorbent ℝ s) : Seminorm 𝕜 E

{𝕜 : Type u_1}
{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[RCLike 𝕜]
[Module 𝕜 E]
[IsScalarTower ℝ 𝕜 E]
(hs₀ : Balanced 𝕜 s)
(hs₁ : Convex ℝ s)
(hs₂ : Absorbent ℝ s)
(x : E)

(gaugeSeminorm hs₀ hs₁ hs₂) x = gauge s x


/-- Closure of a submonoid `S` equals `S`. -/
@[to_additive (attr := simp) "Additive closure of an additive submonoid `S` equals `S`"]
theorem closure_eq : closure (S : Set M) = S

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


@[to_additive (attr := simp)] lemma leOnePart_inv (a : α) : a⁻¹⁻ᵐ = a⁺ᵐ

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


theorem norm_restrict_mono_set {X : Type*} [TopologicalSpace X] (f : C(X, E))
    {K L : TopologicalSpace.Compacts X} (hKL : K ≤ L) : ‖f.restrict K‖ ≤ ‖f.restrict L‖

{E : Type u_3}
[NormedAddCommGroup E]
{X : Type u_4}
[TopologicalSpace X]
(f : C(X, E))
{K L : TopologicalSpace.Compacts X}
(hKL : K ≤ L)

‖ContinuousMap.restrict (↑K) f‖ ≤ ‖ContinuousMap.restrict (↑L) f‖


/-- Closed seminorm-balls at the origin are balanced. -/
theorem balanced_closedBall_zero (r : ℝ) : Balanced 𝕜 (closedBall p 0 r)

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
(r : ℝ)


@[simp]
theorem mapsTo_singleton {x : α} : MapsTo f {x} t ↔ f x ∈ t

{α : Type u_1}
{β : Type u_2}
{t : Set β}
{f : α → β}
{x : α}


/-- This lemma, combined with `edgeSet_sdiff` and `edgeSet_from_edgeSet`,
allows proving `(G \ from_edgeSet s).edge_set = G.edgeSet \ s` by `simp`. -/
@[simp]
theorem edgeSet_sdiff_sdiff_isDiag (G : SimpleGraph V) (s : Set (Sym2 V)) :
    G.edgeSet \ (s \ { e | e.IsDiag }) = G.edgeSet \ s

{V : Type u}
(G : SimpleGraph V)
(s : Set (Sym2 V))

G.edgeSet \ (s \ {e | e.IsDiag}) = G.edgeSet \ s


theorem mem_def : a ∈ s ↔ s.fst ≤ a ∧ a ≤ s.snd

{α : Type u_1}
[Preorder α]
{s : NonemptyInterval α}
{a : α}


theorem exists_measurable_nonneg {β} [Preorder β] [Zero β] {mβ : MeasurableSpace β} {f : α → β}
    (hf : AEMeasurable f μ) (f_nn : ∀ᵐ t ∂μ, 0 ≤ f t) : ∃ g, Measurable g ∧ 0 ≤ g ∧ f =ᵐ[μ] g

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_7}
[Preorder β]
[Zero β]
{mβ : MeasurableSpace β}
{f : α → β}
(hf : AEMeasurable f μ)
(f_nn : ∀ᵐ (t : α) ∂μ, 0 ≤ f t)