/--
If `g` and `h` commute, then `g` fixes `h • x` iff `g` fixes `x`.
This is equivalent to say that the set `fixedBy α g` is fixed by `h`.
-/
@[to_additive "If `g` and `h` commute, then `g` fixes `h +ᵥ x` iff `g` fixes `x`.
This is equivalent to say that the set `fixedBy α g` is fixed by `h`.
"]
theorem fixedBy_mem_fixedBy_of_commute {g h : G} (comm : Commute g h) :
    (fixedBy α g) ∈ fixedBy (Set α) h

{α : Type u_1}
{G : Type u_2}
[Group G]
[MulAction G α]
{g h : G}
(comm : Commute g h)

MulAction.fixedBy α g ∈ MulAction.fixedBy (Set α) h


/-- A category "has zero morphisms" if there is a designated "zero morphism" in each morphism space,
and compositions of zero morphisms with anything give the zero morphism. -/
class HasZeroMorphisms where
  /-- Every morphism space has zero -/
  [zero : ∀ X Y : C, Zero (X ⟶ Y)]
  /-- `f` composed with `0` is `0` -/
  comp_zero : ∀ {X Y : C} (f : X ⟶ Y) (Z : C), f ≫ (0 : Y ⟶ Z) = (0 : X ⟶ Z) := by aesop_cat
  /-- `0` composed with `f` is `0` -/
  zero_comp : ∀ (X : C) {Y Z : C} (f : Y ⟶ Z), (0 : X ⟶ Y) ≫ f = (0 : X ⟶ Z) := by aesop_cat

[self : CategoryTheory.Limits.HasZeroMorphisms C]


@[simp]
theorem intentClosure_union (s₁ s₂ : Set α) :
    intentClosure r (s₁ ∪ s₂) = intentClosure r s₁ ∩ intentClosure r s₂

{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)
(s₁ s₂ : Set α)


theorem Filter.Tendsto.zero_mul_isBoundedUnder_le {f g : ι → α} {l : Filter ι}
    (hf : Tendsto f l (𝓝 0)) (hg : IsBoundedUnder (· ≤ ·) l ((‖·‖) ∘ g)) :
    Tendsto (fun x => f x * g x) l (𝓝 0)

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

Filter.Tendsto (fun x => f x * g x) l (𝓝 0)


@[simp]
theorem mk_smul {γ : Type*} [SMul γ β] [IsScalarTower γ β β] (c : γ) (f : CauSeq β abv) :
    c • mk f = mk (c • f)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{γ : Type u_3}
[SMul γ β]
[IsScalarTower γ β β]
(c : γ)
(f : CauSeq β abv)

c • CauSeq.Completion.mk f = CauSeq.Completion.mk (c • f)


@[simp]
theorem star_star [InvolutiveStar R] (r : R) : star (star r) = r


theorem eq_prod_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    (map φ P).toPoly = C (φ P.a) * (X - C x) * (X - C y) * (X - C z)

(h3 : (Cubic.map φ P).roots = {x, y, z})

(Cubic.map φ P).toPoly =
  Polynomial.C (φ P.a) * (Polynomial.X - Polynomial.C x) * (Polynomial.X - Polynomial.C y) *
    (Polynomial.X - Polynomial.C z)


@[simp]
theorem smul_normal (g : G) (H : Subgroup G) [h : Normal H] : MulAut.conj g • H = H

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


@[simp, deprecated minimum_eq_top "Don't mix Option and WithTop" (since := "2024-05-27")]
theorem minimum_eq_none {l : List α} : l.minimum = none ↔ l = []

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x < x_1]
{l : List α}


@[simp] theorem mul_bmod_bmod : Int.bmod (x * Int.bmod y n) n = Int.bmod (x * y) n


/-- An alternative statement of the Stone-Weierstrass theorem,
for those who like their epsilons.

If `A` is a subalgebra of `C(X, ℝ)` which separates points (and `X` is compact),
every real-valued continuous function on `X` is within any `ε > 0` of some element of `A`.
-/
theorem exists_mem_subalgebra_near_continuousMap_of_separatesPoints (A : Subalgebra ℝ C(X, ℝ))
    (w : A.SeparatesPoints) (f : C(X, ℝ)) (ε : ℝ) (pos : 0 < ε) :
    ∃ g : A, ‖(g : C(X, ℝ)) - f‖ < ε

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(A : Subalgebra ℝ C(X, ℝ))
(w : A.SeparatesPoints)
(f : C(X, ℝ))
(ε : ℝ)
(pos : 0 < ε)


theorem uniformity_basis_edist' (ε' : ℝ≥0∞) (hε' : 0 < ε') :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => ε ∈ Ioo 0 ε') fun ε => { p : α × α | edist p.1 p.2 < ε }

{α : Type u}
[PseudoEMetricSpace α]
(ε' : ℝ≥0∞)
(hε' : 0 < ε')

(𝓤 α).HasBasis (fun ε => ε ∈ Set.Ioo 0 ε') fun ε => {p | edist p.1 p.2 < ε}


@[simp]
theorem normUnit_one : normUnit (1 : α) = 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]


@[simp]
theorem run_bind (f : α → OptionT m β) :
    (x >>= f).run = x.run >>= fun
                              | some a => OptionT.run (f a)
                              | none   => pure none

{α β : Type u}
{m : Type u → Type v}
(x : OptionT m α)
[Monad m]
(f : α → OptionT m β)

(x >>= f).run = do
  let x ← x.run
  match x with
    | some a => (f a).run
    | none => pure none


@[simp]
theorem toFinsupp_toMultiset (s : Multiset α) : Finsupp.toMultiset (toFinsupp s) = s

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

Finsupp.toMultiset (Multiset.toFinsupp s) = s


theorem coe_le_iff (n : ℕ) (x : PartENat) : (n : PartENat) ≤ x ↔ ∀ h : x.Dom, n ≤ x.get h


theorem lf_of_le_moveLeft {x y : PGame} {i} (h : x ≤ y.moveLeft i) : x ⧏ y

{x y : SetTheory.PGame}
{i : y.LeftMoves}
(h : x ≤ y.moveLeft i)


@[simp]
theorem coe_inf : ((S ⊓ T : ConvexCone 𝕜 E) : Set E) = ↑S ∩ ↑T

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
(S T : ConvexCone 𝕜 E)


theorem Embedding.map_nhds_eq (hf : Embedding f) (x : X) :
    (𝓝 x).map f = 𝓝[range f] f x

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : Embedding f)
(x : X)


/-- `Infinite α` is not `Finite`-/
theorem not_finite (α : Sort*) [Infinite α] [Finite α] : False


/-- Bijection between `α` and `ULift.{v} α` -/
theorem ULift.up_down {α : Type u} (b : ULift.{v} α) : Eq (up (down b)) b


theorem mapsTo_preimage (h : Semiconj f fa fb) {s t : Set β} (hb : MapsTo fb s t) :
    MapsTo fa (f ⁻¹' s) (f ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
{fa : α → α}
{fb : β → β}
{f : α → β}
(h : Function.Semiconj f fa fb)
{s t : Set β}
(hb : Set.MapsTo fb s t)


/-- The cosine of the angle between two vectors is 0 if and only if the angle is π / 2. -/
theorem cos_eq_zero_iff_angle_eq_pi_div_two : cos (angle x y) = 0 ↔ angle x y = π / 2

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}

Real.cos (InnerProductGeometry.angle x y) = 0 ↔ InnerProductGeometry.angle x y = π / 2


/-- Class `ProperlyDiscontinuousSMul Γ T` says that the scalar multiplication `(•) : Γ → T → T`
is properly discontinuous, that is, for any pair of compact sets `K, L` in `T`, only finitely many
`γ:Γ` move `K` to have nontrivial intersection with `L`.
-/
class ProperlyDiscontinuousSMul (Γ : Type*) (T : Type*) [TopologicalSpace T] [SMul Γ T] :
    Prop where
  /-- Given two compact sets `K` and `L`, `γ • K ∩ L` is nonempty for finitely many `γ`. -/
  finite_disjoint_inter_image :
    ∀ {K L : Set T}, IsCompact K → IsCompact L → Set.Finite { γ : Γ | (γ • ·) '' K ∩ L ≠ ∅ }

{Γ : Type u_4}
{T : Type u_5}
[TopologicalSpace T]
[SMul Γ T]
[self : ProperlyDiscontinuousSMul Γ T]
{K L : Set T}

IsCompact K → IsCompact L → {γ | (fun x => γ • x) '' K ∩ L ≠ ∅}.Finite


theorem Set.Nonempty.bddAbove_lowerBounds (hs : s.Nonempty) : BddAbove (lowerBounds s)

{α : Type u}
[Preorder α]
{s : Set α}
(hs : s.Nonempty)


@[to_additive]
protected lemma mul_mul_div (a : α) (h : IsUnit b) : a * b * (1 / b) = a

{α : Type u}
[SubtractionMonoid α]
{b : α}
(a : α)
(h : IsAddUnit b)


theorem symm_of_uniformity {s : Set (α × α)} (hs : s ∈ 𝓤 α) :
    ∃ t ∈ 𝓤 α, (∀ a b, (a, b) ∈ t → (b, a) ∈ t) ∧ t ⊆ s

{α : Type ua}
[UniformSpace α]
{s : Set (α × α)}
(hs : s ∈ 𝓤 α)

∃ t ∈ 𝓤 α, (∀ (a b : α), (a, b) ∈ t → (b, a) ∈ t) ∧ t ⊆ s


/-- A mono factorisation of `f ≫ g`, where `g` is an isomorphism,
gives a mono factorisation of `f`. -/
@[simps]
def ofCompIso {Y' : C} {g : Y ⟶ Y'} [IsIso g] (F : MonoFactorisation (f ≫ g)) :
    MonoFactorisation f

(F : CategoryTheory.Limits.MonoFactorisation (f ≫ g))


@[simp]
theorem cos_zero : cos (0 : Angle) = 1


theorem Poly.denote_append (ctx : Context) (p q : Poly) : (p ++ q).denote ctx = p.denote ctx + q.denote ctx

(ctx : Nat.Linear.Context)
(p q : Nat.Linear.Poly)

Nat.Linear.Poly.denote ctx (p ++ q) = Nat.Linear.Poly.denote ctx p + Nat.Linear.Poly.denote ctx q


theorem vector_toList_iff {n} {f : α → Vector β n} : (Primrec fun a => (f a).toList) ↔ Primrec f

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{n : ℕ}
{f : α → Mathlib.Vector β n}


theorem injective_iff_surjective_of_finrank_eq_finrank [FiniteDimensional K V]
    [FiniteDimensional K V₂] (H : finrank K V = finrank K V₂) {f : V →ₗ[K] V₂} :
    Function.Injective f ↔ Function.Surjective f

(H : FiniteDimensional.finrank K V = FiniteDimensional.finrank K V₂)

Function.Injective ⇑f ↔ Function.Surjective ⇑f


@[simp]
theorem neg_comp : (-p).comp q = -p.comp q


theorem restrict_sub_eq_restrict_sub_restrict (h_meas_s : MeasurableSet s) :
    (μ - ν).restrict s = μ.restrict s - ν.restrict s

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s : Set α}
(h_meas_s : MeasurableSet s)


@[simp]
nonrec theorem map_tmul (f : M →ₗ⁅R,L⁆ P) (g : N →ₗ⁅R,L⁆ Q) (m : M) (n : N) :
    map f g (m ⊗ₜ n) = f m ⊗ₜ g n

{R : Type u}
[CommRing R]
{L : Type v}
{M : Type w}
{N : Type w₁}
{P : Type w₂}
{Q : Type w₃}
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[AddCommGroup N]
[Module R N]
[LieRingModule L N]
[LieModule R L N]
[AddCommGroup P]
[Module R P]
[LieRingModule L P]
[LieModule R L P]
[AddCommGroup Q]
[Module R Q]
[LieRingModule L Q]
[LieModule R L Q]
(f : M →ₗ⁅R,L⁆ P)
(g : N →ₗ⁅R,L⁆ Q)
(m : M)
(n : N)

(TensorProduct.LieModule.map f g) (m ⊗ₜ[R] n) = f m ⊗ₜ[R] g n


@[simp]
theorem prod_inf_prod {S T : NonUnitalSubalgebra R A} {S₁ T₁ : NonUnitalSubalgebra R B} :
    S.prod S₁ ⊓ T.prod T₁ = (S ⊓ T).prod (S₁ ⊓ T₁)

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
{S T : NonUnitalSubalgebra R A}
{S₁ T₁ : NonUnitalSubalgebra R B}


theorem c_sub_pf [Sub α] (p : b = c) (a : α) : a - b = a - c

{α : Type u_1}
{b c : α}
[Sub α]
(p : b = c)
(a : α)


theorem card_roots_of_disc_ne_zero [DecidableEq K] (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z})
    (hd : P.disc ≠ 0) : (map φ P).roots.toFinset.card = 3

(h3 : (Cubic.map φ P).roots = {x, y, z})


@[simp]
lemma fromRows_mul (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (B : Matrix n m R) :
    fromRows A₁ A₂ * B = fromRows (A₁ * B) (A₂ * B)

{R : Type u_1}
{m : Type u_2}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
[Fintype n]
[Semiring R]
(A₁ : Matrix m₁ n R)
(A₂ : Matrix m₂ n R)
(B : Matrix n m R)

A₁.fromRows A₂ * B = (A₁ * B).fromRows (A₂ * B)


theorem IsUpperSet.Ioi_subset (h : IsUpperSet s) ⦃a⦄ (ha : a ∈ s) : Ioi a ⊆ s

{α : Type u_1}
[Preorder α]
{s : Set α}
(h : IsUpperSet s)
⦃a : α⦄
(ha : a ∈ s)


@[simp]
theorem lt_sup'_iff : a < s.sup' H f ↔ ∃ b ∈ s, a < f b

{α : Type u_2}
{ι : Type u_5}
[LinearOrder α]
{s : Finset ι}
(H : s.Nonempty)
{f : ι → α}
{a : α}


theorem eq_comm {a b : α} : a = b ↔ b = a


/-- The oriented angle between two vectors is `π` if and only if the angle with the vectors
swapped is `π`. -/
theorem oangle_eq_pi_iff_oangle_rev_eq_pi {x y : V} : o.oangle x y = π ↔ o.oangle y x = π

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


{K : Type u_3}
[DivisionMonoid K]
[HasDistribNeg K]


theorem byCases {p q : Prop} (hpq : p → q) (hnpq : ¬p → q) : q


@[simp]
theorem singleton_union : {a} ∪ s = insert a s


theorem coe_comp_orderMonoidHom (f : β →*₀o γ) (g : α →*₀o β) :
    (f.comp g : α →*o γ) = (f : β →*o γ).comp g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[MulZeroOneClass α]
[MulZeroOneClass β]
[MulZeroOneClass γ]
(f : β →*₀o γ)
(g : α →*₀o β)


protected theorem MonotoneOn.Icc (hf : MonotoneOn f s) (hg : AntitoneOn g s) :
    AntitoneOn (fun x => Icc (f x) (g x)) s

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

AntitoneOn (fun x => Set.Icc (f x) (g x)) s


theorem Measure.FiniteAtFilter.integrableAtFilter_of_tendsto_ae {l : Filter α}
    [IsMeasurablyGenerated l] (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l) {b}
    (hf : Tendsto f (l ⊓ ae μ) (𝓝 b)) : IntegrableAtFilter f l μ

(hf : Filter.Tendsto f (l ⊓ MeasureTheory.ae μ) (𝓝 b))


theorem gcd_ne_zero_left : m ≠ 0 → gcd m n ≠ 0


@[simp]
theorem comp_inv_eq (α : X ⟶ Y) [IsIso α] {f : Z ⟶ Y} {g : Z ⟶ X} : f ≫ inv α = g ↔ f = g ≫ α

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
(α : X ⟶ Y)
[CategoryTheory.IsIso α]
{f : Z ⟶ Y}
{g : Z ⟶ X}

CategoryTheory.CategoryStruct.comp f (CategoryTheory.inv α) = g ↔ f = CategoryTheory.CategoryStruct.comp g α


theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ

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


@[simp]
theorem ofDual_hnot (a : αᵒᵈ) : ofDual (￢a) = (ofDual a)ᶜ

{α : Type u_2}
[HeytingAlgebra α]
(a : αᵒᵈ)

OrderDual.ofDual (￢a) = (OrderDual.ofDual a)ᶜ


theorem continuousOn_inv₀ : ContinuousOn (Inv.inv : G₀ → G₀) {0}ᶜ

{G₀ : Type u_3}
[Zero G₀]
[Inv G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]


theorem ExtensionOf.ext_iff {a b : ExtensionOf i f} :
    a = b ↔ ∃ _ : a.domain = b.domain, ∀ ⦃x : a.domain⦄ ⦃y : b.domain⦄,
    (x : N) = y → a.toLinearPMap x = b.toLinearPMap y

{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}
{a b : Module.Baer.ExtensionOf i f}

a = b ↔ ∃ (_ : a.domain = b.domain), ∀ ⦃x : ↥a.domain⦄ ⦃y : ↥b.domain⦄, ↑x = ↑y → ↑a.toLinearPMap x = ↑b.toLinearPMap y


theorem RingHom.injective_nat (f : ℕ →+* R) [CharZero R] : Function.Injective f

{R : Type u_1}
[NonAssocSemiring R]
(f : ℕ →+* R)
[CharZero R]


theorem lift_lt_univ' (c : Cardinal) : lift.{max (u + 1) v, u} c < univ.{u, v}

Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}


