/-- If `f` is strictly antitone both on `s` and `t`, with `s` to the left of `t` and the center
point belonging to both `s` and `t`, then `f` is strictly antitone on `s ∪ t` -/
protected theorem StrictAntiOn.union {s t : Set α} {c : α} (h₁ : StrictAntiOn f s)
    (h₂ : StrictAntiOn f t) (hs : IsGreatest s c) (ht : IsLeast t c) : StrictAntiOn f (s ∪ t)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s t : Set α}
{c : α}
(h₁ : StrictAntiOn f s)
(h₂ : StrictAntiOn f t)
(hs : IsGreatest s c)
(ht : IsLeast t c)


@[simp]
theorem toSubsemiring_eq_top {S : Subalgebra R A} : S.toSubsemiring = ⊤ ↔ S = ⊤

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


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

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(h : a ≤ b)
(hb : 0 ≤ b)


@[simp]
theorem compl_iff : NullMeasurableSet sᶜ μ ↔ NullMeasurableSet s μ

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}

MeasureTheory.NullMeasurableSet sᶜ μ ↔ MeasureTheory.NullMeasurableSet s μ


theorem closure_subset_iff {s t : Set F} (ht : IsSubfield t) : closure s ⊆ t ↔ s ⊆ t

{F : Type u_1}
[Field F]
{s t : Set F}
(ht : IsSubfield t)


/-- Convert back any exotic `ℤ`-smul to the canonical instance. This should not be needed since in
mathlib all `AddCommGroup`s should normally have exactly one `ℤ`-module structure by design. -/
theorem int_smul_eq_zsmul (h : Module ℤ M) (n : ℤ) (x : M) : @SMul.smul ℤ M h.toSMul n x = n • x

{M : Type u_5}
[AddCommGroup M]
(h : Module ℤ M)
(n : ℤ)
(x : M)


theorem not_nodup_pair (a : α) : ¬Nodup [a, a]


theorem stable_iff_exists_pow_smul_eq_of_ge :
    F.Stable ↔ ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{F : I.Filtration M}


theorem map_add_right (f : M →ₗ[R] P) (g₁ g₂ : N →ₗ[R] Q) :
    map f (g₁ + g₂) = map f g₁ + map f g₂

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(f : M →ₗ[R] P)
(g₁ g₂ : N →ₗ[R] Q)

TensorProduct.map f (g₁ + g₂) = TensorProduct.map f g₁ + TensorProduct.map f g₂


@[reassoc]
theorem map_tensor {X Y X' Y' : C} (f : X ⟶ Y) (g : X' ⟶ Y') :
    F.map (f ⊗ g) = inv (F.μ X X') ≫ (F.map f ⊗ F.map g) ≫ F.μ Y Y'

(F : CategoryTheory.MonoidalFunctor C D)

F.map (CategoryTheory.MonoidalCategory.tensorHom f g) =
  CategoryTheory.inv (F.μ X X') ≫ CategoryTheory.MonoidalCategory.tensorHom (F.map f) (F.map g) ≫ F.μ Y Y'


@[simp, norm_cast]
theorem coe_inr [Module R₁ M₂] : (inr R₁ M₁ M₂ : M₂ →ₗ[R₁] M₁ × M₂) = LinearMap.inr R₁ M₁ M₂

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₁ M₂]

↑(ContinuousLinearMap.inr R₁ M₁ M₂) = LinearMap.inr R₁ M₁ M₂


@[simp]
theorem partiallyWellOrderedOn_empty (r : α → α → Prop) : PartiallyWellOrderedOn ∅ r


protected theorem min_le_left (a b : Int) : min a b ≤ a


@[simp]
theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0

(i : (SetTheory.PGame.powHalf n).LeftMoves)

(SetTheory.PGame.powHalf n).moveLeft i = 0


@[mono]
theorem diag_mono : Monotone (diag : Finset α → Finset (α × α))


@[simp]
theorem add_apply (v : ι → M) : (f + g) v = f v + g v

{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 g : M [⋀^ι]→L[R] N)
[ContinuousAdd N]
(v : ι → M)


theorem ContDiffOn.congr (h : ContDiffOn 𝕜 n f s) (h₁ : ∀ x ∈ s, f₁ x = f x) :
    ContDiffOn 𝕜 n f₁ s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f f₁ : E → F}
{n : ℕ∞}
(h : ContDiffOn 𝕜 n f s)
(h₁ : ∀ x ∈ s, f₁ x = f x)


theorem prev_mem (h : x ∈ l) : l.prev x h ∈ l

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


theorem sSameSide_self_iff {s : AffineSubspace R P} {x : P} :
    s.SSameSide x x ↔ (s : Set P).Nonempty ∧ x ∉ s

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x : P}


