@[reassoc (attr := simp)]
theorem ε_inv_hom_app (X : C) : F.εIso.inv.app X ≫ F.ε.app X = 𝟙 _

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

CategoryTheory.CategoryStruct.comp (F.εIso.inv.app X) (F.ε.app X) =
  CategoryTheory.CategoryStruct.id ((F.obj (𝟙_ M)).obj X)


@[to_additive]
theorem mem_pow {a : α} {n : ℕ} :
    a ∈ s ^ n ↔ ∃ f : Fin n → s, (List.ofFn fun i => ↑(f i)).prod = a

{α : Type u_2}
[DecidableEq α]
[Monoid α]
{s : Finset α}
{a : α}
{n : ℕ}

a ∈ s ^ n ↔ ∃ f, (List.ofFn fun i => ↑(f i)).prod = a


theorem foldr_induction (f : α → α → α) (H : LeftCommutative f) (x : α) (p : α → Prop)
    (s : Multiset α) (p_f : ∀ a b, p a → p b → p (f a b)) (px : p x) (p_s : ∀ a ∈ s, p a) :
    p (foldr f H x s)

(f : α → α → α)

(p_f : ∀ (a b : α), p a → p b → p (f a b))


theorem iff_op : HasLiftingProperty i p ↔ HasLiftingProperty p.op i.op

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{A B X Y : C}
{i : A ⟶ B}
{p : X ⟶ Y}

CategoryTheory.HasLiftingProperty i p ↔ CategoryTheory.HasLiftingProperty p.op i.op


@[simp, norm_cast]
theorem coe_inf (s t : L.DefinableSet A α) :
    ((s ⊓ t : L.DefinableSet A α) : Set (α → M)) = (s : Set (α → M)) ∩ (t : Set (α → M))

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{A : Set M}
{α : Type u₁}
(s t : L.DefinableSet A α)


theorem IsCoprime.prod_right_iff : IsCoprime x (∏ i ∈ t, s i) ↔ ∀ i ∈ t, IsCoprime x (s i)

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


@[continuity]
theorem continuous_imJ : Continuous fun q : ℍ => q.imJ


protected theorem mul_div_assoc (m : Nat) (H : k ∣ n) : m * n / k = m * (n / k)


@[to_additive]
theorem mul_inv_le_one_iff_le : a * b⁻¹ ≤ 1 ↔ a ≤ b

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


@[simp]
theorem fold_map {g : γ ↪ α} {s : Finset γ} : (s.map g).fold op b f = s.fold op b (f ∘ g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{b : β}
{g : γ ↪ α}
{s : Finset γ}

Finset.fold op b f (Finset.map g s) = Finset.fold op b (f ∘ ⇑g) s


/-- `Finsupp.single a b` is injective in `a`. For the statement that it is injective in `b`, see
`Finsupp.single_injective` -/
theorem single_left_injective (h : b ≠ 0) : Function.Injective fun a : α => single a b

{α : Type u_1}
{M : Type u_5}
[Zero M]
{b : M}
(h : b ≠ 0)

Function.Injective fun a => Finsupp.single a b


/-- Given a coalgebra morphism whose carrier part is an isomorphism, we get a coalgebra isomorphism.
-/
theorem coalgebra_iso_of_iso {A B : Coalgebra G} (f : A ⟶ B) [IsIso f.f] : IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(G : CategoryTheory.Comonad C)
{A B : G.Coalgebra}
(f : A ⟶ B)
[CategoryTheory.IsIso f.f]


protected theorem Connected.exists_walk_length_eq_edist  (hconn : G.Connected) (u v : V) :
    ∃ p : G.Walk u v, p.length = G.edist u v

{V : Type u_1}
{G : SimpleGraph V}
(hconn : G.Connected)
(u v : V)


@[to_additive indicator_apply_nonneg]
lemma one_le_mulIndicator_apply (h : a ∈ s → 1 ≤ f a) : 1 ≤ mulIndicator s f a

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[One M]
{s : Set α}
{f : α → M}
{a : α}
(h : a ∈ s → 1 ≤ f a)


/-- Note this matches the convention of `List.ofFn_succ'`, putting the `Fin m` elements first. -/
theorem ofFn_add {m n} (f : Fin (m + n) → α) :
    List.ofFn f =
      (List.ofFn fun i => f (Fin.castAdd n i)) ++ List.ofFn fun j => f (Fin.natAdd m j)

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


@[simp]
theorem finite_interval : (uIcc a b).Finite

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


@[simp]
lemma preNormEDS_zero : preNormEDS b c d 0 = 0


lemma not_equiv_of_Z_eq_zero_right {P Q : Fin 3 → R} (hPz : P z ≠ 0) (hQz : Q z = 0) : ¬P ≈ Q

{R : Type u}
[CommRing R]
{P Q : Fin 3 → R}
(hPz : P z ≠ 0)
(hQz : Q z = 0)


@[reassoc (attr := simp)]
lemma whiskerRight_snd {X₁ X₂ : C} (f : X₁ ⟶ X₂) (Y : C) :
    (f ▷ Y) ≫ snd _ _ = snd _ _

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight f Y)
    (CategoryTheory.ChosenFiniteProducts.snd X₂ Y) =
  CategoryTheory.ChosenFiniteProducts.snd X₁ Y


@[simp]
theorem toSeminormFamily_apply {B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜} {x y} : (B.toSeminormFamily y) x = ‖B x y‖

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
{B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜}
{x : E}
{y : F}


@[simp]
theorem mk_inf_mk {U V : Set α} {hU : IsOpen U} {hV : IsOpen V} :
    (⟨U, hU⟩ ⊓ ⟨V, hV⟩ : Opens α) = ⟨U ⊓ V, IsOpen.inter hU hV⟩

{α : Type u_2}
[TopologicalSpace α]
{U V : Set α}
{hU : IsOpen U}
{hV : IsOpen V}

{ carrier := U, is_open' := hU } ⊓ { carrier := V, is_open' := hV } = { carrier := U ⊓ V, is_open' := ⋯ }


theorem zero_addChar_byteIdx (c : Char) : ((0 : Pos) + c).byteIdx = c.utf8Size


lemma _root_.Set.Finite.eventuallyEq_iUnion {ι : Type*} {s : Set ι} (hs : s.Finite)
    {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 : Set ι}
(hs : s.Finite)
{f g : ι → Set α}
(heq : ∀ i ∈ s, f i =ᶠ[l] g i)


theorem lcomp_apply' (f : M →ₗ[R] Nₗ) (g : Nₗ →ₗ[R] Pₗ) : lcomp R Pₗ f g = g ∘ₗ f

{R : Type u_1}
[CommSemiring R]
{M : Type u_5}
{Nₗ : Type u_10}
{Pₗ : Type u_11}
[AddCommMonoid M]
[AddCommMonoid Nₗ]
[AddCommMonoid Pₗ]
[Module R M]
[Module R Nₗ]
[Module R Pₗ]
(f : M →ₗ[R] Nₗ)
(g : Nₗ →ₗ[R] Pₗ)


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

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


/-- Multiplying the first vector passed to `oangle` by a real multiplies the sign of the angle by
the sign of the real. -/
@[simp]
theorem oangle_sign_smul_left (x y : V) (r : ℝ) :
    (o.oangle (r • x) y).sign = SignType.sign r * (o.oangle x y).sign

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


theorem ext {a b : Set α} (h : ∀ (x : α), x ∈ a ↔ x ∈ b) : a = b

{α : Type u_1}
{a b : Set α}
(h : ∀ (x : α), x ∈ a ↔ x ∈ b)


lemma natDegree_Ψ₂Sq_pos (h : (4 : R) ≠ 0) : 0 < W.Ψ₂Sq.natDegree

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(h : 4 ≠ 0)


theorem independent_iff_linearIndependent_of_ne_zero [NoZeroSMulDivisors R N] {v : ι → N}
    (h_ne_zero : ∀ i, v i ≠ 0) : (Independent fun i => R ∙ v i) ↔ LinearIndependent R v

{ι : Type u_1}
{R : Type u_2}
{N : Type u_5}
[Ring R]
[AddCommGroup N]
[Module R N]
[NoZeroSMulDivisors R N]
{v : ι → N}
(h_ne_zero : ∀ (i : ι), v i ≠ 0)

(CompleteLattice.Independent fun i => Submodule.span R {v i}) ↔ LinearIndependent R v


theorem getElem?_eq_none (h : length l ≤ n) : l[n]? = none

∀ {α : Type u_1} {l : List α} {n : Nat}, l.length ≤ n → l[n]? = none


@[to_additive]
theorem mk_of_inv_mul : ∀ x : G ⊕ H, mk (of (x.map Inv.inv Inv.inv)) * mk (of x) = 1

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
(x : G ⊕ H)

AddMonoid.Coprod.mk (FreeAddMonoid.of (Sum.map Neg.neg Neg.neg x)) + AddMonoid.Coprod.mk (FreeAddMonoid.of x) = 0


theorem toNat_ge_of_msb_true {x : BitVec n} (p : BitVec.msb x = true) : x.toNat ≥ 2^(n-1)

{n : Nat}
{x : BitVec n}
(p : x.msb = true)


protected theorem ContMDiff.coordChangeL
    (hf : ContMDiff IM IB n f) (he : ∀ x, f x ∈ e.baseSet) (he' : ∀ x, f x ∈ e'.baseSet) :
    ContMDiff IM 𝓘(𝕜, F →L[𝕜] F) n (fun y ↦ (e.coordChangeL 𝕜 e' (f y) : F →L[𝕜] F))

[TopologicalSpace (Bundle.TotalSpace F E)]

{e e' : Trivialization F Bundle.TotalSpace.proj}

ContMDiff IM 𝓘(𝕜, F →L[𝕜] F) n fun y => ↑(Trivialization.coordChangeL 𝕜 e e' (f y))


theorem union_zeroLocus (s s' : Set R) :
    zeroLocus s ∪ zeroLocus s' = zeroLocus (Ideal.span s ⊓ Ideal.span s' : Ideal R)

{R : Type u}
[CommSemiring R]
(s s' : Set R)

PrimeSpectrum.zeroLocus s ∪ PrimeSpectrum.zeroLocus s' = PrimeSpectrum.zeroLocus ↑(Ideal.span s ⊓ Ideal.span s')


@[simp]
theorem mk_eq_mk {g h : R[X]} : mk f g = mk f h ↔ f ∣ g - h

{R : Type u}
[CommRing R]
{f g h : R[X]}

(AdjoinRoot.mk f) g = (AdjoinRoot.mk f) h ↔ f ∣ g - h


lemma map_mem {r : R} (hr : r ∈ unitary R) : f r ∈ unitary S

{F : Type u_2}
{R : Type u_3}
{S : Type u_4}
[Monoid R]
[StarMul R]
[Monoid S]
[StarMul S]
[FunLike F R S]
[StarHomClass F R S]
[MonoidHomClass F R S]
(f : F)
{r : R}
(hr : r ∈ unitary R)


theorem sum_le_of_monotoneOn_Iic (f : α → E) {s : Set α} {n : ℕ} {u : ℕ → α}
    (hu : MonotoneOn u (Iic n)) (us : ∀ i ≤ n, u i ∈ s) :
    (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
{s : Set α}
{n : ℕ}
{u : ℕ → α}
(hu : MonotoneOn u (Set.Iic n))
(us : ∀ i ≤ n, u i ∈ s)

∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i)) ≤ eVariationOn f s


theorem coeff_zero_X (s : σ) : coeff R (0 : σ →₀ ℕ) (X s : MvPowerSeries σ R) = 0

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

(MvPowerSeries.coeff R 0) (MvPowerSeries.X s) = 0


theorem ceil_logb_natCast {b : ℕ} {r : ℝ} (hb : 1 < b) (hr : 0 ≤ r) :
    ⌈logb b r⌉ = Int.clog b r


theorem right_eq_zero_of_add_eq_zero {a b : Ordinal} (h : a + b = 0) : b = 0


@[simp]
theorem midpoint_neg_self (x : V) : midpoint R (-x) x = 0

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


theorem NatTrans.epi_iff_epi_app {F G : C ⥤ D} (η : F ⟶ G) : Epi η ↔ ∀ c, Epi (η.app c)

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

CategoryTheory.Epi η ↔ ∀ (c : C), CategoryTheory.Epi (η.app c)


@[to_additive (attr := simp)]
theorem coprod_apply (p : M × N) : f.coprod g p = f p.1 * g p.2

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
[AddCommMonoid P]
(f : M →+ P)
(g : N →+ P)
(p : M × N)


@[simp] lemma div_mem_centralizer₀ (ha : a ∈ centralizer s) (hb : b ∈ centralizer s) :
    a / b ∈ centralizer s

{G₀ : Type u_2}
[GroupWithZero G₀]
{s : Set G₀}
{a b : G₀}
(ha : a ∈ s.centralizer)
(hb : b ∈ s.centralizer)


lemma hasDerivAt_Gammaℂ_one : HasDerivAt Gammaℂ (-(γ + log (2 * π)) / π) 1

HasDerivAt Complex.Gammaℂ (-(↑γ + Complex.log (2 * ↑Real.pi)) / ↑Real.pi) 1


/-- An ideal is maximal if it is maximal in the collection of proper ideals. -/
class IsMaximal (I : Ideal α) : Prop where
  /-- The maximal ideal is a coatom in the ordering on ideals; that is, it is not the entire ring,
  and there are no other proper ideals strictly containing it. -/
  out : IsCoatom I

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


/-- Shows that the fractional parts of the stream are in `[0,1)`. -/
theorem nth_stream_fr_nonneg_lt_one {ifp_n : IntFractPair K}
    (nth_stream_eq : IntFractPair.stream v n = some ifp_n) : 0 ≤ ifp_n.fr ∧ ifp_n.fr < 1

(nth_stream_eq : GenContFract.IntFractPair.stream v n = some ifp_n)


@[simp, norm_cast]
theorem coe_map : (map f s : Set β) = f '' s

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


protected theorem congr_fun {f g : α →𝒄 β} (h : f = g) (x : α) : f x = g x

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
{f g : α →𝒄 β}
(h : f = g)
(x : α)


theorem addBottom_head_fst (L : ListBlank (∀ k, Option (Γ k))) : (addBottom L).head.1 = true

(L : Turing.ListBlank ((k : K) → Option (Γ k)))

(Turing.TM2to1.addBottom L).head.1 = true


@[to_additive (attr := simp)]
lemma aestabilizer_empty : aestabilizer G μ ∅ = ⊤

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.SMulInvariantMeasure G α μ],
  MulAction.aestabilizer G μ ∅ = ⊤


theorem isSeparated_eq_diagonal_isClosedImmersion :
    @IsSeparated = MorphismProperty.diagonal @IsClosedImmersion

@AlgebraicGeometry.IsSeparated = CategoryTheory.MorphismProperty.diagonal @AlgebraicGeometry.IsClosedImmersion


@[trans]
theorem _root_.Filter.EventuallyEq.trans_isBigO {f₁ f₂ : α → E} {g : α → F} (hf : f₁ =ᶠ[l] f₂)
    (h : f₂ =O[l] g) : 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 : α → F}
(hf : f₁ =ᶠ[l] f₂)
(h : f₂ =O[l] g)


@[simp] theorem coe_id (X : TopCat.{u}) : (𝟙 X : X → X) = id


theorem coe_comp_lattice_hom (f : BoundedLatticeHom β γ) (g : BoundedLatticeHom α β) :
    (f.comp g : LatticeHom α γ) = (f : LatticeHom β γ).comp g

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

{ toFun := ⇑(f.comp g), map_sup' := ⋯, map_inf' := ⋯ } =
  { toFun := ⇑f, map_sup' := ⋯, map_inf' := ⋯ }.comp { toFun := ⇑g, map_sup' := ⋯, map_inf' := ⋯ }


/--
Any sieve that contains a covering presieve for a coverage is a covering sieve for the associated
Grothendieck topology.
-/
theorem mem_toGrothendieck_sieves_of_superset (K : Coverage C) {X : C} {S : Sieve X}
    {R : Presieve X} (h : R ≤ S) (hR : R ∈ K.covering X) : S ∈ (K.toGrothendieck C).sieves X

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(K : CategoryTheory.Coverage C)
{X : C}
{S : CategoryTheory.Sieve X}
{R : CategoryTheory.Presieve X}
(h : R ≤ S.arrows)
(hR : R ∈ K.covering X)

S ∈ (CategoryTheory.Coverage.toGrothendieck C K).sieves X


/-- Two isomorphic functors `F₁` and `F₂` induce isomorphic functors
`F₁.mapTriangle` and `F₂.mapTriangle` if the isomorphism `F₁ ≅ F₂` is compatible
with the shifts. -/
@[simps!]
def mapTriangleIso {F₁ F₂ : C ⥤ D} (e : F₁ ≅ F₂) [F₁.CommShift ℤ] [F₂.CommShift ℤ]
    [NatTrans.CommShift e.hom ℤ] : F₁.mapTriangle ≅ F₂.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Functor.mapTriangleIso e).hom.app X).hom₃ = e.hom.app X.obj₃


