/-- Concave **Jensen's inequality**, `Finset.sum` version. -/
theorem ConcaveOn.le_map_sum (hf : ConcaveOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
    (h₁ : ∑ i ∈ t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) :
    (∑ i ∈ t, w i • f (p i)) ≤ f (∑ i ∈ t, w i • p i)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
{ι : Type u_5}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[OrderedAddCommGroup β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
{t : Finset ι}
{w : ι → 𝕜}
{p : ι → E}
(hf : ConcaveOn 𝕜 s f)
(h₀ : ∀ i ∈ t, 0 ≤ w i)
(h₁ : ∑ i ∈ t, w i = 1)
(hmem : ∀ i ∈ t, p i ∈ s)

∑ i ∈ t, w i • f (p i) ≤ f (∑ i ∈ t, w i • p i)


theorem ContinuousOn.circleIntegrable {f : ℂ → E} {c : ℂ} {R : ℝ} (hR : 0 ≤ R)
    (hf : ContinuousOn f (sphere c R)) : CircleIntegrable f c R

(hf : ContinuousOn f (Metric.sphere c R))


lemma isBigO_deriv_rpow_const_atTop (p : ℝ) :
    deriv (fun (x : ℝ) => x ^ p) =O[atTop] fun x => x ^ (p-1)

(deriv fun x => x ^ p) =O[Filter.atTop] fun x => x ^ (p - 1)


/-- The `w`-derivative of the Fourier transform integrand. -/
lemma hasFDerivAt_fourierChar_smul (v : V) (w : W) :
    HasFDerivAt (fun w' ↦ 𝐞 (-L v w') • f v) (𝐞 (-L v w) • fourierSMulRight L f v) w

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
{W : Type u_3}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedAddCommGroup W]
[NormedSpace ℝ W]
(L : V →L[ℝ] W →L[ℝ] ℝ)
(f : V → E)
(v : V)
(w : W)

HasFDerivAt (fun w' => 𝐞 (-(L v) w') • f v) (𝐞 (-(L v) w) • VectorFourier.fourierSMulRight L f v) w


@[simp]
theorem eval_const : ∀ n m, eval (Code.const n) m = Part.some n

(Nat.Partrec.Code.const n).eval m = Part.some n


@[simps! tensorObj tensorHom tensorUnit whiskerLeft whiskerRight associator]
instance prodMonoidal : MonoidalCategory (C₁ × C₂)

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

∀ (x x_1 : C₁ × C₂) (f : x ⟶ x_1),
  CategoryTheory.MonoidalCategory.whiskerLeft X f =
    (CategoryTheory.MonoidalCategory.whiskerLeft X.1 f.1, CategoryTheory.MonoidalCategory.whiskerLeft X.2 f.2)


theorem IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable

{L : FirstOrder.Language}
{T : L.Theory}
(h : T.IsSatisfiable)


theorem arg_neg_eq_arg_add_pi_iff {x : ℂ} :
    arg (-x) = arg x + π ↔ x.im < 0 ∨ x.im = 0 ∧ 0 < x.re

(-x).arg = x.arg + π ↔ x.im < 0 ∨ x.im = 0 ∧ 0 < x.re


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

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


/-- Change a `Cocone F.op` into a `Cone F`. -/
@[simps]
def Cocone.unop (c : Cocone F.op) : Cone F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(c : CategoryTheory.Limits.Cocone F.op)


/-- Any category with finite coproducts and coequalizers has all finite colimits.

See <https://stacks.math.columbia.edu/tag/002Q>.
-/
theorem hasFiniteColimits_of_hasCoequalizers_and_finite_coproducts [HasFiniteCoproducts C]
    [HasCoequalizers C] : HasFiniteColimits C


@[simp]
theorem properDivisors_one : properDivisors 1 = ∅


@[to_additive]
theorem apply_coe_mem_map (f : F) (S : Submonoid M) (x : S) : f x ∈ S.map f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(f : F)
(S : Submonoid M)
(x : ↥S)


@[to_additive]
theorem Right.self_le_inv (h : a ≤ 1) : a ≤ a⁻¹

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


lemma closure_subset_closure_of_subset_closure (hXY : X ⊆ M.closure Y) :
    M.closure X ⊆ M.closure Y

{α : Type u_2}
{M : Matroid α}
{X Y : Set α}
(hXY : X ⊆ M.closure Y)


@[simp]
theorem card_empty : card (∅ : Finset α) = 0


theorem getElem?_set {l : List α} {i j : Nat} {a : α} :
    (l.set i a)[j]? = if i = j then if i < l.length then some a else none else l[j]?

{α : Type u_1}
{l : List α}
{i j : Nat}
{a : α}


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


theorem lt_of_lt_of_eq {f g h : CauSeq α abs} (fg : f < g) (gh : g ≈ h) : f < h

{α : Type u_1}
[LinearOrderedField α]
{f g h : CauSeq α abs}
(fg : f < g)
(gh : g ≈ h)


@[to_additive]
lemma prod_ite_of_true {p : α → Prop} {_ : DecidablePred p} (h : ∀ x ∈ s, p x) (f g : α → β) :
    ∏ x ∈ s, (if p x then f x else g x) = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[AddCommMonoid β]
{p : α → Prop}

∀ {x : DecidablePred p}, (∀ x ∈ s, p x) → ∀ (f g : α → β), (∑ x_1 ∈ s, if p x_1 then f x_1 else g x_1) = ∑ x ∈ s, f x


@[grind_norm↓] theorem not_ite {_ : Decidable p} (q r : Prop) : (¬ite p q r) = ite p (¬q) (¬r)

∀ {x : Decidable p} (q r : Prop), (¬if p then q else r) = if p then ¬q else ¬r


theorem utf8PrevAux_lt_of_pos : ∀ (cs : List Char) (i p : Pos), p ≠ 0 →
    (utf8PrevAux cs i p).1 < p.1

p ≠ 0 → (String.utf8PrevAux cs i p).byteIdx < p.byteIdx


@[simp]
theorem id_apply (a : α) : InfTopHom.id α a = a


@[simp]
theorem of_has_biproduct (X Y : C) [HasBinaryBiproduct X Y] :
    IsPullback biprod.fst biprod.snd (0 : X ⟶ 0) (0 : Y ⟶ 0)

CategoryTheory.IsPullback CategoryTheory.Limits.biprod.fst CategoryTheory.Limits.biprod.snd 0 0


@[simp]
theorem ContinuousMultilinearMap.curryLeft_apply (f : ContinuousMultilinearMap 𝕜 Ei G) (x : Ei 0)
    (m : ∀ i : Fin n, Ei i.succ) : f.curryLeft x m = f (cons x m)

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]


theorem toOuterMeasure_injective : (toOuterMeasure : PMF α → OuterMeasure α).Injective


theorem adjoint_toContinuousLinearMap (A : E →ₗ[𝕜] F) :
    haveI := FiniteDimensional.complete 𝕜 E
    haveI := FiniteDimensional.complete 𝕜 F
    LinearMap.toContinuousLinearMap (LinearMap.adjoint A) =
      ContinuousLinearMap.adjoint (LinearMap.toContinuousLinearMap A)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[FiniteDimensional 𝕜 E]
[FiniteDimensional 𝕜 F]
(A : E →ₗ[𝕜] F)


theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r)

UpperHalfPlane.coe '' Metric.ball z r = Metric.ball (↑(z.center r)) (z.im * Real.sinh r)


/-- A vector of length `0` is a `nil` vector. -/
protected theorem eq_nil (v : Vector α 0) : v = nil


@[to_additive]
theorem prod_subtypeDomain_index [CommMonoid N] {v : α →₀ M} {h : α → M → N}
    (hp : ∀ x ∈ v.support, p x) : (v.subtypeDomain p).prod (fun a b ↦ h a b) = v.prod h

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
{p : α → Prop}
[CommMonoid N]
{v : α →₀ M}
{h : α → M → N}
(hp : ∀ x ∈ v.support, p x)

((Finsupp.subtypeDomain p v).prod fun a b => h (↑a) b) = v.prod h


@[simp]
theorem Filter.lift'_closure_eq_bot {l : Filter X} : l.lift' closure = ⊥ ↔ l = ⊥

{X : Type u}
[TopologicalSpace X]
{l : Filter X}


@[aesop safe apply (rule_sets := [SetLike])]
lemma qsmul_mem (s : S) (q : ℚ) (hx : x ∈ s) : q • x ∈ s

{K : Type u}
[DivisionRing K]
{S : Type u_1}
[SetLike S K]
[h : SubfieldClass S K]
{x : K}
(s : S)
(q : ℚ)
(hx : x ∈ s)


lemma isTriangulated [Pretriangulated D] [L.IsTriangulated] [IsTriangulated C] :
    IsTriangulated D

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

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


theorem unop_iSup (S : ι → Subalgebra R Aᵐᵒᵖ) : (iSup S).unop = ⨆ i, (S i).unop

{ι : Sort u_1}
{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : ι → Subalgebra R Aᵐᵒᵖ)


/-- `Polynomial.Gal.restrictProd` is actually a subgroup embedding. -/
theorem restrictProd_injective : Function.Injective (restrictProd p q)

Function.Injective ⇑(Polynomial.Gal.restrictProd p q)


theorem cond_apply' {t : Set Ω} (hA : MeasurableSet t) : μ[t|s] = (μ s)⁻¹ * μ (s ∩ t)

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s t : Set Ω}
(hA : MeasurableSet t)

(ProbabilityTheory.cond μ s) t = (μ s)⁻¹ * μ (s ∩ t)


theorem liftOn_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) :
    Quot.liftOn (Quot.mk r a) f h = f a

(h : ∀ (a₁ a₂ : α), r a₁ a₂ → f a₁ = f a₂)


theorem map_eq_of_subset {f : α ↪ α} (h : f '' s ⊆ s) (hs : s.Finite := by toFinite_tac) :
    f '' s = s

{α : Type u_1}
{s : Set α}
{f : α ↪ α}
(h : ⇑f '' s ⊆ s)
(hs : s.Finite := by toFinite_tac)


@[simp]
theorem join_cons (a b : α) (s S) :
    join ((a, Seq.cons b s), S) = (a, Seq.join (Seq.cons (b, s) S))

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

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


theorem one_def : (1 : SetSemiring α) = Set.up 1


theorem ennnorm_integral_le_lintegral_ennnorm (f : α → G) :
    (‖∫ a, f a ∂μ‖₊ : ℝ≥0∞) ≤ ∫⁻ a, ‖f a‖₊ ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : α → G)

↑‖∫ (a : α), f a ∂μ‖₊ ≤ ∫⁻ (a : α), ↑‖f a‖₊ ∂μ


theorem of_hasBinaryBiproduct (X Y : C) [HasBinaryBiproduct X Y] :
    IsPushout biprod.fst biprod.snd (0 : X ⟶ 0) (0 : Y ⟶ 0)

CategoryTheory.IsPushout CategoryTheory.Limits.biprod.fst CategoryTheory.Limits.biprod.snd 0 0


theorem pair_injective : Function.Injective2 pair


theorem tsub_lt_tsub_left_of_le : b ≤ a → c < b → a - b < a - c

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

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


theorem memℒp_norm_rpow_iff {q : ℝ≥0∞} {f : α → E} (hf : AEStronglyMeasurable f μ) (q_zero : q ≠ 0)
    (q_top : q ≠ ∞) : Memℒp (fun x : α => ‖f x‖ ^ q.toReal) (p / q) μ ↔ Memℒp f p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Memℒp (fun x => ‖f x‖ ^ q.toReal) (p / q) μ ↔ MeasureTheory.Memℒp f p μ


theorem ReflTransGen.mono {p : α → α → Prop} : (∀ a b, r a b → p a b) →
    ReflTransGen r a b → ReflTransGen p a b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
{p : α → α → Prop}

(∀ (a b : α), r a b → p a b) → Relation.ReflTransGen r a b → Relation.ReflTransGen p a b


@[simp]
theorem pushforwardFamily_apply {X} (x : ℱ.obj (op X)) {Y : C} (f : G.obj Y ⟶ X) :
    pushforwardFamily α x f (Presieve.in_coverByImage G f) = α.app (op Y) (ℱ.map f.op x)

{K : CategoryTheory.GrothendieckTopology D}

{ℱ : CategoryTheory.Functor Dᵒᵖ (Type v)}

CategoryTheory.Functor.IsCoverDense.Types.pushforwardFamily α x f ⋯ = α.app (Opposite.op Y) (ℱ.map f.op x)


lemma exact_subtype_ker_map (g : N →ₗ[R] P) :
    Exact (Submodule.subtype (ker g)) g

{R : Type u_8}
{N : Type u_10}
{P : Type u_11}
[CommRing R]
[AddCommGroup N]
[AddCommGroup P]
[Module R N]
[Module R P]
(g : N →ₗ[R] P)

Function.Exact ⇑(LinearMap.ker g).subtype ⇑g


@[simp]
theorem trans_symm : (e₁₂.trans e₂₃ : M₁ ≃ₛₗ[σ₁₃] M₃).symm = e₂₃.symm.trans e₁₂.symm

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M₁ : Type u_9}
{M₂ : Type u_10}
{M₃ : Type u_11}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{module_M₃ : Module R₃ M₃}
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{σ₂₁ : R₂ →+* R₁}
{σ₃₂ : R₃ →+* R₂}
{σ₃₁ : R₃ →+* R₁}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[RingHomCompTriple σ₃₂ σ₂₁ σ₃₁]
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₃ : RingHomInvPair σ₂₃ σ₃₂}
[RingHomInvPair σ₁₃ σ₃₁]
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
{re₃₂ : RingHomInvPair σ₃₂ σ₂₃}
[RingHomInvPair σ₃₁ σ₁₃]
{e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂}
{e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃}

(e₁₂.trans e₂₃).symm = e₂₃.symm.trans e₁₂.symm


theorem Icc_subset_Ioi_iff (h₁ : a₁ ≤ b₁) : Icc a₁ b₁ ⊆ Ioi a₂ ↔ a₂ < a₁

{α : Type u_1}
[Preorder α]
{a₁ a₂ b₁ : α}
(h₁ : a₁ ≤ b₁)


theorem hom_zero_zero (f : ([0] : SimplexCategory) ⟶ [0]) : f = 𝟙 _

(f : SimplexCategory.mk 0 ⟶ SimplexCategory.mk 0)


@[simp] theorem iff_true (p : Prop) : (p ↔ True) = p


theorem cons_subset_cons {a : α} {s t : Multiset α} : s ⊆ t → a ::ₘ s ⊆ a ::ₘ t

{α : Type u_1}
{a : α}
{s t : Multiset α}


/-- Isometry between the tangent space `V` of a (semi)normed add torsor `P` and `P` given by
addition/subtraction of `x : P`. -/
@[simps!]
def IsometryEquiv.vaddConst (x : P) : V ≃ᵢ P

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x : P)
(v : V)


theorem max_mul_of_nonneg [MulPosMono α]
    (a b : α) (hc : 0 ≤ c) : max a b * c = max (a * c) (b * c)

{α : Type u}
[Semiring α]
[LinearOrder α]
{c : α}
[MulPosMono α]
(a b : α)
(hc : 0 ≤ c)


lemma weightSpace_nsmul_add_ne_bot_of_le {n} (hn : n ≤ chainTopCoeff α β) :
    weightSpace M (n • α + β : L → R) ≠ ⊥

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(α : L → R)
(β : LieModule.Weight R L M)
{n : ℕ}
(hn : n ≤ LieModule.chainTopCoeff α β)

