/-- If `G` and `F ⋙ G` are equivalence of categories, then `F` is also an equivalence. -/
lemma isEquivalence_of_comp_right {E : Type*} [Category E] (F : C ⥤ D) (G : D ⥤ E)
    [IsEquivalence G] [IsEquivalence (F ⋙ G)] : IsEquivalence F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u_1}
[CategoryTheory.Category.{u_2, u_1} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
[G.IsEquivalence]
[(F.comp G).IsEquivalence]


lemma factorsThru_top {X : C} (S : Presieve X) : S.FactorsThru ⊤

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


theorem _root_.Algebra.lmul_isUnit_iff {x : A} :
    IsUnit (Algebra.lmul R A x) ↔ IsUnit x

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

IsUnit ((Algebra.lmul R A) x) ↔ IsUnit x


/-- The matrix representation of `conjAe`. -/
@[simp]
theorem toMatrix_conjAe :
    LinearMap.toMatrix basisOneI basisOneI conjAe.toLinearMap = !![1, 0; 0, -1]

(LinearMap.toMatrix Complex.basisOneI Complex.basisOneI) Complex.conjAe.toLinearMap = !![1, 0; 0, -1]


theorem pi_zero : pi (fun i => 0 : (i : ι) → M₂ →ₗ[R] φ i) = 0

{R : Type u}
{M₂ : Type w}
{ι : Type x}
[Semiring R]
[AddCommMonoid M₂]
[Module R M₂]
{φ : ι → Type i}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]


