theorem ae_restrict_biUnion_finset_eq (s : ι → Set α) (t : Finset ι) :
    ae (μ.restrict (⋃ i ∈ t, s i)) = ⨆ i ∈ t, ae (μ.restrict (s i))

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : ι → Set α)
(t : Finset ι)

MeasureTheory.ae (μ.restrict (⋃ i ∈ t, s i)) = ⨆ i ∈ t, MeasureTheory.ae (μ.restrict (s i))


theorem disjSum_strictMono_left (t : Finset β) : StrictMono fun s : Finset α => s.disjSum t

{α : Type u_1}
{β : Type u_2}
(t : Finset β)


theorem map_linearMap_addHaar_eq_smul_addHaar {f : E →ₗ[ℝ] E} (hf : LinearMap.det f ≠ 0) :
    Measure.map f μ = ENNReal.ofReal |(LinearMap.det f)⁻¹| • μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{f : E →ₗ[ℝ] E}
(hf : LinearMap.det f ≠ 0)

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


theorem pairwise_disjoint_powersetCard (s : Multiset α) :
    _root_.Pairwise fun i j => Multiset.Disjoint (s.powersetCard i) (s.powersetCard j)

Pairwise fun i j => (Multiset.powersetCard i s).Disjoint (Multiset.powersetCard j s)


@[simp]
theorem map_fst_prod (f : Filter α) (g : Filter β) [NeBot g] : map Prod.fst (f ×ˢ g) = f

{α : Type u_1}
{β : Type u_2}
(f : Filter α)
(g : Filter β)
[g.NeBot]


theorem nat_rawCast_1 : (Nat.rawCast 1 : R) = 1


theorem approximatesLinearOn_iff_lipschitzOnWith {f : E → F} {f' : E →L[𝕜] F} {s : Set E}
    {c : ℝ≥0} : ApproximatesLinearOn f f' s c ↔ LipschitzOnWith c (f - ⇑f') s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{s : Set E}
{c : ℝ≥0}


@[to_additive]
lemma Function.Injective.smulCommClass [SMul M α] [SMul N α] [SMul M β] [SMul N β]
    [SMulCommClass M N β] {f : α → β} (hf : Injective f) (h₁ : ∀ (c : M) x, f (c • x) = c • f x)
    (h₂ : ∀ (c : N) x, f (c • x) = c • f x) : SMulCommClass M N α

(h₁ : ∀ (c : M) (x : α), f (c • x) = c • f x)

(h₂ : ∀ (c : N) (x : α), f (c • x) = c • f x)


@[to_additive]
theorem map_left_cancel {x y} {c : S} (h : f.toMap (x * c) = f.toMap (y * c)) :
    f.toMap x = f.toMap y

(h : f.toMap (x + ↑c) = f.toMap (y + ↑c))


theorem iUnion_accumulate [Preorder α] : ⋃ x, Accumulate s x = ⋃ x, s x

{α : Type u_1}
{β : Type u_2}
{s : α → Set β}
[Preorder α]


lemma op_comp_isSheaf_of_preservesOneHypercovers
    [PreservesOneHypercovers.{w} F J K] [GrothendieckTopology.IsGeneratedByOneHypercovers.{w} J]
    (P : Dᵒᵖ ⥤ A) (hP : Presheaf.IsSheaf K P) :
    Presheaf.IsSheaf J (F.op ⋙ P)

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

(hP : CategoryTheory.Presheaf.IsSheaf K P)

CategoryTheory.Presheaf.IsSheaf J (F.op.comp P)


@[ext]
theorem BiconeMorphism.ext {c c' : Bicone F} (f g : c ⟶ c') (w : f.hom = g.hom) : f = g


@[to_additive (attr := measurability)]
protected theorem const_smul' {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (hf : StronglyMeasurable f)
    (c : 𝕜) : StronglyMeasurable fun x => c • f x

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => c +ᵥ f x


@[to_additive]
protected lemma inv_mul_cancel (h : Commute a b) : a⁻¹ * b * a = b

{G : Type u_1}
[Group G]
{a b : G}
(h : Commute a b)


theorem trace_tensorProduct' (f : M →ₗ[R] M) (g : N →ₗ[R] N) :
    trace R (M ⊗ N) (map f g) = trace R M f * trace R N g

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
[Module.Free R M]
[Module.Finite R M]
[Module.Free R N]
[Module.Finite R N]
(f : M →ₗ[R] M)
(g : N →ₗ[R] N)

(LinearMap.trace R (TensorProduct R M N)) (TensorProduct.map f g) = (LinearMap.trace R M) f * (LinearMap.trace R N) g


@[simp] lemma op_g' (h : S.LeftHomologyData) :
    h.op.g' = h.f'.op


/-- If two homomorphisms with domain `W` agree on all simple reflections, then they are equal. -/
theorem ext_simple {G : Type*} [Monoid G] {φ₁ φ₂ : W →* G} (h : ∀ i : B, φ₁ (s i) = φ₂ (s i)) :
    φ₁ = φ₂

(h : ∀ (i : B), φ₁ (cs.simple i) = φ₂ (cs.simple i))


@[fun_prop, measurability]
theorem measurable_norm : Measurable (norm : α → ℝ)

{α : Type u_1}
[MeasurableSpace α]
[NormedAddCommGroup α]
[OpensMeasurableSpace α]


theorem nhdsWithin_eq (a : α) (s : Set α) :
    𝓝[s] a = ⨅ t ∈ { t : Set α | a ∈ t ∧ IsOpen t }, 𝓟 (t ∩ s)

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

𝓝[s] a = ⨅ t ∈ {t | a ∈ t ∧ IsOpen t}, 𝓟 (t ∩ s)


nonrec theorem cosh_two_mul : cosh (2 * x) = cosh x ^ 2 + sinh x ^ 2

Real.cosh (2 * x) = Real.cosh x ^ 2 + Real.sinh x ^ 2


theorem algebraMap_eq_inlHom : algebraMap R' (tsze R' M) = inlHom R' M

(R' : Type u)
(M : Type v)
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]

algebraMap R' (tsze R' M) = TrivSqZeroExt.inlHom R' M


@[to_additive] lemma sup_eq_mul_oneLePart_div (a b : α) : a ⊔ b = b * (a / b)⁺ᵐ

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


@[symm]
nonrec theorem symm (h : IntervalIntegrable f μ a b) : IntervalIntegrable f μ b a

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(h : IntervalIntegrable f μ a b)


@[simp]
theorem round_sub_ofNat (x : α) (n : ℕ) [n.AtLeastTwo] :
    round (x - (no_index (OfNat.ofNat n))) = round x - OfNat.ofNat n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(x : α)
(n : ℕ)
[n.AtLeastTwo]

round (x - OfNat.ofNat n) = round x - OfNat.ofNat n


@[simp]
theorem filterMap_eq_filter (p : α → Bool) :
    filterMap (Option.guard (p ·)) = filter p

List.filterMap (Option.guard fun x => p x = true) = List.filter p


@[to_additive (attr := simp)] theorem coe_mkHomeomorph : ⇑(mkHomeomorph : M ≃ₜ Mᵈᵐᵃ) = mk


@[to_additive]
theorem mulIndicator_preimage_of_not_mem (s : Set α) (f : α → M) {t : Set M} (ht : (1 : M) ∉ t) :
    mulIndicator s f ⁻¹' t = f ⁻¹' t ∩ s

{α : Type u_1}
{M : Type u_4}
[One M]
(s : Set α)
(f : α → M)
{t : Set M}
(ht : 1 ∉ t)


theorem isStarNormal_of_mem {x : R} (hx : x ∈ skewAdjoint R) : IsStarNormal x

{R : Type u_1}
[Ring R]
[StarRing R]
{x : R}
(hx : x ∈ skewAdjoint R)


@[simp]
theorem coeff_hermite_self (n : ℕ) : coeff (hermite n) n = 1


/-- The support of `factorization n` is exactly the Finset of normalized factors -/
@[simp]
theorem support_factorization {n : α} :
    (factorization n).support = (normalizedFactors n).toFinset

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[NormalizationMonoid α]
[DecidableEq α]
{n : α}

(factorization n).support = (UniqueFactorizationMonoid.normalizedFactors n).toFinset


theorem lt_univ {c} : c < univ.{u, u + 1} ↔ ∃ c', c = lift.{u + 1, u} c'

c < Cardinal.univ.{u, u + 1} ↔ ∃ c', c = Cardinal.lift.{u + 1, u} c'


/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1)

Filter.Tendsto (fun z => z * Complex.Gamma z) (𝓝[≠] 0) (𝓝 1)


@[simp]
theorem coe_toEmbedding {f : r ↪r s} : ((f : r ↪r s).toEmbedding : α → β) = f

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{f : r ↪r s}


theorem updateColumn_conjTranspose [DecidableEq m] [Star α] :
    updateColumn Mᴴ i (star b) = (updateRow M i b)ᴴ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{i : m}
{b : n → α}
[DecidableEq m]
[Star α]

M.conjTranspose.updateColumn i (star b) = (M.updateRow i b).conjTranspose


protected theorem eq_zero_of_zero_dvd {a : Nat} (h : 0 ∣ a) : a = 0


@[to_additive]
theorem subset_mul_left (s : Finset α) {t : Finset α} (ht : (1 : α) ∈ t) : s ⊆ s * t

{α : Type u_2}
[DecidableEq α]
[AddZeroClass α]
(s : Finset α)
{t : Finset α}
(ht : 0 ∈ t)


@[simp]
theorem conjTranspose_intCast [DecidableEq n] [Ring α] [StarRing α] (d : ℤ) :
    (d : Matrix n n α)ᴴ = d

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Ring α]
[StarRing α]
(d : ℤ)


@[simp] theorem takeD_succ (l) (a : α) :
    takeD (n+1) l a = l.head?.getD a :: takeD n l.tail a

{α : Type u_1}
{n : Nat}
(l : List α)
(a : α)

List.takeD (n + 1) l a = l.head?.getD a :: List.takeD n l.tail a


@[to_additive]
lemma prod_map_ite (p : α → Prop) [DecidablePred p] (f g : α → M) (l : List α) :
    (l.map fun a => if p a then f a else g a).prod =
      ((l.filter p).map f).prod * ((l.filter fun a ↦ ¬p a).map g).prod

{α : Type u_2}
{M : Type u_4}
[CommMonoid M]
(p : α → Prop)
[DecidablePred p]
(f g : α → M)
(l : List α)

(List.map (fun a => if p a then f a else g a) l).prod =
  (List.map f (List.filter (fun b => decide (p b)) l)).prod * (List.map g (List.filter (fun a => decide ¬p a) l)).prod


lemma cast_card_union [AddGroupWithOne R] :
    ((s ∪ t).card : R) = s.card + t.card - (s ∩ t).card

{α : Type u_1}
{R : Type u_3}
{s t : Finset α}
[DecidableEq α]
[AddGroupWithOne R]

↑(s ∪ t).card = ↑s.card + ↑t.card - ↑(s ∩ t).card


protected theorem eq_neg_swap (a b : α) :
    variationOnFromTo f s a b = -variationOnFromTo f s b a

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


theorem DifferentiableWithinAt.inv (hf : DifferentiableWithinAt 𝕜 h S z) (hz : h z ≠ 0) :
    DifferentiableWithinAt 𝕜 (fun x => (h x)⁻¹) S z

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{h : E → 𝕜}
{z : E}
{S : Set E}
(hf : DifferentiableWithinAt 𝕜 h S z)
(hz : h z ≠ 0)


theorem diff_subset (l₁ l₂ : List α) : l₁.diff l₂ ⊆ l₁

{α : Type u_1}
[BEq α]
[LawfulBEq α]
(l₁ l₂ : List α)


@[simp]
theorem sheafedSpace_toSheafedSpace {X Y : SheafedSpace C} (f : X ⟶ Y) [IsOpenImmersion f] :
    toSheafedSpace Y f = X

{X Y : AlgebraicGeometry.SheafedSpace C}

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSheafedSpace Y f = X