LieModule.weightSpace M (n • α + ⇑β) ≠ ⊥


theorem gc_coe_floor : GaloisConnection ((↑) : ℤ → α) floor

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]


/-- A nontrivial rectangular box in `ι → ℝ` with corners `lower` and `upper`. Represents the product
of half-open intervals `(lower i, upper i]`. -/
structure Box (ι : Type*) where
  /-- coordinates of the lower and upper corners of the box -/
  (lower upper : ι → ℝ)
  /-- Each lower coordinate is less than its upper coordinate: i.e., the box is non-empty -/
  lower_lt_upper : ∀ i, lower i < upper i

{ι : Type u_2}
(self : BoxIntegral.Box ι)
(i : ι)


theorem embedding_coe_ennreal : Embedding ((↑) : ℝ≥0∞ → EReal)


/-- Given a family of opens `U` and an open `Y` equal to the union of opens in `U`, we may
    take the presieve on `Y` associated to `U` and the sieve generated by it, and form the
    full subcategory (subposet) of opens contained in `Y` (`over Y`) consisting of arrows
    in the sieve. This full subcategory is equivalent to `OpensLeCover U`, the (poset)
    category of opens contained in some `U i`. -/
@[simps]
def generateEquivalenceOpensLe :
    (FullSubcategory fun f : Over Y => (Sieve.generate (presieveOfCoveringAux U Y)).arrows f.hom) ≌
    OpensLeCover U

{X : TopCat}
{ι : Type w}
(U : ι → TopologicalSpace.Opens ↑X)
{Y : TopologicalSpace.Opens ↑X}
(hY : Y = iSup U)

(TopCat.Presheaf.generateEquivalenceOpensLe U hY).functor = TopCat.Presheaf.generateEquivalenceOpensLe_functor' U ⋯


@[simp] theorem toCoalgEquiv_symm (e : X ≅ Y) :
    toCoalgEquiv e.symm = (toCoalgEquiv e).symm

{R : Type u}
[CommRing R]
{X Y : CoalgebraCat R}
(e : X ≅ Y)