theorem Monic.normalize_eq_self {p : R[X]} (hp : p.Monic) : normalize p = p

{R : Type u}
[CommRing R]
[IsDomain R]
[NormalizationMonoid R]
{p : R[X]}
(hp : p.Monic)


/-- (Implementation Detail) The glue data associated to a disjoint union. -/
@[simps]
noncomputable
def disjointGlueData' : GlueData' Scheme

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)

∀ (a : ι), (AlgebraicGeometry.disjointGlueData' f).U a = f a


@[simp]
theorem lift_card (a) : Cardinal.lift.{u,v} (card a)= card (lift.{u,v} a)

Cardinal.lift.{u, v} a.card = (Ordinal.lift.{u, v} a).card


@[simp, norm_cast]
theorem coe_ssubset {s₁ s₂ : Finset α} : (s₁ : Set α) ⊂ s₂ ↔ s₁ ⊂ s₂

↑s₁ ⊂ ↑s₂ ↔ s₁ ⊂ s₂


@[to_additive]
theorem ker_eq_bot_of_mono [Mono f] : f.ker = ⊥

{A B : AddCommGrp}
(f : A ⟶ B)
[CategoryTheory.Mono f]


lemma isUnit_X_of_Z_eq_zero {P : Fin 3 → F} (hP : W.Nonsingular P) (hPz : P z = 0) : IsUnit (P x)

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hP : W.Nonsingular P)
(hPz : P z = 0)


/-- This can be use to prove
```lean
example (P : Matrix (Fin 2) (Fin 3) α → Prop) :
  (∃ x, P x) ↔ ∃ a b c d e f, P !![a, b, c; d, e, f] :=
(exists_iff _).symm
```
-/
theorem exists_iff : ∀ {m n} (P : Matrix (Fin m) (Fin n) α → Prop), Exists P ↔ ∃ x, P x

{α : Type u_1}
{m n : ℕ}
(P : Matrix (Fin m) (Fin n) α → Prop)


@[simp]
theorem mul_star_self_of_mem {U : R} (hU : U ∈ unitary R) : U * star U = 1

{R : Type u_1}
[Monoid R]
[StarMul R]
{U : R}
(hU : U ∈ unitary R)


theorem suppPreservation_iff_isUniform : q.SuppPreservation ↔ q.IsUniform

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[q : MvQPF F]


/-- If a ring homomorphism `R →+* A` is injective then `A` has the same exponential characteristic
as `R`. -/
theorem expChar_of_injective_ringHom {R A : Type*}
    [Semiring R] [Semiring A] {f : R →+* A} (h : Function.Injective f)
    (q : ℕ) [hR : ExpChar R q] : ExpChar A q

{R : Type u_1}
{A : Type u_2}
[Semiring R]
[Semiring A]
{f : R →+* A}
(h : Function.Injective ⇑f)
(q : ℕ)
[hR : ExpChar R q]


@[simp]
theorem iInf_mk {ι} (s : ι → Set α) (h : ∀ i, IsClosed (s i)) :
    (⨅ i, ⟨s i, h i⟩ : Closeds α) = ⟨⋂ i, s i, isClosed_iInter h⟩

{α : Type u_2}
[TopologicalSpace α]
{ι : Sort u_4}
(s : ι → Set α)
(h : ∀ (i : ι), IsClosed (s i))

⨅ i, { carrier := s i, closed' := ⋯ } = { carrier := ⋂ i, s i, closed' := ⋯ }


@[ext]
theorem leftDistributor_ext₂_left {J : Type} [Fintype J]
    {X Y Z : C} {f : J → C} {g h : X ⊗ (Y ⊗ ⨁ f) ⟶ Z}
    (w : ∀ j, (X ◁ (Y ◁ biproduct.ι f j)) ≫ g = (X ◁ (Y ◁ biproduct.ι f j)) ≫ h) :
    g = h

{g h : CategoryTheory.MonoidalCategory.tensorObj X (CategoryTheory.MonoidalCategory.tensorObj Y (⨁ f)) ⟶ Z}

(w :
  ∀ (j : J),
    CategoryTheory.CategoryStruct.comp
        (CategoryTheory.MonoidalCategory.whiskerLeft X
          (CategoryTheory.MonoidalCategory.whiskerLeft Y (CategoryTheory.Limits.biproduct.ι f j)))
        g =
      CategoryTheory.CategoryStruct.comp
        (CategoryTheory.MonoidalCategory.whiskerLeft X
          (CategoryTheory.MonoidalCategory.whiskerLeft Y (CategoryTheory.Limits.biproduct.ι f j)))
        h)


lemma rootSpace_zsmul_add_ne_bot_iff_mem (n : ℤ) :
    rootSpace H (n • α + β) ≠ ⊥ ↔ n ∈ Finset.Icc (-chainBotCoeff α β : ℤ) (chainTopCoeff α β)

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α β : LieModule.Weight K (↥H) L)
(hα : α.IsNonZero)
(n : ℤ)

LieAlgebra.rootSpace H (n • ⇑α + ⇑β) ≠ ⊥ ↔
  n ∈ Finset.Icc (-↑(LieModule.chainBotCoeff (⇑α) β)) ↑(LieModule.chainTopCoeff (⇑α) β)


theorem range_fst : NonUnitalRingHom.srange (fst R S) = ⊤

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]

NonUnitalRingHom.srange (NonUnitalRingHom.fst R S) = ⊤


theorem inf_of_mem {s : Finset β} (f : β → α) {b : β} (h : b ∈ s) :
    ∃ a : α, s.inf ((↑) ∘ f : β → WithTop α) = ↑a

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
{s : Finset β}
(f : β → α)
{b : β}
(h : b ∈ s)


/-- Constructor for short complexes in `ModuleCat.{v} R` taking as inputs
morphisms `f` and `g` and the assumption `LinearMap.range f ≤ LinearMap.ker g`. -/
@[simps]
def moduleCatMkOfKerLERange {X₁ X₂ X₃ : ModuleCat.{v} R} (f : X₁ ⟶ X₂) (g : X₂ ⟶ X₃)
    (hfg : LinearMap.range f ≤ LinearMap.ker g) : ShortComplex (ModuleCat.{v} R)

(CategoryTheory.ShortComplex.moduleCatMkOfKerLERange f g hfg).f = f


@[simp]
theorem encode_list_nil : encode (@nil α) = 0


theorem NeBot.not_disjoint (hf : f.NeBot) (hs : s ∈ f) (ht : t ∈ f) : ¬Disjoint s t

{α : Type u}
{f : Filter α}
{s t : Set α}
(hf : f.NeBot)
(hs : s ∈ f)
(ht : t ∈ f)


@[simp]
theorem _root_.Matrix.nondegenerate_toBilin'_iff {M : Matrix ι ι R₃} :
    M.toBilin'.Nondegenerate ↔ M.Nondegenerate

{R₃ : Type u_7}
[CommRing R₃]
{ι : Type u_12}
[DecidableEq ι]
[Fintype ι]
{M : Matrix ι ι R₃}

(Matrix.toBilin' M).Nondegenerate ↔ M.Nondegenerate


@[simp]
lemma scaleRoots_one (p : R[X]) :
    p.scaleRoots 1 = p

{R : Type u_1}
[Semiring R]
(p : Polynomial R)


@[simp]
theorem coe_toContinuousLinearEquiv_symm (e : E ≃ₗ[𝕜] F) :
    (e.toContinuousLinearEquiv.symm : F →ₗ[𝕜] E) = e.symm

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F : Type w}
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousSMul 𝕜 F]
[CompleteSpace 𝕜]
[T2Space E]
[T2Space F]
[FiniteDimensional 𝕜 E]
(e : E ≃ₗ[𝕜] F)


protected theorem le_sup_right {a b : CauSeq α abs} : b ≤ a ⊔ b

{α : Type u_1}
[LinearOrderedField α]
{a b : CauSeq α abs}


/-- The map `B.polar : Set E → Set F` forms an order-reversing Galois connection with
`B.flip.polar : Set F → Set E`. We use `OrderDual.toDual` and `OrderDual.ofDual` to express
that `polar` is order-reversing. -/
theorem polar_gc :
    GaloisConnection (OrderDual.toDual ∘ B.polar) (B.flip.polar ∘ OrderDual.ofDual)

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

GaloisConnection (⇑OrderDual.toDual ∘ B.polar) (B.flip.polar ∘ ⇑OrderDual.ofDual)


@[simp]
theorem directSum_lof_tmul_lof (i₁ : ι₁) (m₁ : M₁ i₁) (i₂ : ι₂) (m₂ : M₂ i₂) :
    TensorProduct.directSum R S M₁ M₂ (DirectSum.lof S ι₁ M₁ i₁ m₁ ⊗ₜ DirectSum.lof R ι₂ M₂ i₂ m₂) =
      DirectSum.lof S (ι₁ × ι₂) (fun i => M₁ i.1 ⊗[R] M₂ i.2) (i₁, i₂) (m₁ ⊗ₜ m₂)

[∀ (i₁ : ι₁), IsScalarTower R S (M₁ i₁)]

(TensorProduct.directSum R S M₁ M₂) ((DirectSum.lof S ι₁ M₁ i₁) m₁ ⊗ₜ[R] (DirectSum.lof R ι₂ M₂ i₂) m₂) =
  (DirectSum.lof S (ι₁ × ι₂) (fun i => TensorProduct R (M₁ i.1) (M₂ i.2)) (i₁, i₂)) (m₁ ⊗ₜ[R] m₂)


theorem closure_singleton_zero : closure ({0} : Set A) = ⊥


theorem isNoetherianRing (h : IsNoetherianRing R) : IsNoetherianRing S

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
(S : Type u_2)
[CommRing S]
[Algebra R S]
[IsLocalization M S]
(h : IsNoetherianRing R)


theorem succ_succ_ne_one (a : Fin n) : Fin.succ (Fin.succ a) ≠ 1


@[simp]
theorem AlgHom.toRingHom_toRatAlgHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S]
    (f : R →ₐ[ℚ] S) : (f : R →+* S).toRatAlgHom = f

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
[Algebra ℚ R]
[Algebra ℚ S]
(f : R →ₐ[ℚ] S)


theorem two_nsmul_eq_zero_iff {θ : Angle} : (2 : ℕ) • θ = 0 ↔ θ = 0 ∨ θ = π

2 • θ = 0 ↔ θ = 0 ∨ θ = ↑π


theorem re_T_smul : (T • z).re = z.re + 1


lemma dual_involutive :
    Function.Involutive (dual A K : FractionalIdeal B⁰ L → FractionalIdeal B⁰ L)

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]

Function.Involutive (FractionalIdeal.dual A K)


@[deprecated filter_beq (since := "2023-12-14")]
theorem filter_beq' (l : List α) (a : α) : l.filter (a == ·) = replicate (count a l) a

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

List.filter (fun x => a == x) l = List.replicate (List.count a l) a


lemma shiftIso_hom_app_obj (n a a' : M) (ha' : n + a = a') (X : C) :
    (shiftIso L G M F' e' n a a' ha').hom.app (L.obj X) =
      (F' a).map ((L.commShiftIso n).inv.app X) ≫
        (e' a).hom.app (X⟦n⟧) ≫ (G.shiftIso n a a' ha').hom.app X ≫ (e' a').inv.app X

[((CategoryTheory.whiskeringLeft C D A).obj L).Full]

[((CategoryTheory.whiskeringLeft C D A).obj L).Faithful]

(CategoryTheory.Functor.ShiftSequence.induced.shiftIso L G M F' e' n a a' ha').hom.app (L.obj X) =
  (F' a).map ((L.commShiftIso n).inv.app X) ≫
    (e' a).hom.app ((CategoryTheory.shiftFunctor C n).obj X) ≫ (G.shiftIso n a a' ha').hom.app X ≫ (e' a').inv.app X


@[to_additive Ici_add_Ici_subset]
theorem Ici_mul_Ici_subset' [LocallyFiniteOrderTop α] (a b : α) : Ici a * Ici b ⊆ Ici (a * b)

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

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

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


theorem Ioo_subset_Ico_self : Ioo a b ⊆ Ico a b

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


theorem decompose {x y : ℤ} : (⟨x, y⟩ : ℤ√d) = x + sqrtd (d := d) * y

{ re := x, im := y } = ↑x + Zsqrtd.sqrtd * ↑y


/-- Symmetric statement to `Set.image2_image_left_anticomm`. -/
theorem image_image2_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {g' : β → β'}
    (h_antidistrib : ∀ a b, g (f a b) = f' (g' b) a) :
    (image2 f s t).image g = image2 f' (t.image g') s

{f : α → β → γ}

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

g '' Set.image2 f s t = Set.image2 f' (g' '' t) s


@[simp]
theorem hyperoperation_three : hyperoperation 3 = (· ^ ·)


@[simp]
theorem map_dfinsupp_sumAddHom [NonAssocSemiring R] [NonAssocSemiring S] [∀ i, AddZeroClass (β i)]
    (h : R →+* S) (f : Π₀ i, β i) (g : ∀ i, β i →+ R) :
    h (sumAddHom g f) = sumAddHom (fun i => h.toAddMonoidHom.comp (g i)) f

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
{R : Type u_1}
{S : Type u_2}
[NonAssocSemiring R]
[NonAssocSemiring S]
[(i : ι) → AddZeroClass (β i)]
(h : R →+* S)
(f : Π₀ (i : ι), β i)
(g : (i : ι) → β i →+ R)

h ((DFinsupp.sumAddHom g) f) = (DFinsupp.sumAddHom fun i => h.toAddMonoidHom.comp (g i)) f


/-- The recurrence relation for the `Γ` function. -/
theorem Gamma_add_one (s : ℂ) (h2 : s ≠ 0) : Gamma (s + 1) = s * Gamma s

Complex.Gamma (s + 1) = s * Complex.Gamma s


@[to_additive]
theorem period_pos_of_orderOf_pos {m : M} (order_pos : 0 < orderOf m) (a : α) :
    0 < period m a

{α : Type v}
{M : Type u}
[AddMonoid M]
[AddAction M α]
{m : M}
(order_pos : 0 < addOrderOf m)
(a : α)


theorem nonempty_of_mem {x u : PSet} (h : x ∈ u) : u.Nonempty


@[simp]
theorem support_erase (p : R[X]) (n : ℕ) : support (p.erase n) = (support p).erase n

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)

(Polynomial.erase n p).support = p.support.erase n


@[ext]
lemma hom_ext {M N : Action V G} (φ₁ φ₂ : M ⟶ N) (h : φ₁.hom = φ₂.hom) : φ₁ = φ₂

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
{M N : Action V G}
(φ₁ φ₂ : M ⟶ N)
(h : φ₁.hom = φ₂.hom)


@[simp]
theorem ClassGroup.equiv_mk0 [IsDedekindDomain R] (I : (Ideal R)⁰) :
    ClassGroup.equiv K (ClassGroup.mk0 I) =
      QuotientGroup.mk' (toPrincipalIdeal R K).range (FractionalIdeal.mk0 K I)

{R : Type u_1}
(K : Type u_2)
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDomain R]
[IsDedekindDomain R]
(I : ↥(Ideal R)⁰)