theorem coe_mul_apply [AddMonoid ι] [SetLike.GradedMonoid A]
    [∀ (i : ι) (x : A i), Decidable (x ≠ 0)] (r r' : ⨁ i, A i) (n : ι) :
    ((r * r') n : R) =
      ∑ ij ∈ (r.support ×ˢ r'.support).filter (fun ij : ι × ι => ij.1 + ij.2 = n),
        (r ij.1 * r' ij.2 : R)

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

↑((r * r') n) =
  ∑ ij ∈ Finset.filter (fun ij => ij.1 + ij.2 = n) (DFinsupp.support r ×ˢ DFinsupp.support r'), ↑(r ij.1) * ↑(r' ij.2)


theorem enumFrom_cons' (n : ℕ) (x : α) (xs : List α) :
    enumFrom n (x :: xs) = (n, x) :: (enumFrom n xs).map (Prod.map Nat.succ id)

{α : Type u_1}
(n : ℕ)
(x : α)
(xs : List α)

List.enumFrom n (x :: xs) = (n, x) :: List.map (Prod.map Nat.succ id) (List.enumFrom n xs)


@[simp]
theorem equitableOn_empty [LE β] [Add β] [One β] (f : α → β) : EquitableOn ∅ f

{α : Type u_1}
{β : Type u_2}
[LE β]
[Add β]
[One β]
(f : α → β)


theorem isTheta_const_const {c₁ : E''} {c₂ : F''} (h₁ : c₁ ≠ 0) (h₂ : c₂ ≠ 0) :
    (fun _ : α ↦ c₁) =Θ[l] fun _ ↦ c₂

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{l : Filter α}
{c₁ : E''}
{c₂ : F''}
(h₁ : c₁ ≠ 0)
(h₂ : c₂ ≠ 0)


@[to_additive]
theorem unop_sInf (S : Set (Subgroup Gᵐᵒᵖ)) : (sInf S).unop = sInf (.op ⁻¹' S)

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

(sInf S).unop = sInf (Subgroup.op ⁻¹' S)


/-- The finpartition in one part, aka indiscrete finpartition. -/
@[simps]
def indiscrete (ha : a ≠ ⊥) : Finpartition a

{α : Type u_1}
[Lattice α]
[OrderBot α]
{a : α}
(ha : a ≠ ⊥)

(Finpartition.indiscrete ha).parts = {a}


theorem EqOn.cancel_right (hf : s.EqOn (g₁ ∘ f) (g₂ ∘ f)) (hf' : s.SurjOn f t) : t.EqOn g₁ g₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{f : α → β}
{g₁ g₂ : β → γ}
(hf : Set.EqOn (g₁ ∘ f) (g₂ ∘ f) s)
(hf' : Set.SurjOn f s t)


@[to_additive]
theorem tprod_subtype_mulSupport (f : β → α) : ∏' x : mulSupport f, f x = ∏' x, f x

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

∏' (x : ↑(Function.mulSupport f)), f ↑x = ∏' (x : β), f x


/-- Suppose `f` is locally integrable on `(0, ∞)`, is `O(x ^ (-a))` as `x → ∞`, and is
`O(x ^ (-b))` as `x → 0`. Then its Mellin transform is differentiable on the domain `b < re s < a`.
-/
theorem mellin_differentiableAt_of_isBigO_rpow [NormedSpace ℂ E] {a b : ℝ}
    {f : ℝ → E} {s : ℂ} (hfc : LocallyIntegrableOn f <| Ioi 0)
    (hf_top : f =O[atTop] (· ^ (-a))) (hs_top : s.re < a)
    (hf_bot : f =O[𝓝[>] 0] (· ^ (-b))) (hs_bot : b < s.re) :
    DifferentiableAt ℂ (mellin f) s

(hfc : MeasureTheory.LocallyIntegrableOn f (Set.Ioi 0) MeasureTheory.volume)

(hf_top : f =O[Filter.atTop] fun x => x ^ (-a))


/-- Sets of subtype are Lindelöf iff the image under a coercion is. -/
theorem Subtype.isLindelof_iff {p : X → Prop} {s : Set { x // p x }} :
    IsLindelof s ↔ IsLindelof ((↑) '' s : Set X)

{X : Type u}
[TopologicalSpace X]
{p : X → Prop}
{s : Set { x // p x }}

IsLindelof s ↔ IsLindelof (Subtype.val '' s)


/-- A structure induced by a bijection. -/
@[simps!]
def inducedStructure (e : M ≃ N) : L.Structure N

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
(e : M ≃ N)

∀ {n : ℕ} (r : L.Relations n) (x : Fin n → N),
  FirstOrder.Language.Structure.RelMap r x = FirstOrder.Language.Structure.RelMap r (⇑e.symm ∘ x)


@[to_additive]
theorem ciInf_div (hf : BddBelow (range f)) (a : G) : (⨅ i, f i) / a = ⨅ i, f i / a

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


theorem Set.Finite.isCompact (hs : s.Finite) : IsCompact s

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : s.Finite)


lemma _root_.fderiv_continuousLinearEquiv_comp' (L : G ≃L[𝕜] G') (f : E → (F →L[𝕜] G)) :
    fderiv 𝕜 (fun x ↦ (L : G →L[𝕜] G').comp (f x)) =
      fun x ↦ (((ContinuousLinearEquiv.refl 𝕜 F).arrowCongr L)) ∘L (fderiv 𝕜 f 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]
{G' : Type u_5}
[NormedAddCommGroup G']
[NormedSpace 𝕜 G']
(L : G ≃L[𝕜] G')
(f : E → F →L[𝕜] G)

(fderiv 𝕜 fun x => (↑L).comp (f x)) = fun x => (↑((ContinuousLinearEquiv.refl 𝕜 F).arrowCongr L)).comp (fderiv 𝕜 f x)


theorem toIocMod_eq_self : toIocMod hp a b = b ↔ b ∈ Set.Ioc a (a + p)

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


/-- If `f` is nonnegative and integrable on the unordered interval `Set.uIoc a b`, then its
integral over `a..b` is positive if and only if `a < b` and the measure of
`Function.support f ∩ Set.Ioc a b` is positive. -/
theorem integral_pos_iff_support_of_nonneg_ae' (hf : 0 ≤ᵐ[μ.restrict (Ι a b)] f)
    (hfi : IntervalIntegrable f μ a b) :
    (0 < ∫ x in a..b, f x ∂μ) ↔ a < b ∧ 0 < μ (support f ∩ Ioc a b)

{f : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hf : 0 ≤ᵐ[μ.restrict (Ι a b)] f)
(hfi : IntervalIntegrable f μ a b)

0 < ∫ (x : ℝ) in a..b, f x ∂μ ↔ a < b ∧ 0 < μ (Function.support f ∩ Set.Ioc a b)


@[simp]
theorem intCast_apply [IntCast β] (m : ℤ) (x : α) : (m : α →ᵇ β) x = m

{α : Type u}
[TopologicalSpace α]
{β : Type u_2}
[PseudoMetricSpace β]
[IntCast β]
(m : ℤ)
(x : α)


theorem apply_symm_apply' {b : B} {x : F} (hx : b ∈ e.baseSet) :
    e (e.toPartialHomeomorph.symm (b, x)) = (b, x)

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


theorem biInter_pair (a b : α) (s : α → Set β) : ⋂ x ∈ ({a, b} : Set α), s x = s a ∩ s b

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


/-- The separable degree multiplied by the inseparable degree is equal
to the (infinite) field extension degree. -/
theorem sepDegree_mul_insepDegree : sepDegree F E * insepDegree F E = Module.rank F E

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

Field.sepDegree F E * Field.insepDegree F E = Module.rank F E


@[simp]
theorem invOf_le_one [Invertible a] (h : 1 ≤ a) : ⅟ a ≤ 1

{α : Type u_1}
[LinearOrderedSemiring α]
{a : α}
[Invertible a]
(h : 1 ≤ a)


@[simp]
theorem image_add_const_Ico : (fun x => x + a) '' Ico b c = Ico (b + a) (c + a)

{M : Type u_1}
[OrderedCancelAddCommMonoid M]
[ExistsAddOfLE M]
(a b c : M)

(fun x => x + a) '' Set.Ico b c = Set.Ico (b + a) (c + a)


@[to_additive]
theorem not_mem_of_not_mem_closure {P : G} (hP : P ∉ closure k) : P ∉ k

{G : Type u_1}
[AddGroup G]
{k : Set G}
{P : G}
(hP : P ∉ AddSubgroup.closure k)


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

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


theorem power_le_power_left : ∀ {a b c : Cardinal}, a ≠ 0 → b ≤ c → a ^ b ≤ a ^ c


theorem sdiff_le_sdiff_of_sup_le_sup_right (h : a ⊔ c ≤ b ⊔ c) : a \ c ≤ b \ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}
(h : a ⊔ c ≤ b ⊔ c)


/-- `Real.exp (f x)` is bounded away from zero along a filter if and only if this filter is bounded
from below under `f`. -/
@[simp]
theorem isBigO_one_exp_comp {f : α → ℝ} :
    ((fun _ => 1 : α → ℝ) =O[l] fun x => exp (f x)) ↔ IsBoundedUnder (· ≥ ·) l f

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

((fun x => 1) =O[l] fun x => Real.exp (f x)) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l f


theorem mem_map_of_mem (f : α → β) (h : a ∈ l) : f a ∈ map f l

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


theorem le_cons_erase (s : Multiset α) (a : α) : s ≤ a ::ₘ s.erase a

{α : Type u_1}
[DecidableEq α]
(s : Multiset α)
(a : α)


/-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
which can be more convenient in practice.
-/
theorem existsUnique_gluing' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : V ≤ iSup U)
    (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompatible F.1 U sf) :
    ∃! s : F.1.obj (op V), ∀ i : ι, F.1.map (iUV i).op s = sf i

(sf : (i : ι) → (CategoryTheory.forget C).obj (F.val.obj (Opposite.op (U i))))

(h : TopCat.Presheaf.IsCompatible F.val U sf)

∃! s, ∀ (i : ι), (F.val.map (iUV i).op) s = sf i


theorem compl_mem_measurableCylinders (hs : s ∈ measurableCylinders α) :
    sᶜ ∈ measurableCylinders α

(hs : s ∈ MeasureTheory.measurableCylinders α)

sᶜ ∈ MeasureTheory.measurableCylinders α


lemma isIso_of_isLeftKanExtension : IsIso α

(L : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ (Type v₁)) ℰ)


/-- Subsingletons are (trivial) blocks -/
theorem isBlock_subsingleton {B : Set X} (hB : B.Subsingleton) :
    IsBlock G B

{G : Type u_1}
{X : Type u_2}
[SMul G X]
{B : Set X}
(hB : B.Subsingleton)


theorem ClosedComplemented.of_quotient_finiteDimensional [CompleteSpace 𝕜]
    [FiniteDimensional 𝕜 (E ⧸ p)] (hp : IsClosed (p : Set E)) : p.ClosedComplemented

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{p : Subspace 𝕜 E}
[CompleteSpace 𝕜]
[FiniteDimensional 𝕜 (E ⧸ p)]
(hp : IsClosed ↑p)


/-- The natural transformation `mapTrifunctor F I₁ I₂ I₃ ⟶ mapTrifunctor F' I₁ I₂ I₃`
induced by a natural transformation `F ⟶ F` of trifunctors. -/
@[simps]
def mapTrifunctorMapNatTrans (α : F ⟶ F') (I₁ I₂ I₃ : Type*) :
    mapTrifunctor F I₁ I₂ I₃ ⟶ mapTrifunctor F' I₁ I₂ I₃

{F F' : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ (CategoryTheory.Functor C₃ C₄))}

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

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

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

(((CategoryTheory.GradedObject.mapTrifunctorMapNatTrans α I₁ I₂ I₃).app X₁).app X₂).app X₃ i =
  ((α.app (X₁ i.1)).app (X₂ i.2.1)).app (X₃ i.2.2)


protected theorem compare_eq_gt {a b : Nat} : compare a b = .gt ↔ b < a


theorem blimsup_congr' {f : Filter β} {p q : β → Prop} {u : β → α}
    (h : ∀ᶠ x in f, u x ≠ ⊥ → (p x ↔ q x)) : blimsup u f p = blimsup u f q

(h : ∀ᶠ (x : β) in f, u x ≠ ⊥ → (p x ↔ q x))

Filter.blimsup u f p = Filter.blimsup u f q


theorem polynomialFunctions.le_equalizer {A : Type*} [Semiring A] [Algebra R A] (s : Set R)
    (φ ψ : C(s, R) →ₐ[R] A)
    (h : φ (toContinuousMapOnAlgHom s X) = ψ (toContinuousMapOnAlgHom s X)) :
    polynomialFunctions s ≤ AlgHom.equalizer φ ψ

(h : φ ((Polynomial.toContinuousMapOnAlgHom s) Polynomial.X) = ψ ((Polynomial.toContinuousMapOnAlgHom s) Polynomial.X))


theorem nonlinearRightInverseOfSurjective_nnnorm_pos (f : E →SL[σ] F)
    (hsurj : LinearMap.range f = ⊤) : 0 < (nonlinearRightInverseOfSurjective f hsurj).nnnorm

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace F]
[CompleteSpace E]
(f : E →SL[σ] F)
(hsurj : LinearMap.range f = ⊤)

0 < (f.nonlinearRightInverseOfSurjective hsurj).nnnorm


lemma linfty_opNNNorm_eq_opNNNorm (A : Matrix m n α) :
    ‖A‖₊ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖₊

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

‖A‖₊ = ‖{ toLinearMap := A.mulVecLin, cont := ⋯ }‖₊


@[to_additive]
nonrec theorem SmoothOn.inv {f : M → G} {s : Set M} (hf : SmoothOn I' I f s) :
    SmoothOn I' I (fun x => (f x)⁻¹) s

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


@[to_additive]
theorem MonoidHom.copy_eq {_ : MulOneClass M} {_ : MulOneClass N} (f : M →* N) (f' : M → N)
    (h : f' = f) : f.copy f' h = f

∀ {x : AddZeroClass M} {x_1 : AddZeroClass N} (f : M →+ N) (f' : M → N) (h : f' = ⇑f), f.copy f' h = f


@[simp]
theorem toSubgraph_map (f : G →g G') (p : G.Walk u v) :
    (p.map f).toSubgraph = p.toSubgraph.map f

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{u v : V}
(f : G →g G')
(p : G.Walk u v)

(SimpleGraph.Walk.map f p).toSubgraph = SimpleGraph.Subgraph.map f p.toSubgraph


theorem ContDiff.of_le (h : ContDiff 𝕜 n f) (hmn : m ≤ n) : ContDiff 𝕜 m f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{m n : ℕ∞}
(h : ContDiff 𝕜 n f)
(hmn : m ≤ n)


theorem mem_sup' : x ∈ p ⊔ p' ↔ ∃ (y : p) (z : p'), (y : M) + z = x

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x : M}
{p p' : Submodule R M}


private theorem ghostFun_mul : ghostFun (x * y) = ghostFun x * ghostFun y

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

WittVector.ghostFun (x * y) = WittVector.ghostFun x * WittVector.ghostFun y


/-- For any circle integrable function `f`, the power series `cauchyPowerSeries f c R` multiplied
by `2πI` converges to the integral `∮ z in C(c, R), (z - w)⁻¹ • f z` on the open disc
`Metric.ball c R`. -/
theorem hasSum_two_pi_I_cauchyPowerSeries_integral {f : ℂ → E} {c : ℂ} {R : ℝ} {w : ℂ}
    (hf : CircleIntegrable f c R) (hw : abs w < R) :
    HasSum (fun n : ℕ => ∮ z in C(c, R), (w / (z - c)) ^ n • (z - c)⁻¹ • f z)
      (∮ z in C(c, R), (z - (c + w))⁻¹ • f z)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : ℂ → E}
{c : ℂ}
{R : ℝ}
{w : ℂ}
(hf : CircleIntegrable f c R)
(hw : Complex.abs w < R)

HasSum (fun n => ∮ (z : ℂ) in C(c, R), (w / (z - c)) ^ n • (z - c)⁻¹ • f z)
  (∮ (z : ℂ) in C(c, R), (z - (c + w))⁻¹ • f z)


theorem proj_isLocallyConstant : IsLocallyConstant S.proj

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


@[to_additive]
lemma iIndepFun.indepFun_div_left (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (f i / f j) (f k) κ μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.Kernel.iIndepFun (fun x => m) f κ μ)

ProbabilityTheory.Kernel.IndepFun (f i - f j) (f k) κ μ


/-- `MvPolynomial.coeff m` but promoted to an `AddMonoidHom`. -/
@[simps]
def coeffAddMonoidHom (m : σ →₀ ℕ) : MvPolynomial σ R →+ R

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(m : σ →₀ ℕ)
(p : MvPolynomial σ R)

(MvPolynomial.coeffAddMonoidHom m) p = MvPolynomial.coeff m p


@[to_additive (attr := simp)]
theorem mem_comap {K : Subgroup N} {f : G →* N} {x : G} : x ∈ K.comap f ↔ f x ∈ K

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{K : Subgroup N}
{f : G →* N}
{x : G}


@[norm_cast] lemma natCast_dvd_natCast {m n : ℕ} : (↑m : ℤ) ∣ ↑n ↔ m ∣ n

↑m ∣ ↑n ↔ m ∣ n


@[to_additive uniformContinuous_const_zsmul]
theorem uniformContinuous_zpow_const (n : ℤ) : UniformContinuous fun x : α => x ^ n

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
(n : ℤ)


lemma eq_top_of_restrict_nondegenerate_of_orthogonal_eq_bot
    (b₁ : B.IsRefl) (b₂ : (B.restrict W).Nondegenerate) (b₃ : B.orthogonal W = ⊥) :
    W = ⊤

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{B : LinearMap.BilinForm K V}
{W : Submodule K V}
(b₁ : B.IsRefl)
(b₂ : (B.restrict W).Nondegenerate)
(b₃ : B.orthogonal W = ⊥)


lemma isSMulRegular_on_submodule_iff_mem_imp_smul_eq_zero_imp_eq_zero :
    IsSMulRegular N r ↔ ∀ x ∈ N, r • x = 0 → x = 0

{R : Type u_1}
{M : Type u_3}
[Ring R]
[AddCommGroup M]
[Module R M]
(N : Submodule R M)
(r : R)

IsSMulRegular (↥N) r ↔ ∀ x ∈ N, r • x = 0 → x = 0


theorem iUnion_image_inf_left : ⋃ a ∈ s, (a ⊓ ·) '' t = s ⊼ t

{α : Type u_2}
[SemilatticeInf α]
(s t : Set α)


theorem diam_image (s : Set E) : Metric.diam (f '' s) = Metric.diam s

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


/-- **Fundamental theorem of algebra**: every non constant complex polynomial
  has a root -/
theorem exists_root {f : ℂ[X]} (hf : 0 < degree f) : ∃ z : ℂ, IsRoot f z


theorem diam_pi_le_of_le {π : β → Type*} [Fintype β] [∀ b, PseudoEMetricSpace (π b)]
    {s : ∀ b : β, Set (π b)} {c : ℝ≥0∞} (h : ∀ b, diam (s b) ≤ c) : diam (Set.pi univ s) ≤ c

{β : Type v}
{π : β → Type u_2}
[Fintype β]
[(b : β) → PseudoEMetricSpace (π b)]
{s : (b : β) → Set (π b)}
{c : ℝ≥0∞}
(h : ∀ (b : β), EMetric.diam (s b) ≤ c)


@[simp]
theorem insert_pi (i : ι) (s : Set ι) (t : ∀ i, Set (α i)) :
    pi (insert i s) t = eval i ⁻¹' t i ∩ pi s t

{ι : Type u_1}
{α : ι → Type u_2}
(i : ι)
(s : Set ι)
(t : (i : ι) → Set (α i))

(insert i s).pi t = Function.eval i ⁻¹' t i ∩ s.pi t


@[simp, norm_cast]
theorem coe_le_one_iff : ↑r ≤ (1 : ℝ≥0∞) ↔ r ≤ 1

↑r ≤ 1 ↔ r ≤ 1


/-- Promote a `LinearMap` to an `AlgHom` by supplying proofs about the behavior on `1` and `*`. -/
@[simps]
def ofLinearMap (f : A →ₗ[R] B) (map_one : f 1 = 1) (map_mul : ∀ x y, f (x * y) = f x * f y) :
    A →ₐ[R] B

(map_mul : ∀ (x y : A), f (x * y) = f x * f y)

(AlgHom.ofLinearMap f map_one map_mul) a = f a


@[simp] theorem foldr_reverse (l : List α) (f : α → β → β) (b) :
    l.reverse.foldr f b = l.foldl (fun x y => f y x) b

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

List.foldr f b l.reverse = List.foldl (fun x y => f y x) b l


lemma of_openCover (H : ∀ i, P (𝒰.pullbackHom f i)) : P f

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

[hP : AlgebraicGeometry.IsLocalAtTarget P]

(H : ∀ (i : (𝒰.pullbackCover f).J), P (𝒰.pullbackHom f i))


theorem prod_ofNatList (l : List ℕ) (h) : ((ofNatList l h).prod : ℕ) = l.prod

↑(PrimeMultiset.ofNatList l h).prod = l.prod


theorem existsUnique_add_of_isCompl (hc : IsCompl p q) (x : E) :
    ∃ (u : p) (v : q), (u : E) + v = x ∧ ∀ (r : p) (s : q), (r : E) + s = x → r = u ∧ s = v

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

∃ u v, ↑u + ↑v = x ∧ ∀ (r : ↥p) (s : ↥q), ↑r + ↑s = x → r = u ∧ s = v


/-- One can cut out `ℝ≥0∞` into the sets `{0}`, `Ico (t^n) (t^(n+1))` for `n : ℤ` and `{∞}`. This
gives a way to compute the measure of a set in terms of sets on which a given function `f` does not
fluctuate by more than `t`. -/
theorem measure_eq_measure_preimage_add_measure_tsum_Ico_zpow {α : Type*} [MeasurableSpace α]
    (μ : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) {s : Set α} (hs : MeasurableSet s)
    {t : ℝ≥0} (ht : 1 < t) :
    μ s =
      μ (s ∩ f ⁻¹' {0}) + μ (s ∩ f ⁻¹' {∞}) +
      ∑' n : ℤ, μ (s ∩ f ⁻¹' Ico ((t : ℝ≥0∞) ^ n) ((t : ℝ≥0∞) ^ (n + 1)))

{α : Type u_5}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
{f : α → ℝ≥0∞}
(hf : Measurable f)
{s : Set α}
(hs : MeasurableSet s)
{t : ℝ≥0}
(ht : 1 < t)

μ s = μ (s ∩ f ⁻¹' {0}) + μ (s ∩ f ⁻¹' {⊤}) + ∑' (n : ℤ), μ (s ∩ f ⁻¹' Set.Ico (↑t ^ n) (↑t ^ (n + 1)))


theorem threeGPFree_smul_set₀ (ha : a ≠ 0) : ThreeGPFree (a • s) ↔ ThreeGPFree s

{α : Type u_2}
[CancelCommMonoidWithZero α]
[NoZeroDivisors α]
{s : Set α}
{a : α}
(ha : a ≠ 0)


/-- A category is adhesive if it has pushouts and pullbacks along monomorphisms,
and such pushouts are van Kampen. -/
class Adhesive (C : Type u) [Category.{v} C] : Prop where
  [hasPullback_of_mono_left : ∀ {X Y S : C} (f : X ⟶ S) (g : Y ⟶ S) [Mono f], HasPullback f g]
  [hasPushout_of_mono_left : ∀ {X Y S : C} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
  van_kampen : ∀ {W X Y Z : C} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z} [Mono f]
    (H : IsPushout f g h i), H.IsVanKampen

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


theorem succ_le_succ_iff_of_not_isMax (ha : ¬IsMax a) (hb : ¬IsMax b) :
    succ a ≤ succ b ↔ a ≤ b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
(ha : ¬IsMax a)
(hb : ¬IsMax b)


theorem apply_eq_component (f : ⨁ i, M i) (i : ι) : f i = component R ι M i f

(R : Type u)
[Semiring R]
{ι : Type v}
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
(f : DirectSum ι fun i => M i)
(i : ι)


theorem inf'_product_right {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) :
    (s ×ˢ t).inf' h f = t.inf' h.snd fun i' => s.inf' h.fst fun i => f ⟨i, i'⟩

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

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


protected theorem le_sup_left {a b : CauSeq α abs} : a ≤ a ⊔ b

{α : Type u_1}
[LinearOrderedField α]
{a b : CauSeq α abs}


theorem lcm_comm (i j : ℤ) : lcm i j = lcm j i


/-- If `R` and `R'` are isomorphic rings that act identically on a module `M`,
then a basis for `M` as `R`-module is also a basis for `M` as `R'`-module.

See also `Basis.algebraMapCoeffs` for the case where `f` is equal to `algebraMap`.
-/
@[simps (config := { simpRhs := true })]
def mapCoeffs : Basis ι R' M

(h : ∀ (c : R) (x : M), f c • x = c • x)

(b.mapCoeffs f h).repr =
  LinearEquiv.restrictScalars R' b.repr ≪≫ₗ Finsupp.mapRange.linearEquiv (Module.compHom.toLinearEquiv f.symm).symm


@[to_additive]
theorem pow_smul_eq_iff_minimalPeriod_dvd {n : ℕ} :
    a ^ n • b = b ↔ minimalPeriod (a • ·) b ∣ n

{α : Type v}
{G : Type u}
[Group G]
[MulAction G α]
{a : G}
{b : α}
{n : ℕ}

a ^ n • b = b ↔ Function.minimalPeriod (fun x => a • x) b ∣ n


@[simp] lemma mem_copy {S hmem} : s ∈ f.copy S hmem ↔ s ∈ S

{α : Type u}
{f : Filter α}
{s : Set α}
{S : Set (Set α)}
{hmem : ∀ (s : Set α), s ∈ S ↔ s ∈ f}


@[to_additive]
theorem toWord_injective : Function.Injective (toWord : FreeGroup α → List (α × Bool))


/-- A Smith normal form basis for a submodule `N` of a module `M` consists of
bases for `M` and `N` such that the inclusion map `N → M` can be written as a
(rectangular) matrix with `a` along the diagonal: in Smith normal form. -/
-- Porting note(#5171): @[nolint has_nonempty_instance]
structure Basis.SmithNormalForm (N : Submodule R M) (ι : Type*) (n : ℕ) where
  /-- The basis of M. -/
  bM : Basis ι R M
  /-- The basis of N. -/
  bN : Basis (Fin n) R N
  /-- The mapping between the vectors of the bases. -/
  f : Fin n ↪ ι
  /-- The (diagonal) entries of the matrix. -/
  a : Fin n → R
  /-- The SNF relation between the vectors of the bases. -/
  snf : ∀ i, (bN i : M) = a i • bM (f i)

{R : Type u_2}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{N : Submodule R M}
{ι : Type u_4}
{n : ℕ}
(self : Basis.SmithNormalForm N ι n)
(i : Fin n)

↑(self.bN i) = self.a i • self.bM (self.f i)


@[to_additive]
theorem isOfFinOrder_iff_pow_eq_one : IsOfFinOrder x ↔ ∃ n, 0 < n ∧ x ^ n = 1

IsOfFinAddOrder x ↔ ∃ n, 0 < n ∧ n • x = 0


/-- The functor `G ↦ k[G]`, from the category of magmas to the category of
non-unital, non-associative algebras over `k` is adjoint to the forgetful functor in the other
direction. -/
@[simps apply_apply symm_apply]
def liftMagma [Module k A] [IsScalarTower k A A] [SMulCommClass k A A] :
    (Multiplicative G →ₙ* A) ≃ (k[G] →ₙₐ[k] A)

(k : Type u₁)
{G : Type u₂}
[Semiring k]
[Add G]
{A : Type u₃}
[NonUnitalNonAssocSemiring A]
[Module k A]
[IsScalarTower k A A]
[SMulCommClass k A A]
(f : Multiplicative G →ₙ* A)
(a : AddMonoidAlgebra k G)

((AddMonoidAlgebra.liftMagma k) f) a = Finsupp.sum a fun m t => t • f (Multiplicative.ofAdd m)


@[to_additive (attr := simp)]
theorem top_toSubmonoid : (⊤ : Subgroup G).toSubmonoid = ⊤


@[ext]
theorem ext {e e' : E ≃ₛₗᵢ[σ₁₂] E₂} (h : ∀ x, e x = e' x) : e = e'

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


theorem const_of_comp [PreconnectedSpace A] (cont : Continuous g)
    (he : ∀ a a', f (g a) = f (g a')) (a a') : g a = g a'

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
(hf : IsCoveringMap f)
{A : Type u_3}
[TopologicalSpace A]
{g : A → E}
[PreconnectedSpace A]
(cont : Continuous g)
(he : ∀ (a a' : A), f (g a) = f (g a'))
(a a' : A)


theorem compl_mem_ae_iff {s : Set α} : sᶜ ∈ ae μ ↔ μ s = 0

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


/-- An `OrderedSemiring` is a semiring with a partial order such that addition is monotone and
multiplication by a nonnegative number is monotone. -/
class OrderedSemiring (α : Type u) extends Semiring α, OrderedAddCommMonoid α where
  /-- `0 ≤ 1` in any ordered semiring. -/
  protected zero_le_one : (0 : α) ≤ 1
  /-- In an ordered semiring, we can multiply an inequality `a ≤ b` on the left
  by a non-negative element `0 ≤ c` to obtain `c * a ≤ c * b`. -/
  protected mul_le_mul_of_nonneg_left : ∀ a b c : α, a ≤ b → 0 ≤ c → c * a ≤ c * b
  /-- In an ordered semiring, we can multiply an inequality `a ≤ b` on the right
  by a non-negative element `0 ≤ c` to obtain `a * c ≤ b * c`. -/
  protected mul_le_mul_of_nonneg_right : ∀ a b c : α, a ≤ b → 0 ≤ c → a * c ≤ b * c

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


theorem Algebra.transcendental_iff_not_isAlgebraic :
    Algebra.Transcendental R A ↔ ¬ Algebra.IsAlgebraic R A

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]

Algebra.Transcendental R A ↔ ¬Algebra.IsAlgebraic R A


/-- Given `X : T`, to upgrade a functor `F : S ⥤ T` to a functor `S ⥤ Over X`, it suffices to
    provide maps `F.obj Y ⟶ X` for all `Y` making the obvious triangles involving all `F.map g`
    commute. -/
@[simps! obj_left map_left]
def toOver (F : S ⥤ T) (X : T) (f : (Y : S) → F.obj Y ⟶ X)
    (h : ∀ {Y Z : S} (g : Y ⟶ Z), F.map g ≫ f Z = f Y) : S ⥤ Over X

(h : ∀ {Y Z : S} (g : Y ⟶ Z), CategoryTheory.CategoryStruct.comp (F.map g) (f Z) = f Y)

∀ {X_1 Y : S} (g : X_1 ⟶ Y), ((F.toOver X f h).map g).left = F.map g


theorem update_le_update_iff :
    Function.update x i a ≤ Function.update y i b ↔ a ≤ b ∧ ∀ (j) (_ : j ≠ i), x j ≤ y j

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

Function.update x i a ≤ Function.update y i b ↔ a ≤ b ∧ ∀ (j : ι), j ≠ i → x j ≤ y j


theorem type_pUnit : type (@EmptyRelation PUnit) = 1


/-- Corresponds to `dist_triangle_right`. -/
theorem hammingDist_triangle_right (x y z : ∀ i, β i) :
    hammingDist x y ≤ hammingDist x z + hammingDist y z

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


@[simp]
theorem update_inr_apply_inr [DecidableEq β] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i j : β}
    {x : γ} : update f (inr i) x (inr j) = update (f ∘ inr) i x j

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq β]
[DecidableEq (α ⊕ β)]
{f : α ⊕ β → γ}
{i j : β}
{x : γ}

Function.update f (Sum.inr i) x (Sum.inr j) = Function.update (f ∘ Sum.inr) i x j


@[simp, norm_cast]
theorem coe_inf (s t : Opens α) : (↑(s ⊓ t) : Set α) = ↑s ∩ ↑t

{α : Type u_2}
[TopologicalSpace α]
(s t : TopologicalSpace.Opens α)


/-- An upper modular lattice, aka semimodular lattice, is a lattice where `a ⊔ b` covers `a` and `b`
if either `a` or `b` covers `a ⊓ b`. -/
class IsUpperModularLattice (α : Type*) [Lattice α] : Prop where
/-- `a ⊔ b` covers `a` and `b` if either `a` or `b` covers `a ⊓ b` -/
  covBy_sup_of_inf_covBy {a b : α} : a ⊓ b ⋖ a → b ⋖ a ⊔ b

{α : Type u_2}
[Lattice α]
[self : IsUpperModularLattice α]
{a b : α}


theorem eq_bot_of_singletons_open {t : TopologicalSpace α} (h : ∀ x, IsOpen[t] {x}) : t = ⊥

{α : Type u_1}
{t : TopologicalSpace α}
(h : ∀ (x : α), IsOpen {x})


lemma iIndepFun.meas_biInter {m : ∀ i, MeasurableSpace (κ i)} {f : ∀ x : ι, Ω → κ x}
    (hf : iIndepFun m f μ) (hs : ∀ i, i ∈ S → MeasurableSet[(m i).comap (f i)] (s i)) :
    μ (⋂ i ∈ S, s i) = ∏ i ∈ S, μ (s i)

{Ω : Type u_1}
{ι : Type u_2}
{κ : ι → Type u_5}

∀ {x : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {S : Finset ι} {s : ι → Set Ω}
  {m : (i : ι) → MeasurableSpace (κ i)} {f : (x : ι) → Ω → κ x},
  ProbabilityTheory.iIndepFun m f μ → (∀ i ∈ S, MeasurableSet (s i)) → μ (⋂ i ∈ S, s i) = ∏ i ∈ S, μ (s i)


/-- A general version of the slash action of the space of modular forms. -/
class SlashAction (β G α γ : Type*) [Group G] [AddMonoid α] [SMul γ α] where
  map : β → G → α → α
  zero_slash : ∀ (k : β) (g : G), map k g 0 = 0
  slash_one : ∀ (k : β) (a : α), map k 1 a = a
  slash_mul : ∀ (k : β) (g h : G) (a : α), map k (g * h) a = map k h (map k g a)
  smul_slash : ∀ (k : β) (g : G) (a : α) (z : γ), map k g (z • a) = z • map k g a
  add_slash : ∀ (k : β) (g : G) (a b : α), map k g (a + b) = map k g a + map k g b

{β : Type u_1}
{G : Type u_2}
{α : Type u_3}
{γ : Type u_4}
[Group G]
[AddMonoid α]
[SMul γ α]
[self : SlashAction β G α γ]
(k : β)
(g h : G)
(a : α)

a ∣[k;γ] (g * h) = (a ∣[k;γ] g) ∣[k;γ] h


@[to_additive]
theorem lift_unique (f : WithOne α →* β) : f = lift (f.toMulHom.comp coeMulHom)

{α : Type u}
{β : Type v}
[Mul α]
[MulOneClass β]
(f : WithOne α →* β)

f = WithOne.lift ((↑f).comp WithOne.coeMulHom)


theorem numLeaves_pos (x : Tree α) : 0 < x.numLeaves


theorem mul_charP_coeff_succ [CharP R p] (x : 𝕎 R) (i : ℕ) :
    (x * p).coeff (i + 1) = x.coeff i ^ p

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]
(x : WittVector p R)
(i : ℕ)


theorem _root_.Rat.coe_toNNRat (q : ℚ) (hq : 0 ≤ q) : (q.toNNRat : ℚ) = q


@[simp]
theorem ofCoprodI_of (i : ι) (g : G i) :
    (ofCoprodI (CoprodI.of g) : PushoutI φ) = of i g

{ι : Type u_1}
{G : ι → Type u_2}
{H : Type u_3}
[(i : ι) → Monoid (G i)]
[Monoid H]
{φ : (i : ι) → H →* G i}
(i : ι)
(g : G i)

Monoid.PushoutI.ofCoprodI (Monoid.CoprodI.of g) = (Monoid.PushoutI.of i) g


@[to_additive]
theorem _root_.Group.mulLeft_bijective (a : G) : Function.Bijective (a * ·)


@[simp]
lemma isSemisimple_id [IsSemisimpleModule R M] : IsSemisimple (LinearMap.id : Module.End R M)

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


@[simp]
theorem ofMul_pow [Monoid α] (n : ℕ) (a : α) : ofMul (a ^ n) = n • ofMul a

Additive.ofMul (a ^ n) = n • Additive.ofMul a


protected lemma union (h₁ : Absorbs M s t₁) (h₂ : Absorbs M s t₂) : Absorbs M s (t₁ ∪ t₂)

{M : Type u_1}
{α : Type u_2}
[Bornology M]
[SMul M α]
{s t₁ t₂ : Set α}
(h₁ : Absorbs M s t₁)
(h₂ : Absorbs M s t₂)


/-- The Hausdorff distance is nonnegative. -/
theorem hausdorffDist_nonneg : 0 ≤ hausdorffDist s t

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}


/-- If `F` and `G` are naturally isomorphic functors, then they have equivalent categories of
cocones.
-/
@[simps]
def precomposeEquivalence {G : J ⥤ C} (α : G ≅ F) : Cocone F ≌ Cocone G

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
(α : G ≅ F)

(CategoryTheory.Limits.Cocones.precomposeEquivalence α).unitIso =
  CategoryTheory.NatIso.ofComponents
    (fun s =>
      CategoryTheory.Limits.Cocones.ext (CategoryTheory.Iso.refl ((𝟭 (CategoryTheory.Limits.Cocone F)).obj s).pt) ⋯)
    ⋯


@[to_additive dite_nonneg]
lemma one_le_dite [LE α] (ha : ∀ h, 1 ≤ a h) (hb : ∀ h, 1 ≤ b h) : 1 ≤ dite p a b

{α : Type u_2}
[Zero α]
{p : Prop}
[Decidable p]
{a : p → α}
{b : ¬p → α}
[LE α]
(ha : ∀ (h : p), 0 ≤ a h)
(hb : ∀ (h : ¬p), 0 ≤ b h)


@[simp] lemma preimage_inv (f : Perm α) (s : Set α) : ↑f⁻¹ ⁻¹' s = f '' s

{α : Type u}
(f : Equiv.Perm α)
(s : Set α)


@[simp] theorem tendsto_principal {f : α → β} {l : Filter α} {s : Set β} :
    Tendsto f l (𝓟 s) ↔ ∀ᶠ a in l, f a ∈ s

{α : Type u}
{β : Type v}
{f : α → β}
{l : Filter α}
{s : Set β}

Filter.Tendsto f l (𝓟 s) ↔ ∀ᶠ (a : α) in l, f a ∈ s


theorem sOppSide_iff_exists_right {s : AffineSubspace R P} {x y p₂ : P} (h : p₂ ∈ s) :
    s.SOppSide x y ↔ x ∉ s ∧ y ∉ s ∧ ∃ p₁ ∈ s, SameRay R (x -ᵥ p₁) (p₂ -ᵥ y)

{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 y p₂ : P}
(h : p₂ ∈ s)


theorem not_sameRay_iff_abs_lt_norm_sub : ¬SameRay ℝ x y ↔ |‖x‖ - ‖y‖| < ‖x - y‖

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y : E}


/-- Change a cone on `F : Jᵒᵖ ⥤ Cᵒᵖ` into a cocone on `F.unop : J ⥤ C`. -/
@[simps]
def coconeUnopOfCone (c : Cone F) : Cocone F.unop

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

(CategoryTheory.Limits.coconeUnopOfCone c).pt = Opposite.unop c.pt


/-- A oplax monoidal functor is a functor `F : C ⥤ D` between monoidal categories,
equipped with morphisms `η : F.obj (𝟙_ C) ⟶ 𝟙 _D` and `δ X Y : F.obj (X ⊗ Y) ⟶ F.obj X ⊗ F.obj Y`,
satisfying the appropriate coherences. -/
structure OplaxMonoidalFunctor extends C ⥤ D where
  /-- counit morphism -/
  η : obj (𝟙_ C) ⟶ 𝟙_ D
  /-- cotensorator -/
  δ : ∀ X Y : C, obj (X ⊗ Y) ⟶ obj X ⊗ obj Y
  δ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      δ X X' ≫ map f ▷ obj X' = map (f ▷ X') ≫ δ Y X' := by
    aesop_cat
  δ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      δ X' X ≫ obj X' ◁ map f = map (X' ◁ f) ≫ δ X' Y := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      δ (X ⊗ Y) Z ≫ δ X Y ▷ obj Z ≫ (α_ (obj X) (obj Y) (obj Z)).hom =
        map (α_ X Y Z).hom ≫ δ X (Y ⊗ Z) ≫ obj X ◁ δ Y Z := by
    aesop_cat
  -- unitality
  left_unitality : ∀ X : C, (λ_ (obj X)).inv = map (λ_ X).inv ≫ δ (𝟙_ C) X ≫ η ▷ obj X := by
    aesop_cat
  right_unitality : ∀ X : C, (ρ_ (obj X)).inv = map (ρ_ X).inv ≫ δ X (𝟙_ C) ≫ obj X ◁ η := by
    aesop_cat

(self : CategoryTheory.OplaxMonoidalFunctor C D)

self.δ (CategoryTheory.MonoidalCategory.tensorObj X Y) Z ≫
    CategoryTheory.MonoidalCategory.whiskerRight (self.δ X Y) (self.obj Z) ≫
      (CategoryTheory.MonoidalCategory.associator (self.obj X) (self.obj Y) (self.obj Z)).hom =
  self.map (CategoryTheory.MonoidalCategory.associator X Y Z).hom ≫
    self.δ X (CategoryTheory.MonoidalCategory.tensorObj Y Z) ≫
      CategoryTheory.MonoidalCategory.whiskerLeft (self.obj X) (self.δ Y Z)


@[simp]
theorem length_support {u v : V} (p : G.Walk u v) : p.support.length = p.length + 1

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)


theorem setIntegral_condexpIndSMul (hs : MeasurableSet[m] s) (ht : MeasurableSet t)
    (hμs : μ s ≠ ∞) (hμt : μ t ≠ ∞) (x : G') :
    ∫ a in s, (condexpIndSMul hm ht hμt x) a ∂μ = (μ (t ∩ s)).toReal • x

{α : Type u_1}
{G' : Type u_6}
[NormedAddCommGroup G']
[NormedSpace ℝ G']
[CompleteSpace G']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
{hm : m ≤ m0}
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(hμs : μ s ≠ ⊤)
(hμt : μ t ≠ ⊤)
(x : G')

∫ (a : α) in s, ↑↑(MeasureTheory.condexpIndSMul hm ht hμt x) a ∂μ = (μ (t ∩ s)).toReal • x


theorem isNat_rpow_pos {a b : ℝ} {nb ne : ℕ}
    (pb : IsNat b nb) (pe' : IsNat (a ^ nb) ne) :
    IsNat (a ^ b) ne

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


theorem comp_iterate_pred_of_pos {n : ℕ} (hn : 0 < n) : f ∘ f^[n.pred] = f^[n]

{α : Type u}
(f : α → α)
{n : ℕ}
(hn : 0 < n)


theorem not_dvd_mul {a b : α} (ha : ¬ p ∣ a) (hb : ¬ p ∣ b) : ¬ p ∣ a * b

{α : Type u_1}
[CommMonoidWithZero α]
{p : α}
(hp : Prime p)
{a b : α}
(ha : ¬p ∣ a)
(hb : ¬p ∣ b)


/-- The pigeonhole principle for finitely many pigeons counted by weight, strict inequality version:
if the total weight of a finite set of pigeons is less than `n • b`, and they are sorted into `n`
pigeonholes, then for some pigeonhole, the total weight of the pigeons in this pigeonhole is less
than `b`. -/
theorem exists_sum_fiber_lt_of_maps_to_of_sum_lt_nsmul (hf : ∀ a ∈ s, f a ∈ t)
    (hb : ∑ x ∈ s, w x < t.card • b) : ∃ y ∈ t, ∑ x ∈ s.filter fun x => f x = y, w x < b

{α : Type u}
{β : Type v}
{M : Type w}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}
{w : α → M}
{b : M}
[LinearOrderedCancelAddCommMonoid M]
(hf : ∀ a ∈ s, f a ∈ t)
(hb : ∑ x ∈ s, w x < t.card • b)

∃ y ∈ t, ∑ x ∈ Finset.filter (fun x => f x = y) s, w x < b


/-- Prefer putting constants to the left of `X`.

This lemma is the loop-avoiding `simp` version of `Polynomial.X_mul`. -/
@[simp]
theorem X_mul_C (r : R) : X * C r = C r * X

Polynomial.X * Polynomial.C r = Polynomial.C r * Polynomial.X


@[reassoc (attr := simp)]
theorem underlyingIso_hom_comp_eq_mk {X Y : C} (f : X ⟶ Y) [Mono f] :
    (underlyingIso f).hom ≫ f = (mk f).arrow

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Subobject.underlyingIso f).hom f =
  (CategoryTheory.Subobject.mk f).arrow


lemma dens_union_add_dens_inter (s t : Finset α) :
    dens (s ∪ t) + dens (s ∩ t) = dens s + dens t

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

(s ∪ t).dens + (s ∩ t).dens = s.dens + t.dens


theorem nhds_bot_basis [TopologicalSpace α] [LinearOrder α] [OrderBot α] [OrderTopology α]
    [Nontrivial α] : (𝓝 ⊥).HasBasis (fun a : α => ⊥ < a) fun a : α => Iio a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderBot α]
[OrderTopology α]
[Nontrivial α]

(𝓝 ⊥).HasBasis (fun a => ⊥ < a) fun a => Set.Iio a


@[to_additive (attr := simp)]
theorem unsym_one [One α] : unsym (1 : αˢʸᵐ) = 1


theorem memℒ1_smul_of_L1_withDensity {f : α → ℝ≥0} (f_meas : Measurable f)
    (u : Lp E 1 (μ.withDensity fun x => f x)) : Memℒp (fun x => f x • u x) 1 μ

(u : ↥(MeasureTheory.Lp E 1 (μ.withDensity fun x => ↑(f x))))

MeasureTheory.Memℒp (fun x => f x • ↑↑u x) 1 μ


lemma top_uniformity : 𝓤[(⊤ : UniformSpace α)] = ⊤


@[simp]
theorem map_nil : (nil : G.Walk u u).map f = nil

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
(f : G →g G')
{u : V}

SimpleGraph.Walk.map f SimpleGraph.Walk.nil = SimpleGraph.Walk.nil


@[simp]
theorem sup_adj : (G₁ ⊔ G₂).Adj a b ↔ G₁.Adj a b ∨ G₂.Adj a b

{V : Type u}
{G : SimpleGraph V}
{G₁ G₂ : G.Subgraph}
{a b : V}


@[simp] lemma sub_τ₂ (φ φ' : S₁ ⟶ S₂) : (φ - φ').τ₂ = φ.τ₂ - φ'.τ₂

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

(φ - φ').τ₂ = φ.τ₂ - φ'.τ₂


/-- A purely inseparable extension has separable degree one. -/
theorem IsPurelyInseparable.sepDegree_eq_one [IsPurelyInseparable F E] :
    sepDegree F E = 1

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[IsPurelyInseparable F E]


@[to_additive]
protected theorem finset_prod {γ} [CommMonoid β] [ContinuousMul β] {U : γ → ι → Ω → β}
    {s : Finset γ} (h : ∀ c ∈ s, ProgMeasurable f (U c)) :
    ProgMeasurable f fun i a => ∏ c ∈ s, U c i a

{U : γ → ι → Ω → β}

(h : ∀ c ∈ s, MeasureTheory.ProgMeasurable f (U c))

MeasureTheory.ProgMeasurable f fun i a => ∏ c ∈ s, U c i a


theorem IsOpen.not_inseparable (hs : IsOpen s) (hx : x ∈ s) (hy : y ∉ s) : ¬(x ~ᵢ y)

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{s : Set X}
(hs : IsOpen s)
(hx : x ∈ s)
(hy : y ∉ s)


theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n

IsPrimePow a ↔ Cardinal.aleph0 ≤ a ∨ ∃ n, a = ↑n ∧ IsPrimePow n


theorem fderiv_const_mul (ha : DifferentiableAt 𝕜 a x) (b : 𝔸) :
    fderiv 𝕜 (fun y => b * a y) x = b • fderiv 𝕜 a x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
(ha : DifferentiableAt 𝕜 a x)
(b : 𝔸)


lemma pow_div_factorial_le_exp (hx : 0 ≤ x) (n : ℕ) : x ^ n / n ! ≤ exp x


/-- The isomorphism between the short complex attached to
two isomorphic distinguished triangles. -/
@[simps!]
def shortComplexOfDistTriangleIsoOfIso {T T' : Triangle C} (e : T ≅ T') (hT : T ∈ distTriang C) :
    shortComplexOfDistTriangle T hT ≅ shortComplexOfDistTriangle T'
      (isomorphic_distinguished _ hT _ e.symm)

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

{T T' : CategoryTheory.Pretriangulated.Triangle C}

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.shortComplexOfDistTriangleIsoOfIso e hT).inv.τ₁ = e.inv.hom₁


theorem _root_.DomMulAct.smul_linearMap_apply (a : S'ᵈᵐᵃ) (f : M →ₛₗ[σ₁₂] M₂) (x : M) :
    (a • f) x = f (DomMulAct.mk.symm a • x)

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


theorem edist_smul_le (s : α) (x y : β) : edist (s • x) (s • y) ≤ ‖s‖₊ • edist x y

{α : Type u_1}
{β : Type u_2}
[SeminormedAddGroup α]
[SeminormedAddGroup β]
[SMulZeroClass α β]
[BoundedSMul α β]
(s : α)
(x y : β)


@[simp]
theorem span_closure {s : Set M} : span R (AddSubmonoid.closure s : Set M) = span R s

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set M}

Submodule.span R ↑(AddSubmonoid.closure s) = Submodule.span R s


theorem swapCore_comm (r a b : α) : swapCore a b r = swapCore b a r

{α : Sort u_1}
[DecidableEq α]
(r a b : α)

Equiv.swapCore a b r = Equiv.swapCore b a r


theorem isAffineOpen_opensRange {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
    [H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f)

[H : AlgebraicGeometry.IsOpenImmersion f]


theorem isCodetector_iff_reflectsIsomorphisms_yoneda_obj (G : C) :
    IsCodetector G ↔ (yoneda.obj G).ReflectsIsomorphisms

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

CategoryTheory.IsCodetector G ↔ (CategoryTheory.yoneda.obj G).ReflectsIsomorphisms


theorem cos_sub_nat_mul_pi (x : ℝ) (n : ℕ) : cos (x - n * π) = (-1) ^ n * cos x

Real.cos (x - ↑n * Real.pi) = (-1) ^ n * Real.cos x


@[simp]
theorem eLpNorm_exponent_top {f : α → F} : eLpNorm f ∞ μ = eLpNormEssSup f μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}

MeasureTheory.eLpNorm f ⊤ μ = MeasureTheory.eLpNormEssSup f μ


@[simp]
theorem measurable_inv_iff₀ {G₀ : Type*} [GroupWithZero G₀] [MeasurableSpace G₀]
    [MeasurableInv G₀] {f : α → G₀} : (Measurable fun x => (f x)⁻¹) ↔ Measurable f

{α : Type u_3}
{m : MeasurableSpace α}
{G₀ : Type u_4}
[GroupWithZero G₀]
[MeasurableSpace G₀]
[MeasurableInv G₀]
{f : α → G₀}


/-- Adjoins a `⊤` and `⊥` to the codomain of a `LatticeHom`. -/
@[simps]
def withTopWithBot' [BoundedOrder β] (f : LatticeHom α β) :
    BoundedLatticeHom (WithTop <| WithBot α) β

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
[BoundedOrder β]
(f : LatticeHom α β)


@[simp, norm_cast]
theorem coe_mem {x : ZFSet.{u}} {A : Class.{u}} : ↑x ∈ A ↔ A x


lemma Injective.comp_exact_iff_exact {i : P →ₗ[R] P'} (h : Injective i) :
    Exact f (i ∘ₗ g) ↔ Exact f g

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
{P' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid P']
[Module R M]
[Module R N]
[Module R P]
[Module R P']
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
{i : P →ₗ[R] P'}
(h : Function.Injective ⇑i)

Function.Exact ⇑f ⇑(i ∘ₗ g) ↔ Function.Exact ⇑f ⇑g


theorem IsNilpotent.neg [Ring R] (h : IsNilpotent x) : IsNilpotent (-x)

{R : Type u_1}
{x : R}
[Ring R]
(h : IsNilpotent x)


theorem toNat_congr {β : Type v} (e : α ≃ β) : toNat #α = toNat #β

Cardinal.toNat (Cardinal.mk α) = Cardinal.toNat (Cardinal.mk β)


@[simp]
lemma binaryRec_zero {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) :
    binaryRec z f 0 = z

(f : (b : Bool) → (n : ℕ) → C n → C (Nat.bit b n))


@[to_additive]
theorem map_strictMono_of_injective : StrictMono (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}
(hf : Function.Injective ⇑f)


theorem natDegree_mul_mirror : (p * p.mirror).natDegree = 2 * p.natDegree

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


@[simp]
theorem coe_nsmulRec : ∀ n, ⇑(nsmulRec n f) = n • ⇑f

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[AddMonoid β]
[BoundedAdd β]
[ContinuousAdd β]
(f : BoundedContinuousFunction α β)
(n : ℕ)


theorem approx_eta {n : ℕ} (x : CofixA F (n + 1)) : x = CofixA.intro (head' x) (children' x)

{F : PFunctor.{u}}
{n : ℕ}
(x : PFunctor.Approx.CofixA F (n + 1))

x = PFunctor.Approx.CofixA.intro (PFunctor.Approx.head' x) (PFunctor.Approx.children' x)


theorem tendsto_nhds_nhds {a b} :
    Tendsto f (𝓝 a) (𝓝 b) ↔ ∀ ε > 0, ∃ δ > 0, ∀ ⦃x⦄, edist x a < δ → edist (f x) b < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
{a : α}
{b : β}

Filter.Tendsto f (𝓝 a) (𝓝 b) ↔ ∀ ε > 0, ∃ δ > 0, ∀ ⦃x : α⦄, edist x a < δ → edist (f x) b < ε


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

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


/-- `HasBinaryBiproduct P Q` expresses the mere existence of a bicone which is
simultaneously a limit and a colimit of the diagram `pair P Q`.
-/
class HasBinaryBiproduct (P Q : C) : Prop where mk' ::
  exists_binary_biproduct : Nonempty (BinaryBiproductData P Q)

[self : CategoryTheory.Limits.HasBinaryBiproduct P Q]

Nonempty (CategoryTheory.Limits.BinaryBiproductData P Q)


theorem normalize_idem (x : α) : normalize (normalize x) = normalize x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(x : α)


theorem not_lt_of_mem_argmin : a ∈ l → m ∈ argmin f l → ¬f a < f m

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[DecidableRel fun x x_1 => x < x_1]
{f : α → β}
{l : List α}
{a m : α}

a ∈ l → m ∈ List.argmin f l → ¬f a < f m


/-- If we apply `prod_extendRight a (σ a)` for all `a : α` in turn,
we get `prod_congrRight σ`. -/
theorem prod_prodExtendRight {α : Type*} [DecidableEq α] (σ : α → Perm β) {l : List α}
    (hl : l.Nodup) (mem_l : ∀ a, a ∈ l) :
    (l.map fun a => prodExtendRight a (σ a)).prod = prodCongrRight σ

{β : Type v}
{α : Type u_1}
[DecidableEq α]
(σ : α → Equiv.Perm β)
{l : List α}
(hl : l.Nodup)
(mem_l : ∀ (a : α), a ∈ l)

(List.map (fun a => Equiv.Perm.prodExtendRight a (σ a)) l).prod = Equiv.prodCongrRight σ


theorem exists_eq_insert_iff_ncard (hs : s.Finite := by toFinite_tac) :
    (∃ a ∉ s, insert a s = t) ↔ s ⊆ t ∧ s.ncard + 1 = t.ncard

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


@[to_additive addEquivOfLocalizations_right_inv_apply]
theorem mulEquivOfLocalizations_right_inv_apply {k : LocalizationMap S P} {x} :
    (f.ofMulEquivOfLocalizations (f.mulEquivOfLocalizations k)).toMap x = k.toMap x

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{k : S.LocalizationMap P}
{x : M}


/--
If the image of an element `m : M` in `MonoidAlgebra R M` belongs the submodule generated by the
closure of some `S : Set M` then `m ∈ closure S`. -/
theorem mem_closure_of_mem_span_closure [Nontrivial R] {m : M} {S : Set M}
    (h : of R M m ∈ span R (Submonoid.closure (of R M '' S) : Set (MonoidAlgebra R M))) :
    m ∈ closure S

(h : (MonoidAlgebra.of R M) m ∈ Submodule.span R ↑(Submonoid.closure (⇑(MonoidAlgebra.of R M) '' S)))


theorem trans_assoc (e'' : PartialHomeomorph Z Z') :
    (e.trans e').trans e'' = e.trans (e'.trans e'')

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
{Z' : Type u_6}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace Z']
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)
(e'' : PartialHomeomorph Z Z')


theorem bot_eq_zero {B : C} : (⊥ : Subobject B) = Subobject.mk (0 : 0 ⟶ B)


theorem sOppSide_vadd_left_iff {s : AffineSubspace R P} {x y : P} {v : V} (hv : v ∈ s.direction) :
    s.SOppSide (v +ᵥ x) y ↔ s.SOppSide x y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
{v : V}
(hv : v ∈ s.direction)


@[to_additive]
theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M}
    (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) :
    ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i ∈ s, f i y

(hf : LocallyFinite fun i => Function.mulSupport (f i))

∃ s, ∀ᶠ (y : X) in 𝓝 x, ∏ᶠ (i : ι), f i y = ∏ i ∈ s, f i y


/-- The "grid-lines lemma" (not a standard name), stated with a general parameter `p` as the
exponent.  Compare with `lintegral_prod_lintegral_pow_le`.

For any finite dependent product `Π i : ι, A i` of sigma-finite measure spaces, for any
nonnegative real number `p` such that `(#ι - 1) * p ≤ 1`, for any function `f` from `Π i, A i` into
the extended nonnegative reals, we consider an associated "grid-lines quantity", the integral of an
associated function from `Π i, A i` into the extended nonnegative reals.  The value of this function
at `x : Π i, A i` is obtained by multiplying a certain power of `f` with the product, for each
co-ordinate `i`, of a certain power of the integral of `f` along the "grid line" in the `i`
direction through `x`.

This lemma bounds the Lebesgue integral of the grid-lines quantity by a power of the Lebesgue
integral of `f`. -/
theorem lintegral_mul_prod_lintegral_pow_le {p : ℝ} (hp₀ : 0 ≤ p)
    (hp : (#ι - 1 : ℝ) * p ≤ 1) {f : (∀ i : ι, A i) → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ x, f x ^ (1 - (#ι - 1 : ℝ) * p) * ∏ i, (∫⁻ xᵢ, f (update x i xᵢ) ∂μ i) ^ p ∂.pi μ
    ≤ (∫⁻ x, f x ∂.pi μ) ^ (1 + p)

(μ : (i : ι) → MeasureTheory.Measure (A i))

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

∫⁻ (x : (i : ι) → A i),
    f x ^ (1 - (↑#ι - 1) * p) *
      ∏ i : ι, (∫⁻ (xᵢ : A i), f (Function.update x i xᵢ) ∂μ i) ^ p ∂MeasureTheory.Measure.pi μ ≤
  (∫⁻ (x : (i : ι) → A i), f x ∂MeasureTheory.Measure.pi μ) ^ (1 + p)


@[deprecated Nodup.get_inj_iff (since := "2023-01-10")]
theorem Nodup.nthLe_inj_iff {l : List α} (h : Nodup l) {i j : ℕ} (hi : i < l.length)
    (hj : j < l.length) : l.nthLe i hi = l.nthLe j hj ↔ i = j

{α : Type u}
{l : List α}
(h : l.Nodup)
{i j : ℕ}
(hi : i < l.length)
(hj : j < l.length)


@[simp] lemma Even.one_add (h : Even a) : Odd (1 + a)

{α : Type u_2}
[Semiring α]
{a : α}
(h : Even a)


@[to_additive]
theorem smul_iUnion (s : Set α) (t : ι → Set β) : (s • ⋃ i, t i) = ⋃ i, s • t i

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
[SMul α β]
(s : Set α)
(t : ι → Set β)


@[simp] theorem getLast_append {a : α} : ∀ (l : List α) h, getLast (l ++ [a]) h = a


@[simp]
theorem card_erase_add_one {a : α} {s : Multiset α} : a ∈ s → card (s.erase a) + 1 = card s

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

a ∈ s → Multiset.card (s.erase a) + 1 = Multiset.card s


/-- Definition of the function on the quotient by a congruence relation `c` induced by a function
    that is constant on `c`'s equivalence classes. -/
@[to_additive (attr := simp) "Definition of the function on the quotient by an additive congruence
relation `c` induced by a function that is constant on `c`'s equivalence classes."]
protected theorem liftOn_coe {β} (c : Con M) (f : M → β) (h : ∀ a b, c a b → f a = f b) (x : M) :
    Con.liftOn (x : c.Quotient) f h = f x

{M : Type u_1}
[Mul M]
{β : Sort u_4}
(c : Con M)
(f : M → β)
(h : ∀ (a b : M), c a b → f a = f b)
(x : M)


/-- A subset `s` is σ-compact iff `s` (with the subspace topology) is a σ-compact space. -/
lemma isSigmaCompact_iff_isSigmaCompact_univ {s : Set X} :
    IsSigmaCompact s ↔ IsSigmaCompact (univ : Set s)

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

IsSigmaCompact s ↔ IsSigmaCompact Set.univ


@[simp]
theorem exists_iff {p : α → Prop} : (∃ a, p a) ↔ False

{α : Sort u_1}
[IsEmpty α]
{p : α → Prop}


@[to_additive]
lemma mem_stabilizer_finset' {s : Finset α} : a ∈ stabilizer G s ↔ ∀ ⦃b⦄, b ∈ s → a • b ∈ s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
{a : G}
[DecidableEq α]
{s : Finset α}

a ∈ AddAction.stabilizer G s ↔ ∀ ⦃b : α⦄, b ∈ s → a +ᵥ b ∈ s


@[reassoc]
lemma mapLeftHomologyIso_inv_naturality [S₁.HasLeftHomology] [S₂.HasLeftHomology]
    [F.PreservesLeftHomologyOf S₁] [F.PreservesLeftHomologyOf S₂] :
    F.map (leftHomologyMap φ) ≫ (S₂.mapLeftHomologyIso F).inv =
      (S₁.mapLeftHomologyIso F).inv ≫ leftHomologyMap (F.mapShortComplex.map φ)

CategoryTheory.CategoryStruct.comp (F.map (CategoryTheory.ShortComplex.leftHomologyMap φ))
    (S₂.mapLeftHomologyIso F).inv =
  CategoryTheory.CategoryStruct.comp (S₁.mapLeftHomologyIso F).inv
    (CategoryTheory.ShortComplex.leftHomologyMap (F.mapShortComplex.map φ))


@[to_additive (attr := mono)]
theorem hasProd_strict_mono (hf : HasProd f a₁) (hg : HasProd g a₂) (h : f < g) : a₁ < a₂

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
[OrderClosedTopology α]
{f g : ι → α}
{a₁ a₂ : α}
(hf : HasSum f a₁)
(hg : HasSum g a₂)
(h : f < g)


/-- A projective module with a discrete type of generator is flat -/
lemma of_projective_surjective (ι : Type w) [Projective R M] (p : (ι →₀ R) →ₗ[R] M)
    (hp : Surjective p) : Flat R M

(R : Type u)
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]
(ι : Type w)
[Module.Projective R M]
(p : (ι →₀ R) →ₗ[R] M)
(hp : Function.Surjective ⇑p)


/-- The counit isomorphism of the auto-equivalence of categories `triangleRotation C` of
`Triangle C` given by the rotation of triangles. -/
@[simps!]
def invRotCompRot : invRotate C ⋙ rotate C ≅ 𝟭 (Triangle C)

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

(X : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.invRotCompRot.inv.app X).hom₁ = 𝟙 X.obj₁


protected theorem coe_sub {R : Type u} {A : Type v} [CommRing R] [Ring A] [Algebra R A]
    {S : NonUnitalSubalgebra R A} (x y : S) : (↑(x - y) : A) = ↑x - ↑y

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
{S : NonUnitalSubalgebra R A}
(x y : ↥S)


@[to_additive]
theorem Finite.toFinset_smul (hs : s.Finite) (ht : t.Finite) (hf := hs.smul ht) :
    hf.toFinset = hs.toFinset • ht.toFinset

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
[DecidableEq β]
{s : Set α}
{t : Set β}
(hs : s.Finite)
(ht : t.Finite)
(hf : (s +ᵥ t).Finite := ⋯)

Set.Finite.toFinset hf = hs.toFinset +ᵥ ht.toFinset


/-- **Jensen's inequality**, strict version: if an integrable function `f : α → E` takes values in a
convex closed set `s`, and `g : E → ℝ` is continuous and strictly concave on `s`, then
either `f` is a.e. equal to its average value, or `⨍ x, g (f x) ∂μ < g (⨍ x, f x ∂μ)`. -/
theorem StrictConcaveOn.ae_eq_const_or_lt_map_average [IsFiniteMeasure μ]
    (hg : StrictConcaveOn ℝ s g) (hgc : ContinuousOn g s) (hsc : IsClosed s)
    (hfs : ∀ᵐ x ∂μ, f x ∈ s) (hfi : Integrable f μ) (hgi : Integrable (g ∘ f) μ) :
    f =ᵐ[μ] const α (⨍ x, f x ∂μ) ∨ (⨍ x, g (f x) ∂μ) < g (⨍ x, f x ∂μ)

(hgi : MeasureTheory.Integrable (g ∘ f) μ)

f =ᵐ[μ] Function.const α (⨍ (x : α), f x ∂μ) ∨ ⨍ (x : α), g (f x) ∂μ < g (⨍ (x : α), f x ∂μ)


/-- `pb.liftEquiv'` states that elements of the root set of the minimal
polynomial of `pb.gen` correspond to maps sending `pb.gen` to that root. -/
@[simps! (config := .asFn)]
noncomputable def liftEquiv' (pb : PowerBasis A S) :
    (S →ₐ[A] B) ≃ { y : B // y ∈ (minpoly A pb.gen).aroots B }

{S : Type u_2}
[Ring S]
{A : Type u_4}
{B : Type u_5}
[CommRing A]
[CommRing B]
[IsDomain B]
[Algebra A B]
[Algebra A S]
(pb : PowerBasis A S)

∀ (a : S →ₐ[A] B), ↑(pb.liftEquiv' a) = a pb.gen


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

{R : Type u}
[Monoid R]
{A : Type v}
{B : Type w}
{C : Type w₁}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R B]
[DistribMulAction R C]
(f : (A →ₙₐ[R] B) × (A →ₙₐ[R] C))

NonUnitalAlgHom.prodEquiv f = f.1.prod f.2


theorem Scheme.restrictFunctor_map_app {U V : X.Opens} (i : U ⟶ V) (W : Opens V) :
    (X.restrictFunctor.map i).1.app W =
      X.presheaf.map (homOfLE <| X.restrictFunctor_map_app_aux i W).op

{X : AlgebraicGeometry.Scheme}
{U V : X.Opens}
(i : U ⟶ V)
(W : (↑V).Opens)

AlgebraicGeometry.Scheme.Hom.app (X.restrictFunctor.map i).left W = X.presheaf.map (CategoryTheory.homOfLE ⋯).op


theorem det_eq_det_toMatrix_of_finset [DecidableEq M] {s : Finset M} (b : Basis s A M)
    (f : M →ₗ[A] M) : LinearMap.det f = Matrix.det (LinearMap.toMatrix b b f)

{M : Type u_2}
[AddCommGroup M]
{A : Type u_5}
[CommRing A]
[Module A M]
[DecidableEq M]
{s : Finset M}
(b : Basis { x // x ∈ s } A M)
(f : M →ₗ[A] M)

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


@[simp]
theorem nndist_left_lineMap (p₁ p₂ : P) (c : 𝕜) :
    nndist p₁ (lineMap p₁ p₂ c) = ‖c‖₊ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

nndist p₁ ((AffineMap.lineMap p₁ p₂) c) = ‖c‖₊ * nndist p₁ p₂


/-- A sieve induces a presheaf. -/
@[simps]
def functor (S : Sieve X) : Cᵒᵖ ⥤ Type v₁

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

∀ {X_1 Y : Cᵒᵖ} (f : X_1 ⟶ Y) (g : { g // S.arrows g }),
  ↑(S.functor.map f g) = CategoryTheory.CategoryStruct.comp f.unop ↑g


theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) :
    DifferentiableOn ℝ (fun x => ⟪f x, g x⟫) s

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
{s : Set G}
(hf : DifferentiableOn ℝ f s)
(hg : DifferentiableOn ℝ g s)

DifferentiableOn ℝ (fun x => ⟪f x, g x⟫_𝕜) s


lemma HasBasis.blimsup_eq_iInf_iSup {p : ι → Prop} {s : ι → Set β} {f : Filter β} {u : β → α}
    (hf : f.HasBasis p s) {q : β → Prop} :
    blimsup u f q = ⨅ (i) (_ : p i), ⨆ a ∈ s i, ⨆ (_ : q a), u a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_4}
[CompleteLattice α]
{p : ι → Prop}
{s : ι → Set β}
{f : Filter β}
{u : β → α}
(hf : f.HasBasis p s)
{q : β → Prop}

Filter.blimsup u f q = ⨅ i, ⨅ (_ : p i), ⨆ a ∈ s i, ⨆ (_ : q a), u a


theorem _root_.locallyFinite_iff_smallSets :
    LocallyFinite f ↔ ∀ x, ∀ᶠ s in (𝓝 x).smallSets, { i | (f i ∩ s).Nonempty }.Finite

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f : ι → Set X}

LocallyFinite f ↔ ∀ (x : X), ∀ᶠ (s : Set X) in (𝓝 x).smallSets, {i | (f i ∩ s).Nonempty}.Finite


/-- `n + 2` points have a `vectorSpan` with dimension at most `n` if
and only if they are not affinely independent. -/
theorem finrank_vectorSpan_le_iff_not_affineIndependent [Fintype ι] (p : ι → P) {n : ℕ}
    (hc : Fintype.card ι = n + 2) :
    finrank k (vectorSpan k (Set.range p)) ≤ n ↔ ¬AffineIndependent k p

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[Fintype ι]
(p : ι → P)
{n : ℕ}
(hc : Fintype.card ι = n + 2)

FiniteDimensional.finrank k ↥(vectorSpan k (Set.range p)) ≤ n ↔ ¬AffineIndependent k p


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X (c.prev i) ⟶ K.X i ⟶ K.X (c.next i)`. -/
@[simps!]
noncomputable def shortComplexFunctor (i : ι)

((HomologicalComplex.shortComplexFunctor C c i).obj K).X₁ = K.X (c.prev i)


theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I J K : FractionalIdeal S P}


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


@[simp]
theorem coeIdeal_span_singleton (x : R) :
    (↑(Ideal.span {x} : Ideal R) : FractionalIdeal S P) = spanSingleton S (algebraMap R P x)

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
(x : R)

↑(Ideal.span {x}) = FractionalIdeal.spanSingleton S ((algebraMap R P) x)


protected theorem add_lt_add_of_lt_of_le [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)]
    [CovariantClass α α (swap (· + ·)) (· < ·)] (hc : c ≠ ⊤) (hab : a < b) (hcd : c ≤ d) :
    a + c < b + d

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

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


@[simp, norm_cast]
theorem mul_apply (f g : CauSeq β abv) (i : ℕ) : (f * g) i = f i * g i

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


lemma pow_eq_zero : ∀ {n}, a ^ n = 0 → a = 0

{M₀ : Type u_2}
[MonoidWithZero M₀]
{a : M₀}
[NoZeroDivisors M₀]
{n : ℕ}


protected theorem Dom.toOption {o : Part α} [Decidable o.Dom] (h : o.Dom) : o.toOption = o.get h

{α : Type u_1}
{o : Part α}
[Decidable o.Dom]
(h : o.Dom)


theorem repeat_comp_rev {α} (a : Fin n → α) :
    Fin.repeat m a ∘ Fin.rev = Fin.repeat m (a ∘ Fin.rev)

{m n : ℕ}
{α : Type u_1}
(a : Fin n → α)


/-- Analogue of `congr_fun h x`,
when `h : f = g` is an equality between morphisms in a concrete category.
-/
theorem congr_hom {X Y : C} {f g : X ⟶ Y} (h : f = g) (x : X) : f x = g x

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.ConcreteCategory C]
{X Y : C}
{f g : X ⟶ Y}
(h : f = g)
(x : (CategoryTheory.forget C).obj X)


/-- If `F` creates limits of shape `J`, and `D` has limits of shape `J`, then
`C` has limits of shape `J`.
-/
theorem hasLimitsOfShape_of_hasLimitsOfShape_createsLimitsOfShape (F : C ⥤ D) [HasLimitsOfShape J D]
    [CreatesLimitsOfShape J F] : HasLimitsOfShape J C


theorem Set.Finite.measurableSet_sUnion {s : Set (Set α)} (hs : s.Finite)
    (h : ∀ t ∈ s, MeasurableSet t) : MeasurableSet (⋃₀ s)

{α : Type u_1}
{m : MeasurableSpace α}
{s : Set (Set α)}
(hs : s.Finite)
(h : ∀ t ∈ s, MeasurableSet t)


theorem casesOn'_none_coe (f : Option α → β) (o : Option α) :
    casesOn' o (f none) (f ∘ (fun a ↦ ↑a)) = f o

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

o.casesOn' (f none) (f ∘ fun a => some a) = f o


/-- A vector lies in the `vectorSpan` of two points if and only if it is a multiple of their
difference (reversed). -/
theorem mem_vectorSpan_pair_rev {p₁ p₂ : P} {v : V} :
    v ∈ vectorSpan k ({p₁, p₂} : Set P) ↔ ∃ r : k, r • (p₂ -ᵥ p₁) = v

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ : P}
{v : V}

v ∈ vectorSpan k {p₁, p₂} ↔ ∃ r, r • (p₂ -ᵥ p₁) = v


theorem disjoint_coe : Disjoint (I : WithBot (Box ι)) J ↔ Disjoint (I : Set (ι → ℝ)) J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}


theorem tendsto_star (a : R) : Tendsto star (𝓝 a) (𝓝 (star a))

{R : Type u_2}
[TopologicalSpace R]
[Star R]
[ContinuousStar R]
(a : R)


theorem Nat.succ_pos (n : Nat) : LT.lt 0 (succ n)


theorem differentiableWithinAt_congr_set' (y : E) (h : s =ᶠ[𝓝[{y}ᶜ] x] t) :
    DifferentiableWithinAt 𝕜 f s x ↔ DifferentiableWithinAt 𝕜 f t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s t : Set E}
(y : E)
(h : s =ᶠ[𝓝[{y}ᶜ] x] t)


lemma normalClosure_le_iff {K' : IntermediateField F L} :
    normalClosure F K L ≤ K' ↔ ∀ f : K →ₐ[F] L, f.fieldRange ≤ K'

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

normalClosure F K L ≤ K' ↔ ∀ (f : K →ₐ[F] L), f.fieldRange ≤ K'


theorem isPredLimit_of_dense [DenselyOrdered α] (a : α) : IsPredLimit a

{α : Type u_1}
[LT α]
[DenselyOrdered α]
(a : α)


/-- A monotone function remains monotone when composed with the partial application
of a covariant operator. E.g., `∀ (m : ℕ), Monotone f → Monotone (fun n ↦ f (m + n))`. -/
theorem Monotone.covariant_of_const [CovariantClass M N μ (· ≤ ·)] (hf : Monotone f) (m : M) :
    Monotone (f <| μ m ·)

[CovariantClass M N μ fun x x_1 => x ≤ x_1]


/-- Assumes left covariance.
The lemma assuming right covariance is `Right.one_lt_mul`. -/
@[to_additive Left.add_pos "Assumes left covariance.
The lemma assuming right covariance is `Right.add_pos`."]
theorem Left.one_lt_mul [CovariantClass α α (· * ·) (· < ·)] {a b : α} (ha : 1 < a) (hb : 1 < b) :
    1 < a * b

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


@[simp]
theorem sub_fst : (x - y).fst = x.fst - y.fst

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
[AddCommGroup α]
[AddCommGroup β]
(x y : WithLp p (α × β))


@[to_additive (attr := simp)]
theorem restrict_range (f : G →* N) : (f.restrict K).range = K.map f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(K : Subgroup G)
(f : G →* N)


@[to_additive (attr := simp)]
theorem univ_mul (ht : t.Nonempty) : (univ : Set α) * t = univ

{α : Type u_2}
[AddGroup α]
{t : Set α}
(ht : t.Nonempty)


/-- The functor `Group ⥤ AddGroup` by sending `X ↦ additive X` and `f ↦ f`.
-/
@[simps]
def toAddGrp : Grp ⥤ AddGrp

Grp.toAddGrp.obj X = AddGrp.of (Additive ↑X)


/-- A decreasing intersection distributes over finite union. -/
theorem iInter_iUnion_of_antitone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [IsDirected ι' (· ≤ ·)]
    [Nonempty ι'] {s : ι → ι' → Set α} (hs : ∀ i, Antitone (s i)) :
    ⋂ j : ι', ⋃ i : ι, s i j = ⋃ i : ι, ⋂ j : ι', s i j

{ι : Type u_1}
{ι' : Type u_2}
{α : Type u_3}
[Finite ι]
[Preorder ι']
[IsDirected ι' fun x x_1 => x ≤ x_1]
[Nonempty ι']
{s : ι → ι' → Set α}
(hs : ∀ (i : ι), Antitone (s i))


@[simp]
theorem exp_pi_mul_I : exp (π * I) = -1


@[fun_prop]
protected theorem hasStrictFDerivAt : HasStrictFDerivAt iso (iso : E →L[𝕜] F) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
(iso : E ≃ₗᵢ[𝕜] F)

HasStrictFDerivAt (⇑iso) (↑{ toLinearEquiv := iso.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }) x


/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G)

{H : Type u_1}
[TopologicalSpace H]
(G : StructureGroupoid H)
[ClosedUnderRestriction G]


lemma exists_sUnion {S : Set (Set α)} {p : α → Prop} :
    (∃ x ∈ ⋃₀ S, p x) ↔ ∃ s ∈ S, ∃ x ∈ s, p x

{α : Type u_1}
{S : Set (Set α)}
{p : α → Prop}


theorem eq_of_fin_equiv {n m : ℕ} : ((Fin n → R) ≃ₗ[R] Fin m → R) → n = m

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


/-- The elements of the subsemiring closure of `M` are exactly the elements of the additive closure
of a multiplicative submonoid `M`. -/
theorem coe_closure_eq (s : Set R) :
    (closure s : Set R) = AddSubmonoid.closure (Submonoid.closure s : Set R)

{R : Type u}
[NonAssocSemiring R]
(s : Set R)

↑(Subsemiring.closure s) = ↑(AddSubmonoid.closure ↑(Submonoid.closure s))


theorem isBigO_cocompact_zpow [ProperSpace E] (k : ℤ) :
    f =O[cocompact E] fun x => ‖x‖ ^ k

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : SchwartzMap E F)
[ProperSpace E]
(k : ℤ)

⇑f =O[Filter.cocompact E] fun x => ‖x‖ ^ k


theorem hasSum_integral_iUnion_ae {ι : Type*} [Countable ι] {s : ι → Set X}
    (hm : ∀ i, NullMeasurableSet (s i) μ) (hd : Pairwise (AEDisjoint μ on s))
    (hfi : IntegrableOn f (⋃ i, s i) μ) :
    HasSum (fun n => ∫ x in s n, f x ∂μ) (∫ x in ⋃ n, s n, f x ∂μ)

(hm : ∀ (i : ι), MeasureTheory.NullMeasurableSet (s i) μ)

(hd : Pairwise (MeasureTheory.AEDisjoint μ on s))

(hfi : MeasureTheory.IntegrableOn f (⋃ i, s i) μ)

HasSum (fun n => ∫ (x : X) in s n, f x ∂μ) (∫ (x : X) in ⋃ n, s n, f x ∂μ)


@[simp]
theorem toIcoMod_add_zsmul' (a b : α) (m : ℤ) :
    toIcoMod hp (a + m • p) b = toIcoMod hp a b + m • p

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


@[simp]
theorem unop_bot : (⊥ : Subring Rᵐᵒᵖ).unop = ⊥


theorem IsChain.mono_rel {r' : α → α → Prop} (h : IsChain r s) (h_imp : ∀ x y, r x y → r' x y) :
    IsChain r' s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{r' : α → α → Prop}
(h : IsChain r s)
(h_imp : ∀ (x y : α), r x y → r' x y)


lemma WCovBy.of_le_of_le (hac : a ⩿ c) (hab : a ≤ b) (hbc : b ≤ c) : b ⩿ c

{α : Type u_1}
[Preorder α]
{a b c : α}
(hac : a ⩿ c)
(hab : a ≤ b)
(hbc : b ≤ c)


theorem min_left_commutative : LeftCommutative (min : α → α → α)


theorem support_subset_iff {s : Set α} {f : α →₀ M} :
    ↑f.support ⊆ s ↔ ∀ a ∉ s, f a = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
{s : Set α}
{f : α →₀ M}


/-- The short complex in `D` obtained by applying a functor `F : C ⥤ D` to a
short complex in `C`, assuming that `F` preserves zero morphisms. -/
@[simps]
def map (F : C ⥤ D) [F.PreservesZeroMorphisms] : ShortComplex D


theorem sumElim_inr {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : β) :
    sumElim f g (Sum.inr x) = g x

{α : Type u_13}
{β : Type u_14}
{γ : Type u_15}
[Zero γ]
(f : α →₀ γ)
(g : β →₀ γ)
(x : β)


@[simp]
theorem toMon_forget : toMon_ C ⋙ Mon_.forget C = forget C

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

Bimon_.toMon_ C ⋙ Mon_.forget C = Bimon_.forget C


lemma overEquiv_pullback {X : C} {Y₁ Y₂ : Over X} (f : Y₁ ⟶ Y₂) (S : Sieve Y₂) :
    overEquiv _ (S.pullback f) = (overEquiv _ S).pullback f.left

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

(CategoryTheory.Sieve.overEquiv Y₁) (CategoryTheory.Sieve.pullback f S) =
  CategoryTheory.Sieve.pullback f.left ((CategoryTheory.Sieve.overEquiv Y₂) S)


/-- Alias of `Nat.cast_inj`, specialized to `Ordinal` --/
theorem natCast_inj {m n : ℕ} : (m : Ordinal) = n ↔ m = n


lemma separatesPoints_continuous_of_t35Space [T35Space X] :
    SeparatesPoints (Continuous : Set (X → ℝ))

{X : Type u}
[TopologicalSpace X]
[T1Space X]
[T35Space X]


@[simp] theorem one_imK : (1 : ℍ[R]).imK = 0


/-- The composition of continuous functions. -/
@[simps!]
def comp (f : β →𝒄 γ) (g : α →𝒄 β) : α →𝒄 γ

{α : Type u}
{β : Type v}
{γ : Type u_3}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
[OmegaCompletePartialOrder γ]
(f : β →𝒄 γ)
(g : α →𝒄 β)


@[simp]
theorem tensorDistribEquiv_tmul (B₁ : BilinForm R M₁) (B₂ : BilinForm R M₂) (m₁ : M₁) (m₂ : M₂)
    (m₁' : M₁) (m₂' : M₂) :
    tensorDistribEquiv R (M₁ := M₁) (M₂ := M₂) (B₁ ⊗ₜ[R] B₂) (m₁ ⊗ₜ m₂) (m₁' ⊗ₜ m₂')
      = B₁ m₁ m₁' * B₂ m₂ m₂'

{R : Type uR}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
[Module.Free R M₁]
[Module.Finite R M₁]
[Module.Free R M₂]
[Module.Finite R M₂]
(B₁ : LinearMap.BilinForm R M₁)
(B₂ : LinearMap.BilinForm R M₂)
(m₁ : M₁)
(m₂ : M₂)
(m₁' : M₁)
(m₂' : M₂)

(((LinearMap.BilinMap.tensorDistribEquiv R) (B₁ ⊗ₜ[R] B₂)) (m₁ ⊗ₜ[R] m₂)) (m₁' ⊗ₜ[R] m₂') = (B₁ m₁) m₁' * (B₂ m₂) m₂'


theorem ContDiffWithinAt.congr (h : ContDiffWithinAt 𝕜 n f s x) (h₁ : ∀ y ∈ s, f₁ y = f y)
    (hx : f₁ x = f x) : ContDiffWithinAt 𝕜 n f₁ s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f f₁ : E → F}
{x : E}
{n : ℕ∞}
(h : ContDiffWithinAt 𝕜 n f s x)
(h₁ : ∀ y ∈ s, f₁ y = f y)
(hx : f₁ x = f x)


theorem erase_append_right [LawfulBEq α] {a : α} {l₁ : List α} (l₂ : List α) (h : a ∉ l₁) :
    (l₁ ++ l₂).erase a = (l₁ ++ l₂.erase a)

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a : α}
{l₁ : List α}
(l₂ : List α)
(h : ¬a ∈ l₁)


/-- Naturality of the `prodComparison` morphism in both arguments. -/
@[reassoc]
theorem prodComparison_natural (f : A ⟶ A') (g : B ⟶ B') :
    F.map (prod.map f g) ≫ prodComparison F A' B' =
      prodComparison F A B ≫ prod.map (F.map f) (F.map g)

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

[CategoryTheory.Limits.HasBinaryProduct (F.obj A') (F.obj B')]

F.map (CategoryTheory.Limits.prod.map f g) ≫ CategoryTheory.Limits.prodComparison F A' B' =
  CategoryTheory.Limits.prodComparison F A B ≫ CategoryTheory.Limits.prod.map (F.map f) (F.map g)


theorem pow_rootMultiplicity_not_dvd {p : R[X]} (p0 : p ≠ 0) (a : R) :
    ¬(X - C a) ^ (rootMultiplicity a p + 1) ∣ p

{R : Type u}
[CommRing R]
{p : R[X]}
(p0 : p ≠ 0)
(a : R)

¬(Polynomial.X - Polynomial.C a) ^ (Polynomial.rootMultiplicity a p + 1) ∣ p


@[to_additive]
theorem setIntegral_eq_tsum' (h : IsFundamentalDomain G s μ) {f : α → E} {t : Set α}
    (hf : IntegrableOn f t μ) : ∫ x in t, f x ∂μ = ∑' g : G, ∫ x in g • t ∩ s, f (g⁻¹ • x) ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

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


@[to_additive]
theorem isComplement'_comm : IsComplement' H K ↔ IsComplement' K H

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}


/-- This ext lemma closes trivial subgoals create when chaining heterobasic ext lemmas. -/
@[ext high]
theorem ext_id (f g : R →ₐ[R] A) : f = g

{R : Type u}
(A : Type v)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(f g : R →ₐ[R] A)


lemma IsUnramified.of_restrictScalars {w : InfinitePlace F} (h : IsUnramified k w) :
    IsUnramified K w

(h : NumberField.InfinitePlace.IsUnramified k w)


lemma orthogonal_eq_bot_iff
    (b₁ : B.IsRefl) (b₂ : (B.restrict W).Nondegenerate) (b₃ : B.Nondegenerate) :
    B.orthogonal W = ⊥ ↔ W = ⊤

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{B : LinearMap.BilinForm K V}
{W : Submodule K V}
(b₁ : B.IsRefl)
(b₂ : (B.restrict W).Nondegenerate)
(b₃ : B.Nondegenerate)


/-- A function on `[a, b]` with the norm of the derivative within `[a, b]`
bounded by `C` satisfies `‖f x - f a‖ ≤ C * (x - a)`, `derivWithin`
version. -/
theorem norm_image_sub_le_of_norm_deriv_le_segment {C : ℝ} (hf : DifferentiableOn ℝ f (Icc a b))
    (bound : ∀ x ∈ Ico a b, ‖derivWithin f (Icc a b) x‖ ≤ C) :
    ∀ x ∈ Icc a b, ‖f x - f a‖ ≤ C * (x - a)

(hf : DifferentiableOn ℝ f (Set.Icc a b))

(bound : ∀ x ∈ Set.Ico a b, ‖derivWithin f (Set.Icc a b) x‖ ≤ C)

x ∈ Set.Icc a b → ‖f x - f a‖ ≤ C * (x - a)


theorem toAddSubgroup_injective : Function.Injective (toAddSubgroup : Subring R → AddSubgroup R)


@[simp, reassoc]
lemma sHomWhiskerLeft_comp (K : C) {L L' L'' : C} (g : L ⟶ L') (g' : L' ⟶ L'') :
    sHomWhiskerLeft K (g ≫ g') = sHomWhiskerLeft K g ≫ sHomWhiskerLeft K g'

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.SimplicialCategory C]
(K : C)
{L L' L'' : C}
(g : L ⟶ L')
(g' : L' ⟶ L'')

CategoryTheory.SimplicialCategory.sHomWhiskerLeft K (g ≫ g') =
  CategoryTheory.SimplicialCategory.sHomWhiskerLeft K g ≫ CategoryTheory.SimplicialCategory.sHomWhiskerLeft K g'


theorem copy_eq (f : LocallyBoundedMap α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

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


@[reassoc (attr := simp)]
lemma singleObjCyclesSelfIso_hom_singleObjOpcyclesSelfIso_hom :
    (singleObjCyclesSelfIso c j A).hom ≫ (singleObjOpcyclesSelfIso c j A).hom =
      ((single C c j).obj A).iCycles j ≫ ((single C c j).obj A).pOpcycles j

(HomologicalComplex.singleObjCyclesSelfIso c j A).hom ≫ (HomologicalComplex.singleObjOpcyclesSelfIso c j A).hom =
  ((HomologicalComplex.single C c j).obj A).iCycles j ≫ ((HomologicalComplex.single C c j).obj A).pOpcycles j


/-- A lax monoidal functor takes monoid objects to monoid objects.

That is, a lax monoidal functor `F : C ⥤ D` induces a functor `Mon_ C ⥤ Mon_ D`.
-/
@[simps]
def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C ⥤ Mon_ D

(F : CategoryTheory.LaxMonoidalFunctor C D)

∀ {X Y : Mon_ C} (f : X ⟶ Y), (F.mapMon.map f).hom = F.map f.hom


/-- A set `s` is Lindelöf if and only if
for every family of closed sets whose intersection avoids `s`,
there exists a countable subfamily whose intersection avoids `s`. -/
theorem isLindelof_iff_countable_subfamily_closed :
    IsLindelof s ↔ ∀ {ι : Type u} (t : ι → Set X),
    (∀ i, IsClosed (t i)) → (s ∩ ⋂ i, t i) = ∅
    → ∃ u : Set ι, u.Countable ∧ (s ∩ ⋂ i ∈ u, t i) = ∅

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

IsLindelof s ↔
  ∀ {ι : Type u} (t : ι → Set X),
    (∀ (i : ι), IsClosed (t i)) → s ∩ ⋂ i, t i = ∅ → ∃ u, u.Countable ∧ s ∩ ⋂ i ∈ u, t i = ∅


theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
    x • vecCons v A = vecCons (x • v) (x • A)

{α : Type u}
{m : ℕ}
{n' : Type uₙ}
[NonUnitalNonAssocSemiring α]
(x : α)
(v : n' → α)
(A : Fin m → n' → α)

x • Matrix.vecCons v A = Matrix.vecCons (x • v) (x • A)


lemma cauchy_inf_uniformSpace {u v : UniformSpace β} {F : Filter β} :
    Cauchy (uniformSpace := u ⊓ v) F ↔
    Cauchy (uniformSpace := u) F ∧ Cauchy (uniformSpace := v) F

{β : Type v}
{u v : UniformSpace β}
{F : Filter β}


@[ext]
theorem Dart.ext (d₁ d₂ : G.Dart) (h : d₁.toProd = d₂.toProd) : d₁ = d₂

{V : Type u_1}
{G : SimpleGraph V}
(d₁ d₂ : G.Dart)
(h : d₁.toProd = d₂.toProd)


protected theorem lt_asymm {a b : Fin n} (h : a < b) : ¬ b < a


/-- Given a particular witness to an element being algebraic over an algebra `R → S`,
We can localize to a submonoid containing the leading coefficient to make it integral.
Explicitly, the map between the localizations will be an integral ring morphism -/
theorem is_integral_localization_at_leadingCoeff {x : S} (p : R[X]) (hp : aeval x p = 0)
    (hM : p.leadingCoeff ∈ M) :
    (map Sₘ (algebraMap R S)
            (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map) :
          Rₘ →+* _).IsIntegralElem
      (algebraMap S Sₘ x)

[IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ]

(IsLocalization.map Sₘ (algebraMap R S) ⋯).IsIntegralElem ((algebraMap S Sₘ) x)


@[simp]
lemma OpenCover.comp_idx_apply {X : Scheme.{u}} {𝓤 𝓥 𝓦 : X.OpenCover}
    (f : 𝓤 ⟶ 𝓥) (g : 𝓥 ⟶ 𝓦) (j : 𝓤.J) :
    (f ≫ g).idx j = g.idx (f.idx j)

{X : AlgebraicGeometry.Scheme}
{𝓤 𝓥 𝓦 : X.OpenCover}
(f : 𝓤 ⟶ 𝓥)
(g : 𝓥 ⟶ 𝓦)
(j : 𝓤.J)


lemma mulSupport_one_add' [AddLeftCancelMonoid R] (f : ι → R) : mulSupport (1 + f) = support f

{ι : Type u_1}
{R : Type u_5}
[One R]
[AddLeftCancelMonoid R]
(f : ι → R)

Function.mulSupport (1 + f) = Function.support f


/-- Auxiliary definition for `AlgebraicGeometry.PresheafedSpace.instHasColimits`.
-/
@[simps]
def colimitCocone (F : J ⥤ PresheafedSpace.{_, _, v} C) : Cocone F

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(AlgebraicGeometry.PresheafedSpace.colimitCocone F).pt = AlgebraicGeometry.PresheafedSpace.colimit F


/-- A monoidal functor induces a monoidal functor between
the categories of `G`-actions within those categories. -/
@[simps!]
def mapAction : MonoidalFunctor (Action V G) (Action W G)

(F : CategoryTheory.MonoidalFunctor V W)

∀ (a : Action V G) (g : ↑G), ((F.mapAction G).obj a).ρ g = F.map (a.ρ g)


theorem total_comp (f : α' → α) :
    Finsupp.total α' M R (v ∘ f) = (Finsupp.total α M R v).comp (lmapDomain R R f)

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α' : Type u_7}
{v : α → M}
(f : α' → α)

Finsupp.total α' M R (v ∘ f) = Finsupp.total α M R v ∘ₗ Finsupp.lmapDomain R R f


/-- Consider a product of `g i (f i)` over a finset.  Suppose `g` is a function such as
`n ↦ (· ^ n)`, which maps a second argument of `1` to `1`. Then if `f` is replaced by the
corresponding multiplicative indicator function, the finset may be replaced by a possibly larger
finset without changing the value of the product. -/
@[to_additive "Consider a sum of `g i (f i)` over a finset.  Suppose `g` is a function such as
`n ↦ (n • ·)`, which maps a second argument of `0` to `0` (or a weighted sum of `f i * h i` or
`f i • h i`, where `f` gives the weights that are multiplied by some other function `h`). Then if
`f` is replaced by the corresponding indicator function, the finset may be replaced by a possibly
larger finset without changing the value of the sum."]
lemma prod_mulIndicator_subset_of_eq_one [One α] (f : ι → α) (g : ι → α → β) {s t : Finset ι}
    (h : s ⊆ t) (hg : ∀ a, g a 1 = 1) :
    ∏ i ∈ t, g i (mulIndicator ↑s f i) = ∏ i ∈ s, g i (f i)

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
[Zero α]
(f : ι → α)
(g : ι → α → β)
{s t : Finset ι}
(h : s ⊆ t)
(hg : ∀ (a : ι), g a 0 = 0)

∑ i ∈ t, g i ((↑s).indicator f i) = ∑ i ∈ s, g i (f i)


/-- The natural transformation `S.opcycles ⟶ S.X₃` for all short complexes `S`. -/
@[simps]
noncomputable def fromOpcyclesNatTrans :
    opcyclesFunctor C ⟶ π₃

(CategoryTheory.ShortComplex.fromOpcyclesNatTrans C).app S = S.fromOpcycles


theorem one_lt_inv_iff : 1 < a⁻¹ ↔ 0 < a ∧ a < 1

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}


/-- `SpectralMapClass F α β` states that `F` is a type of spectral maps.

You should extend this class when you extend `SpectralMap`. -/
class SpectralMapClass (F α β : Type*) [TopologicalSpace α] [TopologicalSpace β]
    [FunLike F α β] : Prop where
  /-- statement that `F` is a type of spectral maps-/
  map_spectral (f : F) : IsSpectralMap f

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[TopologicalSpace α]
[TopologicalSpace β]
[FunLike F α β]
[self : SpectralMapClass F α β]
(f : F)


@[simp]
theorem hasDerivWithinAt_univ : HasDerivWithinAt f f' univ x ↔ HasDerivAt f f' x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}

HasDerivWithinAt f f' Set.univ x ↔ HasDerivAt f f' x


@[simp]
theorem presheafToType_obj {T : Type v} {U : (Opens X)ᵒᵖ} :
    (presheafToType X T).obj U = (U.unop → T)

(X : TopCat)
{T : Type v}
{U : (TopologicalSpace.Opens ↑X)ᵒᵖ}

(X.presheafToType T).obj U = (↥(Opposite.unop U) → T)


@[to_additive]
theorem infinite_mul : (s * t).Infinite ↔ s.Infinite ∧ t.Nonempty ∨ t.Infinite ∧ s.Nonempty

{α : Type u_2}
[Add α]
[IsLeftCancelAdd α]
[IsRightCancelAdd α]
{s t : Set α}

(s + t).Infinite ↔ s.Infinite ∧ t.Nonempty ∨ t.Infinite ∧ s.Nonempty


@[simp, norm_cast]
theorem cast_zneg [AddGroup α] [One α] : ∀ n, ((-n : ZNum) : α) = -n

{α : Type u_1}
[AddGroup α]
[One α]
(n : ZNum)


@[instance]
theorem nhdsWithin_Ioi_nat_neBot (n : ℕ) : (𝓝[>] (n : ℝ≥0∞)).NeBot


theorem SMul.aux_of {R' : Type*} [SMul R' M] (r : R') (m : M) (n : N) :
    SMul.aux r (.of (m, n)) = (r • m) ⊗ₜ[R] n

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
{R' : Type u_10}
[SMul R' M]
(r : R')
(m : M)
(n : N)

(TensorProduct.SMul.aux r) (FreeAddMonoid.of (m, n)) = (r • m) ⊗ₜ[R] n


@[simp]
theorem lsub_typein (o : Ordinal) : lsub.{u, u} (typein ((· < ·) : o.out.α → o.out.α → Prop)) = o

Ordinal.lsub (Ordinal.typein fun x x_1 => x < x_1) = o


theorem mem_notConvergentSeq_iff [Preorder ι] {x : α} :
    x ∈ notConvergentSeq f g n j ↔ ∃ k ≥ j, 1 / (n + 1 : ℝ) < dist (f k x) (g x)

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[MetricSpace β]
{n : ℕ}
{j : ι}
{f : ι → α → β}
{g : α → β}
[Preorder ι]
{x : α}

x ∈ MeasureTheory.Egorov.notConvergentSeq f g n j ↔ ∃ k ≥ j, 1 / (↑n + 1) < dist (f k x) (g x)


/-- The open cover of the glued space given by the glue data. -/
@[simps (config := .lemmasOnly)]
def openCover (D : Scheme.GlueData) : OpenCover D.glued


@[simp]
theorem scanl_cons : scanl f b (a :: l) = [b] ++ scanl f (f b a) l

{α : Type u}
{β : Type v}
{f : β → α → β}
{b : β}
{a : α}
{l : List α}

List.scanl f b (a :: l) = [b] ++ List.scanl f (f b a) l


/-- Compressing a family doesn't change its size. -/
@[simp]
theorem card_compression (u v : α) (s : Finset α) : (𝓒 u v s).card = s.card

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
[DecidableEq α]
(u v : α)
(s : Finset α)


/-- An alternate statement of `LinearMap.map_smul` for when `algebraMap` is more convenient to
work with than `•`. -/
theorem map_algebraMap_mul (f : A →ₗ[R] B) (a : A) (r : R) :
    f (algebraMap R A r * a) = algebraMap R B r * f a

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₗ[R] B)
(a : A)
(r : R)

f ((algebraMap R A) r * a) = (algebraMap R B) r * f a


/-- The function `ζ s - 1 / (s - 1)` tends to `γ` as `s → 1`. -/
theorem _root_.tendsto_riemannZeta_sub_one_div :
    Tendsto (fun s : ℂ ↦ riemannZeta s - 1 / (s - 1)) (𝓝[≠] 1) (𝓝 γ)

Filter.Tendsto (fun s => riemannZeta s - 1 / (s - 1)) (𝓝[≠] 1) (𝓝 ↑γ)


@[simp]
theorem mem_comap {s : NonUnitalSubring S} {f : F} {x : R} : x ∈ s.comap f ↔ f x ∈ s

{F : Type w}
{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{s : NonUnitalSubring S}
{f : F}
{x : R}

x ∈ NonUnitalSubring.comap f s ↔ f x ∈ s


theorem map_pmap {p : α → Prop} (g : β → γ) (f : ∀ a, p a → β) (s) :
    ∀ H, map g (pmap f s H) = pmap (fun a h => g (f a h)) s H

{α : Type u_1}
{β : Type v}
{γ : Type u_2}
{p : α → Prop}
(g : β → γ)
(f : (a : α) → p a → β)
(s : Multiset α)
(H : ∀ a ∈ s, p a)

Multiset.map g (Multiset.pmap f s H) = Multiset.pmap (fun a h => g (f a h)) s H


@[simp] theorem domCongr_support (e : G ≃* H) (f : MonoidAlgebra A G) :
    (domCongr k A e f).support = f.support.map e

(k : Type u₁)
{G : Type u₂}
{H : Type u_1}
[CommSemiring k]
[Monoid G]
[Monoid H]
(A : Type u₃)
[Semiring A]
[Algebra k A]
(e : G ≃* H)
(f : MonoidAlgebra A G)

((MonoidAlgebra.domCongr k A e) f).support = Finset.map (↑e).toEmbedding f.support


theorem single_apply_left {f : α → β} (hf : Function.Injective f) (x z : α) (y : M) :
    single (f x) y (f z) = single x y z

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
{f : α → β}
(hf : Function.Injective f)
(x z : α)
(y : M)

(Finsupp.single (f x) y) (f z) = (Finsupp.single x y) z


theorem re_dotProduct_nonneg {M : Matrix n n 𝕜} (hM : M.PosSemidef) (x : n → 𝕜) :
    0 ≤ RCLike.re (dotProduct (star x) (M *ᵥ x))

{n : Type u_2}
{𝕜 : Type u_4}
[Fintype n]
[RCLike 𝕜]
{M : Matrix n n 𝕜}
(hM : M.PosSemidef)
(x : n → 𝕜)

0 ≤ RCLike.re (Matrix.dotProduct (star x) (M.mulVec x))


/-- A subsemiring is closed under addition. -/
protected theorem add_mem {x y : R} : x ∈ s → y ∈ s → x + y ∈ s

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)
{x y : R}


@[simp]
lemma toFinite_eq_zero_iff [SFinite μ] : μ.toFinite = 0 ↔ μ = 0

{α : Type u_1}
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SFinite μ]


lemma withBot_apply (f : LatticeHom α β) (a : WithBot α) : f.withBot a = a.map f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)
(a : WithBot α)


lemma limsup_add_bot_of_ne_top (h : limsup u f = ⊥) (h' : limsup v f ≠ ⊤) :
    limsup (u + v) f = ⊥

{α : Type u_2}
{f : Filter α}
{u v : α → EReal}
(h : Filter.limsup u f = ⊥)
(h' : Filter.limsup v f ≠ ⊤)


theorem isOpen_mono {U P : Submodule R M} (h : U ≤ P) (hU : IsOpen (U : Set M)) :
    IsOpen (P : Set M)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[TopologicalSpace M]
[TopologicalAddGroup M]
[Module R M]
{U P : Submodule R M}
(h : U ≤ P)
(hU : IsOpen ↑U)


@[simp]
lemma inl_fst :
    (inl φ).comp (fst φ).1 (neg_add_self 1) = Cochain.ofHom (𝟙 F)

(CochainComplex.mappingCone.inl φ).comp ↑(CochainComplex.mappingCone.fst φ) ⋯ =
  CochainComplex.HomComplex.Cochain.ofHom (𝟙 F)


@[to_additive]
lemma uniqueMul_of_twoUniqueMul {G} [Mul G] {A B : Finset G} (h : 1 < A.card * B.card →
    ∃ p1 ∈ A ×ˢ B, ∃ p2 ∈ A ×ˢ B, p1 ≠ p2 ∧ UniqueMul A B p1.1 p1.2 ∧ UniqueMul A B p2.1 p2.2)
    (hA : A.Nonempty) (hB : B.Nonempty) : ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b

(h : 1 < A.card * B.card → ∃ p1 ∈ A ×ˢ B, ∃ p2 ∈ A ×ˢ B, p1 ≠ p2 ∧ UniqueAdd A B p1.1 p1.2 ∧ UniqueAdd A B p2.1 p2.2)


@[simp]
theorem quasispectrum.algebraMap_mem_iff (S : Type*) {R A : Type*} [Semifield R] [Field S]
    [NonUnitalRing A] [Algebra R S] [Module S A] [IsScalarTower S A A]
    [SMulCommClass S A A] [Module R A] [IsScalarTower R S A] {a : A} {r : R} :
    algebraMap R S r ∈ quasispectrum S a ↔ r ∈ quasispectrum R a

(S : Type u_3)
{R : Type u_4}
{A : Type u_5}
[Semifield R]
[Field S]
[NonUnitalRing A]
[Algebra R S]
[Module S A]
[IsScalarTower S A A]
[SMulCommClass S A A]
[Module R A]
[IsScalarTower R S A]
{a : A}
{r : R}

(algebraMap R S) r ∈ quasispectrum S a ↔ r ∈ quasispectrum R a


theorem preimage_iInter {f : α → β} {s : ι → Set β} : (f ⁻¹' ⋂ i, s i) = ⋂ i, f ⁻¹' s i

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : α → β}
{s : ι → Set β}


@[reassoc]
theorem whiskerLeft_comm (X : Center C) {Y₁ Y₂ : Center C} (f : Y₁ ⟶ Y₂) (U : C) :
    (X.1 ◁ f.f) ▷ U ≫ ((tensorObj X Y₂).2.β U).hom =
      ((tensorObj X Y₁).2.β U).hom ≫ U ◁ X.1 ◁ f.f

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

(X.fst ◁ f.f) ▷ U ≫ ((X.tensorObj Y₂).snd.β U).hom = ((X.tensorObj Y₁).snd.β U).hom ≫ U ◁ X.fst ◁ f.f


@[measurability]
theorem measurableSet_ball : MeasurableSet (Metric.ball x ε)

{α : Type u_1}
[PseudoMetricSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{x : α}
{ε : ℝ}


@[to_additive]
theorem mulEquivOfLocalizations_symm_eq_mulEquivOfLocalizations {k : LocalizationMap S P} :
    (k.mulEquivOfLocalizations f).symm = f.mulEquivOfLocalizations k

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{k : S.LocalizationMap P}