theorem setOf_isOpen_sup (t₁ t₂ : TopologicalSpace α) :
    { s | IsOpen[t₁ ⊔ t₂] s } = { s | IsOpen[t₁] s } ∩ { s | IsOpen[t₂] s }

{α : Type u}
(t₁ t₂ : TopologicalSpace α)

{s | IsOpen s} = {s | IsOpen s} ∩ {s | IsOpen s}


theorem span_union (s t : Set L) : lieSpan R L (s ∪ t) = lieSpan R L s ⊔ lieSpan R L t

(R : Type u)
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(s t : Set L)

LieSubalgebra.lieSpan R L (s ∪ t) = LieSubalgebra.lieSpan R L s ⊔ LieSubalgebra.lieSpan R L t


theorem Basis.eq_of_subset_indep (hI : M.Basis I X) (hJ : M.Indep J) (hIJ : I ⊆ J) (hJX : J ⊆ X) :
    I = J

{α : Type u_1}
{M : Matroid α}
{I J X : Set α}
(hI : M.Basis I X)
(hJ : M.Indep J)
(hIJ : I ⊆ J)
(hJX : J ⊆ X)


@[to_additive]
theorem mem_map_equiv {f : M ≃* N} {K : Submonoid M} {x : N} :
    x ∈ K.map f.toMonoidHom ↔ f.symm x ∈ K

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{f : M ≃* N}
{K : Submonoid M}
{x : N}

x ∈ Submonoid.map f.toMonoidHom K ↔ f.symm x ∈ K


@[trans]
protected theorem Equiv.trans {x y z : PGame} : (x ≈ y) → (y ≈ z) → (x ≈ z)


@[simp, norm_cast]
theorem smul_apply (a : G) (f : CauSeq β abv) (i : ℕ) : (a • f) i = a • f i

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{G : Type u_3}
[SMul G β]
[IsScalarTower G β β]
(a : G)
(f : CauSeq β abv)
(i : ℕ)


theorem disjoint_conj (h : Perm α) : Disjoint (h * f * h⁻¹) (h * g * h⁻¹) ↔ Disjoint f g

{α : Type u_1}
{f g : Equiv.Perm α}
(h : Equiv.Perm α)

(h * f * h⁻¹).Disjoint (h * g * h⁻¹) ↔ f.Disjoint g


/-- A constructor for bornologies by specifying the bounded sets,
and showing that they satisfy the appropriate conditions. -/
@[simps! cobounded]
def Bornology.ofBounded' {α : Type*} (B : Set (Set α))
    (empty_mem : ∅ ∈ B)
    (subset_mem : ∀ s₁ ∈ B, ∀ s₂ ⊆ s₁, s₂ ∈ B)
    (union_mem : ∀ s₁ ∈ B, ∀ s₂ ∈ B, s₁ ∪ s₂ ∈ B)
    (sUnion_univ : ⋃₀ B = univ) :
    Bornology α

Bornology.cobounded α = Filter.comk (fun x => x ∈ B) empty_mem subset_mem union_mem


theorem integral_prod_mul {L : Type*} [RCLike L] (f : α → L) (g : β → L) :
    ∫ z, f z.1 * g z.2 ∂μ.prod ν = (∫ x, f x ∂μ) * ∫ y, g y ∂ν

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
{L : Type u_8}
[RCLike L]
(f : α → L)
(g : β → L)

∫ (z : α × β), f z.1 * g z.2 ∂μ.prod ν = (∫ (x : α), f x ∂μ) * ∫ (y : β), g y ∂ν


protected theorem IsMin.isBot [IsDirected α (· ≥ ·)] (h : IsMin a) : IsBot a

{α : Type u}
[Preorder α]
{a : α}
[IsDirected α fun x x_1 => x ≥ x_1]
(h : IsMin a)


/-- `WittVector.verschiebung` is a polynomial function. -/
@[is_poly]
theorem verschiebung_isPoly : IsPoly p fun R _Rcr => @verschiebung p R hp _Rcr

WittVector.IsPoly p fun R _Rcr => ⇑WittVector.verschiebung


theorem homEquiv_id (X : C) : adj.homEquiv X _ (𝟙 _) = adj.unit.app X

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

(adj.homEquiv X (F.obj X)) (CategoryTheory.CategoryStruct.id (F.obj X)) = adj.unit.app X


theorem isCoseparator_prod_of_isCoseparator_left (G H : C) [HasBinaryProduct G H]
    (hG : IsCoseparator G) : IsCoseparator (G ⨯ H)


/-- A ring isomorphism preserves addition. -/
protected theorem map_add (e : R ≃+* S) (x y : R) : e (x + y) = e x + e y

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(e : R ≃+* S)
(x y : R)


/-- A `Ctop` realizer for the topological space `T` is a `Ctop`
  which generates `T`. -/
structure Ctop.Realizer (α) [T : TopologicalSpace α] where
  σ : Type*
  F : Ctop α σ
  eq : F.toTopsp = T

{α : Type u_6}
[T : TopologicalSpace α]
(self : Ctop.Realizer α)


theorem le_of_strongLT (h : a ≺ b) : a ≤ b

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → Preorder (π i)]
{a b : (i : ι) → π i}
(h : StrongLT a b)


theorem _root_.MeasurableEmbedding.integrableAtFilter_iff_comap [MeasurableSpace β] {e : α → β}
    (he : MeasurableEmbedding e) {f : β → E} {μ : Measure β} :
    IntegrableAtFilter f (l.map e) μ ↔ IntegrableAtFilter (f ∘ e) l (μ.comap e)

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{l : Filter α}
[MeasurableSpace β]
{e : α → β}
(he : MeasurableEmbedding e)
{f : β → E}
{μ : MeasureTheory.Measure β}

MeasureTheory.IntegrableAtFilter f (Filter.map e l) μ ↔
  MeasureTheory.IntegrableAtFilter (f ∘ e) l (MeasureTheory.Measure.comap e μ)


theorem iff_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ↔ b) = a


theorem _root_.Measurable.lintegral_kernel_prod_left {f : β → α → ℝ≥0∞}
    (hf : Measurable (uncurry f)) : Measurable fun y => ∫⁻ x, f x y ∂κ y

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{f : β → α → ℝ≥0∞}
(hf : Measurable (Function.uncurry f))

Measurable fun y => ∫⁻ (x : β), f x y ∂κ y


theorem smul_eq_map [SMul K β] (k : K) (f : α →ₛ β) : k • f = f.map (k • ·)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{K : Type u_5}
[SMul K β]
(k : K)
(f : MeasureTheory.SimpleFunc α β)

k • f = MeasureTheory.SimpleFunc.map (fun x => k • x) f


@[simp]
theorem countP_add (s t) : countP p (s + t) = countP p s + countP p t

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

Multiset.countP p (s + t) = Multiset.countP p s + Multiset.countP p t


@[simp]
theorem fin_map {n} {s : Finset ℕ} : (s.fin n).map Fin.valEmbedding = s.filter (· < n)

Finset.map Fin.valEmbedding (Finset.fin n s) = Finset.filter (fun x => x < n) s