@[fun_prop]
nonrec theorem HasFDerivAt.sub_const (hf : HasFDerivAt f f' x) (c : F) :
    HasFDerivAt (fun x => f x - c) f' x

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


@[to_additive (attr := simp, norm_cast)]
theorem coe_zpow (x : H) (n : ℤ) : ((x ^ n : H) : G) = (x : G) ^ n

{G : Type u_1}
[Group G]
{S : Type u_6}
{H : S}
[SetLike S G]
[SubgroupClass S G]
(x : ↥H)
(n : ℤ)


theorem HasDerivAtFilter.sub_const (hf : HasDerivAtFilter f f' x L) (c : F) :
    HasDerivAtFilter (fun x => f x - c) f' x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{L : Filter 𝕜}
(hf : HasDerivAtFilter f f' x L)
(c : F)


/-- The pushforward of a sheaf (by a continuous map) is a sheaf.
-/
theorem pushforward_sheaf_of_sheaf {F : X.Presheaf C} (h : F.IsSheaf) : (f _* F).IsSheaf

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

((TopCat.Presheaf.pushforward C f).obj F).IsSheaf


theorem map_neg₂ (f : M →SL[ρ₁₂] F →SL[σ₁₂] G') (x : M) (y : F) : f (-x) y = -f x y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{R : Type u_5}
{𝕜₂ : Type u_6}
{𝕜' : Type u_7}
[NontriviallyNormedField 𝕜']
[NontriviallyNormedField 𝕜₂]
{M : Type u_8}
[TopologicalSpace M]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{G' : Type u_9}
[NormedAddCommGroup G']
[NormedSpace 𝕜₂ G']
[NormedSpace 𝕜' G']
[SMulCommClass 𝕜₂ 𝕜' G']
[Ring R]
[AddCommGroup M]
[Module R M]
{ρ₁₂ : R →+* 𝕜'}
(f : M →SL[ρ₁₂] F →SL[σ₁₂] G')
(x : M)
(y : F)


/-- An auxiliary equivalence useful in the proofs about
`FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a
`Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a
`Finset (Fin n)`.

The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to
`(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems
with non-definitional equalities. -/
@[simps]
def changeOriginIndexEquiv :
    (Σ k l : ℕ, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Σ n : ℕ, Finset (Fin n)

(FormalMultilinearSeries.changeOriginIndexEquiv.symm s).snd.fst = s.snd.card


theorem sups_subset : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊻ t₁ ⊆ s₂ ⊻ t₂

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{s₁ s₂ t₁ t₂ : Finset α}

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊻ t₁ ⊆ s₂ ⊻ t₂


/-- This lemma is for polynomials over a field. -/
theorem Splits.def {i : K →+* L} {f : K[X]} (h : Splits i f) :
    f = 0 ∨ ∀ {g : L[X]}, Irreducible g → g ∣ f.map i → degree g = 1

{K : Type v}
{L : Type w}
[Field K]
[Field L]
{i : K →+* L}
{f : K[X]}
(h : Polynomial.Splits i f)

f = 0 ∨ ∀ {g : L[X]}, Irreducible g → g ∣ Polynomial.map i f → g.degree = 1


theorem summable_norm_mul_pow (p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h : ↑r < p.radius) :
    Summable fun n : ℕ => ‖p n‖ * (r : ℝ) ^ n

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{r : ℝ≥0}
(h : ↑r < p.radius)


theorem integrable_coeFn {f : α →ₘ[μ] β} : MeasureTheory.Integrable f μ ↔ Integrable f

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : α →ₘ[μ] β}

MeasureTheory.Integrable (↑f) μ ↔ f.Integrable


theorem of_algEquiv [Algebra K F] (p : K[X]) (f : F ≃ₐ[K] L) [IsSplittingField K F p] :
    IsSplittingField K L p

{F : Type u}
{K : Type v}
(L : Type w)
[Field K]
[Field L]
[Field F]
[Algebra K L]
[Algebra K F]
(p : K[X])
(f : F ≃ₐ[K] L)
[Polynomial.IsSplittingField K F p]


/-- Functor composition induces a functor on truncated simplicial objects. -/
@[simps!]
def whiskering {n} (D : Type*) [Category D] : (C ⥤ D) ⥤ Truncated C n ⥤ Truncated D n

(F : (SimplexCategory.Truncated n)ᵒᵖ ⥤ C)

(((CategoryTheory.SimplicialObject.Truncated.whiskering C D).obj H).obj F).obj X = H.obj (F.obj X)


theorem gMul_def {i j} (a : ⨂[R]^i M) (b : (⨂[R]^j) M) :
    a ₜ* b = @mulEquiv R M _ _ _ i j (a ⊗ₜ b)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{i j : ℕ}
(a : ⨂[R]^i M)
(b : ⨂[R]^j M)

GradedMonoid.GMul.mul a b = TensorPower.mulEquiv (a ⊗ₜ[R] b)


theorem LDL.lowerInv_orthogonal {i j : n} (h₀ : i ≠ j) :
    ⟪LDL.lowerInv hS i, Sᵀ *ᵥ LDL.lowerInv hS j⟫ₑ = 0

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

⟪(WithLp.equiv 2 (n → 𝕜)).symm (LDL.lowerInv hS i),
    (WithLp.equiv 2 (n → 𝕜)).symm (S.transpose.mulVec (LDL.lowerInv hS j))⟫_𝕜 =
  0


theorem add_one_le_of_lt {n : ℕ} {a b : Fin (n + 1)} (h : a < b) : a + 1 ≤ b


theorem le_of_toZ_le {j : ι} (h_le : toZ i0 i ≤ toZ i0 j) : i ≤ j

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 i j : ι}
(h_le : toZ i0 i ≤ toZ i0 j)


lemma iSup_genEigenspace_inf_le_add
    (f₁ f₂ : End R M) (μ₁ μ₂ : R) (h : Commute f₁ f₂) :
    (⨆ k, f₁.genEigenspace μ₁ k) ⊓ (⨆ k, f₂.genEigenspace μ₂ k) ≤
    ⨆ k, (f₁ + f₂).genEigenspace (μ₁ + μ₂) k

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f₁ f₂ : Module.End R M)
(μ₁ μ₂ : R)
(h : Commute f₁ f₂)

(⨆ k, (f₁.genEigenspace μ₁) k) ⊓ ⨆ k, (f₂.genEigenspace μ₂) k ≤ ⨆ k, ((f₁ + f₂).genEigenspace (μ₁ + μ₂)) k


@[simp] theorem getLsb_ge (x : BitVec w) (i : Nat) (ge : w ≤ i) : getLsb x i = false

{w : Nat}
(x : BitVec w)
(i : Nat)
(ge : w ≤ i)


/-- `a : α` is a Stieltjes point for `f : α → ℚ → ℝ` if `f a` is monotone with limit 0 at -∞
and 1 at +∞ and satisfies a continuity property. -/
structure IsRatStieltjesPoint (f : α → ℚ → ℝ) (a : α) : Prop where
  mono : Monotone (f a)
  tendsto_atTop_one : Tendsto (f a) atTop (𝓝 1)
  tendsto_atBot_zero : Tendsto (f a) atBot (𝓝 0)
  iInf_rat_gt_eq : ∀ t : ℚ, ⨅ r : Ioi t, f a r = f a t

{f : α → ℚ → ℝ}

(self : ProbabilityTheory.IsRatStieltjesPoint f a)


lemma uniformInducing_iff_uniformSpace {f : α → β} :
    UniformInducing f ↔ ‹UniformSpace β›.comap f = ‹UniformSpace α›

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{f : α → β}

UniformInducing f ↔ UniformSpace.comap f inst✝ = inst✝¹


@[to_additive]
theorem uniformGroup_iInf {ι : Sort*} {us' : ι → UniformSpace β}
    (h' : ∀ i, @UniformGroup β (us' i) _) : @UniformGroup β (⨅ i, us' i) _

{β : Type u_2}
[Group β]
{ι : Sort u_3}
{us' : ι → UniformSpace β}
(h' : ∀ (i : ι), UniformGroup β)


/-- If `s : Set α` and `t : Set β` are finite sets, then taking the product over `s` commutes with
taking the product over `t`. -/
@[to_additive
      "If `s : Set α` and `t : Set β` are finite sets, then summing over `s` commutes with
      summing over `t`."]
theorem finprod_mem_comm {s : Set α} {t : Set β} (f : α → β → M) (hs : s.Finite) (ht : t.Finite) :
    (∏ᶠ i ∈ s, ∏ᶠ j ∈ t, f i j) = ∏ᶠ j ∈ t, ∏ᶠ i ∈ s, f i j

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[CommMonoid M]
{s : Set α}
{t : Set β}
(f : α → β → M)
(hs : s.Finite)
(ht : t.Finite)


@[simp]
theorem bit_cases_on_inj {C : ℕ → Sort u} (H₁ H₂ : ∀ b n, C (bit b n)) :
    ((fun n => bitCasesOn n H₁) = fun n => bitCasesOn n H₂) ↔ H₁ = H₂

(H₁ H₂ : (b : Bool) → (n : ℕ) → C (Nat.bit b n))

((fun n => n.bitCasesOn H₁) = fun n => n.bitCasesOn H₂) ↔ H₁ = H₂


theorem map_mk (x : A) : f <$$> Const.mk x = Const.mk x

{n : ℕ}
{A : Type u}
{α β : TypeVec.{u} n}
(f : α.Arrow β)
(x : A)

MvFunctor.map f (MvQPF.Const.mk x) = MvQPF.Const.mk x


@[simp]
theorem transitionMap_comp_eval_apply {m n : ℕ} (hmn : m ≤ n) (x : AdicCompletion I M) :
    transitionMap I M hmn (x.val n) = x.val m

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

(AdicCompletion.transitionMap I M hmn) (↑x n) = ↑x m


/-- An octahedron is a type of datum whose existence is asserted by
the octahedron axiom (TR 4), see https://stacks.math.columbia.edu/tag/05QK -/
structure Octahedron
  {X₁ X₂ X₃ Z₁₂ Z₂₃ Z₁₃ : C}
  {u₁₂ : X₁ ⟶ X₂} {u₂₃ : X₂ ⟶ X₃} {u₁₃ : X₁ ⟶ X₃} (comm : u₁₂ ≫ u₂₃ = u₁₃)
  {v₁₂ : X₂ ⟶ Z₁₂} {w₁₂ : Z₁₂ ⟶ X₁⟦(1 : ℤ)⟧} (h₁₂ : Triangle.mk u₁₂ v₁₂ w₁₂ ∈ distTriang C)
  {v₂₃ : X₃ ⟶ Z₂₃} {w₂₃ : Z₂₃ ⟶ X₂⟦(1 : ℤ)⟧} (h₂₃ : Triangle.mk u₂₃ v₂₃ w₂₃ ∈ distTriang C)
  {v₁₃ : X₃ ⟶ Z₁₃} {w₁₃ : Z₁₃ ⟶ X₁⟦(1 : ℤ)⟧} (h₁₃ : Triangle.mk u₁₃ v₁₃ w₁₃ ∈ distTriang C) where
  m₁ : Z₁₂ ⟶ Z₁₃
  m₃ : Z₁₃ ⟶ Z₂₃
  comm₁ : v₁₂ ≫ m₁ = u₂₃ ≫ v₁₃
  comm₂ : m₁ ≫ w₁₃ = w₁₂
  comm₃ : v₁₃ ≫ m₃ = v₂₃
  comm₄ : w₁₃ ≫ u₁₂⟦1⟧' = m₃ ≫ w₂₃
  mem : Triangle.mk m₁ m₃ (w₂₃ ≫ v₁₂⟦1⟧') ∈ distTriang C

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

{comm : CategoryTheory.CategoryStruct.comp u₁₂ u₂₃ = u₁₃}

{v₁₂ : X₂ ⟶ Z₁₂}

{w₁₂ : Z₁₂ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₂ : CategoryTheory.Pretriangulated.Triangle.mk u₁₂ v₁₂ w₁₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₂₃ : X₃ ⟶ Z₂₃}

{w₂₃ : Z₂₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₂}

{h₂₃ : CategoryTheory.Pretriangulated.Triangle.mk u₂₃ v₂₃ w₂₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₁₃ : X₃ ⟶ Z₁₃}

{w₁₃ : Z₁₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₃ : CategoryTheory.Pretriangulated.Triangle.mk u₁₃ v₁₃ w₁₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

(self : CategoryTheory.Triangulated.Octahedron comm h₁₂ h₂₃ h₁₃)

CategoryTheory.CategoryStruct.comp v₁₃ self.m₃ = v₂₃


@[simp, reassoc]
theorem pullbackRestrictIsoRestrict_inv_fst {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    (pullbackRestrictIsoRestrict f U).inv ≫ pullback.fst f _ = (f ⁻¹ᵁ U).ι

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(U : Y.Opens)

(AlgebraicGeometry.pullbackRestrictIsoRestrict f U).inv ≫ CategoryTheory.Limits.pullback.fst f U.ι =
  ((TopologicalSpace.Opens.map f.val.base).obj U).ι


theorem eq_zero_of_mul_eq_zero : ∀ {n m : ℕ}, n * m = 0 → n = 0 ∨ m = 0


/-- A submodule contained in a finite-dimensional submodule is
finite-dimensional. -/
theorem finiteDimensional_of_le {S₁ S₂ : Submodule K V} [FiniteDimensional K S₂] (h : S₁ ≤ S₂) :
    FiniteDimensional K S₁

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{S₁ S₂ : Submodule K V}
[FiniteDimensional K ↥S₂]
(h : S₁ ≤ S₂)


/-- A version of the **Borel-Cantelli lemma**: if `sᵢ` is a sequence of sets such that
`∑ μ sᵢ` exists, then for almost all `x`, `x` does not belong to almost all `sᵢ`. -/
theorem ae_eventually_not_mem {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    ∀ᵐ x ∂μ, ∀ᶠ n in atTop, x ∉ s n

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : ℕ → Set α}
(hs : ∑' (i : ℕ), μ (s i) ≠ ⊤)

∀ᵐ (x : α) ∂μ, ∀ᶠ (n : ℕ) in Filter.atTop, x ∉ s n


@[deprecated map_prod (since := "2024-06-26")]
protected theorem map_prod {ι : Type*} (f : ι → A) (s : Finset ι) :
    φ (∏ x ∈ s, f x) = ∏ x ∈ s, φ (f x)

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[CommSemiring A]
[CommSemiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)
{ι : Type u_1}
(f : ι → A)
(s : Finset ι)


theorem valid_next {p : Pos} (h : p.Valid s) (h₂ : p < s.endPos) : (next s p).Valid s

{s : String}
{p : String.Pos}
(h : String.Pos.Valid s p)
(h₂ : p < s.endPos)


protected theorem zero_mem : (0 : A) ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)


/-- All the `Q q` coincide with `0` in degree 0. -/
@[simp]
theorem Q_f_0_eq (q : ℕ) : ((Q q).f 0 : X _[0] ⟶ X _[0]) = 0

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


theorem eq_single_iff {f : α →₀ M} {a b} : f = single a b ↔ f.support ⊆ {a} ∧ f a = b

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α →₀ M}
{a : α}
{b : M}

f = Finsupp.single a b ↔ f.support ⊆ {a} ∧ f a = b


/-- The fork map in the equalizer diagram we will construct. -/
@[simps]
def CofreeEqualizer.ι : X ⟶ (Comonad.cofree T).obj X.A

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

(CategoryTheory.Comonad.CofreeEqualizer.ι X).f = X.a


theorem isUnit_one_sub_smul_of_lt_inv_radius {a : A} {z : 𝕜} (h : ↑‖z‖₊ < (spectralRadius 𝕜 a)⁻¹) :
    IsUnit (1 - z • a)

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
{a : A}
{z : 𝕜}
(h : ↑‖z‖₊ < (spectralRadius 𝕜 a)⁻¹)


theorem restrict_eq_codRestrict_domRestrict {f : M →ₗ[R] M₁} {p : Submodule R M}
    {q : Submodule R M₁} (hf : ∀ x ∈ p, f x ∈ q) :
    f.restrict hf = (f.domRestrict p).codRestrict q fun x => hf x.1 x.2

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₁]
[Module R M]
[Module R M₁]
{f : M →ₗ[R] M₁}
{p : Submodule R M}
{q : Submodule R M₁}
(hf : ∀ x ∈ p, f x ∈ q)

f.restrict hf = LinearMap.codRestrict q (f.domRestrict p) ⋯


theorem isClosed_diagonal [T2Space X] : IsClosed (diagonal X)

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]


theorem degrees_add_of_disjoint [DecidableEq σ] {p q : MvPolynomial σ R}
    (h : Multiset.Disjoint p.degrees q.degrees) : (p + q).degrees = p.degrees ∪ q.degrees

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
{p q : MvPolynomial σ R}
(h : p.degrees.Disjoint q.degrees)


protected theorem lt_of_lt_of_le : ∀ {x y z : Bool}, x < y → y ≤ z → x < z


{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)


{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(a : α)


/-- The unit for the tensor `X ⊗ Y` in `Dial C`. -/
@[simps] def tensorUnit : Dial C

CategoryTheory.Dial.tensorUnit.tgt = ⊤_ C


theorem fib_two_mul (n : ℕ) : fib (2 * n) = fib n * (2 * fib (n + 1) - fib n)

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


protected theorem Homeomorph.contractibleSpace_iff (e : X ≃ₜ Y) :
    ContractibleSpace X ↔ ContractibleSpace Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)


@[simp]
theorem ofConjAct_inv (x : ConjAct G) : ofConjAct x⁻¹ = (ofConjAct x)⁻¹

{G : Type u_3}
[DivInvMonoid G]
(x : ConjAct G)

ConjAct.ofConjAct x⁻¹ = (ConjAct.ofConjAct x)⁻¹


/--
If `q₁` and `q₂` when restricted to each subcategory `C i` agree, then `q₁` and `q₂` are isomorphic.
-/
@[simps]
def natIso {q₁ q₂ : (Σi, C i) ⥤ D} (h : ∀ i, incl i ⋙ q₁ ≅ incl i ⋙ q₂) : q₁ ≅ q₂

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

{q₁ q₂ : CategoryTheory.Functor ((i : I) × C i) D}

(h : (i : I) → (CategoryTheory.Sigma.incl i).comp q₁ ≅ (CategoryTheory.Sigma.incl i).comp q₂)

(CategoryTheory.Sigma.natIso h).inv = CategoryTheory.Sigma.natTrans fun i => (h i).inv


/-- If `p` lifts and `(r : R)` then `r * p` lifts. -/
theorem base_mul_mem_lifts {p : S[X]} (r : R) (hp : p ∈ lifts f) : C (f r) * p ∈ lifts f

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
{f : R →+* S}
{p : S[X]}
(r : R)
(hp : p ∈ Polynomial.lifts f)

Polynomial.C (f r) * p ∈ Polynomial.lifts f


theorem nnnorm_map [SemilinearIsometryClass 𝓕 σ₁₂ E E₂] (f : 𝓕) (x : E) : ‖f x‖₊ = ‖x‖₊

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
{𝓕 : Type u_10}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
[FunLike 𝓕 E E₂]
[SemilinearIsometryClass 𝓕 σ₁₂ E E₂]
(f : 𝓕)
(x : E)

‖f x‖₊ = ‖x‖₊


theorem rpow_add_one {x : ℝ} (hx : x ≠ 0) (y : ℝ) : x ^ (y + 1) = x ^ y * x


theorem Monic.comp_X_add_C (hp : p.Monic) (r : R) : (p.comp (X + C r)).Monic

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

(p.comp (Polynomial.X + Polynomial.C r)).Monic


@[reassoc (attr := simp)]
theorem invApp_app (U : Opens X) :
    H.invApp U ≫ f.c.app (op (opensFunctor f |>.obj U)) =
      X.presheaf.map (eqToHom (by simp [Opens.map, Set.preimage_image_eq _ H.base_open.inj]))

{X Y : AlgebraicGeometry.SheafedSpace C}

[H : AlgebraicGeometry.SheafedSpace.IsOpenImmersion f]

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

AlgebraicGeometry.SheafedSpace.IsOpenImmersion.invApp f U ≫
    f.c.app (Opposite.op ((AlgebraicGeometry.SheafedSpace.IsOpenImmersion.opensFunctor f).obj U)) =
  X.presheaf.map (CategoryTheory.eqToHom ⋯)


@[simp, norm_cast]
theorem coe_mul (x y : Ico (0 : α) 1) : ↑(x * y) = (x * y : α)

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


theorem ordConnectedSection_subset : ordConnectedSection s ⊆ s

{α : Type u_1}
[LinearOrder α]
{s : Set α}


/-- An auxiliary lemma used twice in the proof of `WithLp.prodPseudoMetricAux` below. Not intended
for use outside this file. -/
theorem prod_sup_edist_ne_top_aux [PseudoMetricSpace α] [PseudoMetricSpace β]
    (f g : WithLp ∞ (α × β)) :
    edist f.fst g.fst ⊔ edist f.snd g.snd ≠ ⊤

{α : Type u_2}
{β : Type u_3}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
(f g : WithLp ⊤ (α × β))


theorem final_of_final_comp [hF : Final F] [hFG : Final (F ⋙ G)] : Final G

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


@[ext]
theorem image.ext [HasImage f] {W : C} {g h : image f ⟶ W} [HasLimit (parallelPair g h)]
    (w : factorThruImage f ≫ g = factorThruImage f ≫ h) : g = h

{g h : CategoryTheory.Limits.image f ⟶ W}

[CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.parallelPair g h)]

(w : CategoryTheory.Limits.factorThruImage f ≫ g = CategoryTheory.Limits.factorThruImage f ≫ h)


theorem truncateFun_nsmul (m : ℕ) (x : 𝕎 R) : truncateFun n (m • x) = m • truncateFun n x

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(n : ℕ)
{R : Type u_1}
[CommRing R]
(m : ℕ)
(x : 𝕎 R)

WittVector.truncateFun n (m • x) = m • WittVector.truncateFun n x


theorem Periodic.neg_nsmul [AddGroup α] (h : Periodic f c) (n : ℕ) : Periodic f (-(n • c))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddGroup α]
(h : Function.Periodic f c)
(n : ℕ)


theorem NoZeroSMulDivisors.trans (R A M : Type*) [CommRing R] [Ring A] [IsDomain A] [Algebra R A]
    [AddCommGroup M] [Module R M] [Module A M] [IsScalarTower R A M] [NoZeroSMulDivisors R A]
    [NoZeroSMulDivisors A M] : NoZeroSMulDivisors R M

(R : Type u_5)
(A : Type u_6)
(M : Type u_7)
[CommRing R]
[Ring A]
[IsDomain A]
[Algebra R A]
[AddCommGroup M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[NoZeroSMulDivisors R A]
[NoZeroSMulDivisors A M]


lemma isWeaklyRegular_map_algebraMap_iff [CommRing R] [CommRing S]
    [Algebra R S] [AddCommGroup M] [Module R M] [Module S M]
    [IsScalarTower R S M] (rs : List R) :
    IsWeaklyRegular M (rs.map (algebraMap R S)) ↔ IsWeaklyRegular M rs

{R : Type u_1}
(S : Type u_2)
(M : Type u_3)
[CommRing R]
[CommRing S]
[Algebra R S]
[AddCommGroup M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(rs : List R)

RingTheory.Sequence.IsWeaklyRegular M (List.map (⇑(algebraMap R S)) rs) ↔ RingTheory.Sequence.IsWeaklyRegular M rs


@[mfld_simps]
theorem refl_restr_source (s : Set α) : ((PartialEquiv.refl α).restr s).source = s


@[to_additive sum_univ_one]
theorem prod_univ_one [CommMonoid β] (f : Fin 1 → β) : ∏ i, f i = f 0

{β : Type u_2}
[AddCommMonoid β]
(f : Fin 1 → β)


lemma inv_pow_sub₀ (ha : a ≠ 0) (h : n ≤ m) : a⁻¹ ^ (m - n) = (a ^ m)⁻¹ * a ^ n

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
{m n : ℕ}
(ha : a ≠ 0)
(h : n ≤ m)


theorem comp_eq_mk (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) :
    comp g hg f = mk (g ∘ f) (hg.comp_aestronglyMeasurable f.aestronglyMeasurable)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[TopologicalSpace γ]
(g : β → γ)
(hg : Continuous g)
(f : α →ₘ[μ] β)

MeasureTheory.AEEqFun.comp g hg f = MeasureTheory.AEEqFun.mk (g ∘ ↑f) ⋯


@[to_additive]
theorem smul_of_tower_def (r : M) (x : s) :
    r • x = ⟨r • x, smul_one_smul N r x.1 ▸ smul_mem _ x.2⟩

{S : Type u'}
{M : Type v}
{N : Type u_1}
{α : Type u_2}
[SetLike S α]
[SMul M N]
[SMul M α]
[Monoid N]
[MulAction N α]
[SMulMemClass S N α]
[IsScalarTower M N α]
(s : S)
(r : M)
(x : ↥s)

r • x = ⟨r • ↑x, ⋯⟩


@[simp, norm_cast] lemma coe_himp (s t : CompactOpens α) : ↑(s ⇨ t) = (s ⇨ t : Set α)

{α : Type u_1}
[TopologicalSpace α]
[CompactSpace α]
[T2Space α]
(s t : TopologicalSpace.CompactOpens α)


theorem measurable_fderiv_apply_const_with_param [MeasurableSpace F] [BorelSpace F]
    (hf : Continuous f.uncurry) (y : E) :
    Measurable (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2 y)

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

Measurable fun p => (fderiv 𝕜 (f p.1) p.2) y


theorem map_roots_le [IsDomain A] [IsDomain B] {p : A[X]} {f : A →+* B} (h : p.map f ≠ 0) :
    p.roots.map f ≤ (p.map f).roots

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[CommRing B]
[IsDomain A]
[IsDomain B]
{p : Polynomial A}
{f : A →+* B}
(h : Polynomial.map f p ≠ 0)

Multiset.map (⇑f) p.roots ≤ (Polynomial.map f p).roots


theorem torsionBySet_isTorsionBySet : IsTorsionBySet R (torsionBySet R M s) s

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(s : Set R)

Module.IsTorsionBySet R (↥(Submodule.torsionBySet R M s)) s


@[reassoc]
lemma comm (h : HomologyMapData φ h₁ h₂) :
    h.left.φH ≫ h₂.iso.hom = h₁.iso.hom ≫ h.right.φH

(h : CategoryTheory.ShortComplex.HomologyMapData φ h₁ h₂)

CategoryTheory.CategoryStruct.comp h.left.φH h₂.iso.hom = CategoryTheory.CategoryStruct.comp h₁.iso.hom h.right.φH


theorem ofBaseChange_comp_toBaseChange (Q : QuadraticForm R V) :
    (ofBaseChange A Q).comp (toBaseChange A Q) = AlgHom.id _ _

{R : Type u_1}
(A : Type u_2)
{V : Type u_3}
[CommRing R]
[CommRing A]
[AddCommGroup V]
[Algebra R A]
[Module R V]
[Invertible 2]
(Q : QuadraticForm R V)

(CliffordAlgebra.ofBaseChange A Q).comp (CliffordAlgebra.toBaseChange A Q) =
  AlgHom.id A (CliffordAlgebra (QuadraticForm.baseChange A Q))


@[to_additive]
theorem inv_def (μ : Measure G) : μ.inv = Measure.map inv μ

{G : Type u_2}
[MeasurableSpace G]
[Neg G]
(μ : MeasureTheory.Measure G)

μ.neg = MeasureTheory.Measure.map Neg.neg μ


theorem ae_eq_set {s t : Set α} : s =ᵐ[μ] t ↔ μ (s \ t) = 0 ∧ μ (t \ s) = 0

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t : Set α}


theorem limsup_congr {α : Type*} [ConditionallyCompleteLattice β] {f : Filter α} {u v : α → β}
    (h : ∀ᶠ a in f, u a = v a) : limsup u f = limsup v f

{β : Type u_2}
{α : Type u_6}
[ConditionallyCompleteLattice β]
{f : Filter α}
{u v : α → β}
(h : ∀ᶠ (a : α) in f, u a = v a)


@[to_additive] lemma mabs_le_mabs_of_le_one (ha : a ≤ 1) (hab : b ≤ a) : |a|ₘ ≤ |b|ₘ

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

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


@[simp]
theorem mk_X_0 : (mk X₀ X₁ X₂ d₀ d₁ s succ).X 0 = X₀

(succ : (S : CategoryTheory.ShortComplex V) → (X₃ : V) ×' (d₂ : X₃ ⟶ S.X₁) ×' d₂ ≫ S.f = 0)

(ChainComplex.mk X₀ X₁ X₂ d₀ d₁ s succ).X 0 = X₀


@[simp]
theorem bot_orthogonal_eq_top : (⊥ : Submodule 𝕜 E)ᗮ = ⊤

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]


lemma succAbove_castPred_of_lt (p i : Fin (n + 1)) (h : i < p)
    (hi := Fin.ne_of_lt $ Nat.lt_of_lt_of_le h p.le_last) : succAbove p (i.castPred hi) = i

{n : ℕ}
(p i : Fin (n + 1))
(h : i < p)
(hi : i ≠ Fin.last n := ⋯)


theorem stmts_trans {M : Λ → Stmt₂} {S : Finset Λ} {q₁ q₂ : Stmt₂} (h₁ : q₁ ∈ stmts₁ q₂) :
    some q₂ ∈ stmts M S → some q₁ ∈ stmts M S

{K : Type u_1}
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
{M : Λ → Turing.TM2.Stmt Γ Λ σ}
{S : Finset Λ}
{q₁ q₂ : Turing.TM2.Stmt Γ Λ σ}
(h₁ : q₁ ∈ Turing.TM2.stmts₁ q₂)

some q₂ ∈ Turing.TM2.stmts M S → some q₁ ∈ Turing.TM2.stmts M S


/-- The parts of a Turán-maximal graph form an equipartition. -/
theorem isEquipartition : h.finpartition.IsEquipartition

{V : Type u_1}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{r : ℕ}
(h : G.IsTuranMaximal r)


lemma term_welldef {n : ℕ} (hn : 0 < n) {s : ℝ} (hs : 0 < s) :
    IntervalIntegrable (fun x : ℝ ↦ (x - n) / x ^ (s + 1)) volume n (n + 1)

IntervalIntegrable (fun x => (x - ↑n) / x ^ (s + 1)) MeasureTheory.volume (↑n) (↑n + 1)


theorem linearIndependent_iff_sum :
    LinearIndependent ℤ (eval C) ↔ LinearIndependent ℤ (SumEval C ho)

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

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

LinearIndependent ℤ (Profinite.NobelingProof.GoodProducts.eval C) ↔
  LinearIndependent ℤ (Profinite.NobelingProof.GoodProducts.SumEval C ho)


@[simp]
theorem neg_bind (f : α → FreeAbelianGroup β) (x : FreeAbelianGroup α) : -x >>= f = -(x >>= f)

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


/-- Given a weakly regular measure, any measurable set of finite mass can be approximated from
inside by closed sets. -/
theorem _root_.MeasurableSet.measure_eq_iSup_isClosed_of_ne_top [WeaklyRegular μ] ⦃A : Set α⦄
    (hA : MeasurableSet A) (h'A : μ A ≠ ∞) : μ A = ⨆ (K) (_ : K ⊆ A) (_ : IsClosed K), μ K

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.WeaklyRegular]
⦃A : Set α⦄
(hA : MeasurableSet A)
(h'A : μ A ≠ ⊤)

μ A = ⨆ K, ⨆ (_ : K ⊆ A), ⨆ (_ : IsClosed K), μ K


theorem mapBiproduct_hom :
    haveI : HasBiproduct fun j => F.obj (f j) := hasBiproduct_of_preserves F f
    (mapBiproduct F f).hom = biproduct.lift fun j => F.map (biproduct.π f j)

(F.mapBiproduct f).hom = CategoryTheory.Limits.biproduct.lift fun j => F.map (CategoryTheory.Limits.biproduct.π f j)


/-- `OrderDual` as a functor. -/
@[simps]
def dual : LinOrd ⥤ LinOrd


@[simp, norm_cast]
theorem ofReal_sinh (x : ℝ) : (Real.sinh x : ℂ) = sinh x


/--
The well-formedness invariant for the bucket array says that every element hashes to its index
(assuming the hash is lawful - otherwise there are no promises about where elements are located).
-/
structure WF [BEq α] [Hashable α] (buckets : Buckets α β) : Prop where
  /-- The elements of a bucket are all distinct according to the `BEq` relation. -/
  distinct [LawfulHashable α] [PartialEquivBEq α] : ∀ bucket ∈ buckets.1.data,
    bucket.toList.Pairwise fun a b => ¬(a.1 == b.1)
  /-- Every element in a bucket should hash to its location. -/
  hash_self (i : Nat) (h : i < buckets.1.size) :
    buckets.1[i].All fun k _ => ((hash k).toUSize % buckets.1.size).toNat = i

{buckets : Batteries.HashMap.Imp.Buckets α β}

bucket ∈ buckets.val.data → List.Pairwise (fun a b => ¬(a.fst == b.fst) = true) bucket.toList


theorem IsStarNormal.spectralRadius_eq_nnnorm (a : A) [IsStarNormal a] :
    spectralRadius ℂ a = ‖a‖₊

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


@[simp, norm_cast]
theorem ofReal_im (r : ℝ) : (r : ℂ).im = 0


theorem commute_cast (x : α) (n : ℕ) : Commute x n

{α : Type u_1}
[NonAssocSemiring α]
(x : α)
(n : ℕ)


@[to_additive (attr := simp)]
theorem mul_one : ∀ a : M, a * 1 = a


lemma exterior_subset_iff_mem_nhdsSet : exterior s ⊆ t ↔ t ∈ 𝓝ˢ s

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


theorem mkRat_eq_iff (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) :
    mkRat n₁ d₁ = mkRat n₂ d₂ ↔ n₁ * d₂ = n₂ * d₁

{d₁ d₂ : Nat}
{n₁ n₂ : Int}
(z₁ : d₁ ≠ 0)
(z₂ : d₂ ≠ 0)

mkRat n₁ d₁ = mkRat n₂ d₂ ↔ n₁ * ↑d₂ = n₂ * ↑d₁


@[to_additive (attr := simp)]
theorem Prime.prod_properDivisors {α : Type*} [CommMonoid α] {p : ℕ} {f : ℕ → α} (h : p.Prime) :
    ∏ x ∈ p.properDivisors, f x = f 1

{α : Type u_1}
[AddCommMonoid α]
{p : ℕ}
{f : ℕ → α}
(h : Nat.Prime p)


theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0


lemma append_rev {m n} {α : Type*} (xs : Fin m → α) (ys : Fin n → α) (i : Fin (m + n)) :
    append xs ys (rev i) = append (ys ∘ rev) (xs ∘ rev) (cast (Nat.add_comm ..) i)

{m n : ℕ}
{α : Type u_1}
(xs : Fin m → α)
(ys : Fin n → α)
(i : Fin (m + n))

Fin.append xs ys i.rev = Fin.append (ys ∘ Fin.rev) (xs ∘ Fin.rev) (Fin.cast ⋯ i)


theorem Group.preimage_smul_set
    {R : Type*} [Group R] (M₁ M₂ : Type*)
    [MulAction R M₁] [MulAction R M₂]
    {F : Type*} [FunLike F M₁ M₂] [MulActionHomClass F R M₁ M₂] (h : F)
    (c : R) (t : Set M₂) :
    h ⁻¹' (c • t) = c • h ⁻¹' t

{R : Type u_8}
[Group R]
(M₁ : Type u_9)
(M₂ : Type u_10)
[MulAction R M₁]
[MulAction R M₂]
{F : Type u_11}
[FunLike F M₁ M₂]
[MulActionHomClass F R M₁ M₂]
(h : F)
(c : R)
(t : Set M₂)


@[simp]
theorem prod_map_fst : (prod p q).map (fst R M M₂) = p

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

Submodule.map (LinearMap.fst R M M₂) (p.prod q) = p


@[symm]
protected theorem symm : a ≡ b [MOD n] → b ≡ a [MOD n]


/-- Structure containing the minimal axioms required to check that an order is a completely
distributive. Do NOT use, except for implementing `CompletelyDistribLattice` via
`CompletelyDistribLattice.ofMinimalAxioms`.

This structure omits the `himp`, `compl`, `sdiff`, `hnot` fields, which can be recovered using
`CompletelyDistribLattice.ofMinimalAxioms`. -/
structure CompletelyDistribLattice.MinimalAxioms (α : Type u) extends CompleteLattice α where
  protected iInf_iSup_eq {ι : Type u} {κ : ι → Type u} (f : ∀ a, κ a → α) :
    (⨅ a, ⨆ b, f a b) = ⨆ g : ∀ a, κ a, ⨅ a, f a (g a)

(self : CompletelyDistribLattice.MinimalAxioms α)


/-- finite = integral + finite type -/
theorem Algebra.finite_iff_isIntegral_and_finiteType :
    Module.Finite R A ↔ Algebra.IsIntegral R A ∧ Algebra.FiniteType R A

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]


theorem IsRelPrime.mul_right_iff : IsRelPrime x (y * z) ↔ IsRelPrime x y ∧ IsRelPrime x z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
[DecompositionMonoid α]


@[simp]
theorem eventually_all {ι : Sort*} [Finite ι] {l} {p : ι → α → Prop} :
    (∀ᶠ x in l, ∀ i, p i x) ↔ ∀ i, ∀ᶠ x in l, p i x

{α : Type u}
{ι : Sort u_2}
[Finite ι]
{l : Filter α}
{p : ι → α → Prop}

(∀ᶠ (x : α) in l, ∀ (i : ι), p i x) ↔ ∀ (i : ι), ∀ᶠ (x : α) in l, p i x


lemma IsRatCondKernelCDFAux.isRatCondKernelCDF (hf : IsRatCondKernelCDFAux f κ ν) [IsFiniteKernel κ]
    [IsFiniteKernel ν] :
    IsRatCondKernelCDF f κ ν

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

ProbabilityTheory.IsRatCondKernelCDF f κ ν


@[simp]
theorem frequently_principal {a : Set α} {p : α → Prop} : (∃ᶠ x in 𝓟 a, p x) ↔ ∃ x ∈ a, p x


/-- A monoid is not a torsion monoid if it has an element of infinite order. -/
@[to_additive (attr := simp) "An additive monoid is not a torsion monoid if it
  has an element of infinite order."]
theorem not_isTorsion_iff : ¬IsTorsion G ↔ ∃ g : G, ¬IsOfFinOrder g

¬Monoid.IsTorsion G ↔ ∃ g, ¬IsOfFinOrder g


/-- Consider a disjoint family of intervals `(x, y)` with `x < y` in a second-countable space.
Then the family is countable.
This is not a straightforward consequence of second-countability as some of these intervals might be
empty (but in fact this can happen only for countably many of them). -/
theorem Set.PairwiseDisjoint.countable_of_Ioo [OrderTopology α] [SecondCountableTopology α]
    {y : α → α} {s : Set α} (h : PairwiseDisjoint s fun x => Ioo x (y x))
    (h' : ∀ x ∈ s, x < y x) : s.Countable

(h : s.PairwiseDisjoint fun x => Set.Ioo x (y x))


@[to_additive]
theorem comap_inf (S T : Subsemigroup N) (f : M →ₙ* N) : (S ⊓ T).comap f = S.comap f ⊓ T.comap f

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

Subsemigroup.comap f (S ⊓ T) = Subsemigroup.comap f S ⊓ Subsemigroup.comap f T


theorem prod_comp_prodMap (f : T →+* R) (g : T →+* S) (f' : R →+* R') (g' : S →+* S') :
    (f'.prodMap g').comp (f.prod g) = (f'.comp f).prod (g'.comp g)

{R : Type u_3}
{R' : Type u_4}
{S : Type u_5}
{S' : Type u_6}
{T : Type u_7}
[NonAssocSemiring R]
[NonAssocSemiring S]
[NonAssocSemiring R']
[NonAssocSemiring S']
[NonAssocSemiring T]
(f : T →+* R)
(g : T →+* S)
(f' : R →+* R')
(g' : S →+* S')


theorem infiniteNeg_add_not_infinite {x y : ℝ*} :
    InfiniteNeg x → ¬Infinite y → InfiniteNeg (x + y)

x.InfiniteNeg → ¬y.Infinite → (x + y).InfiniteNeg


@[simp]
theorem pure_id'_seq (x : F α) : (pure fun x => x) <*> x = x

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

(Seq.seq (pure fun x => x) fun x_1 => x) = x


/-- If `i` is an `F`-algebra homomorphism from `E` to `K`, then the preimage of `perfectClosure F K`
under the map `i` is equal to `perfectClosure F E`. -/
theorem perfectClosure.comap_eq_of_algHom (i : E →ₐ[F] K) :
    (perfectClosure F K).comap i = perfectClosure F E

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
{K : Type w}
[Field K]
[Algebra F K]
(i : E →ₐ[F] K)

IntermediateField.comap i (perfectClosure F K) = perfectClosure F E


theorem mem_support_iff (x : X) (a : FreeAbelianGroup X) : x ∈ a.support ↔ coeff x a ≠ 0

{X : Type u_1}
(x : X)
(a : FreeAbelianGroup X)

x ∈ a.support ↔ (FreeAbelianGroup.coeff x) a ≠ 0


theorem subset_support_tsub : f.support \ g.support ⊆ (f - g).support

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]

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


/-- Induction on the well-founded `Prod.GameAdd` relation.
  Note that it's strictly more general to induct on the lexicographic order instead. -/
theorem GameAdd.induction {C : α → β → Prop} :
    WellFounded rα →
      WellFounded rβ →
        (∀ a₁ b₁, (∀ a₂ b₂, GameAdd rα rβ (a₂, b₂) (a₁, b₁) → C a₂ b₂) → C a₁ b₁) → ∀ a b, C a b

{α : Type u_1}
{β : Type u_2}
{rα : α → α → Prop}
{rβ : β → β → Prop}
{C : α → β → Prop}

WellFounded rα →
  WellFounded rβ →
    (∀ (a₁ : α) (b₁ : β), (∀ (a₂ : α) (b₂ : β), Prod.GameAdd rα rβ (a₂, b₂) (a₁, b₁) → C a₂ b₂) → C a₁ b₁) →
      ∀ (a : α) (b : β), C a b


theorem mem_eigenspace_iff {f : End R M} {μ : R} {x : M} : x ∈ eigenspace f μ ↔ f x = μ • x

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
{x : M}


theorem ContinuousOn.preimage_isClosed_of_isClosed {f : α → β} {s : Set α} {t : Set β}
    (hf : ContinuousOn f s) (hs : IsClosed s) (ht : IsClosed t) : IsClosed (s ∩ f ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{t : Set β}
(hf : ContinuousOn f s)
(hs : IsClosed s)
(ht : IsClosed t)


theorem mod_add_div' (m k : R) : m % k + m / k * k = m

{R : Type u}
[EuclideanDomain R]
(m k : R)


theorem zipWith_zipWith_right (f : α → δ → ε) (g : β → γ → δ) :
    ∀ (la : List α) (lb : List β) (lc : List γ),
      zipWith f la (zipWith g lb lc) = zipWith3 (fun a b c => f a (g b c)) la lb lc

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
{δ : Type u_3}
{ε : Type u_4}
(f : α → δ → ε)
(g : β → γ → δ)
(la : List α)
(lb : List β)
(lc : List γ)

List.zipWith f la (List.zipWith g lb lc) = List.zipWith3 (fun a b c => f a (g b c)) la lb lc


theorem eraseP_map (f : β → α) : ∀ (l : List β), (map f l).eraseP p = map f (l.eraseP (p ∘ f))

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

List.eraseP p (List.map f l) = List.map f (List.eraseP (p ∘ f) l)


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

(F : CategoryTheory.Sheaf (CategoryTheory.regularTopology D) A)

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y), ((e.sheafCongrPreregular A).inverse.obj F).val.map f = F.val.map (e.functor.map f.unop).op


lemma equation_neg_iff (x y : R) : W.Equation x (W.negY x y) ↔ W.Equation x y

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


lemma eq_of_restrictSubtype_eq {N : Matroid α} (hM : M.E = E) (hN : N.E = E)
    (h : M.restrictSubtype E = N.restrictSubtype E) : M = N


@[simp]
lemma support_one [One G] [NeZero (1 : k)] : (1 : MonoidAlgebra k G).support = 1

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[One G]
[NeZero 1]


theorem sum_add {S : Type*} [AddCommMonoid S] (p : R[X]) (f g : ℕ → R → S) :
    (p.sum fun n x => f n x + g n x) = p.sum f + p.sum g

{R : Type u}
[Semiring R]
{S : Type u_1}
[AddCommMonoid S]
(p : R[X])
(f g : ℕ → R → S)


/-- Pull an opposite subgroup back to a subgroup along `MulOpposite.op`-/
@[to_additive (attr := simps)
"Pull an opposite additive subgroup back to an additive subgroup along `AddOpposite.op`"]
protected def unop (H : Subgroup Gᵐᵒᵖ) : Subgroup G

{G : Type u_2}
[Group G]
(H : Subgroup Gᵐᵒᵖ)


theorem Set.mem_maximals_iff_forall_insert {P : Set α → Prop} (hP : ∀ ⦃s t⦄, P t → s ⊆ t → P s) :
    s ∈ maximals (· ⊆ ·) {t | P t} ↔ P s ∧ ∀ x ∉ s, ¬ P (insert x s)

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

s ∈ maximals (fun x x_1 => x ⊆ x_1) {t | P t} ↔ P s ∧ ∀ x ∉ s, ¬P (insert x s)


theorem hasCore_def {f : E →ₗ.[R] F} {S : Submodule R E} (h : f.HasCore S) :
    (f.domRestrict S).closure = f

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing R]
[AddCommGroup E]
[AddCommGroup F]
[Module R E]
[Module R F]
[TopologicalSpace E]
[TopologicalSpace F]
[ContinuousAdd E]
[ContinuousAdd F]
[TopologicalSpace R]
[ContinuousSMul R E]
[ContinuousSMul R F]
{f : E →ₗ.[R] F}
{S : Submodule R E}
(h : f.HasCore S)


@[to_additive]
theorem noncommProd_mem (K : Subgroup G) {ι : Type*} {t : Finset ι} {f : ι → G} (comm) :
    (∀ c ∈ t, f c ∈ K) → t.noncommProd f comm ∈ K

(comm : (↑t).Pairwise fun a b => AddCommute (f a) (f b))

(∀ c ∈ t, f c ∈ K) → t.noncommSum f comm ∈ K


@[simp] theorem bitIndices_sorted {n : ℕ} : n.bitIndices.Sorted (· < ·)

List.Sorted (fun x x_1 => x < x_1) n.bitIndices


lemma measure_univ_eq (hμ : IsProjectiveLimit μ P) (I : Finset ι) :
    μ univ = P I univ

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

{μ : MeasureTheory.Measure ((i : ι) → α i)}

(hμ : MeasureTheory.IsProjectiveLimit μ P)


lemma pairwiseDisjoint_union_diffFinset₀ (hC : IsSetSemiring C) (hs : s ∈ C)
    (hI : ↑I ⊆ C) (h_dis : PairwiseDisjoint (I : Set (Set α)) id) :
    PairwiseDisjoint (I ∪ hC.diffFinset₀ hs hI : Set (Set α)) id

{α : Type u_1}
{C : Set (Set α)}
{s : Set α}
{I : Finset (Set α)}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(hI : ↑I ⊆ C)
(h_dis : (↑I).PairwiseDisjoint id)

(↑I ∪ ↑(hC.diffFinset₀ hs hI)).PairwiseDisjoint id


theorem lowerSemicontinuousAt_biSup {p : ι → Prop} {f : ∀ i, p i → α → δ}
    (h : ∀ i hi, LowerSemicontinuousAt (f i hi) x) :
    LowerSemicontinuousAt (fun x' => ⨆ (i) (hi), f i hi x') x

(h : ∀ (i : ι) (hi : p i), LowerSemicontinuousAt (f i hi) x)

LowerSemicontinuousAt (fun x' => ⨆ i, ⨆ (hi : p i), f i hi x') x


@[simp]
theorem add_im (z w : ℂ) : (z + w).im = z.im + w.im


@[simp]
protected theorem not_lt_bot (a : WithBot α) : ¬a < ⊥


@[simp]
theorem coe_zero : ((0 : A →⋆ₙₐ[R] B) : A → B) = 0

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[StarAddMonoid A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[StarAddMonoid B]


@[ext]
lemma hom_ext {X Y : SimplicialObject C} (f g : X ⟶ Y)
    (h : ∀ (n : SimplexCategoryᵒᵖ), f.app n = g.app n) : f = g

{X Y : CategoryTheory.SimplicialObject C}


/-- Associate a `PartialEquiv` to an `Equiv`. -/
@[simps! (config := mfld_cfg)]
def _root_.Equiv.toPartialEquiv (e : α ≃ β) : PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)


theorem atBot_countable_basis [Nonempty α] [SemilatticeInf α] [Countable α] :
    HasCountableBasis (atBot : Filter α) (fun _ => True) Iic

{α : Type u_3}
[Nonempty α]
[SemilatticeInf α]
[Countable α]

Filter.atBot.HasCountableBasis (fun x => True) Set.Iic


/-- If a space is eventually covered by a countable family of sets, all with cardinality at
most `a`, then the cardinality of the space is also bounded by `a`. -/
lemma mk_le_of_countable_eventually_mem {α : Type u} {ι : Type v} {a : Cardinal}
    [Countable ι] {f : ι → Set α} {l : Filter ι} [NeBot l] (ht : ∀ x, ∀ᶠ i in l, x ∈ f i)
    (h'f : ∀ i, #(f i) ≤ a) : #α ≤ a

(ht : ∀ (x : α), ∀ᶠ (i : ι) in l, x ∈ f i)


/-- Given a cartesian morphism `φ : a ⟶ b` lying over `f : R ⟶ S` in `𝒳`, and another morphism
`φ' : a' ⟶ b` which also lifts `f`. Then any morphism `ψ : a' ⟶ a` lifting `𝟙 R` such that
`g ≫ ψ = φ'` must equal the map induced from the universal property of `φ`. -/
lemma map_uniq (ψ : a' ⟶ a) [IsHomLift p (𝟙 R) ψ] (hψ : ψ ≫ φ = φ') :
    ψ = IsCartesian.map p f φ φ'

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
[CategoryTheory.Category.{v₂, u₂} 𝒳]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
[p.IsCartesian f φ]
{a' : 𝒳}
(φ' : a' ⟶ b)
[p.IsHomLift f φ']
(ψ : a' ⟶ a)
[p.IsHomLift (𝟙 R) ψ]
(hψ : ψ ≫ φ = φ')

ψ = CategoryTheory.Functor.IsCartesian.map p f φ φ'


theorem HasMFDerivAt.continuousAt (h : HasMFDerivAt I I' f x f') : ContinuousAt f x

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


protected theorem map_sub : D (a - b) = D a - D b

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(D : LieDerivation R L M)
(a b : L)


@[to_additive (attr := simp)]
theorem singletonMulHom_apply (a : α) : singletonMulHom a = {a}

{α : Type u_2}
[DecidableEq α]
[Mul α]
(a : α)


lemma IsHamiltonianCycle.count_support_self (hp : p.IsHamiltonianCycle) :
    p.support.count a = 2

{α : Type u_1}
[DecidableEq α]
{G : SimpleGraph α}
{a : α}
{p : G.Walk a a}
(hp : p.IsHamiltonianCycle)


@[simp]
theorem one_le_blocks {i : ℕ} (h : i ∈ c.blocks) : 1 ≤ i

{n : ℕ}
(c : Composition n)
{i : ℕ}
(h : i ∈ c.blocks)


theorem map_adjoin (φ : A →ₐ[R] B) (s : Set A) : (adjoin R s).map φ = adjoin R (φ '' s)

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)
(s : Set A)

Subalgebra.map φ (Algebra.adjoin R s) = Algebra.adjoin R (⇑φ '' s)


theorem openEmbedding_inl : OpenEmbedding (@inl X Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


theorem card_typein_out_lt (c : Cardinal) (x : c.ord.out.α) :
    card (@typein _ (· < ·) (isWellOrder_out_lt _) x) < c

(c : Cardinal.{u_3})
(x : (Quotient.out c.ord).α)

(Ordinal.typein (fun x x_1 => x < x_1) x).card < c


@[to_additive]
theorem IsOpen.mul_left : IsOpen t → IsOpen (s * t)

{α : Type u}
[TopologicalSpace α]
[AddGroup α]
[ContinuousConstVAdd α α]
{s t : Set α}


@[simp]
lemma bnot_comp_isNone : (! ·) ∘ @Option.isNone α = Option.isSome

(fun x => !x) ∘ Option.isNone = Option.isSome


/-- Whiskering by an equivalence gives an equivalence between categories of cones.
-/
@[simps]
def whiskeringEquivalence (e : K ≌ J) : Cone F ≌ Cone (e.functor ⋙ F)

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

(CategoryTheory.Limits.Cones.whiskeringEquivalence e).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun s =>
      CategoryTheory.Limits.Cones.ext
        (CategoryTheory.Iso.refl
          (((CategoryTheory.Limits.Cones.whiskering e.inverse ⋙
                    CategoryTheory.Limits.Cones.postcompose (e.invFunIdAssoc F).hom) ⋙
                  CategoryTheory.Limits.Cones.whiskering e.functor).obj
              s).pt)
        ⋯)
    ⋯


@[simp]
theorem toNatLinearEquiv_trans (e₂ : M₂ ≃+ M₃) :
    e.toNatLinearEquiv.trans e₂.toNatLinearEquiv = (e.trans e₂).toNatLinearEquiv

{M : Type u_8}
{M₂ : Type u_10}
{M₃ : Type u_11}
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
(e : M ≃+ M₂)
(e₂ : M₂ ≃+ M₃)

e.toNatLinearEquiv ≪≫ₗ e₂.toNatLinearEquiv = (e.trans e₂).toNatLinearEquiv


theorem isGLB_mem [LinearOrder α] {i : α} (s : Finset α) (his : IsGLB (s : Set α) i)
    (hs : s.Nonempty) : i ∈ s

{α : Type u_2}
[LinearOrder α]
{i : α}
(s : Finset α)
(his : IsGLB (↑s) i)
(hs : s.Nonempty)


theorem le_limsup_of_frequently_le' {α β} [CompleteLattice β] {f : Filter α} {u : α → β} {x : β}
    (h : ∃ᶠ a in f, x ≤ u a) : x ≤ limsup u f

{α : Type u_6}
{β : Type u_7}
[CompleteLattice β]
{f : Filter α}
{u : α → β}
{x : β}
(h : ∃ᶠ (a : α) in f, x ≤ u a)


lemma neg_of_smul_neg_right' [PosSMulMono α β] (h : a • b < 0) (hb : 0 ≤ b) : a < 0

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[LinearOrder α]
[LinearOrder β]
[PosSMulMono α β]
(h : a • b < 0)
(hb : 0 ≤ b)


theorem c_mul_pf [Mul α] (p : b = c) (a : α) : a * b = a * c

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


theorem coeff_hermite_of_lt {n k : ℕ} (hnk : n < k) : coeff (hermite n) k = 0


@[simp]
theorem mul_apply (n : ℕ) (f g : AdicCauchySequence I R) : (f * g) n = f n * g n

(f g : AdicCompletion.AdicCauchySequence I R)


theorem roots_ne_zero_of_splits' {f : K[X]} (hs : Splits i f) (hf0 : natDegree (f.map i) ≠ 0) :
    (f.map i).roots ≠ 0

(hf0 : (Polynomial.map i f).natDegree ≠ 0)


theorem nadd_succ : a ♯ succ b = succ (a ♯ b)


theorem mem_lowerBounds_image_self (Hf : MonotoneOn f t) :
    a ∈ lowerBounds t → a ∈ t → f a ∈ lowerBounds (f '' t)

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


theorem UpperSemicontinuousAt.comp_continuousAt {f : α → β} {g : ι → α} {x : ι}
    (hf : UpperSemicontinuousAt f (g x)) (hg : ContinuousAt g x) :
    UpperSemicontinuousAt (fun x ↦ f (g x)) x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{ι : Type u_5}
[TopologicalSpace ι]
{f : α → β}
{g : ι → α}
{x : ι}
(hf : UpperSemicontinuousAt f (g x))
(hg : ContinuousAt g x)

UpperSemicontinuousAt (fun x => f (g x)) x


@[to_additive]
theorem setLIntegral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) (t : Set α) :
    ∫⁻ x in t, f x ∂μ = ∑' g : G, ∫⁻ x in g • t ∩ s, f (g⁻¹ • x) ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

(f : α → ℝ≥0∞)

∫⁻ (x : α) in t, f x ∂μ = ∑' (g : G), ∫⁻ (x : α) in g • t ∩ s, f (g⁻¹ • x) ∂μ


theorem isLittleO_one_exp_comp {f : α → ℝ} :
    ((fun _ => 1 : α → ℝ) =o[l] fun x => exp (f x)) ↔ Tendsto f l atTop

{α : Type u_1}
{l : Filter α}
{f : α → ℝ}

((fun x => 1) =o[l] fun x => Real.exp (f x)) ↔ Filter.Tendsto f l Filter.atTop


@[simp]
theorem id_comp (f : A →ₑ+[φ] B) : comp (DistribMulActionHom.id N) f = f

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
(f : A →ₑ+[φ] B)


/-- If `s` is a set in a space `X` with second countable topology and `f : X → Y` is Hölder
continuous in a neighborhood within `s` of every point `x ∈ s` with the same positive exponent `r`
but possibly different coefficients, then the Hausdorff dimension of the image `f '' s` is at most
the Hausdorff dimension of `s` divided by `r`. -/
theorem dimH_image_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ≥0} {f : X → Y}
    (hr : 0 < r) {s : Set X} (hf : ∀ x ∈ s, ∃ C : ℝ≥0, ∃ t ∈ 𝓝[s] x, HolderOnWith C r f t) :
    dimH (f '' s) ≤ dimH s / r

(hf : ∀ x ∈ s, ∃ C, ∃ t ∈ 𝓝[s] x, HolderOnWith C r f t)


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

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


@[simp]
theorem withDensity_one : μ.withDensity 1 = μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


theorem UniformContinuous.continuous [UniformSpace α] [UniformSpace β] {f : α → β}
    (hf : UniformContinuous f) : Continuous f

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]
{f : α → β}
(hf : UniformContinuous f)


theorem IsCycle.eq_swap_of_apply_apply_eq_self {α : Type*} [DecidableEq α] {f : Perm α}
    (hf : IsCycle f) {x : α} (hfx : f x ≠ x) (hffx : f (f x) = x) : f = swap x (f x)

{α : Type u_4}
[DecidableEq α]
{f : Equiv.Perm α}
(hf : f.IsCycle)
{x : α}
(hfx : f x ≠ x)
(hffx : f (f x) = x)


/-- Alias for `Or.inl`. -/
theorem Or.intro_left (b : Prop) (h : a) : Or a b


theorem radius_le_radius_continuousLinearMap_comp (p : FormalMultilinearSeries 𝕜 E F)
    (f : F →L[𝕜] G) : p.radius ≤ (f.compFormalMultilinearSeries p).radius

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


protected theorem lt_of_sub_lt_sub_right {a b c : Int} (h : a - c < b - c) : a < b


@[simp, norm_cast] lemma coe_inf (f g : α →ᵇ β) : ⇑(f ⊓ g) = ⇑f ⊓ ⇑g

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


/-- The cosine of the oriented angle at `p` between two points not equal to `p` equals that of the
unoriented angle. -/
theorem cos_oangle_eq_cos_angle {p p₁ p₂ : P} (hp₁ : p₁ ≠ p) (hp₂ : p₂ ≠ p) :
    Real.Angle.cos (∡ p₁ p p₂) = Real.cos (∠ p₁ p p₂)

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


@[to_additive (attr := simp)]
theorem fst_prod_snd : (fst : M ∗ N →* M).prod snd = toProd

{M : Type u_1}
{N : Type u_2}
[AddMonoid M]
[AddMonoid N]

AddMonoid.Coprod.fst.prod AddMonoid.Coprod.snd = AddMonoid.Coprod.toSum


@[simp]
theorem finsuppProdLEquiv_apply {α β R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M]
    (f : α × β →₀ M) (x y) : finsuppProdLEquiv R f x y = f (x, y)

{α : Type u_7}
{β : Type u_8}
{R : Type u_9}
{M : Type u_10}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : α × β →₀ M)
(x : α)
(y : β)

(((Finsupp.finsuppProdLEquiv R) f) x) y = f (x, y)


/-- If `π : Y ⟶ Z` is an equalizer for `(f, g)`, and `U ⊆ Y` such that `f ⁻¹' U = g ⁻¹' U`,
then `π ⁻¹' (π '' U) = U`.
-/
theorem coequalizer_preimage_image_eq_of_preimage_eq (π : Y ⟶ Z) (e : f ≫ π = g ≫ π)
    (h : IsColimit (Cofork.ofπ π e)) (U : Set Y) (H : f ⁻¹' U = g ⁻¹' U) : π ⁻¹' (π '' U) = U

(h : CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.Cofork.ofπ π e))


@[simp, reassoc]
theorem comp_p_d : f.f.f n ≫ Q.p.f n = f.f.f n

{P Q : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C c)}

CategoryTheory.CategoryStruct.comp (f.f.f n) (Q.p.f n) = f.f.f n


theorem aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim {α β} {m m0 m0' : MeasurableSpace α}
    [TopologicalSpace β] (hm0 : m0 ≤ m0') {μ : Measure α} {f : α → β}
    (hf : AEStronglyMeasurable' m f (μ.trim hm0)) : AEStronglyMeasurable' m f μ

(hf : MeasureTheory.AEStronglyMeasurable' m f (μ.trim hm0))

MeasureTheory.AEStronglyMeasurable' m f μ


theorem lipschitz_infDist_set (x : α) : LipschitzWith 1 fun s : NonemptyCompacts α => infDist x s

LipschitzWith 1 fun s => Metric.infDist x ↑s


@[simp] lemma GradedRing.coe_projZeroRingHom'_apply (a : A) :
    (GradedRing.projZeroRingHom' 𝒜 a : A) = GradedRing.projZeroRingHom 𝒜 a

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[Semiring A]
[DecidableEq ι]
[CanonicallyOrderedAddCommMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(a : A)

↑((GradedRing.projZeroRingHom' 𝒜) a) = (GradedRing.projZeroRingHom 𝒜) a


@[simp]
theorem Fintype.card_prod (α β : Type*) [Fintype α] [Fintype β] :
    Fintype.card (α × β) = Fintype.card α * Fintype.card β

(α : Type u_4)
(β : Type u_5)
[Fintype α]
[Fintype β]


theorem image_coe_Ico : (some : α → WithBot α) '' Ico a b = Ico (a : WithBot α) b

WithBot.some '' Set.Ico a b = Set.Ico ↑a ↑b


theorem smul_apply [Zero M] [SMulZeroClass R M] (b : R) (v : α →₀ M) (a : α) :
    (b • v) a = b • v a

{α : Type u_1}
{M : Type u_5}
{R : Type u_11}
[Zero M]
[SMulZeroClass R M]
(b : R)
(v : α →₀ M)
(a : α)


theorem head_terminates_of_mem {s : WSeq α} {a} (h : a ∈ s) : Terminates (head s)

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


theorem lift'_le {f : Filter α} {g : Set α → Set β} {h : Filter β} {s : Set α} (hs : s ∈ f)
    (hg : 𝓟 (g s) ≤ h) : f.lift' g ≤ h

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Set α → Set β}
{h : Filter β}
{s : Set α}
(hs : s ∈ f)
(hg : 𝓟 (g s) ≤ h)


theorem mul_int (h : Irrational x) {m : ℤ} (hm : m ≠ 0) : Irrational (x * m)

{x : ℝ}
(h : Irrational x)
{m : ℤ}
(hm : m ≠ 0)


theorem Set.Subsingleton.continuousOn {s : Set α} (hs : s.Subsingleton) (f : α → β) :
    ContinuousOn f s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{s : Set α}
(hs : s.Subsingleton)
(f : α → β)


@[simp]
theorem adjugate_fin_zero (A : Matrix (Fin 0) (Fin 0) α) : adjugate A = 0

{α : Type w}
[CommRing α]
(A : Matrix (Fin 0) (Fin 0) α)


theorem iSup_union {f : α → β} {s t : Finset α} :
    ⨆ x ∈ s ∪ t, f x = (⨆ x ∈ s, f x) ⊔ ⨆ x ∈ t, f x

{α : Type u_2}
{β : Type u_3}
[CompleteLattice β]
[DecidableEq α]
{f : α → β}
{s t : Finset α}


theorem asSubtype_eq_of_mem {f : α →. β} {x : α} {y : β} (fxy : y ∈ f x) (domx : x ∈ f.Dom) :
    f.asSubtype ⟨x, domx⟩ = y

{α : Type u_1}
{β : Type u_2}
{f : α →. β}
{x : α}
{y : β}
(fxy : y ∈ f x)
(domx : x ∈ f.Dom)


theorem coe_injective : @Function.Injective (LieDerivation R L M) (L → M) DFunLike.coe

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]


theorem Continuous.uncurry_left {f : X → Y → Z} (x : X) (h : Continuous (uncurry f)) :
    Continuous (f x)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Y → Z}
(x : X)
(h : Continuous (Function.uncurry f))


protected theorem HasBasis.mem_of_superset (hl : l.HasBasis p s) (hi : p i) (ht : s i ⊆ t) :
    t ∈ l

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
{t : Set α}
{i : ι}
(hl : l.HasBasis p s)
(hi : p i)
(ht : s i ⊆ t)


@[simp] theorem mul_fmod_right (a b : Int) : (a * b).fmod a = 0


lemma even_iff_not_odd : Even n ↔ ¬Odd n


@[simp]
theorem sheafificationWhiskerRightIso_hom_app :
    (J.sheafificationWhiskerRightIso F).hom.app P = (J.sheafifyCompIso F P).hom

(J : CategoryTheory.GrothendieckTopology C)

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

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

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) D]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) E]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ E]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]

[(X : C) →
    (W : J.Cover X) →
      (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan F]


protected theorem directed (s : Ideal P) : DirectedOn (· ≤ ·) (s : Set P)

{P : Type u_1}
[LE P]
(s : Order.Ideal P)


theorem eq_one_of_mul_eq_self_right {a b : Int} (Hpos : b ≠ 0) (H : b * a = b) : a = 1


theorem of_decide_false {p : Prop} [Decidable p] : decide p = false → ¬p


theorem balancedSz_down {l r₁ r₂ : ℕ} (h₁ : r₁ ≤ r₂) (h₂ : l + r₂ ≤ 1 ∨ l ≤ delta * r₁)
    (H : BalancedSz l r₂) : BalancedSz l r₁

(h₂ : l + r₂ ≤ 1 ∨ l ≤ Ordnode.delta * r₁)


lemma normal_iff_forall_map_le' : Normal F K ↔ ∀ σ : L ≃ₐ[F] L, K.map ↑σ ≤ K

{F : Type u_1}
{L : Type u_3}
[Field F]
[Field L]
[Algebra F L]
[Normal F L]
{K : IntermediateField F L}

Normal F ↥K ↔ ∀ (σ : L ≃ₐ[F] L), IntermediateField.map (↑σ) K ≤ K


lemma W_iff {P₁ P₂ : Cᵒᵖ ⥤ A} (f : P₁ ⟶ P₂) :
    J.W f ↔ IsIso ((presheafToSheaf J A).map f)

J.W f ↔ CategoryTheory.IsIso ((CategoryTheory.presheafToSheaf J A).map f)


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

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


@[simp] lemma odd_add_one_self : Odd (a + 1 + a)


theorem exists_quotient_mk'_sigma_mk'_eq {α : Type*} [Finite α] (x : α → DirectLimit G f) :
    ∃ (i : ι) (y : α → G i), x = fun a => ⟦.mk f i (y a)⟧

[DirectedSystem G fun i j h => ⇑(f i j h)]

(x : α → FirstOrder.Language.DirectLimit G f)

∃ i y, x = fun a => ⟦FirstOrder.Language.Structure.Sigma.mk f i (y a)⟧


lemma preΨ_even (m : ℕ) : W.preΨ (2 * (m + 3)) =
    W.preΨ (m + 2) ^ 2 * W.preΨ (m + 3) * W.preΨ (m + 5) -
      W.preΨ (m + 1) * W.preΨ (m + 3) * W.preΨ (m + 4) ^ 2

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

W.preΨ (2 * (↑m + 3)) =
  W.preΨ (↑m + 2) ^ 2 * W.preΨ (↑m + 3) * W.preΨ (↑m + 5) - W.preΨ (↑m + 1) * W.preΨ (↑m + 3) * W.preΨ (↑m + 4) ^ 2


theorem monotone_powerset : Monotone (powerset : Set α → Set (Set α))


/-- The handshaking lemma.  See also `SimpleGraph.sum_degrees_eq_twice_card_edges`. -/
theorem even_card_odd_degree_vertices [Fintype V] [DecidableRel G.Adj] :
    Even (univ.filter fun v => Odd (G.degree v)).card

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

Even (Finset.filter (fun v => Odd (G.degree v)) Finset.univ).card


protected theorem zsmul {S : Type*} [AddGroup S] [Mul S] (t : RingCon S)
    (z : ℤ) {x y : S} (hx : t x y) : t (z • x) (z • y)

{S : Type u_3}
[AddGroup S]
[Mul S]
(t : RingCon S)
(z : ℤ)
{x y : S}
(hx : t x y)


theorem unique_uniformity_of_compact [t : TopologicalSpace γ] [CompactSpace γ]
    {u u' : UniformSpace γ} (h : u.toTopologicalSpace = t) (h' : u'.toTopologicalSpace = t) :
    u = u'

(h : UniformSpace.toTopologicalSpace = t)

(h' : UniformSpace.toTopologicalSpace = t)


theorem map_spanNorm (I : Ideal S) {T : Type*} [CommRing T] (f : R →+* T) :
    map f (spanNorm R I) = span (f ∘ Algebra.norm R '' (I : Set S))

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
(I : Ideal S)
{T : Type u_3}
[CommRing T]
(f : R →+* T)

Ideal.map f (Ideal.spanNorm R I) = Ideal.span (⇑f ∘ ⇑(Algebra.norm R) '' ↑I)


@[simp]
theorem eval_C : (C a).eval x = a

{R : Type u}
{a : R}
[Semiring R]
{x : R}


theorem IsClosed.mem_iff_closure_subset (hs : IsClosed s) :
    x ∈ s ↔ closure ({x} : Set X) ⊆ s

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]
(hs : IsClosed s)


theorem three_le {α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y

{α : Type u_1}
(h : 3 ≤ Cardinal.mk α)
(x y : α)


@[simp]
theorem coe_apply {x y : ZFSet.{u}} : (y : Class.{u}) x ↔ x ∈ y


theorem LocallyFinite.smul_left [Zero R] [Zero M] [SMulWithZero R M]
    {s : ι → X → R} (h : LocallyFinite fun i ↦ support <| s i) (f : ι → X → M) :
    LocallyFinite fun i ↦ support <| s i • f i

(h : LocallyFinite fun i => Function.support (s i))

LocallyFinite fun i => Function.support (s i • f i)


/-- A more bundled version of `AffineEquiv.constVAdd`. -/
@[simps]
def constVAddHom : Multiplicative V₁ →* P₁ ≃ᵃ[k] P₁

(k : Type u_1)
(P₁ : Type u_2)
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(v : Multiplicative V₁)

(AffineEquiv.constVAddHom k P₁) v = AffineEquiv.constVAdd k P₁ (Multiplicative.toAdd v)


/-- If a category has wide pullbacks on a higher universe level it also has wide pullbacks
on a lower universe level. -/
theorem hasWidePullbacks_shrink [HasWidePullbacks.{max w w'} C] : HasWidePullbacks.{w} C


@[simp]
theorem projKerOfRightInverse_apply_idem [TopologicalAddGroup M] (f₁ : M →SL[σ₁₂] M₂)
    (f₂ : M₂ →SL[σ₂₁] M) (h : Function.RightInverse f₂ f₁) (x : LinearMap.ker f₁) :
    f₁.projKerOfRightInverse f₂ h x = x

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[TopologicalAddGroup M]
(f₁ : M →SL[σ₁₂] M₂)
(f₂ : M₂ →SL[σ₂₁] M)
(h : Function.RightInverse ⇑f₂ ⇑f₁)
(x : ↥(LinearMap.ker f₁))


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

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


@[simp]
theorem fmap_eq_image (f : α → β) : f <$> s = f '' s


/-- A fraction is equal to its expansion by a factor from `S`. -/
@[to_additive "A difference is equal to its expansion by a summand from `S`."]
protected theorem expand' (r : X) (s s' : S) : r /ₒ s = s' • r /ₒ (s' * s)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[MulAction R X]
(r : X)
(s s' : ↥S)


@[to_additive]
theorem lt_mul_of_one_lt_of_le [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c : α} (ha : 1 < a)
    (hbc : b ≤ c) :
    b < a * c

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


/-- The rank of the composition of two maps is less than the minimum of their ranks.

See `lift_rank_comp_le` for the universe-polymorphic version. -/
theorem rank_comp_le (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) :
    rank (f.comp g) ≤ min (rank f) (rank g)

{K : Type u}
{V : Type v}
{V' V'₁ : Type v'}
[Ring K]
[AddCommGroup V]
[Module K V]
[AddCommGroup V']
[Module K V']
[AddCommGroup V'₁]
[Module K V'₁]
(g : V →ₗ[K] V')
(f : V' →ₗ[K] V'₁)


/-- `QuotientMap.lift` as an equivalence. -/
@[simps]
noncomputable def liftEquiv : { g : C(X, Z) // Function.FactorsThrough g f} ≃ C(Y, Z)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : C(X, Y)}
(hf : QuotientMap ⇑f)
(g : C(Y, Z))


theorem eventually_iff_exists_mem {p : α → Prop} {f : Filter α} :
    (∀ᶠ x in f, p x) ↔ ∃ v ∈ f, ∀ y ∈ v, p y

{α : Type u}
{p : α → Prop}
{f : Filter α}

(∀ᶠ (x : α) in f, p x) ↔ ∃ v ∈ f, ∀ y ∈ v, p y


@[simp]
theorem blockDiagonal'_apply_eq (M : ∀ i, Matrix (m' i) (n' i) α) (k i j) :
    blockDiagonal' M ⟨k, i⟩ ⟨k, j⟩ = M k i j

{o : Type u_4}
{m' : o → Type u_7}
{n' : o → Type u_8}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : (i : o) → Matrix (m' i) (n' i) α)
(k : o)
(i : m' k)
(j : n' k)

Matrix.blockDiagonal' M ⟨k, i⟩ ⟨k, j⟩ = M k i j


@[to_additive (attr := simp)]
theorem empty_mul : ∅ * s = ∅


/-- The Legendre symbol `legendreSym p a = 1` if there is a solution in `ℤ/pℤ`
of the equation `x^2 - a*y^2 = 0` with `y ≠ 0`. -/
theorem eq_one_of_sq_sub_mul_sq_eq_zero {p : ℕ} [Fact p.Prime] {a : ℤ} (ha : (a : ZMod p) ≠ 0)
    {x y : ZMod p} (hy : y ≠ 0) (hxy : x ^ 2 - a * y ^ 2 = 0) : legendreSym p a = 1

{p : ℕ}
[Fact (Nat.Prime p)]
{a : ℤ}
(ha : ↑a ≠ 0)
{x y : ZMod p}
(hy : y ≠ 0)
(hxy : x ^ 2 - ↑a * y ^ 2 = 0)


@[simp]
lemma CategoryTheory.LocallyDiscrete.eqToHom_toLoc {C : Type u} [Category.{v} C] {a b : C}
    (h : a = b) : (eqToHom h).toLoc = eqToHom (congrArg LocallyDiscrete.mk h)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{a b : C}
(h : a = b)

(CategoryTheory.eqToHom h).toLoc = CategoryTheory.eqToHom ⋯


/-- Makes a group homomorphism from a proof that the map preserves multiplication. -/
@[to_additive (attr := simps (config := .asFn))
  "Makes an additive group homomorphism from a proof that the map preserves addition."]
def mk' (f : M → G) (map_mul : ∀ a b : M, f (a * b) = f a * f b) : M →* G

(map_mul : ∀ (a b : M), f (a + b) = f a + f b)


@[to_additive]
theorem inf_subgroupOf_inf_normal_of_left {A' A : Subgroup G} (B : Subgroup G) (hA : A' ≤ A)
    [hN : (A'.subgroupOf A).Normal] : ((A' ⊓ B).subgroupOf (A ⊓ B)).Normal

{G : Type u_1}
[AddGroup G]
{A' A : AddSubgroup G}
(B : AddSubgroup G)
(hA : A' ≤ A)
[hN : (A'.addSubgroupOf A).Normal]


protected theorem oldMapIdxCore_eq (l : List α) (f : ℕ → α → β) (n : ℕ) :
    l.oldMapIdxCore f n = l.oldMapIdx fun i a ↦ f (i + n) a

{α : Type u}
{β : Type v}
(l : List α)
(f : ℕ → α → β)
(n : ℕ)

List.oldMapIdxCore f n l = List.oldMapIdx (fun i a => f (i + n) a) l


/-- Implementation of `CommMon_.equivLaxBraidedFunctorPUnit`. -/
@[simps!]
def counitIso : commMonToLaxBraided C ⋙ laxBraidedToCommMon C ≅ 𝟭 (CommMon_ C)

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

((CommMon_.EquivLaxBraidedFunctorPUnit.counitIso C).inv.app X).hom = 𝟙 X.X


@[simp]
theorem natCast_kronecker_natCast [NonAssocSemiring α] [DecidableEq m] [DecidableEq n] (a b : ℕ) :
    (a : Matrix m m α) ⊗ₖ (b : Matrix n n α) = ↑(a * b)

{α : Type u_2}
{m : Type u_9}
{n : Type u_10}
[NonAssocSemiring α]
[DecidableEq m]
[DecidableEq n]
(a b : ℕ)

Matrix.kroneckerMap (fun x x_1 => x * x_1) ↑a ↑b = ↑(a * b)


theorem preimage_closedBall (x : ℤ) (r : ℝ) : (↑) ⁻¹' closedBall (x : ℝ) r = closedBall x r

Int.cast ⁻¹' Metric.closedBall (↑x) r = Metric.closedBall x r


theorem inf_iff_and {r s : Setoid α} {x y} : (r ⊓ s).Rel x y ↔ r.Rel x y ∧ s.Rel x y

{α : Type u_1}
{r s : Setoid α}
{x y : α}


@[simp]
theorem coe_one : ⇑(1 : Poly α) = const 1


theorem ae_le_set_pi {I : Set ι} {s t : ∀ i, Set (α i)} (h : ∀ i ∈ I, s i ≤ᵐ[μ i] t i) :
    Set.pi I s ≤ᵐ[Measure.pi μ] Set.pi I t

{μ : (i : ι) → MeasureTheory.Measure (α i)}

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

I.pi s ≤ᵐ[MeasureTheory.Measure.pi μ] I.pi t


@[simp]
theorem selfZPow_zero : selfZPow x B 0 = 1

{R : Type u_1}
[CommRing R]
(x : R)
(B : Type u_2)
[CommRing B]
[Algebra R B]
[IsLocalization.Away x B]


/-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal
`I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`.

See <https://stacks.math.columbia.edu/tag/00UQ> -/
@[mk_iff]
class FormallyEtale : Prop where
  comp_bijective :
    ∀ ⦃B : Type u⦄ [CommRing B],
      ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
        Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
[self : Algebra.FormallyEtale R A]
⦃B : Type u⦄
[CommRing B]
[Algebra R B]
(I : Ideal B)

I ^ 2 = ⊥ → Function.Bijective (Ideal.Quotient.mkₐ R I).comp


@[simp, norm_cast]
theorem coe_image : ↑(s.image f) = f '' ↑s

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
{s : Finset α}


theorem comap_inf_map_of_injective (S T : L.Substructure M) : (S.map f ⊓ T.map f).comap f = S ⊓ T

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Injective ⇑f)
(S T : L.Substructure M)

FirstOrder.Language.Substructure.comap f
    (FirstOrder.Language.Substructure.map f S ⊓ FirstOrder.Language.Substructure.map f T) =
  S ⊓ T


@[simp]
theorem coe_comap (f : C(X, Y)) (g : LocallyConstant Y Z) :
    (comap f g) = g ∘ f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : C(X, Y))
(g : LocallyConstant Y Z)


theorem indepSet_iff_measure_inter_eq_mul {_m0 : MeasurableSpace Ω} (hs_meas : MeasurableSet s)
    (ht_meas : MeasurableSet t) (κ : Kernel α Ω) (μ : Measure α)
    [IsMarkovKernel κ] :
    IndepSet s t κ μ ↔ ∀ᵐ a ∂μ, κ a (s ∩ t) = κ a s * κ a t

{α : Type u_1}
{Ω : Type u_2}
{_mα : MeasurableSpace α}
{s t : Set Ω}
{_m0 : MeasurableSpace Ω}
(hs_meas : MeasurableSet s)
(ht_meas : MeasurableSet t)
(κ : ProbabilityTheory.Kernel α Ω)
(μ : MeasureTheory.Measure α)
[ProbabilityTheory.IsMarkovKernel κ]

ProbabilityTheory.Kernel.IndepSet s t κ μ ↔ ∀ᵐ (a : α) ∂μ, (κ a) (s ∩ t) = (κ a) s * (κ a) t


@[simp]
theorem closure_singleton [T1Space X] {x : X} : closure ({x} : Set X) = {x}

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{x : X}


/-- The function `f x / g x` is discontinuous when `g x = 0`. However, under appropriate
conditions, `h x (f x / g x)` is still continuous.  The condition is that if `g a = 0` then `h x y`
must tend to `h a 0` when `x` tends to `a`, with no information about `y`. This is represented by
the `⊤` filter.  Note: `tendsto_prod_top_iff` characterizes this convergence in uniform spaces.  See
also `Filter.prod_top` and `Filter.mem_prod_top`. -/
theorem ContinuousAt.comp_div_cases {f g : α → G₀} (h : α → G₀ → β) (hf : ContinuousAt f a)
    (hg : ContinuousAt g a) (hh : g a ≠ 0 → ContinuousAt (↿h) (a, f a / g a))
    (h2h : g a = 0 → Tendsto (↿h) (𝓝 a ×ˢ ⊤) (𝓝 (h a 0))) :
    ContinuousAt (fun x => h x (f x / g x)) a

(h : α → G₀ → β)

(h2h : g a = 0 → Filter.Tendsto (↿h) (𝓝 a ×ˢ ⊤) (𝓝 (h a 0)))


theorem edgeSet_subset (G' : Subgraph G) : G'.edgeSet ⊆ G.edgeSet

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


lemma cond_cond_eq_cond_inter' (hms : MeasurableSet s) (hmt : MeasurableSet t) (hcs : μ s ≠ ∞) :
    μ[|s][|t] = μ[|s ∩ t]

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s t : Set Ω}
(hms : MeasurableSet s)
(hmt : MeasurableSet t)
(hcs : μ s ≠ ⊤)

ProbabilityTheory.cond (ProbabilityTheory.cond μ s) t = ProbabilityTheory.cond μ (s ∩ t)


@[simp]
theorem finRange_map_get (l : List α) : (finRange l.length).map l.get = l

List.map l.get (List.finRange l.length) = l


@[simp]
lemma inl_snd_assoc {K : CochainComplex C ℤ} {d e f : ℤ} (γ : Cochain G K d)
    (he : 0 + d = e) (hf : -1 + e = f) :
    (inl φ).comp ((snd φ).comp γ he) hf = 0

(γ : CochainComplex.HomComplex.Cochain G K d)

(CochainComplex.mappingCone.inl φ).comp ((CochainComplex.mappingCone.snd φ).comp γ he) hf = 0


/-- Over any ring `R`, if `b` is an infinite basis for a module `M`,
and `s` is a maximal linearly independent set,
then the cardinality of `b` is bounded by the cardinality of `s`.
-/
theorem infinite_basis_le_maximal_linearIndependent {ι : Type w} (b : Basis ι R M) [Infinite ι]
    {κ : Type w} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) : #ι ≤ #κ

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Nontrivial R]
[Module R M]
{ι : Type w}
(b : Basis ι R M)
[Infinite ι]
{κ : Type w}
(v : κ → M)
(i : LinearIndependent R v)
(m : i.Maximal)


lemma IsMeasurableRatCDF.nonneg {f : α → ℚ → ℝ} (hf : IsMeasurableRatCDF f) (a : α) (q : ℚ) :
    0 ≤ f a q

{f : α → ℚ → ℝ}

(hf : ProbabilityTheory.IsMeasurableRatCDF f)


lemma iIndepSet_iff (s : ι → Set Ω) (μ : Measure Ω) :
    iIndepSet s μ ↔ ∀ (s' : Finset ι) {f : ι → Set Ω}
      (_H : ∀ i, i ∈ s' → MeasurableSet[generateFrom {s i}] (f i)),
      μ (⋂ i ∈ s', f i) = ∏ i ∈ s', μ (f i)

∀ {x : MeasurableSpace Ω} (s : ι → Set Ω) (μ : MeasureTheory.Measure Ω),
  ProbabilityTheory.iIndepSet s μ ↔
    ∀ (s' : Finset ι) {f : ι → Set Ω}, (∀ i ∈ s', MeasurableSet (f i)) → μ (⋂ i ∈ s', f i) = ∏ i ∈ s', μ (f i)


/-- When the right derivative of a function is nonnegative, then it is automatically integrable. -/
theorem integrableOn_deriv_right_of_nonneg (hcont : ContinuousOn g (Icc a b))
    (hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt g (g' x) (Ioi x) x)
    (g'pos : ∀ x ∈ Ioo a b, 0 ≤ g' x) : IntegrableOn g' (Ioc a b)

(hderiv : ∀ x ∈ Set.Ioo a b, HasDerivWithinAt g (g' x) (Set.Ioi x) x)

MeasureTheory.IntegrableOn g' (Set.Ioc a b) MeasureTheory.volume


/-- In a strictly convex space, the triangle inequality turns into an equality if and only if the
middle point belongs to the segment joining two other points. -/
lemma dist_add_dist_eq_iff : dist a b + dist b c = dist a c ↔ Wbtw ℝ a b c

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[StrictConvexSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{a b c : P}


lemma subset_verticalStrip_of_isCompact {K : Set ℍ} (hK : IsCompact K) :
    ∃ A B : ℝ, 0 < B ∧ K ⊆ verticalStrip A B

∃ A B, 0 < B ∧ K ⊆ UpperHalfPlane.verticalStrip A B


theorem sqrtTwoAddSeries_succ (x : ℝ) :
    ∀ n : ℕ, sqrtTwoAddSeries x (n + 1) = sqrtTwoAddSeries (√(2 + x)) n

x.sqrtTwoAddSeries (n + 1) = (√(2 + x)).sqrtTwoAddSeries n


{R : Type u_1}
[CommRing R]
{x y : R}
(h : IsRelPrime x y)


@[to_additive]
theorem smul_one_oreDiv_one_smul (r : R) (x : X[S⁻¹]) :
    ((r • 1 : M) /ₒ (1 : S)) • x = r • x

{R : Type u_1}
{M : Type u_3}
{X : Type u_4}
[Monoid M]
{S : Submonoid M}
[OreLocalization.OreSet S]
[MulAction M X]
[SMul R X]
[SMul R M]
[IsScalarTower R M M]
[IsScalarTower R M X]
(r : R)
(x : OreLocalization S X)


@[ext 1100]
theorem hom_ext (g1 g2 : X ⟶ widePullback _ _ arrows) : (∀ j : J,
    g1 ≫ π arrows j = g2 ≫ π arrows j) → g1 ≫ base arrows = g2 ≫ base arrows → g1 = g2

[CategoryTheory.Limits.HasWidePullback B objs arrows]

(g1 g2 : X ⟶ CategoryTheory.Limits.widePullback B objs arrows)

(∀ (j : J), g1 ≫ CategoryTheory.Limits.WidePullback.π arrows j = g2 ≫ CategoryTheory.Limits.WidePullback.π arrows j) →
  g1 ≫ CategoryTheory.Limits.WidePullback.base arrows = g2 ≫ CategoryTheory.Limits.WidePullback.base arrows → g1 = g2


@[simp] lemma head_sub (a b : Fin n.succ → α) : vecHead (a - b) = vecHead a - vecHead b

{α : Type u_1}
{n : ℕ}
[Sub α]
(a b : Fin n.succ → α)

Matrix.vecHead (a - b) = Matrix.vecHead a - Matrix.vecHead b


@[to_additive]
theorem tprod_apply [∀ x, T2Space (π x)] {f : ι → ∀ x, π x} {x : α} (hf : Multipliable f) :
    (∏' i, f i) x = ∏' i, f i x

{α : Type u_1}
{ι : Type u_5}
{π : α → Type u_6}
[(x : α) → CommMonoid (π x)]
[(x : α) → TopologicalSpace (π x)]
[∀ (x : α), T2Space (π x)]
{f : ι → (x : α) → π x}
{x : α}
(hf : Multipliable f)

tprod (fun i => f i) x = ∏' (i : ι), f i x


theorem natCast_zero : ((0 : ℕ) : R) = 0


lemma Measurable.iff (hp : Measurable p) (hq : Measurable q) : Measurable fun a ↦ p a ↔ q a

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


theorem div_dvd_div : ∀ {a b c : Int}, a ∣ b → b ∣ c → b.div a ∣ c.div a


@[simp]
theorem fieldRange_toSubfield : f.fieldRange.toSubfield = (f : L →+* L').fieldRange

{K : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
(f : L →ₐ[K] L')


lemma ae_ae_of_ae_compProd [SFinite μ] [IsSFiniteKernel κ] {p : α × β → Prop}
    (h : ∀ᵐ x ∂(μ ⊗ₘ κ), p x) :
    ∀ᵐ a ∂μ, ∀ᵐ b ∂κ a, p (a, b)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{μ : MeasureTheory.Measure α}
{κ : ProbabilityTheory.Kernel α β}
[MeasureTheory.SFinite μ]
[ProbabilityTheory.IsSFiniteKernel κ]
{p : α × β → Prop}
(h : ∀ᵐ (x : α × β) ∂μ ⊗ₘ κ, p x)

∀ᵐ (a : α) ∂μ, ∀ᵐ (b : β) ∂κ a, p (a, b)


theorem strongDownwardInductionOn_eq {p : Multiset α → Sort*} (s : Multiset α) {n : ℕ}
    (H : ∀ t₁, (∀ {t₂ : Multiset α}, card t₂ ≤ n → t₁ < t₂ → p t₂) → card t₁ ≤ n → p t₁) :
    s.strongDownwardInductionOn H = H s fun {t} ht _h => t.strongDownwardInductionOn H ht

(H : (t₁ : Multiset α) → ({t₂ : Multiset α} → Multiset.card t₂ ≤ n → t₁ < t₂ → p t₂) → Multiset.card t₁ ≤ n → p t₁)

(fun a => s.strongDownwardInductionOn H a) = H s fun {t} ht _h => t.strongDownwardInductionOn H ht


/-- Closed balls are bounded -/
theorem isBounded_closedBall : IsBounded (closedBall x r)

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{r : ℝ}

Bornology.IsBounded (Metric.closedBall x r)


/-- The functor `(F ⋙ L, R) ⥤ (L, R)` -/
@[simps]
def preLeft (F : C ⥤ A) (L : A ⥤ T) (R : B ⥤ T) : Comma (F ⋙ L) R ⥤ Comma L R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{C : Type u₄}
[CategoryTheory.Category.{v₄, u₄} C]
(F : CategoryTheory.Functor C A)
(L : CategoryTheory.Functor A T)
(R : CategoryTheory.Functor B T)

∀ {X Y : CategoryTheory.Comma (F.comp L) R} (f : X ⟶ Y),
  ((CategoryTheory.Comma.preLeft F L R).map f).left = F.map f.left


nonrec theorem ContinuousAt.const_cpow {b : ℂ} (hf : ContinuousAt f a) (h : b ≠ 0 ∨ f a ≠ 0) :
    ContinuousAt (fun x => b ^ f x) a

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℂ}
{a : α}
{b : ℂ}
(hf : ContinuousAt f a)
(h : b ≠ 0 ∨ f a ≠ 0)


@[simp]
theorem withConstants_funMap_sum_inr {a : α} {x : Fin 0 → M} :
    @funMap (L[[α]]) M _ 0 (Sum.inr a : L[[α]].Functions 0) x = L.con a

FirstOrder.Language.Structure.funMap (Sum.inr a) x = ↑(L.con a)


@[simp] theorem runK_bind_lift [Monad m] (x : m α) (f : α → StateCpsT σ m β) (s : σ) (k : β → σ → m γ)
    : (StateCpsT.lift x >>= f).runK s k = x >>= fun a => (f a).runK s k

{α σ : Type u}
{m : Type u → Type v}
{β γ : Type u}
[Monad m]
(x : m α)
(f : α → StateCpsT σ m β)
(s : σ)
(k : β → σ → m γ)

(StateCpsT.lift x >>= f).runK s k = do
  let a ← x
  (f a).runK s k


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

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

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).counitIso.hom.app X).right =
  CategoryTheory.CategoryStruct.id X.right


@[to_additive]
theorem div_mem_comm_iff {a b : G} : a / b ∈ H ↔ b / a ∈ H

{G : Type u_1}
[Group G]
{S : Type u_6}
{H : S}
[SetLike S G]
[SubgroupClass S G]
{a b : G}


@[simp]
theorem cancel_natIso_inv_left {X : C} {Z : D} (g g' : F.obj X ⟶ Z) :
    α.inv.app X ≫ g = α.inv.app X ≫ g' ↔ g = g'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ D}
(α : F ≅ G)
{X : C}
{Z : D}
(g g' : F.obj X ⟶ Z)


theorem ContDiff.one_of_succ {n : ℕ} (h : ContDiff 𝕜 (n + 1) f) : ContDiff 𝕜 1 f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ}
(h : ContDiff 𝕜 (↑n + 1) f)


@[simp, norm_cast] lemma natCast_div (m n : ℕ) : ((m / n : ℕ) : ℤ) = m / n


@[simp] lemma ker_eq_univ : ker f = univ ↔ f = ⊤


/-- The isomorphism between `(lift F _ _).obj WithInitial.star` with `Z`. -/
@[simps!]
def liftStar {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z ⟶ F.obj x)
    (hM : ∀ (x y : C) (f : x ⟶ y), M x ≫ F.map f = M y) : (lift F M hM).obj star ≅ Z

(hM : ∀ (x y : C) (f : x ⟶ y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y)

(CategoryTheory.WithInitial.liftStar F M hM).inv = CategoryTheory.CategoryStruct.id Z


/-- See also `Order.succ_eq_of_covBy`. -/
lemma le_succ_of_wcovBy (h : a ⩿ b) : b ≤ succ a

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
(h : a ⩿ b)


@[simp]
lemma IsZeckendorfRep_nil : IsZeckendorfRep []


@[symm]
nonrec theorem symm (hxy : x ≡ y [SMOD U]) : y ≡ x [SMOD U]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{U : Submodule R M}
{x y : M}
(hxy : x ≡ y [SMOD U])


/-- The norm of a matrix is the sup of the sup of the nnnorm of the entries -/
lemma norm_eq_sup_sup_nnnorm (A : Matrix m n α) :
    ‖A‖ = Finset.sup Finset.univ fun i ↦ Finset.sup Finset.univ fun j ↦ ‖A i j‖₊

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

‖A‖ = ↑(Finset.univ.sup fun i => Finset.univ.sup fun j => ‖A i j‖₊)


/-- The triangle (polygon) inequality for sequences of points; `Finset.range` version. -/
theorem dist_le_range_sum_dist (f : ℕ → α) (n : ℕ) :
    dist (f 0) (f n) ≤ ∑ i ∈ Finset.range n, dist (f i) (f (i + 1))

{α : Type u}
[PseudoMetricSpace α]
(f : ℕ → α)
(n : ℕ)


theorem toIocMod_neg' (a b : α) : toIocMod hp (-a) b = p - toIcoMod hp a (-b)

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


/-- In a `DivisionCommMonoid`, `Equiv.inv` is a `MulEquiv`. There is a variant of this
`MulEquiv.inv' G : G ≃* Gᵐᵒᵖ` for the non-commutative case. -/
@[to_additive (attr := simps apply)
  "When the `AddGroup` is commutative, `Equiv.neg` is an `AddEquiv`."]
def MulEquiv.inv (G : Type*) [DivisionCommMonoid G] : G ≃* G

(G : Type u_12)
[SubtractionCommMonoid G]


theorem ContDiffWithinAt.arsinh (h : ContDiffWithinAt ℝ n f s a) :
    ContDiffWithinAt ℝ n (fun x => arsinh (f x)) s a

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{a : E}
{n : ℕ∞}
(h : ContDiffWithinAt ℝ n f s a)

ContDiffWithinAt ℝ n (fun x => Real.arsinh (f x)) s a


theorem mem_inv_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) (S : Subgroup G) (x : G) :
    x ∈ a⁻¹ • S ↔ a • x ∈ S

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

x ∈ a⁻¹ • S ↔ a • x ∈ S


theorem inf_le {b : β} (hb : b ∈ s) : s.inf f ≤ f b

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


lemma card_filter_piFinset_const (s : Finset κ) (i : ι) (j : κ) :
    ((piFinset fun _ ↦ s).filter fun f ↦ f i = j).card =
      if j ∈ s then s.card ^ (card ι - 1) else 0

{ι : Type u_4}
{κ : Type u_5}
[DecidableEq ι]
[DecidableEq κ]
[Fintype ι]
(s : Finset κ)
(i : ι)
(j : κ)

(Finset.filter (fun f => f i = j) (Fintype.piFinset fun x => s)).card =
  if j ∈ s then s.card ^ (Fintype.card ι - 1) else 0


@[simp]
theorem coe_smul (f : ModularForm Γ k) (n : α) : ⇑(n • f) = n • ⇑f

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
{α : Type u_2}
[SMul α ℂ]
[IsScalarTower α ℂ ℂ]
(f : ModularForm Γ k)
(n : α)


/-- If an initial object `0` exists in a CCC then every morphism from it is monic. -/
theorem initial_mono {I : C} (B : C) (t : IsInitial I) [CartesianClosed C] : Mono (t.to B)


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

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


theorem nonempty_of_not_bddBelow [Nonempty α] (h : ¬BddBelow s) : s.Nonempty

{α : Type u}
[Preorder α]
{s : Set α}
[Nonempty α]
(h : ¬BddBelow s)


lemma setLIntegral_withDensity_eq_lintegral_mul₀ {μ : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) {g : α → ℝ≥0∞} (hg : AEMeasurable g μ)
    {s : Set α} (hs : MeasurableSet s) :
    ∫⁻ a in s, g a ∂μ.withDensity f = ∫⁻ a in s, (f * g) a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
{g : α → ℝ≥0∞}
(hg : AEMeasurable g μ)
{s : Set α}
(hs : MeasurableSet s)

∫⁻ (a : α) in s, g a ∂μ.withDensity f = ∫⁻ (a : α) in s, (f * g) a ∂μ


theorem mul_adjugate_apply (A : Matrix n n α) (i j k) :
    A i k * adjugate A k j = cramer Aᵀ (Pi.single k (A i k)) j

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
(A : Matrix n n α)
(i j k : n)

A i k * A.adjugate k j = A.transpose.cramer (Pi.single k (A i k)) j


/-- The group of units of a complete normed ring is an open subset of the ring. -/
protected theorem isOpen : IsOpen { x : R | IsUnit x }

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]


/-- The equivalence `(β →* γ) ≃ (α →* γ)` obtained by precomposition with
a multiplicative equivalence `e : α ≃* β`. -/
@[simps]
def precompEquiv {α β : Type*} [Monoid α] [Monoid β] (e : α ≃* β) (γ : Type*) [Monoid γ] :
    (β →* γ) ≃ (α →* γ)

{α : Type u_1}
{β : Type u_2}
[Monoid α]
[Monoid β]
(e : α ≃* β)
(γ : Type u_3)
[Monoid γ]
(f : β →* γ)

(MonoidHom.precompEquiv e γ) f = f.comp ↑e


/-- The triple product of `u`, `v`, and `w` is equal to the determinant of the matrix
    with those vectors as its rows. -/
theorem triple_product_eq_det (u v w : Fin 3 → R) : u ⬝ᵥ v ×₃ w = Matrix.det ![u, v, w]

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

u ⬝ᵥ (crossProduct v) w = Matrix.det ![u, v, w]


@[simp]
theorem symm_single (a : α) (b : β) : (single a b).symm = single b a

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

(PEquiv.single a b).symm = PEquiv.single b a


theorem mem_mk_right (x y : α) : y ∈ s(x, y)


theorem congr_hom {X Y : PresheafedSpace.{_, _, v} C} (α β : X ⟶ Y) (h : α = β) (x : X) :
    α.stalkMap x =
      eqToHom (show Y.presheaf.stalk (α.base x) =
        Y.presheaf.stalk (β.base x) by rw [h]) ≫ β.stalkMap x

{X Y : AlgebraicGeometry.PresheafedSpace C}

AlgebraicGeometry.PresheafedSpace.Hom.stalkMap α x =
  CategoryTheory.eqToHom ⋯ ≫ AlgebraicGeometry.PresheafedSpace.Hom.stalkMap β x


/-- The left inverse of matrix A is unique when existing. -/
theorem left_inv_eq_left_inv (h : B * A = 1) (g : C * A = 1) : B = C

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B C : Matrix n n α}
(h : B * A = 1)
(g : C * A = 1)


/-- Scaling on the left is sent by `DualNumber.lift` to multiplication on the left -/
@[simp] theorem lift_smul (fe : {fe : (A →ₐ[R] B) × B // _}) (a : A) (ad : A[ε]) :
    lift fe (a • ad) = fe.val.1 a * lift fe ad

(fe : { fe // fe.2 * fe.2 = 0 ∧ ∀ (a : A), Commute fe.2 (fe.1 a) })

(DualNumber.lift fe) (a • ad) = (↑fe).1 a * (DualNumber.lift fe) ad


@[to_additive (attr := measurability)]
theorem Finset.aemeasurable_prod (s : Finset ι) (hf : ∀ i ∈ s, AEMeasurable (f i) μ) :
    AEMeasurable (fun a => ∏ i ∈ s, f i a) μ

{M : Type u_2}
{ι : Type u_3}
{α : Type u_4}
[CommMonoid M]
[MeasurableSpace M]
[MeasurableMul₂ M]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : ι → α → M}
(s : Finset ι)
(hf : ∀ i ∈ s, AEMeasurable (f i) μ)


theorem biprod.lift_mapBiprod (f : W ⟶ X) (g : W ⟶ Y) :
    biprod.lift (F.map f) (F.map g) ≫ (F.mapBiprod X Y).inv = F.map (biprod.lift f g)

[CategoryTheory.Limits.PreservesBinaryBiproduct X Y F]

CategoryTheory.Limits.biprod.lift (F.map f) (F.map g) ≫ (F.mapBiprod X Y).inv =
  F.map (CategoryTheory.Limits.biprod.lift f g)


theorem GammaSeq_eq_betaIntegral_of_re_pos {s : ℂ} (hs : 0 < re s) (n : ℕ) :
    GammaSeq s n = (n : ℂ) ^ s * betaIntegral s (n + 1)

s.GammaSeq n = ↑n ^ s * s.betaIntegral (↑n + 1)


/-- If the range of an injective indexed family of points is affinely
independent, so is that family. -/
theorem AffineIndependent.of_set_of_injective {p : ι → P}
    (ha : AffineIndependent k (fun x => x : Set.range p → P)) (hi : Function.Injective p) :
    AffineIndependent k p

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{p : ι → P}
(ha : AffineIndependent k fun x => ↑x)
(hi : Function.Injective p)


theorem mul_pos_of_neg_of_neg [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    {a b : α} (ha : a < 0) (hb : b < 0) : 0 < a * b

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

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


theorem iff_span_pair_isPrincipal :
    IsBezout R ↔ ∀ x y : R, (Ideal.span {x, y} : Ideal R).IsPrincipal

IsBezout R ↔ ∀ (x y : R), Submodule.IsPrincipal (Ideal.span {x, y})


theorem monomial_add (n : ℕ) (r s : R) : monomial n (r + s) = monomial n r + monomial n s

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

(Polynomial.monomial n) (r + s) = (Polynomial.monomial n) r + (Polynomial.monomial n) s


/-- Given a natural isomorphism `i ⋙ exp A ⋙ leftAdjoint i ⋙ i ≅ i ⋙ exp A`, we can show `i`
is an exponential ideal.
-/
theorem ExponentialIdeal.mk_of_iso [Reflective i]
    (h : ∀ A : C, i ⋙ exp A ⋙ reflector i ⋙ i ≅ i ⋙ exp A) : ExponentialIdeal i

(h :
  (A : C) → i.comp ((CategoryTheory.exp A).comp ((CategoryTheory.reflector i).comp i)) ≅ i.comp (CategoryTheory.exp A))


theorem _root_.MeasurableEquiv.restrict_map (e : α ≃ᵐ β) (μ : Measure α) (s : Set β) :
    (μ.map e).restrict s = (μ.restrict <| e ⁻¹' s).map e

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
{m1 : MeasurableSpace β}
(e : α ≃ᵐ β)
(μ : MeasureTheory.Measure α)
(s : Set β)

(MeasureTheory.Measure.map (⇑e) μ).restrict s = MeasureTheory.Measure.map (⇑e) (μ.restrict (⇑e ⁻¹' s))


lemma truncatedSup_of_isAntichain (hs : IsAntichain (· ≤ ·) (s : Set α)) (ha : a ∈ s) :
    truncatedSup s a = a

(hs : IsAntichain (fun x x_1 => x ≤ x_1) ↑s)


theorem WithSeminorms.hasBasis_ball (hp : WithSeminorms p) {x : E} :
    (𝓝 (x : E)).HasBasis
    (fun sr : Finset ι × ℝ => 0 < sr.2) fun sr => (sr.1.sup p).ball x sr.2

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[TopologicalSpace E]
{p : SeminormFamily 𝕜 E ι}
(hp : WithSeminorms p)
{x : E}

(𝓝 x).HasBasis (fun sr => 0 < sr.2) fun sr => (sr.1.sup p).ball x sr.2


theorem swap_apply {α β : Type*} [DecidableEq α] [DecidableEq β] (f : α ↪ β) (x y z : α) :
    Equiv.swap (f x) (f y) (f z) = f (Equiv.swap x y z)

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
(f : α ↪ β)
(x y z : α)

(Equiv.swap (f x) (f y)) (f z) = f ((Equiv.swap x y) z)


@[simp, norm_cast]
theorem coe_smul [Zero β] {R : Type*} [SMulZeroClass R β] [ContinuousConstSMul R β] (r : R)
    (f : C_c(α, β)) : ⇑(r • f) = r • ⇑f

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
{R : Type u_5}
[SMulZeroClass R β]
[ContinuousConstSMul R β]
(r : R)
(f : α →C_c β)


@[to_additive]
theorem eq_of_div_eq_one (h : a / b = 1) : a = b

{α : Type u_1}
[DivisionMonoid α]
{a b : α}
(h : a / b = 1)


/-- A countable union of meagre sets is meagre. -/
lemma isMeagre_iUnion {s : ℕ → Set X} (hs : ∀ n, IsMeagre (s n)) : IsMeagre (⋃ n, s n)

{X : Type u_5}
[TopologicalSpace X]
{s : ℕ → Set X}
(hs : ∀ (n : ℕ), IsMeagre (s n))


@[to_additive (attr := simp) neg_mem_addCentralizer]
lemma inv_mem_centralizer (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S

{M : Type u_1}
{S : Set M}
[AddGroup M]
{a : M}
(ha : a ∈ S.addCentralizer)


theorem inf_mem_subalgebra_closure (A : Subalgebra ℝ C(X, ℝ)) (f g : A) :
    (f : C(X, ℝ)) ⊓ (g : C(X, ℝ)) ∈ A.topologicalClosure

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(A : Subalgebra ℝ C(X, ℝ))
(f g : ↥A)


lemma rTensor.inverse_of_rightInverse_comp_rTensor
    {h : P → N} (hgh : Function.RightInverse h g) :
    (rTensor.inverse_of_rightInverse Q hfg hgh).comp (rTensor Q g) =
      Submodule.mkQ (p := LinearMap.range (rTensor Q f))

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
(Q : Type u_5)
[AddCommGroup Q]
[Module R Q]
(hfg : Function.Exact ⇑f ⇑g)
{h : P → N}
(hgh : Function.RightInverse h ⇑g)

rTensor.inverse_of_rightInverse Q hfg hgh ∘ₗ LinearMap.rTensor Q g = (LinearMap.range (LinearMap.rTensor Q f)).mkQ


theorem QuasiSeparated.of_comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiSeparated (f ≫ g)] :
    QuasiSeparated f

[AlgebraicGeometry.QuasiSeparated (f ≫ g)]


theorem indicator_of_not_mem (hi : i ∉ s) (f : ∀ i ∈ s, α) : indicator s f i = 0

{ι : Type u_1}
{α : Type u_2}
[Zero α]
{s : Finset ι}
{i : ι}
(hi : i ∉ s)
(f : (i : ι) → i ∈ s → α)


lemma XYIdeal_neg_mul {x y : F} (h : W.Nonsingular x y) :
    XYIdeal W x (C <| W.negY x y) * XYIdeal W x (C y) = XIdeal W x

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x y : F}
(h : W.Nonsingular x y)

WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x (Polynomial.C (W.negY x y)) *
    WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x (Polynomial.C y) =
  WeierstrassCurve.Affine.CoordinateRing.XIdeal W x


@[to_additive (attr := simp)]
theorem mem_map {f : M →ₙ* N} {S : Subsemigroup M} {y : N} : y ∈ S.map f ↔ ∃ x ∈ S, f x = y

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
{S : Subsemigroup M}
{y : N}

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


lemma map_negAddY (x₁ x₂ y₁ L : R) :
    (W.map f).toAffine.negAddY (f x₁) (f x₂) (f y₁) (f L) = f (W.negAddY x₁ x₂ y₁ L)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type v}
[CommRing S]
(f : R →+* S)
(x₁ x₂ y₁ L : R)

(WeierstrassCurve.map W f).toAffine.negAddY (f x₁) (f x₂) (f y₁) (f L) = f (W.negAddY x₁ x₂ y₁ L)


theorem Set.Countable.isLindelof_biUnion {s : Set ι} {f : ι → Set X} (hs : s.Countable)
    (hf : ∀ i ∈ s, IsLindelof (f i)) : IsLindelof (⋃ i ∈ s, f i)

{X : Type u}
{ι : Type u_1}
[TopologicalSpace X]
{s : Set ι}
{f : ι → Set X}
(hs : s.Countable)
(hf : ∀ i ∈ s, IsLindelof (f i))


@[simp]
theorem Matrix.toLin'_one : Matrix.toLin' (1 : Matrix n n R) = LinearMap.id

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]


/-- The functor from homological complexes to differential graded objects.
-/
@[simps]
def homologicalComplexToDGO :
    HomologicalComplex V (ComplexShape.up' b) ⥤
      DifferentialObject ℤ (GradedObjectWithShift b V)

{X Y : HomologicalComplex V (ComplexShape.up' b)}

((HomologicalComplex.homologicalComplexToDGO b V).map f).f i = f.f i


lemma smul_lowerBounds_subset_lowerBounds_smul_of_nonneg (ha : 0 ≤ a) :
    a • lowerBounds s ⊆ lowerBounds (a • s)

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulMono α β]
{a : α}
{s : Set β}
(ha : 0 ≤ a)


protected lemma add_le_zero_iff_le_neg' : a + b ≤ 0 ↔ b ≤ -a


theorem modByMonic_repr_map (h : IsAdjoinRootMonic S f) (g : R[X]) :
    h.repr (h.map g) %ₘ f = g %ₘ f

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(g : R[X])


@[reassoc (attr := simp)]
lemma cyclesIsoX₂_hom_inv_id (hg : S.g = 0) :
    S.iCycles ≫ (S.cyclesIsoX₂ hg).inv = 𝟙 _

CategoryTheory.CategoryStruct.comp S.iCycles (S.cyclesIsoX₂ hg).inv = CategoryTheory.CategoryStruct.id S.cycles


theorem le_antisymm_iff {a b : α} : a = b ↔ a ≤ b ∧ b ≤ a


theorem prop (F : HomotopyWith f₀ f₁ P) (t : I) : P (F.toHomotopy.curry t)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
{P : C(X, Y) → Prop}
(F : f₀.HomotopyWith f₁ P)
(t : ↑I)


theorem closure_interior_Icc {a b : α} (h : a ≠ b) : closure (interior (Icc a b)) = Icc a b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(h : a ≠ b)

closure (interior (Set.Icc a b)) = Set.Icc a b


/-- If `(a : ℕ)` is a root of `cyclotomic n (ZMod p)`, then the multiplicative order of `a` modulo
`p` divides `n`. -/
theorem orderOf_root_cyclotomic_dvd {n : ℕ} (hpos : 0 < n) {p : ℕ} [Fact p.Prime] {a : ℕ}
    (hroot : IsRoot (cyclotomic n (ZMod p)) (Nat.castRingHom (ZMod p) a)) :
    orderOf (ZMod.unitOfCoprime a (coprime_of_root_cyclotomic hpos hroot)) ∣ n

(hroot : (Polynomial.cyclotomic n (ZMod p)).IsRoot ((Nat.castRingHom (ZMod p)) a))


@[simp]
theorem logb_rpow : logb b (b ^ x) = x

{b x : ℝ}
(b_pos : 0 < b)
(b_ne_one : b ≠ 1)


theorem preimage_image (s : Set H) : I ⁻¹' (I '' s) = s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(s : Set H)


@[to_additive]
theorem MonoidHom.toMulHom_injective [MulOneClass M] [MulOneClass N] :
    Function.Injective (MonoidHom.toMulHom : (M →* N) → M →ₙ* N)

{M : Type u_4}
{N : Type u_5}
[MulOneClass M]
[MulOneClass N]


theorem infsep_le_of_mem_of_edist_le {d x} (hx : x ∈ s) {y} (hy : y ∈ s) (hxy : x ≠ y)
    (hxy' : dist x y ≤ d) : s.infsep ≤ d

{α : Type u_1}
[PseudoMetricSpace α]
{s : Set α}
{d : ℝ}
{x : α}
(hx : x ∈ s)
{y : α}
(hy : y ∈ s)
(hxy : x ≠ y)
(hxy' : dist x y ≤ d)


theorem distortion_of_const {c} (h₁ : π.boxes.Nonempty) (h₂ : ∀ J ∈ π, Box.distortion J = c) :
    π.distortion = c

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
[Fintype ι]
{c : ℝ≥0}
(h₁ : π.boxes.Nonempty)
(h₂ : ∀ J ∈ π, J.distortion = c)


lemma le_half_of_half_lt_sub (h : a / 2 < a - b) : b ≤ a / 2


theorem of_mem_append {s₁ s₂ : WSeq α} {a : α} : a ∈ append s₁ s₂ → a ∈ s₁ ∨ a ∈ s₂

{α : Type u}
{s₁ s₂ : Stream'.WSeq α}
{a : α}


/-- The colimit cocone for the coproduct over an index type with exactly one term. -/
@[simps]
def colimitCoconeOfUnique : ColimitCocone (Discrete.functor f)

(s : CategoryTheory.Limits.Cocone (CategoryTheory.Discrete.functor f))

(CategoryTheory.Limits.colimitCoconeOfUnique f).isColimit.desc s = s.ι.app default


theorem nndist_vsub_vsub_le (p₁ p₂ p₃ p₄ : P) :
    nndist (p₁ -ᵥ p₂) (p₃ -ᵥ p₄) ≤ nndist p₁ p₃ + nndist p₂ p₄

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(p₁ p₂ p₃ p₄ : P)


/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
    {f : β → α → ℝ≥0∞} {μ : Measure α} (hμ : μ ≠ 0) (hf : ∀ b, Measurable (f b))
    (hf_int : ∀ b, ∫⁻ a, f b a ∂μ ≠ ∞) (h_directed : Directed (· ≥ ·) f) :
    ∫⁻ a, ⨅ b, f b a ∂μ = ⨅ b, ∫⁻ a, f b a ∂μ

{f : β → α → ℝ≥0∞}

(hf_int : ∀ (b : β), ∫⁻ (a : α), f b a ∂μ ≠ ⊤)

(h_directed : Directed (fun x x_1 => x ≥ x_1) f)

∫⁻ (a : α), ⨅ b, f b a ∂μ = ⨅ b, ∫⁻ (a : α), f b a ∂μ


theorem sub_add_cancel (x y : BitVec w) : x - y + y = x


theorem prod.comp_diag {X Y : C} [HasBinaryProduct Y Y] (f : X ⟶ Y) :
    f ≫ diag Y = prod.lift f f

f ≫ CategoryTheory.Limits.diag Y = CategoryTheory.Limits.prod.lift f f


theorem filter_cons {a : α} (s : Finset α) (ha : a ∉ s) :
    filter p (cons a s ha) =
      (if p a then {a} else ∅ : Finset α).disjUnion (filter p s)
        (by
          split_ifs
          · rw [disjoint_singleton_left]
            exact mem_filter.not.mpr <| mt And.left ha
          · exact disjoint_empty_left _)

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

Finset.filter p (Finset.cons a s ha) = (if p a then {a} else ∅).disjUnion (Finset.filter p s) ⋯


/-- The Yoneda embedding for preadditive categories sends an object `Y` to the presheaf sending an
object `X` to the `End Y`-module of morphisms `X ⟶ Y`.
-/
@[simps]
def preadditiveYonedaObj (Y : C) : Cᵒᵖ ⥤ ModuleCat.{v} (End Y)

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

∀ {X Y_1 : Cᵒᵖ} (f : X ⟶ Y_1),
  (CategoryTheory.preadditiveYonedaObj Y).map f =
    ModuleCat.ofHom { toFun := fun g => CategoryTheory.CategoryStruct.comp f.unop g, map_add' := ⋯, map_smul' := ⋯ }


@[simp]
theorem _root_.CoxeterMatrix.toCoxeterSystem_simple (M : CoxeterMatrix B) :
    M.toCoxeterSystem.simple = M.simple


@[simp]
theorem fderiv_csin (hc : DifferentiableAt ℂ f x) :
    fderiv ℂ (fun x => Complex.sin (f x)) x = Complex.cos (f x) • fderiv ℂ f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
(hc : DifferentiableAt ℂ f x)


@[simp, norm_cast]
theorem coe_C (r : F) : ((RatFunc.C r : RatFunc F) : LaurentSeries F) = HahnSeries.C r


@[to_additive (attr := simp)]
lemma UniformFun.ofFun_one [One β] : ofFun (1 : α → β) = 1