/-- A monoid homomorphism `f : M →* N` such that `f x` commutes with `f y` for all `x, y` defines
a monoid homomorphism to `Nᵐᵒᵖ`. -/
@[to_additive (attr := simps (config := .asFn))
      "An additive monoid homomorphism `f : M →+ N` such that `f x` additively commutes
      with `f y` for all `x, y` defines an additive monoid homomorphism to `Sᵃᵒᵖ`."]
def MonoidHom.toOpposite {M N : Type*} [MulOneClass M] [MulOneClass N] (f : M →* N)
    (hf : ∀ x y, Commute (f x) (f y)) : M →* Nᵐᵒᵖ

{M : Type u_2}
{N : Type u_3}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)
(hf : ∀ (x y : M), Commute (f x) (f y))

⇑(f.toOpposite hf) = MulOpposite.op ∘ ⇑f


theorem val_mul {n : ℕ} (a b : ZMod n) : (a * b).val = a.val * b.val % n


@[to_additive]
theorem range_mem_rightTransversals {f : Quotient (QuotientGroup.rightRel H) → G}
    (hf : ∀ q, Quotient.mk'' (f q) = q) : Set.range f ∈ rightTransversals (H : Set G)

(hf : ∀ (q : Quotient (QuotientGroup.rightRel H)), Quotient.mk'' (f q) = q)

Set.range f ∈ Subgroup.rightTransversals ↑H


@[simp]
theorem sinh_lt_self_iff : sinh x < x ↔ x < 0


theorem succ_pos : ∀ c : Cardinal, 0 < succ c


theorem derivedSeries_le_lowerCentralSeries (k : ℕ) :
    derivedSeries R L k ≤ lowerCentralSeries R L L k

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(k : ℕ)

LieAlgebra.derivedSeries R L k ≤ LieModule.lowerCentralSeries R L L k


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


/-- We say that a type has `MeasurableMul₂` if `uncurry (· * ·)` is a measurable functions.
For a typeclass assuming measurability of `(c * ·)` and `(· * c)` see `MeasurableMul`. -/
@[to_additive MeasurableAdd₂]
class MeasurableMul₂ (M : Type*) [MeasurableSpace M] [Mul M] : Prop where
  measurable_mul : Measurable fun p : M × M => p.1 * p.2

{M : Type u_2}
[MeasurableSpace M]
[Mul M]
[self : MeasurableMul₂ M]


theorem of_prim {n f} : Primrec f → @Primrec' n f


(R : Type u_1)
(n : Type u_3)
[CommRing R]
[Fintype n]
[DecidableEq n]


theorem Ico_subset_Icc_self : Ico a b ⊆ Icc a b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


theorem CondIndepSets.condIndep
    {p1 p2 : Set (Set Ω)} (h1 : m₁ ≤ mΩ) (h2 : m₂ ≤ mΩ)
    (hp1 : IsPiSystem p1) (hp2 : IsPiSystem p2)
    (hpm1 : m₁ = generateFrom p1) (hpm2 : m₂ = generateFrom p2)
    (hyp : CondIndepSets m' hm' p1 p2 μ) :
    CondIndep m' m₁ m₂ hm' μ

(hpm1 : m₁ = MeasurableSpace.generateFrom p1)

(hpm2 : m₂ = MeasurableSpace.generateFrom p2)

(hyp : ProbabilityTheory.CondIndepSets m' hm' p1 p2 μ)

ProbabilityTheory.CondIndep m' m₁ m₂ hm' μ


@[simp]
theorem comp_id (p : FormalMultilinearSeries 𝕜 E F) : p.comp (id 𝕜 E) = p

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

p.comp (FormalMultilinearSeries.id 𝕜 E) = p


@[simp]
theorem encode_decode [DecidableEq α] (s : Sym (Option α) n ⊕ Sym α n.succ) :
    encode (decode s) = s

{α : Type u_1}
{n : ℕ}
[DecidableEq α]
(s : Sym (Option α) n ⊕ Sym α n.succ)

SymOptionSuccEquiv.encode (SymOptionSuccEquiv.decode s) = s


theorem npow_mul_comm (m n : ℕ) (x : M) :
    x ^ m * x ^ n = x ^ n * x ^ m

{M : Type u_1}
[MulOneClass M]
[Pow M ℕ]
[NatPowAssoc M]
(m n : ℕ)
(x : M)


theorem Function.id_def : @id α = fun x => x


theorem map_pure_prod (f : α → β → γ) (a : α) (B : Filter β) :
    map (Function.uncurry f) (pure a ×ˢ B) = map (f a) B

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(a : α)
(B : Filter β)

Filter.map (Function.uncurry f) (pure a ×ˢ B) = Filter.map (f a) B


theorem inv_mul_lt_of_lt_mul₀ (h : a < b * c) : b⁻¹ * a < c

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c : α}
(h : a < b * c)


@[simp]
theorem sup_coe (l : List α) : sup (l : Multiset α) = l.foldr (· ⊔ ·) ⊥

{α : Type u_1}
[SemilatticeSup α]
[OrderBot α]
(l : List α)

(↑l).sup = List.foldr (fun x x_1 => x ⊔ x_1) ⊥ l


theorem multicofork_ι_app_right (b) :
    (Multicoequalizer.multicofork I).ι.app (WalkingMultispan.right b) = Multicoequalizer.π I b

(I : CategoryTheory.Limits.MultispanIndex C)

(CategoryTheory.Limits.Multicoequalizer.multicofork I).ι.app (CategoryTheory.Limits.WalkingMultispan.right b) =
  CategoryTheory.Limits.Multicoequalizer.π I b


/-- **Helly's theorem** for sets of compact convex sets.

If `F` is a set of compact convex sets in a vector space of finite dimension `d`, and any
`k ≤ d + 1` sets from `F` intersect nontrivially, then all sets from `F` intersect nontrivially. -/
theorem helly_theorem_set_compact' [TopologicalSpace E] [T2Space E] {F : Set (Set E)}
    (h_convex : ∀ X ∈ F, Convex 𝕜 X) (h_compact : ∀ X ∈ F, IsCompact X)
    (h_inter : ∀ G : Finset (Set E), (G : Set (Set E)) ⊆ F → G.card ≤ finrank 𝕜 E + 1 →
    (⋂₀ G : Set E).Nonempty) :
    (⋂₀ (F : Set (Set E))).Nonempty

(h_inter : ∀ (G : Finset (Set E)), ↑G ⊆ F → G.card ≤ FiniteDimensional.finrank 𝕜 E + 1 → (⋂₀ ↑G).Nonempty)


theorem Succ.rec_iff {p : α → Prop} (hsucc : ∀ a, p a ↔ p (succ a)) {a b : α} (h : a ≤ b) :
    p a ↔ p b

(hsucc : ∀ (a : α), p a ↔ p (Order.succ a))


lemma delta_mul {f : ℕ → ℂ} (h : f 1 = 1) : δ * f = δ


theorem ext {α : Sort*} : ∀ {s t : Setoid α},
    (∀ a b, @Setoid.r α s a b ↔ @Setoid.r α t a b) → s = t

(∀ (a b : α), Setoid.r a b ↔ Setoid.r a b) → s = t


@[simp]
theorem mk_out {α} : ∀ a : Erased α, mk (out a) = a


theorem one_apply {i j} : (1 : Matrix n n α) i j = if i = j then 1 else 0

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
[One α]
{i j : n}