theorem liftOn_mk {P : Sort v} (p q : K[X]) (f : K[X] → K[X] → P) (f0 : ∀ p, f p 0 = f 0 1)
    (H' : ∀ {p q p' q'} (_hq : q ≠ 0) (_hq' : q' ≠ 0), q' * p = q * p' → f p q = f p' q')
    (H : ∀ {p q p' q'} (_hq : q ∈ K[X]⁰) (_hq' : q' ∈ K[X]⁰), q' * p = q * p' → f p q = f p' q' :=
      fun {p q p' q'} hq hq' h => H' (nonZeroDivisors.ne_zero hq) (nonZeroDivisors.ne_zero hq') h) :
    (RatFunc.mk p q).liftOn f @H = f p q

(H' : ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q')

(H : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q' := ⋯)


theorem eventually_norm_pow_le (a : α) : ∀ᶠ n : ℕ in atTop, ‖a ^ n‖ ≤ ‖a‖ ^ n

{α : Type u_1}
[SeminormedRing α]
(a : α)

∀ᶠ (n : ℕ) in Filter.atTop, ‖a ^ n‖ ≤ ‖a‖ ^ n


@[to_additive (attr := simp)]
theorem orbitRel.Quotient.orbit_mk (a : α) :
    orbitRel.Quotient.orbit (Quotient.mk'' a : orbitRel.Quotient G α) = MulAction.orbit G a

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
(a : α)

MulAction.orbitRel.Quotient.orbit (Quotient.mk'' a) = MulAction.orbit G a


theorem add_coe_eq_top_iff {x : WithTop α} {y : α} : x + y = ⊤ ↔ x = ⊤

{α : Type u}
[Add α]
{x : WithTop α}
{y : α}


theorem blimsup_monotone_filter (h : f ≤ g) : blimsup u f p ≤ blimsup u g p

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

Filter.blimsup u f p ≤ Filter.blimsup u g p


lemma Indep.base_of_ground_subset_closure (hI : M.Indep I) (h : M.E ⊆ M.closure I) : M.Base I

{α : Type u_2}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)
(h : M.E ⊆ M.closure I)


theorem count_strict_mono {m n : ℕ} (hm : p m) (hmn : m < n) : count p m < count p n

{p : ℕ → Prop}
[DecidablePred p]
{m n : ℕ}
(hm : p m)
(hmn : m < n)


/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` is bounded. -/
theorem norm_mul_pow_le_of_lt_radius (p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0}
    (h : (r : ℝ≥0∞) < p.radius) : ∃ C > 0, ∀ n, ‖p n‖ * (r : ℝ) ^ n ≤ C

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


theorem StarConvex.linear_preimage {s : Set F} (f : E →ₗ[𝕜] F) (hs : StarConvex 𝕜 (f x) s) :
    StarConvex 𝕜 x (f ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{x : E}
{s : Set F}
(f : E →ₗ[𝕜] F)
(hs : StarConvex 𝕜 (f x) s)


lemma homologyShiftIso_hom_app (n a a' : ℤ) (ha' : n + a = a') (K : CochainComplex C ℤ) :
    ((homologyFunctor C (ComplexShape.up ℤ) 0).shiftIso n a a' ha').hom.app
      ((quotient _ _).obj K) =
    (homologyFunctor _ _ a).map (((quotient _ _).commShiftIso n).inv.app K) ≫
      (homologyFunctorFactors _ _ a).hom.app (K⟦n⟧) ≫
      ((HomologicalComplex.homologyFunctor _ _ 0).shiftIso n a a' ha').hom.app K ≫
      (homologyFunctorFactors _ _ a').inv.app K

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.CategoryWithHomology C]
(n a a' : ℤ)
(ha' : n + a = a')
(K : CochainComplex C ℤ)

((HomotopyCategory.homologyFunctor C (ComplexShape.up ℤ) 0).shiftIso n a a' ha').hom.app
    ((HomotopyCategory.quotient C (ComplexShape.up ℤ)).obj K) =
  (HomotopyCategory.homologyFunctor C (ComplexShape.up ℤ) a).map
      (((HomotopyCategory.quotient C (ComplexShape.up ℤ)).commShiftIso n).inv.app K) ≫
    (HomotopyCategory.homologyFunctorFactors C (ComplexShape.up ℤ) a).hom.app
        ((CategoryTheory.shiftFunctor (HomologicalComplex C (ComplexShape.up ℤ)) n).obj K) ≫
      ((HomologicalComplex.homologyFunctor C (ComplexShape.up ℤ) 0).shiftIso n a a' ha').hom.app K ≫
        (HomotopyCategory.homologyFunctorFactors C (ComplexShape.up ℤ) a').inv.app K


@[simp]
lemma coe_copy {_ : MulZeroOneClass α} {_ : MulZeroOneClass β} (f : α →*₀ β) (f' : α → β) (h) :
    (f.copy f' h) = f'

∀ {x : MulZeroOneClass α} {x_1 : MulZeroOneClass β} (f : α →*₀ β) (f' : α → β) (h : f' = ⇑f), ⇑(f.copy f' h) = f'


/-- If, for any `a : α`, `β a` is finite, then the cardinality of `WType β`
  is at most the maximum of the cardinality of `α` and `ℵ₀`  -/
theorem cardinal_mk_le_max_aleph0_of_finite [∀ a, Finite (β a)] : #(WType β) ≤ max #α ℵ₀

{α : Type u}
{β : α → Type u}
[∀ (a : α), Finite (β a)]

Cardinal.mk (WType β) ≤ max (Cardinal.mk α) Cardinal.aleph0


/-- If `f` is a locally integrable real-valued function which is `O(x ^ (-a))` at `∞`, then for any
`s < a`, its Mellin transform converges on some neighbourhood of `+∞`. -/
theorem mellin_convergent_top_of_isBigO {f : ℝ → ℝ}
    (hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0)) {a s : ℝ}
    (hf : f =O[atTop] (· ^ (-a))) (hs : s < a) :
    ∃ c : ℝ, 0 < c ∧ IntegrableOn (fun t : ℝ => t ^ (s - 1) * f t) (Ioi c)

(hfc : MeasureTheory.AEStronglyMeasurable f (MeasureTheory.volume.restrict (Set.Ioi 0)))

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

∃ c, 0 < c ∧ MeasureTheory.IntegrableOn (fun t => t ^ (s - 1) * f t) (Set.Ioi c) MeasureTheory.volume


theorem star_eq_adjoint (A : E →L[𝕜] E) : star A = A†

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
(A : E →L[𝕜] E)


protected theorem Balanced.closure (hA : Balanced 𝕜 A) : Balanced 𝕜 (closure A)

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{A : Set E}
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
(hA : Balanced 𝕜 A)


theorem divByMonic_eq_zero_iff [Nontrivial R] (hq : Monic q) : p /ₘ q = 0 ↔ degree p < degree q

{R : Type u}
[Ring R]
{p q : R[X]}
[Nontrivial R]
(hq : q.Monic)


/-- A function is a Schwartz function if it is smooth and all derivatives decay faster than
  any power of `‖x‖`. -/
structure SchwartzMap where
  toFun : E → F
  smooth' : ContDiff ℝ ⊤ toFun
  decay' : ∀ k n : ℕ, ∃ C : ℝ, ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n toFun x‖ ≤ C

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(self : SchwartzMap E F)


/-- The linter message "error: SetLike.GradeZero.coe_mul.{u_3, u_2, u_1} Left-hand side does
  not simplify, when using the simp lemma on itself." is wrong. The LHS does simplify. -/
@[nolint simpNF, simp, norm_cast] theorem coe_mul (a b : A 0) : ↑(a * b) = (↑a * ↑b : R)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[Monoid R]
[AddMonoid ι]
{A : ι → S}
[SetLike.GradedMonoid A]
(a b : ↥(A 0))


theorem ContinuousLinearEquiv.contDiff (f : E ≃L[𝕜] F) : ContDiff 𝕜 n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(f : E ≃L[𝕜] F)


@[simp]
theorem iUnion_Iic_coe_nat : ⋃ n : ℕ, Iic (n : ℝ≥0∞) = {∞}ᶜ


theorem testBit_to_div_mod {x : Nat} : testBit x i = decide (x / 2^i % 2 = 1)

x.testBit i = decide (x / 2 ^ i % 2 = 1)


{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)


@[to_additive]
theorem exponent_eq_max'_orderOf [Fintype G] :
    exponent G = ((@Finset.univ G _).image orderOf).max' ⟨1, by simp⟩

{G : Type u}
[AddCancelCommMonoid G]
[Fintype G]

AddMonoid.exponent G = (Finset.image addOrderOf Finset.univ).max' ⋯


@[measurability]
theorem measurable_sin : Measurable sin


/-- The natural equivalence between continuous linear maps from `M` to `N`
and continuous 1-multilinear alternating maps from `M` to `N`. -/
@[simps! apply_apply symm_apply_apply apply_toContinuousMultilinearMap]
def ofSubsingleton [Subsingleton ι] (i : ι) :
    (M →L[R] N) ≃ M [⋀^ι]→L[R] N

(R : Type u_1)
(M : Type u_2)
(N : Type u_4)
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
[Subsingleton ι]
(i : ι)
(f : M →L[R] N)

((ContinuousAlternatingMap.ofSubsingleton R M N i) f).toContinuousMultilinearMap =
  (ContinuousMultilinearMap.ofSubsingleton R M N i) f


@[simp]
theorem inducing_prod_const {y : Y} {f : X → Z} : (Inducing fun x => (f x, y)) ↔ Inducing f

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{y : Y}
{f : X → Z}


lemma ContinuousOn.finset_inf (hs : ∀ i ∈ s, ContinuousOn (f i) t) :
    ContinuousOn (s.inf f) t

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeInf L]
[OrderTop L]
[ContinuousInf L]
{s : Finset ι}
{f : ι → X → L}
{t : Set X}
(hs : ∀ i ∈ s, ContinuousOn (f i) t)


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

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[VAdd M β]
{m : MeasurableSpace α}
{f : α → M}
{g : α → β}
[MeasurableVAdd₂ M β]
(hf : Measurable f)
(hg : Measurable g)


theorem signBijAux_injOn {n : ℕ} {f : Perm (Fin n)} :
    (finPairsLT n : Set (Σ _, Fin n)).InjOn (signBijAux f)

Set.InjOn f.signBijAux ↑(Equiv.Perm.finPairsLT n)


@[simp]
theorem limit.isLimit_lift {F : J ⥤ C} [HasLimit F] (c : Cone F) :
    (limit.isLimit F).lift c = limit.lift F c

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

(CategoryTheory.Limits.limit.isLimit F).lift c = CategoryTheory.Limits.limit.lift F c


@[simp]
theorem polar_univ : polar 𝕜 (univ : Set E) = {(0 : Dual 𝕜 E)}

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]


protected theorem DirectedOn.disjoint_sSup_left (h : DirectedOn (· ≤ ·) s) :
    Disjoint (sSup s) a ↔ ∀ ⦃b⦄, b ∈ s → Disjoint b a

(h : DirectedOn (fun x x_1 => x ≤ x_1) s)

Disjoint (sSup s) a ↔ ∀ ⦃b : α⦄, b ∈ s → Disjoint b a


theorem ContinuousAt.continuousOn {f : α → β} {s : Set α} (hcont : ∀ x ∈ s, ContinuousAt f x) :
    ContinuousOn f s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
(hcont : ∀ x ∈ s, ContinuousAt f x)


@[simp] protected theorem one : IsSelfAdjoint (1 : R)

(R : Type u_1)
[MulOneClass R]
[StarMul R]


/-- `D : Derivation R A M` is an `R`-linear map from `A` to `M` that satisfies the `leibniz`
equality. We also require that `D 1 = 0`. See `Derivation.mk'` for a constructor that deduces this
assumption from the Leibniz rule when `M` is cancellative.

TODO: update this when bimodules are defined. -/
structure Derivation (R : Type*) (A : Type*) (M : Type*)
    [CommSemiring R] [CommSemiring A] [AddCommMonoid M] [Algebra R A] [Module A M] [Module R M]
    extends A →ₗ[R] M where
  protected map_one_eq_zero' : toLinearMap 1 = 0
  protected leibniz' (a b : A) : toLinearMap (a * b) = a • toLinearMap b + b • toLinearMap a

{R : Type u_1}
{A : Type u_2}
{M : Type u_3}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(self : Derivation R A M)
(a b : A)

↑self (a * b) = a • ↑self b + b • ↑self a


lemma addMap_of_Y_eq {P Q : Fin 3 → F} (hP : W.Nonsingular P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2)
    (hy' : P y * Q z ^ 3 = W.negY Q * P z ^ 3) : W.addMap ⟦P⟧ ⟦Q⟧ = ⟦![1, 1, 0]⟧


/-- The restriction of a Scheme along an open embedding. -/
@[simps! (config := .lemmasOnly) carrier, simps! presheaf_obj]
def Scheme.restrict : Scheme

{f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace}


/-- In a well-founded lattice, any element is the supremum of finitely many sup-irreducible
elements. This is the order-theoretic analogue of prime factorisation. -/
theorem exists_supIrred_decomposition (a : α) :
    ∃ s : Finset α, s.sup id = a ∧ ∀ ⦃b⦄, b ∈ s → SupIrred b

{α : Type u_2}
[SemilatticeSup α]
[OrderBot α]
[WellFoundedLT α]
(a : α)

∃ s, s.sup id = a ∧ ∀ ⦃b : α⦄, b ∈ s → SupIrred b


@[simp]
theorem baseChange_smul : (r • f).baseChange A = r • f.baseChange A

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(r : R)
(f : M →ₗ[R] N)

LinearMap.baseChange A (r • f) = r • LinearMap.baseChange A f


theorem Valid'.right {s l x r o₁ o₂} (H : Valid' o₁ (@Ordnode.node α s l x r) o₂) : Valid' x r o₂

(H : Ordnode.Valid' o₁ (Ordnode.node s l x r) o₂)


theorem Perm.kerase {a : α} {l₁ l₂ : List (Sigma β)} (nd : l₁.NodupKeys) :
    l₁ ~ l₂ → kerase a l₁ ~ kerase a l₂

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

l₁.Perm l₂ → (List.kerase a l₁).Perm (List.kerase a l₂)


theorem of_bot : IsPGroup p (⊥ : Subgroup G)


@[fun_prop]
theorem Differentiable.continuousMultilinear_apply_const (hc : Differentiable 𝕜 c) (u : ∀ i, M i) :
    Differentiable 𝕜 fun y ↦ (c y) u

{c : E → ContinuousMultilinearMap 𝕜 M H}


@[simp] theorem nnnorm_inr (m : M) : ‖(inr m : tsze R M)‖₊ = ‖m‖₊

{R : Type u_3}
{M : Type u_4}
[SeminormedRing R]
[SeminormedAddCommGroup M]
(m : M)


theorem hasDerivAt_rpow_const {x p : ℝ} (h : x ≠ 0 ∨ 1 ≤ p) :
    HasDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x


theorem toHom_injective : @Function.Injective (M ↪[L] N) (M →[L] N) (·.toHom)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]


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

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


theorem AEMeasurable.isGLB {ι} {μ : Measure δ} [Countable ι] {f : ι → δ → α} {g : δ → α}
    (hf : ∀ i, AEMeasurable (f i) μ) (hg : ∀ᵐ b ∂μ, IsGLB { a | ∃ i, f i b = a } (g b)) :
    AEMeasurable g μ

{f : ι → δ → α}

(hg : ∀ᵐ (b : δ) ∂μ, IsGLB {a | ∃ i, f i b = a} (g b))


/-- Variant of Hahn-Banach, eliminating the hypothesis that `x` be nonzero, and choosing
    the dual element arbitrarily when `x = 0`. -/
theorem exists_dual_vector' [Nontrivial E] (x : E) : ∃ g : E →L[𝕜] 𝕜, ‖g‖ = 1 ∧ g x = ‖x‖

(𝕜 : Type v)
[RCLike 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[Nontrivial E]
(x : E)


theorem minFacHelper_3 {n k k' : ℕ} (e : k + 2 = k') (nk : (n % k).beq 0 = false)
    (h : MinFacHelper n k) : MinFacHelper n k'

(h : Mathlib.Meta.NormNum.MinFacHelper n k)


theorem mul_div_le (a b : Ordinal) : b * (a / b) ≤ a


@[simp]
theorem preimage_coe_Ioo : (some : α → WithBot α) ⁻¹' Ioo a b = Ioo a b

WithBot.some ⁻¹' Set.Ioo ↑a ↑b = Set.Ioo a b


/-- `IsTrans X r` means the binary relation `r` on `X` is transitive. -/
class IsTrans (α : Sort u) (r : α → α → Prop) : Prop where
  trans : ∀ a b c, r a b → r b c → r a c

{α : Sort u}
{r : α → α → Prop}
[self : IsTrans α r]
(a b c : α)


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

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


theorem congr_mul (f : M ≃ₗ[R] M) (g : N ≃ₗ[R] N) (f' : M ≃ₗ[R] M) (g' : N ≃ₗ[R] N) :
    congr (f * f') (g * g') = congr f g * congr f' g'

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : M ≃ₗ[R] M)
(g : N ≃ₗ[R] N)
(f' : M ≃ₗ[R] M)
(g' : N ≃ₗ[R] N)

TensorProduct.congr (f * f') (g * g') = TensorProduct.congr f g * TensorProduct.congr f' g'


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

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


@[rclike_simps, norm_cast]
theorem ofReal_natCast (n : ℕ) : ((n : ℝ) : K) = n


theorem chineseRemainderOfFinset_lt_prod {t : Finset ι}
    (hs : ∀ i ∈ t, s i ≠ 0) (pp : Set.Pairwise t (Coprime on s)) :
    chineseRemainderOfFinset a s t hs pp < ∏ i ∈ t, s i

{ι : Type u_1}
(a s : ι → ℕ)
{t : Finset ι}
(hs : ∀ i ∈ t, s i ≠ 0)
(pp : (↑t).Pairwise (Nat.Coprime on s))

↑(Nat.chineseRemainderOfFinset a s t hs pp) < ∏ i ∈ t, s i


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
{X : LeftInvariantDerivation I G}


theorem toSquareBlockProp_def (M : Matrix m m α) (p : m → Prop) :
    -- Porting note: added missing `of`
    toSquareBlockProp M p = of (fun i j : { a // p a } => M ↑i ↑j)

{m : Type u_2}
{α : Type u_12}
(M : Matrix m m α)
(p : m → Prop)

M.toSquareBlockProp p = Matrix.of fun i j => M ↑i ↑j


theorem upperSemicontinuousWithinAt_iInf {f : ι → α → δ}
    (h : ∀ i, UpperSemicontinuousWithinAt (f i) s x) :
    UpperSemicontinuousWithinAt (fun x' => ⨅ i, f i x') s x

{f : ι → α → δ}

(h : ∀ (i : ι), UpperSemicontinuousWithinAt (f i) s x)


@[simp]
theorem add_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f + g) z = f z + g z

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f g : SlashInvariantForm Γ k)
(z : ℍ)


theorem commutator_apply : ⁅X, Y⁆ f = X (Y f) - Y (X f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X Y : LeftInvariantDerivation I G)
(f : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯)


nonrec theorem RingHom.IsIntegral.tower_bot (hg : Function.Injective g)
    (hfg : (g.comp f).IsIntegral) : f.IsIntegral

{R : Type u_1}
{S : Type u_4}
{T : Type u_5}
[CommRing R]
[CommRing S]
[CommRing T]
(f : R →+* S)
(g : S →+* T)
(hg : Function.Injective ⇑g)
(hfg : (g.comp f).IsIntegral)


/-- From a natural transformation `α : F → G` we get a functor from
coalgebras of `F` to coalgebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : F ⟶ G) : Coalgebra F ⥤ Coalgebra G

(V : CategoryTheory.Endofunctor.Coalgebra F)

((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α).obj V).str =
  CategoryTheory.CategoryStruct.comp V.str (α.app V.V)


theorem IsMaxChain.top_mem [LE α] [OrderTop α] (h : IsMaxChain (· ≤ ·) s) : ⊤ ∈ s

(h : IsMaxChain (fun x x_1 => x ≤ x_1) s)


/-- Flipping a square by switching the top-right and the bottom-left objects. -/
@[simps]
def flip (sq : Square C) : Square C

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


theorem erase_ne_self : s.erase a ≠ s ↔ a ∈ s

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


@[simp]
theorem mk_factors_iff {X Y Z : C} (f : Y ⟶ X) [Mono f] (g : Z ⟶ X) :
    (Subobject.mk f).Factors g ↔ (MonoOver.mk' f).Factors g

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

(CategoryTheory.Subobject.mk f).Factors g ↔ (CategoryTheory.MonoOver.mk' f).Factors g


theorem innerRegular_measurable [WeaklyRegular μ] :
    InnerRegularWRT μ IsClosed fun s => MeasurableSet s ∧ μ s ≠ ∞

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.WeaklyRegular]

μ.InnerRegularWRT IsClosed fun s => MeasurableSet s ∧ μ s ≠ ⊤


lemma exp_nmul (x : EReal) (n : ℕ) : exp (n * x) = (exp x) ^ n


theorem zero_def : (0 : PerfectClosure K p) = mk K p (0, 0)

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]


{α : Type u}
{x y : α}
[BooleanAlgebra α]


/-- The first projection within a domain at a point in a product is `C^∞`. -/
theorem contDiffWithinAt_fst {s : Set (E × F)} {p : E × F} :
    ContDiffWithinAt 𝕜 n (Prod.fst : E × F → E) s p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{s : Set (E × F)}
{p : E × F}


theorem _root_.MeasureTheory.Memℒp.ofReal_variance_eq [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
    ENNReal.ofReal (variance X μ) = evariance X μ

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hX : MeasureTheory.Memℒp X 2 μ)

ENNReal.ofReal (ProbabilityTheory.variance X μ) = ProbabilityTheory.evariance X μ


theorem add_mem_Ioo_iff_right : a + b ∈ Set.Ioo c d ↔ b ∈ Set.Ioo (c - a) (d - a)

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


@[simp]
theorem mk_associator_inv : Quot.mk _ (Hom₂.associator_inv f g h) = (α_ f g h).inv

{a b c d : CategoryTheory.FreeBicategory B}

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


@[simp]
theorem map_vadd (f : P →ᴬ[R] Q) (p : P) (v : V) : f (v +ᵥ p) = f.contLinear v +ᵥ f p

{R : Type u_2}
{V : Type u_3}
{W : Type u_4}
{P : Type u_6}
{Q : Type u_7}
[NormedAddCommGroup V]
[MetricSpace P]
[NormedAddTorsor V P]
[NormedAddCommGroup W]
[MetricSpace Q]
[NormedAddTorsor W Q]
[NormedField R]
[NormedSpace R V]
[NormedSpace R W]
(f : P →ᴬ[R] Q)
(p : P)
(v : V)


theorem eps_pow_five_pos (hPε : 100 ≤ (4 : ℝ) ^ P.parts.card * ε ^ 5) : ↑0 < ε ^ 5

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{P : Finpartition Finset.univ}
{ε : ℝ}
(hPε : 100 ≤ 4 ^ P.parts.card * ε ^ 5)


@[simp] theorem getD_some : getD (some a) b = a

∀ {α : Type u_1} {a b : α}, (some a).getD b = a


/-- Extending the domain of Hahn series is a linear map. -/
@[simps]
def embDomainLinearMap (f : Γ ↪o Γ') : HahnSeries Γ R →ₗ[R] HahnSeries Γ' R

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Semiring R]
{Γ' : Type u_4}
[PartialOrder Γ']
(f : Γ ↪o Γ')

∀ (a : HahnSeries Γ R), (HahnSeries.embDomainLinearMap f) a = HahnSeries.embDomain f a


@[to_additive]
theorem map_eq_range_iff {f : G →* N} {H : Subgroup G} :
    H.map f = f.range ↔ Codisjoint H f.ker

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

Subgroup.map f H = f.range ↔ Codisjoint H f.ker


@[simp]
theorem antivaryOn_toDual_right : AntivaryOn f (toDual ∘ g) s ↔ MonovaryOn f g s

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

AntivaryOn f (⇑OrderDual.toDual ∘ g) s ↔ MonovaryOn f g s


@[simp]
theorem mk'_toAddSubmonoid {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) : (Subsemiring.mk' s sm hm sa ha).toAddSubmonoid = sa

{R : Type u}
[NonAssocSemiring R]
{s : Set R}
{sm : Submonoid R}
(hm : ↑sm = s)
{sa : AddSubmonoid R}
(ha : ↑sa = s)


theorem inv_app_top {X Y : Scheme} (f : X ⟶ Y) [IsIso f] :
    (inv f).app ⊤ = inv (f.app ⊤)

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[CategoryTheory.IsIso f]

AlgebraicGeometry.Scheme.Hom.app (CategoryTheory.inv f) ⊤ = CategoryTheory.inv (AlgebraicGeometry.Scheme.Hom.app f ⊤)


@[simp]
theorem preimage_image_eq {f : α → β} (s : Set α) (h : Injective f) : f ⁻¹' (f '' s) = s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(s : Set α)
(h : Function.Injective f)


protected theorem ediv_le_ediv {a b c : Int} (H : 0 < c) (H' : a ≤ b) : a / c ≤ b / c


/-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/
@[simps]
def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C

{W₁ W₂ : CategoryTheory.MorphismProperty C}

(data : W₁.FunctorialFactorizationData W₂)

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

((CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z data J).obj f).obj j =
  (data.factorizationData (f.hom.app j)).Z


/-- To bound the Hausdorff measure of a set, one may use coverings with maximum diameter tending
to `0`, indexed by any sequence of countable types. -/
theorem hausdorffMeasure_le_liminf_tsum {β : Type*} {ι : β → Type*} [∀ n, Countable (ι n)]
    (d : ℝ) (s : Set X) {l : Filter β} (r : β → ℝ≥0∞) (hr : Tendsto r l (𝓝 0))
    (t : ∀ n : β, ι n → Set X) (ht : ∀ᶠ n in l, ∀ i, diam (t n i) ≤ r n)
    (hst : ∀ᶠ n in l, s ⊆ ⋃ i, t n i) : μH[d] s ≤ liminf (fun n => ∑' i, diam (t n i) ^ d) l

(r : β → ℝ≥0∞)

(ht : ∀ᶠ (n : β) in l, ∀ (i : ι n), EMetric.diam (t n i) ≤ r n)

μH[d] s ≤ Filter.liminf (fun n => ∑' (i : ι n), EMetric.diam (t n i) ^ d) l


@[ext]
lemma ext {F G : OplaxFunctor B C} {α β : F ⟶ G} {m n : α ⟶ β} (w : ∀ b, m.app b = n.app b) :
    m = n

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{F G : CategoryTheory.OplaxFunctor B C}
{α β : F ⟶ G}
{m n : α ⟶ β}
(w : ∀ (b : B), m.app b = n.app b)


@[to_additive (attr := simp)]
lemma mem_aestabilizer : g ∈ aestabilizer G μ s ↔ g • s =ᵐ[μ] s

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.SMulInvariantMeasure G α μ] {g : G}
  {s : Set α}, g ∈ MulAction.aestabilizer G μ s ↔ g • s =ᵐ[μ] s


@[to_additive]
theorem finprod_subtype_eq_finprod_cond (p : α → Prop) :
    ∏ᶠ j : Subtype p, f j = ∏ᶠ (i) (_ : p i), f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
(p : α → Prop)

∑ᶠ (j : Subtype p), f ↑j = ∑ᶠ (i : α) (_ : p i), f i


theorem chain'_iff_get {R} : ∀ {l : List α}, Chain' R l ↔
    ∀ (i : ℕ) (h : i < length l - 1),
      R (get l ⟨i, by omega⟩) (get l ⟨i + 1, by omega⟩)

{α : Type u}
{R : α → α → Prop}
{l : List α}

List.Chain' R l ↔ ∀ (i : ℕ) (h : i < l.length - 1), R (l.get ⟨i, ⋯⟩) (l.get ⟨i + 1, ⋯⟩)


theorem pairwise_of_forall (s : Set α) (r : α → α → Prop) (h : ∀ a b, r a b) : s.Pairwise r

{α : Type u_1}
(s : Set α)
(r : α → α → Prop)
(h : ∀ (a b : α), r a b)


/--
A universe polymorphic Yoneda presheaf on `TopCat` given by continuous maps into a topoological
space `Y`.
-/
@[simps]
def yonedaPresheaf' : TopCat.{w}ᵒᵖ ⥤ Type (max w w')

(Y : Type w')
[TopologicalSpace Y]
(X : TopCatᵒᵖ)

(ContinuousMap.yonedaPresheaf' Y).obj X = C(↑(Opposite.unop X), Y)


theorem IsRelPrime.of_mul_left_right (H : IsRelPrime (x * y) z) : IsRelPrime y z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(H : IsRelPrime (x * y) z)


@[simp]
theorem basicOpen_eq_bot_iff {X : Scheme} [IsReduced X] {U : X.Opens}
    (s : Γ(X, U)) : X.basicOpen s = ⊥ ↔ s = 0

{X : AlgebraicGeometry.Scheme}
[AlgebraicGeometry.IsReduced X]
{U : X.Opens}
(s : ↑(X.presheaf.obj (Opposite.op U)))


theorem IsMax.not_lt (h : IsMax a) : ¬a < b

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


lemma eq_bot_of_eq_ideal_smul_of_le_jacobson_annihilator {I : Ideal R}
    {N : Submodule R M} (hN : FG N) (hIN : N = I • N)
    (hIjac : I ≤ N.annihilator.jacobson) : N = ⊥

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{N : Submodule R M}
(hN : N.FG)
(hIN : N = I • N)
(hIjac : I ≤ N.annihilator.jacobson)


@[to_additive]
theorem image_mul_left' :
    image (fun b => a⁻¹ * b) t = preimage t (fun b => a * b) (mul_right_injective _).injOn

{α : Type u_2}
[DecidableEq α]
[AddGroup α]
{t : Finset α}
{a : α}

Finset.image (fun b => -a + b) t = t.preimage (fun b => a + b) ⋯


@[simp] theorem neg_imJ : (-a).imJ = -a.imJ

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])


@[simp]
theorem uncurry_curry (f : A ⊗ X ⟶ Y) : uncurry (curry f) = f

(f : CategoryTheory.MonoidalCategory.tensorObj A X ⟶ Y)

CategoryTheory.MonoidalClosed.uncurry (CategoryTheory.MonoidalClosed.curry f) = f


theorem exists_of_sep (P : Cᵒᵖ ⥤ D)
    (hsep :
      ∀ (X : C) (S : J.Cover X) (x y : P.obj (op X)),
        (∀ I : S.Arrow, P.map I.f.op x = P.map I.f.op y) → x = y)
    (X : C) (S : J.Cover X) (s : Meq (J.plusObj P) S) :
    ∃ t : (J.plusObj P).obj (op X), Meq.mk S t = s

{J : CategoryTheory.GrothendieckTopology C}

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

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

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

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

(hsep :
  ∀ (X : C) (S : J.Cover X) (x y : (CategoryTheory.forget D).obj (P.obj (Opposite.op X))),
    (∀ (I : S.Arrow), (P.map I.f.op) x = (P.map I.f.op) y) → x = y)

(s : CategoryTheory.Meq (J.plusObj P) S)


theorem le_mkMetric (m : ℝ≥0∞ → ℝ≥0∞) (μ : OuterMeasure X) (r : ℝ≥0∞) (h0 : 0 < r)
    (hr : ∀ s, diam s ≤ r → μ s ≤ m (diam s)) : μ ≤ mkMetric m

(m : ℝ≥0∞ → ℝ≥0∞)

(hr : ∀ (s : Set X), EMetric.diam s ≤ r → μ s ≤ m (EMetric.diam s))

μ ≤ MeasureTheory.OuterMeasure.mkMetric m


@[to_additive]
theorem mem_ker [Group H] (f : G → H) {x : G} : x ∈ ker f ↔ f x = 1

{G : Type u_1}
{H : Type u_2}
[AddGroup H]
(f : G → H)
{x : G}


/-- The extension of `N₁` to the Karoubi envelope of `SimplicialObject C`. -/
@[simps!]
def N₂ : Karoubi (SimplicialObject C) ⥤ Karoubi (ChainComplex C ℕ)

(P : CategoryTheory.Idempotents.Karoubi (CategoryTheory.SimplicialObject C))

(AlgebraicTopology.DoldKan.N₂.obj P).X.X n = P.X.obj (Opposite.op (SimplexCategory.mk n))


@[simp, norm_cast]
theorem toENNReal_zero : ((0 : ℕ∞) : ℝ≥0∞) = 0


protected theorem iff (hk : 0 < k) :
    IsPrimitiveRoot ζ k ↔ ζ ^ k = 1 ∧ ∀ l : ℕ, 0 < l → l < k → ζ ^ l ≠ 1

{M : Type u_1}
[CommMonoid M]
{k : ℕ}
{ζ : M}
(hk : 0 < k)

IsPrimitiveRoot ζ k ↔ ζ ^ k = 1 ∧ ∀ (l : ℕ), 0 < l → l < k → ζ ^ l ≠ 1


/-- The inverse part of the equivalence `LightProfinite ≌ LightDiagram` -/
@[simps]
def lightDiagramToLightProfinite : LightDiagram.{u} ⥤ LightProfinite.{u}

∀ {X Y : LightDiagram} (f : X ⟶ Y), lightDiagramToLightProfinite.map f = f


lemma shiftFunctor_op_map (n m : ℤ) (hnm : n + m = 0) {K L : Cᵒᵖ} (φ : K ⟶ L) :
    (shiftFunctor Cᵒᵖ n).map φ =
      (shiftFunctorOpIso C n m hnm).hom.app K ≫ ((shiftFunctor C m).map φ.unop).op ≫
        (shiftFunctorOpIso C n m hnm).inv.app L

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(n m : ℤ)
(hnm : n + m = 0)
{K L : Cᵒᵖ}
(φ : K ⟶ L)

(CategoryTheory.shiftFunctor Cᵒᵖ n).map φ =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Pretriangulated.shiftFunctorOpIso C n m hnm).hom.app K)
    (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor C m).map φ.unop).op
      ((CategoryTheory.Pretriangulated.shiftFunctorOpIso C n m hnm).inv.app L))


@[simp]
theorem uIcc_of_le (h : a ≤ b) : [[a, b]] = Icc a b

{α : Type u_2}
[Lattice α]
[LocallyFiniteOrder α]
{a b : α}
(h : a ≤ b)


private lemma w_spec : S.c = λ ^ S.multiplicity * S.w

(S : FermatLastTheoremForThreeGen.Solution hζ)

S.c = (hζ.toInteger - 1) ^ S.multiplicity * FermatLastTheoremForThreeGen.Solution.w S


theorem isCompl_of_proj {f : E →ₗ[R] p} (hf : ∀ x : p, f x = x) : IsCompl p (ker f)

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{p : Submodule R E}
{f : E →ₗ[R] ↥p}
(hf : ∀ (x : ↥p), f ↑x = x)


/-- Auxiliary definition for `CategoryTheory.Functor.closed`.
The counit for the adjunction `(tensorLeft F) ⊣ (ihom F)`. -/
@[simps]
def closedCounit (F : D ⥤ C) : closedIhom F ⋙ tensorLeft F ⟶ 𝟭 (D ⥤ C)

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

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


/-- Alternate phrasing of `Polynomial.Monic.irreducible_iff_natDegree'` where we only have to check
one divisor at a time. -/
theorem Monic.irreducible_iff_lt_natDegree_lt {p : R[X]} (hp : p.Monic) (hp1 : p ≠ 1) :
    Irreducible p ↔ ∀ q, Monic q → natDegree q ∈ Finset.Ioc 0 (natDegree p / 2) → ¬ q ∣ p

{R : Type u}
[CommSemiring R]
[NoZeroDivisors R]
{p : R[X]}
(hp : p.Monic)
(hp1 : p ≠ 1)

Irreducible p ↔ ∀ (q : R[X]), q.Monic → q.natDegree ∈ Finset.Ioc 0 (p.natDegree / 2) → ¬q ∣ p


theorem IsGreatest.isLUB (h : IsGreatest s a) : IsLUB s a

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}
(h : IsGreatest s a)


theorem map_int_of_map_zero (n : ℤ) : f n = f 0 + n


/-- `Function.const` as a `MulHom`. -/
@[to_additive (attr := simps) "`Function.const` as an `AddHom`."]
def Pi.constMulHom (α β : Type*) [Mul β] :
    β →ₙ* α → β

(α : Type u_3)
(β : Type u_4)
[Mul β]
(a : β)

∀ (a_1 : α), (Pi.constMulHom α β) a a_1 = Function.const α a a_1


protected theorem MonotoneOn.monovaryOn (hf : MonotoneOn f s) (hg : MonotoneOn g s) :
    MonovaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}
[LinearOrder ι]
(hf : MonotoneOn f s)
(hg : MonotoneOn g s)


theorem le_map_apply_image {f : α → β} (hf : AEMeasurable f μ) (s : Set α) :
    μ s ≤ μ.map f (f '' s)

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)
(s : Set α)