@[simp]
theorem vsub_apply (f g : P1 →ᵃ[k] P2) (p : P1) : (f -ᵥ g : P1 →ᵃ[k] V2) p = f p -ᵥ g p

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(f g : P1 →ᵃ[k] P2)
(p : P1)


/-- Adds `b` to a finpartition of `a` to make a finpartition of `a ⊔ b`. -/
@[simps]
def extend (P : Finpartition a) (hb : b ≠ ⊥) (hab : Disjoint a b) (hc : a ⊔ b = c) :
    Finpartition c

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
[DecidableEq α]
{a b c : α}
(P : Finpartition a)
(hb : b ≠ ⊥)
(hab : Disjoint a b)
(hc : a ⊔ b = c)

(P.extend hb hab hc).parts = insert b P.parts


@[to_additive (attr := simp) norm_le_zero_iff]
theorem norm_le_zero_iff'' : ‖a‖ ≤ 0 ↔ a = 1

{E : Type u_6}
[NormedAddGroup E]
{a : E}


theorem unrev_ok {q s} {S : K' → List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (unrev q), s, S⟩
      ⟨some q, none, update (update S rev []) main (List.reverseAux (S rev) (S main))⟩

{S : Turing.PartrecToTM2.K' → List Turing.PartrecToTM2.Γ'}

Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr) { l := some (Turing.PartrecToTM2.unrev q), var := s, stk := S }
  { l := some q, var := none,
    stk :=
      Function.update (Function.update S Turing.PartrecToTM2.K'.rev []) Turing.PartrecToTM2.K'.main
        ((S Turing.PartrecToTM2.K'.rev).reverseAux (S Turing.PartrecToTM2.K'.main)) }


/-- Any path to `a` gives `treeHom T a`, since paths in the tree are unique. -/
theorem treeHom_eq {a : G} (p : Path (root T) a) : treeHom T a = homOfPath T p

(T : WideSubquiver (Quiver.Symmetrify (IsFreeGroupoid.Generators G)))

[Quiver.Arborescence (WideSubquiver.toType (Quiver.Symmetrify (IsFreeGroupoid.Generators G)) T)]

(p : Quiver.Path (Quiver.root (WideSubquiver.toType (Quiver.Symmetrify (IsFreeGroupoid.Generators G)) T)) a)

IsFreeGroupoid.SpanningTree.treeHom T a = IsFreeGroupoid.SpanningTree.homOfPath T p


theorem zsmul (z : ℤ) (x : WittVector p R) : mapFun f (z • x) = z • mapFun f x

{p : ℕ}
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)
(z : ℤ)
(x : 𝕎 R)

WittVector.mapFun (⇑f) (z • x) = z • WittVector.mapFun (⇑f) x


/-- Given a triangle of the form:
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
applying `invRotate` gives a triangle that can be thought of as:
```
        -h⟦-1⟧'     f       g
  Z⟦-1⟧  ───>  X  ───> Y  ───> Z
```
(note that this diagram doesn't technically fit the definition of triangle, as `Z⟦-1⟧⟦1⟧` is
not necessarily equal to `Z`, but it is isomorphic, by the `counitIso` of `shiftEquiv C 1`)
-/
@[simps!]
def Triangle.invRotate (T : Triangle C) : Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)


/-- If two mul homomorphisms are equal on a set, then they are equal on its subsemigroup closure. -/
@[to_additive "If two add homomorphisms are equal on a set,
  then they are equal on its additive subsemigroup closure."]
theorem eqOn_closure {f g : M →ₙ* N} {s : Set M} (h : Set.EqOn f g s) :
    Set.EqOn f g (closure s)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f g : M →ₙ* N}
{s : Set M}
(h : Set.EqOn (⇑f) (⇑g) s)

Set.EqOn ⇑f ⇑g ↑(Subsemigroup.closure s)


theorem locallyOfFiniteType_of_comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z)
    [LocallyOfFiniteType (f ≫ g)] : LocallyOfFiniteType f

[AlgebraicGeometry.LocallyOfFiniteType (f ≫ g)]


theorem mem_Icc_of_Ioc (h : x ∈ Ioc a b) : x ∈ Icc a b

{α : Type u_1}
[Preorder α]
{a b x : α}
(h : x ∈ Set.Ioc a b)


theorem M.bisim {α : TypeVec n} (R : P.M α → P.M α → Prop)
    (h :
      ∀ x y,
        R x y →
          ∃ a f f₁ f₂,
            M.dest P x = ⟨a, splitFun f f₁⟩ ∧
              M.dest P y = ⟨a, splitFun f f₂⟩ ∧ ∀ i, R (f₁ i) (f₂ i))
    (x y) (r : R x y) : x = y

(h :
  ∀ (x y : P.M α),
    R x y →
      ∃ a f f₁ f₂,
        MvPFunctor.M.dest P x = ⟨a, TypeVec.splitFun f f₁⟩ ∧
          MvPFunctor.M.dest P y = ⟨a, TypeVec.splitFun f f₂⟩ ∧ ∀ (i : (P.B a).last), R (f₁ i) (f₂ i))


@[trans]
theorem Lex.trans {r : α → α → Prop} {s : β → β → Prop} [IsTrans α r] [IsTrans β s] :
    ∀ {x y z : α × β}, Prod.Lex r s x y → Prod.Lex r s y z → Prod.Lex r s x z

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsTrans α r]
[IsTrans β s]
{x y z : α × β}


@[simp] lemma coe_mk (f : LatticeHom α β) (hf hf') : ⇑(mk f hf hf') = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(f : LatticeHom α β)
(hf : f.toFun ⊤ = ⊤)
(hf' : f.toFun ⊥ = ⊥)

⇑{ toLatticeHom := f, map_top' := hf, map_bot' := hf' } = ⇑f


protected theorem add_lt_add_of_lt_of_le : c ≠ ∞ → a < b → c ≤ d → a + c < b + d


theorem Convex.segment_subset (h : Convex 𝕜 s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) :
    [x -[𝕜] y] ⊆ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{s : Set E}
(h : Convex 𝕜 s)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)


@[simp]
theorem vanishingIdeal_pointToPoint (V : Set (σ → k)) :
    PrimeSpectrum.vanishingIdeal (pointToPoint '' V) = MvPolynomial.vanishingIdeal V

{k : Type u_1}
[Field k]
{σ : Type u_2}
(V : Set (σ → k))

PrimeSpectrum.vanishingIdeal (MvPolynomial.pointToPoint '' V) = MvPolynomial.vanishingIdeal V


@[reassoc]
lemma mapBifunctorRightUnitor_naturality :
    mapBifunctorMapMap F p φ (𝟙 _) ≫ (mapBifunctorRightUnitor F Y e p hp X').hom =
      (mapBifunctorRightUnitor F Y e p hp X).hom ≫ φ

(F : CategoryTheory.Functor D (CategoryTheory.Functor C D))

(e : F.flip.obj Y ≅ CategoryTheory.Functor.id D)

[(X : D) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C) (F.obj X)]

(X X' : CategoryTheory.GradedObject J D)

[(((CategoryTheory.GradedObject.mapBifunctor F J I).obj X).obj ((CategoryTheory.GradedObject.single₀ I).obj Y)).HasMap
    p]

[(((CategoryTheory.GradedObject.mapBifunctor F J I).obj X').obj ((CategoryTheory.GradedObject.single₀ I).obj Y)).HasMap
    p]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.mapBifunctorMapMap F p φ
      (CategoryTheory.CategoryStruct.id ((CategoryTheory.GradedObject.single₀ I).obj Y)))
    (CategoryTheory.GradedObject.mapBifunctorRightUnitor F Y e p hp X').hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.mapBifunctorRightUnitor F Y e p hp X).hom φ


@[simp]
theorem closure_thickening (hδ : 0 < δ) (s : Set E) :
    closure (thickening δ s) = cthickening δ s

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ : ℝ}
(hδ : 0 < δ)
(s : Set E)

closure (Metric.thickening δ s) = Metric.cthickening δ s


@[simp, norm_cast]
theorem coe_smul (t : R) (m : N) : (↑(t • m) : M) = t • (m : M)

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


@[to_additive]
theorem Monoid.exponent_pi_eq_zero {ι : Type*} {M : ι → Type*} [∀ i, Monoid (M i)] {j : ι}
    (hj : exponent (M j) = 0) : exponent ((i : ι) → M i) = 0

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → AddMonoid (M i)]
{j : ι}
(hj : AddMonoid.exponent (M j) = 0)


@[measurability]
theorem AEMeasurable.const_inf (hf : AEMeasurable f μ) (c : M) :
    AEMeasurable (fun x => c ⊓ f x) μ

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


theorem intValuation_apply {r : R} (v : IsDedekindDomain.HeightOneSpectrum R) :
    intValuation v r = intValuationDef v r


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

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


@[simp]
theorem disjoint_pure_pure {x y : α} : Disjoint (pure x : Filter α) (pure y) ↔ x ≠ y


lemma nonDegenerateFlip_iff {B : BilinForm K V} :
    B.flip.Nondegenerate ↔ B.Nondegenerate

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{B : LinearMap.BilinForm K V}


/-- If a linear map is invertible, so is its determinant. -/
theorem isUnit_det {A : Type*} [CommRing A] [Module A M] (f : M →ₗ[A] M) (hf : IsUnit f) :
    IsUnit (LinearMap.det f)

{M : Type u_2}
[AddCommGroup M]
{A : Type u_7}
[CommRing A]
[Module A M]
(f : M →ₗ[A] M)
(hf : IsUnit f)


theorem join_join (l : List (List (List α))) : l.join.join = (l.map join).join

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

l.join.join = (List.map List.join l).join


theorem carrier.asIdeal.ne_top : carrier.asIdeal f_deg hm q ≠ ⊤

(q :
  ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj
          (CommRingCat.of (HomogeneousLocalization.Away 𝒜 f))).toPresheafedSpace)

AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier.asIdeal f_deg hm q ≠ ⊤


@[to_additive]
theorem finprod_mem_inter_mulSupport (f : α → M) (s : Set α) :
    ∏ᶠ i ∈ s ∩ mulSupport f, f i = ∏ᶠ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)
(s : Set α)

∑ᶠ (i : α) (_ : i ∈ s ∩ Function.support f), f i = ∑ᶠ (i : α) (_ : i ∈ s), f i


/-- A specialization of 'the smallest congruence relation containing a congruence relation `c`
    equals `c`'. -/
@[to_additive "A specialization of 'the smallest additive congruence relation containing
an additive congruence relation `c` equals `c`'."]
theorem mapOfSurjective_eq_mapGen {c : Con M} {f : M → N} (H : ∀ x y, f (x * y) = f x * f y)
    (h : mulKer f H ≤ c) (hf : Surjective f) : c.mapGen f = c.mapOfSurjective f H h hf

(H : ∀ (x y : M), f (x + y) = f x + f y)


@[to_additive]
theorem closedEmbedding_mk_symm : ClosedEmbedding (@mk M).symm


@[fun_prop]
theorem differentiableOn_id : DifferentiableOn 𝕜 id s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}


theorem Poly.add_denote (ctx : Context) (p₁ p₂ : Poly) : (p₁.add p₂).denote ctx = p₁.denote ctx + p₂.denote ctx

(ctx : Nat.Linear.Context)
(fuel : Nat)
(p₁ p₂ : Nat.SOM.Poly)

Nat.SOM.Poly.denote ctx (Nat.SOM.Poly.add.go fuel p₁ p₂) = Nat.SOM.Poly.denote ctx p₁ + Nat.SOM.Poly.denote ctx p₂


@[to_additive (attr := simp)]
theorem inv_le_inv (S T : Submonoid G) : S⁻¹ ≤ T⁻¹ ↔ S ≤ T

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


@[simp]
theorem coeff_out (x : TruncatedWittVector p n R) (i : Fin n) : x.out.coeff i = x.coeff i

{p n : ℕ}
{R : Type u_1}
[CommRing R]
(x : TruncatedWittVector p n R)
(i : Fin n)

x.out.coeff ↑i = TruncatedWittVector.coeff i x


/-- The identity map, bundled as an equivalence between the subtypes of `s : Set α` and of
`h.toFinset : Finset α`, where `h` is a proof of finiteness of `s`. -/
@[simps!] def subtypeEquivToFinset : {x // x ∈ s} ≃ {x // x ∈ hs.toFinset}

(b : { b // (fun x => x ∈ hs.toFinset) b })


lemma preimage_val_sUnion : A ↓∩ (⋃₀ S) = ⋃₀ { (A ↓∩ B) | B ∈ S }

{α : Type u_2}
{A : Set α}
{S : Set (Set α)}

Subtype.val ⁻¹' ⋃₀ S = ⋃₀ {x | ∃ B ∈ S, Subtype.val ⁻¹' B = x}


/-- The definition of a periodic orbit, in terms of `Cycle.map`. -/
theorem periodicOrbit_eq_cycle_map (f : α → α) (x : α) :
    periodicOrbit f x = (List.range (minimalPeriod f x) : Cycle ℕ).map fun n => f^[n] x

Function.periodicOrbit f x = Cycle.map (fun n => f^[n] x) ↑(List.range (Function.minimalPeriod f x))


theorem interedges_mono : s₂ ⊆ s₁ → t₂ ⊆ t₁ → G.interedges s₂ t₂ ⊆ G.interedges s₁ t₁

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{s₁ s₂ t₁ t₂ : Finset α}


/--
Equivalent preregular categories give equivalent regular toposes.
-/
@[simps!]
def sheafCongrPreregular : haveI := e.preregular
    Sheaf (regularTopology C) A ≌ Sheaf (regularTopology D) A

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_5, u_2} D]
(e : C ≌ D)
[CategoryTheory.Preregular C]
(A : Type u_3)
[CategoryTheory.Category.{u_6, u_3} A]

