/-- A telescoping product along `{0, ..., n - 1}` of a commutative group valued function reduces to
the ratio of the last and first factors. -/
@[to_additive "A telescoping sum along `{0, ..., n - 1}` of an additive commutative group valued
function reduces to the difference of the last and first terms."]
theorem prod_range_div {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
    (∏ i ∈ range n, f (i + 1) / f i) = f n / f 0

{M : Type u_6}
[CommGroup M]
(f : ℕ → M)
(n : ℕ)

∏ i ∈ Finset.range n, f (i + 1) / f i = f n / f 0


theorem setToL1S_sub {T : Set α → E →L[ℝ] F} (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
    (h_add : FinMeasAdditive μ T) (f g : α →₁ₛ[μ] E) :
    setToL1S T (f - g) = setToL1S T f - setToL1S T g

(h_zero : ∀ (s : Set α), MeasurableSet s → μ s = 0 → T s = 0)

(h_add : MeasureTheory.FinMeasAdditive μ T)

(f g : ↥(MeasureTheory.Lp.simpleFunc E 1 μ))

MeasureTheory.L1.SimpleFunc.setToL1S T (f - g) =
  MeasureTheory.L1.SimpleFunc.setToL1S T f - MeasureTheory.L1.SimpleFunc.setToL1S T g


theorem sup_opow_nat {o : Ordinal} (ho : 0 < o) : (sup fun n : ℕ => o ^ (n : Ordinal)) = o ^ ω


/-- The map `(x, y) ↦ (x, y / x)` is measure-preserving. -/
@[to_additive measurePreserving_prod_sub "The map `(x, y) ↦ (x, y - x)` is measure-preserving."]
theorem measurePreserving_prod_div [IsMulRightInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.1, z.2 / z.1)) (μ.prod ν) (μ.prod ν)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[ν.IsMulRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.1, z.2 / z.1)) (μ.prod ν) (μ.prod ν)


theorem nonneg_pi_iff {P} [Fintype ι] [OrderedAddCommMonoid P] [Module R P]
    {Q : ∀ i, QuadraticMap R (Mᵢ i) P} : (∀ x, 0 ≤ pi Q x) ↔ ∀ i x, 0 ≤ Q i x

{ι : Type u_1}
{R : Type u_2}
{Mᵢ : ι → Type u_8}
[CommSemiring R]
[(i : ι) → AddCommMonoid (Mᵢ i)]
[(i : ι) → Module R (Mᵢ i)]
{P : Type u_10}
[Fintype ι]
[OrderedAddCommMonoid P]
[Module R P]
{Q : (i : ι) → QuadraticMap R (Mᵢ i) P}

(∀ (x : (i : ι) → Mᵢ i), 0 ≤ (QuadraticMap.pi Q) x) ↔ ∀ (i : ι) (x : Mᵢ i), 0 ≤ (Q i) x


theorem map_inf [SemilatticeInf α] [LinearOrder β] [FunLike F β α]
    [RelHomClass F (· < ·) (· < ·)] (a : F) (m n : β) :
    a (m ⊓ n) = a m ⊓ a n

[RelHomClass F (fun x x_1 => x < x_1) fun x x_1 => x < x_1]


@[simp]
theorem RightExactFunctor.ofExact_map {F G : C ⥤ₑ D} (α : F ⟶ G) :
    (RightExactFunctor.ofExact C D).map α = α

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ₑ D}
(α : F ⟶ G)

(CategoryTheory.RightExactFunctor.ofExact C D).map α = α


/-- For any `S`-module Y, there is a natural `R`-linear map from `S ⨂ Y` to `Y` by
`s ⊗ y ↦ s • y` -/
@[simps apply]
def Counit.map {Y} : (restrictScalars f ⋙ extendScalars f).obj Y ⟶ Y

{R : Type u₁}
{S : Type u₂}
[CommRing R]
[CommRing S]
(f : R →+* S)
{Y : ModuleCat S}
(a : TensorProduct R S ↑Y)

(ModuleCat.ExtendRestrictScalarsAdj.Counit.map f) a =
  (TensorProduct.lift
      { toFun := fun s => { toFun := fun y => s • y, map_add' := ⋯, map_smul' := ⋯ }, map_add' := ⋯, map_smul' := ⋯ })
    a


@[to_additive]
theorem pairwiseDisjoint_smul_iff {s : Set α} {t : Finset α} :
    s.PairwiseDisjoint (· • t) ↔ (s ×ˢ t : Set (α × α)).InjOn fun p => p.1 * p.2

{α : Type u_2}
[Mul α]
[IsLeftCancelMul α]
[DecidableEq α]
{s : Set α}
{t : Finset α}

(s.PairwiseDisjoint fun x => x • t) ↔ Set.InjOn (fun p => p.1 * p.2) (s ×ˢ ↑t)


theorem sbtw_of_btw_not_btw {a b c : α} (habc : btw a b c) (hcba : ¬btw c b a) : sbtw a b c

{α : Type u_1}
[CircularPreorder α]
{a b c : α}
(habc : btw a b c)
(hcba : ¬btw c b a)


@[simp]
theorem expand_one (f : R[X]) : expand R 1 f = f

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


@[to_additive (attr := simp)]
lemma smul_inv_smul (g : G) (a : α) : g • g⁻¹ • a = a

{G : Type u_3}
{α : Type u_7}
[AddGroup G]
[AddAction G α]
(g : G)
(a : α)


theorem Ico_union_Ico {a b c d : α} (h₁ : min a b ≤ max c d) (h₂ : min c d ≤ max a b) :
    Ico a b ∪ Ico c d = Ico (min a c) (max b d)

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
{a b c d : α}
(h₁ : min a b ≤ max c d)
(h₂ : min c d ≤ max a b)

Finset.Ico a b ∪ Finset.Ico c d = Finset.Ico (min a c) (max b d)


@[simp]
theorem mapEquiv_refl : mapEquiv f (Equiv.refl α) = Equiv.refl (f α)

{α : Type u}
(f : Type u → Type v)
[Functor f]
[LawfulFunctor f]

Functor.mapEquiv f (Equiv.refl α) = Equiv.refl (f α)


@[simp]
theorem mk₂_apply (f : M → Nₗ → Pₗ) {H1 H2 H3 H4} (m : M) (n : Nₗ) :
    (mk₂ R f H1 H2 H3 H4 : M →ₗ[R] Nₗ →ₗ[R] Pₗ) m n = f m n

{H1 : ∀ (m₁ m₂ : M) (n : Nₗ), f (m₁ + m₂) n = f m₁ n + f m₂ n}

{H2 : ∀ (c : R) (m : M) (n : Nₗ), f (c • m) n = c • f m n}

{H3 : ∀ (m : M) (n₁ n₂ : Nₗ), f m (n₁ + n₂) = f m n₁ + f m n₂}

{H4 : ∀ (c : R) (m : M) (n : Nₗ), f m (c • n) = c • f m n}

((LinearMap.mk₂ R f H1 H2 H3 H4) m) n = f m n


@[to_additive]
lemma IsMulFreimanHom.mul_eq_mul (hf : IsMulFreimanHom 2 A B f) {a b c d : α}
    (ha : a ∈ A) (hb : b ∈ A) (hc : c ∈ A) (hd : d ∈ A) (h : a * b = c * d) :
    f a * f b = f c * f d

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{A : Set α}
{B : Set β}
{f : α → β}
(hf : IsMulFreimanHom 2 A B f)
{a b c d : α}
(ha : a ∈ A)
(hb : b ∈ A)
(hc : c ∈ A)
(hd : d ∈ A)
(h : a * b = c * d)


lemma upperClosure_inf_sdiff (hts : t ⊆ s) (hst : ∀ b ∈ s, ∀ c ∈ t, b ≤ c → b ∈ t) :
    upperClosure t ⊓ s.sdiff t = s

{α : Type u_1}
[Preorder α]
{s : UpperSet α}
{t : Set α}
(hts : t ⊆ ↑s)
(hst : ∀ b ∈ s, ∀ c ∈ t, b ≤ c → b ∈ t)


theorem Submodule.bot_eq_top_of_rank_eq_zero [NoZeroSMulDivisors R M] (h : Module.rank R M = 0) :
    (⊥ : Submodule R M) = ⊤

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
[NoZeroSMulDivisors R M]
(h : Module.rank R M = 0)


@[simp]
theorem map_id : ∀ P : RegularExpression α, P.map id = P

{α : Type u_1}
(P : RegularExpression α)


@[simp]
theorem bind_map {γ} (f : α → β) (x) (g : β → Part γ) :
    (map f x).bind g = x.bind fun y => g (f y)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
(f : α → β)
(x : Part α)
(g : β → Part γ)

(Part.map f x).bind g = x.bind fun y => g (f y)


theorem eq_zero_of_dvd_of_natDegree_lt {p q : R[X]} (h₁ : p ∣ q) (h₂ : natDegree q < natDegree p) :
    q = 0

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p q : R[X]}
(h₁ : p ∣ q)
(h₂ : q.natDegree < p.natDegree)


@[simp]
theorem one_apply (m : M) : (1 : M ≃ₗ⁅R,L⁆ M) m = m

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


/-- If `s₂ ⊆ s₁`, `t₂ ⊆ t₁` and they take up all but a `δ`-proportion, then the difference in edge
densities is at most `2 * δ`. -/
theorem abs_edgeDensity_sub_edgeDensity_le_two_mul (hs : s₂ ⊆ s₁) (ht : t₂ ⊆ t₁) (hδ : 0 ≤ δ)
    (hscard : (1 - δ) * s₁.card ≤ s₂.card) (htcard : (1 - δ) * t₁.card ≤ t₂.card) :
    |(edgeDensity r s₂ t₂ : 𝕜) - edgeDensity r s₁ t₁| ≤ 2 * δ

(hscard : (1 - δ) * ↑s₁.card ≤ ↑s₂.card)

(htcard : (1 - δ) * ↑t₁.card ≤ ↑t₂.card)

|↑(Rel.edgeDensity r s₂ t₂) - ↑(Rel.edgeDensity r s₁ t₁)| ≤ 2 * δ


theorem span_smul_span : Ideal.span S • span R T = span R (⋃ (s ∈ S) (t ∈ T), {s • t})

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(S : Set R)
(T : Set M)

Ideal.span S • Submodule.span R T = Submodule.span R (⋃ s ∈ S, ⋃ t ∈ T, {s • t})


@[to_additive (attr := simp)]
lemma finite_zpowers : (zpowers a : Set α).Finite ↔ IsOfFinOrder a

(↑(AddSubgroup.zmultiples a)).Finite ↔ IsOfFinAddOrder a


theorem image_inter_dom_eq (s : Set α) : r.image (s ∩ r.dom) = r.image s

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


@[to_additive]
nonrec theorem ContinuousWithinAt.const_smul (hg : ContinuousWithinAt g s b) (c : M) :
    ContinuousWithinAt (fun x => c • g x) s b