/-- The map `Cocycle K L n → Cocycle (K⟦a⟧) L n'` when `n + a = n'`. -/
@[simps!]
def leftShift (γ : Cocycle K L n) (a n' : ℤ) (hn' : n + a = n') :
    Cocycle (K⟦a⟧) L n'

(γ : CochainComplex.HomComplex.Cocycle K L n)

↑(γ.leftShift a n' hn') = (↑γ).leftShift a n' hn'


theorem OrderIso.map_mem_maximals (f : s ≃o t) {x : α}
    (hx : x ∈ maximals (· ≤ ·) s) : (f ⟨x, hx.1⟩).val ∈ maximals (· ≤ ·) t

(hx : x ∈ maximals (fun x x_1 => x ≤ x_1) s)

↑(f ⟨x, ⋯⟩) ∈ maximals (fun x x_1 => x ≤ x_1) t


@[to_additive] lemma lt_of_mabs_lt : |a|ₘ < b → a < b

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


lemma D₁_shape (i₁₂ i₁₂' : I₁₂) (h₁₂ : ¬ c₁₂.Rel i₁₂ i₁₂') : K.D₁ c₁₂ i₁₂ i₁₂' = 0

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
(i₁₂ i₁₂' : I₁₂)
(h₁₂ : ¬c₁₂.Rel i₁₂ i₁₂')


/-- A variant of `Matrix.mvPolynomialX_map_eval₂` with a bundled `RingHom` on the LHS. -/
theorem mvPolynomialX_mapMatrix_eval [Fintype m] [DecidableEq m] [CommSemiring R]
    (A : Matrix m m R) :
    (MvPolynomial.eval fun p : m × m => A p.1 p.2).mapMatrix (mvPolynomialX m m R) = A

{m : Type u_1}
{R : Type u_3}
[Fintype m]
[DecidableEq m]
[CommSemiring R]
(A : Matrix m m R)

(MvPolynomial.eval fun p => A p.1 p.2).mapMatrix (Matrix.mvPolynomialX m m R) = A


@[simp]
theorem coe_toMultiset (l : List α) : (l : Cycle α).toMultiset = l


theorem isIso_ι_of_isInitial {j : J} (I : IsInitial j) (F : J ⥤ C) [HasColimit F]
    [∀ (i j : J) (f : i ⟶ j), IsIso (F.map f)] : IsIso (colimit.ι F j)

[∀ (i j : J) (f : i ⟶ j), CategoryTheory.IsIso (F.map f)]

CategoryTheory.IsIso (CategoryTheory.Limits.colimit.ι F j)


@[to_additive]
theorem image_mul_left' :
    image (fun b => a⁻¹ * b) t = preimage t (fun b => a * b) (mul_right_injective _).injOn

{α : Type u_2}
[DecidableEq α]
[Group α]
{t : Finset α}
{a : α}

Finset.image (fun b => a⁻¹ * b) t = t.preimage (fun b => a * b) ⋯


theorem CliqueFreeOn.of_succ (hs : G.CliqueFreeOn s (n + 1)) (ha : a ∈ s) :
    G.CliqueFreeOn (s ∩ G.neighborSet a) n

{α : Type u_1}
(G : SimpleGraph α)
{s : Set α}
{a : α}
{n : ℕ}
(hs : G.CliqueFreeOn s (n + 1))
(ha : a ∈ s)


@[simp] lemma add_succ_sub_one (m n : ℕ) : m + succ n - 1 = m + n


theorem one_lt_natDegree_of_irrational_root (hx : Irrational x) (p_nonzero : p ≠ 0)
    (x_is_root : aeval x p = 0) : 1 < p.natDegree

(x_is_root : (Polynomial.aeval x) p = 0)


@[to_additive]
theorem lift_comp_lift_eq {Q : Type*} [CommMonoid Q] (k : LocalizationMap S Q)
    {A : Type*} [CommMonoid A] {l : M →* A} (hl : ∀ w : S, IsUnit (l w)) :
    (k.lift hl).comp (f.lift k.map_units) = f.lift hl

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
{Q : Type u_4}
[AddCommMonoid Q]
(k : S.LocalizationMap Q)
{A : Type u_5}
[AddCommMonoid A]
{l : M →+ A}
(hl : ∀ (w : ↥S), IsAddUnit (l ↑w))


theorem openEmbedding {x : X} (U : OpenNhds x) : OpenEmbedding U.1.inclusion

{X : TopCat}
{x : ↑X}
(U : TopologicalSpace.OpenNhds x)


@[measurability]
theorem AEMeasurable.inf' (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (f ⊓ g) μ

{M : Type u_1}
[MeasurableSpace M]
{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → M}
[Inf M]
[MeasurableInf₂ M]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


theorem LE.le.disjoint_compl_left (h : b ≤ a) : Disjoint aᶜ b

{α : Type u_2}
[HeytingAlgebra α]
{a b : α}
(h : b ≤ a)


lemma cotangentSpaceBasis_apply i :
    P.cotangentSpaceBasis i = 1 ⊗ₜ .D _ _ (.X i)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Generators R S)
(i : P.vars)

P.cotangentSpaceBasis i = 1 ⊗ₜ[P.Ring] (KaehlerDifferential.D R P.Ring) (MvPolynomial.X i)


theorem hasBasis_nhdsSet_Iic_Iio (a : α) [h : Nonempty (Ioi a)] :
    HasBasis (𝓝ˢ (Iic a)) (a < ·) Iio

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
(a : α)
[h : Nonempty ↑(Set.Ioi a)]

(𝓝ˢ (Set.Iic a)).HasBasis (fun x => a < x) Set.Iio


/-- Two linear maps are equal if they are equal on basis vectors. -/
theorem ext {f₁ f₂ : M →ₛₗ[σ] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
{R₁ : Type u_10}
[Semiring R₁]
{σ : R →+* R₁}
{M₁ : Type u_11}
[AddCommMonoid M₁]
[Module R₁ M₁]
{f₁ f₂ : M →ₛₗ[σ] M₁}
(h : ∀ (i : ι), f₁ (b i) = f₂ (b i))


@[simp]
theorem nhdsSet_interior : 𝓝ˢ (interior s) = 𝓟 (interior s)

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


/-- The forgetful functor from `Factorisation f` to the underlying category `C`. -/
@[simps]
def forget : Factorisation f ⥤ C

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

CategoryTheory.Factorisation.forget.obj self = self.mid


@[simp] lemma sub_τ₃ (φ φ' : S₁ ⟶ S₂) : (φ - φ').τ₃ = φ.τ₃ - φ'.τ₃

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

(φ - φ').τ₃ = φ.τ₃ - φ'.τ₃


/-- A scheme `X` is locally Noetherian if `𝒪ₓ(U)` is Noetherian for all affine `U`. -/
class IsLocallyNoetherian (X : Scheme) : Prop where
  component_noetherian : ∀ (U : X.affineOpens),
    IsNoetherianRing Γ(X, U) := by infer_instance

[self : AlgebraicGeometry.IsLocallyNoetherian X]


@[simp] theorem measurableSet_inr_image {s : Set β} :
    MeasurableSet (Sum.inr '' s : Set (α ⊕ β)) ↔ MeasurableSet s

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{s : Set β}

MeasurableSet (Sum.inr '' s) ↔ MeasurableSet s


theorem WalkingParallelPairHom.id_comp
    {X Y : WalkingParallelPair} (g : WalkingParallelPairHom X Y) : comp (id X) g = g

{X Y : CategoryTheory.Limits.WalkingParallelPair}

(g : CategoryTheory.Limits.WalkingParallelPairHom X Y)

(CategoryTheory.Limits.WalkingParallelPairHom.id X).comp g = g


theorem preimage_eq_codom_of_domain_subset {s : Set α} (h : r.dom ⊆ s) : r.image s = r.codom

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)
{s : Set α}
(h : r.dom ⊆ s)


/-- One can get `f'' v w` as the limit of `h ^ (-2)` times the alternate sum of the values of `f`
along the vertices of a quadrilateral with sides `h v` and `h w` based at `x`.
In a setting where `f` is not guaranteed to be continuous at `f`, we can still
get this if we use a quadrilateral based at `h v + h w`. -/
theorem Convex.isLittleO_alternate_sum_square {v w : E} (h4v : x + (4 : ℝ) • v ∈ interior s)
    (h4w : x + (4 : ℝ) • w ∈ interior s) :
    (fun h : ℝ => f (x + h • (2 • v + 2 • w)) + f (x + h • (v + w))
        - f (x + h • (2 • v + w)) - f (x + h • (v + 2 • w)) - h ^ 2 • f'' v w) =o[𝓝[>] 0]
      fun h => h ^ 2

(hf : ∀ x ∈ interior s, HasFDerivAt f (f' x) x)

(hx : HasFDerivWithinAt f' f'' (interior s) x)


@[ext]
theorem Shrink.ext {α : Type v} [Small.{w} α] {x y : Shrink α}
    (w : (equivShrink _).symm x = (equivShrink _).symm y) : x = y

(w : (equivShrink α).symm x = (equivShrink α).symm y)


theorem toIcoDiv_zero_one (b : α) : toIcoDiv (zero_lt_one' α) 0 b = ⌊b⌋

{α : Type u_1}
[LinearOrderedField α]
[FloorRing α]
(b : α)


lemma surjective_up_to_refinements_of_epi (f : X ⟶ Y) [Epi f] {A : C} (y : A ⟶ Y) :
    ∃ (A' : C) (π : A' ⟶ A) (_ : Epi π) (x : A' ⟶ X), π ≫ y = x ≫ f

{C : Type u_2}
[CategoryTheory.Category.{u_1, u_2} C]
[CategoryTheory.Abelian C]
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.Epi f]
{A : C}
(y : A ⟶ Y)

∃ A' π,
  ∃ (_ : CategoryTheory.Epi π), ∃ x, CategoryTheory.CategoryStruct.comp π y = CategoryTheory.CategoryStruct.comp x f


@[simp]
theorem ofEquiv_F (F : Realizer α) (E : F.σ ≃ τ) (s : τ) : (F.ofEquiv E).F s = F.F (E.symm s)

{α : Type u_1}
{τ : Type u_4}
[TopologicalSpace α]
(F : Ctop.Realizer α)
(E : F.σ ≃ τ)
(s : τ)


theorem isOpen_iff_open_ball_subset {s : Set α} :
    IsOpen s ↔ ∀ x ∈ s, ∃ V ∈ 𝓤 α, IsOpen V ∧ ball x V ⊆ s

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

IsOpen s ↔ ∀ x ∈ s, ∃ V ∈ 𝓤 α, IsOpen V ∧ UniformSpace.ball x V ⊆ s


theorem isClosed_property3 [TopologicalSpace β] {e : α → β} {p : β → β → β → Prop}
    (he : DenseRange e) (hp : IsClosed { q : β × β × β | p q.1 q.2.1 q.2.2 })
    (h : ∀ a₁ a₂ a₃, p (e a₁) (e a₂) (e a₃)) : ∀ b₁ b₂ b₃, p b₁ b₂ b₃

(h : ∀ (a₁ a₂ a₃ : α), p (e a₁) (e a₂) (e a₃))


@[to_additive]
theorem map_le_iff_le_comap {f : F} {S : Submonoid M} {T : Submonoid N} :
    S.map f ≤ T ↔ S ≤ T.comap f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
{S : AddSubmonoid M}
{T : AddSubmonoid N}

AddSubmonoid.map f S ≤ T ↔ S ≤ AddSubmonoid.comap f T


/-- A morphism of modules that admits a linear retraction induces an injective morphism of
exterior algebras. -/
lemma map_injective {f : M →ₗ[R] N} (hf : ∃ (g : N →ₗ[R] M), g.comp f = LinearMap.id) :
    Function.Injective (map f)

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{N : Type u4}
[AddCommGroup N]
[Module R N]
{f : M →ₗ[R] N}
(hf : ∃ g, g ∘ₗ f = LinearMap.id)


/-- Constructor for short complexes in `ModuleCat.{v} R` taking as inputs
linear maps `f` and `g` and the vanishing of their composition. -/
@[simps]
def moduleCatMk {X₁ X₂ X₃ : Type v} [AddCommGroup X₁] [AddCommGroup X₂] [AddCommGroup X₃]
    [Module R X₁] [Module R X₂] [Module R X₃] (f : X₁ →ₗ[R] X₂) (g : X₂ →ₗ[R] X₃)
    (hfg : g.comp f = 0) : ShortComplex (ModuleCat.{v} R)

{R : Type u}
[Ring R]
{X₁ X₂ X₃ : Type v}
[AddCommGroup X₁]
[AddCommGroup X₂]
[AddCommGroup X₃]
[Module R X₁]
[Module R X₂]
[Module R X₃]
(f : X₁ →ₗ[R] X₂)
(g : X₂ →ₗ[R] X₃)
(hfg : g ∘ₗ f = 0)

(CategoryTheory.ShortComplex.moduleCatMk f g hfg).g = ModuleCat.ofHom g


theorem tsum_le_tsum_comp_of_surjective {f : α → β} (hf : Surjective f) (g : β → ℝ≥0∞) :
    ∑' y, g y ≤ ∑' x, g (f x)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Surjective f)
(g : β → ℝ≥0∞)


theorem ContDiffWithinAt.sin {n} (hf : ContDiffWithinAt ℝ n f s x) :
    ContDiffWithinAt ℝ n (fun x => Real.sin (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt ℝ n f s x)


@[to_additive (attr := simp)]
theorem coe_submonoidMap_apply (e : M ≃* N) (S : Submonoid M) (g : S) :
    ((submonoidMap e S g : S.map (e : M →* N)) : N) = e g

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(e : M ≃+ N)
(S : AddSubmonoid M)
(g : ↥S)


lemma finSuccAboveOrderIso_apply (p : Fin (n + 1)) (i : Fin n) :
    finSuccAboveOrderIso p i = ⟨p.succAbove i, p.succAbove_ne i⟩

(finSuccAboveOrderIso p) i = ⟨p.succAbove i, ⋯⟩


@[simp]
theorem image_univ_equiv [Fintype β] (f : β ≃ α) : univ.image f = univ

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq α]
[Fintype β]
(f : β ≃ α)

Finset.image (⇑f) Finset.univ = Finset.univ


/-- A Lie algebra is simple if it is irreducible as a Lie module over itself via the adjoint
action, and it is non-Abelian. -/
class IsSimple : Prop where
  eq_bot_or_eq_top : ∀ I : LieIdeal R L, I = ⊥ ∨ I = ⊤
  non_abelian : ¬IsLieAbelian L

(R : Type u_1)
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[self : LieAlgebra.IsSimple R L]


/-- Equivalent types give rise to multiplicatively equivalent free groups.

The converse can be found in `GroupTheory.FreeAbelianGroupFinsupp`,
as `Equiv.of_freeGroupEquiv`
 -/
@[to_additive (attr := simps apply)
  "Equivalent types give rise to additively equivalent additive free groups."]
def freeGroupCongr {α β} (e : α ≃ β) : FreeGroup α ≃* FreeGroup β

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

(FreeAddGroup.freeAddGroupCongr e) a = (FreeAddGroup.map ⇑e) a


/-- A helper lemma used to prove that the (scalar or usual) product of a function that tends to one
and a bounded function tends to one. This lemma is formulated for any binary operation
`op : E → F → G` with an estimate `‖op x y‖ ≤ ‖x‖ * ‖y‖` instead of multiplication so that it
can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`. -/
@[to_additive "A helper lemma used to prove that the (scalar or usual) product of a function that
tends to zero and a bounded function tends to zero. This lemma is formulated for any binary
operation `op : E → F → G` with an estimate `‖op x y‖ ≤ ‖x‖ * ‖y‖` instead of multiplication so
that it can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`."]
theorem Filter.Tendsto.op_one_isBoundedUnder_le {f : α → E} {g : α → F} {l : Filter α}
    (hf : Tendsto f l (𝓝 1)) (hg : IsBoundedUnder (· ≤ ·) l (Norm.norm ∘ g)) (op : E → F → G)
    (h_op : ∀ x y, ‖op x y‖ ≤ ‖x‖ * ‖y‖) : Tendsto (fun x => op (f x) (g x)) l (𝓝 1)

(hg : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ g))

(h_op : ∀ (x : E) (y : F), ‖op x y‖ ≤ ‖x‖ * ‖y‖)

Filter.Tendsto (fun x => op (f x) (g x)) l (𝓝 1)


@[simp]
theorem aevalTower_comp_C : (aevalTower g y : MvPolynomial σ R →+* A).comp C = g

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{S : Type u_2}
{A : Type u_3}
[CommSemiring S]
[CommSemiring A]
[Algebra S R]
[Algebra S A]
(g : R →ₐ[S] A)
(y : σ → A)

(↑(MvPolynomial.aevalTower g y)).comp MvPolynomial.C = ↑g


@[simp]
lemma ringHomComp_one (f : R' →+* R'') : (1 : MulChar R R').ringHomComp f = 1

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


theorem orderIsoRpow_symm_apply (y : ℝ) (hy : 0 < y) :
    (orderIsoRpow y hy).symm = orderIsoRpow (1 / y) (one_div_pos.2 hy)

(ENNReal.orderIsoRpow y hy).symm = ENNReal.orderIsoRpow (1 / y) ⋯


/-- `PreordToPartOrd` and `OrderDual` commute. -/
@[simps! inv_app_coe, simps! (config := .lemmasOnly) hom_app_coe]
def preordToPartOrdCompToDualIsoToDualCompPreordToPartOrd :
    preordToPartOrd.{u} ⋙ PartOrd.dual ≅ Preord.dual ⋙ preordToPartOrd

(a : ↑((preordToPartOrd ⋙ PartOrd.dual).obj X))

(preordToPartOrdCompToDualIsoToDualCompPreordToPartOrd.hom.app X) a = (OrderIso.dualAntisymmetrization ↑X) a


theorem Nonempty.of_vsub_right : (s -ᵥ t : Finset α).Nonempty → t.Nonempty

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


theorem apply_eq_of_mem_graph {a : α} {m : M} {f : α →₀ M} (h : (a, m) ∈ f.graph) : f a = m

{α : Type u_1}
{M : Type u_5}
[Zero M]
{a : α}
{m : M}
{f : α →₀ M}
(h : (a, m) ∈ f.graph)


/-- If there is an element with norm different from `0`, then the norm of the identity equals `1`.
(Since we are working with seminorms supposing that the space is non-trivial is not enough.) -/
theorem norm_id_of_nontrivial_seminorm (h : ∃ x : V, ‖x‖ ≠ 0) : ‖id V‖ = 1

(V : Type u_1)
[SeminormedAddCommGroup V]
(h : ∃ x, ‖x‖ ≠ 0)


@[simp]
theorem mkHom_f_1 : (mkHom P Q zero one one_zero_comm succ).f 1 = one

(one_zero_comm : one ≫ Q.d 1 0 = P.d 1 0 ≫ zero)

(P.mkHom Q zero one one_zero_comm succ).f 1 = one


/-- A direct sum of copies of an `Algebra` inherits the algebra structure.

-/
@[simps]
instance Algebra.directSumGAlgebra {R A : Type*} [DecidableEq ι] [AddMonoid ι] [CommSemiring R]
    [Semiring A] [Algebra R A] : DirectSum.GAlgebra R fun _ : ι => A

{ι : Type uι}
{R : Type u_1}
{A : Type u_2}
[DecidableEq ι]
[AddMonoid ι]
[CommSemiring R]
[Semiring A]
[Algebra R A]

∀ (a : R), DirectSum.GAlgebra.toFun a = (↑↑(algebraMap R A)).toFun a


@[simp] lemma singleton_infs : {a} ⊼ t = t.image (a ⊓ ·)

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

{a} ⊼ t = Finset.image (fun x => a ⊓ x) t


theorem isCobounded_principal (s : Set α) :
    (𝓟 s).IsCobounded r ↔ ∃ b, ∀ a, (∀ x ∈ s, r x a) → r b a

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

Filter.IsCobounded r (𝓟 s) ↔ ∃ b, ∀ (a : α), (∀ x ∈ s, r x a) → r b a


/-- The restriction map from `α →ᵤ[𝔖] β` to `⋃₀ 𝔖 → β` is uniformly continuous. -/
theorem uniformContinuous_restrict_toFun :
    UniformContinuous ((⋃₀ 𝔖).restrict ∘ toFun 𝔖 : (α →ᵤ[𝔖] β) → ⋃₀ 𝔖 → β)

{α : Type u_1}
{β : Type u_2}
[UniformSpace β]
{𝔖 : Set (Set α)}

UniformContinuous ((⋃₀ 𝔖).restrict ∘ ⇑(UniformOnFun.toFun 𝔖))


@[simp]
theorem sum_single [∀ i, AddCommMonoid (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] {f : Π₀ i, β i} :
    f.sum single = f

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


@[simp, norm_cast] lemma up_nnratCast [NNRatCast α] (q : ℚ≥0) : up (q : α) = q


@[simp] lemma disjointSigma_base_iff {h B} :
    (Matroid.disjointSigma M h).Base B ↔
      (∀ i, (M i).Base (B ∩ (M i).E)) ∧ B ⊆ ⋃ i, (M i).E

{h : Pairwise (Disjoint on fun i => (M i).E)}

(Matroid.disjointSigma M h).Base B ↔ (∀ (i : ι), (M i).Base (B ∩ (M i).E)) ∧ B ⊆ ⋃ i, (M i).E


@[simp]
theorem toNat_coe (n : ℕ) : toNat n = n


@[to_additive (attr := simp)]
theorem clift_comp_mk (f : FreeMonoid (M ⊕ N) →* P) (hM₁ hN₁ hM hN) :
    (clift f hM₁ hN₁ hM hN).comp mk = f

(hM₁ : f (FreeMonoid.of (Sum.inl 1)) = 1)

(hN₁ : f (FreeMonoid.of (Sum.inr 1)) = 1)

(hM : ∀ (x y : M), f (FreeMonoid.of (Sum.inl (x * y))) = f (FreeMonoid.of (Sum.inl x) * FreeMonoid.of (Sum.inl y)))

(hN : ∀ (x y : N), f (FreeMonoid.of (Sum.inr (x * y))) = f (FreeMonoid.of (Sum.inr x) * FreeMonoid.of (Sum.inr y)))

(Monoid.Coprod.clift f hM₁ hN₁ hM hN).comp Monoid.Coprod.mk = f


theorem epi_iff_cancel_zero {P Q : C} (f : P ⟶ Q) :
    Epi f ↔ ∀ (R : C) (g : Q ⟶ R), f ≫ g = 0 → g = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{P Q : C}
(f : P ⟶ Q)

CategoryTheory.Epi f ↔ ∀ (R : C) (g : Q ⟶ R), f ≫ g = 0 → g = 0


theorem cast_mul (h : m ∣ n) (a b : ZMod n) : (cast (a * b : ZMod n) : R) = cast a * cast b

{n : ℕ}
{R : Type u_1}
[Ring R]
{m : ℕ}
[CharP R m]
(h : m ∣ n)
(a b : ZMod n)


@[simp, norm_cast]
theorem coe_eq_coe {x y : ℝ} : (x : ℝ*) = y ↔ x = y


@[simp]
theorem isConj_iff {a b : α} : IsConj a b ↔ ∃ c : α, c * a * c⁻¹ = b


/-- If `f` has a local max on `s` at `a`, `f'` is a derivative of `f` at `a` within `s`, and
both `y` and `-y` belong to the positive tangent cone of `s` at `a`, then `f' y ≤ 0`. -/
theorem IsLocalMinOn.hasFDerivWithinAt_eq_zero (h : IsLocalMinOn f s a)
    (hf : HasFDerivWithinAt f f' s a) (hy : y ∈ posTangentConeAt s a)
    (hy' : -y ∈ posTangentConeAt s a) : f' y = 0

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{s : Set E}
{a y : E}
(h : IsLocalMinOn f s a)
(hf : HasFDerivWithinAt f f' s a)
(hy : y ∈ posTangentConeAt s a)
(hy' : -y ∈ posTangentConeAt s a)


@[to_additive (attr := simp)]
lemma leOnePart_eq_one : a⁻ᵐ = 1 ↔ 1 ≤ a

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


theorem boundary_sup_le : ∂ (a ⊔ b) ≤ ∂ a ⊔ ∂ b

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

∂ (a ⊔ b) ≤ ∂ a ⊔ ∂ b


theorem sum_mul_sum_eq_sum_perm (hσ : σ.IsCycleOn s) (f g : ι → α) :
    ((∑ i ∈ s, f i) * ∑ i ∈ s, g i) = ∑ k ∈ range s.card, ∑ i ∈ s, f i * g ((σ ^ k) i)

{ι : Type u_1}
{α : Type u_2}
[Semiring α]
{s : Finset ι}
{σ : Equiv.Perm ι}
(hσ : σ.IsCycleOn ↑s)
(f g : ι → α)

(∑ i ∈ s, f i) * ∑ i ∈ s, g i = ∑ k ∈ Finset.range s.card, ∑ i ∈ s, f i * g ((σ ^ k) i)


{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


theorem mem_span_pow {x y : S} {d : ℕ} (hd : d ≠ 0) :
    y ∈ Submodule.span R (Set.range fun i : Fin d => x ^ (i : ℕ)) ↔
      ∃ f : R[X], f.natDegree < d ∧ y = aeval x f

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{x y : S}
{d : ℕ}
(hd : d ≠ 0)

y ∈ Submodule.span R (Set.range fun i => x ^ ↑i) ↔ ∃ f, f.natDegree < d ∧ y = (Polynomial.aeval x) f


theorem sub_apply {D1 D2 : LieDerivation R L M} : (D1 - D2) a = D1 a - D2 a

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(a : L)
{D1 D2 : LieDerivation R L M}


theorem Periodic.sub_antiperiod_eq [AddGroup α] [InvolutiveNeg β] (h1 : Periodic f c₁)
    (h2 : Antiperiodic f c₂) : f (c₁ - c₂) = -f 0

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c₁ c₂ : α}
[AddGroup α]
[InvolutiveNeg β]
(h1 : Function.Periodic f c₁)
(h2 : Function.Antiperiodic f c₂)


theorem generateFrom_singleton_univ : generateFrom {Set.univ} = (⊥ : MeasurableSpace α)

MeasurableSpace.generateFrom {Set.univ} = ⊥


theorem translationNumber_le_of_le_add_int {x : ℝ} {m : ℤ} (h : f x ≤ x + m) : τ f ≤ m

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℤ}
(h : f x ≤ x + ↑m)


@[simp]
lemma map_zero : (0 : Cochain K L n).map Φ = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(K L : CochainComplex C ℤ)
(n : ℤ)
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive D]
(Φ : C ⥤ D)
[Φ.Additive]

CochainComplex.HomComplex.Cochain.map 0 Φ = 0


@[to_additive]
theorem mul_lt_of_le_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]


theorem invOf_fromBlocks_zero₂₁_eq (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α)
    [Invertible A] [Invertible D] [Invertible (fromBlocks A B 0 D)] :
    ⅟ (fromBlocks A B 0 D) = fromBlocks (⅟ A) (-(⅟ A * B * ⅟ D)) 0 (⅟ D)

[Invertible (Matrix.fromBlocks A B 0 D)]

⅟(Matrix.fromBlocks A B 0 D) = Matrix.fromBlocks (⅟A) (-(⅟A * B * ⅟D)) 0 ⅟D


theorem Nat.noZeroSMulDivisors
    (R) (M) [Semiring R] [CharZero R] [AddCommMonoid M] [Module R M] [NoZeroSMulDivisors R M] :
    NoZeroSMulDivisors ℕ M

(R : Type u_9)
(M : Type u_10)
[Semiring R]
[CharZero R]
[AddCommMonoid M]
[Module R M]
[NoZeroSMulDivisors R M]


lemma exists_walk_of_dist_ne_zero (h : G.dist u v ≠ 0) :
    ∃ p : G.Walk u v, p.length = G.dist u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(h : G.dist u v ≠ 0)


@[simp] theorem size_push (a : Array α) (v : α) : (push a v).size = a.size + 1


@[to_additive]
theorem sec_spec {f : LocalizationMap S N} (z : N) :
    z * f.toMap (f.sec z).2 = f.toMap (f.sec z).1

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f : S.LocalizationMap N}
(z : N)

z * f.toMap ↑(f.sec z).2 = f.toMap (f.sec z).1


/-- The `Lp`-norm of a bounded continuous function is at most a constant (depending on the measure
of the whole space) times its sup-norm. -/
theorem Lp_norm_le (f : α →ᵇ E) :
    ‖(⟨f.toContinuousMap.toAEEqFun μ, mem_Lp f⟩ : Lp E p μ)‖ ≤
      measureUnivNNReal μ ^ p.toReal⁻¹ * ‖f‖

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[MeasureTheory.IsFiniteMeasure μ]
(f : α →ᵇ E)

‖⟨ContinuousMap.toAEEqFun μ f.toContinuousMap, ⋯⟩‖ ≤ ↑(MeasureTheory.measureUnivNNReal μ) ^ p.toReal⁻¹ * ‖f‖


/-- Sophie Germain's identity, see <https://www.cut-the-knot.org/blue/SophieGermainIdentity.shtml>.
-/
theorem pow_four_add_four_mul_pow_four :
    a ^ 4 + 4 * b ^ 4 = ((a - b) ^ 2 + b ^ 2) * ((a + b) ^ 2 + b ^ 2)


theorem iInter_setOf_subset {ι : Type*} (S : ι → L[[α]].Theory) :
    ⋂ i : ι, { p : T.CompleteType α | S i ⊆ p } =
      { p : T.CompleteType α | ⋃ i : ι, S i ⊆ p }

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{ι : Type u_1}
(S : ι → L[[α]].Theory)

⋂ i, {p | S i ⊆ ↑p} = {p | ⋃ i, S i ⊆ ↑p}


@[to_additive sum_lt_sum_of_nonempty]
lemma prod_lt_prod_of_nonempty' (hs : s ≠ ∅) (hfg : ∀ i ∈ s, f i < g i) :
    (s.map f).prod < (s.map g).prod

{ι : Type u_1}
{α : Type u_2}
[OrderedCancelAddCommMonoid α]
{s : Multiset ι}
{f g : ι → α}
(hs : s ≠ ∅)
(hfg : ∀ i ∈ s, f i < g i)

(Multiset.map f s).sum < (Multiset.map g s).sum


theorem natDegree_add_le (p q : R[X]) : natDegree (p + q) ≤ max (natDegree p) (natDegree q)

(p + q).natDegree ≤ max p.natDegree q.natDegree


theorem Iic_ofDual (a : αᵒᵈ) : Iic (ofDual a) = (Ici a).map ofDual.toEmbedding

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderBot α]
(a : αᵒᵈ)

Finset.Iic (OrderDual.ofDual a) = Finset.map OrderDual.ofDual.toEmbedding (Finset.Ici a)


@[simp]
theorem deriv_arccos : deriv arccos = fun x => -(1 / √(1 - x ^ 2))

deriv Real.arccos = fun x => -(1 / √(1 - x ^ 2))


theorem ne_and_ne_of_swap_mul_apply_ne_self {f : Perm α} {x y : α} (hy : (swap x (f x) * f) y ≠ y) :
    f y ≠ y ∧ y ≠ x

{α : Type u_1}
[DecidableEq α]
{f : Equiv.Perm α}
{x y : α}
(hy : (Equiv.swap x (f x) * f) y ≠ y)


theorem Ici_toDual (a : α) : Ici (toDual a) = (Iic a).map toDual.toEmbedding

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

Finset.Ici (OrderDual.toDual a) = Finset.map OrderDual.toDual.toEmbedding (Finset.Iic a)


theorem exposed_point_def :
    x ∈ A.exposedPoints 𝕜 ↔ x ∈ A ∧ ∃ l : E →L[𝕜] 𝕜, ∀ y ∈ A, l y ≤ l x ∧ (l x ≤ l y → y = x)

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace 𝕜]
[OrderedRing 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
{A : Set E}
{x : E}

x ∈ Set.exposedPoints 𝕜 A ↔ x ∈ A ∧ ∃ l, ∀ y ∈ A, l y ≤ l x ∧ (l x ≤ l y → y = x)


/-- A point in `K` with the orthogonality property (here characterized in terms of `Kᗮ`) must be the
orthogonal projection. -/
theorem eq_orthogonalProjection_of_mem_orthogonal' {u v z : E}
    (hv : v ∈ K) (hz : z ∈ Kᗮ) (hu : u = v + z) : (orthogonalProjection K u : E) = v

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
{u v z : E}
(hv : v ∈ K)
(hz : z ∈ Kᗮ)
(hu : u = v + z)


lemma measurable_stieltjesOfMeasurableRat (hf : Measurable f) (x : ℝ) :
    Measurable fun a ↦ stieltjesOfMeasurableRat f hf a x

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

Measurable fun a => ↑(ProbabilityTheory.stieltjesOfMeasurableRat f hf a) x


@[simp] lemma supClosure_eq_self : supClosure s = s ↔ SupClosed s

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


theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
    (h : (sphere (0 : E) 1).Pairwise fun x y => ‖x + y‖ ≠ 2) : StrictConvexSpace ℝ E

(h : (Metric.sphere 0 1).Pairwise fun x y => ‖x + y‖ ≠ 2)


theorem HasDerivAt.csinh (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => Complex.sinh (f x)) (Complex.cosh (f x) * f') x

{f : ℂ → ℂ}
{f' x : ℂ}
(hf : HasDerivAt f f' x)


theorem killCompl_C (r : R) : killCompl hf (C r) = C r

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_4}
[CommSemiring R]
{f : σ → τ}
(hf : Function.Injective f)
(r : R)

(MvPolynomial.killCompl hf) (MvPolynomial.C r) = MvPolynomial.C r


lemma logDeriv_fun_zpow {f : 𝕜 → 𝕜'} {x : 𝕜} (hdf : DifferentiableAt 𝕜 f x) (n : ℤ) :
    logDeriv (f · ^ n) x = n * logDeriv f x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{f : 𝕜 → 𝕜'}
{x : 𝕜}
(hdf : DifferentiableAt 𝕜 f x)
(n : ℤ)

logDeriv (fun x => f x ^ n) x = ↑n * logDeriv f x


lemma chromaticNumber_eq_iff_forall_surjective (hG : G.Colorable n) :
    G.chromaticNumber = n ↔ ∀ C : G.Coloring (Fin n), Surjective C

{V : Type u}
{G : SimpleGraph V}
{n : ℕ}
(hG : G.Colorable n)

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


theorem eq_zero_or_eq_zero_of_mul_eq_zero [NoZeroDivisors R] (φ ψ : R⟦X⟧) (h : φ * ψ = 0) :
    φ = 0 ∨ ψ = 0

{R : Type u_1}
[Ring R]
[NoZeroDivisors R]
(φ ψ : PowerSeries R)
(h : φ * ψ = 0)


theorem tendsto_atTop_of_add_bdd_above_left (C) (hC : ∀ x, f x ≤ C) :
    Tendsto (fun x => f x + g x) l atTop → Tendsto g l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedCancelAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(C : β)
(hC : ∀ (x : α), f x ≤ C)

Filter.Tendsto (fun x => f x + g x) l Filter.atTop → Filter.Tendsto g l Filter.atTop


theorem iIndep_comap_mem_iff {f : ι → Set Ω} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} :
    iIndep (fun i => MeasurableSpace.comap (· ∈ f i) ⊤) κ μ ↔ iIndepSet f κ μ

{α : Type u_1}
{Ω : Type u_2}
{ι : Type u_3}
{_mα : MeasurableSpace α}
{f : ι → Set Ω}
{_mΩ : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μ : MeasureTheory.Measure α}

ProbabilityTheory.Kernel.iIndep (fun i => MeasurableSpace.comap (fun x => x ∈ f i) ⊤) κ μ ↔
  ProbabilityTheory.Kernel.iIndepSet f κ μ


/-- A perfect pairing of two (left) modules over a commutative ring. -/
structure PerfectPairing :=
  toLin : M →ₗ[R] N →ₗ[R] R
  bijectiveLeft : Bijective toLin
  bijectiveRight : Bijective toLin.flip

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(self : PerfectPairing R M N)


@[to_additive Iic_add_Iic_subset]
theorem Iic_mul_Iic_subset' [LocallyFiniteOrderBot α] (a b : α) : Iic a * Iic b ⊆ Iic (a * b)

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

[CovariantClass α α (Function.swap HMul.hMul) LE.le]

Finset.Iic a * Finset.Iic b ⊆ Finset.Iic (a * b)


@[norm_cast]
theorem coe_sInf (s : Set ℝ≥0) : (↑(sInf s) : ℝ) = sInf (((↑) : ℝ≥0 → ℝ) '' s)


theorem eq_of_edist_zero_on {f f' : α → E} {s : Set α} (h : ∀ ⦃x⦄, x ∈ s → edist (f x) (f' x) = 0) :
    eVariationOn f s = eVariationOn f' s

(h : ∀ ⦃x : α⦄, x ∈ s → edist (f x) (f' x) = 0)


/-- Reindexing both indices along the same equivalence preserves the determinant.

For the `simp` version of this lemma, see `det_submatrix_equiv_self`; this one is unsuitable because
`Matrix.reindex_apply` unfolds `reindex` first.
-/
theorem det_reindex_self (e : m ≃ n) (A : Matrix m m R) : det (reindex e e A) = det A

{m : Type u_1}
{n : Type u_2}
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
{R : Type v}
[CommRing R]
(e : m ≃ n)
(A : Matrix m m R)


/-- Note: the "obvious" statement `(piCongrLeft P e) f b = f (e.symm b)` doesn't typecheck: the
LHS would have type `P b` while the RHS would have type `P (e (e.symm b))`. For that reason,
we have to explicitly substitute along `e (e.symm b) = b` in the statement of this lemma. -/
@[simp]
lemma piCongrLeft_apply (f : ∀ a, P (e a)) (b : β) :
    (piCongrLeft P e) f b = e.apply_symm_apply b ▸ f (e.symm b)

{β : Sort u_1}
{α : Sort u_2}
(P : β → Sort w)
(e : α ≃ β)
(f : (a : α) → P (e a))
(b : β)

(Equiv.piCongrLeft P e) f b = ⋯ ▸ f (e.symm b)


@[to_additive comap_norm_nhdsWithin_Ioi_zero]
lemma comap_norm_nhdsWithin_Ioi_zero' : comap norm (𝓝[>] 0) = 𝓝[≠] (1 : E)


@[simp]
protected lemma minOrder {n : ℕ} (hn : n ≠ 0) (hn₁ : n ≠ 1) : minOrder (ZMod n) = n.minFac


theorem iInf_ite (f g : ι → α) :
    ⨅ i, (if p i then f i else g i) = (⨅ (i) (_ : p i), f i) ⊓ ⨅ (i) (_ : ¬p i), g i

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
(p : ι → Prop)
[DecidablePred p]
(f g : ι → α)

(⨅ i, if p i then f i else g i) = (⨅ i, ⨅ (_ : p i), f i) ⊓ ⨅ i, ⨅ (_ : ¬p i), g i


lemma coeFn_mk (μ : Measure Ω) (hμ) :
    DFunLike.coe (F := FiniteMeasure Ω) ⟨μ, hμ⟩ = fun s ↦ (μ s).toNNReal

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.Measure Ω)
(hμ : MeasureTheory.IsFiniteMeasure μ)


/-- When shifts are indexed by an additive commutative monoid, then shifts commute. -/
theorem shiftComm' (i j : A) :
    f⟦i⟧'⟦j⟧' = (shiftComm _ _ _).hom ≫ f⟦j⟧'⟦i⟧' ≫ (shiftComm _ _ _).hom

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddCommMonoid A]
[CategoryTheory.HasShift C A]
{X Y : C}
(f : X ⟶ Y)
(i j : A)

(CategoryTheory.shiftFunctor C j).map ((CategoryTheory.shiftFunctor C i).map f) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.shiftComm X i j).hom
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.shiftFunctor C i).map ((CategoryTheory.shiftFunctor C j).map f))
      (CategoryTheory.shiftComm Y j i).hom)


/-- Bijection between a subalgebra `S` and `MulOpposite` of its opposite. -/
@[simps!]
def algEquivOpMop (S : Subalgebra R A) : S ≃ₐ[R] (S.op)ᵐᵒᵖ

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)

∀ (a : ↥S.toSubsemiring), S.algEquivOpMop a = MulOpposite.op (S.addEquivOp a)


/-- The limit cone for the product over an index type with exactly one term. -/
@[simps]
def limitConeOfUnique : LimitCone (Discrete.functor f)

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
[Unique β]
(f : β → C)

(CategoryTheory.Limits.limitConeOfUnique f).cone.π =
  CategoryTheory.Discrete.natTrans fun x =>
    match x with
    | { as := j } => CategoryTheory.eqToHom ⋯


theorem right_mem_Ico : b ∈ Ico a b ↔ False


theorem ExpChar.exists_unique [Ring R] [IsDomain R] : ∃! q, ExpChar R q


theorem not_lt_min {r : α → α → Prop} (H : WellFounded r) (s : Set α) (h : s.Nonempty) {x}
    (hx : x ∈ s) : ¬r x (H.min s h)

{α : Type u_1}
{r : α → α → Prop}
(H : WellFounded r)
(s : Set α)
(h : s.Nonempty)
{x : α}
(hx : x ∈ s)


protected theorem mem_cellsOfRowLens {w : List ℕ} {c : ℕ × ℕ} :
    c ∈ YoungDiagram.cellsOfRowLens w ↔ ∃ h : c.fst < w.length, c.snd < w.get ⟨c.fst, h⟩

c ∈ YoungDiagram.cellsOfRowLens w ↔ ∃ (h : c.1 < w.length), c.2 < w.get ⟨c.1, h⟩


@[simp]
theorem empty_toList_eq_ff (v : Vector α (n + 1)) : v.toList.isEmpty = false

{n : ℕ}
{α : Type u_1}
(v : Mathlib.Vector α (n + 1))


/-- If all elements of a `Finset` satisfy the predicate `p`,
`s.subtype p` converts back to `s` with `Embedding.subtype`. -/
theorem subtype_map_of_mem {p : α → Prop} [DecidablePred p] {s : Finset α} (h : ∀ x ∈ s, p x) :
    (s.subtype p).map (Embedding.subtype _) = s

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Finset α}
(h : ∀ x ∈ s, p x)

Finset.map (Function.Embedding.subtype p) (Finset.subtype p s) = s


/-- Constructor for simple graphs using a symmetric irreflexive boolean function. -/
@[simps]
def SimpleGraph.mk' {V : Type u} :
    {adj : V → V → Bool // (∀ x y, adj x y = adj y x) ∧ (∀ x, ¬ adj x x)} ↪ SimpleGraph V

(x : { adj // (∀ (x y : V), adj x y = adj y x) ∧ ∀ (x : V), ¬adj x x = true })

(SimpleGraph.mk' x).Adj v w = (↑x v w = true)


/-- An injective sequence `f : ℕ → ℕ` tends to infinity at infinity. -/
theorem Function.Injective.nat_tendsto_atTop {f : ℕ → ℕ} (hf : Injective f) :
    Tendsto f atTop atTop

Filter.Tendsto f Filter.atTop Filter.atTop


theorem edgeFinset_replaceVertex_of_adj (ha : G.Adj s t) : (G.replaceVertex s t).edgeFinset =
    (G.edgeFinset \ G.incidenceFinset t ∪ (G.neighborFinset s).image (s(·, t))) \ {s(t, t)}

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

(G.replaceVertex s t).edgeFinset =
  (G.edgeFinset \ G.incidenceFinset t ∪ Finset.image (fun x => s(x, t)) (G.neighborFinset s)) \ {s(t, t)}


theorem stronglyMeasurable_condexpKernel {s : Set Ω} (hs : MeasurableSet s) :
    StronglyMeasurable[m] fun ω => condexpKernel μ m ω s

{Ω : Type u_1}
{m : MeasurableSpace Ω}
[mΩ : MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
{s : Set Ω}
(hs : MeasurableSet s)

MeasureTheory.StronglyMeasurable fun ω => ((ProbabilityTheory.condexpKernel μ m) ω) s


@[to_additive IsUpperSet.cthickening]
protected theorem IsUpperSet.cthickening' (hs : IsUpperSet s) (ε : ℝ) :
    IsUpperSet (cthickening ε s)

{α : Type u_1}
[NormedOrderedAddGroup α]
{s : Set α}
(hs : IsUpperSet s)
(ε : ℝ)


@[simp]
theorem totalDegree_C (a : R) : (C a : MvPolynomial σ R).totalDegree = 0

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


/-- The natural isomorphism from the composition of restrictions along homomorphisms
to the restriction along the composition of homomorphism.
-/
@[simps!]
def resComp {G H K : MonCat} (f : G ⟶ H) (g : H ⟶ K) : res V g ⋙ res V f ≅ res V (f ≫ g)

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
{G H K : MonCat}
(f : G ⟶ H)
(g : H ⟶ K)
(X : Action V K)

((Action.resComp V f g).hom.app X).hom = 𝟙 X.V


/-- If a family is affinely independent, so is any subfamily indexed
by a subtype of the index type. -/
protected theorem AffineIndependent.subtype {p : ι → P} (ha : AffineIndependent k p) (s : Set ι) :
    AffineIndependent k fun i : s => p i

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{p : ι → P}
(ha : AffineIndependent k p)
(s : Set ι)


@[simp]
theorem set_coe_cast :
    ∀ {s t : Set α} (H' : s = t) (H : ↥s = ↥t) (x : s), cast H x = ⟨x.1, H' ▸ x.2⟩

{α : Type u}
{s t : Set α}
(H' : s = t)
(H : ↑s = ↑t)
(x : ↑s)


@[simp]
theorem comapSMul_single (g : G) (a : α) (b : M) : g • single a b = single (g • a) b

{α : Type u_1}
{M : Type u_5}
{G : Type u_9}
[Monoid G]
[MulAction G α]
[AddCommMonoid M]
(g : G)
(a : α)
(b : M)

g • Finsupp.single a b = Finsupp.single (g • a) b


theorem principal_le_nhdsSet : 𝓟 s ≤ 𝓝ˢ s

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


@[simp] lemma sum_indep_iff (M : Matroid α) (N : Matroid β) {I : Set (α ⊕ β)} :
    (M.sum N).Indep I ↔ M.Indep (.inl ⁻¹' I) ∧ N.Indep (.inr ⁻¹' I)

{α : Type u}
{β : Type v}
(M : Matroid α)
(N : Matroid β)
{I : Set (α ⊕ β)}

(M.sum N).Indep I ↔ M.Indep (Sum.inl ⁻¹' I) ∧ N.Indep (Sum.inr ⁻¹' I)


theorem min_lt_of_left_lt (h : a < c) : min a b < c

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


@[simp, measurability]
theorem measurableSet_Ioo : MeasurableSet (Ioo a b)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{a b : α}


@[to_additive (attr := simp)]
theorem coe_singletonMonoidHom : (singletonMonoidHom : α → Finset α) = singleton

{α : Type u_2}
[DecidableEq α]
[AddZeroClass α]


lemma map_id (i : ℕ) : map f i i (by omega) = 𝟙 _

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X : ℕ → C}
(f : (n : ℕ) → X n ⟶ X (n + 1))
(i : ℕ)

CategoryTheory.Functor.OfSequence.map f i i ⋯ = CategoryTheory.CategoryStruct.id (X i)


@[simp]
theorem mk'_self {x : R} (hx : x ∈ M) : mk' S x ⟨x, hx⟩ = 1

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{x : R}
(hx : x ∈ M)


@[simp]
theorem isCaratheodory_empty : IsCaratheodory m ∅

{α : Type u}
(m : MeasureTheory.OuterMeasure α)


/-- A functor `G : (C, J) ⥤ (D, K)` is cover dense if for each object in `D`,
  there exists a covering sieve in `D` that factors through images of `G`.

This definition can be found in https://ncatlab.org/nlab/show/dense+sub-site Definition 2.2.
-/
class Functor.IsCoverDense (G : C ⥤ D) (K : GrothendieckTopology D) : Prop where
  is_cover : ∀ U : D, Sieve.coverByImage G U ∈ K U

{K : CategoryTheory.GrothendieckTopology D}

CategoryTheory.Sieve.coverByImage G U ∈ K.sieves U


@[simp]
theorem mul_invSelf : algebraMap R S x * invSelf x = 1

{R : Type u_1}
[CommSemiring R]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
(x : R)
[IsLocalization.Away x S]

(algebraMap R S) x * IsLocalization.Away.invSelf x = 1


theorem quadratic_reciprocity_if {a b : ℕ} (ha2 : a % 2 = 1) (hb2 : b % 2 = 1) :
    (if a % 4 = 3 ∧ b % 4 = 3 then -J(b | a) else J(b | a)) = J(a | b)

(if a % 4 = 3 ∧ b % 4 = 3 then -jacobiSym (↑b) a else jacobiSym (↑b) a) = jacobiSym (↑a) b


theorem Complex.volume_sum_rpow_le [Nonempty ι] {p : ℝ} (hp : 1 ≤ p) (r : ℝ) :
    volume {x : ι → ℂ | (∑ i, ‖x i‖ ^ p) ^ (1 / p) ≤ r} = (.ofReal r) ^ (2 * card ι) *
      .ofReal ((π * Real.Gamma (2 / p + 1)) ^ card ι / Real.Gamma (2 * card ι / p + 1))

(ι : Type u_1)
[Fintype ι]
[Nonempty ι]
{p : ℝ}
(hp : 1 ≤ p)
(r : ℝ)

MeasureTheory.volume {x | (∑ i : ι, ‖x i‖ ^ p) ^ (1 / p) ≤ r} =
  ENNReal.ofReal r ^ (2 * Fintype.card ι) *
    ENNReal.ofReal ((Real.pi * Real.Gamma (2 / p + 1)) ^ Fintype.card ι / Real.Gamma (2 * ↑(Fintype.card ι) / p + 1))


theorem polar_eq_iInter {s : Set E} : B.polar s = ⋂ x ∈ s, { y : F | ‖B x y‖ ≤ 1 }

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedCommRing 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜)
{s : Set E}

B.polar s = ⋂ x ∈ s, {y | ‖(B x) y‖ ≤ 1}


theorem Kernel.integral_fn_integral_sub ⦃f g : β × γ → E⦄ (F : E → E')
    (hf : Integrable f ((κ ⊗ₖ η) a)) (hg : Integrable g ((κ ⊗ₖ η) a)) :
    ∫ x, F (∫ y, f (x, y) - g (x, y) ∂η (a, x)) ∂κ a =
      ∫ x, F (∫ y, f (x, y) ∂η (a, x) - ∫ y, g (x, y) ∂η (a, x)) ∂κ a

{η : ProbabilityTheory.Kernel (α × β) γ}

⦃f g : β × γ → E⦄

(hf : MeasureTheory.Integrable f ((κ ⊗ₖ η) a))

(hg : MeasureTheory.Integrable g ((κ ⊗ₖ η) a))


/-- A measurable set `s` is a *fundamental domain* for an action of a group `G` on a measurable
space `α` with respect to a measure `α` if the sets `g • s`, `g : G`, are pairwise a.e. disjoint and
cover the whole space. -/
@[to_additive IsAddFundamentalDomain]
structure IsFundamentalDomain (G : Type*) {α : Type*} [One G] [SMul G α] [MeasurableSpace α]
    (s : Set α) (μ : Measure α := by volume_tac) : Prop where
  protected nullMeasurableSet : NullMeasurableSet s μ
  protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g • x ∈ s
  protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g • s)

{μ : autoParam (MeasureTheory.Measure α) _auto✝}

(self : MeasureTheory.IsFundamentalDomain G s μ)


@[simp]
protected theorem get_mk (x : A) : Const.get (Const.mk x : Const n A α) = x

{n : ℕ}
{A : Type u}
{α : TypeVec.{u} n}
(x : A)


/-- Regarding the `LieRing` of a `LieAlgebra` as a `NonUnitalNonAssocSemiring`, we can
regard a `LieHom` as a `NonUnitalAlgHom`. -/
@[simps]
def toNonUnitalAlgHom (f : L →ₗ⁅R⁆ L₂) : CommutatorRing L →ₙₐ[R] CommutatorRing L₂

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


@[simp]
theorem imageSubobject_zero {A B : C} : imageSubobject (0 : A ⟶ B) = ⊥

CategoryTheory.Limits.imageSubobject 0 = ⊥


/-- Lemma used in `tendsto_Lp_of_tendsto_ae`. -/
private theorem ae_tendsto_ae_congr {f f' : ℕ → α → β} {g g' : α → β}
    (hff' : ∀ (n : ℕ), f n =ᵐ[μ] f' n) (hgg' : g =ᵐ[μ] g')
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
    ∀ᵐ x ∂μ, Tendsto (fun n => f' n x) atTop (𝓝 (g' x))

(hfg : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (nhds (g x)))

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f' n x) Filter.atTop (nhds (g' x))


/-- A lattice is coatomic iff every element other than `⊤` has a coatom above it. -/
@[mk_iff]
class IsCoatomic [OrderTop α] : Prop where
  /-- Every element other than `⊤` has an atom above it. -/
  eq_top_or_exists_le_coatom : ∀ b : α, b = ⊤ ∨ ∃ a : α, IsCoatom a ∧ b ≤ a

(α : Type u_2)
[PartialOrder α]
[OrderTop α]

IsCoatomic α ↔ ∀ (b : α), b = ⊤ ∨ ∃ a, IsCoatom a ∧ b ≤ a


theorem IsPreconnected.intermediate_value_Ici {s : Set X} (hs : IsPreconnected s) {a : X}
    {l : Filter X} (ha : a ∈ s) [NeBot l] (hl : l ≤ 𝓟 s) {f : X → α} (hf : ContinuousOn f s)
    (ht : Tendsto f l atTop) : Ici (f a) ⊆ f '' s

{X : Type u}
{α : Type v}
[TopologicalSpace X]
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{s : Set X}
(hs : IsPreconnected s)
{a : X}
{l : Filter X}
(ha : a ∈ s)
[l.NeBot]
(hl : l ≤ 𝓟 s)
{f : X → α}
(hf : ContinuousOn f s)
(ht : Filter.Tendsto f l Filter.atTop)


theorem gcd_isUnit_iff [DecidableEq α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y

{α : Type u_1}
[EuclideanDomain α]
[DecidableEq α]
{x y : α}

IsUnit (EuclideanDomain.gcd x y) ↔ IsCoprime x y


@[simp]
theorem Basis.det_isEmpty [IsEmpty ι] : e.det = AlternatingMap.constOfIsEmpty R M ι 1

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(e : Basis ι R M)
[IsEmpty ι]


@[simp]
theorem aleph0_le_mk (α : Type u) [Infinite α] : ℵ₀ ≤ #α


@[simp]
theorem dotProduct_empty (v w : Fin 0 → α) : dotProduct v w = 0

{α : Type u}
[AddCommMonoid α]
[Mul α]
(v w : Fin 0 → α)


/-- An auxiliary lemma for
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable`. Compared to the previous
lemma, here we drop the assumption of differentiability on the boundary of the box. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable_aux₂ (I : Box (Fin (n + 1)))
    (f : ℝⁿ⁺¹ → Eⁿ⁺¹)
    (f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹)
    (s : Set ℝⁿ⁺¹) (hs : s.Countable) (Hc : ContinuousOn f (Box.Icc I))
    (Hd : ∀ x ∈ Box.Ioo I \ s, HasFDerivAt f (f' x) x)
    (Hi : IntegrableOn (∑ i, f' · (e i) i) (Box.Icc I)) :
    (∫ x in Box.Icc I, ∑ i, f' x (e i) i) =
      ∑ i : Fin (n + 1),
        ((∫ x in Box.Icc (I.face i), f (i.insertNth (I.upper i) x) i) -
          ∫ x in Box.Icc (I.face i), f (i.insertNth (I.lower i) x) i)

(f : (Fin (n + 1) → ℝ) → Fin (n + 1) → E)

(f' : (Fin (n + 1) → ℝ) → (Fin (n + 1) → ℝ) →L[ℝ] Fin (n + 1) → E)

(Hc : ContinuousOn f (BoxIntegral.Box.Icc I))

(Hd : ∀ x ∈ BoxIntegral.Box.Ioo I \ s, HasFDerivAt f (f' x) x)

(Hi :
  MeasureTheory.IntegrableOn (fun x => ∑ i : Fin (n + 1), (f' x) (Pi.single i 1) i) (BoxIntegral.Box.Icc I)
    MeasureTheory.volume)

∫ (x : Fin (n + 1) → ℝ) in BoxIntegral.Box.Icc I, ∑ i : Fin (n + 1), (f' x) (Pi.single i 1) i =
  ∑ i : Fin (n + 1),
    ((∫ (x : Fin n → ℝ) in BoxIntegral.Box.Icc (I.face i), f (i.insertNth (I.upper i) x) i) -
      ∫ (x : Fin n → ℝ) in BoxIntegral.Box.Icc (I.face i), f (i.insertNth (I.lower i) x) i)


theorem Module.free_iff_noZeroSMulDivisors [Module.Finite R M] :
    Module.Free R M ↔ NoZeroSMulDivisors R M

{R : Type u_2}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[Module.Finite R M]


@[simp]
theorem tensorLeftTensor_hom_app (X Y Z : C) :
    (tensorLeftTensor X Y).hom.app Z = (associator X Y Z).hom

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

(CategoryTheory.MonoidalCategory.tensorLeftTensor X Y).hom.app Z =
  (CategoryTheory.MonoidalCategory.associator X Y Z).hom


@[simp]
lemma mul_apply (γ₁ γ₂ : ZeroCochain G U) (i : I) : (γ₁ * γ₂) i = γ₁ i * γ₂ i

(γ₁ γ₂ : CategoryTheory.PresheafOfGroups.ZeroCochain G U)

(γ₁ * γ₂) i = γ₁ i * γ₂ i


theorem lt_opow_succ_log_self {b : Ordinal} (hb : 1 < b) (x : Ordinal) :
    x < b ^ succ (log b x)

{b : Ordinal.{u_1}}
(hb : 1 < b)
(x : Ordinal.{u_1})


/-- The cardinality of the quaternions, as a set. -/
--@[simp] Porting note (#10618): `simp` can prove it
theorem mk_univ_quaternion : #(Set.univ : Set ℍ[R]) = #R ^ 4

Cardinal.mk ↑Set.univ = Cardinal.mk R ^ 4


@[simp]
theorem coe_iterateFrobeniusEquiv : ⇑(iterateFrobeniusEquiv R p n) = iterateFrobenius R p n

(R : Type u_1)
(p n : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]

⇑(iterateFrobeniusEquiv R p n) = ⇑(iterateFrobenius R p n)


theorem sInf_le_sInf_of_forall_exists_le (h : ∀ x ∈ s, ∃ y ∈ t, y ≤ x) : sInf t ≤ sInf s

{α : Type u_1}
[CompleteSemilatticeInf α]
{s t : Set α}
(h : ∀ x ∈ s, ∃ y ∈ t, y ≤ x)


theorem replicateTR_loop_eq : ∀ n, replicateTR.loop a n acc = replicate n a ++ acc

∀ {α : Type u_1} {a : α} {acc : List α} (n : Nat), List.replicateTR.loop a n acc = List.replicate n a ++ acc


theorem join_congr {S T : WSeq (WSeq α)} (h : LiftRel Equiv S T) : join S ~ʷ join T

(h : Stream'.WSeq.LiftRel Stream'.WSeq.Equiv S T)


/-- Evaluating the Cantor normal form of an ordinal returns the ordinal. -/
theorem CNF_foldr (b o : Ordinal) : (CNF b o).foldr (fun p r ↦ b ^ p.1 * p.2 + r) 0 = o

List.foldr (fun p r => b ^ p.1 * p.2 + r) 0 (Ordinal.CNF b o) = o


@[simp]
theorem iSup_coe_toSubmodule {ι} (p : ι → LieSubmodule R L M) :
    (↑(⨆ i, p i) : Submodule R M) = ⨆ i, (p i : Submodule R M)

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{ι : Sort u_1}
(p : ι → LieSubmodule R L M)


theorem prev_nthLe (l : List α) (h : Nodup l) (n : ℕ) (hn : n < l.length) :
    prev l (l.nthLe n hn) (nthLe_mem _ _ _) =
      l.nthLe ((n + (l.length - 1)) % l.length) (Nat.mod_lt _ (n.zero_le.trans_lt hn))

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(n : ℕ)
(hn : n < l.length)

l.prev (l.nthLe n hn) ⋯ = l.nthLe ((n + (l.length - 1)) % l.length) ⋯


/-- `x * y` is square-free iff `x` and `y` have no common factors and are themselves square-free. -/
theorem squarefree_mul_iff : Squarefree (x * y) ↔ IsRelPrime x y ∧ Squarefree x ∧ Squarefree y

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


theorem Equiv.Perm.map_finRange_perm {n : ℕ} (σ : Equiv.Perm (Fin n)) :
    map σ (finRange n) ~ finRange n

List.map (⇑σ) (List.finRange n) ~ List.finRange n


theorem IsLindelof.ne_univ [NonLindelofSpace X] (hs : IsLindelof s) : s ≠ univ

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


@[simp] theorem not_nonempty_pempty : ¬Nonempty PEmpty


theorem gramSchmidtOrthonormalBasis_apply {f : ι → E} {i : ι} (hi : gramSchmidtNormed 𝕜 f i ≠ 0) :
    gramSchmidtOrthonormalBasis h f i = gramSchmidtNormed 𝕜 f i

(h : FiniteDimensional.finrank 𝕜 E = Fintype.card ι)

(gramSchmidtOrthonormalBasis h f) i = gramSchmidtNormed 𝕜 f i


theorem submartingale_of_setIntegral_le_succ [IsFiniteMeasure μ] {f : ℕ → Ω → ℝ}
    (hadp : Adapted 𝒢 f) (hint : ∀ i, Integrable (f i) μ)
    (hf : ∀ i, ∀ s : Set Ω, MeasurableSet[𝒢 i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f (i + 1) ω ∂μ) :
    Submartingale f 𝒢 μ

{f : ℕ → Ω → ℝ}

(hint : ∀ (i : ℕ), MeasureTheory.Integrable (f i) μ)

(hf : ∀ (i : ℕ) (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f (i + 1) ω ∂μ)


theorem hasLineDerivAt_iff_isLittleO_nhds_zero :
    HasLineDerivAt 𝕜 f f' x v ↔
      (fun t : 𝕜 => f (x + t • v) - f x - t • f') =o[𝓝 0] fun t => t

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

HasLineDerivAt 𝕜 f f' x v ↔ (fun t => f (x + t • v) - f x - t • f') =o[𝓝 0] fun t => t


@[simp] lemma divInt_div_divInt (n₁ d₁ n₂ d₂) :
    (n₁ /. d₁) / (n₂ /. d₂) = (n₁ * d₂) /. (d₁ * n₂)

Rat.divInt n₁ d₁ / Rat.divInt n₂ d₂ = Rat.divInt (n₁ * d₂) (d₁ * n₂)


@[simp]
theorem ofBoolRing_neg (a : AsBoolRing α) : ofBoolRing (-a) = ofBoolRing a

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


theorem compare_def_lt (a b : Nat) :
    compare a b = if a < b then .lt else if b < a then .gt else .eq

compare a b = if a < b then Ordering.lt else if b < a then Ordering.gt else Ordering.eq


@[simp]
theorem dist_equiv_symm_fst (x₁ x₂ : α) :
    dist ((WithLp.equiv p (α × β)).symm (x₁, 0)) ((WithLp.equiv p (α × β)).symm (x₂, 0)) =
      dist x₁ x₂

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[hp : Fact (1 ≤ p)]
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(x₁ x₂ : α)


@[to_additive (attr := continuity, fun_prop)]
theorem Continuous.smul (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x • g x

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


@[to_additive]
theorem some_div_some [Div α] (a b : α) : some a / some b = some (a / b)

Part.some a - Part.some b = Part.some (a - b)


@[simp]
theorem elim_self (v : TProd α (i :: l)) : v.elim (l.mem_cons_self i) = v.1

{ι : Type u}
{α : ι → Type v}
{i : ι}
{l : List ι}
[DecidableEq ι]
(v : List.TProd α (i :: l))


theorem tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ (n : ℝ)⁻¹) atTop (𝓝 0)

Filter.Tendsto (fun n => (↑n)⁻¹) Filter.atTop (𝓝 0)


@[to_additive]
theorem mulRothNumber_le : mulRothNumber s ≤ s.card

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


theorem LpAddConst_of_one_le {p : ℝ≥0∞} (hp : 1 ≤ p) : LpAddConst p = 1


/-- If `H ≤ K`, then `G/H ≃ G/K × K/H` nonconstructively.
The constructive version is `quotientEquivProdOfLE'`. -/
@[to_additive (attr := simps!) "If `H ≤ K`, then `G/H ≃ G/K × K/H` nonconstructively. The
 constructive version is `quotientEquivProdOfLE'`."]
noncomputable def quotientEquivProdOfLE (h_le : s ≤ t) : α ⧸ s ≃ (α ⧸ t) × t ⧸ s.subgroupOf t

{α : Type u_1}
[Group α]
{s t : Subgroup α}
(h_le : s ≤ t)
(a : α ⧸ s)

(Subgroup.quotientEquivProdOfLE h_le) a =
  (Quotient.map' id ⋯ a, Quotient.map' (fun g => ⟨(Quotient.mk'' g).out'⁻¹ * g, ⋯⟩) ⋯ a)


/-- Taking duals distributes over products. -/
@[simps!]
def dualProdDualEquivDual : (Module.Dual R M × Module.Dual R M') ≃ₗ[R] Module.Dual R (M × M')

(R : Type uR)
(M : Type uM)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(M' : Type uM')
[AddCommMonoid M']
[Module R M']
(f : M × M' →ₗ[R] R)

(Module.dualProdDualEquivDual R M M').symm f = (f ∘ₗ LinearMap.inl R M M', f ∘ₗ LinearMap.inr R M M')


/-- A T₂.₅ space, also known as a Urysohn space, is a topological space
  where for every pair `x ≠ y`, there are two open sets, with the intersection of closures
  empty, one containing `x` and the other `y` . -/
class T25Space (X : Type u) [TopologicalSpace X] : Prop where
  /-- Given two distinct points in a T₂.₅ space, their filters of closed neighborhoods are
  disjoint. -/
  t2_5 : ∀ ⦃x y : X⦄, x ≠ y → Disjoint ((𝓝 x).lift' closure) ((𝓝 y).lift' closure)

{X : Type u}
[TopologicalSpace X]
[self : T25Space X]
⦃x y : X⦄


@[reassoc (attr := simp)]
theorem Cone.w {F : J ⥤ C} (c : Cone F) {j j' : J} (f : j ⟶ j') :
    c.π.app j ≫ F.map f = c.π.app j'

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(c : CategoryTheory.Limits.Cone F)
{j j' : J}
(f : j ⟶ j')


@[simp]
theorem zero_comp (f : M →ₛₗ[σ₁₂] M₂) : ((0 : M₂ →ₛₗ[σ₂₃] M₃).comp f : M →ₛₗ[σ₁₃] M₃) = 0

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M : Type u_9}
{M₂ : Type u_11}
{M₃ : Type u_12}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R₁ M]
[Module R₂ M₂]
[Module R₃ M₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f : M →ₛₗ[σ₁₂] M₂)


/-- The cardinals are totally ordered. See
`Cardinal.conditionallyCompleteLinearOrderBot` for (one of) the lattice
instance. -/
-- Porting note: `ULift.{max u v, u} α` was `ULift α`
theorem total (α : Type u) (β : Type v) : Nonempty (α ↪ β) ∨ Nonempty (β ↪ α)


@[simp, norm_cast]
theorem coe_add : ((f + g : RatFunc F) : LaurentSeries F) = f + g

{F : Type u}
[Field F]
(f g : RatFunc F)


theorem OrderIso.map_sInf_eq_sInf_symm_preimage [CompleteLattice β] (f : α ≃o β) (s : Set α) :
    f (sInf s) = sInf (f.symm ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
(f : α ≃o β)
(s : Set α)


theorem Decidable.and_iff_not_or_not [Decidable a] [Decidable b] : a ∧ b ↔ ¬(¬a ∨ ¬b)

{a b : Prop}
[Decidable a]
[Decidable b]

a ∧ b ↔ ¬(¬a ∨ ¬b)


lemma le_succ_pred (a : α) : a ≤ succ (pred a)

{α : Type u_1}
[Preorder α]
[SuccOrder α]
[PredOrder α]
(a : α)


private theorem norm_sq_eq_inner' (f : α →₂[μ] E) : ‖f‖ ^ 2 = RCLike.re ⟪f, f⟫

{α : Type u_1}
{E : Type u_2}
{𝕜 : Type u_4}
[RCLike 𝕜]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(f : ↥(MeasureTheory.Lp E 2 μ))


@[to_additive]
theorem edist_op (x y : α) : edist (op x) (op y) = edist x y

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

edist (MulOpposite.op x) (MulOpposite.op y) = edist x y


lemma auxEquiv_comm (x : 𝒜 ᵍ⊗[R] ℬ) :
    auxEquiv R ℬ 𝒜 (comm 𝒜 ℬ x) = gradedComm R (𝒜 ·) (ℬ ·) (auxEquiv R 𝒜 ℬ x)

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
(x : 𝒜 ᵍ⊗[R] ℬ)

(GradedTensorProduct.auxEquiv R ℬ 𝒜) ((GradedTensorProduct.comm 𝒜 ℬ) x) =
  (TensorProduct.gradedComm R (fun x => ↥(𝒜 x)) fun x => ↥(ℬ x)) ((GradedTensorProduct.auxEquiv R 𝒜 ℬ) x)


theorem openSegment_subset (x y : ∀ i, π i) :
    openSegment 𝕜 x y ⊆ s.pi fun i => openSegment 𝕜 (x i) (y i)

{𝕜 : Type u_1}
{ι : Type u_5}
{π : ι → Type u_6}
[OrderedSemiring 𝕜]
[(i : ι) → AddCommMonoid (π i)]
[(i : ι) → Module 𝕜 (π i)]
{s : Set ι}
(x y : (i : ι) → π i)


@[reassoc (attr := simp 1100)]
lemma inr_f_d (n₁ n₂ : ℤ) :
    (inr φ).f n₁ ≫ (mappingCone φ).d n₁ n₂ = G.d n₁ n₂ ≫ (inr φ).f n₂

(CochainComplex.mappingCone.inr φ).f n₁ ≫ (CochainComplex.mappingCone φ).d n₁ n₂ =
  G.d n₁ n₂ ≫ (CochainComplex.mappingCone.inr φ).f n₂


/-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{D : Type u_1}
[CategoryTheory.Category.{v₁, u_1} D]
[CategoryTheory.Preadditive D]
(F : C ⥤ D)
[F.Additive]

∀ {X Y : CategoryTheory.Mat_ C} (f : X ⟶ Y) (i : ((fun M => CategoryTheory.Mat_.mk M.ι fun i => F.obj (M.X i)) X).ι)
  (j : ((fun M => CategoryTheory.Mat_.mk M.ι fun i => F.obj (M.X i)) Y).ι), F.mapMat_.map f i j = F.map (f i j)


/-- A version of `nthLe_map` that can be used for rewriting. -/
@[deprecated get_map_rev (since := "2023-01-05")]
theorem nthLe_map_rev (f : α → β) {l n} (H) :
    f (nthLe l n H) = nthLe (map f l) n ((l.length_map f).symm ▸ H)

{α : Type u}
{β : Type v}
(f : α → β)
{l : List α}
{n : ℕ}
(H : n < l.length)

f (l.nthLe n H) = (List.map f l).nthLe n ⋯


@[simp]
lemma Pi.map_id {f : α → C} [HasProduct f] : Pi.map (fun a => 𝟙 (f a)) = 𝟙 (∏ᶜ f)

{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : α → C}
[CategoryTheory.Limits.HasProduct f]

(CategoryTheory.Limits.Pi.map fun a => 𝟙 (f a)) = 𝟙 (∏ᶜ f)


/-- **Lebesgue dominated convergence theorem** provides sufficient conditions under which almost
  everywhere convergence of a sequence of functions implies the convergence of their integrals.
  We could weaken the condition `bound_integrable` to require `HasFiniteIntegral bound μ` instead
  (i.e. not requiring that `bound` is measurable), but in all applications proving integrability
  is easier. -/
theorem tendsto_integral_of_dominated_convergence {F : ℕ → α → G} {f : α → G} (bound : α → ℝ)
    (F_measurable : ∀ n, AEStronglyMeasurable (F n) μ) (bound_integrable : Integrable bound μ)
    (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a)
    (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop (𝓝 (f a))) :
    Tendsto (fun n => ∫ a, F n a ∂μ) atTop (𝓝 <| ∫ a, f a ∂μ)

(F_measurable : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (F n) μ)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_bound : ∀ (n : ℕ), ∀ᵐ (a : α) ∂μ, ‖F n a‖ ≤ bound a)

(h_lim : ∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun n => F n a) Filter.atTop (nhds (f a)))

Filter.Tendsto (fun n => ∫ (a : α), F n a ∂μ) Filter.atTop (nhds (∫ (a : α), f a ∂μ))


theorem image_coe_nnreal_real (h : t.OrdConnected) : ((↑) '' t : Set ℝ).OrdConnected


theorem map_iInf_comap {ι β} [Nonempty ι] {f : α → β} (m : ι → OuterMeasure β) :
    map f (⨅ i, comap f (m i)) = ⨅ i, map f (comap f (m i))

{α : Type u_1}
{ι : Sort u_2}
{β : Type u_3}
[Nonempty ι]
{f : α → β}
(m : ι → MeasureTheory.OuterMeasure β)

(MeasureTheory.OuterMeasure.map f) (⨅ i, (MeasureTheory.OuterMeasure.comap f) (m i)) =
  ⨅ i, (MeasureTheory.OuterMeasure.map f) ((MeasureTheory.OuterMeasure.comap f) (m i))


/-- The unoriented angle at `p` between two points not equal to `p` is zero if and only if the
unoriented angle is zero. -/
theorem oangle_eq_zero_iff_angle_eq_zero {p p₁ p₂ : P} (hp₁ : p₁ ≠ p) (hp₂ : p₂ ≠ p) :
    ∡ p₁ p p₂ = 0 ↔ ∠ p₁ p p₂ = 0

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


@[simp] lemma sups_eq_self : s ⊻ s = s ↔ SupClosed (s : Set α)

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{s : Finset α}


theorem isClassified_of_isPrimitiveClassified (hp : h.IsPrimitiveClassified) : h.IsClassified

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(hp : h.IsPrimitiveClassified)


{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


theorem SupIndep.pairwiseDisjoint (hs : s.SupIndep f) : (s : Set ι).PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_3}
[Lattice α]
[OrderBot α]
{s : Finset ι}
{f : ι → α}
(hs : s.SupIndep f)


@[simp]
theorem map_apply {M M' : ModuleCat R} (g : M ⟶ M') (x) (s : S) :
    (coextendScalars f).map g x s = g (x s)

(x : ↑((ModuleCat.coextendScalars f).obj M))

(((ModuleCat.coextendScalars f).map g) x).toFun s = g (x.toFun s)


/-- Composition of two partial homeomorphisms when the target of the first and the source of
the second coincide. -/
@[simps! apply symm_apply toPartialEquiv, simps! (config := .lemmasOnly) source target]
protected def trans' (h : e.target = e'.source) : PartialHomeomorph X Z

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)
(h : e.target = e'.source)


/-- The natural isomorphism between `𝕜` satisfying `RCLike 𝕜` and `ℂ` when
`RCLike.im RCLike.I = 1`. -/
@[simps]
def _root_.RCLike.complexRingEquiv {𝕜 : Type*} [RCLike 𝕜]
    (h : RCLike.im (RCLike.I : 𝕜) = 1) : 𝕜 ≃+* ℂ

{𝕜 : Type u_2}
[RCLike 𝕜]
(h : RCLike.im RCLike.I = 1)
(x : 𝕜)

(RCLike.complexRingEquiv h) x = ↑(RCLike.re x) + ↑(RCLike.im x) * Complex.I


@[simp]
theorem reverse_reverse : ∀ a : CliffordAlgebra Q, reverse (reverse a) = a

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(a : CliffordAlgebra Q)

CliffordAlgebra.reverse (CliffordAlgebra.reverse a) = a


theorem fst_surjective : Function.Surjective (fst R M M₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

Function.Surjective ⇑(LinearMap.fst R M M₂)


theorem op_inf (S₁ S₂ : Subalgebra R A) : (S₁ ⊓ S₂).op = S₁.op ⊓ S₂.op

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


@[to_additive]
theorem mk'_eq_iff_mk'_eq (g : LocalizationMap S P) {x₁ x₂} {y₁ y₂ : S} :
    f.mk' x₁ y₁ = f.mk' x₂ y₂ ↔ g.mk' x₁ y₁ = g.mk' x₂ y₂

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


theorem div_neg_of_neg_of_pos (ha : a < 0) (hb : 0 < b) : a / b < 0

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


@[simp]
theorem coe_prodAssoc_symm [Module R E₂] [Module R E₃] :
    ((prodAssoc R E E₂ E₃).symm : E × E₂ × E₃ → (E × E₂) × E₃) = (Equiv.prodAssoc E E₂ E₃).symm

(R : Type u_1)
(E : Type u_5)
(E₂ : Type u_6)
(E₃ : Type u_7)
[Semiring R]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[SeminormedAddCommGroup E₃]
[Module R E]
[Module R E₂]
[Module R E₃]

⇑(LinearIsometryEquiv.prodAssoc R E E₂ E₃).symm = ⇑(Equiv.prodAssoc E E₂ E₃).symm


lemma lintegral_compProd [SFinite μ] [IsSFiniteKernel κ]
    {f : α × β → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ x, f x ∂(μ ⊗ₘ κ) = ∫⁻ a, ∫⁻ b, f (a, b) ∂(κ a) ∂μ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{μ : MeasureTheory.Measure α}
{κ : ProbabilityTheory.Kernel α β}
[MeasureTheory.SFinite μ]
[ProbabilityTheory.IsSFiniteKernel κ]
{f : α × β → ℝ≥0∞}
(hf : Measurable f)

∫⁻ (x : α × β), f x ∂μ ⊗ₘ κ = ∫⁻ (a : α), ∫⁻ (b : β), f (a, b) ∂κ a ∂μ


@[simp]
protected theorem zero_mem : (0 : L) ∈ L'

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(L' : LieSubalgebra R L)


protected theorem Pairwise.eq (h : Pairwise r) : ¬r a b → a = b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
(h : Pairwise r)


theorem imp_and {α} : (α → b ∧ c) ↔ (α → b) ∧ (α → c)

α → b ∧ c ↔ (α → b) ∧ (α → c)


theorem isPartitionSplit (I : Box ι) (i : ι) (x : ℝ) : IsPartition (split I i x)

{ι : Type u_1}
(I : BoxIntegral.Box ι)
(i : ι)
(x : ℝ)

(BoxIntegral.Prepartition.split I i x).IsPartition


theorem coe_eq_zero_iff {x : s} : (x : R) = 0 ↔ x = 0

{R : Type u}
[Ring R]
(s : Subring R)
{x : ↥s}


{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


theorem codisjoint_left : Codisjoint s t ↔ ∀ ⦃a⦄, a ∉ s → a ∈ t

{α : Type u_1}
[Fintype α]
{s t : Finset α}

Codisjoint s t ↔ ∀ ⦃a : α⦄, a ∉ s → a ∈ t


/-- The floor of the real square root is the same as the natural square root. -/
@[simp]
theorem floor_real_sqrt_eq_nat_sqrt {a : ℕ} : ⌊√(a : ℝ)⌋ = Nat.sqrt a


@[simp]
theorem fst_inf [Inf α] [Inf β] (p q : α × β) : (p ⊓ q).fst = p.fst ⊓ q.fst

(α : Type u)
(β : Type v)
[Inf α]
[Inf β]
(p q : α × β)


theorem doset_eq_of_mem {H K : Subgroup G} {a b : G} (hb : b ∈ doset a H K) :
    doset b H K = doset a H K

{G : Type u_1}
[Group G]
{H K : Subgroup G}
{a b : G}
(hb : b ∈ Doset.doset a ↑H ↑K)

Doset.doset b ↑H ↑K = Doset.doset a ↑H ↑K


/-- A space `X` is sequentially compact if every sequence in `X` has a
converging subsequence. -/
@[mk_iff]
class SeqCompactSpace : Prop where
  isSeqCompact_univ : IsSeqCompact (univ : Set X)

{X : Type u_1}
[TopologicalSpace X]
[self : SeqCompactSpace X]


@[simp]
theorem ofFn_fin_repeat {m} (a : Fin m → α) (n : ℕ) :
    List.ofFn (Fin.repeat n a) = (List.replicate n (List.ofFn a)).join

{α : Type u}
{m : ℕ}
(a : Fin m → α)
(n : ℕ)


theorem IsRelPrime.of_mul_add_right_right (h : IsRelPrime x (z * x + y)) : IsRelPrime x y

{R : Type u}
[CommSemiring R]
{x y z : R}
(h : IsRelPrime x (z * x + y))


@[to_additive]
lemma mem_stabilizer_set_iff_smul_set_subset {s : Set α} (hs : s.Finite) :
    a ∈ stabilizer G s ↔ a • s ⊆ s

{G : Type u_1}
{α : Type u_3}
[Group G]
[MulAction G α]
{a : G}
{s : Set α}
(hs : s.Finite)

a ∈ MulAction.stabilizer G s ↔ a • s ⊆ s


/-- The canonical ring isomorphism between `⨁ i, A i` and `R`-/
@[simp]
theorem coeRingHom_of [AddMonoid ι] [SetLike.GradedMonoid A] (i : ι) (x : A i) :
    (coeRingHom A : _ →+* R) (of (fun i => A i) i x) = x

{ι : Type u_1}
{σ : Type u_2}
{R : Type u_4}
[DecidableEq ι]
[Semiring R]
[SetLike σ R]
[AddSubmonoidClass σ R]
(A : ι → σ)
[AddMonoid ι]
[SetLike.GradedMonoid A]
(i : ι)
(x : ↥(A i))

(DirectSum.coeRingHom A) ((DirectSum.of (fun i => ↥(A i)) i) x) = ↑x


theorem erase_subset (a : α) (s : Multiset α) : s.erase a ⊆ s

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


@[simp]
theorem coe_refl_to_affineMap : ↑(refl k P₁) = AffineMap.id k P₁

(k : Type u_1)
(P₁ : Type u_2)
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]

↑(AffineEquiv.refl k P₁) = AffineMap.id k P₁


@[simp, rclike_simps, norm_cast]
theorem reCLM_coe : ((reCLM : K →L[ℝ] ℝ) : K →ₗ[ℝ] ℝ) = reLm


@[simp]
theorem Iio_insert : insert a (Iio a) = Iic a


theorem continuousWithinAt_id {s : Set α} {x : α} : ContinuousWithinAt id s x

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{x : α}


@[simp]
theorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
(a b : A)

LinearMap.mulLeft R (a * b) = LinearMap.mulLeft R a ∘ₗ LinearMap.mulLeft R b


theorem takeWhile_eq (p : Char → Bool) (s : String) : s.takeWhile p = ⟨s.1.takeWhile p⟩

s.takeWhile p = { data := List.takeWhile p s.data }


theorem of_equiv {H : Type*} [Group H] (ϕ : G ≃* H) : IsPGroup p H

{p : ℕ}
{G : Type u_1}
[Group G]
(hG : IsPGroup p G)
{H : Type u_2}
[Group H]
(ϕ : G ≃* H)


/-- Pointwise supremum of two monotone functions is a monotone function. -/
protected theorem sup [Preorder α] [SemilatticeSup β] {f g : α → β} (hf : Monotone f)
    (hg : Monotone g) :
    Monotone (f ⊔ g)

{α : Type u}
{β : Type v}
[Preorder α]
[SemilatticeSup β]
{f g : α → β}
(hf : Monotone f)
(hg : Monotone g)


/-- The sine of the sum of the angles of a possibly degenerate
triangle (where two given sides are nonzero), vector angle form. -/
theorem sin_angle_add_angle_sub_add_angle_sub_eq_zero {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    Real.sin (angle x y + angle x (x - y) + angle y (y - x)) = 0

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

Real.sin
    (InnerProductGeometry.angle x y + InnerProductGeometry.angle x (x - y) + InnerProductGeometry.angle y (y - x)) =
  0


lemma isSplitEpi_g (s : S.Splitting) : IsSplitEpi S.g

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


theorem gramSchmidt_ne_zero_coe {f : ι → E} (n : ι)
    (h₀ : LinearIndependent 𝕜 (f ∘ ((↑) : Set.Iic n → ι))) : gramSchmidt 𝕜 f n ≠ 0

(h₀ : LinearIndependent (ι := { x // x ∈ Set.Iic n }) 𝕜 (f ∘ Subtype.val))


lemma cons_def (a : α i) (f : ∀ j ∈ l, α j) : cons _ _ a f =
    fun j hj ↦ if h : j = i then h.symm.rec a else f j <| (mem_cons.1 hj).resolve_left h

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

List.Pi.cons i l a f = fun j hj => if h : j = i then ⋯ ▸ a else f j ⋯


theorem count_le_count_cons (a b : α) (s : Multiset α) : count a s ≤ count a (b ::ₘ s)

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

Multiset.count a s ≤ Multiset.count a (b ::ₘ s)


theorem mem_permsOfList_iff {l : List α} {f : Perm α} :
    f ∈ permsOfList l ↔ ∀ {x}, f x ≠ x → x ∈ l

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

f ∈ permsOfList l ↔ ∀ {x : α}, f x ≠ x → x ∈ l


/-- Given an integral element `s : E` over `F` whose `F`-conjugates are all in `K`,
any lift can be extended to one whose carrier contains `s`. -/
theorem Lifts.exists_lift_of_splits (x : Lifts F E K) {s : E} (h1 : IsIntegral F s)
    (h2 : (minpoly F s).Splits (algebraMap F K)) : ∃ y, x ≤ y ∧ s ∈ y.carrier

(h2 : Polynomial.Splits (algebraMap F K) (minpoly F s))


/-- Given a limit cone over `G : D ⥤ E` we can construct a limit cone over `F ⋙ G`. -/
@[simps]
def limitConeComp (t : LimitCone G) : LimitCone (F ⋙ G)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
[F.Initial]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{G : CategoryTheory.Functor D E}
(t : CategoryTheory.Limits.LimitCone G)

(CategoryTheory.Functor.Initial.limitConeComp F t).isLimit =
  (CategoryTheory.Functor.Initial.isLimitWhiskerEquiv F t.cone).symm t.isLimit


/-- Characterization of proper maps by ultrafilters. -/
lemma isProperMap_iff_ultrafilter : IsProperMap f ↔ Continuous f ∧
    ∀ ⦃𝒰 : Ultrafilter X⦄, ∀ ⦃y : Y⦄, Tendsto f 𝒰 (𝓝 y) → ∃ x, f x = y ∧ 𝒰 ≤ 𝓝 x

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

IsProperMap f ↔ Continuous f ∧ ∀ ⦃𝒰 : Ultrafilter X⦄ ⦃y : Y⦄, Filter.Tendsto f (↑𝒰) (𝓝 y) → ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x


lemma lipschitzWith_negPart : LipschitzWith 1 (negPart : α → α)

{α : Type u_1}
[NormedLatticeAddCommGroup α]


theorem map_dirac {f : α → β} (hf : Measurable f) (a : α) : (dirac a).map f = dirac (f a)

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

MeasureTheory.Measure.map f (MeasureTheory.Measure.dirac a) = MeasureTheory.Measure.dirac (f a)


@[fun_prop]
theorem HasFDerivAt.differentiableAt (h : HasFDerivAt f f' x) : DifferentiableAt 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
(h : HasFDerivAt f f' x)


/-- Reindexing by the composition of two equivalences is the same as reindexing twice. -/
@[simp]
theorem reindex_trans {n₁ n₂ n₃ : ℕ} (e₁₂ : Fin (n₁ + 1) ≃ Fin (n₂ + 1))
    (e₂₃ : Fin (n₂ + 1) ≃ Fin (n₃ + 1)) (s : Simplex k P n₁) :
    s.reindex (e₁₂.trans e₂₃) = (s.reindex e₁₂).reindex e₂₃

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{n₁ n₂ n₃ : ℕ}
(e₁₂ : Fin (n₁ + 1) ≃ Fin (n₂ + 1))
(e₂₃ : Fin (n₂ + 1) ≃ Fin (n₃ + 1))
(s : Affine.Simplex k P n₁)


lemma isCompl_ker_of_disjoint_of_ne_bot {p : Submodule K V₁}
    (hpf : Disjoint (LinearMap.ker f) p) (hp : p ≠ ⊥) :
    IsCompl (LinearMap.ker f) p

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
[AddCommGroup V₁]
[Module K V₁]
[FiniteDimensional K V₁]
{f : Module.Dual K V₁}
(hf : f ≠ 0)
{p : Submodule K V₁}
(hpf : Disjoint (LinearMap.ker f) p)
(hp : p ≠ ⊥)


@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(I : FractionalIdeal S P)
(g : P ≃ₐ[R] P')

FractionalIdeal.map (↑g.symm) (FractionalIdeal.map (↑g) I) = I


/-- Consider a multivariate polynomial `φ` whose variables are indexed by `Option σ`,
and suppose that `σ ≃ Fin n`.
Then one may view `φ` as a polynomial over `MvPolynomial (Fin n) R`, by

1. renaming the variables via `Option σ ≃ Fin (n+1)`, and then singling out the `0`-th variable
    via `MvPolynomial.finSuccEquiv`;
2. first viewing it as polynomial over `MvPolynomial σ R` via `MvPolynomial.optionEquivLeft`,
    and then renaming the variables.

This lemma shows that both constructions are the same. -/
lemma finSuccEquiv_rename_finSuccEquiv (e : σ ≃ Fin n) (φ : MvPolynomial (Option σ) R) :
    ((finSuccEquiv R n) ((rename ((Equiv.optionCongr e).trans (_root_.finSuccEquiv n).symm)) φ)) =
      Polynomial.map (rename e).toRingHom (optionEquivLeft R σ φ)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{n : ℕ}
(e : σ ≃ Fin n)
(φ : MvPolynomial (Option σ) R)

(MvPolynomial.finSuccEquiv R n) ((MvPolynomial.rename ⇑(e.optionCongr.trans (finSuccEquiv n).symm)) φ) =
  Polynomial.map (MvPolynomial.rename ⇑e).toRingHom ((MvPolynomial.optionEquivLeft R σ) φ)


@[simp] lemma coe_toLinear_eq_zero_iff : (χ : L →ₗ[R] R) = 0 ↔ χ.IsZero

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[LieModule.LinearWeights R L M]
{χ : LieModule.Weight R L M}

LieModule.Weight.toLinear R L M χ = 0 ↔ χ.IsZero


theorem proj_bot_injective [DiscreteTopology X] : Injective (⊥ : DiscreteQuotient X).proj

{X : Type u_2}
[TopologicalSpace X]
[DiscreteTopology X]


@[to_additive]
theorem finprod_eq_prod_plift_of_mulSupport_toFinset_subset {f : α → M}
    (hf : (mulSupport (f ∘ PLift.down)).Finite) {s : Finset (PLift α)} (hs : hf.toFinset ⊆ s) :
    ∏ᶠ i, f i = ∏ i ∈ s, f i.down

(hf : (Function.mulSupport (f ∘ PLift.down)).Finite)


theorem stoppedValue_eq' [Preorder ι] [LocallyFiniteOrderBot ι] [AddCommMonoid E] {N : ι}
    (hbdd : ∀ ω, τ ω ≤ N) :
    stoppedValue u τ = ∑ i ∈ Finset.Iic N, Set.indicator {ω | τ ω = i} (u i)

{Ω : Type u_1}
{ι : Type u_3}
{τ : Ω → ι}
{E : Type u_4}
{u : ι → Ω → E}
[Preorder ι]
[LocallyFiniteOrderBot ι]
[AddCommMonoid E]
{N : ι}
(hbdd : ∀ (ω : Ω), τ ω ≤ N)

MeasureTheory.stoppedValue u τ = ∑ i ∈ Finset.Iic N, {ω | τ ω = i}.indicator (u i)


theorem invOf_one [Monoid α] [Invertible (1 : α)] : ⅟ (1 : α) = 1


theorem Finite.bddAbove_range [IsDirected α (· ≤ ·)] (f : β → α) : BddAbove (Set.range f)

{α : Type u_1}
{β : Type u_2}
[Finite β]
[Nonempty α]
[Preorder α]
[IsDirected α fun x x_1 => x ≤ x_1]
(f : β → α)


theorem darts_toPath_subset {u v : V} (p : G.Walk u v) : (p.toPath : G.Walk u v).darts ⊆ p.darts

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


@[to_additive (attr := simp, nolint simpNF)]
theorem mulEquivOfMulEquiv_mk' {k : LocalizationMap T Q} {j : M ≃* P} (H : S.map j.toMonoidHom = T)
    (x y) :
    f.mulEquivOfMulEquiv k H (f.mk' x y) = k.mk' (j x) ⟨j y, H ▸ Set.mem_image_of_mem j y.2⟩

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

(f.addEquivOfAddEquiv k H) (f.mk' x y) = k.mk' (j x) ⟨j ↑y, ⋯⟩


@[norm_cast] theorem ofNat_mul (n m : Nat) : (↑(n * m) : Int) = n * m


@[simp] theorem ofNat_lt_ofNat {n} (x y : Nat) : BitVec.ofNat n x < BitVec.ofNat n y ↔ x % 2^n < y % 2^n

BitVec.ofNat n x < BitVec.ofNat n y ↔ x % 2 ^ n < y % 2 ^ n


/-- Given a subgroup `Γ` of a topological group `G` with measure `ν`, and a measure 'μ' on the
  quotient `G ⧸ Γ` satisfying `QuotientMeasureEqMeasurePreimage`, the restriction
  of `ν` to a fundamental domain is measure-preserving with respect to `μ`. -/
@[to_additive]
theorem measurePreserving_quotientGroup_mk_of_QuotientMeasureEqMeasurePreimage
    {𝓕 : Set G} (h𝓕 : IsFundamentalDomain Γ.op 𝓕 ν) (μ : Measure (G ⧸ Γ))
    [QuotientMeasureEqMeasurePreimage ν μ] :
    MeasurePreserving (@QuotientGroup.mk G _ Γ) (ν.restrict 𝓕) μ

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

MeasureTheory.MeasurePreserving QuotientAddGroup.mk (ν.restrict 𝓕) μ


theorem sin_eq_zero_iff {x : ℝ} : sin x = 0 ↔ ∃ n : ℤ, (n : ℝ) * π = x


@[simp, norm_cast]
theorem coeComplex_imK (z : ℂ) : (z : ℍ).imK = 0


/-- A morphism property `W` on a category `C` is compatible with the shift by a
monoid `A` when for all `a : A`, a morphism `f` belongs to `W`
if and only if `f⟦a⟧'` does. -/
class IsCompatibleWithShift : Prop :=
  /-- the condition that for all `a : A`, the morphism property `W` is not changed when
  we take its inverse image by the shift functor by `a` -/
  condition : ∀ (a : A), W.inverseImage (shiftFunctor C a) = W

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{W : CategoryTheory.MorphismProperty C}
{A : Type w}
[AddMonoid A]
[CategoryTheory.HasShift C A]
[self : W.IsCompatibleWithShift A]
(a : A)

W.inverseImage (CategoryTheory.shiftFunctor C a) = W


@[simp] theorem fmod_self {a : Int} : a.fmod a = 0


/-- The carrier of `N ⊔ H` is just `↑N * ↑H` (pointwise set product) when `N` is normal. -/
@[to_additive "The carrier of `N ⊔ H` is just `↑N + ↑H` (pointwise set addition)
when `N` is normal."]
theorem normal_mul (N H : Subgroup G) [N.Normal] : (↑(N ⊔ H) : Set G) = N * H

{G : Type u_2}
[Group G]
(N H : Subgroup G)
[N.Normal]


@[simp]
theorem lie_skew : -⁅y, x⁆ = ⁅x, y⁆


protected theorem le_sub_one_iff_lt (h : 0 < m) : n ≤ m - 1 ↔ n < m


lemma divNat_mul_divNat (n₁ n₂ : ℕ) {d₁ d₂} (hd₁ : d₁ ≠ 0) (hd₂ : d₂ ≠ 0) :
    divNat n₁ d₁ * divNat n₂ d₂ = divNat (n₁ * n₂) (d₁ * d₂)

(n₁ n₂ : ℕ)
{d₁ d₂ : ℕ}
(hd₁ : d₁ ≠ 0)
(hd₂ : d₂ ≠ 0)

NNRat.divNat n₁ d₁ * NNRat.divNat n₂ d₂ = NNRat.divNat (n₁ * n₂) (d₁ * d₂)


theorem convexOn_id {s : Set β} (hs : Convex 𝕜 s) : ConvexOn 𝕜 s _root_.id

{𝕜 : Type u_1}
{β : Type u_5}
[OrderedSemiring 𝕜]
[OrderedAddCommMonoid β]
[SMul 𝕜 β]
{s : Set β}
(hs : Convex 𝕜 s)


/-- If a submodule is contained in a finite-dimensional
submodule with the same or smaller dimension, they are equal. -/
theorem eq_of_le_of_finrank_le {S₁ S₂ : Submodule K V} [FiniteDimensional K S₂] (hle : S₁ ≤ S₂)
    (hd : finrank K S₂ ≤ finrank K S₁) : S₁ = S₂

(hd : FiniteDimensional.finrank K ↥S₂ ≤ FiniteDimensional.finrank K ↥S₁)


/-- Reorder a finset.

The difference with `Finset.card_nbij'` is that the bijection is specified as a surjective
injection, rather than by an inverse function.

The difference with `Finset.card_bij` is that the bijection is a non-dependent function, rather than
being allowed to use membership of the domain. -/
lemma card_nbij (i : α → β) (hi : ∀ a ∈ s, i a ∈ t) (i_inj : (s : Set α).InjOn i)
    (i_surj : (s : Set α).SurjOn i t) : s.card = t.card

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(i : α → β)
(hi : ∀ a ∈ s, i a ∈ t)
(i_inj : Set.InjOn i ↑s)
(i_surj : Set.SurjOn i ↑s ↑t)


private lemma int_div_nonneg_of_pos_of_pos {a b : ℤ} (ha : 0 < a) (hb : 0 < b) : 0 ≤ a / b


/-- A ring satisfies the strong rank condition if and only if, for all `n : ℕ`, any linear map
`(Fin (n + 1) → R) →ₗ[R] (Fin n → R)` is not injective. -/
theorem strongRankCondition_iff_succ :
    StrongRankCondition R ↔
      ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Function.Injective f

StrongRankCondition R ↔ ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Function.Injective ⇑f


@[reassoc]
theorem lift_map {X Y : C} (f : X ⟶ Y) :
    prod.lift (𝟙 X) 0 ≫ Limits.prod.map f f = f ≫ prod.lift (𝟙 Y) 0

CategoryTheory.Limits.prod.lift (𝟙 X) 0 ≫ CategoryTheory.Limits.prod.map f f =
  f ≫ CategoryTheory.Limits.prod.lift (𝟙 Y) 0


/-- This is an auxiliary data structure useful for constructing adjunctions.
See `Adjunction.mkOfUnitCounit`.
This structure won't typically be used anywhere else.
-/
-- Porting note(#5171): `has_nonempty_instance` linter not ported yet
-- @[nolint has_nonempty_instance]
structure CoreUnitCounit (F : C ⥤ D) (G : D ⥤ C) where
  /-- The unit of an adjunction between `F` and `G` -/
  unit : 𝟭 C ⟶ F.comp G
  /-- The counit of an adjunction between `F` and `G`s -/
  counit : G.comp F ⟶ 𝟭 D
  /-- Equality of the composition of the unit, associator, and counit with the identity
  `F ⟶ (F G) F ⟶ F (G F) ⟶ F = NatTrans.id F` -/
  left_triangle :
    whiskerRight unit F ≫ (Functor.associator F G F).hom ≫ whiskerLeft F counit =
      NatTrans.id (𝟭 C ⋙ F) := by
    aesop_cat
  /-- Equality of the composition of the unit, associator, and counit with the identity
  `G ⟶ G (F G) ⟶ (F G) F ⟶ G = NatTrans.id G` -/
  right_triangle :
    whiskerLeft G unit ≫ (Functor.associator G F G).inv ≫ whiskerRight counit G =
      NatTrans.id (G ⋙ 𝟭 C) := by
    aesop_cat

(self : CategoryTheory.Adjunction.CoreUnitCounit F G)

CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft G self.unit)
    (CategoryTheory.CategoryStruct.comp (G.associator F G).inv (CategoryTheory.whiskerRight self.counit G)) =
  CategoryTheory.NatTrans.id (G.comp (CategoryTheory.Functor.id C))


/-- The images of two vectors under a linear equivalence are on the same ray if and only if the
original vectors are on the same ray. -/
@[simp]
theorem sameRay_map_iff (e : M ≃ₗ[R] N) : SameRay R (e x) (e y) ↔ SameRay R x y

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{x y : M}
(e : M ≃ₗ[R] N)


@[reassoc (attr := simp)]
lemma stalkMap_inv_hom (e : X ≅ Y) (x : X) :
    e.inv.stalkMap (e.hom.val.base x) ≫ e.hom.stalkMap x =
      X.presheaf.stalkSpecializes (specializes_of_eq <| by simp)

{X Y : AlgebraicGeometry.LocallyRingedSpace}

AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap e.inv (e.hom.val.base x) ≫
    AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap e.hom x =
  X.presheaf.stalkSpecializes ⋯


@[to_additive (attr := simp)]
theorem map_op_nhds (x : M) : map (op : M → Mᵐᵒᵖ) (𝓝 x) = 𝓝 (op x)

{M : Type u_1}
[TopologicalSpace M]
(x : M)

Filter.map AddOpposite.op (𝓝 x) = 𝓝 (AddOpposite.op x)


@[simp] lemma invert_T (n : ℤ) : invert (T n : R[T;T⁻¹]) = T (-n)

LaurentPolynomial.invert (LaurentPolynomial.T n) = LaurentPolynomial.T (-n)


/-- Calculate the integral of `g ∘ f : α →ₛ F`, where `f` is an integrable function from `α` to `E`
    and `g` is a function from `E` to `F`. We require `g 0 = 0` so that `g ∘ f` is integrable. -/
theorem map_integral (f : α →ₛ E) (g : E → F) (hf : Integrable f μ) (hg : g 0 = 0) :
    (f.map g).integral μ = ∑ x ∈ f.range, ENNReal.toReal (μ (f ⁻¹' {x})) • g x

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : MeasureTheory.SimpleFunc α E)
(g : E → F)
(hf : MeasureTheory.Integrable (↑f) μ)
(hg : g 0 = 0)

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


theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) :
    fderiv 𝕜 f x = continuousMultilinearCurryFin1 𝕜 E F (p 1)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{f : E → F}
{x : E}
(h : HasFPowerSeriesAt f p x)

fderiv 𝕜 f x = (continuousMultilinearCurryFin1 𝕜 E F) (p 1)


theorem unit_aux (x : HahnSeries Γ R) {r : R} (hr : r * x.leadingCoeff = 1) :
    0 < (1 - single (-x.order) r * x).orderTop

{Γ : Type u_1}
{R : Type u_2}
[LinearOrderedAddCommGroup Γ]
[CommRing R]
[IsDomain R]
(x : HahnSeries Γ R)
{r : R}
(hr : r * x.leadingCoeff = 1)

0 < (1 - (HahnSeries.single (-x.order)) r * x).orderTop


lemma _root_.NonUnitalStarAlgHom.map_adjoin (f : F) (s : Set A) :
    map f (adjoin R s) = adjoin R (f '' s)

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
[NonUnitalSemiring B]
[StarRing B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
[StarModule R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
(f : F)
(s : Set A)

NonUnitalStarSubalgebra.map f (NonUnitalStarAlgebra.adjoin R s) = NonUnitalStarAlgebra.adjoin R (⇑f '' s)


@[simp]
theorem restrict_ite_compl (f g : α → β) (s : Set α) [∀ x, Decidable (x ∈ s)] :
    (sᶜ.restrict fun a => if a ∈ s then f a else g a) = sᶜ.restrict g

{α : Type u_1}
{β : Type u_2}
(f g : α → β)
(s : Set α)
[(x : α) → Decidable (x ∈ s)]


theorem infinitePos_abs_iff_infinite_abs {x : ℝ*} : InfinitePos |x| ↔ Infinite |x|


@[ext]
theorem ext {s t : Ideal P} : (s : Set P) = t → s = t

{P : Type u_1}
[LE P]
{s t : Order.Ideal P}


/-- The function `Ring.inverse` is continuous at each unit of `R`. -/
theorem inverse_continuousAt (x : Rˣ) : ContinuousAt inverse (x : R)

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)


/-- A continuous function with compact support is bounded below. -/
@[to_additive " A continuous function with compact support is bounded below. "]
theorem Continuous.bddBelow_range_of_hasCompactMulSupport [ClosedIicTopology α] [One α]
    {f : β → α} (hf : Continuous f) (h : HasCompactMulSupport f) : BddBelow (range f)

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
[One α]
{f : β → α}
(hf : Continuous f)
(h : HasCompactMulSupport f)


@[to_additive (attr := simp 1100)]
theorem singleton_div_closedBall : {x} / closedBall y δ = closedBall (x / y) δ

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

{x} - Metric.closedBall y δ = Metric.closedBall (x - y) δ


theorem toNonUnitalRingHom_injective :
    Function.Injective (toNonUnitalRingHom : R ≃+* S → R →ₙ+* S)

{R : Type u_4}
{S : Type u_5}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]


theorem card_Ioc_of_le (h : a ≤ b) : ((Ioc a b).card : ℤ) = b - a


theorem coeff_trunc (m : σ →₀ ℕ) (φ : MvPowerSeries σ R) :
    (trunc R n φ).coeff m = if m < n then coeff R m φ else 0

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

MvPolynomial.coeff m ((MvPowerSeries.trunc R n) φ) = if m < n then (MvPowerSeries.coeff R m) φ else 0


theorem prefix_append_right_inj (l) : l ++ l₁ <+: l ++ l₂ ↔ l₁ <+: l₂

∀ {α : Type u_1} {l₁ l₂ : List α} (l : List α), l ++ l₁ <+: l ++ l₂ ↔ l₁ <+: l₂


theorem ae_eq_zero_of_forall_inner [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
    [SecondCountableTopology E] {f : α → E} (hf : ∀ c : E, (fun x => (inner c (f x) : 𝕜)) =ᵐ[μ] 0) :
    f =ᵐ[μ] 0

(hf : ∀ (c : E), (fun x => ⟪c, f x⟫_𝕜) =ᵐ[μ] 0)


@[to_additive]
theorem _root_.SemiconjBy.unop [Mul α] {a x y : αᵐᵒᵖ} (h : SemiconjBy a x y) :
    SemiconjBy (unop a) (unop y) (unop x)

{α : Type u_1}
[Add α]
{a x y : αᵃᵒᵖ}
(h : AddSemiconjBy a x y)

AddSemiconjBy (AddOpposite.unop a) (AddOpposite.unop y) (AddOpposite.unop x)


@[simp, norm_cast]
theorem coe_toLinearMap (f : A →ₐc[R] B) : ⇑(f : A →ₗ[R] B) = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₐc[R] B)


theorem C_one : C (1 : R) = (1 : HahnSeries Γ R)

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[NonAssocSemiring R]


theorem add_le_of_le_tsub_left_of_le (h : a ≤ c) (h2 : b ≤ c - a) : a + b ≤ c

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


theorem congr_comp_reverse {X Y : Paths <| Quiver.Symmetrify V} (p : X ⟶ Y) :
    Quot.mk (@Quotient.CompClosure _ _ redStep _ _) (p ≫ p.reverse) =
      Quot.mk (@Quotient.CompClosure _ _ redStep _ _) (𝟙 X)

{X Y : CategoryTheory.Paths (Quiver.Symmetrify V)}

Quot.mk (CategoryTheory.Quotient.CompClosure CategoryTheory.Groupoid.Free.redStep)
    (CategoryTheory.CategoryStruct.comp p (Quiver.Path.reverse p)) =
  Quot.mk (CategoryTheory.Quotient.CompClosure CategoryTheory.Groupoid.Free.redStep)
    (CategoryTheory.CategoryStruct.id X)


protected theorem sub_pos_iff_lt : 0 < n - m ↔ m < n


lemma embedding_toWeakDualBCNN :
    Embedding (toWeakDualBCNN : FiniteMeasure Ω → WeakDual ℝ≥0 (Ω →ᵇ ℝ≥0))

(Ω : Type u_1)
[MeasurableSpace Ω]
[TopologicalSpace Ω]
[HasOuterApproxClosed Ω]
[BorelSpace Ω]


/-- `0 + x` is equivalent to `x`. -/
theorem zero_add_equiv (x : PGame.{u}) : 0 + x ≈ x


@[to_additive]
theorem smoothOn_one [One M'] : SmoothOn I I' (1 : M → M') s

{𝕜 : 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']
{s : Set M}
[Zero M']


theorem StrictAnti.wellFoundedGT [WellFoundedLT β] (hf : StrictAnti f) : WellFoundedGT α

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
[WellFoundedLT β]
(hf : StrictAnti f)


@[simp] lemma logOrderIso_apply (x : ℝ≥0∞) : logOrderIso x = log x


theorem det_apply (M : Matrix n n R) : M.det = ∑ σ : Perm n, Equiv.Perm.sign σ • ∏ i, M (σ i) i

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

M.det = ∑ σ : Equiv.Perm n, Equiv.Perm.sign σ • ∏ i : n, M (σ i) i


/--
This structure encodes the data required for a morphism to be an effective epimorphism.
-/
structure EffectiveEpiStruct {X Y : C} (f : Y ⟶ X) where
  /--
  For every `W` with a morphism `e : Y ⟶ W` that coequalizes every pair of morphisms
  `g₁ g₂ : Z ⟶ Y` which `f` coequalizes, `desc e h` is a morphism `X ⟶ W`...
  -/
  desc : ∀ {W : C} (e : Y ⟶ W),
    (∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e) → (X ⟶ W)
  /-- ...factorizing `e` through `f`... -/
  fac : ∀ {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e),
    f ≫ desc e h = e
  /-- ...and as such, unique. -/
  uniq : ∀ {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e)
    (m : X ⟶ W), f ≫ m = e → m = desc e h

(self : CategoryTheory.EffectiveEpiStruct f)

(h :
  ∀ {Z : C} (g₁ g₂ : Z ⟶ Y),
    CategoryTheory.CategoryStruct.comp g₁ f = CategoryTheory.CategoryStruct.comp g₂ f →
      CategoryTheory.CategoryStruct.comp g₁ e = CategoryTheory.CategoryStruct.comp g₂ e)

CategoryTheory.CategoryStruct.comp f (self.desc e ⋯) = e


@[to_additive]
theorem inter_mul_subset : s₁ ∩ s₂ * t ⊆ s₁ * t ∩ (s₂ * t)

{α : Type u_2}
[Mul α]
{s₁ s₂ t : Set α}


@[simp]
nonrec theorem next_prev (s : Cycle α) : ∀ (hs : Nodup s) (x : α) (hx : x ∈ s),
    s.next hs (s.prev hs x hx) (prev_mem s hs x hx) = x

{α : Type u_1}
[DecidableEq α]
(s : Cycle α)
(hs : s.Nodup)
(x : α)
(hx : x ∈ s)


theorem diagonal_kroneckerTMul [DecidableEq l] (a : l → α) (B : Matrix m n α) :
    diagonal a ⊗ₖₜ[R] B =
      Matrix.reindex (Equiv.prodComm _ _) (Equiv.prodComm _ _)
        (blockDiagonal fun i => B.map fun b => a i ⊗ₜ[R] b)

(R : Type u_1)
{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
[CommSemiring R]
[AddCommMonoid α]
[Module R α]
[DecidableEq l]
(a : l → α)
(B : Matrix m n α)

Matrix.kroneckerMap (TensorProduct.tmul R) (Matrix.diagonal a) B =
  (Matrix.reindex (Equiv.prodComm m l) (Equiv.prodComm n l)) (Matrix.blockDiagonal fun i => B.map fun b => a i ⊗ₜ[R] b)


theorem LinearIndependent.extend_subset (hs : LinearIndependent K (fun x => x : s → V))
    (hst : s ⊆ t) : hs.extend hst ⊆ t

(hs : LinearIndependent K fun (x : ↑s) => ↑x)


structure Subarray (α : Type u)  where
  array : Array α
  start : Nat
  stop : Nat
  start_le_stop : start ≤ stop
  stop_le_array_size : stop ≤ array.size


@[simp]
theorem WalkingParallelFamily.hom_id (X : WalkingParallelFamily J) :
    WalkingParallelFamily.Hom.id X = 𝟙 X

(X : CategoryTheory.Limits.WalkingParallelFamily J)

CategoryTheory.Limits.WalkingParallelFamily.Hom.id X = CategoryTheory.CategoryStruct.id X


@[simp]
theorem ofLinear_toLinearMap {h₁ h₂} : (ofLinear f g h₁ h₂ : M ≃ₛₗ[σ₁₂] M₂) = f

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
(f : M →ₛₗ[σ₁₂] M₂)
(g : M₂ →ₛₗ[σ₂₁] M)
{h₁ : f.comp g = LinearMap.id}
{h₂ : g.comp f = LinearMap.id}


theorem IsGLB.mem_of_isClosed {a : α} {s : Set α} (ha : IsGLB s a) (hs : s.Nonempty)
    (sc : IsClosed s) : a ∈ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(ha : IsGLB s a)
(hs : s.Nonempty)
(sc : IsClosed s)


theorem StarSubalgebra.one_mem_toNonUnitalStarSubalgebra (S : StarSubalgebra R A) :
    (1 : A) ∈ S.toNonUnitalStarSubalgebra

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(S : StarSubalgebra R A)


theorem IsClosed.isLeast_csInf {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) :
    IsLeast s (sInf s)

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hc : IsClosed s)
(hs : s.Nonempty)
(B : BddBelow s)


/-- `p` splits in the splitting field of `p ∘ q`, for `q` non-constant. -/
theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
    p.Splits (algebraMap F (p.comp q).SplittingField)

{F : Type u_1}
[Field F]
(p q : F[X])
(hq : q.natDegree ≠ 0)

Polynomial.Splits (algebraMap F (p.comp q).SplittingField) p


@[simp]
theorem gold_add_goldConj : φ + ψ = 1


lemma isIso_homologyMap_of_isIso_opcyclesMap_of_mono {φ : S₁ ⟶ S₂}
    [S₁.HasHomology] [S₂.HasHomology] (h₁ : IsIso (opcyclesMap φ)) (h₂ : Mono φ.τ₃) :
    IsIso (homologyMap φ)

(h₁ : CategoryTheory.IsIso (CategoryTheory.ShortComplex.opcyclesMap φ))


/-- A variant of `incl_lift` with `Z` a terminal object. -/
@[simps!]
def inclLiftToTerminal {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsTerminal Z) :
    incl ⋙ liftToTerminal F hZ ≅ F

(hZ : CategoryTheory.Limits.IsTerminal Z)

(CategoryTheory.WithTerminal.inclLiftToTerminal F hZ).hom.app X =
  CategoryTheory.CategoryStruct.id
    (match CategoryTheory.WithTerminal.incl.obj X with
    | CategoryTheory.WithTerminal.of x => F.obj x
    | CategoryTheory.WithTerminal.star => Z)


theorem coe_prodMap (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₄) : ⇑(f.prodMap g) = Prod.map f g

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


/-- `insert x ∅ = {x}` -/
class LawfulSingleton (α : Type u) (β : Type v) [EmptyCollection β] [Insert α β] [Singleton α β] :
    Prop where
  /-- `insert x ∅ = {x}` -/
  insert_emptyc_eq (x : α) : (insert x ∅ : β) = singleton x

{α : Type u}
{β : Type v}
[EmptyCollection β]
[Insert α β]
[Singleton α β]
[self : LawfulSingleton α β]
(x : α)


/-- `ζ - 1` is prime if `p ≠ 2` and `ζ` is a primitive `p ^ (k + 1)`-th root of unity.
  See `zeta_sub_one_prime` for a general statement. -/
theorem zeta_sub_one_prime_of_ne_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) (hodd : p ≠ 2) :
    Prime (hζ.toInteger - 1)


theorem mem_bot {x : A} : x ∈ (⊥ : NonUnitalSubalgebra R A) ↔ x = 0

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{x : A}


theorem IsEulerian.isTrail {u v : V} {p : G.Walk u v} (h : p.IsEulerian) : p.IsTrail

{V : Type u_1}
{G : SimpleGraph V}
[DecidableEq V]
{u v : V}
{p : G.Walk u v}
(h : p.IsEulerian)