/-- If for some `n`, `m ^ n • a = a`, then `0 < period m a`. -/
@[to_additive "If for some `n`, `(n • m) +ᵥ a = a`, then `0 < period m a`."]
theorem period_pos_of_fixed {m : M} {a : α} {n : ℕ} (n_pos : 0 < n) (fixed : m ^ n • a = a) :
    0 < period m a

{α : Type v}
{M : Type u}
[AddMonoid M]
[AddAction M α]
{m : M}
{a : α}
{n : ℕ}
(n_pos : 0 < n)
(fixed : n • m +ᵥ a = a)


lemma δ_comp_zero_cochain {n₁ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K 0)
    (m₁ : ℤ) (h₁ : n₁ + 1 = m₁) :
    δ n₁ m₁ (z₁.comp z₂ (add_zero n₁)) =
      z₁.comp (δ 0 1 z₂) h₁ + (δ n₁ m₁ z₁).comp z₂ (add_zero m₁)

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K 0)

CochainComplex.HomComplex.δ n₁ m₁ (z₁.comp z₂ ⋯) =
  z₁.comp (CochainComplex.HomComplex.δ 0 1 z₂) h₁ + (CochainComplex.HomComplex.δ n₁ m₁ z₁).comp z₂ ⋯


@[simp] lemma norm_ofDual (x : Eᵒᵈ) : ‖ofDual x‖ = ‖x‖


/-- If the elements of a set are independent, then any pair within that set is disjoint. -/
theorem SetIndependent.pairwiseDisjoint : s.PairwiseDisjoint id

{α : Type u_1}
[CompleteLattice α]
{s : Set α}
(hs : CompleteLattice.SetIndependent s)


/-- The functor of adjoining a neutral element `one` to a semigroup.
 -/
@[to_additive (attr := simps) "The functor of adjoining a neutral element `zero` to a semigroup"]
def adjoinOne : Semigrp.{u} ⥤ MonCat.{u}

MonCat.adjoinOne.obj S = MonCat.of (WithOne ↑S)


theorem inf_sdiff_right_comm : x \ z ⊓ y = (x ⊓ y) \ z

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]


theorem toIcoMod_add_toIocMod_zero (a b : α) :
    toIcoMod hp 0 (a - b) + toIocMod hp 0 (b - a) = p

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


lemma StrictMono.vecCons (hf : StrictMono f) (ha : a < f 0) : StrictMono (vecCons a f)

{α : Type u_1}
[Preorder α]
{n : ℕ}
{f : Fin (n + 1) → α}
{a : α}
(hf : StrictMono f)
(ha : a < f 0)


@[simp]
theorem iUnion_nonempty_self (s : Set α) : ⋃ _ : s.Nonempty, s = s


/-- A *Coxeter matrix* is a symmetric matrix of natural numbers whose diagonal entries are equal to
1 and whose off-diagonal entries are not equal to 1. -/
@[ext]
structure CoxeterMatrix (B : Type*) where
  /-- The underlying matrix of the Coxeter matrix. -/
  M : Matrix B B ℕ
  isSymm : M.IsSymm := by decide
  diagonal i : M i i = 1 := by decide
  off_diagonal i i' : i ≠ i' → M i i' ≠ 1 := by decide

{B : Type u_1}
(self : CoxeterMatrix B)
(i : B)


theorem Bool.of_not_eq_false : {b : Bool} → ¬ (b = false) → b = true


@[simp] theorem ULift.down_inj {α : Sort _} {a b : ULift α} : a.down = b.down ↔ a = b

{α : Type u_1}
{a b : ULift.{u_2, u_1} α}


lemma fac {Y : C} (f : Y ⟶ X) (hf : S f) :
    lift hP hE le F ≫ P.map f.op = F.ι ⟨Y, f, hf⟩

{J : CategoryTheory.GrothendieckTopology C}

(hP : ∀ ⦃X : C⦄ (E : J.OneHypercover X), H E → Nonempty (CategoryTheory.Limits.IsLimit (E.multifork P)))

(F : CategoryTheory.Limits.Multifork (CategoryTheory.GrothendieckTopology.Cover.index ⟨S, ⋯⟩ P))

CategoryTheory.CategoryStruct.comp (CategoryTheory.GrothendieckTopology.OneHypercoverFamily.IsSheafIff.lift hP hE le F)
    (P.map f.op) =
  F.ι { Y := Y, f := f, hf := hf }


theorem MeasureTheory.measure_lt_one_eq_integral_div_gamma {p : ℝ} (hp : 0 < p) :
    μ {x : E | g x < 1} =
      .ofReal ((∫ (x : E), Real.exp (- (g x) ^ p) ∂μ) / Real.Gamma (finrank ℝ E / p + 1))

(h3 : ∀ (x y : E), g (x + y) ≤ g x + g y)

μ {x | g x < 1} =
  ENNReal.ofReal ((∫ (x : E), Real.exp (-g x ^ p) ∂μ) / Real.Gamma (↑(FiniteDimensional.finrank ℝ E) / p + 1))


/-- The embedding of `G` into `G □ H` given by `b`. -/
@[simps]
def boxProdLeft (b : β) : G ↪g G □ H

{α : Type u_1}
{β : Type u_2}
(G : SimpleGraph α)
(H : SimpleGraph β)
(b : β)
(a : α)


theorem map_injective {m : α → β} (hm : Injective m) : Injective (map m)

{α : Type u}
{β : Type v}
{m : α → β}
(hm : Function.Injective m)


/-- If a function vanishes almost everywhere on `sᶜ`, then its integral on `s`
coincides with its integral on the whole space. -/
theorem setIntegral_eq_integral_of_ae_compl_eq_zero (h : ∀ᵐ x ∂μ, x ∉ s → f x = 0) :
    ∫ x in s, f x ∂μ = ∫ x, f x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{s : Set X}
{μ : MeasureTheory.Measure X}
(h : ∀ᵐ (x : X) ∂μ, x ∉ s → f x = 0)

∫ (x : X) in s, f x ∂μ = ∫ (x : X), f x ∂μ


theorem one_minus_pos (x : Ioo (0 : β) 1) : 0 < 1 - (x : β)

{β : Type u_2}
[OrderedRing β]
(x : ↑(Set.Ioo 0 1))


@[ext] theorem ext {s₁ s₂ : Sym α n} (h : (s₁ : Multiset α) = ↑s₂) : s₁ = s₂

{α : Type u_1}
{n : ℕ}
{s₁ s₂ : Sym α n}
(h : ↑s₁ = ↑s₂)


@[simp]
theorem choose_symm {n k : ℕ} (hk : k ≤ n) : choose n (n - k) = choose n k


theorem LiftRel.symm (R : α → α → Prop) (H : Symmetric R) : Symmetric (LiftRel R)

{α : Type u}
(R : α → α → Prop)
(H : Symmetric R)


/-- Prime `p` divides the product of a list `L` iff it divides some `a ∈ L` -/
theorem Prime.dvd_prod_iff {p : M} {L : List M} (pp : Prime p) : p ∣ L.prod ↔ ∃ a ∈ L, p ∣ a

{M : Type u_1}
[CommMonoidWithZero M]
{p : M}
{L : List M}
(pp : Prime p)


/-- In a Galois category, every object is the sum of connected objects. -/
theorem has_decomp_connected_components' (X : C) :
    ∃ (ι : Type) (_ : Finite ι) (f : ι → C) (_ : ∐ f ≅ X), ∀ i, IsConnected (f i)

{C : Type u₁}
[CategoryTheory.Category.{u₂, u₁} C]
[CategoryTheory.GaloisCategory C]
(X : C)

∃ ι, ∃ (x : Finite ι), ∃ f x, ∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)


theorem biInter_univ (u : α → Set β) : ⋂ x ∈ @univ α, u x = ⋂ x, u x

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


@[simp]
theorem edist_pos {x y : γ} : 0 < edist x y ↔ x ≠ y


/-- `WithLp.equiv` as a linear equivalence. -/
@[simps (config := .asFn)]
protected def linearEquiv : WithLp p V ≃ₗ[K] V

(p : ℝ≥0∞)
(K : Type uK)
(V : Type uV)
[Semiring K]
[AddCommGroup V]
[Module K V]

⇑(WithLp.linearEquiv p K V).symm = ⇑(WithLp.equiv p V).symm


/-- If the vector passed to `secondInter` is given by a subtraction involving the point in
`secondInter`, the result lies in the span of the two points. -/
theorem Sphere.secondInter_vsub_mem_affineSpan (s : Sphere P) (p₁ p₂ : P) :
    s.secondInter p₁ (p₂ -ᵥ p₁) ∈ line[ℝ, p₁, p₂]

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : EuclideanGeometry.Sphere P)
(p₁ p₂ : P)

s.secondInter p₁ (p₂ -ᵥ p₁) ∈ affineSpan ℝ {p₁, p₂}


/-- Coproduct of two `MulHom`s with the same codomain with `Commute` assumption:
  `f.noncommCoprod g _ (p : M × N) = f p.1 * g p.2`.
  (For the commutative case, use `MulHom.coprod`) -/