/-- Let `b` be a basis for `S` over `ℤ` and `bI` a basis for `I` over `ℤ` of the same dimension.
Then an alternative way to compute the norm of `I` is given by taking the determinant of `bI`
over `b`. -/
theorem natAbs_det_basis_change {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι ℤ S)
    (I : Ideal S) (bI : Basis ι ℤ I) : (b.det ((↑) ∘ bI)).natAbs = Ideal.absNorm I

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
[Module.Finite ℤ S]
{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
(b : Basis ι ℤ S)
(I : Ideal S)
(bI : Basis ι ℤ ↥I)

(b.det (Subtype.val ∘ ⇑bI)).natAbs = Ideal.absNorm I


@[to_additive]
theorem innerContent_pos_of_is_mul_left_invariant [Group G] [TopologicalGroup G]
    (h3 : ∀ (g : G) {K : Compacts G}, μ (K.map _ <| continuous_mul_left g) = μ K) (K : Compacts G)
    (hK : μ K ≠ 0) (U : Opens G) (hU : (U : Set G).Nonempty) : 0 < μ.innerContent U

(h3 :
  ∀ (g : G) {K : TopologicalSpace.Compacts G},
    (fun s => ↑(μ.toFun s)) (TopologicalSpace.Compacts.map (fun b => g + b) ⋯ K) = (fun s => ↑(μ.toFun s)) K)


theorem AnalyticOn.eval_continuousLinearMap (f : E →L[𝕜] σ → B) (p : MvPolynomial σ B) :
    AnalyticOn 𝕜 (fun x ↦ eval (f x) p) Set.univ

{𝕜 : Type u_1}
{E : Type u_2}
{B : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedCommRing B]
[NormedAlgebra 𝕜 B]
{σ : Type u_5}
(f : E →L[𝕜] σ → B)
(p : MvPolynomial σ B)

AnalyticOn 𝕜 (fun x => (MvPolynomial.eval (f x)) p) Set.univ


@[to_additive]
theorem orderOf_eq_iff {n} (h : 0 < n) :
    orderOf x = n ↔ x ^ n = 1 ∧ ∀ m, m < n → 0 < m → x ^ m ≠ 1

{G : Type u_1}
[Monoid G]
{x : G}
{n : ℕ}
(h : 0 < n)

orderOf x = n ↔ x ^ n = 1 ∧ ∀ m < n, 0 < m → x ^ m ≠ 1


/-- Determinant of 0x0 matrix -/
@[simp]
theorem det_fin_zero {A : Matrix (Fin 0) (Fin 0) R} : det A = 1

{R : Type v}
[CommRing R]
{A : Matrix (Fin 0) (Fin 0) R}


theorem Structure.FG.mem_age_of_equiv {M N : Bundled L.Structure} (h : Structure.FG L M)
    (MN : Nonempty (M ≃[L] N)) : N ∈ L.age M

{M N : CategoryTheory.Bundled L.Structure}

(h : FirstOrder.Language.Structure.FG L ↑M)


theorem coe_ideal_span_singleton_mul_inv {x : R₁} (hx : x ≠ 0) :
    (Ideal.span ({x} : Set R₁) : FractionalIdeal R₁⁰ K) *
    (Ideal.span ({x} : Set R₁) : FractionalIdeal R₁⁰ K)⁻¹ = 1

(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{x : R₁}
(hx : x ≠ 0)

↑(Ideal.span {x}) * (↑(Ideal.span {x}))⁻¹ = 1


lemma δ_eq {A : C} (x₃ : A ⟶ S.X₃.X i) (hx₃ : x₃ ≫ S.X₃.d i j = 0)
    (x₂ : A ⟶ S.X₂.X i) (hx₂ : x₂ ≫ S.g.f i = x₃)
    (x₁ : A ⟶ S.X₁.X j) (hx₁ : x₁ ≫ S.f.f j = x₂ ≫ S.X₂.d i j)
    (k : ι) (hk : c.next j = k) :
    S.X₃.liftCycles x₃ j (c.next_eq' hij) hx₃ ≫ S.X₃.homologyπ i ≫ hS.δ i j hij =
      S.X₁.liftCycles x₁ k hk (by
        have := hS.mono_f
        rw [← cancel_mono (S.f.f k), assoc, ← S.f.comm, reassoc_of% hx₁,
          d_comp_d, comp_zero, zero_comp]) ≫ S.X₁.homologyπ j

{S : CategoryTheory.ShortComplex (HomologicalComplex C c)}

S.X₃.liftCycles x₃ j ⋯ hx₃ ≫ S.X₃.homologyπ i ≫ hS.δ i j hij = S.X₁.liftCycles x₁ k hk ⋯ ≫ S.X₁.homologyπ j


@[simp]
theorem tails_append :
    ∀ s t : List α, tails (s ++ t) = (s.tails.map fun l => l ++ t) ++ t.tails.tail

(s ++ t).tails = List.map (fun l => l ++ t) s.tails ++ t.tails.tail


lemma map_sups (f : F) (hf) (s t : Finset α) :
    map ⟨f, hf⟩ (s ⊻ t) = map ⟨f, hf⟩ s ⊻ map ⟨f, hf⟩ t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
[SemilatticeSup α]
[SemilatticeSup β]
[FunLike F α β]
[SupHomClass F α β]
(f : F)
(hf : Function.Injective ⇑f)
(s t : Finset α)

Finset.map { toFun := ⇑f, inj' := hf } (s ⊻ t) =
  Finset.map { toFun := ⇑f, inj' := hf } s ⊻ Finset.map { toFun := ⇑f, inj' := hf } t


@[simp]
theorem length_pure (a : α) : length (pure a) = 0


/-- Pseudo metric and Metric spaces

A pseudo metric space is endowed with a distance for which the requirement `d(x,y)=0 → x = y` might
not hold. A metric space is a pseudo metric space such that `d(x,y)=0 → x = y`.
Each pseudo metric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace` This is enforced in the type class definition, by extending the `UniformSpace`
structure. When instantiating a `PseudoMetricSpace` structure, the uniformity fields are not
necessary, they will be filled in by default. In the same way, each (pseudo) metric space induces a
(pseudo) emetric space structure. It is included in the structure, but filled in by default.
-/
class PseudoMetricSpace (α : Type u) extends Dist α : Type u where
  dist_self : ∀ x : α, dist x x = 0
  dist_comm : ∀ x y : α, dist x y = dist y x
  dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z
  edist : α → α → ℝ≥0∞ := fun x y => ENNReal.ofNNReal ⟨dist x y, dist_nonneg' _ ‹_› ‹_› ‹_›⟩
  edist_dist : ∀ x y : α, edist x y = ENNReal.ofReal (dist x y) := by
    intros x y; exact ENNReal.coe_nnreal_eq _
  toUniformSpace : UniformSpace α := .ofDist dist dist_self dist_comm dist_triangle
  uniformity_dist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | dist p.1 p.2 < ε } := by intros; rfl
  toBornology : Bornology α := Bornology.ofDist dist dist_comm dist_triangle
  cobounded_sets : (Bornology.cobounded α).sets =
    { s | ∃ C : ℝ, ∀ x ∈ sᶜ, ∀ y ∈ sᶜ, dist x y ≤ C } := by intros; rfl

{α : Type u}
[self : PseudoMetricSpace α]


@[to_additive (attr := simp)]
theorem mulLeft_symm (a : G) : (Equiv.mulLeft a).symm = Equiv.mulLeft a⁻¹

Equiv.symm (Equiv.mulLeft a) = Equiv.mulLeft a⁻¹


@[to_additive (attr := simp)]
theorem flip_apply {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} (f : M →* N →* P)
    (x : M) (y : N) : f.flip y x = f x y

{M : Type uM}
{N : Type uN}
{P : Type uP}

∀ {x : AddZeroClass M} {x_1 : AddZeroClass N} {x_2 : AddCommMonoid P} (f : M →+ N →+ P) (x_3 : M) (y : N),
  (f.flip y) x_3 = (f x_3) y


@[simp]
theorem presheafToTypes_obj {T : X → Type v} {U : (Opens X)ᵒᵖ} :
    (presheafToTypes X T).obj U = ∀ x : U.unop, T x

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

(X.presheafToTypes T).obj U = ((x : ↥(Opposite.unop U)) → T ↑x)


/-- The Haar measure equals the Lebesgue measure on `ℝ^ι`. -/
theorem addHaarMeasure_eq_volume_pi (ι : Type*) [Fintype ι] :
    addHaarMeasure (piIcc01 ι) = volume

MeasureTheory.Measure.addHaarMeasure (TopologicalSpace.PositiveCompacts.piIcc01 ι) = MeasureTheory.volume


/-- Construct a pseudofunctor from an oplax functor whose `mapId` and `mapComp` are isomorphisms. -/
@[simps!]
noncomputable def mkOfOplax' (F : OplaxFunctor B C) [∀ a, IsIso (F.mapId a)]
    [∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), IsIso (F.mapComp f g)] : Pseudofunctor B C

[∀ (a : B), CategoryTheory.IsIso (F.mapId a)]

[∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c), CategoryTheory.IsIso (F.mapComp f g)]

(CategoryTheory.Pseudofunctor.mkOfOplax' F).toPrelaxFunctor = F.toPrelaxFunctor


/-- A category has all finite colimits if every functor `J ⥤ C` with a `FinCategory J`
instance and `J : Type` has a colimit.

This is often called 'finitely cocomplete'.
-/
class HasFiniteColimits : Prop where
  /-- `C` has all colimits over any type `J` whose objects and morphisms lie in the same universe
  and which has `Fintype` objects and morphisms-/
  out (J : Type) [𝒥 : SmallCategory J] [@FinCategory J 𝒥] : @HasColimitsOfShape J 𝒥 C _

[self : CategoryTheory.Limits.HasFiniteColimits C]


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

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

∀ {X Y : CategoryTheory.Comma L₂ R} (f : X ⟶ Y), ((CategoryTheory.Comma.mapLeftIso R i).inverse.map f).left = f.left


theorem InfPrime.finset_inf_le (ha : InfPrime a) : s.inf f ≤ a ↔ ∃ i ∈ s, f i ≤ a

{ι : Type u_1}
{α : Type u_2}
[SemilatticeInf α]
{a : α}
[OrderTop α]
{s : Finset ι}
{f : ι → α}
(ha : InfPrime a)


/-- If the action of a countable group `G` admits an invariant measure `μ` with a fundamental domain
`s`, then every null-measurable set `t` of measure strictly greater than `μ s` contains two
points `x y` such that `g • x = y` for some `g ≠ 1`. -/
@[to_additive "If the additive action of a countable group `G` admits an invariant measure `μ` with
  a fundamental domain `s`, then every null-measurable set `t` of measure strictly greater than
  `μ s` contains two points `x y` such that `g +ᵥ x = y` for some `g ≠ 0`."]
theorem exists_ne_one_smul_eq (hs : IsFundamentalDomain G s μ) (htm : NullMeasurableSet t μ)
    (ht : μ s < μ t) : ∃ x ∈ t, ∃ y ∈ t, ∃ g, g ≠ (1 : G) ∧ g • x = y

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.IsAddFundamentalDomain G s μ)

(htm : MeasureTheory.NullMeasurableSet t μ)

∃ x ∈ t, ∃ y ∈ t, ∃ g, g ≠ 0 ∧ g +ᵥ x = y


/-- The only numbers with empty prime factorization are `0` and `1` -/
theorem factorization_eq_zero_iff' (n : ℕ) : n.factorization = 0 ↔ n = 0 ∨ n = 1


/-- Consider a series of functions `∑' n, f n x`. If the series converges at a
point, and all functions in the series are differentiable with a summable bound on the derivatives,
then the series is differentiable and its derivative is the sum of the derivatives. -/
theorem hasDerivAt_tsum (hu : Summable u) (hg : ∀ n y, HasDerivAt (g n) (g' n y) y)
    (hg' : ∀ n y, ‖g' n y‖ ≤ u n) (hg0 : Summable fun n => g n y₀) (y : 𝕜) :
    HasDerivAt (fun z => ∑' n, g n z) (∑' n, g' n y) y

(hg : ∀ (n : α) (y : 𝕜), HasDerivAt (g n) (g' n y) y)

(hg' : ∀ (n : α) (y : 𝕜), ‖g' n y‖ ≤ u n)

HasDerivAt (fun z => ∑' (n : α), g n z) (∑' (n : α), g' n y) y


theorem compatibility_Γ₂N₁_Γ₂N₂_natTrans (X : SimplicialObject C) :
    Γ₂N₁.natTrans.app X =
      (Γ₂N₂ToKaroubiIso.app X).inv ≫
        Γ₂N₂.natTrans.app ((toKaroubi (SimplicialObject C)).obj X)

AlgebraicTopology.DoldKan.Γ₂N₁.natTrans.app X =
  (AlgebraicTopology.DoldKan.Γ₂N₂ToKaroubiIso.app X).inv ≫
    AlgebraicTopology.DoldKan.Γ₂N₂.natTrans.app
      ((CategoryTheory.Idempotents.toKaroubi (CategoryTheory.SimplicialObject C)).obj X)


theorem comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B

(R : Type u)
[CommSemiring R]
(A : Type u)
[CommSemiring A]
[Algebra R A]
(B : Type u)
[Semiring B]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
[Algebra.FormallySmooth R A]
[Algebra.FormallySmooth A B]


/-- If `E1` and `E2` are finite-dimensional intermediate fields, then so is their compositum.
This rephrases a result already in mathlib so that it is compatible with our type classes -/
theorem finiteDimensional_sup {K L : Type*} [Field K] [Field L] [Algebra K L]
    (E1 E2 : IntermediateField K L) (_ : FiniteDimensional K E1) (_ : FiniteDimensional K E2) :
    FiniteDimensional K (↥(E1 ⊔ E2))

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

FiniteDimensional K ↥E1 → FiniteDimensional K ↥E2 → FiniteDimensional K ↥(E1 ⊔ E2)


/-- Two nonnegative real exponents `p, q` are conjugate if they are `> 1` and satisfy the equality
`1/p + 1/q = 1`. This condition shows up in many theorems in analysis, notably related to `L^p`
norms. -/
@[mk_iff]
structure IsConjExponent (p q : ℝ≥0) : Prop where
  one_lt : 1 < p
  inv_add_inv_conj : p⁻¹ + q⁻¹ = 1

{p q : NNReal}
(self : p.IsConjExponent q)


lemma card_image_of_injOn {f : α → β} (hf : s.InjOn f) : Nat.card (f '' s) = Nat.card s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f : α → β}
(hf : Set.InjOn f s)


theorem lt_succ_self (x : s) : x < succ x

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


/-- Two homomorphisms out of a free group are equal if they are equal on generators.

See note [partially-applied ext lemmas]. -/
@[to_additive (attr := ext) "Two homomorphisms out of a free additive group are equal if they are
  equal on generators. See note [partially-applied ext lemmas]."]
theorem ext_hom {G : Type*} [Group G] (f g : FreeGroup α →* G) (h : ∀ a, f (of a) = g (of a)) :
    f = g

(h : ∀ (a : α), f (FreeAddGroup.of a) = g (FreeAddGroup.of a))


/-- `Cardinal.lift` as an `OrderEmbedding`. -/
@[simps! (config := .asFn)]
def liftOrderEmbedding : Cardinal.{v} ↪o Cardinal.{max v u}

⇑Cardinal.liftOrderEmbedding = Cardinal.lift.{u, v}


theorem filter_range_nth_eq_insert_of_finite (hf : (setOf p).Finite) {k : ℕ}
    (hlt : k + 1 < hf.toFinset.card) :
    (range (nth p (k + 1))).filter p = insert (nth p k) ((range (nth p k)).filter p)

{p : ℕ → Prop}
[DecidablePred p]
(hf : (setOf p).Finite)
{k : ℕ}
(hlt : k + 1 < hf.toFinset.card)

Finset.filter p (Finset.range (Nat.nth p (k + 1))) = insert (Nat.nth p k) (Finset.filter p (Finset.range (Nat.nth p k)))


protected theorem neg_nonneg_of_nonpos {a : Int} (h : a ≤ 0) : 0 ≤ -a


@[to_additive]
theorem mem_smul_filter : s ∈ a • f ↔ (a • ·) ⁻¹' s ∈ f

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter β}
{s : Set β}
{a : α}


lemma Monotone.frequently_le_map_of_frequently_le {f : R → S} (f_incr : Monotone f)
    {u : R} (freq_le : ∃ᶠ x in F, x ≤ u) :
    ∃ᶠ y in F.map f, y ≤ f u

{R : Type u_6}
{S : Type u_7}
{F : Filter R}
[LinearOrder R]
[LinearOrder S]
{f : R → S}
(f_incr : Monotone f)
{u : R}
(freq_le : ∃ᶠ (x : R) in F, x ≤ u)


@[simp]
theorem Ico_union_Icc_eq_Icc (h₁ : a ≤ b) (h₂ : b ≤ c) : Ico a b ∪ Icc b c = Icc a c

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


theorem stronglyMeasurable_in_set {m : MeasurableSpace α} [TopologicalSpace β] [Zero β] {s : Set α}
    {f : α → β} (hs : MeasurableSet s) (hf : StronglyMeasurable f)
    (hf_zero : ∀ x, x ∉ s → f x = 0) :
    ∃ fs : ℕ → α →ₛ β,
      (∀ x, Tendsto (fun n => fs n x) atTop (𝓝 (f x))) ∧ ∀ x ∉ s, ∀ n, fs n x = 0

(hf : MeasureTheory.StronglyMeasurable f)

∃ fs, (∀ (x : α), Filter.Tendsto (fun n => ↑(fs n) x) Filter.atTop (𝓝 (f x))) ∧ ∀ x ∉ s, ∀ (n : ℕ), ↑(fs n) x = 0


theorem Function.injective_iff_pairwise_ne : Injective f ↔ Pairwise ((· ≠ ·) on f)

{α : Type u_1}
{ι : Type u_4}
{f : ι → α}

Function.Injective f ↔ Pairwise ((fun x x_1 => x ≠ x_1) on f)


lemma _root_.Finset.eventuallyLE_iUnion {ι : Type*} (s : Finset ι) {f g : ι → Set α}
    (hle : ∀ i ∈ s, f i ≤ᶠ[l] g i) : (⋃ i ∈ s, f i) ≤ᶠ[l] (⋃ i ∈ s, g i)

{α : Type u}
{l : Filter α}
{ι : Type u_2}
(s : Finset ι)
{f g : ι → Set α}
(hle : ∀ i ∈ s, f i ≤ᶠ[l] g i)


theorem prop_of_isGood  {l : Products I} (J : I → Prop) [∀ j, Decidable (J j)]
    (h : l.isGood (π C J)) : ∀ a, a ∈ l.val → J a

{l : Profinite.NobelingProof.Products I}

(h : Profinite.NobelingProof.Products.isGood (Profinite.NobelingProof.π C J) l)


@[to_additive]
theorem MulHom.cancel_left [Mul M] [Mul N] [Mul P] {g : N →ₙ* P} {f₁ f₂ : M →ₙ* N}
    (hg : Function.Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[Mul M]
[Mul N]
[Mul P]
{g : N →ₙ* P}
{f₁ f₂ : M →ₙ* N}
(hg : Function.Injective ⇑g)


/-- The tensor product functor from `C × C` to `C` as a monoidal functor. -/
@[simps!]
def tensorMonoidal : MonoidalFunctor (C × C) C

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

(CategoryTheory.tensorMonoidal C).map f = f.1 ⊗ f.2


@[simp]
lemma FamilyOfElements.map_apply
    (p : FamilyOfElements P R) (φ : P ⟶ Q) {Y : C} (f : Y ⟶ X) (hf : R f) :
    p.map φ f hf = φ.app _ (p f hf)

{P Q : CategoryTheory.Functor Cᵒᵖ (Type w)}

(p : CategoryTheory.Presieve.FamilyOfElements P R)

p.map φ f hf = φ.app (Opposite.op Y) (p f hf)


theorem exists_le_le [LE α] [IsDirected α (· ≥ ·)] (a b : α) : ∃ c, c ≤ a ∧ c ≤ b

{α : Type u}
[LE α]
[IsDirected α fun x x_1 => x ≥ x_1]
(a b : α)


lemma measurable_memPartitionSet_subtype (ht : ∀ n, MeasurableSet (t n)) (n : ℕ)
    (m : MeasurableSpace (memPartition t n)) :
    @Measurable α (memPartition t n) (partitionFiltration ht n) m
      (fun a ↦ ⟨memPartitionSet t n a, memPartitionSet_mem t n a⟩)

{α : Type u_1}
[m : MeasurableSpace α]
{t : ℕ → Set α}
(ht : ∀ (n : ℕ), MeasurableSet (t n))
(n : ℕ)

∀ (m_1 : MeasurableSpace ↑(memPartition t n)), Measurable fun a => ⟨memPartitionSet t n a, ⋯⟩


theorem norm_vComp_le (t : ℝ) : ‖f.vComp t‖ ≤ v.C

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f : v.FunSpace)
(t : ℝ)


@[simp] theorem get_cons_succ : get (x :: xs) (i+1) = get xs i

Lean.Omega.IntList.get (x :: xs) (i + 1) = Lean.Omega.IntList.get xs i


theorem Admissible.one_lt_sumInv {pqr : Multiset ℕ+} : Admissible pqr → 1 < sumInv pqr

ADEInequality.Admissible pqr → 1 < ADEInequality.sumInv pqr


@[simp]
theorem mem_mk {x : α} {U : Set α} {h : IsOpen U} : x ∈ mk U h ↔ x ∈ U

{α : Type u_2}
[TopologicalSpace α]
{x : α}
{U : Set α}
{h : IsOpen U}

x ∈ { carrier := U, is_open' := h } ↔ x ∈ U


/-- If `f` and `g` are isomorphic arrows, then a mono factorisation of `f`
gives a mono factorisation of `g` -/
@[simps]
def ofArrowIso {f g : Arrow C} (F : MonoFactorisation f.hom) (sq : f ⟶ g) [IsIso sq] :
    MonoFactorisation g.hom

(F : CategoryTheory.Limits.MonoFactorisation f.hom)

(F.ofArrowIso sq).e = CategoryTheory.inv sq.left ≫ F.e


theorem le_toNNReal_iff_coe_le {r : ℝ≥0} {p : ℝ} (hp : 0 ≤ p) : r ≤ Real.toNNReal p ↔ ↑r ≤ p


@[reassoc]
theorem additiveObjIsoBiproduct_naturality' (F : Mat_ C ⥤ D) [Functor.Additive F] {M N : Mat_ C}
    (f : M ⟶ N) :
    (additiveObjIsoBiproduct F M).inv ≫ F.map f =
      biproduct.matrix (fun i j => F.map ((embedding C).map (f i j)) : _) ≫
        (additiveObjIsoBiproduct F N).inv

(CategoryTheory.Mat_.additiveObjIsoBiproduct F M).inv ≫ F.map f =
  (CategoryTheory.Limits.biproduct.matrix fun i j => F.map ((CategoryTheory.Mat_.embedding C).map (f i j))) ≫
    (CategoryTheory.Mat_.additiveObjIsoBiproduct F N).inv


theorem pure_le_nhds : pure ≤ (𝓝 : X → Filter X)


theorem natSepDegree_mul_of_isCoprime (g : F[X]) (hc : IsCoprime f g) :
    (f * g).natSepDegree = f.natSepDegree + g.natSepDegree

{F : Type u}
[Field F]
(f g : F[X])
(hc : IsCoprime f g)


private theorem zero_def : 0 = mk (abv := abv) 0

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]


theorem lt_aleph0_iff_finite {α : Type u} : #α < ℵ₀ ↔ Finite α

Cardinal.mk α < Cardinal.aleph0 ↔ Finite α


/-- Elements of the `α` root space which are Killing-orthogonal to the `-α` root space are
Killing-orthogonal to all of `L`. -/
lemma mem_ker_killingForm_of_mem_rootSpace_of_forall_rootSpace_neg
    {α : H → K} {x : L} (hx : x ∈ rootSpace H α)
    (hx' : ∀ y ∈ rootSpace H (-α), killingForm K L x y = 0) :
    x ∈ LinearMap.ker (killingForm K L)

(hx' : ∀ y ∈ LieAlgebra.rootSpace H (-α), ((killingForm K L) x) y = 0)


theorem eLpNorm'_le_eLpNormEssSup_mul_rpow_measure_univ {q : ℝ} (hq_pos : 0 < q) :
    eLpNorm' f q μ ≤ eLpNormEssSup f μ * μ Set.univ ^ (1 / q)

{α : Type u_1}
{E : Type u_2}
{m : MeasurableSpace α}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{f : α → E}
{q : ℝ}
(hq_pos : 0 < q)

MeasureTheory.eLpNorm' f q μ ≤ MeasureTheory.eLpNormEssSup f μ * μ Set.univ ^ (1 / q)


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

{α : Type u_1}
[TopologicalSpace α]
[LE α]
(s t : ClopenUpperSet α)


theorem set_biInter_finset_image {f : γ → α} {g : α → Set β} {s : Finset γ} :
    ⋂ x ∈ s.image f, g x = ⋂ y ∈ s, g (f y)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[DecidableEq α]
{f : γ → α}
{g : α → Set β}
{s : Finset γ}

⋂ x ∈ Finset.image f s, g x = ⋂ y ∈ s, g (f y)


theorem mem_thickening_iff_infDist_lt {E : Set X} {x : X} (h : E.Nonempty) :
    x ∈ thickening δ E ↔ infDist x E < δ

{δ : ℝ}
{X : Type u}
[PseudoMetricSpace X]
{E : Set X}
{x : X}
(h : E.Nonempty)

x ∈ Metric.thickening δ E ↔ Metric.infDist x E < δ


@[to_additive (attr := simp)]
theorem mker_inl : mker (inl M N) = ⊥

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

AddMonoidHom.mker (AddMonoidHom.inl M N) = ⊥


/-- Any integrable function can be approximated by bounded continuous functions,
version in terms of `∫⁻`. -/
theorem Integrable.exists_boundedContinuous_lintegral_sub_le [μ.WeaklyRegular] {f : α → E}
    (hf : Integrable f μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ g : α →ᵇ E, (∫⁻ x, ‖f x - g x‖₊ ∂μ) ≤ ε ∧ Integrable g μ

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[MeasurableSpace α]
[BorelSpace α]
{E : Type u_2}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[μ.WeaklyRegular]
{f : α → E}
(hf : MeasureTheory.Integrable f μ)
{ε : ℝ≥0∞}
(hε : ε ≠ 0)

∃ g, ∫⁻ (x : α), ↑‖f x - g x‖₊ ∂μ ≤ ε ∧ MeasureTheory.Integrable (⇑g) μ


theorem nhdsWithin_prod {α : Type*} [TopologicalSpace α] {β : Type*} [TopologicalSpace β]
    {s u : Set α} {t v : Set β} {a : α} {b : β} (hu : u ∈ 𝓝[s] a) (hv : v ∈ 𝓝[t] b) :
    u ×ˢ v ∈ 𝓝[s ×ˢ t] (a, b)

{α : Type u_5}
[TopologicalSpace α]
{β : Type u_6}
[TopologicalSpace β]
{s u : Set α}
{t v : Set β}
{a : α}
{b : β}
(hu : u ∈ 𝓝[s] a)
(hv : v ∈ 𝓝[t] b)


theorem proj_pi (i : ι) : (proj i).comp (pi fp) = fp i

{k : Type u_2}
{V1 : Type u_3}
{P1 : Type u_4}
[Ring k]
[AddCommGroup V1]
[AffineSpace V1 P1]
[Module k V1]
{ι : Type u_9}
{φv : ι → Type u_10}
{φp : ι → Type u_11}
[(i : ι) → AddCommGroup (φv i)]
[(i : ι) → Module k (φv i)]
[(i : ι) → AffineSpace (φv i) (φp i)]
(fp : (i : ι) → P1 →ᵃ[k] φp i)
(i : ι)

(AffineMap.proj i).comp (AffineMap.pi fp) = fp i


@[to_additive]
theorem image_inter_image_iff (U V : Set α) :
    letI := orbitRel G α
    Quotient.mk' '' U ∩ Quotient.mk' '' V = ∅ ↔ ∀ x ∈ U, ∀ g : G, g • x ∉ V

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
(U V : Set α)

Quotient.mk' '' U ∩ Quotient.mk' '' V = ∅ ↔ ∀ x ∈ U, ∀ (g : G), g • x ∉ V


theorem log_mul_self_monotoneOn : MonotoneOn (fun x : ℝ => log x * x) { x | 1 ≤ x }

MonotoneOn (fun x => Real.log x * x) {x | 1 ≤ x}


@[simp]
theorem dfinsupp_sum_apply (t : Π₀ i, γ i) (g : ∀ i, γ i → M →ₛₗ[σ₁₂] M₂) (b : M) :
    (t.sum g) b = t.sum fun i d => g i d b

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

(t.sum g) b = t.sum fun i d => (g i d) b


@[to_additive]
theorem image_finset_prod (f : F) (m : Finset ι) (s : ι → Set α) :
    ((f : α → β) '' ∏ i ∈ m, s i) = ∏ i ∈ m, f '' s i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
{F : Type u_4}
[FunLike F α β]
[AddCommMonoid α]
[AddCommMonoid β]
[AddMonoidHomClass F α β]
(f : F)
(m : Finset ι)
(s : ι → Set α)


theorem KaehlerDifferential.kerTotal_mkQ_single_smul (r : R) (x y) : (y𝖣r • x) = r • y𝖣x

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(r : R)
(x y : S)

(KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single (r • x) y) =
  r • (KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single x y)


theorem mem_range_self (f : R →ₙ+* S) (x : R) : f x ∈ f.range

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
(f : R →ₙ+* S)
(x : R)


@[to_additive]
protected theorem inj [Mul α] [PartialOrder α] {a b c : α} (ha : MulLECancellable a) :
    a * b = a * c ↔ b = c

{α : Type u_1}
[Mul α]
[PartialOrder α]
{a b c : α}
(ha : MulLECancellable a)


@[simp]
theorem truncateAugment_hom_f (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0)
    (w : f ≫ C.d 0 1 = 0) (i : ℕ) : (truncateAugment C f w).hom.f i = 𝟙 (C.X i)

(C.truncateAugment f w).hom.f i = 𝟙 (C.X i)


theorem uniformContinuous_def [UniformSpace β] {f : α → β} :
    UniformContinuous f ↔ ∀ r ∈ 𝓤 β, { x : α × α | (f x.1, f x.2) ∈ r } ∈ 𝓤 α

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]
{f : α → β}

UniformContinuous f ↔ ∀ r ∈ 𝓤 β, {x | (f x.1, f x.2) ∈ r} ∈ 𝓤 α


theorem IsOpen.subset_interior_iff (h₁ : IsOpen s) : s ⊆ interior t ↔ s ⊆ t

{X : Type u}
{s t : Set X}
[TopologicalSpace X]
(h₁ : IsOpen s)


@[simp]
theorem coe_const (b : β) : ⇑(const α b) = Function.const α b

(α : Type u_3)
{β : Type u_4}
[Inf α]
[SemilatticeInf β]
(b : β)

⇑(InfHom.const α b) = Function.const α b


theorem mk'_mem_maximal_iff (x : R) (y : I.primeCompl) (h : LocalRing S := localRing S I) :
    mk' S x y ∈ LocalRing.maximalIdeal S ↔ x ∈ I

{R : Type u_1}
[CommSemiring R]
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
(I : Ideal R)
[hI : I.IsPrime]
[IsLocalization.AtPrime S I]
(x : R)
(y : ↥I.primeCompl)
(h : LocalRing S := ⋯)

IsLocalization.mk' S x y ∈ LocalRing.maximalIdeal S ↔ x ∈ I


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


@[simp]
theorem coeff_expand_mul' {p : ℕ} (hp : 0 < p) (f : R[X]) (n : ℕ) :
    (expand R p f).coeff (p * n) = f.coeff n

{R : Type u}
[CommSemiring R]
{p : ℕ}
(hp : 0 < p)
(f : R[X])
(n : ℕ)

((Polynomial.expand R p) f).coeff (p * n) = f.coeff n


@[simp]
lemma overEquiv_top {X : C} (Y : Over X) :
    overEquiv Y ⊤ = ⊤

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : C}
(Y : CategoryTheory.Over X)

(CategoryTheory.Sieve.overEquiv Y) ⊤ = ⊤


/-- Pull an opposite subsemiring back to a subsemiring along `MulOpposite.op` -/
@[simps toSubmonoid]
protected def unop (S : Subsemiring Rᵐᵒᵖ) : Subsemiring R

{R : Type u_2}
[NonAssocSemiring R]
(S : Subsemiring Rᵐᵒᵖ)


@[simp]
theorem comp_apply (f : β →CO γ) (g : α →CO β) (a : α) : (f.comp g) a = f (g a)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
(f : β →CO γ)
(g : α →CO β)
(a : α)


theorem trinomial_natTrailingDegree (hkm : k < m) (hmn : m < n) (hu : u ≠ 0) :
    (trinomial k m n u v w).natTrailingDegree = k

{R : Type u_1}
[Semiring R]
{k m n : ℕ}
{u v w : R}
(hkm : k < m)
(hmn : m < n)
(hu : u ≠ 0)

(Polynomial.trinomial k m n u v w).natTrailingDegree = k


theorem smul_nonpos {f : ι → Ω → F} {c : ℝ} (hc : c ≤ 0) (hf : Submartingale f ℱ μ) :
    Supermartingale (c • f) ℱ μ

(hf : MeasureTheory.Submartingale f ℱ μ)

MeasureTheory.Supermartingale (c • f) ℱ μ


lemma mul_coe_eq_bind {b : α} (hb : b ≠ 0) : ∀ a, (a * b : WithBot α) = a.bind fun a ↦ ↑(a * b)

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
{b : α}
(hb : b ≠ 0)
(a : WithBot α)

a * ↑b = Option.bind a fun a => some (a * b)


@[to_additive (attr := simp)]
theorem bot_div : ⊥ / g = ⊥


lemma one_le_pow (n m : ℕ) (h : 0 < m) : 1 ≤ m ^ n


theorem IsCycle.inv (hf : IsCycle f) : IsCycle f⁻¹

{α : Type u_2}
{f : Equiv.Perm α}
(hf : f.IsCycle)


theorem single_algebraMap_eq_algebraMap_mul_of {A : Type*} [CommSemiring k] [Semiring A]
    [Algebra k A] [Monoid G] (a : G) (b : k) :
    single a (algebraMap k A b) = algebraMap k (MonoidAlgebra A G) b * of A G a

{k : Type u₁}
{G : Type u₂}
{A : Type u_3}
[CommSemiring k]
[Semiring A]
[Algebra k A]
[Monoid G]
(a : G)
(b : k)

MonoidAlgebra.single a ((algebraMap k A) b) = (algebraMap k (MonoidAlgebra A G)) b * (MonoidAlgebra.of A G) a


@[simp]
theorem toFun_eq_coe_aux {f : CoheytingHom α β} : (↑f.toLatticeHom) = ⇑f

{α : Type u_2}
{β : Type u_3}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
{f : CoheytingHom α β}


@[simp]
theorem neg_eq_neg_one : neg = -1


/-- A morphism between coalgebras of an endofunctor `F` -/
@[ext]
structure Hom (V₀ V₁ : Coalgebra F) where
  /-- underlying morphism between two carriers -/
  f : V₀.1 ⟶ V₁.1
  /-- compatibility condition -/
  h : V₀.str ≫ F.map f = f ≫ V₁.str := by aesop_cat

{V₀ V₁ : CategoryTheory.Endofunctor.Coalgebra F}

CategoryTheory.CategoryStruct.comp V₀.str (F.map self.f) = CategoryTheory.CategoryStruct.comp self.f V₁.str


theorem comap_comp (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
    (g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) : comap (g.comp f) = comap f ∘ comap g

MvPolynomial.comap (g.comp f) = MvPolynomial.comap f ∘ MvPolynomial.comap g


theorem count_of [DecidableEq α] (x y : α) :
    count x (of y) = @Pi.mulSingle α (fun _ => Multiplicative ℕ) _ _ x (Multiplicative.ofAdd 1) y

{α : Type u_1}
[DecidableEq α]
(x y : α)

(FreeMonoid.count x) (FreeMonoid.of y) = Pi.mulSingle x (Multiplicative.ofAdd 1) y


/-- The obvious functor `(J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)`. -/
@[simps]
def inverse : (J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)

∀ {X Y : CategoryTheory.Functor J (CategoryTheory.ShortComplex C)} (φ : X ⟶ Y),
  ((CategoryTheory.ShortComplex.FunctorEquivalence.inverse J C).map φ).τ₁ =
    CategoryTheory.whiskerRight φ CategoryTheory.ShortComplex.π₁


theorem zeroLocus_mul_ideal (I J : Ideal A) :
    zeroLocus 𝒜 ((I * J : Ideal A) : Set A) = zeroLocus 𝒜 I ∪ zeroLocus 𝒜 J

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(I J : Ideal A)

ProjectiveSpectrum.zeroLocus 𝒜 ↑(I * J) = ProjectiveSpectrum.zeroLocus 𝒜 ↑I ∪ ProjectiveSpectrum.zeroLocus 𝒜 ↑J


/-- Let `R : α → ℝ` be a (possibly discontinuous) positive function on a proper metric space. Then
there exists a collection of pairs of balls `Metric.ball (c i) (r i)`, `Metric.ball (c i) (r' i)`
such that

* for all `i` we have `0 < r i < r' i < R (c i)`;
* the family of balls `Metric.ball (c i) (r' i)` is locally finite;
* the balls `Metric.ball (c i) (r i)` cover the whole space.

This is a simple corollary of `refinement_of_locallyCompact_sigmaCompact_of_nhds_basis`
and `exists_iUnion_ball_eq_radius_pos_lt` or `exists_locallyFinite_subset_iUnion_ball_radius_lt`. -/
theorem exists_locallyFinite_iUnion_eq_ball_radius_lt {R : α → ℝ} (hR : ∀ x, 0 < R x) :
    ∃ (ι : Type u) (c : ι → α) (r r' : ι → ℝ),
      (∀ i, 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
        (LocallyFinite fun i => ball (c i) (r' i)) ∧ ⋃ i, ball (c i) (r i) = univ

{α : Type u}
[MetricSpace α]
[ProperSpace α]
{R : α → ℝ}
(hR : ∀ (x : α), 0 < R x)

∃ ι c r r',
  (∀ (i : ι), 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
    (LocallyFinite fun i => Metric.ball (c i) (r' i)) ∧ ⋃ i, Metric.ball (c i) (r i) = Set.univ


theorem EqOn.inter_preimage_eq (heq : EqOn f₁ f₂ s) (t : Set β) : s ∩ f₁ ⁻¹' t = s ∩ f₂ ⁻¹' t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}
(heq : Set.EqOn f₁ f₂ s)
(t : Set β)


@[simp]
theorem finSumFinEquiv_symm_apply_natAdd (x : Fin n) :
    finSumFinEquiv.symm (Fin.natAdd m x) = Sum.inr x


@[simp]
theorem mul_im (z w : ℤ√d) : (z * w).im = z.re * w.im + z.im * w.re


theorem op_ne_zero_iff [Zero α] (a : α) : op a ≠ (0 : αᵐᵒᵖ) ↔ a ≠ (0 : α)


theorem ContDiff.csin {n} (h : ContDiff ℂ n f) : ContDiff ℂ n fun x => Complex.sin (f x)

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


@[elab_as_elim]
theorem isNat.natElim {p : ℕ → Prop} : {n : ℕ} → {n' : ℕ} → IsNat n n' → p n' → p n

Mathlib.Meta.NormNum.IsNat n n' → p n' → p n


theorem Int.coprime_of_sq_sum {r s : ℤ} (h2 : IsCoprime s r) : IsCoprime (r ^ 2 + s ^ 2) r


/-- We may construct a glue data from a family of open sets. -/
@[simps! toGlueData_J toGlueData_U toGlueData_V toGlueData_t toGlueData_f]
def ofOpenSubsets : TopCat.GlueData.{u}

{α : Type u}
[TopologicalSpace α]
{J : Type u}
(U : J → TopologicalSpace.Opens α)

∀
  (a :
    (TopCat.GlueData.MkCore.mk (fun i => (TopologicalSpace.Opens.toTopCat (TopCat.of α)).obj (U i))
        (fun i j => (TopologicalSpace.Opens.map (U i).inclusion).obj (U j))
        (fun i j => { toFun := fun x => ⟨⟨↑↑x, ⋯⟩, ⋯⟩, continuous_toFun := ⋯ }) ⋯ ⋯ ⋯ ⋯).J),
  (TopCat.GlueData.ofOpenSubsets U).U a = (TopologicalSpace.Opens.toTopCat (TopCat.of α)).obj (U a)


/-- If an indexed family of points is affinely independent, so is the
corresponding set of points. -/
protected theorem AffineIndependent.range {p : ι → P} (ha : AffineIndependent k p) :
    AffineIndependent k (fun x => x : Set.range p → P)

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


theorem innerContent_mono' ⦃U V : Set G⦄ (hU : IsOpen U) (hV : IsOpen V) (h2 : U ⊆ V) :
    μ.innerContent ⟨U, hU⟩ ≤ μ.innerContent ⟨V, hV⟩

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
⦃U V : Set G⦄
(hU : IsOpen U)
(hV : IsOpen V)
(h2 : U ⊆ V)

μ.innerContent { carrier := U, is_open' := hU } ≤ μ.innerContent { carrier := V, is_open' := hV }


/-- Combine two equivalences using `PProd` in the domain and `Prod` in the codomain. -/
@[simps! apply symm_apply]
def pprodProd (ea : α₁ ≃ α₂) (eb : β₁ ≃ β₂) :
    PProd α₁ β₁ ≃ α₂ × β₂

{α₁ : Sort u_1}
{α₂ : Type u_2}
{β₁ : Sort u_3}
{β₂ : Type u_4}
(ea : α₁ ≃ α₂)
(eb : β₁ ≃ β₂)

∀ (a : PProd α₁ β₁), (ea.pprodProd eb) a = (ea a.fst, eb a.snd)


theorem USize.le_antisymm {x y : USize} (h1 : x ≤ y) (h2 : y ≤ x) : x = y


theorem not_infiniteRk (M : Matroid α) [FiniteRk M] : ¬ InfiniteRk M

{α : Type u_1}
(M : Matroid α)
[M.FiniteRk]


/-- `pure : α → Ultrafilter α` defines a dense inducing of `α` in `Ultrafilter α`. -/
theorem denseInducing_pure : @DenseInducing _ _ ⊥ _ (pure : α → Ultrafilter α)


theorem iUnion_congr_of_surjective {f : ι → Set α} {g : ι₂ → Set α} (h : ι → ι₂) (h1 : Surjective h)
    (h2 : ∀ x, g (h x) = f x) : ⋃ x, f x = ⋃ y, g y

{α : Type u_1}
{ι : Sort u_4}
{ι₂ : Sort u_6}
{f : ι → Set α}
{g : ι₂ → Set α}
(h : ι → ι₂)
(h1 : Function.Surjective h)
(h2 : ∀ (x : ι), g (h x) = f x)


theorem Ioc_mem_nhdsWithin_Iic' (H : a < b) : Ioc a b ∈ 𝓝[≤] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b : α}
(H : a < b)


theorem henstock_le_riemann : Henstock ≤ Riemann


lemma dist_le_dist_of_le_pi (ha : a₂ ≤ a₁) (h₁ : a₁ ≤ b₁) (hb : b₁ ≤ b₂) :
    dist a₁ b₁ ≤ dist a₂ b₂

{ι : Type u_2}
[Fintype ι]
{a₁ a₂ b₁ b₂ : ι → ℝ}
(ha : a₂ ≤ a₁)
(h₁ : a₁ ≤ b₁)
(hb : b₁ ≤ b₂)


theorem filterMap_congr {f g : α → Option β} {l : List α}
    (h : ∀ x ∈ l, f x = g x) : l.filterMap f = l.filterMap g

{α : Type u}
{β : Type v}
{f g : α → Option β}
{l : List α}
(h : ∀ (x : α), x ∈ l → f x = g x)


theorem AECover.comp_tendsto {α ι ι' : Type*} [MeasurableSpace α] {μ : Measure α} {l : Filter ι}
    {l' : Filter ι'} {φ : ι → Set α} (hφ : AECover μ l φ) {u : ι' → ι} (hu : Tendsto u l' l) :
    AECover μ l' (φ ∘ u)

{α : Type u_1}
{ι : Type u_2}
{ι' : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
{l' : Filter ι'}
{φ : ι → Set α}
(hφ : MeasureTheory.AECover μ l φ)
{u : ι' → ι}
(hu : Filter.Tendsto u l' l)


/-- Every linear isometry on a real finite dimensional Hilbert space is measure-preserving. -/
theorem measurePreserving : MeasurePreserving f

{E : Type u_2}
{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
[FiniteDimensional ℝ F]
[MeasurableSpace F]
[BorelSpace F]
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(f : E ≃ₗᵢ[ℝ] F)

MeasureTheory.MeasurePreserving (⇑f) MeasureTheory.volume MeasureTheory.volume


@[simp]
theorem neg_smul_finset : -a • t = -(a • t)

{α : Type u_2}
{β : Type u_3}
[Ring α]
[AddCommGroup β]
[Module α β]
[DecidableEq β]
{t : Finset β}
{a : α}


theorem restrict_def {α β} (f : α → β) (p : α → Prop) :
    restrict p f = f ∘ (fun (a : Subtype p) ↦ a)

{α : Sort u_4}
{β : Type u_5}
(f : α → β)
(p : α → Prop)


theorem π_tensor_id_preserves_coequalizer_inv_desc {W X Y Z : C} (f g : X ⟶ Y) (h : Y ⊗ Z ⟶ W)
    (wh : (f ▷ Z) ≫ h = (g ▷ Z) ≫ h) :
    (coequalizer.π f g ▷ Z) ≫
        (PreservesCoequalizer.iso (tensorRight Z) f g).inv ≫ coequalizer.desc h wh =
      h

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

CategoryTheory.Limits.coequalizer.π f g ▷ Z ≫
    (CategoryTheory.Limits.PreservesCoequalizer.iso (CategoryTheory.MonoidalCategory.tensorRight Z) f g).inv ≫
      CategoryTheory.Limits.coequalizer.desc h wh =
  h


theorem holor_index_cons_decomp (p : HolorIndex (d :: ds) → Prop) :
    ∀ t : HolorIndex (d :: ds),
      (∀ i is, ∀ h : t.1 = i :: is, p ⟨i :: is, by rw [← h]; exact t.2⟩) → p t

{d : ℕ}
{ds : List ℕ}
(p : HolorIndex (d :: ds) → Prop)
(t : HolorIndex (d :: ds))

(∀ (i : ℕ) (is : List ℕ) (h : ↑t = i :: is), p ⟨i :: is, ⋯⟩) → p t


theorem summable_nat_add (f : ℕ → ℝ≥0) (hf : Summable f) (k : ℕ) : Summable fun i => f (i + k)

(f : ℕ → NNReal)
(hf : Summable f)
(k : ℕ)


@[simp]
theorem map₂Right'_cons_cons :
    map₂Right' f (a :: as) (b :: bs) =
      let r := map₂Right' f as bs
      (f (some a) b :: r.fst, r.snd)

{α : Type u}
{β : Type v}
{γ : Type w}
(f : Option α → β → γ)
(a : α)
(as : List α)
(b : β)
(bs : List β)

List.map₂Right' f (a :: as) (b :: bs) =
  let r := List.map₂Right' f as bs;
  (f (some a) b :: r.1, r.2)


@[simp, norm_cast]
theorem of_natCast {α} [AddMonoidWithOne α] (n : ℕ) : ((n : Num) : α) = n

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


@[grind_norm] theorem cond_eq_ite (c : Bool) (a b : α) : cond c a b = ite c a b

(bif c then a else b) = if c = true then a else b


theorem finite_mul {p a b : α} (hp : Prime p) : Finite p a → Finite p b → Finite p (a * b)

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

multiplicity.Finite p a → multiplicity.Finite p b → multiplicity.Finite p (a * b)


theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
    image₂ f s (t.image g) = image₂ (fun a b => f a (g b)) s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
[DecidableEq γ]
[DecidableEq δ]
{s : Finset α}
{t : Finset β}
(f : α → γ → δ)
(g : β → γ)

Finset.image₂ f s (Finset.image g t) = Finset.image₂ (fun a b => f a (g b)) s t


/-- The category of bicones on a given diagram. -/
@[simps]
instance Bicone.category : Category (Bicone F)


@[to_additive]
theorem inter_div_union_subset_union : s₁ ∩ s₂ / (t₁ ∪ t₂) ⊆ s₁ / t₁ ∪ s₂ / t₂

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

s₁ ∩ s₂ - (t₁ ∪ t₂) ⊆ s₁ - t₁ ∪ (s₂ - t₂)


theorem innerContent_le (U : Opens G) (K : Compacts G) (h2 : (U : Set G) ⊆ K) :
    μ.innerContent U ≤ μ K

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
(U : TopologicalSpace.Opens G)
(K : TopologicalSpace.Compacts G)
(h2 : ↑U ⊆ ↑K)

μ.innerContent U ≤ (fun s => ↑(μ.toFun s)) K


@[simp]
theorem image2_right (h : s.Nonempty) : image2 (fun _ y => y) s t = t

{α : Type u_1}
{β : Type u_3}
{s : Set α}
{t : Set β}
(h : s.Nonempty)


theorem range_toProdMulOpposite :
    Set.range toProdMulOpposite =
      { lr : (A →L[𝕜] A) × (A →L[𝕜] A)ᵐᵒᵖ | ∀ x y, unop lr.2 x * y = x * lr.1 y }

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

Set.range DoubleCentralizer.toProdMulOpposite = {lr | ∀ (x y : A), (MulOpposite.unop lr.2) x * y = x * lr.1 y}


theorem archimedean_iff_int_le : Archimedean α ↔ ∀ x : α, ∃ n : ℤ, x ≤ n


/-- Canonical isomorphism between linear combinations and the span of linearly independent vectors.
-/
@[simps (config := { rhsMd := default }) symm_apply]
def LinearIndependent.totalEquiv (hv : LinearIndependent R v) :
    (ι →₀ R) ≃ₗ[R] span R (range v)

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hv : LinearIndependent R v)

∀ (a : ↥(Submodule.span R (Set.range v))),
  hv.totalEquiv.symm a =
    ((LinearEquiv.ofInjective (LinearMap.codRestrict (Submodule.span R (Set.range v)) (Finsupp.total ι M R v) ⋯)
                ⋯).toEquiv.trans
          (LinearEquiv.ofTop
              (LinearMap.range (LinearMap.codRestrict (Submodule.span R (Set.range v)) (Finsupp.total ι M R v) ⋯))
              ⋯).toEquiv).invFun
      a


protected theorem Continuous.inversion (hc : Continuous c) (hR : Continuous R) (hx : Continuous x)
    (hne : ∀ a, x a ≠ c a) : Continuous (fun a ↦ inversion (c a) (R a) (x a))

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{X : Type u_3}
[TopologicalSpace X]
{c x : X → P}
{R : X → ℝ}
(hc : Continuous c)
(hR : Continuous R)
(hx : Continuous x)
(hne : ∀ (a : X), x a ≠ c a)

Continuous fun a => EuclideanGeometry.inversion (c a) (R a) (x a)


lemma measurable_preCDF' {ρ : Measure (α × ℝ)} :
    Measurable fun a r ↦ (preCDF ρ r a).toReal

{α : Type u_1}
{mα : MeasurableSpace α}
{ρ : MeasureTheory.Measure (α × ℝ)}

Measurable fun a r => (ProbabilityTheory.preCDF ρ r a).toReal


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

{R : Type u}
[CommSemiring R]
{x y z : R}


/-- The set of points which are isolated on the left is countable when the space is
second-countable. -/
theorem countable_setOf_covBy_left [OrderTopology α] [SecondCountableTopology α] :
    Set.Countable { x : α | ∃ y, y ⋖ x }

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]


theorem isSheaf_iff_isSheaf_comp (s : A ⥤ B) [HasLimitsOfSize.{v₁, max v₁ u₁} A]
    [PreservesLimitsOfSize.{v₁, max v₁ u₁} s] [s.ReflectsIsomorphisms] :
    IsSheaf J P ↔ IsSheaf J (P ⋙ s)

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Limits.HasLimitsOfSize.{v₁, max v₁ u₁, v₂, u₂} A]

[CategoryTheory.Limits.PreservesLimitsOfSize.{v₁, max v₁ u₁, v₂, v₃, u₂, u₃} s]

CategoryTheory.Presheaf.IsSheaf J P ↔ CategoryTheory.Presheaf.IsSheaf J (P.comp s)


theorem mono_iff_injective_of_preservesPullback {X Y : C} (f : X ⟶ Y)
    [PreservesLimitsOfShape WalkingCospan (forget C)] : Mono f ↔ Function.Injective f

[CategoryTheory.Limits.PreservesLimitsOfShape CategoryTheory.Limits.WalkingCospan (CategoryTheory.forget C)]

CategoryTheory.Mono f ↔ Function.Injective ⇑f


theorem of_convergence_epsilon :
    ∀ ε > (0 : K), ∃ N : ℕ, ∀ n ≥ N, |v - (of v).convs n| < ε

{K : Type u_1}
(v : K)
[LinearOrderedField K]
[FloorRing K]
[Archimedean K]
(ε : K)

ε > 0 → ∃ N, ∀ n ≥ N, |v - (GenContFract.of v).convs n| < ε


theorem ne_zero_of_mul_eq_one (I J : FractionalIdeal R₁⁰ K) (h : I * J = 1) : I ≠ 0

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
(I J : FractionalIdeal R₁⁰ K)
(h : I * J = 1)


@[to_additive mem_approx_add_orderOf_iff]
theorem mem_approxOrderOf_iff {A : Type*} [SeminormedGroup A] {n : ℕ} {δ : ℝ} {a : A} :
    a ∈ approxOrderOf A n δ ↔ ∃ b : A, orderOf b = n ∧ a ∈ ball b δ

{A : Type u_1}
[SeminormedGroup A]
{n : ℕ}
{δ : ℝ}
{a : A}

a ∈ approxOrderOf A n δ ↔ ∃ b, orderOf b = n ∧ a ∈ Metric.ball b δ


@[simp] theorem natAbs_eq_zero : natAbs a = 0 ↔ a = 0


protected theorem IsMaxOn.closure (h : IsMaxOn f s a) (hc : ContinuousOn f (closure s)) :
    IsMaxOn f (closure s) a

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[Preorder Y]
[OrderClosedTopology Y]
{f : X → Y}
{s : Set X}
{a : X}
(h : IsMaxOn f s a)
(hc : ContinuousOn f (closure s))


/-- A topological space with discrete topology is separable iff it is countable. -/
theorem separableSpace_iff_countable [DiscreteTopology α] : SeparableSpace α ↔ Countable α

{α : Type u}
[t : TopologicalSpace α]
[DiscreteTopology α]

TopologicalSpace.SeparableSpace α ↔ Countable α


theorem coe_ofInjective_symm {α β} {f : α → β} (hf : Injective f) :
    ((ofInjective f hf).symm : range f → α) = rangeSplitting f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Injective f)

⇑(Equiv.ofInjective f hf).symm = Set.rangeSplitting f


theorem isPWO_iff_exists_monotone_subseq :
    s.IsPWO ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g)

s.IsPWO ↔ ∀ (f : ℕ → α), (∀ (n : ℕ), f n ∈ s) → ∃ g, Monotone (f ∘ ⇑g)


theorem dvd_or_coprime (x y : α) (h : Irreducible x) :
    x ∣ y ∨ IsCoprime x y

{α : Type u_1}
[EuclideanDomain α]
(x y : α)
(h : Irreducible x)


@[simp]
theorem IsInvariantSubring.coe_subtypeHom :
    (IsInvariantSubring.subtypeHom M U : U → R') = Subtype.val

(M : Type u_1)
[Monoid M]
{R' : Type u_2}
[Ring R']
[MulSemiringAction M R']
(U : Subring R')
[IsInvariantSubring M U]

⇑(IsInvariantSubring.subtypeHom M U) = Subtype.val


protected theorem OpenEmbedding.measurableEmbedding {f : α → β} (h : OpenEmbedding f) :
    MeasurableEmbedding f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[TopologicalSpace β]
[MeasurableSpace β]
[BorelSpace β]
{f : α → β}
(h : OpenEmbedding f)


@[ext]
theorem ext :
    ∀ {l : List ι} (_ : l.Nodup) {v w : TProd α l}
      (_ : ∀ (i) (hi : i ∈ l), v.elim hi = w.elim hi), v = w

{ι : Type u}
{α : ι → Type v}
[DecidableEq ι]
{l : List ι}

l.Nodup → ∀ {v w : List.TProd α l}, (∀ (i : ι) (hi : i ∈ l), v.elim hi = w.elim hi) → v = w


@[simp]
theorem self_trans_symm (f : M₁ ≃ₛₗ[σ₁₂] M₂) : f.trans f.symm = LinearEquiv.refl R₁ M₁

{R₁ : Type u_2}
{R₂ : Type u_3}
{M₁ : Type u_9}
{M₂ : Type u_10}
[Semiring R₁]
[Semiring R₂]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
(f : M₁ ≃ₛₗ[σ₁₂] M₂)


theorem continuousWithinAt_Iio_iff_Iic {a : α} {f : α → β} :
    ContinuousWithinAt f (Iio a) a ↔ ContinuousWithinAt f (Iic a) a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[PartialOrder α]
[TopologicalSpace β]
{a : α}
{f : α → β}

ContinuousWithinAt f (Set.Iio a) a ↔ ContinuousWithinAt f (Set.Iic a) a


/-- When `t` is supported on `s`, `f ∈ s.finsupp t` precisely means that `f` is pointwise in `t`. -/
@[simp]
theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.support ⊆ s) :
    f ∈ s.finsupp t ↔ ∀ i, f i ∈ t i

{ι : Type u_1}
{α : Type u_2}
[Zero α]
{s : Finset ι}
{f : ι →₀ α}
{t : ι →₀ Finset α}
(ht : t.support ⊆ s)


/-- The sup of the directions of two nonempty affine subspaces with empty intersection is less than
the direction of their sup. -/
theorem sup_direction_lt_of_nonempty_of_inter_empty {s1 s2 : AffineSubspace k P}
    (h1 : (s1 : Set P).Nonempty) (h2 : (s2 : Set P).Nonempty) (he : (s1 ∩ s2 : Set P) = ∅) :
    s1.direction ⊔ s2.direction < (s1 ⊔ s2).direction

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{s1 s2 : AffineSubspace k P}
(h1 : (↑s1).Nonempty)
(h2 : (↑s2).Nonempty)
(he : ↑s1 ∩ ↑s2 = ∅)


@[simp]
theorem IsSymm.sub {A B : Matrix n n α} [Sub α] (hA : A.IsSymm) (hB : B.IsSymm) : (A - B).IsSymm

{α : Type u_1}
{n : Type u_3}
{A B : Matrix n n α}
[Sub α]
(hA : A.IsSymm)
(hB : B.IsSymm)


@[simp]
lemma bnot_isNone (a : Option α) : (! a.isNone) = a.isSome


/-- Pre-images of ample sets under continuous affine equivalences are ample. -/
theorem preimage {s : Set F} (h : AmpleSet s) (L : E ≃ᵃL[ℝ] F) : AmpleSet (L ⁻¹' s)

{F : Type u_1}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
{s : Set F}
(h : AmpleSet s)
(L : E ≃ᵃL[ℝ] F)


/-- The upper shadow of the empty set is empty. -/
@[simp]
theorem upShadow_empty : ∂⁺ (∅ : Finset (Finset α)) = ∅

{α : Type u_1}
[DecidableEq α]
[Fintype α]


theorem IsTopologicalBasis.open_iff_eq_sUnion {B : Set (Set α)} (hB : IsTopologicalBasis B)
    {u : Set α} : IsOpen u ↔ ∃ S ⊆ B, u = ⋃₀ S

(hB : TopologicalSpace.IsTopologicalBasis B)


theorem le_lt_asymm {x y : Int} (h₁ : y ≤ x) (h₂ : x < y) : False


@[to_additive isBounded_iff_forall_norm_le]
lemma isBounded_iff_forall_norm_le' : Bornology.IsBounded s ↔ ∃ C, ∀ x ∈ s, ‖x‖ ≤ C

{E : Type u_3}
[SeminormedAddGroup E]
{s : Set E}


theorem rotateR_node (sz : ℕ) (l : Ordnode α) (x : α) (m : Ordnode α) (y : α) (r : Ordnode α) :
    rotateR (node sz l x m) y r =
      if size m < ratio * size l then node3R l x m y r else node4R l x m y r

{α : Type u_1}
(sz : ℕ)
(l : Ordnode α)
(x : α)
(m : Ordnode α)
(y : α)
(r : Ordnode α)

(Ordnode.node sz l x m).rotateR y r = if m.size < Ordnode.ratio * l.size then l.node3R x m y r else l.node4R x m y r


theorem liftRel_map {δ} (R : α → β → Prop) (S : γ → δ → Prop) {s1 : Computation α}
    {s2 : Computation β} {f1 : α → γ} {f2 : β → δ} (h1 : LiftRel R s1 s2)
    (h2 : ∀ {a b}, R a b → S (f1 a) (f2 b)) : LiftRel S (map f1 s1) (map f2 s2)

Computation.LiftRel S (Computation.map f1 s1) (Computation.map f2 s2)


@[aesop safe destruct (rule_sets := [CategoryTheory])]
lemma false_of_to_star {X : C} (f : of X ⟶ star) : False

(f : CategoryTheory.WithInitial.of X ⟶ CategoryTheory.WithInitial.star)


/-- Left translation preserves concavity. -/
theorem ConcaveOn.translate_left (hf : ConcaveOn 𝕜 s f) (c : E) :
    ConcaveOn 𝕜 ((fun z => c + z) ⁻¹' s) (f ∘ fun z => z + c)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
(c : E)


@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b


/-- The identity triangle morphism.
-/
@[simps]
def triangleMorphismId (T : Triangle C) : TriangleMorphism T T

(T : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.triangleMorphismId T).hom₁ = 𝟙 T.obj₁


{α : Type u}
[NonAssocSemiring α]
(n : α)


theorem ucs_eq_self_of_normalizer_eq_self (h : N₁.normalizer = N₁) (k : ℕ) : N₁.ucs k = N₁

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{N₁ : LieSubmodule R L M}
(h : N₁.normalizer = N₁)
(k : ℕ)


@[simp]
theorem map_inl (f : M →ₗ[R'] N) (r : R') : map f (inl r) = inl r

{R' : Type u}
{M : Type v}
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]
{N : Type u_3}
[AddCommMonoid N]
[Module R' N]
[Module R'ᵐᵒᵖ N]
[IsCentralScalar R' N]
(f : M →ₗ[R'] N)
(r : R')

(TrivSqZeroExt.map f) (TrivSqZeroExt.inl r) = TrivSqZeroExt.inl r


theorem segment_subset_iff :
    [x -[𝕜] y] ⊆ s ↔ ∀ a b : 𝕜, 0 ≤ a → 0 ≤ b → a + b = 1 → a • x + b • y ∈ s

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

[x-[𝕜]y] ⊆ s ↔ ∀ (a b : 𝕜), 0 ≤ a → 0 ≤ b → a + b = 1 → a • x + b • y ∈ s


@[deprecated gauge_ball (since := "2023-07-24")]
theorem gauge_ball' (hr : 0 < r) (x : E) : gauge (ball (0 : E) r) x = ‖x‖ / r

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{r : ℝ}
(hr : 0 < r)
(x : E)


theorem mkPiRing_eq_iff {z₁ z₂ : M} :
    ContinuousMultilinearMap.mkPiRing R ι z₁ = ContinuousMultilinearMap.mkPiRing R ι z₂ ↔
      z₁ = z₂

{R : Type u}
{ι : Type v}
{M : Type u_1}
[Fintype ι]
[CommRing R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace R]
[TopologicalSpace M]
[ContinuousMul R]
[ContinuousSMul R M]
{z₁ z₂ : M}


theorem eventually_smallSets' {p : Set α → Prop} (hp : ∀ ⦃s t⦄, s ⊆ t → p t → p s) :
    (∀ᶠ s in l.smallSets, p s) ↔ ∃ s ∈ l, p s

(hp : ∀ ⦃s t : Set α⦄, s ⊆ t → p t → p s)

(∀ᶠ (s : Set α) in l.smallSets, p s) ↔ ∃ s ∈ l, p s


@[simp]
theorem cancel_left {g : SupBotHom β γ} {f₁ f₂ : SupBotHom α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
[Sup γ]
[Bot γ]
{g : SupBotHom β γ}
{f₁ f₂ : SupBotHom α β}
(hg : Function.Injective ⇑g)


@[simp]
theorem condCount_empty_meas : (condCount ∅ : Measure Ω) = 0


@[simp]
theorem opensRange_fromSpec : Scheme.Hom.opensRange hU.fromSpec = U

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)

AlgebraicGeometry.Scheme.Hom.opensRange hU.fromSpec = U


@[to_additive]
theorem inter_mul_union_subset : s ∩ t * (s ∪ t) ⊆ s * t

{α : Type u_2}
[CommSemigroup α]
{s t : Set α}


@[simp, norm_cast]
lemma ofReal_lt_zero {x : ℝ} : (x : K) < 0 ↔ x < 0


@[simp] theorem quickCmpAux_iff_eq : ∀ {n n'}, quickCmpAux n n' = .eq ↔ n = n'


theorem tendsto_atTop (e : α ≃o β) : Tendsto e atTop atTop

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(e : α ≃o β)

Filter.Tendsto (⇑e) Filter.atTop Filter.atTop


theorem image_univ_of_surjective [Fintype β] {f : β → α} (hf : Surjective f) :
    univ.image f = univ

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq α]
[Fintype β]
{f : β → α}
(hf : Function.Surjective f)

Finset.image f Finset.univ = Finset.univ


theorem cthickening_mem_nhdsSet (E : Set α) {δ : ℝ} (hδ : 0 < δ) : cthickening δ E ∈ 𝓝ˢ E

{α : Type u}
[PseudoEMetricSpace α]
(E : Set α)
{δ : ℝ}
(hδ : 0 < δ)


lemma Algebra.intTrace_eq_trace [Module.Free A B] : Algebra.intTrace A B = Algebra.trace A B

(A : Type u_1)
(B : Type u_4)
[CommRing A]
[CommRing B]
[Algebra A B]
[IsDomain A]
[IsIntegrallyClosed A]
[IsDomain B]
[IsIntegrallyClosed B]
[Module.Finite A B]
[NoZeroSMulDivisors A B]
[Module.Free A B]


@[to_additive (attr := simp)] lemma leOnePart_eq_inv : a⁻ᵐ = a⁻¹ ↔ a ≤ 1

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


@[reassoc]
lemma totalShift₂Iso_hom_naturality [L.HasTotal (up ℤ)] :
    total.map ((shiftFunctor₂ C y).map f) (up ℤ) ≫ (L.totalShift₂Iso y).hom =
      (K.totalShift₂Iso y).hom ≫ (total.map f (up ℤ))⟦y⟧'

{K L : HomologicalComplex₂ C (ComplexShape.up ℤ) (ComplexShape.up ℤ)}

HomologicalComplex₂.total.map ((HomologicalComplex₂.shiftFunctor₂ C y).map f) (ComplexShape.up ℤ) ≫
    (L.totalShift₂Iso y).hom =
  (K.totalShift₂Iso y).hom ≫
    (CategoryTheory.shiftFunctor (HomologicalComplex C (ComplexShape.up ℤ)) y).map
      (HomologicalComplex₂.total.map f (ComplexShape.up ℤ))


/-- Two nonzero vectors `x y` in a real normed space are on the same ray if and only if the unit
vectors `‖x‖⁻¹ • x` and `‖y‖⁻¹ • y` are equal. -/
theorem sameRay_iff_inv_norm_smul_eq_of_ne (hx : x ≠ 0) (hy : y ≠ 0) :
    SameRay ℝ x y ↔ ‖x‖⁻¹ • x = ‖y‖⁻¹ • y

{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{x y : F}
(hx : x ≠ 0)
(hy : y ≠ 0)


lemma isIso_opcyclesMap_of_isIso_of_epi' (φ : S₁ ⟶ S₂) (h₂ : IsIso φ.τ₂) (h₁ : Epi φ.τ₁)
    [S₁.HasRightHomology] [S₂.HasRightHomology] :
    IsIso (opcyclesMap φ)


/-- A function `f : X → Y` between topological spaces is inducing if the topology on `X` is induced
by the topology on `Y` through `f`, meaning that a set `s : Set X` is open iff it is the preimage
under `f` of some open set `t : Set Y`. -/
@[mk_iff]
structure Inducing (f : X → Y) : Prop where
  /-- The topology on the domain is equal to the induced topology. -/
  induced : tX = tY.induced f

{X : Type u_1}
{Y : Type u_2}
[tX : TopologicalSpace X]
[tY : TopologicalSpace Y]
(f : X → Y)

Inducing f ↔ tX = TopologicalSpace.induced f tY


theorem IsClosed.closure_interior_subset {s : Set X} (s_closed : IsClosed s) :
    closure (interior s) ⊆ s

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


/-- If vectors `v₁` and `v₂` are on the same ray, then for some nonnegative `a b`, `a + b = 1`, we
have `v₁ = a • (v₁ + v₂)` and `v₂ = b • (v₁ + v₂)`. -/
theorem exists_eq_smul_add (h : SameRay R v₁ v₂) :
    ∃ a b : R, 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ v₁ = a • (v₁ + v₂) ∧ v₂ = b • (v₁ + v₂)

{R : Type u_1}
[LinearOrderedField R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{v₁ v₂ : M}
(h : SameRay R v₁ v₂)

∃ a b, 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ v₁ = a • (v₁ + v₂) ∧ v₂ = b • (v₁ + v₂)


theorem dist_tri_left (n m : ℕ) : m ≤ dist n m + n


@[simp] theorem isEmpty_nil : ([] : List α).isEmpty = true


theorem toLinearEquiv_toLinearMap : ((e : A ≃ₗ[R] B) : A →ₗ[R] B) = (e : A →ₗc[R] B)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(e : A ≃ₗc[R] B)


@[ghost_simps]
theorem ghostComponent_frobeniusFun (n : ℕ) (x : 𝕎 R) :
    ghostComponent n (frobeniusFun x) = ghostComponent (n + 1) x

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

(WittVector.ghostComponent n) x.frobeniusFun = (WittVector.ghostComponent (n + 1)) x


theorem finRotate_last' : finRotate (n + 1) ⟨n, by omega⟩ = ⟨0, Nat.zero_lt_succ _⟩


theorem UnivLE.ofEssSurj (w : (uliftFunctor.{u, v} : Type v ⥤ Type max u v).EssSurj) :
    UnivLE.{max u v, v}

(w : CategoryTheory.uliftFunctor.{u, v}.EssSurj)


@[simp]
theorem cycleOf_zpow_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) :
    ∀ n : ℤ, (cycleOf f x ^ n) x = (f ^ n) x

{α : Type u_2}
(f : Equiv.Perm α)
[DecidableRel f.SameCycle]
(x : α)
(n : ℤ)


theorem add_tsub_cancel_iff_le : a + (b - a) = b ↔ a ≤ b

{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
{a b : α}


@[simp] theorem Proj.add_apply : (s + t).1 x = s.1 x + t.1 x

{V : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ}

(s t : ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj V))


theorem destutter'_of_chain (h : l.Chain R a) : l.destutter' R a = a :: l

{α : Type u_1}
(l : List α)
(R : α → α → Prop)
[DecidableRel R]
{a : α}
(h : List.Chain R a l)


theorem kroneckerMap_add_left [Add α] [Add γ] (f : α → β → γ)
    (hf : ∀ a₁ a₂ b, f (a₁ + a₂) b = f a₁ b + f a₂ b) (A₁ A₂ : Matrix l m α) (B : Matrix n p β) :
    kroneckerMap f (A₁ + A₂) B = kroneckerMap f A₁ B + kroneckerMap f A₂ B

(f : α → β → γ)

(hf : ∀ (a₁ a₂ : α) (b : β), f (a₁ + a₂) b = f a₁ b + f a₂ b)

Matrix.kroneckerMap f (A₁ + A₂) B = Matrix.kroneckerMap f A₁ B + Matrix.kroneckerMap f A₂ B


@[simp]
theorem lowerClosure_union (s t : Set α) : lowerClosure (s ∪ t) = lowerClosure s ⊔ lowerClosure t

{α : Type u_1}
[Preorder α]
(s t : Set α)


@[simp]
theorem floor_sub_nat (a : α) (n : ℕ) : ⌊a - n⌋ = ⌊a⌋ - n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)
(n : ℕ)


theorem antilipschitzWith_equiv [∀ i, PseudoEMetricSpace (β i)] :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i))

(p : ℝ≥0∞)
{ι : Type u_2}
(β : ι → Type u_4)
[Fact (1 ≤ p)]
[Fintype ι]
[(i : ι) → PseudoEMetricSpace (β i)]

AntilipschitzWith (↑(Fintype.card ι) ^ (1 / p).toReal) ⇑(WithLp.equiv p ((i : ι) → β i))


theorem card_eq_card_of_rel {r : α → β → Prop} {s : Multiset α} {t : Multiset β} (h : Rel r s t) :
    card s = card t

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{s : Multiset α}
{t : Multiset β}
(h : Multiset.Rel r s t)


/--
If `α` has a unique term, the type of finitely supported functions `α →₀ β` is equivalent to `β`.
-/
@[simps!]
noncomputable def _root_.Equiv.finsuppUnique {ι : Type*} [Unique ι] : (ι →₀ M) ≃ M

{M : Type u_5}
[Zero M]
{ι : Type u_13}
[Unique ι]

∀ (a : M) (a_1 : ι), (Equiv.finsuppUnique.symm a) a_1 = a


/-- If the factorization of `n` contains just one number `p` then `n` is a power of `p` -/
theorem eq_pow_of_factorization_eq_single {n p k : ℕ} (hn : n ≠ 0)
    (h : n.factorization = Finsupp.single p k) : n = p ^ k


@[simp]
theorem Perm.subtypeCongr.left_apply {a : ε} (h : p a) : ep.subtypeCongr en a = ep ⟨a, h⟩

{ε : Type u_1}
{p : ε → Prop}
[DecidablePred p]
(ep : Equiv.Perm { a // p a })
(en : Equiv.Perm { a // ¬p a })
{a : ε}
(h : p a)


@[to_additive (attr := simp) coe_prodMap]
theorem coe_prodMap : ⇑(prodMap f g) = Prod.map f g

{M : Type u_5}
{N : Type u_6}
{M' : Type u_8}
{N' : Type u_9}
[Mul M]
[Mul N]
[Mul M']
[Mul N']
(f : M →ₙ* M')
(g : N →ₙ* N')


@[simp] lemma tail_add (a b : Fin n.succ → α) : vecTail (a + b) = vecTail a + vecTail b

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

Matrix.vecTail (a + b) = Matrix.vecTail a + Matrix.vecTail b


/-- Type class for additive monoid actions. -/
class AddAction (G : Type*) (P : Type*) [AddMonoid G] extends VAdd G P where
  /-- Zero is a neutral element for `+ᵥ` -/
  protected zero_vadd : ∀ p : P, (0 : G) +ᵥ p = p
  /-- Associativity of `+` and `+ᵥ` -/
  add_vadd : ∀ (g₁ g₂ : G) (p : P), g₁ + g₂ +ᵥ p = g₁ +ᵥ (g₂ +ᵥ p)

{G : Type u_11}
{P : Type u_12}
[AddMonoid G]
[self : AddAction G P]
(g₁ g₂ : G)
(p : P)


theorem LinearIndependent.repr_range : LinearMap.range hv.repr = ⊤

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hv : LinearIndependent R v)


protected theorem measurableSet (hτ : IsStoppingTime f τ) (s : Set Ω) :
    MeasurableSet[hτ.measurableSpace] s ↔ ∀ i : ι, MeasurableSet[f i] (s ∩ {ω | τ ω ≤ i})

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(s : Set Ω)

MeasurableSet s ↔ ∀ (i : ι), MeasurableSet (s ∩ {ω | τ ω ≤ i})


theorem Periodic.nsmul_sub_eq [AddCommGroup α] (h : Periodic f c) (n : ℕ) :
    f (n • c - x) = f (-x)

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


lemma monotone_isoClosure (h : P ≤ Q) : isoClosure P ≤ isoClosure Q

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{P Q : C → Prop}
(h : P ≤ Q)

CategoryTheory.isoClosure P ≤ CategoryTheory.isoClosure Q


/-- Fekete's lemma: a subadditive sequence which is bounded below converges. -/
theorem tendsto_lim (hbdd : BddBelow (range fun n => u n / n)) :
    Tendsto (fun n => u n / n) atTop (𝓝 h.lim)

(hbdd : BddBelow (Set.range fun n => u n / ↑n))

Filter.Tendsto (fun n => u n / ↑n) Filter.atTop (𝓝 h.lim)


/-- The gamma pdf is strongly measurable -/
@[measurability]
 lemma stronglyMeasurable_gammaPDFReal (a r : ℝ) :
     StronglyMeasurable (gammaPDFReal a r)

MeasureTheory.StronglyMeasurable (ProbabilityTheory.gammaPDFReal a r)


/-- If `f^n x - x`, `n > 0`, is an integer number `m` for some point `x`, then
`τ f = m / n`. On the circle this means that a map with a periodic orbit has
a rational rotation number. -/
theorem translationNumber_of_map_pow_eq_add_int {x : ℝ} {n : ℕ} {m : ℤ} (h : (f ^ n) x = x + m)
    (hn : 0 < n) : τ f = m / n

(f : CircleDeg1Lift)
{x : ℝ}
{n : ℕ}
{m : ℤ}
(h : (f ^ n) x = x + ↑m)
(hn : 0 < n)


theorem valuation_le_one_iff (x : K) : A.valuation x ≤ 1 ↔ x ∈ A

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


@[reassoc (attr := simp)]
theorem w {s t : RightExtension f g} (η : s ⟶ t) :
    f ◁ η.left ≫ t.counit = s.counit

{s t : CategoryTheory.Bicategory.RightExtension f g}

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft f η.left) t.counit = s.counit


theorem ae_eq_mk (hf : AEStronglyMeasurable f μ) : f =ᵐ[μ] hf.mk f

(hf : MeasureTheory.AEStronglyMeasurable f μ)

f =ᵐ[μ] MeasureTheory.AEStronglyMeasurable.mk f hf


theorem isPrimitive_iff_content_eq_one {p : R[X]} : p.IsPrimitive ↔ p.content = 1

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p : Polynomial R}


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

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


theorem mkDerivationₗ_monomial (f : σ → A) (s : σ →₀ ℕ) (r : R) :
    mkDerivationₗ R f (monomial s r) =
      r • s.sum fun i k => monomial (s - Finsupp.single i 1) (k : R) • f i

{σ : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Module (MvPolynomial σ R) A]
(f : σ → A)
(s : σ →₀ ℕ)
(r : R)

(MvPolynomial.mkDerivationₗ R f) ((MvPolynomial.monomial s) r) =
  r • s.sum fun i k => (MvPolynomial.monomial (s - Finsupp.single i 1)) ↑k • f i


@[to_additive]
theorem divRight_eq_mulRight_inv (a : G) : Equiv.divRight a = Equiv.mulRight a⁻¹


protected theorem add_le_add_iff_left [CovariantClass α α (· + ·) (· ≤ ·)]
    [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊥) : a + b ≤ a + c ↔ b ≤ c

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

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


@[simp]
theorem neg_pi_div_two_eq_arcsin {x} : -(π / 2) = arcsin x ↔ x ≤ -1


@[simp]
lemma gaussianReal_zero_var (μ : ℝ) : gaussianReal μ 0 = Measure.dirac μ

ProbabilityTheory.gaussianReal μ 0 = MeasureTheory.Measure.dirac μ


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightIso L i).unitIso.hom.app X).left = CategoryTheory.CategoryStruct.id X.left


theorem continuousWithinAt_update_of_ne [T1Space X] [DecidableEq X] [TopologicalSpace Y] {f : X → Y}
    {s : Set X} {x x' : X} {y : Y} (hne : x' ≠ x) :
    ContinuousWithinAt (Function.update f x y) s x' ↔ ContinuousWithinAt f s x'

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[T1Space X]
[DecidableEq X]
[TopologicalSpace Y]
{f : X → Y}
{s : Set X}
{x x' : X}
{y : Y}
(hne : x' ≠ x)


private theorem exists_lt_omega_opow' {α} {o b : Ordinal} (hb : 1 < b) (ho : o.IsLimit)
    {f : α → Ordinal} (H : ∀ ⦃a⦄, a < o → ∃ i, a < f i) ⦃a⦄ (h : a < b ^ o) :
        ∃ i, a < b ^ f i

(H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i)


/-- Note that since `starMulOfComm` is reducible, `simp` can already prove this. -/
theorem star_id_of_comm {R : Type*} [CommSemiring R] {x : R} : star x = x


theorem isOpen_basicOpen {a : R} : IsOpen (basicOpen a : Set (PrimeSpectrum R))


@[simp, norm_cast]
theorem coe_natCast (n : ℕ) : ⇑(n : CentroidHom α) = n • (CentroidHom.id α)

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(n : ℕ)


theorem totient_prime {p : ℕ} (hp : p.Prime) : φ p = p - 1


theorem natCast (n : ℕ) : mapFun f (n : 𝕎 R) = n

{p : ℕ}
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)
(n : ℕ)


@[ext]
theorem ext {f g : FrameHom α β} (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
{f g : FrameHom α β}
(h : ∀ (a : α), f a = g a)


@[simp]
theorem vonMangoldt_nonneg {n : ℕ} : 0 ≤ Λ n


theorem Filter.Tendsto.rexp {l : Filter α} {f : α → ℝ} {z : ℝ} (hf : Tendsto f l (𝓝 z)) :
    Tendsto (fun x => exp (f x)) l (𝓝 (exp z))

{α : Type u_1}
{l : Filter α}
{f : α → ℝ}
{z : ℝ}
(hf : Filter.Tendsto f l (𝓝 z))

Filter.Tendsto (fun x => Real.exp (f x)) l (𝓝 (Real.exp z))


/-- Being in the upper shadow of `𝒜` means we have a superset in `𝒜`. -/
theorem exists_subset_of_mem_upShadow (hs : s ∈ ∂⁺ 𝒜) : ∃ t ∈ 𝒜, t ⊆ s

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
(hs : s ∈ 𝒜.upShadow)

∃ t ∈ 𝒜, t ⊆ s


theorem decide_eq_false : [Decidable p] → Not p → Eq (decide p) false


theorem HasFTaylorSeriesUpToOn.add {q g} (hf : HasFTaylorSeriesUpToOn n f p s)
    (hg : HasFTaylorSeriesUpToOn n g q s) : HasFTaylorSeriesUpToOn n (f + g) (p + q) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
{q : E → FormalMultilinearSeries 𝕜 E F}
{g : E → F}
(hf : HasFTaylorSeriesUpToOn n f p s)
(hg : HasFTaylorSeriesUpToOn n g q s)


theorem map_eq_of_sub_lt (h : v (y - x) < v x) : v y = v x

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation R Γ₀)
{x y : R}
(h : v (y - x) < v x)


theorem liftAlternating_ι_mul (f : ∀ i, M [⋀^Fin i]→ₗ[R] N) (m : M)
    (x : ExteriorAlgebra R M) :
    liftAlternating (R := R) (M := M) (N := N) f (ι R m * x) =
    liftAlternating (R := R) (M := M) (N := N) (fun i => (f i.succ).curryLeft m) x

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(f : (i : ℕ) → M [⋀^Fin i]→ₗ[R] N)
(m : M)
(x : ExteriorAlgebra R M)

(ExteriorAlgebra.liftAlternating f) ((ExteriorAlgebra.ι R) m * x) =
  (ExteriorAlgebra.liftAlternating fun i => (f i.succ).curryLeft m) x


theorem coe_inv_of_nonzero {J : FractionalIdeal R₁⁰ K} (h : J ≠ 0) :
    (↑J⁻¹ : Submodule R₁ K) = IsLocalization.coeSubmodule K ⊤ / (J : Submodule R₁ K)

(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{J : FractionalIdeal R₁⁰ K}
(h : J ≠ 0)

↑J⁻¹ = IsLocalization.coeSubmodule K ⊤ / ↑J


@[ext]
lemma FunctorsInverting.hom_ext {W : MorphismProperty C} {F₁ F₂ : FunctorsInverting W D}
    {α β : F₁ ⟶ F₂} (h : α.app = β.app) : α = β

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
{W : CategoryTheory.MorphismProperty C}
{F₁ F₂ : W.FunctorsInverting D}
{α β : F₁ ⟶ F₂}
(h : α.app = β.app)


@[simp]
theorem mem_top (x : M) : x ∈ (⊤ : L.Substructure M)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(x : M)


@[simp]
theorem toLieHom_comp : (g.comp f : A →ₗ⁅R⁆ C) = (g : B →ₗ⁅R⁆ C).comp (f : A →ₗ⁅R⁆ B)

{A : Type v}
[Ring A]
{R : Type u}
[CommRing R]
[Algebra R A]
{B : Type w}
{C : Type w₁}
[Ring B]
[Ring C]
[Algebra R B]
[Algebra R C]
(f : A →ₐ[R] B)
(g : B →ₐ[R] C)

(g.comp f).toLieHom = g.toLieHom.comp f.toLieHom


@[to_additive]
theorem prod_empty {α β : Type*} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
    ∏ x : α, f x = 1

{α : Type u_9}
{β : Type u_10}
[AddCommMonoid β]
[IsEmpty α]
[Fintype α]
(f : α → β)


/-- We make this the simp lemma instead of `range_coe`. The reason is that if we write
  for `s : Set α` the function `(↑) : s → α`, then the inferred implicit arguments of `(↑)` are
  `↑α (fun x ↦ x ∈ s)`. -/
@[simp]
theorem range_coe_subtype {p : α → Prop} : range ((↑) : Subtype p → α) = { x | p x }


/-- **Formula for the Number of Combinations** -/
@[simp]
theorem card_powersetCard (n : ℕ) (s : Finset α) :
    card (powersetCard n s) = Nat.choose (card s) n

(Finset.powersetCard n s).card = s.card.choose n


theorem MulPosMono.toMulPosStrictMono [MulPosMono α] : MulPosStrictMono α

{α : Type u_1}
[CancelMonoidWithZero α]
[PartialOrder α]
[MulPosMono α]


theorem inr_mono : Monotone (inr : β → α ⊕ β)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]


protected theorem add_right_comm (n m k : Nat) : (n + m) + k = (n + k) + m


@[simp]
theorem cons_empty (a : α) : cons a ∅ (not_mem_empty _) = {a}


@[simp]
theorem antidiagonalTuple_one (n : ℕ) : antidiagonalTuple 1 n = {![n]}

Multiset.Nat.antidiagonalTuple 1 n = {![n]}


theorem and_eq_false_iff : ∀ (x y : Bool), (x && y) = false ↔ x = false ∨ y = false


/-- If `α` and `β` are order-isomorphic then the two orders of order-homomorphisms
from `α` and `β` to themselves are order-isomorphic. -/
@[simps! apply symm_apply]
def conj {α β} [Preorder α] [Preorder β] (f : α ≃o β) : (α →o α) ≃ (β →o β)

{α : Type u_6}
{β : Type u_7}
[Preorder α]
[Preorder β]
(f : α ≃o β)

∀ (a : β →o β), f.conj.symm a = EquivLike.inv (f.arrowCongr f) a


theorem Algebra.map_leftMulMatrix_localization {ι : Type*} [Fintype ι] [DecidableEq ι]
    (b : Basis ι R S) (a : S) :
    (algebraMap R Rₘ).mapMatrix (leftMulMatrix b a) =
    leftMulMatrix (b.localizationLocalization Rₘ M Sₘ) (algebraMap S Sₘ a)

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

(algebraMap R Rₘ).mapMatrix ((Algebra.leftMulMatrix b) a) =
  (Algebra.leftMulMatrix (Basis.localizationLocalization Rₘ M Sₘ b)) ((algebraMap S Sₘ) a)


theorem KaehlerDifferential.DLinearMap_apply (s : S) :
    KaehlerDifferential.DLinearMap R S s =
      (KaehlerDifferential.ideal R S).toCotangent
        ⟨1 ⊗ₜ s - s ⊗ₜ 1, KaehlerDifferential.one_smul_sub_smul_one_mem_ideal R s⟩

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(s : S)

(KaehlerDifferential.DLinearMap R S) s = (KaehlerDifferential.ideal R S).toCotangent ⟨1 ⊗ₜ[R] s - s ⊗ₜ[R] 1, ⋯⟩


theorem eq_inducedTopology_of_transports : K = e.inverse.inducedTopology J

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]


lemma natCast_eq_natCast_mod (a : ℕ) : (a : R) = a % p

(R : Type u_1)
[AddMonoidWithOne R]
(p : ℕ)
[CharP R p]
(a : ℕ)


theorem ncard_mono [Finite α] : @Monotone (Set α) _ _ _ ncard


/-- Auxiliary definition for `functorCategoryEquivalence`. -/
@[simps!]
def counitIso : inverse ⋙ functor ≅ 𝟭 (SingleObj G ⥤ V)

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
(X : CategoryTheory.SingleObj ↑G ⥤ V)

∀ (X_1 : CategoryTheory.SingleObj ↑G),
  (Action.FunctorCategoryEquivalence.counitIso.inv.app X).app X_1 = 𝟙 (X.obj PUnit.unit)


lemma ite_zero_smul (a : R) (b : M) : (if p then a else 0 : R) • b = if p then a • b else 0

{R : Type u_1}
{M : Type u_3}
[MonoidWithZero R]
[Zero M]
[MulActionWithZero R M]
(p : Prop)
[Decidable p]
(a : R)
(b : M)

(if p then a else 0) • b = if p then a • b else 0


@[simp]
theorem quotientInfEquivQuotientProd_fst (I J : Ideal R) (coprime : IsCoprime I J) (x : R ⧸ I ⊓ J) :
    (quotientInfEquivQuotientProd I J coprime x).fst =
      Ideal.Quotient.factor (I ⊓ J) I inf_le_left x

{R : Type u}
[CommRing R]
(I J : Ideal R)
(coprime : IsCoprime I J)
(x : R ⧸ I ⊓ J)

((I.quotientInfEquivQuotientProd J coprime) x).1 = (Ideal.Quotient.factor (I ⊓ J) I ⋯) x


/-- Coproduct of two `MonoidHom`s with the same codomain,
  with a commutation assumption:
  `f.noncommCoprod g _ (p : M × N) = f p.1 * g p.2`.
  (Noncommutative case; in the commutative case, use `MonoidHom.coprod`.)-/
@[to_additive (attr := simps)
    "Coproduct of two `AddMonoidHom`s with the same codomain,
    with a commutation assumption:
    `f.noncommCoprod g (p : M × N) = f p.1 + g p.2`.
    (Noncommutative case; in the commutative case, use `AddHom.coprod`.)"]
def noncommCoprod : M × N →* P

(comm : ∀ (m : M) (n : N), Commute (f m) (g n))

(f.noncommCoprod g comm) mn = f mn.1 * g mn.2


theorem naturality_2 (α : F ≅ G) (f : X ⟶ Y) : α.hom.app X ≫ G.map f ≫ α.inv.app Y = F.map f

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


lemma iInter_eq_const (hf : ∀ i, f i = s) : ⋂ i, f i = s

{α : Type u_1}
{ι : Sort u_4}
[Nonempty ι]
{f : ι → Set α}
{s : Set α}
(hf : ∀ (i : ι), f i = s)


theorem isCobounded_bot : IsCobounded r ⊥ ↔ ∃ b, ∀ x, r b x

Filter.IsCobounded r ⊥ ↔ ∃ b, ∀ (x : α), r b x


lemma toColex_injective : Injective (toColex : Finset α → Colex α)


@[to_additive] lemma mulEnergy_mono_right (ht : t₁ ⊆ t₂) : Eₘ[s, t₁] ≤ Eₘ[s, t₂]

{α : Type u_1}
[DecidableEq α]
[Add α]
{s t₁ t₂ : Finset α}
(ht : t₁ ⊆ t₂)


theorem cauchy₂ (hf : IsCauSeq abv f) {ε : α} (ε0 : 0 < ε) :
    ∃ i, ∀ j ≥ i, ∀ k ≥ i, abv (f j - f k) < ε

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f : ℕ → β}
(hf : IsCauSeq abv f)
{ε : α}
(ε0 : 0 < ε)


@[simp] theorem head_cons_tail (x : List α) (h : x ≠ []) : x.head h :: x.tail = x


@[to_additive]
theorem card_dvd_of_injective (f : α →* H) (hf : Function.Injective f) :
    Nat.card α ∣ Nat.card H

{α : Type u_1}
[AddGroup α]
{H : Type u_2}
[AddGroup H]
(f : α →+ H)
(hf : Function.Injective ⇑f)


/-- The minimum of locally Lipschitz functions is locally Lipschitz. -/
protected lemma min (hf : LocallyLipschitz f) (hg : LocallyLipschitz g) :
    LocallyLipschitz (fun x => min (f x) (g x))

{α : Type u}
[PseudoEMetricSpace α]
{f g : α → ℝ}
(hf : LocallyLipschitz f)
(hg : LocallyLipschitz g)

LocallyLipschitz fun x => min (f x) (g x)


@[to_additive]
theorem hasProd_subtype_iff_mulIndicator {s : Set β} :
    HasProd (f ∘ (↑) : s → α) a ↔ HasProd (s.mulIndicator f) a

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
{s : Set β}

HasProd (f ∘ Subtype.val) a ↔ HasProd (s.mulIndicator f) a


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

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


@[simp]
lemma preΨ'_zero : W.preΨ' 0 = 0

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


@[simp] theorem filterMap_replicate_of_isSome {f : α → Option β} (h : (f a).isSome) :
    (replicate n a).filterMap f = replicate n (Option.get _ h)

{α : Type u_1}
{β : Type u_2}
{a : α}
{n : Nat}
{f : α → Option β}
(h : (f a).isSome = true)

List.filterMap f (List.replicate n a) = List.replicate n ((f a).get h)


theorem strictAntiOn_dual_iff :
    StrictAntiOn (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) s ↔ StrictAntiOn f s

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

StrictAntiOn (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual) s ↔ StrictAntiOn f s


theorem add_div_eq_of_le_mod_add_mod {a b c : ℕ} (hc : c ≤ a % c + b % c) (hc0 : 0 < c) :
    (a + b) / c = a / c + b / c + 1


theorem ne_of_adj (h : G.Adj a b) : a ≠ b

{V : Type u}
(G : SimpleGraph V)
{a b : V}
(h : G.Adj a b)


theorem isSpanning_iff {G' : Subgraph G} : G'.IsSpanning ↔ G'.verts = Set.univ

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


@[simp] lemma toENat_eq_ofNat {a : Cardinal} {n : ℕ} [n.AtLeastTwo] :
    toENat a = no_index (OfNat.ofNat n) ↔ a = OfNat.ofNat n

{a : Cardinal.{u_1}}
{n : ℕ}
[n.AtLeastTwo]

Cardinal.toENat a = OfNat.ofNat n ↔ a = OfNat.ofNat n


theorem interedges_disjoint_right (s : Finset α) {t t' : Finset β} (ht : Disjoint t t') :
    Disjoint (interedges r s t) (interedges r s t')

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
(s : Finset α)
{t t' : Finset β}
(ht : Disjoint t t')

Disjoint (Rel.interedges r s t) (Rel.interedges r s t')


@[to_additive (attr := gcongr) nsmul_lt_nsmul_left]
theorem pow_lt_pow_right' [CovariantClass M M (· * ·) (· < ·)] {a : M} {n m : ℕ} (ha : 1 < a)
    (h : n < m) : a ^ n < a ^ m

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

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


@[to_additive] lemma max_div_min_eq_mabs (a b : α) : max a b / min a b = |b / a|ₘ

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


@[to_additive (attr := simp)]
theorem coe_inf (p p' : Subsemigroup M) : ((p ⊓ p' : Subsemigroup M) : Set M) = (p : Set M) ∩ p'

{M : Type u_1}
[Add M]
(p p' : AddSubsemigroup M)


theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a)

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
(a : A)
(r : R)

{r} + spectrum R a = spectrum R ((algebraMap R A) r + a)


@[elab_as_elim]
protected theorem casesOn' {P : PartENat → Prop} :
    ∀ a : PartENat, P ⊤ → (∀ n : ℕ, P (some n)) → P a


@[to_additive (attr := simp)]
theorem map_one (f : α → β) : f <$> (1 : FreeGroup α) = 1


/-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl

{α : Type u}
[self : PseudoEMetricSpace α]
(x y z : α)


@[to_additive (attr := simp)]
theorem map_comp (f : M →* N) (g : N →* P) : map (g.comp f) = (map g).comp (map f)

{M : Type u}
{N : Type v}
{P : Type w}
[AddMonoid M]
[AddMonoid N]
[AddMonoid P]
(f : M →+ N)
(g : N →+ P)

AddUnits.map (g.comp f) = (AddUnits.map g).comp (AddUnits.map f)


/-- If you rotate a triangle, you get another triangle.
Given a triangle of the form:
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
applying `rotate` gives a triangle of the form:
```
      g       h        -f⟦1⟧'
  Y  ───> Z  ───>  X⟦1⟧ ───> Y⟦1⟧
```
-/
@[simps!]
def Triangle.rotate (T : Triangle C) : Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)


theorem inf_left_comm (a b c : α) : a ⊓ (b ⊓ c) = b ⊓ (a ⊓ c)

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


/-- The forgetful functor from the category of algebras, forgetting the algebraic structure. -/
@[simps]
def forget (F : C ⥤ C) : Algebra F ⥤ C

(A : CategoryTheory.Endofunctor.Algebra F)

(CategoryTheory.Endofunctor.Algebra.forget F).obj A = A.a


@[simp]
theorem upperClosure_empty : upperClosure (∅ : Set α) = ⊤


theorem StrictConvexOn.secant_strict_mono_aux3 (hf : StrictConvexOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s)
    (hz : z ∈ s) (hxy : x < y) (hyz : y < z) : (f z - f x) / (z - x) < (f z - f y) / (z - y)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{s : Set 𝕜}
{f : 𝕜 → 𝕜}
(hf : StrictConvexOn 𝕜 s f)
{x y z : 𝕜}
(hx : x ∈ s)
(hz : z ∈ s)
(hxy : x < y)
(hyz : y < z)


@[to_additive]
theorem coe_center : ↑(center M) = Set.center M


/-- See also `Finset.product_biUnion`. -/
theorem sup_product_left (s : Finset β) (t : Finset γ) (f : β × γ → α) :
    (s ×ˢ t).sup f = s.sup fun i => t.sup fun i' => f ⟨i, i'⟩

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeSup α]
[OrderBot α]
(s : Finset β)
(t : Finset γ)
(f : β × γ → α)

(s ×ˢ t).sup f = s.sup fun i => t.sup fun i' => f (i, i')


@[to_additive]
lemma iIndepFun.indepFun_finset_prod_of_not_mem (hf_Indep : iIndepFun (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i)) {s : Finset ι} {i : ι} (hi : i ∉ s) :
    IndepFun (∏ j ∈ s, f j) (f i) μ

{f : ι → Ω → β}

(hf_Indep : ProbabilityTheory.iIndepFun (fun x => m) f μ)

ProbabilityTheory.IndepFun (∑ j ∈ s, f j) (f i) μ


@[to_additive]
theorem prod_of_isEmpty [IsEmpty α] (s : Finset α) : ∏ i ∈ s, f i = 1

{α : Type u_3}
{β : Type u_4}
{f : α → β}
[AddCommMonoid β]
[IsEmpty α]
(s : Finset α)


theorem iSup₂_le {f : ∀ i, κ i → α} (h : ∀ i j, f i j ≤ a) : ⨆ (i) (j), f i j ≤ a

{α : Type u_1}
{ι : Sort u_5}
{κ : ι → Sort u_7}
[CompleteLattice α]
{a : α}
{f : (i : ι) → κ i → α}
(h : ∀ (i : ι) (j : κ i), f i j ≤ a)


theorem log_le_self (b x : Ordinal) : log b x ≤ x


theorem union_inter_cancel_left {s t : Set α} : (s ∪ t) ∩ s = s


theorem inr_fst' {b : BinaryBicone X Y} (h : b.IsBilimit) :
    IsPullback b.inr (0 : Y ⟶ 0) b.fst (0 : 0 ⟶ X)

{b : CategoryTheory.Limits.BinaryBicone X Y}

CategoryTheory.IsPullback b.inr 0 b.fst 0


theorem Icc_def : Box.Icc I = Icc I.lower I.upper

BoxIntegral.Box.Icc I = Set.Icc I.lower I.upper


@[simp]
theorem fold_dedup_idem [DecidableEq α] [hi : Std.IdempotentOp op] (s : Multiset α) (b : α) :
    (dedup s).fold op b = s.fold op b

{α : Type u_1}
(op : α → α → α)
[hc : Std.Commutative op]
[ha : Std.Associative op]
[DecidableEq α]
[hi : Std.IdempotentOp op]
(s : Multiset α)
(b : α)

Multiset.fold op b s.dedup = Multiset.fold op b s


lemma closedBall_eq_or_disjoint :
    closedBall x r = closedBall y r ∨ Disjoint (closedBall x r) (closedBall y r)

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
(x y : X)
(r : ℝ)

Metric.closedBall x r = Metric.closedBall y r ∨ Disjoint (Metric.closedBall x r) (Metric.closedBall y r)


theorem IsLowerSet.mem_interior_of_forall_lt (hs : IsLowerSet s) (hx : x ∈ closure s)
    (h : ∀ i, y i < x i) : y ∈ interior s

{ι : Type u_2}
[Finite ι]
{s : Set (ι → ℝ)}
{x y : ι → ℝ}
(hs : IsLowerSet s)
(hx : x ∈ closure s)
(h : ∀ (i : ι), y i < x i)


theorem isReduced_iff_pow_one_lt [MonoidWithZero R] (k : ℕ) (hk : 1 < k) :
    IsReduced R ↔ ∀ x : R, x ^ k = 0 → x = 0

{R : Type u_1}
[MonoidWithZero R]
(k : ℕ)
(hk : 1 < k)

IsReduced R ↔ ∀ (x : R), x ^ k = 0 → x = 0


theorem IsThreeCycle.mem_alternatingGroup {f : Perm α} (h : IsThreeCycle f) :
    f ∈ alternatingGroup α

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{f : Equiv.Perm α}
(h : f.IsThreeCycle)


@[simp]
theorem rTensorOne_tmul_one (m : M) : M.rTensorOne (m ⊗ₜ[R] 1) = m

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{M : Submodule R S}
(m : ↥M)


theorem card_support_ne_one (f : Perm α) : f.support.card ≠ 1

{α : Type u_1}
[DecidableEq α]
[Fintype α]
(f : Equiv.Perm α)


theorem mem_centralizer_iff {s : Set A} {z : A} :
    z ∈ centralizer R s ↔ ∀ g ∈ s, g * z = z * g ∧ star g * z = z * star g

(R : Type u)
{A : Type v}
[CommSemiring R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{s : Set A}
{z : A}

z ∈ NonUnitalStarSubalgebra.centralizer R s ↔ ∀ g ∈ s, g * z = z * g ∧ star g * z = z * star g


/-- Let `X` be a locally compact sigma compact Hausdorff topological space. Suppose that for each
`x` the sets `B x : ι x → Set X` with the predicate `p x : ι x → Prop` form a basis of the filter
`𝓝 x`. Then there exists a locally finite covering `fun i ↦ B (c i) (r i)` of `X` such that each
`r i` satisfies `p (c i)`.

The notation is inspired by the case `B x r = Metric.ball x r` but the theorem applies to
`nhds_basis_opens` as well. If the covering must be subordinate to some open covering of `s`, then
the user should use a basis obtained by `Filter.HasBasis.restrict_subset` or a similar lemma, see
the proof of `paracompact_of_locallyCompact_sigmaCompact` for an example.

The formalization is based on two [ncatlab](https://ncatlab.org/) proofs:
* [locally compact and sigma compact spaces are paracompact](https://ncatlab.org/nlab/show/locally+compact+and+sigma-compact+spaces+are+paracompact);
* [open cover of smooth manifold admits locally finite refinement by closed balls](https://ncatlab.org/nlab/show/partition+of+unity#ExistenceOnSmoothManifolds).

See also `refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set` for a version of this lemma
dealing with a covering of a closed set.

In most cases (namely, if `B c r ∪ B c r'` is again a set of the form `B c r''`) it is possible
to choose `α = X`. This fact is not yet formalized in `mathlib`. -/
theorem refinement_of_locallyCompact_sigmaCompact_of_nhds_basis [WeaklyLocallyCompactSpace X]
    [SigmaCompactSpace X] [T2Space X] {ι : X → Type u} {p : ∀ x, ι x → Prop} {B : ∀ x, ι x → Set X}
    (hB : ∀ x, (𝓝 x).HasBasis (p x) (B x)) :
    ∃ (α : Type v) (c : α → X) (r : ∀ a, ι (c a)),
      (∀ a, p (c a) (r a)) ∧ ⋃ a, B (c a) (r a) = univ ∧ LocallyFinite fun a ↦ B (c a) (r a)

(hB : ∀ (x : X), (𝓝 x).HasBasis (p x) (B x))

∃ α c r, (∀ (a : α), p (c a) (r a)) ∧ ⋃ a, B (c a) (r a) = Set.univ ∧ LocallyFinite fun a => B (c a) (r a)


theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n)

(E : ℕ → Type u_1)
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]
(x : (n : ℕ) → E n)
(n : ℕ)


theorem hasBasis_nhds (a : A) :
    HasBasis (@nhds A hB.topology a) (fun _ => True) fun i => { b | b - a ∈ B i }

{A : Type u_1}
{ι : Type u_2}
[Ring A]
[Nonempty ι]
{B : ι → AddSubgroup A}
(hB : RingSubgroupsBasis B)
(a : A)

(𝓝 a).HasBasis (fun x => True) fun i => {b | b - a ∈ B i}


theorem selfZPow_mul_neg (d : ℤ) : selfZPow x B d * selfZPow x B (-d) = 1

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


@[to_additive (attr := simp)]
theorem zpowers_eq_bot {g : G} : zpowers g = ⊥ ↔ g = 1


/-- If `X` is a real-valued random variable that has pdf `f`, then the expectation of `X` equals
`∫ x, x * f x ∂λ` where `λ` is the Lebesgue measure. -/
theorem integral_mul_eq_integral [HasPDF X ℙ] : ∫ x, x * (pdf X ℙ volume x).toReal = ∫ x, X x ∂ℙ

[MeasureTheory.HasPDF X ℙ MeasureTheory.volume]

∫ (x : ℝ), x * (MeasureTheory.pdf X ℙ MeasureTheory.volume x).toReal = ∫ (x : Ω), X x ∂ℙ


/-- A `𝕜`-affine isometric embedding of one normed add-torsor over a normed `𝕜`-space into
another. -/
structure AffineIsometry extends P →ᵃ[𝕜] P₂ where
  norm_map : ∀ x : V, ‖linear x‖ = ‖x‖

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(self : P →ᵃⁱ[𝕜] P₂)
(x : V)


@[simp] lemma cfc_apply_one {f : R → R} : cfc f (1 : A) = algebraMap R A (f 1)

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


@[to_additive exists_nhds_zero_quarter]
theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) :
    ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u

{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
{u : Set M}
(hu : u ∈ 𝓝 0)

∃ V ∈ 𝓝 0, ∀ {v w s t : M}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v + w + s + t ∈ u


theorem smul_sum {α : Type*} [Monoid α] [∀ i, Zero (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    [AddCommMonoid γ] [DistribMulAction α γ] {f : Π₀ i, β i} {h : ∀ i, β i → γ} {c : α} :
    c • f.sum h = f.sum fun a b => c • h a b

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


@[to_additive]
theorem Step.diamond_aux :
    ∀ {L₁ L₂ L₃ L₄ : List (α × Bool)} {x1 b1 x2 b2},
      L₁ ++ (x1, b1) :: (x1, !b1) :: L₂ = L₃ ++ (x2, b2) :: (x2, !b2) :: L₄ →
        L₁ ++ L₂ = L₃ ++ L₄ ∨ ∃ L₅, Red.Step (L₁ ++ L₂) L₅ ∧ Red.Step (L₃ ++ L₄) L₅

{α : Type u}
{L₁ L₂ L₃ L₄ : List (α × Bool)}
{x1 : α}
{b1 : Bool}
{x2 : α}
{b2 : Bool}

L₁ ++ (x1, b1) :: (x1, !b1) :: L₂ = L₃ ++ (x2, b2) :: (x2, !b2) :: L₄ →
  L₁ ++ L₂ = L₃ ++ L₄ ∨ ∃ L₅, FreeGroup.Red.Step (L₁ ++ L₂) L₅ ∧ FreeGroup.Red.Step (L₃ ++ L₄) L₅


@[simp]
theorem const.get_mk (x : A) : const.get (const.mk n x : const n A α) = x

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

MvPFunctor.const.get (MvPFunctor.const.mk n x) = x


theorem tsum_const_eq_top_of_ne_zero {α : Type*} [Infinite α] {c : ℝ≥0∞} (hc : c ≠ 0) :
    ∑' _ : α, c = ∞

{α : Type u_4}
[Infinite α]
{c : ℝ≥0∞}
(hc : c ≠ 0)


lemma exists_iso_of_arrow_iso (T₁ T₂ : Triangle C) (hT₁ : T₁ ∈ distTriang C)
    (hT₂ : T₂ ∈ distTriang C) (e : Arrow.mk T₁.mor₁ ≅ Arrow.mk T₂.mor₁) :
    ∃ (e' : T₁ ≅ T₂), e'.hom.hom₁ = e.hom.left ∧ e'.hom.hom₂ = e.hom.right

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

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C)

(hT₁ : T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(hT₂ : T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(e : CategoryTheory.Arrow.mk T₁.mor₁ ≅ CategoryTheory.Arrow.mk T₂.mor₁)

∃ e', e'.hom.hom₁ = e.hom.left ∧ e'.hom.hom₂ = e.hom.right


theorem eLpNorm'_const (c : F) (hq_pos : 0 < q) :
    eLpNorm' (fun _ : α => c) q μ = (‖c‖₊ : ℝ≥0∞) * μ Set.univ ^ (1 / q)

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{q : ℝ}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
(c : F)
(hq_pos : 0 < q)

MeasureTheory.eLpNorm' (fun x => c) q μ = ↑‖c‖₊ * μ Set.univ ^ (1 / q)


theorem cons_eq_cons {a b : α} {as bs : Multiset α} :
    a ::ₘ as = b ::ₘ bs ↔ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

{α : Type u_1}
{a b : α}
{as bs : Multiset α}


@[to_additive sub_nsmul_nsmul_add]
lemma pow_sub_mul_pow (a : M) (h : m ≤ n) : a ^ (n - m) * a ^ m = a ^ n

{M : Type u_4}
[AddMonoid M]
{m n : ℕ}
(a : M)
(h : m ≤ n)


lemma normal_iff_normalClosure_le : Normal F K ↔ normalClosure F K L ≤ K

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

Normal F ↥K ↔ normalClosure F (↥K) L ≤ K


theorem normalClosure_subset_iff {s t : Set G} (ht : IsNormalSubgroup t) :
    s ⊆ t ↔ normalClosure s ⊆ t

{G : Type u_1}
[Group G]
{s t : Set G}
(ht : IsNormalSubgroup t)


@[simp]
theorem gcd_add (s₁ s₂ : Multiset α) : (s₁ + s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(s₁ s₂ : Multiset α)


@[simp]
lemma id_hom (a : A) : Hom.hom (𝟙 F) a = 𝟙 _

(F : CategoryTheory.SingleFunctors C D A)


lemma isIso_pOpcycles (hf : S.f = 0) : IsIso S.pOpcycles


theorem single_eq_zero : single a (0 : R) = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{a : Γ}


/-- An additive character maps multiples by natural numbers to powers. -/
lemma map_nsmul_eq_pow (ψ : AddChar A M) (n : ℕ) (x : A) : ψ (n • x) = ψ x ^ n

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)
(n : ℕ)
(x : A)


@[to_additive existing (attr := simp)]
lemma zpowersHom_symm_apply (f : Multiplicative ℤ →* α) :
    (zpowersHom α).symm f = f (ofAdd 1)

(α : Type u_3)
[Group α]
(f : Multiplicative ℤ →* α)

(zpowersHom α).symm f = f (Multiplicative.ofAdd 1)


@[to_additive] lemma le_iff_oneLePart_leOnePart (a b : α) : a ≤ b ↔ a⁺ᵐ ≤ b⁺ᵐ ∧ b⁻ᵐ ≤ a⁻ᵐ

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

a ≤ b ↔ a⁺ᵐ ≤ b⁺ᵐ ∧ b⁻ᵐ ≤ a⁻ᵐ


theorem unitSphereToUnits_injective [NormedDivisionRing 𝕜] :
    Function.Injective (unitSphereToUnits 𝕜)


theorem equiv_self_apply (x : L) : equiv i i p x = x

{K : Type u_1}
{L : Type u_2}
[CommRing K]
[CommRing L]
(i : K →+* L)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[PerfectRing L p]
[IsPerfectClosure i p]
(x : L)


theorem foldr_le_nfpBFamily {o : Ordinal}
    (f : ∀ b < o, Ordinal → Ordinal) (a l) :
    List.foldr (familyOfBFamily o f) a l ≤ nfpBFamily.{u, v} o f a

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

List.foldr (o.familyOfBFamily f) a l ≤ o.nfpBFamily f a


theorem toFunBilinear_apply_eq_sum (a : A) (p : R[X]) :
    toFunBilinear R A a p = p.sum fun n r => monomial n (a * algebraMap R A r)

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(a : A)
(p : R[X])

((PolyEquivTensor.toFunBilinear R A) a) p = p.sum fun n r => (Polynomial.monomial n) (a * (algebraMap R A) r)


@[simp]
theorem toBoolAlg_mul (a b : α) : toBoolAlg (a * b) = toBoolAlg a ⊓ toBoolAlg b

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


@[simp]
theorem filter_le_of_bot {n m : ℕ} (hnm : n < m) : ((Ico n m).filter fun x => x ≤ n) = [n]

List.filter (fun x => decide (x ≤ n)) (List.Ico n m) = [n]


/-- Note the `hif` argument is needed for this to work in `rw`. -/
@[simp]
theorem comapDomain_zero (f : α → β)
    (hif : Set.InjOn f (f ⁻¹' ↑(0 : β →₀ M).support) := Finset.coe_empty ▸ (Set.injOn_empty f)) :
    comapDomain f (0 : β →₀ M) hif = (0 : α →₀ M)

(hif : Set.InjOn f (f ⁻¹' ↑(Finsupp.support 0)) := ⋯)


@[simp] lemma zero_mem_centralizer : (0 : M₀) ∈ centralizer s

{M₀ : Type u_1}
[MulZeroClass M₀]
{s : Set M₀}


protected theorem is_rat (q : ℚ_[p]) : ∃ q' : ℚ, ‖q‖ = q'

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