μ s ≤ (MeasureTheory.Measure.map f μ) (f '' s)


/-- The order topology on an ordered type is the topology generated by open intervals. We register
it on a preorder, but it is mostly interesting in linear orders, where it is also order-closed.
We define it as a mixin. If you want to introduce the order topology on a preorder, use
`Preorder.topology`. -/
class OrderTopology (α : Type*) [t : TopologicalSpace α] [Preorder α] : Prop where
  /-- The topology is generated by open intervals `Set.Ioi _` and `Set.Iio _`. -/
  topology_eq_generate_intervals : t = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a }

{α : Type u_1}
[t : TopologicalSpace α]
[Preorder α]
[self : OrderTopology α]

t = TopologicalSpace.generateFrom {s | ∃ a, s = Set.Ioi a ∨ s = Set.Iio a}


theorem _root_.IsMin.Iio_eq (h : IsMin a) : Iio a = ∅

{α : Type u_1}
[Preorder α]
{a : α}
(h : IsMin a)


theorem eq_univ_of_subset {s t : Set α} (h : s ⊆ t) (hs : s = univ) : t = univ

{α : Type u}
{s t : Set α}
(h : s ⊆ t)
(hs : s = Set.univ)


theorem realize_toPrenexImp {φ ψ : L.BoundedFormula α n} (hφ : IsPrenex φ) (hψ : IsPrenex ψ)
    {v : α → M} {xs : Fin n → M} : (φ.toPrenexImp ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n : ℕ}
