@[simp]
theorem mk_coe (f : A →⋆ₐ[R] B) (h₁ h₂ h₃ h₄ h₅ h₆) :
    (⟨⟨⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩, h₅⟩, h₆⟩ : A →⋆ₐ[R] B) = f

(h₂ :
  ∀ (x y : A),
    { toFun := ⇑f, map_one' := h₁ }.toFun (x * y) =
      { toFun := ⇑f, map_one' := h₁ }.toFun x * { toFun := ⇑f, map_one' := h₁ }.toFun y)

(h₃ : (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun 0 = 0)

(h₄ :
  ∀ (x y : A),
    (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun (x + y) =
      (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun x +
        (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun y)

(h₅ :
  ∀ (r : R),
    (↑↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄ }).toFun ((algebraMap R A) r) =
      (algebraMap R B) r)

(h₆ :
  ∀ (x : A),
    (↑↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄,
                  commutes' := h₅ }.toRingHom).toFun
        (star x) =
      star
        ((↑↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄,
                    commutes' := h₅ }.toRingHom).toFun
          x))

{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄, commutes' := h₅, map_star' := h₆ } = f


theorem associativity (X Y Z : Type u) :
    ((μ R X Y).hom ⊗ 𝟙 ((free R).obj Z)) ≫ (μ R (X ⊗ Y) Z).hom ≫ map (free R).obj (α_ X Y Z).hom =
      (α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
        (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom

(R : Type u)
[CommRing R]
(X Y Z : Type u)

CategoryTheory.MonoidalCategory.tensorHom (ModuleCat.Free.μ R X Y).hom (𝟙 ((ModuleCat.free R).obj Z)) ≫
    (ModuleCat.Free.μ R (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).hom ≫
      CategoryTheory.map (ModuleCat.free R).obj (CategoryTheory.MonoidalCategory.associator X Y Z).hom =
  (CategoryTheory.MonoidalCategory.associator ((ModuleCat.free R).obj X) ((ModuleCat.free R).obj Y)
        ((ModuleCat.free R).obj Z)).hom ≫
    CategoryTheory.MonoidalCategory.tensorHom (𝟙 ((ModuleCat.free R).obj X)) (ModuleCat.Free.μ R Y Z).hom ≫
      (ModuleCat.Free.μ R X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom


@[simp] protected lemma upper (s : UpperSet α) : IsUpperSet (s : Set α)


@[simp]
theorem restrict_apply (f : α → β) (s : Set α) (x : s) : s.restrict f x = f x

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


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

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

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


theorem min_val {a : Fin n} : min (a : ℕ) n = a


@[functor_norm]
theorem map_mk {α β} (h : α → β) (x : F (G α)) : h <$> Comp.mk x = Comp.mk ((h <$> ·) <$> x)

{F : Type u → Type w}
{G : Type v → Type u}
[Functor F]
[Functor G]
{α β : Type v}
(h : α → β)
(x : F (G α))

h <$> Functor.Comp.mk x = Functor.Comp.mk ((fun x => h <$> x) <$> x)


@[simp] theorem coprime_one_left_eq_true (n) : Coprime 1 n = True


@[simp]
theorem optionSubtype_symm_apply_symm_apply [DecidableEq β] (x : β) (e : α ≃ { y : β // y ≠ x })
    (b : { y : β // y ≠ x }) : ((optionSubtype x).symm e : Option α ≃ β).symm b = e.symm b

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : α ≃ { y // y ≠ x })
(b : { y // y ≠ x })

(↑((Equiv.optionSubtype x).symm e)).symm ↑b = some (e.symm b)


lemma prev_π₂ (i₁ : I₁) {i₂ i₂' : I₂} (h : c₂.Rel i₂ i₂') :
    c₁₂.prev (π c₁ c₂ c₁₂ ⟨i₁, i₂'⟩) = π c₁ c₂ c₁₂ ⟨i₁, i₂⟩

{I₁ : Type u_1}
{I₂ : Type u_2}
{I₁₂ : Type u_3}
(c₁ : ComplexShape I₁)
{c₂ : ComplexShape I₂}
(c₁₂ : ComplexShape I₁₂)
[TotalComplexShape c₁ c₂ c₁₂]
(i₁ : I₁)
{i₂ i₂' : I₂}
(h : c₂.Rel i₂ i₂')

c₁₂.prev (c₁.π c₂ c₁₂ (i₁, i₂')) = c₁.π c₂ c₁₂ (i₁, i₂)


@[simp]
theorem cos_coe (x : ℝ) : cos (x : Angle) = Real.cos x


@[simp, norm_cast]
theorem coe_one : ⇑(1 : CauSeq β abv) = 1

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]


@[to_additive]
nonrec theorem measurableSet_mulSupport {m : MeasurableSpace α} [One β] [TopologicalSpace β]
    [MetrizableSpace β] (hf : StronglyMeasurable f) : MeasurableSet (mulSupport f)

(hf : MeasureTheory.StronglyMeasurable f)


theorem preimage_relEmbedding {t : Set β} (ht : IsAntichain r' t) (φ : r ↪r r') :
    IsAntichain r (φ ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{r' : β → β → Prop}
{t : Set β}
(ht : IsAntichain r' t)
(φ : r ↪r r')


theorem inv_zero : (0 : (Cauchy abv))⁻¹ = 0

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[DivisionRing β]
{abv : β → α}
[IsAbsoluteValue abv]


/-- Restriction from `R`-linear automorphisms of `M` to `R`-linear endomorphisms of `M`,
promoted to a monoid hom. -/
@[simps]
def automorphismGroup.toLinearMapMonoidHom : (M ≃ₗ[R] M) →* M →ₗ[R] M

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(e : M ≃ₗ[R] M)

LinearEquiv.automorphismGroup.toLinearMapMonoidHom e = ↑e


/-- The constant-function embedding, as a multiplicative monoid hom. -/
@[to_additive (attr := simps) "The constant-function embedding, as an additive monoid hom."]
def constMonoidHom [MulOneClass Y] : Y →* LocallyConstant X Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[MulOneClass Y]
(y : Y)

LocallyConstant.constMonoidHom y = LocallyConstant.const X y


@[to_additive]
theorem UniformContinuous.const_smul [UniformContinuousConstSMul M X] {f : Y → X}
    (hf : UniformContinuous f) (c : M) : UniformContinuous (c • f)

{M : Type v}
{X : Type x}
{Y : Type y}
[UniformSpace X]
[UniformSpace Y]
[SMul M X]
[UniformContinuousConstSMul M X]
{f : Y → X}
(hf : UniformContinuous f)
(c : M)


theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
    trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f)

{R : Type u_1}
[CommSemiring R]
(f : PowerSeries R)
(n : ℕ)

PowerSeries.trunc (n - 1) ((PowerSeries.derivative R) f) = Polynomial.derivative (PowerSeries.trunc n f)


theorem Decidable.imp_iff_right_iff [Decidable a] : (a → b ↔ b) ↔ a ∨ b


theorem Prod.isTop_iff : IsTop x ↔ IsTop x.1 ∧ IsTop x.2

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{x : α × β}


{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)


@[to_additive mem_fixedPoints_iff_card_orbit_eq_one]
theorem mem_fixedPoints_iff_card_orbit_eq_one {a : α} [Fintype (orbit M a)] :
    a ∈ fixedPoints M α ↔ Fintype.card (orbit M a) = 1

{M : Type u}
[Monoid M]
{α : Type v}
[MulAction M α]
{a : α}
[Fintype ↑(MulAction.orbit M a)]

a ∈ MulAction.fixedPoints M α ↔ Fintype.card ↑(MulAction.orbit M a) = 1


/-- Given a family of `n` linearly independent vectors in a space of dimension `> n`, one may extend
the family by another vector while retaining linear independence. -/
theorem exists_linearIndependent_cons_of_lt_rank [StrongRankCondition R] {n : ℕ} {v : Fin n → M}
    (hv : LinearIndependent R v) (h : n < Module.rank R M) :
    ∃ (x : M), LinearIndependent R (Fin.cons x v)

{R : Type u_1}
{M : Type u}
[Ring R]
[AddCommGroup M]
[Module R M]
[HasRankNullity.{u, u_1} R]
[StrongRankCondition R]
{n : ℕ}
{v : Fin n → M}
(hv : LinearIndependent R v)
(h : ↑n < Module.rank R M)


protected theorem zero_le {_m0 : MeasurableSpace α} (μ : Measure α) : 0 ≤ μ

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


@[simp]
theorem augmentTruncate_inv_f_succ (C : CochainComplex V ℕ) (i : ℕ) :
    (augmentTruncate C).inv.f (i + 1) = 𝟙 (C.X (i + 1))

C.augmentTruncate.inv.f (i + 1) = 𝟙 (C.X (i + 1))


/-- A *tree* is a connected acyclic graph. -/
@[mk_iff]
structure IsTree : Prop where
  /-- Graph is connected. -/
  protected isConnected : G.Connected
  /-- Graph is acyclic. -/
  protected IsAcyclic : G.IsAcyclic

{V : Type u}
{G : SimpleGraph V}
(self : G.IsTree)


/-- Constant function bundled as an `OrderHom`. -/
@[simps (config := .asFn)]
def const (α : Type*) [Preorder α] {β : Type*} [Preorder β] : β →o α →o β

(α : Type u_6)
[Preorder α]
{β : Type u_7}
[Preorder β]
(b : β)

⇑((OrderHom.const α) b) = Function.const α b


/-- The uniqueness part of the universal property for quotients of monoids. -/
@[to_additive "The uniqueness part of the universal property for quotients of `AddMonoid`s."]
theorem lift_unique (H : c ≤ ker f) (g : c.Quotient →* P) (Hg : g.comp c.mk' = f) :
    g = c.lift f H

{M : Type u_1}
{P : Type u_3}
[MulOneClass M]
[MulOneClass P]
{c : Con M}
{f : M →* P}
(H : c ≤ Con.ker f)
(g : c.Quotient →* P)
(Hg : g.comp c.mk' = f)


/--
Any character `c` in `(A ⊗ B)⋆` induces a linear map `A → B⋆` by `a ↦ b ↦ c (a ⊗ b)`.
-/
@[simps] noncomputable def curry :
    CharacterModule (A ⊗[R] B) →ₗ[R] (A →ₗ[R] CharacterModule B)

(c : CharacterModule (TensorProduct R A B))

∀ (x : A), (CharacterModule.curry c) x = AddMonoidHom.comp c ↑((TensorProduct.mk R A B) x)


@[to_additive]
theorem comap_comap (S : Subsemigroup P) (g : N →ₙ* P) (f : M →ₙ* N) :
    (S.comap g).comap f = S.comap (g.comp f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Add M]
[Add N]
[Add P]
(S : AddSubsemigroup P)
(g : AddHom N P)
(f : AddHom M N)

AddSubsemigroup.comap f (AddSubsemigroup.comap g S) = AddSubsemigroup.comap (g.comp f) S


@[simp]
lemma image_coe_Iic (x : ℝ) : Real.toEReal '' Iic x = Ioc ⊥ ↑x

Real.toEReal '' Set.Iic x = Set.Ioc ⊥ ↑x


theorem div_tendsto_leadingCoeff_div_of_degree_eq (hdeg : P.degree = Q.degree) :
    Tendsto (fun x => eval x P / eval x Q) atTop (𝓝 <| P.leadingCoeff / Q.leadingCoeff)

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P Q : 𝕜[X])
[OrderTopology 𝕜]
(hdeg : P.degree = Q.degree)

Filter.Tendsto (fun x => Polynomial.eval x P / Polynomial.eval x Q) Filter.atTop (𝓝 (P.leadingCoeff / Q.leadingCoeff))


theorem le_natAbs {a : Int} : a ≤ natAbs a


theorem MeasureTheory.MeasurePreserving.aestronglyMeasurable_comp_iff {β : Type*}
    {f : α → β} {mα : MeasurableSpace α} {μa : Measure α} {mβ : MeasurableSpace β} {μb : Measure β}
    (hf : MeasurePreserving f μa μb) (h₂ : MeasurableEmbedding f) {g : β → γ} :
    AEStronglyMeasurable (g ∘ f) μa ↔ AEStronglyMeasurable g μb

(hf : MeasureTheory.MeasurePreserving f μa μb)

MeasureTheory.AEStronglyMeasurable (g ∘ f) μa ↔ MeasureTheory.AEStronglyMeasurable g μb


@[simp]
theorem NormedAddGroupHom.completion_toCompl (f : NormedAddGroupHom G H) :
    f.completion.comp toCompl = toCompl.comp f

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
(f : NormedAddGroupHom G H)

f.completion.comp NormedAddCommGroup.toCompl = NormedAddCommGroup.toCompl.comp f


@[simp]
theorem coe_toContinuousLinearMap (φ : A →ₐ[𝕜] 𝕜) : ⇑φ.toContinuousLinearMap = φ

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


theorem irrefl {r : α → α → Prop} [IsWellOrder α r] (f : r ≺i r) : False

{α : Type u_1}
{r : α → α → Prop}
[IsWellOrder α r]
(f : r ≺i r)


@[to_additive]
theorem Step.append_left_iff : ∀ L, Step (L ++ L₁) (L ++ L₂) ↔ Step L₁ L₂

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(L : List (α × Bool))

FreeAddGroup.Red.Step (L ++ L₁) (L ++ L₂) ↔ FreeAddGroup.Red.Step L₁ L₂


/-- If the angle between two vectors is π, the norm of their difference equals
the sum of their norms. -/
theorem norm_sub_eq_add_norm_of_angle_eq_pi {x y : V} (h : angle x y = π) :
    ‖x - y‖ = ‖x‖ + ‖y‖

(h : InnerProductGeometry.angle x y = π)


theorem isCoprime_mul_unit_left_left : IsCoprime (x * y) z ↔ IsCoprime y z

{R : Type u_1}
[CommSemiring R]
{x : R}
(hu : IsUnit x)
(y z : R)


/-- The Stone-Weierstrass approximation theorem, `RCLike` version, that a star subalgebra `A` of
`C(X, 𝕜)`, where `X` is a compact topological space and `RCLike 𝕜`, is dense if it separates
points. -/
theorem ContinuousMap.starSubalgebra_topologicalClosure_eq_top_of_separatesPoints
    (A : StarSubalgebra 𝕜 C(X, 𝕜)) (hA : A.SeparatesPoints) : A.topologicalClosure = ⊤

{𝕜 : Type u_1}
{X : Type u_2}
[RCLike 𝕜]
[TopologicalSpace X]
[CompactSpace X]
(A : StarSubalgebra 𝕜 C(X, 𝕜))
(hA : A.SeparatesPoints)


theorem ker_eq_bot : f.ker = ⊥ ↔ Function.Injective f

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


theorem neg_iff_neg_of_mul_pos [PosMulMono α] [MulPosMono α] (hab : 0 < a * b) : a < 0 ↔ b < 0

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[LinearOrder α]
[PosMulMono α]
[MulPosMono α]
(hab : 0 < a * b)


theorem AECover.lintegral_eq_of_tendsto [l.NeBot] [l.IsCountablyGenerated] {φ : ι → Set α}
    (hφ : AECover μ l φ) {f : α → ℝ≥0∞} (I : ℝ≥0∞) (hfm : AEMeasurable f μ)
    (htendsto : Tendsto (fun i => ∫⁻ x in φ i, f x ∂μ) l (𝓝 I)) : ∫⁻ x, f x ∂μ = I

{f : α → ℝ≥0∞}

(htendsto : Filter.Tendsto (fun i => ∫⁻ (x : α) in φ i, f x ∂μ) l (𝓝 I))


theorem aeStronglyMeasurable'_condexpL2 (hm : m ≤ m0) (f : α →₂[μ] E) :
    AEStronglyMeasurable' (β := E) m (condexpL2 E 𝕜 hm 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.AEStronglyMeasurable' m (↑↑↑((MeasureTheory.condexpL2 E 𝕜 hm) f)) μ


@[to_additive]
theorem smul_ae_eq_of_ae_eq {G α : Type*} [Group G] [MulAction G α] [MeasurableSpace α]
    {s t : Set α} {μ : Measure α} (g : G)
    (h_qmp : QuasiMeasurePreserving (g⁻¹ • · : α → α) μ μ)
    (h_ae_eq : s =ᵐ[μ] t) : (g • s : Set α) =ᵐ[μ] (g • t : Set α)

(h_qmp : MeasureTheory.Measure.QuasiMeasurePreserving (fun x => g⁻¹ • x) μ μ)


@[simp]
theorem GammaIntegral_one : GammaIntegral 1 = 1


@[simp]
theorem basisFun_map :
    (basisFun p 𝕜 ι).map (WithLp.linearEquiv p 𝕜 (ι → 𝕜)) = Pi.basisFun 𝕜 ι

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

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


@[simp]
theorem colimit.pre_pre [h : HasColimit (D ⋙ E ⋙ F)] :
    haveI : HasColimit ((D ⋙ E) ⋙ F) := h
    colimit.pre (E ⋙ F) D ≫ colimit.pre F E = colimit.pre F (D ⋙ E)

[CategoryTheory.Limits.HasColimit (E ⋙ F)]

[h : CategoryTheory.Limits.HasColimit (D ⋙ E ⋙ F)]

CategoryTheory.Limits.colimit.pre (E ⋙ F) D ≫ CategoryTheory.Limits.colimit.pre F E =
  CategoryTheory.Limits.colimit.pre F (D ⋙ E)


lemma Real.summable_one_div_nat_add_rpow (a : ℝ) (s : ℝ) :
    Summable (fun n : ℕ ↦ 1 / |n + a| ^ s) ↔ 1 < s

(Summable fun n => 1 / |↑n + a| ^ s) ↔ 1 < s


theorem aeval_monomial (g : σ → S₁) (d : σ →₀ ℕ) (r : R) :
    aeval g (monomial d r) = algebraMap _ _ r * d.prod fun i k => g i ^ k

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(g : σ → S₁)
(d : σ →₀ ℕ)
(r : R)

(MvPolynomial.aeval g) ((MvPolynomial.monomial d) r) = (algebraMap R S₁) r * d.prod fun i k => g i ^ k


theorem comp_assoc {α β γ δ : TypeVec n} (h : γ ⟹ δ) (g : β ⟹ γ) (f : α ⟹ β) :
    (h ⊚ g) ⊚ f = h ⊚ g ⊚ f

{n : ℕ}
{α : TypeVec.{u_1} n}
{β : TypeVec.{u_2} n}
{γ : TypeVec.{u_3} n}
{δ : TypeVec.{u_4} n}
(h : γ.Arrow δ)
(g : β.Arrow γ)
(f : α.Arrow β)

TypeVec.comp (TypeVec.comp h g) f = TypeVec.comp h (TypeVec.comp g f)


theorem UniformInducing.uniformContinuousOn_iff {f : α → β} {g : β → γ} {S : Set α}
    (hg : UniformInducing g) :
    UniformContinuousOn f S ↔ UniformContinuousOn (g ∘ f) S

{α : Type u}
{β : Type v}
{γ : Type w}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{f : α → β}
{g : β → γ}
{S : Set α}
(hg : UniformInducing g)


@[simp]
theorem taylor_one : taylor r (1 : R[X]) = C 1

(Polynomial.taylor r) 1 = Polynomial.C 1


theorem IsMaxFilter.filter_mono (h : IsMaxFilter f l a) (hl : l' ≤ l) : IsMaxFilter f l' a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{l : Filter α}
{a : α}
{l' : Filter α}
(h : IsMaxFilter f l a)
(hl : l' ≤ l)


@[simp]
theorem ofDual_sSup (s : Set αᵒᵈ) : ofDual (sSup s) = sInf (toDual ⁻¹' s)

{α : Type u_1}
[CompleteLattice α]
(s : Set αᵒᵈ)

OrderDual.ofDual (sSup s) = sInf (⇑OrderDual.toDual ⁻¹' s)


@[to_additive]
theorem eq_trivial_iff {s : Set G} (hs : IsSubgroup s) : s = trivial G ↔ ∀ x ∈ s, x = (1 : G)

{G : Type u_1}
[Group G]
{s : Set G}
(hs : IsSubgroup s)

s = IsSubgroup.trivial G ↔ ∀ x ∈ s, x = 1


/-- Definition of a (Pre)Galois category. Lenstra, Def 3.1, (G1)-(G3) -/
class PreGaloisCategory (C : Type u₁) [Category.{u₂, u₁} C] : Prop where
  /-- `C` has a terminal object (G1). -/
  hasTerminal : HasTerminal C := by infer_instance
  /-- `C` has pullbacks (G1). -/
  hasPullbacks : HasPullbacks C := by infer_instance
  /-- `C` has finite coproducts (G2). -/
  hasFiniteCoproducts : HasFiniteCoproducts C := by infer_instance
  /-- `C` has quotients by finite groups (G2). -/
  hasQuotientsByFiniteGroups (G : Type u₂) [Group G] [Finite G] :
    HasColimitsOfShape (SingleObj G) C := by infer_instance
  /-- Every monomorphism in `C` induces an isomorphism on a direct summand (G3). -/
  monoInducesIsoOnDirectSummand {X Y : C} (i : X ⟶ Y) [Mono i] : ∃ (Z : C) (u : Z ⟶ Y),
    Nonempty (IsColimit (BinaryCofan.mk i u))

[self : CategoryTheory.PreGaloisCategory C]


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the top side and `g` on the bottom side. -/
@[simps!]
def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C

(f : CategoryTheory.Arrow (CategoryTheory.Arrow C))

(CategoryTheory.Square.fromArrowArrowFunctor'.obj f).f₁₃ = f.hom.left


theorem erase_WF [BEq α] [Hashable α] {m : Imp α β} {k}
    (h : m.buckets.WF) : (erase m k).buckets.WF

{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
{m : Batteries.HashMap.Imp α β}
{k : α}
(h : m.buckets.WF)


@[to_additive]
theorem div_apply [Div β] (f g : α →ₛ β) (x : α) : (f / g) x = f x / g x

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Div β]
(f g : MeasureTheory.SimpleFunc α β)
(x : α)


/-- `SameRay` is transitive unless the vector in the middle is zero and both other vectors are
nonzero. -/
theorem trans (hxy : SameRay R x y) (hyz : SameRay R y z) (hy : y = 0 → x = 0 ∨ z = 0) :
    SameRay R x z

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x y z : M}
(hxy : SameRay R x y)
(hyz : SameRay R y z)
(hy : y = 0 → x = 0 ∨ z = 0)


protected theorem mul_const (hm : IsPeriodicPt f m x) (n : ℕ) : IsPeriodicPt f (m * n) x

{α : Type u_1}
{f : α → α}
{x : α}
{m : ℕ}
(hm : Function.IsPeriodicPt f m x)
(n : ℕ)


theorem toComplex_div_im (x y : ℤ[i]) : ((x / y : ℤ[i]) : ℂ).im = round (x / y : ℂ).im

(GaussianInt.toComplex (x / y)).im = ↑(round (GaussianInt.toComplex x / GaussianInt.toComplex y).im)


@[to_additive]
theorem inducing_embedProduct : Inducing (embedProduct M)

{M : Type u_1}
[TopologicalSpace M]
[AddMonoid M]


theorem of_injective : Function.Injective (of : α → FreeRing α)


@[simp]
theorem zeroLocus_bot : zeroLocus (⊥ : Ideal (MvPolynomial σ k)) = ⊤


lemma pullbackShiftFunctorAdd'_inv_app :
    (shiftFunctorAdd' _ a₁ a₂ a₃ h).inv.app X =
      (shiftFunctor (PullbackShift C φ) a₂).map ((pullbackShiftIso C φ a₁ b₁ h₁).hom.app X) ≫
        (pullbackShiftIso C φ a₂ b₂ h₂).hom.app _ ≫
        (shiftFunctorAdd' C b₁ b₂ b₃ (by rw [h₁, h₂, h₃, ← h, φ.map_add])).inv.app X ≫
        (pullbackShiftIso C φ a₃ b₃ h₃).inv.app X

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{A : Type u_2}
{B : Type u_3}
[AddMonoid A]
[AddMonoid B]
(φ : A →+ B)
[CategoryTheory.HasShift C B]
(X : CategoryTheory.PullbackShift C φ)
(a₁ a₂ a₃ : A)
(h : a₁ + a₂ = a₃)
(b₁ b₂ b₃ : B)
(h₁ : b₁ = φ a₁)
(h₂ : b₂ = φ a₂)
(h₃ : b₃ = φ a₃)

(CategoryTheory.shiftFunctorAdd' (CategoryTheory.PullbackShift C φ) a₁ a₂ a₃ h).inv.app X =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctor (CategoryTheory.PullbackShift C φ) a₂).map
      ((CategoryTheory.pullbackShiftIso C φ a₁ b₁ h₁).hom.app X))
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.pullbackShiftIso C φ a₂ b₂ h₂).hom.app ((CategoryTheory.shiftFunctor C b₁).obj X))
      (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorAdd' C b₁ b₂ b₃ ⋯).inv.app X)
        ((CategoryTheory.pullbackShiftIso C φ a₃ b₃ h₃).inv.app X)))


@[to_additive]
theorem period_dvd_orderOf (m : M) (a : α) : period m a ∣ orderOf m

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


protected theorem subsingleton [IsTrichotomous α r] (h : IsAntichain r s) : s.Subsingleton

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsTrichotomous α r]
(h : IsAntichain r s)


/-- The universal enveloping algebra of the free Lie algebra is just the free unital associative
algebra. -/
@[simps!]
def universalEnvelopingEquivFreeAlgebra :
    UniversalEnvelopingAlgebra R (FreeLieAlgebra R X) ≃ₐ[R] FreeAlgebra R X

(R : Type u)
(X : Type v)
[CommRing R]
(a : FreeAlgebra R X)

(FreeLieAlgebra.universalEnvelopingEquivFreeAlgebra R X).symm a =
  ((FreeAlgebra.lift R) (⇑(UniversalEnvelopingAlgebra.ι R) ∘ FreeLieAlgebra.of R)) a


@[simp, norm_cast]
theorem coe_iInf {ι : Sort*} {S : ι → NonUnitalSubalgebra R A} :
    (↑(⨅ i, S i) : Set A) = ⋂ i, S i

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{ι : Sort u_2}
{S : ι → NonUnitalSubalgebra R A}


@[reassoc]
lemma map₂_rightUnitor_hom {a b : B} (f : a ⟶ b) :
    (ρ_ (F.map f)).hom = F.map f ◁ F.mapId b ≫ F.mapComp f (𝟙 b) ≫ F.map₂ (ρ_ f).hom

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.LaxFunctor B C)
{a b : B}
(f : a ⟶ b)

(CategoryTheory.Bicategory.rightUnitor (F.map f)).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (F.map f) (F.mapId b))
    (CategoryTheory.CategoryStruct.comp (F.mapComp f (CategoryTheory.CategoryStruct.id b))
      (F.map₂ (CategoryTheory.Bicategory.rightUnitor f).hom))


@[simp]
theorem image₂_insert_right [DecidableEq β] :
    image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
{b : β}
[DecidableEq β]

Finset.image₂ f s (insert b t) = Finset.image (fun a => f a b) s ∪ Finset.image₂ f s t


@[simp]
theorem edist_equiv_symm_snd (y₁ y₂ : β) :
    edist ((WithLp.equiv p (α × β)).symm (0, y₁)) ((WithLp.equiv p (α × β)).symm (0, y₂)) =
      edist y₁ y₂

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


/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C) ≃ (A →⋆ₙₐ[R] B × C)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R C]
[Star C]
(f : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C))

NonUnitalStarAlgHom.prodEquiv f = f.1.prod f.2


protected theorem cond_true  {α : Type u} {a b : α} : cond true  a b = a


theorem tendsto_atBot_add_left_of_ge' (C : β) (hf : ∀ᶠ x in l, f x ≤ C) (hg : Tendsto g l atBot) :
    Tendsto (fun x => f x + g x) l atBot

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

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


/-- If `Irreducible (cyclotomic (2 ^ (k + 1)) K)` (in particular for `K = ℚ`), then the norm of
`ζ ^ (2 ^ k) - 1` is `(-2) ^ (2 ^ k)`. -/
-- Porting note: writing `(2 : ℕ+)` was not needed (similarly everywhere).
theorem norm_pow_sub_one_two {k : ℕ} (hζ : IsPrimitiveRoot ζ (2 ^ (k + 1)))
    [IsCyclotomicExtension {(2 : ℕ+) ^ (k + 1)} K L]
    (hirr : Irreducible (cyclotomic (2 ^ (k + 1)) K)) :
    norm K (ζ ^ 2 ^ k - 1) = (-2 : K) ^ 2 ^ k

[IsCyclotomicExtension {2 ^ (k + 1)} K L]

(hirr : Irreducible (Polynomial.cyclotomic (2 ^ (k + 1)) K))


@[reassoc (attr := simp)]
theorem homotopyEquiv_hom_π {X : C} (P Q : ProjectiveResolution X) :
    (homotopyEquiv P Q).hom ≫ Q.π = P.π

(P Q : CategoryTheory.ProjectiveResolution X)

CategoryTheory.CategoryStruct.comp (P.homotopyEquiv Q).hom Q.π = P.π


@[simp] lemma lowerBounds_smul_of_neg (ha : a < 0) : lowerBounds (a • s) = a • upperBounds s

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
{s : Set β}
{a : α}
(ha : a < 0)


theorem mellin_comp_rpow (f : ℝ → E) (s : ℂ) (a : ℝ) :
    mellin (fun t => f (t ^ a)) s = |a|⁻¹ • mellin f (s / a)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : ℝ → E)
(s : ℂ)
(a : ℝ)

mellin (fun t => f (t ^ a)) s = |a|⁻¹ • mellin f (s / ↑a)


/-- The star algebra equivalence between the linear endomorphisms of finite-dimensional inner
product space and square matrices induced by the choice of an orthonormal basis. -/
@[simps]
def LinearMap.toMatrixOrthonormal : (E →ₗ[𝕜] E) ≃⋆ₐ[𝕜] Matrix n n 𝕜

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{n : Type u_6}
[Fintype n]
[DecidableEq n]
[FiniteDimensional 𝕜 E]
(v₁ : OrthonormalBasis n 𝕜 E)

∀ (a : Matrix n n 𝕜), (LinearMap.toMatrixOrthonormal v₁).symm a = (LinearMap.toMatrix v₁.toBasis v₁.toBasis).invFun a


theorem coordinate_eval_0 : (coordinate 0).eval (.ofList (a0 :: t)) = a0

(Lean.Omega.LinearCombo.coordinate 0).eval (Lean.Omega.Coeffs.ofList (a0 :: t)) = a0


@[to_additive]
theorem Step.diamond_aux :
    ∀ {L₁ L₂ L₃ L₄ : List (α × Bool)} {x1 b1 x2 b2},
      L₁ ++ (x1, b1) :: (x1, !b1) :: L₂ = L₃ ++ (x2, b2) :: (x2, !b2) :: L₄ →
        L₁ ++ L₂ = L₃ ++ L₄ ∨ ∃ L₅, Red.Step (L₁ ++ L₂) L₅ ∧ Red.Step (L₃ ++ L₄) L₅

{α : Type u}
{L₁ L₂ L₃ L₄ : List (α × Bool)}
{x1 : α}
{b1 : Bool}
{x2 : α}
{b2 : Bool}

L₁ ++ (x1, b1) :: (x1, !b1) :: L₂ = L₃ ++ (x2, b2) :: (x2, !b2) :: L₄ →
  L₁ ++ L₂ = L₃ ++ L₄ ∨ ∃ L₅, FreeAddGroup.Red.Step (L₁ ++ L₂) L₅ ∧ FreeAddGroup.Red.Step (L₃ ++ L₄) L₅


@[simp]
theorem refl_mul (e : E ≃ₗᵢ[R] E) : refl _ _ * e = e

{R : Type u_1}
{E : Type u_5}
[Semiring R]
[SeminormedAddCommGroup E]
[Module R E]
(e : E ≃ₗᵢ[R] E)


@[simp]
theorem comap_snd : q.comap (snd R M M₂) = prod ⊤ q

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(q : Submodule R M₂)

Submodule.comap (LinearMap.snd R M M₂) q = ⊤.prod q


/-- The length-1 path between a pair of adjacent vertices. -/
@[simps]
def singleton {u v : V} (h : G.Adj u v) : G.Path u v

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(h : G.Adj u v)

↑(SimpleGraph.Path.singleton h) = SimpleGraph.Walk.cons h SimpleGraph.Walk.nil


theorem sub_eq_add_neg (xs ys : Coeffs) : xs - ys = xs + -ys


/-- If the sign of the angle between two vectors is positive, the first vector is nonzero. -/
theorem left_ne_zero_of_oangle_sign_eq_one {x y : V} (h : (o.oangle x y).sign = 1) : x ≠ 0

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


@[simp]
theorem splits_zero : Splits i (0 : K[X])

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)


@[simp]
lemma cyclesMap_neg : cyclesMap (-φ) = -cyclesMap φ

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

CategoryTheory.ShortComplex.cyclesMap (-φ) = -CategoryTheory.ShortComplex.cyclesMap φ


theorem fib_add_two_sub_fib_add_one {n : ℕ} : fib (n + 2) - fib (n + 1) = fib n

Nat.fib (n + 2) - Nat.fib (n + 1) = Nat.fib n


/--
For any natural `n`, the Schnirelmann density multiplied by `n` is bounded by `|A ∩ {1, ..., n}|`.
Note this property fails for the natural density.
-/
lemma schnirelmannDensity_mul_le_card_filter {n : ℕ} :
    schnirelmannDensity A * n ≤ ((Ioc 0 n).filter (· ∈ A)).card

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]
{n : ℕ}

schnirelmannDensity A * ↑n ≤ ↑(Finset.filter (fun x => x ∈ A) (Finset.Ioc 0 n)).card


theorem HasFDerivAt.ccosh (hf : HasFDerivAt f f' x) :
    HasFDerivAt (fun x => Complex.cosh (f x)) (Complex.sinh (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
(hf : HasFDerivAt f f' x)


@[simp]
theorem bddAbove_preimage (e : α ≃o β) {s : Set β} : BddAbove (e ⁻¹' s) ↔ BddAbove s

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


@[simp]
theorem commute_rmul_rmul_sq (a : A) : Commute (R a) (R (a * a))

{A : Type u_1}
[NonUnitalNonAssocRing A]
[IsJordan A]
(a : A)


@[simp]
theorem fst_one [One R] [Zero A] : (1 : Unitization R A).fst = 1

{R : Type u_1}
{A : Type u_2}
[One R]
[Zero A]


theorem pow_apply_eq_of_apply_apply_eq_self {x : α} (hffx : f (f x) = x) :
    ∀ n : ℕ, (f ^ n) x = x ∨ (f ^ n) x = f x

{α : Type u_1}
{f : Equiv.Perm α}
{x : α}
(hffx : f (f x) = x)
(n : ℕ)


@[elab_without_expected_type]
theorem trichotomous_of [IsTrichotomous α r] : ∀ a b : α, a ≺ b ∨ a = b ∨ b ≺ a

{α : Sort u}
(r : α → α → Prop)
[IsTrichotomous α r]
(a b : α)


@[reassoc (attr := simp, nolint simpNF)]
theorem obj_μ_inv_app (m₁ m₂ m₃ : M) (X : C) :
    (F.obj m₃).map ((F.μIso m₁ m₂).inv.app X) =
      (F.μ (m₁ ⊗ m₂) m₃).app X ≫
        (F.map (α_ m₁ m₂ m₃).hom).app X ≫
          (F.μIso m₁ (m₂ ⊗ m₃)).inv.app X ≫ (F.μIso m₂ m₃).inv.app ((F.obj m₁).obj X)

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

(F.obj m₃).map ((F.μIso m₁ m₂).inv.app X) =
  CategoryTheory.CategoryStruct.comp ((F.μ (CategoryTheory.MonoidalCategory.tensorObj m₁ m₂) m₃).app X)
    (CategoryTheory.CategoryStruct.comp ((F.map (CategoryTheory.MonoidalCategory.associator m₁ m₂ m₃).hom).app X)
      (CategoryTheory.CategoryStruct.comp ((F.μIso m₁ (CategoryTheory.MonoidalCategory.tensorObj m₂ m₃)).inv.app X)
        ((F.μIso m₂ m₃).inv.app ((F.obj m₁).obj X))))


@[simp]
theorem sUnion_image (f : α → Set β) (s : Set α) : ⋃₀(f '' s) = ⋃ x ∈ s, f x

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


@[simp]
theorem smul_mem_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) (S : Subgroup G) (x : G) :
    a • x ∈ a • S ↔ x ∈ S

{α : Type u_1}
{G : Type u_2}
[Group G]
[GroupWithZero α]
[MulDistribMulAction α G]
{a : α}
(ha : a ≠ 0)
(S : Subgroup G)
(x : G)


@[to_additive (attr := simp)]
theorem elim_one_one [One γ] : Sum.elim (1 : α → γ) (1 : β → γ) = 1

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[One γ]


@[simp, norm_cast] lemma imK_nnratCast (q : ℚ≥0) : (q : ℍ[R]).imK = 0

{R : Type u_1}
[LinearOrderedField R]
(q : ℚ≥0)


theorem of_inverse {g : Y → X} (hf : Continuous f) (hg : Continuous g) (h : LeftInverse g f) :
    QuotientMap g

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
{g : Y → X}
(hf : Continuous f)
(hg : Continuous g)
(h : Function.LeftInverse g f)


protected theorem measurableSpace_le_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) : hτ.measurableSpace ≤ m

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(h_countable : (Set.range τ).Countable)


/-- The range of `NonemptyCompacts.toCloseds` is closed in a complete space -/
theorem NonemptyCompacts.isClosed_in_closeds [CompleteSpace α] :
    IsClosed (range <| @NonemptyCompacts.toCloseds α _ _)

{α : Type u}
[EMetricSpace α]
[CompleteSpace α]


@[simp]
theorem diagramIso_app_left (i : D.J × D.J) :
    (D.diagramIso F).app (WalkingMultispan.left i) = Iso.refl _

[H : (i j k : D.J) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan (D.f i j) (D.f i k)) F]

(D.diagramIso F).app (CategoryTheory.Limits.WalkingMultispan.left i) =
  CategoryTheory.Iso.refl ((D.diagram.multispan.comp F).obj (CategoryTheory.Limits.WalkingMultispan.left i))


@[to_additive eq_zero_of_add_nonneg_right]
theorem eq_one_of_one_le_mul_right (ha : a ≤ 1) (hb : b ≤ 1) (hab : 1 ≤ a * b) : b = 1

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


theorem mk_plift_true : #(PLift True) = 1


theorem NNReal.upper_bound {α : Type*} [TopologicalSpace α] (f : α →ᵇ ℝ≥0) (x : α) :
    f x ≤ nndist f 0

{α : Type u_2}
[TopologicalSpace α]
(f : BoundedContinuousFunction α ℝ≥0)
(x : α)


theorem homomorphism (f : α → β) (a : α) : pure f ⊛ pure a = pure (f a)

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

Stream'.pure f ⊛ Stream'.pure a = Stream'.pure (f a)


@[simp] theorem foldlM_cons [Monad m] (f : β → α → m β) (b) (a) (l : List α) :
    (a :: l).foldlM f b = f b a >>= l.foldlM f

{m : Type u_1 → Type u_2}
{β : Type u_1}
{α : Type u_3}
[Monad m]
(f : β → α → m β)
(b : β)
(a : α)
(l : List α)

List.foldlM f b (a :: l) = do
  let init ← f b a
  List.foldlM f init l


@[simp]
theorem primeCounting'_nth_eq (n : ℕ) : π' (nth Prime n) = n

(Nat.nth Nat.Prime n).primeCounting' = n


theorem setIntegral_abs_condexp_le {s : Set α} (hs : MeasurableSet[m] s) (f : α → ℝ) :
    ∫ x in s, |(μ[f|m]) x| ∂μ ≤ ∫ x in s, |f x| ∂μ

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(f : α → ℝ)

∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ


/-- If the `LSeries` of `f` is summable at `s`, then `f n` is bounded in absolute value
by a constant times `n^(re s)`. -/
lemma LSeriesSummable.le_const_mul_rpow {f : ℕ → ℂ} {s : ℂ} (h : LSeriesSummable f s) :
    ∃ C, ∀ n ≠ 0, ‖f n‖ ≤ C * n ^ s.re

∃ C, ∀ (n : ℕ), n ≠ 0 → ‖f n‖ ≤ C * ↑n ^ s.re


/-- `sigmaPreimageEquiv f` for `f : α → β` is the natural equivalence between
the type of all preimages of points under `f` and the total space `α`. -/
@[simps!]
def sigmaPreimageEquiv {α β} (f : α → β) : (Σb, f ⁻¹' {b}) ≃ α

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

((Equiv.sigmaPreimageEquiv f).symm x).fst = f x


theorem apply_le_norm (f : C(α, ℝ)) (x : α) : f x ≤ ‖f‖

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


/-- The Legendre symbol `legendreSym p a` with an integer `a` and a prime number `p`
is the same as the Jacobi symbol `J(a | p)`. -/
theorem legendreSym.to_jacobiSym (p : ℕ) [fp : Fact p.Prime] (a : ℤ) :
    legendreSym p a = J(a | p)

(p : ℕ)
[fp : Fact (Nat.Prime p)]
(a : ℤ)


@[simp]
lemma φ_three : W.φ 3 = C X * C W.Ψ₃ ^ 2 - C W.preΨ₄ * W.ψ₂ ^ 2

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

W.φ 3 = Polynomial.C Polynomial.X * Polynomial.C W.Ψ₃ ^ 2 - Polynomial.C W.preΨ₄ * W.ψ₂ ^ 2


lemma coeSubgraph_adj {G' : G.Subgraph} (G'' : G'.coe.Subgraph) (v w : V) :
    (G'.coeSubgraph G'').Adj v w ↔
      ∃ (hv : v ∈ G'.verts) (hw : w ∈ G'.verts), G''.Adj ⟨v, hv⟩ ⟨w, hw⟩

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

(SimpleGraph.Subgraph.coeSubgraph G'').Adj v w ↔ ∃ (hv : v ∈ G'.verts) (hw : w ∈ G'.verts), G''.Adj ⟨v, hv⟩ ⟨w, hw⟩


theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
{s : Set X}
{d : ℝ≥0}
(h : dimH s < ↑d)


theorem eq_mk_support (f : Π₀ i, β i) : f = mk f.support fun i => f i

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


@[simp] theorem gt_iff_lt [LT α] {x y : α} : x > y ↔ y < x


/-- The tagged partition made of boxes of `π` that satisfy predicate `p`. -/
@[simps! (config := .asFn)]
def filter (p : Box ι → Prop) : TaggedPrepartition I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
(p : BoxIntegral.Box ι → Prop)


theorem normalize.reduced' {num : Int} {den g : Nat} (den_nz : den ≠ 0)
    (e : g = num.natAbs.gcd den) : (num / g).natAbs.Coprime (den / g)


lemma even_or_odd [NoZeroDivisors S] : ψ.Even ∨ ψ.Odd

{S : Type}
[CommRing S]
{m : ℕ}
(ψ : DirichletCharacter S m)
[NoZeroDivisors S]


theorem multiplicity_pow_self {p n : ℕ} (hp : p.Prime) : multiplicity p (p ^ n) = n


/-- `μ` has finite spanning sets in `C` if there is a countable sequence of sets in `C` that have
  finite measures. This structure is a type, which is useful if we want to record extra properties
  about the sets, such as that they are monotone.
  `SigmaFinite` is defined in terms of this: `μ` is σ-finite if there exists a sequence of
  finite spanning sets in the collection of all measurable sets. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure FiniteSpanningSetsIn {m0 : MeasurableSpace α} (μ : Measure α) (C : Set (Set α)) where
  protected set : ℕ → Set α
  protected set_mem : ∀ i, set i ∈ C
  protected finite : ∀ i, μ (set i) < ∞
  protected spanning : ⋃ i, set i = univ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{C : Set (Set α)}
(self : μ.FiniteSpanningSetsIn C)
(i : ℕ)


theorem add_isLimit (a) {b} : IsLimit b → IsLimit (a + b)


@[simp] theorem data_takeWhile (p : Char → Bool) (s : String) :
    (s.takeWhile p).1 = s.1.takeWhile p

(s.takeWhile p).data = List.takeWhile p s.data


theorem IsInternal.addSubmonoid_independent {M : Type*} [AddCommMonoid M] {A : ι → AddSubmonoid M}
    (h : IsInternal A) : CompleteLattice.Independent A

{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_2}
[AddCommMonoid M]
{A : ι → AddSubmonoid M}
(h : DirectSum.IsInternal A)


theorem bound_of_isBigO_nat_atTop {f : ℕ → E} {g'' : ℕ → E''} (h : f =O[atTop] g'') :
    ∃ C > 0, ∀ ⦃x⦄, g'' x ≠ 0 → ‖f x‖ ≤ C * ‖g'' x‖

{E : Type u_3}
{E'' : Type u_9}
[Norm E]
[NormedAddCommGroup E'']
{f : ℕ → E}
{g'' : ℕ → E''}
(h : f =O[Filter.atTop] g'')

∃ C > 0, ∀ ⦃x : ℕ⦄, g'' x ≠ 0 → ‖f x‖ ≤ C * ‖g'' x‖


theorem dualCoannihilator_dualAnnihilator_dualCoannihilator (U : Submodule R (Module.Dual R M)) :
    U.dualCoannihilator.dualAnnihilator.dualCoannihilator = U.dualCoannihilator

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


@[to_additive]
theorem gc_map_comap (f : M →ₙ* N) : GaloisConnection (map f) (comap f)

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

GaloisConnection (Subsemigroup.map f) (Subsemigroup.comap f)


@[to_additive]
theorem lift_of_mul (x y) : lift f (of x * y) = f x * lift f y

{α : Type u}
{β : Type v}
[AddSemigroup β]
(f : α → β)
(x : α)
(y : FreeAddSemigroup α)

(FreeAddSemigroup.lift f) (FreeAddSemigroup.of x + y) = f x + (FreeAddSemigroup.lift f) y


@[simp]
theorem pureTransformation_apply {α} (x : id α) : PureTransformation F x = pure x

(F : Type u → Type u)
[Applicative F]
[LawfulApplicative F]
{α : Type u}
(x : id α)

(fun {α} => (Traversable.PureTransformation F).app α) x = pure x


@[simp]
theorem single_eq_zero {a : G} {b : k} : single a b = 0 ↔ b = 0

{k : Type u₁}
{G : Type u₂}
[Semiring k]
{a : G}
{b : k}


@[to_additive]
theorem prod_divisorsAntidiagonal' {M : Type*} [CommMonoid M] (f : ℕ → ℕ → M) {n : ℕ} :
    ∏ i ∈ n.divisorsAntidiagonal, f i.1 i.2 = ∏ i ∈ n.divisors, f (n / i) i

{M : Type u_1}
[CommMonoid M]
(f : ℕ → ℕ → M)
{n : ℕ}


@[to_additive (attr := simp)]
theorem dist_self_mul_left (a b : E) : dist (a * b) a = ‖b‖

{E : Type u_3}
[SeminormedCommGroup E]
(a b : E)


theorem IsRoot.of_map {R} [CommRing R] {f : R →+* S} {x : R} {p : R[X]} (h : IsRoot (p.map f) (f x))
    (hf : Function.Injective f) : IsRoot p x

{S : Type v}
[CommSemiring S]
{R : Type u_1}
[CommRing R]
{f : R →+* S}
{x : R}
{p : R[X]}
(h : (Polynomial.map f p).IsRoot (f x))
(hf : Function.Injective ⇑f)


@[gcongr]
theorem inter_subset_inter {s₁ s₂ t₁ t₂ : Set α} (h₁ : s₁ ⊆ t₁) (h₂ : s₂ ⊆ t₂) :
    s₁ ∩ s₂ ⊆ t₁ ∩ t₂

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

s₁ ∩ s₂ ⊆ t₁ ∩ t₂


@[simp] lemma powerset_eq_univ : s.powerset = univ ↔ s = univ

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

s.powerset = Finset.univ ↔ s = Finset.univ


theorem vars_map : (map f p).vars ⊆ p.vars

{R : Type u}
{S : Type v}
{σ : Type u_1}
[CommSemiring R]
(p : MvPolynomial σ R)
[CommSemiring S]
(f : R →+* S)


@[to_additive (attr := simp, norm_cast)]
theorem coe_eq_one {x : S'} : (↑x : M₁) = 1 ↔ x = 1

{A : Type u_4}
{M₁ : Type u_5}
[SetLike A M₁]
[Zero M₁]
[hA : ZeroMemClass A M₁]
{S' : A}
{x : ↥S'}


/-- The type of collections of lines such that
- each line is only one color except possibly at its endpoint
- the lines all have the same endpoint
- the colors of the lines are distinct.
Used in the proof `exists_mono_in_high_dimension`. -/
structure ColorFocused {α ι κ : Type*} (C : (ι → Option α) → κ) where
  /-- The underlying multiset of almost monochromatic lines of a color-focused collection. -/
  lines : Multiset (AlmostMono C)
  /-- The common endpoint of the lines in the color-focused collection. -/
  focus : ι → Option α
  /-- The proposition that all lines in a color-focused collection have the same endpoint. -/
  is_focused : ∀ p ∈ lines, p.line none = focus
  /-- The proposition that all lines in a color-focused collection of lines have distinct colors. -/
  distinct_colors : (lines.map AlmostMono.color).Nodup

(self : Combinatorics.Line.ColorFocused C)

p ∈ self.lines → (fun x i => (p.line.idxFun i).getD x) none = self.focus


@[simp]
theorem beckCofork_π : (beckCofork X).π = X.a

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T : CategoryTheory.Monad C}
(X : T.Algebra)

(CategoryTheory.Monad.beckCofork X).π = X.a


@[simp]
theorem Dart.edge_symm (d : G.Dart) : d.symm.edge = d.edge

{V : Type u_1}
{G : SimpleGraph V}
(d : G.Dart)


theorem nodup_dedup : ∀ l : List α, Nodup (dedup l)

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


@[simp]
theorem filter_cons_of_neg {a : α} (s) : ¬p a → filter p (a ::ₘ s) = filter p s

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{a : α}
(s : Multiset α)

¬p a → Multiset.filter p (a ::ₘ s) = Multiset.filter p s


theorem Raised.right {l x₁ x₂ r₁ r₂} (H : Raised (size r₁) (size r₂)) :
    Raised (size (@node' α l x₁ r₁)) (size (@node' α l x₂ r₂))

{α : Type u_1}
{l : Ordnode α}
{x₁ x₂ : α}
{r₁ r₂ : Ordnode α}
(H : Ordnode.Raised r₁.size r₂.size)

Ordnode.Raised (l.node' x₁ r₁).size (l.node' x₂ r₂).size


@[simp]
theorem tensorLeftHomEquiv_whiskerLeft_comp_evaluation {Y Z : C} [HasLeftDual Z] (f : Y ⟶ ᘁZ) :
    (tensorLeftHomEquiv _ _ _ _) (Z ◁ f ≫ ε_ _ _) = f ≫ (ρ_ _).inv

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

(CategoryTheory.tensorLeftHomEquiv Y (ᘁZ) Z (𝟙_ C)) (Z ◁ f ≫ ε_ (ᘁZ) Z) = f ≫ (ρ_ ᘁZ).inv


@[to_additive (attr := simp)]
theorem orbitEquivQuotientStabilizer_symm_apply (b : β) (a : α) :
    ((orbitEquivQuotientStabilizer α b).symm a : β) = a • b

(α : Type u)
{β : Type v}
[Group α]
[MulAction α β]
(b : β)
(a : α)

↑((MulAction.orbitEquivQuotientStabilizer α b).symm ↑a) = a • b


lemma map_comp (f : Hom P P') (g : Hom P' P'') :
    CotangentSpace.map (g.comp f) =
      (CotangentSpace.map g).restrictScalars S ∘ₗ CotangentSpace.map f

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u'}
{S' : Type v'}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
{R'' : Type u''}
{S'' : Type v''}
[CommRing R'']
[CommRing S'']
[Algebra R'' S'']
{P'' : Algebra.Generators R'' S''}
[Algebra R R'']
[Algebra S S'']
[Algebra R S'']
[IsScalarTower R R'' S'']
[IsScalarTower R S S'']
[Algebra R' R'']
[Algebra S' S'']
[Algebra R' S'']
[IsScalarTower R' R'' S'']
[IsScalarTower R' S' S'']
[IsScalarTower S S' S'']
(f : P.Hom P')
(g : P'.Hom P'')

Algebra.Generators.CotangentSpace.map (g.comp f) =
  ↑S (Algebra.Generators.CotangentSpace.map g) ∘ₗ Algebra.Generators.CotangentSpace.map f


theorem filter_not (s : Finset α) : (s.filter fun a => ¬p a) = s \ s.filter p

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
[DecidableEq α]
(s : Finset α)

Finset.filter (fun a => ¬p a) s = s \ Finset.filter p s


theorem map_proj_nhds (x : TotalSpace F E) : map (π F E) (𝓝 x) = 𝓝 x.proj

[TopologicalSpace (Bundle.TotalSpace F E)]

Filter.map Bundle.TotalSpace.proj (𝓝 x) = 𝓝 x.proj


@[simp]
theorem coe_notMemRangeEquiv (k : ℕ) :
    (notMemRangeEquiv k : { n // n ∉ range k } → ℕ) = fun (i : { n // n ∉ range k }) => i - k


theorem inf_le_centerMass {s : Finset ι} {f : ι → α} {w : ι → R} (hw₀ : ∀ i ∈ s, 0 ≤ w i)
    (hw₁ : 0 < ∑ i ∈ s, w i) :
    s.inf' (nonempty_of_ne_empty <| by rintro rfl; simp at hw₁) f ≤ s.centerMass w f

{R : Type u_1}
{ι : Type u_5}
{α : Type u_7}
[LinearOrderedField R]
[LinearOrderedAddCommGroup α]
[Module R α]
[OrderedSMul R α]
{s : Finset ι}
{f : ι → α}
{w : ι → R}
(hw₀ : ∀ i ∈ s, 0 ≤ w i)
(hw₁ : 0 < ∑ i ∈ s, w i)


/-- Turn a primitive root μ into a member of the `rootsOfUnity` subgroup. -/
@[simps!]
def IsPrimitiveRoot.toRootsOfUnity {μ : M} {n : ℕ+} (h : IsPrimitiveRoot μ n) : rootsOfUnity n M

{M : Type u_1}
[CommMonoid M]
{μ : M}
{n : ℕ+}
(h : IsPrimitiveRoot μ ↑n)


/-- If `(p : ι → Prop, s : ι → Set α)` is a basis of a filter `f`, `g` is a monotone function
`Set α → Filter γ`, and for each `i`, `(pg : β i → Prop, sg : β i → Set α)` is a basis
of the filter `g (s i)`, then
`(fun (i : ι) (x : β i) ↦ p i ∧ pg i x, fun (i : ι) (x : β i) ↦ sg i x)` is a basis
of the filter `f.lift g`.

This basis is parametrized by `i : ι` and `x : β i`, so in order to formulate this fact using
`Filter.HasBasis` one has to use `Σ i, β i` as the index type, see `Filter.HasBasis.lift`.
This lemma states the corresponding `mem_iff` statement without using a sigma type. -/
theorem HasBasis.mem_lift_iff {ι} {p : ι → Prop} {s : ι → Set α} {f : Filter α}
    (hf : f.HasBasis p s) {β : ι → Type*} {pg : ∀ i, β i → Prop} {sg : ∀ i, β i → Set γ}
    {g : Set α → Filter γ} (hg : ∀ i, (g <| s i).HasBasis (pg i) (sg i)) (gm : Monotone g)
    {s : Set γ} : s ∈ f.lift g ↔ ∃ i, p i ∧ ∃ x, pg i x ∧ sg i x ⊆ s

(hg : ∀ (i : ι), (g (s i)).HasBasis (pg i) (sg i))

∀ {s : Set γ}, s ∈ f.lift g ↔ ∃ i, p i ∧ ∃ x, pg i x ∧ sg i x ⊆ s


/-- A Type `R` is a `CompatibleRing` if it is a structure for the language of rings and this
structure is the same as the structure already given on `R` by the classes `Add`, `Mul` etc.

It is recommended to use this type class as a hypothesis to any theorem whose statement
requires a type to have be both a `Ring` (or `Field` etc.) and a
`Language.ring.Structure`  -/
/- This class does not extend `Add` etc, because this way it can be used in
combination with a `Ring`, or `Field` instance without having multiple different
`Add` structures on the Type. -/
class CompatibleRing (R : Type*) [Add R] [Mul R] [Neg R] [One R] [Zero R]
    extends Language.ring.Structure R where
  /-- Addition in the `Language.ring.Structure` is the same as the addition given by the
    `Add` instance -/
  funMap_add : ∀ x, funMap addFunc x = x 0 + x 1
  /-- Multiplication in the `Language.ring.Structure` is the same as the multiplication given by the
    `Mul` instance -/
  funMap_mul : ∀ x, funMap mulFunc x = x 0 * x 1
  /-- Negation in the `Language.ring.Structure` is the same as the negation given by the
    `Neg` instance -/
  funMap_neg : ∀ x, funMap negFunc x = -x 0
  /-- The constant `0` in the `Language.ring.Structure` is the same as the constant given by the
    `Zero` instance -/
  funMap_zero : ∀ x, funMap (zeroFunc : Language.ring.Constants) x = 0
  /-- The constant `1` in the `Language.ring.Structure` is the same as the constant given by the
    `One` instance -/
  funMap_one : ∀ x, funMap (oneFunc : Language.ring.Constants) x = 1

[self : FirstOrder.Ring.CompatibleRing R]

FirstOrder.Language.Structure.funMap FirstOrder.Ring.mulFunc x = x 0 * x 1


theorem IsLittleO.prod_left_snd : (fun x => (f' x, g' x)) =o[l] k' → g' =o[l] k'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
{G' : Type u_8}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{f' : α → E'}
{g' : α → F'}
{k' : α → G'}
{l : Filter α}


theorem mem_open_set_iff (h : IsGenericPoint x S) (hU : IsOpen U) : x ∈ U ↔ (S ∩ U).Nonempty

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{S U : Set α}
(h : IsGenericPoint x S)
(hU : IsOpen U)


theorem _root_.Set.Finite.nullMeasurableSet_sUnion {s : Set (Set α)} (hs : s.Finite)
    (h : ∀ t ∈ s, NullMeasurableSet t μ) : NullMeasurableSet (⋃₀ s) μ

(h : ∀ t ∈ s, MeasureTheory.NullMeasurableSet t μ)

MeasureTheory.NullMeasurableSet (⋃₀ s) μ


/-- Two morphisms are equal if there is a fork whose inclusion is epi. -/
theorem eq_of_epi_fork_ι (t : Fork f g) [Epi (Fork.ι t)] : f = g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f g : X ⟶ Y}
(t : CategoryTheory.Limits.Fork f g)
[CategoryTheory.Epi t.ι]


theorem isComplemented_top : IsComplemented (⊤ : α)

{α : Type u_1}
[Lattice α]
[BoundedOrder α]


theorem pointwise_smul_le_iff₀ {a : M} (ha : a ≠ 0) {S T : Subsemiring R} :
    a • S ≤ T ↔ S ≤ a⁻¹ • T

{M : Type u_1}
{R : Type u_2}
[GroupWithZero M]
[Semiring R]
[MulSemiringAction M R]
{a : M}
(ha : a ≠ 0)
{S T : Subsemiring R}

a • S ≤ T ↔ S ≤ a⁻¹ • T


lemma verts_monotone : Monotone (verts : G.Subgraph → Set V)


@[simp]
theorem infty_coeFn_intCast (z : ℤ) : ⇑(z : lp B ∞) = z

{I : Type u_3}
{B : I → Type u_4}
[(i : I) → NormedRing (B i)]
[∀ (i : I), NormOneClass (B i)]
(z : ℤ)


lemma Ioc_inl_inl :
    Ioc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(a₁ a₂ : α)

Finset.Ioc (Sum.inlₗ a₁) (Sum.inlₗ a₂) = Finset.map (Function.Embedding.inl.trans toLex.toEmbedding) (Finset.Ioc a₁ a₂)


@[simp]
theorem top_eq_univ : (⊤ : Set α) = univ


/-- If a function `f` is summable in norm, and along some sequence of finsets exhausting the space
its sum is converging to a limit `a`, then this holds along all finsets, i.e., `f` is summable
with sum `a`. -/
theorem hasSum_of_subseq_of_summable {f : ι → E} (hf : Summable fun a => ‖f a‖) {s : α → Finset ι}
    {p : Filter α} [NeBot p] (hs : Tendsto s p atTop) {a : E}
    (ha : Tendsto (fun b => ∑ i ∈ s b, f i) p (𝓝 a)) : HasSum f a

(ha : Filter.Tendsto (fun b => ∑ i ∈ s b, f i) p (𝓝 a))


theorem image_trans_source : e '' (e.trans e').source = e.target ∩ e'.source

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)

↑e '' (e.trans e').source = e.target ∩ e'.source


theorem vec_iff {m n f} : @Vec m n f ↔ Computable f

{f : Mathlib.Vector ℕ m → Mathlib.Vector ℕ n}


protected theorem congr_arg (f : LocallyConstant X Y) {x y : X} (h : x = y) : f x = f y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(f : LocallyConstant X Y)
{x y : X}
(h : x = y)


/-- Constructs an equivalence between linear orders from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : LinOrd.{u}} (e : α ≃o β) : α ≅ β


/-- The **Banach-Steinhaus** theorem, or **Uniform Boundedness Principle**, for maps from a
barrelled space to any space whose topology is generated by a family of seminorms. Use
`WithSeminorms.equicontinuous_TFAE` and `Seminorm.bound_of_continuous` to get explicit bounds on
the seminorms from equicontinuity. -/
protected theorem banach_steinhaus (H : ∀ k x, BddAbove (range fun i ↦ q k (𝓕 i x))) :
    UniformEquicontinuous ((↑) ∘ 𝓕)

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

(H : ∀ (k : κ) (x : E), BddAbove (Set.range fun i => (q k) ((𝓕 i) x)))

UniformEquicontinuous (DFunLike.coe ∘ 𝓕)


theorem linearIndependent_iff :
    LinearIndependent R v ↔ ∀ l, Finsupp.total ι M R v l = 0 → l = 0

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

LinearIndependent R v ↔ ∀ (l : ι →₀ R), (Finsupp.total ι M R v) l = 0 → l = 0


theorem none_eq_bot : (none : WithBot α) = (⊥ : WithBot α)


/-- If `G.op` is adjoint to `F.op` then `F` is adjoint to `G`. -/
-- Porting note: in mathlib3 we generated all the default `simps` lemmas.
-- However the `simpNF` linter correctly flags some of these as unsuitable simp lemmas.
-- `unit_app` and `counit_app` appear to suffice (tested in mathlib3).
-- See also the porting note on opAdjointOpOfAdjoint
@[simps! unit_app counit_app]
def adjointOfOpAdjointOp (F : C ⥤ D) (G : D ⥤ C) (h : G.op ⊣ F.op) : F ⊣ G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
(G : D ⥤ C)
(h : G.op ⊣ F.op)
(X : C)

(CategoryTheory.Adjunction.adjointOfOpAdjointOp F G h).unit.app X =
  (CategoryTheory.opEquiv (Opposite.op (G.obj (F.obj X))) (Opposite.op X))
    ((h.homEquiv (Opposite.op (F.obj X)) (Opposite.op X)).symm
      ((CategoryTheory.opEquiv (Opposite.op (F.obj X)) (Opposite.op (F.obj X))).symm (𝟙 (F.obj X))))


theorem le_of_lt : ∀ {a b : α}, a < b → a ≤ b


theorem Monic.isUnit_iff (hm : p.Monic) : IsUnit p ↔ p = 1

{R : Type u}
[Semiring R]
{p : R[X]}
(hm : p.Monic)


@[to_additive] lemma monovary_inv : Monovary f⁻¹ g⁻¹ ↔ Monovary f g

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


theorem dom_toSubtype_apply_iff {p : β → Prop} {f : α → β} {a : α} :
    (toSubtype p f a).Dom ↔ p (f a)

{α : Type u_1}
{β : Type u_2}
{p : β → Prop}
{f : α → β}
{a : α}


@[simp, norm_cast]
theorem im_coe (z : 𝔻) : (z : ℂ).im = z.im


@[to_additive (attr := simp)]
lemma inf_one [SemilatticeInf β] [OrderTop β] (f : α → β) : inf 1 f = f 1

{α : Type u_2}
{β : Type u_3}
[Zero α]
[SemilatticeInf β]
[OrderTop β]
(f : α → β)


/-- `sigmaPreimageEquiv f` for `f : α → β` is the natural equivalence between
the type of all preimages of points under `f` and the total space `α`. -/
@[simps!]
def sigmaPreimageEquiv {α β} (f : α → β) : (Σb, f ⁻¹' {b}) ≃ α

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(x : (y : β) × { x // f x = y })


@[to_additive]
theorem smul_finset_sdiff : a • (s \ t) = a • s \ a • t

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


@[simp]
theorem mem_disjUnion {α s t h a} : a ∈ @disjUnion α s t h ↔ a ∈ s ∨ a ∈ t

{α : Type u_4}
{s t : Finset α}
{h : Disjoint s t}
{a : α}


@[simp]
theorem mk_associator_hom : Quot.mk _ (Hom₂.associator f g h) = (α_ f g h).hom

{a b c d : CategoryTheory.FreeBicategory B}

Quot.mk CategoryTheory.FreeBicategory.Rel (CategoryTheory.FreeBicategory.Hom₂.associator f g h) =
  (CategoryTheory.Bicategory.associator f g h).hom


@[to_additive]
theorem exponent_dvd {n : ℕ} : exponent G ∣ n ↔ ∀ g : G, orderOf g ∣ n

Monoid.exponent G ∣ n ↔ ∀ (g : G), orderOf g ∣ n


theorem norm_entry_le_entrywise_sup_norm (A : Matrix m n α) {i : m} {j : n} : ‖A i j‖ ≤ ‖A‖

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
(A : Matrix m n α)
{i : m}
{j : n}

‖A i j‖ ≤ ‖A‖


/-- The permutation of a type is equivalent to the units group of the endomorphisms monoid of this
type. -/
@[simps]
def equivUnitsEnd : Perm α ≃* Units (Function.End α)

∀ (a : α), ↑(Equiv.Perm.equivUnitsEnd e)⁻¹ a = (Equiv.symm e).toFun a


theorem Tendsto.basis_both (H : Tendsto f la lb) (hla : la.HasBasis pa sa)
    (hlb : lb.HasBasis pb sb) :
    ∀ ib, pb ib → ∃ ia, pa ia ∧ MapsTo f (sa ia) (sb ib)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{ι' : Sort u_5}
{la : Filter α}
{pa : ι → Prop}
{sa : ι → Set α}
{lb : Filter β}
{pb : ι' → Prop}
{sb : ι' → Set β}
{f : α → β}
(H : Filter.Tendsto f la lb)
(hla : la.HasBasis pa sa)
(hlb : lb.HasBasis pb sb)
(ib : ι')

pb ib → ∃ ia, pa ia ∧ Set.MapsTo f (sa ia) (sb ib)


theorem sdiff_sdiff_le : a \ (a \ b) ≤ b

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


@[reassoc (attr := simp)]
lemma inlX_π (i j : ι) (hij : c.Rel j i) :
    inlX K i j hij ≫ (π K).f j = 0

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (K.X i)]

[HomologicalComplex.HasHomotopyCofiber (CategoryTheory.Limits.biprod.lift (𝟙 K) (-𝟙 K))]

HomologicalComplex.cylinder.inlX K i j hij ≫ (HomologicalComplex.cylinder.π K).f j = 0


theorem list_rec {f : α → List β} {g : α → σ} {h : α → β × List β × σ → σ} (hf : Primrec f)
    (hg : Primrec g) (hh : Primrec₂ h) :
    @Primrec _ σ _ _ fun a => List.recOn (f a) (g a) fun b l IH => h a (b, l, IH)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → List β}
{g : α → σ}
{h : α → β × List β × σ → σ}
(hf : Primrec f)
(hg : Primrec g)
(hh : Primrec₂ h)

Primrec fun a => List.recOn (f a) (g a) fun b l IH => h a (b, l, IH)


/-- The intersection of the subspace and the orthogonal subspace
through the given point is the `orthogonalProjection` of that point
onto the subspace. -/
theorem inter_eq_singleton_orthogonalProjection {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] (p : P) :
    (s : Set P) ∩ mk' p s.directionᗮ = {↑(orthogonalProjection s p)}

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
(p : P)

↑s ∩ ↑(AffineSubspace.mk' p s.directionᗮ) = {↑((EuclideanGeometry.orthogonalProjection s) p)}


theorem Equiv.antisymm_iff {l₁ l₂ : Lists' α true} : of' l₁ ~ of' l₂ ↔ l₁ ⊆ l₂ ∧ l₂ ⊆ l₁

Lists.of' l₁ ~ Lists.of' l₂ ↔ l₁ ⊆ l₂ ∧ l₂ ⊆ l₁


/-- Each element `a : S` has an `M`-multiple which is an integer.

This version multiplies `a` on the right, matching the argument order in `LocalizationMap.surj`.
-/
theorem exists_integer_multiple' (a : S) : ∃ b : M, IsInteger R (a * algebraMap R S b)

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

∃ b, IsLocalization.IsInteger R (a * (algebraMap R S) ↑b)


theorem coe_to_submodule : ((L' : Submodule R L) : Set L) = L'

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


/-- The other direction does not hold because of the `h`-`h` cross terms on the RHS. -/
theorem map₂_distrib_le_right {m : δ → γ → ε} {n : α → β → δ} {m₁ : α → γ → α'} {m₂ : β → γ → β'}
    {n' : α' → β' → ε} (h_distrib : ∀ a b c, m (n a b) c = n' (m₁ a c) (m₂ b c)) :
    map₂ m (map₂ n f g) h ≤ map₂ n' (map₂ m₁ f h) (map₂ m₂ g h)

{m : δ → γ → ε}

{n : α → β → δ}

{m₁ : α → γ → α'}

{m₂ : β → γ → β'}

(h_distrib : ∀ (a : α) (b : β) (c : γ), m (n a b) c = n' (m₁ a c) (m₂ b c))

Filter.map₂ m (Filter.map₂ n f g) h ≤ Filter.map₂ n' (Filter.map₂ m₁ f h) (Filter.map₂ m₂ g h)


theorem map₂_coe_coe (a : α) (b : β) (f : α → β → γ) (hf : UniformContinuous₂ f) :
    pkg.map₂ pkg' pkg'' f (ι a) (ι' b) = ι'' (f a b)

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{β : Type u_2}
[UniformSpace β]
(pkg' : AbstractCompletion β)
{γ : Type u_3}
[UniformSpace γ]
(pkg'' : AbstractCompletion γ)
(a : α)
(b : β)
(f : α → β → γ)
(hf : UniformContinuous₂ f)

pkg.map₂ pkg' pkg'' f (pkg.coe a) (pkg'.coe b) = pkg''.coe (f a b)


theorem toAlgHom_op (f : A ≃ₐ[R] B) :
    (AlgEquiv.op f).toAlgHom = AlgHom.op f.toAlgHom

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A ≃ₐ[R] B)


theorem comp_congr (e : M' ≃ₗ[R] M'') (B : BilinForm R M) (l r : M' →ₗ[R] M) :
    congr e (B.comp l r) =
      B.comp (l.comp (e.symm : M'' →ₗ[R] M')) (r.comp (e.symm : M'' →ₗ[R] M'))

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_7}
{M'' : Type u_8}
[AddCommMonoid M']
[AddCommMonoid M'']
[Module R M']
[Module R M'']
(e : M' ≃ₗ[R] M'')
(B : LinearMap.BilinForm R M)
(l r : M' →ₗ[R] M)

(LinearMap.BilinForm.congr e) (B.comp l r) = B.comp (l ∘ₗ ↑e.symm) (r ∘ₗ ↑e.symm)


@[simp]
theorem deriv_tan (x : ℝ) : deriv tan x = 1 / cos x ^ 2


@[simp]
theorem constantCoeff_wittStructureInt_zero (Φ : MvPolynomial idx ℤ) :
    constantCoeff (wittStructureInt p Φ 0) = constantCoeff Φ

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
(Φ : MvPolynomial idx ℤ)

MvPolynomial.constantCoeff (wittStructureInt p Φ 0) = MvPolynomial.constantCoeff Φ


theorem diff_mem_iff (f : Ultrafilter α) : s \ t ∈ f ↔ s ∈ f ∧ t ∉ f

{α : Type u}
{s t : Set α}
(f : Ultrafilter α)


@[simp]
theorem LinearMap.toMatrix_toLin (M : Matrix m n R) :
    LinearMap.toMatrix v₁ v₂ (Matrix.toLin v₁ v₂ M) = M

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Finite m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
(M : Matrix m n R)

(LinearMap.toMatrix v₁ v₂) ((Matrix.toLin v₁ v₂) M) = M


protected theorem Set.UniformEquicontinuous.mono {H H' : Set <| β → α} (h : H.UniformEquicontinuous)
    (hH : H' ⊆ H) : H'.UniformEquicontinuous

{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{H H' : Set (β → α)}
(h : H.UniformEquicontinuous)
(hH : H' ⊆ H)


theorem rotate_eq_rotate' (l : List α) (n : ℕ) : l.rotate n = l.rotate' n


/-- A type `α` is countable if there exists an injective map `α → ℕ`. -/
@[mk_iff countable_iff_exists_injective]
class Countable (α : Sort u) : Prop where
  /-- A type `α` is countable if there exists an injective map `α → ℕ`. -/
  exists_injective_nat' : ∃ f : α → ℕ, Injective f


/-- **Gauss' lemma**. The Legendre symbol can be computed by considering the number of naturals less
  than `p/2` such that `(a * x) % p > p / 2`. -/
theorem gauss_lemma {p : ℕ} [h : Fact p.Prime] {a : ℤ} (hp : p ≠ 2) (ha0 : (a : ZMod p) ≠ 0) :
    legendreSym p a = (-1) ^ ((Ico 1 (p / 2).succ).filter fun x : ℕ =>
      p / 2 < (a * x : ZMod p).val).card

{p : ℕ}
[h : Fact (Nat.Prime p)]
{a : ℤ}
(hp : p ≠ 2)
(ha0 : ↑a ≠ 0)

legendreSym p a = (-1) ^ (Finset.filter (fun x => p / 2 < (↑a * ↑x).val) (Finset.Ico 1 (p / 2).succ)).card


@[simp]
theorem map_diff [DecidableEq β] {f : α → β} (finj : Injective f) {l₁ l₂ : List α} :
    map f (l₁.diff l₂) = (map f l₁).diff (map f l₂)

{α : Type u}
{β : Type v}
[DecidableEq α]
[DecidableEq β]
{f : α → β}
(finj : Function.Injective f)
{l₁ l₂ : List α}

List.map f (l₁.diff l₂) = (List.map f l₁).diff (List.map f l₂)


lemma isQuasiregular_inr_iff (a : A) :
    IsQuasiregular (a : Unitization R A) ↔ IsQuasiregular a

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


protected theorem Subsingleton.isPWO (hs : s.Subsingleton) : IsPWO s

{α : Type u_2}
[Preorder α]
{s : Set α}
(hs : s.Subsingleton)


@[simp]
theorem sign_zero : sign (0 : α) = 0

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


lemma uIcc_eq_union : [[a, b]] = Icc a b ∪ Icc b a

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

Set.uIcc a b = Set.Icc a b ∪ Set.Icc b a


lemma interior_sInter (S : Set (Set α)) : interior (⋂₀ S) = ⋂ s ∈ S, interior s

{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
(S : Set (Set α))


theorem fmod_add_fdiv : ∀ a b : Int, a.fmod b + b * a.fdiv b = a


theorem Poly.denote_combineAux (ctx : Context) (fuel : Nat) (p₁ p₂ : Poly) : (p₁.combineAux fuel p₂).denote ctx = p₁.denote ctx + p₂.denote ctx

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

Nat.Linear.Poly.denote ctx (Nat.Linear.Poly.combineAux fuel p₁ p₂) =
  Nat.Linear.Poly.denote ctx p₁ + Nat.Linear.Poly.denote ctx p₂


protected theorem subsingleton (h : IsHausdorff (⊤ : Ideal R) M) : Subsingleton M

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(h : IsHausdorff ⊤ M)


/-- For `L/K` a finite separable extension of fields and `E` an algebraically closed extension
of `K`, the norm (down to `K`) of an element `x` of `L` is equal to the product of the images
of `x` over all the `K`-embeddings `σ` of `L` into `E`. -/
theorem norm_eq_prod_embeddings [FiniteDimensional K L] [Algebra.IsSeparable K L] [IsAlgClosed E]
    (x : L) : algebraMap K E (norm K x) = ∏ σ : L →ₐ[K] E, σ x

(K : Type u_4)
{L : Type u_5}
[Field K]
[Field L]
[Algebra K L]
(E : Type u_7)
[Field E]
[Algebra K E]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsAlgClosed E]
(x : L)

(algebraMap K E) ((Algebra.norm K) x) = ∏ σ : L →ₐ[K] E, σ x


/-- An additive functor `C ⥤ D` factors through its lift to `Mat_ C ⥤ D`. -/
@[simps!]
def embeddingLiftIso (F : C ⥤ D) [Functor.Additive F] : embedding C ⋙ lift F ≅ F

(CategoryTheory.Mat_.embeddingLiftIso F).inv.app X = CategoryTheory.Limits.biproduct.lift fun x => 𝟙 (F.obj X)


@[simp]
lemma leftHomologyMap_nullHomotopic [S₁.HasLeftHomology] [S₂.HasLeftHomology]
    (h₀ : S₁.X₁ ⟶ S₂.X₁) (h₀_f : h₀ ≫ S₂.f = 0)
    (h₁ : S₁.X₂ ⟶ S₂.X₁) (h₂ : S₁.X₃ ⟶ S₂.X₂) (h₃ : S₁.X₃ ⟶ S₂.X₃) (g_h₃ : S₁.g ≫ h₃ = 0) :
    leftHomologyMap (nullHomotopic _ _ h₀ h₀_f h₁ h₂ h₃ g_h₃) = 0

(h₀_f : CategoryTheory.CategoryStruct.comp h₀ S₂.f = 0)

(g_h₃ : CategoryTheory.CategoryStruct.comp S₁.g h₃ = 0)

CategoryTheory.ShortComplex.leftHomologyMap (S₁.nullHomotopic S₂ h₀ h₀_f h₁ h₂ h₃ g_h₃) = 0


/-- A more general version of `finprod_mem_union'` that requires `s ∩ mulSupport f` and
`t ∩ mulSupport f` rather than `s` and `t` to be disjoint -/
@[to_additive
      "A more general version of `finsum_mem_union'` that requires `s ∩ support f` and
      `t ∩ support f` rather than `s` and `t` to be disjoint"]
theorem finprod_mem_union'' (hst : Disjoint (s ∩ mulSupport f) (t ∩ mulSupport f))
    (hs : (s ∩ mulSupport f).Finite) (ht : (t ∩ mulSupport f).Finite) :
    ∏ᶠ i ∈ s ∪ t, f i = (∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ t, f i

(hst : Disjoint (s ∩ Function.mulSupport f) (t ∩ Function.mulSupport f))

(hs : (s ∩ Function.mulSupport f).Finite)

(ht : (t ∩ Function.mulSupport f).Finite)

∏ᶠ (i : α) (_ : i ∈ s ∪ t), f i = (∏ᶠ (i : α) (_ : i ∈ s), f i) * ∏ᶠ (i : α) (_ : i ∈ t), f i


@[simp]
theorem coe_ofMapLEIff {α β} [PartialOrder α] [Preorder β] {f : α → β} (h) :
    ⇑(ofMapLEIff f h) = f

{α : Type u_6}
{β : Type u_7}
[PartialOrder α]
[Preorder β]
{f : α → β}
(h : ∀ (a b : α), f a ≤ f b ↔ a ≤ b)


theorem indicator_ae_eq_zero_of_restrict_ae_eq_zero (hs : MeasurableSet s)
    (hf : f =ᵐ[μ.restrict s] 0) : s.indicator f =ᵐ[μ] 0

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → β}
[Zero β]
(hs : MeasurableSet s)
(hf : f =ᵐ[μ.restrict s] 0)


/-- Note that we rarely use `CompleteSemilatticeInf`
(in fact, any such object is always a `CompleteLattice`, so it's usually best to start there).

Nevertheless it is sometimes a useful intermediate step in constructions.
-/
class CompleteSemilatticeInf (α : Type*) extends PartialOrder α, InfSet α where
  /-- Any element of a set is more than the set infimum. -/
  sInf_le : ∀ s, ∀ a ∈ s, sInf s ≤ a
  /-- Any lower bound is less than the set infimum. -/
  le_sInf : ∀ s a, (∀ b ∈ s, a ≤ b) → a ≤ sInf s

{α : Type u_9}
[self : CompleteSemilatticeInf α]
(s : Set α)
(a : α)


theorem dvd_iff_norm_le {n : ℕ} {z : ℤ} : ↑(p ^ n) ∣ z ↔ padicNorm p z ≤ (p : ℚ) ^ (-n : ℤ)

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

↑(p ^ n) ∣ z ↔ padicNorm p ↑z ≤ ↑p ^ (-↑n)


theorem content_mul_aux {p q : R[X]} :
    GCDMonoid.gcd (p * q).eraseLead.content p.leadingCoeff =
      GCDMonoid.gcd (p.eraseLead * q).content p.leadingCoeff

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

gcd (p * q).eraseLead.content p.leadingCoeff = gcd (p.eraseLead * q).content p.leadingCoeff


/-- The real square root is less than the natural square root plus one -/
theorem real_sqrt_lt_nat_sqrt_succ {a : ℕ} : √(a : ℝ) < Nat.sqrt a + 1


@[reassoc (attr := simp)]
lemma fromOpcycles_naturality : opcyclesMap φ ≫ S₂.fromOpcycles = S₁.fromOpcycles ≫ φ.τ₃

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.opcyclesMap φ) S₂.fromOpcycles =
  CategoryTheory.CategoryStruct.comp S₁.fromOpcycles φ.τ₃


@[simp]
theorem star_eq_zero [AddMonoid R] [StarAddMonoid R] {x : R} : star x = 0 ↔ x = 0

{R : Type u}
[AddMonoid R]
[StarAddMonoid R]
{x : R}


@[simp]
theorem cancel_right {g₁ g₂ : β →ₙ+* γ} {f : α →ₙ+* β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
[NonUnitalNonAssocSemiring γ]
{g₁ g₂ : β →ₙ+* γ}
{f : α →ₙ+* β}
(hf : Function.Surjective ⇑f)


@[simp] theorem UInt32.toUInt16_toNat (x : UInt32) : x.toUInt16.toNat = x.toNat % 2 ^ 16


protected lemma IsOfFinOrder.eq_one (ha₀ : 0 ≤ a) (ha : IsOfFinOrder a) : a = 1

{G : Type u_1}
[LinearOrderedSemiring G]
{a : G}
(ha₀ : 0 ≤ a)
(ha : IsOfFinOrder a)


/-- If `x` is a Liouville number, then for any `n`, for infinitely many denominators `b` there
exists a numerator `a` such that `x ≠ a / b` and `|x - a / b| < 1 / b ^ n`. -/
theorem frequently_exists_num (hx : Liouville x) (n : ℕ) :
    ∃ᶠ b : ℕ in atTop, ∃ a : ℤ, x ≠ a / b ∧ |x - a / b| < 1 / (b : ℝ) ^ n

∃ᶠ (b : ℕ) in Filter.atTop, ∃ a, x ≠ ↑a / ↑b ∧ |x - ↑a / ↑b| < 1 / ↑b ^ n


/-- A set `s` is compact if for every open cover of `s`, there exists a finite subcover. -/
theorem isCompact_of_finite_subcover
    (h : ∀ {ι : Type u} (U : ι → Set X), (∀ i, IsOpen (U i)) → (s ⊆ ⋃ i, U i) →
      ∃ t : Finset ι, s ⊆ ⋃ i ∈ t, U i) :
    IsCompact s

(h : ∀ {ι : Type u} (U : ι → Set X), (∀ (i : ι), IsOpen (U i)) → s ⊆ ⋃ i, U i → ∃ t, s ⊆ ⋃ i ∈ t, U i)


/-- This is `Algebra.norm_eq_zero_iff` composed with `Algebra.norm_apply`. -/
@[simp]
theorem norm_eq_zero_iff' [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    LinearMap.det (LinearMap.mul R S x) = 0 ↔ x = 0

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[Module.Free R S]
[Module.Finite R S]
{x : S}

LinearMap.det ((LinearMap.mul R S) x) = 0 ↔ x = 0


@[simp]
theorem finTwoProd_one (R : Type*) [Semiring R] : Basis.finTwoProd R 1 = (0, 1)


theorem Ideal.prime_of_isPrime {P : Ideal A} (hP : P ≠ ⊥) (h : IsPrime P) : Prime P

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{P : Ideal A}
(hP : P ≠ ⊥)
(h : P.IsPrime)


/-- A monoid homomorphism `f : M →* N` with a left-inverse `g : N → M` defines a multiplicative
equivalence between `M` and `f.mrange`.
This is a bidirectional version of `MonoidHom.mrange_restrict`. -/
@[to_additive (attr := simps (config := { simpRhs := true }))
      "An additive monoid homomorphism `f : M →+ N` with a left-inverse `g : N → M`
      defines an additive equivalence between `M` and `f.mrange`.
      This is a bidirectional version of `AddMonoidHom.mrange_restrict`. "]
def ofLeftInverse' (f : M →* N) {g : N → M} (h : Function.LeftInverse g f) :
    M ≃* MonoidHom.mrange f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)
{g : N → M}
(h : Function.LeftInverse g ⇑f)

∀ (a : ↥(MonoidHom.mrange f)), (MulEquiv.ofLeftInverse' f h).symm a = g ↑a


@[simp]
theorem integrableOn_finite_iUnion [Finite β] {t : β → Set α} :
    IntegrableOn f (⋃ i, t i) μ ↔ ∀ i, IntegrableOn f (t i) μ

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{μ : MeasureTheory.Measure α}
[Finite β]
{t : β → Set α}

MeasureTheory.IntegrableOn f (⋃ i, t i) μ ↔ ∀ (i : β), MeasureTheory.IntegrableOn f (t i) μ


@[simp]
theorem univ_eq_empty_iff : (univ : Set α) = ∅ ↔ IsEmpty α


theorem mem_minimals_iff_forall_erase (hP : ∀ ⦃s t⦄, P s → s ⊆ t → P t) :
    s ∈ minimals (· ⊆ ·) {t | P t} ↔ P s ∧ ∀ x ∈ s, ¬ P (s.erase x)

(hP : ∀ ⦃s t : Finset α⦄, P s → s ⊆ t → P t)

s ∈ minimals (fun x x_1 => x ⊆ x_1) {t | P t} ↔ P s ∧ ∀ x ∈ s, ¬P (s.erase x)


lemma zero_le_four [Preorder α] [ZeroLEOneClass α] [CovariantClass α α (·+·) (·≤·)] :
    (0 : α) ≤ 4

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


@[simp]
theorem mem_comap {m : α → β} (u : Ultrafilter β) (inj : Injective m) (large : Set.range m ∈ u)
    {s : Set α} : s ∈ u.comap inj large ↔ m '' s ∈ u

{α : Type u}
{β : Type v}
{m : α → β}
(u : Ultrafilter β)
(inj : Function.Injective m)
(large : Set.range m ∈ u)
{s : Set α}


/-- Convert a `Bicone` over a function on `WalkingPair` to a BinaryBicone. -/
@[simps]
def toBinaryBiconeFunctor {X Y : C} : Bicone (pairFunction X Y) ⥤ BinaryBicone X Y

(b : CategoryTheory.Limits.Bicone (CategoryTheory.Limits.pairFunction X Y))

(CategoryTheory.Limits.Bicone.toBinaryBiconeFunctor.obj b).pt = b.pt


theorem card_Iio : (Iio f).card = (∏ i ∈ f.support, (Iic (f i)).card) - 1

{ι : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]
[LocallyFiniteOrder α]
(f : ι →₀ α)

(Finset.Iio f).card = ∏ i ∈ f.support, (Finset.Iic (f i)).card - 1


@[simp]
theorem sumLexAssoc_apply_inl_inl :
    sumLexAssoc α β γ (toLex <| inl <| toLex <| inl a) = toLex (inl a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[LE α]
[LE β]
[LE γ]
(a : α)

(OrderIso.sumLexAssoc α β γ) (toLex (Sum.inl (toLex (Sum.inl a)))) = toLex (Sum.inl a)


theorem Decidable.peirce (a b : Prop) [Decidable a] : ((a → b) → a) → a


theorem sum_geometric_two_le (n : ℕ) : (∑ i ∈ range n, (1 / (2 : ℝ)) ^ i) ≤ 2


theorem cancel_epi (f : X ⟶ Y) [Epi f] {g h : Y ⟶ Z} : f ≫ g = f ≫ h ↔ g = h

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

CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f h ↔ g = h


/-- The orthocenter is the only point lying in any two of the
altitudes. -/
theorem eq_orthocenter_of_forall_mem_altitude {t : Triangle ℝ P} {i₁ i₂ : Fin 3} {p : P}
    (h₁₂ : i₁ ≠ i₂) (h₁ : p ∈ t.altitude i₁) (h₂ : p ∈ t.altitude i₂) : p = t.orthocenter

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{t : Affine.Triangle ℝ P}
{i₁ i₂ : Fin 3}
{p : P}
(h₁₂ : i₁ ≠ i₂)
(h₁ : p ∈ Affine.Simplex.altitude t i₁)
(h₂ : p ∈ Affine.Simplex.altitude t i₂)


@[to_additive (attr := simp)]
theorem Quotient.mk_smul_out' [QuotientAction β H] (b : β) (q : α ⧸ H) :
    QuotientGroup.mk (b • q.out') = b • q

{α : Type u}
{β : Type v}
[Group α]
[Monoid β]
[MulAction β α]
(H : Subgroup α)
[MulAction.QuotientAction β H]
(b : β)
(q : α ⧸ H)


/-- If two sets `s` and `t` are included in a set `u`, and `μ s + μ t > μ u`,
then `s` intersects `t`. Version assuming that `t` is measurable. -/
theorem nonempty_inter_of_measure_lt_add {m : MeasurableSpace α} (μ : Measure α) {s t u : Set α}
    (ht : MeasurableSet t) (h's : s ⊆ u) (h't : t ⊆ u) (h : μ u < μ s + μ t) :
    (s ∩ t).Nonempty

{α : Type u_1}
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
{s t u : Set α}
(ht : MeasurableSet t)
(h's : s ⊆ u)
(h't : t ⊆ u)
(h : μ u < μ s + μ t)


theorem ContinuousLinearMap.isBoundedLinearMap_comp_left (g : F →L[𝕜] G) :
    IsBoundedLinearMap 𝕜 fun f : E →L[𝕜] F => ContinuousLinearMap.comp g f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(g : F →L[𝕜] G)


theorem opow_ne_zero {a : Ordinal} (b : Ordinal) (a0 : a ≠ 0) : a ^ b ≠ 0

{a : Ordinal.{u_1}}
(b : Ordinal.{u_1})
(a0 : a ≠ 0)


@[simp]
theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f @o).symm : β → α) = f.symm

(o : ∀ {a b : α}, s (f a) (f b) ↔ r a b)

⇑{ toEquiv := f, map_rel_iff' := o }.symm = ⇑f.symm


/-- If `X` is affine, the image of the zero locus of global sections of `X` under `toΓSpecFun`
is the zero locus in terms of the prime spectrum of `Γ(X, ⊤)`. -/
lemma Scheme.toΓSpec_image_zeroLocus_eq_of_isAffine {X : Scheme.{u}} [IsAffine X]
    (s : Set Γ(X, ⊤)) :
    X.isoSpec.hom.val.base '' X.zeroLocus s = PrimeSpectrum.zeroLocus s

(s : Set ↑(X.presheaf.obj (Opposite.op ⊤)))

⇑X.isoSpec.hom.val.base '' X.zeroLocus s = PrimeSpectrum.zeroLocus s


@[simp]
theorem chainHeight_of_isEmpty [IsEmpty α] : s.chainHeight = 0

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


@[simp] theorem beq_true  : ∀b, (b == true)  =  b


protected theorem mono (f : α →o β) : Monotone f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α →o β)


@[simp]
theorem accept_one : (1 : εNFA α σ).accept = univ


/-- The Fourier integral of the `n`-th derivative of a function is obtained by multiplying the
Fourier integral of the original function by `(2πI L w ⬝ )^n`. -/
theorem fourierIntegral_iteratedFDeriv {N : ℕ∞} (hf : ContDiff ℝ N f)
    (h'f : ∀ (n : ℕ), n ≤ N → Integrable (iteratedFDeriv ℝ n f)) {n : ℕ} (hn : n ≤ N) :
    𝓕 (iteratedFDeriv ℝ n f)
      = (fun w ↦ fourierPowSMulRight (-innerSL ℝ) (𝓕 f) w n)

(h'f : ∀ (n : ℕ), ↑n ≤ N → MeasureTheory.Integrable (iteratedFDeriv ℝ n f) MeasureTheory.volume)

𝓕 (iteratedFDeriv ℝ n f) = fun w => VectorFourier.fourierPowSMulRight (-innerSL ℝ) (𝓕 f) w n


@[instance]
theorem nhdsWithin_Ioi_ofNat_nebot (n : ℕ) [n.AtLeastTwo] :
    (𝓝[>] (OfNat.ofNat n : ℝ≥0∞)).NeBot


/-- A functor `F : T ⥤ D` induces a functor `Under X ⥤ Under (F.obj X)` in the obvious way. -/
@[simps]
def post {X : T} (F : T ⥤ D) : Under X ⥤ Under (F.obj X)

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{X : T}
(F : CategoryTheory.Functor T D)
(Y : CategoryTheory.Under X)

(CategoryTheory.Under.post F).obj Y = CategoryTheory.Under.mk (F.map Y.hom)


@[simp]
theorem associator_obj_inl_inl (X) : (associator C D E).obj (inl (inl X)) = inl X

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

(CategoryTheory.sum.associator C D E).obj (Sum.inl (Sum.inl X)) = Sum.inl X


/-- `WalkingParallelPair` as a category is equivalent to a special case of
`WalkingParallelFamily`.  -/
@[simps!]
def walkingParallelFamilyEquivWalkingParallelPair :
    WalkingParallelFamily.{w} (ULift Bool) ≌ WalkingParallelPair

{x y : CategoryTheory.Limits.WalkingParallelFamily (ULift.{w, 0} Bool)}

CategoryTheory.Limits.walkingParallelFamilyEquivWalkingParallelPair.functor.map h =
  match x, y, h with
  | x, .(x), CategoryTheory.Limits.WalkingParallelFamily.Hom.id .(x) =>
    CategoryTheory.CategoryStruct.id
      (CategoryTheory.Limits.WalkingParallelFamily.rec CategoryTheory.Limits.WalkingParallelPair.zero
        CategoryTheory.Limits.WalkingParallelPair.one x)
  | .(CategoryTheory.Limits.WalkingParallelFamily.zero), .(CategoryTheory.Limits.WalkingParallelFamily.one),
    CategoryTheory.Limits.WalkingParallelFamily.Hom.line j =>
    bif j.down then CategoryTheory.Limits.WalkingParallelPairHom.left
    else CategoryTheory.Limits.WalkingParallelPairHom.right


theorem Sbtw.right_ne {x y z : P} (h : Sbtw R x y z) : z ≠ y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Sbtw R x y z)


@[to_additive (attr := simp)]
theorem pure_mul : pure a * g = g.map (a * ·)

{α : Type u_2}
[Mul α]
{g : Filter α}
{a : α}

pure a * g = Filter.map (fun x => a * x) g


/-- Transfer `IsLittleO` over a `PartialHomeomorph`. -/
theorem isLittleO_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} : f =o[𝓝 b] g ↔ (f ∘ e) =o[𝓝 (e.symm b)] (g ∘ e)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{E : Type u_3}
[Norm E]
{F : Type u_4}
[Norm F]
(e : PartialHomeomorph α β)
{b : β}
(hb : b ∈ e.target)
{f : β → E}
{g : β → F}

f =o[𝓝 b] g ↔ (f ∘ ↑e) =o[𝓝 (↑e.symm b)] (g ∘ ↑e)


/-- If the condition `G.Adj v w` fails, then `card_commonNeighbors_le_degree` is
the best we can do in general. -/
theorem Adj.card_commonNeighbors_lt_degree {G : SimpleGraph V} [DecidableRel G.Adj] {v w : V}
    (h : G.Adj v w) : Fintype.card (G.commonNeighbors v w) < G.degree v

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

Fintype.card ↑(G.commonNeighbors v w) < G.degree v


@[simp]
theorem toOrderRingHom_eq_coe (f : α ≃+*o β) : f.toOrderRingHom = f

{α : Type u_2}
{β : Type u_3}
[NonAssocSemiring α]
[Preorder α]
[NonAssocSemiring β]
[Preorder β]
(f : α ≃+*o β)


theorem sqrt_mul (x y : ℝ≥0) : sqrt (x * y) = sqrt x * sqrt y

NNReal.sqrt (x * y) = NNReal.sqrt x * NNReal.sqrt y


lemma iCondIndepFun_iff_iCondIndep {β : ι → Type*}
    (m : ∀ x : ι, MeasurableSpace (β x)) (f : ∀ x : ι, Ω → β x)
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepFun m' hm' m f μ
      ↔ iCondIndep m' hm' (fun x ↦ MeasurableSpace.comap (f x) (m x)) μ

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

ProbabilityTheory.iCondIndepFun m' hm' m f μ ↔
  ProbabilityTheory.iCondIndep m' hm' (fun x => MeasurableSpace.comap (f x) (m x)) μ


@[simp] lemma piTensorHomMap_tprod_tprod (f : Π i, s i →ₗ[R] t i) (x : Π i, s i) :
    piTensorHomMap (tprod R f) (tprod R x) = tprod R fun i ↦ f i (x i)

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{t : ι → Type u_11}
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i →ₗ[R] t i)
(x : (i : ι) → s i)

(PiTensorProduct.piTensorHomMap ((PiTensorProduct.tprod R) f)) ((PiTensorProduct.tprod R) x) =
  ⨂ₜ[R] (i : ι), (f i) (x i)


theorem projective_iff_preservesEpimorphisms_coyoneda_obj (P : C) :
    Projective P ↔ (coyoneda.obj (op P)).PreservesEpimorphisms

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

CategoryTheory.Projective P ↔ (CategoryTheory.coyoneda.obj (Opposite.op P)).PreservesEpimorphisms


theorem t2_separation_nhds [T2Space X] {x y : X} (h : x ≠ y) :
    ∃ u v, u ∈ 𝓝 x ∧ v ∈ 𝓝 y ∧ Disjoint u v

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


theorem not_isPredLimit_iff_exists_covBy (a : α) : ¬IsPredLimit a ↔ ∃ b, a ⋖ b


theorem mem_span_iff_total (s : Set M) (x : M) :
    x ∈ span R s ↔ ∃ l : s →₀ R, Finsupp.total s M R (↑) l = x

{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s : Set M)
(x : M)

x ∈ Submodule.span R s ↔ ∃ l, (Finsupp.total (↑s) M R Subtype.val) l = x


theorem colimit.pre_post {D : Type u'} [Category.{v'} D] (E : K ⥤ J) (F : J ⥤ C) (G : C ⥤ D)
    [HasColimit F] [HasColimit (E ⋙ F)] [HasColimit (F ⋙ G)] [h : HasColimit ((E ⋙ F) ⋙ G)] :
    -- G (colimit F) ⟶ G (colimit (E ⋙ F)) ⟶ colimit ((E ⋙ F) ⋙ G) vs
    -- G (colimit F) ⟶ colimit F ⋙ G ⟶ colimit (E ⋙ (F ⋙ G)) or
    haveI : HasColimit (E ⋙ F ⋙ G) := h
    colimit.post (E ⋙ F) G ≫ G.map (colimit.pre F E) =
      colimit.pre (F ⋙ G) E ≫ colimit.post F G

[CategoryTheory.Limits.HasColimit (E ⋙ F)]

[CategoryTheory.Limits.HasColimit (F ⋙ G)]

[h : CategoryTheory.Limits.HasColimit ((E ⋙ F) ⋙ G)]

CategoryTheory.Limits.colimit.post (E ⋙ F) G ≫ G.map (CategoryTheory.Limits.colimit.pre F E) =
  CategoryTheory.Limits.colimit.pre (F ⋙ G) E ≫ CategoryTheory.Limits.colimit.post F G


@[simp]
theorem trans_refl : e.trans (refl R₂ E₂) = e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)

e.trans (LinearIsometryEquiv.refl R₂ E₂) = e


theorem support_add_eq [DecidableEq α] {g₁ g₂ : α →₀ M} (h : Disjoint g₁.support g₂.support) :
    (g₁ + g₂).support = g₁.support ∪ g₂.support

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]
[DecidableEq α]
{g₁ g₂ : α →₀ M}
(h : Disjoint g₁.support g₂.support)


/-- Pull back an `I`-indexed family of objects to a `J`-indexed family, along a function `J → I`.
-/
@[simps]
def comap (h : J → I) : (∀ i, C i) ⥤ (∀ j, C (h j))

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

∀ {X Y : (i : I) → C i} (α : X ⟶ Y) (i : J), (CategoryTheory.Pi.comap C h).map α i = α (h i)


@[simp]
theorem empty_vsub (t : Set β) : ∅ -ᵥ t = ∅

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


@[simp] theorem sub_eq_top_iff : a - b = ∞ ↔ a = ∞ ∧ b ≠ ∞


protected theorem snoc {s₁ s₂ : CompositionSeries X} {x₁ x₂ : X} {hsat₁ : IsMaximal s₁.last x₁}
    {hsat₂ : IsMaximal s₂.last x₂} (hequiv : Equivalent s₁ s₂)
    (hlast : Iso (s₁.last, x₁) (s₂.last, x₂)) : Equivalent (s₁.snoc x₁ hsat₁) (s₂.snoc x₂ hsat₂)

{hsat₁ : JordanHolderLattice.IsMaximal (RelSeries.last s₁) x₁}

{hsat₂ : JordanHolderLattice.IsMaximal (RelSeries.last s₂) x₂}

(hlast : JordanHolderLattice.Iso (RelSeries.last s₁, x₁) (RelSeries.last s₂, x₂))

CompositionSeries.Equivalent (RelSeries.snoc s₁ x₁ hsat₁) (RelSeries.snoc s₂ x₂ hsat₂)


theorem lineDifferentiableAt_smul_iff {c : 𝕜} (hc : c ≠ 0) :
    LineDifferentiableAt 𝕜 f x (c • v) ↔ LineDifferentiableAt 𝕜 f x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{x v : E}
{c : 𝕜}
(hc : c ≠ 0)


/-- If a family of submodules is orthogonal, then the `orthogonalProjection` on a direct sum
is just the coefficient of that direct sum. -/
theorem OrthogonalFamily.projection_directSum_coeAddHom [DecidableEq ι] {V : ι → Submodule 𝕜 E}
    (hV : OrthogonalFamily 𝕜 (fun i => V i) fun i => (V i).subtypeₗᵢ) (x : ⨁ i, V i) (i : ι)
    [CompleteSpace (V i)] :
    orthogonalProjection (V i) (DirectSum.coeAddMonoidHom V x) = x i

(hV : OrthogonalFamily 𝕜 (fun i => ↥(V i)) fun i => (V i).subtypeₗᵢ)

(orthogonalProjection (V i)) ((DirectSum.coeAddMonoidHom V) x) = x i


/-- If the modulus of a holomorphic function `f` is bounded below by `ε` on a circle, then its range
contains a disk of radius `ε / 2`. -/
theorem DiffContOnCl.ball_subset_image_closedBall (h : DiffContOnCl ℂ f (ball z₀ r)) (hr : 0 < r)
    (hf : ∀ z ∈ sphere z₀ r, ε ≤ ‖f z - f z₀‖) (hz₀ : ∃ᶠ z in 𝓝 z₀, f z ≠ f z₀) :
    ball (f z₀) (ε / 2) ⊆ f '' closedBall z₀ r

(h : DiffContOnCl ℂ f (Metric.ball z₀ r))

(hf : ∀ z ∈ Metric.sphere z₀ r, ε ≤ ‖f z - f z₀‖)

Metric.ball (f z₀) (ε / 2) ⊆ f '' Metric.closedBall z₀ r


@[to_additive (attr := simp)]
theorem coe_inclusion {H K : Subgroup G} {h : H ≤ K} (a : H) : (inclusion h a : G) = a

{G : Type u_1}
[Group G]
{H K : Subgroup G}
{h : H ≤ K}
(a : ↥H)


@[to_additive (attr := simp)]
theorem image2_smul : image2 SMul.smul s t = s • t

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


theorem cast_commute (r : ℚ) (a : α) : Commute (↑r) a

{α : Type u_3}
[DivisionRing α]
(r : ℚ)
(a : α)


/-- Riemann zeta functional equation, formulated for `ζ`: if `1 - s ∉ ℕ`, then we have
`ζ (1 - s) = 2 ^ (1 - s) * π ^ (-s) * Γ s * sin (π * (1 - s) / 2) * ζ s`. -/
theorem riemannZeta_one_sub {s : ℂ} (hs : ∀ n : ℕ, s ≠ -n) (hs' : s ≠ 1) :
    riemannZeta (1 - s) = 2 * (2 * π) ^ (-s) * Gamma s * cos (π * s / 2) * riemannZeta s

riemannZeta (1 - s) = 2 * (2 * ↑π) ^ (-s) * Complex.Gamma s * Complex.cos (↑π * s / 2) * riemannZeta s


theorem mem_sInf {s : Set (Subgroupoid C)} {p : Σ c d : C, c ⟶ d} :
    p ∈ sInf s ↔ ∀ S ∈ s, p ∈ S

{s : Set (CategoryTheory.Subgroupoid C)}


theorem isSupported_sub (hxs : IsSupported x s) (hys : IsSupported y s) : IsSupported (x - y) s

{α : Type u}
{x y : FreeCommRing α}
{s : Set α}
(hxs : x.IsSupported s)
(hys : y.IsSupported s)


theorem toIsometryEquiv_injective :
    Function.Injective (toIsometryEquiv : (E ≃ₛₗᵢ[σ₁₂] E₂) → E ≃ᵢ E₂)

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]


theorem add_one_le_iff_lt {x y : PartENat} (hx : x ≠ ⊤) : x + 1 ≤ y ↔ x < y


theorem biInf_sets_eq {f : β → Filter α} {s : Set β} (h : DirectedOn (f ⁻¹'o (· ≥ ·)) s)
    (ne : s.Nonempty) : (⨅ i ∈ s, f i).sets = ⋃ i ∈ s, (f i).sets

(h : DirectedOn (f ⁻¹'o fun x x_1 => x ≥ x_1) s)


theorem multiplicity_choose_prime_pow {p n k : ℕ} (hp : p.Prime) (hkn : k ≤ p ^ n) (hk0 : k ≠ 0) :
    multiplicity p (choose (p ^ n) k) =
      ↑(n - (multiplicity p k).get (finite_nat_iff.2 ⟨hp.ne_one, hk0.bot_lt⟩))

{p n k : ℕ}
(hp : Nat.Prime p)
(hkn : k ≤ p ^ n)
(hk0 : k ≠ 0)

multiplicity p ((p ^ n).choose k) = ↑(n - (multiplicity p k).get ⋯)


/-- An object of a category `C` is connected if it is not initial
and has no non-trivial subobjects. Lenstra, 3.12. -/
class IsConnected {C : Type u₁} [Category.{u₂, u₁} C] (X : C) : Prop where
  /-- `X` is not an initial object. -/
  notInitial : IsInitial X → False
  /-- `X` has no non-trivial subobjects. -/
  noTrivialComponent (Y : C) (i : Y ⟶ X) [Mono i] : (IsInitial Y → False) → IsIso i

[self : CategoryTheory.PreGaloisCategory.IsConnected X]

CategoryTheory.Limits.IsInitial X → False


@[to_additive (attr := simp)]
theorem mulSingle_inj (i : I) {x y : f i} : mulSingle i x = mulSingle i y ↔ x = y

{I : Type u}
(f : I → Type v₁)
[DecidableEq I]
[(i : I) → One (f i)]
(i : I)
{x y : f i}

Pi.mulSingle i x = Pi.mulSingle i y ↔ x = y


@[simp]
theorem lintegral_indicator_one {s : Set α} (hs : MeasurableSet s) :
    ∫⁻ a, s.indicator 1 a ∂μ = μ s

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


theorem nfpBFamily_le_fp (H : ∀ i hi, Monotone (f i hi)) {a b} (ab : a ≤ b)
    (h : ∀ i hi, f i hi b ≤ b) : nfpBFamily.{u, v} o f a ≤ b

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

(H : ∀ (i : Ordinal.{u}) (hi : i < o), Monotone (f i hi))

(h : ∀ (i : Ordinal.{u}) (hi : i < o), f i hi b ≤ b)


lemma exterior_subset_iff : exterior s ⊆ t ↔ ∃ U, IsOpen U ∧ s ⊆ U ∧ U ⊆ t

{α : Type u_3}
[TopologicalSpace α]
{s t : Set α}
[AlexandrovDiscrete α]


lemma mul_bounded_of_bounded_of_bounded {X : Type*} [PseudoMetricSpace R] [Mul R] [BoundedMul R]
    {f g : X → R} (f_bdd : ∃ C, ∀ x y, dist (f x) (f y) ≤ C)
    (g_bdd : ∃ C, ∀ x y, dist (g x) (g y) ≤ C) :
    ∃ C, ∀ x y, dist ((f * g) x) ((f * g) y) ≤ C

(f_bdd : ∃ C, ∀ (x y : X), dist (f x) (f y) ≤ C)

(g_bdd : ∃ C, ∀ (x y : X), dist (g x) (g y) ≤ C)

∃ C, ∀ (x y : X), dist ((f * g) x) ((f * g) y) ≤ C


theorem map_comap_le {β} (f : α → β) (m : OuterMeasure β) : map f (comap f m) ≤ m

{α : Type u_1}
{β : Type u_3}
(f : α → β)
(m : MeasureTheory.OuterMeasure β)

(MeasureTheory.OuterMeasure.map f) ((MeasureTheory.OuterMeasure.comap f) m) ≤ m


/-- Extending a cocone by a composition is the same as extending the cone twice. -/
@[simps!]
def extendComp (s : Cocone F) {X Y : C} (f : s.pt ⟶ X) (g : X ⟶ Y) :
    s.extend (f ≫ g) ≅ (s.extend f).extend g

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(s : CategoryTheory.Limits.Cocone F)
{X Y : C}
(f : s.pt ⟶ X)
(g : X ⟶ Y)

(CategoryTheory.Limits.Cocones.extendComp s f g).hom.hom = 𝟙 Y


protected lemma Continuous.partialSups (hf : ∀ k ≤ n, Continuous (f k)) :
    Continuous (partialSups f n)

{L : Type u_1}
[SemilatticeSup L]
[TopologicalSpace L]
[ContinuousSup L]
{X : Type u_2}
[TopologicalSpace X]
{f : ℕ → X → L}
{n : ℕ}
(hf : ∀ k ≤ n, Continuous (f k))


@[to_additive nsmul_neg]
theorem pow_lt_one' {a : M} (ha : a < 1) {k : ℕ} (hk : k ≠ 0) : a ^ k < 1

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


/-- An open set is everywhere positive for a measure which is positive on open sets. -/
lemma _root_.IsOpen.isEverywherePos [IsOpenPosMeasure μ] (hs : IsOpen s) : IsEverywherePos μ s

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


theorem sign_mul_pos_of_ne_zero (r : ℝ) (hr : r ≠ 0) : 0 < sign r * r


@[to_additive]
lemma orderOf_generator_eq_natCard (h : ∀ x, x ∈ Subgroup.zpowers a) : orderOf a = Nat.card α

{α : Type u}
{a : α}
[Group α]
(h : ∀ (x : α), x ∈ Subgroup.zpowers a)


@[to_additive (attr := simp)]
theorem diam_one [One α] : diam (1 : Set α) = 0

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


theorem truncate_range {a b : X} (γ : Path a b) {t₀ t₁ : ℝ} :
    range (γ.truncate t₀ t₁) ⊆ range γ

{X : Type u_1}
[TopologicalSpace X]
{a b : X}
(γ : Path a b)
{t₀ t₁ : ℝ}

Set.range ⇑(γ.truncate t₀ t₁) ⊆ Set.range ⇑γ


theorem toGHSpace_continuous :
    Continuous (NonemptyCompacts.toGHSpace : NonemptyCompacts X → GHSpace)


theorem eq_zero {β : Type*} [NormedAddCommGroup β] {T : Set α → β} {C : ℝ} {m : MeasurableSpace α}
    (hT : DominatedFinMeasAdditive (0 : Measure α) T C) {s : Set α} (hs : MeasurableSet s) :
    T s = 0

(hT : MeasureTheory.DominatedFinMeasAdditive 0 T C)


lemma le_traceDual_traceDual {I : Submodule B L} :
    I ≤ Iᵛᵛ

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
{I : Submodule B L}

I ≤ Submodule.traceDual A K (Submodule.traceDual A K I)


theorem ZeroAtFilter.boundedAtFilter [NormedAddCommGroup β] {l : Filter α} {f : α → β}
    (hf : ZeroAtFilter l f) : BoundedAtFilter l f

{α : Type u_2}
{β : Type u_3}
[NormedAddCommGroup β]
{l : Filter α}
{f : α → β}
(hf : l.ZeroAtFilter f)


theorem cons_perm_iff_perm_erase {a : α} {l₁ l₂ : List α} :
    a :: l₁ ~ l₂ ↔ a ∈ l₂ ∧ l₁ ~ l₂.erase a

{α : Type u_1}
[DecidableEq α]
{a : α}
{l₁ l₂ : List α}


theorem measurable_rangeSplitting (hf : MeasurableEmbedding f) :
    Measurable (rangeSplitting f)

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


@[reassoc]
theorem map_inr_inv_coprodComparison [IsIso (coprodComparison F A B)] :
    F.map coprod.inr ≫ inv (coprodComparison F A B) = coprod.inr

[CategoryTheory.Limits.HasBinaryCoproduct (F.obj A) (F.obj B)]

[CategoryTheory.IsIso (CategoryTheory.Limits.coprodComparison F A B)]

F.map CategoryTheory.Limits.coprod.inr ≫ CategoryTheory.inv (CategoryTheory.Limits.coprodComparison F A B) =
  CategoryTheory.Limits.coprod.inr


theorem isOpen_singleton_iff : IsOpen ({a} : Set Ordinal) ↔ ¬IsLimit a


theorem IsCompact.nhdsSet_prod_eq_biSup {K : Set X} (hK : IsCompact K) (l : Filter Y) :
    (𝓝ˢ K) ×ˢ l = ⨆ x ∈ K, 𝓝 x ×ˢ l

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
{K : Set X}
(hK : IsCompact K)
(l : Filter Y)

𝓝ˢ K ×ˢ l = ⨆ x ∈ K, 𝓝 x ×ˢ l


theorem coeff_zero_eq_constantCoeff_apply (φ : R⟦X⟧) : coeff R 0 φ = constantCoeff R φ

{R : Type u_1}
[Semiring R]
(φ : PowerSeries R)

(PowerSeries.coeff R 0) φ = (PowerSeries.constantCoeff R) φ


@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_inv_snd_snd :
    (pullbackDiagonalMapIdIso f g i).inv ≫ pullback.snd _ _ ≫ pullback.snd _ _ =
      pullback.snd _ _

[CategoryTheory.Limits.HasPullback (f ≫ i) (g ≫ i)]

[CategoryTheory.Limits.HasPullback (CategoryTheory.Limits.pullback.diagonal i)
    (CategoryTheory.Limits.pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯)]

(CategoryTheory.Limits.pullbackDiagonalMapIdIso f g i).inv ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.diagonal i)
        (CategoryTheory.Limits.pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯) ≫
      CategoryTheory.Limits.pullback.snd (f ≫ i) (g ≫ i) =
  CategoryTheory.Limits.pullback.snd f g


@[simp]
theorem map_ratCast [DivisionRing α] [DivisionRing β] [RingHomClass F α β] (f : F) (q : ℚ) :
    f q = q

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[DivisionRing α]
[DivisionRing β]
[RingHomClass F α β]
(f : F)
(q : ℚ)


theorem seqClosure_eq_closure [FrechetUrysohnSpace X] (s : Set X) : seqClosure s = closure s

{X : Type u_1}
[TopologicalSpace X]
[FrechetUrysohnSpace X]
(s : Set X)


lemma congr_cylinder (hP : IsProjectiveMeasureFamily P)
    {S : Set (∀ i : I, α i)} {T : Set (∀ i : J, α i)} (hS : MeasurableSet S) (hT : MeasurableSet T)
    (h_eq : cylinder I S = cylinder J T) :
    P I S = P J T

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

(hP : MeasureTheory.IsProjectiveMeasureFamily P)

(h_eq : MeasureTheory.cylinder I S = MeasureTheory.cylinder J T)


@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIso_hom_snd :
    (pullbackDiagonalMapIso f i i₁ i₂).hom ≫ pullback.snd _ _ =
      pullback.snd _ _ ≫ pullback.snd _ _

(i₁ : V₁ ⟶ CategoryTheory.Limits.pullback f i)

(i₂ : V₂ ⟶ CategoryTheory.Limits.pullback f i)

(CategoryTheory.Limits.pullbackDiagonalMapIso f i i₁ i₂).hom ≫ CategoryTheory.Limits.pullback.snd i₁ i₂ =
  CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.diagonal f)
      (CategoryTheory.Limits.pullback.map (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) f f (i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.fst f i) i ⋯ ⋯) ≫
    CategoryTheory.Limits.pullback.snd (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
      (i₂ ≫ CategoryTheory.Limits.pullback.snd f i)


@[simp]
theorem blockDiag'_sub [AddGroup α] (M N : Matrix (Σi, m' i) (Σi, n' i) α) :
    blockDiag' (M - N) = blockDiag' M - blockDiag' N

(M N : Matrix ((i : o) × m' i) ((i : o) × n' i) α)

(M - N).blockDiag' = M.blockDiag' - N.blockDiag'


@[simp]
theorem disjoint_bot_left : Disjoint ⊥ a

{α : Type u_1}
[PartialOrder α]
[OrderBot α]
{a : α}


@[simp]
theorem hnot_apply [∀ i, HNot (π i)] (a : ∀ i, π i) (i : ι) : (￢a) i = ￢a i

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → HNot (π i)]
(a : (i : ι) → π i)
(i : ι)


theorem isAtomic_of_orderBot_wellFounded_lt [OrderBot α]
    (h : WellFounded ((· < ·) : α → α → Prop)) : IsAtomic α

{α : Type u_2}
[PartialOrder α]
[OrderBot α]
(h : WellFounded fun x x_1 => x < x_1)


theorem chromaticNumber_mono (G' : SimpleGraph V)
    (h : G ≤ G') : G.chromaticNumber ≤ G'.chromaticNumber

{V : Type u}
{G : SimpleGraph V}
(G' : SimpleGraph V)
(h : G ≤ G')


/-- Two bases are equal if they assign the same coordinates. -/
theorem eq_ofRepr_eq_repr {b₁ b₂ : Basis ι R M} (h : ∀ x i, b₁.repr x i = b₂.repr x i) : b₁ = b₂

(h : ∀ (x : M) (i : ι), (b₁.repr x) i = (b₂.repr x) i)


@[simp]
theorem kahler_rightAngleRotation_right (x y : E) :
    o.kahler x (J y) = Complex.I * o.kahler x y

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

(o.kahler x) (o.rightAngleRotation y) = Complex.I * (o.kahler x) y


/-- Given sieve `S` and presheaf `P : Cᵒᵖ ⥤ A`, their natural associated cone is a limit cone
    iff `Hom (E, P -)` is a sheaf of types for the sieve `S` and all `E : A`. -/
theorem isLimit_iff_isSheafFor :
    Nonempty (IsLimit (P.mapCone S.arrows.cocone.op)) ↔
      ∀ E : Aᵒᵖ, IsSheafFor (P ⋙ coyoneda.obj E) S.arrows

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A : Type u₂}
[CategoryTheory.Category.{v₂, u₂} A]
(P : CategoryTheory.Functor Cᵒᵖ A)
{X : C}
(S : CategoryTheory.Sieve X)

Nonempty (CategoryTheory.Limits.IsLimit (P.mapCone S.arrows.cocone.op)) ↔
  ∀ (E : Aᵒᵖ), CategoryTheory.Presieve.IsSheafFor (P.comp (CategoryTheory.coyoneda.obj E)) S.arrows


@[simp] theorem add_mul_emod_self_left (a b c : Int) : (a + b * c) % b = a % b


/-- Expand the square -/
theorem norm_add_mul_self_real (x y : F) :
    ‖x + y‖ * ‖x + y‖ = ‖x‖ * ‖x‖ + 2 * ⟪x, y⟫_ℝ + ‖y‖ * ‖y‖

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


/-- `val_v(v^n) = n` for every `n ∈ ℕ`. -/
theorem count_pow_self (n : ℕ) :
    count K v ((v.asIdeal : FractionalIdeal R⁰ K) ^ n) = n

(v : IsDedekindDomain.HeightOneSpectrum R)

FractionalIdeal.count K v (↑v.asIdeal ^ n) = ↑n


theorem tendsto_atBot_of_leadingCoeff_nonpos (hdeg : 0 < P.degree) (hnps : P.leadingCoeff ≤ 0) :
    Tendsto (fun x => eval x P) atTop atBot

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P : 𝕜[X])
[OrderTopology 𝕜]
(hdeg : 0 < P.degree)
(hnps : P.leadingCoeff ≤ 0)

Filter.Tendsto (fun x => Polynomial.eval x P) Filter.atTop Filter.atBot