@[simp]
theorem comp_assoc (f : sInfHom γ δ) (g : sInfHom β γ) (h : sInfHom α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[InfSet α]
[InfSet β]
[InfSet γ]
[InfSet δ]
(f : sInfHom γ δ)
(g : sInfHom β γ)
(h : sInfHom α β)


theorem TendstoUniformlyOnFilter.congr {F' : ι → α → β} (hf : TendstoUniformlyOnFilter F f p p')
    (hff' : ∀ᶠ n : ι × α in p ×ˢ p', F n.fst n.snd = F' n.fst n.snd) :
    TendstoUniformlyOnFilter F' f p p'

{F : ι → α → β}

{F' : ι → α → β}

(hff' : ∀ᶠ (n : ι × α) in p ×ˢ p', F n.1 n.2 = F' n.1 n.2)


protected theorem ssubset_of_subset_of_ssubset {s₁ s₂ s₃ : Set α} (hs₁s₂ : s₁ ⊆ s₂)
    (hs₂s₃ : s₂ ⊂ s₃) : s₁ ⊂ s₃

{α : Type u}
{s₁ s₂ s₃ : Set α}
(hs₁s₂ : s₁ ⊆ s₂)
(hs₂s₃ : s₂ ⊂ s₃)


protected theorem map_prod [CommSemiring R] [CommSemiring S] (g : R ≃+* S) (f : α → R)
    (s : Finset α) : g (∏ x ∈ s, f x) = ∏ x ∈ s, g (f x)

{α : Type u_1}
{R : Type u_2}
{S : Type u_3}
[CommSemiring R]
[CommSemiring S]
(g : R ≃+* S)
(f : α → R)
(s : Finset α)


@[simp]
theorem inseparable_eq_eq [T0Space X] : Inseparable = @Eq X

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


/-- The inclusion of the subterminal objects into the original category. -/
@[simps!]
def subterminalInclusion : Subterminals C ⥤ C

(self : CategoryTheory.FullSubcategory fun A => CategoryTheory.IsSubterminal A)

(CategoryTheory.subterminalInclusion C).obj self = self.obj


theorem Finite.exists_univ_list (α) [Finite α] : ∃ l : List α, l.Nodup ∧ ∀ x : α, x ∈ l


theorem hasNext : ∀ {it}, ValidFor l r it → (it.hasNext ↔ r ≠ [])

{l r : List Char}
{it : String.Iterator}

String.Iterator.ValidFor l r it → (it.hasNext = true ↔ r ≠ [])


@[to_additive exponent_nsmul_eq_zero]
theorem pow_exponent_eq_one (g : G) : g ^ exponent G = 1


/-- Explicit formula for the derivative of the Gamma function at positive integers, in terms of
harmonic numbers and the Euler-Mascheroni constant `γ`. -/
lemma deriv_Gamma_nat (n : ℕ) :
    deriv Gamma (n + 1) = n ! * (-γ + harmonic n)

deriv Real.Gamma (↑n + 1) = ↑n ! * (-γ + ↑(harmonic n))


lemma delta_mul_eq_smul_delta {f : ℕ → ℂ} : δ * f = f 1 • δ


theorem Poly.of_isZero (ctx : Context) {p : Poly} (h : isZero p = true) : p.denote ctx = 0

(ctx : Nat.Linear.Context)
{p : Nat.Linear.Poly}
(h : p.isZero = true)


@[to_additive]
theorem inv_mem_Ioo_iff : a⁻¹ ∈ Set.Ioo c d ↔ a ∈ Set.Ioo d⁻¹ c⁻¹

{α : Type u_1}
[OrderedAddCommGroup α]
{a c d : α}

-a ∈ Set.Ioo c d ↔ a ∈ Set.Ioo (-d) (-c)


@[simp]
theorem map_prodComm_prod :
    map ((RingEquiv.prodComm : R × S ≃+* S × R) : R × S →+* S × R) (prod I J) = prod J I

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(I : Ideal R)
(J : Ideal S)

Ideal.map (↑RingEquiv.prodComm) (I.prod J) = J.prod I


theorem measure_eq_measure_larger_of_between_null_diff {s₁ s₂ s₃ : Set α} (h12 : s₁ ⊆ s₂)
    (h23 : s₂ ⊆ s₃) (h_nulldiff : μ (s₃ \ s₁) = 0) : μ s₂ = μ s₃

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ s₃ : Set α}
(h12 : s₁ ⊆ s₂)
(h23 : s₂ ⊆ s₃)
(h_nulldiff : μ (s₃ \ s₁) = 0)


theorem sum_ite_self_eq' [DecidableEq α] {N : Type*} [AddCommMonoid N] (f : α →₀ N) (a : α) :
    (f.sum fun x v => ite (x = a) v 0) = f a

{α : Type u_1}
[DecidableEq α]
{N : Type u_16}
[AddCommMonoid N]
(f : α →₀ N)
(a : α)

(f.sum fun x v => if x = a then v else 0) = f a


theorem IsCompact.isGLB_sInf [ClosedIicTopology α] {s : Set α} (hs : IsCompact s)
    (ne_s : s.Nonempty) : IsGLB s (sInf s)

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[ClosedIicTopology α]
{s : Set α}
(hs : IsCompact s)
(ne_s : s.Nonempty)


theorem exists_vecMul_eq_zero_iff {A : Type*} [DecidableEq n] [CommRing A] [IsDomain A]
    {M : Matrix n n A} : (∃ v ≠ 0, v ᵥ* M = 0) ↔ M.det = 0

{n : Type u_1}
[Fintype n]
{A : Type u_4}
[DecidableEq n]
[CommRing A]
[IsDomain A]
{M : Matrix n n A}

(∃ v, v ≠ 0 ∧ Matrix.vecMul v M = 0) ↔ M.det = 0


theorem getElem_le_maximum_of_length_pos {i : ℕ} (w : i < l.length) (h := (Nat.zero_lt_of_lt w)) :
    l[i] ≤ l.maximum_of_length_pos h

{α : Type u_1}
[LinearOrder α]
{l : List α}
{i : ℕ}
(w : i < l.length)
(h : 0 < l.length := ⋯)


@[to_additive]
theorem measure_set_eq (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ) {A : Set α}
    (hA₀ : MeasurableSet A) (hA : ∀ g : G, (fun x => g • x) ⁻¹' A = A) : μ (A ∩ s) = μ (A ∩ t)

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.IsAddFundamentalDomain G s μ)

(ht : MeasureTheory.IsAddFundamentalDomain G t μ)

(hA : ∀ (g : G), (fun x => g +ᵥ x) ⁻¹' A = A)


/-- A right homology data for a short complex `S` in the opposite category
induces a left homology data for `S.unop`. -/
@[simps]
def unop {S : ShortComplex Cᵒᵖ} (h : S.RightHomologyData) : S.unop.LeftHomologyData


/-- The right fraction corresponding to a left fraction in the opposite category. -/
@[simps]
def LeftFraction.unop {W : MorphismProperty Cᵒᵖ}
    {X Y : Cᵒᵖ} (φ : W.LeftFraction X Y) :
    W.unop.RightFraction (Opposite.unop Y) (Opposite.unop X)

{W : CategoryTheory.MorphismProperty Cᵒᵖ}


/-- The composition of an updated function with an equiv on a subtype can be expressed as an
updated function. -/
-- Porting note: replace `s : Set α` and `: s` with `p : α → Prop` and `: Subtype p`, since the
-- former now unfolds syntactically to a less general case of the latter.
theorem dite_comp_equiv_update {α : Type*} {β : Sort*} {γ : Sort*} {p : α → Prop}
    (e : β ≃ Subtype p)
    (v : β → γ) (w : α → γ) (j : β) (x : γ) [DecidableEq β] [DecidableEq α]
    [∀ j, Decidable (p j)] :
    (fun i : α => if h : p i then (Function.update v j x) (e.symm ⟨i, h⟩) else w i) =
      Function.update (fun i : α => if h : p i then v (e.symm ⟨i, h⟩) else w i) (e j) x

{α : Type u_1}
{β : Sort u_2}
{γ : Sort u_3}
{p : α → Prop}
(e : β ≃ Subtype p)
(v : β → γ)
(w : α → γ)
(j : β)
(x : γ)
[DecidableEq β]
[DecidableEq α]
[(j : α) → Decidable (p j)]

(fun i => if h : p i then Function.update v j x (e.symm ⟨i, h⟩) else w i) =
  Function.update (fun i => if h : p i then v (e.symm ⟨i, h⟩) else w i) (↑(e j)) x


/-- Reflecting an orthogonal vector plus a point in the subspace
produces the negation of that vector plus the point. -/
theorem reflection_orthogonal_vadd {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] {p : P} (hp : p ∈ s) {v : V} (hv : v ∈ s.directionᗮ) :
    reflection s (v +ᵥ p) = -v +ᵥ p

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

(EuclideanGeometry.reflection s) (v +ᵥ p) = -v +ᵥ p


theorem conjugate_lt_conjugate' {a b : R} (hab : a < b) {c : R} (hc : IsRegular c) :
    c * a * star c < c * b * star c

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{a b : R}
(hab : a < b)
{c : R}
(hc : IsRegular c)


/-- A natural number is odd iff it has residue `1` or `3` mod `4`-/
theorem odd_mod_four_iff {n : ℕ} : n % 2 = 1 ↔ n % 4 = 1 ∨ n % 4 = 3


lemma continuous_coinducingCoprod {S : LightProfinite.{u}} (x : X.val.obj ⟨S⟩) :
    Continuous fun a ↦ (X.coinducingCoprod ⟨⟨S, x⟩, a⟩)

(X : LightCondSet)
{S : LightProfinite}
(x : X.val.obj (Opposite.op S))

Continuous fun a => LightCondSet.coinducingCoprod X ⟨⟨S, x⟩, a⟩


@[simp]
theorem preimage_cast_Iio (p : ℚ≥0) : (↑) ⁻¹' Iio (p : K) = Iio p

{K : Type u_5}
[LinearOrderedSemifield K]
(p : ℚ≥0)


theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
    orderEmbeddingOfSet s n = Subtype.ofNat s n

{s : Set ℕ}
[Infinite ↑s]
[DecidablePred fun x => x ∈ s]
{n : ℕ}

(Nat.orderEmbeddingOfSet s) n = ↑(Nat.Subtype.ofNat s n)


lemma HurwitzZeta.hurwitzZetaEven_zero : hurwitzZetaEven 0 = riemannZeta

HurwitzZeta.hurwitzZetaEven 0 = riemannZeta


theorem smul_induction {C : Word M → Prop} (h_empty : C empty)
    (h_smul : ∀ (i) (m : M i) (w), C w → C (of m • w)) (w : Word M) : C w

(h_smul : ∀ (i : ι) (m : M i) (w : Monoid.CoprodI.Word M), C w → C (Monoid.CoprodI.of m • w))


theorem mul_mem_sup {S T : StarSubalgebra R A} {x y : A} (hx : x ∈ S) (hy : y ∈ T) :
    x * y ∈ S ⊔ T

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S T : StarSubalgebra R A}
{x y : A}
(hx : x ∈ S)
(hy : y ∈ T)


theorem injective_nhdsSet [T1Space X] : Function.Injective (𝓝ˢ : Set X → Filter X)

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


@[nontriviality]
lemma of_subsingleton_left [Subsingleton α] : EventuallyConst f l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
[Subsingleton α]


protected theorem ContinuousLinearEquiv.summable {f : ι → M} (e : M ≃SL[σ] M₂) :
    (Summable fun b : ι ↦ e (f b)) ↔ Summable f

{ι : Type u_5}
{R : Type u_7}
{R₂ : Type u_8}
{M : Type u_9}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M₂]
[Module R₂ M₂]
[TopologicalSpace M]
[TopologicalSpace M₂]
{σ : R →+* R₂}
{σ' : R₂ →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
{f : ι → M}
(e : M ≃SL[σ] M₂)

(Summable fun b => e (f b)) ↔ Summable f


theorem Valid'.node3L {l} {x : α} {m} {y : α} {r o₁ o₂} (hl : Valid' o₁ l x) (hm : Valid' x m y)
    (hr : Valid' y r o₂) (H1 : BalancedSz (size l) (size m))
    (H2 : BalancedSz (size l + size m + 1) (size r)) : Valid' o₁ (@node3L α l x m y r) o₂

(H2 : Ordnode.BalancedSz (l.size + m.size + 1) r.size)


theorem prod_mono_left (t : Subring S) : Monotone fun s : Subring R => s.prod t

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(t : Subring S)


theorem addHaar_closedBall_center {E : Type*} [NormedAddCommGroup E] [MeasurableSpace E]
    [BorelSpace E] (μ : Measure E) [IsAddHaarMeasure μ] (x : E) (r : ℝ) :
    μ (closedBall x r) = μ (closedBall (0 : E) r)

{E : Type u_3}
[NormedAddCommGroup E]
[MeasurableSpace E]
[BorelSpace E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(x : E)
(r : ℝ)

μ (Metric.closedBall x r) = μ (Metric.closedBall 0 r)


theorem to_iso [h' : Epi f.1.base] : IsIso f

{X Y : AlgebraicGeometry.LocallyRingedSpace}

[H : AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion f]


@[simp]
theorem fst_hnot [HNot α] [HNot β] (a : α × β) : (￢a).1 = ￢a.1

{α : Type u_2}
{β : Type u_3}
[HNot α]
[HNot β]
(a : α × β)


theorem coprod.desc_comp_assoc {C : Type u} [Category C] {V W X Y : C}
    [HasBinaryCoproduct X Y] (f : V ⟶ W) (g : X ⟶ V) (h : Y ⟶ V) {Z : C} (l : W ⟶ Z) :
    coprod.desc g h ≫ f ≫ l = coprod.desc (g ≫ f) (h ≫ f) ≫ l

CategoryTheory.Limits.coprod.desc g h ≫ f ≫ l = CategoryTheory.Limits.coprod.desc (g ≫ f) (h ≫ f) ≫ l


theorem strictAntiOn_deriv (hfc : StrictConcaveOn ℝ S f) (hfd : ∀ x ∈ S, DifferentiableAt ℝ f x) :
    StrictAntiOn (deriv f) S

{S : Set ℝ}
{f : ℝ → ℝ}
(hfc : StrictConcaveOn ℝ S f)
(hfd : ∀ x ∈ S, DifferentiableAt ℝ f x)


/-- `zsmul` is equal to any other module structure via a cast. -/
lemma Int.cast_smul_eq_nsmul (n : ℤ) (b : M) : (n : R) • b = n • b

(R : Type u_2)
{M : Type u_5}
[Ring R]
[AddCommGroup M]
[Module R M]
(n : ℤ)
(b : M)


theorem ContDiff.sinh {n} (h : ContDiff ℝ n f) : ContDiff ℝ n fun x => Real.sinh (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{n : ℕ∞}
(h : ContDiff ℝ n f)


theorem sInter [ContinuousAdd 𝕜] {F : Finset (Set E)} (hF : F.Nonempty)
    (hAF : ∀ B ∈ F, IsExposed 𝕜 A B) : IsExposed 𝕜 A (⋂₀ F)

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace 𝕜]
[OrderedRing 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
{A : Set E}
[ContinuousAdd 𝕜]
{F : Finset (Set E)}
(hF : F.Nonempty)
(hAF : ∀ B ∈ F, IsExposed 𝕜 A B)


theorem hasColimitsOfShape_of_final [HasColimitsOfShape C E] : HasColimitsOfShape D E


/-- Conjugating preserves self-adjointness. -/
theorem adjoint_conj {T : E →L[𝕜] E} (hT : IsSelfAdjoint T) (S : F →L[𝕜] E) :
    IsSelfAdjoint (ContinuousLinearMap.adjoint S ∘L T ∘L S)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[CompleteSpace E]
[CompleteSpace F]
{T : E →L[𝕜] E}
(hT : IsSelfAdjoint T)
(S : F →L[𝕜] E)

IsSelfAdjoint ((ContinuousLinearMap.adjoint S).comp (T.comp S))


theorem modify_size [BEq α] [Hashable α] {m : Imp α β} {k}
    (h : m.size = m.buckets.size) :
    (modify m k f).size = (modify m k f).buckets.size

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

(m.modify k f).size = (m.modify k f).buckets.size


/-- `x` is a cluster point of a set `s` if every neighbourhood of `x` meets `s` on a nonempty
set. See also `mem_closure_iff_clusterPt`. -/
theorem clusterPt_principal_iff :
    ClusterPt x (𝓟 s) ↔ ∀ U ∈ 𝓝 x, (U ∩ s).Nonempty

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]


@[to_additive sum_lt_sum_of_nonempty]
theorem prod_lt_prod_of_nonempty' (hs : s.Nonempty) (hlt : ∀ i ∈ s, f i < g i) :
    ∏ i ∈ s, f i < ∏ i ∈ s, g i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelAddCommMonoid M]
{f g : ι → M}
{s : Finset ι}
(hs : s.Nonempty)
(hlt : ∀ i ∈ s, f i < g i)


lemma nmem_nonZeroDivisorsLeft_iff {r : M₀} :
    r ∉ nonZeroDivisorsLeft M₀ ↔ {s | s * r = 0 ∧ s ≠ 0}.Nonempty

(M₀ : Type u_1)
[MonoidWithZero M₀]
{r : M₀}


/-- Auxiliary definition for `mapBifunctorShift₂Iso`. -/
@[simps! hom_f_f inv_f_f]
def mapBifunctorHomologicalComplexShift₂Iso :
    ((F.mapBifunctorHomologicalComplex _ _).obj K₁).obj (K₂⟦y⟧) ≅
    (HomologicalComplex₂.shiftFunctor₂ D y).obj
      (((F.mapBifunctorHomologicalComplex _ _).obj K₁).obj K₂)

∀ (i_1 : ℤ),
  ((K₁.mapBifunctorHomologicalComplexShift₂Iso K₂ F y).inv.f i).f i_1 = 𝟙 ((F.obj (K₁.X i)).obj (K₂.X (i_1 + y)))


protected theorem refl (s : Subtype p) : s ≈ s

{α : Sort u_1}
{p : α → Prop}
[Setoid α]
(s : Subtype p)


@[simp]
theorem erase_toFinmap (a : α) (s : AList β) : erase a ⟦s⟧ = AList.toFinmap (s.erase a)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : AList β)


@[simp]
theorem not_finite_iff_infinite : ¬Finite α ↔ Infinite α


lemma normal_iff_forall_fieldRange_eq : Normal F K ↔ ∀ σ : K →ₐ[F] L, σ.fieldRange = 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 ↔ ∀ (σ : ↥K →ₐ[F] L), σ.fieldRange = K


theorem Base.diff_finite_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).Finite ↔ (B₂ \ B₁).Finite

{α : Type u_1}
{M : Matroid α}
{B₁ B₂ : Set α}
(hB₁ : M.Base B₁)
(hB₂ : M.Base B₂)


@[simp]
theorem comp_symm (e : R ≃+* S) : (e : R →+* S).comp (e.symm : S →+* R) = RingHom.id S

{R : Type u_4}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]
(e : R ≃+* S)


theorem leftInverse_list : Function.LeftInverse (ofList γ) (toList _)

Function.LeftInverse (WType.ofList γ) (WType.toList γ)


@[simp] lemma ofLex_intCast [IntCast R] (n : ℤ) : (ofLex n : R) = n


theorem blsub_comp {o o' : Ordinal.{max u v}} {f : ∀ a < o, Ordinal.{max u v w}}
    (hf : ∀ {i j} (hi) (hj), i ≤ j → f i hi ≤ f j hj) {g : ∀ a < o', Ordinal.{max u v}}
    (hg : blsub.{_, u} o' g = o) :
    (blsub.{_, w} o' fun a ha => f (g a ha) (by rw [← hg]; apply lt_blsub)) = blsub.{_, w} o f

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

(hf : ∀ {i j : Ordinal.{max u v}} (hi : i < o) (hj : j < o), i ≤ j → f i hi ≤ f j hj)

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

(o'.blsub fun a ha => f (g a ha) ⋯) = o.blsub f


@[reassoc (attr := simp)]
theorem PInftyToNormalizedMooreComplex_comp_inclusionOfMooreComplexMap (X : SimplicialObject A) :
    PInftyToNormalizedMooreComplex X ≫ inclusionOfMooreComplexMap X = PInfty

{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
[CategoryTheory.Abelian A]
(X : CategoryTheory.SimplicialObject A)

AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex X ≫ AlgebraicTopology.inclusionOfMooreComplexMap X =
  AlgebraicTopology.DoldKan.PInfty


theorem hasStrictFDerivAt_norm_sq (x : F) :
    HasStrictFDerivAt (fun x => ‖x‖ ^ 2) (2 • (innerSL ℝ x)) x

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

HasStrictFDerivAt (fun x => ‖x‖ ^ 2) (2 • (innerSL ℝ) x) x


/-- The functor which sends `S : SnakeInput C` to its zeroth line `S.L₁`. -/
@[simps]
def functorL₁ : SnakeInput C ⥤ ShortComplex C

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]

∀ {X Y : CategoryTheory.ShortComplex.SnakeInput C} (f : X ⟶ Y),
  CategoryTheory.ShortComplex.SnakeInput.functorL₁.map f = f.f₁


protected theorem add_le_of_le_sub' {n k m : Nat} (h : m ≤ k) : n ≤ k - m → m + n ≤ k


theorem mono_iff_mono_right [HasPullbacks C] {f g : Under X} (h : f ⟶ g) : Mono h ↔ Mono h.right

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : C}
[CategoryTheory.Limits.HasPullbacks C]
{f g : CategoryTheory.Under X}
(h : f ⟶ g)

CategoryTheory.Mono h ↔ CategoryTheory.Mono h.right


theorem two_le_of_mem_cycleType {σ : Perm α} {n : ℕ} (h : n ∈ σ.cycleType) : 2 ≤ n

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ : Equiv.Perm α}
{n : ℕ}
(h : n ∈ σ.cycleType)


@[reassoc (attr := simp)]
theorem cokernelIsoOfEq_hom_comp_desc {Z} {f g : X ⟶ Y} [HasCokernel f] [HasCokernel g] (h : f = g)
    (e : Y ⟶ Z) (he) :
    (cokernelIsoOfEq h).hom ≫ cokernel.desc _ e he = cokernel.desc _ e (by simp [h, he])

(CategoryTheory.Limits.cokernelIsoOfEq h).hom ≫ CategoryTheory.Limits.cokernel.desc g e he =
  CategoryTheory.Limits.cokernel.desc f e ⋯


theorem uniqueMDiffOn_iff_uniqueDiffOn : UniqueMDiffOn 𝓘(𝕜, E) s ↔ UniqueDiffOn 𝕜 s

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


/-- The L-series of a Dirichlet character mod `N > 0` converges absolutely at `s` if and only if
`re s > 1`. -/
lemma LSeriesSummable_iff {N : ℕ} (hN : N ≠ 0) (χ : DirichletCharacter ℂ N) {s : ℂ} :
    LSeriesSummable ↗χ s ↔ 1 < s.re

LSeriesSummable (fun n => χ ↑n) s ↔ 1 < s.re


@[simp]
lemma abs_mul_sin_arg (x : ℂ) : abs x * Real.sin (arg x) = x.im


theorem DifferentiableWithinAt.cosh (hf : DifferentiableWithinAt ℝ f s x) :
    DifferentiableWithinAt ℝ (fun x => Real.cosh (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℝ f s x)


lemma completeSpace_continuousMultilinearMap_iff {m : ∀ i, M i} (hm : ∀ i, m i ≠ 0) :
    CompleteSpace (ContinuousMultilinearMap 𝕜 M F) ↔ CompleteSpace F

(𝕜 : Type u_3)
(F : Type u_5)
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{ι : Type u_6}
[Finite ι]
{M : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (M i)]
[(i : ι) → NormedSpace 𝕜 (M i)]
[∀ (i : ι), SeparatingDual 𝕜 (M i)]
{m : (i : ι) → M i}
(hm : ∀ (i : ι), m i ≠ 0)


theorem liftPropWithinAt_univ : LiftPropWithinAt P g univ x ↔ LiftPropAt P g x

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{P : (H → H') → Set H → H → Prop}
{g : M → M'}
{x : M}

ChartedSpace.LiftPropWithinAt P g Set.univ x ↔ ChartedSpace.LiftPropAt P g x


@[to_additive (attr := simp)]
theorem lift_quot_mk {φ : G →* M} (HN : N ≤ φ.ker) (g : G) :
    lift N φ HN (Quot.mk _ g : Q) = φ g

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]
{M : Type x}
[Monoid M]
{φ : G →* M}
(HN : N ≤ φ.ker)
(g : G)

(QuotientGroup.lift N φ HN) (Quot.mk Setoid.r g) = φ g


theorem antitoneOn_rpow_Ioi_of_exponent_nonpos {r : ℝ} (hr : r ≤ 0) :
    AntitoneOn (fun (x : ℝ) => x ^ r) (Set.Ioi 0)


/-- This is a mixin class describing a locally finite order,
that is, is an order where bounded intervals are finite.
When you don't care too much about definitional equality, you can use `LocallyFiniteOrder.ofIcc` or
`LocallyFiniteOrder.ofFiniteIcc` to build a locally finite order from just `Finset.Icc`. -/
class LocallyFiniteOrder (α : Type*) [Preorder α] where
  /-- Left-closed right-closed interval -/
  finsetIcc : α → α → Finset α
  /-- Left-closed right-open interval -/
  finsetIco : α → α → Finset α
  /-- Left-open right-closed interval -/
  finsetIoc : α → α → Finset α
  /-- Left-open right-open interval -/
  finsetIoo : α → α → Finset α
  /-- `x ∈ finsetIcc a b ↔ a ≤ x ∧ x ≤ b` -/
  finset_mem_Icc : ∀ a b x : α, x ∈ finsetIcc a b ↔ a ≤ x ∧ x ≤ b
  /-- `x ∈ finsetIco a b ↔ a ≤ x ∧ x < b` -/
  finset_mem_Ico : ∀ a b x : α, x ∈ finsetIco a b ↔ a ≤ x ∧ x < b
  /-- `x ∈ finsetIoc a b ↔ a < x ∧ x ≤ b` -/
  finset_mem_Ioc : ∀ a b x : α, x ∈ finsetIoc a b ↔ a < x ∧ x ≤ b
  /-- `x ∈ finsetIoo a b ↔ a < x ∧ x < b` -/
  finset_mem_Ioo : ∀ a b x : α, x ∈ finsetIoo a b ↔ a < x ∧ x < b

{α : Type u_1}
[Preorder α]
[self : LocallyFiniteOrder α]
(a b x : α)

x ∈ LocallyFiniteOrder.finsetIoo a b ↔ a < x ∧ x < b


lemma succ_neg_succ (a : ℤ) : succ (-succ a) = -a


theorem eq_nil_iff_forall_not_mem {l : List α} : l = [] ↔ ∀ a, a ∉ l


@[reassoc (attr := simp)]
theorem conePointUniqueUpToIso_hom_comp {s t : Cone F} (P : IsLimit s) (Q : IsLimit t) (j : J) :
    (conePointUniqueUpToIso P Q).hom ≫ t.π.app j = s.π.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{s t : CategoryTheory.Limits.Cone F}
(P : CategoryTheory.Limits.IsLimit s)
(Q : CategoryTheory.Limits.IsLimit t)
(j : J)

(P.conePointUniqueUpToIso Q).hom ≫ t.π.app j = s.π.app j


/-- Given `Fintype α`, `linearEquivFunOnFintype R` is the natural `R`-linear equivalence
between `⨁ i, M i` and `∀ i, M i`. -/
@[simps apply]
def linearEquivFunOnFintype [Fintype ι] : (⨁ i, M i) ≃ₗ[R] ∀ i, M i

(R : Type u)
[Semiring R]
(ι : Type v)
(M : ι → Type w)
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
[Fintype ι]

∀ (a : Π₀ (i : ι), (fun i => M i) i) (a_1 : ι), (DirectSum.linearEquivFunOnFintype R ι M) a a_1 = a a_1


/-- Product divergence test: if `f` is unconditionally multipliable, then `f x` tends to one along
`cofinite`. -/
@[to_additive "Series divergence test: if `f` is unconditionally summable, then `f x` tends to zero
along `cofinite`."]
theorem Multipliable.tendsto_cofinite_one (hf : Multipliable f) : Tendsto f cofinite (𝓝 1)

{α : Type u_1}
{G : Type u_5}
[TopologicalSpace G]
[AddCommGroup G]
[TopologicalAddGroup G]
{f : α → G}
(hf : Summable f)


theorem findIdxs_cons :
    (x :: xs : List α).findIdxs p =
      bif p x then 0 :: (xs.findIdxs p).map (· + 1) else (xs.findIdxs p).map (· + 1)

{α : Type u_1}
{x : α}
{xs : List α}
{p : α → Bool}

List.findIdxs p (x :: xs) =
  bif p x then 0 :: List.map (fun x => x + 1) (List.findIdxs p xs) else List.map (fun x => x + 1) (List.findIdxs p xs)


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


@[simp]
lemma rightUnshift_add {n' a : ℤ} (γ₁ γ₂ : Cochain K (L⟦a⟧) n') (n : ℤ) (hn : n' + a = n) :
    (γ₁ + γ₂).rightUnshift n hn = γ₁.rightUnshift n hn + γ₂.rightUnshift n hn

(γ₁ γ₂ : CochainComplex.HomComplex.Cochain K ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj L) n')


@[simp, norm_cast]
theorem tendsto_coe {f : Filter α} {m : α → ℝ≥0} {x : ℝ≥0} :
    Tendsto (fun a => (m a : ℝ)) f (𝓝 (x : ℝ)) ↔ Tendsto m f (𝓝 x)

{α : Type u_1}
{f : Filter α}
{m : α → NNReal}
{x : NNReal}

Filter.Tendsto (fun a => ↑(m a)) f (𝓝 ↑x) ↔ Filter.Tendsto m f (𝓝 x)


theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c p₁ p₂ : P}

c ∈ AffineSubspace.perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂


theorem algebraicIndependent_comp_subtype {s : Set ι} :
    AlgebraicIndependent R (x ∘ (↑) : s → A) ↔
      ∀ p ∈ MvPolynomial.supported R s, aeval x p = 0 → p = 0

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
{s : Set ι}

AlgebraicIndependent R (x ∘ Subtype.val) ↔ ∀ p ∈ MvPolynomial.supported R s, (MvPolynomial.aeval x) p = 0 → p = 0


@[simp]
theorem preimage_const_sub_Ici : (fun x => a - x) ⁻¹' Ici b = Iic (a - b)

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

(fun x => a - x) ⁻¹' Set.Ici b = Set.Iic (a - b)


theorem norm_midpoint_lt_iff (h : ‖x‖ = ‖y‖) : ‖(1 / 2 : ℝ) • (x + y)‖ < ‖x‖ ↔ x ≠ y

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y : E}
(h : ‖x‖ = ‖y‖)


@[simp]
theorem cons_ne_self (a : α) (l : List α) : a :: l ≠ l


/-- The determinant of `LinearMap.toMatrix` does not depend on the choice of basis. -/
theorem det_toMatrix_eq_det_toMatrix [DecidableEq κ] (b : Basis ι A M) (c : Basis κ A M)
    (f : M →ₗ[A] M) : det (LinearMap.toMatrix b b f) = det (LinearMap.toMatrix c c f)

{M : Type u_2}
[AddCommGroup M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
{A : Type u_5}
[CommRing A]
[Module A M]
{κ : Type u_6}
[Fintype κ]
[DecidableEq κ]
(b : Basis ι A M)
(c : Basis κ A M)
(f : M →ₗ[A] M)

((LinearMap.toMatrix b b) f).det = ((LinearMap.toMatrix c c) f).det


@[ext]
lemma prod_ext {a : C} (z w : (prod F G).obj a) (h1 : z.1 = w.1) (h2 : z.2 = w.2) :
    z = w

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

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


@[to_additive]
lemma mulIndicator_iUnion_apply (h1 : (⊥ : M) = 1) (s : ι → Set α) (f : α → M) (x : α) :
    mulIndicator (⋃ i, s i) f x = ⨆ i, mulIndicator (s i) f x

{ι : Sort u_1}
{α : Type u_2}
{M : Type u_4}
[CompleteLattice M]
[Zero M]
(h1 : ⊥ = 0)
(s : ι → Set α)
(f : α → M)
(x : α)

(⋃ i, s i).indicator f x = ⨆ i, (s i).indicator f x


@[simp, norm_cast]
theorem coe_natCast (n : ℕ) : ((n : s) : R) = n

{R : Type u}
{S : Type v}
[Ring R]
[SetLike S R]
[hSR : SubringClass S R]
(s : S)
(n : ℕ)


theorem Expr.eq_of_toNormPoly (ctx : Context) (a b : Expr) (h : a.toNormPoly = b.toNormPoly) : a.denote ctx = b.denote ctx

(ctx : Nat.Linear.Context)
(a b : Nat.Linear.Expr)
(h : a.toNormPoly = b.toNormPoly)

Nat.Linear.Expr.denote ctx a = Nat.Linear.Expr.denote ctx b


/-- The data needed to induce a `MonoidalCategory` via the functor `F`; namely, pre-existing
definitions of `⊗`, `𝟙_`, `▷`, `◁` that are preserved by `F`.
-/
structure InducingFunctorData [MonoidalCategoryStruct D] (F : D ⥤ C) where
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.μIso` -/
  μIso : ∀ X Y,
    F.obj X ⊗ F.obj Y ≅ F.obj (X ⊗ Y)
  whiskerLeft_eq : ∀ (X : D) {Y₁ Y₂ : D} (f : Y₁ ⟶ Y₂),
    F.map (X ◁ f) = (μIso _ _).inv ≫ (F.obj X ◁ F.map f) ≫ (μIso _ _).hom := by
    aesop_cat
  whiskerRight_eq : ∀ {X₁ X₂ : D} (f : X₁ ⟶ X₂) (Y : D),
    F.map (f ▷ Y) = (μIso _ _).inv ≫ (F.map f ▷ F.obj Y) ≫ (μIso _ _).hom := by
    aesop_cat
  tensorHom_eq : ∀ {X₁ Y₁ X₂ Y₂ : D} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
    F.map (f ⊗ g) = (μIso _ _).inv ≫ (F.map f ⊗ F.map g) ≫ (μIso _ _).hom := by
    aesop_cat
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.εIso` -/
  εIso : 𝟙_ _ ≅ F.obj (𝟙_ _)
  associator_eq : ∀ X Y Z : D,
    F.map (α_ X Y Z).hom =
      (((μIso _ _).symm ≪≫ ((μIso _ _).symm ⊗ .refl _))
        ≪≫ α_ (F.obj X) (F.obj Y) (F.obj Z)
        ≪≫ ((.refl _ ⊗ μIso _ _) ≪≫ μIso _ _)).hom := by
    aesop_cat
  leftUnitor_eq : ∀ X : D,
    F.map (λ_ X).hom =
      (((μIso _ _).symm ≪≫ (εIso.symm ⊗ .refl _)) ≪≫ λ_ (F.obj X)).hom := by
    aesop_cat
  rightUnitor_eq : ∀ X : D,
    F.map (ρ_ X).hom =
      (((μIso _ _).symm ≪≫ (.refl _ ⊗ εIso.symm)) ≪≫ ρ_ (F.obj X)).hom := by
    aesop_cat

(self : CategoryTheory.Monoidal.InducingFunctorData F)

F.map (f ▷ Y) = (self.μIso X₁ Y).inv ≫ F.map f ▷ F.obj Y ≫ (self.μIso X₂ Y).hom


@[simp]
theorem sumCongrHom.card_range {α β : Type*} [Fintype (sumCongrHom α β).range]
    [Fintype (Perm α × Perm β)] :
    Fintype.card (sumCongrHom α β).range = Fintype.card (Perm α × Perm β)

[Fintype ↥(Equiv.Perm.sumCongrHom α β).range]

Fintype.card ↥(Equiv.Perm.sumCongrHom α β).range = Fintype.card (Equiv.Perm α × Equiv.Perm β)


theorem tendsto_embedBox_toFilteriUnion_top (l : IntegrationParams) (h : I ≤ J) :
    Tendsto (TaggedPrepartition.embedBox I J h) (l.toFilteriUnion I ⊤)
      (l.toFilteriUnion J (Prepartition.single J I h))

{ι : Type u_1}
[Fintype ι]
{I J : BoxIntegral.Box ι}
(l : BoxIntegral.IntegrationParams)
(h : I ≤ J)

Filter.Tendsto (⇑(BoxIntegral.TaggedPrepartition.embedBox I J h)) (l.toFilteriUnion I ⊤)
  (l.toFilteriUnion J (BoxIntegral.Prepartition.single J I h))


@[simp] theorem concat_take_get {n : ℕ} {s : Stream' α} : s.take n ++ [s.get n] = s.take (n+1)

Stream'.take n s ++ [s.get n] = Stream'.take (n + 1) s


theorem mulMap_bot_right_eq : mulMap A ⊥ = A.val.comp A.rTensorBot.toAlgHom

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


@[simp]
theorem one_compl : (1 : { p : R // IsIdempotentElem p })ᶜ = 0


@[simp]
theorem coe_mk (f : A →ₙ+* B) (h) :
    ((⟨f, h⟩ : A  →⋆ₙ+* B) : A → B) = f

(h : ∀ (a : A), f.toFun (star a) = star (f.toFun a))

⇑{ toNonUnitalRingHom := f, map_star' := h } = ⇑f


@[simp]
theorem affineSpan_convexHull (s : Set E) : affineSpan 𝕜 (convexHull 𝕜 s) = affineSpan 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(s : Set E)

affineSpan 𝕜 ((convexHull 𝕜) s) = affineSpan 𝕜 s


theorem IsFraction.eq_mk' {U : Opens (PrimeSpectrum.Top R)} {f : ∀ x : U, Localizations R x}
    (hf : IsFraction f) :
    ∃ r s : R,
      ∀ x : U,
        ∃ hs : s ∉ x.1.asIdeal,
          f x =
            IsLocalization.mk' (Localization.AtPrime _) r
              (⟨s, hs⟩ : (x : PrimeSpectrum.Top R).asIdeal.primeCompl)

{U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R)}

{f : (x : ↥U) → AlgebraicGeometry.StructureSheaf.Localizations R ↑x}

(hf : AlgebraicGeometry.StructureSheaf.IsFraction f)

∃ r s, ∀ (x : ↥U), ∃ (hs : s ∉ (↑x).asIdeal), f x = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) r ⟨s, hs⟩


@[to_additive]
theorem TopologicalGroup.ext {G : Type*} [Group G] {t t' : TopologicalSpace G}
    (tg : @TopologicalGroup G t _) (tg' : @TopologicalGroup G t' _)
    (h : @nhds G t 1 = @nhds G t' 1) : t = t'

{G : Type u_1}
[AddGroup G]
{t t' : TopologicalSpace G}
(tg : TopologicalAddGroup G)
(tg' : TopologicalAddGroup G)
(h : 𝓝 0 = 𝓝 0)


@[simp]
lemma fst_prod [IsProbabilityMeasure ν] : (μ.prod ν).fst = μ

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.IsProbabilityMeasure ν]


theorem indicator_norm_le_norm_self : indicator s (fun a => ‖f a‖) a ≤ ‖f a‖

{α : Type u_1}
{E : Type u_2}
[SeminormedAddCommGroup E]
{s : Set α}
(f : α → E)
(a : α)


private irreducible_def mul : R[X] → R[X] → R[X]

∀ (x x_1 : R[X]),
  Polynomial.mul x x_1 =
    match x, x_1 with
    | { toFinsupp := a }, { toFinsupp := b } => { toFinsupp := a * b }


theorem pullback_snd_range {X Y S : TopCat} (f : X ⟶ S) (g : Y ⟶ S) :
    Set.range (pullback.snd f g) = { y : Y | ∃ x : X, f x = g y }

Set.range ⇑(CategoryTheory.Limits.pullback.snd f g) = {y | ∃ x, f x = g y}


theorem Real.sSup_smul_of_nonneg (ha : 0 ≤ a) (s : Set ℝ) : sSup (a • s) = a • sSup s

{α : Type u_2}
[LinearOrderedField α]
[MulActionWithZero α ℝ]
[OrderedSMul α ℝ]
{a : α}
(ha : 0 ≤ a)
(s : Set ℝ)


theorem fderiv_const_apply (c : F) : fderiv 𝕜 (fun _ => c) x = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
(c : F)


/-- If a polynomial has separable contraction, then its separable degree is equal to the degree of
the given separable contraction. -/
theorem HasSeparableContraction.natSepDegree_eq
    {q : ℕ} [ExpChar F q] (hf : f.HasSeparableContraction q) :
    f.natSepDegree = hf.degree

(hf : Polynomial.HasSeparableContraction q f)


/-- The opposite of the golden ratio is the inverse of its conjugate. -/
theorem inv_goldConj : ψ⁻¹ = -φ


@[simp]
theorem map_split_add (f : ι →ᵇᵃ[I₀] M) (hI : ↑I ≤ I₀) (i : ι) (x : ℝ) :
    (I.splitLower i x).elim' 0 f + (I.splitUpper i x).elim' 0 f = f I

{ι : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
{I₀ : WithTop (BoxIntegral.Box ι)}
{I : BoxIntegral.Box ι}
(f : BoxIntegral.BoxAdditiveMap ι M I₀)
(hI : ↑I ≤ I₀)
(i : ι)
(x : ℝ)

Option.elim' 0 (⇑f) (I.splitLower i x) + Option.elim' 0 (⇑f) (I.splitUpper i x) = f I


@[simp]
theorem rename_psum (n : ℕ) (e : σ ≃ τ) : rename e (psum σ R n) = psum τ R n

(σ : Type u_1)
(R : Type u_2)
{τ : Type u_3}
[CommSemiring R]
[Fintype σ]
[Fintype τ]
(n : ℕ)
(e : σ ≃ τ)

(MvPolynomial.rename ⇑e) (MvPolynomial.psum σ R n) = MvPolynomial.psum τ R n


@[to_additive]
theorem mclosure_inv_subset {s : Set G} : Monoid.Closure (Inv.inv ⁻¹' s) ⊆ closure s

AddMonoid.Closure (Neg.neg ⁻¹' s) ⊆ AddGroup.closure s


lemma iIndepFun.indepFun_prod_mk (hf_Indep : iIndepFun m f μ) (hf_meas : ∀ i, Measurable (f i))
    (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (fun a => (f i a, f j a)) (f k) μ

(hf_Indep : ProbabilityTheory.iIndepFun m f μ)

ProbabilityTheory.IndepFun (fun a => (f i a, f j a)) (f k) μ


theorem OrdConnected.out (h : OrdConnected s) : ∀ ⦃x⦄ (_ : x ∈ s) ⦃y⦄ (_ : y ∈ s), Icc x y ⊆ s

{α : Type u_1}
[Preorder α]
{s : Set α}
(h : s.OrdConnected)
⦃x : α⦄

x ∈ s → ∀ ⦃y : α⦄, y ∈ s → Set.Icc x y ⊆ s


/-- `RatFunc K` is isomorphic to the field of fractions of `K[X]`, as rings.

This is an auxiliary definition; `simp`-normal form is `IsLocalization.algEquiv`.
-/
@[simps apply]
def toFractionRingRingEquiv : RatFunc K ≃+* FractionRing K[X]

(K : Type u)
[CommRing K]
(self : RatFunc K)

(RatFunc.toFractionRingRingEquiv K) self = self.toFractionRing


@[simp]
theorem toMulBot_coe_ofAdd (x : α) :
    toMulBot.symm (Multiplicative.ofAdd (x : WithBot α)) = Multiplicative.ofAdd x

WithZero.toMulBot.symm (Multiplicative.ofAdd ↑x) = ↑(Multiplicative.ofAdd x)


theorem val_dvd_le : ∀ a b : R, b ∣ a → a ≠ 0 → ¬a ≺ b

{R : Type u}
[EuclideanDomain R]
(a b : R)


@[simp]
theorem map_id : ∀ s : Computation α, map id s = s


@[simp] lemma subtype_comp_inclusion (h : L ≤ M) : M.subtype.comp (inclusion h) = L.subtype

{α : Type u_2}
[Lattice α]
{L M : Sublattice α}
(h : L ≤ M)

M.subtype.comp (Sublattice.inclusion h) = L.subtype


/-- The preimage of polynomials on `[0,1]` under the pullback map by `x ↦ (b-a) * x + a`
is the polynomials on `[a,b]`. -/
theorem polynomialFunctions.comap_compRightAlgHom_iccHomeoI (a b : ℝ) (h : a < b) :
    (polynomialFunctions I).comap (compRightAlgHom ℝ ℝ (iccHomeoI a b h).symm.toContinuousMap) =
      polynomialFunctions (Set.Icc a b)

Subalgebra.comap (ContinuousMap.compRightAlgHom ℝ ℝ (iccHomeoI a b h).symm.toContinuousMap)
    (polynomialFunctions unitInterval) =
  polynomialFunctions (Set.Icc a b)


/--
A `PreSubmersivePresentation` is submersive if its jacobian is a unit in `S`
and the presentation is finite.
-/
@[nolint checkUnivs]
structure SubmersivePresentation extends PreSubmersivePresentation.{t, w} R S where
  jacobian_isUnit : IsUnit toPreSubmersivePresentation.jacobian
  isFinite : toPreSubmersivePresentation.IsFinite := by infer_instance

(self : Algebra.SubmersivePresentation R S)


@[simp]
theorem subtypePermOfFintype_apply (f : Perm α) {p : α → Prop} [Finite { x // p x }]
    (h : ∀ x, p x → p (f x)) (x : { x // p x }) : subtypePermOfFintype f h x = ⟨f x, h x x.2⟩

{α : Type u}
(f : Equiv.Perm α)
{p : α → Prop}
[Finite { x // p x }]
(h : ∀ (x : α), p x → p (f x))
(x : { x // p x })

(f.subtypePermOfFintype h) x = ⟨f ↑x, ⋯⟩


lemma add_eq (f₁ f₂ : X' ⟶ Y') :
    letI := addCommGroup L W X' Y'
    f₁ + f₂ = add W eX eY f₁ f₂

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
{X' Y' : D}
(eX : L.obj X ≅ X')
(eY : L.obj Y ≅ Y')
(f₁ f₂ : X' ⟶ Y')

f₁ + f₂ = CategoryTheory.Localization.Preadditive.add W eX eY f₁ f₂


/-- Gives a `Set.Finite` for the `Finset` coerced to a `Set`.
This is a wrapper around `Set.toFinite`. -/
@[simp]
theorem finite_toSet (s : Finset α) : (s : Set α).Finite


theorem eq_emptyOn_or_nonempty (M : Matroid α) : M = emptyOn α ∨ Matroid.Nonempty M


/-- Given a continuous function `f` in a subalgebra of `C(X, ℝ)`, postcomposing by a polynomial
gives another function in `A`.

This lemma proves something slightly more subtle than this:
we take `f`, and think of it as a function into the restricted target `Set.Icc (-‖f‖) ‖f‖)`,
and then postcompose with a polynomial function on that interval.
This is in fact the same situation as above, and so also gives a function in `A`.
-/
theorem polynomial_comp_attachBound_mem (A : Subalgebra ℝ C(X, ℝ)) (f : A) (g : ℝ[X]) :
    (g.toContinuousMapOn (Set.Icc (-‖f‖) ‖f‖)).comp (f : C(X, ℝ)).attachBound ∈ A

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

(g.toContinuousMapOn (Set.Icc (-‖f‖) ‖f‖)).comp (↑f).attachBound ∈ A


lemma pos_iff_pos_of_smul_pos [PosSMulReflectLT α β] [SMulPosReflectLT α β] (hab : 0 < a • b) :
    0 < a ↔ 0 < b

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[Preorder α]
[Preorder β]
[PosSMulReflectLT α β]
[SMulPosReflectLT α β]
(hab : 0 < a • b)


@[to_additive (attr := simp)]
theorem lift₂Expand_of {C : Sort*} {P : X → S → X → S → C}
    {hP :
      ∀ (r₁ : X) (t₁ : R) (s₁ : S) (ht₁ : t₁ * s₁ ∈ S) (r₂ : X) (t₂ : R) (s₂ : S)
        (ht₂ : t₂ * s₂ ∈ S),
        P r₁ s₁ r₂ s₂ = P (t₁ • r₁) ⟨t₁ * s₁, ht₁⟩ (t₂ • r₂) ⟨t₂ * s₂, ht₂⟩}
    (r₁ : X) (s₁ : S) (r₂ : X) (s₂ : S) : lift₂Expand P hP (r₁ /ₒ s₁) (r₂ /ₒ s₂) = P r₁ s₁ r₂ s₂

{hP :
  ∀ (r₁ : X) (t₁ : R) (s₁ : ↥S) (ht₁ : t₁ * ↑s₁ ∈ S) (r₂ : X) (t₂ : R) (s₂ : ↥S) (ht₂ : t₂ * ↑s₂ ∈ S),
    P r₁ s₁ r₂ s₂ = P (t₁ • r₁) ⟨t₁ * ↑s₁, ht₁⟩ (t₂ • r₂) ⟨t₂ * ↑s₂, ht₂⟩}

OreLocalization.lift₂Expand P hP (r₁ /ₒ s₁) (r₂ /ₒ s₂) = P r₁ s₁ r₂ s₂


theorem monotone_dual_iff : Monotone (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) ↔ Monotone f

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

Monotone (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual) ↔ Monotone f


theorem and_eq_true_eq_eq_true_and_eq_true (a b : Bool) :
    ((a && b) = true) = (a = true ∧ b = true)


theorem aecover_Ioi [NoMinOrder α] : AECover μ l fun i => Ioi (a i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a : ι → α}
(ha : Filter.Tendsto a l Filter.atBot)
[NoMinOrder α]

MeasureTheory.AECover μ l fun i => Set.Ioi (a i)


@[simp]
theorem im_to_complex {x : ℂ} : imC x = x.im


@[to_additive]
nonrec theorem SmoothOn.mul (hf : SmoothOn I' I f s) (hg : SmoothOn I' I g s) :
    SmoothOn I' I (f * g) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
(hf : SmoothOn I' I f s)
(hg : SmoothOn I' I g s)


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


protected theorem StrictMonoOn.compares (hf : StrictMonoOn f s) {a b : α} (ha : a ∈ s)
    (hb : b ∈ s) : ∀ {o : Ordering}, o.Compares (f a) (f b) ↔ o.Compares a b

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : StrictMonoOn f s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)
{o : Ordering}


@[simps (config := .lemmasOnly) id comp]
noncomputable instance categoryAsType : SmallCategory (AsType α)

(i : CategoryTheory.FinCategory.AsType α)

CategoryTheory.CategoryStruct.id i = (Fintype.equivFin (i ⟶ i)) (CategoryTheory.CategoryStruct.id i)


/-- `iUnionLift_const` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `1`. -/
theorem iUnionLift_const (c : T) (ci : ∀ i, S i) (hci : ∀ i, (ci i : α) = c) (cβ : β)
    (h : ∀ i, f i (ci i) = cβ) : iUnionLift S f hf T hT c = cβ

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


@[simp]
theorem count_true_add_count_false (l : List Bool) : count true l + count false l = length l

List.count true l + List.count false l = l.length


@[simp] theorem up_top [Top α] : up (⊤ : α) = ⊤


@[simp]
theorem succ_eq {n : ℕ} : SuccOrder.succ = fun a => if a < Fin.last n then a + 1 else a


/-- Every expression $\sum_i m_i \otimes n_i$ which vanishes also vanishes trivially if and only if
for every submodule $M' \subseteq M$, the map $M' \otimes N \to M \otimes N$ is injective. -/
theorem forall_vanishesTrivially_iff_forall_rTensor_injective :
    (∀ {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N},
      ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) → VanishesTrivially R m n) ↔
    ∀ M' : Submodule R M, Injective (rTensor N M'.subtype)

(R : Type u)
[CommRing R]
{M : Type u}
[AddCommGroup M]
[Module R M]
{N : Type u}
[AddCommGroup N]
[Module R N]

(∀ {ι : Type u} [inst : Fintype ι] {m : ι → M} {n : ι → N},
    ∑ i : ι, m i ⊗ₜ[R] n i = 0 → TensorProduct.VanishesTrivially R m n) ↔
  ∀ (M' : Submodule R M), Function.Injective ⇑(LinearMap.rTensor N M'.subtype)


theorem dfinsupp_sum_mem {β : ι → Type*} [∀ i, Zero (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    (S : Submodule R N) (f : Π₀ i, β i) (g : ∀ i, β i → N) (h : ∀ c, f c ≠ 0 → g c (f c) ∈ S) :
    f.sum g ∈ S

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

(h : ∀ (c : ι), f c ≠ 0 → g c (f c) ∈ S)


/-- The `i`-th component of an isomorphism of chain complexes. -/
@[simps!]
def isoApp (f : C₁ ≅ C₂) (i : ι) : C₁.X i ≅ C₂.X i

(HomologicalComplex.Hom.isoApp f i).hom = f.hom.f i


theorem isGLB_Ioi {a : γ} : IsGLB (Ioi a) a

{γ : Type w}
[LinearOrder γ]
[DenselyOrdered γ]
{a : γ}


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

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


@[simp]
theorem map_one [Zero β] [One β] (f : α → β) (h₀ : f 0 = 0) (h₁ : f 1 = 1) :
    (1 : Matrix n n α).map f = (1 : Matrix n n β)

{n : Type u_3}
{α : Type v}
{β : Type w}
[DecidableEq n]
[Zero α]
[One α]
[Zero β]
[One β]
(f : α → β)
(h₀ : f 0 = 0)
(h₁ : f 1 = 1)


@[ext] theorem Perm.ext {σ τ : Equiv.Perm α} (H : ∀ x, σ x = τ x) : σ = τ

{α : Sort u}
{σ τ : Equiv.Perm α}
(H : ∀ (x : α), σ x = τ x)


@[simp]
theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    toSubtype p ⊚ ofSubtype p = id

{n : ℕ}
{α : TypeVec.{u_1} n}
(p : α.Arrow (TypeVec.repeat n Prop))

TypeVec.comp (TypeVec.toSubtype p) (TypeVec.ofSubtype p) = TypeVec.id


@[simp] theorem Name.anonymous.sizeOf_spec : sizeOf anonymous = 1


theorem integral_withDensity_eq_integral_smul {f : X → ℝ≥0} (f_meas : Measurable f) (g : X → E) :
    ∫ x, g x ∂μ.withDensity (fun x => f x) = ∫ x, f x • g x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → ℝ≥0}
(f_meas : Measurable f)
(g : X → E)

(∫ (x : X), g x ∂μ.withDensity fun x => ↑(f x)) = ∫ (x : X), f x • g x ∂μ


theorem tendsto_dist_right_cobounded_atTop (c : α) : Tendsto (dist · c) (cobounded α) atTop

{α : Type u}
[PseudoMetricSpace α]
(c : α)

Filter.Tendsto (fun x => dist x c) (Bornology.cobounded α) Filter.atTop


/-- A preadditive category has a kernel for `f - g` if it has an equalizer for `f` and `g`. -/
theorem hasKernel_of_hasEqualizer [HasEqualizer f g] : HasKernel (f - g)


/-- The identity functor on `C`, viewed as a functor from the
monoidal opposite of `C` to `C`, upgraded to a braided functor. -/
@[simps!] def unmopBraidedFunctor : BraidedFunctor Cᴹᵒᵖ C

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

(CategoryTheory.MonoidalOpposite.unmopBraidedFunctor C).ε = 𝟙 (𝟙_ C)


@[to_additive]
theorem map_div' [DivInvMonoid G] [DivInvMonoid H] [MonoidHomClass F G H]
    (f : F) (hf : ∀ a, f a⁻¹ = (f a)⁻¹) (a b : G) : f (a / b) = f a / f b

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[SubNegMonoid G]
[SubNegMonoid H]
[AddMonoidHomClass F G H]
(f : F)
(hf : ∀ (a : G), f (-a) = -f a)
(a b : G)


theorem results_bind {s : Computation α} {f : α → Computation β} {a b m n} (h1 : Results s a m)
    (h2 : Results (f a) b n) : Results (bind s f) b (n + m)

{α : Type u}
{β : Type v}
{s : Computation α}
{f : α → Computation β}
{a : α}
{b : β}
{m n : ℕ}
(h1 : s.Results a m)
(h2 : (f a).Results b n)


protected theorem continuous_mul_const {a : ℝ≥0∞} (ha : a ≠ ∞) : Continuous fun x => x * a


theorem ediam_preimage_le (hf : AntilipschitzWith K f) (s : Set β) : diam (f ⁻¹' s) ≤ K * diam s

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith K f)
(s : Set β)

EMetric.diam (f ⁻¹' s) ≤ ↑K * EMetric.diam s


theorem LinearMap.lift_rank_le_of_injective (f : M →ₗ[R] M') (i : Injective f) :
    Cardinal.lift.{v'} (Module.rank R M) ≤ Cardinal.lift.{v} (Module.rank R M')

{R : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
(i : Function.Injective ⇑f)

Cardinal.lift.{v', v} (Module.rank R M) ≤ Cardinal.lift.{v, v'} (Module.rank R M')


@[to_additive] lemma prod_range_succ (f : ℕ → M) (n : ℕ) :
    ((range n.succ).map f).prod = ((range n).map f).prod * f n

{M : Type u_4}
[AddMonoid M]
(f : ℕ → M)
(n : ℕ)

(List.map f (List.range n.succ)).sum = (List.map f (List.range n)).sum + f n


@[to_additive FreeAddGroup.join_red_of_step]
theorem join_red_of_step (h : Red.Step L₁ L₂) : Join Red L₁ L₂

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(h : FreeGroup.Red.Step L₁ L₂)


theorem psub'_eq_psub (m n) : psub' m n = psub m n


@[simp] theorem add_div_left (x : Nat) {z : Nat} (H : 0 < z) : (z + x) / z = (x / z) + 1


/-- Corresponds to `dist_self`. -/
@[simp]
theorem hammingDist_self (x : ∀ i, β i) : hammingDist x x = 0

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
(x : (i : ι) → β i)


/-- The reverse of a path from `x` to `y`, as a path from `y` to `x` -/
@[symm, simps]
def symm (γ : Path x y) : Path y x

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(γ : Path x y)


theorem mul_apply_left (f g : MonoidAlgebra k G) (x : G) :
    (f * g) x = f.sum fun a b => b * g (a⁻¹ * x)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Group G]
(f g : MonoidAlgebra k G)
(x : G)

(f * g) x = Finsupp.sum f fun a b => b * g (a⁻¹ * x)


/-- For finite `E`, finitely many matroids have ground set contained in `E`. -/
theorem finite_setOf_matroid {E : Set α} (hE : E.Finite) : {M : Matroid α | M.E ⊆ E}.Finite

{α : Type u_1}
{E : Set α}
(hE : E.Finite)


@[to_additive]
theorem subset_closure {s : Set G} : s ⊆ closure s


theorem mem_biInf_of_directed {f : β → Filter α} {s : Set β} (h : DirectedOn (f ⁻¹'o (· ≥ ·)) s)
    (ne : s.Nonempty) {t : Set α} : (t ∈ ⨅ i ∈ s, f i) ↔ ∃ i ∈ s, t ∈ f i

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


@[simp]
theorem empty_toList {s : Finset α} : s.toList.isEmpty ↔ s = ∅


@[to_additive]
theorem Set.OrdConnected.smul (hs : s.OrdConnected) : (a • s).OrdConnected

{α : Type u_1}
[OrderedAddCommGroup α]
{s : Set α}
{a : α}
(hs : s.OrdConnected)


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.smul [MeasurableSMul₂ M β] {μ : Measure α} (hf : AEMeasurable f μ)
    (hg : AEMeasurable g μ) : AEMeasurable (fun x => f x • g x) μ

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[SMul M β]
{m : MeasurableSpace α}
{f : α → M}
{g : α → β}
[MeasurableSMul₂ M β]
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


/-- See also `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` which work for general
Lp-convergence for all `p ≠ 0`. -/
theorem tendstoInMeasure_of_tendsto_eLpNorm_top {E} [NormedAddCommGroup E] {f : ι → α → E}
    {g : α → E} {l : Filter ι} (hfg : Tendsto (fun n => eLpNorm (f n - g) ∞ μ) l (𝓝 0)) :
    TendstoInMeasure μ f l g

(hfg : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) ⊤ μ) l (𝓝 0))


theorem sbtw_trans_right {a b c d : α} (hbc : sbtw a b c) (hcd : sbtw a c d) : sbtw a b d

{α : Type u_1}
[CircularPreorder α]
{a b c d : α}
(hbc : sbtw a b c)
(hcd : sbtw a c d)


theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s

{α : Type u_1}
[MeasurableSpace α]
(m : MeasureTheory.OuterMeasure α)
(s : Set α)


/-- Over a nontrivially normed field, any linear form which is nonzero on a nonempty open set is
    automatically continuous. -/
theorem LinearMap.continuous_of_nonzero_on_open (l : E →ₗ[𝕜] 𝕜) (s : Set E) (hs₁ : IsOpen s)
    (hs₂ : s.Nonempty) (hs₃ : ∀ x ∈ s, l x ≠ 0) : Continuous l

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
(l : E →ₗ[𝕜] 𝕜)
(s : Set E)
(hs₁ : IsOpen s)
(hs₂ : s.Nonempty)
(hs₃ : ∀ x ∈ s, l x ≠ 0)


@[simp]
theorem reindexAlgEquiv_apply (e : m ≃ n) (M : Matrix m m A) :
    reindexAlgEquiv R A e M = reindex e e M

{m : Type u_2}
{n : Type u_3}
(R : Type u_11)
(A : Type u_12)
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq m]
[DecidableEq n]
[Semiring A]
[Algebra R A]
(e : m ≃ n)
(M : Matrix m m A)

(Matrix.reindexAlgEquiv R A e) M = (Matrix.reindex e e) M


/-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
such that `rᵢ → 0`, the set of points which belong to infinitely many of the closed
`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
the `rᵢ` are all scaled by a positive constant.

This lemma is a generalisation of Lemma 9 appearing on page 217 of
[J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).

See also `blimsup_thickening_mul_ae_eq`.

NB: The `: Set α` type ascription is present because of
https://github.com/leanprover-community/mathlib/issues/16932. -/
theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M)
    (r : ℕ → ℝ) (hr : Tendsto r atTop (𝓝 0)) :
    (blimsup (fun i => cthickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
      (blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α)

(hr : Filter.Tendsto r Filter.atTop (𝓝 0))

Filter.blimsup (fun i => Metric.cthickening (M * r i) (s i)) Filter.atTop p =ᵐ[μ]
  Filter.blimsup (fun i => Metric.cthickening (r i) (s i)) Filter.atTop p


theorem nat_gcd_helper_1' (x y a b : ℕ) (h : y * b = x * a + 1) :
    Nat.gcd x y = 1


theorem edist_le_of_le (h : HolderOnWith C r f s) {x y : X} (hx : x ∈ s) (hy : y ∈ s) {d : ℝ≥0∞}
    (hd : edist x y ≤ d) : edist (f x) (f y) ≤ (C : ℝ≥0∞) * d ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
{s : Set X}
(h : HolderOnWith C r f s)
{x y : X}
(hx : x ∈ s)
(hy : y ∈ s)
{d : ℝ≥0∞}
(hd : edist x y ≤ d)


@[simp] theorem range'_eq_nil : range' s n step = [] ↔ n = 0


@[simp]
theorem isPredLimitRecOn_pred (hs : ∀ a, ¬IsMin a → C (pred a)) (hl : ∀ a, IsPredLimit a → C a)
    (b : α) : @isPredLimitRecOn α _ _ C (pred b) hs hl = hs b (not_isMin b)

(hs : (a : α) → ¬IsMin a → C (Order.pred a))

(hl : (a : α) → Order.IsPredLimit a → C a)

Order.isPredLimitRecOn (Order.pred b) hs hl = hs b ⋯


theorem embedding_inl : Embedding (@inl X Y)

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


theorem append_ne_nil_of_ne_nil_left (s t : List α) : s ≠ [] → s ++ t ≠ []


theorem sups_inter_subset_right : s ⊻ (t₁ ∩ t₂) ⊆ s ⊻ t₁ ∩ s ⊻ t₂

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

s ⊻ (t₁ ∩ t₂) ⊆ s ⊻ t₁ ∩ s ⊻ t₂


/-- The number of rows in `ofRowLens w hw` is the length of `w` -/
theorem rowLens_length_ofRowLens {w : List ℕ} {hw : w.Sorted (· ≥ ·)} (hpos : ∀ x ∈ w, 0 < x) :
    (ofRowLens w hw).rowLens.length = w.length

{hw : List.Sorted (fun x x_1 => x ≥ x_1) w}

(YoungDiagram.ofRowLens w hw).rowLens.length = w.length


theorem smooth_prod_iff (f : M → M' × N') :
    Smooth I (I'.prod J') f ↔ Smooth I I' (Prod.fst ∘ f) ∧ Smooth I J' (Prod.snd ∘ f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
(f : M → M' × N')


theorem pow_succ_eq {p : N} (n : ℕ) (h : IsIdempotentElem p) : p ^ (n + 1) = p

{N : Type u_2}
[Monoid N]
{p : N}
(n : ℕ)
(h : IsIdempotentElem p)


@[to_additive]
theorem saturated_iff_zpow {H : Subgroup G} :
    Saturated H ↔ ∀ (n : ℤ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}

H.Saturated ↔ ∀ (n : ℤ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H


@[simp]
theorem swap_eq_one_iff {i j : α} : swap i j = (1 : Perm α) ↔ i = j


/-- The left fraction corresponding to a right fraction in the opposite category. -/
@[simps]
def RightFraction.unop {W : MorphismProperty Cᵒᵖ}
    {X Y : Cᵒᵖ} (φ : W.RightFraction X Y) :
    W.unop.LeftFraction (Opposite.unop Y) (Opposite.unop X)

{W : CategoryTheory.MorphismProperty Cᵒᵖ}


theorem liftPropWithinAt_self_target {f : M → H'} :
    LiftPropWithinAt P f s x ↔ ContinuousWithinAt f s x ∧
      P (f ∘ (chartAt H x).symm) ((chartAt H x).symm ⁻¹' s) (chartAt H x x)

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
{P : (H → H') → Set H → H → Prop}
{s : Set M}
{x : M}
{f : M → H'}

ChartedSpace.LiftPropWithinAt P f s x ↔
  ContinuousWithinAt f s x ∧ P (f ∘ ↑(chartAt H x).symm) (↑(chartAt H x).symm ⁻¹' s) (↑(chartAt H x) x)


@[simp]
theorem ClassGroup.equiv_mk (K' : Type*) [Field K'] [Algebra R K'] [IsFractionRing R K']
    (I : (FractionalIdeal R⁰ K)ˣ) :
    ClassGroup.equiv K' (ClassGroup.mk I) =
      QuotientGroup.mk' _ (Units.mapEquiv (↑(FractionalIdeal.canonicalEquiv R⁰ K K')) I)

{R : Type u_1}
(K : Type u_2)
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDomain R]
(K' : Type u_4)
[Field K']
[Algebra R K']
[IsFractionRing R K']
(I : (FractionalIdeal R⁰ K)ˣ)

(ClassGroup.equiv K') (ClassGroup.mk I) =
  (QuotientGroup.mk' (toPrincipalIdeal R K').range) ((Units.mapEquiv ↑(FractionalIdeal.canonicalEquiv R⁰ K K')) I)


@[simp] lemma coeff_mul_ofNat {a k : ℕ} [Nat.AtLeastTwo a] :
  coeff (p * (no_index (OfNat.ofNat a) : R[X])) k = coeff p k * OfNat.ofNat a

{R : Type u}
[Semiring R]
{p : R[X]}
{a k : ℕ}
[a.AtLeastTwo]

(p * OfNat.ofNat a).coeff k = p.coeff k * OfNat.ofNat a


/-- The composition of homotopy equivalences. -/
@[simps]
def trans (e : HomotopyEquiv S₁ S₂) (e' : HomotopyEquiv S₂ S₃) :
    HomotopyEquiv S₁ S₃

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(e.trans e').inv = CategoryTheory.CategoryStruct.comp e'.inv e.inv


theorem kroneckerMap_transpose (f : α → β → γ) (A : Matrix l m α) (B : Matrix n p β) :
    kroneckerMap f Aᵀ Bᵀ = (kroneckerMap f A B)ᵀ

{α : Type u_2}
{β : Type u_4}
{γ : Type u_6}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
(f : α → β → γ)
(A : Matrix l m α)
(B : Matrix n p β)

Matrix.kroneckerMap f A.transpose B.transpose = (Matrix.kroneckerMap f A B).transpose


theorem add_sub_add_le (a c : Nat) {b d : Nat} (h : b ≤ d) : a + b - (c + d) = a - (c + (d-b))


theorem isLocallySurjective_of_surjective {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G)
    (H : ∀ U, Function.Surjective (f.app U)) : IsLocallySurjective J f

(J : CategoryTheory.GrothendieckTopology C)

(H : ∀ (U : Cᵒᵖ), Function.Surjective ⇑(f.app U))


theorem reduce_isReduced : ∀ u : XgcdType, u.reduce.IsReduced


@[to_additive (attr := simp)]
theorem coe_mk' : (c.mk' : M → c.Quotient) = ((↑) : M → c.Quotient)

{M : Type u_1}
[AddZeroClass M]
{c : AddCon M}


/-- An open subset of a Polish space is also Polish. -/
theorem _root_.IsOpen.polishSpace {α : Type*} [TopologicalSpace α] [PolishSpace α] {s : Set α}
    (hs : IsOpen s) : PolishSpace s

{α : Type u_3}
[TopologicalSpace α]
[PolishSpace α]
{s : Set α}
(hs : IsOpen s)


theorem coe_pos (x : Ioc (0 : α) 1) : 0 < (x : α)

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


lemma isClopen_setOf_mapsTo (hK : IsCompact K) (hU : IsClopen U) :
    IsClopen {f : C(X, Y) | MapsTo f K U}

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{K : Set X}
{U : Set Y}
(hK : IsCompact K)
(hU : IsClopen U)


@[simp]
lemma nextCoeff_C_mul_X_add_C (ha : a ≠ 0) (c : R) : nextCoeff (C a * X + C c) = c

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

(Polynomial.C a * Polynomial.X + Polynomial.C c).nextCoeff = c


@[measurability]
theorem Measurable.floor [OpensMeasurableSpace R] {f : α → R} (hf : Measurable f) :
    Measurable fun x => ⌊f x⌋

{α : Type u_1}
{R : Type u_2}
[MeasurableSpace α]
[LinearOrderedRing R]
[FloorRing R]
[TopologicalSpace R]
[OrderTopology R]
[MeasurableSpace R]
[OpensMeasurableSpace R]
{f : α → R}
(hf : Measurable f)


theorem foldlIdxSpec_cons (f : ℕ → α → β → α) (a b bs start) :
    foldlIdxSpec f a (b :: bs) start = foldlIdxSpec f (f start a b) bs (start + 1)

{α : Type u}
{β : Type v}
(f : ℕ → α → β → α)
(a : α)
(b : β)
(bs : List β)
(start : ℕ)

List.foldlIdxSpec f a (b :: bs) start = List.foldlIdxSpec f (f start a b) bs (start + 1)


theorem openSegment_eq_image₂ (x y : E) :
    openSegment 𝕜 x y =
      (fun p : 𝕜 × 𝕜 => p.1 • x + p.2 • y) '' { p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1 }

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
(x y : E)

openSegment 𝕜 x y = (fun p => p.1 • x + p.2 • y) '' {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1}


theorem _root_.Disjoint.exists_thickenings (hst : Disjoint s t) (hs : IsCompact s)
    (ht : IsClosed t) :
    ∃ δ, 0 < δ ∧ Disjoint (thickening δ s) (thickening δ t)

{α : Type u}
[PseudoEMetricSpace α]
{s t : Set α}
(hst : Disjoint s t)
(hs : IsCompact s)
(ht : IsClosed t)

∃ δ, 0 < δ ∧ Disjoint (Metric.thickening δ s) (Metric.thickening δ t)


/-- Given a diagram of `StructuredArrow X F`s, we may obtain a cone with cone point `X`. -/
@[simps!]
def Cone.fromStructuredArrow (F : C ⥤ D) {X : D} (G : J ⥤ StructuredArrow X F) :
    Cone (G ⋙ StructuredArrow.proj X F ⋙ F)

(G : CategoryTheory.Functor J (CategoryTheory.StructuredArrow X F))

(CategoryTheory.Limits.Cone.fromStructuredArrow F G).π.app j = (G.obj j).hom


@[simp]
theorem evalFrom_nil (s : σ) : M.evalFrom s [] = s

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


/-- Order equipped with a sensible successor function. -/
@[ext]
class SuccOrder (α : Type*) [Preorder α] where
  /-- Successor function-/
  succ : α → α
  /-- Proof of basic ordering with respect to `succ`-/
  le_succ : ∀ a, a ≤ succ a
  /-- Proof of interaction between `succ` and maximal element-/
  max_of_succ_le {a} : succ a ≤ a → IsMax a
  /-- Proof that `succ` satisfies ordering invariants between `LT` and `LE`-/
  succ_le_of_lt {a b} : a < b → succ a ≤ b
  /-- Proof that `succ` satisfies ordering invariants between `LE` and `LT`-/
  le_of_lt_succ {a b} : a < succ b → a ≤ b

{α : Type u_3}
[Preorder α]
[self : SuccOrder α]
{a b : α}


theorem continuousOn_const_smul_iff₀ (hc : c ≠ 0) :
    ContinuousOn (fun x => c • f x) s ↔ ContinuousOn f s

{α : Type u_2}
{β : Type u_3}
{G₀ : Type u_4}
[TopologicalSpace α]
[GroupWithZero G₀]
[MulAction G₀ α]
[ContinuousConstSMul G₀ α]
[TopologicalSpace β]
{f : β → α}
{c : G₀}
{s : Set β}
(hc : c ≠ 0)


theorem Fuzzy.not_equiv {x y : PGame} (h : x ‖ y) : ¬(x ≈ y)


theorem tr_reaches₁ {σ₁ σ₂ f₁ f₂} {tr : σ₁ → σ₂ → Prop} (H : Respects f₁ f₂ tr) {a₁ a₂}
    (aa : tr a₁ a₂) {b₁} (ab : Reaches₁ f₁ a₁ b₁) : ∃ b₂, tr b₁ b₂ ∧ Reaches₁ f₂ a₂ b₂

{σ₁ : Type u_1}
{σ₂ : Type u_2}
{f₁ : σ₁ → Option σ₁}
{f₂ : σ₂ → Option σ₂}
{tr : σ₁ → σ₂ → Prop}
(H : Turing.Respects f₁ f₂ tr)
{a₁ : σ₁}
{a₂ : σ₂}
(aa : tr a₁ a₂)
{b₁ : σ₁}
(ab : Turing.Reaches₁ f₁ a₁ b₁)

∃ b₂, tr b₁ b₂ ∧ Turing.Reaches₁ f₂ a₂ b₂


theorem extendScalars_injective :
    Function.Injective fun E : { E : IntermediateField K L // F ≤ E } ↦ extendScalars E.2

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(F : IntermediateField K L)

Function.Injective fun E => IntermediateField.extendScalars ⋯


theorem neg_left {x y : R} (h : IsCoprime x y) : IsCoprime (-x) y

{R : Type u}
[CommRing R]
{x y : R}
(h : IsCoprime x y)


theorem support_formPerm [Fintype α] (s : Cycle α) (h : Nodup s) (hn : Nontrivial s) :
    support (formPerm s h) = s.toFinset

{α : Type u_1}
[DecidableEq α]
[Fintype α]
(s : Cycle α)
(h : s.Nodup)
(hn : s.Nontrivial)


/-- Composition of a `Homotopy g₀ g₁` and `f : C(X, Y)` as a homotopy between `g₀.comp f` and
`g₁.comp f`. -/
@[simps!]
def compContinuousMap {g₀ g₁ : C(Y, Z)} (G : Homotopy g₀ g₁) (f : C(X, Y)) :
    Homotopy (g₀.comp f) (g₁.comp f)

{X : Type u}
{Y : Type v}
{Z : Type w}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{g₀ g₁ : C(Y, Z)}
(G : g₀.Homotopy g₁)
(f : C(X, Y))

∀ (a : ↑I × X), (G.compContinuousMap f) a = G (Prod.map id (⇑f) a)


@[simp]
theorem length_zero : (0 : NonemptyInterval α).length = 0


/-- **Equality case of the Rearrangement Inequality**: Pointwise scalar multiplication of `f` and
`g`, which antivary together, is unchanged by a permutation if and only if `f ∘ σ` and `g` antivary
together. Stated by permuting the entries of `f`. -/
theorem AntivaryOn.sum_comp_perm_smul_eq_sum_smul_iff (hfg : AntivaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) :
    ∑ i ∈ s, f (σ i) • g i = ∑ i ∈ s, f i • g i ↔ AntivaryOn (f ∘ σ) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{s : Finset ι}
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
(hfg : AntivaryOn f g ↑s)
(hσ : {x | σ x ≠ x} ⊆ ↑s)

∑ i ∈ s, f (σ i) • g i = ∑ i ∈ s, f i • g i ↔ AntivaryOn (f ∘ ⇑σ) g ↑s


/-- **Fermat's Theorem**: the derivative of a function at a local maximum equals zero. -/
theorem IsLocalMax.hasDerivAt_eq_zero (h : IsLocalMax f a) (hf : HasDerivAt f f' a) : f' = 0

{f : ℝ → ℝ}
{f' a : ℝ}
(h : IsLocalMax f a)
(hf : HasDerivAt f f' a)


/-- The chosen kernels and cokernels of the limits API give a `LeftHomologyData` -/
@[simps]
noncomputable def ofHasKernelOfHasCokernel
    [HasKernel S.g] [HasCokernel (kernel.lift S.g S.f S.zero)] :
    S.LeftHomologyData

[CategoryTheory.Limits.HasCokernel (CategoryTheory.Limits.kernel.lift S.g S.f ⋯)]

(CategoryTheory.ShortComplex.LeftHomologyData.ofHasKernelOfHasCokernel S).i = CategoryTheory.Limits.kernel.ι S.g


protected theorem rightInvOn : RightInvOn I.symm I (range I)

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

Set.RightInvOn (↑I.symm) (↑I) (Set.range ↑I)


@[simp]
theorem mem_top {x : A} : x ∈ (⊤ : NonUnitalSubalgebra R A)

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{x : A}


/-- An element `x : α` of `l : List α` is a duplicate iff it can be found
at two distinct indices `n m : ℕ` inside the list `l`.
-/
theorem duplicate_iff_exists_distinct_get {l : List α} {x : α} :
    l.Duplicate x ↔
      ∃ (n m : Fin l.length) (_ : n < m),
        x = l.get n ∧ x = l.get m

List.Duplicate x l ↔ ∃ n m, ∃ (_ : n < m), x = l.get n ∧ x = l.get m


@[simp]
theorem AdditiveFunctor.forget_map (F G : C ⥤+ D) (α : F ⟶ G) :
    (AdditiveFunctor.forget C D).map α = α

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
(F G : C ⥤+ D)
(α : F ⟶ G)

(CategoryTheory.AdditiveFunctor.forget C D).map α = α


/-- The kernel of `f.op` is the opposite of `cokernel f`. -/
@[simps]
def kernelOpUnop : (kernel f.op).unop ≅ cokernel f

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.kernelOpUnop f).inv = CategoryTheory.Limits.cokernel.desc f (CategoryTheory.Limits.kernel.ι f.op).unop ⋯


theorem ofReal_toReal_le {a : ℝ≥0∞} : ENNReal.ofReal a.toReal ≤ a


nonrec theorem lintegral_map (κ : Kernel α β) (hf : Measurable f) (a : α) {g' : γ → ℝ≥0∞}
    (hg : Measurable g') : ∫⁻ b, g' b ∂map κ f hf a = ∫⁻ a, g' (f a) ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{f : β → γ}
(κ : ProbabilityTheory.Kernel α β)
(hf : Measurable f)
(a : α)
{g' : γ → ℝ≥0∞}
(hg : Measurable g')

∫⁻ (b : γ), g' b ∂(κ.map f hf) a = ∫⁻ (a : β), g' (f a) ∂κ a


theorem tendsto_ceil_left' (n : ℤ) :
    Tendsto (fun x => ceil x : α → α) (𝓝[≤] n) (𝓝 n)

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
(n : ℤ)

Filter.Tendsto (fun x => ↑⌈x⌉) (𝓝[≤] ↑n) (𝓝 ↑n)


@[simp]
theorem inf_himp_bihimp : a ⇔ b ⇨ a ⊓ b = a ⊔ b

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


theorem ContMDiffOn.comp_contMDiff {t : Set M'} {g : M' → M''} (hg : ContMDiffOn I' I'' n g t)
    (hf : ContMDiff I I' n f) (ht : ∀ x, f x ∈ t) : ContMDiff I I'' n (g ∘ f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
{f : M → M'}
{n : ℕ∞}
{t : Set M'}
{g : M' → M''}
(hg : ContMDiffOn I' I'' n g t)
(hf : ContMDiff I I' n f)
(ht : ∀ (x : M), f x ∈ t)


@[simp]
theorem liftRel_const_iff [NeBot l] {r : β → γ → Prop} {x : β} {y : γ} :
    LiftRel r (↑x : Germ l β) ↑y ↔ r x y

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
[l.NeBot]
{r : β → γ → Prop}
{x : β}
{y : γ}


@[reassoc (attr := simp)]
theorem limit.conePointUniqueUpToIso_hom_comp {F : J ⥤ C} [HasLimit F] {c : Cone F} (hc : IsLimit c)
    (j : J) : (IsLimit.conePointUniqueUpToIso hc (limit.isLimit _)).hom ≫ limit.π F j = c.π.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasLimit F]
{c : CategoryTheory.Limits.Cone F}
(hc : CategoryTheory.Limits.IsLimit c)
(j : J)

(hc.conePointUniqueUpToIso (CategoryTheory.Limits.limit.isLimit F)).hom ≫ CategoryTheory.Limits.limit.π F j = c.π.app j


theorem mem_split_iff' : J ∈ split I i x ↔
    (J : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } ∨ (J : Set (ι → ℝ)) = ↑I ∩ { y | x < y i }

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{i : ι}
{x : ℝ}

J ∈ BoxIntegral.Prepartition.split I i x ↔ ↑J = ↑I ∩ {y | y i ≤ x} ∨ ↑J = ↑I ∩ {y | x < y i}


/-- Derivative under integral of `x ↦ ∫ F x a` at a given point `x₀ : 𝕜`, `𝕜 = ℝ` or `𝕜 = ℂ`,
assuming `F x₀` is integrable, `x ↦ F x a` is locally Lipschitz on a ball around `x₀` for ae `a`
(with ball radius independent of `a`) with integrable Lipschitz bound, and `F x` is
ae-measurable for `x` in a possibly smaller neighborhood of `x₀`. -/
nonrec theorem hasDerivAt_integral_of_dominated_loc_of_lip {F : 𝕜 → ℝ → E} {F' : ℝ → E} {x₀ : 𝕜}
    (ε_pos : 0 < ε) (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) (μ.restrict (Ι a b)))
    (hF_int : IntervalIntegrable (F x₀) μ a b)
    (hF'_meas : AEStronglyMeasurable F' (μ.restrict (Ι a b)))
    (h_lipsch : ∀ᵐ t ∂μ, t ∈ Ι a b →
      LipschitzOnWith (Real.nnabs <| bound t) (fun x => F x t) (ball x₀ ε))
    (bound_integrable : IntervalIntegrable (bound : ℝ → ℝ) μ a b)
    (h_diff : ∀ᵐ t ∂μ, t ∈ Ι a b → HasDerivAt (fun x => F x t) (F' t) x₀) :
    IntervalIntegrable F' μ a b ∧
      HasDerivAt (fun x => ∫ t in a..b, F x t ∂μ) (∫ t in a..b, F' t ∂μ) x₀

(hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, MeasureTheory.AEStronglyMeasurable (F x) (μ.restrict (Ι a b)))

(hF'_meas : MeasureTheory.AEStronglyMeasurable F' (μ.restrict (Ι a b)))

(h_lipsch : ∀ᵐ (t : ℝ) ∂μ, t ∈ Ι a b → LipschitzOnWith (Real.nnabs (bound t)) (fun x => F x t) (Metric.ball x₀ ε))

(bound_integrable : IntervalIntegrable bound μ a b)

(h_diff : ∀ᵐ (t : ℝ) ∂μ, t ∈ Ι a b → HasDerivAt (fun x => F x t) (F' t) x₀)

IntervalIntegrable F' μ a b ∧ HasDerivAt (fun x => ∫ (t : ℝ) in a..b, F x t ∂μ) (∫ (t : ℝ) in a..b, F' t ∂μ) x₀


@[simp]
theorem shiftFun_0 {n : ℕ} {X : Type*} [Zero X] (f : Fin n → X) : shiftFun f 0 = 0

{n : ℕ}
{X : Type u_1}
[Zero X]
(f : Fin n → X)

SSet.Augmented.StandardSimplex.shiftFun f 0 = 0


theorem reflTransSymmAux_mem_I (x : I × I) : reflTransSymmAux x ∈ I


@[simp] lemma unmop_whiskerLeft (X : Cᴹᵒᵖ) {Y Z : Cᴹᵒᵖ} (f : Y ⟶ Z) :
    (X ◁ f).unmop = f.unmop ▷ unmop X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
(X : Cᴹᵒᵖ)
{Y Z : Cᴹᵒᵖ}
(f : Y ⟶ Z)

(CategoryTheory.MonoidalCategory.whiskerLeft X f).unmop = CategoryTheory.MonoidalCategory.whiskerRight f.unmop X.unmop


theorem le_iff_sign {x y : EReal} :
    x ≤ y ↔ sign x < sign y ∨
      sign x = SignType.neg ∧ sign y = SignType.neg ∧ y.abs ≤ x.abs ∨
        sign x = SignType.zero ∧ sign y = SignType.zero ∨
          sign x = SignType.pos ∧ sign y = SignType.pos ∧ x.abs ≤ y.abs

x ≤ y ↔
  SignType.sign x < SignType.sign y ∨
    SignType.sign x = SignType.neg ∧ SignType.sign y = SignType.neg ∧ y.abs ≤ x.abs ∨
      SignType.sign x = SignType.zero ∧ SignType.sign y = SignType.zero ∨
        SignType.sign x = SignType.pos ∧ SignType.sign y = SignType.pos ∧ x.abs ≤ y.abs


theorem exists_normalized_aux1 {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ)
    (lastr : a.r (last N) = 1) (hτ : 1 ≤ τ) (δ : ℝ) (hδ1 : τ ≤ 1 + δ / 4) (hδ2 : δ ≤ 1)
    (i j : Fin N.succ) (inej : i ≠ j) : 1 - δ ≤ ‖a.c i - a.c j‖

{E : Type u_1}
[NormedAddCommGroup E]
{N : ℕ}
{τ : ℝ}
(a : Besicovitch.SatelliteConfig E N τ)
(lastr : a.r (Fin.last N) = 1)
(hτ : 1 ≤ τ)
(δ : ℝ)
(hδ1 : τ ≤ 1 + δ / 4)
(hδ2 : δ ≤ 1)
(i j : Fin N.succ)
(inej : i ≠ j)


@[measurability]
theorem smul_measure [Monoid R] [DistribMulAction R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞]
    (h : AEMeasurable f μ) (c : R) : AEMeasurable f (c • μ)

{α : Type u_2}
{β : Type u_3}
{R : Type u_6}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ : MeasureTheory.Measure α}
[Monoid R]
[DistribMulAction R ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
(h : AEMeasurable f μ)
(c : R)


theorem Basis.det_reindex_symm {ι' : Type*} [Fintype ι'] [DecidableEq ι'] (b : Basis ι R M)
    (v : ι → M) (e : ι' ≃ ι) : (b.reindex e.symm).det (v ∘ e) = b.det v

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
{ι' : Type u_6}
[Fintype ι']
[DecidableEq ι']
(b : Basis ι R M)
(v : ι → M)
(e : ι' ≃ ι)

(b.reindex e.symm).det (v ∘ ⇑e) = b.det v


/-- `SupBotHomClass F α β` states that `F` is a type of finitary supremum-preserving morphisms.

You should extend this class when you extend `SupBotHom`. -/
class SupBotHomClass (F α β : Type*) [Sup α] [Sup β] [Bot α] [Bot β] [FunLike F α β]
  extends SupHomClass F α β : Prop where
  /-- A `SupBotHomClass` morphism preserves the bottom element. -/
  map_bot (f : F) : f ⊥ = ⊥

{F : Type u_7}
{α : Type u_8}
{β : Type u_9}
[Sup α]
[Sup β]
[Bot α]
[Bot β]
[FunLike F α β]
[self : SupBotHomClass F α β]
(f : F)


theorem vectorEx_iff_exists : ∀ {n} (f : Vector3 α n → Prop), VectorEx n f ↔ Exists f

{α : Type u_1}
{n : ℕ}
(f : Vector3 α n → Prop)


theorem prod_add (u v : PrimeMultiset) : (u + v).prod = u.prod * v.prod


protected theorem ciSup_add_ciSup (g : ι' → Cardinal.{v}) (hg : BddAbove (range g)) :
    (⨆ i, f i) + (⨆ j, g j) = ⨆ (i) (j), f i + g j

{ι : Type u}
{ι' : Type w}
(f : ι → Cardinal.{v})
[Nonempty ι]
[Nonempty ι']
(hf : BddAbove (Set.range f))
(g : ι' → Cardinal.{v})
(hg : BddAbove (Set.range g))

(⨆ i, f i) + ⨆ j, g j = ⨆ i, ⨆ j, f i + g j


@[simp]
theorem deleteVerts_empty : G'.deleteVerts ∅ = G'

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


@[simp] theorem filter_cons_of_pos {p : α → Bool} {a : α} (l) (pa : p a) :
    filter p (a :: l) = a :: filter p l

{α : Type u_1}
{p : α → Bool}
{a : α}
(l : List α)
(pa : p a = true)

List.filter p (a :: l) = a :: List.filter p l


@[simp]
theorem cancel_right (hf : Surjective f) : g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
[BiheytingAlgebra γ]
{f : BiheytingHom α β}
{g₁ g₂ : BiheytingHom β γ}
(hf : Function.Surjective ⇑f)


@[simp]
theorem removeNone_optionCongr (e : α ≃ β) : removeNone e.optionCongr = e

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


theorem lift_insepDegree_bot' : Cardinal.lift.{v} (insepDegree F (⊥ : IntermediateField E K)) =
    Cardinal.lift.{w} (insepDegree F E)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]

Cardinal.lift.{v, w} (Field.insepDegree F ↥⊥) = Cardinal.lift.{w, v} (Field.insepDegree F E)


theorem nat_mul_inj' {n : ℕ} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n ≠ 0) : a = b

{R : Type u_1}
[NonAssocRing R]
[NoZeroDivisors R]
[CharZero R]
{n : ℕ}
{a b : R}
(h : ↑n * a = ↑n * b)
(w : n ≠ 0)


theorem morphismRestrict_comp {X Y Z : Scheme.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) (U : Opens Z) :
    (f ≫ g) ∣_ U = f ∣_ g ⁻¹ᵁ U ≫ g ∣_ U

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

(f ≫ g) ∣_ U = f ∣_ (TopologicalSpace.Opens.map g.val.base).obj U ≫ g ∣_ U


@[simp]
theorem self_eq_mass_mul_normalize (s : Set Ω) : μ s = μ.mass * μ.normalize s

{Ω : Type u_1}
[Nonempty Ω]
{m0 : MeasurableSpace Ω}
(μ : MeasureTheory.FiniteMeasure Ω)
(s : Set Ω)


/-- Definition of a Baire space. -/
theorem dense_iInter_of_isOpen_nat {f : ℕ → Set X} (ho : ∀ n, IsOpen (f n))
    (hd : ∀ n, Dense (f n)) : Dense (⋂ n, f n)

{X : Type u_1}
[TopologicalSpace X]
[BaireSpace X]
{f : ℕ → Set X}
(ho : ∀ (n : ℕ), IsOpen (f n))
(hd : ∀ (n : ℕ), Dense (f n))


/-- **Tietze extension theorem** for real-valued bounded continuous maps, a version for a closed
embedding. Let `e` be a closed embedding of a nonempty topological space `X` into a normal
topological space `Y`. Let `f` be a bounded continuous real-valued function on `X`. Then there
exists a bounded continuous function `g : Y →ᵇ ℝ` such that `g ∘ e = f` and each value `g y` belongs
to a closed interval `[f x₁, f x₂]` for some `x₁` and `x₂`.  -/
theorem exists_extension_forall_exists_le_ge_of_closedEmbedding [Nonempty X] (f : X →ᵇ ℝ)
    {e : X → Y} (he : ClosedEmbedding e) :
    ∃ g : Y →ᵇ ℝ, (∀ y, ∃ x₁ x₂, g y ∈ Icc (f x₁) (f x₂)) ∧ g ∘ e = f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[NormalSpace Y]
[Nonempty X]
(f : X →ᵇ ℝ)
{e : X → Y}
(he : ClosedEmbedding e)

∃ g, (∀ (y : Y), ∃ x₁ x₂, g y ∈ Set.Icc (f x₁) (f x₂)) ∧ ⇑g ∘ e = ⇑f


theorem opNorm_le_of_ball {f : E →SL[σ₁₂] F} {ε : ℝ} {C : ℝ} (ε_pos : 0 < ε) (hC : 0 ≤ C)
    (hf : ∀ x ∈ ball (0 : E) ε, ‖f x‖ ≤ C * ‖x‖) : ‖f‖ ≤ C

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

(hf : ∀ x ∈ Metric.ball 0 ε, ‖f x‖ ≤ C * ‖x‖)


theorem exists_fin_two {p : Fin 2 → Prop} : (∃ i, p i) ↔ p 0 ∨ p 1


@[simp]
lemma negOnePow_one : negOnePow 1 = -1


@[simp]
theorem lt_update_self_iff : x < update x i a ↔ x i < a

{ι : Type u_1}
{π : ι → Type u_4}
[DecidableEq ι]
[(i : ι) → Preorder (π i)]
{x : (i : ι) → π i}
{i : ι}
{a : π i}


@[simp]
theorem of_add_of [Add α] (f g : m → n → α) : of f + of g = of (f + g)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Add α]
(f g : m → n → α)

Matrix.of f + Matrix.of g = Matrix.of (f + g)


theorem isAlgebraic_algHom_iff (f : A →ₐ[R] B) (hf : Function.Injective f)
    {a : A} : IsAlgebraic R (f a) ↔ IsAlgebraic R a

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
{B : Type u_2}
[Ring B]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : Function.Injective ⇑f)
{a : A}


@[to_additive (attr := simp)]
theorem snd_one [One M] [One N] : (1 : M × N).2 = 1

{M : Type u_5}
{N : Type u_6}
[Zero M]
[Zero N]


@[to_additive]
theorem tprod_subtype (s : Set β) (f : β → α) : ∏' x : s, f x = ∏' x, s.mulIndicator f x

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

∑' (x : ↑s), f ↑x = ∑' (x : β), s.indicator f x


@[simp]
theorem integrable_neg : Integrable I l (-f) vol ↔ Integrable I l f vol

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}

BoxIntegral.Integrable I l (-f) vol ↔ BoxIntegral.Integrable I l f vol


theorem HasIntegral.mono {l₁ l₂ : IntegrationParams} (h : HasIntegral I l₁ f vol y) (hl : l₂ ≤ l₁) :
    HasIntegral I l₂ f vol y

(h : BoxIntegral.HasIntegral I l₁ f vol y)


@[to_additive]
theorem inr_injective : Injective (inr : N →* M ∗ N)

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


protected theorem measurable [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
    (f : α →ₘ[μ] β) : Measurable f


theorem bsup_eq_blsub_iff_succ {o : Ordinal.{u}} (f : ∀ a < o, Ordinal.{max u v}) :
    bsup.{_, v} o f = blsub.{_, v} o f ↔ ∀ a < blsub.{_, v} o f, succ a < blsub.{_, v} o f

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

o.bsup f = o.blsub f ↔ ∀ a < o.blsub f, Order.succ a < o.blsub f


theorem IsCompact.exists_sInf_image_eq_and_le [ClosedIicTopology α] {s : Set β}
    (hs : IsCompact s) (ne_s : s.Nonempty) {f : β → α} (hf : ContinuousOn f s) :
    ∃ x ∈ s, sInf (f '' s) = f x ∧ ∀ y ∈ s, f x ≤ f y

{α : Type u_2}
{β : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
{s : Set β}
(hs : IsCompact s)
(ne_s : s.Nonempty)
{f : β → α}
(hf : ContinuousOn f s)


theorem symm (x y : X) : S.Rel x y → S.Rel y x

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


/-- Constructs an isomorphism between pointed types from an equivalence that preserves the point
between them. -/
@[simps]
def Iso.mk {α β : Pointed} (e : α ≃ β) (he : e α.point = β.point) : α ≅ β

{α β : Pointed}
(e : α.X ≃ β.X)
(he : e α.point = β.point)
(a : β.X)

(Pointed.Iso.mk e he).inv.toFun a = e.symm a


@[to_additive]
lemma map_comp_zpow [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (g : ι → G)
    (n : ℤ) : f ∘ (g ^ n) = f ∘ g ^ n

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


theorem unifIntegrable_congr_ae {p : ℝ≥0∞} {f g : ι → α → β} (hfg : ∀ n, f n =ᵐ[μ] g n) :
    UnifIntegrable f p μ ↔ UnifIntegrable g p μ

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{p : ℝ≥0∞}
{f g : ι → α → β}
(hfg : ∀ (n : ι), f n =ᵐ[μ] g n)

MeasureTheory.UnifIntegrable f p μ ↔ MeasureTheory.UnifIntegrable g p μ


theorem convex_Ioo (r s : β) : Convex 𝕜 (Ioo r s)

{𝕜 : Type u_1}
{β : Type u_4}
[OrderedSemiring 𝕜]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r s : β)


/-- (internal implementation) the limit cone of a functor,
implemented as flat sections of a pi type
-/
@[simps]
noncomputable def limitCone : Cone F

(u : ((CategoryTheory.Functor.const J).obj (Shrink.{u, max u v} ↑F.sections)).obj j)

(CategoryTheory.Limits.Types.Small.limitCone F).π.app j u = ↑((equivShrink ↑F.sections).symm u) j


theorem normalClosure_subset_iff {N : Subgroup G} [N.Normal] : s ⊆ N ↔ normalClosure s ≤ N

{G : Type u_1}
[Group G]
{s : Set G}
{N : Subgroup G}
[N.Normal]


@[simp]
theorem unop_le_unop_iff {S₁ S₂ : Subsemiring Rᵐᵒᵖ} : S₁.unop ≤ S₂.unop ↔ S₁ ≤ S₂

{R : Type u_2}
[NonAssocSemiring R]
{S₁ S₂ : Subsemiring Rᵐᵒᵖ}


theorem sups_sups_sups_comm : s ⊻ t ⊻ (u ⊻ v) = s ⊻ u ⊻ (t ⊻ v)

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


@[simp]
theorem prodCongrLeft_trans_prodComm :
    (prodCongrLeft e).trans (prodComm _ _) = (prodComm _ _).trans (prodCongrRight e)

{α₁ : Type u_3}
{β₁ : Type u_2}
{β₂ : Type u_1}
(e : α₁ → β₁ ≃ β₂)

(Equiv.prodCongrLeft e).trans (Equiv.prodComm β₂ α₁) = (Equiv.prodComm β₁ α₁).trans (Equiv.prodCongrRight e)


theorem add_comp (f g : X ⟶ Y) (h : Y ⟶ Z) : (f + g) ≫ h = f ≫ h + g ≫ h


theorem card_Icc : (Icc f g).card = ∏ i ∈ f.support ∪ g.support, (Icc (f i) (g i)).card

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

(Finset.Icc f g).card = ∏ i ∈ f.support ∪ g.support, (Finset.Icc (f i) (g i)).card


theorem ι_mul_ι_mul_of_isOrtho (x : CliffordAlgebra Q) {a b : M} (h : Q.IsOrtho a b) :
    ι Q a * (ι Q b * x) = -(ι Q b * (ι Q a * x))

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(x : CliffordAlgebra Q)
{a b : M}
(h : QuadraticMap.IsOrtho Q a b)

(CliffordAlgebra.ι Q) a * ((CliffordAlgebra.ι Q) b * x) = -((CliffordAlgebra.ι Q) b * ((CliffordAlgebra.ι Q) a * x))


/-- `IsAdjoinRoot S f` states that the ring `S` can be constructed by adjoining a specified root
of the polynomial `f : R[X]` to `R`.

Compare `PowerBasis R S`, which does not explicitly specify which polynomial we adjoin a root of
(in particular `f` does not need to be the minimal polynomial of the root we adjoin),
and `AdjoinRoot` which constructs a new type.

This is not a typeclass because the choice of root given `S` and `f` is not unique.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure IsAdjoinRoot {R : Type u} (S : Type v) [CommSemiring R] [Semiring S] [Algebra R S]
    (f : R[X]) : Type max u v where
  map : R[X] →+* S
  map_surjective : Function.Surjective map
  ker_map : RingHom.ker map = Ideal.span {f}
  algebraMap_eq : algebraMap R S = map.comp Polynomial.C

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{f : R[X]}
(self : IsAdjoinRoot S f)


@[simp]
theorem toNatLinearEquiv_symm : e.toNatLinearEquiv.symm = e.symm.toNatLinearEquiv

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


protected theorem ciSup_mul_ciSup (g : ι' → Cardinal.{v}) :
    (⨆ i, f i) * (⨆ j, g j) = ⨆ (i) (j), f i * g j

{ι : Type u}
{ι' : Type w}
(f : ι → Cardinal.{v})
(g : ι' → Cardinal.{v})

(⨆ i, f i) * ⨆ j, g j = ⨆ i, ⨆ j, f i * g j


@[simp]
theorem seqRight_def (s : Finset α) (t : Finset β) : s *> t = if s = ∅ then ∅ else t

{α β : Type u}
[(P : Prop) → Decidable P]
(s : Finset α)
(t : Finset β)

(SeqRight.seqRight s fun x => t) = if s = ∅ then ∅ else t


/-- The composition of two oplax monoidal functors is again oplax monoidal. -/
@[simps]
def comp : OplaxMonoidalFunctor.{v₁, v₃} C E

(F : CategoryTheory.OplaxMonoidalFunctor C D)

(G : CategoryTheory.OplaxMonoidalFunctor D E)

(F ⊗⋙ G).toFunctor = F.toFunctor ⋙ G.toFunctor


@[simp]
theorem snoc_castSucc : snoc p x (castSucc i) = p i

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


theorem ediv_nonneg {a b : Int} (Ha : 0 ≤ a) (Hb : 0 ≤ b) : 0 ≤ a / b


@[simp]
theorem algebraMap_eq_one_iff (x : R) : algebraMap R (ExteriorAlgebra R M) x = 1 ↔ x = 1

{R : Type u1}
[CommRing R]
(M : Type u2)
[AddCommGroup M]
[Module R M]
(x : R)

(algebraMap R (ExteriorAlgebra R M)) x = 1 ↔ x = 1


theorem exists_eval₂_eq_zero {R : Type*} [Field R] [IsAlgClosed k] (f : R →+* k) (p : R[X])
    (hp : p.degree ≠ 0) : ∃ x, p.eval₂ f x = 0

{k : Type u}
[Field k]
{R : Type u_1}
[Field R]
[IsAlgClosed k]
(f : R →+* k)
(p : R[X])
(hp : p.degree ≠ 0)


@[to_additive]
lemma extend_smul {M α β : Type*} [SMul M β] (r : M) (f : ι → α) (g : ι → β) (e : α → β) :
    extend f (r • g) (r • e) = r • extend f g e

{ι : Type u_1}
{M : Type u_7}
{α : Type u_8}
{β : Type u_9}
[VAdd M β]
(r : M)
(f : ι → α)
(g : ι → β)
(e : α → β)

Function.extend f (r +ᵥ g) (r +ᵥ e) = r +ᵥ Function.extend f g e


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

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

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