@[to_additive (attr := simps)
    "Coproduct of two `AddHom`s with the same codomain with `AddCommute` assumption:
    `f.noncommCoprod g _ (p : M × N) = f p.1 + g p.2`.
    (For the commutative case, use `AddHom.coprod`)"]
def noncommCoprod (comm : ∀ m n, Commute (f m) (g n)) : M × N →ₙ* P

(comm : ∀ (m : M) (n : N), AddCommute (f m) (g n))

(f.noncommCoprod g comm) mn = f mn.1 + g mn.2


@[simp]
theorem toNatOrdinal_max (a b : Ordinal) :
    toNatOrdinal (max a b) = max (toNatOrdinal a) (toNatOrdinal b)

Ordinal.toNatOrdinal (max a b) = max (Ordinal.toNatOrdinal a) (Ordinal.toNatOrdinal b)


theorem Indep.exists_insert_of_not_base (hI : M.Indep I) (hI' : ¬M.Base I) (hB : M.Base B) :
    ∃ e ∈ B \ I, M.Indep (insert e I)

{α : Type u_1}
{M : Matroid α}
{B I : Set α}
(hI : M.Indep I)
(hI' : ¬M.Base I)
(hB : M.Base B)


theorem min_bot_left [OrderBot α] (a : α) : min ⊥ a = ⊥

{α : Type u}
[LinearOrder α]
[OrderBot α]
(a : α)


lemma setLIntegral_rnDeriv' [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν) {s : Set α}
    (hs : MeasurableSet s) :
    ∫⁻ x in s, μ.rnDeriv ν x ∂ν = μ s

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[μ.HaveLebesgueDecomposition ν]
(hμν : μ ≪ ν)
{s : Set α}
(hs : MeasurableSet s)


theorem comap_injective {f : A →⋆ₐ[R] B} (hf : Function.Surjective f) :
    Function.Injective (comap f)

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
[Semiring B]
[StarRing B]
[Algebra R B]
[StarModule R B]
{f : A →⋆ₐ[R] B}
(hf : Function.Surjective ⇑f)


@[to_additive (attr := simp, nolint simpNF)]
theorem one_apply [∀ i, One <| f i] : (1 : ∀ i, f i) i = 1

{I : Type u}
{f : I → Type v₁}
(i : I)
[(i : I) → Zero (f i)]


/-- The maps `hσ' q n m hnm` are natural on the simplicial object -/
theorem hσ'_naturality (q : ℕ) (n m : ℕ) (hnm : c.Rel m n) {X Y : SimplicialObject C} (f : X ⟶ Y) :
    f.app (op [n]) ≫ hσ' q n m hnm = hσ' q n m hnm ≫ f.app (op [m])

(hnm : AlgebraicTopology.DoldKan.c.Rel m n)

{X Y : CategoryTheory.SimplicialObject C}

f.app (Opposite.op [n]) ≫ AlgebraicTopology.DoldKan.hσ' q n m hnm =
  AlgebraicTopology.DoldKan.hσ' q n m hnm ≫ f.app (Opposite.op [m])


@[elementwise, reassoc]
theorem stalkMap_germ {X Y : PresheafedSpace.{_, _, v} C} (α : X ⟶ Y) (U : Opens Y)
    (x : (Opens.map α.base).obj U) :
    Y.presheaf.germ ⟨α.base x.1, x.2⟩ ≫ α.stalkMap ↑x = α.c.app (op U) ≫ X.presheaf.germ x

{X Y : AlgebraicGeometry.PresheafedSpace C}

(x : ↥((TopologicalSpace.Opens.map α.base).obj U))

Y.presheaf.germ ⟨α.base ↑x, ⋯⟩ ≫ AlgebraicGeometry.PresheafedSpace.Hom.stalkMap α ↑x =
  α.c.app (Opposite.op U) ≫ X.presheaf.germ x


@[to_additive]
theorem map_comap_le (H : Subgroup N) : map f (comap f H) ≤ H

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
(H : Subgroup N)


theorem replicate_right_inj {a b : α} {n : ℕ} (h : n ≠ 0) : replicate n a = replicate n b ↔ a = b

Sym.replicate n a = Sym.replicate n b ↔ a = b


@[simp]
theorem toOrdinal_one : toOrdinal 1 = 1


/-- The diagram whose colimit defines the values of `plus`. -/
@[simps]
def diagram (X : C) : (J.Cover X)ᵒᵖ ⥤ D

(J : CategoryTheory.GrothendieckTopology C)

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

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

(J.diagram P X).map f =
  CategoryTheory.Limits.Multiequalizer.lift ((Opposite.unop T).index P)
    ((fun S => CategoryTheory.Limits.multiequalizer ((Opposite.unop S).index P)) S)
    (fun I =>
      CategoryTheory.Limits.Multiequalizer.ι ((Opposite.unop S).index P)
        (CategoryTheory.GrothendieckTopology.Cover.Arrow.map I f.unop))
    ⋯


/-- Uniform isomorphism between `α` and `β` -/
--@[nolint has_nonempty_instance] -- Porting note(#5171): linter not yet ported
structure UniformEquiv (α : Type*) (β : Type*) [UniformSpace α] [UniformSpace β] extends
  α ≃ β where
  /-- Uniform continuity of the function -/
  uniformContinuous_toFun : UniformContinuous toFun
  /-- Uniform continuity of the inverse -/
  uniformContinuous_invFun : UniformContinuous invFun

{α : Type u_4}
{β : Type u_5}
[UniformSpace α]
[UniformSpace β]
(self : α ≃ᵤ β)


lemma _root_.Finset.eventuallyEq_iUnion {ι : Type*} (s : Finset ι) {f g : ι → Set α}
    (heq : ∀ i ∈ s, f i =ᶠ[l] g i) : (⋃ i ∈ s, f i) =ᶠ[l] (⋃ i ∈ s, g i)

{α : Type u}
{l : Filter α}
{ι : Type u_2}
(s : Finset ι)
{f g : ι → Set α}
(heq : ∀ i ∈ s, f i =ᶠ[l] g i)


theorem wOppSide_pointReflection {s : AffineSubspace R P} {x : P} (y : P) (hx : x ∈ s) :
    s.WOppSide y (pointReflection R x y)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x : P}
(y : P)
(hx : x ∈ s)

s.WOppSide y ((AffineEquiv.pointReflection R x) y)


/-- **Ruzsa's triangle inequality**. Mul-div-div version. -/
@[to_additive "**Ruzsa's triangle inequality**. Add-sub-sub version."]
theorem ruzsa_triangle_inequality_mul_div_div (A B C : Finset α) :
    (A * C).card * B.card ≤ (A / B).card * (B / C).card

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
(A B C : Finset α)


theorem all_mem_nhds (x : X) (P : Set X → Prop) (hP : ∀ s t, s ⊆ t → P s → P t) :
    (∀ s ∈ 𝓝 x, P s) ↔ ∀ s, IsOpen s → x ∈ s → P s

(hP : ∀ (s t : Set X), s ⊆ t → P s → P t)

(∀ s ∈ 𝓝 x, P s) ↔ ∀ (s : Set X), IsOpen s → x ∈ s → P s


theorem of_symm_smul_of_eq_mul [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} :
    (HahnModule.of R).symm (x • HahnModule.of R y) = x * y

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[NonUnitalNonAssocSemiring R]
{x y : HahnSeries Γ R}

(HahnModule.of R).symm (x • (HahnModule.of R) y) = x * y


theorem forall_iff {p : Fin n → Prop} : (∀ i, p i) ↔ ∀ i h, p ⟨i, h⟩

(∀ (i : Fin n), p i) ↔ ∀ (i : Nat) (h : i < n), p ⟨i, h⟩


theorem adjointDomainMkCLM_apply (y : T.adjointDomain) (x : T.domain) :
    adjointDomainMkCLM T y x = ⟪(y : F), T x⟫

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
(T : E →ₗ.[𝕜] F)
(y : ↥T.adjointDomain)
(x : ↥T.domain)

(T.adjointDomainMkCLM y) x = ⟪↑y, ↑T x⟫_𝕜


/--
This is the special case of `Valuation.Integers.isUnit_of_one` when the valuation is defined
over a field. Let `v` be a valuation on some field `F` and `O` be its integers. For every element
`x` in `O`, `x` is a unit in `O` if and only if the image of `x` in `F` has valuation 1.
-/
theorem isUnit_of_one' (hv : Integers v O) {x : O} (hvx : v (algebraMap O F x) = 1) : IsUnit x

{F : Type u}
{Γ₀ : Type v}
[Field F]
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation F Γ₀}
{O : Type w}
[CommRing O]
[Algebra O F]
(hv : v.Integers O)
{x : O}
(hvx : v ((algebraMap O F) x) = 1)


theorem hasIntegral_const (c : E) : HasIntegral I l (fun _ => c) vol (vol I c)

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

BoxIntegral.HasIntegral I l (fun x => c) vol ((vol I) c)


theorem lt_mul_of_one_lt_right [PosMulStrictMono α] (ha : 0 < a) (h : 1 < b) : a < a * b

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulStrictMono α]
(ha : 0 < a)
(h : 1 < b)


@[to_additive]
theorem closure_one_eq : closure ({1} : Set E) = { x | ‖x‖ = 0 }


@[simp] lemma ofEquiv_toEquiv (a : α) : ofEquiv (toEquiv a) = a

Specialization.ofEquiv (Specialization.toEquiv a) = a


lemma charpoly_constantCoeff_eq_zero_iff (φ : Module.End K M) :
    constantCoeff φ.charpoly = 0 ↔ ∃ (m : M), m ≠ 0 ∧ φ m = 0

{K : Type u_2}
{M : Type u_3}
[Field K]
[AddCommGroup M]
[Module K M]
[Module.Finite K M]
(φ : Module.End K M)

Polynomial.constantCoeff (LinearMap.charpoly φ) = 0 ↔ ∃ m, m ≠ 0 ∧ φ m = 0


theorem mem_iff_get? {a} {l : List α} : a ∈ l ↔ ∃ n, l.get? n = some a


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


@[simp]
theorem ofReal_toReal_eq_iff : ENNReal.ofReal a.toReal = a ↔ a ≠ ⊤


@[to_additive (attr := simp)] lemma op_inv [Inv α] (x : α) : op x⁻¹ = (op x)⁻¹


theorem p_nonzero [Nontrivial R] [CharP R p] : (p : 𝕎 R) ≠ 0

(p : ℕ)
(R : Type u_1)
[hp : Fact (Nat.Prime p)]
[CommRing R]
[Nontrivial R]
[CharP R p]


theorem isInt_gcd : {x y nx ny : ℤ} → {z : ℕ} →
    IsInt x nx → IsInt y ny → Int.gcd nx ny = z → IsNat (Int.gcd x y) z

Mathlib.Meta.NormNum.IsInt x nx →
  Mathlib.Meta.NormNum.IsInt y ny → nx.gcd ny = z → Mathlib.Meta.NormNum.IsNat (x.gcd y) z


theorem comap_mono (h : K ≤ L) : comap f K ≤ comap f L

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


protected theorem IsHermitian.isSelfAdjoint {A : Matrix n n α} (h : A.IsHermitian) :
    IsSelfAdjoint A

{α : Type u_1}
{n : Type u_4}
[Star α]
{A : Matrix n n α}
(h : A.IsHermitian)


/-- The induced functor `Sheaf K A ⥤ Sheaf J A` given by `F.op ⋙ _`
if `F` is a continuous functor.
-/
@[simps!]
def sheafPushforwardContinuous : Sheaf K A ⥤ Sheaf J A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

((F.sheafPushforwardContinuous A J K).obj ℱ).val.obj X = ℱ.val.obj (Opposite.op (F.obj (Opposite.unop X)))


theorem comp_as_mul {x y z : SingleObj M} (f : x ⟶ y) (g : y ⟶ z) : f ≫ g = g * f

(M : Type u)
[Monoid M]
{x y z : CategoryTheory.SingleObj M}
(f : x ⟶ y)
(g : y ⟶ z)


theorem ofFn_id (n) : ofFn id = finRange n


theorem boxProd_adj_right {a : α} {b₁ b₂ : β} : (G □ H).Adj (a, b₁) (a, b₂) ↔ H.Adj b₁ b₂

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{H : SimpleGraph β}
{a : α}
{b₁ b₂ : β}


@[simp]
theorem sup_apply (f g : SupHom α β) (a : α) : (f ⊔ g) a = f a ⊔ g a

{α : Type u_3}
{β : Type u_4}
[Sup α]
[SemilatticeSup β]
(f g : SupHom α β)
(a : α)


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

(X.braiding Y).inv.f = CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst


/-- Coercion from `G' : Subgraph G` to a `SimpleGraph G'.verts`. -/
@[simps]
protected def coe (G' : Subgraph G) : SimpleGraph G'.verts

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)
(v w : ↑G'.verts)


/-- The unit isomorphism upgrades to a monoidal isomorphism. -/
@[simps! hom inv]
def transportedMonoidalUnitIso (e : C ≌ D) :
    LaxMonoidalFunctor.id C ≅
      (toTransported e).toLaxMonoidalFunctor ⊗⋙ (fromTransported e).toLaxMonoidalFunctor

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

(CategoryTheory.Monoidal.transportedMonoidalUnitIso e).inv =
  CategoryTheory.monoidalCounit (CategoryTheory.Monoidal.fromTransported e) e.symm.toAdjunction


theorem of_terminatedAt_n_iff_succ_nth_intFractPair_stream_eq_none :
    (of v).TerminatedAt n ↔ IntFractPair.stream v (n + 1) = none

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}
{n : ℕ}

(GenContFract.of v).TerminatedAt n ↔ GenContFract.IntFractPair.stream v (n + 1) = none


theorem monotone_accumulate [Preorder α] : Monotone (Accumulate s)

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


@[simp, norm_cast] lemma coe_neg [∀ i, AddGroup (β i)] (g : Π₀ i, β i) : ⇑(-g) = -g

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


theorem sin_antiperiodic : Function.Antiperiodic sin π


theorem strictMonoOn_sin : StrictMonoOn sin (Icc (-(π / 2)) (π / 2))

StrictMonoOn Real.sin (Set.Icc (-(Real.pi / 2)) (Real.pi / 2))


@[simp]
theorem eqToHom_proj {x x' : ∀ i, C i} (h : x = x') (i : I) :
    (eqToHom h : x ⟶ x') i = eqToHom (Function.funext_iff.mp h i)

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

CategoryTheory.eqToHom h i = CategoryTheory.eqToHom ⋯


@[simp]
theorem integral_exp : ∫ x in a..b, exp x = exp b - exp a

∫ (x : ℝ) in a..b, rexp x = rexp b - rexp a


@[simp]
theorem singleton_mem_subchain_iff : [a] ∈ s.subchain ↔ a ∈ s

{α : Type u_1}
[LT α]
{s : Set α}
{a : α}


theorem btw_rfl_right {a b : α} : btw a b b

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


theorem Ioo_ae_eq_Ioc' (hb : μ {b} = 0) : Ioo a b =ᵐ[μ] Ioc a b

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[PartialOrder α]
{a b : α}
(hb : μ {b} = 0)


theorem ωSup_eq_none {c : Chain (Part α)} (h : ¬∃ a, some a ∈ c) : Part.ωSup c = none

{c : OmegaCompletePartialOrder.Chain (Part α)}


@[to_additive MeasureTheory.addFundamentalInterior_subset]
theorem fundamentalInterior_subset : fundamentalInterior G s ⊆ s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
{s : Set α}

MeasureTheory.addFundamentalInterior G s ⊆ s


theorem ChainClosure.total (hc₁ : ChainClosure r c₁) (hc₂ : ChainClosure r c₂) :
    c₁ ⊆ c₂ ∨ c₂ ⊆ c₁

{α : Type u_1}
{r : α → α → Prop}
{c₁ c₂ : Set α}
(hc₁ : ChainClosure r c₁)
(hc₂ : ChainClosure r c₂)

c₁ ⊆ c₂ ∨ c₂ ⊆ c₁


/-- An element `x : α` of `l : List α` is a duplicate iff it can be found
at two distinct indices `n m : ℕ` inside the list `l`.
-/
@[deprecated duplicate_iff_exists_distinct_get (since := "2023-01-19")]
theorem duplicate_iff_exists_distinct_nthLe {l : List α} {x : α} :
    l.Duplicate x ↔
      ∃ (n : ℕ) (hn : n < l.length) (m : ℕ) (hm : m < l.length) (_ : n < m),
        x = l.nthLe n hn ∧ x = l.nthLe m hm

List.Duplicate x l ↔
  ∃ n, ∃ (hn : n < l.length), ∃ m, ∃ (hm : m < l.length) (_ : n < m), x = l.nthLe n hn ∧ x = l.nthLe m hm


@[higher_order snd_comp_snd]
theorem comp_snd {α β₀ β₁ β₂} (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α β₀) :
    snd g' (snd g x) = snd (g' ∘ g) x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[LawfulBifunctor F]
{α : Type u₀}
{β₀ β₁ β₂ : Type u₁}
(g : β₀ → β₁)
(g' : β₁ → β₂)

Bifunctor.snd g' ∘ Bifunctor.snd g = Bifunctor.snd (g' ∘ g)


theorem lintegral_rnDeriv_mul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f ν) : ∫⁻ x, μ.rnDeriv ν x * f x ∂ν = ∫⁻ x, f x ∂μ

{α : Type u_3}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[μ.HaveLebesgueDecomposition ν]
(hμν : μ ≪ ν)
{f : α → ℝ≥0∞}
(hf : AEMeasurable f ν)

∫⁻ (x : α), μ.rnDeriv ν x * f x ∂ν = ∫⁻ (x : α), f x ∂μ


@[to_additive coe_prod]
theorem coe_prod (H : Subgroup G) (K : Subgroup N) :
    (H.prod K : Set (G × N)) = (H : Set G) ×ˢ (K : Set N)

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