{M : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[SMul M α]
[ContinuousConstSMul M α]
[TopologicalSpace β]
{g : β → α}
{b : β}
{s : Set β}
(hg : ContinuousWithinAt g s b)
(c : M)


theorem count_eq_zero {l : List α} : count a l = 0 ↔ a ∉ l

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


theorem IsUpperSet.union (hs : IsUpperSet s) (ht : IsUpperSet t) : IsUpperSet (s ∪ t)

{α : Type u_1}
[LE α]
{s t : Set α}
(hs : IsUpperSet s)
(ht : IsUpperSet t)


theorem condexp_stopping_time_ae_eq_restrict_eq_of_countable_range [SigmaFiniteFiltration μ ℱ]
    (hτ : IsStoppingTime ℱ τ) (h_countable : (Set.range τ).Countable)
    [SigmaFinite (μ.trim (hτ.measurableSpace_le_of_countable_range h_countable))] (i : ι) :
    μ[f|hτ.measurableSpace] =ᵐ[μ.restrict {x | τ x = i}] μ[f|ℱ i]

μ[f|hτ.measurableSpace] =ᵐ[μ.restrict {x | τ x = i}] μ[f|↑ℱ i]


@[simp]
theorem coe_trans (e₁ : A ≃⋆+* B) (e₂ : B ≃⋆+* C) : ⇑(e₁.trans e₂) = e₂ ∘ e₁

{A : Type u_1}
{B : Type u_2}
{C : Type u_3}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
[Add C]
[Mul C]
[Star C]
(e₁ : A ≃⋆+* B)
(e₂ : B ≃⋆+* C)


/-- The image of `ExteriorAlgebra.ιMulti R n` spans the `n`th exterior power, as a submodule
of the exterior algebra. -/
lemma ιMulti_span_fixedDegree (n : ℕ) :
    Submodule.span R (Set.range (ιMulti R n)) = ⋀[R]^n M

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

Submodule.span R (Set.range ⇑(ExteriorAlgebra.ιMulti R n)) = ⋀[R]^n M


@[deprecated (since := "2024-06-05")]
theorem tailings_disjoint_tailing (f : M × N →ₗ[R] M) (i : Injective f) (n : ℕ) :
    Disjoint (tailings f i n) (tailing f i (n + 1))

{R : Type u}
{M : Type v}
[Ring R]
{N : Type u_3}
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(f : M × N →ₗ[R] M)
(i : Function.Injective ⇑f)
(n : ℕ)

Disjoint (f.tailings i n) (f.tailing i (n + 1))


@[simp]
theorem Ioc_diff_Ioo_same (h : a < b) : Ioc a b \ Ioo a b = {b}

{α : Type u_1}
[PartialOrder α]
{a b : α}
(h : a < b)


theorem uniformContinuous_subtype_val {p : α → Prop} [UniformSpace α] :
    UniformContinuous (Subtype.val : { a : α // p a } → α)

{α : Type ua}
{p : α → Prop}
[UniformSpace α]


theorem range_snd : NonUnitalRingHom.srange (snd R S) = ⊤

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

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


theorem ConcaveOn.left_le_of_le_right (hf : ConcaveOn 𝕜 s f) {x y z : E} (hx : x ∈ s) (hy : y ∈ s)
    (hz : z ∈ openSegment 𝕜 x y) (hyz : f z ≤ f y) : f x ≤ f z

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
{x y z : E}
(hx : x ∈ s)
(hy : y ∈ s)
(hz : z ∈ openSegment 𝕜 x y)
(hyz : f z ≤ f y)


theorem expSeries_div_summable_of_mem_ball [CompleteSpace 𝔸] (x : 𝔸)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) : Summable fun n => x ^ n / n !

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)


theorem isIdealMorphism_of_surjective (h : Function.Surjective f) : f.IsIdealMorphism

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


@[simp]
theorem coe_prodEquivOfIsCompl' (h : IsCompl p q) (x : p × q) :
    prodEquivOfIsCompl p q h x = x.1 + x.2

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
(p q : Submodule R E)
(h : IsCompl p q)
(x : ↥p × ↥q)

(p.prodEquivOfIsCompl q h) x = ↑x.1 + ↑x.2


lemma condKernelCountable_apply (h_atom : ∀ x y, x ∈ measurableAtom y → κCond x = κCond y)
    (p : α × β) : condKernelCountable κCond h_atom p = κCond p.1 p.2

(κCond : α → ProbabilityTheory.Kernel β Ω)

(h_atom : ∀ (x y : α), x ∈ measurableAtom y → κCond x = κCond y)

(ProbabilityTheory.Kernel.condKernelCountable κCond h_atom) p = (κCond p.1) p.2


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

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


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

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


theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
    (h₁ : Surjective f₁) (h₂ : ∀ a, Surjective (f₂ a)) : Surjective (Sigma.map f₁ f₂)

{f₁ : α₁ → α₂}

(h₂ : ∀ (a : α₁), Function.Surjective (f₂ a))


@[to_additive]
theorem norm_div_eq_zero_iff : ‖a / b‖ = 0 ↔ a = b

{E : Type u_6}
[NormedGroup E]
{a b : E}


@[simp]
theorem ediam_preimage (h : α ≃ᵢ β) (s : Set β) : EMetric.diam (h ⁻¹' s) = EMetric.diam s

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)
(s : Set β)

EMetric.diam (⇑h ⁻¹' s) = EMetric.diam s


/-- The map that appears in Behrend's bound on Roth numbers. -/
@[simps]
def map (d : ℕ) : (Fin n → ℕ) →+ ℕ

(Behrend.map d) a = ∑ i : Fin n, a i * d ^ ↑i


@[continuity]
theorem AddMonoidHom.continuous_extension [CompleteSpace β] [T0Space β] (f : α →+ β)
    (hf : Continuous f) : Continuous (f.extension hf)

{α : Type u_3}
{β : Type u_4}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
[UniformSpace β]
[AddGroup β]
[UniformAddGroup β]
[CompleteSpace β]
[T0Space β]
(f : α →+ β)
(hf : Continuous ⇑f)


/-- The defining property of the minimal polynomial of an element `x`:
it is the monic polynomial with smallest degree that has `x` as its root. -/
theorem min {p : A[X]} (pmonic : p.Monic) (hp : Polynomial.aeval x p = 0) :
    degree (minpoly A x) ≤ degree p

(A : Type u_1)
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
(x : B)
{p : A[X]}
(pmonic : p.Monic)
(hp : (Polynomial.aeval x) p = 0)


@[simp] lemma erase_eq : s.erase a = s ↔ a ∉ s

{α : Type u_1}
[Preorder α]
{s : UpperSet α}
{a : α}


/-- The obvious triangle `X₁ ⟶ X₁ ⨯ X₂ ⟶ X₂ ⟶ X₁⟦1⟧`. -/
@[simps!]
def binaryProductTriangle (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryProduct X₁ X₂] :
    Triangle C

(CategoryTheory.Pretriangulated.binaryProductTriangle X₁ X₂).obj₁ = X₁


@[simp low+1]
theorem singleton_vsub (t : Set β) (b : β) : {b} -ᵥ t = (b -ᵥ ·) '' t

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


@[measurability]
theorem measurable_infEdist {s : Set α} : Measurable fun x => infEdist x s

{α : Type u_1}
[PseudoEMetricSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{s : Set α}

Measurable fun x => EMetric.infEdist x s


theorem natTrailingDegree_le_natDegree (p : R[X]) : p.natTrailingDegree ≤ p.natDegree


lemma dens_map_le [Fintype β] (f : α ↪ β) : dens (s.map f) ≤ dens s

{α : Type u_2}
{β : Type u_3}
[Fintype α]
{s : Finset α}
[Fintype β]
(f : α ↪ β)


theorem mem_keys_of_mem_keys_kerase {a₁ a₂} {l : List (Sigma β)} :
    a₁ ∈ (kerase a₂ l).keys → a₁ ∈ l.keys

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a₁ a₂ : α}
{l : List (Sigma β)}

a₁ ∈ (List.kerase a₂ l).keys → a₁ ∈ l.keys


theorem toIocMod_le_toIcoMod_add (a b : α) : toIocMod hp a b ≤ toIcoMod hp a b + p

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


lemma coborder_eq_union_frontier_compl :
    coborder s = s ∪ (frontier s)ᶜ

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


@[simp]
theorem isLittleO_bot : f =o[⊥] g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
(f : α → E)
(g : α → F)


theorem induction₂ {p : (α →₀ M) → Prop} (f : α →₀ M) (h0 : p 0)
    (ha : ∀ (a b) (f : α →₀ M), a ∉ f.support → b ≠ 0 → p f → p (f + single a b)) : p f

(ha : ∀ (a : α) (b : M) (f : α →₀ M), a ∉ f.support → b ≠ 0 → p f → p (f + Finsupp.single a b))


@[simp]
theorem covBy_top_iff : a ⋖ ⊤ ↔ IsCoatom a

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


theorem SetLike.algebraMap_mem_graded [Zero ι] [CommSemiring S] [Semiring R] [Algebra S R]
    (A : ι → Submodule S R) [SetLike.GradedOne A] (s : S) : algebraMap S R s ∈ A 0

{ι : Type u_1}
{S : Type u_3}
{R : Type u_4}
[Zero ι]
[CommSemiring S]
[Semiring R]
[Algebra S R]
(A : ι → Submodule S R)
[SetLike.GradedOne A]
(s : S)


theorem add_mod_of_add_mod_lt {a b c : ℕ} (hc : a % c + b % c < c) :
    (a + b) % c = a % c + b % c


@[simp]
theorem obj_X (X : SimplicialObject C) (n : ℕ) : (AlternatingFaceMapComplex.obj X).X n = X _[n]

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

(AlgebraicTopology.AlternatingFaceMapComplex.obj X).X n = X _[n]


@[simp]
theorem sigmaCongrRight_inv {α : Type*} {β : α → Type*} (F : ∀ a, Perm (β a)) :
    (sigmaCongrRight F)⁻¹ = sigmaCongrRight fun a => (F a)⁻¹

{α : Type u_1}
{β : α → Type u_2}
(F : (a : α) → Equiv.Perm (β a))

(Equiv.Perm.sigmaCongrRight F)⁻¹ = Equiv.Perm.sigmaCongrRight fun a => (F a)⁻¹


@[simp]
theorem ennreal_coeFn_eq_coeFn_toMeasure (ν : FiniteMeasure Ω) (s : Set Ω) :
    (ν s : ℝ≥0∞) = (ν : Measure Ω) s

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


theorem not_mem_sigmaLift_of_ne_left (f : ∀ ⦃i⦄, α i → β i → Finset (γ i)) (a : Sigma α)
    (b : Sigma β) (x : Sigma γ) (h : a.1 ≠ x.1) : x ∉ sigmaLift f a b

(f : ⦃i : ι⦄ → α i → β i → Finset (γ i))


/-- The pullback cone whose cone point is the explicit pullback. -/
@[simps! pt π]
def pullback.cone : Limits.PullbackCone f g

{X Y B : LightProfinite}
(f : X ⟶ B)
(g : Y ⟶ B)

(LightProfinite.pullback.cone f g).pt = LightProfinite.pullback f g


@[reassoc (attr := simp)]
lemma ι_mapBifunctorComp₁₂MapObjIso_inv (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (j : J)
    (h : r (i₁, i₂, i₃) = j) :
    ιMapBifunctor₁₂BifunctorMapObj F₁₂ G ρ₁₂ X₁ X₂ X₃ i₁ i₂ i₃ j h ≫
      (mapBifunctorComp₁₂MapObjIso F₁₂ G ρ₁₂ X₁ X₂ X₃).inv j =
      ιMapTrifunctorMapObj (bifunctorComp₁₂ F₁₂ G) r X₁ X₂ X₃ i₁ i₂ i₃ j h

(F₁₂ : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₁₂))

(G : CategoryTheory.Functor C₁₂ (CategoryTheory.Functor C₃ C₄))

(ρ₁₂ : CategoryTheory.GradedObject.BifunctorComp₁₂IndexData r)

(X₁ : CategoryTheory.GradedObject I₁ C₁)

(X₂ : CategoryTheory.GradedObject I₂ C₂)

(X₃ : CategoryTheory.GradedObject I₃ C₃)

[(((CategoryTheory.GradedObject.mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).HasMap ρ₁₂.p]

[(((CategoryTheory.GradedObject.mapBifunctor G ρ₁₂.I₁₂ I₃).obj
            (CategoryTheory.GradedObject.mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂)).obj
        X₃).HasMap
    ρ₁₂.q]

[H : CategoryTheory.GradedObject.HasGoodTrifunctor₁₂Obj F₁₂ G ρ₁₂ X₁ X₂ X₃]

[((((CategoryTheory.GradedObject.mapTrifunctor (CategoryTheory.bifunctorComp₁₂ F₁₂ G) I₁ I₂ I₃).obj X₁).obj X₂).obj
        X₃).HasMap
    r]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.ιMapBifunctor₁₂BifunctorMapObj F₁₂ G ρ₁₂ X₁ X₂ X₃ i₁ i₂ i₃ j h)
    ((CategoryTheory.GradedObject.mapBifunctorComp₁₂MapObjIso F₁₂ G ρ₁₂ X₁ X₂ X₃).inv j) =
  CategoryTheory.GradedObject.ιMapTrifunctorMapObj (CategoryTheory.bifunctorComp₁₂ F₁₂ G) r X₁ X₂ X₃ i₁ i₂ i₃ j h


lemma IsHamiltonian.connected (hG : G.IsHamiltonian) : G.Connected

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{G : SimpleGraph α}
(hG : G.IsHamiltonian)


/-- Given right homology data `h₁` and `h₂` for two short complexes `S₁` and `S₂`,
a `RightHomologyMapData` for a morphism `φ : S₁ ⟶ S₂`
consists of a description of the induced morphisms on the `Q` (opcycles)
and `H` (right homology) fields of `h₁` and `h₂`. -/
structure RightHomologyMapData where
  /-- the induced map on opcycles -/
  φQ : h₁.Q ⟶ h₂.Q
  /-- the induced map on right homology -/
  φH : h₁.H ⟶ h₂.H
  /-- commutation with `p` -/
  commp : h₁.p ≫ φQ = φ.τ₂ ≫ h₂.p := by aesop_cat
  /-- commutation with `g'` -/
  commg' : φQ ≫ h₂.g' = h₁.g' ≫ φ.τ₃ := by aesop_cat
  /-- commutation with `ι` -/
  commι : φH ≫ h₂.ι = h₁.ι ≫ φQ := by aesop_cat

(self : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂)

CategoryTheory.CategoryStruct.comp self.φH h₂.ι = CategoryTheory.CategoryStruct.comp h₁.ι self.φQ


@[simp]
theorem subset_dedup' {s t : Multiset α} : s ⊆ dedup t ↔ s ⊆ t

{α : Type u_1}
[DecidableEq α]
{s t : Multiset α}


@[simp]
theorem liftRel_think_left (R : α → β → Prop) (s t) : LiftRel R (think s) t ↔ LiftRel R s t

{α : Type u}
{β : Type v}
(R : α → β → Prop)
(s : Stream'.WSeq α)
(t : Stream'.WSeq β)

Stream'.WSeq.LiftRel R s.think t ↔ Stream'.WSeq.LiftRel R s t


theorem preimage_coe_nnreal_real (h : s.OrdConnected) : ((↑) ⁻¹' s : Set ℝ≥0).OrdConnected


theorem toFin_injective {n : Nat} : Function.Injective (toFin : BitVec n → _)


/-- If `f` is convex on `S` and differentiable at all points of `S`, then its derivative is monotone
on `S`. -/
theorem monotoneOn_deriv (hfc : ConvexOn ℝ S f) (hfd : ∀ x ∈ S, DifferentiableAt ℝ f x) :
    MonotoneOn (deriv f) S

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


theorem absNorm_eq (I : FractionalIdeal R⁰ K) :
    absNorm I = (Ideal.absNorm I.num : ℚ) / |Algebra.norm ℤ (I.den : R)|

(I : FractionalIdeal (nonZeroDivisors R) K)

FractionalIdeal.absNorm I = ↑(Ideal.absNorm I.num) / ↑|(Algebra.norm ℤ) ↑I.den|


theorem lift_unique {N : Type*} [SeminormedAddCommGroup N] (S : AddSubgroup M)
    (f : NormedAddGroupHom M N) (hf : ∀ s ∈ S, f s = 0) (g : NormedAddGroupHom (M ⧸ S) N)
    (h : g.comp S.normedMk = f) : g = lift S f hf

{M : Type u_1}
[SeminormedAddCommGroup M]
{N : Type u_3}
[SeminormedAddCommGroup N]
(S : AddSubgroup M)
(f : NormedAddGroupHom M N)
(hf : ∀ s ∈ S, f s = 0)
(g : NormedAddGroupHom (M ⧸ S) N)
(h : g.comp S.normedMk = f)


theorem singleton_disjUnion (a : α) (t : Finset α) (h : Disjoint {a} t) :
    disjUnion {a} t h = cons a t (disjoint_singleton_left.mp h)

{α : Type u_1}
(a : α)
(t : Finset α)
(h : Disjoint {a} t)


theorem isClosed_iSup_iff {s : Set α} : IsClosed[⨆ i, t i] s ↔ ∀ i, IsClosed[t i] s

{α : Type u}
{ι : Sort v}
{t : ι → TopologicalSpace α}
{s : Set α}


theorem gfp_le {a : α} (h : ∀ b, b ≤ f b → b ≤ a) : gfp f ≤ a

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{a : α}
(h : ∀ b ≤ f b, b ≤ a)


@[to_additive (attr := simp)]
theorem self_trans_symm (e : M ≃* N) : e.trans e.symm = refl M

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(e : M ≃* N)


/-- The determinant of an endomorphism given a basis.

See `LinearMap.det` for a version that populates the basis non-computably.

Although the `Trunc (Basis ι A M)` parameter makes it slightly more convenient to switch bases,
there is no good way to generalize over universe parameters, so we can't fully state in `detAux`'s
type that it does not depend on the choice of basis. Instead you can use the `detAux_def''` lemma,
or avoid mentioning a basis at all using `LinearMap.det`.
-/
irreducible_def detAux : Trunc (Basis ι A M) → (M →ₗ[A] M) →* A

{M : Type u_7}
[AddCommGroup M]
{ι : Type u_8}
[DecidableEq ι]
[Fintype ι]
{A : Type u_9}
[CommRing A]
[Module A M]

LinearMap.detAux = Trunc.lift (fun b => Matrix.detMonoidHom.comp ↑(LinearMap.toMatrixAlgEquiv b)) ⋯


@[simp]
theorem decode_unit_zero : decode 0 = some PUnit.unit


theorem sup_left_comm (a b c : α) : a ⊔ (b ⊔ c) = b ⊔ (a ⊔ c)

{α : Type u}
[SemilatticeSup α]
(a b c : α)


lemma pow_lt_pow_succ (ha : 1 < a) : a ^ n < a ^ n.succ

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a : α}
{n : ℕ}
(ha : 1 < a)


/-- The ring `HahnSeries ℕ R` is isomorphic to `PowerSeries R`. -/
@[simps]
def toPowerSeries : HahnSeries ℕ R ≃+* PowerSeries R

{R : Type u_2}
[Semiring R]
(f : PowerSeries R)
(n : ℕ)

(HahnSeries.toPowerSeries.symm f).coeff n = (PowerSeries.coeff R n) f


@[simp]
theorem continuousMultilinearCurryLeftEquiv_apply
    (f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i : Fin n => Ei i.succ) G) (v : ∀ i, Ei i) :
    continuousMultilinearCurryLeftEquiv 𝕜 Ei G f v = f (v 0) (tail v)

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

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

(f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i => Ei i.succ) G)

((continuousMultilinearCurryLeftEquiv 𝕜 Ei G) f) v = (f (v 0)) (Fin.tail v)


(A : SimplicialObject.Splitting.IndexSet Δ)


/-- Basic hypothesis to talk about a topological group. A topological group over `M`, for example,
is obtained by requiring the instances `Group M` and `ContinuousMul M` and
`ContinuousInv M`. -/
@[to_additive (attr := continuity)]
class ContinuousInv (G : Type u) [TopologicalSpace G] [Inv G] : Prop where
  continuous_inv : Continuous fun a : G => a⁻¹

{G : Type u}
[TopologicalSpace G]
[Inv G]
[self : ContinuousInv G]


@[simp]
theorem center_eq_inversion' : c = inversion c R x ↔ x = c ∨ R = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c x : P}
{R : ℝ}

c = EuclideanGeometry.inversion c R x ↔ x = c ∨ R = 0


lemma cfcₙ_comp_smul {S : Type*} [SMulZeroClass S R] [ContinuousConstSMul S R]
    [SMulZeroClass S A] [IsScalarTower S R A] [IsScalarTower S R (R → R)]
    (s : S) (f : R → R) (a : A) (hf : ContinuousOn f ((s • ·) '' (σₙ R a)) := by cfc_cont_tac)
    (hf0 : f 0 = 0 := by cfc_zero_tac) (ha : p a := by cfc_tac) :
    cfcₙ (f <| s • ·) a = cfcₙ f (s • a)

(hf : ContinuousOn f ((fun x => s • x) '' σₙ R a) := by cfc_cont_tac)

cfcₙ (fun x => f (s • x)) a = cfcₙ f (s • a)


theorem pullback.mapDesc_comp {X Y S T S' : C} (f : X ⟶ T) (g : Y ⟶ T) (i : T ⟶ S) (i' : S ⟶ S')
    [HasPullback f g] [HasPullback (f ≫ i) (g ≫ i)] [HasPullback (f ≫ i ≫ i') (g ≫ i ≫ i')]
    [HasPullback ((f ≫ i) ≫ i') ((g ≫ i) ≫ i')] :
    pullback.mapDesc f g (i ≫ i') = pullback.mapDesc f g i ≫ pullback.mapDesc _ _ i' ≫
    (pullback.congrHom (Category.assoc _ _ _) (Category.assoc _ _ _)).hom

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

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

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

CategoryTheory.Limits.pullback.mapDesc f g (i ≫ i') =
  CategoryTheory.Limits.pullback.mapDesc f g i ≫
    CategoryTheory.Limits.pullback.mapDesc (f ≫ i) (g ≫ i) i' ≫ (CategoryTheory.Limits.pullback.congrHom ⋯ ⋯).hom


@[to_additive MeasureTheory.disjoint_addFundamentalInterior_addFundamentalFrontier]
theorem disjoint_fundamentalInterior_fundamentalFrontier :
    Disjoint (fundamentalInterior G s) (fundamentalFrontier G s)

(G : Type u_1)
{α : Type u_3}
[AddGroup G]
[AddAction G α]
(s : Set α)

Disjoint (MeasureTheory.addFundamentalInterior G s) (MeasureTheory.addFundamentalFrontier G s)


theorem UInt32.ext_iff {x y : UInt32} : x = y ↔ x.toNat = y.toNat


theorem HasStrictFDerivAt.cosh (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => Real.cosh (f x)) (Real.sinh (f x) • f') x

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


theorem nonZeroDivisors_le_comap_nonZeroDivisors_of_injective [NoZeroDivisors M']
    [MonoidWithZeroHomClass F M M'] (f : F) (hf : Function.Injective f) : M⁰ ≤ M'⁰.comap f

{M : Type u_2}
{M' : Type u_3}
{F : Type u_7}
[MonoidWithZero M]
[MonoidWithZero M']
[FunLike F M M']
[NoZeroDivisors M']
[MonoidWithZeroHomClass F M M']
(f : F)
(hf : Function.Injective ⇑f)


@[to_additive] lemma antivaryOn_inv : AntivaryOn f⁻¹ g⁻¹ s ↔ AntivaryOn f g s

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

AntivaryOn (-f) (-g) s ↔ AntivaryOn f g s


@[to_additive]
theorem op_sup (S₁ S₂ : Submonoid M) : (S₁ ⊔ S₂).op = S₁.op ⊔ S₂.op

{M : Type u_2}
[MulOneClass M]
(S₁ S₂ : Submonoid M)


theorem surjInv_eq (h : Surjective f) (b) : f (surjInv h b) = b

{α : Sort u}
{β : Sort v}
{f : α → β}
(h : Function.Surjective f)
(b : β)


theorem partNum_eq_s_a {gp : Pair α} (s_nth_eq : g.s.get? n = some gp) :
    g.partNums.get? n = some gp.a

{α : Type u_1}
{g : GenContFract α}
{n : ℕ}
{gp : GenContFract.Pair α}
(s_nth_eq : g.s.get? n = some gp)


/-- To give an object in the under category, it suffices to give an arrow with domain `X`. -/
@[simps! right hom]
def mk {X Y : T} (f : X ⟶ Y) : Under X

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


theorem comap_map_of_surjective (hf : Function.Surjective f) (I : Ideal R) :
    comap f (map f I) = I ⊔ comap f ⊥

{R : Type u}
{S : Type v}
{F : Type u_1}
[Ring R]
[Ring S]
[FunLike F R S]
[RingHomClass F R S]
(f : F)
(hf : Function.Surjective ⇑f)
(I : Ideal R)

Ideal.comap f (Ideal.map f I) = I ⊔ Ideal.comap f ⊥


theorem sq_lt_one_iff {a : R} (ha : 0 ≤ a) : a ^ 2 < 1 ↔ a < 1

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
(ha : 0 ≤ a)


theorem eigenvalue_pos_of_pos {μ : ℝ} {T : E →ₗ[𝕜] E} (hμ : HasEigenvalue T μ)
    (hnn : ∀ x : E, 0 < RCLike.re ⟪x, T x⟫) : 0 < μ

(hnn : ∀ (x : E), 0 < RCLike.re ⟪x, T x⟫_𝕜)


@[reassoc (attr := simp)]
lemma map_condition : G.map f ≫ G.map c.π = 0

(c : CategoryTheory.Limits.CokernelCofork f)

G.map f ≫ G.map (CategoryTheory.Limits.Cofork.π c) = 0


protected theorem hasFPowerSeriesAt_bilinear (f : E →L[𝕜] F →L[𝕜] G) (x : E × F) :
    HasFPowerSeriesAt (fun x : E × F => f x.1 x.2) (f.fpowerSeriesBilinear x) x

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

HasFPowerSeriesAt (fun x => (f x.1) x.2) (f.fpowerSeriesBilinear x) x


/-- The valuation subring of a valued field is open. -/
theorem valuationSubring_isOpen (K : Type u) [Field K] [hv : Valued K Γ₀] :
    IsOpen (hv.v.valuationSubring : Set K)

{Γ₀ : Type v}
[LinearOrderedCommGroupWithZero Γ₀]
(K : Type u)
[Field K]
[hv : Valued K Γ₀]


lemma finSuccAboveOrderIso_symm_apply_last (x : { x : Fin (n + 1) // x ≠ Fin.last n }) :
    (finSuccAboveOrderIso (Fin.last n)).symm x = Fin.castLT x.1 (Fin.val_lt_last x.2)

(finSuccAboveOrderIso (Fin.last n)).symm x = (↑x).castLT ⋯


theorem lift_algebraMap_apply (h : IsAdjoinRoot S f) (z : S) :
    h.lift (algebraMap R T) x hx' z = h.liftHom x hx' z

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[CommRing T]
{x : T}
[Algebra R T]
(hx' : (Polynomial.aeval x) f = 0)
(h : IsAdjoinRoot S f)
(z : S)

(IsAdjoinRoot.lift (algebraMap R T) x hx' h) z = (IsAdjoinRoot.liftHom x hx' h) z


@[simp]
theorem succ_eval : succ.eval = fun v => pure [v.headI.succ]

Turing.ToPartrec.Code.succ.eval = fun v => pure [v.headI.succ]


@[to_additive (attr := simp)]
theorem toProd_comp_inl : (toProd : M ∗ N →* M × N).comp inl = .inl _ _

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

AddMonoid.Coprod.toSum.comp AddMonoid.Coprod.inl = AddMonoidHom.inl M N


@[deprecated measure_biUnion_finset_le (since := "2024-05-14")]
protected theorem iUnion_finset (m : OuterMeasure α) (s : β → Set α) (t : Finset β) :
    m (⋃ i ∈ t, s i) ≤ ∑ i ∈ t, m (s i)

{α : Type u_1}
{β : Type u_2}
(m : MeasureTheory.OuterMeasure α)
(s : β → Set α)
(t : Finset β)


/-- `HasKernels` represents the existence of kernels for every morphism. -/
class HasKernels : Prop where
  has_limit : ∀ {X Y : C} (f : X ⟶ Y), HasKernel f := by infer_instance

[self : CategoryTheory.Limits.HasKernels C]


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

∀ (x x_1 : CategoryTheory.FullSubcategory P) (f : x ⟶ x_1),
  CategoryTheory.MonoidalCategory.whiskerLeft X f = CategoryTheory.MonoidalCategory.whiskerLeft X.obj f


/-- For a reflexive relation, insert then erasing is the identity. -/
theorem erase_orderedInsert [DecidableEq α] [IsRefl α r] (x : α) (xs : List α) :
    (xs.orderedInsert r x).erase x = xs

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

(List.orderedInsert r x xs).erase x = xs


/-- A set `C` is called perfect if it is closed and all of its
points are accumulation points of itself.
Note that we do not require `C` to be nonempty. -/
@[mk_iff perfect_def]
structure Perfect (C : Set α) : Prop where
  closed : IsClosed C
  acc : Preperfect C

{α : Type u_1}
[TopologicalSpace α]
(C : Set α)


/-- A finite set is totally bounded. -/
lemma Set.Finite.totallyBounded {s : Set α} (hs : s.Finite) : TotallyBounded s

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}
(hs : s.Finite)


theorem ext_iff {inst₁ inst₂ : Ring R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


/-- The composition of two cocontinuous functors is cocontinuous. -/
theorem isCocontinuous_comp [G.IsCocontinuous J K] [G'.IsCocontinuous K L] :
    (G ⋙ G').IsCocontinuous J L

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

{L : CategoryTheory.GrothendieckTopology E}


@[simp]
theorem mk_sub (f g : CauSeq β abv) : mk f - mk g = mk (f - g)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f g : CauSeq β abv)

CauSeq.Completion.mk f - CauSeq.Completion.mk g = CauSeq.Completion.mk (f - g)


@[simp]
theorem natDegree_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).natDegree = (unop p).natDegree

{R : Type u_1}
[Semiring R]
(p : R[X]ᵐᵒᵖ)

((Polynomial.opRingEquiv R) p).natDegree = (MulOpposite.unop p).natDegree


/--
Data showing that the Levenshtein distance from `xs` to `ys`
is bounded below by the minimum Levenshtein distance between some suffix of `xs`
and a particular suffix of `ys`.

This bound is (non-strict) monotone as we take longer suffixes of `ys`.

This is an auxiliary definition for the later `LevenshteinEstimator`:
this variant constructs a lower bound for the pair consisting of
the Levenshtein distance from `xs` to `ys`,
along with the length of `ys`.
-/
structure LevenshteinEstimator' : Type where
  /-- The prefix of `ys` that is not is not involved in the bound, in reverse order. -/
  pre_rev : List β
  /-- The suffix of `ys`, such that the distance from `xs` to `ys` is bounded below
  by the minimum distance from any suffix of `xs` to this suffix. -/
  suff : List β
  /-- Witness that `ys` has been decomposed into a prefix and suffix. -/
  split : pre_rev.reverse ++ suff = ys
  /-- The distances from each suffix of `xs` to `suff`. -/
  distances : {r : List δ // 0 < r.length}
  /-- Witness that `distances` are correct. -/
  distances_eq : distances = suffixLevenshtein C xs suff
  /-- The current bound on the pair (distance from `xs` to `ys`, length of `ys`). -/
  bound : δ × ℕ
  /-- Predicate describing the current bound. -/
  bound_eq : bound = match pre_rev with
    | [] => (distances.1[0]'(distances.2), ys.length)
    | _ => (List.minimum_of_length_pos distances.2, suff.length)

self.bound =
  match self.pre_rev, ⋯ with
  | [], split => ((↑self.distances)[0], ys.length)
  | x, split => (List.minimum_of_length_pos ⋯, self.suff.length)


@[simp]
theorem neg_apply [Neg α] (A : Matrix m n α) (i : m) (j : n) :
    (-A) i j = -(A i j)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Neg α]
(A : Matrix m n α)
(i : m)
(j : n)


/-- **Fundamental theorem of calculus-1**, strict differentiability in the right endpoint.

If `f : ℝ → E` is continuous, then `u ↦ ∫ x in a..u, f x` has derivative `f b` at `b` in the sense
of strict differentiability. -/
theorem _root_.Continuous.integral_hasStrictDerivAt {f : ℝ → E} (hf : Continuous f) (a b : ℝ) :
    HasStrictDerivAt (fun u => ∫ x : ℝ in a..u, f x) (f b) b

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ℝ → E}
(hf : Continuous f)
(a b : ℝ)

HasStrictDerivAt (fun u => ∫ (x : ℝ) in a..u, f x) (f b) b


protected theorem find_min : ∀ {m : ℕ}, m < Nat.find H → ¬p m

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


theorem integrableOn_Iic_iff_integrableAtFilter_atBot [LinearOrder X] [CompactIccSpace X] :
    IntegrableOn f (Iic a) μ ↔ IntegrableAtFilter f atBot μ ∧ LocallyIntegrableOn f (Iic a) μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
{a : X}
[LinearOrder X]
[CompactIccSpace X]

MeasureTheory.IntegrableOn f (Set.Iic a) μ ↔
  MeasureTheory.IntegrableAtFilter f Filter.atBot μ ∧ MeasureTheory.LocallyIntegrableOn f (Set.Iic a) μ


/-- In a graph, if `k` is at least the degree of every vertex, then it is at least the maximum
degree. -/
theorem maxDegree_le_of_forall_degree_le [DecidableRel G.Adj] (k : ℕ) (h : ∀ v, G.degree v ≤ k) :
    G.maxDegree ≤ k

{V : Type u_1}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
(k : ℕ)
(h : ∀ (v : V), G.degree v ≤ k)


theorem exists_measurable_superset_of_null (h : μ s = 0) : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ μ t = 0

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
(h : μ s = 0)


/-- A function `f : β → α` with lower topology in the codomain is continuous
if and only if the preimage of every interval `Set.Ici a` is a closed set.
-/
lemma continuous_iff_Ici [TopologicalSpace β] {f : β → α} :
    Continuous f ↔ ∀ a, IsClosed (f ⁻¹' (Ici a))

{α : Type u_2}
{β : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsLower α]
[TopologicalSpace β]
{f : β → α}

Continuous f ↔ ∀ (a : α), IsClosed (f ⁻¹' Set.Ici a)


lemma mem_closure_X_union_C {R : Type*} [Ring R] (p : R[X]) :
    p ∈ Subring.closure (insert X {f | f.degree ≤ 0} : Set R[X])

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

p ∈ Subring.closure (insert Polynomial.X {f | f.degree ≤ 0})


theorem codisjoint_iff : Codisjoint a b ↔ a ⊔ b = ⊤

{α : Type u_1}
[SemilatticeSup α]
[OrderTop α]
{a b : α}


/-- Adding the second vector passed to `oangle` to the first vector does not change the sign of
the angle. -/
@[simp]
theorem oangle_sign_add_left (x y : V) : (o.oangle (x + y) y).sign = (o.oangle x y).sign

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


@[simp] theorem encard_singleton (e : α) : ({e} : Set α).encard = 1


theorem bddLat_dual_comp_forget_to_semilatSupCat :
    BddLat.dual ⋙ forget₂ BddLat SemilatSupCat =
    forget₂ BddLat SemilatInfCat ⋙ SemilatInfCat.dual

BddLat.dual ⋙ CategoryTheory.forget₂ BddLat SemilatSupCat =
  CategoryTheory.forget₂ BddLat SemilatInfCat ⋙ SemilatInfCat.dual


theorem head {n : ℕ} : @Partrec' n.succ (@head ℕ n)


@[to_additive (attr := simp)]
theorem mkOfCompact_one [CompactSpace α] : mkOfCompact (1 : C(α, β)) = 1

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[One β]
[CompactSpace α]

BoundedContinuousFunction.mkOfCompact 1 = 1


lemma next_add' (p q : I) (hq : c.Rel q (c.next q)) :
    c.next (p + q) = p + c.next q

{I : Type u_4}
[AddMonoid I]
(c : ComplexShape I)
[c.TensorSigns]
(p q : I)
(hq : c.Rel q (c.next q))


@[simp]
lemma rightUnshift_zero (a n' : ℤ) (hn' : n' + a = n) :
    (0 : Cochain K (L⟦a⟧) n').rightUnshift n hn' = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(K L : CochainComplex C ℤ)
(n a n' : ℤ)
(hn' : n' + a = n)

CochainComplex.HomComplex.Cochain.rightUnshift 0 n hn' = 0


theorem IsClosed.smul_of_ne_zero {c : G₀} {s : Set α} (hs : IsClosed s) (hc : c ≠ 0) :
    IsClosed (c • s)

{α : Type u_2}
{G₀ : Type u_4}
[TopologicalSpace α]
[GroupWithZero G₀]
[MulAction G₀ α]
[ContinuousConstSMul G₀ α]
{c : G₀}
{s : Set α}
(hs : IsClosed s)
(hc : c ≠ 0)


@[simp]
theorem augmentTruncate_inv_f_zero (C : CochainComplex V ℕ) :
    (augmentTruncate C).inv.f 0 = 𝟙 (C.X 0)


/-- `PUnit` is a left identity for type product up to an equivalence. -/
@[simps!]
def punitProd (α) : PUnit × α ≃ α

∀ (a : α), (Equiv.punitProd α).symm a = (PUnit.unit, a)


@[simp]
theorem generate_of_singleton_isSplitEpi (f : Y ⟶ X) [IsSplitEpi f] :
    generate (Presieve.singleton f) = ⊤

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

CategoryTheory.Sieve.generate (CategoryTheory.Presieve.singleton f) = ⊤


theorem l_u_l_eq_l (a : α) : l (u (l a)) = l a

{α : Type u}
{β : Type v}
[Preorder α]
[PartialOrder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
(a : α)


theorem Gamma_eq_GammaAux (s : ℂ) (n : ℕ) (h1 : -s.re < ↑n) : Gamma s = GammaAux n s


@[fun_prop]
protected theorem HasStrictFDerivAt.hasFDerivAt (hf : HasStrictFDerivAt f f' x) :
    HasFDerivAt f f' x

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


theorem is3Clique_triple_iff : G.IsNClique 3 {a, b, c} ↔ G.Adj a b ∧ G.Adj a c ∧ G.Adj b c

{α : Type u_1}
{G : SimpleGraph α}
{a b c : α}
[DecidableEq α]


theorem principal_units_le_units : A.principalUnitGroup ≤ A.unitGroup

{K : Type u}
[Field K]
(A : ValuationSubring K)


/-- Given two disjoint closed sets `s, t` in a Hausdorff σ-compact finite dimensional manifold,
there exists an infinitely smooth function that is equal to `0` on `s` and to `1` on `t`.
See also `exists_msmooth_zero_iff_one_iff_of_isClosed`, which ensures additionally that
`f` is equal to `0` exactly on `s` and to `1` exactly on `t`. -/
theorem exists_smooth_zero_one_of_isClosed [T2Space M] [SigmaCompactSpace M] {s t : Set M}
    (hs : IsClosed s) (ht : IsClosed t) (hd : Disjoint s t) :
    ∃ f : C^∞⟮I, M; 𝓘(ℝ), ℝ⟯, EqOn f 0 s ∧ EqOn f 1 t ∧ ∀ x, f x ∈ Icc 0 1

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
(I : ModelWithCorners ℝ E H)
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[T2Space M]
[SigmaCompactSpace M]
{s t : Set M}
(hs : IsClosed s)
(ht : IsClosed t)
(hd : Disjoint s t)

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


/-- If `C` has all limits of diagrams `cospan f g`, then it has all pullbacks -/
theorem hasPullbacks_of_hasLimit_cospan
    [∀ {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z}, HasLimit (cospan f g)] : HasPullbacks C

[∀ {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z}, CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.cospan f g)]


/-- Auxiliary definition for the `MonoidalCategory` instance on `Center C`. -/
@[simps]
def tensorUnit : Center C

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

CategoryTheory.Center.tensorUnit.snd.β U = λ_ U ≪≫ (ρ_ U).symm


@[simp] lemma unop_tensorUnit : unop (𝟙_ Cᵒᵖ) = 𝟙_ C

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


@[to_additive]
theorem max_le_mul_of_one_le [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a b : α} (ha : 1 ≤ a) (hb : 1 ≤ b) :
    max a b ≤ a * b

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

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


/-- A `MulEquiv` `φ` between two semigroups `M` and `N` induces a `MulEquiv` between
a subsemigroup `S ≤ M` and the subsemigroup `φ(S) ≤ N`.
See `MulHom.subsemigroupMap` for a variant for `MulHom`s. -/
@[to_additive (attr := simps)
      "An `AddEquiv` `φ` between two additive semigroups `M` and `N` induces an `AddEquiv`
      between a subsemigroup `S ≤ M` and the subsemigroup `φ(S) ≤ N`.
      See `AddHom.addSubsemigroupMap` for a variant for `AddHom`s."]
def subsemigroupMap (e : M ≃* N) (S : Subsemigroup M) : S ≃* S.map (e : M →ₙ* N)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(e : M ≃* N)
(S : Subsemigroup M)
(x : ↥S)


@[to_additive]
theorem div_mul_eq_div_div_swap : a / (b * c) = a / c / b

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


@[simp]
theorem sinh_nonneg_iff : 0 ≤ sinh x ↔ 0 ≤ x


@[simp] lemma girth_bot : girth (⊥ : SimpleGraph α) = 0


lemma le_egauge_ball_one (x : E) : ‖x‖₊ ≤ egauge 𝕜 (ball 0 1) x

(𝕜 : Type u_1)
[NormedField 𝕜]
{E : Type u_3}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)


@[simp]
theorem optionCongr_symm (e : α ≃ β) : (optionCongr e).symm = optionCongr e.symm

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


@[simp]
theorem IsHermitian.neg {A : Matrix n n α} (h : A.IsHermitian) : (-A).IsHermitian

{α : Type u_1}
{n : Type u_4}
[AddGroup α]
[StarAddMonoid α]
{A : Matrix n n α}
(h : A.IsHermitian)


@[reassoc (attr := simp)]
theorem LaxMonoidalFunctor.right_unitality_inv (F : LaxMonoidalFunctor C D) (X : C) :
    (ρ_ (F.obj X)).inv ≫ F.obj X ◁ F.ε ≫ F.μ X (𝟙_ C) = F.map (ρ_ X).inv

(F : CategoryTheory.LaxMonoidalFunctor C D)

(CategoryTheory.MonoidalCategory.rightUnitor (F.obj X)).inv ≫
    CategoryTheory.MonoidalCategory.whiskerLeft (F.obj X) F.ε ≫ F.μ X (𝟙_ C) =
  F.map (CategoryTheory.MonoidalCategory.rightUnitor X).inv


protected theorem map_star (a : A) : σ (star a) = star (σ a)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
[InvolutiveStar R]
[StarRing A]
[StarModule R A]
(a : A)

spectrum R (star a) = star (spectrum R a)


@[simp, norm_cast]
lemma cast_mul {α : Type*} [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n

{α : Type u_1}
[NonAssocRing α]
(m n : ℤ)


theorem IsCycleOn.exists_pow_eq {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) (hb : b ∈ s) :
    ∃ n < s.card, (f ^ n) a = b

{α : Type u_2}
{f : Equiv.Perm α}
{a b : α}
{s : Finset α}
(hf : f.IsCycleOn ↑s)
(ha : a ∈ s)
(hb : b ∈ s)


theorem tprod_eq_tprodCoeff_one :
    ⇑(tprod R : MultilinearMap R s (⨂[R] i, s i)) = tprodCoeff R 1

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]

⇑(PiTensorProduct.tprod R) = PiTensorProduct.tprodCoeff R 1


@[simp] lemma unop_whiskerRight {X Y : Cᵒᵖ} (f : X ⟶ Y) (Z : Cᵒᵖ) :
    (f ▷ Z).unop = f.unop ▷ unop Z

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

(CategoryTheory.MonoidalCategory.whiskerRight f Z).unop =
  CategoryTheory.MonoidalCategory.whiskerRight f.unop (Opposite.unop Z)


@[simp]
theorem norm_col (v : m → α) : ‖col ι v‖ = ‖v‖

{m : Type u_3}
{α : Type u_5}
{ι : Type u_7}
[Fintype m]
[Unique ι]
[SeminormedAddCommGroup α]
(v : m → α)


theorem isRightRegular [Mul R] {a : R} (h : IsSMulRegular R (MulOpposite.op a)) :
    IsRightRegular a


@[to_additive]
theorem eq_symm_comp {α : Type*} (e : M ≃* N) (f : α → M) (g : α → N) :
    f = e.symm ∘ g ↔ e ∘ f = g

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
{α : Type u_12}
(e : M ≃+ N)
(f : α → M)
(g : α → N)


theorem mem_of_mem_dropLast (h : a ∈ l.dropLast) : a ∈ l

{α : Type u_1}
{l : List α}
{a : α}
(h : a ∈ l.dropLast)


theorem IsCobounded.superset (hs : IsCobounded s) (ht : s ⊆ t) : IsCobounded t

∀ {x : Bornology α} {s t : Set α}, Bornology.IsCobounded s → s ⊆ t → Bornology.IsCobounded t


theorem IsPWO.image_of_monotone (hs : s.IsPWO) {f : α → β} (hf : Monotone f) : IsPWO (f '' s)

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{s : Set α}
(hs : s.IsPWO)
{f : α → β}
(hf : Monotone f)


@[simp]
lemma FixedPoints.addSubgroup_toAddSubmonoid : (α^+M).toAddSubmonoid = addSubmonoid M α

(M : Type u)
(α : Type v)
[Monoid M]
[AddGroup α]
[DistribMulAction M α]

(α^+M).toAddSubmonoid = FixedPoints.addSubmonoid M α


theorem map_le_iff_le_comap {f : M →[L] N} {S : L.Substructure M} {T : L.Substructure N} :
    S.map f ≤ T ↔ S ≤ T.comap f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
{S : L.Substructure M}
{T : L.Substructure N}

FirstOrder.Language.Substructure.map f S ≤ T ↔ S ≤ FirstOrder.Language.Substructure.comap f T


theorem ae_tendsto_of_cauchy_eLpNorm [CompleteSpace E] {f : ℕ → α → E}
    (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hp : 1 ≤ p) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
    (h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm (f n - f m) p μ < B N) :
    ∀ᵐ x ∂μ, ∃ l : E, atTop.Tendsto (fun n => f n x) (𝓝 l)

(hf : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

{B : ℕ → ℝ≥0∞}

(h_cau : ∀ (N n m : ℕ), N ≤ n → N ≤ m → MeasureTheory.eLpNorm (f n - f m) p μ < B N)

∀ᵐ (x : α) ∂μ, ∃ l, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 l)


theorem lt_or_eq_of_le {a b : α} (hab : a ≤ b) : a < b ∨ a = b

{α : Type u}
[PartialOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{a b : α}
(hab : a ≤ b)


theorem insertNth_zero (x : α 0) (p : ∀ j : Fin n, α (succAbove 0 j)) :
    insertNth 0 x p =
      cons x fun j ↦ _root_.cast (congr_arg α (congr_fun succAbove_zero j)) (p j)

(p : (j : Fin n) → α (Fin.succAbove 0 j))

Fin.insertNth 0 x p = Fin.cons x fun j => cast ⋯ (p j)


@[to_additive (attr := simp)]
theorem nndist_inv_inv [Group G] [PseudoMetricSpace G] [IsometricSMul G G]
    [IsometricSMul Gᵐᵒᵖ G] (a b : G) : nndist a⁻¹ b⁻¹ = nndist a b

{G : Type v}
[Group G]
[PseudoMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]
(a b : G)


/-- If preimage of each singleton under `f : α → β` is either empty or the whole type,
then `f` is a constant. -/
lemma exists_eq_const_of_preimage_singleton [Nonempty β] {f : α → β}
    (hf : ∀ b : β, f ⁻¹' {b} = ∅ ∨ f ⁻¹' {b} = univ) : ∃ b, f = const α b

(hf : ∀ (b : β), f ⁻¹' {b} = ∅ ∨ f ⁻¹' {b} = Set.univ)


theorem le_boundedBy' {μ : OuterMeasure α} :
    μ ≤ boundedBy m ↔ ∀ s : Set α, s.Nonempty → μ s ≤ m s

{α : Type u_1}
{m : Set α → ℝ≥0∞}
{μ : MeasureTheory.OuterMeasure α}

μ ≤ MeasureTheory.OuterMeasure.boundedBy m ↔ ∀ (s : Set α), s.Nonempty → μ s ≤ m s


theorem HasDerivWithinAt.norm_sq {f : ℝ → F} {f' : F} {s : Set ℝ} {x : ℝ}
    (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (‖f ·‖ ^ 2) (2 * Inner.inner (f x) f') s x

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{f : ℝ → F}
{f' : F}
{s : Set ℝ}
{x : ℝ}
(hf : HasDerivWithinAt f f' s x)

HasDerivWithinAt (fun x => ‖f x‖ ^ 2) (2 * ⟪f x, f'⟫_ℝ) s x


theorem rootMultiplicity_eq_natTrailingDegree' {p : R[X]} :
    p.rootMultiplicity 0 = p.natTrailingDegree

Polynomial.rootMultiplicity 0 p = p.natTrailingDegree


@[simp]
theorem mk'_cancel_right (m : M) (s₁ s₂ : S) : mk' f (s₂ • m) (s₁ * s₂) = mk' f m s₁

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(m : M)
(s₁ s₂ : ↥S)

IsLocalizedModule.mk' f (s₂ • m) (s₁ * s₂) = IsLocalizedModule.mk' f m s₁


theorem embeddingPiTangent_injective_mfderiv (x : M) (hx : x ∈ s) :
    Injective (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x)

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[T2Space M]
[hi : Fintype ι]
{s : Set M}
(f : SmoothBumpCovering ι I M s)
(x : M)
(hx : x ∈ s)

Function.Injective ⇑(mfderiv I 𝓘(ℝ, ι → E × ℝ) (⇑f.embeddingPiTangent) x)


@[simp]
theorem sInf_apply {α : Type*} {β : α → Type*} [∀ i, InfSet (β i)] {s : Set (∀ a, β a)} {a : α} :
    sInf s a = ⨅ f : s, (f : ∀ a, β a) a

{α : Type u_9}
{β : α → Type u_10}
[(i : α) → InfSet (β i)]
{s : Set ((a : α) → β a)}
{a : α}


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

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

(CategoryTheory.kernelOpOp f).hom =
  (CategoryTheory.Limits.cokernel.desc f (CategoryTheory.Limits.kernel.ι f.op).unop ⋯).op


theorem of_not_lex {α} {r : α → α → Prop} [DecidableEq α] {β} {s : β → β → Prop}
    {p q : α × β} (w : ¬ Prod.Lex r s p q) :
    ¬ r p.fst q.fst ∧ (p.fst ≠ q.fst ∨ ¬ s p.snd q.snd)

{α : Type u_1}
{r : α → α → Prop}
[DecidableEq α]
{β : Type u_2}
{s : β → β → Prop}
{p q : α × β}
(w : ¬Prod.Lex r s p q)

¬r p.fst q.fst ∧ (p.fst ≠ q.fst ∨ ¬s p.snd q.snd)


theorem l_surjective [Preorder α] [PartialOrder β] (gi : GaloisInsertion l u) : Surjective l

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[Preorder α]
[PartialOrder β]
(gi : GaloisInsertion l u)


@[simp]
theorem single_zero_one [Zero R] [One R] : single (0 : Γ) (1 : R) = 1

{Γ : Type u_1}
{R : Type u_3}
[Zero Γ]
[PartialOrder Γ]
[Zero R]
[One R]


/-- Two indexed families of points that are injective on the given
`Finset`s and with the same points in the image of those `Finset`s
have the same centroid. -/
theorem centroid_eq_of_inj_on_of_image_eq {p : ι → P}
    (hi : ∀ i ∈ s, ∀ j ∈ s, p i = p j → i = j) {p₂ : ι₂ → P}
    (hi₂ : ∀ i ∈ s₂, ∀ j ∈ s₂, p₂ i = p₂ j → i = j) (he : p '' ↑s = p₂ '' ↑s₂) :
    s.centroid k p = s₂.centroid k p₂

Finset.centroid k s p = Finset.centroid k s₂ p₂


@[reassoc]
theorem tensor_μ_natural_right (Z₁ Z₂ : C) {X₁ X₂ Y₁ Y₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) :
    (Z₁ ⊗ Z₂) ◁ (f₁ ⊗ f₂) ≫ tensor_μ C (Z₁, Z₂) (Y₁, Y₂) =
      tensor_μ C (Z₁, Z₂) (X₁, X₂) ≫ (Z₁ ◁ f₁ ⊗ Z₂ ◁ f₂)

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

(Z₁ ⊗ Z₂) ◁ (f₁ ⊗ f₂) ≫ CategoryTheory.tensor_μ C (Z₁, Z₂) (Y₁, Y₂) =
  CategoryTheory.tensor_μ C (Z₁, Z₂) (X₁, X₂) ≫ (Z₁ ◁ f₁ ⊗ Z₂ ◁ f₂)


@[to_additive (attr := simp)]
theorem toList_mul (xs ys : FreeMonoid α) : toList (xs * ys) = toList xs ++ toList ys

{α : Type u_1}
(xs ys : FreeAddMonoid α)

FreeAddMonoid.toList (xs + ys) = FreeAddMonoid.toList xs ++ FreeAddMonoid.toList ys


@[to_additive]
theorem mem_map_of_mem (f : F) {S : Submonoid M} {x : M} (hx : x ∈ S) : f x ∈ S.map f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(f : F)
{S : AddSubmonoid M}
{x : M}
(hx : x ∈ S)


(R : Type u_1)
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]


/-- If `f : SmoothBumpFunction I c` is a smooth bump function and `g : M → G` is a function smooth
on the source of the chart at `c`, then `f • g` is smooth on the whole manifold. -/
theorem smooth_smul {G} [NormedAddCommGroup G] [NormedSpace ℝ G] {g : M → G}
    (hg : SmoothOn I 𝓘(ℝ, G) g (chartAt H c).source) : Smooth I 𝓘(ℝ, G) fun x => f x • g x


/-- Expressing uniform convergence on a set using `dist`. -/
theorem tendstoUniformlyOn_iff {F : ι → β → α} {f : β → α} {p : Filter ι} {s : Set β} :
    TendstoUniformlyOn F f p s ↔ ∀ ε > 0, ∀ᶠ n in p, ∀ x ∈ s, dist (f x) (F n x) < ε

{α : Type u}
{β : Type v}
{ι : Type u_2}
[PseudoMetricSpace α]
{F : ι → β → α}
{f : β → α}
{p : Filter ι}
{s : Set β}

TendstoUniformlyOn F f p s ↔ ∀ ε > 0, ∀ᶠ (n : ι) in p, ∀ x ∈ s, dist (f x) (F n x) < ε


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

(CategoryTheory.cokernelOpOp f).hom = CategoryTheory.Limits.cokernel.desc f.op (CategoryTheory.Limits.kernel.ι f).op ⋯


/-- Create an isomorphism between arrows,
by providing isomorphisms between the domains and codomains,
and a proof that the square commutes. -/
@[simps!]
def isoMk {f g : Arrow T} (l : f.left ≅ g.left) (r : f.right ≅ g.right)
    (h : l.hom ≫ g.hom = f.hom ≫ r.hom := by aesop_cat) : f ≅ g

(h : CategoryTheory.CategoryStruct.comp l.hom g.hom = CategoryTheory.CategoryStruct.comp f.hom r.hom := by aesop_cat)

(CategoryTheory.Arrow.isoMk l r h).inv.right = r.inv


theorem finite_dsupport {f : ∀ i, E i} (hf : Memℓp f 0) : Set.Finite { i | f i ≠ 0 }

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{f : (i : α) → E i}
(hf : Memℓp f 0)


@[simp]
theorem some_zero [Zero M] : (0 : Option α →₀ M).some = 0


theorem NFBelow.mono {o b₁ b₂} (bb : b₁ ≤ b₂) (h : NFBelow o b₁) : NFBelow o b₂

{o : ONote}
{b₁ b₂ : Ordinal.{0}}
(bb : b₁ ≤ b₂)
(h : o.NFBelow b₁)


theorem orElse_eq_some (o o' : Option α) (x : α) :
    (o <|> o') = some x ↔ o = some x ∨ o = none ∧ o' = some x

{α : Type u_1}
(o o' : Option α)
(x : α)

(HOrElse.hOrElse o fun x => o') = some x ↔ o = some x ∨ o = none ∧ o' = some x


theorem contDiffAt_norm {x : E} (hx : x ≠ 0) : ContDiffAt ℝ n norm x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{n : ℕ∞}
{x : E}
(hx : x ≠ 0)


/-- If `R` is a nontrivial ring, the polynomials `R[X]` are not finite as an `R`-module. When `R` is
a field, this is equivalent to `R[X]` being an infinite-dimensional vector space over `R`.  -/
theorem not_finite [Nontrivial R] : ¬ Module.Finite R R[X]

{R : Type u}
[Semiring R]
[Nontrivial R]


/-- If `y` is a unique `MapClusterPt` for `f` along `l`
and the codomain of `f` is a compact space,
then `f` tends to `𝓝 y` along `l`. -/
lemma tendsto_nhds_of_unique_mapClusterPt [CompactSpace X] {l : Filter Y} {y : X} {f : Y → X}
    (h : ∀ x, MapClusterPt x l f → x = y) :
    Tendsto f l (𝓝 y)

(h : ∀ (x : X), MapClusterPt x l f → x = y)


@[simp]
theorem join_eq_out {α} (a) : @join α a = a.out


theorem logb_div_base {a b : ℝ} (h₁ : a ≠ 0) (h₂ : b ≠ 0) (c : ℝ) :
    logb (a / b) c = ((logb a c)⁻¹ - (logb b c)⁻¹)⁻¹

Real.logb (a / b) c = ((Real.logb a c)⁻¹ - (Real.logb b c)⁻¹)⁻¹


@[simp]
theorem norm_extendTo𝕜' (fr : F →L[ℝ] ℝ) : ‖(fr.extendTo𝕜' : F →L[𝕜] 𝕜)‖ = ‖fr‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{F : Type u_2}
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace ℝ F]
[IsScalarTower ℝ 𝕜 F]
(fr : F →L[ℝ] ℝ)


@[simp]
theorem image_bot (s : Set α) : (⊥ : Rel α β).image s = ∅

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


theorem rowLen_eq_card (μ : YoungDiagram) {i : ℕ} : μ.rowLen i = (μ.row i).card


/-- If `α` is a linear succ order, `β` is a preorder, and `f : α → β` is a monotone function, then
the intervals `Set.Ico (f n) (f (Order.succ n))` are pairwise disjoint. -/
theorem pairwise_disjoint_on_Ico_succ [SuccOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    Pairwise (Disjoint on fun n => Ico (f n) (f (succ n)))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[SuccOrder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)

Pairwise (Disjoint on fun n => Set.Ico (f n) (f (Order.succ n)))


theorem ihom_ev_app (F G : D ⥤ C) : (ihom.ev F).app G = (closedCounit F).app G

{D : Type u_1}
{C : Type u_2}
[CategoryTheory.Groupoid D]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.MonoidalClosed C]
(F G : D ⥤ C)

(CategoryTheory.ihom.ev F).app G = F.closedCounit.app G


theorem minpoly_root (hf : f ≠ 0) : minpoly K (root f) = f * C f.leadingCoeff⁻¹

{K : Type w}
[Field K]
{f : K[X]}
(hf : f ≠ 0)

minpoly K (AdjoinRoot.root f) = f * Polynomial.C f.leadingCoeff⁻¹


@[simp]
lemma whiskerRightIso_trans {X Y Z : C} (f : X ≅ Y) (g : Y ≅ Z) (W : C) :
    whiskerRightIso (f ≪≫ g) W = whiskerRightIso f W ≪≫ whiskerRightIso g W

{C : Type u}
[𝒞 : CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{X Y Z : C}
(f : X ≅ Y)
(g : Y ≅ Z)
(W : C)

CategoryTheory.MonoidalCategory.whiskerRightIso (f ≪≫ g) W =
  CategoryTheory.MonoidalCategory.whiskerRightIso f W ≪≫ CategoryTheory.MonoidalCategory.whiskerRightIso g W


/-- The canonical bijection between `α` and `αᵐᵒᵖ`. -/
@[to_additive (attr := simps (config := .asFn) apply symm_apply)
  "The canonical bijection between `α` and `αᵃᵒᵖ`."]
def opEquiv : α ≃ αᵐᵒᵖ


theorem ncard_union_add_ncard_inter (s t : Set α) (hs : s.Finite := by toFinite_tac)
    (ht : t.Finite := by toFinite_tac) : (s ∪ t).ncard + (s ∩ t).ncard = s.ncard + t.ncard

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


/-- If the spans of two vectors are equal, twice angles with those vectors on the right are
equal. -/
theorem two_zsmul_oangle_right_of_span_eq (x : V) {y z : V} (h : (ℝ ∙ y) = ℝ ∙ z) :
    (2 : ℤ) • o.oangle x y = (2 : ℤ) • o.oangle x z

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

(h : Submodule.span ℝ {y} = Submodule.span ℝ {z})


lemma IsMeasurableRatCDF_defaultRatCDF (α : Type*) [MeasurableSpace α] :
    IsMeasurableRatCDF (fun (_ : α) (q : ℚ) ↦ defaultRatCDF q)

ProbabilityTheory.IsMeasurableRatCDF fun x q => ProbabilityTheory.defaultRatCDF q


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

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


@[simp] theorem USize.val_ofNat (n) :
    (no_index (OfNat.ofNat n) : USize).val = OfNat.ofNat n


theorem Codisjoint.himp_eq_right (h : Codisjoint a b) : b ⇨ a = a

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b : α}
(h : Codisjoint a b)


@[simp]
theorem getElem?_getD_singleton_default_eq (n : ℕ) : [d][n]?.getD d = d


@[simp]
theorem smul_domain (a : M) (f : E →ₗ.[R] F) : (a • f).domain = f.domain

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


@[simp]
theorem cancel_left (hg : Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
[CoheytingAlgebra γ]
{f₁ f₂ : CoheytingHom α β}
{g : CoheytingHom β γ}
(hg : Function.Injective ⇑g)


/-- For a function `f` and a measurable set `s`, the integral of `indicator s f`
over the whole space is equal to `∫ x in s, f x ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
    ∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{s : Set X}
{μ : MeasureTheory.Measure X}
(hs : MeasurableSet s)

∫ (x : X), s.indicator f x ∂μ = ∫ (x : X) in s, f x ∂μ


theorem nhdsWithin_Iic_eq' [TopologicalSpace α] [Preorder α] [OrderTopology α] {a : α}
    (ha : ∃ l, l < a) : 𝓝[≤] a = ⨅ l < a, 𝓟 (Ioc l a)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
{a : α}
(ha : ∃ l, l < a)

𝓝[≤] a = ⨅ l, ⨅ (_ : l < a), 𝓟 (Set.Ioc l a)


@[simp] lemma findGreatest_eq : ∀ {n}, P n → Nat.findGreatest P n = n

{P : ℕ → Prop}
[DecidablePred P]
{n : ℕ}


theorem coeffs_zero : coeffs (0 : R[X]) = ∅


@[simp]
lemma shiftFunctor_of_induced (a : A) :
    letI := HasShift.induced F A s i
    shiftFunctor D a = s a

(i : (a : A) → F.comp (s a) ≅ (CategoryTheory.shiftFunctor C a).comp F)

[((CategoryTheory.whiskeringLeft C D D).obj F).Full]

[((CategoryTheory.whiskeringLeft C D D).obj F).Faithful]


theorem other_mem' [DecidableEq α] {a : α} {z : Sym2 α} (h : a ∈ z) : Mem.other' h ∈ z

{α : Type u_1}
[DecidableEq α]
{a : α}
{z : Sym2 α}
(h : a ∈ z)


theorem attach_map_val {s : Finset α} : s.attach.map (Embedding.subtype _) = s

Finset.map (Function.Embedding.subtype fun x => x ∈ s) s.attach = s


@[simp, norm_cast] lemma coe_pos : (0 : ℝ) < r ↔ 0 < r


/-- A Lie subalgebra of a Lie algebra is submodule that is closed under the Lie bracket.
This is a sufficient condition for the subset itself to form a Lie algebra. -/
structure LieSubalgebra extends Submodule R L where
  /-- A Lie subalgebra is closed under Lie bracket. -/
  lie_mem' : ∀ {x y}, x ∈ carrier → y ∈ carrier → ⁅x, y⁆ ∈ carrier

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

x ∈ self.carrier → y ∈ self.carrier → ⁅x, y⁆ ∈ self.carrier


@[simp]
theorem chain_append_cons_cons {a b c : α} {l₁ l₂ : List α} :
    Chain R a (l₁ ++ b :: c :: l₂) ↔ Chain R a (l₁ ++ [b]) ∧ R b c ∧ Chain R c l₂

{α : Type u}
{R : α → α → Prop}
{a b c : α}
{l₁ l₂ : List α}

List.Chain R a (l₁ ++ b :: c :: l₂) ↔ List.Chain R a (l₁ ++ [b]) ∧ R b c ∧ List.Chain R c l₂


@[simp]
theorem top_covers (S : Sieve X) (f : Y ⟶ X) : (⊤ : GrothendieckTopology C).Covers S f

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


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

(a : UniversalEnvelopingAlgebra R (FreeLieAlgebra R X))

(FreeLieAlgebra.universalEnvelopingEquivFreeAlgebra R X) a =
  ((UniversalEnvelopingAlgebra.lift R) ((FreeLieAlgebra.lift R) (FreeAlgebra.ι R))) a


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem infs_nonempty : (s ⊼ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s t : Finset α}


theorem not_modEq_iff_toIcoMod_eq_toIocMod : ¬a ≡ b [PMOD p] ↔ toIcoMod hp a b = toIocMod hp a b

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


theorem _root_.Real.list_prod_map_rpow' {ι} (l : List ι) (f : ι → ℝ)
    (hl : ∀ i ∈ l, (0 : ℝ) ≤ f i) (r : ℝ) :
    (l.map (f · ^ r)).prod = (l.map f).prod ^ r

{ι : Type u_1}
(l : List ι)
(f : ι → ℝ)
(hl : ∀ i ∈ l, 0 ≤ f i)
(r : ℝ)

(List.map (fun x => f x ^ r) l).prod = (List.map f l).prod ^ r


@[to_additive (attr := simp)] lemma hasProd_unique [Unique β] (f : β → α) : HasProd f (f default)

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


theorem toReal_setLaverage {f : α → ℝ≥0∞} (hf : AEMeasurable f (μ.restrict s))
    (hf' : ∀ᵐ x ∂μ.restrict s, f x ≠ ∞) :
    (⨍⁻ x in s, f x ∂μ).toReal = ⨍ x in s, (f x).toReal ∂μ

{f : α → ℝ≥0∞}

(hf' : ∀ᵐ (x : α) ∂μ.restrict s, f x ≠ ⊤)

(⨍⁻ (x : α) in s, f x ∂μ).toReal = ⨍ (x : α) in s, (f x).toReal ∂μ


@[simp]
theorem reverse_comp_reverse :
    reverse.comp reverse = (LinearMap.id : _ →ₗ[R] CliffordAlgebra Q)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}

CliffordAlgebra.reverse ∘ₗ CliffordAlgebra.reverse = LinearMap.id


@[to_additive]
theorem Nonempty.of_div_right : (s / t).Nonempty → t.Nonempty


@[simp] theorem rTensor_trans_congr (f : M ≃ₗ[R] P) (g : N ≃ₗ[R] Q) (f' : S ≃ₗ[R] M) :
    f'.rTensor _ ≪≫ₗ TensorProduct.congr f g = TensorProduct.congr (f' ≪≫ₗ f) g

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
{S : Type u_8}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[AddCommMonoid S]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
[Module R S]
(f : M ≃ₗ[R] P)
(g : N ≃ₗ[R] Q)
(f' : S ≃ₗ[R] M)

LinearEquiv.rTensor N f' ≪≫ₗ TensorProduct.congr f g = TensorProduct.congr (f' ≪≫ₗ f) g


theorem closedBall_subset_ball' (h : ε₁ + dist x y < ε₂) :
    closedBall x ε₁ ⊆ ball y ε₂

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{ε₁ ε₂ : ℝ}
(h : ε₁ + dist x y < ε₂)

Metric.closedBall x ε₁ ⊆ Metric.ball y ε₂


theorem ULift.isClosed_iff [TopologicalSpace X] {s : Set (ULift.{v} X)} :
    IsClosed s ↔ IsClosed (ULift.up ⁻¹' s)

{X : Type u}
[TopologicalSpace X]
{s : Set (ULift.{v, u} X)}


@[simp] theorem foldlM_nil [Monad m] (f : β → α → m β) (b) : [].foldlM f b = pure b

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


theorem le_sum {ι} (f : ι → Cardinal) (i) : f i ≤ sum f

{ι : Type u_1}
(f : ι → Cardinal.{max u_1 u_2})
(i : ι)


theorem eLpNorm'_const_smul_le (c : 𝕜) (f : α → F) (hq_pos : 0 < q) :
    eLpNorm' (c • f) q μ ≤ ‖c‖₊ • eLpNorm' f q μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{q : ℝ}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{𝕜 : Type u_5}
[NormedRing 𝕜]
[MulActionWithZero 𝕜 F]
[BoundedSMul 𝕜 F]
(c : 𝕜)
(f : α → F)
(hq_pos : 0 < q)

MeasureTheory.eLpNorm' (c • f) q μ ≤ ‖c‖₊ • MeasureTheory.eLpNorm' f q μ


@[simp]
theorem one_re : (1 : ℤ√d).re = 1


/-- A property of ring homs is local if it is preserved by localizations and compositions, and for
each `{ r }` that spans `S`, we have `P (R →+* S) ↔ ∀ r, P (R →+* Sᵣ)`. -/
structure RingHom.PropertyIsLocal : Prop where
  LocalizationPreserves : RingHom.LocalizationPreserves @P
  OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P
  StableUnderComposition : RingHom.StableUnderComposition @P
  HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P

{P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop}


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


@[to_additive]
theorem prime_card [Fintype α] : (Fintype.card α).Prime

{α : Type u}
[CommGroup α]
[IsSimpleGroup α]
[Fintype α]


protected theorem hasStrictDerivAt_aeval (x : 𝕜) :
    HasStrictDerivAt (fun x => aeval x q) (aeval x (derivative q)) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])
(x : 𝕜)

HasStrictDerivAt (fun x => (Polynomial.aeval x) q) ((Polynomial.aeval x) (Polynomial.derivative q)) x


@[simp]
theorem holderWith_one {C : ℝ≥0} {f : X → Y} : HolderWith C 1 f ↔ LipschitzWith C f

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C : ℝ≥0}
{f : X → Y}


/-- A *right*-invariant measure is quasi-preserved by *left*-multiplication.
This should not be confused with `(measurePreserving_mul_left μ g).quasiMeasurePreserving`. -/
@[to_additive
"A *right*-invariant measure is quasi-preserved by *left*-addition.
This should not be confused with `(measurePreserving_add_left μ g).quasiMeasurePreserving`. "]
theorem quasiMeasurePreserving_mul_left [IsMulRightInvariant μ] (g : G) :
    QuasiMeasurePreserving (fun h : G => g * h) μ μ

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[μ.IsMulRightInvariant]
(g : G)

MeasureTheory.Measure.QuasiMeasurePreserving (fun h => g * h) μ μ


theorem _root_.Function.invFunOn_image_image_subset [Nonempty α] (f : α → β) (s : Set α) :
    (invFunOn f s) '' (f '' s) ⊆ s

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


@[to_additive] -- Porting note: was `@[simp]`
theorem integral_smul_eq_self {μ : Measure α} [SMulInvariantMeasure G α μ] (f : α → E) {g : G} :
    (∫ x, f (g • x) ∂μ) = ∫ x, f x ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

∫ (x : α), f (g • x) ∂μ = ∫ (x : α), f x ∂μ


theorem restrict_apply₀' (hs : NullMeasurableSet s μ) : μ.restrict s t = μ (t ∩ s)

(hs : MeasureTheory.NullMeasurableSet s μ)


theorem condIndep_iSup_of_monotone [SemilatticeSup ι] {m : ι → MeasurableSpace Ω}
    (h_indep : ∀ i, CondIndep m' (m i) m₁ hm' μ) (h_le : ∀ i, m i ≤ mΩ) (h_le' : m₁ ≤ mΩ)
    (hm : Monotone m) :
    CondIndep m' (⨆ i, m i) m₁ hm' μ

(h_indep : ∀ (i : ι), ProbabilityTheory.CondIndep m' (m i) m₁ hm' μ)

ProbabilityTheory.CondIndep m' (⨆ i, m i) m₁ hm' μ


theorem _root_.sSupHom.apply_blimsup_le [CompleteLattice γ] (g : sSupHom α γ) :
    g (blimsup u f p) ≤ blimsup (g ∘ u) f p

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CompleteLattice α]
{f : Filter β}
{p : β → Prop}
{u : β → α}
[CompleteLattice γ]
(g : sSupHom α γ)

g (Filter.blimsup u f p) ≤ Filter.blimsup (⇑g ∘ u) f p


theorem esymm_isSymmetric (n : ℕ) : IsSymmetric (esymm σ R n)

(σ : Type u_1)
(R : Type u_2)
[CommSemiring R]
[Fintype σ]
(n : ℕ)


/-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
and the derivative of the `n`-th derivative. -/
theorem iteratedFDerivWithin_succ_eq_comp_left {n : ℕ} :
    iteratedFDerivWithin 𝕜 (n + 1) f s =
      (continuousMultilinearCurryLeftEquiv 𝕜 (fun _ : Fin (n + 1) => E) F :
          (E →L[𝕜] (E [×n]→L[𝕜] F)) → (E [×n.succ]→L[𝕜] F)) ∘
        fderivWithin 𝕜 (iteratedFDerivWithin 𝕜 n f s) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ}

iteratedFDerivWithin 𝕜 (n + 1) f s =
  ⇑(continuousMultilinearCurryLeftEquiv 𝕜 (fun x => E) F) ∘ fderivWithin 𝕜 (iteratedFDerivWithin 𝕜 n f s) s


/-- A cocone on `F` with cocone point `X` is the same as an element of `lim Hom(F·, X)`. -/
@[simps!]
noncomputable def limitCompYonedaIsoCocone (F : J ⥤ C) (X : C) :
    limit (F.op ⋙ yoneda.obj X) ≅ (F ⟶ (const J).obj X)

{J : Type v}
[CategoryTheory.SmallCategory J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : J ⥤ C)
(X : C)

∀ (a : F ⟶ (CategoryTheory.Functor.const J).obj X),
  (CategoryTheory.Limits.limitCompYonedaIsoCocone F X).inv a =
    (CategoryTheory.Limits.Types.limitEquivSections (F.op ⋙ CategoryTheory.yoneda.obj X)).symm
      ((CategoryTheory.Limits.opCompYonedaSectionsEquiv F X).symm a)


@[to_additive]
theorem Pi.semiconjBy_iff {x y z : ∀ i, f i} :
    SemiconjBy x y z ↔ ∀ i, SemiconjBy (x i) (y i) (z i)

{I : Type u}
{f : I → Type v}
[(i : I) → Add (f i)]
{x y z : (i : I) → f i}

AddSemiconjBy x y z ↔ ∀ (i : I), AddSemiconjBy (x i) (y i) (z i)


@[simp]
theorem symm_toEquiv_eq_symm {e : A₁ ≃ₐ[R] A₂} : (e : A₁ ≃ A₂).symm = e.symm

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{e : A₁ ≃ₐ[R] A₂}


/-- A `JordanHolderLattice` is the class for which the Jordan Hölder theorem is proved. A
Jordan Hölder lattice is a lattice equipped with a notion of maximality, `IsMaximal`, and a notion
of isomorphism of pairs `Iso`. In the example of subgroups of a group, `IsMaximal H K` means that
`H` is a maximal normal subgroup of `K`, and `Iso (H₁, K₁) (H₂, K₂)` means that the quotient
`H₁ / K₁` is isomorphic to the quotient `H₂ / K₂`. `Iso` must be symmetric and transitive and must
satisfy the second isomorphism theorem `Iso (H, H ⊔ K) (H ⊓ K, K)`.
Examples include `Subgroup G` if `G` is a group, and `Submodule R M` if `M` is an `R`-module.
-/
class JordanHolderLattice (X : Type u) [Lattice X] where
  IsMaximal : X → X → Prop
  lt_of_isMaximal : ∀ {x y}, IsMaximal x y → x < y
  sup_eq_of_isMaximal : ∀ {x y z}, IsMaximal x z → IsMaximal y z → x ≠ y → x ⊔ y = z
  isMaximal_inf_left_of_isMaximal_sup :
    ∀ {x y}, IsMaximal x (x ⊔ y) → IsMaximal y (x ⊔ y) → IsMaximal (x ⊓ y) x
  Iso : X × X → X × X → Prop
  iso_symm : ∀ {x y}, Iso x y → Iso y x
  iso_trans : ∀ {x y z}, Iso x y → Iso y z → Iso x z
  second_iso : ∀ {x y}, IsMaximal x (x ⊔ y) → Iso (x, x ⊔ y) (x ⊓ y, y)

{X : Type u}
[Lattice X]
[self : JordanHolderLattice X]
{x y z : X}

JordanHolderLattice.IsMaximal x z → JordanHolderLattice.IsMaximal y z → x ≠ y → x ⊔ y = z


lemma charZero_iff_forall_prime_ne_zero [NonAssocRing R] [NoZeroDivisors R] [Nontrivial R] :
    CharZero R ↔ ∀ p : ℕ, p.Prime → (p : R) ≠ 0

(R : Type u_1)
[NonAssocRing R]
[NoZeroDivisors R]
[Nontrivial R]

CharZero R ↔ ∀ (p : ℕ), Nat.Prime p → ↑p ≠ 0


/-- `snd` is entire -/
theorem analyticOn_snd {s : Set (E × F)} : AnalyticOn 𝕜 (fun p : E × F ↦ p.snd) s

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


theorem EventuallyEq.countable_iInter [Countable ι] {s t : ι → Set α} (h : ∀ i, s i =ᶠ[l] t i) :
    ⋂ i, s i =ᶠ[l] ⋂ i, t i

{ι : Sort u_1}
{α : Type u_2}
{l : Filter α}
[CountableInterFilter l]
[Countable ι]
{s t : ι → Set α}
(h : ∀ (i : ι), s i =ᶠ[l] t i)


theorem sdiff_limsup [NeBot f] (a : α) : a \ limsup u f = liminf (fun b => a \ u b) f

{α : Type u_1}
{β : Type u_2}
[CompleteBooleanAlgebra α]
(f : Filter β)
(u : β → α)
[f.NeBot]
(a : α)

a \ Filter.limsup u f = Filter.liminf (fun b => a \ u b) f


/-- Composition with a linear isometry on the left preserves the norm of the iterated
derivative within a set. -/
theorem LinearIsometry.norm_iteratedFDerivWithin_comp_left {f : E → F} (g : F →ₗᵢ[𝕜] G)
    (hf : ContDiffOn 𝕜 n f s) (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) {i : ℕ} (hi : (i : ℕ∞) ≤ n) :
    ‖iteratedFDerivWithin 𝕜 i (g ∘ f) s x‖ = ‖iteratedFDerivWithin 𝕜 i f s x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{s : Set E}
{x : E}
{n : ℕ∞}
{f : E → F}
(g : F →ₗᵢ[𝕜] G)
(hf : ContDiffOn 𝕜 n f s)
(hs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)
{i : ℕ}
(hi : ↑i ≤ n)

‖iteratedFDerivWithin 𝕜 i (⇑g ∘ f) s x‖ = ‖iteratedFDerivWithin 𝕜 i f s x‖


theorem bot_lt_comap_prime [IsDomain R] (hM : M ≤ R⁰) (p : Ideal S) [hpp : p.IsPrime]
    (hp0 : p ≠ ⊥) : ⊥ < Ideal.comap (algebraMap R S) p

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
(S : Type u_2)
[CommRing S]
[Algebra R S]
[IsLocalization M S]
[IsDomain R]
(hM : M ≤ nonZeroDivisors R)
(p : Ideal S)
[hpp : p.IsPrime]
(hp0 : p ≠ ⊥)


@[simp]
theorem id_comp (f : α →+*o β) : (OrderRingHom.id β).comp f = f

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


theorem imageToKernel_unop {X Y Z : Vᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) (w : f ≫ g = 0) :
    imageToKernel g.unop f.unop (by rw [← unop_comp, w, unop_zero]) =
      (imageSubobjectIso _ ≪≫ (imageUnopUnop _).symm).hom ≫
        (cokernel.desc f (factorThruImage g)
              (by rw [← cancel_mono (image.ι g), Category.assoc, image.fac, w, zero_comp])).unop ≫
          (kernelSubobjectIso _ ≪≫ kernelUnopUnop _).inv

{V : Type u_1}
[CategoryTheory.Category.{u_2, u_1} V]
[CategoryTheory.Abelian V]
{X Y Z : Vᵒᵖ}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(w : f ≫ g = 0)

imageToKernel g.unop f.unop ⋯ =
  (CategoryTheory.Limits.imageSubobjectIso g.unop ≪≫ (CategoryTheory.imageUnopUnop g).symm).hom ≫
    (CategoryTheory.Limits.cokernel.desc f (CategoryTheory.Limits.factorThruImage g) ⋯).unop ≫
      (CategoryTheory.Limits.kernelSubobjectIso f.unop ≪≫ CategoryTheory.kernelUnopUnop f).inv


/-- Given a category of complexes with objects in `V`, there is a natural equivalence between its
opposite category and a category of complexes with objects in `Vᵒᵖ`. -/
@[simps]
def opEquivalence : (HomologicalComplex V c)ᵒᵖ ≌ HomologicalComplex Vᵒᵖ c.symm

(HomologicalComplex.opEquivalence V c).unitIso = HomologicalComplex.opUnitIso V c


theorem isNat_rpow_neg {a b : ℝ} {nb ne : ℕ}
    (pb : IsInt b (Int.negOfNat nb)) (pe' : IsNat (a ^ (Int.negOfNat nb)) ne) :
    IsNat (a ^ b) ne

(pb : Mathlib.Meta.NormNum.IsInt b (Int.negOfNat nb))

(pe' : Mathlib.Meta.NormNum.IsNat (a ^ Int.negOfNat nb) ne)


theorem toNNReal_eq_nnnorm_of_nonneg (hr : 0 ≤ r) : r.toNNReal = ‖r‖₊


@[to_additive (attr := simp) mod_natCard_nsmul]
lemma pow_mod_natCard (a : G) (n : ℕ) : a ^ (n % Nat.card G) = a ^ n

{G : Type u_1}
[Group G]
(a : G)
(n : ℕ)


@[to_additive]
nonrec theorem ContinuousWithinAt.const_smul (hg : ContinuousWithinAt g s b) (c : M) :
    ContinuousWithinAt (fun x => c • g x) s b

{M : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[VAdd M α]
[ContinuousConstVAdd M α]
[TopologicalSpace β]
{g : β → α}
{b : β}
{s : Set β}
(hg : ContinuousWithinAt g s b)
(c : M)

ContinuousWithinAt (fun x => c +ᵥ g x) s b


@[simp]
theorem fieldRange_subtype (s : Subfield K) : s.subtype.fieldRange = s

{K : Type u}
[DivisionRing K]
(s : Subfield K)


@[simp]
theorem none_bind' (f : α → Option β) : none.bind f = none

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


@[to_additive]
theorem pow_eq_one_iff {x : M} {n : ℕ} (hn : n ≠ 0) : x ^ n = 1 ↔ x = 1

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


theorem lift_map_le {g : Set β → Filter γ} {m : α → β} : (map m f).lift g ≤ f.lift (g ∘ image m)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{g : Set β → Filter γ}
{m : α → β}

(Filter.map m f).lift g ≤ f.lift (g ∘ Set.image m)


/-- If `{ n_i }` is an `R`-basis of `N`, which is also `M`-linearly independent,
then `M` and `N` are linearly disjoint. -/
theorem of_basis_right {ι : Type*} (n : Basis ι R N)
    (H : LinearMap.ker (mulRightMap M n) = ⊥) : M.LinearDisjoint N

(H : LinearMap.ker (M.mulRightMap ⇑n) = ⊥)


/-- **Hölder inequality**: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `NNReal`-valued
functions. For an alternative version, convenient if the infinite sums are not already expressed as
`p`-th powers, see `inner_le_Lp_mul_Lq_tsum`.  -/
theorem inner_le_Lp_mul_Lq_hasSum {f g : ι → ℝ≥0} {A B : ℝ≥0} {p q : ℝ}
    (hpq : p.IsConjExponent q) (hf : HasSum (fun i => f i ^ p) (A ^ p))
    (hg : HasSum (fun i => g i ^ q) (B ^ q)) : ∃ C, C ≤ A * B ∧ HasSum (fun i => f i * g i) C

∃ C ≤ A * B, HasSum (fun i => f i * g i) C


private lemma continuousAt_mul_symm2 {a b : EReal}
    (h : ContinuousAt (fun p : EReal × EReal ↦ p.1 * p.2) (a, b)) :
    ContinuousAt (fun p : EReal × EReal ↦ p.1 * p.2) (a, -b)

(h : ContinuousAt (fun p => p.1 * p.2) (a, b))

ContinuousAt (fun p => p.1 * p.2) (a, -b)


/-- Finsets form an order-connected suborder of sets. -/
lemma ordConnected_range_coe : Set.OrdConnected (Set.range ((↑) : Finset α → Set α))


theorem preimage_subset_image_of_inverse {f : α → β} {g : β → α} (I : LeftInverse g f) (s : Set β) :
    f ⁻¹' s ⊆ g '' s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{g : β → α}
(I : Function.LeftInverse g f)
(s : Set β)


@[to_additive]
theorem mem_mul : a ∈ s * t ↔ ∃ x ∈ s, ∃ y ∈ t, x * y = a

{α : Type u_2}
[Mul α]
{s t : Set α}
{a : α}


lemma isProperMap_iff_ultrafilter_of_t2 [T2Space Y] : IsProperMap f ↔ Continuous f ∧
    ∀ ⦃𝒰 : Ultrafilter X⦄, ∀ ⦃y : Y⦄, Tendsto f 𝒰 (𝓝 y) → ∃ x, 𝒰.1 ≤ 𝓝 x

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
[T2Space Y]

IsProperMap f ↔ Continuous f ∧ ∀ ⦃𝒰 : Ultrafilter X⦄ ⦃y : Y⦄, Filter.Tendsto f (↑𝒰) (𝓝 y) → ∃ x, ↑𝒰 ≤ 𝓝 x


theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).subtype fun n : ℕ => 0 < n

Finset.Icc a b = Finset.subtype (fun n => 0 < n) (Finset.Icc ↑a ↑b)


@[simp]
lemma coe_aeval_eq_eval : RingHomClass.toRingHom (MvPolynomial.aeval f) = MvPolynomial.eval f

{S₁ : Type v}
{σ : Type u_1}
[CommSemiring S₁]
(f : σ → S₁)

↑(MvPolynomial.aeval f) = MvPolynomial.eval f


/-- The (open) thickening is an open set. -/
theorem isOpen_thickening {δ : ℝ} {E : Set α} : IsOpen (thickening δ E)

{α : Type u}
[PseudoEMetricSpace α]
{δ : ℝ}
{E : Set α}


/--
If `B` is a strict bicategory and `I` is a (1-)category, any functor (of 1-categories) `I ⥤ B` can
be promoted to a pseudofunctor from `LocallyDiscrete I` to `B`.
-/
@[simps]
def Functor.toPseudoFunctor (F : I ⥤ B) : Pseudofunctor (LocallyDiscrete I) B

{I : Type u₁}
[CategoryTheory.Category.{v₁, u₁} I]
{B : Type u₂}
[CategoryTheory.Bicategory B]
[CategoryTheory.Bicategory.Strict B]
(F : CategoryTheory.Functor I B)

∀ {X Y : CategoryTheory.LocallyDiscrete I} (f : X ⟶ Y), F.toPseudoFunctor.map f = F.map f.as


@[simp]
theorem AddMonoid.End.zero_apply [AddCommMonoid M] (m : M) : (0 : AddMonoid.End M) m = 0


theorem bijOn_empty (f : α → β) : BijOn f ∅ ∅

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


theorem size_feraseIdx (a : Array α) (i : Fin a.size) : (a.feraseIdx i).size = a.size - 1

{α : Type u_1}
(a : Array α)
(i : Fin a.size)


theorem _root_.NumberField.adjoin_eq_top_of_infinitePlace_lt {x : 𝓞 K} {w : InfinitePlace K}
    (h₁ : x ≠ 0) (h₂ : ∀ ⦃w'⦄, w' ≠ w → w' x < 1) (h₃ : IsReal w ∨ |(w.embedding x).re| < 1) :
    Algebra.adjoin ℚ {(x : K)} = ⊤

(h₂ : ∀ ⦃w' : NumberField.InfinitePlace K⦄, w' ≠ w → w' ↑x < 1)

(h₃ : w.IsReal ∨ |(w.embedding ↑x).re| < 1)


@[simp]
theorem lift_apply (f : M →ₗ[R] N →ₗ[R] P) (m : M) (n : N) : lift R L M N P f (m ⊗ₜ n) = f m n

(R : Type u)
[CommRing R]
(L : Type v)
(M : Type w)
(N : Type w₁)
(P : Type w₂)
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[AddCommGroup N]
[Module R N]
[LieRingModule L N]
[LieModule R L N]
[AddCommGroup P]
[Module R P]
[LieRingModule L P]
[LieModule R L P]
(f : M →ₗ[R] N →ₗ[R] P)
(m : M)
(n : N)

((TensorProduct.LieModule.lift R L M N P) f) (m ⊗ₜ[R] n) = (f m) n


@[simp]
theorem apply_symm_apply (e : P₁ ≃ᵃL[k] P₂) (p : P₂) : e (e.symm p) = p

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)
(p : P₂)


theorem Finsupp.total_eq_fintype_total_apply (x : α → R) : Finsupp.total α M R v
    ((Finsupp.linearEquivFunOnFinite R R α).symm x) = Fintype.total R S v x

{α : Type u_1}
{M : Type u_2}
(R : Type u_3)
[Fintype α]
[Semiring R]
[AddCommMonoid M]
[Module R M]
(S : Type u_4)
[Semiring S]
[Module S M]
[SMulCommClass R S M]
(v : α → M)
(x : α → R)

(Finsupp.total α M R v) ((Finsupp.linearEquivFunOnFinite R R α).symm x) = ((Fintype.total R S) v) x


/-- If `A` is an `R`-algebra such that the induced morphism `R →+* A` is surjective, then the
`R`-module generated by a set `X` equals the `A`-module generated by `X`. -/
theorem restrictScalars_span (hsur : Function.Surjective (algebraMap R A)) (X : Set M) :
    restrictScalars R (span A X) = span R X

(hsur : Function.Surjective ⇑(algebraMap R A))

Submodule.restrictScalars R (Submodule.span A X) = Submodule.span R X


/-- If `f` is a.e. equal to zero on a rectangular box, then it has McShane integral zero on this
box. -/
theorem HasIntegral.of_aeEq_zero {l : IntegrationParams} {I : Box ι} {f : (ι → ℝ) → E}
    {μ : Measure (ι → ℝ)} [IsLocallyFiniteMeasure μ] (hf : f =ᵐ[μ.restrict I] 0)
    (hl : l.bRiemann = false) : HasIntegral.{u, v, v} I l f μ.toBoxAdditive.toSMul 0

BoxIntegral.HasIntegral I l f μ.toBoxAdditive.toSMul 0


theorem norm_multiset_sum_le {E} [SeminormedAddCommGroup E] (m : Multiset E) :
    ‖m.sum‖ ≤ (m.map fun x => ‖x‖).sum

{E : Type u_9}
[SeminormedAddCommGroup E]
(m : Multiset E)

‖m.sum‖ ≤ (Multiset.map (fun x => ‖x‖) m).sum


theorem Filter.Eventually.ratCast_atBot [LinearOrderedField R] [Archimedean R] {p : R → Prop}
    (h : ∀ᶠ (x : R) in atBot, p x) : ∀ᶠ (n : ℚ) in atBot, p n

{R : Type u_2}
[LinearOrderedField R]
[Archimedean R]
{p : R → Prop}
(h : ∀ᶠ (x : R) in Filter.atBot, p x)


theorem Commute.zpow_zpow_self (A : M) (m n : ℤ) : Commute (A ^ m) (A ^ n)

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(A : Matrix n' n' R)
(m n : ℤ)


theorem iSup_lt_lift {ι} {f : ι → Cardinal} {c : Cardinal}
    (hι : Cardinal.lift.{v, u} #ι < c.ord.cof)
    (hf : ∀ i, f i < c) : iSup.{max u v + 1, u + 1} f < c


lemma coe_iSup : BddAbove (range f) → ↑(⨆ i, f i) = ⨆ i, (f i : ℕ∞)

BddAbove (Set.range f) → ↑(⨆ i, f i) = ⨆ i, ↑(f i)


theorem ne_sup_iff_lt_sup {ι : Type u} {f : ι → Ordinal.{max u v}} :
    (∀ i, f i ≠ sup.{_, v} f) ↔ ∀ i, f i < sup.{_, v} f

(∀ (i : ι), f i ≠ Ordinal.sup f) ↔ ∀ (i : ι), f i < Ordinal.sup f


/-- If a `LocalizerMorphism` is a localized equivalence, then any compatible functor
between the localized categories is an equivalence. -/
lemma isEquivalence [h : Φ.IsLocalizedEquivalence] [CatCommSq Φ.functor L₁ L₂ G] :
    G.IsEquivalence

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

[CategoryTheory.CatCommSq Φ.functor L₁ L₂ G]


/-- A list with product less than one must have positive length. -/
@[to_additive "A list with negative sum must have positive length."]
theorem length_pos_of_prod_lt_one [Preorder M] (L : List M) (h : L.prod < 1) : 0 < L.length

{M : Type u_4}
[Monoid M]
[Preorder M]
(L : List M)
(h : L.prod < 1)


@[reassoc] -- @[simp] -- Porting note (#10618): simp can prove this
theorem Cocone.w {F : J ⥤ C} (c : Cocone F) {j j' : J} (f : j ⟶ j') :
    F.map f ≫ c.ι.app j' = c.ι.app j

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


@[to_additive]
theorem div_left_injective : Function.Injective fun a ↦ a / b


theorem chainClosure_maxChain : ChainClosure r (maxChain r)


@[simp]
theorem pointReflection_self (x : P₁) : pointReflection k x x = x

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


@[simp]
theorem eqToHom_whiskerRight {a b c : B} {f g : a ⟶ b} (η : f = g) (h : b ⟶ c) :
    eqToHom η ▷ h = eqToHom (congr_arg₂ (· ≫ ·) η rfl)

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
{f g : a ⟶ b}
(η : f = g)
(h : b ⟶ c)

CategoryTheory.Bicategory.whiskerRight (CategoryTheory.eqToHom η) h = CategoryTheory.eqToHom ⋯


/-- A Jordan decomposition of a measurable space is a pair of mutually singular,
finite measures. -/
@[ext]
structure JordanDecomposition (α : Type*) [MeasurableSpace α] where
  (posPart negPart : Measure α)
  [posPart_finite : IsFiniteMeasure posPart]
  [negPart_finite : IsFiniteMeasure negPart]
  mutuallySingular : posPart ⟂ₘ negPart

(self : MeasureTheory.JordanDecomposition α)


/-- When `D` is a monoidal category,
monoid objects in `C ⥤ D` are the same thing
as functors from `C` into the monoid objects of `D`.
-/
@[simps]
def monFunctorCategoryEquivalence : Mon_ (C ⥤ D) ≌ C ⥤ Mon_ D

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

(CategoryTheory.Monoidal.monFunctorCategoryEquivalence C D).counitIso =
  CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.counitIso


@[simp]
theorem isLittleO_pi {ι : Type*} [Fintype ι] {E' : ι → Type*} [∀ i, NormedAddCommGroup (E' i)]
    {f : α → ∀ i, E' i} : f =o[l] g' ↔ ∀ i, (fun x => f x i) =o[l] g'

{α : Type u_1}
{F' : Type u_7}
[SeminormedAddCommGroup F']
{g' : α → F'}
{l : Filter α}
{ι : Type u_17}
[Fintype ι]
{E' : ι → Type u_18}
[(i : ι) → NormedAddCommGroup (E' i)]
{f : α → (i : ι) → E' i}

f =o[l] g' ↔ ∀ (i : ι), (fun x => f x i) =o[l] g'


theorem adjugate_smul (r : α) (A : Matrix n n α) :
    adjugate (r • A) = r ^ (Fintype.card n - 1) • adjugate A

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

(r • A).adjugate = r ^ (Fintype.card n - 1) • A.adjugate


theorem one_div_strictAntiOn : StrictAntiOn (fun x : α => 1 / x) (Set.Ioi 0)

{α : Type u_2}
[LinearOrderedSemifield α]

StrictAntiOn (fun x => 1 / x) (Set.Ioi 0)


theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3

Complex.sin (3 * x) = 3 * Complex.sin x - 4 * Complex.sin x ^ 3


/-- A graded version of `Algebra`. An instance of `DirectSum.GAlgebra R A` endows `(⨁ i, A i)`
with an `R`-algebra structure. -/
class GAlgebra where
  toFun : R →+ A 0
  map_one : toFun 1 = GradedMonoid.GOne.one
  map_mul :
    ∀ r s, GradedMonoid.mk _ (toFun (r * s)) = .mk _ (GradedMonoid.GMul.mul (toFun r) (toFun s))
  commutes : ∀ (r) (x : GradedMonoid A), .mk _ (toFun r) * x = x * .mk _ (toFun r)
  smul_def : ∀ (r) (x : GradedMonoid A), r • x = .mk _ (toFun r) * x

{ι : Type uι}
{R : Type uR}
{A : ι → Type uA}
[DecidableEq ι]
[CommSemiring R]
[(i : ι) → AddCommMonoid (A i)]
[(i : ι) → Module R (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
[self : DirectSum.GAlgebra R A]
(r : R)
(x : GradedMonoid A)

r • x = GradedMonoid.mk 0 (DirectSum.GAlgebra.toFun r) * x


@[simp]
theorem toFinset_inter [Fintype (s ∩ t : Set _)] : (s ∩ t).toFinset = s.toFinset ∩ t.toFinset

{α : Type u_1}
(s t : Set α)
[DecidableEq α]
[Fintype ↑s]
[Fintype ↑t]
[Fintype ↑(s ∩ t)]


lemma krullDim_le_of_strictMono (f : α → β) (hf : StrictMono f) : krullDim α ≤ krullDim β

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α → β)
(hf : StrictMono f)


@[simp]
theorem antidiagonalTuple_zero_succ (n : ℕ) : antidiagonalTuple 0 n.succ = ∅

Finset.Nat.antidiagonalTuple 0 n.succ = ∅


theorem ι_isoPresheafedSpace_inv (i : D.J) :
    D.toPresheafedSpaceGlueData.toGlueData.ι i ≫ D.isoPresheafedSpace.inv = 𝖣.ι i

(D : AlgebraicGeometry.SheafedSpace.GlueData C)

D.toPresheafedSpaceGlueData.ι i ≫ D.isoPresheafedSpace.inv = D.ι i


/-- `IsSplitEpi f` is the assertion that `f` admits a section -/
class IsSplitEpi {X Y : C} (f : X ⟶ Y) : Prop where
  /-- There is a splitting -/
  exists_splitEpi : Nonempty (SplitEpi f)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
{f : X ⟶ Y}
[self : CategoryTheory.IsSplitEpi f]


lemma uniformEmbedding_toUniformOnFun :
    UniformEmbedding (toUniformOnFun : ContinuousMultilinearMap 𝕜 E F → _)

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
{F : Type u_4}
[NormedField 𝕜]
[(i : ι) → TopologicalSpace (E i)]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[UniformSpace F]
[UniformAddGroup F]


theorem sOppSide_smul_vsub_vadd_right {s : AffineSubspace R P} {x p₁ p₂ : P} (hx : x ∉ s)
    (hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s) {t : R} (ht : t < 0) : s.SOppSide x (t • (x -ᵥ p₁) +ᵥ p₂)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x p₁ p₂ : P}
(hx : x ∉ s)
(hp₁ : p₁ ∈ s)
(hp₂ : p₂ ∈ s)
{t : R}
(ht : t < 0)


/-- For any `a > 1` and a natural `n` we have `n ≤ a ^ n / (a - 1)`. See also
`Nat.cast_le_pow_sub_div_sub` for a stronger inequality with `a ^ n - 1` in the numerator. -/
theorem Nat.cast_le_pow_div_sub (H : 1 < a) (n : ℕ) : (n : α) ≤ a ^ n / (a - 1)

{α : Type u_1}
[LinearOrderedField α]
{a : α}
(H : 1 < a)
(n : ℕ)


@[simp]
lemma map₁_yonedaEquivFst {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G)
    (p : YonedaCollection F X) :
    (YonedaCollection.map₁ η p).yonedaEquivFst = p.yonedaEquivFst

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

{G : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

(p : CategoryTheory.OverPresheafAux.YonedaCollection F X)

(CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η p).yonedaEquivFst = p.yonedaEquivFst


theorem HasTrivialRadical.eq_bot_of_isSolvable [HasTrivialRadical R L]
    (I : LieIdeal R L) [hI : IsSolvable R I] : I = ⊥

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.HasTrivialRadical R L]
(I : LieIdeal R L)
[hI : LieAlgebra.IsSolvable R ↥↑I]


theorem prod_inter : s ×ˢ (t₁ ∩ t₂) = s ×ˢ t₁ ∩ s ×ˢ t₂

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t₁ t₂ : Set β}

s ×ˢ (t₁ ∩ t₂) = s ×ˢ t₁ ∩ s ×ˢ t₂


/-- Given two points on a circle, twice the radius of that circle may be expressed explicitly as
the distance between those two points divided by the cosine of the angle between the chord and
the radius at one of those points. -/
theorem dist_div_cos_oangle_center_eq_two_mul_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) (h : p₁ ≠ p₂) :
    dist p₁ p₂ / Real.Angle.cos (∡ p₂ p₁ s.center) = 2 * s.radius

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

dist p₁ p₂ / (∡ p₂ p₁ s.center).cos = 2 * s.radius


theorem Monotone.compRel [Preorder β] {f g : β → Set (α × α)} (hf : Monotone f) (hg : Monotone g) :
    Monotone fun x => f x ○ g x

{α : Type ua}
{β : Type ub}
[Preorder β]
{f g : β → Set (α × α)}
(hf : Monotone f)
(hg : Monotone g)


@[simp]
theorem map_fun (φ : M →[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
    φ (funMap f x) = funMap f (φ ∘ x)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(φ : L.Hom M N)
{n : ℕ}
(f : L.Functions n)
(x : Fin n → M)

φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)


lemma egauge_le_one (h : x ∈ s) : egauge 𝕜 s x ≤ 1

(𝕜 : Type u_1)
[NormedDivisionRing 𝕜]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(h : x ∈ s)


@[simp, norm_cast]
theorem ofReal_neg (r : ℝ) : ((-r : ℝ) : ℂ) = -r


theorem Cotrident.π_ofπ [Nonempty J] {P : C} (π : Y ⟶ P) (w : ∀ j₁ j₂, f j₁ ≫ π = f j₂ ≫ π) :
    (Cotrident.ofπ π w).π = π

(w : ∀ (j₁ j₂ : J), CategoryTheory.CategoryStruct.comp (f j₁) π = CategoryTheory.CategoryStruct.comp (f j₂) π)

(CategoryTheory.Limits.Cotrident.ofπ π w).π = π


/-- When the second map `S.g` is zero, this is the left homology data on `S` given by
the chosen `cokernel S.f` -/
@[simps!]
noncomputable def ofHasCokernel [HasCokernel S.f] (hg : S.g = 0) : S.LeftHomologyData

(CategoryTheory.ShortComplex.LeftHomologyData.ofHasCokernel S hg).i = CategoryTheory.CategoryStruct.id S.X₂


@[simp]
theorem first_contAux_eq_h_one : g.contsAux 1 = ⟨g.h, 1⟩

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]


/-- If the left cosets of `t` by elements of `s` are disjoint (but not necessarily distinct!), then
the size of `t` divides the size of `s * t`. -/
@[to_additive "If the left cosets of `t` by elements of `s` are disjoint (but not necessarily
distinct!), then the size of `t` divides the size of `s + t`."]
theorem card_dvd_card_mul_right {s t : Finset α} :
    ((· • t) '' (s : Set α)).PairwiseDisjoint id → t.card ∣ (s * t).card

{α : Type u_2}
[AddGroup α]
[DecidableEq α]
{s t : Finset α}

((fun x => x +ᵥ t) '' ↑s).PairwiseDisjoint id → t.card ∣ (s + t).card


/-- For coprime `a` and `b`, the prime factors of `a * b` are the union of those of `a` and `b` -/
theorem perm_primeFactorsList_mul_of_coprime {a b : ℕ} (hab : Coprime a b) :
    (a * b).primeFactorsList ~ a.primeFactorsList ++ b.primeFactorsList

(a * b).primeFactorsList.Perm (a.primeFactorsList ++ b.primeFactorsList)


@[gcongr] protected theorem inv_le_inv' (h : a ≤ b) : b⁻¹ ≤ a⁻¹


theorem HasSum.smul_const {r : R} (hf : HasSum f r) (a : M) : HasSum (fun z ↦ f z • a) (r • a)

{ι : Type u_5}
{R : Type u_7}
{M : Type u_9}
[Semiring R]
[TopologicalSpace R]
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
[ContinuousSMul R M]
{f : ι → R}
{r : R}
(hf : HasSum f r)
(a : M)


@[nontriviality]
theorem degree_of_subsingleton [Subsingleton R] : degree p = ⊥

{R : Type u}
[Semiring R]
{p : R[X]}
[Subsingleton R]


theorem isClopen_biInter_finset {s : Finset Y} {f : Y → Set X}
    (h : ∀ i ∈ s, IsClopen (f i)) : IsClopen (⋂ i ∈ s, f i)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
{s : Finset Y}
{f : Y → Set X}
(h : ∀ i ∈ s, IsClopen (f i))