(ClassGroup.equiv K) (ClassGroup.mk0 I) = (QuotientGroup.mk' (toPrincipalIdeal R K).range) ((FractionalIdeal.mk0 K) I)


@[simp] protected theorem neg_eq_zero : -a = 0 ↔ a = 0


@[to_additive (attr := simp)]
lemma symm_mk_one [One M] : mk.symm (1 : Mᵈᵐᵃ) = 1


@[simp] lemma isSublattice_preimage_toDual {s : Set αᵒᵈ} :
    IsSublattice (toDual ⁻¹' s) ↔ IsSublattice s

{α : Type u_2}
[Lattice α]
{s : Set αᵒᵈ}

IsSublattice (⇑OrderDual.toDual ⁻¹' s) ↔ IsSublattice s


@[to_additive (attr := simp)]
theorem smul_aeeqFun_const (c : Mᵈᵐᵃ) (b : β) :
    c • (AEEqFun.const α b : α →ₘ[μ] β) = AEEqFun.const α b

[MeasureTheory.SMulInvariantMeasure M α μ]

c • MeasureTheory.AEEqFun.const α b = MeasureTheory.AEEqFun.const α b


theorem le_logb_iff_rpow_le_of_base_lt_one (hy : 0 < y) : x ≤ logb b y ↔ y ≤ b ^ x


@[to_additive (attr := simp)]
theorem sSup_one : sSup (1 : Set α) = 1

{α : Type u_1}
[CompleteLattice α]
[Zero α]


@[simp]
theorem uliftFunctor_obj {X : Type u} : uliftFunctor.obj.{v} X = ULift.{v} X

CategoryTheory.uliftFunctor.{v, u}.obj X = ULift.{v, u} X


lemma quasiIso_unopMap {S₁ S₂ : ShortComplex Cᵒᵖ} [S₁.HasHomology] [S₂.HasHomology]
    [S₁.unop.HasHomology] [S₂.unop.HasHomology]
    (φ : S₁ ⟶ S₂) [QuasiIso φ] : QuasiIso (unopMap φ)

{S₁ S₂ : CategoryTheory.ShortComplex Cᵒᵖ}


/-- The functor which sends a bicomplex to its total complex. -/
@[simps]
noncomputable def totalFunctor :
    HomologicalComplex₂ C c₁ c₂ ⥤ HomologicalComplex C c₁₂

[∀ (K : HomologicalComplex₂ C c₁ c₂), K.HasTotal c₁₂]

(HomologicalComplex₂.totalFunctor C c₁ c₂ c₁₂).obj K = K.total c₁₂


@[simp]
theorem destutter_nil : ([] : List α).destutter R = []

{α : Type u_1}
(R : α → α → Prop)
[DecidableRel R]


@[simp]
theorem not_one_lt (a : SignType) : ¬1 < a


theorem le_of_tendsto_of_tendsto' {f g : β → α} {b : Filter β} {a₁ a₂ : α} [NeBot b]
    (hf : Tendsto f b (𝓝 a₁)) (hg : Tendsto g b (𝓝 a₂)) (h : ∀ x, f x ≤ g x) : a₁ ≤ a₂

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[t : OrderClosedTopology α]
{f g : β → α}
{b : Filter β}
{a₁ a₂ : α}
[b.NeBot]
(hf : Filter.Tendsto f b (𝓝 a₁))
(hg : Filter.Tendsto g b (𝓝 a₂))
(h : ∀ (x : β), f x ≤ g x)


theorem Poly.mul.go_denote (ctx : Context) (k : Nat) (p : Poly) : (Poly.mul.go k p).denote ctx = k * p.denote ctx

(ctx : Nat.Linear.Context)
(k : Nat)
(p : Nat.Linear.Poly)

Nat.Linear.Poly.denote ctx (Nat.Linear.Poly.mul.go k p) = k * Nat.Linear.Poly.denote ctx p


@[simp]
lemma dualAnnihilator_ker_eq_range_flip [IsReflexive K V₂] :
    (ker B).dualAnnihilator = range B.flip

{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}
[Module.IsReflexive K V₂]

(LinearMap.ker B).dualAnnihilator = LinearMap.range B.flip


/-- A bimodule object for a pair of monoid objects, all internal to some monoidal category. -/
structure Bimod (A B : Mon_ C) where
  X : C
  actLeft : A.X ⊗ X ⟶ X
  one_actLeft : (A.one ▷ X) ≫ actLeft = (λ_ X).hom := by aesop_cat
  left_assoc :
    (A.mul ▷ X) ≫ actLeft = (α_ A.X A.X X).hom ≫ (A.X ◁ actLeft) ≫ actLeft := by aesop_cat
  actRight : X ⊗ B.X ⟶ X
  actRight_one : (X ◁ B.one) ≫ actRight = (ρ_ X).hom := by aesop_cat
  right_assoc :
    (X ◁ B.mul) ≫ actRight = (α_ X B.X B.X).inv ≫ (actRight ▷ B.X) ≫ actRight := by
    aesop_cat
  middle_assoc :
    (actLeft ▷ B.X) ≫ actRight = (α_ A.X X B.X).hom ≫ (A.X ◁ actRight) ≫ actLeft := by
    aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A B : Mon_ C}
(self : Bimod A B)

self.actLeft ▷ B.X ≫ self.actRight = (α_ A.X self.X B.X).hom ≫ A.X ◁ self.actRight ≫ self.actLeft


/-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
-/
class CircularPreorder (α : Type*) extends Btw α, SBtw α where
  /-- `a` is between `a` and `a`. -/
  btw_refl (a : α) : btw a a a
  /-- If `b` is between `a` and `c`, then `c` is between `b` and `a`.
  This is motivated by imagining three points on a circle. -/
  btw_cyclic_left {a b c : α} : btw a b c → btw b c a
  sbtw := fun a b c => btw a b c ∧ ¬btw c b a
  /-- Strict betweenness is given by betweenness in one direction and non-betweenness in the other.

  I.e., if `b` is between `a` and `c` but not between `c` and `a`, then we say `b` is strictly
  between `a` and `c`. -/
  sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by intros; rfl
  /-- For any fixed `c`, `fun a b ↦ sbtw a b c` is a transitive relation.

  I.e., given `a` `b` `d` `c` in that "order", if we have `b` strictly between `a` and `c`, and `d`
  strictly between `b` and `c`, then `d` is strictly between `a` and `c`. -/
  sbtw_trans_left {a b c d : α} : sbtw a b c → sbtw b d c → sbtw a d c

{α : Type u_1}
[self : CircularPreorder α]
(a : α)


@[simp]
theorem coe_prodComm : ⇑(prodComm I J M N n) = Prod.swap

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{G : Type u_7}
[TopologicalSpace G]
(I : ModelWithCorners 𝕜 E H)
(J : ModelWithCorners 𝕜 F G)
(M : Type u_9)
[TopologicalSpace M]
[ChartedSpace H M]
(N : Type u_11)
[TopologicalSpace N]
[ChartedSpace G N]
(n : ℕ∞)

⇑(Diffeomorph.prodComm I J M N n) = Prod.swap


/-- Group homomorphisms preserve integer power. -/
@[to_additive (attr := simp) (reorder := 9 10)
"Additive group homomorphisms preserve integer scaling."]
theorem map_zpow [Group G] [DivisionMonoid H] [MonoidHomClass F G H]
    (f : F) (g : G) (n : ℤ) : f (g ^ n) = f g ^ n

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[Group G]
[DivisionMonoid H]
[MonoidHomClass F G H]
(f : F)
(g : G)
(n : ℤ)


@[simp]
theorem MonoFactorisation.kernel_ι_comp [HasKernel f] (F : MonoFactorisation f) :
    kernel.ι f ≫ F.e = 0

(F : CategoryTheory.Limits.MonoFactorisation f)

CategoryTheory.Limits.kernel.ι f ≫ F.e = 0


theorem not_dvd_of_degree_lt {p q : R[X]} (h0 : q ≠ 0) (hl : q.degree < p.degree) : ¬p ∣ q

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p q : R[X]}
(h0 : q ≠ 0)
(hl : q.degree < p.degree)


theorem card_real_embeddings :
    card { φ : K →+* ℂ // ComplexEmbedding.IsReal φ } = NrRealPlaces K

(K : Type u_2)
[Field K]
[NumberField K]

Fintype.card { φ // NumberField.ComplexEmbedding.IsReal φ } = NumberField.InfinitePlace.NrRealPlaces K


theorem hasMFDerivWithinAt_extChartAt (h : y ∈ (chartAt H x).source) :
    HasMFDerivWithinAt I 𝓘(𝕜, E) (extChartAt I x) s y (mfderiv I I (chartAt H x) y : _)

{𝕜 : Type u_11}
[NontriviallyNormedField 𝕜]
{E : Type u_12}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_13}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_14}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{s : Set M}
{x y : M}
(h : y ∈ (chartAt H x).source)

HasMFDerivWithinAt I 𝓘(𝕜, E) (↑(extChartAt I x)) s y (mfderiv I I (↑(chartAt H x)) y)


@[simp]
lemma isStarNormal_inr : IsStarNormal (a : Unitization R A) ↔ IsStarNormal a

{R : Type u_1}
{A : Type u_2}
[Semiring R]
[AddCommMonoid A]
[Mul A]
[SMulWithZero R A]
[StarAddMonoid R]
[Star A]
{a : A}


lemma connected_iff_exists_forall_reachable : G.Connected ↔ ∃ v, ∀ w, G.Reachable v w

G.Connected ↔ ∃ v, ∀ (w : V), G.Reachable v w


theorem InjOn.encard_image (h : InjOn f s) : (f '' s).encard = s.encard

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


theorem map_extChartAt_symm_nhdsWithin (x : M) :
    map (extChartAt I x).symm (𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x x) =
      𝓝[s] 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)
{s : Set M}
[ChartedSpace H M]
(x : M)

Filter.map (↑(extChartAt I x).symm) (𝓝[↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I] ↑(extChartAt I x) x) = 𝓝[s] x


theorem Integrable.comp_mul_right' {g : ℝ → F} (hg : Integrable g) {R : ℝ} (hR : R ≠ 0) :
    Integrable fun x => g (x * R)

(hg : MeasureTheory.Integrable g MeasureTheory.volume)

MeasureTheory.Integrable (fun x => g (x * R)) MeasureTheory.volume


theorem Valid'.trans_right {t₁ t₂ : Ordnode α} {x : α} {o₁ o₂} (H : Valid' o₁ t₁ x)
    (h : Bounded t₂ x o₂) : Valid' o₁ t₁ o₂

{α : Type u_1}
[Preorder α]
{t₁ t₂ : Ordnode α}
{x : α}
{o₁ : WithBot α}
{o₂ : WithTop α}
(H : Ordnode.Valid' o₁ t₁ ↑x)
(h : t₂.Bounded (↑x) o₂)


@[to_additive]
theorem map_sup_comap_of_surjective (S T : Subsemigroup N) :
    (S.comap f ⊔ T.comap f).map f = S ⊔ T

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
(hf : Function.Surjective ⇑f)
(S T : Subsemigroup N)

Subsemigroup.map f (Subsemigroup.comap f S ⊔ Subsemigroup.comap f T) = S ⊔ T


@[simp]
theorem liftAlternating_one (f : ∀ i, M [⋀^Fin i]→ₗ[R] N) :
    liftAlternating (R := R) (M := M) (N := N) f (1 : ExteriorAlgebra R M) = f 0 0

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(f : (i : ℕ) → M [⋀^Fin i]→ₗ[R] N)

(ExteriorAlgebra.liftAlternating f) 1 = (f 0) 0


@[to_additive]
theorem MeasurePreserving.mul_left (μ : Measure G) [IsMulLeftInvariant μ] (g : G) {X : Type*}
    [MeasurableSpace X] {μ' : Measure X} {f : X → G} (hf : MeasurePreserving f μ' μ) :
    MeasurePreserving (fun x => g * f x) μ' μ

(hf : MeasureTheory.MeasurePreserving f μ' μ)

MeasureTheory.MeasurePreserving (fun x => g + f x) μ' μ


/-- The linear equivalence between `(α ⊕ β) →₀ M` and `(α →₀ M) × (β →₀ M)`.

This is the `LinearEquiv` version of `Finsupp.sumFinsuppEquivProdFinsupp`. -/
@[simps apply symm_apply]
def sumFinsuppLEquivProdFinsupp {α β : Type*} : (α ⊕ β →₀ M) ≃ₗ[R] (α →₀ M) × (β →₀ M)

{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_7}
{β : Type u_8}

∀ (a : (α →₀ M) × (β →₀ M)),
  (Finsupp.sumFinsuppLEquivProdFinsupp R).symm a = Finsupp.sumFinsuppAddEquivProdFinsupp.invFun a


@[fun_prop]
nonrec theorem HasFDerivAt.neg (h : HasFDerivAt f f' x) : HasFDerivAt (fun x => -f x) (-f') x

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


lemma map_id (P : W⟮F⟯) : map W (Algebra.ofId F F) P = P

(P : WeierstrassCurve.Affine.Point (WeierstrassCurve.baseChange W F))

(WeierstrassCurve.Affine.Point.map W (Algebra.ofId F F)) P = P


/-- An R-module is Noetherian iff all its submodules are finitely-generated. -/
theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG

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

IsNoetherian R M ↔ ∀ (s : Submodule R M), s.FG


@[simp]
lemma nonsingular_zero : W.Nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨ W.a₄ ≠ 0)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)