∀ {X Y : CategoryTheory.Sheaf (CategoryTheory.regularTopology D) A} (f : X ⟶ Y) (X_1 : Cᵒᵖ),
  ((e.sheafCongrPreregular A).inverse.map f).val.app X_1 = f.val.app (Opposite.op (e.functor.obj (Opposite.unop X_1)))


theorem IsSemisimple.mul_of_commute : (f * g).IsSemisimple

{M : Type u_2}
[AddCommGroup M]
{K : Type u_3}
[Field K]
[Module K M]
{f g : Module.End K M}
[FiniteDimensional K M]
[PerfectField K]
(comm : Commute f g)
(hf : f.IsSemisimple)
(hg : g.IsSemisimple)


@[simp]
theorem conjAut_hom (f : Aut X) : (α.conjAut f).hom = α.conj f.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(α : X ≅ Y)
(f : CategoryTheory.Aut X)


lemma homologySequence_mono_shift_map_mor₁_iff :
    Mono ((F.shift n₁).map T.mor₁) ↔ F.homologySequenceδ T n₀ n₁ h = 0

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

CategoryTheory.Mono ((F.shift n₁).map T.mor₁) ↔ F.homologySequenceδ T n₀ n₁ h = 0


lemma sdiff_sdiff_sdiff_cancel_left (hca : z ≤ x) : (x \ y) \ (x \ z) = z \ y

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]
(hca : z ≤ x)


@[to_additive]
private lemma devosMulRel_iff :
    DevosMulRel x y ↔
      (x.1 * x.2).card < (y.1 * y.2).card ∨
        (x.1 * x.2).card = (y.1 * y.2).card ∧ y.1.card + y.2.card < x.1.card + x.2.card ∨
          (x.1 * x.2).card = (y.1 * y.2).card ∧
            x.1.card + x.2.card = y.1.card + y.2.card ∧ x.1.card < y.1.card

{α : Type u_1}
[AddGroup α]
[DecidableEq α]
{x y : Finset α × Finset α}

DevosAddRel x y ↔
  (x.1 + x.2).card < (y.1 + y.2).card ∨
    (x.1 + x.2).card = (y.1 + y.2).card ∧ y.1.card + y.2.card < x.1.card + x.2.card ∨
      (x.1 + x.2).card = (y.1 + y.2).card ∧ x.1.card + x.2.card = y.1.card + y.2.card ∧ x.1.card < y.1.card


theorem flip_surjective_iff₁ [FiniteDimensional K V₁] : Surjective B.flip ↔ Injective B

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
{V₂ : Type uV₂}
[AddCommGroup V₁]
[Module K V₁]
[AddCommGroup V₂]
[Module K V₂]
{B : V₁ →ₗ[K] V₂ →ₗ[K] K}
[FiniteDimensional K V₁]

Function.Surjective ⇑B.flip ↔ Function.Injective ⇑B