theorem ContMDiffWithinAt.prod_map (hf : ContMDiffWithinAt I I' n f s x)
    (hg : ContMDiffWithinAt J J' n g r y) :
    ContMDiffWithinAt (I.prod J) (I'.prod J') n (Prod.map f g) (s ×ˢ r) (x, y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{f : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}
{g : N → N'}
{r : Set N}
{y : N}
(hf : ContMDiffWithinAt I I' n f s x)
(hg : ContMDiffWithinAt J J' n g r y)


theorem map_add [∀ i j, AddMonoid (α i j)] {β : m → n → Type w} [∀ i j, AddMonoid (β i j)]
    (f : ∀ ⦃i j⦄, α i j →+ β i j) (M N : DMatrix m n α) :
    ((M + N).map fun i j => @f i j) = (M.map fun i j => @f i j) + N.map fun i j => @f i j

(f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j)

((M + N).map fun i j => ⇑f) = (M.map fun i j => ⇑f) + N.map fun i j => ⇑f


/-- Preparatory lemma for `inducedOrderRingHom`. -/
theorem exists_mem_cutMap_mul_self_of_lt_inducedMap_mul_self (ha : 0 < a) (b : β)
    (hba : b < inducedMap α β a * inducedMap α β a) : ∃ c ∈ cutMap β (a * a), b < c

(hba : b < LinearOrderedField.inducedMap α β a * LinearOrderedField.inducedMap α β a)

∃ c ∈ LinearOrderedField.cutMap β (a * a), b < c


/-- We verify that the biproduct in `AddCommGrp` is isomorphic to
the cartesian product of the underlying types:
-/
@[simps! hom_apply]
noncomputable def biprodIsoProd (G H : AddCommGrp.{u}) :
    (G ⊞ H : AddCommGrp) ≅ AddCommGrp.of (G × H)

(i : ↑(CategoryTheory.Limits.BinaryBiproduct.bicone G H).toCone.pt)

(G.biprodIsoProd H).hom i = (CategoryTheory.Limits.biprod.fst i, CategoryTheory.Limits.biprod.snd i)


/-- Coercion from `ℚ` as an order embedding. -/
@[simps!]
def castOrderEmbedding : ℚ≥0 ↪o K

{K : Type u_5}
[LinearOrderedSemifield K]

∀ (a : ℚ≥0), NNRat.castOrderEmbedding a = ↑a


theorem add_self (x : Tropical R) : x + x = x

{R : Type u}
[LinearOrder R]
(x : Tropical R)


theorem nonuniformWitness_spec (h₁ : s ≠ t) (h₂ : ¬G.IsUniform ε s t) : ε ≤ |G.edgeDensity
    (G.nonuniformWitness ε s t) (G.nonuniformWitness ε t s) - G.edgeDensity s t|

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
(h₁ : s ≠ t)
(h₂ : ¬G.IsUniform ε s t)

ε ≤ ↑|G.edgeDensity (G.nonuniformWitness ε s t) (G.nonuniformWitness ε t s) - G.edgeDensity s t|


theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
    map (f.extend I) (𝓝[s] y) = 𝓝[f.extend I '' ((f.extend I).source ∩ s)] f.extend I y

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

Filter.map (↑(f.extend I)) (𝓝[s] y) = 𝓝[↑(f.extend I) '' ((f.extend I).source ∩ s)] ↑(f.extend I) y


theorem integral_exp_Iic (c : ℝ) : ∫ x : ℝ in Iic c, exp x = exp c


theorem summable_of_isBigO' {ι E F : Type*} [NormedAddCommGroup E] [CompleteSpace E]
    [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] {f : ι → E} {g : ι → F}
    (hg : Summable g) (h : f =O[cofinite] g) : Summable f

{ι : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[FiniteDimensional ℝ F]
{f : ι → E}
{g : ι → F}
(hg : Summable g)
(h : f =O[Filter.cofinite] g)


theorem map_inf_le (f : F) {p q : Submodule R M} :
    (p ⊓ q).map f ≤ p.map f ⊓ q.map f

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
[RingHomSurjective σ₁₂]
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
(f : F)
{p q : Submodule R M}

Submodule.map f (p ⊓ q) ≤ Submodule.map f p ⊓ Submodule.map f q


@[simp]
theorem coe_modNat (i : Fin (m * n)) : (i.modNat : ℕ) = i % n


@[simp]
theorem expMapCircle_sub (x y : ℝ) : expMapCircle (x - y) = expMapCircle x / expMapCircle y


@[simp] theorem toCoalgebraCatIso_trans (e : X ≃ₗc[R] Y) (f : Y ≃ₗc[R] Z) :
    toCoalgebraCatIso (e.trans f) = toCoalgebraCatIso e ≪≫ toCoalgebraCatIso f

{R : Type u}
[CommRing R]
{X Y Z : Type v}
[AddCommGroup X]
[Module R X]
[AddCommGroup Y]
[Module R Y]
[AddCommGroup Z]
[Module R Z]
[Coalgebra R X]
[Coalgebra R Y]
[Coalgebra R Z]
(e : X ≃ₗc[R] Y)
(f : Y ≃ₗc[R] Z)

(e.trans f).toCoalgebraCatIso = e.toCoalgebraCatIso ≪≫ f.toCoalgebraCatIso


theorem pNilradical_eq_bot_of_frobenius_inj (R : Type*) [CommRing R] (p : ℕ) [ExpChar R p]
    (h : Function.Injective (frobenius R p)) : pNilradical R p = ⊥

(h : Function.Injective ⇑(frobenius R p))


theorem Nonempty.to_type {s : Finset α} : s.Nonempty → Nonempty α


theorem integral_mul_right {L : Type*} [RCLike L] (r : L) (f : α → L) :
    ∫ a, f a * r ∂μ = (∫ a, f a ∂μ) * r

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{L : Type u_6}
[RCLike L]
(r : L)
(f : α → L)

∫ (a : α), f a * r ∂μ = (∫ (a : α), f a ∂μ) * r


theorem IsBigO.congr (h : f₁ =O[l] g₁) (hf : ∀ x, f₁ x = f₂ x) (hg : ∀ x, g₁ x = g₂ x) :
    f₂ =O[l] g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{l : Filter α}
{f₁ f₂ : α → E}
{g₁ g₂ : α → F}
(h : f₁ =O[l] g₁)
(hf : ∀ (x : α), f₁ x = f₂ x)
(hg : ∀ (x : α), g₁ x = g₂ x)


private theorem int_ceil_pos [LinearOrderedRing α] [FloorRing α] {a : α} : 0 < a → 0 < ⌈a⌉

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


lemma stieltjesOfMeasurableRat_unit_prod (hf : Measurable f) (a : α) :
    stieltjesOfMeasurableRat (fun (p : Unit × α) ↦ f p.2) (hf.comp measurable_snd) ((), a)
      = stieltjesOfMeasurableRat f hf a

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

ProbabilityTheory.stieltjesOfMeasurableRat (fun p => f p.2) ⋯ ((), a) =
  ProbabilityTheory.stieltjesOfMeasurableRat f hf a


/-- Hilbert basis theorem: a polynomial ring over a noetherian ring is a noetherian ring. -/
protected theorem Polynomial.isNoetherianRing [inst : IsNoetherianRing R] : IsNoetherianRing R[X]

{R : Type u}
[CommRing R]
[inst : IsNoetherianRing R]


/-- Defining the homomorphism in the category R-Alg. -/
-- @[nolint has_nonempty_instance] -- Porting note(#5171): linter not ported yet
structure AlgHom (R : Type u) (A : Type v) (B : Type w) [CommSemiring R] [Semiring A] [Semiring B]
  [Algebra R A] [Algebra R B] extends RingHom A B where
  commutes' : ∀ r : R, toFun (algebraMap R A r) = algebraMap R B r

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(self : A →ₐ[R] B)
(r : R)

(↑↑self.toRingHom).toFun ((algebraMap R A) r) = (algebraMap R B) r


/-- A series of non-negative real numbers converges to `r` in the sense of `HasSum` if and only if
the sequence of partial sum converges to `r`. -/
theorem hasSum_iff_tendsto_nat {f : ℕ → ℝ≥0} {r : ℝ≥0} :
    HasSum f r ↔ Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, f i) atTop (𝓝 r)

HasSum f r ↔ Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 r)


theorem Filter.HasBasis.inseparable_iff_uniformity {ι : Sort*} {p : ι → Prop} {s : ι → Set (α × α)}
    (h : (𝓤 α).HasBasis p s) {x y : α} : Inseparable x y ↔ ∀ i, p i → (x, y) ∈ s i

{α : Type u}
[UniformSpace α]
{ι : Sort u_1}
{p : ι → Prop}
{s : ι → Set (α × α)}
(h : (𝓤 α).HasBasis p s)
{x y : α}

Inseparable x y ↔ ∀ (i : ι), p i → (x, y) ∈ s i


@[simp]
theorem PInfty_f_0 : (PInfty.f 0 : X _[0] ⟶ X _[0]) = 𝟙 _

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

AlgebraicTopology.DoldKan.PInfty.f 0 = 𝟙 (K[X].X 0)


lemma map'_map'  (f : α →* β) (g : β →* γ) (x) : map' g (map' f x) = map' (g.comp f) x

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MulOneClass α]
[MulOneClass β]
[MulOneClass γ]
(f : α →* β)
(g : β →* γ)
(x : WithZero α)

(WithZero.map' g) ((WithZero.map' f) x) = (WithZero.map' (g.comp f)) x


theorem ext_of_generateFrom_of_cover {S T : Set (Set α)} (h_gen : ‹_› = generateFrom S)
    (hc : T.Countable) (h_inter : IsPiSystem S) (hU : ⋃₀ T = univ) (htop : ∀ t ∈ T, μ t ≠ ∞)
    (ST_eq : ∀ t ∈ T, ∀ s ∈ S, μ (s ∩ t) = ν (s ∩ t)) (T_eq : ∀ t ∈ T, μ t = ν t) : μ = ν

(h_gen : m0 = MeasurableSpace.generateFrom S)


/-- The natural isomorphism `mapTrifunctor F I₁ I₂ I₃ ≅ mapTrifunctor F' I₁ I₂ I₃`
induced by a natural isomorphism `F ≅ F` of trifunctors. -/
@[simps]
def mapTrifunctorMapIso (e : F ≅ F') (I₁ I₂ I₃ : Type*) :
    mapTrifunctor F I₁ I₂ I₃ ≅ mapTrifunctor F' I₁ I₂ I₃

{F F' : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ (CategoryTheory.Functor C₃ C₄))}

(CategoryTheory.GradedObject.mapTrifunctorMapIso e I₁ I₂ I₃).hom =
  CategoryTheory.GradedObject.mapTrifunctorMapNatTrans e.hom I₁ I₂ I₃


/-- The `ShortComplex` in `C` associated to a short complex in `Cᵒᵖ`. -/
@[simps]
def unop (S : ShortComplex Cᵒᵖ) : ShortComplex C


@[simp]
theorem map_inl (n : N) : map f₁ f₂ h (inl n) = inl (f₁ n)

(h : ∀ (g : G), f₁.comp (MulEquiv.toMonoidHom (φ g)) = (MulEquiv.toMonoidHom (φ₁ (f₂ g))).comp f₁)

(SemidirectProduct.map f₁ f₂ h) (SemidirectProduct.inl n) = SemidirectProduct.inl (f₁ n)


theorem map_traverse' (g : α → G β) (h : β → γ) :
    traverse (map h ∘ g) = (map (map h) ∘ traverse g : t α → G (t γ))

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{G : Type u → Type u}
[Applicative G]
[LawfulApplicative G]
{α β γ : Type u}
(g : α → G β)
(h : β → γ)

traverse (Functor.map h ∘ g) = Functor.map (Functor.map h) ∘ traverse g


protected lemma inv_inv (ha : a ≠ 0) (hb : b ≠ 0) (hab : a + b = 1) :
    a⁻¹.IsConjExponent b⁻¹

{a b : NNReal}
(ha : a ≠ 0)
(hb : b ≠ 0)
(hab : a + b = 1)


theorem finSuccEquiv_comp_C_eq_C {R : Type u} [CommSemiring R] (n : ℕ) :
    (↑(MvPolynomial.finSuccEquiv R n).symm : Polynomial (MvPolynomial (Fin n) R) →+* _).comp
        (Polynomial.C.comp MvPolynomial.C) =
      (MvPolynomial.C : R →+* MvPolynomial (Fin n.succ) R)

(↑(MvPolynomial.finSuccEquiv R n).symm).comp (Polynomial.C.comp MvPolynomial.C) = MvPolynomial.C


{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : StrongFEPair E)


@[simp]
theorem apply_symm_apply (e : α ≃ᵐ β) (y : β) : e (e.symm y) = y

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


@[simp]
theorem involute_involute : ∀ a : CliffordAlgebra Q, involute (involute 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.involute (CliffordAlgebra.involute a) = a


@[simp] theorem toCoalgHom_comp {M N U : CoalgebraCat.{v} R} (f : M ⟶ N) (g : N ⟶ U) :
    (f ≫ g).toCoalgHom = g.toCoalgHom.comp f.toCoalgHom

{R : Type u}
[CommRing R]
{M N U : CoalgebraCat R}
(f : M ⟶ N)
(g : N ⟶ U)


@[simp]
theorem attachBound_apply_coe (f : C(X, ℝ)) (x : X) : ((attachBound f) x : ℝ) = f x

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


theorem filter_single (p : ι → Prop) [DecidablePred p] (i : ι) (x : β i) :
    (single i x).filter p = if p i then single i x else 0

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
(p : ι → Prop)
[DecidablePred p]
(i : ι)
(x : β i)

DFinsupp.filter p (DFinsupp.single i x) = if p i then DFinsupp.single i x else 0


theorem modEq_of_xn_modEq {i j n} (ipos : 0 < i) (hin : i ≤ n)
    (h : xn a1 j ≡ xn a1 i [MOD xn a1 n]) :
    j ≡ i [MOD 4 * n] ∨ j + i ≡ 0 [MOD 4 * n]

(h : Pell.xn a1 j ≡ Pell.xn a1 i [MOD Pell.xn a1 n])


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

(X Y : CategoryTheory.FullSubcategory P)

(CategoryTheory.MonoidalCategory.tensorObj X Y).obj = CategoryTheory.MonoidalCategory.tensorObj X.obj Y.obj


lemma comap_equiv_eq_map_symm (f : β ≃o α) (L : Sublattice α) :
    L.comap f = L.map (f.symm : LatticeHom α β)

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

Sublattice.comap { toFun := ⇑f, map_sup' := ⋯, map_inf' := ⋯ } L =
  Sublattice.map { toFun := ⇑f.symm, map_sup' := ⋯, map_inf' := ⋯ } L


theorem fst_mem_divisors_of_mem_antidiagonal {x : ℕ × ℕ} (h : x ∈ divisorsAntidiagonal n) :
    x.fst ∈ divisors n

{n : ℕ}
{x : ℕ × ℕ}
(h : x ∈ n.divisorsAntidiagonal)


theorem contDiffOn_pi' (hΦ : ∀ i, ContDiffOn K n (fun x => Φ x i) s) : ContDiffOn K n Φ s

(hΦ : ∀ (i : ι), ContDiffOn K n (fun x => Φ x i) s)


@[simp]
theorem ContinuousMultilinearMap.curry0_norm (x : G') :
    ‖ContinuousMultilinearMap.curry0 𝕜 G x‖ = ‖x‖

(𝕜 : Type u)
(G : Type wG)
{G' : Type wG'}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[NormedAddCommGroup G']
[NormedSpace 𝕜 G']
(x : G')


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

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


/-- The object in the category of `R`-coalgebras associated to an `R`-coalgebra. -/
@[simps]
def of (X : Type v) [AddCommGroup X] [Module R X] [Coalgebra R X] :
    CoalgebraCat R

(R : Type u)
[CommRing R]
(X : Type v)
[AddCommGroup X]
[Module R X]
[Coalgebra R X]

(CoalgebraCat.of R X).instCoalgebra = inferInstance


theorem specializes_closedPoint (x : PrimeSpectrum R) : x ⤳ closedPoint R

{R : Type u}
[CommSemiring R]
[LocalRing R]
(x : PrimeSpectrum R)


theorem IsGLB.exists_seq_strictAnti_tendsto_of_not_mem {t : Set α} {x : α}
    [IsCountablyGenerated (𝓝 x)] (htx : IsGLB t x) (not_mem : x ∉ t) (ht : t.Nonempty) :
    ∃ u : ℕ → α, StrictAnti u ∧ (∀ n, x < u n) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ n, u n ∈ t

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{t : Set α}
{x : α}
[(𝓝 x).IsCountablyGenerated]
(htx : IsGLB t x)
(not_mem : x ∉ t)
(ht : t.Nonempty)

∃ u, StrictAnti u ∧ (∀ (n : ℕ), x < u n) ∧ Filter.Tendsto u Filter.atTop (𝓝 x) ∧ ∀ (n : ℕ), u n ∈ t


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

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

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


theorem LindelofSpace.elim_nhds_subcover [LindelofSpace X] (U : X → Set X) (hU : ∀ x, U x ∈ 𝓝 x) :
    ∃ t : Set X, t.Countable ∧ ⋃ x ∈ t, U x = univ

{X : Type u}
[TopologicalSpace X]
[LindelofSpace X]
(U : X → Set X)
(hU : ∀ (x : X), U x ∈ 𝓝 x)

∃ t, t.Countable ∧ ⋃ x ∈ t, U x = Set.univ


theorem pre_le (hs : diam s ≤ r) : pre m r s ≤ m s

{X : Type u_2}
[EMetricSpace X]
{m : Set X → ℝ≥0∞}
{r : ℝ≥0∞}
{s : Set X}
(hs : EMetric.diam s ≤ r)

(MeasureTheory.OuterMeasure.mkMetric'.pre m r) s ≤ m s


theorem of_comp (f : X → Y) (hg : OpenEmbedding g)
    (h : OpenEmbedding (g ∘ f)) : OpenEmbedding f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(f : X → Y)
(hg : OpenEmbedding g)
(h : OpenEmbedding (g ∘ f))


@[to_additive (attr := simp)]
theorem noncommProd_singleton (a : α) (f : α → β) :
    noncommProd ({a} : Finset α) f
        (by
          norm_cast
          exact Set.pairwise_singleton _ _) =
      f a

{α : Type u_3}
{β : Type u_4}
[Monoid β]
(a : α)
(f : α → β)


/-- If `α` has no zero divisors, then the product of two elements is nonzero iff both of them
are nonzero. -/
theorem mul_ne_zero_iff : a * b ≠ 0 ↔ a ≠ 0 ∧ b ≠ 0

{M₀ : Type u_1}
[MulZeroClass M₀]
[NoZeroDivisors M₀]
{a b : M₀}


theorem singularPart_zero (μ : Measure α) : (0 : SignedMeasure α).singularPart μ = 0

{α : Type u_1}
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)

MeasureTheory.SignedMeasure.singularPart 0 μ = 0


theorem iff_isOpen_fiber_apply {f : X → Y} : IsLocallyConstant f ↔ ∀ x, IsOpen (f ⁻¹' {f x})

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

IsLocallyConstant f ↔ ∀ (x : X), IsOpen (f ⁻¹' {f x})


@[simp]
theorem evalFrom_singleton (s : σ) (a : α) : M.evalFrom s [a] = M.step s a

{α : Type u}
{σ : Type v}
(M : DFA α σ)
(s : σ)
(a : α)


lemma polyCharpolyAux_map_aeval
    (A : Type*) [CommRing A] [Algebra R A] [Module.Finite A (A ⊗[R] M)] [Module.Free A (A ⊗[R] M)]
    (x : ι → A) :
    (polyCharpolyAux φ b bₘ).map (MvPolynomial.aeval x).toRingHom =
      LinearMap.charpoly ((tensorProduct R A M M).comp (baseChange A φ)
        ((basis A b).repr.symm (Finsupp.equivFunOnFinite.symm x)))

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
{ιM : Type u_7}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[Fintype ιM]
[DecidableEq ι]
[DecidableEq ιM]
(b : Basis ι R L)
(bₘ : Basis ιM R M)
(A : Type u_8)
[CommRing A]
[Algebra R A]
[Module.Finite A (TensorProduct R A M)]
[Module.Free A (TensorProduct R A M)]
(x : ι → A)

Polynomial.map (MvPolynomial.aeval x).toRingHom (φ.polyCharpolyAux b bₘ) =
  ((LinearMap.tensorProduct R A M M ∘ₗ LinearMap.baseChange A φ)
      ((Algebra.TensorProduct.basis A b).repr.symm (Finsupp.equivFunOnFinite.symm x))).charpoly


/-- A simplicial complex in a `𝕜`-module is a collection of simplices which glue nicely together.
Note that the textbook meaning of "glue nicely" is given in
`Geometry.SimplicialComplex.disjoint_or_exists_inter_eq_convexHull`. It is mostly useless, as
`Geometry.SimplicialComplex.convexHull_inter_convexHull` is enough for all purposes. -/
@[ext]
structure SimplicialComplex where
  /-- the faces of this simplicial complex: currently, given by their spanning vertices -/
  faces : Set (Finset E)
  /-- the empty set is not a face: hence, all faces are non-empty -/
  not_empty_mem : ∅ ∉ faces
  /-- the vertices in each face are affine independent: this is an implementation detail -/
  indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E)
  /-- faces are downward closed: a non-empty subset of its spanning vertices spans another face -/
  down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces
  inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces →
    convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(self : Geometry.SimplicialComplex 𝕜 E)


lemma smul_nonpos_iff_pos_imp_nonpos : a • b ≤ 0 ↔ (0 < a → b ≤ 0) ∧ (b < 0 → 0 ≤ a)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[PosSMulStrictMono α β]
{a : α}
{b : β}


@[simp]
lemma iso_inv_val_base_hom_val_base {X Y : LocallyRingedSpace.{u}} (e : X ≅ Y) :
    e.inv.val.base ≫ e.hom.val.base = 𝟙 _

{X Y : AlgebraicGeometry.LocallyRingedSpace}

e.inv.val.base ≫ e.hom.val.base = 𝟙 ↑Y.toPresheafedSpace


theorem set_set (a : Array α) (i : Fin a.size) (v v' : α) :
    (a.set i v).set ⟨i, by simp [i.2]⟩ v' = a.set i v'

{α : Type u_1}
(a : Array α)
(i : Fin a.size)
(v v' : α)


theorem single_eq_C (r : R) : Finsupp.single 0 r = C r

Finsupp.single 0 r = LaurentPolynomial.C r


theorem ne_zero_of_ortho {x : M} {N : Submodule R M}
    (ortho : ∀ (c : R), ∀ y ∈ N, c • x + y = (0 : M) → c = 0) : x ≠ 0

(ortho : ∀ (c : R), ∀ y ∈ N, c • x + y = 0 → c = 0)


protected theorem lt_asymm {a b : Nat} (h : a < b) : ¬ b < a


@[to_additive]
theorem image_mul : (s * t).image (f : α → β) = s.image f * t.image f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
[Add α]
[Add β]
[FunLike F α β]
[AddHomClass F α β]
(f : F)
{s t : Finset α}

Finset.image (⇑f) (s + t) = Finset.image (⇑f) s + Finset.image (⇑f) t


@[to_additive]
theorem smul_pi [Group K] [∀ i, MulAction K (R i)] (r : K) (S : Set ι) (t : ∀ i, Set (R i)) :
    r • S.pi t = S.pi (r • t)

{K : Type u_1}
{ι : Type u_2}
{R : ι → Type u_3}
[AddGroup K]
[(i : ι) → AddAction K (R i)]
(r : K)
(S : Set ι)
(t : (i : ι) → Set (R i))


@[simp]
theorem get_map {β : Type*} (v : Vector α n) (f : α → β) (i : Fin n) :
    (v.map f).get i = f (v.get i)

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

(Mathlib.Vector.map f v).get i = f (v.get i)


theorem finite_iff_nonempty_fintype (α : Type*) : Finite α ↔ Nonempty (Fintype α)


@[simp]
theorem coe_rangeS : (f.rangeS : Set S) = Set.range f

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


lemma rTensor_apply_tmul (p : MvPolynomial σ S) (n : N) :
    rTensor (p ⊗ₜ[R] n) = p.sum (fun i m ↦ Finsupp.single i (m ⊗ₜ[R] n))

{R : Type u}
{N : Type w}
[CommSemiring R]
{σ : Type u_1}
[DecidableEq σ]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[AddCommMonoid N]
[Module R N]
(p : MvPolynomial σ S)
(n : N)

MvPolynomial.rTensor (p ⊗ₜ[R] n) = Finsupp.sum p fun i m => Finsupp.single i (m ⊗ₜ[R] n)


theorem nonempty_support : (support f).Nonempty

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


/-- `affineCombination` gives the sum with any base point, when the
sum of the weights is 1. -/
theorem affineCombination_eq_weightedVSubOfPoint_vadd_of_sum_eq_one (w : ι → k) (p : ι → P)
    (h : ∑ i ∈ s, w i = 1) (b : P) :
    s.affineCombination k p w = s.weightedVSubOfPoint p b w +ᵥ b

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : ι → P)
(h : ∑ i ∈ s, w i = 1)
(b : P)

(Finset.affineCombination k s p) w = (s.weightedVSubOfPoint p b) w +ᵥ b


/-- The obvious functor `WidePushoutShape J ⥤ (WidePullbackShape J)ᵒᵖ` -/
@[simps]
def widePushoutShapeOp : WidePushoutShape J ⥤ (WidePullbackShape J)ᵒᵖ

(X : CategoryTheory.Limits.WidePushoutShape J)

(CategoryTheory.Limits.widePushoutShapeOp J).obj X = Opposite.op X


@[to_additive (attr := simp)]
theorem apply_ofInjective_symm {f : G →* N} (hf : Function.Injective f) (x : f.range) :
    f ((ofInjective hf).symm x) = x

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
(hf : Function.Injective ⇑f)
(x : ↥f.range)

f ((AddMonoidHom.ofInjective hf).symm x) = ↑x


@[simp] theorem not_liftRel_inl_inr : ¬LiftRel r s (inl a) (inr d)

∀ {α : Type u_1} {γ : Type u_2} {r : α → γ → Prop} {β : Type u_3} {δ : Type u_4} {s : β → δ → Prop} {a : α} {d : δ},
  ¬Sum.LiftRel r s (Sum.inl a) (Sum.inr d)


/-- On a finite product space, a product of integrable functions depending on each coordinate is
integrable. -/
theorem Integrable.fintype_prod {ι : Type*} [Fintype ι] {E : Type*}
    {f : ι → E → 𝕜} [MeasureSpace E] [SigmaFinite (volume : Measure E)]
    (hf : ∀ i, Integrable (f i)) :
    Integrable (fun (x : ι → E) ↦ ∏ i, f i (x i))

(hf : ∀ (i : ι), MeasureTheory.Integrable (f i) MeasureTheory.volume)

MeasureTheory.Integrable (fun x => ∏ i : ι, f i (x i)) MeasureTheory.volume


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

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


@[simp]
theorem LinearMap.toMatrixₛₗ₂'_apply (B : (n → R₁) →ₛₗ[σ₁] (m → R₂) →ₛₗ[σ₂] N₂) (i : n) (j : m) :
    LinearMap.toMatrixₛₗ₂' R B i j =
      B (stdBasis R₁ (fun _ => R₁) i 1) (stdBasis R₂ (fun _ => R₂) j 1)

(LinearMap.toMatrixₛₗ₂' R) B i j =
  (B ((LinearMap.stdBasis R₁ (fun x => R₁) i) 1)) ((LinearMap.stdBasis R₂ (fun x => R₂) j) 1)


@[reassoc]
theorem w {A B : CostructuredArrow S T} (f : A ⟶ B) : S.map f.left ≫ B.hom = A.hom

{A B : CategoryTheory.CostructuredArrow S T}

CategoryTheory.CategoryStruct.comp (S.map f.left) B.hom = A.hom


@[simp]
theorem mem_unop {s : Set αᵒᵖ} {a : α} : a ∈ s.unop ↔ op a ∈ s


theorem exists_of_mem_join {a : α} : ∀ {S : WSeq (WSeq α)}, a ∈ join S → ∃ s, s ∈ S ∧ a ∈ s

{α : Type u}
{a : α}
{S : Stream'.WSeq (Stream'.WSeq α)}


/-- **Darboux's theorem**: if `a ≤ b` and `f' a < m < f' b`, then `f' c = m` for some
`c ∈ (a, b)`. -/
theorem exists_hasDerivWithinAt_eq_of_gt_of_lt (hab : a ≤ b)
    (hf : ∀ x ∈ Icc a b, HasDerivWithinAt f (f' x) (Icc a b) x) {m : ℝ} (hma : f' a < m)
    (hmb : m < f' b) : m ∈ f' '' Ioo a b

(hf : ∀ x ∈ Set.Icc a b, HasDerivWithinAt f (f' x) (Set.Icc a b) x)


@[elab_as_elim]
theorem trans_induction_on {P : ∀ {a b : α}, TransGen r a b → Prop} {a b : α} (h : TransGen r a b)
    (base : ∀ {a b} (h : r a b), P (single h))
    (ih : ∀ {a b c} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (h₁.trans h₂)) :
    P h

{P : {a b : α} → Relation.TransGen r a b → Prop}

(ih : ∀ {a b c : α} (h₁ : Relation.TransGen r a b) (h₂ : Relation.TransGen r b c), P h₁ → P h₂ → P ⋯)


theorem IsBigO.sup (h : f =O[l] g') (h' : f =O[l'] g') : f =O[l ⊔ l'] g'

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


/-- If `f` has a local min on `s` at `a` and both `y` and `-y` belong to the positive tangent cone
of `s` at `a`, then `f' y = 0`. -/
theorem IsLocalMinOn.fderivWithin_eq_zero (h : IsLocalMinOn f s a)
    (hy : y ∈ posTangentConeAt s a) (hy' : -y ∈ posTangentConeAt s a) :
    (fderivWithin ℝ f s a : E → ℝ) y = 0

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


/-- Permutations of `Option α` are equivalent to fixing an
`Option α` and permuting the remaining with a `Perm α`.
The fixed `Option α` is swapped with `none`. -/
@[simps]
def Equiv.Perm.decomposeOption {α : Type*} [DecidableEq α] :
    Perm (Option α) ≃ Option α × Perm α

{α : Type u_1}
[DecidableEq α]
(σ : Equiv.Perm (Option α))

Equiv.Perm.decomposeOption σ = (σ none, Equiv.removeNone σ)


theorem fuzzy_irrefl (x : PGame) : ¬x ‖ x


/-- **Gram-Schmidt Orthogonalisation**:
`gramSchmidt` produces an orthogonal system of vectors. -/
theorem gramSchmidt_orthogonal (f : ι → E) {a b : ι} (h₀ : a ≠ b) :
    ⟪gramSchmidt 𝕜 f a, gramSchmidt 𝕜 f b⟫ = 0

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(f : ι → E)
{a b : ι}
(h₀ : a ≠ b)

⟪gramSchmidt 𝕜 f a, gramSchmidt 𝕜 f b⟫_𝕜 = 0


theorem tendsto_prod_uniformity_fst [UniformSpace α] [UniformSpace β] :
    Tendsto (fun p : (α × β) × α × β => (p.1.1, p.2.1)) (𝓤 (α × β)) (𝓤 α)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]

Filter.Tendsto (fun p => (p.1.1, p.2.1)) (𝓤 (α × β)) (𝓤 α)


/-- `rev` commutes with `predAbove`. -/
lemma rev_predAbove {n : ℕ} (p : Fin n) (i : Fin (n + 1)) :
    (predAbove p i).rev = predAbove p.rev i.rev

(p.predAbove i).rev = p.rev.predAbove i.rev


@[simp] theorem charpoly_natDegree_eq_dim [Nontrivial R] (M : Matrix n n R) :
    M.charpoly.natDegree = Fintype.card n

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


lemma BijOn.perm_pow : BijOn f s s → ∀ n : ℕ, BijOn (f ^ n) s s

{α : Type u_1}
{f : Equiv.Perm α}
{s : Set α}

Set.BijOn (⇑f) s s → ∀ (n : ℕ), Set.BijOn (⇑(f ^ n)) s s


/-- The fundamental property of the adjoint. -/
theorem adjoint_isFormalAdjoint : T†.IsFormalAdjoint T

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
{T : E →ₗ.[𝕜] F}
(hT : Dense ↑T.domain)
[CompleteSpace E]


theorem HasUnitSpeedOn.Icc_Icc {x y z : ℝ} (hfs : HasUnitSpeedOn f (Icc x y))
    (hft : HasUnitSpeedOn f (Icc y z)) : HasUnitSpeedOn f (Icc x z)

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{x y z : ℝ}
(hfs : HasUnitSpeedOn f (Set.Icc x y))
(hft : HasUnitSpeedOn f (Set.Icc y z))


@[reassoc (attr := simp)]
lemma homologyι_comp_fromOpcycles :
    S.homologyι ≫ S.fromOpcycles = 0

CategoryTheory.CategoryStruct.comp S.homologyι S.fromOpcycles = 0


@[to_additive]
theorem IsLowerSet.smul_subset (hs : IsLowerSet s) (hx : x ≤ 1) : x • s ⊆ s

{α : Type u_1}
[OrderedAddCommMonoid α]
{s : Set α}
{x : α}
(hs : IsLowerSet s)
(hx : x ≤ 0)


@[simp]
theorem inv_mul_integral_comp_div_sub :
    (c⁻¹ * ∫ x in a..b, f (x / c - d)) = ∫ x in a / c - d..b / c - d, f x

c⁻¹ * ∫ (x : ℝ) in a..b, f (x / c - d) = ∫ (x : ℝ) in a / c - d..b / c - d, f x


/-- The complex sine function is everywhere strictly differentiable, with the derivative `cos x`. -/
theorem hasStrictDerivAt_sin (x : ℂ) : HasStrictDerivAt sin (cos x) x

HasStrictDerivAt Complex.sin (Complex.cos x) x


@[simp] theorem map_prodComm_antidiagonal [AddCommMonoid A] [HasAntidiagonal A] {n : A} :
    (antidiagonal n).map (Equiv.prodComm A A) = antidiagonal n

{A : Type u_1}
[AddCommMonoid A]
[Finset.HasAntidiagonal A]
{n : A}

Finset.map (Equiv.prodComm A A).toEmbedding (Finset.antidiagonal n) = Finset.antidiagonal n


theorem sq_of_gcd_eq_one {a b c : ℤ} (h : Int.gcd a b = 1) (heq : a * b = c ^ 2) :
    ∃ a0 : ℤ, a = a0 ^ 2 ∨ a = -a0 ^ 2

{a b c : ℤ}
(h : a.gcd b = 1)
(heq : a * b = c ^ 2)


theorem ite_eq_of_subset_right (t : Set α) {s₁ s₂ : Set α} (h : s₂ ⊆ s₁) :
    t.ite s₁ s₂ = (s₁ ∩ t) ∪ s₂

{α : Type u}
(t : Set α)
{s₁ s₂ : Set α}
(h : s₂ ⊆ s₁)


lemma norm_mkContinuous₂_aux (f : E →ₛₗ[σ₁₃] F →ₛₗ[σ₂₃] G) (C : ℝ)
    (h : ∀ x y, ‖f x y‖ ≤ C * ‖x‖ * ‖y‖) (x : E) :
    ‖(f x).mkContinuous (C * ‖x‖) (h x)‖ ≤ max C 0 * ‖x‖

{σ₂₃ : 𝕜₂ →+* 𝕜₃}

{σ₁₃ : 𝕜 →+* 𝕜₃}

(f : E →ₛₗ[σ₁₃] F →ₛₗ[σ₂₃] G)

(h : ∀ (x : E) (y : F), ‖(f x) y‖ ≤ C * ‖x‖ * ‖y‖)

‖(f x).mkContinuous (C * ‖x‖) ⋯‖ ≤ max C 0 * ‖x‖


∀ {α : Type u_1} {le : α → α → Bool} {n : Nat},
  Batteries.BinomialHeap.Imp.Heap.WF le n Batteries.BinomialHeap.Imp.Heap.nil


/-- The sieve generated by `presieveOfCovering U` is a member of the grothendieck topology.
-/
theorem mem_grothendieckTopology :
    Sieve.generate (presieveOfCovering U) ∈ Opens.grothendieckTopology X (iSup U)

{X : TopCat}
{ι : Type v}
(U : ι → TopologicalSpace.Opens ↑X)

CategoryTheory.Sieve.generate (TopCat.Presheaf.presieveOfCovering U) ∈ (Opens.grothendieckTopology ↑X).sieves (iSup U)


@[simp]
lemma smul_eq (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ f₂), r (a • f₁) (a • f₂))
    (a : R) {X Y : C} (f : X ⟶ Y) :
    letI := smul r hr
    a • (functor r).map f = (functor r).map (a • f)

(hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y), r f₁ f₂ → r (a • f₁) (a • f₂))

a • (CategoryTheory.Quotient.functor r).map f = (CategoryTheory.Quotient.functor r).map (a • f)


theorem recF_eq_of_wEquiv (α : TypeVec n) {β : Type u} (u : F (α.append1 β) → β) (x y : q.P.W α) :
    WEquiv x y → recF u x = recF u y

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
(α : TypeVec.{u} n)
{β : Type u}
(u : F (α ::: β) → β)
(x y : (MvQPF.P F).W α)

MvQPF.WEquiv x y → MvQPF.recF u x = MvQPF.recF u y


lemma ext {e e' : Pretrivialization F proj} (h₁ : ∀ x, e x = e' x)
    (h₂ : ∀ x, e.toPartialEquiv.symm x = e'.toPartialEquiv.symm x) (h₃ : e.baseSet = e'.baseSet) :
    e = e'

(h₂ : ∀ (x : B × F), ↑e.symm x = ↑e'.symm x)


theorem finite_of_finite_preimage (h : (f ⁻¹' s).Finite) (hs : s ⊆ range f) : s.Finite

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set β}
(h : (f ⁻¹' s).Finite)
(hs : s ⊆ Set.range f)


theorem map_ofDual_min (s : Finset αᵒᵈ) : s.min.map ofDual = (s.image ofDual).max

{α : Type u_2}
[LinearOrder α]
(s : Finset αᵒᵈ)

WithTop.map (⇑OrderDual.ofDual) s.min = (Finset.image (⇑OrderDual.ofDual) s).max


lemma lt_pow_self (ha : 1 < a) : ∀ n : ℕ, n < a ^ n


@[to_additive (attr := simp)]
theorem eqLocusM_same (f : M →* N) : f.eqLocusM f = ⊤

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)


@[simp]
theorem subset_εClosure (S : Set σ) : S ⊆ M.εClosure S

{α : Type u}
{σ : Type v}
(M : εNFA α σ)
(S : Set σ)


lemma comp_apply {M N P : Type*}
    {φ : M → N} {ψ : N → P} {χ : M → P} (h : CompTriple φ ψ χ) (x : M) :
    ψ (φ x) = χ x

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
{φ : M → N}
{ψ : N → P}
{χ : M → P}
(h : CompTriple φ ψ χ)
(x : M)


@[to_additive]
theorem mem_normalizer_iff'' {g : G} : g ∈ H.normalizer ↔ ∀ h : G, h ∈ H ↔ g⁻¹ * h * g ∈ H

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

g ∈ H.normalizer ↔ ∀ (h : G), h ∈ H ↔ -g + h + g ∈ H


/-- The linear map associated to the conjugate transpose of a matrix corresponding to two
orthonormal bases is the adjoint of the linear map associated to the matrix. -/
lemma Matrix.toLin_conjTranspose (A : Matrix m n 𝕜) :
    toLin v₂.toBasis v₁.toBasis Aᴴ = adjoint (toLin v₁.toBasis v₂.toBasis A)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
{m : Type u_5}
{n : Type u_6}
[Fintype m]
[DecidableEq m]
[Fintype n]
[DecidableEq n]
[FiniteDimensional 𝕜 E]
[FiniteDimensional 𝕜 F]
(v₁ : OrthonormalBasis n 𝕜 E)
(v₂ : OrthonormalBasis m 𝕜 F)
(A : Matrix m n 𝕜)

(Matrix.toLin v₂.toBasis v₁.toBasis) A.conjTranspose = LinearMap.adjoint ((Matrix.toLin v₁.toBasis v₂.toBasis) A)


theorem fst_apply (κ : Kernel α (β × γ)) (a : α) : fst κ a = (κ a).map Prod.fst

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

κ.fst a = MeasureTheory.Measure.map Prod.fst (κ a)


theorem cos_eq (z : ℂ) : cos z = cos z.re * cosh z.im - sin z.re * sinh z.im * I

Complex.cos z = Complex.cos ↑z.re * Complex.cosh ↑z.im - Complex.sin ↑z.re * Complex.sinh ↑z.im * Complex.I


@[simp, norm_cast]
theorem lcm_coe (n m : ℕ+) : (lcm n m : ℕ) = Nat.lcm n m


/-- The inverse of an equivalence of first-order languages. -/
@[simps]
protected def symm : L' ≃ᴸ L

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(e : L ≃ᴸ L')


theorem Surjective.hasRightInverse (hf : Surjective f) : HasRightInverse f

{α : Sort u}
{β : Sort v}
{f : α → β}
(hf : Function.Surjective f)


theorem blimsup_and_le_inf : (blimsup u f fun x => p x ∧ q x) ≤ blimsup u f p ⊓ blimsup u f q

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}

(Filter.blimsup u f fun x => p x ∧ q x) ≤ Filter.blimsup u f p ⊓ Filter.blimsup u f q


@[simp]
theorem lowerBounds_union : lowerBounds (s ∪ t) = lowerBounds s ∩ lowerBounds t


/-- Auxiliary lemma to show that the infimum of seminorms is well-defined. -/
theorem bddBelow_range_add : BddBelow (range fun u => p u + q (x - u))

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p q : Seminorm 𝕜 E}
{x : E}

BddBelow (Set.range fun u => p u + q (x - u))


@[simp]
theorem Prefunctor.star_apply {u v : U} (e : u ⟶ v) :
    φ.star u (Quiver.Star.mk e) = Quiver.Star.mk (φ.map e)

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
(φ : U ⥤q V)
{u v : U}
(e : u ⟶ v)


lemma exact_iff_mono_cokernel_desc [S.HasHomology] [HasCokernel S.f] :
    S.Exact ↔ Mono (cokernel.desc S.f S.g S.zero)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(S : CategoryTheory.ShortComplex C)
[S.HasHomology]
[CategoryTheory.Limits.HasCokernel S.f]

S.Exact ↔ CategoryTheory.Mono (CategoryTheory.Limits.cokernel.desc S.f S.g ⋯)


theorem inv_two_add_inv_two : (2 : ℝ≥0∞)⁻¹ + 2⁻¹ = 1


@[simp]
theorem liftHom_aequiv {U : Type*} [CommRing U] [Algebra R U] (h : IsAdjoinRoot S f)
    (h' : IsAdjoinRoot T f) (x : U) (hx z) : h'.liftHom x hx (h.aequiv h' z) = h.liftHom x hx z

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{f : R[X]}
{T : Type u_1}
[CommRing T]
[Algebra R T]
{U : Type u_2}
[CommRing U]
[Algebra R U]
(h : IsAdjoinRoot S f)
(h' : IsAdjoinRoot T f)
(x : U)
(hx : (Polynomial.aeval x) f = 0)
(z : S)

(IsAdjoinRoot.liftHom x hx h') ((h.aequiv h') z) = (IsAdjoinRoot.liftHom x hx h) z


@[to_additive]
theorem Function.Surjective.multipliable_iff_of_hasProd_iff {α' : Type*} [CommMonoid α']
    [TopologicalSpace α'] {e : α' → α} (hes : Function.Surjective e) {f : β → α} {g : γ → α'}
    (he : ∀ {a}, HasProd f (e a) ↔ HasProd g a) : Multipliable f ↔ Multipliable g

(he : ∀ {a : α'}, HasProd f (e a) ↔ HasProd g a)


@[simp]
theorem Iic_diff_Iio_same : Iic a \ Iio a = {a}


theorem real_inner_smul_right (x y : F) (r : ℝ) : ⟪x, r • y⟫_ℝ = r * ⟪x, y⟫_ℝ

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x y : F)
(r : ℝ)


theorem mod_lt (a) {b : Ordinal} (h : b ≠ 0) : a % b < b

(a : Ordinal.{u_4})
{b : Ordinal.{u_4}}
(h : b ≠ 0)


/--
Removing the leading `o` from a term of `MaxProducts C` yields a list which `isGood` with respect to
`C'`.
-/
theorem maxTail_isGood (l : MaxProducts C ho)
    (h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C (ord I · < o))))) :
    l.val.Tail.isGood (C' C ho)

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(l : ↑(Profinite.NobelingProof.GoodProducts.MaxProducts C ho))

(h₁ :
  ⊤ ≤
    Submodule.span ℤ
      (Set.range
        (Profinite.NobelingProof.GoodProducts.eval
          (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o))))

Profinite.NobelingProof.Products.isGood (Profinite.NobelingProof.C' C ho) (↑l).Tail


/-- A binomial coefficient is the product of its prime factors, which are at most `n`. -/
theorem prod_pow_factorization_choose (n k : ℕ) (hkn : k ≤ n) :
    (∏ p ∈ Finset.range (n + 1), p ^ (Nat.choose n k).factorization p) = choose n k

∏ p ∈ Finset.range (n + 1), p ^ (n.choose k).factorization p = n.choose k


theorem isBigO_atTop_iff_eventually_exists_pos {α : Type*}
    [SemilatticeSup α] [Nonempty α] {f : α → G} {g : α → G'} :
    f =O[atTop] g ↔ ∀ᶠ n₀ in atTop, ∃ c > 0, ∀ n ≥ n₀, c * ‖f n‖ ≤ ‖g n‖

{G : Type u_5}
{G' : Type u_8}
[Norm G]
[SeminormedAddCommGroup G']
{α : Type u_17}
[SemilatticeSup α]
[Nonempty α]
{f : α → G}
{g : α → G'}

f =O[Filter.atTop] g ↔ ∀ᶠ (n₀ : α) in Filter.atTop, ∃ c > 0, ∀ n ≥ n₀, c * ‖f n‖ ≤ ‖g n‖


theorem Periodic.sub_period [AddGroup α] (h1 : Periodic f c₁) (h2 : Periodic f c₂) :
    Periodic f (c₁ - c₂)

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


/-- Change a `Cone F.op` into a `Cocone F`. -/
@[simps]
def Cone.unop (c : Cone F.op) : Cocone F

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

c.unop.ι = CategoryTheory.NatTrans.removeOp c.π


@[nontriviality]
theorem update_eq_const_of_subsingleton [Subsingleton α] (a : α) (v : α') (f : α → α') :
    update f a v = const α v

{α : Sort u}
{α' : Sort w}
[DecidableEq α]
[Subsingleton α]
(a : α)
(v : α')
(f : α → α')

Function.update f a v = Function.const α v


@[simp]
theorem quotQuotMkₐ_toRingHom :
    (quotQuotMkₐ R I J : _ →+* _ ⧸ J.map (Quotient.mkₐ R I)) = quotQuotMk I J

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

↑(DoubleQuot.quotQuotMkₐ R I J) = DoubleQuot.quotQuotMk I J


@[simp] theorem pop_empty : (#[] : Array α).pop = #[]


theorem coe_mul_of_apply_of_not_le (r : ⨁ i, A i) {i : ι} (r' : A i) (n : ι) (h : ¬i ≤ n) :
    ((r * of (fun i => A i) i r') n : R) = 0

{ι : Type u_1}
{σ : Type u_2}
{R : Type u_4}
[DecidableEq ι]
[Semiring R]
[SetLike σ R]
[AddSubmonoidClass σ R]
(A : ι → σ)
[CanonicallyOrderedAddCommMonoid ι]
[SetLike.GradedMonoid A]
(r : ⨁ (i : ι), ↥(A i))
{i : ι}
(r' : ↥(A i))
(n : ι)
(h : ¬i ≤ n)

↑((r * (DirectSum.of (fun i => ↥(A i)) i) r') n) = 0


@[simp]
theorem down_subset_down {s t : SetSemiring α} : SetSemiring.down s ⊆ SetSemiring.down t ↔ s ≤ t


@[simp]
theorem mul_apply [Semiring R] {f g : ArithmeticFunction R} {n : ℕ} :
    (f * g) n = ∑ x ∈ divisorsAntidiagonal n, f x.fst * g x.snd

{R : Type u_1}
[Semiring R]
{f g : ArithmeticFunction R}
{n : ℕ}

(f * g) n = ∑ x ∈ n.divisorsAntidiagonal, f x.1 * g x.2


theorem head_main_ok {q s L} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (head main q), s, K'.elim (trList L) [] c d⟩
      ⟨some q, none, K'.elim (trList [L.headI]) [] c d⟩

{q : Turing.PartrecToTM2.Λ'}
{s : Option Turing.PartrecToTM2.Γ'}
{L : List ℕ}
{c d : List Turing.PartrecToTM2.Γ'}

Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr)
  { l := some (Turing.PartrecToTM2.head Turing.PartrecToTM2.K'.main q), var := s,
    stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList L) [] c d }
  { l := some q, var := none, stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList [L.headI]) [] c d }


theorem map_sum_le {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hf : ∀ i ∈ s, v (f i) ≤ g) :
    v (∑ i ∈ s, f i) ≤ g

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
{ι : Type u_7}
{s : Finset ι}
{f : ι → R}
{g : Γ₀}
(hf : ∀ i ∈ s, v (f i) ≤ g)


@[simp]
theorem card_Ici : (Ici a).card = n - a


/-- A C*-ring is a normed star ring that satisfies the stronger condition `‖x‖ ^ 2 ≤ ‖x⋆ * x‖`
for every `x`. Note that this condition actually implies equality, as is shown in
`norm_star_mul_self` below. -/
class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where
  norm_mul_self_le : ∀ x : E, ‖x‖ * ‖x‖ ≤ ‖x⋆ * x‖

{E : Type u_4}
[NonUnitalNormedRing E]
[StarRing E]
[self : CstarRing E]
(x : E)

‖x‖ * ‖x‖ ≤ ‖x⋆ * x‖


lemma concaveOn_rpow {p : ℝ} (hp₀ : 0 ≤ p) (hp₁ : p ≤ 1) :
    ConcaveOn ℝ (Set.Ici 0) fun x : ℝ ↦ x ^ p


@[simp] theorem run_lift {α σ : Type u} [Monad m] (x : m α) (s : σ) : (StateT.lift x : StateT σ m α).run s = x >>= fun a => pure (a, s)

{m : Type u → Type u_1}
{α σ : Type u}
[Monad m]
(x : m α)
(s : σ)

(StateT.lift x).run s = do
  let a ← x
  pure (a, s)


@[to_additive]
protected theorem div [Group β] [TopologicalGroup β] (hu : ProgMeasurable f u)
    (hv : ProgMeasurable f v) : ProgMeasurable f fun i ω => u i ω / v i ω

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u v : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[MeasurableSpace ι]
[Group β]
[TopologicalGroup β]
(hu : MeasureTheory.ProgMeasurable f u)
(hv : MeasureTheory.ProgMeasurable f v)

MeasureTheory.ProgMeasurable f fun i ω => u i ω / v i ω


theorem mem_compl {s : Set α} {x : α} (h : x ∉ s) : x ∈ sᶜ

{α : Type u}
{s : Set α}
{x : α}
(h : x ∉ s)


theorem lintegral_union {f : α → ℝ≥0∞} {A B : Set α} (hB : MeasurableSet B) (hAB : Disjoint A B) :
    ∫⁻ a in A ∪ B, f a ∂μ = ∫⁻ a in A, f a ∂μ + ∫⁻ a in B, f a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
{A B : Set α}
(hB : MeasurableSet B)
(hAB : Disjoint A B)

∫⁻ (a : α) in A ∪ B, f a ∂μ = ∫⁻ (a : α) in A, f a ∂μ + ∫⁻ (a : α) in B, f a ∂μ


theorem Icc_eq : Icc a b = piFinset fun i => Icc (a i) (b i)

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

Finset.Icc a b = Fintype.piFinset fun i => Finset.Icc (a i) (b i)


/-- If `s : Set α` is a nonempty countable set, then there exists a map
`f : ℕ → α` such that `s = range f`. -/
theorem Countable.exists_eq_range {s : Set α} (hc : s.Countable) (hs : s.Nonempty) :
    ∃ f : ℕ → α, s = range f

{α : Type u}
{s : Set α}
(hc : s.Countable)
(hs : s.Nonempty)


theorem copy_eq (f : A →A[R] B) (f' : A → B) (h : f' = ⇑f) : f.copy f' h = f

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
(f : A →A[R] B)
(f' : A → B)
(h : f' = ⇑f)


@[simp]
theorem Nonempty.forall {α} {p : Nonempty α → Prop} : (∀ h : Nonempty α, p h) ↔ ∀ a, p ⟨a⟩

(∀ (h : Nonempty α), p h) ↔ ∀ (a : α), p ⋯


@[simp]
theorem binaryProductLimitCone_cone_π_app_left (M N : ModuleCat.{v} R) :
    (binaryProductLimitCone M N).cone.π.app ⟨WalkingPair.left⟩ = LinearMap.fst R M N

{R : Type u}
[Ring R]
(M N : ModuleCat R)

(M.binaryProductLimitCone N).cone.π.app { as := CategoryTheory.Limits.WalkingPair.left } = LinearMap.fst R ↑M ↑N


theorem dist_succ_succ {i j : Nat} : dist (succ i) (succ j) = dist i j


@[simp] theorem ncard_eq_one : s.ncard = 1 ↔ ∃ a, s = {a}


@[to_additive]
theorem smul_filter_le_smul_filter (hf : f₁ ≤ f₂) : a • f₁ ≤ a • f₂

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{f₁ f₂ : Filter β}
{a : α}
(hf : f₁ ≤ f₂)


@[simp]
theorem toOrderMonoidHom_eq_coe (f : α →*₀o β) : f.toOrderMonoidHom = f

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


theorem Products.lt_nil_empty : { m : Products I | m < Products.nil } = ∅

{m | m < Profinite.NobelingProof.Products.nil} = ∅


theorem liftR_map_last' [LawfulMvFunctor F] {α : TypeVec n} {ι} (R : ι → ι → Prop) (x : F (α ::: ι))
    (f : ι → ι) (hh : ∀ x : ι, R (f x) x) : LiftR' (RelLast' _ R) ((id ::: f) <$$> x) x

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
[LawfulMvFunctor F]
{α : TypeVec.{u} n}
{ι : Type u}
(R : ι → ι → Prop)
(x : F (α ::: ι))
(f : ι → ι)
(hh : ∀ (x : ι), R (f x) x)

MvFunctor.LiftR' (α.RelLast' R) ((TypeVec.id ::: f) <$$> x) x


/-- An auxiliary version of the layer cake formula (Cavalieri's principle, tail probability
formula), with a measurability assumption that would also essentially follow from the
integrability assumptions, and a sigma-finiteness assumption.

See `MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul` and
`MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul` for the main formulations of the layer
cake formula. -/
theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite
    (μ : Measure α) [SFinite μ]
    (f_nn : 0 ≤ f) (f_mble : Measurable f)
    (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t) (g_mble : Measurable g)
    (g_nn : ∀ t > 0, 0 ≤ g t) :
    ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ =
      ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t)

(g_intble : ∀ t > 0, IntervalIntegrable g MeasureTheory.volume 0 t)

∫⁻ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) ∂μ =
  ∫⁻ (t : ℝ) in Set.Ioi 0, μ {a | t ≤ f a} * ENNReal.ofReal (g t)


@[simp]
theorem liftPred_const_iff [NeBot l] {p : β → Prop} {x : β} : LiftPred p (↑x : Germ l β) ↔ p x

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[l.NeBot]
{p : β → Prop}
{x : β}


/-- A field extension E/F is Galois if it is both separable and normal. Note that in mathlib
a separable extension of fields is by definition algebraic. -/
class IsGalois : Prop where
  [to_isSeparable : Algebra.IsSeparable F E]
  [to_normal : Normal F E]

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
[self : IsGalois F E]


theorem braiding_rightUnitor_aux₂ (X : C) :
    (𝟙_ C ◁ (β_ (𝟙_ C) X).hom) ≫ (𝟙_ C ◁ (ρ_ X).hom) = 𝟙_ C ◁ (λ_ X).hom

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

𝟙_ C ◁ (β_ (𝟙_ C) X).hom ≫ 𝟙_ C ◁ (ρ_ X).hom = 𝟙_ C ◁ (λ_ X).hom


protected theorem IsLimit.isSuccLimit {c} (h : IsLimit c) : IsSuccLimit c


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

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasStrictDerivAt f f' x)


/-- Adding the angles between two vectors in each order, with the first vector in each angle
negated, results in 0. -/
@[simp]
theorem oangle_add_oangle_rev_neg_left (x y : V) : o.oangle (-x) y + o.oangle (-y) x = 0

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


lemma exact_iff_surjective_moduleCatToCycles :
    S.Exact ↔ Function.Surjective S.moduleCatToCycles

(S : CategoryTheory.ShortComplex (ModuleCat R))

S.Exact ↔ Function.Surjective ⇑S.moduleCatToCycles


theorem truncate_add (x y : BitVec w) (h : i ≤ w) :
    (x + y).truncate i = x.truncate i + y.truncate i

{w i : Nat}
(x y : BitVec w)
(h : i ≤ w)

BitVec.truncate i (x + y) = BitVec.truncate i x + BitVec.truncate i y


@[ext]
theorem ext {f g : SupHom α β} (h : ∀ a, f a = g a) : f = g

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Sup β]
{f g : SupHom α β}
(h : ∀ (a : α), f a = g a)


/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T

{D : CategoryTheory.Functor J T.Algebra}

(c : CategoryTheory.Limits.Cocone (D.comp T.forget))

[CategoryTheory.Limits.PreservesColimit (D.comp T.forget) T.toFunctor]

[CategoryTheory.Limits.PreservesColimit ((D.comp T.forget).comp T.toFunctor) T.toFunctor]

(CategoryTheory.Monad.ForgetCreatesColimits.coconePoint c t).a = CategoryTheory.Monad.ForgetCreatesColimits.lambda c t


/-- The opposite `ShortComplex` in `Cᵒᵖ` associated to a short complex in `C`. -/
@[simps]
def op : ShortComplex Cᵒᵖ


@[simp]
protected theorem inf_eq_inter (s t : {s : Set α // MeasurableSet s}) : s ⊓ t = s ∩ t

{α : Type u_1}
[MeasurableSpace α]
(s t : { s // MeasurableSet s })


@[simp]
theorem mem_edgeSet {G' : Subgraph G} {v w : V} : s(v, w) ∈ G'.edgeSet ↔ G'.Adj v w

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
{v w : V}


theorem Sum.dist_eq {x y : X ⊕ Y} : dist x y = Sum.dist x y

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
{x y : X ⊕ Y}


theorem eq_bot_of_comap_eq_bot [Nontrivial R] [IsDomain S] [Algebra.IsIntegral R S]
    (hI : I.comap (algebraMap R S) = ⊥) : I = ⊥

(hI : Ideal.comap (algebraMap R S) I = ⊥)


theorem recDiagOn_succ_succ {motive : Nat → Nat → Sort _} (zero_zero : motive 0 0)
    (zero_succ : ∀ n, motive 0 n → motive 0 (n+1)) (succ_zero : ∀ m, motive m 0 → motive (m+1) 0)
    (succ_succ : ∀ m n, motive m n → motive (m+1) (n+1)) (m n) :
    Nat.recDiagOn (m+1) (n+1) zero_zero zero_succ succ_zero succ_succ
      = succ_succ m n (Nat.recDiagOn m n zero_zero zero_succ succ_zero succ_succ)

(zero_succ : (n : Nat) → motive 0 n → motive 0 (n + 1))

(succ_zero : (m : Nat) → motive m 0 → motive (m + 1) 0)

(succ_succ : (m n : Nat) → motive m n → motive (m + 1) (n + 1))

Nat.recDiagOn (m + 1) (n + 1) zero_zero zero_succ succ_zero succ_succ =
  succ_succ m n (Nat.recDiagOn m n zero_zero zero_succ succ_zero succ_succ)


theorem one_lt_ack_succ_right : ∀ m n, 1 < ack m (n + 1)


theorem le_liminf_iff {α β} [ConditionallyCompleteLinearOrder β] {f : Filter α} {u : α → β} {x : β}
    (h₁ : f.IsCoboundedUnder (· ≥ ·) u := by isBoundedDefault)
    (h₂ : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault) :
    x ≤ liminf u f ↔ ∀ y < x, ∀ᶠ a in f, y < u a

(h₁ : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

(h₂ : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

x ≤ Filter.liminf u f ↔ ∀ y < x, ∀ᶠ (a : α) in f, y < u a


/-- If `fbc : β → γ` semiconjugates `gb` to `gc` and `fab : α → β` semiconjugates `ga` to `gb`,
then `fbc ∘ fab` semiconjugates `ga` to `gc`.

See also `Function.Semiconj.trans` for a version with reversed arguments.

**Backward compatibility note:** before 2024-01-13,
this lemma used to have the same order of arguments that `Function.Semiconj.trans` has now. -/
theorem comp_left (hbc : Semiconj fbc gb gc) (hab : Semiconj fab ga gb) :
    Semiconj (fbc ∘ fab) ga gc

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{fab : α → β}
{fbc : β → γ}
{ga : α → α}
{gb : β → β}
{gc : γ → γ}
(hbc : Function.Semiconj fbc gb gc)
(hab : Function.Semiconj fab ga gb)


/-- `nextOr` does not depend on the default value, if the next value appears. -/
theorem nextOr_eq_nextOr_of_mem_of_ne (xs : List α) (x d d' : α) (x_mem : x ∈ xs)
    (x_ne : x ≠ xs.getLast (ne_nil_of_mem x_mem)) : nextOr xs x d = nextOr xs x d'

{α : Type u_1}
[DecidableEq α]
(xs : List α)
(x d d' : α)
(x_mem : x ∈ xs)
(x_ne : x ≠ xs.getLast ⋯)


lemma dvd_div_of_mul_dvd (h : a * b ∣ c) : b ∣ c / a


/-- The projection from a fiber bundle to its base is continuous. -/
@[continuity]
theorem continuous_proj : Continuous (π F E)

[TopologicalSpace (Bundle.TotalSpace F E)]


protected theorem DifferentiableWithinAt.inversion (hc : DifferentiableWithinAt ℝ c s a)
    (hR : DifferentiableWithinAt ℝ R s a) (hx : DifferentiableWithinAt ℝ x s a) (hne : x a ≠ c a) :
    DifferentiableWithinAt ℝ (fun a ↦ inversion (c a) (R a) (x a)) s a

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{c x : E → F}
{R : E → ℝ}
{s : Set E}
{a : E}
(hc : DifferentiableWithinAt ℝ c s a)
(hR : DifferentiableWithinAt ℝ R s a)
(hx : DifferentiableWithinAt ℝ x s a)
(hne : x a ≠ c a)

DifferentiableWithinAt ℝ (fun a => EuclideanGeometry.inversion (c a) (R a) (x a)) s a


theorem exists_most_significant_bit {n : ℕ} (h : n ≠ 0) :
    ∃ i, testBit n i = true ∧ ∀ j, i < j → testBit n j = false

∃ i, n.testBit i = true ∧ ∀ (j : ℕ), i < j → n.testBit j = false


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₁₂')


theorem Commute.mul_geom_sum₂ [Ring α] {x y : α} (h : Commute x y) (n : ℕ) :
    ((x - y) * ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) = x ^ n - y ^ n

{α : Type u}
[Ring α]
{x y : α}
(h : Commute x y)
(n : ℕ)

(x - y) * ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) = x ^ n - y ^ n


theorem toIcoMod_eq_self : toIcoMod hp a b = b ↔ b ∈ Set.Ico a (a + p)

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


/-- A rational number has only finitely many good rational approximations. -/
theorem finite_rat_abs_sub_lt_one_div_den_sq (ξ : ℚ) :
    {q : ℚ | |ξ - q| < 1 / (q.den : ℚ) ^ 2}.Finite


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

Algebra.Generators.Cotangent.of x.val = x


@[simp]
lemma image_val_inter : (↑(D ∩ E) : Set α) = ↑D ∩ ↑E

{α : Type u_2}
{A : Set α}
{D E : Set ↑A}

Subtype.val '' (D ∩ E) = Subtype.val '' D ∩ Subtype.val '' E


theorem get?_set_eq (a : Array α) (i : Fin a.size) (v : α) :
    (a.set i v)[i.1]? = v

{α : Type u_1}
(a : Array α)
(i : Fin a.size)
(v : α)


@[simp]
theorem dimH_coe_finset (s : Finset X) : dimH (s : Set X) = 0

{X : Type u_2}
[EMetricSpace X]
(s : Finset X)


lemma Algebra.transcendental_def : Algebra.Transcendental R A ↔ ∃ x : A, Transcendental R x

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]

Algebra.Transcendental R A ↔ ∃ x, Transcendental R x


@[simp] lemma ofLawson_toLawson (a : α) : ofLawson (toLawson a) = a

Topology.WithLawson.ofLawson (Topology.WithLawson.toLawson a) = a


@[to_additive] lemma IsSquare.pow (n : ℕ) : IsSquare a → IsSquare (a ^ n)

{α : Type u_2}
[AddMonoid α]
{a : α}
(n : ℕ)


/-- Deprecated, please use `not_mem_tsupport_iff_eventuallyEq` instead. -/
@[deprecated (since := "2024-01-15")]
theorem eventuallyEq_zero_nhds {M₀} [Zero M₀] {f : X → M₀} :
    f =ᶠ[𝓝 x] 0 ↔ x ∉ closure (Function.support f)

{X : Type u_1}
[TopologicalSpace X]
{x : X}
{M₀ : Type u_4}
[Zero M₀]
{f : X → M₀}


@[reassoc]
theorem rightAdjointMate_comp_evaluation {X Y : C} [HasRightDual X] [HasRightDual Y] (f : X ⟶ Y) :
    (fᘁ ▷ X) ≫ ε_ X (Xᘁ) = ((Yᘁ) ◁ f) ≫ ε_ Y (Yᘁ)

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


/-- A `DivisionSemiring` is a `Semiring` with multiplicative inverses for nonzero elements.

An instance of `DivisionSemiring K` includes maps `nnratCast : ℚ≥0 → K` and `nnqsmul : ℚ≥0 → K → K`.
Those two fields are needed to implement the `DivisionSemiring K → Algebra ℚ≥0 K` instance since we
need to control the specific definitions for some special cases of `K` (in particular `K = ℚ≥0`
itself). See also note [forgetful inheritance].

If the division semiring has positive characteristic `p`, our division by zero convention forces
`nnratCast (1 / p) = 1 / 0 = 0`. -/
class DivisionSemiring (α : Type*) extends Semiring α, GroupWithZero α, NNRatCast α where
  protected nnratCast := NNRat.castRec
  /-- However `NNRat.cast` is defined, it must be propositionally equal to `a / b`.

  Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
  protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a nonnegative rational number.

  Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
  `nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected nnqsmul : ℚ≥0 → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
  protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl

{α : Type u_4}
[self : DivisionSemiring α]
(q : ℚ≥0)


/-- The `SlashInvariantForm` corresponding to `Function.const _ x`. -/
@[simps (config := .asFn)]
def const (x : ℂ) : SlashInvariantForm Γ 0

⇑(SlashInvariantForm.const x) = Function.const ℍ x


theorem starConvex_univ (x : E) : StarConvex 𝕜 x univ

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
(x : E)


theorem mem_insert (x : α) (s : Set α) : x ∈ insert x s


@[simp, norm_cast] lemma nonZeroDivisors.associated_coe : Associated (a : M₀) b ↔ Associated a b

{M₀ : Type u_1}
[MonoidWithZero M₀]
{a b : ↥M₀⁰}


theorem midpoint_mem_perpBisector (p₁ p₂ : P) :
    midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p₁ p₂ : P)

midpoint ℝ p₁ p₂ ∈ AffineSubspace.perpBisector p₁ p₂


@[simp]
theorem mk_coe {f : A →ₗc[R] B} (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩ : A →ₗc[R] B) = f

(h₁ : ∀ (x y : A), f (x + y) = f x + f y)

(h₂ :
  ∀ (m : R) (x : A),
    { toFun := ⇑f, map_add' := h₁ }.toFun (m • x) = (RingHom.id R) m • { toFun := ⇑f, map_add' := h₁ }.toFun x)

(h₃ : Coalgebra.counit ∘ₗ { toFun := ⇑f, map_add' := h₁, map_smul' := h₂ } = Coalgebra.counit)

(h₄ :
  TensorProduct.map { toFun := ⇑f, map_add' := h₁, map_smul' := h₂ } { toFun := ⇑f, map_add' := h₁, map_smul' := h₂ } ∘ₗ
      Coalgebra.comul =
    Coalgebra.comul ∘ₗ { toFun := ⇑f, map_add' := h₁, map_smul' := h₂ })

{ toFun := ⇑f, map_add' := h₁, map_smul' := h₂, counit_comp := h₃, map_comp_comul := h₄ } = f


theorem edgeSet_deleteEdges (s : Set (Sym2 V)) : (G.deleteEdges s).edgeSet = G.edgeSet \ s

{V : Type u}
{G : SimpleGraph V}
(s : Set (Sym2 V))


/-- If `f` and `g` are identically distributed and `f` is a.e. strongly measurable, so is `g`. -/
theorem aestronglyMeasurable_snd [TopologicalSpace γ] [MetrizableSpace γ] [BorelSpace γ]
    (h : IdentDistrib f g μ ν) (hf : AEStronglyMeasurable f μ) : AEStronglyMeasurable g ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

(hf : MeasureTheory.AEStronglyMeasurable f μ)


theorem closure_iUnion (h : LocallyFinite f) : closure (⋃ i, f i) = ⋃ i, closure (f i)

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f : ι → Set X}
(h : LocallyFinite f)


/-- If c is a cycle, a ∈ c.support and c is a cycle of f, then `c = f.cycleOf a` -/
theorem cycle_is_cycleOf {f c : Equiv.Perm α} {a : α} (ha : a ∈ c.support)
    (hc : c ∈ f.cycleFactorsFinset) : c = f.cycleOf a

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{f c : Equiv.Perm α}
{a : α}
(ha : a ∈ c.support)
(hc : c ∈ f.cycleFactorsFinset)


theorem normalizedFactors_prod_of_prime [Nontrivial α] [Unique αˣ] {m : Multiset α}
    (h : ∀ p ∈ m, Prime p) : normalizedFactors m.prod = m

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
[Nontrivial α]
[Unique αˣ]
{m : Multiset α}
(h : ∀ p ∈ m, Prime p)

UniqueFactorizationMonoid.normalizedFactors m.prod = m


@[simp]
theorem antidiagonalTuple_zero_zero : antidiagonalTuple 0 0 = {![]}

Multiset.Nat.antidiagonalTuple 0 0 = {![]}


@[symm]
protected theorem Antivary.symm (h : Antivary f g) : Antivary g f

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[LinearOrder β]
{f : ι → α}
{g : ι → β}
(h : Antivary f g)


theorem localization_artinian : IsArtinianRing L

{R : Type u_1}
[CommRing R]
[IsArtinianRing R]
(S : Submonoid R)
(L : Type u_2)
[CommRing L]
[Algebra R L]
[IsLocalization S L]


/-- The circumcenter of a 1-simplex equals its centroid. -/
theorem circumcenter_eq_centroid (s : Simplex ℝ P 1) :
    s.circumcenter = Finset.univ.centroid ℝ s.points

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : Affine.Simplex ℝ P 1)

s.circumcenter = Finset.centroid ℝ Finset.univ s.points


protected theorem integrable [LE E] (hf : Submartingale f ℱ μ) (i : ι) : Integrable (f i) μ

(hf : MeasureTheory.Submartingale f ℱ μ)


/-- A version of `GradedMonoid.ghas_one` for internally graded objects. -/
class SetLike.GradedMul {S : Type*} [SetLike S R] [Mul R] [Add ι] (A : ι → S) : Prop where
  /-- Multiplication is homogeneous -/
  mul_mem : ∀ ⦃i j⦄ {gi gj}, gi ∈ A i → gj ∈ A j → gi * gj ∈ A (i + j)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[Mul R]
[Add ι]
{A : ι → S}
[self : SetLike.GradedMul A]
⦃i j : ι⦄
{gi gj : R}


@[reassoc (attr := simp)]
theorem biproduct.lift_map {f g : J → C} [HasBiproduct f] [HasBiproduct g] {P : C}
    (k : ∀ j, P ⟶ f j) (p : ∀ j, f j ⟶ g j) :
    biproduct.lift k ≫ biproduct.map p = biproduct.lift fun j => k j ≫ p j

CategoryTheory.Limits.biproduct.lift k ≫ CategoryTheory.Limits.biproduct.map p =
  CategoryTheory.Limits.biproduct.lift fun j => k j ≫ p j


/-- A Galois connection. -/
theorem _root_.Multiset.prod_X_sub_C_dvd_iff_le_roots {p : R[X]} (hp : p ≠ 0) (s : Multiset R) :
    (s.map fun a => X - C a).prod ∣ p ↔ s ≤ p.roots

{R : Type u}
[CommRing R]
[IsDomain R]
{p : Polynomial R}
(hp : p ≠ 0)
(s : Multiset R)

(Multiset.map (fun a => Polynomial.X - Polynomial.C a) s).prod ∣ p ↔ s ≤ p.roots


theorem map_radical_le : map f (radical I) ≤ radical (map f I)

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

Ideal.map f I.radical ≤ (Ideal.map f I).radical


theorem minimum?_replicate [Min α] {n : Nat} {a : α} (w : min a a = a) :
    (replicate n a).minimum? = if n = 0 then none else some a

{α : Type u_1}
[Min α]
{n : Nat}
{a : α}
(w : min a a = a)

(List.replicate n a).minimum? = if n = 0 then none else some a


protected theorem uniformContinuous' [UniformSpace E] [UniformAddGroup E] [ContinuousConstSMul 𝕜 E]
    {p : Seminorm 𝕜 E} {r : ℝ} (hp : p.closedBall 0 r ∈ (𝓝 0 : Filter E)) :
    UniformContinuous p

{𝕜 : Type u_3}
{E : Type u_7}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[UniformSpace E]
[UniformAddGroup E]
[ContinuousConstSMul 𝕜 E]
{p : Seminorm 𝕜 E}
{r : ℝ}
(hp : p.closedBall 0 r ∈ 𝓝 0)


@[simp]
theorem volume_Ioi {a : ℝ} : volume (Ioi a) = ∞


/-- The functor which sends `S : SnakeInput C` to the auxiliary object `S.P`,
which is `pullback S.L₁.g S.v₀₁.τ₃`. -/
@[simps]
noncomputable def functorP : SnakeInput C ⥤ C

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]

∀ {X Y : CategoryTheory.ShortComplex.SnakeInput C} (f : X ⟶ Y),
  CategoryTheory.ShortComplex.SnakeInput.functorP.map f =
    CategoryTheory.Limits.pullback.map X.L₁.g X.v₀₁.τ₃ Y.L₁.g Y.v₀₁.τ₃ f.f₁.τ₂ f.f₀.τ₃ f.f₁.τ₃ ⋯ ⋯


theorem IccExtend_apply (h : a ≤ b) (f : Icc a b → β) (x : α) :
    IccExtend h f x = f ⟨max a (min b x), le_max_left _ _, max_le h (min_le_left _ _)⟩

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{a b : α}
(h : a ≤ b)
(f : ↑(Set.Icc a b) → β)
(x : α)

Set.IccExtend h f x = f ⟨max a (min b x), ⋯⟩


lemma iterate_eq_self (hf : Involutive f) (hne : f ≠ id) : f^[n] = f ↔ Odd n

{α : Type u_5}
{f : α → α}
{n : ℕ}
(hf : Function.Involutive f)
(hne : f ≠ id)


@[trans]
theorem trans ⦃f g h : C(X, Y)⦄ (h₀ : HomotopicRel f g S) (h₁ : HomotopicRel g h S) :
    HomotopicRel f h S

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{S : Set X}
⦃f g h : C(X, Y)⦄
(h₀ : f.HomotopicRel g S)
(h₁ : g.HomotopicRel h S)


@[simp]
theorem principal_top : principal (⊤ : P) = ⊤

{P : Type u_1}
[Preorder P]
[OrderTop P]


@[simp]
theorem inf_principal {s t : Set α} : 𝓟 s ⊓ 𝓟 t = 𝓟 (s ∩ t)


/-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl

{α : Type u}
[self : PseudoEMetricSpace α]


@[simp]
theorem tail_nil : tail (nil : Seq α) = nil


theorem eq_of_mem_replicate {a b : α} {n} (h : b ∈ replicate n a) : b = a

{α : Type u_1}
{a b : α}
{n : Nat}
(h : b ∈ List.replicate n a)


lemma InjOn.image_subset_image_iff (h : s.InjOn f) (h₁ : s₁ ⊆ s) (h₂ : s₂ ⊆ s) :
    f '' s₁ ⊆ f '' s₂ ↔ s₁ ⊆ s₂

{α : Type u_1}
{β : Type u_2}
{s s₁ s₂ : Set α}
{f : α → β}
(h : Set.InjOn f s)
(h₁ : s₁ ⊆ s)
(h₂ : s₂ ⊆ s)


theorem le_iff_exists_add {s t : Multiset α} : s ≤ t ↔ ∃ u, t = s + u


theorem primitive_element_iff_algHom_eq_of_eval' (α : E) :
    F⟮α⟯ = ⊤ ↔ Function.Injective fun φ : E →ₐ[F] A ↦ φ α

(hA : ∀ (x : E), Polynomial.Splits (algebraMap F A) (minpoly F x))

F⟮α⟯ = ⊤ ↔ Function.Injective fun φ => φ α


theorem disjoint_boxes_of_disjoint_iUnion (h : Disjoint π₁.iUnion π₂.iUnion) :
    Disjoint π₁.boxes π₂.boxes

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}
(h : Disjoint π₁.iUnion π₂.iUnion)


@[simp]
theorem π_app_left (c : PullbackCone f g) : c.π.app WalkingCospan.left = c.fst

(c : CategoryTheory.Limits.PullbackCone f g)

c.π.app CategoryTheory.Limits.WalkingCospan.left = c.fst


theorem exists_disjoint_covering_ae :
    ∃ t : Set (α × Set α),
      (∀ p : α × Set α, p ∈ t → p.1 ∈ s) ∧
      (t.PairwiseDisjoint fun p => p.2) ∧
      (∀ p : α × Set α, p ∈ t → p.2 ∈ v.setsAt p.1 ∩ f p.1) ∧
      μ (s \ ⋃ (p : α × Set α) (_ : p ∈ t), p.2) = 0

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{v : VitaliFamily μ}
{f : α → Set (Set α)}
{s : Set α}
(h : v.FineSubfamilyOn f s)

∃ t,
  (∀ p ∈ t, p.1 ∈ s) ∧
    (t.PairwiseDisjoint fun p => p.2) ∧ (∀ p ∈ t, p.2 ∈ v.setsAt p.1 ∩ f p.1) ∧ μ (s \ ⋃ p ∈ t, p.2) = 0


@[simp]
theorem valuation_X_eq_neg_one :
    (idealX K).valuation (RatFunc.X : RatFunc K) = Multiplicative.ofAdd (-1 : ℤ)

(Polynomial.idealX K).valuation RatFunc.X = ↑(Multiplicative.ofAdd (-1))


/-- A topological basis is one that satisfies the necessary conditions so that
  it suffices to take unions of the basis sets to get a topology (without taking
  finite intersections as well). -/
structure IsTopologicalBasis (s : Set (Set α)) : Prop where
  /-- For every point `x`, the set of `t ∈ s` such that `x ∈ t` is directed downwards.  -/
  exists_subset_inter : ∀ t₁ ∈ s, ∀ t₂ ∈ s, ∀ x ∈ t₁ ∩ t₂, ∃ t₃ ∈ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂
  /-- The sets from `s` cover the whole space. -/
  sUnion_eq : ⋃₀ s = univ
  /-- The topology is generated by sets from `s`. -/
  eq_generateFrom : t = generateFrom s

(self : TopologicalSpace.IsTopologicalBasis s)


theorem hasColimitsOfShape_of_essentiallySmall [EssentiallySmall.{w₁} J]
    [HasColimitsOfSize.{w₁, w₁} C] : HasColimitsOfShape J C

[CategoryTheory.EssentiallySmall.{w₁, v₂, u₂} J]

[CategoryTheory.Limits.HasColimitsOfSize.{w₁, w₁, v₁, u₁} C]


/-- Suppose `X Y : SheafedSpace C`, where `C` is a concrete category,
whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits.
Then a morphism `X ⟶ Y` that is a topological open embedding
is an open immersion iff every stalk map is an iso.
-/
theorem of_stalk_iso {X Y : LocallyRingedSpace} (f : X ⟶ Y) (hf : OpenEmbedding f.1.base)
    [stalk_iso : ∀ x : X.1, IsIso (f.stalkMap x)] :
    LocallyRingedSpace.IsOpenImmersion f

{X Y : AlgebraicGeometry.LocallyRingedSpace}

[stalk_iso :
  ∀ (x : ↑↑X.toPresheafedSpace), CategoryTheory.IsIso (AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap f x)]


theorem UInt16.toNat_modn (x : UInt16) (n) : (x.modn n).toNat = x.toNat % n


theorem tendsto_atBot_of_add_bdd_below_right' (C) (hC : ∀ᶠ x in l, C ≤ g x)
    (h : Tendsto (fun x => f x + g x) l atBot) : Tendsto f l atBot

(h : Filter.Tendsto (fun x => f x + g x) l Filter.atBot)


theorem snd_iInf [InfSet α] [InfSet β] (f : ι → α × β) : (iInf f).snd = ⨅ i, (f i).snd

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[InfSet α]
[InfSet β]
(f : ι → α × β)


theorem conj_eq_re_sub_im (z : K) : conj z = re z - im z * I

(starRingEnd K) z = ↑(RCLike.re z) - ↑(RCLike.im z) * RCLike.I


@[to_additive (attr := simp)]
theorem snd_mul [Mul M] [Mul N] (p q : M × N) : (p * q).2 = p.2 * q.2

{M : Type u_5}
{N : Type u_6}
[Mul M]
[Mul N]
(p q : M × N)


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


theorem PairwiseDisjoint.eq_of_le (hs : s.PairwiseDisjoint f) {i j : ι} (hi : i ∈ s) (hj : j ∈ s)
    (hf : f i ≠ ⊥) (hij : f i ≤ f j) : i = j

{α : Type u_1}
{ι : Type u_4}
[SemilatticeInf α]
[OrderBot α]
{s : Set ι}
{f : ι → α}
(hs : s.PairwiseDisjoint f)
{i j : ι}
(hi : i ∈ s)
(hj : j ∈ s)
(hf : f i ≠ ⊥)
(hij : f i ≤ f j)


@[simp]
theorem ListBlank.nth_mk {Γ} [Inhabited Γ] (l : List Γ) (n : ℕ) :
    (ListBlank.mk l).nth n = l.getI n

{Γ : Type u_1}
[Inhabited Γ]
(l : List Γ)
(n : ℕ)

(Turing.ListBlank.mk l).nth n = l.getI n


theorem extend_unique [T2Space γ] {f : α → γ} {g : β → γ} (di : DenseInducing i)
    (hf : ∀ x, g (i x) = f x) (hg : Continuous g) : di.extend f = g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
{i : α → β}
[TopologicalSpace γ]
[T2Space γ]
{f : α → γ}
{g : β → γ}
(di : DenseInducing i)
(hf : ∀ (x : α), g (i x) = f x)
(hg : Continuous g)


theorem isLittleO_log_re_re (hl : IsExpCmpFilter l) : (fun z => Real.log z.re) =o[l] re

{l : Filter ℂ}
(hl : Complex.IsExpCmpFilter l)

(fun z => Real.log z.re) =o[l] Complex.re


theorem seven_le_initialBound : 7 ≤ initialBound ε l

7 ≤ SzemerediRegularity.initialBound ε l


@[simp]
theorem mem_rfind {p : ℕ →. Bool} {n : ℕ} :
    n ∈ rfind p ↔ true ∈ p n ∧ ∀ {m : ℕ}, m < n → false ∈ p m

n ∈ Nat.rfind p ↔ true ∈ p n ∧ ∀ {m : ℕ}, m < n → false ∈ p m


lemma isFiniteKernel_of_le {κ ν : Kernel α β} [hν : IsFiniteKernel ν] (hκν : κ ≤ ν) :
    IsFiniteKernel κ

[hν : ProbabilityTheory.IsFiniteKernel ν]

(hκν : κ ≤ ν)


/-- The n-ary version of `Set.image_mul_prod`. -/
@[to_additive "The n-ary version of `Set.add_image_prod`. "]
theorem image_finset_prod_pi (l : Finset ι) (S : ι → Set α) :
    (fun f : ι → α => ∏ i ∈ l, f i) '' (l : Set ι).pi S = ∏ i ∈ l, S i

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
(l : Finset ι)
(S : ι → Set α)

(fun f => ∑ i ∈ l, f i) '' (↑l).pi S = ∑ i ∈ l, S i


theorem eventually_le_limsup [CountableInterFilter f] (u : α → ℝ≥0∞) :
    ∀ᶠ y in f, u y ≤ f.limsup u

{α : Type u_1}
{f : Filter α}
[CountableInterFilter f]
(u : α → ℝ≥0∞)

∀ᶠ (y : α) in f, u y ≤ Filter.limsup u f


@[simp]
protected theorem IsRotated.forall (l : List α) (n : ℕ) : l.rotate n ~r l


lemma sSup_iUnion_Iic (f : ι → α) : sSup (⋃ (i : ι), Iic (f i)) = ⨆ i, f i

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


theorem mem_pair {x y z : ZFSet.{u}} : x ∈ ({y, z} : ZFSet) ↔ x = y ∨ x = z


theorem IsLeast.lt_iff (h : IsLeast s a) : b < a ↔ ∀ x ∈ s, b < x

{α : Type u}
[Preorder α]
{s : Set α}
{a b : α}
(h : IsLeast s a)


/-- The isomorphism of short complexes `S.map F ≅ S.map G` induced by
a natural isomorphism `F ≅ G`. -/
@[simps]
def mapNatIso {F G : C ⥤ D} [F.PreservesZeroMorphisms] [G.PreservesZeroMorphisms] (τ : F ≅ G) :
    S.map F ≅ S.map G

(S.mapNatIso τ).hom = S.mapNatTrans τ.hom


@[simp]
theorem rid_tmul (m : M) (r : R) : (TensorProduct.rid R M) (m ⊗ₜ r) = r • m

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
[AddCommMonoid M]
[Module R M]
(m : M)
(r : R)

(TensorProduct.rid R M) (m ⊗ₜ[R] r) = r • m


@[to_additive (attr := simp)]
protected theorem conj_iff (h : G) : Commute (h * a * h⁻¹) (h * b * h⁻¹) ↔ Commute a b

{G : Type u_1}
[Group G]
{a b : G}
(h : G)


theorem Ne.nhdsWithin_compl_singleton [T1Space X] {x y : X} (h : x ≠ y) : 𝓝[{y}ᶜ] x = 𝓝 x

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


theorem geom_sum₂_succ_eq {α : Type u} [CommRing α] (x y : α) {n : ℕ} :
    ∑ i ∈ range (n + 1), x ^ i * y ^ (n - i) =
      x ^ n + y * ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)

∑ i ∈ Finset.range (n + 1), x ^ i * y ^ (n - i) = x ^ n + y * ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)


theorem sdiff_insert_of_not_mem {x : α} (h : x ∉ s) (t : Finset α) : s \ insert x t = s \ t

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{x : α}
(h : x ∉ s)
(t : Finset α)


theorem Subtype.volume_univ (hu : NullMeasurableSet u) : volume (univ : Set u) = volume u

(hu : MeasureTheory.NullMeasurableSet u MeasureTheory.volume)

MeasureTheory.volume Set.univ = MeasureTheory.volume u


@[to_additive (attr := simp)]
theorem quotientSubgroupOfMapOfLE_apply_mk (H : Subgroup α) (h : s ≤ t) (g : H) :
    quotientSubgroupOfMapOfLE H h (QuotientGroup.mk g) =
      (QuotientGroup.mk g : { x // x ∈ H } ⧸ subgroupOf t H)

{α : Type u_1}
[AddGroup α]
{s t : AddSubgroup α}
(H : AddSubgroup α)
(h : s ≤ t)
(g : ↥H)

AddSubgroup.quotientAddSubgroupOfMapOfLE H h ↑g = ↑g


protected theorem exists_eq_add_of_lt (h : m < n) : ∃ k : Nat, n = m + k + 1


theorem isConstant_coe {l : Filter α} {b} (h : ∀ x', f x' = b) : (↑f : Germ l β).IsConstant

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{l : Filter α}
{b : β}
(h : ∀ (x' : α), f x' = b)


/-- Subtracting the first vector passed to `oangle` from a multiple of the second vector negates
the sign of the angle. -/
@[simp]
theorem oangle_sign_smul_sub_left (x y : V) (r : ℝ) :
    (o.oangle (r • y - x) y).sign = -(o.oangle x y).sign

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


/-- Factoring through the image is a strong epi-mono factorisation. -/
@[simps]
def imageStrongEpiMonoFactorisation : StrongEpiMonoFactorisation f

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

(CategoryTheory.Abelian.imageStrongEpiMonoFactorisation f).I = CategoryTheory.Abelian.image f


theorem cond_eq_if : (bif b then x else y) = (if b then x else y)

∀ {α : Type u_1} {x y : α}, (bif b then x else y) = if b = true then x else y


theorem encard_tsub_one_le_encard_diff_singleton (s : Set α) (x : α) :
    s.encard - 1 ≤ (s \ {x}).encard


theorem hasDerivAt_exp_smul_const' (x : 𝔸) (t : 𝕂) :
    HasDerivAt (fun u : 𝕂 => exp 𝕂 (u • x)) (x * exp 𝕂 (t • x)) t

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

HasDerivAt (fun u => NormedSpace.exp 𝕂 (u • x)) (x * NormedSpace.exp 𝕂 (t • x)) t