theorem isLittleO_norm_pow_id {n : ℕ} (h : 1 < n) :
    (fun x : E' => ‖x‖ ^ n) =o[𝓝 0] fun x => x

{E' : Type u_6}
[SeminormedAddCommGroup E']
{n : ℕ}
(h : 1 < n)


lemma δ_eq' {A : C} (x₃ : A ⟶ S.X₃.homology i) (x₂ : A ⟶ S.X₂.opcycles i)
    (x₁ : A ⟶ S.X₁.cycles j)
    (h₂ : x₂ ≫ HomologicalComplex.opcyclesMap S.g i = x₃ ≫ S.X₃.homologyι i)
    (h₁ : x₁ ≫ HomologicalComplex.cyclesMap S.f j = x₂ ≫ S.X₂.opcyclesToCycles i j) :
    x₃ ≫ hS.δ i j hij = x₁ ≫ S.X₁.homologyπ j

{S : CategoryTheory.ShortComplex (HomologicalComplex C c)}


/-- `ζ - 1` is prime if `ζ` is a primitive `p ^ (k + 1)`-th root of unity. -/
theorem zeta_sub_one_prime [IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) : Prime (hζ.toInteger - 1)


@[to_additive (attr := simp)]
theorem quot_liftOn_mk (β : Type v) (f : List (α × Bool) → β)
    (H : ∀ L₁ L₂, Red.Step L₁ L₂ → f L₁ = f L₂) : Quot.liftOn (mk L) f H = f L

(H : ∀ (L₁ L₂ : List (α × Bool)), FreeAddGroup.Red.Step L₁ L₂ → f L₁ = f L₂)

Quot.liftOn (FreeAddGroup.mk L) f H = f L


theorem log_lt_iff_lt_exp (hx : 0 < x) : log x < y ↔ x < exp y


/--
For a precoherent category, any sieve that contains an `EffectiveEpiFamily` is a sieve of the
coherent topology.
Note: This is one direction of `mem_sieves_iff_hasEffectiveEpiFamily`, but is needed for the proof.
-/
theorem coherentTopology.mem_sieves_of_hasEffectiveEpiFamily (S : Sieve X) :
    (∃ (α : Type) (_ : Finite α) (Y : α → C) (π : (a : α) → (Y a ⟶ X)),
      EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) →
        (S ∈ GrothendieckTopology.sieves (coherentTopology C) X)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Precoherent C]
{X : C}
(S : CategoryTheory.Sieve X)

(∃ α, ∃ (_ : Finite α), ∃ Y π, CategoryTheory.EffectiveEpiFamily Y π ∧ ∀ (a : α), S.arrows (π a)) →
  S ∈ (CategoryTheory.coherentTopology C).sieves X


@[simp]
theorem projIic_coe (x : Iic b) : projIic b x = x

{α : Type u_1}
[LinearOrder α]
{b : α}
(x : ↑(Set.Iic b))


theorem coe_mk (f) (h₁) (h₂) (h₃) : ⇑(⟨f, h₁, h₂, h₃⟩ : NormedAddGroupHom V₁ V₂) = f

(h₁ : ∀ (v₁ v₂ : V₁), f (v₁ + v₂) = f v₁ + f v₂)

⇑{ toFun := f, map_add' := h₁, bound' := ⋯ } = f


theorem one_le_mult {w : InfinitePlace K} : (1 : ℝ) ≤ mult w

{K : Type u_2}
[Field K]
{w : NumberField.InfinitePlace K}


theorem IsSelfAdjoint.spectralRadius_eq_nnnorm {a : A} (ha : IsSelfAdjoint a) :
    spectralRadius ℂ a = ‖a‖₊

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
{a : A}
(ha : IsSelfAdjoint a)


@[reassoc]
theorem comp_sum {P Q R : C} {J : Type*} (s : Finset J) (f : P ⟶ Q) (g : J → (Q ⟶ R)) :
    (f ≫ ∑ j ∈ s, g j) = ∑ j ∈ s, f ≫ g j

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{P Q R : C}
{J : Type u_1}
(s : Finset J)
(f : P ⟶ Q)
(g : J → (Q ⟶ R))


theorem any_iff_exists {p : α → Bool} : any l p ↔ ∃ a ∈ l, p a

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

l.any p = true ↔ ∃ a, a ∈ l ∧ p a = true


/-- The coevaluation map `Y → C(X, Y × X)` is continuous (always). -/
theorem continuous_coev : Continuous (coev X Y)

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]


@[simp]
theorem Ioo_insert_right (h : a < b) : insert b (Ioo a b) = Ioc a b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
{a b : α}
[DecidableEq α]
(h : a < b)

insert b (Finset.Ioo a b) = Finset.Ioc a b


/-- A coalgebra over a commutative (semi)ring `R` is an `R`-module equipped with a coassociative
comultiplication `Δ` and a counit `ε` obeying the left and right counitality laws. -/
class Coalgebra (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] extends CoalgebraStruct R A where
  /-- The comultiplication is coassociative -/
  coassoc : TensorProduct.assoc R A A A ∘ₗ comul.rTensor A ∘ₗ comul = comul.lTensor A ∘ₗ comul
  /-- The counit satisfies the left counitality law -/
  rTensor_counit_comp_comul : counit.rTensor A ∘ₗ comul = TensorProduct.mk R _ _ 1
  /-- The counit satisfies the right counitality law -/
  lTensor_counit_comp_comul : counit.lTensor A ∘ₗ comul = (TensorProduct.mk R _ _).flip 1

{R : Type u}
{A : Type v}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[self : Coalgebra R A]

LinearMap.rTensor A Coalgebra.counit ∘ₗ Coalgebra.comul = (TensorProduct.mk R R A) 1


@[simp]
theorem compl_symmDiff_compl : aᶜ ∆ bᶜ = a ∆ b

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


/-- If `N` is boundaryless, `∂(M×N) = ∂M × N`. -/
lemma boundary_of_boundaryless_right [J.Boundaryless] :
    (I.prod J).boundary (M × N) = Set.prod (I.boundary M) (univ : Set N)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace H' N]
(J : ModelWithCorners 𝕜 E' H')
[J.Boundaryless]

(I.prod J).boundary (M × N) = (I.boundary M).prod Set.univ


lemma map_map (P : W⟮F⟯) : map W g (map W f P) = map W (g.comp f) P

(P : WeierstrassCurve.Affine.Point (WeierstrassCurve.baseChange W F))

(WeierstrassCurve.Affine.Point.map W g) ((WeierstrassCurve.Affine.Point.map W f) P) =
  (WeierstrassCurve.Affine.Point.map W (g.comp f)) P


/-- The functor from augmented objects to arrows. -/
@[simps!]
def toArrow : Augmented C ⥤ Arrow C

(X : CategoryTheory.CosimplicialObject.Augmented C)

(CategoryTheory.CosimplicialObject.Augmented.toArrow.obj X).right = X.right.obj (SimplexCategory.mk 0)


theorem toGLPos_injective : Function.Injective (toGLPos : SpecialLinearGroup n R → GLPos n R)

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


/-- Left-composition gives a functor `(C ⥤ D) ⥤ ((D ⥤ E) ⥤ (C ⥤ E))`.

`(whiskeringLeft.obj F).obj G` is `F ⋙ G`, and
`(whiskeringLeft.obj F).map α` is `whiskerLeft F α`.
-/
@[simps]
def whiskeringLeft : (C ⥤ D) ⥤ (D ⥤ E) ⥤ C ⥤ E

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

∀ {X Y : CategoryTheory.Functor D E} (α : X ⟶ Y),
  ((CategoryTheory.whiskeringLeft C D E).obj F).map α = CategoryTheory.whiskerLeft F α


@[simp]
theorem comp_assoc {Q : Type*} [Monoid Q]
    {φ₁ : M →* N} {φ₂ : N →* P} {φ₁₂ : M →* P}
    (κ : CompTriple φ₁ φ₂ φ₁₂)
    {φ₃ : P →* Q} {φ₂₃ : N →* Q} (κ' : CompTriple φ₂ φ₃ φ₂₃)
    {φ₁₂₃ : M →* Q} :
    CompTriple φ₁ φ₂₃ φ₁₂₃ ↔ CompTriple φ₁₂ φ₃ φ₁₂₃

{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[Monoid M]
[Monoid N]
[Monoid P]
{Q : Type u_5}
[Monoid Q]
{φ₁ : M →* N}
{φ₂ : N →* P}
{φ₁₂ : M →* P}
(κ : φ₁.CompTriple φ₂ φ₁₂)
{φ₃ : P →* Q}
{φ₂₃ : N →* Q}
(κ' : φ₂.CompTriple φ₃ φ₂₃)
{φ₁₂₃ : M →* Q}

φ₁.CompTriple φ₂₃ φ₁₂₃ ↔ φ₁₂.CompTriple φ₃ φ₁₂₃


theorem BilinForm.toMatrix_compRight (B : BilinForm R₂ M₂) (f : M₂ →ₗ[R₂] M₂) :
    BilinForm.toMatrix b (B.compRight f) = BilinForm.toMatrix b B * LinearMap.toMatrix b b f

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(b : Basis n R₂ M₂)
(B : LinearMap.BilinForm R₂ M₂)
(f : M₂ →ₗ[R₂] M₂)

(BilinForm.toMatrix b) (B.compRight f) = (BilinForm.toMatrix b) B * (LinearMap.toMatrix b b) f


protected theorem Associated.lcm [GCDMonoid α]
    {a₁ a₂ b₁ b₂ : α} (ha : Associated a₁ a₂) (hb : Associated b₁ b₂) :
    Associated (lcm a₁ b₁) (lcm a₂ b₂)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{a₁ a₂ b₁ b₂ : α}
(ha : Associated a₁ a₂)
(hb : Associated b₁ b₂)


theorem cof_bsup_le_lift {o : Ordinal} {f : ∀ a < o, Ordinal} (H : ∀ i h, f i h < bsup.{u, v} o f) :
    cof (bsup.{u, v} o f) ≤ Cardinal.lift.{v, u} o.card

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

(H : ∀ (i : Ordinal.{u}) (h : i < o), f i h < o.bsup f)

(o.bsup f).cof ≤ Cardinal.lift.{v, u} o.card


lemma iCondIndepSet_iff_iCondIndep (s : ι → Set Ω) (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSet m' hm' s μ ↔ iCondIndep m' hm' (fun i ↦ generateFrom {s i}) μ

{Ω : Type u_1}
{ι : Type u_2}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
(s : ι → Set Ω)
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.iCondIndepSet m' hm' s μ ↔
  ProbabilityTheory.iCondIndep m' hm' (fun i => MeasurableSpace.generateFrom {s i}) μ


theorem constr_pow_algebraMap (pb : PowerBasis A S) {y : S'} (hy : aeval y (minpoly A pb.gen) = 0)
    (x : A) : pb.basis.constr A (fun i => y ^ (i : ℕ)) (algebraMap A S x) = algebraMap A S' x

(hy : (Polynomial.aeval y) (minpoly A pb.gen) = 0)

((pb.basis.constr A) fun i => y ^ ↑i) ((algebraMap A S) x) = (algebraMap A S') x


@[simp]
theorem one_apply (a : A) : (1 : AddAut A) a = a


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) {S T : Submonoid M} :
    a • S ≤ a • T ↔ S ≤ T

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[GroupWithZero α]
[MulDistribMulAction α M]
{a : α}
(ha : a ≠ 0)
{S T : Submonoid M}


theorem Prime.not_dvd_one {p : ℕ} (pp : Prime p) : ¬p ∣ 1


@[simp]
lemma mk_mem_sparsePairs (u v : Finset α) (ε : 𝕜) :
    (u, v) ∈ P.sparsePairs G ε ↔ u ∈ P.parts ∧ v ∈ P.parts ∧ u ≠ v ∧ G.edgeDensity u v < ε

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
(P : Finpartition A)
(G : SimpleGraph α)
[DecidableRel G.Adj]
(u v : Finset α)
(ε : 𝕜)

(u, v) ∈ P.sparsePairs G ε ↔ u ∈ P.parts ∧ v ∈ P.parts ∧ u ≠ v ∧ ↑(G.edgeDensity u v) < ε


/-- If an irreducible has a prime factorization,
  then it is an associate of one of its prime factors. -/
theorem prime_factors_irreducible [CancelCommMonoidWithZero α] {a : α} {f : Multiset α}
    (ha : Irreducible a) (pfa : (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a) : ∃ p, a ~ᵤ p ∧ f = {p}


theorem Integrable.congr {f g : α → β} (hf : Integrable f μ) (h : f =ᵐ[μ] g) : Integrable g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f g : α → β}
(hf : MeasureTheory.Integrable f μ)
(h : f =ᵐ[μ] g)


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

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

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


@[simp] theorem forall_apply_eq_imp_iff {f : α → β} {p : β → Prop} :
    (∀ b a, f a = b → p b) ↔ ∀ a, p (f a)

{α : Sort u_2}
{β : Sort u_1}
{f : α → β}
{p : β → Prop}

(∀ (b : β) (a : α), f a = b → p b) ↔ ∀ (a : α), p (f a)


theorem map_subtype_source {x : s} (hxe : (x : X) ∈ e.source) :
    e x ∈ (e.subtypeRestr hs).target

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{s : TopologicalSpace.Opens X}
(hs : Nonempty ↥s)
{x : ↥s}
(hxe : ↑x ∈ e.source)


@[simp]
theorem mk_coe' (f h₁ h₂ h₃ h₄) :
    (LinearEquiv.mk ⟨⟨f, h₁⟩, h₂⟩ (⇑e) h₃ h₄ : M₂ ≃ₛₗ[σ'] M) = e.symm

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

(h₂ : ∀ (m : S) (x : M₂), { toFun := f, map_add' := h₁ }.toFun (m • x) = σ' m • { toFun := f, map_add' := h₁ }.toFun x)

(h₃ : Function.LeftInverse ⇑e { toFun := f, map_add' := h₁, map_smul' := h₂ }.toFun)

(h₄ : Function.RightInverse ⇑e { toFun := f, map_add' := h₁, map_smul' := h₂ }.toFun)

{ toFun := f, map_add' := h₁, map_smul' := h₂, invFun := ⇑e, left_inv := h₃, right_inv := h₄ } = e.symm


/-- If `C` is filtered, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered. -/
theorem of_isRightAdjoint (R : C ⥤ D) [R.IsRightAdjoint] : IsFiltered D

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFiltered C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(R : CategoryTheory.Functor C D)
[R.IsRightAdjoint]


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

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

a⁻ᵐ = a⁻¹ ↔ a ≤ 1


@[simp]
theorem uniformSpace_comap_id {α : Type*} : UniformSpace.comap (id : α → α) = id


/-- Analyticity implies analyticity within any `s` -/
lemma AnalyticAt.analyticWithinAt {f : E → F} {s : Set E} {x : E} (h : AnalyticAt 𝕜 f x) :
    AnalyticWithinAt 𝕜 f s x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
{x : E}
(h : AnalyticAt 𝕜 f x)


@[to_additive]
theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k ∈ range n, b

{β : Type u_4}
[CommMonoid β]
(b : β)
(n : ℕ)


/-- Constructs a bundled linear map from a function and a proof that this function belongs to the
closure of the set of linear maps. -/
@[simps (config := .asFn)]
def linearMapOfMemClosureRangeCoe (f : M₁ → M₂)
    (hf : f ∈ closure (Set.range ((↑) : (M₁ →ₛₗ[σ] M₂) → M₁ → M₂))) : M₁ →ₛₗ[σ] M₂

(hf : f ∈ closure (Set.range DFunLike.coe))

⇑(linearMapOfMemClosureRangeCoe f hf) = (↑(addMonoidHomOfMemClosureRangeCoe f hf)).toFun


@[simp]
theorem mem_range {m n : ℕ} : m ∈ range n ↔ m < n


theorem compLeft_injective (B : BilinForm R₁ M₁) (b : B.Nondegenerate) :
    Function.Injective B.compLeft

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


@[simp]
theorem adjugate_one : adjugate (1 : Matrix n n α) = 1

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]


/-- An `R`-submodule of `M` is principal if it is generated by one element. -/
@[mk_iff]
class IsPrincipal (S : Submodule R M) : Prop where
  principal' : ∃ a, S = span R {a}

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{S : Submodule R M}
[self : S.IsPrincipal]


/-- Converse to the mean value inequality: if `f` is differentiable at `x₀` and `C`-lipschitz
on a neighborhood of `x₀` then its derivative at `x₀` has norm bounded by `C`. -/
theorem HasFDerivAt.le_of_lipschitzOn
    {f : E → F} {f' : E →L[𝕜] F} {x₀ : E} (hf : HasFDerivAt f f' x₀)
    {s : Set E} (hs : s ∈ 𝓝 x₀) {C : ℝ≥0} (hlip : LipschitzOnWith C f s) : ‖f'‖ ≤ C

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x₀ : E}
(hf : HasFDerivAt f f' x₀)
{s : Set E}
(hs : s ∈ 𝓝 x₀)
{C : ℝ≥0}
(hlip : LipschitzOnWith C f s)


@[simp]
theorem coe_sub (D1 D2 : Derivation R A M) : ⇑(D1 - D2) = D1 - D2

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
(D1 D2 : Derivation R A M)


@[simp]
theorem hcomp (x : (I ⋙ F).obj W) : (ρ ◫ σ).app W x = (G.map (ρ.app W)) (σ.app (I.obj W) x)

(F G : CategoryTheory.Functor C (Type w))

[𝒟 : CategoryTheory.Category.{u', u'} D]

(ρ ◫ σ).app W x = G.map (ρ.app W) (σ.app (I.obj W) x)


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

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


@[simp]
theorem alephIdx.relIso_coe : (alephIdx.relIso : Cardinal → Ordinal) = alephIdx


@[simp]
lemma binaryProductIso_inv_comp_snd_apply (a : C) (z : (prod F G).obj a) :
    (Limits.prod.snd (X := F)).app a ((binaryProductIso F G).inv.app a z) = z.2

(z : (CategoryTheory.FunctorToTypes.prod F G).obj a)

CategoryTheory.Limits.prod.snd.app a ((CategoryTheory.FunctorToTypes.binaryProductIso F G).inv.app a z) = z.2


@[simp]
lemma succAbove_ne_zero_zero [NeZero n] {a : Fin (n + 1)} (ha : a ≠ 0) : a.succAbove 0 = 0

{n : ℕ}
[NeZero n]
{a : Fin (n + 1)}
(ha : a ≠ 0)


/-- A weighted sum of pairwise subtractions, expressed as a subtraction of two `affineCombination`
expressions. -/
theorem sum_smul_vsub_eq_affineCombination_vsub (w : ι → k) (p₁ p₂ : ι → P) :
    (∑ i ∈ s, w i • (p₁ i -ᵥ p₂ i)) =
      s.affineCombination k p₁ w -ᵥ s.affineCombination k p₂ w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p₁ p₂ : ι → P)

∑ i ∈ s, w i • (p₁ i -ᵥ p₂ i) = (Finset.affineCombination k s p₁) w -ᵥ (Finset.affineCombination k s p₂) w


@[simp] theorem and_not_self : ∀ (x : Bool), (x && !x) = false


lemma finiteCoproduct.hom_ext {B : Stonean.{u}} (f g : finiteCoproduct X ⟶ B)
    (h : ∀ a : α, finiteCoproduct.ι X a ≫ f = finiteCoproduct.ι X a ≫ g) : f = g

(h : ∀ (a : α), Stonean.finiteCoproduct.ι X a ≫ f = Stonean.finiteCoproduct.ι X a ≫ g)


@[simp]
theorem coe_zsmul (s : Cₛ^n⟮I; F, V⟯) (z : ℤ) : ⇑(z • s : Cₛ^n⟮I; F, V⟯) = z • ⇑s

[TopologicalSpace (Bundle.TotalSpace F V)]


/-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
module. -/
theorem isNilpotent_toEnd_weightSpace_zero [IsNoetherian R M] (x : L) :
    _root_.IsNilpotent <| toEnd R L (weightSpace M (0 : L → R)) x

{R : Type u_2}
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsNoetherian R M]
(x : L)

IsNilpotent ((LieModule.toEnd R L ↥↑(LieModule.weightSpace M 0)) x)


/-- The operator norm of the first projection `E × F → E` is exactly 1 if `E` is nontrivial. -/
@[simp] lemma norm_fst [NormedAddCommGroup E] [NormedSpace 𝕜 E]
    [SeminormedAddCommGroup F] [NormedSpace 𝕜 F] [Nontrivial E] :
    ‖fst 𝕜 E F‖ = 1

(𝕜 : Type u_1)
(E : Type u_2)
(F : Type u_3)
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 F]
[Nontrivial E]


@[simp]
theorem pushforwardEq_hom_app {X Y : TopCat.{w}} {f g : X ⟶ Y}
    (h : f = g) (ℱ : X.Presheaf C) (U) :
    (pushforwardEq h ℱ).hom.app U = ℱ.map (eqToHom (by aesop_cat))

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
{f g : X ⟶ Y}
(h : f = g)
(ℱ : TopCat.Presheaf C X)
(U : (TopologicalSpace.Opens ↑Y)ᵒᵖ)

(TopCat.Presheaf.pushforwardEq h ℱ).hom.app U = ℱ.map (CategoryTheory.eqToHom ⋯)


theorem limsSup_eq_iInf_sSup {f : Filter α} : limsSup f = ⨅ s ∈ f, sSup s

{α : Type u_1}
[CompleteLattice α]
{f : Filter α}


theorem norm_nonzero_of_not_equiv_zero {f : PadicSeq p} (hf : ¬f ≈ 0) : f.norm ≠ 0

{p : ℕ}
[Fact (Nat.Prime p)]
{f : PadicSeq p}
(hf : ¬f ≈ 0)


@[simp] lemma not_nil_cons {h : G.Adj u v} {p : G.Walk v w} : ¬ (cons h p).Nil

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
{h : G.Adj u v}
{p : G.Walk v w}


@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_hom_fst_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).hom ≫ pullback.fst _ _ ≫ pullback.fst _ _ =
      pullback.fst _ _ ≫ pullback.snd _ _

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(CategoryTheory.Limits.diagonalObjPullbackFstIso f g).hom ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.snd g g ≫ g) f ≫
      CategoryTheory.Limits.pullback.fst g g =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst f g) (CategoryTheory.Limits.pullback.fst f g) ≫
    CategoryTheory.Limits.pullback.snd f g


@[to_additive (attr := simp)] lemma mabs_inv (a : α) : |a⁻¹|ₘ = |a|ₘ

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


/-- A smooth bump function is infinitely smooth. -/
protected theorem smooth : Smooth I 𝓘(ℝ) f

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


theorem minimum?_eq_some_iff' {xs : List Nat} :
    xs.minimum? = some a ↔ (a ∈ xs ∧ ∀ b ∈ xs, a ≤ b)

xs.minimum? = some a ↔ a ∈ xs ∧ ∀ (b : Nat), b ∈ xs → a ≤ b


@[simp]
theorem naturality {X Y : C} (α : yoneda.obj X ⟶ yoneda.obj Y) {Z Z' : C} (f : Z ⟶ Z')
    (h : Z' ⟶ X) : f ≫ α.app (op Z') h = α.app (op Z) (f ≫ h)

(α : CategoryTheory.yoneda.obj X ⟶ CategoryTheory.yoneda.obj Y)

CategoryTheory.CategoryStruct.comp f (α.app (Opposite.op Z') h) =
  α.app (Opposite.op Z) (CategoryTheory.CategoryStruct.comp f h)


@[simp]
theorem one_def : (epsilon : RegularExpression α) = 1


theorem compare_ge_iff_ge {a b : α} : (compare a b ≠ .lt) ↔ a ≥ b


/-- Given a function `f : E → F`, a formal multilinear series `p` and `n : ℕ`, we say that
`f` has `p` as a finite power series on the ball of radius `r > 0` around `x` if
`f (x + y) = ∑' pₘ yᵐ` for all `‖y‖ < r` and `pₙ = 0` for `n ≤ m`. -/
structure HasFiniteFPowerSeriesOnBall (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E)
    (n : ℕ) (r : ℝ≥0∞) extends HasFPowerSeriesOnBall f p x r : Prop where
  finite : ∀ (m : ℕ), n ≤ m → p m = 0

(self : HasFiniteFPowerSeriesOnBall f p x n r)


@[simp]
theorem star_iff [InvolutiveStar R] {x : R} : IsSelfAdjoint (star x) ↔ IsSelfAdjoint x

{R : Type u_1}
[InvolutiveStar R]
{x : R}


@[to_additive]
protected theorem Tendsto.div_div (hf : Tendsto m f₁ f₂) (hg : Tendsto m g₁ g₂) :
    Tendsto m (f₁ / g₁) (f₂ / g₂)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[SubtractionMonoid β]
[FunLike F α β]
[AddMonoidHomClass F α β]
(m : F)
{f₁ g₁ : Filter α}
{f₂ g₂ : Filter β}
(hf : Filter.Tendsto (⇑m) f₁ f₂)
(hg : Filter.Tendsto (⇑m) g₁ g₂)


@[norm_cast]
theorem WithBot.coe_sSup' [SupSet α] {s : Set α} (hs : s.Nonempty) (h's : BddAbove s) :
    ↑(sSup s) = (sSup ((fun (a : α) ↦ ↑a) '' s) : WithBot α)

{α : Type u_1}
[Preorder α]
[SupSet α]
{s : Set α}
(hs : s.Nonempty)
(h's : BddAbove s)


theorem det_eq_one_of_card_eq_zero {A : Matrix n n R} (h : Fintype.card n = 0) : det A = 1

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{A : Matrix n n R}
(h : Fintype.card n = 0)


/-- The circumradius of a triangle may be expressed explicitly as half the length of a side
divided by the absolute value of the sine of the angle at the third point (a version of the law
of sines or sine rule). -/
theorem dist_div_sin_oangle_div_two_eq_circumradius (t : Triangle ℝ P) {i₁ i₂ i₃ : Fin 3}
    (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) : dist (t.points i₁) (t.points i₃) /
      |Real.Angle.sin (∡ (t.points i₁) (t.points i₂) (t.points i₃))| / 2 = t.circumradius

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

dist (t.points i₁) (t.points i₃) / |(∡ (t.points i₁) (t.points i₂) (t.points i₃)).sin| / 2 =
  Affine.Simplex.circumradius t


theorem lt_iff_exists_add_pos_lt : a < b ↔ ∃ r : ℝ≥0, 0 < r ∧ a + r < b


private lemma lambda_not_dvd_y : ¬ λ ∣ S.y

(S : FermatLastTheoremForThreeGen.Solution hζ)

¬hζ.toInteger - 1 ∣ FermatLastTheoremForThreeGen.Solution.y S


@[simp]
theorem norm_neg ⦃f : lp E p⦄ : ‖-f‖ = ‖f‖

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
⦃f : ↥(lp E p)⦄


@[to_additive (attr := simp)]
theorem smul_set_nonempty : (a • s).Nonempty ↔ s.Nonempty

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


theorem birkhoffSum_add (f : α → α) (g : α → M) (m n : ℕ) (x : α) :
    birkhoffSum f g (m + n) x = birkhoffSum f g m x + birkhoffSum f g n (f^[m] x)

{α : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
(f : α → α)
(g : α → M)
(m n : ℕ)
(x : α)


theorem normalize_self (r : Rat) : normalize r.num r.den r.den_nz = r


@[simp]
theorem polar_smul_right_of_tower (a : S) (x y : M) : polar Q x (a • y) = a • polar Q x y

{S : Type u_1}
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)
[CommSemiring S]
[Algebra S R]
[Module S M]
[IsScalarTower S R M]
[Module S N]
[IsScalarTower S R N]
(a : S)
(x y : M)

QuadraticMap.polar (⇑Q) x (a • y) = a • QuadraticMap.polar (⇑Q) x y


theorem fromBlocks_add [Add α] (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) (A' : Matrix n l α) (B' : Matrix n m α) (C' : Matrix o l α)
    (D' : Matrix o m α) : fromBlocks A B C D + fromBlocks A' B' C' D' =
      fromBlocks (A + A') (B + B') (C + C') (D + D')

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[Add α]
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)
(A' : Matrix n l α)
(B' : Matrix n m α)
(C' : Matrix o l α)
(D' : Matrix o m α)

Matrix.fromBlocks A B C D + Matrix.fromBlocks A' B' C' D' = Matrix.fromBlocks (A + A') (B + B') (C + C') (D + D')


@[simp] lemma toENat_ofENat (n : ℕ∞) : toENat n = n


theorem exists_castSucc_eq {n : Nat} {i : Fin (n + 1)} : (∃ j, castSucc j = i) ↔ i ≠ last n


theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn 𝕜 f s) (hg : AnalyticOn 𝕜 g s) :
    AnalyticOn 𝕜 (f + g) s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hf : AnalyticOn 𝕜 f s)
(hg : AnalyticOn 𝕜 g s)


theorem core_union (s t : Set β) : r.core s ∪ r.core t ⊆ r.core (s ∪ t)

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)
(s t : Set β)


/-- A component of a transposed version of the inverse mates correspondence. -/
theorem mateEquiv_counit_symm (α : R₁ ⋙ G ⟶ H ⋙ R₂) (d : D) :
    L₂.map (α.app _) ≫ adj₂.counit.app _ =
      ((mateEquiv adj₁ adj₂).symm α).app _ ≫ H.map (adj₁.counit.app d)

{C : Type u₁}
{D : Type u₂}
{E : Type u₃}
{F : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.Category.{v₃, u₃} E]
[CategoryTheory.Category.{v₄, u₄} F]
{G : CategoryTheory.Functor C E}
{H : CategoryTheory.Functor D F}
{L₁ : CategoryTheory.Functor C D}
{R₁ : CategoryTheory.Functor D C}
{L₂ : CategoryTheory.Functor E F}
{R₂ : CategoryTheory.Functor F E}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(α : R₁.comp G ⟶ H.comp R₂)
(d : D)

CategoryTheory.CategoryStruct.comp (L₂.map (α.app d)) (adj₂.counit.app (H.obj d)) =
  CategoryTheory.CategoryStruct.comp (((CategoryTheory.mateEquiv adj₁ adj₂).symm α).app (R₁.obj d))
    (H.map (adj₁.counit.app d))


@[simp]
theorem model_infiniteTheory_iff : M ⊨ L.infiniteTheory ↔ Infinite M

(L : FirstOrder.Language)
{M : Type w}
[L.Structure M]


theorem integral_comp (g : F' → A) : ∫ (x : E'), g (f x) = ∫ (y : F'), g y

{E' : Type u_2}
{F' : Type u_3}
{A : Type u_4}
[NormedAddCommGroup E']
[InnerProductSpace ℝ E']
[FiniteDimensional ℝ E']
[MeasurableSpace E']
[BorelSpace E']
[NormedAddCommGroup F']
[InnerProductSpace ℝ F']
[FiniteDimensional ℝ F']
[MeasurableSpace F']
[BorelSpace F']
(f : E' ≃ₗᵢ[ℝ] F')
[NormedAddCommGroup A]
[NormedSpace ℝ A]
(g : F' → A)


@[to_additive all_zero_of_le_zero_le_of_sum_eq_zero]
lemma all_one_of_le_one_le_of_prod_eq_one :
    (∀ x ∈ s, (1 : α) ≤ x) → s.prod = 1 → ∀ x ∈ s, x = (1 : α)

{α : Type u_2}
[OrderedCommMonoid α]
{s : Multiset α}

(∀ x ∈ s, 1 ≤ x) → s.prod = 1 → ∀ x ∈ s, x = 1


theorem dist_eq_intro {n m k l : ℕ} (h : n + m = k + l) : dist n k = dist l m


@[simp] theorem coe_trans (f : α ≃ β) (g : β ≃ γ) : (f.trans g : α → γ) = g ∘ f

{α : Sort u}
{β : Sort v}
{γ : Sort w}
(f : α ≃ β)
(g : β ≃ γ)


@[reassoc (attr := simp)]
lemma toCycles_comp_leftHomologyπ : S.toCycles ≫ S.leftHomologyπ = 0

CategoryTheory.CategoryStruct.comp S.toCycles S.leftHomologyπ = 0


lemma LSeriesSummable.smul_iff {f : ℕ → ℂ} {c s : ℂ} (hc : c ≠ 0) :
    LSeriesSummable (c • f) s ↔ LSeriesSummable f s


theorem IsRegular.ord_pos {c : Cardinal} (H : c.IsRegular) : 0 < c.ord


/-- The sine of `π / 6` is `1 / 2`. -/
@[simp]
theorem sin_pi_div_six : sin (π / 6) = 1 / 2


protected theorem id_comp (F : C ⥤ D) : 𝟭 C ⋙ F = F

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

(CategoryTheory.Functor.id C).comp F = F


theorem lex_lt_of_lt [∀ i, PartialOrder (β i)] {r} (hwf : WellFounded r) {x y : ∀ i, β i}
    (hlt : x < y) : Pi.Lex r (@fun i => (· < ·)) x y

{ι : Type u_1}
{β : ι → Type u_2}
[(i : ι) → PartialOrder (β i)]
{r : ι → ι → Prop}
(hwf : WellFounded r)
{x y : (i : ι) → β i}
(hlt : x < y)


theorem NormedAddCommGroup.cauchy_series_of_le_geometric'' {C : ℝ} {u : ℕ → α} {N : ℕ} {r : ℝ}
    (hr₀ : 0 < r) (hr₁ : r < 1) (h : ∀ n ≥ N, ‖u n‖ ≤ C * r ^ n) :
    CauchySeq fun n ↦ ∑ k ∈ range (n + 1), u k

{α : Type u_1}
[SeminormedAddCommGroup α]
{C : ℝ}
{u : ℕ → α}
{N : ℕ}
{r : ℝ}
(hr₀ : 0 < r)
(hr₁ : r < 1)
(h : ∀ n ≥ N, ‖u n‖ ≤ C * r ^ n)

CauchySeq fun n => ∑ k ∈ Finset.range (n + 1), u k


/-- There exists a vertex of maximal degree. Note the assumption of being nonempty is necessary, as
the lemma implies there exists a vertex. -/
theorem exists_maximal_degree_vertex [DecidableRel G.Adj] [Nonempty V] :
    ∃ v, G.maxDegree = G.degree v

{V : Type u_1}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
[Nonempty V]


protected theorem add_lt_add_iff_right (c : Int) : a + c < b + c ↔ a < b


theorem mem_accepts {x : List α} : x ∈ M.accepts ↔ ∃ S ∈ M.accept, S ∈ M.evalFrom M.start x

{α : Type u}
{σ : Type v}
(M : NFA α σ)
{x : List α}


@[simp]
lemma toBlocks₂₁_diagonal (v : l ⊕ m → α) : toBlocks₂₁ (diagonal v) = 0

{l : Type u_1}
{m : Type u_2}
{α : Type u_12}
[DecidableEq l]
[DecidableEq m]
[Zero α]
(v : l ⊕ m → α)


@[reassoc]
theorem δ_comp_δ_self' {n} {i : Fin (n + 2)} {j : Fin (n + 3)} (H : j = Fin.castSucc i) :
    δ i ≫ δ j = δ i ≫ δ i.succ

{n : ℕ}
{i : Fin (n + 2)}
{j : Fin (n + 3)}
(H : j = i.castSucc)

SimplexCategory.δ i ≫ SimplexCategory.δ j = SimplexCategory.δ i ≫ SimplexCategory.δ i.succ


theorem IsBigO.of_bound (c : ℝ) (h : ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖) : f =O[l] g

(h : ∀ᶠ (x : α) in l, ‖f x‖ ≤ c * ‖g x‖)


protected theorem ne_zero [Nontrivial M₀] {ζ : M₀} (h : IsPrimitiveRoot ζ k) : k ≠ 0 → ζ ≠ 0

{k : ℕ}
{M₀ : Type u_7}
[CommMonoidWithZero M₀]
[Nontrivial M₀]
{ζ : M₀}
(h : IsPrimitiveRoot ζ k)

k ≠ 0 → ζ ≠ 0


theorem zigzag_equivalence : _root_.Equivalence (@Zigzag J _)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]


theorem Nat.ble_self_eq_true : (n : Nat) → Eq (Nat.ble n n) true


theorem mul_lt_mul_of_pos_left {a b c : Ordinal} (h : a < b) (c0 : 0 < c) : c * a < c * b


theorem LinearMap.toMatrixAlgEquiv_transpose_apply (f : M₁ →ₗ[R] M₁) (j : n) :
    (LinearMap.toMatrixAlgEquiv v₁ f)ᵀ j = v₁.repr (f (v₁ j))

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)
(f : M₁ →ₗ[R] M₁)
(j : n)

((LinearMap.toMatrixAlgEquiv v₁) f)ᵀ j = ⇑(v₁.repr (f (v₁ j)))


lemma smul_ne_zero_iff_left (hx : x ≠ 0) : c • x ≠ 0 ↔ c ≠ 0

{R : Type u_2}
{M : Type u_5}
[Zero R]
[Zero M]
[SMulWithZero R M]
[NoZeroSMulDivisors R M]
{c : R}
{x : M}
(hx : x ≠ 0)


theorem continuousOn_div : ContinuousOn (fun p : G₀ × G₀ => p.1 / p.2) { p | p.2 ≠ 0 }

{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]

ContinuousOn (fun p => p.1 / p.2) {p | p.2 ≠ 0}


@[to_additive]
theorem subset_mul_right {s : Set α} (t : Set α) (hs : (1 : α) ∈ s) : t ⊆ s * t

{α : Type u_2}
[AddZeroClass α]
{s : Set α}
(t : Set α)
(hs : 0 ∈ s)


@[simp]
theorem coe_subsingletonEquiv [Subsingleton α] :
    (subsingletonEquiv α : List α → Multiset α) = ofList

⇑(Multiset.subsingletonEquiv α) = Multiset.ofList


/-- Two vectors are in the same ray, or they are nonzero and the first is in the same ray as the
negation of the second, if and only if they are not linearly independent. -/
theorem sameRay_or_ne_zero_and_sameRay_neg_iff_not_linearIndependent {x y : M} :
    SameRay R x y ∨ x ≠ 0 ∧ y ≠ 0 ∧ SameRay R x (-y) ↔ ¬LinearIndependent R ![x, y]

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{x y : M}


theorem fiber_subset_ofLE {A B : DiscreteQuotient X} (h : A ≤ B) (a : A) :
    A.proj ⁻¹' {a} ⊆ B.proj ⁻¹' {ofLE h a}

{X : Type u_2}
[TopologicalSpace X]
{A B : DiscreteQuotient X}
(h : A ≤ B)
(a : Quotient A.toSetoid)

A.proj ⁻¹' {a} ⊆ B.proj ⁻¹' {DiscreteQuotient.ofLE h a}


@[simp]
theorem diagram_r : D.diagram.R = D.J

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


theorem range_snd : (snd R S).rangeS = ⊤

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]


@[simp]
theorem liftIsometry_apply_apply (f : ContinuousMultilinearMap 𝕜 E F) (x : ⨂[𝕜] i, E i) :
    liftIsometry 𝕜 E F f x = lift f.toMultilinearMap x

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

((PiTensorProduct.liftIsometry 𝕜 E F) f) x = (PiTensorProduct.lift f.toMultilinearMap) x


@[to_additive]
theorem mulLECancellable_one [Monoid α] [LE α] : MulLECancellable (1 : α)


@[simp]
theorem get_one (h : (1 : PartENat).Dom) : (1 : PartENat).get h = 1


/-- If the distances between distinct points in a (pseudo) metric space
are uniformly bounded away from zero, then the space has discrete topology. -/
lemma DiscreteTopology.of_forall_le_dist {α} [PseudoMetricSpace α] {r : ℝ} (hpos : 0 < r)
    (hr : Pairwise (r ≤ dist · · : α → α → Prop)) : DiscreteTopology α

(hr : Pairwise fun x x_1 => r ≤ dist x x_1)


theorem dvd_map_of_isScalarTower' (R : Type*) {S : Type*} (K L : Type*) [CommRing R]
    [CommRing S] [Field K] [CommRing L] [Algebra R S] [Algebra R K] [Algebra S L] [Algebra K L]
    [Algebra R L] [IsScalarTower R K L] [IsScalarTower R S L] (s : S) :
    minpoly K (algebraMap S L s) ∣ map (algebraMap R K) (minpoly R s)

(R : Type u_3)
{S : Type u_4}
(K : Type u_5)
(L : Type u_6)
[CommRing R]
[CommRing S]
[Field K]
[CommRing L]
[Algebra R S]
[Algebra R K]
[Algebra S L]
[Algebra K L]
[Algebra R L]
[IsScalarTower R K L]
[IsScalarTower R S L]
(s : S)

minpoly K ((algebraMap S L) s) ∣ Polynomial.map (algebraMap R K) (minpoly R s)


/-- If three points are not collinear, the angle between them is not π. -/
theorem angle_ne_pi_of_not_collinear {p₁ p₂ p₃ : P} (h : ¬Collinear ℝ ({p₁, p₂, p₃} : Set P)) :
    ∠ p₁ p₂ p₃ ≠ π

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


/-- We can reexpress a sum over `p.support` as a sum over `range n`,
for any `n` satisfying `p.natDegree < n`.
-/
theorem sum_over_range' [AddCommMonoid S] (p : R[X]) {f : ℕ → R → S} (h : ∀ n, f n 0 = 0) (n : ℕ)
    (w : p.natDegree < n) : p.sum f = ∑ a ∈ range n, f a (coeff p a)

{R : Type u}
{S : Type v}
[Semiring R]
[AddCommMonoid S]
(p : R[X])
{f : ℕ → R → S}
(h : ∀ (n : ℕ), f n 0 = 0)
(n : ℕ)
(w : p.natDegree < n)

p.sum f = ∑ a ∈ Finset.range n, f a (p.coeff a)


lemma cfcₙHom_le_iff {a : A} (ha : p a) {f g : C(σₙ R a, R)₀} :
    cfcₙHom ha f ≤ cfcₙHom ha g ↔ f ≤ g

[∀ (α : Type u_1) [inst : Zero α] [inst_1 : TopologicalSpace α], StarOrderedRing C(α, R)₀]


lemma Module.mem_support_iff :
    p ∈ Module.support R M ↔ Nontrivial (LocalizedModule p.asIdeal.primeCompl M)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{p : PrimeSpectrum R}


@[fun_prop]
theorem Continuous.comp_continuousOn'
    {α β γ : Type*} [TopologicalSpace α] [TopologicalSpace β] [TopologicalSpace γ] {g : β → γ}
    {f : α → β} {s : Set α} (hg : Continuous g) (hf : ContinuousOn f s) :
    ContinuousOn (fun x ↦ g (f x)) s

{α : Type u_7}
{β : Type u_8}
{γ : Type u_9}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
{g : β → γ}
{f : α → β}
{s : Set α}
(hg : Continuous g)
(hf : ContinuousOn f s)


theorem ext {s₁ s₂ : String} (h : s₁.data = s₂.data) : s₁ = s₂


theorem toPadicInt_comp_fromPadicInt_ext (x) :
    (toPadicInt p).comp (fromPadicInt p) x = RingHom.id ℤ_[p] x

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(x : ℤ_[p])

((WittVector.toPadicInt p).comp (WittVector.fromPadicInt p)) x = (RingHom.id ℤ_[p]) x


@[simp] lemma norm_toAdd (x) : ‖(toAdd x : E)‖ = ‖x‖

{E : Type u_2}
[Norm E]
(x : Multiplicative E)


/-- If `R` is of characteristic `p` and `p ∣ n`, then
`cyclotomic (n * p) R = (cyclotomic n R) ^ p`. -/
theorem cyclotomic_mul_prime_dvd_eq_pow (R : Type*) {p n : ℕ} [hp : Fact (Nat.Prime p)] [Ring R]
    [CharP R p] (hn : p ∣ n) : cyclotomic (n * p) R = cyclotomic n R ^ p

(R : Type u_1)
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
[Ring R]
[CharP R p]
(hn : p ∣ n)

Polynomial.cyclotomic (n * p) R = Polynomial.cyclotomic n R ^ p


@[to_additive sum_pos]
lemma one_lt_prod (hf : 1 < f) : 1 < ∏ i, f i

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCancelCommMonoid M]
{f : ι → M}
(hf : 1 < f)


@[simps]
instance refl (f : a ⟶ b) : BicategoricalCoherence f f

{B : Type u}
[CategoryTheory.Bicategory B]
{a b : B}
(f : a ⟶ b)


theorem eq_iff_abs_toReal_eq_of_sign_eq {θ ψ : Angle} (h : θ.sign = ψ.sign) :
    θ = ψ ↔ |θ.toReal| = |ψ.toReal|

{θ ψ : Real.Angle}
(h : θ.sign = ψ.sign)


theorem abs_abs_sub_abs_le_abs_sub (a b : α) : |(|a| - |b|)| ≤ |a - b|

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


theorem disc_ne_zero_iff_roots_nodup (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    P.disc ≠ 0 ↔ (map φ P).roots.Nodup

(h3 : (Cubic.map φ P).roots = {x, y, z})

P.disc ≠ 0 ↔ (Cubic.map φ P).roots.Nodup


@[simp]
theorem card_relations_sum (i : ℕ) :
    #((L.sum L').Relations i) =
      Cardinal.lift.{v'} #(L.Relations i) + Cardinal.lift.{v} #(L'.Relations i)

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(i : ℕ)

#((L.sum L').Relations i) = Cardinal.lift.{v', v} #(L.Relations i) + Cardinal.lift.{v, v'} #(L'.Relations i)


/-- If the quasispectrum of an element restricts to a smaller scalar ring, then a non-unital
continuous functional calculus over the larger scalar ring descends to the smaller one. -/
@[simps!]
def nonUnitalStarAlgHom {R : Type u} {S : Type v} {A : Type w} [Semifield R]
    [StarRing R] [TopologicalSpace R] [TopologicalSemiring R] [ContinuousStar R] [Field S]
    [StarRing S] [TopologicalSpace S] [TopologicalRing S] [ContinuousStar S] [NonUnitalRing A]
    [StarRing A] [Algebra R S] [Module R A] [Module S A] [IsScalarTower S A A] [SMulCommClass S A A]
    [IsScalarTower R S A] [StarModule R S] [ContinuousSMul R S] {a : A}
    (φ : C(σₙ S a, S)₀ →⋆ₙₐ[S] A) {f : C(S, R)} (h : QuasispectrumRestricts a f) :
    C(σₙ R a, R)₀ →⋆ₙₐ[R] A

(φ : ContinuousMapZero (↑(quasispectrum S a)) S →⋆ₙₐ[S] A)

∀ (a_1 : ContinuousMapZero (↑(quasispectrum R a)) R),
  (QuasispectrumRestricts.nonUnitalStarAlgHom φ h) a_1 =
    φ
      ({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯, map_zero' := ⋯ }.comp
        (a_1.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯, map_zero' := ⋯ }))


theorem Convex.min_le_combo (x y : E) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
    min x y ≤ a • x + b • y

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{a b : 𝕜}
(x y : E)
(ha : 0 ≤ a)
(hb : 0 ≤ b)
(hab : a + b = 1)


@[simp]
theorem succ_zero : succ (0 : Ordinal) = 1


/-- The projection on the `i`-th coordinate of `EuclideanSpace 𝕜 ι`,
as a continuous linear map. -/
@[simps! apply coe]
def EuclideanSpace.proj (i : ι) : EuclideanSpace 𝕜 ι →L[𝕜] 𝕜

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
(i : ι)

↑(EuclideanSpace.proj i) = EuclideanSpace.projₗ i


theorem coeff_prod_of_natDegree_le (f : ι → R[X]) (n : ℕ) (h : ∀ p ∈ s, natDegree (f p) ≤ n) :
    coeff (∏ i ∈ s, f i) (s.card * n) = ∏ i ∈ s, coeff (f i) n

{R : Type u}
{ι : Type w}
(s : Finset ι)
[CommSemiring R]
(f : ι → R[X])
(n : ℕ)
(h : ∀ p ∈ s, (f p).natDegree ≤ n)

(∏ i ∈ s, f i).coeff (s.card * n) = ∏ i ∈ s, (f i).coeff n


@[fun_prop]
theorem hasFDerivAt_fst : HasFDerivAt (@Prod.fst E F) (fst 𝕜 E F) p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}

HasFDerivAt Prod.fst (ContinuousLinearMap.fst 𝕜 E F) p


theorem sub_mem_ker_iff {x y} : x - y ∈ ker f ↔ f x = f y

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Ring R]
[Ring R₂]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_12}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
{f : F}
{x y : M}


@[simp]
theorem cast_cast {n'' : ℕ} (h : n = n') (h' : n' = n'') :
    Sym.cast h' (Sym.cast h s) = Sym.cast (h.trans h') s

(Sym.cast h') ((Sym.cast h) s) = (Sym.cast ⋯) s


theorem GoodProducts.Plimit (o : Ordinal) (ho : Ordinal.IsLimit o) :
    (∀ (o' : Ordinal), o' < o → P I o') → P I o

{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]
(o : Ordinal.{u})
(ho : o.IsLimit)

(∀ o' < o, Profinite.NobelingProof.P I o') → Profinite.NobelingProof.P I o


/-- Variant of `lt_mul_of_one_lt_left` for `b` negative instead of positive. -/
theorem mul_lt_of_one_lt_left [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    (hb : b < 0) (h : 1 < a) : a * b < b

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

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


theorem IsBounded.isCobounded_ge [Preorder α] [NeBot f] (h : f.IsBounded (· ≤ ·)) :
    f.IsCobounded (· ≥ ·)

(h : Filter.IsBounded (fun x x_1 => x ≤ x_1) f)

Filter.IsCobounded (fun x x_1 => x ≥ x_1) f


theorem lt_fold_max : c < s.fold max b f ↔ c < b ∨ ∃ x ∈ s, c < f x

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

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


theorem π_tensor_id_actRight :
    (coequalizer.π _ _ ▷ T.X) ≫ actRight P Q =
      (α_ _ _ _).hom ≫ (P.X ◁ Q.actRight) ≫ coequalizer.π _ _

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

CategoryTheory.Limits.coequalizer.π (P.actRight ▷ Q.X) ((α_ P.X S.X Q.X).hom ≫ P.X ◁ Q.actLeft) ▷ T.X ≫
    Bimod.TensorBimod.actRight P Q =
  (α_ P.X Q.X T.X).hom ≫
    P.X ◁ Q.actRight ≫ CategoryTheory.Limits.coequalizer.π (P.actRight ▷ Q.X) ((α_ P.X S.X Q.X).hom ≫ P.X ◁ Q.actLeft)


theorem lfp_le_fixed {a : α} (h : f a = a) : lfp f ≤ a

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{a : α}
(h : f a = a)


@[to_additive]
theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
    ∃ x : α, ∀ y : α, y ∈ Submonoid.powers x

{α : Type u}
[Group α]
[Finite α]
[IsCyclic α]


/-- **Harris-Kleitman inequality**: Upper sets and lower sets of finsets anticorrelate. -/
theorem IsUpperSet.card_inter_le_finset (h𝒜 : IsUpperSet (𝒜 : Set (Finset α)))
    (hℬ : IsLowerSet (ℬ : Set (Finset α))) :
    2 ^ Fintype.card α * (𝒜 ∩ ℬ).card ≤ 𝒜.card * ℬ.card

{α : Type u_1}
[DecidableEq α]
{𝒜 ℬ : Finset (Finset α)}
[Fintype α]
(h𝒜 : IsUpperSet ↑𝒜)
(hℬ : IsLowerSet ↑ℬ)


@[simp, norm_cast]
theorem down_natCast [NatCast α] (n : ℕ) : down (n : ULift α) = n


theorem modifyNth_eq_take_cons_drop (f : α → α) {n l} (h : n < length l) :
    modifyNth f n l = take n l ++ f l[n] :: drop (n + 1) l

{α : Type u_1}
(f : α → α)
{n : Nat}
{l : List α}
(h : n < l.length)

List.modifyNth f n l = List.take n l ++ f l[n] :: List.drop (n + 1) l


@[simp, norm_cast] lemma coe_mul (a b : α) : (↑(a * b) : WithZero α) = a * b


@[simp]
theorem ListBlank.bind_mk {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (l : List Γ) (f : Γ → List Γ') (hf) :
    (ListBlank.mk l).bind f hf = ListBlank.mk (l.bind f)

(hf : ∃ n, f default = List.replicate n default)

(Turing.ListBlank.mk l).bind f hf = Turing.ListBlank.mk (l.bind f)


private theorem a_id_helper {a b : ℕ} (ha : 2 ≤ a) (hb : 2 ≤ b) : 2 ≤ (a ^ b - 1) / (a - 1)


theorem coe_mk (f T h₁ I h₂ h₃ a) : (@Ctop.mk α σ f T h₁ I h₂ h₃) a = f a

(I : (a b : σ) → (x : α) → x ∈ f a ∩ f b → σ)

(h₂ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), x ∈ f (I a b x h))

(h₃ : ∀ (a b : σ) (x : α) (h : x ∈ f a ∩ f b), f (I a b x h) ⊆ f a ∩ f b)

{ f := f, top := T, top_mem := h₁, inter := I, inter_mem := h₂, inter_sub := h₃ }.f a = f a


theorem eLpNorm_indicator_sub_indicator (s t : Set α) (f : α → E) :
    eLpNorm (s.indicator f - t.indicator f) p μ = eLpNorm ((s ∆ t).indicator f) p μ

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

MeasureTheory.eLpNorm (s.indicator f - t.indicator f) p μ = MeasureTheory.eLpNorm ((symmDiff s t).indicator f) p μ


/-- A set `s` is irreducible if and only if
for every finite collection of open sets all of whose members intersect `s`,
`s` also intersects the intersection of the entire collection
(i.e., there is an element of `s` contained in every member of the collection). -/
theorem isIrreducible_iff_sInter :
    IsIrreducible s ↔
      ∀ (U : Finset (Set X)), (∀ u ∈ U, IsOpen u) → (∀ u ∈ U, (s ∩ u).Nonempty) →
        (s ∩ ⋂₀ ↑U).Nonempty

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


@[simp] lemma Equiv.embeddingFinSucc_snd {n : ℕ} {ι : Type*} (e : Fin (n+1) ↪ ι) :
    ((Equiv.embeddingFinSucc n ι e).2 : ι) = e 0

{n : ℕ}
{ι : Type u_1}
(e : Fin (n + 1) ↪ ι)

↑((Equiv.embeddingFinSucc n ι) e).snd = e 0


@[simp]
theorem head_empty : "".data.head! = default


theorem range_coe : range (some : α → WithTop α) = Iio ⊤


theorem join_cons_cons (a b : α) (s S) :
    join (cons (a, cons b s) S) = cons a (join (cons (b, s) S))

{α : Type u}
(a b : α)
(s : Stream'.Seq α)
(S : Stream'.Seq (Stream'.Seq1 α))

(Stream'.Seq.cons (a, Stream'.Seq.cons b s) S).join = Stream'.Seq.cons a (Stream'.Seq.cons (b, s) S).join


theorem isIntegral_iff {x : K} : IsIntegral R x ↔ ∃ y : R, algebraMap R K y = x

{R : Type u_1}
[CommRing R]
[iic : IsIntegrallyClosed R]
{K : Type u_3}
[CommRing K]
[Algebra R K]
[ifr : IsFractionRing R K]
{x : K}

IsIntegral R x ↔ ∃ y, (algebraMap R K) y = x


/-- The category of cones on `F` is just the comma category `(Δ ↓ F)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cone.equivCostructuredArrow (F : J ⥤ C) : Cone F ≌ CostructuredArrow (const J) F

(X : CategoryTheory.CostructuredArrow (CategoryTheory.Functor.const J) F)

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).counitIso.inv.app X).left =
  CategoryTheory.CategoryStruct.id X.left


/-- The `PowerBasis` given by a primitive root `η`. -/
@[simps!]
protected noncomputable def powerBasis : PowerBasis K L

{n : ℕ+}
(K : Type u)
{L : Type v}
[Field K]
[CommRing L]
[IsDomain L]
[Algebra K L]
[IsCyclotomicExtension {n} K L]
{ζ : L}
(hζ : IsPrimitiveRoot ζ ↑n)

(IsPrimitiveRoot.powerBasis K hζ).gen = ζ


theorem add_apply (f g : M →ₗ⁅R,L⁆ N) (m : M) : (f + g) m = f m + g m

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


/-- The functor `Cᵒᵖ ⥤ C ⥤ AddCommGrp` which sends `X : C` and `Y : C`
to `Ext X Y n`. -/
@[simps]
noncomputable def extFunctor (n : ℕ) : Cᵒᵖ ⥤ C ⥤ AddCommGrp.{w}

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
(n : ℕ)
(X : Cᵒᵖ)

(CategoryTheory.Abelian.extFunctor n).obj X = CategoryTheory.Abelian.extFunctorObj (Opposite.unop X) n


theorem dualCoannihilator_sup_eq (U V : Submodule R (Module.Dual R M)) :
    (U ⊔ V).dualCoannihilator = U.dualCoannihilator ⊓ V.dualCoannihilator

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(U V : Submodule R (Module.Dual R M))


theorem first_of_chain_isUnit {q : Associates M} {n : ℕ} {c : Fin (n + 1) → Associates M}
    (h₁ : StrictMono c) (h₂ : ∀ {r}, r ≤ q ↔ ∃ i, r = c i) : IsUnit (c 0)

(h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i)


theorem degree_lt_card_verts [DecidableRel G.Adj] (v : V) : G.degree v < Fintype.card V

{V : Type u_1}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
(v : V)


/-- `rootOfSplits'` is definitionally equal to `rootOfSplits`. -/
theorem rootOfSplits'_eq_rootOfSplits {f : K[X]} (hf : f.Splits i) (hfd) :
    rootOfSplits' i hf hfd = rootOfSplits i hf (f.degree_map i ▸ hfd)

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

Polynomial.rootOfSplits' i hf hfd = Polynomial.rootOfSplits i hf ⋯


theorem C_content_dvd (p : R[X]) : C p.content ∣ p

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


theorem mul_invOf_self_assoc [Monoid α] (a b : α) [Invertible a] : a * (⅟ a * b) = b

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


@[to_additive]
theorem pow_smul_eq_iff_period_dvd {n : ℕ} {m : M} {a : α} :
    m ^ n • a = a ↔ period m a ∣ n

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

m ^ n • a = a ↔ MulAction.period m a ∣ n


theorem linearIndependent_span (hs : LinearIndependent R v) :
    LinearIndependent R (M := span R (range v))
      (fun i : ι => ⟨v i, subset_span (mem_range_self i)⟩)

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(hs : LinearIndependent R v)


/-- An Abelian group is equivalent to its own abelianization. -/
@[simps]
def Abelianization.equivOfComm {H : Type*} [CommGroup H] : H ≃* Abelianization H

Abelianization.equivOfComm a = Abelianization.of a


theorem pow_two_pow_sub_pow_two_pow [CommRing R] {x y : R} (n : ℕ) :
    x ^ 2 ^ n - y ^ 2 ^ n = (∏ i ∈ Finset.range n, (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)

{R : Type u_1}
[CommRing R]
{x y : R}
(n : ℕ)


lemma edist_eq_top_of_not_reachable (h : ¬G.Reachable u v) :
    G.edist u v = ⊤

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(h : ¬G.Reachable u v)


@[simp]
theorem sum_hom {X Y : Action V G} {ι : Type*} (f : ι → (X ⟶ Y)) (s : Finset ι) :
    (s.sum f).hom = s.sum fun i => (f i).hom

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
[CategoryTheory.Preadditive V]
{X Y : Action V G}
{ι : Type u_1}
(f : ι → (X ⟶ Y))
(s : Finset ι)


@[simp]
theorem toNFA_evalFrom_match (M : DFA α σ) (start : σ) (s : List α) :
    M.toNFA.evalFrom {start} s = {M.evalFrom start s}

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


theorem mem_mul : x ∈ l * m ↔ ∃ a ∈ l, ∃ b ∈ m, a ++ b = x

{α : Type u_1}
{l m : Language α}
{x : List α}


lemma charpoly_nilpotent_tfae [IsNoetherian R M] (φ : Module.End R M) :
    List.TFAE [
      IsNilpotent φ,
      φ.charpoly = X ^ finrank R M,
      ∀ m : M, ∃ (n : ℕ), (φ ^ n) m = 0,
      natTrailingDegree φ.charpoly = finrank R M ]

{R : Type u_1}
{M : Type u_3}
[CommRing R]
[IsDomain R]
[AddCommGroup M]
[Module R M]
[Module.Finite R M]
[Module.Free R M]
[IsNoetherian R M]
(φ : Module.End R M)

[IsNilpotent φ, LinearMap.charpoly φ = Polynomial.X ^ FiniteDimensional.finrank R M, ∀ (m : M), ∃ n, (φ ^ n) m = 0,
    (LinearMap.charpoly φ).natTrailingDegree = FiniteDimensional.finrank R M].TFAE


lemma refl {X Y : C} (z : W.LeftFraction X Y) : LeftFractionRel z z

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(z : W.LeftFraction X Y)


/--
In a monoidal category, we can take the tensor product of objects, `X ⊗ Y` and of morphisms `f ⊗ g`.
Tensor product does not need to be strictly associative on objects, but there is a
specified associator, `α_ X Y Z : (X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)`. There is a tensor unit `𝟙_ C`,
with specified left and right unitor isomorphisms `λ_ X : 𝟙_ C ⊗ X ≅ X` and `ρ_ X : X ⊗ 𝟙_ C ≅ X`.
These associators and unitors satisfy the pentagon and triangle equations.

See <https://stacks.math.columbia.edu/tag/0FFK>.
-/
-- Porting note: The Mathport did not translate the temporary notation
class MonoidalCategory (C : Type u) [𝒞 : Category.{v} C] extends MonoidalCategoryStruct C where
  tensorHom_def {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    f ⊗ g = (f ▷ X₂) ≫ (Y₁ ◁ g) := by
      aesop_cat
  /-- Tensor product of identity maps is the identity: `(𝟙 X₁ ⊗ 𝟙 X₂) = 𝟙 (X₁ ⊗ X₂)` -/
  tensor_id : ∀ X₁ X₂ : C, 𝟙 X₁ ⊗ 𝟙 X₂ = 𝟙 (X₁ ⊗ X₂) := by aesop_cat
  /--
  Composition of tensor products is tensor product of compositions:
  `(f₁ ⊗ g₁) ∘ (f₂ ⊗ g₂) = (f₁ ∘ f₂) ⊗ (g₁ ⊗ g₂)`
  -/
  tensor_comp :
    ∀ {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : Y₁ ⟶ Z₁) (g₂ : Y₂ ⟶ Z₂),
      (f₁ ≫ g₁) ⊗ (f₂ ≫ g₂) = (f₁ ⊗ f₂) ≫ (g₁ ⊗ g₂) := by
    aesop_cat
  whiskerLeft_id : ∀ (X Y : C), X ◁ 𝟙 Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  id_whiskerRight : ∀ (X Y : C), 𝟙 X ▷ Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  /-- Naturality of the associator isomorphism: `(f₁ ⊗ f₂) ⊗ f₃ ≃ f₁ ⊗ (f₂ ⊗ f₃)` -/
  associator_naturality :
    ∀ {X₁ X₂ X₃ Y₁ Y₂ Y₃ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃),
      ((f₁ ⊗ f₂) ⊗ f₃) ≫ (α_ Y₁ Y₂ Y₃).hom = (α_ X₁ X₂ X₃).hom ≫ (f₁ ⊗ (f₂ ⊗ f₃)) := by
    aesop_cat
  /--
  Naturality of the left unitor, commutativity of `𝟙_ C ⊗ X ⟶ 𝟙_ C ⊗ Y ⟶ Y` and `𝟙_ C ⊗ X ⟶ X ⟶ Y`
  -/
  leftUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), 𝟙_ _ ◁ f ≫ (λ_ Y).hom = (λ_ X).hom ≫ f := by
    aesop_cat
  /--
  Naturality of the right unitor: commutativity of `X ⊗ 𝟙_ C ⟶ Y ⊗ 𝟙_ C ⟶ Y` and `X ⊗ 𝟙_ C ⟶ X ⟶ Y`
  -/
  rightUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), f ▷ 𝟙_ _ ≫ (ρ_ Y).hom = (ρ_ X).hom ≫ f := by
    aesop_cat
  /--
  The pentagon identity relating the isomorphism between `X ⊗ (Y ⊗ (Z ⊗ W))` and `((X ⊗ Y) ⊗ Z) ⊗ W`
  -/
  pentagon :
    ∀ W X Y Z : C,
      (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom ≫ W ◁ (α_ X Y Z).hom =
        (α_ (W ⊗ X) Y Z).hom ≫ (α_ W X (Y ⊗ Z)).hom := by
    aesop_cat
  /--
  The identity relating the isomorphisms between `X ⊗ (𝟙_ C ⊗ Y)`, `(X ⊗ 𝟙_ C) ⊗ Y` and `X ⊗ Y`
  -/
  triangle :
    ∀ X Y : C, (α_ X (𝟙_ _) Y).hom ≫ X ◁ (λ_ Y).hom = (ρ_ X).hom ▷ Y := by
    aesop_cat

[self : CategoryTheory.MonoidalCategory C]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.associator W X Y).hom Z)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).hom
      (CategoryTheory.MonoidalCategory.whiskerLeft W (CategoryTheory.MonoidalCategory.associator X Y Z).hom)) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).hom
    (CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom


/-- Inversion on a group is a `MulEquiv` to the opposite group. When `G` is commutative, there is
`MulEquiv.inv`. -/
@[to_additive (attr := simps! (config := { fullyApplied := false, simpRhs := true }))
      "Negation on an additive group is an `AddEquiv` to the opposite group. When `G`
      is commutative, there is `AddEquiv.inv`."]
def MulEquiv.inv' (G : Type*) [DivisionMonoid G] : G ≃* Gᵐᵒᵖ

⇑(MulEquiv.inv' G) = MulOpposite.op ∘ Inv.inv


@[simp] theorem shiftLeft_eq (x : BitVec w) (n : Nat)     : BitVec.shiftLeft x n = x <<< n


lemma HasFiniteIntegral.restrict (h : HasFiniteIntegral f μ) {s : Set α} :
    HasFiniteIntegral f (μ.restrict s)

(h : MeasureTheory.HasFiniteIntegral f μ)

MeasureTheory.HasFiniteIntegral f (μ.restrict s)


/-- For filtrations indexed by a discrete order, `Adapted` and `ProgMeasurable` are equivalent.
This lemma provides `Adapted f u → ProgMeasurable f u`.
See `ProgMeasurable.adapted` for the reverse direction, which is true more generally. -/
theorem Adapted.progMeasurable_of_discrete [TopologicalSpace ι] [DiscreteTopology ι]
    [SecondCountableTopology ι] [MeasurableSpace ι] [OpensMeasurableSpace ι]
    [PseudoMetrizableSpace β] (h : Adapted f u) : ProgMeasurable f u

{u : ι → Ω → β}


/-- The reciprocal of the Gamma function is differentiable everywhere
(including the points where Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹

Differentiable ℂ fun s => (Complex.Gamma s)⁻¹


@[simp] lemma mem_piDiag : f ∈ s.piDiag ι ↔ ∃ a ∈ s, const ι a = f

{α : Type u_1}
{ι : Type u_2}
[DecidableEq (ι → α)]
{s : Finset α}
{f : ι → α}

f ∈ s.piDiag ι ↔ ∃ a ∈ s, Function.const ι a = f


protected theorem pow_add' (a m n : Nat) : a ^ (m + n) = a ^ n * a ^ m


/-- Functor composition induces a functor on augmented simplicial objects. -/
@[simps]
def whiskering (D : Type u') [Category.{v'} D] : (C ⥤ D) ⥤ Augmented C ⥤ Augmented D

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

∀ {X Y : C ⥤ D} (η : X ⟶ Y) (A : CategoryTheory.SimplicialObject.Augmented C),
  (((CategoryTheory.SimplicialObject.Augmented.whiskering C D).map η).app A).left =
    CategoryTheory.whiskerLeft (CategoryTheory.SimplicialObject.Augmented.drop.obj A) η


@[simp]
theorem ediam_Ioo (a b : ℝ) : EMetric.diam (Ioo a b) = ENNReal.ofReal (b - a)

EMetric.diam (Set.Ioo a b) = ENNReal.ofReal (b - a)


@[simp]
theorem isCycleOn_empty : f.IsCycleOn ∅


@[to_additive]
theorem comap_ker (g : N →* P) (f : G →* N) : g.ker.comap f = (g.comp f).ker

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
{P : Type u_6}
[AddGroup N]
[AddGroup P]
(g : N →+ P)
(f : G →+ N)

AddSubgroup.comap f g.ker = (g.comp f).ker


theorem mem_iff_exists {x : α} {z : Sym2 α} : x ∈ z ↔ ∃ y : α, z = s(x, y)


theorem subset_union_of_subset_left {s t : Set α} (h : s ⊆ t) (u : Set α) : s ⊆ t ∪ u

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


@[to_additive le_prod_iff]
theorem le_prod_iff {s : Submonoid M} {t : Submonoid N} {u : Submonoid (M × N)} :
    u ≤ s.prod t ↔ u.map (fst M N) ≤ s ∧ u.map (snd M N) ≤ t

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{s : Submonoid M}
{t : Submonoid N}
{u : Submonoid (M × N)}

u ≤ s.prod t ↔ Submonoid.map (MonoidHom.fst M N) u ≤ s ∧ Submonoid.map (MonoidHom.snd M N) u ≤ t


theorem self_mem_range_succ (n : ℕ) : n ∈ range (n + 1)


/-- Two morphisms into a pullback are equal if their compositions with the pullback morphisms are
    equal -/
@[ext 1100]
theorem pullback.hom_ext {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} [HasPullback f g] {W : C}
    {k l : W ⟶ pullback f g} (h₀ : k ≫ pullback.fst f g = l ≫ pullback.fst f g)
    (h₁ : k ≫ pullback.snd f g = l ≫ pullback.snd f g) : k = l

{k l : W ⟶ CategoryTheory.Limits.pullback f g}

(h₀ : k ≫ CategoryTheory.Limits.pullback.fst f g = l ≫ CategoryTheory.Limits.pullback.fst f g)

(h₁ : k ≫ CategoryTheory.Limits.pullback.snd f g = l ≫ CategoryTheory.Limits.pullback.snd f g)


theorem eq_top_of_disjoint [FiniteDimensional K V] (s t : Submodule K V)
    (hdim : finrank K s + finrank K t = finrank K V) (hdisjoint : Disjoint s t) : s ⊔ t = ⊤

(hdim : FiniteDimensional.finrank K ↥s + FiniteDimensional.finrank K ↥t = FiniteDimensional.finrank K V)


theorem star_apply (f : C₀(α, β)) (x : α) : (star f) x = star (f x)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[AddMonoid β]
[StarAddMonoid β]
[ContinuousStar β]
(f : α →C₀ β)
(x : α)


/-- As an intermediate step to show that `μ.withDensity (v.limRatioMeas hρ) = ρ`, we show here
that `μ.withDensity (v.limRatioMeas hρ) ≤ t^2 ρ` for any `t > 1`. -/
theorem withDensity_le_mul {s : Set α} (hs : MeasurableSet s) {t : ℝ≥0} (ht : 1 < t) :
    μ.withDensity (v.limRatioMeas hρ) s ≤ (t : ℝ≥0∞) ^ 2 * ρ s

(hρ : ρ ≪ μ)

(μ.withDensity (v.limRatioMeas hρ)) s ≤ ↑t ^ 2 * ρ s


theorem RightInverse.leftInverse_of_injective {f : α → β} {g : β → α} :
    RightInverse f g → Injective g → LeftInverse f g

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g : β → α}

Function.RightInverse f g → Function.Injective g → Function.LeftInverse f g


theorem Coprime.coprime_dvd_right (H1 : n ∣ m) (H2 : Coprime k m) : Coprime k n

{n m k : Nat}
(H1 : n ∣ m)
(H2 : k.Coprime m)


theorem rtendsto'_def (r : Rel α β) (l₁ : Filter α) (l₂ : Filter β) :
    RTendsto' r l₁ l₂ ↔ ∀ s ∈ l₂, r.preimage s ∈ l₁

{α : Type u}
{β : Type v}
(r : Rel α β)
(l₁ : Filter α)
(l₂ : Filter β)

Filter.RTendsto' r l₁ l₂ ↔ ∀ s ∈ l₂, r.preimage s ∈ l₁


theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(x : ℚ_[p])
(n : ℤ)


theorem size_shrink_loop (a : Array α) (n) : (shrink.loop n a).size = a.size - n

(Array.shrink.loop n a).size = a.size - n


/-- If `p ≠ 0` and `p ≠ 1`, then `padicValNat p p` is `1`. -/
@[simp]
theorem self (hp : 1 < p) : padicValNat p p = 1


theorem noetherianSpace_iff_opens : NoetherianSpace α ↔ ∀ s : Opens α, IsCompact (s : Set α)

TopologicalSpace.NoetherianSpace α ↔ ∀ (s : TopologicalSpace.Opens α), IsCompact ↑s


@[simp]
theorem MulEquiv.restrictRootsOfUnity_coe_apply (σ : R ≃* S) (ζ : rootsOfUnity k R) :
    (σ.restrictRootsOfUnity k ζ : Sˣ) = σ (ζ : Rˣ)

{R : Type u_4}
{S : Type u_5}
{k : ℕ+}
[CommMonoid R]
[CommMonoid S]
(σ : R ≃* S)
(ζ : ↥(rootsOfUnity k R))

↑↑((σ.restrictRootsOfUnity k) ζ) = σ ↑↑ζ


@[to_additive]
theorem IsOpen.div_right (hs : IsOpen s) : IsOpen (s / t)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{s t : Set G}
(hs : IsOpen s)


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

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

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

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

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


@[simp]
theorem coe_mkFinCons {n : ℕ} {N : Submodule R M} (y : M) (b : Basis (Fin n) R N)
    (hli : ∀ (c : R), ∀ x ∈ N, c • y + x = 0 → c = 0) (hsp : ∀ z : M, ∃ c : R, z + c • y ∈ N) :
    (mkFinCons y b hli hsp : Fin (n + 1) → M) = Fin.cons y ((↑) ∘ b)

⇑(Basis.mkFinCons y b hli hsp) = Fin.cons y (Subtype.val ∘ ⇑b)


theorem mul_inv_eq_gcd {n : ℕ} (a : ZMod n) : a * a⁻¹ = Nat.gcd a.val n


lemma Φ_ne_zero [Nontrivial R] (n : ℤ) : W.Φ n ≠ 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
[Nontrivial R]
(n : ℤ)


@[simp]
theorem inner_rightAngleRotationAux₁_left (x y : E) : ⟪o.rightAngleRotationAux₁ x, y⟫ = ω x y

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

⟪o.rightAngleRotationAux₁ x, y⟫_ℝ = (o.areaForm x) y


/-- If a point `x` belongs to `s`, then its edist to `s` vanishes -/
theorem infEdist_zero_of_mem (h : x ∈ s) : infEdist x s = 0

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s : Set α}
(h : x ∈ s)


theorem injectiveSeminorm_apply (x : ⨂[𝕜] i, E i) :
    injectiveSeminorm x = ⨆ p : {p | ∃ (G : Type (max uι u𝕜 uE))
    (_ : SeminormedAddCommGroup G) (_ : NormedSpace 𝕜 G), p = Seminorm.comp (normSeminorm 𝕜
    (ContinuousMultilinearMap 𝕜 E G →L[𝕜] G))
    (toDualContinuousMultilinearMap G (𝕜 := 𝕜) (E := E))}, p.1 x

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

PiTensorProduct.injectiveSeminorm x = ⨆ p, ↑p x


theorem injectiveSeminorm_le_projectiveSeminorm :
    injectiveSeminorm (𝕜 := 𝕜) (E := E) ≤ projectiveSeminorm


theorem finrank_of_infinite_dimensional (h : ¬FiniteDimensional K V) : finrank K V = 0

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(h : ¬FiniteDimensional K V)


@[to_additive]
theorem BddAbove.inv (h : BddAbove s) : BddBelow s⁻¹

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

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