[Nonempty M]
{φ ψ : L.BoundedFormula α n}
(hφ : φ.IsPrenex)
(hψ : ψ.IsPrenex)
{v : α → M}
{xs : Fin n → M}


theorem shiftLeft_add (m n : Nat) : ∀ k, m <<< (n + k) = (m <<< n) <<< k


theorem coe_bot : ((⊥ : Subsemiring R) : Set R) = Set.range ((↑) : ℕ → R)


theorem Set.OrdConnected.convex_of_chain [OrderedSemiring 𝕜] [OrderedAddCommMonoid E] [Module 𝕜 E]
    [OrderedSMul 𝕜 E] {s : Set E} (hs : s.OrdConnected) (h : IsChain (· ≤ ·) s) : Convex 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[OrderedAddCommMonoid E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
(hs : s.OrdConnected)
(h : IsChain (fun x x_1 => x ≤ x_1) s)


/-- The same-universe version of `lift_rank_le_of_surjective_injective`. -/
theorem rank_le_of_surjective_injective (i : ZeroHom R R') (j : M →+ M₁)
    (hi : Surjective i) (hj : Injective j)
    (hc : ∀ (r : R) (m : M), j (r • m) = i r • j m) :
    Module.rank R M ≤ Module.rank R' M₁


theorem sup_range_inl_inr : (range <| inl R M M₂) ⊔ (range <| inr R M M₂) = ⊤

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.range (LinearMap.inl R M M₂) ⊔ LinearMap.range (LinearMap.inr R M M₂) = ⊤


theorem bijOn_iInter_of_directed [Nonempty ι] {s : ι → Set α} (hs : Directed (· ⊆ ·) s)
    {t : ι → Set β} {f : α → β} (H : ∀ i, BijOn f (s i) (t i)) : BijOn f (⋂ i, s i) (⋂ i, t i)

(hs : Directed (fun x x_1 => x ⊆ x_1) s)

(H : ∀ (i : ι), Set.BijOn f (s i) (t i))


theorem bind_defined {f : Part α} {g : α → Part β} :
    ∀ h : f.Dom, (g (f.get h)).Dom → (f.bind g).Dom

{α : Type u_1}
{β : Type u_2}
{f : Part α}
{g : α → Part β}
(h : f.Dom)


theorem le_ker_iff : I ≤ f.ker ↔ ∀ x, x ∈ I → f x = 0

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


/-- Theorem of bark and tree: if a set is within a connected set and its closure, then it is
connected as well. See also `IsPreconnected.subset_closure`. -/
protected theorem IsConnected.subset_closure {s : Set α} {t : Set α} (H : IsConnected s)
    (Kst : s ⊆ t) (Ktcs : t ⊆ closure s) : IsConnected t

{α : Type u}
[TopologicalSpace α]
{s t : Set α}
(H : IsConnected s)
(Kst : s ⊆ t)
(Ktcs : t ⊆ closure s)


/-- Let `P` be a predicate on the affine open sets of `X` satisfying
1. If `P` holds on `U`, then `P` holds on the basic open set of every section on `U`.
2. If `P` holds for a family of basic open sets covering `U`, then `P` holds for `U`.
3. There exists an affine open cover of `X` each satisfying `P`.

Then `P` holds for every affine open of `X`.

This is also known as the **Affine communication lemma** in [*The rising sea*][RisingSea]. -/
@[elab_as_elim]
theorem of_affine_open_cover {X : Scheme} {P : X.affineOpens → Prop}
    {ι} (U : ι → X.affineOpens) (iSup_U : (⨆ i, U i : X.Opens) = ⊤)
    (V : X.affineOpens)
    (basicOpen : ∀ (U : X.affineOpens) (f : Γ(X, U)), P U → P (X.affineBasicOpen f))
    (openCover :
      ∀ (U : X.affineOpens) (s : Finset (Γ(X, U)))
        (_ : Ideal.span (s : Set (Γ(X, U))) = ⊤),
        (∀ f : s, P (X.affineBasicOpen f.1)) → P U)
    (hU : ∀ i, P (U i)) : P V

(basicOpen : ∀ (U : ↑X.affineOpens) (f : ↑(X.presheaf.obj (Opposite.op ↑U))), P U → P (X.affineBasicOpen f))

(openCover :
  ∀ (U : ↑X.affineOpens) (s : Finset ↑(X.presheaf.obj (Opposite.op ↑U))),
    Ideal.span ↑s = ⊤ → (∀ (f : { x // x ∈ s }), P (X.affineBasicOpen ↑f)) → P U)


/--
For an addivite functor `F : C ⥤ D` between abelian categories, the following are equivalent:
- `F` preserves short exact sequences on the right hand side, i.e. if `0 ⟶ A ⟶ B ⟶ C ⟶ 0` is
  exact then `F(A) ⟶ F(B) ⟶ F(C) ⟶ 0` is exact.
- `F` preserves exact sequences on the right hand side, i.e. if `A ⟶ B ⟶ C` is exact where `B ⟶ C`
  is epi, then `F(A) ⟶ F(B) ⟶ F(C) ⟶ 0` is exact and `F(B) ⟶ F(C)` is epi as well.
- `F` preserves cokernels.
- `F` preserves finite colimits.
-/
lemma preservesFiniteColimits_tfae : List.TFAE
    [
      ∀ (S : ShortComplex C), S.ShortExact → (S.map F).Exact ∧ Epi (F.map S.g),
      ∀ (S : ShortComplex C), S.Exact ∧ Epi S.g → (S.map F).Exact ∧ Epi (F.map S.g),
      ∀ ⦃X Y : C⦄ (f : X ⟶ Y), Nonempty $ PreservesColimit (parallelPair f 0) F,
      Nonempty $ PreservesFiniteColimits F
    ]

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Abelian C]
[CategoryTheory.Abelian D]
(F : CategoryTheory.Functor C D)
[F.Additive]

[∀ (S : CategoryTheory.ShortComplex C), S.ShortExact → (S.map F).Exact ∧ CategoryTheory.Epi (F.map S.g),
    ∀ (S : CategoryTheory.ShortComplex C),
      S.Exact ∧ CategoryTheory.Epi S.g → (S.map F).Exact ∧ CategoryTheory.Epi (F.map S.g),
    ∀ ⦃X Y : C⦄ (f : X ⟶ Y),
      Nonempty (CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.parallelPair f 0) F),
    Nonempty (CategoryTheory.Limits.PreservesFiniteColimits F)].TFAE


theorem uniformity_eq_aux :
    𝓤[instUniformSpaceProd.comap <| addEquiv 𝕜 A] = 𝓤 (Unitization 𝕜 A)

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
[RegularNormedAlgebra 𝕜 A]

uniformity (Unitization 𝕜 A) = uniformity (Unitization 𝕜 A)


/-- A useful form of the **closed graph theorem** : let `f` be a linear map between two Banach
spaces. To show that `f` is continuous, it suffices to show that for any convergent sequence
`uₙ ⟶ x`, if `f(uₙ) ⟶ y` then `y = f(x)`. -/
theorem LinearMap.continuous_of_seq_closed_graph
    (hg : ∀ (u : ℕ → E) (x y), Tendsto u atTop (𝓝 x) → Tendsto (g ∘ u) atTop (𝓝 y) → y = g x) :
    Continuous g

(hg :
  ∀ (u : ℕ → E) (x : E) (y : F),
    Filter.Tendsto u Filter.atTop (𝓝 x) → Filter.Tendsto (⇑g ∘ u) Filter.atTop (𝓝 y) → y = g x)


@[simp]
theorem coe_mk (s : Set V) (h₁ h₂ h₃) : (mk s h₁ h₂ h₃ : Set V) = s

{V : Type u_1}
[TopologicalSpace V]
[AddCommGroup V]
[Module ℝ V]
(s : Set V)
(h₁ : Convex ℝ s)
(h₂ : IsCompact s)
(h₃ : s.Nonempty)

↑{ carrier := s, convex' := h₁, isCompact' := h₂, nonempty' := h₃ } = s


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

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

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


@[simp]
theorem toAdd_multiset_sum (s : Multiset (Multiplicative α)) :
    toAdd s.prod = (s.map toAdd).sum

{α : Type u_3}
[AddCommMonoid α]
(s : Multiset (Multiplicative α))

Multiplicative.toAdd s.prod = (Multiset.map (⇑Multiplicative.toAdd) s).sum


@[to_additive]
lemma inf_mul_left [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
    inf (s * t) f = inf s fun x ↦ inf t (f <| x * ·)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Mul α]
[SemilatticeInf β]
[OrderTop β]
(s t : Finset α)
(f : α → β)

(s * t).inf f = s.inf fun x => t.inf fun x_1 => f (x * x_1)


@[simp]
theorem compAlongComposition_apply {n : ℕ} (p : FormalMultilinearSeries 𝕜 E F) (c : Composition n)
    (f : ContinuousMultilinearMap 𝕜 (fun _i : Fin c.length => F) G) (v : Fin n → E) :
    (f.compAlongComposition p c) v = f (p.applyComposition c v)

(f : ContinuousMultilinearMap 𝕜 (fun _i => F) G)

(ContinuousMultilinearMap.compAlongComposition p c f) v = f (p.applyComposition c v)


theorem foldr_range_subset_of_range_subset {f : β → α → α} {g : γ → α → α}
    (hfg : Set.range f ⊆ Set.range g) (a : α) : Set.range (foldr f a) ⊆ Set.range (foldr g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : β → α → α}
{g : γ → α → α}
(hfg : Set.range f ⊆ Set.range g)
(a : α)

Set.range (List.foldr f a) ⊆ Set.range (List.foldr g a)


theorem logDeriv_mul {f g : 𝕜 → 𝕜'} (x : 𝕜) (hf : f x ≠ 0) (hg : g x ≠ 0)
    (hdf : DifferentiableAt 𝕜 f x) (hdg : DifferentiableAt 𝕜 g x) :
      logDeriv (fun z => f z * g z) x = logDeriv f x + logDeriv g x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{f g : 𝕜 → 𝕜'}
(x : 𝕜)
(hf : f x ≠ 0)
(hg : g x ≠ 0)
(hdf : DifferentiableAt 𝕜 f x)
(hdg : DifferentiableAt 𝕜 g x)


theorem isBounded_biUnion {s : Set ι} {f : ι → Set α} (hs : s.Finite) :
    IsBounded (⋃ i ∈ s, f i) ↔ ∀ i ∈ s, IsBounded (f i)

{ι : Type u_1}
{α : Type u_2}
[Bornology α]
{s : Set ι}
{f : ι → Set α}
(hs : s.Finite)

Bornology.IsBounded (⋃ i ∈ s, f i) ↔ ∀ i ∈ s, Bornology.IsBounded (f i)


theorem mul_inverse_cancel (x : M₀) (h : IsUnit x) : x * inverse x = 1

{M₀ : Type u_2}
[MonoidWithZero M₀]
(x : M₀)
(h : IsUnit x)


theorem coe_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Subring R} (hS : Directed (· ≤ ·) S) :
    ((⨆ i, S i : Subring R) : Set R) = ⋃ i, S i

(hS : Directed (fun x x_1 => x ≤ x_1) S)


theorem _root_.Function.Embedding.enccard_le (e : s ↪ t) : s.encard ≤ t.encard

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
(e : ↑s ↪ ↑t)


lemma Fibration.isUpperSet_image [LE α] [LE β] (hf : Fibration (· ≥ ·) (· ≥ ·) f)
    {s : Set α} (hs : IsUpperSet s) : IsUpperSet (f '' s)

(hf : Relation.Fibration (fun x x_1 => x ≥ x_1) (fun x x_1 => x ≥ x_1) f)


@[simp]
theorem lift_cof (o) : Cardinal.lift.{u, v} (cof o) = cof (Ordinal.lift.{u, v} o)

Cardinal.lift.{u, v} o.cof = (Ordinal.lift.{u, v} o).cof


lemma traceForm_dualSubmodule_adjoin
    {x : L} (hx : Algebra.adjoin K {x} = ⊤) (hAx : IsIntegral A x) :
    (traceForm K L).dualSubmodule (Subalgebra.toSubmodule (Algebra.adjoin A {x})) =
      (aeval x (derivative <| minpoly K x) : L)⁻¹ •
        (Subalgebra.toSubmodule (Algebra.adjoin A {x}))

(A : Type u_1)
(K : Type u_2)
{L : Type u}
[CommRing A]
[Field K]
[Field L]
[Algebra A K]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsDomain A]
[IsFractionRing A K]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
{x : L}
(hx : Algebra.adjoin K {x} = ⊤)
(hAx : IsIntegral A x)

(Algebra.traceForm K L).dualSubmodule (Subalgebra.toSubmodule (Algebra.adjoin A {x})) =
  ((Polynomial.aeval x) (Polynomial.derivative (minpoly K x)))⁻¹ • Subalgebra.toSubmodule (Algebra.adjoin A {x})


theorem Simple.iff_of_iso {X Y : C} (i : X ≅ Y) : Simple X ↔ Simple Y

CategoryTheory.Simple X ↔ CategoryTheory.Simple Y


theorem min_def_lt (x y : α) : min x y = if x < y then x else y

{α : Type u_2}
[LinearOrder α]
(x y : α)


theorem exists_algebraMap_eq_of_isIntegral_pow {x : K} {n : ℕ} (hn : 0 < n)
    (hx : IsIntegral R <| x ^ n) : ∃ y : R, algebraMap R K y = x

{R : Type u_1}
[CommRing R]
[iic : IsIntegrallyClosed R]
{K : Type u_3}
[CommRing K]
[Algebra R K]
[ifr : IsFractionRing R K]
{x : K}
{n : ℕ}
(hn : 0 < n)
(hx : IsIntegral R (x ^ n))


theorem xn_dioph : DiophPFun fun v : Vector3 ℕ 2 => ⟨1 < v &0, fun h => xn h (v &1)⟩

Dioph.DiophPFun fun v => { Dom := 1 < v (Fin2.ofNat' 0), get := fun h => Pell.xn h (v (Fin2.ofNat' 1)) }


lemma jacobiTheta_eq_jacobiTheta₂ (τ : ℂ) : jacobiTheta τ = jacobiTheta₂ 0 τ


@[simp]
theorem embDomain_single {f : Γ ↪o Γ'} {g : Γ} {r : R} :
    embDomain f (single g r) = single (f g) r

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{Γ' : Type u_3}
[PartialOrder Γ']
{f : Γ ↪o Γ'}
{g : Γ}
{r : R}

HahnSeries.embDomain f ((HahnSeries.single g) r) = (HahnSeries.single (f g)) r


lemma inf_eq_half_smul_add_sub_abs_sub (x y : β) : x ⊓ y = (⅟2 : α) • (x + y - |y - x|)

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


@[measurability]
theorem measurable_arccos : Measurable arccos


@[simp]
theorem foldl_fixed {a : α} : ∀ l : List β, foldl (fun a _ => a) a l = a

{α : Type u}
{β : Type v}
{a : α}
(l : List β)


@[simp]
theorem range_id : NonUnitalStarAlgHom.range (NonUnitalStarAlgHom.id R A) = ⊤

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]


@[to_additive]
theorem FP.mul_two {M} [Semigroup M] (a : Stream' M) (i j : ℕ) (ij : i < j) :
    a.get i * a.get j ∈ FP a

{M : Type u_1}
[AddSemigroup M]
(a : Stream' M)
(i j : ℕ)
(ij : i < j)


theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [IsScalarTower R Rₘ S]
    (x : S) (hx : IsIntegral Rₘ x) : ∃ m : M, IsIntegral R (m • x)

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
{S : Type u_2}
[CommRing S]
[Algebra R S]
{Rₘ : Type u_4}
[CommRing Rₘ]
[Algebra R Rₘ]
[IsLocalization M Rₘ]
[Algebra Rₘ S]
[IsScalarTower R Rₘ S]
(x : S)
(hx : IsIntegral Rₘ x)


theorem support_toFinsupp (p : R[X]) : p.toFinsupp.support = p.support


theorem support_scaleRoots_le (p : R[X]) (s : R) : (scaleRoots p s).support ≤ p.support

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


theorem length_split_snd_le (l : List α) : length (split l).2 ≤ length l


theorem SplitEpi.epi {X Y : C} {f : X ⟶ Y} (se : SplitEpi f) : Epi f

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


@[simp]
theorem mapEquiv.symm (f : R ≃+* S) : (mapEquiv f).symm = mapEquiv f.symm

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[LocalRing R]
[CommRing S]
[LocalRing S]
(f : R ≃+* S)

(LocalRing.ResidueField.mapEquiv f).symm = LocalRing.ResidueField.mapEquiv f.symm


theorem UInt16.le_antisymm_iff {x y : UInt16} : x = y ↔ x ≤ y ∧ y ≤ x


theorem const_mem_Lp (α) {_ : MeasurableSpace α} (μ : Measure α) (c : E) [IsFiniteMeasure μ] :
    @AEEqFun.const α _ _ μ _ c ∈ Lp E p μ

{E : Type u_2}
{p : ℝ≥0∞}
[NormedAddCommGroup E]
(α : Type u_5)

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α) (c : E) [inst : MeasureTheory.IsFiniteMeasure μ],
  MeasureTheory.AEEqFun.const α c ∈ MeasureTheory.Lp E p μ


@[to_additive (attr := simp)]
theorem relindex_bot_left : (⊥ : Subgroup G).relindex H = Nat.card H

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


theorem Walk.mem_finsetWalkLength_iff_length_eq {n : ℕ} {u v : V} (p : G.Walk u v) :
    p ∈ G.finsetWalkLength n u v ↔ p.length = n

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
[G.LocallyFinite]
{n : ℕ}
{u v : V}
(p : G.Walk u v)


theorem Coprime.factor_eq_gcd_right_right {a b m n : ℕ+} (cop : m.Coprime n) (am : a ∣ m)
    (bn : b ∣ n) : a = m.gcd (b * a)


/-- A family of Hahn series whose formal coefficient-wise sum is a Hahn series.  For each
coefficient of the sum to be well-defined, we require that only finitely many series are nonzero at
any given coefficient.  For the formal sum to be a Hahn series, we require that the union of the
supports of the constituent series is partially well-ordered. -/
structure SummableFamily (α : Type*) where
  /-- A parametrized family of Hahn series. -/
  toFun : α → HahnSeries Γ R
  isPWO_iUnion_support' : Set.IsPWO (⋃ a : α, (toFun a).support)
  finite_co_support' : ∀ g : Γ, { a | (toFun a).coeff g ≠ 0 }.Finite

(self : HahnSeries.SummableFamily Γ R α)


theorem hom_eq_zero_iff [Preadditive C] {P Q : Karoubi C} {f : P ⟶ Q} : f = 0 ↔ f.f = 0

{P Q : CategoryTheory.Idempotents.Karoubi C}


@[to_additive prod_map_comap_prod']
theorem prod_map_comap_prod' {M' : Type*} {N' : Type*} [MulOneClass M'] [MulOneClass N']
    (f : M →* N) (g : M' →* N') (S : Submonoid N) (S' : Submonoid N') :
    (S.prod S').comap (prodMap f g) = (S.comap f).prod (S'.comap g)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{M' : Type u_6}
{N' : Type u_7}
[MulOneClass M']
[MulOneClass N']
(f : M →* N)
(g : M' →* N')
(S : Submonoid N)
(S' : Submonoid N')

Submonoid.comap (f.prodMap g) (S.prod S') = (Submonoid.comap f S).prod (Submonoid.comap g S')


theorem ball_subset_closedBall : ball x ε ⊆ closedBall x ε

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{ε : ℝ≥0∞}

EMetric.ball x ε ⊆ EMetric.closedBall x ε


theorem inter_mem_nhdsWithin (s : Set α) {t : Set α} {a : α} (h : t ∈ 𝓝 a) : s ∩ t ∈ 𝓝[s] a

{α : Type u_1}
[TopologicalSpace α]
(s : Set α)
{t : Set α}
{a : α}
(h : t ∈ 𝓝 a)


theorem size_pos' : ∀ [Nonempty (Fin n)], 0 < n


theorem Measurable.of_uncurry_left {f : α → β → γ} (hf : Measurable (uncurry f)) {x : α} :
    Measurable (f x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{mγ : MeasurableSpace γ}
{f : α → β → γ}
(hf : Measurable (Function.uncurry f))
{x : α}


/-- Two vectors are equal if and only if they have equal norms and zero angle between them. -/
theorem eq_iff_norm_eq_and_oangle_eq_zero (x y : V) : x = y ↔ ‖x‖ = ‖y‖ ∧ o.oangle x y = 0

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


/-- If `R` is of characteristic `p` and `¬p ∣ m`, then `ζ` is a root of `cyclotomic (p ^ k * m) R`
 if and only if it is a primitive `m`-th root of unity. -/
theorem isRoot_cyclotomic_prime_pow_mul_iff_of_charP {m k p : ℕ} {R : Type*} [CommRing R]
    [IsDomain R] [hp : Fact (Nat.Prime p)] [hchar : CharP R p] {μ : R} [NeZero (m : R)] :
    (Polynomial.cyclotomic (p ^ k * m) R).IsRoot μ ↔ IsPrimitiveRoot μ m

{m k p : ℕ}
{R : Type u_1}
[CommRing R]
[IsDomain R]
[hp : Fact (Nat.Prime p)]
[hchar : CharP R p]
{μ : R}
[NeZero ↑m]


/-- If two pseudoelements `x` and `y` have the same image under some morphism `f`, then we can form
    their "difference" `z`. This pseudoelement has the properties that `f z = 0` and for all
    morphisms `g`, if `g y = 0` then `g z = g x`. -/
theorem sub_of_eq_image {P Q : C} (f : P ⟶ Q) (x y : P) :
    f x = f y → ∃ z, f z = 0 ∧ ∀ (R : C) (g : P ⟶ R), (g : P ⟶ R) y = 0 → g z = g x

(x y : CategoryTheory.Abelian.Pseudoelement P)

CategoryTheory.Abelian.Pseudoelement.pseudoApply f x = CategoryTheory.Abelian.Pseudoelement.pseudoApply f y →
  ∃ z,
    CategoryTheory.Abelian.Pseudoelement.pseudoApply f z = 0 ∧
      ∀ (R : C) (g : P ⟶ R),
        CategoryTheory.Abelian.Pseudoelement.pseudoApply g y = 0 →
          CategoryTheory.Abelian.Pseudoelement.pseudoApply g z = CategoryTheory.Abelian.Pseudoelement.pseudoApply g x


@[to_additive (attr := simp) add_pos_iff]
theorem one_lt_mul_iff : 1 < a * b ↔ 1 < a ∨ 1 < b

{α : Type u}
[CanonicallyOrderedAddCommMonoid α]
{a b : α}


nonrec theorem exists_gcf_pair_rat_eq_of_nth_contsAux :
    ∃ conts : Pair ℚ, (of v).contsAux n = (conts.map (↑) : Pair K)

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(v : K)
(n : ℕ)

∃ conts, (GenContFract.of v).contsAux n = GenContFract.Pair.map Rat.cast conts


theorem exists_lt_add_of_lt_add {x y z : ℝ≥0∞} (h : x < y + z) (hy : y ≠ 0) (hz : z ≠ 0) :
    ∃ y' z', y' < y ∧ z' < z ∧ x < y' + z'


@[simp]
theorem Basis.ofEquivFun_equivFun [Finite ι] (v : Basis ι R M) :
    Basis.ofEquivFun v.equivFun = v

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Finite ι]
(v : Basis ι R M)


theorem l_unique {l' : α → β} {u' : β → α} (gc' : GaloisConnection l' u') (hu : ∀ b, u b = u' b)
    {a : α} : l a = l' a

{α : Type u}
{β : Type v}
[Preorder α]
[PartialOrder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{l' : α → β}
{u' : β → α}
(gc' : GaloisConnection l' u')
(hu : ∀ (b : β), u b = u' b)
{a : α}


@[reassoc (attr := simp)]
lemma leftDerivedZeroIsoSelf_inv_hom_id :
    F.leftDerivedZeroIsoSelf.inv ≫ F.fromLeftDerivedZero =  𝟙 _

CategoryTheory.CategoryStruct.comp F.leftDerivedZeroIsoSelf.inv F.fromLeftDerivedZero =
  CategoryTheory.CategoryStruct.id F


/--
A comonoid object in a functor category induces a functor to the category of comonoid objects.
-/
@[simps]
def functorObj (A : Comon_ (C ⥤ D)) : C ⥤ Comon_ D

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

((CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.functorObj A).obj X).counit = A.counit.app X


theorem Subpresheaf.to_sheafify_lift_unique (h : Presieve.IsSheaf J F')
    (l₁ l₂ : (G.sheafify J).toPresheaf ⟶ F')
    (e : Subpresheaf.homOfLe (G.le_sheafify J) ≫ l₁ = Subpresheaf.homOfLe (G.le_sheafify J) ≫ l₂) :
    l₁ = l₂

{J : CategoryTheory.GrothendieckTopology C}

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)

(h : CategoryTheory.Presieve.IsSheaf J F')

(l₁ l₂ : (CategoryTheory.GrothendieckTopology.Subpresheaf.sheafify J G).toPresheaf ⟶ F')

(e :
  CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe ⋯ ≫ l₁ =
    CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe ⋯ ≫ l₂)


theorem decide_False' (h : Decidable False) : decide False = false


/-- We can post-compose a multiplicative character with a ring homomorphism. -/
@[simps]
def ringHomComp (χ : MulChar R R') (f : R' →+* R'') : MulChar R R''

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{R'' : Type u_3}
[CommRing R'']
(χ : MulChar R R')
(f : R' →+* R'')
(a : R)


/-- A field extension `E / F` is purely inseparable if and only if for every element `x` of `E`,
its minimal polynomial has separable degree one. -/
theorem isPurelyInseparable_iff_natSepDegree_eq_one :
    IsPurelyInseparable F E ↔ ∀ x : E, (minpoly F x).natSepDegree = 1

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

IsPurelyInseparable F E ↔ ∀ (x : E), (minpoly F x).natSepDegree = 1


theorem bsup_le_of_brange_subset {o o'} {f : ∀ a < o, Ordinal} {g : ∀ a < o', Ordinal}
    (h : brange o f ⊆ brange o' g) : bsup.{u, max v w} o f ≤ bsup.{v, max u w} o' g

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

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


theorem coprime_list_prod_left_iff {l : List ℕ} {k : ℕ} :
    Coprime l.prod k ↔ ∀ n ∈ l, Coprime n k


/-- The exponent of finite product of monoids is the `Finset.lcm` of the exponents of the
constituent monoids. -/
@[to_additive "The exponent of finite product of additive monoids is the `Finset.lcm` of the
exponents of the constituent additive monoids."]
theorem Monoid.exponent_pi {ι : Type*} [Fintype ι] {M : ι → Type*} [∀ i, Monoid (M i)] :
    exponent ((i : ι) → M i) = lcm univ (exponent <| M ·)

{ι : Type u_1}
[Fintype ι]
{M : ι → Type u_2}
[(i : ι) → AddMonoid (M i)]

AddMonoid.exponent ((i : ι) → M i) = Finset.univ.lcm fun x => AddMonoid.exponent (M x)


theorem inr.inj_iff : (inr a : α ⊕ β) = inr b ↔ a = b


/-- Prove equality of bitvectors in terms of nat operations. -/
theorem eq_of_toInt_eq {i j : BitVec n} : i.toInt = j.toInt → i = j


lemma shatterer_compress_subset_shatterer (a : α) (𝒜 : Finset (Finset α)) :
    (𝓓 a 𝒜).shatterer ⊆ 𝒜.shatterer

{α : Type u_1}
[DecidableEq α]
(a : α)
(𝒜 : Finset (Finset α))


/-- The equivalence `(ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n` obtained
by reversing the arrows. -/
@[simps!]
def opEquivalence : (ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n

(X : CategoryTheory.ComposableArrows Cᵒᵖ n)

∀ (X_1 : Fin (n + 1)),
  ((CategoryTheory.ComposableArrows.opEquivalence C n).counitIso.inv.app X).app X_1 =
    X.map
      (((CategoryTheory.orderDualEquivalence (Fin (n + 1))).symm.trans Fin.revOrderIso.equivalence).symm.counit.app
          (Opposite.op X_1)).unop


theorem monomial_def [DecidableEq σ] (n : σ →₀ ℕ) :
    (monomial R n) = LinearMap.stdBasis R (fun _ ↦ R) n

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
[DecidableEq σ]
(n : σ →₀ ℕ)

MvPowerSeries.monomial R n = LinearMap.stdBasis R (fun x => R) n


theorem eigenspace_div (f : End K V) (a b : K) (hb : b ≠ 0) :
    eigenspace f (a / b) = LinearMap.ker (b • f - algebraMap K (End K V) a)

{K : Type v}
{V : Type w}
[Field K]
[AddCommGroup V]
[Module K V]
(f : Module.End K V)
(a b : K)
(hb : b ≠ 0)

f.eigenspace (a / b) = LinearMap.ker (b • f - (algebraMap K (Module.End K V)) a)


/-- The underlying object of `(Monad.comparison R).obj X` is just `R.obj X`.
-/
@[simps]
def Monad.comparisonForget (h : L ⊣ R) : Monad.comparison h ⋙ h.toMonad.forget ≅ R

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)
(X : D)

(CategoryTheory.Monad.comparisonForget h).inv.app X = CategoryTheory.CategoryStruct.id (R.obj X)


protected lemma Shatters.subset_iff (h : 𝒜.Shatters s) : t ⊆ s ↔ ∃ u ∈ 𝒜, s ∩ u = t

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{s t : Finset α}
(h : 𝒜.Shatters s)


theorem exists_retraction_subtype_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s)
    (hne : s.Nonempty) :
    ∃ f : (∀ n, E n) → s, (∀ x : s, f x = x) ∧ Surjective f ∧ Continuous f

{E : ℕ → Type u_1}
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]
{s : Set ((n : ℕ) → E n)}
(hs : IsClosed s)
(hne : s.Nonempty)

∃ f, (∀ (x : ↑s), f ↑x = x) ∧ Function.Surjective f ∧ Continuous f


@[simp]
lemma homMk₅_app_one : (homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app 1 = app₁

{f g : CategoryTheory.ComposableArrows C 5}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁ = CategoryTheory.CategoryStruct.comp app₀ (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂ = CategoryTheory.CategoryStruct.comp app₁ (g.map' 1 2 ⋯ ⋯))

(w₂ :
  CategoryTheory.CategoryStruct.comp (f.map' 2 3 ⋯ ⋯) app₃ = CategoryTheory.CategoryStruct.comp app₂ (g.map' 2 3 ⋯ ⋯))

(w₃ :
  CategoryTheory.CategoryStruct.comp (f.map' 3 4 ⋯ ⋯) app₄ = CategoryTheory.CategoryStruct.comp app₃ (g.map' 3 4 ⋯ ⋯))

(w₄ :
  CategoryTheory.CategoryStruct.comp (f.map' 4 5 ⋯ ⋯) app₅ = CategoryTheory.CategoryStruct.comp app₄ (g.map' 4 5 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app 1 = app₁


@[simp]
theorem map_id' : Filter.map (fun x => x) f = f


/-- Given a chain from `a` to `b`, and a predicate true at `b`, if `r x y → p y → p x` then
the predicate is true everywhere in the chain and at `a`.
That is, we can propagate the predicate up the chain.
-/
theorem Chain.induction (p : α → Prop) (l : List α) (h : Chain r a l)
    (hb : getLast (a :: l) (cons_ne_nil _ _) = b) (carries : ∀ ⦃x y : α⦄, r x y → p y → p x)
    (final : p b) : ∀ i ∈ a :: l, p i


theorem ite_cond_eq_true {α : Sort u} {c : Prop} {_ : Decidable c} (a b : α) (h : c = True) : (if c then a else b) = a

∀ {x : Decidable c} (a b : α), c = True → ite c a b = a


@[simp] theorem monadLift_self {m : Type u → Type v} (x : m α) : monadLift x = x

{α : Type u}
{m : Type u → Type v}
(x : m α)


theorem lcm_assoc [NormalizedGCDMonoid α] (m n k : α) : lcm (lcm m n) k = lcm m (lcm n k)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(m n k : α)


@[simp]
theorem sup_singleton {b : β} : ({b} : Finset β).sup f = f b

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{f : β → α}
{b : β}


@[to_additive (attr := simp)]
theorem piCongrRight_refl {η : Type*} {Ms : η → Type*} [∀ j, Mul (Ms j)] :
    (piCongrRight fun j => MulEquiv.refl (Ms j)) = MulEquiv.refl _

{η : Type u_12}
{Ms : η → Type u_13}
[(j : η) → Add (Ms j)]

(AddEquiv.piCongrRight fun j => AddEquiv.refl (Ms j)) = AddEquiv.refl ((j : η) → Ms j)


@[to_additive]
theorem iUnion₂_mul (s : ∀ i, κ i → Set α) (t : Set α) :
    (⋃ (i) (j), s i j) * t = ⋃ (i) (j), s i j * t

{α : Type u_2}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[Add α]
(s : (i : ι) → κ i → Set α)
(t : Set α)

(⋃ i, ⋃ j, s i j) + t = ⋃ i, ⋃ j, s i j + t


theorem le_pure_iff' : f ≤ pure a ↔ f = ⊥ ∨ f = pure a


@[simp]
theorem inf_coe : ↑(p ⊓ q) = (p ∩ q : Set M)

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p q : Submodule R M}


/-- The natural isomorphism `𝟭 (Sheaf J D) ≅ sheafToPresheaf J D ⋙ presheafToSheaf J D`. -/
@[simps!]
noncomputable def sheafificationNatIso :
    𝟭 (Sheaf J D) ≅ sheafToPresheaf J D ⋙ presheafToSheaf J D

(J : CategoryTheory.GrothendieckTopology C)

((CategoryTheory.sheafificationNatIso J D).inv.app X).val =
  CategoryTheory.sheafifyLift J (CategoryTheory.CategoryStruct.id X.val) ⋯


/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s

(s + 1).GammaIntegral = s * s.GammaIntegral


theorem Perm.product_right {l₁ l₂ : List α} (t₁ : List β) (p : l₁ ~ l₂) :
    product l₁ t₁ ~ product l₂ t₁

{α : Type u_1}
{β : Type u_2}
{l₁ l₂ : List α}
(t₁ : List β)
(p : l₁.Perm l₂)


@[to_additive]
theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∉ s) (f : α → β)
    (b : β) : ∏ x ∈ s, Function.update f i b x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
{s : Finset α}
{i : α}
(h : i ∉ s)
(f : α → β)
(b : β)


/-- The `StrongRankCondition` is automatic. See `commRing_strongRankCondition`. -/
theorem FiniteDimensional.finrank_eq_zero_iff_isTorsion {R} [CommRing R] [StrongRankCondition R]
    [IsDomain R] [Module R M] [Module.Finite R M] :
    finrank R M = 0 ↔ Module.IsTorsion R M

{M : Type v}
[AddCommGroup M]
{R : Type u_1}
[CommRing R]
[StrongRankCondition R]
[IsDomain R]
[Module R M]
[Module.Finite R M]

FiniteDimensional.finrank R M = 0 ↔ Module.IsTorsion R M


theorem IsClopen.inter (hs : IsClopen s) (ht : IsClopen t) : IsClopen (s ∩ t)

{X : Type u}
[TopologicalSpace X]
{s t : Set X}
(hs : IsClopen s)
(ht : IsClopen t)


@[reassoc (attr := simp)]
theorem Trident.app_zero (s : Trident f) (j : J) : s.π.app zero ≫ f j = s.π.app one

{J : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : J → (X ⟶ Y)}
(s : CategoryTheory.Limits.Trident f)
(j : J)

CategoryTheory.CategoryStruct.comp (s.π.app CategoryTheory.Limits.WalkingParallelFamily.zero) (f j) =
  s.π.app CategoryTheory.Limits.WalkingParallelFamily.one


/--
The balance invariant of the `ins` function.
The result of inserting into the tree either yields a balanced tree,
or a tree which is almost balanced except that it has a red-red violation at the root.
-/
protected theorem Balanced.ins (cmp v) {t : RBNode α}
    (h : t.Balanced c n) : (ins cmp v t).RedRed (t.isRed = red) n

{α : Type u_1}
{c : Batteries.RBColor}
{n : Nat}
(cmp : α → α → Ordering)
(v : α)
{t : Batteries.RBNode α}
(h : t.Balanced c n)

Batteries.RBNode.RedRed (t.isRed = Batteries.RBColor.red) (Batteries.RBNode.ins cmp v t) n


/-- An open lower half-plane (with boundary imaginary part given by an `EReal`) is an open set
in the complex plane. -/
lemma isOpen_im_lt_EReal (x : EReal) : IsOpen {z : ℂ | z.im < x}


/-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceFunctorProj (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).functor ⋙ CostructuredArrow.proj _ _ ≅ (π F).leftOp

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceFunctorProj F).inv.app X =
  CategoryTheory.CategoryStruct.id (Opposite.unop (Opposite.unop X).1)


@[simp]
theorem lintegral_deterministic {f : β → ℝ≥0∞} {g : α → β} {a : α} (hg : Measurable g)
    [MeasurableSingletonClass β] : ∫⁻ x, f x ∂deterministic g hg a = f (g a)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : β → ℝ≥0∞}
{g : α → β}
{a : α}
(hg : Measurable g)
[MeasurableSingletonClass β]

∫⁻ (x : β), f x ∂(ProbabilityTheory.Kernel.deterministic g hg) a = f (g a)


/-- An object admits an injective resolution. -/
class HasInjectiveResolution (Z : C) : Prop where
  out : Nonempty (InjectiveResolution Z)

[self : CategoryTheory.HasInjectiveResolution Z]


theorem finite_mul_iff {p a b : α} (hp : Prime p) : Finite p (a * b) ↔ Finite p a ∧ Finite p b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p a b : α}
(hp : Prime p)

multiplicity.Finite p (a * b) ↔ multiplicity.Finite p a ∧ multiplicity.Finite p b


/--
The congruences of a ring `R` biject to the congruences of the opposite ring `Rᵐᵒᵖ`.
-/
@[simps]
def opOrderIso : RingCon R ≃o RingCon Rᵐᵒᵖ

{R : Type u_1}
[Add R]
[Mul R]
(c : RingCon R)


/-- (Impl) Establish an equivalence between the category of cones for `F` and for the "grown" `F`.
-/
@[simps]
def conesEquiv (B : C) (F : Discrete J ⥤ Over B) :
    Cone (widePullbackDiagramOfDiagramOver B F) ≌ Cone F

(F : CategoryTheory.Discrete J ⥤ CategoryTheory.Over B)

(CategoryTheory.Over.ConstructProducts.conesEquiv B F).inverse =
  CategoryTheory.Over.ConstructProducts.conesEquivInverse B F


/-- `snd` is the functor `(X, Y) ↦ Y`. -/
@[simps]
def snd : C × D ⥤ D

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

∀ {X Y : C × D} (f : X ⟶ Y), (CategoryTheory.Prod.snd C D).map f = f.2


@[to_additive (attr := measurability)]
theorem _root_.Multiset.aestronglyMeasurable_prod (s : Multiset (α → M))
    (hs : ∀ f ∈ s, AEStronglyMeasurable f μ) :
    AEStronglyMeasurable (fun x => (s.map fun f : α → M => f x).prod) μ

(hs : ∀ f ∈ s, MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => (Multiset.map (fun f => f x) s).prod) μ


theorem lt_floor_add_one (a : α) : a < ⌊a⌋₊ + 1

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


theorem map_derivedSeries_le_derivedSeries (n : ℕ) :
    (derivedSeries G n).map f ≤ derivedSeries G' n

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(f : G →* G')
(n : ℕ)

Subgroup.map f (derivedSeries G n) ≤ derivedSeries G' n


theorem emod_def (a b : Int) : a % b = a - b * (a / b)


@[to_additive]
theorem map_inf_comap_of_surjective (S T : Subsemigroup N) :
    (S.comap f ⊓ T.comap f).map f = S ⊓ T

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

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


theorem ord_compl_pos {n : ℕ} (p : ℕ) (hn : n ≠ 0) : 0 < ord_compl[p] n


theorem essSup_liminf_le {ι} [Countable ι] [LinearOrder ι] (f : ι → α → ℝ≥0∞) :
    essSup (fun x => atTop.liminf fun n => f n x) μ ≤
      atTop.liminf fun n => essSup (fun x => f n x) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{ι : Type u_3}
[Countable ι]
[LinearOrder ι]
(f : ι → α → ℝ≥0∞)

essSup (fun x => Filter.liminf (fun n => f n x) Filter.atTop) μ ≤
  Filter.liminf (fun n => essSup (fun x => f n x) μ) Filter.atTop


@[simp]
theorem csInf_Ici : sInf (Ici a) = a

{α : Type u_1}
[ConditionallyCompleteLattice α]
{a : α}


/-- The Lebesgue integral is measurable. This shows that the integrand of (the right-hand-side of)
  the symmetric version of Tonelli's theorem is measurable.
  This version has the argument `f` in curried form. -/
theorem Measurable.lintegral_prod_left [SFinite μ] {f : α → β → ℝ≥0∞}
    (hf : Measurable (uncurry f)) : Measurable fun y => ∫⁻ x, f x y ∂μ

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[MeasureTheory.SFinite μ]
{f : α → β → ℝ≥0∞}
(hf : Measurable (Function.uncurry f))

Measurable fun y => ∫⁻ (x : α), f x y ∂μ


theorem upperSemicontinuousAt_biInf {p : ι → Prop} {f : ∀ i, p i → α → δ}
    (h : ∀ i hi, UpperSemicontinuousAt (f i hi) x) :
    UpperSemicontinuousAt (fun x' => ⨅ (i) (hi), f i hi x') x

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

UpperSemicontinuousAt (fun x' => ⨅ i, ⨅ (hi : p i), f i hi x') x


theorem le_of_fin_surjective [RankCondition R] {n m : ℕ} (f : (Fin n → R) →ₗ[R] Fin m → R) :
    Surjective f → m ≤ n

(R : Type u)
[Semiring R]
[RankCondition R]
{n m : ℕ}
(f : (Fin n → R) →ₗ[R] Fin m → R)


/-- When we have `[CommSemiring R]`, the function `C` is the same as `algebraMap R R[T;T⁻¹]`.
(But note that `C` is defined when `R` is not necessarily commutative, in which case
`algebraMap` is not available.)
-/
theorem C_eq_algebraMap {R : Type*} [CommSemiring R] (r : R) : C r = algebraMap R R[T;T⁻¹] r

LaurentPolynomial.C r = (algebraMap R R[T;T⁻¹]) r


theorem imageMonoFactorisation_e' {X Y : C} (f : X ⟶ Y) :
    (imageMonoFactorisation f).e = cokernel.π _ ≫ Abelian.coimageImageComparison f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Limits.HasKernels C]
[CategoryTheory.Limits.HasCokernels C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.Abelian.OfCoimageImageComparisonIsIso.imageMonoFactorisation f).e =
  CategoryTheory.Limits.cokernel.π (CategoryTheory.Limits.kernel.ι f) ≫ CategoryTheory.Abelian.coimageImageComparison f


theorem toReal_eq_toReal_iff (x y : ℝ≥0∞) :
    x.toReal = y.toReal ↔ x = y ∨ x = 0 ∧ y = ⊤ ∨ x = ⊤ ∧ y = 0


/-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
it is differentiable at `x`. -/
theorem HasFTaylorSeriesUpToOn.differentiableAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≤ n)
    (hx : s ∈ 𝓝 x) : DifferentiableAt 𝕜 f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpToOn n f p s)
(hn : 1 ≤ n)
(hx : s ∈ 𝓝 x)


@[simp]
theorem one_rpow (x : ℝ) : (1 : ℝ≥0) ^ x = 1


@[simp]
theorem liftOn₂_toFinmap {γ} (s₁ s₂ : AList β) (f : AList β → AList β → γ) (H) :
    liftOn₂ ⟦s₁⟧ ⟦s₂⟧ f H = f s₁ s₂

(H : ∀ (a₁ b₁ a₂ b₂ : AList β), a₁.entries ~ a₂.entries → b₁.entries ~ b₂.entries → f a₁ b₁ = f a₂ b₂)


theorem integrableOn_Ici_iff_integrableOn_Ioi :
    IntegrableOn f (Ici b) μ ↔ IntegrableOn f (Ioi b) μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
[PartialOrder α]
[MeasurableSingletonClass α]
{f : α → E}
{μ : MeasureTheory.Measure α}
{b : α}
[MeasureTheory.NoAtoms μ]

MeasureTheory.IntegrableOn f (Set.Ici b) μ ↔ MeasureTheory.IntegrableOn f (Set.Ioi b) μ


/-- **Uniqueness of left-invariant measures**:
Given two left-invariant measures which are finite
on compacts and regular, they coincide up to a multiplicative constant. -/
@[to_additive isAddLeftInvariant_eq_smul_of_regular]
lemma isMulLeftInvariant_eq_smul_of_regular [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    [Regular μ] [Regular μ'] :
    μ' = haarScalarFactor μ' μ • μ


@[simp]
lemma ofReal_le_one {r : ℝ} : ENNReal.ofReal r ≤ 1 ↔ r ≤ 1


theorem measurable_of_measurable_on_compl_singleton [MeasurableSingletonClass α] {f : α → β} (a : α)
    (hf : Measurable ({ x | x ≠ a }.restrict f)) : Measurable f

(hf : Measurable ({x | x ≠ a}.restrict f))


protected theorem map_sum {ι : Type*} (g : ι → R[X]) (s : Finset ι) :
    (∑ i ∈ s, g i).map f = ∑ i ∈ s, (g i).map f

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(f : R →+* S)
{ι : Type u_1}
(g : ι → R[X])
(s : Finset ι)

Polynomial.map f (∑ i ∈ s, g i) = ∑ i ∈ s, Polynomial.map f (g i)


theorem exists_eq_cons (v : Vector α n.succ) : ∃ (a : α) (as : Vector α n), v = a ::ᵥ as

{n : ℕ}
{α : Type u_1}
(v : Mathlib.Vector α n.succ)


theorem mem_rangeIcc_apply_iff : a ∈ f.rangeIcc g i ↔ f i ≤ a ∧ a ≤ g i

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

a ∈ (f.rangeIcc g) i ↔ f i ≤ a ∧ a ≤ g i


/-- If two sequences of functions have a.e. equal conditional expectations at each step, converge
and verify dominated convergence hypotheses, then the conditional expectations of their limits are
a.e. equal. -/
theorem tendsto_condexp_unique (fs gs : ℕ → α → F') (f g : α → F')
    (hfs_int : ∀ n, Integrable (fs n) μ) (hgs_int : ∀ n, Integrable (gs n) μ)
    (hfs : ∀ᵐ x ∂μ, Tendsto (fun n => fs n x) atTop (𝓝 (f x)))
    (hgs : ∀ᵐ x ∂μ, Tendsto (fun n => gs n x) atTop (𝓝 (g x))) (bound_fs : α → ℝ)
    (h_int_bound_fs : Integrable bound_fs μ) (bound_gs : α → ℝ)
    (h_int_bound_gs : Integrable bound_gs μ) (hfs_bound : ∀ n, ∀ᵐ x ∂μ, ‖fs n x‖ ≤ bound_fs x)
    (hgs_bound : ∀ n, ∀ᵐ x ∂μ, ‖gs n x‖ ≤ bound_gs x) (hfg : ∀ n, μ[fs n|m] =ᵐ[μ] μ[gs n|m]) :
    μ[f|m] =ᵐ[μ] μ[g|m]

(hfs_int : ∀ (n : ℕ), MeasureTheory.Integrable (fs n) μ)

(hgs_int : ∀ (n : ℕ), MeasureTheory.Integrable (gs n) μ)

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

(hgs : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => gs n x) Filter.atTop (𝓝 (g x)))

(h_int_bound_fs : MeasureTheory.Integrable bound_fs μ)

(h_int_bound_gs : MeasureTheory.Integrable bound_gs μ)

(hfs_bound : ∀ (n : ℕ), ∀ᵐ (x : α) ∂μ, ‖fs n x‖ ≤ bound_fs x)

(hgs_bound : ∀ (n : ℕ), ∀ᵐ (x : α) ∂μ, ‖gs n x‖ ≤ bound_gs x)

(hfg : ∀ (n : ℕ), μ[fs n|m] =ᵐ[μ] μ[gs n|m])


theorem exists_prop_of_true {p : Prop} {q : p → Prop} (h : p) : (∃ h' : p, q h') ↔ q h


theorem eventually_cofinite {p : α → Prop} : (∀ᶠ x in μ.cofinite, p x) ↔ μ { x | ¬p x } < ∞

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

(∀ᶠ (x : α) in μ.cofinite, p x) ↔ μ {x | ¬p x} < ⊤


theorem mem_traverse_iff (fs : List β) (t : Set (List α)) :
    t ∈ traverse f fs ↔
      ∃ us : List (Set α), Forall₂ (fun b (s : Set α) => s ∈ f b) fs us ∧ sequence us ⊆ t

{α β : Type u}
{f : β → Filter α}
(fs : List β)
(t : Set (List α))

t ∈ traverse f fs ↔ ∃ us, List.Forall₂ (fun b s => s ∈ f b) fs us ∧ sequence us ⊆ t


theorem isOpen_generateFrom_of_mem {g : Set (Set α)} {s : Set α} (hs : s ∈ g) :
    IsOpen[generateFrom g] s

{α : Type u}
{g : Set (Set α)}
{s : Set α}
(hs : s ∈ g)


theorem isJacobson_iff {R} [CommRing R] :
    IsJacobson R ↔ ∀ I : Ideal R, I.IsRadical → I.jacobson = I

Ideal.IsJacobson R ↔ ∀ (I : Ideal R), I.IsRadical → I.jacobson = I


theorem apply_firstDiff_ne {x y : ∀ n, E n} (h : x ≠ y) :
    x (firstDiff x y) ≠ y (firstDiff x y)

{E : ℕ → Type u_1}
{x y : (n : ℕ) → E n}
(h : x ≠ y)

x (PiNat.firstDiff x y) ≠ y (PiNat.firstDiff x y)


theorem map_rootsOfUnity (f : Mˣ →* Nˣ) (k : ℕ+) : (rootsOfUnity k M).map f ≤ rootsOfUnity k N

{M : Type u_1}
{N : Type u_2}
[CommMonoid M]
[CommMonoid N]
(f : Mˣ →* Nˣ)
(k : ℕ+)

Subgroup.map f (rootsOfUnity k M) ≤ rootsOfUnity k N


/-- Cancel right multiplication on both sides of the `≡` and in the modulus.

For cancelling right multiplication in the modulus, see `Nat.ModEq.of_mul_right`. -/
protected theorem mul_right_cancel' {a b c m : ℕ} (hc : c ≠ 0) :
    a * c ≡ b * c [MOD m * c] → a ≡ b [MOD m]


theorem think_equiv (s : Computation α) : think s ~ s


@[to_additive (attr := simp)]
theorem toDual_inv [Inv α] (a : α) : toDual a⁻¹ = (toDual a)⁻¹

OrderDual.toDual (-a) = -OrderDual.toDual a


/-- If `f` is a monotone map and `f x ≤ x` at some point `x`, then the iterates `f^[n] x` form
an antitone sequence. -/
theorem antitone_iterate_of_map_le (hf : Monotone f) (hx : f x ≤ x) : Antitone fun n => f^[n] x

{α : Type u_1}
[Preorder α]
{f : α → α}
{x : α}
(hf : Monotone f)
(hx : f x ≤ x)


{R : Type u_10}
[CommRing R]
(A B : Matrix (Fin 2) (Fin 2) R)


theorem IsBigOWith.trans_isLittleO (hfg : IsBigOWith c l f g) (hgk : g =o[l] k) (hc : 0 < c) :
    f =o[l] k

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[Norm E]
[Norm F]
[Norm G]
{c : ℝ}
{f : α → E}
{g : α → F}
{k : α → G}
{l : Filter α}
(hfg : Asymptotics.IsBigOWith c l f g)
(hgk : g =o[l] k)
(hc : 0 < c)


private lemma rangeOfWType_eq_top : rangeOfWType s = ⊤

{α : Type u}
(s : Set α)
[DivisionRing α]


@[norm_cast]
theorem coe_neg : ((-g : M [⋀^ι]→ₗ[R] N') : MultilinearMap R (fun _ : ι => M) N') = -g

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
(g : M [⋀^ι]→ₗ[R] N')


@[simp, norm_cast]
protected theorem coe_neg' {x : ℝ} : (x : EReal) < 0 ↔ x < 0


theorem erase_diff_erase_sublist_of_sublist {a : α} :
    ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → (l₂.erase a).diff (l₁.erase a) <+ l₂.diff l₁

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

l₁.Sublist l₂ → ((l₂.erase a).diff (l₁.erase a)).Sublist (l₂.diff l₁)


/-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the
category of structured arrows `op d ⟶ F.op.obj c` to the category of costructured arrows
`F.obj c ⟶ d`.
-/
@[simps]
def toCostructuredArrow' (F : C ⥤ D) (d : D) :
    (StructuredArrow (op d) F.op)ᵒᵖ ⥤ CostructuredArrow F d

(X : (CategoryTheory.StructuredArrow (Opposite.op d) F.op)ᵒᵖ)

(CategoryTheory.StructuredArrow.toCostructuredArrow' F d).obj X =
  CategoryTheory.CostructuredArrow.mk (Opposite.unop X).hom.unop


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

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


@[simp]
theorem mop_id {X : C} : (𝟙 X).mop = 𝟙 (mop X)

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


theorem HasBasis.disjoint_iff_left (h : l.HasBasis p s) :
    Disjoint l l' ↔ ∃ i, p i ∧ (s i)ᶜ ∈ l'

{α : Type u_1}
{ι : Sort u_4}
{l l' : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)


@[simp]
lemma isClique_insert : G.IsClique (insert a s) ↔ G.IsClique s ∧ ∀ b ∈ s, a ≠ b → G.Adj a b

{α : Type u_1}
{G : SimpleGraph α}
{s : Set α}
{a : α}


theorem mem_nhdsWithin_Iic_iff_exists_mem_Ico_Ioc_subset {a l' : α} {s : Set α} (hl' : l' < a) :
    s ∈ 𝓝[≤] a ↔ ∃ l ∈ Ico l' a, Ioc l a ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a l' : α}
{s : Set α}
(hl' : l' < a)

s ∈ 𝓝[≤] a ↔ ∃ l ∈ Set.Ico l' a, Set.Ioc l a ⊆ s


@[simp]
theorem toNNRat_eq_zero : toNNRat q = 0 ↔ q ≤ 0


theorem IsStrongLimit.ne_zero {c} (h : IsStrongLimit c) : c ≠ 0

{c : Cardinal.{u_2}}
(h : c.IsStrongLimit)


theorem mul_coeff_right' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPWO) (hys : y.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij ∈ addAntidiagonal x.isPWO_support hs a, x.coeff ij.fst * y.coeff ij.snd

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[NonUnitalNonAssocSemiring R]
{x y : HahnSeries Γ R}
{a : Γ}
{s : Set Γ}
(hs : s.IsPWO)
(hys : y.support ⊆ s)

(x * y).coeff a = ∑ ij ∈ Finset.addAntidiagonal ⋯ hs a, x.coeff ij.1 * y.coeff ij.2


theorem IsTheta.rpow (hr : 0 ≤ r) (hf : 0 ≤ᶠ[l] f) (hg : 0 ≤ᶠ[l] g) (h : f =Θ[l] g) :
    (fun x => f x ^ r) =Θ[l] fun x => g x ^ r

{α : Type u_1}
{r : ℝ}
{l : Filter α}
{f g : α → ℝ}
(hr : 0 ≤ r)
(hf : 0 ≤ᶠ[l] f)
(hg : 0 ≤ᶠ[l] g)
(h : f =Θ[l] g)


@[to_additive (attr := simp)]
theorem coe_one : ((1 : α →ᵇ β) : α → β) = 1

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


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

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

(CategoryTheory.Comonad.CofreeEqualizer.topMap X).f = T.map X.a


theorem trans_apply {x : X} : (e.trans e') x = e' (e x)

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


theorem hasPushout_of_left_iso : HasPushout f g

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


@[simp] lemma inv_smul_finset_distrib₀ (a : α) (s : Finset α) : (a • s)⁻¹ = op a⁻¹ • s⁻¹

{α : Type u_2}
[GroupWithZero α]
[DecidableEq α]
(a : α)
(s : Finset α)


@[simp]
theorem isCobounded_inter : IsCobounded (s ∩ t) ↔ IsCobounded s ∧ IsCobounded t

∀ {x : Bornology α} {s t : Set α}, Bornology.IsCobounded (s ∩ t) ↔ Bornology.IsCobounded s ∧ Bornology.IsCobounded t


lemma prod_ne_zero_iff : f.prod g ≠ 0 ↔ ∀ i ∈ f.support, g i (f i) ≠ 0

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
[CommMonoidWithZero γ]
[Nontrivial γ]
[NoZeroDivisors γ]
[(i : ι) → DecidableEq (β i)]
{f : Π₀ (i : ι), β i}
{g : (i : ι) → β i → γ}


@[simp]
theorem sum_coord_apply_eq_one [Fintype ι] (q : P) : ∑ i, b.coord i q = 1

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
[Fintype ι]
(q : P)


@[simp] lemma infClosure_univ : infClosure (Set.univ : Set α) = Set.univ


theorem hasTerminal_of_hasInitial_op [HasInitial Cᵒᵖ] : HasTerminal C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasInitial Cᵒᵖ]


theorem trim_sum_ge {ι} (m : ι → OuterMeasure α) : (sum fun i => (m i).trim) ≤ (sum m).trim

{α : Type u_1}
[MeasurableSpace α]
{ι : Type u_2}
(m : ι → MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.sum fun i => (m i).trim) ≤ (MeasureTheory.OuterMeasure.sum m).trim


@[to_additive]
lemma SMulCommClass.of_mul_smul_one {M N} [Monoid N] [SMul M N]
    (H : ∀ (x : M) (y : N), y * x • (1 : N) = x • y) : SMulCommClass M N N


/-- Note that `hφ = Quotient.out_eq'` is a useful choice here. -/
@[to_additive "Note that `hφ = Quotient.out_eq'` is a useful choice here."]
theorem orbitRel.Quotient.orbit_eq_orbit_out (x : orbitRel.Quotient G α)
    {φ : orbitRel.Quotient G α → α} (hφ : letI := orbitRel G α; RightInverse φ Quotient.mk') :
    orbitRel.Quotient.orbit x = MulAction.orbit G (φ x)

{φ : AddAction.orbitRel.Quotient G α → α}

(hφ : Function.RightInverse φ Quotient.mk')


theorem IsLowerSet.Iio_subset (h : IsLowerSet s) ⦃a⦄ (ha : a ∈ s) : Iio a ⊆ s

{α : Type u_1}
[Preorder α]
{s : Set α}
(h : IsLowerSet s)
⦃a : α⦄
(ha : a ∈ s)


/-- For a function on a convex set in a linearly ordered space (where the order and the algebraic
structures aren't necessarily compatible), in order to prove that it is concave it suffices to
verify the inequality `a • f x + b • f y ≤ f (a • x + b • y)` for `x < y` and positive `a`, `b`. The
main use case is `E = ℝ` however one can apply it, e.g., to `ℝ^n` with lexicographic order. -/
theorem LinearOrder.concaveOn_of_lt (hs : Convex 𝕜 s)
    (hf : ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → x < y → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 →
      a • f x + b • f y ≤ f (a • x + b • y)) :
    ConcaveOn 𝕜 s f

(hf :
  ∀ ⦃x : E⦄,
    x ∈ s → ∀ ⦃y : E⦄, y ∈ s → x < y → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → a • f x + b • f y ≤ f (a • x + b • y))


@[simp] lemma ofENat_eq_lift {x : Cardinal.{v}} {m : ℕ∞} : m = lift.{u} x ↔ m = x


theorem MDifferentiable.mfderivWithin (h : MDifferentiableAt I I' f x)
    (hxs : UniqueMDiffWithinAt I s x) : mfderivWithin I I' f s x = mfderiv I I' f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{x : M}
{s : Set M}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
(h : MDifferentiableAt I I' f x)
(hxs : UniqueMDiffWithinAt I s x)


/-- A family with at most one point is affinely independent. -/
theorem affineIndependent_of_subsingleton [Subsingleton ι] (p : ι → P) : AffineIndependent k p

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
[Subsingleton ι]
(p : ι → P)


@[to_additive] lemma mabs_ne_one : |a|ₘ ≠ 1 ↔ a ≠ 1

[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]


lemma next_eq_self (c : ComplexShape ι) (j : ι) (hj : ¬ c.Rel j (c.next j)) :
    c.next j = j

{ι : Type u_1}
(c : ComplexShape ι)
(j : ι)
(hj : ¬c.Rel j (c.next j))


@[simp]
theorem fst_intCast (n : ℤ) : (n : α × β).fst = n

{α : Type u_1}
{β : Type u_2}
[AddGroupWithOne α]
[AddGroupWithOne β]
(n : ℤ)


/-- Data exhibiting that a given factorisation through a mono is initial. -/
structure IsImage (F : MonoFactorisation f) where
  lift : ∀ F' : MonoFactorisation f, F.I ⟶ F'.I
  lift_fac : ∀ F' : MonoFactorisation f, lift F' ≫ F'.m = F.m := by aesop_cat

{F : CategoryTheory.Limits.MonoFactorisation f}

(self : CategoryTheory.Limits.IsImage F)

(F' : CategoryTheory.Limits.MonoFactorisation f)


@[to_additive (attr := simp)]
theorem map.id (x : FreeGroup α) : map id x = x


@[to_additive]
theorem ofMulEquivOfLocalizations_comp {k : N ≃* P} {j : P ≃* Q} :
    (f.ofMulEquivOfLocalizations (k.trans j)).toMap =
      j.toMonoidHom.comp (f.ofMulEquivOfLocalizations k).toMap

{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)
{Q : Type u_4}
[CommMonoid Q]
{k : N ≃* P}
{j : P ≃* Q}


@[simp]
theorem isCompact_empty : IsCompact (∅ : Set X)


@[simp, norm_cast]
theorem coe_add (p q : ℚ≥0) : ((p + q : ℚ≥0) : ℚ) = p + q


theorem Coprime.mul_add_mul_ne_mul {m n a b : ℕ} (cop : Coprime m n) (ha : a ≠ 0) (hb : b ≠ 0) :
    a * m + b * n ≠ m * n

{m n a b : ℕ}
(cop : m.Coprime n)
(ha : a ≠ 0)
(hb : b ≠ 0)


/-- The conditional expectation of the indicator of a function over an `m`-measurable set with
respect to the σ-algebra `m` is a.e. equal to the indicator of the conditional expectation. -/
theorem condexp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m])

{α : Type u_1}
{E : Type u_3}
{m m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{f : α → E}
{s : Set α}
(hf_int : MeasureTheory.Integrable f μ)
(hs : MeasurableSet s)


theorem trim_eq_iInf (s : Set α) : m.trim s = ⨅ (t) (_ : s ⊆ t) (_ : MeasurableSet t), m t

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

m.trim s = ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), m t


/-- An antitone function on a downwards-directed type is directed. -/
theorem directed_of_isDirected_ge [LE α] [IsDirected α (· ≥ ·)] {r : β → β → Prop} {f : α → β}
    (hf : ∀ a₁ a₂, a₁ ≤ a₂ → r (f a₂) (f a₁)) : Directed r f

(hf : ∀ (a₁ a₂ : α), a₁ ≤ a₂ → r (f a₂) (f a₁))


/-- One of the most useful consequences of Baire theorem: if a countable union of closed sets
covers the space, then one of the sets has nonempty interior. -/
theorem nonempty_interior_of_iUnion_of_closed [Nonempty X] [Countable ι] {f : ι → Set X}
    (hc : ∀ i, IsClosed (f i)) (hU : ⋃ i, f i = univ) : ∃ i, (interior <| f i).Nonempty

{X : Type u_1}
{ι : Sort u_3}
[TopologicalSpace X]
[BaireSpace X]
[Nonempty X]
[Countable ι]
{f : ι → Set X}
(hc : ∀ (i : ι), IsClosed (f i))
(hU : ⋃ i, f i = Set.univ)


@[continuity, fun_prop]
theorem continuous_top {t : TopologicalSpace α} : Continuous[t, ⊤] f

{α : Type u}
{β : Type v}
{f : α → β}
{t : TopologicalSpace α}


theorem iterate_le_of_map_le (h : Commute f g) (hf : Monotone f) (hg : Monotone g) {x}
    (hx : f x ≤ g x) (n : ℕ) : f^[n] x ≤ g^[n] x

{α : Type u_1}
[Preorder α]
{f g : α → α}
(h : Function.Commute f g)
(hf : Monotone f)
(hg : Monotone g)
{x : α}
(hx : f x ≤ g x)
(n : ℕ)


theorem strictConvex_iff_ordConnected : StrictConvex 𝕜 s ↔ s.OrdConnected

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{s : Set 𝕜}


@[to_additive (attr := simp)]
theorem comp_assoc (f : γ →*o δ) (g : β →*o γ) (h : α →*o β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
[Preorder δ]
[AddZeroClass α]
[AddZeroClass β]
[AddZeroClass γ]
[AddZeroClass δ]
(f : γ →+o δ)
(g : β →+o γ)
(h : α →+o β)


theorem rootMultiplicity_eq_rootMultiplicity {p : R[X]} {t : R} :
    p.rootMultiplicity t = (p.comp (X + C t)).rootMultiplicity 0

{R : Type u}
[CommRing R]
{p : R[X]}
{t : R}

Polynomial.rootMultiplicity t p = Polynomial.rootMultiplicity 0 (p.comp (Polynomial.X + Polynomial.C t))


theorem copy_eq (S : Submodule R M) (s : Set M) (hs : s = ↑S) : S.copy s hs = S

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(S : Submodule R M)
(s : Set M)
(hs : s = ↑S)


@[reassoc (attr := simp)]
lemma cyclesIsoLeftHomology_inv_hom_id (hf : S.f = 0) :
    (S.cyclesIsoLeftHomology hf).inv ≫ S.leftHomologyπ = 𝟙 _

CategoryTheory.CategoryStruct.comp (S.cyclesIsoLeftHomology hf).inv S.leftHomologyπ =
  CategoryTheory.CategoryStruct.id S.leftHomology


lemma char_ne_one [Nontrivial R] (p : ℕ) [hc : CharP R p] : p ≠ 1

(R : Type u_1)
[NonAssocSemiring R]
[Nontrivial R]
(p : ℕ)
[hc : CharP R p]


theorem not_isTop_iff_ne_top : ¬IsTop a ↔ a ≠ ⊤

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


@[simp]
theorem arsinh_neg (x : ℝ) : arsinh (-x) = -arsinh x


@[simp] theorem enumFrom_nil : ([] : List α).enumFrom i = []


theorem eq_true_of_not_eq_false' {a : Bool} : !a = false → a = true


theorem mul_le_mul_of_nonpos_of_nonpos [ExistsAddOfLE α] [MulPosMono α] [PosMulMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hca : c ≤ a) (hdb : d ≤ b) (hc : c ≤ 0) (hb : b ≤ 0) : a * b ≤ c * d

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

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


@[simp]
lemma Ioo_inr_inl : Ioo (inrₗ b) (inlₗ a) = ∅

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

Finset.Ioo (Sum.inrₗ b) (Sum.inlₗ a) = ∅


@[simp]
theorem map_id : map I (LinearMap.id (M := M)) = LinearMap.id

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]

AdicCompletion.AdicCauchySequence.map I LinearMap.id = LinearMap.id


lemma Set.Iic_ciInf [Nonempty ι] {f : ι → α} (hf : BddBelow (range f)) :
    Iic (⨅ i, f i) = ⋂ i, Iic (f i)

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[Nonempty ι]
{f : ι → α}
(hf : BddBelow (Set.range f))


@[reassoc]
theorem factorThruImage_comp_hom {X Y : A} (f : X ⟶ Y) :
    factorThruImage (L.map f) ≫ (iso L f).hom = L.map (factorThruImage f)

[{X Y Z : A} → (f : X ⟶ Z) → (g : Y ⟶ Z) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) L]

[{X Y Z : A} → (f : X ⟶ Y) → (g : X ⟶ Z) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.span f g) L]

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.factorThruImage (L.map f))
    (CategoryTheory.PreservesImage.iso L f).hom =
  L.map (CategoryTheory.Limits.factorThruImage f)


theorem map_comap_eq_self_of_surjective
    {f : R →+* S} (hf : Function.Surjective f) (t : Subring S) : (t.comap f).map f = t

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{f : R →+* S}
(hf : Function.Surjective ⇑f)
(t : Subring S)


/-- If the domain of a `PEquiv` is `α` except a point, its forward direction is injective. -/
theorem injective_of_forall_ne_isSome (f : α ≃. β) (a₂ : α)
    (h : ∀ a₁ : α, a₁ ≠ a₂ → isSome (f a₁)) : Injective f

(h : ∀ (a₁ : α), a₁ ≠ a₂ → (f a₁).isSome = true)


@[to_additive (attr := simp)]
theorem mem_prehaar_empty {K₀ : Set G} {f : Compacts G → ℝ} :
    f ∈ haarProduct K₀ ↔ ∀ K : Compacts G, f K ∈ Icc (0 : ℝ) (index (K : Set G) K₀)

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{K₀ : Set G}
{f : TopologicalSpace.Compacts G → ℝ}

f ∈ MeasureTheory.Measure.haar.haarProduct K₀ ↔
  ∀ (K : TopologicalSpace.Compacts G), f K ∈ Set.Icc 0 ↑(MeasureTheory.Measure.haar.index (↑K) K₀)


theorem fin_two_eq_of_eq_zero_iff : ∀ {a b : Fin 2}, (a = 0 ↔ b = 0) → a = b


theorem antitone_app (f : β → α → γ) (b : β) (hf : Antitone fun a b ↦ f b a) : Antitone (f b)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder γ]
(f : β → α → γ)
(b : β)
(hf : Antitone fun a b => f b a)


theorem norm_const (q : ℚ) : norm (const (padicNorm p) q) = padicNorm p q

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(q : ℚ)

PadicSeq.norm (CauSeq.const (padicNorm p) q) = padicNorm p q


/-- Equivalence of categories is transitive. -/
@[trans, simps]
def trans (e : C ≌ D) (f : D ≌ E) : C ≌ E

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(e : C ≌ D)
(f : D ≌ E)

(e.trans f).inverse = f.inverse.comp e.inverse


@[to_additive (attr := simp)]
lemma mul_smul_one {M N} [MulOneClass N] [SMul M N] [SMulCommClass M N N] (x : M) (y : N) :
    y * x • (1 : N) = x • y

{M : Type u_11}
{N : Type u_12}
[AddZeroClass N]
[VAdd M N]
[VAddCommClass M N N]
(x : M)
(y : N)


theorem digits_add_two_add_one (b n : ℕ) :
    digits (b + 2) (n + 1) = ((n + 1) % (b + 2)) :: digits (b + 2) ((n + 1) / (b + 2))


@[to_additive]
theorem subset_one_iff_eq : s ⊆ 1 ↔ s = ∅ ∨ s = 1