theorem rev_bijective : Bijective (@rev n)


@[simp]
theorem coe_imAddGroupHom : (imAddGroupHom : ℂ → ℝ) = im


theorem image_upperBounds_subset_upperBounds_image (Hf : Monotone f) :
    f '' upperBounds s ⊆ upperBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}
(Hf : Monotone f)


theorem HasFDerivAt.eventually_ne (h : HasFDerivAt f f' x) (hf' : ∃ C, ∀ z, ‖z‖ ≤ C * ‖f' z‖) :
    ∀ᶠ z in 𝓝[≠] x, f z ≠ f x

(hf' : ∃ C, ∀ (z : E), ‖z‖ ≤ C * ‖f' z‖)


theorem Iic_mem_nhdsSet_Iic (h : a < b) : Iic b ∈ 𝓝ˢ (Iic a)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b : α}
(h : a < b)


theorem linearIndependent_singleton {x : M} (hx : x ≠ 0) :
    LinearIndependent R (fun x => x : ({x} : Set M) → M)

{R : Type u_2}
{M : Type u_4}
[Ring R]
[Nontrivial R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{x : M}
(hx : x ≠ 0)

LinearIndependent R fun (x_1 : ↑{x}) => ↑x_1


/-- In this situation, `C` is also cofiltered, see
    `IsCofilteredOrEmpty.of_exists_of_isCofiltered_of_fullyFaithful`. -/
theorem Functor.initial_of_exists_of_isCofiltered_of_fullyFaithful [IsCofilteredOrEmpty D] [F.Full]
    [Faithful F] (h : ∀ d, ∃ c, Nonempty (F.obj c ⟶ d)) : Initial F

(h : ∀ (d : D), ∃ c, Nonempty (F.obj c ⟶ d))


lemma cons_sub_cons (x : α) (v : Fin n → α) (y : α) (w : Fin n → α) :
    vecCons x v - vecCons y w = vecCons (x - y) (v - w)

{α : Type u_1}
{n : ℕ}
[Sub α]
(x : α)
(v : Fin n → α)
(y : α)
(w : Fin n → α)

Matrix.vecCons x v - Matrix.vecCons y w = Matrix.vecCons (x - y) (v - w)


theorem mem_dite (p : Prop) [Decidable p] (s : p → Set α) (t : ¬ p → Set α) (x : α) :
    (x ∈ if h : p then s h else t h) ↔ (∀ h : p, x ∈ s h) ∧ ∀ h : ¬p, x ∈ t h

{α : Type u}
(p : Prop)
[Decidable p]
(s : p → Set α)
(t : ¬p → Set α)
(x : α)

(x ∈ if h : p then s h else t h) ↔ (∀ (h : p), x ∈ s h) ∧ ∀ (h : ¬p), x ∈ t h


/-- A group `G` is nilpotent iff there exists an ascending central series which reaches `G` in
  finitely many steps. -/
theorem nilpotent_iff_finite_ascending_central_series :
    IsNilpotent G ↔ ∃ n : ℕ, ∃ H : ℕ → Subgroup G, IsAscendingCentralSeries H ∧ H n = ⊤

Group.IsNilpotent G ↔ ∃ n H, IsAscendingCentralSeries H ∧ H n = ⊤


theorem embedding_iff_embedding_of_iSup_eq_top (h : Continuous f) :
    Embedding f ↔ ∀ i, Embedding ((U i).1.restrictPreimage f)

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

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


lemma inter_mem_infs : s ∈ 𝒜 → t ∈ ℬ → s ∩ t ∈ 𝒜 ⊼ ℬ

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

s ∈ 𝒜 → t ∈ ℬ → s ∩ t ∈ 𝒜 ⊼ ℬ


lemma map_apply (ν : FiniteMeasure Ω) {f : Ω → Ω'} (f_mble : Measurable f)
    {A : Set Ω'} (A_mble : MeasurableSet A) :
    ν.map f A = ν (f ⁻¹' A)

{Ω : Type u_1}
{Ω' : Type u_2}
[MeasurableSpace Ω]
[MeasurableSpace Ω']
(ν : MeasureTheory.FiniteMeasure Ω)
{f : Ω → Ω'}
(f_mble : Measurable f)
{A : Set Ω'}
(A_mble : MeasurableSet A)


theorem coe_lt_one (x : Ico (0 : α) 1) : (x : α) < 1

{α : Type u_1}
[OrderedSemiring α]
(x : ↑(Set.Ico 0 1))


@[simp]
theorem get?_enum (s : Seq α) (n : ℕ) : get? (enum s) n = Option.map (Prod.mk n) (get? s n)

{α : Type u}
(s : Stream'.Seq α)
(n : ℕ)

s.enum.get? n = Option.map (Prod.mk n) (s.get? n)


theorem topologicalClosure_map_le [StarModule R B] [TopologicalSemiring B] [ContinuousStar B]
    (s : StarSubalgebra R A) (φ : A →⋆ₐ[R] B) (hφ : IsClosedMap φ) :
    (map φ s).topologicalClosure ≤ map φ s.topologicalClosure

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[TopologicalSemiring A]
[ContinuousStar A]
[TopologicalSpace B]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
[TopologicalSemiring B]
[ContinuousStar B]
(s : StarSubalgebra R A)
(φ : A →⋆ₐ[R] B)
(hφ : IsClosedMap ⇑φ)

(StarSubalgebra.map φ s).topologicalClosure ≤ StarSubalgebra.map φ s.topologicalClosure


@[simp]
theorem support_conj : (σ * τ * σ⁻¹).support = τ.support.map σ.toEmbedding

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

(σ * τ * σ⁻¹).support = Finset.map (Equiv.toEmbedding σ) τ.support


@[simp] lemma comm_coe_tmul_coe {i j : ι} (a : 𝒜 i) (b : ℬ j) :
    comm 𝒜 ℬ (a ᵍ⊗ₜ b) = (-1 : ℤˣ)^(j * i) • (b ᵍ⊗ₜ a : ℬ ᵍ⊗[R] 𝒜)

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
{i j : ι}
(a : ↥(𝒜 i))
(b : ↥(ℬ j))

(GradedTensorProduct.comm 𝒜 ℬ) (↑a ᵍ⊗ₜ[R] ↑b) = (-1) ^ (j * i) • ↑b ᵍ⊗ₜ[R] ↑a


theorem exists_eval₂_eq_zero [IsSepClosed K] (f : k →+* K)
    (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) :
    ∃ x, p.eval₂ f x = 0

{k : Type u}
[Field k]
{K : Type v}
[Field K]
[IsSepClosed K]
(f : k →+* K)
(p : k[X])
(hp : p.degree ≠ 0)
(hsep : p.Separable)


/-- The `nonsing_inv` of `A` is a left inverse. -/
@[simp]
theorem nonsing_inv_mul (h : IsUnit A.det) : A⁻¹ * A = 1

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(h : IsUnit A.det)


/-- A submonoid is either the trivial submonoid or contains a nonzero element. -/
@[to_additive
      "An additive submonoid is either the trivial additive submonoid or contains a nonzero
      element."]
theorem bot_or_exists_ne_one (S : Submonoid M) : S = ⊥ ∨ ∃ x ∈ S, x ≠ (1 : M)

{M : Type u_1}
[MulOneClass M]
(S : Submonoid M)


/-- A mixin for left cancellative multiplication. -/
class IsLeftCancelMul (G : Type u) [Mul G] : Prop where
  /-- Multiplication is left cancellative. -/
  protected mul_left_cancel : ∀ a b c : G, a * b = a * c → b = c

{G : Type u}
[Mul G]
[self : IsLeftCancelMul G]
(a b c : G)


/-- We can evaluate the pushforward on measurable sets. For non-measurable sets, see
  `MeasureTheory.Measure.le_map_apply` and `MeasurableEquiv.map_apply`. -/
@[simp]
theorem map_apply_of_aemeasurable (hf : AEMeasurable f μ) {s : Set β} (hs : MeasurableSet s) :
    μ.map f s = μ (f ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)
{s : Set β}
(hs : MeasurableSet s)

(MeasureTheory.Measure.map f μ) s = μ (f ⁻¹' s)


theorem toEuclideanLin_apply (M : Matrix m n 𝕜) (v : EuclideanSpace 𝕜 n) :
    toEuclideanLin M v = (WithLp.equiv 2 (m → 𝕜)).symm (M *ᵥ (WithLp.equiv 2 (n → 𝕜)) v)

{𝕜 : Type u_3}
[RCLike 𝕜]
{m : Type u_8}
{n : Type u_9}
[Fintype n]
[DecidableEq n]
(M : Matrix m n 𝕜)
(v : EuclideanSpace 𝕜 n)

(Matrix.toEuclideanLin M) v = (WithLp.equiv 2 (m → 𝕜)).symm (M.mulVec ((WithLp.equiv 2 (n → 𝕜)) v))


@[ext]
lemma ext {n : ℕ} {α β : Ext X Y n} (h : α.hom = β.hom) : α = β

{α β : CategoryTheory.Abelian.Ext X Y n}


lemma commShiftIso_add (a b : A) :
    F.commShiftIso (a + b) = CommShift.isoAdd (F.commShiftIso a) (F.commShiftIso b)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
(F : CategoryTheory.Functor C D)
{A : Type u_4}
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
[F.CommShift A]
(a b : A)

F.commShiftIso (a + b) = CategoryTheory.Functor.CommShift.isoAdd (F.commShiftIso a) (F.commShiftIso b)


/-- If the angle between two vectors is `π`, the first vector is nonzero. -/
theorem left_ne_zero_of_oangle_eq_pi {x y : V} (h : o.oangle x y = π) : x ≠ 0

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


/-- The two step comparison map
  `image (f ≫ (g ≫ h)) ⟶ image (g ≫ h) ⟶ image h`
agrees with the one step comparison map
  `image (f ≫ (g ≫ h)) ≅ image ((f ≫ g) ≫ h) ⟶ image h`.
 -/
theorem image.preComp_comp {W : C} (h : Z ⟶ W) [HasImage (g ≫ h)] [HasImage (f ≫ g ≫ h)]
    [HasImage h] [HasImage ((f ≫ g) ≫ h)] :
    image.preComp f (g ≫ h) ≫ image.preComp g h =
      image.eqToHom (Category.assoc f g h).symm ≫ image.preComp (f ≫ g) h

[CategoryTheory.Limits.HasImage (g ≫ h)]

[CategoryTheory.Limits.HasImage (f ≫ g ≫ h)]

[CategoryTheory.Limits.HasImage ((f ≫ g) ≫ h)]

CategoryTheory.Limits.image.preComp f (g ≫ h) ≫ CategoryTheory.Limits.image.preComp g h =
  CategoryTheory.Limits.image.eqToHom ⋯ ≫ CategoryTheory.Limits.image.preComp (f ≫ g) h


theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t

{ι : Type u_1}
{α : ι → Type u_2}
(s : Set ι)
[DecidablePred fun x => x ∈ s]
(t : (i : ι) → Set (α i))

(Set.univ.pi fun i => if i ∈ s then t i else Set.univ) = s.pi t


theorem EventuallyEq.exists_mem {l : Filter α} {f g : α → β} (h : f =ᶠ[l] g) :
    ∃ s ∈ l, EqOn f g s

{α : Type u}
{β : Type v}
{l : Filter α}
{f g : α → β}
(h : f =ᶠ[l] g)


@[simp, norm_cast]
theorem pow_coe (m : ℕ+) (n : ℕ) : ↑(m ^ n) = (m : ℕ) ^ n


@[simp]
theorem dualTensorHomEquivOfBasis_symm_cancel_right (x : M →ₗ[R] N) :
    dualTensorHom R M N ((dualTensorHomEquivOfBasis (N := N) b).symm x) = x

{ι : Type w}
{R : Type u}
{M : Type v₁}
{N : Type v₂}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[DecidableEq ι]
[Fintype ι]
(b : Basis ι R M)
(x : M →ₗ[R] N)

(dualTensorHom R M N) ((dualTensorHomEquivOfBasis b).symm x) = x


theorem range_dcomp (f : ∀ i, α i → β i) :
    (range fun g : ∀ i, α i => fun i => f i (g i)) = pi univ fun i => range (f i)

{ι : Type u_1}
{α : ι → Type u_2}
{β : ι → Type u_3}
(f : (i : ι) → α i → β i)

(Set.range fun g i => f i (g i)) = Set.univ.pi fun i => Set.range (f i)


/-- The Dold-Kan equivalence `Karoubi (SimplicialObject C) ≌ Karoubi (ChainComplex C ℕ)`
for additive categories. -/
@[simps]
def equivalence : Karoubi (SimplicialObject C) ≌ Karoubi (ChainComplex C ℕ)


@[simp]
theorem expand_monomial (r : R) : expand R p (monomial q r) = monomial (q * p) r

{R : Type u}
[CommSemiring R]
(p q : ℕ)
(r : R)

(Polynomial.expand R p) ((Polynomial.monomial q) r) = (Polynomial.monomial (q * p)) r


/-- See `List.length_bind` for the corresponding statement using `List.sum`. -/
lemma length_bind' (l : List α) (f : α → List β) :
    length (l.bind f) = Nat.sum (map (length ∘ f) l)

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

(l.bind f).length = Nat.sum (List.map (List.length ∘ f) l)


/-- In a linear order, symmetric squares are canonically identified with ordered pairs. -/
@[simps!]
def sortEquiv [LinearOrder α] : Sym2 α ≃ { p : α × α // p.1 ≤ p.2 }

{α : Type u_1}
[LinearOrder α]
(s : Sym2 α)


@[simp]
lemma cons_val_three (x : α) (u : Fin m.succ.succ.succ → α) :
    vecCons x u 3 = vecHead (vecTail (vecTail u))

{α : Type u}
{m : ℕ}
(x : α)
(u : Fin m.succ.succ.succ → α)

Matrix.vecCons x u 3 = Matrix.vecHead (Matrix.vecTail (Matrix.vecTail u))


@[to_additive]
theorem Finite.toFinset_mul (hs : s.Finite) (ht : t.Finite) (hf := hs.mul ht) :
    hf.toFinset = hs.toFinset * ht.toFinset

{α : Type u_2}
[DecidableEq α]
[Mul α]
{s t : Set α}
(hs : s.Finite)
(ht : t.Finite)
(hf : (s * t).Finite := ⋯)

Set.Finite.toFinset hf = hs.toFinset * ht.toFinset


/-- `LECmp cmp` asserts that `cmp x y ≠ .gt` and `x ≤ y` coincide. -/
class LECmp [LE α] (cmp : α → α → Ordering) extends OrientedCmp cmp : Prop where
  /-- `cmp x y ≠ .gt` holds iff `x ≤ y` is true. -/
  cmp_iff_le : cmp x y ≠ .gt ↔ x ≤ y

{α : Type u_1}
[LE α]
{cmp : α → α → Ordering}
[self : Batteries.LECmp cmp]
{x y : α}


@[measurability]
theorem Measurable.carg : Measurable fun x => arg (f x)

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → ℂ}
(hf : Measurable f)


@[simp]
theorem comap_swap_uniformity : comap (@Prod.swap α α) (𝓤 α) = 𝓤 α


@[simp] theorem nil_append (as : List α) : [] ++ as = as


/-- The angle between the negation of a nonzero vector and that vector is `π`. -/
@[simp]
theorem oangle_neg_self_left {x : V} (hx : x ≠ 0) : o.oangle (-x) x = π


/-- Given two elements `a`, `b` of a commutative `CancelMonoidWithZero` and a nonzero
  element `c`, `a*c` divides `b*c` iff `a` divides `b`. -/
theorem mul_dvd_mul_iff_right [CancelCommMonoidWithZero α] {a b c : α} (hc : c ≠ 0) :
    a * c ∣ b * c ↔ a ∣ b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a b c : α}
(hc : c ≠ 0)


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

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

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

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

(X X' : CategoryTheory.GradedObject J D)

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

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

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


theorem Antitone.directed_ge [Preorder α] [IsDirected α (· ≤ ·)] [Preorder β] {f : α → β}
    (hf : Antitone f) : Directed (· ≥ ·) f

{α : Type u}
{β : Type v}
[Preorder α]
[IsDirected α fun x x_1 => x ≤ x_1]
[Preorder β]
{f : α → β}
(hf : Antitone f)


theorem rnDeriv_ae_eq_condexp {hm : m ≤ m0} [hμm : SigmaFinite (μ.trim hm)] {f : α → ℝ}
    (hf : Integrable f μ) :
    SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m]

[hμm : MeasureTheory.SigmaFinite (μ.trim hm)]

MeasureTheory.SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m]


protected theorem _root_.Pairwise.aedisjoint {f : ι → Set α} (hf : Pairwise (Disjoint on f)) :
    Pairwise (AEDisjoint μ on f)

{ι : Type u_1}
{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : ι → Set α}
(hf : Pairwise (Disjoint on f))

Pairwise (MeasureTheory.AEDisjoint μ on f)


@[to_additive of_forall_le_norm]
lemma DiscreteTopology.of_forall_le_norm' (hpos : 0 < r) (hr : ∀ x : E, x ≠ 1 → r ≤ ‖x‖) :
    DiscreteTopology E

{E : Type u_6}
[SeminormedGroup E]
{r : ℝ}
(hpos : 0 < r)
(hr : ∀ (x : E), x ≠ 1 → r ≤ ‖x‖)


@[to_additive (attr := simp)]
theorem traverse_mul' :
    Function.comp (traverse F) ∘ (HMul.hMul : FreeSemigroup α → FreeSemigroup α → FreeSemigroup α) =
      fun x y ↦ (· * ·) <$> traverse F x <*> traverse F y

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)
[LawfulApplicative m]

Function.comp (traverse F) ∘ HAdd.hAdd = fun x y =>
  Seq.seq ((fun x x_1 => x + x_1) <$> traverse F x) fun x => traverse F y


theorem lt_of_getLsb (x : BitVec w) (i : Nat) : getLsb x i = true → i < w


theorem lt_iff_exists_rat_btwn (a b : ℝ≥0) :
    a < b ↔ ∃ q : ℚ, 0 ≤ q ∧ a < Real.toNNReal q ∧ Real.toNNReal q < b

a < b ↔ ∃ q, 0 ≤ q ∧ a < (↑q).toNNReal ∧ (↑q).toNNReal < b


@[simp] theorem permCongr_symm : e.permCongr.symm = e.symm.permCongr


/-- `ContinuousMultilinearMap.pi` as an `Equiv`. -/
@[simps]
def piEquiv {ι' : Type*} {M' : ι' → Type*} [∀ i, AddCommMonoid (M' i)]
    [∀ i, TopologicalSpace (M' i)] [∀ i, Module R (M' i)] :
    (∀ i, ContinuousMultilinearMap R M₁ (M' i)) ≃ ContinuousMultilinearMap R M₁ (∀ i, M' i)

(f : ContinuousMultilinearMap R M₁ ((i : ι') → M' i))

ContinuousMultilinearMap.piEquiv.symm f i = (ContinuousLinearMap.proj i).compContinuousMultilinearMap f


/-- When `R'` has prime characteristic `p`, then the `p`th power of the Gauss sum
of `χ` and `ψ` is the Gauss sum of `χ^p` and `ψ^p`. -/
theorem gaussSum_frob (χ : MulChar R R') (ψ : AddChar R R') :
    gaussSum χ ψ ^ p = gaussSum (χ ^ p) (ψ ^ p)

{R : Type u}
[CommRing R]
[Fintype R]
{R' : Type v}
[CommRing R']
(p : ℕ)
[fp : Fact (Nat.Prime p)]
[hch : CharP R' p]
(χ : MulChar R R')
(ψ : AddChar R R')


lemma isCompactElement_lieSpan_singleton (m : M) :
    CompleteLattice.IsCompactElement (lieSpan R L {m})

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

CompleteLattice.IsCompactElement (LieSubmodule.lieSpan R L {m})


@[simp]
theorem reduceOption_cons_of_some (x : α) (l : List (Option α)) :
    reduceOption (some x :: l) = x :: l.reduceOption

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

(some x :: l).reduceOption = x :: l.reduceOption


@[reassoc, simp]
theorem braiding_inv_tensorUnit_left (X : C) : (β_ (𝟙_ C) X).inv = (ρ_ X).hom ≫ (λ_ X).inv

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


theorem ncard_add_ncard_compl (s : Set α) (hs : s.Finite := by toFinite_tac)
    (hsc : sᶜ.Finite := by toFinite_tac) : s.ncard + sᶜ.ncard = Nat.card α

{α : Type u_1}
(s : Set α)
(hs : s.Finite := by toFinite_tac)
(hsc : sᶜ.Finite := by toFinite_tac)


@[simp, norm_cast] lemma val_qsmul (q : ℚ) (x : selfAdjoint R) : ↑(q • x) = q • (x : R)

{R : Type u_1}
[Field R]
[StarRing R]
(q : ℚ)
(x : ↥(selfAdjoint R))


@[simp]
theorem eval_one_cyclotomic_prime_pow {R : Type*} [CommRing R] {p : ℕ} (k : ℕ)
    [hn : Fact p.Prime] : eval 1 (cyclotomic (p ^ (k + 1)) R) = p

{R : Type u_1}
[CommRing R]
{p : ℕ}
(k : ℕ)
[hn : Fact (Nat.Prime p)]

Polynomial.eval 1 (Polynomial.cyclotomic (p ^ (k + 1)) R) = ↑p


theorem term_smulg {α} [AddCommGroup α] (c n x a n' a')
    (h₁ : c * n = n') (h₂ : smulg c a = a') :
    smulg c (@termg α _ n x a) = termg n' x a'

(h₂ : Mathlib.Tactic.Abel.smulg c a = a')

Mathlib.Tactic.Abel.smulg c (Mathlib.Tactic.Abel.termg n x a) = Mathlib.Tactic.Abel.termg n' x a'


theorem fiber_eq (x : X) : S.proj ⁻¹' {S.proj x} = setOf (S.Rel x)

{X : Type u_2}
[TopologicalSpace X]
(S : DiscreteQuotient X)
(x : X)


@[simp]
theorem differentiableOn_add_const_iff (c : F) :
    DifferentiableOn 𝕜 (fun y => f y + c) s ↔ DifferentiableOn 𝕜 f s

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


@[elab_as_elim]
theorem inductionOn {C : Ordinal → Prop} (o : Ordinal)
    (H : ∀ (α r) [IsWellOrder α r], C (type r)) : C o

(H : ∀ (α : Type u_3) (r : α → α → Prop) [inst : IsWellOrder α r], C (Ordinal.type r))


theorem isSimpleModule_iff_finrank_eq_one {R} [DivisionRing R] [Module R M] :
    IsSimpleModule R M ↔ FiniteDimensional.finrank R M = 1

{M : Type u_4}
[AddCommGroup M]
{R : Type u_6}
[DivisionRing R]
[Module R M]


@[to_additive]
lemma stabilizer_image_coe_quotient : stabilizer Q (q '' s) = ⊥

{G : Type u_1}
[AddCommGroup G]
(s : Set G)

AddAction.stabilizer (G ⧸ AddAction.stabilizer G s) (QuotientAddGroup.mk '' s) = ⊥


@[simp]
theorem blockDiagonal_mul [Fintype n] [Fintype o] [NonUnitalNonAssocSemiring α]
    (M : o → Matrix m n α) (N : o → Matrix n p α) :
    (blockDiagonal fun k => M k * N k) = blockDiagonal M * blockDiagonal N

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{p : Type u_5}
{α : Type u_12}
[DecidableEq o]
[Fintype n]
[Fintype o]
[NonUnitalNonAssocSemiring α]
(M : o → Matrix m n α)
(N : o → Matrix n p α)

(Matrix.blockDiagonal fun k => M k * N k) = Matrix.blockDiagonal M * Matrix.blockDiagonal N


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

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


/-- The projection map is precisely `Path.Homotopic.proj` interpreted as a functor -/
@[simp]
theorem proj_map (i : I) (x₀ x₁ : πₓ (TopCat.of (∀ i, X i))) (p : x₀ ⟶ x₁) :
    (proj X i).map p = @Path.Homotopic.proj _ _ _ _ _ i p

(x₀ x₁ : ↑(π.obj (TopCat.of ((i : I) → ↑(X i)))))

(FundamentalGroupoidFunctor.proj X i).map p = Path.Homotopic.proj i p


@[simp]
theorem coprod_inl (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₃) : (coprod f g).comp (inl R M M₂) = f

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M →ₗ[R] M₃)
(g : M₂ →ₗ[R] M₃)


@[simp]
theorem comapDomain_add [∀ i, AddZeroClass (β i)] (h : κ → ι) (hh : Function.Injective h)
    (f g : Π₀ i, β i) : comapDomain h hh (f + g) = comapDomain h hh f + comapDomain h hh g

{ι : Type u}
{β : ι → Type v}
{κ : Type u_1}
[(i : ι) → AddZeroClass (β i)]
(h : κ → ι)
(hh : Function.Injective h)
(f g : Π₀ (i : ι), β i)

DFinsupp.comapDomain h hh (f + g) = DFinsupp.comapDomain h hh f + DFinsupp.comapDomain h hh g


theorem ofInt_re (n : ℤ) : (ofInt n : ℤ√d).re = n


lemma fourierIntegral_eq (f : V → E) (w : V) :
    𝓕 f w = ∫ v, 𝐞 (-⟪v, w⟫) • f v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MeasurableSpace V]
[BorelSpace V]
[FiniteDimensional ℝ V]
(f : V → E)
(w : V)

Real.fourierIntegral f w = ∫ (v : V), Real.fourierChar (-⟪v, w⟫_ℝ) • f v


/-- The obvious map `PushoutCocone f.op g.op → PullbackCone f g` -/
@[simps!]
def op {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : PullbackCone f.op g.op

(c : CategoryTheory.Limits.PushoutCocone f g)

∀ (X_1 : CategoryTheory.Limits.WalkingCospan),
  c.op.π.app X_1 =
    (c.ι.app X_1).op ≫
      (Option.rec (CategoryTheory.Iso.refl (Opposite.op X))
          (fun val =>
            CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl (Opposite.op Y))
              (CategoryTheory.Iso.refl (Opposite.op Z)) val)
          X_1).inv


@[simp]
theorem sameCycle_conj : SameCycle (g * f * g⁻¹) x y ↔ SameCycle f (g⁻¹ x) (g⁻¹ y)

{α : Type u_2}
{f g : Equiv.Perm α}
{x y : α}

(g * f * g⁻¹).SameCycle x y ↔ f.SameCycle (g⁻¹ x) (g⁻¹ y)


/-- Internal definition for `M`. It is needed to avoid name clashes
between `M.mk` and `M.cases_on` and the declarations generated for
the structure -/
structure MIntl where
  /-- An `n`-th level approximation, for each depth `n` -/
  approx : ∀ n, CofixA F n
  /-- Each approximation agrees with the next -/
  consistent : AllAgree approx


theorem uniformContinuous_compareEquiv : UniformContinuous (pkg.compareEquiv pkg')

{α : Type u_1}
[UniformSpace α]
(pkg pkg' : AbstractCompletion α)


/-- An element `a` is regular if and only if a positive power of `a` is regular. -/
theorem IsRegular.pow_iff {n : ℕ} (n0 : 0 < n) : IsRegular (a ^ n) ↔ IsRegular a

{R : Type u_1}
{a : R}
[Monoid R]
{n : ℕ}
(n0 : 0 < n)


theorem subtype_Iio_eq : Iio a = (Iio (a : α)).subtype p

{α : Type u_1}
[Preorder α]
(p : α → Prop)
[DecidablePred p]
[LocallyFiniteOrderBot α]
(a : Subtype p)

Finset.Iio a = Finset.subtype p (Finset.Iio ↑a)


/-- Given an open cover `{ Yᵢ }` of `Y`, then `X ×[Z] Y` is covered by `X ×[Z] Yᵢ`. -/
@[simps! J obj map]
def openCoverOfRight (𝒰 : OpenCover Y) (f : X ⟶ Z) (g : Y ⟶ Z) : OpenCover (pullback f g)

{X Y Z : AlgebraicGeometry.Scheme}
(𝒰 : Y.OpenCover)
(f : X ⟶ Z)
(g : Y ⟶ Z)

(AlgebraicGeometry.Scheme.Pullback.openCoverOfRight 𝒰 f g).J = 𝒰.J


@[simp] theorem orElse_none (x : Option α) : (x <|> none) = x


@[simp]
theorem _root_.Prod.range_snd [Nonempty α] : range (Prod.snd : α × β → β) = univ

{α : Type u_1}
{β : Type u_2}
[Nonempty α]


@[simp]
theorem infty_coeFn_mul (f g : lp B ∞) : ⇑(f * g) = ⇑f * ⇑g

{I : Type u_3}
{B : I → Type u_4}
[(i : I) → NonUnitalNormedRing (B i)]
(f g : ↥(lp B ⊤))


theorem mk_ne_zero_iff {α : Type u} : #α ≠ 0 ↔ Nonempty α


protected theorem find_min' {m : ℕ} (h : p m) : Nat.find H ≤ m

{p : ℕ → Prop}
[DecidablePred p]
(H : ∃ n, p n)
{m : ℕ}
(h : p m)


@[simp]
theorem distortion_top (I : Box ι) : distortion (⊤ : Prepartition I) = I.distortion

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)


@[simp]
theorem id_toCoalgHom : BialgHom.id R A = CoalgHom.id R A

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[CoalgebraStruct R A]


@[simp]
theorem isUnit_ring_inverse {a : M₀} : IsUnit (Ring.inverse a) ↔ IsUnit a

{M₀ : Type u_2}
[MonoidWithZero M₀]
{a : M₀}


protected theorem isAsymm [RelHomClass F r s] (f : F) : ∀ [IsAsymm β s], IsAsymm α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{F : Type u_5}
[FunLike F α β]
[RelHomClass F r s]
(f : F)
[IsAsymm β s]


/--
Bounding the cardinal of an ordinal-indexed union of sets.
-/
lemma mk_iUnion_Ordinal_le_of_le {β : Type*} {o : Ordinal} {c : Cardinal}
    (ho : o.card ≤ c) (hc : ℵ₀ ≤ c) (A : Ordinal → Set β)
    (hA : ∀ j < o, #(A j) ≤ c) :
    #(⋃ j < o, A j) ≤ c

{β : Type u_1}
{o : Ordinal.{u_1}}
{c : Cardinal.{u_1}}
(ho : o.card ≤ c)
(hc : ℵ₀ ≤ c)
(A : Ordinal.{u_1} → Set β)
(hA : ∀ j < o, #↑(A j) ≤ c)


/-- The stalks are isomorphic on inseparable points -/
@[simps]
def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X}
    (e : Inseparable x y) : F.stalk x ≅ F.stalk y

{X : TopCat}
{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasColimits C]
(F : TopCat.Presheaf C X)
{x y : ↑X}
(e : Inseparable x y)

(F.stalkCongr e).hom = F.stalkSpecializes ⋯


@[simp]
lemma comp_id (F : 𝒳 ⥤ᵇ 𝒴) :  F ⋙ 𝟭 𝒴 = F

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
{𝒳 : CategoryTheory.BasedCategory 𝒮}
{𝒴 : CategoryTheory.BasedCategory 𝒮}
(F : CategoryTheory.BasedFunctor 𝒳 𝒴)

F.comp (CategoryTheory.BasedFunctor.id 𝒴) = F


@[simp]
lemma ofHom_add (φ₁ φ₂ : F ⟶ G) :
    Cochain.ofHom (φ₁ + φ₂) = Cochain.ofHom φ₁ + Cochain.ofHom φ₂

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(φ₁ φ₂ : F ⟶ G)

CochainComplex.HomComplex.Cochain.ofHom (φ₁ + φ₂) =
  CochainComplex.HomComplex.Cochain.ofHom φ₁ + CochainComplex.HomComplex.Cochain.ofHom φ₂


/-- A morphism of Lie algebras is a linear map respecting the bracket operations. -/
structure LieHom (R L L' : Type*) [CommRing R] [LieRing L] [LieAlgebra R L]
  [LieRing L'] [LieAlgebra R L'] extends L →ₗ[R] L' where
  /-- A morphism of Lie algebras is compatible with brackets. -/
  map_lie' : ∀ {x y : L}, toFun ⁅x, y⁆ = ⁅toFun x, toFun y⁆

{R : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(self : L →ₗ⁅R⁆ L')
{x y : L}

(↑self).toFun ⁅x, y⁆ = ⁅(↑self).toFun x, (↑self).toFun y⁆


/-- An auxiliary result en route to `ModularGroup.c_eq_zero`. -/
theorem abs_c_le_one (hz : z ∈ 𝒟ᵒ) (hg : g • z ∈ 𝒟ᵒ) : |(↑ₘg) 1 0| ≤ 1

{g : SL(2, ℤ)}
{z : ℍ}
(hz : z ∈ ModularGroup.fdo)
(hg : g • z ∈ ModularGroup.fdo)


@[to_additive]
protected theorem UniformOnFun.hasBasis_nhds_one_of_basis (𝔖 : Set <| Set α) (h𝔖₁ : 𝔖.Nonempty)
    (h𝔖₂ : DirectedOn (· ⊆ ·) 𝔖) {p : ι → Prop} {b : ι → Set G}
    (h : (𝓝 1 : Filter G).HasBasis p b) :
    (𝓝 1 : Filter (α →ᵤ[𝔖] G)).HasBasis (fun Si : Set α × ι => Si.1 ∈ 𝔖 ∧ p Si.2) fun Si =>
      { f : α →ᵤ[𝔖] G | ∀ x ∈ Si.1, toFun 𝔖 f x ∈ b Si.2 }

(h𝔖₂ : DirectedOn (fun x x_1 => x ⊆ x_1) 𝔖)

(𝓝 1).HasBasis (fun Si => Si.1 ∈ 𝔖 ∧ p Si.2) fun Si => {f | ∀ x ∈ Si.1, (UniformOnFun.toFun 𝔖) f x ∈ b Si.2}


@[simp]
theorem toεNFA_correct (M : NFA α σ) : M.toεNFA.accepts = M.accepts


@[to_additive]
theorem closure_singleton_le_iff_mem (m : M) (p : Submonoid M) : closure {m} ≤ p ↔ m ∈ p

{M : Type u_1}
[MulOneClass M]
(m : M)
(p : Submonoid M)


@[reassoc (attr := simp)]
lemma Cofork.IsColimit.π_desc' {s : Cofork f g} (hs : IsColimit s) {W : C} (k : Y ⟶ W)
    (h : f ≫ k = g ≫ k) : Cofork.π s ≫ Cofork.IsColimit.desc hs k h = k

(hs : CategoryTheory.Limits.IsColimit s)

(h : CategoryTheory.CategoryStruct.comp f k = CategoryTheory.CategoryStruct.comp g k)

CategoryTheory.CategoryStruct.comp s.π (CategoryTheory.Limits.Cofork.IsColimit.desc hs k h) = k


theorem support_single_mul_subset [DecidableEq G] [Mul G] (f : MonoidAlgebra k G) (r : k) (a : G) :
    (single a r * f : MonoidAlgebra k G).support ⊆ Finset.image (a * ·) f.support

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[DecidableEq G]
[Mul G]
(f : MonoidAlgebra k G)
(r : k)
(a : G)

(MonoidAlgebra.single a r * f).support ⊆ Finset.image (fun x => a * x) f.support


@[to_additive]
theorem toFreeSemigroup_map (f : α → β) (x : FreeMagma α) :
    toFreeSemigroup (map f x) = FreeSemigroup.map f (toFreeSemigroup x)

{α : Type u}
{β : Type v}
(f : α → β)
(x : FreeMagma α)

FreeMagma.toFreeSemigroup ((FreeMagma.map f) x) = (FreeSemigroup.map f) (FreeMagma.toFreeSemigroup x)


theorem basisFun_eq_pi_basisFun :
    basisFun p 𝕜 ι = (Pi.basisFun 𝕜 ι).map (WithLp.linearEquiv p 𝕜 (ι → 𝕜)).symm

(p : ℝ≥0∞)
(𝕜 : Type u_1)
(ι : Type u_2)
[Finite ι]
[Ring 𝕜]

PiLp.basisFun p 𝕜 ι = (Pi.basisFun 𝕜 ι).map (WithLp.linearEquiv p 𝕜 (ι → 𝕜)).symm


theorem coe_nnnorm_toLp {f : α → E} (hf : Memℒp f p μ) : (‖hf.toLp f‖₊ : ℝ≥0∞) = eLpNorm f p μ

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

↑‖MeasureTheory.Memℒp.toLp f hf‖₊ = MeasureTheory.eLpNorm f p μ


/-- If `k ∉ S`, then as `δ ≤ |x - k/n|`, we have the inequality `1 ≤ δ^-2 * (x - k/n)^2`.
This particular formulation will be helpful later.
-/
theorem le_of_mem_S_compl {f : C(I, ℝ)} {ε : ℝ} {h : 0 < ε} {n : ℕ} {x : I} {k : Fin (n + 1)}
    (m : k ∈ (S f ε h n x)ᶜ) : (1 : ℝ) ≤ δ f ε h ^ (-2 : ℤ) * ((x : ℝ) - k/ₙ) ^ 2

(m : k ∈ (bernsteinApproximation.S f ε h n x)ᶜ)

1 ≤ bernsteinApproximation.δ f ε h ^ (-2) * (↑x - ↑k/ₙ) ^ 2


theorem norm_ne_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} :
    Algebra.norm R x ≠ 0 ↔ x ≠ 0

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{ι : Type w}
[Finite ι]
[IsDomain R]
[IsDomain S]
(b : Basis ι R S)
{x : S}


theorem t_pow_smul_eq_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (t ^ (u : ℤ) : HNNExtension G A B φ) • w = unitsSMul φ u w

{d : HNNExtension.NormalWord.TransversalPair G A B}

HNNExtension.t ^ ↑u • w = HNNExtension.NormalWord.unitsSMul φ u w


theorem integrableOn_Icc_iff_integrableOn_Ioc' (ha : μ {a} ≠ ∞) :
    IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ioc a b) μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
[PartialOrder α]
[MeasurableSingletonClass α]
{f : α → E}
{μ : MeasureTheory.Measure α}
{a b : α}
(ha : μ {a} ≠ ⊤)

MeasureTheory.IntegrableOn f (Set.Icc a b) μ ↔ MeasureTheory.IntegrableOn f (Set.Ioc a b) μ


/-- The special case of the first simplicial identity -/
@[reassoc]
theorem δ_comp_δ_self {n} {i : Fin (n + 2)} :
    X.δ (Fin.castSucc i) ≫ X.δ i = X.δ i.succ ≫ X.δ i

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

X.δ i.castSucc ≫ X.δ i = X.δ i.succ ≫ X.δ i


@[to_additive (attr := simp)]
theorem lift_of (x) : lift f (of x) = f x

{α : Type u}
{β : Type v}
[Mul β]
(f : α → β)
(x : α)

(FreeMagma.lift f) (FreeMagma.of x) = f x


theorem smul_apply (a : M) (f : E →ₗ.[R] F) (x : (a • f).domain) : (a • f) x = a • f x

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{M : Type u_5}
[Monoid M]
[DistribMulAction M F]
[SMulCommClass R M F]
(a : M)
(f : E →ₗ.[R] F)
(x : ↥(a • f).domain)


theorem wittZSMul_vars (m : ℤ) (n : ℕ) :
    (wittZSMul p m n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(m : ℤ)
(n : ℕ)

(WittVector.wittZSMul p m n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)


@[simp]
theorem invOf_nonpos [Invertible a] : ⅟ a ≤ 0 ↔ a ≤ 0

{α : Type u_1}
[LinearOrderedSemiring α]
{a : α}
[Invertible a]

⅟a ≤ 0 ↔ a ≤ 0


@[simp]
theorem pushoutCocone_pt :
    (pushoutCocone R A B).pt = CommRingCat.of (A ⊗[R] B)

(R A B : Type u)
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]

(CommRingCat.pushoutCocone R A B).pt = CommRingCat.of (A ⊗[R] B)


@[to_additive]
theorem mul_mk'_one_eq_mk' (x) (y : S) : f.toMap x * f.mk' 1 y = f.mk' x y

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(x : M)
(y : ↥S)


theorem exists_pow_neg_lt_rat {ε : ℚ} (hε : 0 < ε) : ∃ k : ℕ, (p : ℚ) ^ (-(k : ℤ)) < ε

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{ε : ℚ}
(hε : 0 < ε)


@[to_additive]
theorem symm_bijective : Function.Bijective (symm : (M ≃* N) → N ≃* M)

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]


/-- If `a ≠ 0, b` are elements of a unique factorization domain, then dividing
out their common factor `c'` gives `a'` and `b'` with no factors in common. -/
theorem exists_reduced_factors :
    ∀ a ≠ (0 : R), ∀ b,
      ∃ a' b' c', IsRelPrime a' b' ∧ c' * a' = a ∧ c' * b' = b

{R : Type u_2}
[CancelCommMonoidWithZero R]
[UniqueFactorizationMonoid R]
(a : R)

a ≠ 0 → ∀ (b : R), ∃ a' b' c', IsRelPrime a' b' ∧ c' * a' = a ∧ c' * b' = b


theorem mem_rootSet' {p : T[X]} {S : Type*} [CommRing S] [IsDomain S] [Algebra T S] {a : S} :
    a ∈ p.rootSet S ↔ p.map (algebraMap T S) ≠ 0 ∧ aeval a p = 0

{T : Type w}
[CommRing T]
{p : Polynomial T}
{S : Type u_1}
[CommRing S]
[IsDomain S]
[Algebra T S]
{a : S}

a ∈ p.rootSet S ↔ Polynomial.map (algebraMap T S) p ≠ 0 ∧ (Polynomial.aeval a) p = 0


@[to_additive (attr := simp)]
theorem traverse_eq (x) : FreeMagma.traverse F x = traverse F x

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)
(x : FreeAddMagma α)

FreeAddMagma.traverse F x = traverse F x


/-- If `V : ι → Set X` is a decreasing family of closed compact sets then any neighborhood of
`⋂ i, V i` contains some `V i`. We assume each `V i` is compact *and* closed because `X` is
not assumed to be Hausdorff. See `exists_subset_nhd_of_compact` for version assuming this. -/
theorem exists_subset_nhds_of_isCompact' [Nonempty ι] {V : ι → Set X}
    (hV : Directed (· ⊇ ·) V) (hV_cpct : ∀ i, IsCompact (V i)) (hV_closed : ∀ i, IsClosed (V i))
    {U : Set X} (hU : ∀ x ∈ ⋂ i, V i, U ∈ 𝓝 x) : ∃ i, V i ⊆ U

(hV : Directed (fun x x_1 => x ⊇ x_1) V)


@[simp]
theorem star_mul_self (U : unitary R) : star U * U = 1

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


theorem norm_condexpL2_le (hm : m ≤ m0) (f : α →₂[μ] E) : ‖condexpL2 E 𝕜 hm f‖ ≤ ‖f‖

{α : Type u_1}
{E : Type u_2}
{𝕜 : Type u_7}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
(f : ↥(MeasureTheory.Lp E 2 μ))

‖(MeasureTheory.condexpL2 E 𝕜 hm) f‖ ≤ ‖f‖


@[to_additive (attr := simp)]
lemma Homeomorph.coe_inv {G : Type*} [TopologicalSpace G] [InvolutiveInv G] [ContinuousInv G] :
    ⇑(Homeomorph.inv G) = Inv.inv

{G : Type u_1}
[TopologicalSpace G]
[InvolutiveNeg G]
[ContinuousNeg G]


@[simp]
theorem preimageSingletonHomeomorph_symm_apply {b : B} (hb : b ∈ e.baseSet) (p : F) :
    (e.preimageSingletonHomeomorph hb).symm p =
      ⟨e.symm (b, p), by rw [mem_preimage, e.proj_symm_apply' hb, mem_singleton_iff]⟩

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)
{b : B}
(hb : b ∈ e.baseSet)
(p : F)

(e.preimageSingletonHomeomorph hb).symm p = ⟨↑e.symm (b, p), ⋯⟩


/-- When `R` is a non-unital ring, to construct a `StarOrderedRing` instance it suffices to
show that the nonnegative elements are precisely those elements of the form `star s * s`
for `s : R`.

This is provided for convenience because it holds in many common scenarios (e.g.,`ℝ`, `ℂ`, or
any C⋆-algebra), and obviates the hassle of `AddSubmonoid.closure_induction` when creating those
instances. -/
lemma of_nonneg_iff' [NonUnitalRing R] [PartialOrder R] [StarRing R]
    (h_add : ∀ {x y : R}, x ≤ y → ∀ z, z + x ≤ z + y)
    (h_nonneg_iff : ∀ x : R, 0 ≤ x ↔ ∃ s, x = star s * s) : StarOrderedRing R

(h_add : ∀ {x y : R}, x ≤ y → ∀ (z : R), z + x ≤ z + y)

(h_nonneg_iff : ∀ (x : R), 0 ≤ x ↔ ∃ s, x = star s * s)


@[simp]
theorem domDomCongr_add (σ : ι ≃ ι') (f g : M [⋀^ι]→ₗ[R] N) :
    (f + g).domDomCongr σ = f.domDomCongr σ + g.domDomCongr σ

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{ι' : Type u_8}
(σ : ι ≃ ι')
(f g : M [⋀^ι]→ₗ[R] N)

AlternatingMap.domDomCongr σ (f + g) = AlternatingMap.domDomCongr σ f + AlternatingMap.domDomCongr σ g


@[simp] lemma sq_abs (a : α) : |a| ^ 2 = a ^ 2

{α : Type u_1}
[LinearOrderedRing α]
(a : α)


theorem pi_update_of_mem [DecidableEq ι] (hi : i ∈ s) (f : ∀ j, α j) (a : α i)
    (t : ∀ j, α j → Set (β j)) :
    (s.pi fun j => t j (update f i a j)) = { x | x i ∈ t i a } ∩ (s \ {i}).pi fun j => t j (f j)

{ι : Type u_1}
{α : ι → Type u_2}
{β : ι → Type u_3}
{s : Set ι}
{i : ι}
[DecidableEq ι]
(hi : i ∈ s)
(f : (j : ι) → α j)
(a : α i)
(t : (j : ι) → α j → Set (β j))

(s.pi fun j => t j (Function.update f i a j)) = {x | x i ∈ t i a} ∩ (s \ {i}).pi fun j => t j (f j)


/-- The Grothendieck construction applied to a functor to `Type`
(thought of as a functor to `Cat` by realising a type as a discrete category)
is the same as the 'category of elements' construction.
-/
-- See porting note on grothendieckTypeToCatInverse.
-- We just want to turn off grothendieckTypeToCat_inverse_map_fiber_down_down,
-- so have to list the complement here for `@[simps]`.
@[simps! functor_obj_fst functor_obj_snd functor_map_coe inverse_obj_base inverse_obj_fiber_as
  inverse_map_base unitIso_hom_app_base unitIso_hom_app_fiber unitIso_inv_app_base
  unitIso_inv_app_fiber counitIso_hom_app_coe counitIso_inv_app_coe]
def grothendieckTypeToCat : Grothendieck (G ⋙ typeToCat) ≌ G.Elements

(X : CategoryTheory.Grothendieck (G.comp CategoryTheory.typeToCat))

((CategoryTheory.Grothendieck.grothendieckTypeToCat G).unitIso.hom.app X).base = CategoryTheory.CategoryStruct.id X.base


/-- When the first map `S.f` is zero, this is the left homology data on `S` given
by any limit kernel fork of `S.g` -/
@[simps]
def ofIsLimitKernelFork (hf : S.f = 0) (c : KernelFork S.g) (hc : IsLimit c) :
    S.LeftHomologyData

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.LeftHomologyData.ofIsLimitKernelFork S hf c hc).π = CategoryTheory.CategoryStruct.id c.pt


theorem tendsto_toReal {a : EReal} (ha : a ≠ ⊤) (h'a : a ≠ ⊥) :
    Tendsto EReal.toReal (𝓝 a) (𝓝 a.toReal)

Filter.Tendsto EReal.toReal (𝓝 a) (𝓝 a.toReal)


/-- Homeomorphism between dependent functions `Π i : Fin 2, X i` and `X 0 × X 1`. -/
@[simps! (config := .asFn)]
def piFinTwo.{u} (X : Fin 2 → Type u) [∀ i, TopologicalSpace (X i)] : (∀ i, X i) ≃ₜ X 0 × X 1

(X : Fin 2 → Type u)
[(i : Fin 2) → TopologicalSpace (X i)]

⇑(Homeomorph.piFinTwo X) = fun f => (f 0, f 1)


theorem chart_mem_maximalAtlas [SmoothManifoldWithCorners I M] (x : M) :
    chartAt H x ∈ maximalAtlas I M

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

chartAt H x ∈ SmoothManifoldWithCorners.maximalAtlas I M


@[to_additive]
theorem topologicalGroup_inf {t₁ t₂ : TopologicalSpace G} (h₁ : @TopologicalGroup G t₁ _)
    (h₂ : @TopologicalGroup G t₂ _) : @TopologicalGroup G (t₁ ⊓ t₂) _

{G : Type w}
[Group G]
{t₁ t₂ : TopologicalSpace G}
(h₁ : TopologicalGroup G)
(h₂ : TopologicalGroup G)


@[continuity]
theorem continuous_apply_apply {ρ : κ → ι → Type*} [∀ j i, TopologicalSpace (ρ j i)] (j : κ)
    (i : ι) : Continuous fun p : ∀ j, ∀ i, ρ j i => p j i

[(j : κ) → (i : ι) → TopologicalSpace (ρ j i)]


lemma Homotopy.homologyMap_eq (ho : Homotopy f g) (i : ι) [K.HasHomology i] [L.HasHomology i] :
    homologyMap f i = homologyMap g i

{C : Type u_2}
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Preadditive C]
{ι : Type u_4}
{c : ComplexShape ι}
[DecidableRel c.Rel]
{K L : HomologicalComplex C c}
{f g : K ⟶ L}
(ho : Homotopy f g)
(i : ι)
[K.HasHomology i]
[L.HasHomology i]

HomologicalComplex.homologyMap f i = HomologicalComplex.homologyMap g i


/-- The diagram of the multifork attached to a presheaf
`F : Cᵒᵖ ⥤ A`, `S : C` and `E : PreOneHypercover S`. -/
@[simps]
def multicospanIndex (F : Cᵒᵖ ⥤ A) : MulticospanIndex A

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
{S : C}
(E : CategoryTheory.PreOneHypercover S)
(F : CategoryTheory.Functor Cᵒᵖ A)


theorem ProgMeasurable.adapted_stoppedProcess [MetrizableSpace ι] (h : ProgMeasurable f u)
    (hτ : IsStoppingTime f τ) : Adapted f (MeasureTheory.stoppedProcess u τ)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
[MeasurableSpace ι]
[TopologicalSpace ι]
[OrderTopology ι]
[SecondCountableTopology ι]
[BorelSpace ι]
[TopologicalSpace β]
{u : ι → Ω → β}
{τ : Ω → ι}
{f : MeasureTheory.Filtration ι m}
[TopologicalSpace.MetrizableSpace ι]
(h : MeasureTheory.ProgMeasurable f u)
(hτ : MeasureTheory.IsStoppingTime f τ)

MeasureTheory.Adapted f (MeasureTheory.stoppedProcess u τ)


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

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


theorem monic_of_natDegree_le_of_coeff_eq_one (n : ℕ) (pn : p.natDegree ≤ n) (p1 : p.coeff n = 1) :
    Monic p

{R : Type u}
[Semiring R]
{p : R[X]}
(n : ℕ)
(pn : p.natDegree ≤ n)
(p1 : p.coeff n = 1)


lemma nonsingular_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    W.Nonsingular P ↔ W.toAffine.Nonsingular (P x / P z ^ 2) (P y / P z ^ 3)

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


theorem setToFun_sub (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ)
    (hg : Integrable g μ) : setToFun μ T hT (f - g) = setToFun μ T hT f - setToFun μ T hT g

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

MeasureTheory.setToFun μ T hT (f - g) = MeasureTheory.setToFun μ T hT f - MeasureTheory.setToFun μ T hT g


@[simp]
theorem uniqueElim_default {_ : Unique ι} (x : α (default : ι)) : uniqueElim x (default : ι) = x

∀ {x : Unique ι} (x_1 : α default), uniqueElim x_1 default = x_1


theorem lt_nadd_iff : a < b ♯ c ↔ (∃ b' < b, a ≤ b' ♯ c) ∨ ∃ c' < c, a ≤ b ♯ c'


lemma rnDeriv_withDensity_left_of_absolutelyContinuous {ν : Measure α} [SigmaFinite μ]
    [SigmaFinite ν] (hμν : μ ≪ ν) (hf : AEMeasurable f ν) :
    (μ.withDensity f).rnDeriv ν =ᵐ[ν] fun x ↦ f x * μ.rnDeriv ν x

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

(μ.withDensity f).rnDeriv ν =ᵐ[ν] fun x => f x * μ.rnDeriv ν x


@[to_additive]
theorem sInf_inv (s : Set α) : sInf s⁻¹ = (sSup s)⁻¹

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

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


theorem IsPrimitiveRoot.norm'_eq_one {ζ : ℂ} {n : ℕ} (h : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
    ‖ζ‖ = 1


@[to_additive]
theorem prod_list_count [DecidableEq α] [CommMonoid α] (s : List α) :
    s.prod = ∏ m ∈ s.toFinset, m ^ s.count m

{α : Type u_3}
[DecidableEq α]
[AddCommMonoid α]
(s : List α)

s.sum = ∑ m ∈ s.toFinset, List.count m s • m


/-- If `g ≫ f = 0` implies `g = 0` for all `g`, then `f` is a monomorphism. -/
theorem mono_of_cancel_zero {X Y : C} (f : X ⟶ Y)
    (hf : ∀ (Z : C) (g : Z ⟶ X) (_ : g ≫ f = 0), g = 0) : Mono f

(hf : ∀ (Z : C) (g : Z ⟶ X), g ≫ f = 0 → g = 0)


/-- Any invertible linear map rescales Lebesgue measure through the absolute value of its
determinant. -/
theorem map_linearMap_volume_pi_eq_smul_volume_pi {f : (ι → ℝ) →ₗ[ℝ] ι → ℝ}
    (hf : LinearMap.det f ≠ 0) : Measure.map f volume =
      ENNReal.ofReal (abs (LinearMap.det f)⁻¹) • volume

{ι : Type u_1}
[Fintype ι]
{f : (ι → ℝ) →ₗ[ℝ] ι → ℝ}
(hf : LinearMap.det f ≠ 0)

MeasureTheory.Measure.map (⇑f) MeasureTheory.volume = ENNReal.ofReal |(LinearMap.det f)⁻¹| • MeasureTheory.volume


theorem map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = f a b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(a : α)
(b : β)

Option.map₂ f (some a) (some b) = some (f a b)


@[simp]
theorem mem_atBot_sets [Nonempty α] [SemilatticeInf α] {s : Set α} :
    s ∈ (atBot : Filter α) ↔ ∃ a : α, ∀ b ≤ a, b ∈ s

{α : Type u_3}
[Nonempty α]
[SemilatticeInf α]
{s : Set α}


theorem splitAtPred_eq {α} (p : α → Bool) :
    ∀ L l₁ o l₂,
      (∀ x ∈ l₁, p x = false) →
        Option.elim' (L = l₁ ∧ l₂ = []) (fun a => p a = true ∧ L = l₁ ++ a::l₂) o →
          splitAtPred p L = (l₁, o, l₂)

{α : Type u_1}
(p : α → Bool)
(L l₁ : List α)
(o : Option α)
(l₂ : List α)

(∀ x ∈ l₁, p x = false) →
  Option.elim' (L = l₁ ∧ l₂ = []) (fun a => p a = true ∧ L = l₁ ++ a :: l₂) o →
    Turing.PartrecToTM2.splitAtPred p L = (l₁, o, l₂)


theorem leadingCoeff_sub_of_degree_eq (h : degree p = degree q)
    (hlc : leadingCoeff p ≠ leadingCoeff q) :
    leadingCoeff (p - q) = leadingCoeff p - leadingCoeff q

{R : Type u}
[Ring R]
{p q : R[X]}
(h : p.degree = q.degree)
(hlc : p.leadingCoeff ≠ q.leadingCoeff)

(p - q).leadingCoeff = p.leadingCoeff - q.leadingCoeff


@[simp]
theorem val_one' : (1 : ZMod 0).val = 1


lemma perfect_iff_eq_derivedSet {U : Set X} : Perfect U ↔ U = derivedSet U

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


lemma StarOrderedRing.nonneg_iff_spectrum_nonneg (a : A) (ha : p a := by cfc_tac) :
    0 ≤ a ↔ ∀ x ∈ spectrum R a, 0 ≤ x

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


/-- If a preconnected set `s` intersects an open set `u`, and limit points of `u` inside `s` are
contained in `u`, then the whole set `s` is contained in `u`. -/
theorem IsPreconnected.subset_of_closure_inter_subset (hs : IsPreconnected s) (hu : IsOpen u)
    (h'u : (s ∩ u).Nonempty) (h : closure u ∩ s ⊆ u) : s ⊆ u

{α : Type u}
[TopologicalSpace α]
{s u : Set α}
(hs : IsPreconnected s)
(hu : IsOpen u)
(h'u : (s ∩ u).Nonempty)
(h : closure u ∩ s ⊆ u)


@[to_additive (attr := simp)]
theorem noncommPiCoprod_mulSingle (i : ι) (y : N i) :
    noncommPiCoprod ϕ hcomm (Pi.mulSingle i y) = ϕ i y

{hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), AddCommute ((ϕ i) x) ((ϕ j) y)}

(AddMonoidHom.noncommPiCoprod ϕ hcomm) (Pi.single i y) = (ϕ i) y


lemma directedOn_ge_Icc (a b : α) : DirectedOn (· ≥ ·) (Icc a b)

DirectedOn (fun x x_1 => x ≥ x_1) (Set.Icc a b)


theorem zorn_nonempty_preorder [Nonempty α]
    (h : ∀ c : Set α, IsChain (· ≤ ·) c → c.Nonempty → BddAbove c) : ∃ m : α, ∀ a, m ≤ a → a ≤ m

(h : ∀ (c : Set α), IsChain (fun x x_1 => x ≤ x_1) c → c.Nonempty → BddAbove c)


/-- For a nonempty collection of subsets of a given independent set,
the closure of the intersection is the intersection of the closure. -/
lemma Indep.closure_sInter_eq_biInter_closure_of_forall_subset {Js : Set (Set α)} (hI : M.Indep I)
    (hne : Js.Nonempty) (hIs : ∀ J ∈ Js, J ⊆ I) : M.closure (⋂₀ Js) = (⋂ J ∈ Js, M.closure J)

{α : Type u_2}
{M : Matroid α}
{I : Set α}
{Js : Set (Set α)}
(hI : M.Indep I)
(hne : Js.Nonempty)
(hIs : ∀ J ∈ Js, J ⊆ I)

M.closure (⋂₀ Js) = ⋂ J ∈ Js, M.closure J


theorem hausdorffEdist_ne_top {K L : ConvexBody V} : EMetric.hausdorffEdist (K : Set V) L ≠ ⊤

{V : Type u_1}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
{K L : ConvexBody V}


@[simp]
theorem ofNat_of_decode {n b} (h : decode (α := α) n = some b) : ofNat (α := α) n = b

{α : Type u_1}
[Denumerable α]
{n : ℕ}
{b : α}
(h : Encodable.decode n = some b)


@[simp]
theorem edgeSet_iSup (f : ι → G.Subgraph) :
    (⨆ i, f i).edgeSet = ⋃ i, (f i).edgeSet

{ι : Sort u_1}
{V : Type u}
{G : SimpleGraph V}
(f : ι → G.Subgraph)


theorem inj_on_of_surj_on_of_card_le (f : ∀ a ∈ s, β) (hf : ∀ a ha, f a ha ∈ t)
    (hsurj : ∀ b ∈ t, ∃ a ha, f a ha = b) (hst : s.card ≤ t.card) ⦃a₁⦄ (ha₁ : a₁ ∈ s) ⦃a₂⦄
    (ha₂ : a₂ ∈ s) (ha₁a₂ : f a₁ ha₁ = f a₂ ha₂) : a₁ = a₂

(hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t)

(hsurj : ∀ b ∈ t, ∃ a, ∃ (ha : a ∈ s), f a ha = b)


theorem prev_cons_cons_eq (z : α) (h : x ∈ x :: z :: l) :
    prev (x :: z :: l) x h = getLast (z :: l) (cons_ne_nil _ _)

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

(x :: z :: l).prev x h = (z :: l).getLast ⋯


@[simp]
theorem ofDual_symm_apply (a : WithBot α) : WithTop.ofDual.symm a = WithBot.toDual a


@[simp]
theorem coe_copy (f : LocallyBoundedMap α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_2}
{β : Type u_3}
[Bornology α]
[Bornology β]
(f : LocallyBoundedMap α β)
(f' : α → β)
(h : f' = ⇑f)


/-- The Yoneda embedding, as a functor from `C` into presheaves on `C`.

See <https://stacks.math.columbia.edu/tag/001O>.
-/
@[simps]
def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁

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

∀ {X Y : C} (f : X ⟶ Y) (Y_1 : Cᵒᵖ)
  (g :
    ((fun X =>
            { obj := fun Y => Opposite.unop Y ⟶ X,
              map := fun {X_1 Y} f g => CategoryTheory.CategoryStruct.comp f.unop g, map_id := ⋯, map_comp := ⋯ })
          X).obj
      Y_1),
  (CategoryTheory.yoneda.map f).app Y_1 g = CategoryTheory.CategoryStruct.comp g f


theorem eq_of_monic_of_associated (hp : p.Monic) (hq : q.Monic) (hpq : Associated p q) : p = q

{R : Type u}
[Semiring R]
{p q : R[X]}
(hp : p.Monic)
(hq : q.Monic)
(hpq : Associated p q)


/-- When `α` is compact, and `β` is a metric space, the bounded continuous maps `α →ᵇ β` are
isometric to `C(α, β)`.
-/
@[simps! (config := .asFn) toEquiv apply symm_apply]
def isometryEquivBoundedOfCompact : C(α, β) ≃ᵢ (α →ᵇ β)

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]

⇑(ContinuousMap.isometryEquivBoundedOfCompact α β).symm = BoundedContinuousFunction.toContinuousMap


@[simp]
theorem expand_zero (f : R[X]) : expand R 0 f = C (eval 1 f)

{R : Type u}
[CommSemiring R]
(f : R[X])

(Polynomial.expand R 0) f = Polynomial.C (Polynomial.eval 1 f)


theorem hausdorffMeasure_measurePreserving_piFinTwo (α : Fin 2 → Type*)
    [∀ i, MeasurableSpace (α i)] [∀ i, EMetricSpace (α i)] [∀ i, BorelSpace (α i)]
    [∀ i, SecondCountableTopology (α i)] (d : ℝ) :
    MeasurePreserving (MeasurableEquiv.piFinTwo α) μH[d] μH[d]

[∀ (i : Fin 2), SecondCountableTopology (α i)]

MeasureTheory.MeasurePreserving ⇑(MeasurableEquiv.piFinTwo α) μH[d] μH[d]


theorem forall_or_of_or_forall {α : Sort*} {p : α → Prop} {b : Prop} (h : b ∨ ∀ x, p x) (x : α) :
    b ∨ p x

{α : Sort u_3}
{p : α → Prop}
{b : Prop}
(h : b ∨ ∀ (x : α), p x)
(x : α)


@[to_additive (attr := gcongr) sub_lt_sub]
theorem div_lt_div'' (hab : a < b) (hcd : c < d) : a / d < b / c

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


theorem one_sub_le_one (x : Icc (0 : β) 1) : 1 - (x : β) ≤ 1

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


@[simp, norm_cast]
theorem cast_subNatNat (m n) : ((Int.subNatNat m n : ℤ) : R) = m - n

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


lemma cfc_polynomial (q : R[X]) (a : A) (ha : p a := by cfc_tac) :
    cfc q.eval a = aeval a q

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
(q : Polynomial R)
(a : A)
(ha : p a := by cfc_tac)

cfc (fun a => Polynomial.eval a q) a = (Polynomial.aeval a) q


@[ext] lemma ext {X Y : Comon_ C} {f g : X ⟶ Y} (w : f.hom = g.hom) : f = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y : Comon_ C}
{f g : X ⟶ Y}
(w : f.hom = g.hom)


@[simp] theorem join_pure (f : Filter α) : join (pure f) = f


lemma lt_of_toNat_lt {a b : ℤ} (h : toNat a < toNat b) : a < b


/--
If there exists a finite set `{ r }` of `R` such that `Mᵣ` is `Rᵣ`-finite for each `r`,
then `M` is a finite `R`-module.

General version for any modules `Mᵣ` and rings `Rᵣ` satisfying the correct universal properties.
See `Module.Finite.of_localizationSpan_finite` for the specialized version.

See `of_localizationSpan'` for a version without the finite set assumption.
-/
theorem of_localizationSpan_finite' (t : Finset R) (ht : Ideal.span (t : Set R) = ⊤)
    {Mₚ : ∀ (_ : t), Type*} [∀ (g : t), AddCommMonoid (Mₚ g)] [∀ (g : t), Module R (Mₚ g)]
    {Rₚ : ∀ (_ : t), Type u} [∀ (g : t), CommRing (Rₚ g)] [∀ (g : t), Algebra R (Rₚ g)]
    [∀ (g : t), IsLocalization.Away g.val (Rₚ g)]
    [∀ (g : t), Module (Rₚ g) (Mₚ g)] [∀ (g : t), IsScalarTower R (Rₚ g) (Mₚ g)]
    (f : ∀ (g : t), M →ₗ[R] Mₚ g) [∀ (g : t), IsLocalizedModule (Submonoid.powers g.val) (f g)]
    (H : ∀ (g : t), Module.Finite (Rₚ g) (Mₚ g)) :
    Module.Finite R M

[(g : { x // x ∈ t }) → AddCommMonoid (Mₚ g)]

[(g : { x // x ∈ t }) → Module R (Mₚ g)]

[(g : { x // x ∈ t }) → CommRing (Rₚ g)]

[(g : { x // x ∈ t }) → Algebra R (Rₚ g)]

[∀ (g : { x // x ∈ t }), IsLocalization.Away (↑g) (Rₚ g)]

[(g : { x // x ∈ t }) → Module (Rₚ g) (Mₚ g)]

[∀ (g : { x // x ∈ t }), IsScalarTower R (Rₚ g) (Mₚ g)]

(f : (g : { x // x ∈ t }) → M →ₗ[R] Mₚ g)

[∀ (g : { x // x ∈ t }), IsLocalizedModule (Submonoid.powers ↑g) (f g)]

(H : ∀ (g : { x // x ∈ t }), Module.Finite (Rₚ g) (Mₚ g))


theorem IsCompactOperator.sub [TopologicalAddGroup M₄] {f g : M₁ → M₄} (hf : IsCompactOperator f)
    (hg : IsCompactOperator g) : IsCompactOperator (f - g)

{M₁ : Type u_5}
{M₄ : Type u_8}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[TopologicalSpace M₄]
[AddCommGroup M₄]
[TopologicalAddGroup M₄]
{f g : M₁ → M₄}
(hf : IsCompactOperator f)
(hg : IsCompactOperator g)


theorem smoothAt_id : SmoothAt I I (id : M → M) x

{𝕜 : 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]
{x : M}


theorem Decidable.imp_or' [Decidable b] : (a → b ∨ c) ↔ (a → b) ∨ (a → c)

{b : Prop}
{a : Sort u_1}
{c : Prop}
[Decidable b]


theorem isRat_inv_pos {α} [DivisionRing α] [CharZero α] {a : α} {n d : ℕ} :
    IsRat a (.ofNat (Nat.succ n)) d → IsRat a⁻¹ (.ofNat d) (Nat.succ n)

{α : Type u_1}
[DivisionRing α]
[CharZero α]
{a : α}
{n d : ℕ}

Mathlib.Meta.NormNum.IsRat a (Int.ofNat n.succ) d → Mathlib.Meta.NormNum.IsRat a⁻¹ (Int.ofNat d) n.succ


theorem dense_compl_compact (hs : IsCompact s) : Dense sᶜ


theorem isPrimitiveClassified_of_coprime_of_zero_left (hc : Int.gcd x y = 1) (hx : x = 0) :
    h.IsPrimitiveClassified

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(hc : x.gcd y = 1)
(hx : x = 0)


theorem nnnorm_coe_units (e : ℤˣ) : ‖(e : ℤ)‖₊ = 1


theorem norm_compContinuousMultilinearMap_le (g : G →L[𝕜] G') (f : ContinuousMultilinearMap 𝕜 E G) :
    ‖g.compContinuousMultilinearMap f‖ ≤ ‖g‖ * ‖f‖

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


@[simp, norm_cast]
theorem coe_centralizer {R} [Semiring R] (s : Set R) : (centralizer s : Set R) = s.centralizer

↑(Subsemiring.centralizer s) = s.centralizer


/-- `GroupSeminormClass F α` states that `F` is a type of `β`-valued seminorms on the group `α`.

You should extend this class when you extend `GroupSeminorm`. -/
@[to_additive]
class GroupSeminormClass (F α β : Type*) [Group α] [OrderedAddCommMonoid β] [FunLike F α β]
  extends MulLEAddHomClass F α β : Prop where
  /-- The image of one is zero. -/
  map_one_eq_zero (f : F) : f 1 = 0
  /-- The map is invariant under inversion of its argument. -/
  map_inv_eq_map (f : F) (a : α) : f a⁻¹ = f a

{F : Type u_7}
{α : Type u_8}
{β : Type u_9}
[Group α]
[OrderedAddCommMonoid β]
[FunLike F α β]
[self : GroupSeminormClass F α β]
(f : F)
(a : α)


@[simp]
theorem mem_map {S : NonUnitalSubalgebra R A} {f : F} {y : B} : y ∈ map f S ↔ ∃ x ∈ S, f x = y

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[Module R A]
[Module R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
{S : NonUnitalSubalgebra R A}
{f : F}
{y : B}

y ∈ NonUnitalSubalgebra.map f S ↔ ∃ x ∈ S, f x = y


@[to_additive (attr := simp)]
theorem smul_finset_subset_smul_finset_iff : a • s ⊆ a • t ↔ s ⊆ t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[AddGroup α]
[AddAction α β]
{s t : Finset β}
{a : α}


theorem rangeSplitting_injective (f : α → β) : Injective (rangeSplitting f)

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


@[simp]
theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i)

QuaternionGroup.xa i * QuaternionGroup.xa j = QuaternionGroup.a (↑n + j - i)


/-- `triangleRotateShortComplex φ` is a degreewise split short exact sequence of
cochain complexes. -/
@[simps]
noncomputable def triangleRotateShortComplexSplitting (n : ℤ) :
    ((triangleRotateShortComplex φ).map (eval _ _ n)).Splitting

(CochainComplex.mappingCone.triangleRotateShortComplexSplitting φ n).s =
  -(CochainComplex.mappingCone.inl φ).v (n + 1) n ⋯


@[simp]
theorem codisjoint_hnot_hnot_left_iff : Codisjoint (￢￢a) b ↔ Codisjoint a b

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


protected theorem Commute.div_sub_div (hbc : Commute b c) (hbd : Commute b d) (hb : b ≠ 0)
    (hd : d ≠ 0) : a / b - c / d = (a * d - b * c) / (b * d)

{K : Type u_3}
[DivisionRing K]
{a b c d : K}
(hbc : Commute b c)
(hbd : Commute b d)
(hb : b ≠ 0)
(hd : d ≠ 0)


@[to_additive (attr := simp)]
theorem iUnion_smul_set (s : Set α) (t : Set β) : ⋃ a ∈ s, a • t = s • t

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


@[simp]
theorem volume_pi_Ioo_toReal {a b : ι → ℝ} (h : a ≤ b) :
    (volume (pi univ fun i => Ioo (a i) (b i))).toReal = ∏ i, (b i - a i)

{ι : Type u_1}
[Fintype ι]
{a b : ι → ℝ}
(h : a ≤ b)

(MeasureTheory.volume (Set.univ.pi fun i => Set.Ioo (a i) (b i))).toReal = ∏ i : ι, (b i - a i)


lemma exponentialPDF_of_neg {r x : ℝ} (hx : x < 0) : exponentialPDF r x = 0

ProbabilityTheory.exponentialPDF r x = 0


/-- A preorder is a reflexive, transitive relation `≤` with `a < b` defined in the obvious way. -/
class Preorder (α : Type u) extends LE α, LT α where
  le_refl : ∀ a : α, a ≤ a
  le_trans : ∀ a b c : α, a ≤ b → b ≤ c → a ≤ c
  lt := fun a b => a ≤ b ∧ ¬b ≤ a
  lt_iff_le_not_le : ∀ a b : α, a < b ↔ a ≤ b ∧ ¬b ≤ a := by intros; rfl

{α : Type u}
[self : Preorder α]
(a b : α)


theorem npow_mul' (x : M) (m n : ℕ) : x ^ (m * n) = (x ^ n) ^ m

{M : Type u_1}
[MulOneClass M]
[Pow M ℕ]
[NatPowAssoc M]
(x : M)
(m n : ℕ)


theorem pow_snd (n : ℕ) (a : 𝓜(𝕜, A)) : (a ^ n).snd = a.snd ^ n

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


@[simp 999]
theorem ofNat'_eq : ∀ n, Num.ofNat' n = n


/-- The set of differentiability points of a continuous function depending on a parameter taking
values in a complete space is Borel-measurable. -/
theorem measurableSet_of_differentiableAt_with_param (hf : Continuous f.uncurry) :
    MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2}

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[LocallyCompactSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{α : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[MeasurableSpace E]
[OpensMeasurableSpace α]
[OpensMeasurableSpace E]
{f : α → E → F}
[CompleteSpace F]
(hf : Continuous (Function.uncurry f))

MeasurableSet {p | DifferentiableAt 𝕜 (f p.1) p.2}


@[simp]
theorem mapDart_apply (d : G.Dart) : f.mapDart d = ⟨d.1.map f f, f.map_adj d.2⟩

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
(d : G.Dart)

f.mapDart d = { toProd := Prod.map (⇑f) (⇑f) d.toProd, adj := ⋯ }


theorem turnBound_of_right {s t : S} (m : t ∈ r s) (n : ℕ) (h : turnBound s ≤ n + 1) :
    turnBound t ≤ n

(h : SetTheory.PGame.State.turnBound s ≤ n + 1)


theorem Chain'.cons_of_le [LinearOrder α] {a : α} {as m : List α}
    (ha : List.Chain' (· > ·) (a :: as)) (hm : List.Chain' (· > ·) m) (hmas : m ≤ as) :
    List.Chain' (· > ·) (a :: m)

(ha : List.Chain' (fun x x_1 => x > x_1) (a :: as))

(hm : List.Chain' (fun x x_1 => x > x_1) m)

List.Chain' (fun x x_1 => x > x_1) (a :: m)


@[simp, norm_cast]
theorem coe_intCast (n : ℤ) : ((n : α →ᵇ R) : α → R) = n

{α : Type u}
[TopologicalSpace α]
{R : Type u_2}
[SeminormedRing R]
(n : ℤ)


theorem isMulTwoCoboundary_of_twoCoboundaries
    (f : twoCoboundaries (Rep.ofMulDistribMulAction G M)) :
    IsMulTwoCoboundary (M := M) (Additive.toMul ∘ f.1.1)

(f : ↥(groupCohomology.twoCoboundaries (Rep.ofMulDistribMulAction G M)))

groupCohomology.IsMulTwoCoboundary (⇑Additive.toMul ∘ ↑↑f)


/-- The cocone points of two colimit cocones for naturally isomorphic functors
are themselves isomorphic.
-/
@[simps]
def coconePointsIsoOfNatIso {F G : J ⥤ C} {s : Cocone F} {t : Cocone G} (P : IsColimit s)
    (Q : IsColimit t) (w : F ≅ G) : s.pt ≅ t.pt

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
{s : CategoryTheory.Limits.Cocone F}
{t : CategoryTheory.Limits.Cocone G}
(P : CategoryTheory.Limits.IsColimit s)
(Q : CategoryTheory.Limits.IsColimit t)
(w : F ≅ G)

(P.coconePointsIsoOfNatIso Q w).hom = P.map t w.hom


theorem orderOf_ne_two_of_involutive (hφ : FixedPointFree φ) (h2 : Function.Involutive φ) (g : G) :
    orderOf g ≠ 2

{G : Type u_1}
[Group G]
{φ : G →* G}
[Finite G]
(hφ : MonoidHom.FixedPointFree ⇑φ)
(h2 : Function.Involutive ⇑φ)
(g : G)


@[simp]
theorem det_pow (M : Matrix m m R) (n : ℕ) : det (M ^ n) = det M ^ n

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


theorem exists_lt_apply_of_lt_opNNNorm {𝕜 𝕜₂ E F : Type*} [NormedAddCommGroup E]
    [SeminormedAddCommGroup F] [DenselyNormedField 𝕜] [NontriviallyNormedField 𝕜₂] {σ₁₂ : 𝕜 →+* 𝕜₂}
    [NormedSpace 𝕜 E] [NormedSpace 𝕜₂ F] [RingHomIsometric σ₁₂] (f : E →SL[σ₁₂] F) {r : ℝ≥0}
    (hr : r < ‖f‖₊) : ∃ x : E, ‖x‖₊ < 1 ∧ r < ‖f x‖₊

{𝕜 : Type u_11}
{𝕜₂ : Type u_12}
{E : Type u_13}
{F : Type u_14}
[NormedAddCommGroup E]
[SeminormedAddCommGroup F]
[DenselyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
{r : ℝ≥0}
(hr : r < ‖f‖₊)


@[simp]
theorem constFormalMultilinearSeries_radius {v : F} :
    (constFormalMultilinearSeries 𝕜 E v).radius = ⊤

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


@[to_additive]
protected theorem Finset.multipliable_compl_iff (s : Finset β) :
    (Multipliable fun x : { x // x ∉ s } ↦ f x) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f : β → α}
(s : Finset β)


@[reassoc (attr := simp)]
lemma germ_stalkPullbackHom
    (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) (U : Opens Y) (hU : f x ∈ U) :
    F.germ ⟨f x, hU⟩ ≫ stalkPullbackHom C f F x =
      ((pushforwardPullbackAdjunction C f).unit.app F).app _ ≫
        ((pullback C f).obj F).germ ⟨x, show x ∈ (Opens.map f).obj U from hU⟩

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X Y : TopCat}
(f : X ⟶ Y)
(F : TopCat.Presheaf C Y)
(x : ↑X)
(U : TopologicalSpace.Opens ↑Y)
(hU : f x ∈ U)

F.germ ⟨f x, hU⟩ ≫ TopCat.Presheaf.stalkPullbackHom C f F x =
  ((TopCat.Presheaf.pushforwardPullbackAdjunction C f).unit.app F).app (Opposite.op U) ≫
    ((TopCat.Presheaf.pullback C f).obj F).germ ⟨x, ⋯⟩


theorem irreducible : Irreducible (p : 𝕎 k)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[Field k]
[CharP k p]


/--
A comonoid object in a functor category induces a functor to the category of comonoid objects.
-/
@[simps]
def functorObj (A : Comon_ (C ⥤ D)) : C ⥤ Comon_ D

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

((CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.functorObj A).obj X).comul = A.comul.app X


/-- The continuous homomorphism given by projection onto the first factor. -/
@[to_additive (attr := simps!)
  "The continuous homomorphism given by projection onto the first factor."]
def fst : ContinuousMonoidHom (A × B) A

(A : Type u_2)
(B : Type u_3)
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(self : A × B)

(ContinuousMonoidHom.fst A B) self = self.1


theorem mem_adjoin_simple_iff {α : E} (x : E) :
    x ∈ adjoin F {α} ↔ ∃ r s : F[X], x = aeval α r / aeval α s

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

x ∈ F⟮α⟯ ↔ ∃ r s, x = (Polynomial.aeval α) r / (Polynomial.aeval α) s


lemma range_domRestrict_le_range [RingHomSurjective τ₁₂] (f : M →ₛₗ[τ₁₂] M₂) (S : Submodule R M) :
    LinearMap.range (f.domRestrict S) ≤ LinearMap.range f

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)
(S : Submodule R M)


lemma rnDeriv_self (μ : Measure α) [SigmaFinite μ] : μ.rnDeriv μ =ᵐ[μ] fun _ ↦ 1

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


theorem le_mul_left (a : Ordinal) {b : Ordinal} (hb : 0 < b) : a ≤ a * b

(a : Ordinal.{u_4})
{b : Ordinal.{u_4}}
(hb : 0 < b)


@[simp]
theorem nil_eval (v) : nil.eval v = pure []

Turing.ToPartrec.Code.nil.eval v = pure []


@[simp]
theorem smul_apply (a : S) (f : M →ₛₗ[σ₁₂] M₂) (x : M) : (a • f) x = a • f x

{R : Type u_1}
{R₂ : Type u_3}
{S : Type u_6}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
[Monoid S]
[DistribMulAction S M₂]
[SMulCommClass R₂ S M₂]
(a : S)
(f : M →ₛₗ[σ₁₂] M₂)
(x : M)


@[to_additive (attr := simp 1001)]
theorem smul_Lp_zero (c : Mᵈᵐᵃ) : c • (0 : Lp E p μ) = 0

[MeasureTheory.SMulInvariantMeasure M α μ]


@[reassoc (attr := simp)]
lemma p_opcyclesMap' : h₁.p ≫ opcyclesMap' φ h₁ h₂ = φ.τ₂ ≫ h₂.p

CategoryTheory.CategoryStruct.comp h₁.p (CategoryTheory.ShortComplex.opcyclesMap' φ h₁ h₂) =
  CategoryTheory.CategoryStruct.comp φ.τ₂ h₂.p


theorem associated_unit_mul_left {β : Type*} [CommMonoid β] (a u : β) (hu : IsUnit u) :
    Associated (u * a) a

{β : Type u_5}
[CommMonoid β]
(a u : β)
(hu : IsUnit u)


theorem not_mem_range_self : n ∉ range n


theorem mul_mul_apply [Fintype n] (A B C : Matrix n n α) (i j : n) :
    (A * B * C) i j = A i ⬝ᵥ B *ᵥ (Cᵀ j)

{n : Type u_3}
{α : Type v}
[NonUnitalSemiring α]
[Fintype n]
(A B C : Matrix n n α)
(i j : n)


theorem map_one [AddZeroClass G] [One G] [Add H] [AddConstMapClass F G H 1 b] (f : F) :
    f 1 = f 0 + b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddZeroClass G]
[One G]
[Add H]
[AddConstMapClass F G H 1 b]
(f : F)


theorem DifferentiableAt.zpow (hf : DifferentiableAt 𝕜 f a) (h : f a ≠ 0 ∨ 0 ≤ m) :
    DifferentiableAt 𝕜 (fun x => f x ^ m) a

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{m : ℤ}
{f : E → 𝕜}
{a : E}
(hf : DifferentiableAt 𝕜 f a)
(h : f a ≠ 0 ∨ 0 ≤ m)


theorem UniformContinuousOn.tendstoUniformly [UniformSpace α] [UniformSpace γ] {x : α} {U : Set α}
    (hU : U ∈ 𝓝 x) {F : α → β → γ} (hF : UniformContinuousOn (↿F) (U ×ˢ (univ : Set β))) :
    TendstoUniformly F (F x) (𝓝 x)

{F : α → β → γ}

(hF : UniformContinuousOn (↿F) (U ×ˢ Set.univ))


/-- The **Dyson e-transform**. Turns `(s, t)` into `(s ∪ e • t, t ∩ e⁻¹ • s)`. This reduces the
product of the two sets. -/
@[to_additive (attr := simps) "The **Dyson e-transform**.
Turns `(s, t)` into `(s ∪ e +ᵥ t, t ∩ -e +ᵥ s)`. This reduces the sum of the two sets."]
def mulDysonETransform : Finset α × Finset α

{α : Type u_1}
[DecidableEq α]
[AddCommGroup α]
(e : α)
(x : Finset α × Finset α)

(Finset.addDysonETransform e x).2 = x.2 ∩ (-e +ᵥ x.1)


/-- If `[c, d]` is a subinterval of `[a, b]`, then the distance between `c` and `d` is less than or
equal to that of `a` and `b` -/
theorem abs_sub_le_of_uIcc_subset_uIcc (h : [[c, d]] ⊆ [[a, b]]) : |d - c| ≤ |b - a|

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b c d : α}
(h : [[c, d]] ⊆ [[a, b]])


theorem prod_map_implicitFunction :
    ∀ᶠ p : F × G in 𝓝 (φ.prodFun φ.pt), φ.prodFun (φ.implicitFunction p.1 p.2) = p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(φ : ImplicitFunctionData 𝕜 E F G)

∀ᶠ (p : F × G) in 𝓝 (φ.prodFun φ.pt), φ.prodFun (φ.implicitFunction p.1 p.2) = p


/-- `CentroidHomClass F α` states that `F` is a type of centroid homomorphisms.

You should extend this class when you extend `CentroidHom`. -/
class CentroidHomClass (F α : Type*) [NonUnitalNonAssocSemiring α] [FunLike F α α] extends
  AddMonoidHomClass F α α : Prop where
  /-- Commutativity of centroid homomorphims with left multiplication. -/
  map_mul_left (f : F) (a b : α) : f (a * b) = a * f b
  /-- Commutativity of centroid homomorphims with right multiplication. -/
  map_mul_right (f : F) (a b : α) : f (a * b) = f a * b

{F : Type u_6}
{α : Type u_7}
[NonUnitalNonAssocSemiring α]
[FunLike F α α]
[self : CentroidHomClass F α]
(f : F)
(a b : α)


theorem mOfFn_pure {m} [Monad m] [LawfulMonad m] {α} :
    ∀ {n} (f : Fin n → α), (@mOfFn m _ _ _ fun i => pure (f i)) = pure (ofFn f)

{m : Type u_2 → Type u_3}
[Monad m]
[LawfulMonad m]
{α : Type u_2}
{n : ℕ}
(f : Fin n → α)

(Mathlib.Vector.mOfFn fun i => pure (f i)) = pure (Mathlib.Vector.ofFn f)


/-- A uniform space is complete provided that (a) its uniformity filter has a countable basis;
(b) any sequence satisfying a "controlled" version of the Cauchy condition converges. -/
theorem complete_of_convergent_controlled_sequences (U : ℕ → Set (α × α)) (U_mem : ∀ n, U n ∈ 𝓤 α)
    (HU : ∀ u : ℕ → α, (∀ N m n, N ≤ m → N ≤ n → (u m, u n) ∈ U N) → ∃ a, Tendsto u atTop (𝓝 a)) :
    CompleteSpace α

(HU : ∀ (u : ℕ → α), (∀ (N m n : ℕ), N ≤ m → N ≤ n → (u m, u n) ∈ U N) → ∃ a, Filter.Tendsto u Filter.atTop (𝓝 a))


theorem infs_sups_subset_right : (t ⊻ u) ⊼ s ⊆ t ⊼ s ⊻ u ⊼ s

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


theorem JoinedIn.source_mem (h : JoinedIn F x y) : x ∈ F

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{F : Set X}
(h : JoinedIn F x y)


@[simp] theorem length_pushn (c : Char) (n : Nat) : (pushn s c n).length = s.length + n


@[simp] theorem of_coe (X : ModuleCat R) : of R X = X


@[to_additive]
lemma prodAux_eq : ∀ l : List M, FreeMonoid.prodAux l = l.prod


{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_5}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
(l : Filter E)


/-- A prelax functor between bicategories is a lax prefunctor such that `map₂` is a functor.
This structure will be extended to define `LaxFunctor` and `OplaxFunctor`.
-/
structure PrelaxFunctor (B : Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u₂) [Bicategory.{w₂, v₂} C]
    extends PrelaxFunctorStruct B C where
  /-- Prelax functors preserves identity 2-morphisms. -/
  map₂_id : ∀ {a b : B} (f : a ⟶ b), map₂ (𝟙 f) = 𝟙 (map f) := by aesop -- TODO: why not aesop_cat?
  /-- Prelax functors preserves compositions of 2-morphisms. -/
  map₂_comp : ∀ {a b : B} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h),
      map₂ (η ≫ θ) = map₂ η ≫ map₂ θ := by aesop_cat

(self : CategoryTheory.PrelaxFunctor B C)

self.map₂ (CategoryTheory.CategoryStruct.comp η θ) = CategoryTheory.CategoryStruct.comp (self.map₂ η) (self.map₂ θ)


@[simp]
theorem sub_apply : (x - y) i = x i - y i

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


/-- The kernel of `biprod.snd : X ⊞ Y ⟶ Y` is `X`. -/
@[simps!]
def kernelBiprodSndIso : kernel (biprod.snd : X ⊞ Y ⟶ Y) ≅ X

CategoryTheory.Limits.kernelBiprodSndIso.inv =
  CategoryTheory.Limits.limit.lift (CategoryTheory.Limits.parallelPair CategoryTheory.Limits.biprod.snd 0)
    (CategoryTheory.Limits.biprod.sndKernelFork X Y)


theorem fundamentalDomain_stdBasis :
    fundamentalDomain (stdBasis K) =
        (Set.univ.pi fun _ => Set.Ico 0 1) ×ˢ
        (Set.univ.pi fun _ => Complex.measurableEquivPi⁻¹' (Set.univ.pi fun _ => Set.Ico 0 1))

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

Zspan.fundamentalDomain (NumberField.mixedEmbedding.stdBasis K) =
  (Set.univ.pi fun x => Set.Ico 0 1) ×ˢ
    Set.univ.pi fun x => ⇑Complex.measurableEquivPi ⁻¹' Set.univ.pi fun x => Set.Ico 0 1


@[simp]
theorem realize_graph {f : L.Functions n} {x : Fin n → M} {y : M} :
    (Formula.graph f).Realize (Fin.cons y x : _ → M) ↔ funMap f x = y

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{n : ℕ}
{f : L.Functions n}
{x : Fin n → M}
{y : M}

(FirstOrder.Language.Formula.graph f).Realize (Fin.cons y x) ↔ FirstOrder.Language.Structure.funMap f x = y


theorem subset_inter_iff : s ⊆ t ∩ u ↔ s ⊆ t ∧ s ⊆ u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}


@[to_additive (attr := simp, norm_cast)]
theorem coe_sup : ⇑(p ⊔ q) = ⇑p ⊔ ⇑q

{E : Type u_4}
[AddGroup E]
(p q : AddGroupSeminorm E)


lemma lTensor_exact [Small.{v} R] [flat : Flat R M] ⦃N N' N'' : Type v⦄
    [AddCommGroup N] [AddCommGroup N'] [AddCommGroup N''] [Module R N] [Module R N'] [Module R N'']
    ⦃f : N →ₗ[R] N'⦄ ⦃g : N' →ₗ[R] N''⦄ (exact : Function.Exact f g) :
    Function.Exact (f.lTensor M) (g.lTensor M)

{R : Type u}
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]
[Small.{v, u} R]
[flat : Module.Flat R M]
⦃N N' N'' : Type v⦄
[AddCommGroup N]
[AddCommGroup N']
[AddCommGroup N'']
[Module R N]
[Module R N']
[Module R N'']
⦃f : N →ₗ[R] N'⦄
⦃g : N' →ₗ[R] N''⦄
(exact : Function.Exact ⇑f ⇑g)

Function.Exact ⇑(LinearMap.lTensor M f) ⇑(LinearMap.lTensor M g)


/-- If `f : α → β` is constant w.r.t. `l` and `g : β → γ`, then `g ∘ f : α → γ` also is. -/
lemma isConstant_comp {l : Filter α} {f : α → β} {g : β → γ}
    (h : (f : Germ l β).IsConstant) : ((g ∘ f) : Germ l γ).IsConstant

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
{f : α → β}
{g : β → γ}
(h : (↑f).IsConstant)


/-- A function in `Lp` can be approximated in `Lp` by continuous functions. -/
theorem boundedContinuousFunction_topologicalClosure [SecondCountableTopologyEither α E]
    [Fact (1 ≤ p)] (hp : p ≠ ∞) [μ.WeaklyRegular] :
    (boundedContinuousFunction E p μ).topologicalClosure = ⊤

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[MeasurableSpace α]
[BorelSpace α]
(E : Type u_2)
[NormedAddCommGroup E]
(μ : MeasureTheory.Measure α)
{p : ℝ≥0∞}
[NormedSpace ℝ E]
[SecondCountableTopologyEither α E]
[Fact (1 ≤ p)]
(hp : p ≠ ⊤)
[μ.WeaklyRegular]

(MeasureTheory.Lp.boundedContinuousFunction E p μ).topologicalClosure = ⊤


/-- Urysohn's lemma: if `s` and `t` are two disjoint sets in a regular locally compact topological
space `X`, with `s` compact and `t` closed, then there exists a continuous compactly supported
function `f : X → ℝ` such that

* `f` equals one on `s`;
* `f` equals zero on `t`;
* `0 ≤ f x ≤ 1` for all `x`.
-/
theorem exists_continuous_one_zero_of_isCompact [RegularSpace X] [LocallyCompactSpace X]
    {s t : Set X} (hs : IsCompact s) (ht : IsClosed t) (hd : Disjoint s t) :
    ∃ f : C(X, ℝ), EqOn f 1 s ∧ EqOn f 0 t ∧ HasCompactSupport f ∧ ∀ x, f x ∈ Icc (0 : ℝ) 1

{X : Type u_1}
[TopologicalSpace X]
[RegularSpace X]
[LocallyCompactSpace X]
{s t : Set X}
(hs : IsCompact s)
(ht : IsClosed t)
(hd : Disjoint s t)

∃ f, Set.EqOn (⇑f) 1 s ∧ Set.EqOn (⇑f) 0 t ∧ HasCompactSupport ⇑f ∧ ∀ (x : X), f x ∈ Set.Icc 0 1


@[fun_prop]
nonrec
theorem ContinuousAt.cexp (h : ContinuousAt f x) : ContinuousAt (fun y => exp (f y)) x

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℂ}
{x : α}
(h : ContinuousAt f x)

ContinuousAt (fun y => Complex.exp (f y)) x


@[simp]
theorem dimH_preimage (e : X ≃ᵢ Y) (s : Set Y) : dimH (e ⁻¹' s) = dimH s

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
(e : X ≃ᵢ Y)
(s : Set Y)


theorem pathConnectedSpace_iff_zerothHomotopy :
    PathConnectedSpace X ↔ Nonempty (ZerothHomotopy X) ∧ Subsingleton (ZerothHomotopy X)


/-- If `(s : S)` is in the image of `f`, then `monomial n s` lifts. -/
theorem monomial_mem_lifts {s : S} (n : ℕ) (h : s ∈ Set.range f) : monomial n s ∈ lifts f

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
{f : R →+* S}
{s : S}
(n : ℕ)
(h : s ∈ Set.range ⇑f)

(Polynomial.monomial n) s ∈ Polynomial.lifts f


@[to_additive (attr := simp)]
theorem coe_id : ⇑(OrderMonoidHom.id α) = id

(α : Type u_2)
[Preorder α]
[AddZeroClass α]


{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I J : LieIdeal R L)


/-- The map `Square C → Square Cᵒᵖ` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def op (sq : Square C) : Square Cᵒᵖ

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


@[simp]
lemma Φ_four : W.Φ 4 = X * W.preΨ₄ ^ 2 * W.Ψ₂Sq - W.Ψ₃ * (W.preΨ₄ * W.Ψ₂Sq ^ 2 - W.Ψ₃ ^ 3)

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)

W.Φ 4 = Polynomial.X * W.preΨ₄ ^ 2 * W.Ψ₂Sq - W.Ψ₃ * (W.preΨ₄ * W.Ψ₂Sq ^ 2 - W.Ψ₃ ^ 3)


@[simp]
theorem range_coe_inter_infty : range ((↑) : X → OnePoint X) ∩ {∞} = ∅

Set.range OnePoint.some ∩ {OnePoint.infty} = ∅


theorem updateRow_reindex [DecidableEq l] [DecidableEq m] (A : Matrix m n α) (i : l) (r : o → α)
    (e : m ≃ l) (f : n ≃ o) :
    updateRow (reindex e f A) i r = reindex e f (A.updateRow (e.symm i) fun j => r (f j))

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[DecidableEq l]
[DecidableEq m]
(A : Matrix m n α)
(i : l)
(r : o → α)
(e : m ≃ l)
(f : n ≃ o)

((Matrix.reindex e f) A).updateRow i r = (Matrix.reindex e f) (A.updateRow (e.symm i) fun j => r (f j))


theorem hitting_le_iff_of_exists [IsWellOrder ι (· < ·)] {m : ι}
    (h_exists : ∃ j ∈ Set.Icc n m, u j ω ∈ s) :
    hitting u s n m ω ≤ i ↔ ∃ j ∈ Set.Icc n i, u j ω ∈ s

{u : ι → Ω → β}

MeasureTheory.hitting u s n m ω ≤ i ↔ ∃ j ∈ Set.Icc n i, u j ω ∈ s


@[simp]
theorem algebraMap_mk' (x : B) (hx : IsIntegral R x) : algebraMap A B (mk' A x hx) = x

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsIntegralClosure A R B]
(x : B)
(hx : IsIntegral R x)

(algebraMap A B) (IsIntegralClosure.mk' A x hx) = x


@[norm_cast]
theorem coe_iInf {ι : Sort*} (s : ι → ℝ≥0) : (↑(⨅ i, s i) : ℝ) = ⨅ i, ↑(s i)


@[simp]
theorem map_apply_ιMulti {n : ℕ} (f : M →ₗ[R] N) (m : Fin n → M) :
    map f (ιMulti R n m) = ιMulti R n (f ∘ m)

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{N : Type u4}
[AddCommGroup N]
[Module R N]
{n : ℕ}
(f : M →ₗ[R] N)
(m : Fin n → M)

(ExteriorAlgebra.map f) ((ExteriorAlgebra.ιMulti R n) m) = (ExteriorAlgebra.ιMulti R n) (⇑f ∘ m)


theorem ordConnected_of_uIcc_subset_left (h : ∀ y ∈ s, [[x, y]] ⊆ s) : OrdConnected s

{α : Type u_1}
[LinearOrder α]
{s : Set α}
{x : α}
(h : ∀ y ∈ s, [[x, y]] ⊆ s)


theorem pairwise_insert_of_symmetric_of_not_mem (hr : Symmetric r) (ha : a ∉ s) :
    (insert a s).Pairwise r ↔ s.Pairwise r ∧ ∀ b ∈ s, r a b

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a : α}
(hr : Symmetric r)
(ha : a ∉ s)


@[to_additive (attr := simp)]
theorem nontrivial_iff : Nontrivial (Subgroup G) ↔ Nontrivial G

Nontrivial (AddSubgroup G) ↔ Nontrivial G


theorem HasDerivAt.tendsto_slope_zero_left [PartialOrder 𝕜] (h : HasDerivAt f f' x) :
    Tendsto (fun t ↦ t⁻¹ • (f (x + t) - f x)) (𝓝[<] 0) (𝓝 f')

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
[PartialOrder 𝕜]
(h : HasDerivAt f f' x)

Filter.Tendsto (fun t => t⁻¹ • (f (x + t) - f x)) (𝓝[<] 0) (𝓝 f')


lemma shiftIso_add'_inv_app (n m mn : M) (hnm : m + n = mn) (a a' a'' : M)
    (ha' : n + a = a') (ha'' : m + a' = a'') (X : C) :
    (F.shiftIso mn a a'' (by rw [← hnm, ← ha'', ← ha', add_assoc])).inv.app X =
      (shiftIso F m a' a'' ha'').inv.app X ≫
        (shiftIso F n a a' ha').inv.app ((shiftFunctor C m).obj X) ≫
        (shift F a).map ((shiftFunctorAdd' C m n mn hnm).inv.app X)

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_5, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
(n m mn : M)
(hnm : m + n = mn)
(a a' a'' : M)
(ha' : n + a = a')
(ha'' : m + a' = a'')
(X : C)

(F.shiftIso mn a a'' ⋯).inv.app X =
  (F.shiftIso m a' a'' ha'').inv.app X ≫
    (F.shiftIso n a a' ha').inv.app ((CategoryTheory.shiftFunctor C m).obj X) ≫
      (F.shift a).map ((CategoryTheory.shiftFunctorAdd' C m n mn hnm).inv.app X)


/-- If `m` and `n` are natural numbers, then the natural number `m^n` is even
if and only if `m` is even and `n` is positive. -/
@[parity_simps] lemma even_pow : Even (m ^ n) ↔ Even m ∧ n ≠ 0


/-- Composition of non-unital ring homomorphisms is associative. -/
theorem comp_assoc {δ} {_ : NonUnitalNonAssocSemiring δ} (f : α →ₙ+* β) (g : β →ₙ+* γ)
    (h : γ →ₙ+* δ) : (h.comp g).comp f = h.comp (g.comp f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
[NonUnitalNonAssocSemiring γ]
{δ : Type u_5}

∀ {x : NonUnitalNonAssocSemiring δ} (f : α →ₙ+* β) (g : β →ₙ+* γ) (h : γ →ₙ+* δ), (h.comp g).comp f = h.comp (g.comp f)


theorem forall_mem_of_forall_mem_union_left (h : ∀ x ∈ l₁ ∪ l₂, p x) : ∀ x ∈ l₁, p x

{α : Type u_1}
{l₁ l₂ : List α}
{p : α → Prop}
[DecidableEq α]
(h : ∀ (x : α), x ∈ l₁ ∪ l₂ → p x)
(x : α)


/-- `liminf (c + xᵢ) = c + liminf xᵢ`. -/
lemma limsup_const_add (F : Filter ι) [NeBot F] [Add R] [ContinuousAdd R]
    [CovariantClass R R (fun x y ↦ x + y) fun x y ↦ x ≤ y] (f : ι → R) (c : R)
    (bdd_above : F.IsBoundedUnder (· ≤ ·) f) (cobdd : F.IsCoboundedUnder (· ≤ ·) f) :
    Filter.limsup (fun i ↦ c + f i) F = c + Filter.limsup f F

[CovariantClass R R (fun x y => x + y) fun x y => x ≤ y]

(bdd_above : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) F f)

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) F f)

Filter.limsup (fun i => c + f i) F = c + Filter.limsup f F


@[simp]
lemma natTrailingDegree_X_pow (n : ℕ) :
    (X ^ n : R[X]).natTrailingDegree = n

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

(Polynomial.X ^ n).natTrailingDegree = n


theorem image_gaugeRescaleHomeomorph_interior {s t : Set E}
    (hsc : Convex ℝ s) (hs₀ : s ∈ 𝓝 0) (hsb : IsVonNBounded ℝ s)
    (htc : Convex ℝ t) (ht₀ : t ∈ 𝓝 0) (htb : IsVonNBounded ℝ t) :
    gaugeRescaleHomeomorph s t hsc hs₀ hsb htc ht₀ htb '' interior s = interior t

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[T1Space E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
{s t : Set E}
(hsc : Convex ℝ s)
(hs₀ : s ∈ 𝓝 0)
(hsb : Bornology.IsVonNBounded ℝ s)
(htc : Convex ℝ t)
(ht₀ : t ∈ 𝓝 0)
(htb : Bornology.IsVonNBounded ℝ t)

⇑(gaugeRescaleHomeomorph s t hsc hs₀ hsb htc ht₀ htb) '' interior s = interior t


/-- Restrict a `PartialEquiv` to a pair of corresponding sets. -/
@[simps (config := .asFn)]
def restr (h : e.IsImage s t) : PartialEquiv α β

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


@[to_additive le_sum_of_subadditive_on_pred]
lemma le_prod_of_submultiplicative_on_pred (f : α → β)
    (p : α → Prop) (h_one : f 1 = 1) (hp_one : p 1)
    (h_mul : ∀ a b, p a → p b → f (a * b) ≤ f a * f b) (hp_mul : ∀ a b, p a → p b → p (a * b))
    (s : Multiset α) (hps : ∀ a, a ∈ s → p a) : f s.prod ≤ (s.map f).prod

(h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b)

(hp_mul : ∀ (a b : α), p a → p b → p (a * b))


@[simp]
lemma add_of_imp {x₁ x₂ y₁ y₂ : F} {h₁ : W.Nonsingular x₁ y₁} {h₂ : W.Nonsingular x₂ y₂}
    (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) : some h₁ + some h₂ = some (nonsingular_add h₁ h₂ hxy)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
{h₁ : W.Nonsingular x₁ y₁}
{h₂ : W.Nonsingular x₂ y₂}
(hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂)

WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ = WeierstrassCurve.Affine.Point.some ⋯


theorem isLocallySurjective_iff_imagePresheaf_sheafify_eq_top' {F G : Cᵒᵖ ⥤ Type w} (f : F ⟶ G) :
    IsLocallySurjective J f ↔ (imagePresheaf f).sheafify J = ⊤

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsLocallySurjective J f ↔
  CategoryTheory.GrothendieckTopology.Subpresheaf.sheafify J (CategoryTheory.GrothendieckTopology.imagePresheaf f) = ⊤


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

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

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


theorem insertRec_insert_mk {C : AList β → Sort*} (H0 : C ∅)
    (IH : ∀ (a : α) (b : β a) (l : AList β), a ∉ l → C l → C (l.insert a b)) {a : α} (b : β a)
    {l : AList β} (h : a ∉ l) :
    @insertRec α β _ C H0 IH (l.insert a b) = IH a b l h (@insertRec α β _ C H0 IH l)

(IH : (a : α) → (b : β a) → (l : AList β) → a ∉ l → C l → C (AList.insert a b l))

AList.insertRec H0 IH (AList.insert a b l) = IH a b l h (AList.insertRec H0 IH l)


theorem isLowerSet_of_isClosed (h : IsClosed s) : IsLowerSet s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsUpper α]
{s : Set α}
(h : IsClosed s)


@[simp] theorem mk_length (s : List Char) : (String.mk s).length = s.length


@[simp] theorem map_eq_some' : x.map f = some b ↔ ∃ a, x = some a ∧ f a = b

∀ {α : Type u_1} {b : α} {α_1 : Type u_2} {x : Option α_1} {f : α_1 → α},
  Option.map f x = some b ↔ ∃ a, x = some a ∧ f a = b


@[simp]
theorem restrict_comp_codRestrict {f : ι → α} {g : α → β} {b : Set α} (h : ∀ x, f x ∈ b) :
    b.restrict g ∘ b.codRestrict f h = g ∘ f

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : ι → α}
{g : α → β}
{b : Set α}
(h : ∀ (x : ι), f x ∈ b)

b.restrict g ∘ Set.codRestrict f b h = g ∘ f


lemma complete_distinguished_triangle_morphism (T₁ T₂ : Triangle D)
    (hT₁ : T₁ ∈ L.essImageDistTriang) (hT₂ : T₂ ∈ L.essImageDistTriang)
    (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (fac : T₁.mor₁ ≫ b = a ≫ T₂.mor₁) :
    ∃ c, T₁.mor₂ ≫ c = b ≫ T₂.mor₂ ∧ T₁.mor₃ ≫ a⟦1⟧' = c ≫ T₂.mor₃

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

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle D)

(fac : CategoryTheory.CategoryStruct.comp T₁.mor₁ b = CategoryTheory.CategoryStruct.comp a T₂.mor₁)

∃ c,
  CategoryTheory.CategoryStruct.comp T₁.mor₂ c = CategoryTheory.CategoryStruct.comp b T₂.mor₂ ∧
    CategoryTheory.CategoryStruct.comp T₁.mor₃ ((CategoryTheory.shiftFunctor D 1).map a) =
      CategoryTheory.CategoryStruct.comp c T₂.mor₃


lemma top_ne_ideal_smul_of_le_jacobson_annihilator [Nontrivial M]
    [Module.Finite R M] {I} (h : I ≤ (Module.annihilator R M).jacobson) :
    (⊤ : Submodule R M) ≠ I • ⊤


theorem max_le {a b c : α} (h₁ : a ≤ c) (h₂ : b ≤ c) : max a b ≤ c

{α : Type u}
[LinearOrder α]
{a b c : α}
(h₁ : a ≤ c)
(h₂ : b ≤ c)


theorem addHaar_ball [Nontrivial E] (x : E) {r : ℝ} (hr : 0 ≤ r) :
    μ (ball x r) = ENNReal.ofReal (r ^ finrank ℝ E) * μ (ball 0 1)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
[Nontrivial E]
(x : E)
{r : ℝ}
(hr : 0 ≤ r)

μ (Metric.ball x r) = ENNReal.ofReal (r ^ FiniteDimensional.finrank ℝ E) * μ (Metric.ball 0 1)


/-- A function is `C^(n + 1)` if and only if it is differentiable,
  and its derivative (formulated in terms of `deriv`) is `C^n`. -/
theorem contDiff_succ_iff_deriv {n : ℕ} :
    ContDiff 𝕜 (n + 1 : ℕ) f₂ ↔ Differentiable 𝕜 f₂ ∧ ContDiff 𝕜 n (deriv f₂)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f₂ : 𝕜 → F}
{n : ℕ}

ContDiff 𝕜 (↑(n + 1)) f₂ ↔ Differentiable 𝕜 f₂ ∧ ContDiff 𝕜 (↑n) (deriv f₂)


theorem summable_toReal {f : α → ℝ≥0∞} (hsum : ∑' x, f x ≠ ∞) : Summable fun x => (f x).toReal

{α : Type u_1}
{f : α → ℝ≥0∞}
(hsum : ∑' (x : α), f x ≠ ⊤)


lemma reflTransGen_wcovBy_eq_reflTransGen_covBy [PartialOrder α] :
    ReflTransGen ((· : α) ⩿ ·) = ReflTransGen (· ⋖ ·)

(Relation.ReflTransGen fun x x_1 => x ⩿ x_1) = Relation.ReflTransGen fun x x_1 => x ⋖ x_1


theorem liftPropOn_of_mem_maximalAtlas [HasGroupoid M G] (hG : G.LocalInvariantProp G Q)
    (hQ : ∀ y, Q id univ y) (he : e ∈ maximalAtlas M G) : LiftPropOn Q e e.source

(he : e ∈ StructureGroupoid.maximalAtlas M G)


theorem natDegree_mul (hp : p.Monic) (hq : q.Monic) :
    (p * q).natDegree = p.natDegree + q.natDegree

{R : Type u}
[Semiring R]
{p q : R[X]}
(hp : p.Monic)
(hq : q.Monic)


@[simp]
theorem isDiag_iff_proj_eq (z : α × α) : IsDiag (Sym2.mk z) ↔ z.1 = z.2


lemma isComplex_smul_iff : IsComplex (σ • w) ↔ IsComplex w

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
{σ : K ≃ₐ[k] K}
{w : NumberField.InfinitePlace K}


theorem eq_of_forall_apply_eq (μ ν : FiniteMeasure Ω)
    (h : ∀ s : Set Ω, MeasurableSet s → μ s = ν s) : μ = ν

(h : ∀ (s : Set Ω), MeasurableSet s → μ s = ν s)


theorem setIntegral_condexpL2_indicator (hs : MeasurableSet[m] s) (ht : MeasurableSet t)
    (hμs : μ s ≠ ∞) (hμt : μ t ≠ ∞) :
    ∫ x in s, (condexpL2 ℝ ℝ hm (indicatorConstLp 2 ht hμt 1) : α → ℝ) x ∂μ = (μ (t ∩ s)).toReal

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
{hm : m ≤ m0}
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(hμs : μ s ≠ ⊤)
(hμt : μ t ≠ ⊤)

∫ (x : α) in s, ↑↑↑((MeasureTheory.condexpL2 ℝ ℝ hm) (MeasureTheory.indicatorConstLp 2 ht hμt 1)) x ∂μ =
  (μ (t ∩ s)).toReal


@[simp]
theorem toContinuousLinearMap_norm [NormOneClass A] (φ : A →ₐ[𝕜] 𝕜) :
    ‖φ.toContinuousLinearMap‖ = 1

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
[NormOneClass A]
(φ : A →ₐ[𝕜] 𝕜)


@[to_additive (attr := simp)]
theorem mul_fromLeftInv (x : S.leftInv) : (x : M) * S.fromLeftInv x = 1

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
(x : ↥S.leftInv)


@[simp]
theorem linearIsometryEquiv_mk' (e : P₁ → P₂) (e' : V₁ ≃ₗᵢ[𝕜] V₂) (p h) :
    (mk' e e' p h).linearIsometryEquiv = e'

(AffineIsometryEquiv.mk' e e' p h).linearIsometryEquiv = e'


@[simp]
theorem mod_one (a : Ordinal) : a % 1 = 0


theorem prod_uniformContinuous_equiv : UniformContinuous (WithLp.equiv p (α × β))

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[UniformSpace α]
[UniformSpace β]

UniformContinuous ⇑(WithLp.equiv p (α × β))


theorem isOpen_iff {s : Set Γ₀} : IsOpen s ↔ (0 : Γ₀) ∉ s ∨ ∃ γ, γ ≠ 0 ∧ Iio γ ⊆ s

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
{s : Set Γ₀}

IsOpen s ↔ 0 ∉ s ∨ ∃ γ, γ ≠ 0 ∧ Set.Iio γ ⊆ s


@[to_additive]
theorem le_or_lt_of_mul_le_mul [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} :
    a₁ * b₁ ≤ a₂ * b₂ → a₁ ≤ a₂ ∨ b₁ < b₂

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

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

a₁ * b₁ ≤ a₂ * b₂ → a₁ ≤ a₂ ∨ b₁ < b₂


theorem isCoatomic_iff_forall_isCoatomic_Ici [OrderTop α] :
    IsCoatomic α ↔ ∀ x : α, IsCoatomic (Set.Ici x)

{α : Type u_2}
[PartialOrder α]
[OrderTop α]

IsCoatomic α ↔ ∀ (x : α), IsCoatomic ↑(Set.Ici x)


theorem IsCompactOperator.clm_comp [AddCommMonoid M₂] [Module R₂ M₂] [AddCommMonoid M₃]
    [Module R₃ M₃] {f : M₁ → M₂} (hf : IsCompactOperator f) (g : M₂ →SL[σ₂₃] M₃) :
    IsCompactOperator (g ∘ f)

{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₂]
[Semiring R₃]
{σ₂₃ : R₂ →+* R₃}
{M₁ : Type u_4}
{M₂ : Type u_5}
{M₃ : Type u_6}
[TopologicalSpace M₁]
[TopologicalSpace M₂]
[TopologicalSpace M₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R₂ M₂]
[AddCommMonoid M₃]
[Module R₃ M₃]
{f : M₁ → M₂}
(hf : IsCompactOperator f)
(g : M₂ →SL[σ₂₃] M₃)


theorem mem_A_of_differentiable {ε : ℝ} (hε : 0 < ε) {x : E} (hx : DifferentiableAt 𝕜 f x) :
    ∃ R > 0, ∀ r ∈ Ioo (0 : ℝ) R, x ∈ A f (fderiv 𝕜 f x) r ε

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{ε : ℝ}
(hε : 0 < ε)
{x : E}
(hx : DifferentiableAt 𝕜 f x)

∃ R > 0, ∀ r ∈ Set.Ioo 0 R, x ∈ FDerivMeasurableAux.A f (fderiv 𝕜 f x) r ε


theorem toReal_coe_eq_self_iff {θ : ℝ} : (θ : Angle).toReal = θ ↔ -π < θ ∧ θ ≤ π


@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ

{G : Type u_1}
[CommGroup G]
[TopologicalSpace G]
[TopologicalGroup G]
[MeasurableSpace G]
[BorelSpace G]
(μ : MeasureTheory.Measure G)
[μ.IsHaarMeasure]
[CompactSpace G]
[RootableBy G ℤ]
{n : ℤ}
(hn : n ≠ 0)

MeasureTheory.MeasurePreserving (fun g => g ^ n) μ μ


@[to_additive]
theorem smul_closure_subset (c : M) (s : Set α) : c • closure s ⊆ closure (c • s)

{M : Type u_1}
{α : Type u_2}
[TopologicalSpace α]
[Monoid M]
[MulAction M α]
[ContinuousConstSMul M α]
(c : M)
(s : Set α)


/-- A subsemigroup `S` includes `closure s` if and only if it includes `s`. -/
@[to_additive (attr := simp)
  "An additive subsemigroup `S` includes `closure s` if and only if it includes `s`"]
theorem closure_le : closure s ≤ S ↔ s ⊆ S

{M : Type u_1}
[Mul M]
{s : Set M}
{S : Subsemigroup M}


/-- The type of bounded order homomorphisms from `α` to `β`. -/
structure BoundedOrderHom (α β : Type*) [Preorder α] [Preorder β] [BoundedOrder α]
  [BoundedOrder β] extends OrderHom α β where
  /-- The function preserves the top element. The preferred spelling is `map_top`. -/
  map_top' : toFun ⊤ = ⊤
  /-- The function preserves the bottom element. The preferred spelling is `map_bot`. -/
  map_bot' : toFun ⊥ = ⊥

{α : Type u_6}
{β : Type u_7}
[Preorder α]
[Preorder β]
[BoundedOrder α]
[BoundedOrder β]
(self : BoundedOrderHom α β)


/-- Hölder's inequality for functions `α → ℝ`. The integral of the product of two nonnegative
functions is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are conjugate
exponents. -/
theorem integral_mul_le_Lp_mul_Lq_of_nonneg {p q : ℝ} (hpq : p.IsConjExponent q) {f g : α → ℝ}
    (hf_nonneg : 0 ≤ᵐ[μ] f) (hg_nonneg : 0 ≤ᵐ[μ] g) (hf : Memℒp f (ENNReal.ofReal p) μ)
    (hg : Memℒp g (ENNReal.ofReal q) μ) :
    ∫ a, f a * g a ∂μ ≤ (∫ a, f a ^ p ∂μ) ^ (1 / p) * (∫ a, g a ^ q ∂μ) ^ (1 / q)

(hf : MeasureTheory.Memℒp f (ENNReal.ofReal p) μ)

(hg : MeasureTheory.Memℒp g (ENNReal.ofReal q) μ)


theorem rotateR_nil (y : α) (r : Ordnode α) : rotateR nil y r = node' nil y r

Ordnode.nil.rotateR y r = Ordnode.nil.node' y r


theorem pullback_snd_image_fst_preimage (f : X ⟶ Z) (g : Y ⟶ Z) (U : Set X) :
    (pullback.snd f g) '' ((pullback.fst f g) ⁻¹' U) =
      g ⁻¹' (f '' U)

{X Y Z : TopCat}
(f : X ⟶ Z)
(g : Y ⟶ Z)
(U : Set ↑X)

⇑(CategoryTheory.Limits.pullback.snd f g) '' (⇑(CategoryTheory.Limits.pullback.fst f g) ⁻¹' U) = ⇑g ⁻¹' (⇑f '' U)


theorem unzip_eq_map : ∀ l : List (α × β), unzip l = (l.map Prod.fst, l.map Prod.snd)

{α : Type u}
{β : Type u_1}
(l : List (α × β))

l.unzip = (List.map Prod.fst l, List.map Prod.snd l)


/-- **Lucas's Theorem**: For primes `p`, `choose n k` is congruent to the product of
`choose (⌊n / p ^ i⌋ % p) (⌊k / p ^ i⌋ % p)` over `i` modulo `p`. -/
theorem choose_modEq_prod_range_choose {a : ℕ} (ha₁ : n < p ^ a) (ha₂ : k < p ^ a) :
    choose n k ≡ ∏ i in range a, choose (n / p ^ i % p) (k / p ^ i % p) [ZMOD p]

{n k p : ℕ}
[Fact (Nat.Prime p)]
{a : ℕ}
(ha₁ : n < p ^ a)
(ha₂ : k < p ^ a)

↑(n.choose k) ≡ ∏ i ∈ Finset.range a, ↑((n / p ^ i % p).choose (k / p ^ i % p)) [ZMOD ↑p]


/-- Restriction of a measure to a subset is monotone both in set and in measure. -/
@[mono]
theorem restrict_mono {_m0 : MeasurableSpace α} ⦃s s' : Set α⦄ (hs : s ⊆ s') ⦃μ ν : Measure α⦄
    (hμν : μ ≤ ν) : μ.restrict s ≤ ν.restrict s'

{α : Type u_2}
{_m0 : MeasurableSpace α}
⦃s s' : Set α⦄
(hs : s ⊆ s')
⦃μ ν : MeasureTheory.Measure α⦄
(hμν : μ ≤ ν)


@[simp] private lemma card_triangleIndices : (triangleIndices A).card = A.card

{G : Type u_1}
[AddCommGroup G]
{A : Finset (G × G)}

(Corners.triangleIndices A).card = A.card


theorem sublist_orderedInsert (x : α) (xs : List α) : xs <+ xs.orderedInsert r x

{α : Type u}
{r : α → α → Prop}
[DecidableRel r]
(x : α)
(xs : List α)


/-- **LDL decomposition**: any positive definite matrix `S` can be
decomposed as `S = LDLᴴ` where `L` is a lower-triangular matrix and `D` is a diagonal matrix.  -/
theorem LDL.lower_conj_diag : LDL.lower hS * LDL.diag hS * (LDL.lower hS)ᴴ = S

{𝕜 : Type u_1}
[RCLike 𝕜]
{n : Type u_2}
[LinearOrder n]
[IsWellOrder n fun x x_1 => x < x_1]
[LocallyFiniteOrderBot n]
{S : Matrix n n 𝕜}
[Fintype n]
(hS : S.PosDef)

LDL.lower hS * LDL.diag hS * (LDL.lower hS).conjTranspose = S


theorem ncard_def (s : Set α) : s.ncard = ENat.toNat s.encard


/-- The pushforward functor. -/
@[simps!]
def pushforward {X Y : TopCat.{w}} (f : X ⟶ Y) : X.Presheaf C ⥤ Y.Presheaf C

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

∀ {X_1 Y_1 : (TopologicalSpace.Opens ↑X)ᵒᵖ ⥤ C} (α : X_1 ⟶ Y_1) (X_2 : (TopologicalSpace.Opens ↑Y)ᵒᵖ),
  ((TopCat.Presheaf.pushforward C f).map α).app X_2 =
    α.app (Opposite.op ((TopologicalSpace.Opens.map f).obj (Opposite.unop X_2)))


theorem inf_product_right (s : Finset β) (t : Finset γ) (f : β × γ → α) :
    (s ×ˢ t).inf f = t.inf fun i' => s.inf fun i => f ⟨i, i'⟩

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeInf α]
[OrderTop α]
(s : Finset β)
(t : Finset γ)
(f : β × γ → α)

(s ×ˢ t).inf f = t.inf fun i' => s.inf fun i => f (i, i')


theorem differentiableAt_arctan (x : ℝ) : DifferentiableAt ℝ arctan x


@[to_additive]
theorem closure_iUnion {ι} (s : ι → Set M) : closure (⋃ i, s i) = ⨆ i, closure (s i)

{M : Type u_1}
[AddZeroClass M]
{ι : Sort u_4}
(s : ι → Set M)

AddSubmonoid.closure (⋃ i, s i) = ⨆ i, AddSubmonoid.closure (s i)


@[simp] lemma coe_tosInfHom (f : CompleteLatticeHom α β) : ⇑f.tosInfHom = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)


theorem Filter.Tendsto.lift'_closure (hf : Continuous f) {l l'} (h : Tendsto f l l') :
    Tendsto f (l.lift' closure) (l'.lift' closure)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Continuous f)
{l : Filter X}
{l' : Filter Y}
(h : Filter.Tendsto f l l')

Filter.Tendsto f (l.lift' closure) (l'.lift' closure)


theorem map_lt_of_translationNumber_lt_nat {n : ℕ} (h : τ f < n) (x : ℝ) : f x < x + n

(f : CircleDeg1Lift)
{n : ℕ}
(h : f.translationNumber < ↑n)
(x : ℝ)


lemma toSpec_surjective {f : A} {m : ℕ} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) :
    Function.Surjective (toSpec 𝒜 f)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
{f : A}
{m : ℕ}
(f_deg : f ∈ 𝒜 m)
(hm : 0 < m)

Function.Surjective ⇑(AlgebraicGeometry.ProjIsoSpecTopComponent.toSpec 𝒜 f)


@[simp]
theorem conjTranspose_row [Star α] (v : m → α) : (row ι v)ᴴ = col ι (star v)

{m : Type u_2}
{α : Type v}
{ι : Type u_6}
[Star α]
(v : m → α)

(Matrix.row ι v).conjTranspose = Matrix.col ι (star v)


theorem WithTop.coe_sSup' [SupSet α] {s : Set α} (hs : BddAbove s) :
    ↑(sSup s) = (sSup ((fun (a : α) ↦ ↑a) '' s) : WithTop α)

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