theorem ae_empty_or_univ_of_image_ae_le (hf : Ergodic f μ) (hs : MeasurableSet s)
    (hs' : f '' s ≤ᵐ[μ] s) : s =ᵐ[μ] (∅ : Set α) ∨ s =ᵐ[μ] univ

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
(hf : Ergodic f μ)
(hs : MeasurableSet s)
(hs' : f '' s ≤ᵐ[μ] s)


theorem preimage_coe_compl (s : Set α) : ((↑) : s → α) ⁻¹' sᶜ = ∅


lemma add_def (P Q : W.Point) : P + Q = P.add Q

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
(P Q : W.Point)


/-- To prove a relation on pairs of `Finset X`, it suffices to show that it is
  * symmetric,
  * it holds when one of the `Finset`s is empty,
  * it holds for pairs of singletons,
  * if it holds for `[a, c]` and for `[b, c]`, then it holds for `[a ∪ b, c]`.
-/
theorem induction_on_union (P : Finset α → Finset α → Prop) (symm : ∀ {a b}, P a b → P b a)
    (empty_right : ∀ {a}, P a ∅) (singletons : ∀ {a b}, P {a} {b})
    (union_of : ∀ {a b c}, P a c → P b c → P (a ∪ b) c) : ∀ a b, P a b

(symm : ∀ {a b : Finset α}, P a b → P b a)

(union_of : ∀ {a b c : Finset α}, P a c → P b c → P (a ∪ b) c)


theorem cthickening_eq_iInter_cthickening {δ : ℝ} (E : Set α) :
    cthickening δ E = ⋂ (ε : ℝ) (_ : δ < ε), cthickening ε E

{α : Type u}
[PseudoEMetricSpace α]
{δ : ℝ}
(E : Set α)

Metric.cthickening δ E = ⋂ ε, ⋂ (_ : δ < ε), Metric.cthickening ε E


theorem inv_three_add_inv_three : (3 : ℝ≥0∞)⁻¹ + 3⁻¹ + 3⁻¹ = 1


theorem submartingale_nat [IsFiniteMeasure μ] {f : ℕ → Ω → ℝ} (hadp : Adapted 𝒢 f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i, f i ≤ᵐ[μ] μ[f (i + 1)|𝒢 i]) :
    Submartingale f 𝒢 μ

{f : ℕ → Ω → ℝ}

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

(hf : ∀ (i : ℕ), f i ≤ᵐ[μ] μ[f (i + 1)|↑𝒢 i])


@[simp]
theorem piecewise_compl {s : Set α} (hs : MeasurableSet sᶜ) (f g : α →ₛ β) :
    piecewise sᶜ hs f g = piecewise s hs.of_compl g f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{s : Set α}
(hs : MeasurableSet sᶜ)
(f g : MeasureTheory.SimpleFunc α β)

MeasureTheory.SimpleFunc.piecewise sᶜ hs f g = MeasureTheory.SimpleFunc.piecewise s ⋯ g f


@[reassoc (attr := simp)]
lemma mapOfIsLimit_ι (kf : KernelFork f) {kf' : KernelFork f'} (hf' : IsLimit kf')
    (φ : Arrow.mk f ⟶ Arrow.mk f') :
    kf.mapOfIsLimit hf' φ ≫ kf'.ι = kf.ι ≫ φ.left

(kf : CategoryTheory.Limits.KernelFork f)

{kf' : CategoryTheory.Limits.KernelFork f'}

(hf' : CategoryTheory.Limits.IsLimit kf')

(φ : CategoryTheory.Arrow.mk f ⟶ CategoryTheory.Arrow.mk f')

kf.mapOfIsLimit hf' φ ≫ CategoryTheory.Limits.Fork.ι kf' = CategoryTheory.Limits.Fork.ι kf ≫ φ.left


theorem le_of_mem_argmax : a ∈ l → m ∈ argmax f l → f a ≤ f m

{α : Type u_1}
{β : Type u_2}
[LinearOrder β]
{f : α → β}
{l : List α}
{a m : α}


protected theorem leftOrdContinuous : LeftOrdContinuous e

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
(e : α ≃o β)


@[simp]
theorem eta : ∀ z : ℂ, Complex.mk z.re z.im = z


theorem iterateFrobenius_inj : Function.Injective (iterateFrobenius R p n)

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

Function.Injective ⇑(iterateFrobenius R p n)


theorem tendsto_atTop_add_left_of_le (C : β) (hf : ∀ x, C ≤ f x) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommGroup β]
(l : Filter α)
{f g : α → β}
(C : β)
(hf : ∀ (x : α), C ≤ f x)
(hg : Filter.Tendsto g l Filter.atTop)

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


theorem ord_proj_dvd (n p : ℕ) : ord_proj[p] n ∣ n


/-- Shows that $e^{aX} * e^{bX} = e^{(a + b)X}$ -/
theorem exp_mul_exp_eq_exp_add [Algebra ℚ A] (a b : A) :
    rescale a (exp A) * rescale b (exp A) = rescale (a + b) (exp A)

{A : Type u_1}
[CommRing A]
[Algebra ℚ A]
(a b : A)

(PowerSeries.rescale a) (PowerSeries.exp A) * (PowerSeries.rescale b) (PowerSeries.exp A) =
  (PowerSeries.rescale (a + b)) (PowerSeries.exp A)


/-- Given the existence of the appropriate (possibly finite) coproducts and coequalizers,
we know a colimit of `F` exists.
(This assumes the existence of all coequalizers, which is technically stronger than needed.)
-/
theorem hasColimit_of_coequalizer_and_coproduct (F : J ⥤ C) [HasColimit (Discrete.functor F.obj)]
    [HasColimit (Discrete.functor fun f : Σp : J × J, p.1 ⟶ p.2 => F.obj f.1.1)]
    [HasCoequalizers C] : HasColimit F

[CategoryTheory.Limits.HasColimit (CategoryTheory.Discrete.functor fun f => F.obj f.fst.1)]


@[simp]
theorem coyonedaEvaluation_map_down (P Q : C × (C ⥤ Type v₁)) (α : P ⟶ Q)
    (x : (coyonedaEvaluation C).obj P) :
    ((coyonedaEvaluation C).map α x).down = α.2.app Q.1 (P.2.map α.1 x.down)

(P Q : C × CategoryTheory.Functor C (Type v₁))

(x : (CategoryTheory.coyonedaEvaluation C).obj P)

((CategoryTheory.coyonedaEvaluation C).map α x).down = α.2.app Q.1 (P.2.map α.1 x.down)


/-- If `f` semiconjugates `ga` to `gb` and `f'` is both a left and a right inverse of `f`,
then `f'` semiconjugates `gb` to `ga`. -/
lemma inverse_left {f' : β → α} (h : Semiconj f ga gb)
    (hf₁ : LeftInverse f' f) (hf₂ : RightInverse f' f) : Semiconj f' gb ga

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{ga : α → α}
{gb : β → β}
{f' : β → α}
(h : Function.Semiconj f ga gb)
(hf₁ : Function.LeftInverse f' f)
(hf₂ : Function.RightInverse f' f)


theorem eventually_smallSets {p : Set α → Prop} :
    (∀ᶠ s in l.smallSets, p s) ↔ ∃ s ∈ l, ∀ t, t ⊆ s → p t

{α : Type u_1}
{l : Filter α}
{p : Set α → Prop}

(∀ᶠ (s : Set α) in l.smallSets, p s) ↔ ∃ s ∈ l, ∀ t ⊆ s, p t


theorem max_commutative : Commutative (max : α → α → α)


@[simp]
theorem iSup_eq_iUnion (s : ι → Set α) : iSup s = iUnion s

{α : Type u}
{ι : Sort v}
(s : ι → Set α)


/-- If a map `f : α → β` sends any two distinct points to point that are **not** related by a fixed
`s ∈ 𝓤 β`, then `f` is a uniform embedding with respect to the discrete uniformity on `α`. -/
theorem uniformEmbedding_of_spaced_out {α} {f : α → β} {s : Set (β × β)} (hs : s ∈ 𝓤 β)
    (hf : Pairwise fun x y => (f x, f y) ∉ s) : @UniformEmbedding α β ⊥ ‹_› f


/-- The short complex `L₀.X₂ ⟶ L₀.X₃ ⟶ L₃.X₁`. -/
@[simps]
noncomputable def L₁' : ShortComplex C

(S : CategoryTheory.ShortComplex.SnakeInput C)


/-- A module is a generalization of vector spaces to a scalar semiring.
  It consists of a scalar semiring `R` and an additive monoid of "vectors" `M`,
  connected by a "scalar multiplication" operation `r • x : M`
  (where `r : R` and `x : M`) with some natural associativity and
  distributivity axioms similar to those on a ring. -/
@[ext]
class Module (R : Type u) (M : Type v) [Semiring R] [AddCommMonoid M] extends
  DistribMulAction R M where
  /-- Scalar multiplication distributes over addition from the right. -/
  protected add_smul : ∀ (r s : R) (x : M), (r + s) • x = r • x + s • x
  /-- Scalar multiplication by zero gives zero. -/
  protected zero_smul : ∀ x : M, (0 : R) • x = 0

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[self : Module R M]
(x : M)


lemma isComplex₂_iff (S : ComposableArrows C 2) :
    S.IsComplex ↔ S.map' 0 1 ≫ S.map' 1 2 = 0

(S : CategoryTheory.ComposableArrows C 2)

S.IsComplex ↔ CategoryTheory.CategoryStruct.comp (S.map' 0 1 ⋯ ⋯) (S.map' 1 2 ⋯ ⋯) = 0


@[simp]
theorem antitoneOn_singleton : AntitoneOn f {a}

{α : Type u}
{β : Type v}
{a : α}
[Preorder α]
[Preorder β]
(f : α → β)


@[simp]
theorem eval_intCast {n : ℤ} {x : R} : (n : R[X]).eval x = n


theorem prod_alternatingWord_eq_prod_alternatingWord_sub (i i' : B) (m : ℕ) (hm : m ≤ M i i' * 2) :
    π (alternatingWord i i' m) = π (alternatingWord i' i (M i i' * 2 - m))

{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i i' : B)
(m : ℕ)
(hm : m ≤ M.M i i' * 2)

cs.wordProd (CoxeterSystem.alternatingWord i i' m) = cs.wordProd (CoxeterSystem.alternatingWord i' i (M.M i i' * 2 - m))


/-- A gluing datum consists of
1. An index type `J`
2. An object `U i` for each `i : J`.
3. An object `V i j` for each `i j : J`.
4. A monomorphism `f i j : V i j ⟶ U i` for each `i j : J`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : J`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. The pullback for `f i j` and `f i k` exists.
9. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
10. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.
-/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure GlueData where
  J : Type v
  U : J → C
  V : J × J → C
  f : ∀ i j, V (i, j) ⟶ U i
  f_mono : ∀ i j, Mono (f i j) := by infer_instance
  f_hasPullback : ∀ i j k, HasPullback (f i j) (f i k) := by infer_instance
  f_id : ∀ i, IsIso (f i i) := by infer_instance
  t : ∀ i j, V (i, j) ⟶ V (j, i)
  t_id : ∀ i, t i i = 𝟙 _
  t' : ∀ i j k, pullback (f i j) (f i k) ⟶ pullback (f j k) (f j i)
  t_fac : ∀ i j k, t' i j k ≫ pullback.snd _ _ = pullback.fst _ _ ≫ t i j
  cocycle : ∀ i j k, t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(self : CategoryTheory.GlueData C)
(i j k : self.J)

CategoryTheory.Limits.HasPullback (self.f i j) (self.f i k)


theorem borel_eq_generateFrom_Ioi : borel α = .generateFrom (range Ioi)

(α : Type u_1)
[TopologicalSpace α]
[SecondCountableTopology α]
[LinearOrder α]
[OrderTopology α]

borel α = MeasurableSpace.generateFrom (Set.range Set.Ioi)


theorem transReflReparamAux_zero : transReflReparamAux 0 = 0


/-- The identity strong natural transformation. -/
@[simps!]
def id : StrongOplaxNatTrans F F

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.OplaxFunctor B C)
(a : B)

(CategoryTheory.StrongOplaxNatTrans.id F).app a = CategoryTheory.CategoryStruct.id (F.obj a)


theorem IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocalizedModule S f] :
    IsLocalizedModule S (e ∘ₗ f : M →ₗ[R] M'')

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
{M'' : Type u_4}
[AddCommMonoid M]
[AddCommMonoid M']
[AddCommMonoid M'']
[Module R M]
[Module R M']
[Module R M'']
(f : M →ₗ[R] M')
(e : M' ≃ₗ[R] M'')
[hf : IsLocalizedModule S f]


/-- One of two vectors is zero or the oriented angle between them is plus or minus `π / 2` if
and only if the inner product of those vectors is zero. -/
theorem eq_zero_or_oangle_eq_iff_inner_eq_zero {x y : V} :
    x = 0 ∨ y = 0 ∨ o.oangle x y = (π / 2 : ℝ) ∨ o.oangle x y = (-π / 2 : ℝ) ↔ ⟪x, y⟫ = 0

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

x = 0 ∨ y = 0 ∨ o.oangle x y = ↑(π / 2) ∨ o.oangle x y = ↑(-π / 2) ↔ ⟪x, y⟫_ℝ = 0


/--
Explicit formula for `toCircle j`. Note that this is "evil" because it uses `ZMod.val`. Where
possible, it is recommended to lift `j` to `ℤ` and use `toCircle_intCast` instead.
-/
lemma toCircle_apply (j : ZMod N) :
    toCircle j = exp (2 * π * I * j.val / N)

↑(ZMod.toCircle j) = cexp (2 * ↑π * Complex.I * ↑j.val / ↑N)


protected lemma div_pos (hba : b ≤ a) (hb : 0 < b) : 0 < a / b


@[to_additive]
theorem isRegular_iff {c : R} : IsRegular c ↔ IsLeftRegular c ∧ IsRightRegular c

IsAddRegular c ↔ IsAddLeftRegular c ∧ IsAddRightRegular c


theorem iUnion_prod_of_monotone [SemilatticeSup α] {s : α → Set β} {t : α → Set γ} (hs : Monotone s)
    (ht : Monotone t) : ⋃ x, s x ×ˢ t x = (⋃ x, s x) ×ˢ ⋃ x, t x

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[SemilatticeSup α]
{s : α → Set β}
{t : α → Set γ}
(hs : Monotone s)
(ht : Monotone t)


/-- If a p-group acts on `α` and the cardinality of `α` is not a multiple
  of `p` then the action has a fixed point. -/
theorem nonempty_fixed_point_of_prime_not_dvd_card (hpα : ¬p ∣ Nat.card α) :
    (fixedPoints G α).Nonempty

{p : ℕ}
{G : Type u_1}
[Group G]
(hG : IsPGroup p G)
[hp : Fact (Nat.Prime p)]
(α : Type u_2)
[MulAction G α]
(hpα : ¬p ∣ Nat.card α)


theorem odd_mul_odd_div_two {m n : ℕ} (hm1 : m % 2 = 1) (hn1 : n % 2 = 1) :
    m * n / 2 = m * (n / 2) + m / 2


theorem eq_of_bisim (bisim : IsBisimulation R) {s₁ s₂} (r : s₁ ~ s₂) : s₁ = s₂

(R : Stream'.Seq α → Stream'.Seq α → Prop)


@[to_additive]
theorem isCompact (hf : HasCompactMulSupport f) : IsCompact (mulTSupport f)

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[Zero β]
{f : α → β}
(hf : HasCompactSupport f)


@[to_additive (attr := simp)]
lemma centralizer_centralizer_centralizer {s : Set M} :
    centralizer s.centralizer.centralizer = centralizer s

Submonoid.centralizer s.centralizer.centralizer = Submonoid.centralizer s


theorem sup_mono_fun {g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.sup f ≤ s.sup g

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s : Finset β}
{f g : β → α}
(h : ∀ b ∈ s, f b ≤ g b)


theorem clusterPt_iff_lift'_closure {F : Filter X} :
    ClusterPt x F ↔ pure x ≤ (F.lift' closure)

{X : Type u}
{x : X}
[TopologicalSpace X]
{F : Filter X}

ClusterPt x F ↔ pure x ≤ F.lift' closure


theorem U_eq_X_mul_U_add_T (n : ℤ) : U R (n + 1) = X * U R n + T R (n + 1)

Polynomial.Chebyshev.U R (n + 1) = Polynomial.X * Polynomial.Chebyshev.U R n + Polynomial.Chebyshev.T R (n + 1)


/-- A monoid `M` is finitely generated if and only if `MonoidAlgebra R M` is of finite type. -/
theorem finiteType_iff_fg [CommRing R] [Nontrivial R] :
    FiniteType R (MonoidAlgebra R M) ↔ Monoid.FG M

{R : Type u_1}
{M : Type u_2}
[Monoid M]
[CommRing R]
[Nontrivial R]

Algebra.FiniteType R (MonoidAlgebra R M) ↔ Monoid.FG M


{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.OplaxFunctor B C)

∀ {a b : B} (f : a ⟶ b),
  ((CategoryTheory.StrongOplaxNatTrans.id F).naturality f).inv =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor (F.map f)).hom
      (CategoryTheory.Bicategory.rightUnitor (F.map f)).inv


theorem iSup_coe [SupSet β] (f : α → β) (s : Finset α) : ⨆ x ∈ (↑s : Set α), f x = ⨆ x ∈ s, f x

{α : Type u_2}
{β : Type u_3}
[SupSet β]
(f : α → β)
(s : Finset α)


/-- This is the homology data for a short complex `S` that is obtained
from a left homology data `h₁` and a right homology data `h₂` when the comparison
morphism `leftRightHomologyComparison' h₁ h₂ : h₁.H ⟶ h₂.H` is an isomorphism. -/
@[simps]
noncomputable def ofIsIsoLeftRightHomologyComparison'
    (h₁ : S.LeftHomologyData) (h₂ : S.RightHomologyData)
    [IsIso (leftRightHomologyComparison' h₁ h₂)] :
    S.HomologyData

[CategoryTheory.IsIso (CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂)]

(CategoryTheory.ShortComplex.HomologyData.ofIsIsoLeftRightHomologyComparison' h₁ h₂).right = h₂


theorem span_image_eq_map_total (s : Set α) :
    span R (v '' s) = Submodule.map (Finsupp.total α M R v) (supported R R s)

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{v : α → M}
(s : Set α)

Submodule.span R (v '' s) = Submodule.map (Finsupp.total α M R v) (Finsupp.supported R R s)


theorem LE.le.exists_pred_iterate (h : a ≤ b) : ∃ n, pred^[n] b = a

{α : Type u_1}
[Preorder α]
[PredOrder α]
[IsPredArchimedean α]
{a b : α}
(h : a ≤ b)


theorem dist_smul_pair (x : α) (y₁ y₂ : β) : dist (x • y₁) (x • y₂) ≤ dist x 0 * dist y₁ y₂

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[Zero α]
[Zero β]
[SMul α β]
[BoundedSMul α β]
(x : α)
(y₁ y₂ : β)


theorem Kernel.measure_eq_zero_or_one_or_top_of_indepSet_self {t : Set Ω}
    (h_indep : Kernel.IndepSet t t κ μα) :
    ∀ᵐ a ∂μα, κ a t = 0 ∨ κ a t = 1 ∨ κ a t = ∞

(h_indep : ProbabilityTheory.Kernel.IndepSet t t κ μα)

∀ᵐ (a : α) ∂μα, (κ a) t = 0 ∨ (κ a) t = 1 ∨ (κ a) t = ⊤


/-- A right homology map data for a morphism of short complexes induces
a left homology map data in the opposite category. -/
@[simps]
def RightHomologyMapData.op {S₁ S₂ : ShortComplex C} {φ : S₁ ⟶ S₂}
    {h₁ : S₁.RightHomologyData} {h₂ : S₂.RightHomologyData}
    (ψ : RightHomologyMapData φ h₁ h₂) : LeftHomologyMapData (opMap φ) h₂.op h₁.op

(ψ : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂)


theorem diagonal_kroneckerTMul_diagonal [DecidableEq m] [DecidableEq n] (a : m → α) (b : n → α) :
    diagonal a ⊗ₖₜ[R] diagonal b = diagonal fun mn => a mn.1 ⊗ₜ b mn.2

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

Matrix.kroneckerMap (TensorProduct.tmul R) (Matrix.diagonal a) (Matrix.diagonal b) =
  Matrix.diagonal fun mn => a mn.1 ⊗ₜ[R] b mn.2


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `f'` is negative, then
`f` is a strictly antitone function on `D`. -/
theorem strictAntiOn_of_deriv_neg {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : ∀ x ∈ interior D, deriv f x < 0) : StrictAntiOn f D


theorem univ_supports (M : Machine₀) : Supports M Set.univ

{Γ : Type u_1}
{Λ : Type u_2}
[Inhabited Λ]
(M : Turing.TM0.Machine Γ Λ)


@[simp]
theorem preimage_cast_Ioi (q : ℚ) : (↑) ⁻¹' Ioi (q : K) = Ioi q

{K : Type u_5}
[LinearOrderedField K]
(q : ℚ)


@[simp]
theorem restrict_univ : κ.restrict MeasurableSet.univ = κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}


@[to_additive (attr := simp)]
theorem coe_top : ((⊤ : Subgroup G) : Set G) = Set.univ


@[simp]
theorem id_comp (f : α →+* β) : (id β).comp f = f

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), (RingHom.id β).comp f = f


/-- Every Yoneda-presheaf is a sheaf for the extensive topology. -/
theorem extensiveTopology.isSheaf_yoneda_obj (W : C) : Presieve.IsSheaf (extensiveTopology C)
    (yoneda.obj W)

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

CategoryTheory.Presieve.IsSheaf (CategoryTheory.extensiveTopology C) (CategoryTheory.yoneda.obj W)


theorem prod_X_sub_X_eq_sum_esymm (s : Multiset R) :
    (s.map fun t => X - C t).prod =
      ∑ j ∈ Finset.range (Multiset.card s + 1),
        (-1) ^ j * (C (s.esymm j) * X ^ (Multiset.card s - j))

{R : Type u_1}
[CommRing R]
(s : Multiset R)

(Multiset.map (fun t => Polynomial.X - Polynomial.C t) s).prod =
  ∑ j ∈ Finset.range (Multiset.card s + 1), (-1) ^ j * (Polynomial.C (s.esymm j) * Polynomial.X ^ (Multiset.card s - j))


@[to_additive]
theorem orderOf_eq_zero_iff' : orderOf x = 0 ↔ ∀ n : ℕ, 0 < n → x ^ n ≠ 1

orderOf x = 0 ↔ ∀ (n : ℕ), 0 < n → x ^ n ≠ 1


@[field_simps 1010]
theorem divp_sub_divp_same (a b : α) (u : αˣ) : a /ₚ u - b /ₚ u = (a - b) /ₚ u

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


@[simp]
theorem bliminf_sup_le_or_aux_left : blimsup u f p ≤ blimsup u f fun x => p x ∨ q x

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

Filter.blimsup u f p ≤ Filter.blimsup u f fun x => p x ∨ q x


/-- A sequence `φ` of subsets of `α` is a `MeasureTheory.AECover` w.r.t. a measure `μ` and a filter
    `l` if almost every point (w.r.t. `μ`) of `α` eventually belongs to `φ n` (w.r.t. `l`), and if
    each `φ n` is measurable.  This definition is a technical way to avoid duplicating a lot of
    proofs.  It should be thought of as a sufficient condition for being able to interpret
    `∫ x, f x ∂μ` (if it exists) as the limit of `∫ x in φ n, f x ∂μ` as `n` tends to `l`.

    See for example `MeasureTheory.AECover.lintegral_tendsto_of_countably_generated`,
    `MeasureTheory.AECover.integrable_of_integral_norm_tendsto` and
    `MeasureTheory.AECover.integral_tendsto_of_countably_generated`. -/
structure AECover (φ : ι → Set α) : Prop where
  ae_eventually_mem : ∀ᵐ x ∂μ, ∀ᶠ i in l, x ∈ φ i
  protected measurableSet : ∀ i, MeasurableSet <| φ i

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
{φ : ι → Set α}
(self : MeasureTheory.AECover μ l φ)
(i : ι)


@[simp]
lemma single₀_obj_zero (A : V) :
    ((single₀ V).obj A).X 0 = A

((ChainComplex.single₀ V).obj A).X 0 = A


@[simp]
theorem ack_lt_iff_left {m₁ m₂ n : ℕ} : ack m₁ n < ack m₂ n ↔ m₁ < m₂


/-- When the underlying functor `Φ.functor` of `Φ : LocalizerMorphism W₁ W₂` is
an equivalence of categories and that `W₁` and `W₂` essentially correspond to each
other via this equivalence, then `Φ` is a localized equivalence. -/
lemma IsLocalizedEquivalence.of_equivalence [Φ.functor.IsEquivalence]
    (h : W₂ ≤ W₁.map Φ.functor) : IsLocalizedEquivalence Φ

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)


theorem _root_.Batteries.RBNode.Ordered.zoom {t : RBNode α}
    (ht : t.Ordered cmp) (eq : t.zoom cut = (t', path')) :
    t'.Ordered cmp ∧ path'.Ordered cmp ∧ t'.All (path'.RootOrdered cmp) ∧ path'.Zoomed cut

(eq : Batteries.RBNode.zoom cut t = (t', path'))

Batteries.RBNode.Ordered cmp t' ∧
  Batteries.RBNode.Path.Ordered cmp path' ∧
    Batteries.RBNode.All (Batteries.RBNode.Path.RootOrdered cmp path') t' ∧ Batteries.RBNode.Path.Zoomed cut path'


/-- The functor `Γ₀' : ChainComplex C ℕ ⥤ SimplicialObject.Split C`
that induces `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`, which
shall be the inverse functor of the Dold-Kan equivalence for
abelian or pseudo-abelian categories. -/
@[simps]
def Γ₀' : ChainComplex C ℕ ⥤ SimplicialObject.Split C

(AlgebraicTopology.DoldKan.Γ₀'.map f).F = AlgebraicTopology.DoldKan.Γ₀.map f


lemma _root_.MeasureTheory.AEStronglyMeasurable.integral_condKernel
    (hf : AEStronglyMeasurable f ρ) :
    AEStronglyMeasurable (fun x ↦ ∫ y, f (x, y) ∂ρ.condKernel x) ρ.fst

(hf : MeasureTheory.AEStronglyMeasurable f ρ)

MeasureTheory.AEStronglyMeasurable (fun x => ∫ (y : Ω), f (x, y) ∂ρ.condKernel x) ρ.fst


theorem flip_flip_aux (A : BilinForm R M) :
    flipHomAux (M := M) (flipHomAux (M := M) A) = A

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

LinearMap.BilinForm.flipHomAux (LinearMap.BilinForm.flipHomAux A) = A


theorem rightInv_coeff (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) (n : ℕ) (hn : 2 ≤ n) :
    p.rightInv i n =
      -(i.symm : F →L[𝕜] E).compContinuousMultilinearMap
          (∑ c ∈ ({c | 1 < Composition.length c}.toFinset : Finset (Composition n)),
            p.compAlongComposition (p.rightInv i) c)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(i : E ≃L[𝕜] F)
(n : ℕ)
(hn : 2 ≤ n)

p.rightInv i n =
  -(↑i.symm).compContinuousMultilinearMap (∑ c ∈ {c | 1 < c.length}.toFinset, p.compAlongComposition (p.rightInv i) c)


/-- A map from the vertex of a cocone naturally induces a cocone by composition. -/
@[simps]
def extensions (c : Cocone F) : coyoneda.obj (op c.pt) ⋙ uliftFunctor.{u₁} ⟶ F.cocones

(f : (CategoryTheory.coyoneda.obj (Opposite.op c.pt) ⋙ CategoryTheory.uliftFunctor.{u₁, v₃}).obj X)

c.extensions.app X f = c.ι ≫ (CategoryTheory.Functor.const J).map f.down


lemma even_or_odd (n : ℕ) : Even n ∨ Odd n


/-- If `l : Filter ℂ` is an "exponential comparison filter", then for any complex `a` and any
negative real `b`, we have `(fun z ↦ exp (b * z)) =o[l] (fun z ↦ z ^ a)`. -/
theorem isLittleO_exp_cpow (hl : IsExpCmpFilter l) (a : ℂ) {b : ℝ} (hb : b < 0) :
    (fun z => exp (b * z)) =o[l] fun z => z ^ a

{l : Filter ℂ}
(hl : Complex.IsExpCmpFilter l)
(a : ℂ)
{b : ℝ}
(hb : b < 0)

(fun z => Complex.exp (↑b * z)) =o[l] fun z => z ^ a


@[simp]
theorem mem_comap {S : L.Substructure N} {f : M →[L] N} {x : M} : x ∈ S.comap f ↔ f x ∈ S

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{S : L.Substructure N}
{f : L.Hom M N}
{x : M}

x ∈ FirstOrder.Language.Substructure.comap f S ↔ f x ∈ S


@[to_additive addIndex_elim]
theorem index_elim {K V : Set G} (hK : IsCompact K) (hV : (interior V).Nonempty) :
    ∃ t : Finset G, (K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V) ∧ Finset.card t = index K V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
{K V : Set G}
(hK : IsCompact K)
(hV : (interior V).Nonempty)

∃ t, K ⊆ ⋃ g ∈ t, (fun h => g + h) ⁻¹' V ∧ t.card = MeasureTheory.Measure.haar.addIndex K V


theorem of_apply_eq_base (i : ι) (x : H) : of i (φ i x) = base φ x

{ι : Type u_1}
{G : ι → Type u_2}
{H : Type u_3}
[(i : ι) → Monoid (G i)]
[Monoid H]
(φ : (i : ι) → H →* G i)
(i : ι)
(x : H)

(Monoid.PushoutI.of i) ((φ i) x) = (Monoid.PushoutI.base φ) x


theorem ker_dualMap_eq_dualAnnihilator_range :
    LinearMap.ker f.dualMap = f.range.dualAnnihilator

{R : Type uR}
[CommSemiring R]
{M₁ : Type uM₁}
{M₂ : Type uM₂}
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
(f : M₁ →ₗ[R] M₂)

LinearMap.ker f.dualMap = (LinearMap.range f).dualAnnihilator


theorem comp_memℒp (L : E →L[𝕜] F) (f : Lp E p μ) : Memℒp (L ∘ f) p μ

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{𝕜 : Type u_5}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
(L : E →L[𝕜] F)
(f : ↥(MeasureTheory.Lp E p μ))


/-- Extract the isomorphism between the left objects from an isomorphism in the comma category. -/
@[simps!]
def leftIso {X Y : Comma L₁ R₁} (α : X ≅ Y) : X.left ≅ Y.left

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{L₁ : CategoryTheory.Functor A T}
{R₁ : CategoryTheory.Functor B T}
{X Y : CategoryTheory.Comma L₁ R₁}
(α : X ≅ Y)

(CategoryTheory.Comma.leftIso α).hom = α.hom.left


@[simp]
theorem map_comp (P : PresheafOfModules R) {X Y Z : Cᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) :
    P.map (f ≫ g) = (P.map g).comp (P.map f)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
(P : PresheafOfModules R)
{X Y Z : Cᵒᵖ}
(f : X ⟶ Y)
(g : Y ⟶ Z)


/-- If `gcd a (m * n) = 1`, then `gcd a m = 1`. -/
theorem gcd_eq_one_of_gcd_mul_right_eq_one_left {a : ℤ} {m n : ℕ} (h : a.gcd (m * n) = 1) :
    a.gcd m = 1


lemma toClass_injective : Function.Injective <| @toClass _ _ W

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}


@[simp] theorem mapsTo_empty_iff : MapsTo f s ∅ ↔ s = ∅

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


@[simp]
theorem liftCover_coe {i : ι} (x : S i) : liftCover S f hf hS x = f i x

{hf : ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩}


theorem lintegral_mono_ae {f g : α → ℝ≥0∞} (h : ∀ᵐ a ∂μ, f a ≤ g a) :
    ∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
(h : ∀ᵐ (a : α) ∂μ, f a ≤ g a)


@[simp]
lemma mulShift_one (ψ : AddChar R M) : mulShift ψ 1 = ψ

{R : Type u_1}
{M : Type u_2}
[Ring R]
[CommMonoid M]
(ψ : AddChar R M)


lemma sum_card_fiberwise_eq_card_filter {κ : Type*} [DecidableEq κ] (s : Finset ι) (t : Finset κ)
    (g : ι → κ) : ∑ j ∈ t, (s.filter fun i ↦ g i = j).card = (s.filter fun i ↦ g i ∈ t).card

{ι : Type u_1}
{κ : Type u_6}
[DecidableEq κ]
(s : Finset ι)
(t : Finset κ)
(g : ι → κ)

∑ j ∈ t, (Finset.filter (fun i => g i = j) s).card = (Finset.filter (fun i => g i ∈ t) s).card


/-- The oriented angle at `p` between two points not equal to `p` is plus or minus the unoriented
angle. -/
theorem oangle_eq_angle_or_eq_neg_angle {p p₁ p₂ : P} (hp₁ : p₁ ≠ p) (hp₂ : p₂ ≠ p) :
    ∡ p₁ p p₂ = ∠ p₁ p p₂ ∨ ∡ p₁ p p₂ = -∠ p₁ p p₂

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

∡ p₁ p p₂ = ↑(∠ p₁ p p₂) ∨ ∡ p₁ p p₂ = -↑(∠ p₁ p p₂)


lemma isConnected_iff_of_equivalence {K : Type u₂} [Category.{v₂} K] (e : J ≌ K) :
    IsConnected J ↔ IsConnected K

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
(e : J ≌ K)

CategoryTheory.IsConnected J ↔ CategoryTheory.IsConnected K


@[to_additive FreeAddGroup.eqvGen_step_iff_join_red]
theorem eqvGen_step_iff_join_red : EqvGen Red.Step L₁ L₂ ↔ Join Red L₁ L₂

EqvGen FreeGroup.Red.Step L₁ L₂ ↔ Relation.Join FreeGroup.Red L₁ L₂


theorem image_upperBounds_subset_lowerBounds_image (Hf : AntitoneOn f t) (Hst : s ⊆ t) :
    f '' (upperBounds s ∩ t) ⊆ lowerBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
(Hf : AntitoneOn f t)
(Hst : s ⊆ t)


theorem X_eq_normalize : (X : Polynomial R) = normalize X

{R : Type u}
[CommRing R]
[IsDomain R]
[NormalizationMonoid R]


/-- The sum of `x ^ i` as `x` ranges over a finite field of cardinality `q`
is equal to `0` if `i < q - 1`. -/
theorem sum_pow_lt_card_sub_one (i : ℕ) (h : i < q - 1) : ∑ x : K, x ^ i = 0

(K : Type u_1)
[Field K]
[Fintype K]
(i : ℕ)
(h : i < q - 1)


theorem disjoint_sdiff_self_left : Disjoint (y \ x) x

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


/-- If the real valued function `f` is bounded almost everywhere by `R`, then so is its conditional
expectation. -/
theorem ae_bdd_condexp_of_ae_bdd {R : ℝ≥0} {f : α → ℝ} (hbdd : ∀ᵐ x ∂μ, |f x| ≤ R) :
    ∀ᵐ x ∂μ, |(μ[f|m]) x| ≤ R

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{R : ℝ≥0}
{f : α → ℝ}
(hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R)


@[to_additive (attr := simp)] lemma antivary_inv_right : Antivary f g⁻¹ ↔ Monovary f g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{f : ι → α}
{g : ι → β}


theorem integral_sin_pow_aux :
    (∫ x in a..b, sin x ^ (n + 2)) =
      (sin a ^ (n + 1) * cos a - sin b ^ (n + 1) * cos b + (↑n + 1) * ∫ x in a..b, sin x ^ n) -
        (↑n + 1) * ∫ x in a..b, sin x ^ (n + 2)

∫ (x : ℝ) in a..b, Real.sin x ^ (n + 2) =
  (Real.sin a ^ (n + 1) * Real.cos a - Real.sin b ^ (n + 1) * Real.cos b +
      (↑n + 1) * ∫ (x : ℝ) in a..b, Real.sin x ^ n) -
    (↑n + 1) * ∫ (x : ℝ) in a..b, Real.sin x ^ (n + 2)


lemma isUpperSet_of_isOpen : IsOpen s → IsUpperSet s

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


@[simp]
theorem toNNRat_lt_toNNRat_iff' : toNNRat q < toNNRat p ↔ q < p ∧ 0 < p


lemma Measurable.or (hp : Measurable p) (hq : Measurable q) : Measurable fun a ↦ p a ∨ q a

{α : Type u_1}
[MeasurableSpace α]
{p q : α → Prop}
(hp : Measurable p)
(hq : Measurable q)


@[simp, norm_cast]
theorem coe_C (a : R) : ((C a : R[X]) : PowerSeries R) = PowerSeries.C R a


theorem ext_iff {φ₁ φ₂ : A →ₐ[R] B} : φ₁ = φ₂ ↔ ∀ x, φ₁ x = φ₂ x

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
{φ₁ φ₂ : A →ₐ[R] B}

φ₁ = φ₂ ↔ ∀ (x : A), φ₁ x = φ₂ x


theorem cons_left_injective (x : ∀ i : Fin n, α i.succ) : Function.Injective fun x₀ ↦ cons x₀ x

{n : ℕ}
{α : Fin (n + 1) → Type u}
(x : (i : Fin n) → α i.succ)

Function.Injective fun x₀ => Fin.cons x₀ x


theorem Integrable.ofReal {f : α → ℝ} (hf : Integrable f μ) :
    Integrable (fun x => (f x : 𝕜)) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{𝕜 : Type u_5}
[RCLike 𝕜]
{f : α → ℝ}
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (fun x => ↑(f x)) μ


/-- A non-empty directed union of ideals of sets in a preorder is an ideal. -/
lemma isIdeal_sUnion_of_directedOn {C : Set (Set P)} (hidl : ∀ I ∈ C, IsIdeal I)
    (hD : DirectedOn (· ⊆ ·) C) (hNe : C.Nonempty) : IsIdeal C.sUnion

(hD : DirectedOn (fun x x_1 => x ⊆ x_1) C)


@[to_additive]
theorem one_def [One β] : (1 : α →ₘ[μ] β) = mk (fun _ : α => 1) aestronglyMeasurable_const

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[Zero β]

0 = MeasureTheory.AEEqFun.mk (fun x => 0) ⋯


/-- The sine of an angle in a right-angled triangle multiplied by the hypotenuse equals the
opposite side. -/
theorem sin_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : Real.Angle.sin (o.oangle x (x + y)) * ‖x + y‖ = ‖y‖

(o.oangle x (x + y)).sin * ‖x + y‖ = ‖y‖


@[simp]
theorem mem_zeroLocus (x : ProjectiveSpectrum 𝒜) (s : Set A) :
    x ∈ zeroLocus 𝒜 s ↔ s ⊆ x.asHomogeneousIdeal

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(x : ProjectiveSpectrum 𝒜)
(s : Set A)

x ∈ ProjectiveSpectrum.zeroLocus 𝒜 s ↔ s ⊆ ↑x.asHomogeneousIdeal


@[simp]
theorem mapAlgHom_comp (C : Type z) [Semiring C] [Algebra R C] (f : B →ₐ[R] C) (g : A →ₐ[R] B) :
    (mapAlgHom f).comp (mapAlgHom g) = mapAlgHom (f.comp g)

{R : Type u}
{A : Type z}
{B : Type u_2}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(C : Type z)
[Semiring C]
[Algebra R C]
(f : B →ₐ[R] C)
(g : A →ₐ[R] B)

(Polynomial.mapAlgHom f).comp (Polynomial.mapAlgHom g) = Polynomial.mapAlgHom (f.comp g)


theorem comap_of_injective {H : Subgroup G} (hH : IsPGroup p H) {K : Type*} [Group K] (ϕ : K →* G)
    (hϕ : Function.Injective ϕ) : IsPGroup p (H.comap ϕ)

{p : ℕ}
{G : Type u_1}
[Group G]
{H : Subgroup G}
(hH : IsPGroup p ↥H)
{K : Type u_2}
[Group K]
(ϕ : K →* G)
(hϕ : Function.Injective ⇑ϕ)


/-- Given an action `μ` of a Type `M` on a Type `N` and a relation `r` on `N`, informally, the
`ContravariantClass` says that "if the result of the action `μ` on a pair satisfies the
relation `r`, then the initial pair satisfied the relation `r`."

More precisely, the `ContravariantClass` is a class taking two Types `M N`, together with an
"action" `μ : M → N → N` and a relation `r : N → N → Prop`.  Its unique field `elim` is the
assertion that for all `m ∈ M` and all elements `n₁, n₂ ∈ N`, if the relation `r` holds for the
pair `(μ m n₁, μ m n₂)` obtained from `(n₁, n₂)` by acting upon it by `m`, then, the relation
`r` also holds for the pair `(n₁, n₂)`.

If `m : M` and `h : r (μ m n₁) (μ m n₂)`, then `ContravariantClass.elim m h : r n₁ n₂`.
-/
class ContravariantClass : Prop where
  /-- For all `m ∈ M` and all elements `n₁, n₂ ∈ N`, if the relation `r` holds for the
  pair `(μ m n₁, μ m n₂)` obtained from `(n₁, n₂)` by acting upon it by `m`, then, the relation
  `r` also holds for the pair `(n₁, n₂)`. -/
  protected elim : Contravariant M N μ r

{M : Type u_1}
{N : Type u_2}
{μ : M → N → N}
{r : N → N → Prop}
[self : ContravariantClass M N μ r]


lemma hurwitzZetaEven_def_of_ne_or_ne {a : UnitAddCircle} {s : ℂ} (h : a ≠ 0 ∨ s ≠ 0) :
    hurwitzZetaEven a s = completedHurwitzZetaEven a s / Gammaℝ s

HurwitzZeta.hurwitzZetaEven a s = HurwitzZeta.completedHurwitzZetaEven a s / s.Gammaℝ


@[to_additive add_const]
theorem AntitoneOn.mul_const' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : AntitoneOn f s)
    (a : α) :
    AntitoneOn (fun x => f x * a) s

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


@[to_additive]
theorem prod_eq_prod_iff_of_le {f g : ι → M} (h : ∀ i ∈ s, f i ≤ g i) :
    ((∏ i ∈ s, f i) = ∏ i ∈ s, g i) ↔ ∀ i ∈ s, f i = g i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{s : Finset ι}
{f g : ι → M}
(h : ∀ i ∈ s, f i ≤ g i)

∏ i ∈ s, f i = ∏ i ∈ s, g i ↔ ∀ i ∈ s, f i = g i


@[to_additive]
theorem intro [R1Space α] {K : Set α} (hK : IsCompact K)
    (hfK : ∀ x, x ∉ K → f x = 1) : HasCompactMulSupport f

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[One β]
{f : α → β}
[R1Space α]
{K : Set α}
(hK : IsCompact K)
(hfK : ∀ x ∉ K, f x = 1)


@[to_additive (attr := ext)]
theorem RightCancelMonoid.ext {M : Type u} ⦃m₁ m₂ : RightCancelMonoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M))  :
    m₁ = m₂

{M : Type u}
⦃m₁ m₂ : AddRightCancelMonoid M⦄
(h_mul : HAdd.hAdd = HAdd.hAdd)


theorem openEmbedding_iff_openEmbedding_of_iSup_eq_top (h : Continuous f) :
    OpenEmbedding f ↔ ∀ i, OpenEmbedding ((U i).1.restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{ι : Type u_3}
{U : ι → TopologicalSpace.Opens β}
(hU : iSup U = ⊤)
(h : Continuous f)

OpenEmbedding f ↔ ∀ (i : ι), OpenEmbedding ((U i).carrier.restrictPreimage f)


@[nolint unusedHavesSuffices]
theorem inv_zero : ∀ n : ℕ, (0 : ZMod n)⁻¹ = 0


@[simp, norm_cast]
theorem coe_sort_coe (s : Finset α) : ((s : Set α) : Sort _) = s


/-- Converting an augmented cosimplicial object to an augmented simplicial
object and back is isomorphic to the given object. -/
@[simps!]
def CosimplicialObject.Augmented.leftOpRightOpIso (X : CosimplicialObject.Augmented Cᵒᵖ) :
    X.leftOp.rightOp ≅ X

(X : CategoryTheory.CosimplicialObject.Augmented Cᵒᵖ)


theorem affine_isIntegral_iff (R : CommRingCat) :
    IsIntegral (Spec R) ↔ IsDomain R

AlgebraicGeometry.IsIntegral (AlgebraicGeometry.Spec R) ↔ IsDomain ↑R


@[simp]
theorem coe_toSmoothPartitionOfUnity (f : BumpCovering ι M s) (hf : ∀ i, Smooth I 𝓘(ℝ) (f i))
    (i : ι) : ⇑(f.toSmoothPartitionOfUnity hf i) = f.toPartitionOfUnity i

(hf : ∀ (i : ι), Smooth I 𝓘(ℝ, ℝ) ⇑(f i))

⇑((f.toSmoothPartitionOfUnity hf) i) = ⇑(f.toPartitionOfUnity i)


theorem two_zsmul_neg_pi_div_two : (2 : ℤ) • (↑(-π / 2) : Angle) = π


/-- If two lifts of circle homeomorphisms have the same translation number, then they are
semiconjugate by a `CircleDeg1Lift`. This version uses assumptions `bijective f₁` and
`bijective f₂` to assume that `f₁` and `f₂` are homeomorphisms. -/
theorem semiconj_of_bijective_of_translationNumber_eq {f₁ f₂ : CircleDeg1Lift} (h₁ : Bijective f₁)
    (h₂ : Bijective f₂) (h : τ f₁ = τ f₂) : ∃ F : CircleDeg1Lift, Semiconj F f₁ f₂

(h : f₁.translationNumber = f₂.translationNumber)


@[simp]
theorem preimage_top {s : Set β} (h : Set.Nonempty s) :
    (⊤ : Rel α β).preimage s = Set.univ

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


@[simp]
theorem hsum_embDomain : (s.embDomain f).hsum = s.hsum

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
{β : Type u_4}
(s : HahnSeries.SummableFamily Γ R α)
(f : α ↪ β)


/-- The set in the definition of `log` is nonempty. -/
theorem log_nonempty {b x : Ordinal} (h : 1 < b) : { o : Ordinal | x < b ^ o }.Nonempty


@[simp]
theorem cross_anticomm' (v w : Fin 3 → R) : v ×₃ w + w ×₃ v = 0

{R : Type u_1}
[CommRing R]
(v w : Fin 3 → R)

(crossProduct v) w + (crossProduct w) v = 0


theorem iInf_empty [IsEmpty ι] (f : ι → ℝ≥0) : ⨅ i, f i = 0

{ι : Sort u_1}
[IsEmpty ι]
(f : ι → ℝ≥0)


/-- The box product is associative up to isomorphism. `Equiv.prodAssoc` as a graph isomorphism. -/
@[simps!]
def boxProdAssoc (I : SimpleGraph γ) : G □ H □ I ≃g G □ (H □ I)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(G : SimpleGraph α)
(H : SimpleGraph β)
(I : SimpleGraph γ)
(p : (α × β) × γ)

(G.boxProdAssoc H I) p = (p.1.1, p.1.2, p.2)


@[to_additive]
theorem mem_iInf {ι : Sort*} {S : ι → Subgroup G} {x : G} : (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{G : Type u_1}
[AddGroup G]
{ι : Sort u_5}
{S : ι → AddSubgroup G}
{x : G}


@[simp] theorem mkInductiveAux₂_zero :
    mkInductiveAux₂ e zero comm_zero one comm_one succ 0 =
      ⟨0, zero ≫ (Q.xPrevIso rfl).inv, mkInductiveAux₂.proof_2 e zero comm_zero⟩

(comm_one : e.f 1 = P.d 1 0 ≫ zero + one ≫ Q.d 2 1)

Homotopy.mkInductiveAux₂ e zero comm_zero one comm_one succ 0 = ⟨0, ⟨zero ≫ (HomologicalComplex.xPrevIso Q ⋯).inv, ⋯⟩⟩


@[simp]
theorem natDegree_C_mul_X_pow (n : ℕ) (a : R) (ha : a ≠ 0) : natDegree (C a * X ^ n) = n

{R : Type u}
[Semiring R]
(n : ℕ)
(a : R)
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X ^ n).natDegree = n


@[simp] theorem induction_succ {motive : Fin (n + 1) → Sort _} (zero : motive 0)
    (succ : ∀ i : Fin n, motive (castSucc i) → motive i.succ) (i : Fin n) :
    induction (motive := motive) zero succ i.succ = succ i (induction zero succ (castSucc i))

(succ : (i : Fin n) → motive i.castSucc → motive i.succ)

Fin.induction zero succ i.succ = succ i (Fin.induction zero succ i.castSucc)


theorem head_le_of_mem {s : CompositionSeries X} {x : X} (hx : x ∈ s) : s.head ≤ x

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s : CompositionSeries X}
{x : X}
(hx : x ∈ s)


/-- The forgetful braided functor from a full braided subcategory into the original category
("forgetting" the condition).
-/
@[simps!]
def fullBraidedSubcategoryInclusion : BraidedFunctor (FullSubcategory P) C

∀ {X Y : CategoryTheory.InducedCategory C CategoryTheory.FullSubcategory.obj} (f : X ⟶ Y),
  (CategoryTheory.MonoidalCategory.fullBraidedSubcategoryInclusion P).map f = f


lemma EquicontinuousWithinAt.mono {F : ι → X → α} {x₀ : X} {S T : Set X}
    (H : EquicontinuousWithinAt F T x₀) (hST : S ⊆ T) : EquicontinuousWithinAt F S x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
{x₀ : X}
{S T : Set X}
(H : EquicontinuousWithinAt F T x₀)
(hST : S ⊆ T)


@[simp] lemma Polynomial.coe_toLaurentAlg [CommSemiring R] :
    (toLaurentAlg : R[X] → R[T;T⁻¹]) = toLaurent


@[to_additive]
protected theorem MulHom.map_mul [Mul M] [Mul N] (f : M →ₙ* N) (a b : M) : f (a * b) = f a * f b

{M : Type u_4}
{N : Type u_5}
[Mul M]
[Mul N]
(f : M →ₙ* N)
(a b : M)


/-- A function `f : α → (ι → ℝ)` which is `K`-Lipschitz on a subset `s` admits a `K`-Lipschitz
extension to the whole space. The same result for the space `ℓ^∞ (ι, ℝ)` over a possibly infinite
type `ι` is implemented in `LipschitzOnWith.extend_lp_infty`. -/
theorem LipschitzOnWith.extend_pi [Fintype ι] {f : α → ι → ℝ} {s : Set α}
    {K : ℝ≥0} (hf : LipschitzOnWith K f s) : ∃ g : α → ι → ℝ, LipschitzWith K g ∧ EqOn f g s

{α : Type u}
{ι : Type x}
[PseudoMetricSpace α]
[Fintype ι]
{f : α → ι → ℝ}
{s : Set α}
{K : ℝ≥0}
(hf : LipschitzOnWith K f s)


theorem IsLittleO.inv_rev {f : α → 𝕜} {g : α → 𝕜'} (h : f =o[l] g)
    (h₀ : ∀ᶠ x in l, f x = 0 → g x = 0) : (fun x => (g x)⁻¹) =o[l] fun x => (f x)⁻¹

(h₀ : ∀ᶠ (x : α) in l, f x = 0 → g x = 0)


theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l)
    (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y

∀ {α : Type u_1} {l : List α} {R : α → α → Prop},
  (∀ (x : α), x ∈ l → R x x) →
    List.Pairwise R l → List.Pairwise (flip R) l → ∀ ⦃x : α⦄, x ∈ l → ∀ ⦃y : α⦄, y ∈ l → R x y


theorem ne_top_of_lt {x y : PartENat} (h : x < y) : x ≠ ⊤


/-- Evaluation on an object `X` gives a functor
`PresheafOfModules R ⥤ ModuleCat (R.obj X)`. -/
@[simps]
def evaluation (X : Cᵒᵖ) : PresheafOfModules.{v} R ⥤ ModuleCat (R.obj X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(R : Cᵒᵖ ⥤ RingCat)
(X : Cᵒᵖ)

∀ {X_1 Y : PresheafOfModules R} (f : X_1 ⟶ Y), (PresheafOfModules.evaluation R X).map f = PresheafOfModules.Hom.app f X


protected theorem lt_add_of_pos_left (a : Int) {b : Int} (h : 0 < b) : a < b + a


@[simp] theorem coe_neg_ball {r : ℝ} (v : ball (0 : E) r) : ↑(-v) = (-v : E)

{E : Type u_1}
[i : SeminormedAddCommGroup E]
{r : ℝ}
(v : ↑(Metric.ball 0 r))


/-- A version of `exists_idempotent_of_compact_t2_of_continuous_mul_left` where the idempotent lies
in some specified nonempty compact subsemigroup. -/
@[to_additive exists_idempotent_in_compact_add_subsemigroup
      "A version of
      `exists_idempotent_of_compact_t2_of_continuous_add_left` where the idempotent lies in
      some specified nonempty compact additive subsemigroup."]
theorem exists_idempotent_in_compact_subsemigroup {M} [Semigroup M] [TopologicalSpace M] [T2Space M]
    (continuous_mul_left : ∀ r : M, Continuous (· * r)) (s : Set M) (snemp : s.Nonempty)
    (s_compact : IsCompact s) (s_add : ∀ᵉ (x ∈ s) (y ∈ s), x * y ∈ s) :
    ∃ m ∈ s, m * m = m

(continuous_mul_left : ∀ (r : M), Continuous fun x => x * r)


@[to_additive (attr := simp)]
theorem mulIndicator_self_mul_compl_apply (s : Set α) (f : α → M) (a : α) :
    mulIndicator s f a * mulIndicator sᶜ f a = f a

{α : Type u_1}
{M : Type u_4}
[MulOneClass M]
(s : Set α)
(f : α → M)
(a : α)

s.mulIndicator f a * sᶜ.mulIndicator f a = f a


@[simp]
theorem moebius_apply_of_squarefree {n : ℕ} (h : Squarefree n) : μ n = (-1) ^ cardFactors n

ArithmeticFunction.moebius n = (-1) ^ ArithmeticFunction.cardFactors n


lemma r_lower_bound_on_verticalStrip {A B : ℝ} (h : 0 < B) (hz : z ∈ verticalStrip A B) :
    r ⟨⟨A, B⟩, h⟩ ≤ r z

(hz : z ∈ UpperHalfPlane.verticalStrip A B)

EisensteinSeries.r ⟨{ re := A, im := B }, h⟩ ≤ EisensteinSeries.r z


lemma map_eq (h : AreEqualizedByLocalization W f g) (L : C ⥤ D) [L.IsLocalization W] :
    L.map f = L.map g

(h : CategoryTheory.AreEqualizedByLocalization W f g)


@[to_additive (attr := simp)]
theorem coe_mk (f : α →* β) (h) : (OrderMonoidHom.mk f h : α → β) = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulOneClass α]
[MulOneClass β]
(f : α →* β)
(h : Monotone (↑f).toFun)

⇑{ toMonoidHom := f, monotone' := h } = ⇑f


nonrec theorem IsLocalMinOn.neg (hf : IsLocalMinOn f s a) : IsLocalMaxOn (fun x => -f x) s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
{s : Set α}
(hf : IsLocalMinOn f s a)


lemma exists_isNilRegular_of_finrank_le_card (h : finrank R M ≤ #R) :
    ∃ x : L, IsNilRegular φ x

(h : ↑(FiniteDimensional.finrank R M) ≤ Cardinal.mk R)


theorem tendsto_abv_aeval_atTop {R A k α : Type*} [CommSemiring R] [Ring A] [Algebra R A]
    [LinearOrderedField k] (abv : A → k) [IsAbsoluteValue abv] (p : R[X]) (hd : 0 < degree p)
    (h₀ : algebraMap R A p.leadingCoeff ≠ 0) {l : Filter α} {z : α → A}
    (hz : Tendsto (abv ∘ z) l atTop) : Tendsto (fun x => abv (aeval (z x) p)) l atTop

(h₀ : (algebraMap R A) p.leadingCoeff ≠ 0)

(hz : Filter.Tendsto (abv ∘ z) l Filter.atTop)

Filter.Tendsto (fun x => abv ((Polynomial.aeval (z x)) p)) l Filter.atTop


@[to_additive]
theorem smooth_pow : ∀ n : ℕ, Smooth I I fun a : G => a ^ n

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Monoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
(n : ℕ)


/-- The trivial embedding from an empty preorder to another preorder -/
@[simps] def ofIsEmpty [IsEmpty α] : α ↪o β

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[IsEmpty α]
(a : α)

OrderEmbedding.ofIsEmpty a = isEmptyElim a


@[to_additive]
theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α}
    (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b))

(h : Filter.Tendsto (fun k => f k) l (𝓝 c))

Filter.Tendsto (fun k => f k + b) l (𝓝 (c + b))


theorem basicOpen_zero (X : LocallyRingedSpace.{u}) (U : Opens X.carrier) :
    X.toRingedSpace.basicOpen (0 : X.presheaf.obj <| op U) = ⊥

(U : TopologicalSpace.Opens ↑↑X.toPresheafedSpace)


@[simp]
theorem toAList_keys_toFinset [DecidableEq α] (f : α →₀ M) :
    f.toAList.keys.toFinset = f.support

{α : Type u_1}
{M : Type u_2}
[Zero M]
[DecidableEq α]
(f : α →₀ M)


@[simp] lemma supClosure_prod (s : Set α) (t : Set β) :
    supClosure (s ×ˢ t) = supClosure s ×ˢ supClosure t

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[SemilatticeSup β]
(s : Set α)
(t : Set β)


protected lemma _root_.MeasurableSet.everywherePosSubset [OpensMeasurableSpace α]
    (hs : MeasurableSet s) :
    MeasurableSet (μ.everywherePosSubset s)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
[OpensMeasurableSpace α]
(hs : MeasurableSet s)


theorem l_eq {x : α} {z : β} : l x = z ↔ ∀ y, z ≤ y ↔ x ≤ u y

{α : Type u}
{β : Type v}
[Preorder α]
[PartialOrder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{x : α}
{z : β}


/-- To construct an isomorphism between coforks,
it suffices to give an isomorphism between the cocone points
and check that it commutes with the `π` morphisms.
-/
@[simps]
def Cofork.ext {s t : Cofork f g} (i : s.pt ≅ t.pt) (w : s.π ≫ i.hom = t.π := by aesop_cat) :
    s ≅ t

{s t : CategoryTheory.Limits.Cofork f g}

(w : CategoryTheory.CategoryStruct.comp s.π i.hom = t.π := by aesop_cat)

(CategoryTheory.Limits.Cofork.ext i w).hom = CategoryTheory.Limits.Cofork.mkHom i.hom w


@[simp]
theorem of_apply (x : M) (n : ℕ) : (of I M x).1 n = mkQ (I ^ n • ⊤ : Submodule R M) x

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

↑((AdicCompletion.of I M) x) n = (I ^ n • ⊤).mkQ x


/-- The equivalence of categories `(J → C) ≌ (Discrete J ⥤ C)`. -/
@[simps]
def piEquivalenceFunctorDiscrete (J : Type u₂) (C : Type u₁) [Category.{v₁} C] :
    (J → C) ≌ (Discrete J ⥤ C)

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

∀ {X Y : CategoryTheory.Functor (CategoryTheory.Discrete J) C} (f : X ⟶ Y) (j : J),
  (CategoryTheory.piEquivalenceFunctorDiscrete J C).inverse.map f j = f.app { as := j }


@[to_additive]
theorem quot_mk_assoc (x y z : α) : Quot.mk (AssocRel α) (x * y * z) = Quot.mk _ (x * (y * z))

Quot.mk (Magma.AssocRel α) (x * y * z) = Quot.mk (Magma.AssocRel α) (x * (y * z))


/-- When `α` and `β` are in the same universe, this is the same as the result of
`EquivFunctor.mapEquiv`. -/
theorem optionCongr_eq_equivFunctor_mapEquiv {α β : Type u} (e : α ≃ β) :
    optionCongr e = EquivFunctor.mapEquiv Option e

e.optionCongr = EquivFunctor.mapEquiv Option e


theorem lt.intro {a b : Int} {n : Nat} (h : a + Nat.succ n = b) : a < b

{a b : Int}
{n : Nat}
(h : a + ↑n.succ = b)


@[to_additive (attr := simp)]
theorem mul_eq_empty : s * t = ∅ ↔ s = ∅ ∨ t = ∅

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


theorem sInf_range : sInf (range f) = iInf f

{α : Type u_1}
{ι : Sort u_5}
[InfSet α]
{f : ι → α}


/-- Exponentiation map from natural numbers to powers. -/
@[simps!]
def pow (n : M) (m : ℕ) : powers n

{M : Type u_1}
[Monoid M]
(n : M)
(m : ℕ)


/-- The wide equalizer morphism in any limit cone is a monomorphism. -/
theorem mono_of_isLimit_parallelFamily [Nonempty J] {c : Cone (parallelFamily f)} (i : IsLimit c) :
    Mono (Trident.ι c)

{c : CategoryTheory.Limits.Cone (CategoryTheory.Limits.parallelFamily f)}


/-- A point in the `affineSpan` of an indexed family is an
`affineCombination` with sum of weights 1. See also
`eq_affineCombination_of_mem_affineSpan_of_fintype`. -/
theorem eq_affineCombination_of_mem_affineSpan {p1 : P} {p : ι → P}
    (h : p1 ∈ affineSpan k (Set.range p)) :
    ∃ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 1 ∧ p1 = s.affineCombination k p w

{ι : Type u_1}
{k : Type u_2}
{V : Type u_3}
{P : Type u_4}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p1 : P}
{p : ι → P}
(h : p1 ∈ affineSpan k (Set.range p))

∃ s w, ∑ i ∈ s, w i = 1 ∧ p1 = (Finset.affineCombination k s p) w


@[to_additive (attr := measurability)]
theorem aestronglyMeasurable_one {α β} {_ : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β]
    [One β] : AEStronglyMeasurable (1 : α → β) μ

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : TopologicalSpace β] [inst_1 : Zero β],
  MeasureTheory.AEStronglyMeasurable 0 μ


/-- Characterize `x.toInt` in terms of `x.msb`. -/
theorem toInt_eq_msb_cond (x : BitVec w) :
    x.toInt = if x.msb then (x.toNat : Int) - (2^w : Nat) else (x.toNat : Int)

x.toInt = if x.msb = true then ↑x.toNat - ↑(2 ^ w) else ↑x.toNat


/-- If one controls the norm of every `f x`, then one controls the norm of `f`. -/
theorem opNorm_le_bound {M : ℝ} (hMp : 0 ≤ M) (hM : ∀ m, ‖f m‖ ≤ M * ∏ i, ‖m i‖) : ‖f‖ ≤ M

[(i : ι) → SeminormedAddCommGroup (E i)]

(hM : ∀ (m : (i : ι) → E i), ‖f m‖ ≤ M * ∏ i : ι, ‖m i‖)


@[simp]
theorem wellFoundedOn_range : (range f).WellFoundedOn r ↔ WellFounded (r on f)

{α : Type u_2}
{β : Type u_3}
{r : α → α → Prop}
{f : β → α}

(Set.range f).WellFoundedOn r ↔ WellFounded (r on f)


lemma isLeftAdjoint (adj : F ⊣ G) : F.IsLeftAdjoint

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


theorem neg_limZero {f : CauSeq β abv} (hf : LimZero f) : LimZero (-f)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f : CauSeq β abv}
(hf : f.LimZero)


@[to_additive (attr := simp)]
theorem prod_inv [Zero M] [CommGroup G] {f : α →₀ M} {h : α → M → G} :
    (f.prod fun a b => (h a b)⁻¹) = (f.prod h)⁻¹

{α : Type u_1}
{M : Type u_8}
{G : Type u_12}
[Zero M]
[AddCommGroup G]
{f : α →₀ M}
{h : α → M → G}


theorem smul_mem_iff (s0 : s ≠ 0) : s • x ∈ p ↔ x ∈ p

{S : Type u'}
{R : Type u}
{M : Type v}
[GroupWithZero S]
[Monoid R]
[MulAction R M]
[SMul S R]
[MulAction S M]
[IsScalarTower S R M]
(p : SubMulAction R M)
{s : S}
{x : M}
(s0 : s ≠ 0)


theorem contDiff_mul : ContDiff 𝕜 n fun p : 𝔸 × 𝔸 => p.1 * p.2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{n : ℕ∞}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]


theorem symmetry (X Y : C) :
    (Limits.BinaryFan.braiding (ℬ X Y).isLimit (ℬ Y X).isLimit).hom ≫
        (Limits.BinaryFan.braiding (ℬ Y X).isLimit (ℬ X Y).isLimit).hom =
      𝟙 (tensorObj ℬ X Y)

(ℬ : (X Y : C) → CategoryTheory.Limits.LimitCone (CategoryTheory.Limits.pair X Y))

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.BinaryFan.braiding (ℬ X Y).isLimit (ℬ Y X).isLimit).hom
    (CategoryTheory.Limits.BinaryFan.braiding (ℬ Y X).isLimit (ℬ X Y).isLimit).hom =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorObj ℬ X Y)


theorem not_subset_iff_exists_mem_not_mem {α : Type*} {s t : Set α} :
    ¬s ⊆ t ↔ ∃ x, x ∈ s ∧ x ∉ t


theorem image_inter_preimage (f : α → β) (s : Set α) (t : Set β) :
    f '' (s ∩ f ⁻¹' t) = f '' s ∩ t

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


/-- Construct a homeomorphism from an isomorphism. -/
@[simps!]
def homeoOfIso {X Y : CompHausLike.{u} P} (f : X ≅ Y) : X ≃ₜ Y

{P : TopCat → Prop}
{X Y : CompHausLike P}
(f : X ≅ Y)
(a : ↑Y.toTop)

(CompHausLike.homeoOfIso f).symm a = f.inv a


theorem eq_iff_eq {x y} :
    algebraMap R S x = algebraMap R S y ↔ algebraMap R P x = algebraMap R P y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
[Algebra R P]
[IsLocalization M P]
{x y : R}

(algebraMap R S) x = (algebraMap R S) y ↔ (algebraMap R P) x = (algebraMap R P) y


@[trans]
theorem fuzzy_of_equiv_of_fuzzy {x y z : PGame} (h₁ : x ≈ y) (h₂ : y ‖ z) : x ‖ z

{x y z : SetTheory.PGame}
(h₁ : x ≈ y)
(h₂ : y.Fuzzy z)


@[simp]
theorem neighborSet_subgraphOfAdj_of_ne_of_ne {u v w : V} (hvw : G.Adj v w) (hv : u ≠ v)
    (hw : u ≠ w) : (G.subgraphOfAdj hvw).neighborSet u = ∅

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(hvw : G.Adj v w)
(hv : u ≠ v)
(hw : u ≠ w)


theorem exp_conjTranspose [StarRing 𝔸] [ContinuousStar 𝔸] (A : Matrix m m 𝔸) :
    exp 𝕂 Aᴴ = (exp 𝕂 A)ᴴ

(𝕂 : Type u_1)
{m : Type u_2}
{𝔸 : Type u_6}
[Fintype m]
[DecidableEq m]
[Field 𝕂]
[Ring 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[Algebra 𝕂 𝔸]
[T2Space 𝔸]
[StarRing 𝔸]
[ContinuousStar 𝔸]
(A : Matrix m m 𝔸)

NormedSpace.exp 𝕂 Aᴴ = (NormedSpace.exp 𝕂 A)ᴴ


theorem IsAlt.self_eq_zero (x : M₁) : B x x = 0

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
(H : B.IsAlt)
(x : M₁)


lemma isIso_unit_app_of_iso [R.Faithful] [R.Full] {X : D} {Y : C} (e : Y ≅ R.obj X) :
    IsIso (h.unit.app Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : C ⥤ D}
{R : D ⥤ C}
(h : L ⊣ R)
[R.Faithful]
[R.Full]
{X : D}
{Y : C}
(e : Y ≅ R.obj X)


/-- Construct an object of the category `(F ↓ Δ)` from a cocone on `F`. This is part of an
    equivalence, see `Cocone.equivStructuredArrow`. -/
@[simps]
def Cocone.toStructuredArrow (F : J ⥤ C) : Cocone F ⥤ StructuredArrow F (const J)

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

∀ {X Y : CategoryTheory.Limits.Cocone F} (f : X ⟶ Y),
  (CategoryTheory.Limits.Cocone.toStructuredArrow F).map f = CategoryTheory.StructuredArrow.homMk f.hom ⋯


theorem comap_equiv_eq_map_symm (e : M ≃ₛₗ[τ₁₂] M₂) (K : Submodule R₂ M₂) :
    K.comap (e : M →ₛₗ[τ₁₂] M₂) = K.map (e.symm : M₂ →ₛₗ[τ₂₁] M)

{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₂}
{τ₂₁ : R₂ →+* R}
[RingHomInvPair τ₁₂ τ₂₁]
[RingHomInvPair τ₂₁ τ₁₂]
(e : M ≃ₛₗ[τ₁₂] M₂)
(K : Submodule R₂ M₂)

Submodule.comap (↑e) K = Submodule.map (↑e.symm) K


theorem toReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toReal = ⨅ i, (f i).toReal

{ι : Sort u_1}
{f : ι → ℝ≥0∞}
(hf : ∀ (i : ι), f i ≠ ⊤)


theorem adjoin_simple_eq_bot_iff : F⟮α⟯ = ⊥ ↔ α ∈ (⊥ : IntermediateField F E)

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

F⟮α⟯ = ⊥ ↔ α ∈ ⊥


@[simp] lemma ofENat_eq_nat {m : ℕ∞} {n : ℕ} : (m : Cardinal) = n ↔ m = n


theorem right_ne_zero_of_mul : a * b ≠ 0 → b ≠ 0

{M₀ : Type u_2}
[MulZeroClass M₀]
{a b : M₀}


theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) :
    CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K))

(n : ℕ+)
(A : Type u)
(K : Type w)
[CommRing A]
[Field K]
[Algebra A K]
{μ : CyclotomicField n K}
(h : IsPrimitiveRoot μ ↑n)

CyclotomicRing n A K = ↥(Algebra.adjoin A {μ})


@[simp]
theorem face_mk {n} (l u : Fin (n + 1) → ℝ) (h : ∀ i, l i < u i) (i : Fin (n + 1)) :
    face ⟨l, u, h⟩ i = ⟨l ∘ Fin.succAbove i, u ∘ Fin.succAbove i, fun _ ↦ h _⟩

{ lower := l, upper := u, lower_lt_upper := h }.face i =
  { lower := l ∘ i.succAbove, upper := u ∘ i.succAbove, lower_lt_upper := ⋯ }


lemma card_image_of_injective {f : α → β} (hf : Injective f) (s : Set α) :
    Nat.card (f '' s) = Nat.card s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Injective f)
(s : Set α)


theorem isVonNBounded_iff (s : Set E) : IsVonNBounded 𝕜 s ↔ ∀ V ∈ 𝓝 (0 : E), Absorbs 𝕜 V s

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
[Zero E]
[TopologicalSpace E]
(s : Set E)

Bornology.IsVonNBounded 𝕜 s ↔ ∀ V ∈ 𝓝 0, Absorbs 𝕜 V s


protected theorem sub_le_sub_right {n m : Nat} (h : n ≤ m) : ∀ k, n - k ≤ m - k


protected theorem eq_or_ssubset_of_subset (h : s ⊆ t) : s = t ∨ s ⊂ t


theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖₊ ≤ ‖A‖₊ * ‖v‖₊

{l : Type u_2}
{m : Type u_3}
{α : Type u_5}
[Fintype l]
[Fintype m]
[NonUnitalSeminormedRing α]
(A : Matrix l m α)
(v : m → α)

‖A *ᵥ v‖₊ ≤ ‖A‖₊ * ‖v‖₊


protected theorem le (f : Filtration ι m) (i : ι) : f i ≤ m

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
(f : MeasureTheory.Filtration ι m)
(i : ι)


@[simp]
theorem tmul_zero (m : M) : m ⊗ₜ[R] (0 : N) = 0

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


theorem ContinuousWithinAt.mem_closure {f : α → β} {s : Set α} {x : α} {A : Set β}
    (h : ContinuousWithinAt f s x) (hx : x ∈ closure s) (hA : MapsTo f s A) : f x ∈ closure A

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{x : α}
{A : Set β}
(h : ContinuousWithinAt f s x)
(hx : x ∈ closure s)
(hA : Set.MapsTo f s A)


theorem not_lt_of_equiv' {a b : α} : a ≈ b → ¬b ≺ a

{α : Sort u}
{r : α → α → Prop}
{a b : α}


theorem nndist_eq_sum {p : ℝ≥0∞} [Fact (1 ≤ p)] {β : ι → Type*} [∀ i, PseudoMetricSpace (β i)]
    (hp : p ≠ ∞) (x y : PiLp p β) :
    nndist x y = (∑ i : ι, nndist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal)

{ι : Type u_2}
[Fintype ι]
{p : ℝ≥0∞}
[Fact (1 ≤ p)]
{β : ι → Type u_5}
[(i : ι) → PseudoMetricSpace (β i)]
(hp : p ≠ ⊤)
(x y : PiLp p β)


theorem tsum_div_const [T2Space α] : ∑' x, f x / a = (∑' x, f x) / a

{ι : Type u_1}
{α : Type u_4}
[DivisionSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
{a : α}
[T2Space α]


theorem map_extChartAt_nhds_of_boundaryless [I.Boundaryless] (x : M) :
    map (extChartAt I x) (𝓝 x) = 𝓝 (extChartAt I x x)

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

Filter.map (↑(extChartAt I x)) (𝓝 x) = 𝓝 (↑(extChartAt I x) x)


/-- A nontrivial monoid has prime exponent `p` if and only if every non-identity element has
order `p`. -/
@[to_additive]
lemma exponent_eq_prime_iff {G : Type*} [Monoid G] [Nontrivial G] {p : ℕ} (hp : p.Prime) :
    Monoid.exponent G = p ↔ ∀ g : G, g ≠ 1 → orderOf g = p

{G : Type u_1}
[Monoid G]
[Nontrivial G]
{p : ℕ}
(hp : Nat.Prime p)

Monoid.exponent G = p ↔ ∀ (g : G), g ≠ 1 → orderOf g = p


theorem continuous_sSup_dom {T : Set (TopologicalSpace α)} {t₂ : TopologicalSpace β} :
    Continuous[sSup T, t₂] f ↔ ∀ t ∈ T, Continuous[t, t₂] f

{α : Type u}
{β : Type v}
{f : α → β}
{T : Set (TopologicalSpace α)}
{t₂ : TopologicalSpace β}


@[simp] protected theorem one_pow (n : Nat) : 1 ^ n = 1


@[simp]
lemma image_subtype_val_Ioi_Ici {a : α} (b : Ioi a) : Subtype.val '' Ici b = Ici b.1

{α : Type u_1}
[Preorder α]
{a : α}
(b : ↑(Set.Ioi a))


@[simp]
theorem linMulLin_apply (x y) : linMulLin f g x y = f x * g y

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{f g : M →ₗ[R] R}
(x y : M)

((LinearMap.BilinForm.linMulLin f g) x) y = f x * g y


theorem Trivialization.mdifferentiable (e : Trivialization F (π F Z)) [MemTrivializationAtlas e] :
    e.toPartialHomeomorph.MDifferentiable (I.prod 𝓘(𝕜, F)) (I.prod 𝓘(𝕜, F))

[TopologicalSpace (Bundle.TotalSpace F Z)]

(e : Trivialization F Bundle.TotalSpace.proj)

PartialHomeomorph.MDifferentiable (I.prod 𝓘(𝕜, F)) (I.prod 𝓘(𝕜, F)) e.toPartialHomeomorph


@[reassoc (attr := simp)]
lemma singleObjOpcyclesSelfIso_inv_naturality :
    opcyclesMap ((single C c j).map f) j ≫ (singleObjOpcyclesSelfIso c j B).inv =
      (singleObjOpcyclesSelfIso c j A).inv ≫ f

HomologicalComplex.opcyclesMap ((HomologicalComplex.single C c j).map f) j ≫
    (HomologicalComplex.singleObjOpcyclesSelfIso c j B).inv =
  (HomologicalComplex.singleObjOpcyclesSelfIso c j A).inv ≫ f


@[to_additive]
protected theorem map_eq_one_iff (h : M ≃* N) {x : M} : h x = 1 ↔ x = 1

{M : Type u_6}
{N : Type u_7}
[MulOneClass M]
[MulOneClass N]
(h : M ≃* N)
{x : M}


@[simp, norm_cast]
theorem cast_sub (m n) : ((m - n : ℤ) : R) = m - n

{R : Type u}
[AddGroupWithOne R]
(m n : ℤ)


theorem dist_tri_right' (n m : ℕ) : n ≤ m + dist n m


@[to_additive (attr := simp)]
theorem op_unop (S : Submonoid Mᵐᵒᵖ) : S.unop.op = S

{M : Type u_2}
[AddZeroClass M]
(S : AddSubmonoid Mᵃᵒᵖ)


private theorem poly_binom_aux2 (f : R[X]) (x y : R) :
    f.eval (x + y) =
      f.sum fun e a => a * (x ^ e + e * x ^ (e - 1) * y + (polyBinomAux1 x y e a).val * y ^ 2)

{R : Type u}
[CommRing R]
(f : Polynomial R)
(x y : R)

Polynomial.eval (x + y) f =
  f.sum fun e a => a * (x ^ e + ↑e * x ^ (e - 1) * y + ↑(Polynomial.polyBinomAux1 x y e a) * y ^ 2)


theorem compl_mul {P : { P : M // IsLprojection X P }} {Q : M} : ↑Pᶜ * Q = Q - ↑P * Q

{X : Type u_1}
[NormedAddCommGroup X]
{M : Type u_2}
[Ring M]
[Module M X]
{P : { P // IsLprojection X P }}
{Q : M}


@[to_additive (attr := continuity)]
theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) :
    Continuous fun a => (l.map fun i => f i a).prod

{ι : Type u_1}
{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
{f : ι → X → M}
(l : List ι)
(h : ∀ i ∈ l, Continuous (f i))

Continuous fun a => (List.map (fun i => f i a) l).prod


theorem ExtensionOfMaxAdjoin.extendIdealTo_wd' (h : Module.Baer R Q) {y : N} (r : R)
    (eq1 : r • y = 0) : ExtensionOfMaxAdjoin.extendIdealTo i f h y r = 0

{R : Type u}
[Ring R]
{Q : Type v}
[AddCommGroup Q]
[Module R Q]
{M : Type u_1}
{N : Type u_2}
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(i : M →ₗ[R] N)
(f : M →ₗ[R] Q)
[Fact (Function.Injective ⇑i)]
(h : Module.Baer R Q)
{y : N}
(r : R)
(eq1 : r • y = 0)

(Module.Baer.ExtensionOfMaxAdjoin.extendIdealTo i f h y) r = 0


@[simp]
lemma tensor_id (X Y : GradedObject I C) [HasTensor X Y] :
    tensorHom (𝟙 X) (𝟙 Y) = 𝟙 _

{I : Type u}
[AddMonoid I]
{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.MonoidalCategory C]
(X Y : CategoryTheory.GradedObject I C)
[X.HasTensor Y]

CategoryTheory.GradedObject.Monoidal.tensorHom (CategoryTheory.CategoryStruct.id X)
    (CategoryTheory.CategoryStruct.id Y) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.GradedObject.Monoidal.tensorObj X Y)


/-- Morphisms of `Factorisation f` consist of morphism between their midpoints and the obvious
commutativity conditions. -/
@[ext]
protected structure Hom (d e : Factorisation f) : Type (max u v) where
  /-- The morphism between the midpoints of the factorizations. -/
  h : d.mid ⟶ e.mid
  /-- The left commuting triangle of the factorization morphism. -/
  ι_h : d.ι ≫ h = e.ι := by aesop_cat
  /-- The right commuting triangle of the factorization morphism. -/
  h_π : h ≫ e.π = d.π := by aesop_cat

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

CategoryTheory.CategoryStruct.comp self.h e.π = d.π


/-- The category of R-modules has kernels, given by the inclusion of the kernel submodule. -/
theorem hasKernels_moduleCat : HasKernels (ModuleCat R)


@[to_additive]
theorem mulSupport_curry (f : α × β → M) :
    (mulSupport f.curry) = (mulSupport f).image Prod.fst

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

Function.support (Function.curry f) = Prod.fst '' Function.support f


/-- Cantor's intersection theorem for `iInter`:
the intersection of a directed family of nonempty compact closed sets is nonempty. -/
theorem IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed
    {ι : Type v} [hι : Nonempty ι] (t : ι → Set X) (htd : Directed (· ⊇ ·) t)
    (htn : ∀ i, (t i).Nonempty) (htc : ∀ i, IsCompact (t i)) (htcl : ∀ i, IsClosed (t i)) :
    (⋂ i, t i).Nonempty

(htd : Directed (fun x x_1 => x ⊇ x_1) t)


/-- A copy of `invOf_mul_self_assoc` for rectangular matrices. -/
protected theorem invOf_mul_self_assoc (A : Matrix n n α) (B : Matrix n m α) [Invertible A] :
    ⅟ A * (A * B) = B

{m : Type u_1}
{n : Type u_2}
{α : Type u_3}
[Fintype n]
[DecidableEq n]
[Semiring α]
(A : Matrix n n α)
(B : Matrix n m α)
[Invertible A]


/-- The functor `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`, on morphisms. -/
@[simps]
def map {K K' : ChainComplex C ℕ} (f : K ⟶ K') : obj K ⟶ obj K'

(AlgebraicTopology.DoldKan.Γ₀.map f).app Δ =
  (AlgebraicTopology.DoldKan.Γ₀.splitting K).desc Δ fun A =>
    f.f (Opposite.unop A.fst).len ≫ ((AlgebraicTopology.DoldKan.Γ₀.splitting K').cofan Δ).inj A


theorem exists_dropn_of_mem {s : WSeq α} {a} (h : a ∈ s) :
    ∃ n s', some (a, s') ∈ destruct (drop s n)

{α : Type u}
{s : Stream'.WSeq α}
{a : α}
(h : a ∈ s)

∃ n s', some (a, s') ∈ (s.drop n).destruct


@[to_additive]
theorem prod_mapRange_index {f : M → M'} {hf : f 0 = 0} {g : α →₀ M} {h : α → M' → N}
    (h0 : ∀ a, h a 0 = 1) : (mapRange f hf g).prod h = g.prod fun a b => h a (f b)

{α : Type u_1}
{M : Type u_8}
{M' : Type u_9}
{N : Type u_10}
[Zero M]
[Zero M']
[AddCommMonoid N]
{f : M → M'}
{hf : f 0 = 0}
{g : α →₀ M}
{h : α → M' → N}
(h0 : ∀ (a : α), h a 0 = 0)

(Finsupp.mapRange f hf g).sum h = g.sum fun a b => h a (f b)


theorem mk'_eq_iff_eq_mul {x} {y : M} {z} :
    mk' S x y = z ↔ algebraMap R S x = z * algebraMap R S y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{x : R}
{y : ↥M}
{z : S}

IsLocalization.mk' S x y = z ↔ (algebraMap R S) x = z * (algebraMap R S) ↑y


lemma additive_of_comp_faithful
    (F : C ⥤ D) (G : D ⥤ E) [G.Additive] [(F ⋙ G).Additive] [Faithful G] :
    F.Additive

{C : Type u_1}
{D : Type u_2}
{E : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} E]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
[CategoryTheory.Preadditive E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
[G.Additive]
[(F.comp G).Additive]
[G.Faithful]


@[reassoc (attr := simp)]
lemma isoOfHom_inv_hom_id {X Y : C} (f : X ⟶ Y) (hf : W f) :
    (isoOfHom L W f hf).inv ≫ L.map f = 𝟙 _

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
{X Y : C}
(f : X ⟶ Y)
(hf : W f)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Localization.isoOfHom L W f hf).inv (L.map f) =
  CategoryTheory.CategoryStruct.id (L.obj Y)


lemma asympBound_pos (n : ℕ) (hn : 0 < n) : 0 < asympBound g a b n

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

0 < AkraBazziRecurrence.asympBound g a b n


@[simp, norm_cast]
theorem coe_pow_unitSphere [NormedDivisionRing 𝕜] (x : sphere (0 : 𝕜) 1) (n : ℕ) :
    ↑(x ^ n) = (x : 𝕜) ^ n

{𝕜 : Type u_1}
[NormedDivisionRing 𝕜]
(x : ↑(Metric.sphere 0 1))
(n : ℕ)


theorem abs_coe_lt_top (x : ℝ) : (x : EReal).abs < ⊤


@[to_additive]
lemma fst_mem_orbit_of_mem_orbit {x y : α × β} (h : x ∈ MulAction.orbit M y) :
    x.1 ∈ MulAction.orbit M y.1

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
{β : Type u_1}
[AddAction M β]
{x y : α × β}
(h : x ∈ AddAction.orbit M y)


lemma not_equiv_of_X_ne {P Q : Fin 3 → R} (hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2) : ¬P ≈ Q

{R : Type u}
[CommRing R]
{P Q : Fin 3 → R}
(hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2)


theorem span_singleton_absNorm_le (I : Ideal S) : Ideal.span {(Ideal.absNorm I : S)} ≤ I

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
(I : Ideal S)


@[simp]
lemma natTransEquiv_id_symm {F : C ⥤ D} {G : D ⥤ C} (adj : F ⊣ G) :
    (natTransEquiv adj adj).symm (𝟙 _) = 𝟙 _

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F : C ⥤ D}
{G : D ⥤ C}
(adj : F ⊣ G)

(adj.natTransEquiv adj).symm (𝟙 F) = 𝟙 G


theorem comap_bracket_eq {J₁ J₂ : LieIdeal R L'} (h : f.IsIdealMorphism) :
    comap f ⁅f.idealRange ⊓ J₁, f.idealRange ⊓ J₂⁆ = ⁅comap f J₁, comap f J₂⁆ ⊔ f.ker

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}
{J₁ J₂ : LieIdeal R L'}
(h : f.IsIdealMorphism)

LieIdeal.comap f ⁅f.idealRange ⊓ J₁, f.idealRange ⊓ J₂⁆ = ⁅LieIdeal.comap f J₁, LieIdeal.comap f J₂⁆ ⊔ f.ker


theorem homogeneousComponent_of_mem {m n : ℕ} {p : MvPolynomial σ R}
    (h : p ∈ homogeneousSubmodule σ R n) :
    homogeneousComponent m p = if m = n then p else 0

(h : p ∈ MvPolynomial.homogeneousSubmodule σ R n)

(MvPolynomial.homogeneousComponent m) p = if m = n then p else 0


/-- If there are zero morphisms, any terminal object is a zero object. -/
theorem hasZeroObject_of_hasTerminal_object [HasZeroMorphisms C] [HasTerminal C] :
    HasZeroObject C


theorem sublistsLen_one (l : List α) : sublistsLen 1 l = l.reverse.map ([·])

List.sublistsLen 1 l = List.map (fun x => [x]) l.reverse


theorem LiftRelRec.lem {R : α → β → Prop} (C : Computation α → Computation β → Prop)
    (H : ∀ {ca cb}, C ca cb → LiftRelAux R C (destruct ca) (destruct cb)) (ca cb) (Hc : C ca cb) (a)
    (ha : a ∈ ca) : LiftRel R ca cb

(H : ∀ {ca : Computation α} {cb : Computation β}, C ca cb → Computation.LiftRelAux R C ca.destruct cb.destruct)


@[simp] theorem dist_toAdd (a b : Multiplicative X) : dist (toAdd a) (toAdd b) = dist a b

{X : Type u_1}
[Dist X]
(a b : Multiplicative X)

dist (Multiplicative.toAdd a) (Multiplicative.toAdd b) = dist a b


/-- The ray given by the negation of a nonzero vector. -/
@[simp]
theorem neg_rayOfNeZero (v : M) (h : v ≠ 0) :
    -rayOfNeZero R _ h = rayOfNeZero R (-v) (neg_ne_zero.2 h)

(R : Type u_1)
[StrictOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(v : M)
(h : v ≠ 0)

-rayOfNeZero R v h = rayOfNeZero R (-v) ⋯


theorem not_prime_pow {n : ℕ} (hn : n ≠ 1) : ¬Prime (a ^ n)

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a : α}
{n : ℕ}
(hn : n ≠ 1)