@[simp]
theorem toIocMod_zsmul_add (a b : α) (m : ℤ) : toIocMod hp a (m • p + b) = toIocMod hp a b

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


/-- A sub star semigroup is a subset of a magma which is closed under the `star`-/
structure SubStarSemigroup (M : Type v) [Mul M] [Star M] extends Subsemigroup M : Type v where
  /-- The `carrier` of a `StarSubset` is closed under the `star` operation. -/
  star_mem' : ∀ {a : M} (_ha : a ∈ carrier), star a ∈ carrier

{M : Type v}
[Mul M]
[Star M]
(self : SubStarSemigroup M)
{a : M}
(_ha : a ∈ self.carrier)


theorem ofReal_ne_zero {z : ℝ} : (z : ℂ) ≠ 0 ↔ z ≠ 0

↑z ≠ 0 ↔ z ≠ 0


/-- Special case of the sandwich lemma; see `tendsto_of_tendsto_of_tendsto_of_le_of_le`
and `tendsto_of_tendsto_of_tendsto_of_le_of_le'` for the general case. -/
lemma squeeze_zero {α} {f g : α → ℝ} {t₀ : Filter α} (hf : ∀ t, 0 ≤ f t) (hft : ∀ t, f t ≤ g t)
    (g0 : Tendsto g t₀ (𝓝 0)) : Tendsto f t₀ (𝓝 0)

{α : Type u_3}
{f g : α → ℝ}
{t₀ : Filter α}
(hf : ∀ (t : α), 0 ≤ f t)
(hft : ∀ (t : α), f t ≤ g t)
(g0 : Filter.Tendsto g t₀ (𝓝 0))


/-- Assemble an `I`-indexed family of natural transformations into a single natural transformation.
-/
@[simps!]
def pi (α : ∀ i, F i ⟶ G i) : Functor.pi F ⟶ Functor.pi G

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

[(i : I) → CategoryTheory.Category.{v₂, u₂} (D i)]

{F G : (i : I) → CategoryTheory.Functor (C i) (D i)}

(CategoryTheory.NatTrans.pi α).app f i = (α i).app (f i)


@[simp]
theorem pure_isPure (a : α) : IsPure (pure a)


/-- **Tietze extension theorem** for real-valued continuous maps, a version for a closed
embedding. Let `e` be a closed embedding of a nonempty topological space `X` into a normal
topological space `Y`. Let `f` be a continuous real-valued function on `X`. Let `t` be a nonempty
convex set of real numbers (we use `OrdConnected` instead of `Convex` to automatically deduce this
argument by typeclass search) such that `f x ∈ t` for all `x`. Then there exists a continuous
real-valued function `g : C(Y, ℝ)` such that `g y ∈ t` for all `y` and `g ∘ e = f`. -/
theorem exists_extension_forall_mem_of_closedEmbedding (f : C(X, ℝ)) {t : Set ℝ} {e : X → Y}
    [hs : OrdConnected t] (hf : ∀ x, f x ∈ t) (hne : t.Nonempty) (he : ClosedEmbedding e) :
    ∃ g : C(Y, ℝ), (∀ y, g y ∈ t) ∧ g ∘ e = f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[NormalSpace Y]
(f : C(X, ℝ))
{t : Set ℝ}
{e : X → Y}
[hs : t.OrdConnected]
(hf : ∀ (x : X), f x ∈ t)
(hne : t.Nonempty)
(he : ClosedEmbedding e)


@[simp]
theorem toMultilinearMap_smul (c : R') (f : ContinuousMultilinearMap A M₁ M₂) :
    (c • f).toMultilinearMap = c • f.toMultilinearMap

{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
{R' : Type u_1}
{A : Type u_3}
[Monoid R']
[Semiring A]
[(i : ι) → Module A (M₁ i)]
[Module A M₂]
[DistribMulAction R' M₂]
[ContinuousConstSMul R' M₂]
[SMulCommClass A R' M₂]
(c : R')
(f : ContinuousMultilinearMap A M₁ M₂)


theorem deriv_clm_comp (hc : DifferentiableAt 𝕜 c x) (hd : DifferentiableAt 𝕜 d x) :
    deriv (fun y => (c y).comp (d y)) x = (deriv c x).comp (d x) + (c x).comp (deriv d x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : 𝕜}
{G : Type u_2}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{c : 𝕜 → F →L[𝕜] G}
{d : 𝕜 → E →L[𝕜] F}
(hc : DifferentiableAt 𝕜 c x)
(hd : DifferentiableAt 𝕜 d x)


lemma rel_eq {r : α → β → Prop} (hr : BiUnique r) : (r ⇒ r ⇒ (·↔·)) (·=·) (·=·)

{α : Type u_1}
{β : Type u_2}
{r : α → β → Prop}
(hr : Relator.BiUnique r)

(r ⇒ r ⇒ fun x x_1 => x ↔ x_1) (fun x x_1 => x = x_1) fun x x_1 => x = x_1


theorem singleton_span_isCompactElement (x : M) :
    CompleteLattice.IsCompactElement (span R {x} : Submodule R M)

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)

CompleteLattice.IsCompactElement (Submodule.span R {x})


@[simp]
theorem LinearMap.dualMap_apply (f : M₁ →ₗ[R] M₂) (g : Dual R M₂) (x : M₁) :
    f.dualMap g x = g (f x)

{R : Type u}
[CommSemiring R]
{M₁ : Type v}
{M₂ : Type v'}
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
(f : M₁ →ₗ[R] M₂)
(g : Module.Dual R M₂)
(x : M₁)


theorem trinomial_leading_coeff' (hkm : k < m) (hmn : m < n) :
    (trinomial k m n u v w).coeff n = w

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

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


/-- Reinterpret `G ≃+ H` as `Multiplicative G ≃* Multiplicative H`. -/
@[simps]
def AddEquiv.toMultiplicative [AddZeroClass G] [AddZeroClass H] :
    G ≃+ H ≃ (Multiplicative G ≃* Multiplicative H)

(f : Multiplicative G ≃* Multiplicative H)

(AddEquiv.toMultiplicative.symm f) a = (AddMonoidHom.toMultiplicative.symm f.toMonoidHom) a


theorem subset_coe_map (f : α →o β) : ∀ s : Interval α, f '' s ⊆ s.map f

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
(f : α →o β)
(s : Interval α)


/-- Partial sums of an alternating antitone series with an even number of terms provide
lower bounds on the limit. -/
theorem Antitone.alternating_series_le_tendsto
    (hfl : Tendsto (fun n ↦ ∑ i ∈ range n, (-1) ^ i * f i) atTop (𝓝 l))
    (hfa : Antitone f) (k : ℕ) : ∑ i ∈ range (2 * k), (-1) ^ i * f i ≤ l

(hfl : Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) Filter.atTop (𝓝 l))

∑ i ∈ Finset.range (2 * k), (-1) ^ i * f i ≤ l


theorem decompId_i_naturality {P Q : Karoubi C} (f : P ⟶ Q) :
    f ≫ decompId_i Q = decompId_i P ≫ (by exact Hom.mk f.f (by simp))

{P Q : CategoryTheory.Idempotents.Karoubi C}

CategoryTheory.CategoryStruct.comp f Q.decompId_i =
  CategoryTheory.CategoryStruct.comp P.decompId_i { f := f.f, comm := ⋯ }


theorem Monotone.locallyIntegrable [IsLocallyFiniteMeasure μ] (hmono : Monotone f) :
    LocallyIntegrable f μ


theorem one_lt_rootMultiplicity_iff_isRoot_gcd
    [GCDMonoid R[X]] {p : R[X]} {t : R} (h : p ≠ 0) :
    1 < p.rootMultiplicity t ↔ (gcd p (derivative p)).IsRoot t

{R : Type u}
[CommRing R]
[IsDomain R]
[GCDMonoid R[X]]
{p : R[X]}
{t : R}
(h : p ≠ 0)

1 < Polynomial.rootMultiplicity t p ↔ (gcd p (Polynomial.derivative p)).IsRoot t


theorem card_rootSet_eq_natDegree [Algebra F K] {p : F[X]} (hsep : p.Separable)
    (hsplit : Splits (algebraMap F K) p) : Fintype.card (p.rootSet K) = p.natDegree

(hsplit : Polynomial.Splits (algebraMap F K) p)

Fintype.card ↑(p.rootSet K) = p.natDegree


theorem doubleton_eq [DecidableEq α] {x y : α} (h : x ≠ y) : ({x, y} : List α) = [x, y]

{α : Type u}
[DecidableEq α]
{x y : α}
(h : x ≠ y)


theorem unbot'_le_iff {a : WithBot α} {b c : α} (h : a = ⊥ → b ≤ c) :
    a.unbot' b ≤ c ↔ a ≤ c

{α : Type u_1}
[LE α]
{a : WithBot α}
{b c : α}
(h : a = ⊥ → b ≤ c)


/-- If `‖v‖^n * ‖f v‖` is integrable for all `n ≤ N`, then the `n`-th derivative of the Fourier
transform of `f` is the Fourier transform of `fourierPowSMulRight L f v n`,
i.e., `(L v ⬝) ^ n • f v`. -/
lemma iteratedFDeriv_fourierIntegral {N : ℕ∞}
    (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun v ↦ ‖v‖^n * ‖f v‖) μ)
    (h'f : AEStronglyMeasurable f μ) {n : ℕ} (hn : n ≤ N) :
    iteratedFDeriv ℝ n (fourierIntegral 𝐞 μ L.toLinearMap₂ f) =
      fourierIntegral 𝐞 μ L.toLinearMap₂ (fun v ↦ fourierPowSMulRight L f v n)

(hf : ∀ (n : ℕ), ↑n ≤ N → MeasureTheory.Integrable (fun v => ‖v‖ ^ n * ‖f v‖) μ)

(h'f : MeasureTheory.AEStronglyMeasurable f μ)

iteratedFDeriv ℝ n (VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ f) =
  VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ fun v => VectorFourier.fourierPowSMulRight L f v n


theorem eq_empty_of_ssubset_singleton {s : Set α} {x : α} (hs : s ⊂ {x}) : s = ∅

{α : Type u}
{s : Set α}
{x : α}
(hs : s ⊂ {x})


@[simp]
theorem restrictScalars₁₂_inj {B B' : M →ₗ[R] N →ₗ[S] Pₗ} :
    B.restrictScalars₁₂ R' S' = B'.restrictScalars₁₂ R' S' ↔ B = B'

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{M : Type u_5}
{N : Type u_6}
{Pₗ : Type u_12}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid Pₗ]
[Module R M]
[Module S N]
[Module R Pₗ]
[Module S Pₗ]
[SMulCommClass S R Pₗ]
(R' : Type u_16)
(S' : Type u_17)
[Semiring R']
[Semiring S']
[Module R' M]
[Module S' N]
[Module R' Pₗ]
[Module S' Pₗ]
[SMulCommClass S' R' Pₗ]
[SMul S' S]
[IsScalarTower S' S N]
[IsScalarTower S' S Pₗ]
[SMul R' R]
[IsScalarTower R' R M]
[IsScalarTower R' R Pₗ]
{B B' : M →ₗ[R] N →ₗ[S] Pₗ}

LinearMap.restrictScalars₁₂ R' S' B = LinearMap.restrictScalars₁₂ R' S' B' ↔ B = B'


@[simp]
theorem disjoint_image {s t : Finset α} {f : α → β} (hf : Injective f) :
    Disjoint (s.image f) (t.image f) ↔ Disjoint s t

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{s t : Finset α}
{f : α → β}
(hf : Function.Injective f)

Disjoint (Finset.image f s) (Finset.image f t) ↔ Disjoint s t


@[to_additive]
theorem ofMulEquivOfDom_comp_symm {k : P ≃* M} (H : T.map k.toMonoidHom = S) (x) :
    (f.ofMulEquivOfDom H).toMap (k.symm x) = f.toMap x

(H : AddSubmonoid.map k.toAddMonoidHom T = S)

(f.ofAddEquivOfDom H).toMap (k.symm x) = f.toMap x


@[field_simps]
theorem div_sub' (a b c : K) (hc : c ≠ 0) : a / c - b = (a - c * b) / c

{K : Type u_3}
[Field K]
(a b c : K)
(hc : c ≠ 0)


lemma ContinuousAt.inf' (hf : ContinuousAt f x) (hg : ContinuousAt g x) :
    ContinuousAt (f ⊓ g) x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Inf L]
[ContinuousInf L]
{f g : X → L}
{x : X}
(hf : ContinuousAt f x)
(hg : ContinuousAt g x)


@[norm_cast]
theorem diagonal_natCast' [Zero α] [NatCast α] (m : ℕ) : diagonal ((m : n → α)) = m

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
[NatCast α]
(m : ℕ)


{R : Type x}
[Monoid R]
[HasDistribNeg R]
(a : R)


@[simp]
theorem aleph'_cof {o : Ordinal} (ho : o.IsLimit) : (aleph' o).ord.cof = o.cof


protected theorem Filter.Tendsto.inversion {α : Type*} {x c : P} {R : ℝ} {l : Filter α}
    {fc fx : α → P} {fR : α → ℝ} (hc : Tendsto fc l (𝓝 c)) (hR : Tendsto fR l (𝓝 R))
    (hx : Tendsto fx l (𝓝 x)) (hne : x ≠ c) :
    Tendsto (fun a ↦ inversion (fc a) (fR a) (fx a)) l (𝓝 (inversion c R x))

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{α : Type u_3}
{x c : P}
{R : ℝ}
{l : Filter α}
{fc fx : α → P}
{fR : α → ℝ}
(hc : Filter.Tendsto fc l (𝓝 c))
(hR : Filter.Tendsto fR l (𝓝 R))
(hx : Filter.Tendsto fx l (𝓝 x))
(hne : x ≠ c)

Filter.Tendsto (fun a => EuclideanGeometry.inversion (fc a) (fR a) (fx a)) l (𝓝 (EuclideanGeometry.inversion c R x))


theorem succ_le_succ_iff : succ a ≤ succ b ↔ a ≤ b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
[NoMaxOrder α]


/-- If `Prod.snd ⁻¹' t` is a null measurable set and `μ ≠ 0`, then `t` is a null measurable set. -/
lemma _root_.MeasureTheory.NullMeasurableSet.of_preimage_snd [NeZero μ] {t : Set β}
    (h : NullMeasurableSet (Prod.snd ⁻¹' t) (μ.prod ν)) : NullMeasurableSet t ν

(h : MeasureTheory.NullMeasurableSet (Prod.snd ⁻¹' t) (μ.prod ν))


theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l l' y)
    (hf : HasStrictDerivAt f f' x) (hy : y = f x) :
    HasStrictDerivAt (l ∘ f) (l' f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → F}
{f' : F}
(x : 𝕜)
{l : F → E}
{l' : F →L[𝕜] E}
{y : F}
(hl : HasStrictFDerivAt l l' y)
(hf : HasStrictDerivAt f f' x)
(hy : y = f x)


/-- `ord ∘ aleph` enumerates the infinite ordinals that are cardinals. -/
theorem ord_aleph_eq_enum_card :
    ord ∘ aleph = enumOrd { b : Ordinal | b.card.ord = b ∧ ω ≤ b }

Cardinal.ord ∘ Cardinal.aleph = Ordinal.enumOrd {b | b.card.ord = b ∧ ω ≤ b}


theorem chromaticNumber_top_eq_top_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = ⊤


/-- A version of `WithTop.coe_sInf'` with a more convenient but less general statement. -/
@[norm_cast]
theorem coe_sInf {s : Set α} (hs : s.Nonempty) (h's : BddBelow s) :
    ↑(sInf s) = (⨅ a ∈ s, ↑a : WithTop α)

{α : Type u_1}
[ConditionallyCompleteLinearOrderBot α]
{s : Set α}
(hs : s.Nonempty)
(h's : BddBelow s)


theorem eq_of_heq {α : Sort u} {a a' : α} (h : HEq a a') : Eq a a'


/-- Let `(x : 𝓞 K)`. Then we have that `λ` divides one amongst `x`, `x - 1` and `x + 1`. -/
lemma lambda_dvd_or_dvd_sub_one_or_dvd_add_one : λ ∣ x ∨ λ ∣ x - 1 ∨ λ ∣ x + 1

{K : Type u_1}
[Field K]
[NumberField K]
[IsCyclotomicExtension {3} ℚ K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)
(x : 𝓞 K)

hζ.toInteger - 1 ∣ x ∨ hζ.toInteger - 1 ∣ x - 1 ∨ hζ.toInteger - 1 ∣ x + 1


theorem interior_eq_nhds' : interior s = { x | s ∈ 𝓝 x }

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


@[trans]
protected theorem IsExtreme.trans (hAB : IsExtreme 𝕜 A B) (hBC : IsExtreme 𝕜 B C) :
    IsExtreme 𝕜 A C

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{A B C : Set E}
(hAB : IsExtreme 𝕜 A B)
(hBC : IsExtreme 𝕜 B C)


@[to_additive (attr := simp)]
theorem fst_swap (x : M ∗ N) : fst (swap M N x) = snd x

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]
(x : Monoid.Coprod M N)

Monoid.Coprod.fst ((Monoid.Coprod.swap M N) x) = Monoid.Coprod.snd x


theorem add_mem (x y : K) : x ∈ A → y ∈ A → x + y ∈ A

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


theorem isSheaf_iff_preservesFiniteProducts_of_projective [Preregular C] [FinitaryExtensive C]
    [∀ (X : C), Projective X] :
    IsSheaf (coherentTopology C) F ↔ Nonempty (PreservesFiniteProducts F)

[∀ (X : C), CategoryTheory.Projective X]

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology C) F ↔
  Nonempty (CategoryTheory.Limits.PreservesFiniteProducts F)


@[simp]
theorem HasTrivialRadical.center_eq_bot [HasTrivialRadical R L] : center R L = ⊥

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.HasTrivialRadical R L]


/-- This lemma allows the computation of the connecting homomorphism
`D.δ` when `D : SnakeInput C` and `C` is a concrete category. -/
lemma δ_apply' (x₃ : (forget₂ C Ab).obj D.L₀.X₃)
    (x₂ : (forget₂ C Ab).obj D.L₁.X₂) (x₁ : (forget₂ C Ab).obj D.L₂.X₁)
    (h₂ : (forget₂ C Ab).map D.L₁.g x₂ = (forget₂ C Ab).map D.v₀₁.τ₃ x₃)
    (h₁ : (forget₂ C Ab).map D.L₂.f x₁ = (forget₂ C Ab).map D.v₁₂.τ₂ x₂) :
    (forget₂ C Ab).map D.δ x₃ = (forget₂ C Ab).map D.v₂₃.τ₁ x₁

(D : CategoryTheory.ShortComplex.SnakeInput C)

(x₃ : ↑((CategoryTheory.forget₂ C Ab).obj D.L₀.X₃))

(x₂ : ↑((CategoryTheory.forget₂ C Ab).obj D.L₁.X₂))

(x₁ : ↑((CategoryTheory.forget₂ C Ab).obj D.L₂.X₁))

(h₂ : ((CategoryTheory.forget₂ C Ab).map D.L₁.g) x₂ = ((CategoryTheory.forget₂ C Ab).map D.v₀₁.τ₃) x₃)

(h₁ : ((CategoryTheory.forget₂ C Ab).map D.L₂.f) x₁ = ((CategoryTheory.forget₂ C Ab).map D.v₁₂.τ₂) x₂)

((CategoryTheory.forget₂ C Ab).map D.δ) x₃ = ((CategoryTheory.forget₂ C Ab).map D.v₂₃.τ₁) x₁


@[simp]
theorem singleton_ne_empty (a : α) : ({a} : Finset α) ≠ ∅


nonrec theorem cos_two_mul' : cos (2 * x) = cos x ^ 2 - sin x ^ 2

Real.cos (2 * x) = Real.cos x ^ 2 - Real.sin x ^ 2


lemma continuous_iff_from_discrete {Y : Type*} [TopologicalSpace Y]
    [DiscreteTopology X] (f : OnePoint X → Y) :
    Continuous f ↔ Tendsto (fun x : X ↦ f x) cofinite (𝓝 (f ∞))

{X : Type u_1}
[TopologicalSpace X]
{Y : Type u_2}
[TopologicalSpace Y]
[DiscreteTopology X]
(f : OnePoint X → Y)

Continuous f ↔ Filter.Tendsto (fun x => f ↑x) Filter.cofinite (𝓝 (f OnePoint.infty))


lemma IsUnramifiedAtInfinitePlaces.card_infinitePlace [NumberField k] [NumberField K]
    [IsGalois k K] [IsUnramifiedAtInfinitePlaces k K] :
    Fintype.card (InfinitePlace K) = Fintype.card (InfinitePlace k) * finrank k K

(k : Type u_1)
[Field k]
(K : Type u_2)
[Field K]
[Algebra k K]
[NumberField k]
[NumberField K]
[IsGalois k K]
[IsUnramifiedAtInfinitePlaces k K]

Fintype.card (NumberField.InfinitePlace K) = Fintype.card (NumberField.InfinitePlace k) * FiniteDimensional.finrank k K


/-- A variant of `of_is_product` that is more useful with `apply`. -/
theorem of_is_product' (h : Limits.IsLimit (BinaryFan.mk fst snd)) (t : IsTerminal Z) :
    IsPullback fst snd (t.from _) (t.from _)

(h : CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.BinaryFan.mk fst snd))

(t : CategoryTheory.Limits.IsTerminal Z)

CategoryTheory.IsPullback fst snd (t.from X) (t.from Y)


theorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}
    (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
{f g : A →ₛₙₐ[φ] B}
(h : ↑f = ↑g)


@[to_additive]
theorem prod_map_prod_map (m : Multiset β) (n : Multiset γ) {f : β → γ → α} :
    prod (m.map fun a => prod <| n.map fun b => f a b) =
      prod (n.map fun b => prod <| m.map fun a => f a b)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[CommMonoid α]
(m : Multiset β)
(n : Multiset γ)
{f : β → γ → α}

(Multiset.map (fun a => (Multiset.map (fun b => f a b) n).prod) m).prod =
  (Multiset.map (fun b => (Multiset.map (fun a => f a b) m).prod) n).prod


/-- If the forgetful functor of a concrete category reflects isomorphisms, being an isomorphism
is equivalent to being bijective. -/
theorem isIso_iff_bijective [(forget C).ReflectsIsomorphisms]
    {X Y : C} (f : X ⟶ Y) : IsIso f ↔ Function.Bijective ((forget C).map f)

CategoryTheory.IsIso f ↔ Function.Bijective ((CategoryTheory.forget C).map f)


@[to_additive] lemma mulEnergy_eq_card_filter (s t : Finset α) :
    Eₘ[s, t] = (((s ×ˢ t) ×ˢ s ×ˢ t).filter fun ((a, b), c, d) ↦ a * b = c * d).card

{α : Type u_1}
[DecidableEq α]
[Add α]
(s t : Finset α)

s.addEnergy t =
  (Finset.filter (fun x => Finset.addEnergy_eq_card_filter.match_1 (fun x => Prop) x fun a b c d => a + b = c + d)
      ((s ×ˢ t) ×ˢ s ×ˢ t)).card


/-- Oriented angle version of "angles in same segment are equal" and "opposite angles of a
cyclic quadrilateral add to π", for oriented angles mod π (for which those are the same result),
represented here as equality of twice the angles. -/
theorem Cospherical.two_zsmul_oangle_eq {p₁ p₂ p₃ p₄ : P}
    (h : Cospherical ({p₁, p₂, p₃, p₄} : Set P)) (hp₂p₁ : p₂ ≠ p₁) (hp₂p₄ : p₂ ≠ p₄)
    (hp₃p₁ : p₃ ≠ p₁) (hp₃p₄ : p₃ ≠ p₄) : (2 : ℤ) • ∡ p₁ p₂ p₄ = (2 : ℤ) • ∡ p₁ p₃ p₄

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

(h : EuclideanGeometry.Cospherical {p₁, p₂, p₃, p₄})

2 • ∡ p₁ p₂ p₄ = 2 • ∡ p₁ p₃ p₄


lemma conductor_ne_zero (hn : n ≠ 0) : conductor χ ≠ 0

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)
(hn : n ≠ 0)


/-- Canonical isomorphism between polynomials and the subalgebra generated by
  algebraically independent elements. -/
@[simps!]
def AlgebraicIndependent.aevalEquiv (hx : AlgebraicIndependent R x) :
    MvPolynomial ι R ≃ₐ[R] Algebra.adjoin R (range x)

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)
(b : ↥(Algebra.adjoin R (Set.range x)))

hx.aevalEquiv.symm b = Function.surjInv ⋯ b


theorem tendsto_abs_tan_atTop (k : ℤ) :
    Tendsto (fun x => abs (tan x)) (𝓝[≠] ((2 * k + 1) * π / 2 : ℂ)) atTop

Filter.Tendsto (fun x => Complex.abs (Complex.tan x))
  (nhdsWithin ((2 * ↑k + 1) * ↑Real.pi / 2) {(2 * ↑k + 1) * ↑Real.pi / 2}ᶜ) Filter.atTop


theorem fract_eq_fract {a b : α} : fract a = fract b ↔ ∃ z : ℤ, a - b = z

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

Int.fract a = Int.fract b ↔ ∃ z, a - b = ↑z


/-- If the inner product of two vectors is equal to the product of their norms, then the two vectors
are multiples of each other. One form of the equality case for Cauchy-Schwarz.
Compare `inner_eq_norm_mul_iff`, which takes the stronger hypothesis `⟪x, y⟫ = ‖x‖ * ‖y‖`. -/
theorem norm_inner_eq_norm_iff {x y : E} (hx₀ : x ≠ 0) (hy₀ : y ≠ 0) :
    ‖⟪x, y⟫‖ = ‖x‖ * ‖y‖ ↔ ∃ r : 𝕜, r ≠ 0 ∧ y = r • x

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x y : E}
(hx₀ : x ≠ 0)
(hy₀ : y ≠ 0)

‖⟪x, y⟫_𝕜‖ = ‖x‖ * ‖y‖ ↔ ∃ r, r ≠ 0 ∧ y = r • x


@[simp]
theorem coeSubmodule_map : (N.map f : Submodule R M') = (N : Submodule R M).map (f : M →ₗ[R] M')

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
(f : M →ₗ⁅R,L⁆ M')
(N : LieSubmodule R L M)

↑(LieSubmodule.map f N) = Submodule.map ↑f ↑N


@[simp]
theorem bind_apply {m : Measure α} {f : α → Measure β} {s : Set β} (hs : MeasurableSet s)
    (hf : Measurable f) : bind m f s = ∫⁻ a, f a s ∂m

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{m : MeasureTheory.Measure α}
{f : α → MeasureTheory.Measure β}
{s : Set β}
(hs : MeasurableSet s)
(hf : Measurable f)


/-- Given `z : S`, `IsLocalization.sec M z` is defined to be a pair `(x, y) : R × M` such
that `z * f y = f x`, so this lemma is just an application of `S`'s commutativity. -/
theorem sec_spec' (z : S) :
    algebraMap R S (IsLocalization.sec M z).1 = algebraMap R S (IsLocalization.sec M z).2 * z

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(z : S)

(algebraMap R S) (IsLocalization.sec M z).1 = (algebraMap R S) ↑(IsLocalization.sec M z).2 * z


/-- A countable filter basis `B` on a type `α` is a nonempty countable collection of sets of `α`
such that the intersection of two elements of this collection contains some element
of the collection. -/
structure CountableFilterBasis (α : Type*) extends FilterBasis α where
  /-- The set of sets of the filter basis is countable. -/
  countable : sets.Countable

{α : Type u_6}
(self : Filter.CountableFilterBasis α)


theorem hasSum_geometric_two' (a : ℝ) : HasSum (fun n : ℕ ↦ a / 2 / 2 ^ n) a


theorem _root_.AddSubmonoid.centralizer_toAddSubsemigroup {M} [AddMonoid M] (S : Set M) :
    (AddSubmonoid.centralizer S).toAddSubsemigroup = AddSubsemigroup.centralizer S

{M : Type u_2}
[AddMonoid M]
(S : Set M)


private theorem mem_replaceF {l : List (α × β)} {x : α × β} {p : α × β → Bool} {f : α × β → β} :
    x ∈ (l.replaceF fun a => bif p a then some (k, f a) else none) → x.1 = k ∨ x ∈ l

{α : Type u_1}
{β : Type u_2}
{k : α}
{l : List (α × β)}
{x : α × β}
{p : α × β → Bool}
{f : α × β → β}

x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l


@[simp]
theorem relNorm_singleton (r : S) : relNorm R (span ({r} : Set S)) = span {Algebra.norm R r}

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[IsDedekindDomain R]
[IsDedekindDomain S]
[Module.Finite R S]
[Module.Free R S]
(r : S)

(Ideal.relNorm R) (Ideal.span {r}) = Ideal.span {(Algebra.norm R) r}


@[simp, mfld_simps]
theorem mem_trivChange_source (i j : ι) (p : B × F) :
    p ∈ (Z.trivChange i j).source ↔ p.1 ∈ Z.baseSet i ∩ Z.baseSet j

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(i j : ι)
(p : B × F)


/-- When `A : Rep k G` is a trivial representation of `G`, `Z¹(G, A)` is isomorphic to the
group homs `G → A`. -/
@[simps] def oneCocyclesLequivOfIsTrivial [hA : A.IsTrivial] :
    oneCocycles A ≃ₗ[k] Additive G →+ A

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)
[hA : A.IsTrivial]
(f : ↥(groupCohomology.oneCocycles A))

∀ (a : Additive G), ((groupCohomology.oneCocyclesLequivOfIsTrivial A) f) a = (↑f ∘ ⇑Additive.toMul) a


/-- Two vector spaces are isomorphic if they have the same dimension. -/
theorem nonempty_linearEquiv_of_rank_eq (cond : Module.rank R M = Module.rank R M₁) :
    Nonempty (M ≃ₗ[R] M₁)


@[to_additive]
theorem tprod_le_tprod_of_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 1 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : Multipliable f)
    (hg : Multipliable g) : tprod f ≤ tprod g

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{g : κ → α}
(e : ι → κ)
(he : Function.Injective e)
(hs : ∀ c ∉ Set.range e, 1 ≤ g c)
(h : ∀ (i : ι), f i ≤ g (e i))
(hf : Multipliable f)
(hg : Multipliable g)


@[simp] lemma toLinearEquiv_toOpposite : toLinearEquiv (toOpposite R A) = opLinearEquiv R

(R : Type u_1)
(A : Type u_3)
[CommSemiring R]
[CommSemiring A]
[Algebra R A]

(AlgEquiv.toOpposite R A).toLinearEquiv = MulOpposite.opLinearEquiv R


theorem LowerSemicontinuous.lowerSemicontinuousWithinAt (h : LowerSemicontinuous f) (s : Set α)
    (x : α) : LowerSemicontinuousWithinAt f s x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}
(h : LowerSemicontinuous f)
(s : Set α)
(x : α)


@[to_additive (attr := simp) sub_sub_sub_cancel_right]
theorem div_div_div_cancel_right' (a b c : G) : a / c / (b / c) = a / b


@[simp]
nonrec theorem next_mem (s : Cycle α) (hs : Nodup s) (x : α) (hx : x ∈ s) : s.next hs x hx ∈ s

{α : Type u_1}
[DecidableEq α]
(s : Cycle α)
(hs : s.Nodup)
(x : α)
(hx : x ∈ s)


theorem toNNRat_lt_toNNRat_iff_of_nonneg (hq : 0 ≤ q) : toNNRat q < toNNRat p ↔ q < p


theorem image2_eq_seq (f : α → β → γ) (s : Set α) (t : Set β) : image2 f s t = seq (f '' s) t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(s : Set α)
(t : Set β)


/-- For every set `s` and a countable collection of measures `μ i` there exists a measurable
superset `t ⊇ s` such that each measure `μ i` takes the same value on `s` and `t`. -/
theorem exists_measurable_superset_forall_eq [Countable ι] (μ : ι → Measure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ∀ i, μ i t = μ i s

{α : Type u_1}
{ι : Sort u_5}
[MeasurableSpace α]
[Countable ι]
(μ : ι → MeasureTheory.Measure α)
(s : Set α)

∃ t, s ⊆ t ∧ MeasurableSet t ∧ ∀ (i : ι), (μ i) t = (μ i) s


theorem eLpNorm_const_smul (c : 𝕜) (f : α → F) :
    eLpNorm (c • f) p μ = (‖c‖₊ : ℝ≥0∞) * eLpNorm f p μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{𝕜 : Type u_5}
[NormedDivisionRing 𝕜]
[Module 𝕜 F]
[BoundedSMul 𝕜 F]
(c : 𝕜)
(f : α → F)

MeasureTheory.eLpNorm (c • f) p μ = ↑‖c‖₊ * MeasureTheory.eLpNorm f p μ


@[simp]
theorem coeff_mk (x : Fin n → R) (i : Fin n) : (mk p x).coeff i = x i

{p n : ℕ}
{R : Type u_1}
(x : Fin n → R)
(i : Fin n)

TruncatedWittVector.coeff i (TruncatedWittVector.mk p x) = x i


lemma hasFDerivWithinAt_of_isOpen (h : IsOpen s) (hx : x ∈ s) :
    HasFDerivWithinAt f f' s x ↔ HasFDerivAt f f' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s : Set E}
(h : IsOpen s)
(hx : x ∈ s)


@[simp]
protected theorem compl_sup (s t : UpperSet α) : (s ⊔ t).compl = s.compl ⊔ t.compl

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


@[to_additive (attr := measurability)]
protected theorem const_smul {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β]
    (hf : AEStronglyMeasurable f μ) (c : 𝕜) : AEStronglyMeasurable (c • f) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (c +ᵥ f) μ


theorem liftPropWithinAt_inter (ht : t ∈ 𝓝 x) :
    LiftPropWithinAt P g (s ∩ t) x ↔ LiftPropWithinAt P g s x

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
{g : M → M'}
{s t : Set M}
{x : M}
(hG : G.LocalInvariantProp G' P)
(ht : t ∈ 𝓝 x)

ChartedSpace.LiftPropWithinAt P g (s ∩ t) x ↔ ChartedSpace.LiftPropWithinAt P g s x


@[simp]
theorem gcd_eq_sup (I J : Ideal A) : gcd I J = I ⊔ J

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
(I J : Ideal A)


theorem dedup_append (l₁ l₂ : List α) : dedup (l₁ ++ l₂) = l₁ ∪ dedup l₂

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


theorem fderiv_inv : fderiv 𝕜 (fun x => x⁻¹) x = smulRight (1 : 𝕜 →L[𝕜] 𝕜) (-(x ^ 2)⁻¹)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}

fderiv 𝕜 (fun x => x⁻¹) x = ContinuousLinearMap.smulRight 1 (-(x ^ 2)⁻¹)


/-- The functor from the arrow category of `C` to `C` itself that maps a morphism to its image
    and a commutative square to the induced morphism on images. -/
@[simps]
def im : Arrow C ⥤ C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasImages C]
[CategoryTheory.Limits.HasImageMaps C]

∀ {X Y : CategoryTheory.Arrow C} (st : X ⟶ Y), CategoryTheory.Limits.im.map st = CategoryTheory.Limits.image.map st


@[simp]
theorem coe_real_pi : (pi : ℝ) = π


theorem setIntegral_mono (h : f ≤ g) : ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f g : X → ℝ}
{s : Set X}
(hf : MeasureTheory.IntegrableOn f s μ)
(hg : MeasureTheory.IntegrableOn g s μ)
(h : f ≤ g)

∫ (x : X) in s, f x ∂μ ≤ ∫ (x : X) in s, g x ∂μ


theorem join_of_single (h : Reflexive r) (hab : r a b) : Join r a b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
(h : Reflexive r)
(hab : r a b)


theorem iUnion_and {p q : Prop} (s : p ∧ q → Set α) : ⋃ h, s h = ⋃ (hp) (hq), s ⟨hp, hq⟩

{α : Type u_1}
{p q : Prop}
(s : p ∧ q → Set α)

⋃ (h : p ∧ q), s h = ⋃ (hp : p), ⋃ (hq : q), s ⋯


@[simps]
instance Endofunctor.coalgebraPreadditive : Preadditive (Endofunctor.Coalgebra F)

(A₁ A₂ : CategoryTheory.Endofunctor.Coalgebra F)


@[simp] theorem getLast_singleton (a h) : @getLast α [a] h = a


@[simp]
theorem ae_dirac_eq [MeasurableSingletonClass α] (a : α) : ae (dirac a) = pure a

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
(a : α)

MeasureTheory.ae (MeasureTheory.Measure.dirac a) = pure a


lemma isAffine_of_isAffineOpen_basicOpen (s : Set Γ(X, ⊤))
    (hs : Ideal.span s = ⊤) (hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)) :
    IsAffine X

(s : Set ↑(X.presheaf.obj (Opposite.op ⊤)))

(hs₂ : ∀ i ∈ s, AlgebraicGeometry.IsAffineOpen (X.basicOpen i))


theorem mem_cons_of_mem (v : Vector α n) (ha' : a' ∈ v.toList) : a' ∈ (a ::ᵥ v).toList

{α : Type u_1}
{n : ℕ}
(a a' : α)
(v : Mathlib.Vector α n)
(ha' : a' ∈ v.toList)


@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm 𝕜 E} : (p : E → ℝ) ≤ q ↔ p ≤ q

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
{p q : Seminorm 𝕜 E}

⇑p ≤ ⇑q ↔ p ≤ q


/-- Markov's inequality for the counting measure with hypothesis using `tsum` in `ℝ≥0∞`. -/
theorem _root_.ENNReal.count_const_le_le_of_tsum_le [MeasurableSingletonClass α] {a : α → ℝ≥0∞}
    (a_mble : Measurable a) {c : ℝ≥0∞} (tsum_le_c : ∑' i, a i ≤ c) {ε : ℝ≥0∞} (ε_ne_zero : ε ≠ 0)
    (ε_ne_top : ε ≠ ∞) : Measure.count { i : α | ε ≤ a i } ≤ c / ε

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
{a : α → ℝ≥0∞}
(a_mble : Measurable a)
{c : ℝ≥0∞}
(tsum_le_c : ∑' (i : α), a i ≤ c)
{ε : ℝ≥0∞}
(ε_ne_zero : ε ≠ 0)
(ε_ne_top : ε ≠ ⊤)

MeasureTheory.Measure.count {i | ε ≤ a i} ≤ c / ε


theorem eq_insert_of_ncard_eq_succ {n : ℕ} (h : s.ncard = n + 1) :
    ∃ a t, a ∉ t ∧ insert a t = s ∧ t.ncard = n

{α : Type u_1}
{s : Set α}
{n : ℕ}
(h : s.ncard = n + 1)


/-- An additive content is a set function with value 0 at the empty set which is finitely additive
on a given set of sets. -/
structure AddContent (C : Set (Set α)) where
  /-- The value of the content on a set. -/
  toFun : Set α → ℝ≥0∞
  empty' : toFun ∅ = 0
  sUnion' (I : Finset (Set α)) (_h_ss : ↑I ⊆ C)
      (_h_dis : PairwiseDisjoint (I : Set (Set α)) id) (_h_mem : ⋃₀ ↑I ∈ C) :
    toFun (⋃₀ I) = ∑ u ∈ I, toFun u

{α : Type u_1}
{C : Set (Set α)}
(self : MeasureTheory.AddContent C)
(I : Finset (Set α))
(_h_ss : ↑I ⊆ C)
(_h_dis : (↑I).PairwiseDisjoint id)
(_h_mem : ⋃₀ ↑I ∈ C)

self.toFun (⋃₀ ↑I) = ∑ u ∈ I, self.toFun u


/-- The radius of the sum of two formal series is at least the minimum of their two radii. -/
theorem min_radius_le_radius_add (p q : FormalMultilinearSeries 𝕜 E F) :
    min p.radius q.radius ≤ (p + q).radius

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


theorem countablySeparated_def [MeasurableSpace α] :
    CountablySeparated α ↔ HasCountableSeparatingOn α MeasurableSet univ

MeasurableSpace.CountablySeparated α ↔ HasCountableSeparatingOn α MeasurableSet Set.univ


@[simp]
theorem neg_smul : -r • x = -(r • x)

{R : Type u_2}
{M : Type u_5}
[Ring R]
[AddCommGroup M]
[Module R M]
(r : R)
(x : M)


@[simp]
theorem toDFinsupp_inj : toDFinsupp s = toDFinsupp t ↔ s = t

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

Multiset.toDFinsupp s = Multiset.toDFinsupp t ↔ s = t


/-- The complex hyperbolic sine function is everywhere strictly differentiable, with the derivative
`cosh x`. -/
theorem hasStrictDerivAt_sinh (x : ℂ) : HasStrictDerivAt sinh (cosh x) x

HasStrictDerivAt Complex.sinh (Complex.cosh x) x


theorem forall' {p : α → β → Prop} : (∀ x : PProd α β, p x.1 x.2) ↔ ∀ a b, p a b

{α : Sort u_1}
{β : Sort u_2}
{p : α → β → Prop}

(∀ (x : PProd α β), p x.fst x.snd) ↔ ∀ (a : α) (b : β), p a b


theorem measure_le_lintegral_thickenedIndicatorAux (μ : Measure X) {E : Set X}
    (E_mble : MeasurableSet E) (δ : ℝ) : μ E ≤ ∫⁻ x, (thickenedIndicatorAux δ E x : ℝ≥0∞) ∂μ

{X : Type u_1}
[MeasurableSpace X]
[PseudoEMetricSpace X]
(μ : MeasureTheory.Measure X)
{E : Set X}
(E_mble : MeasurableSet E)
(δ : ℝ)

μ E ≤ ∫⁻ (x : X), thickenedIndicatorAux δ E x ∂μ


/-- The cartesian product of two equivalences of categories. -/
@[simps]
def prod (E₁ : A ≌ B) (E₂ : C ≌ D) : A × C ≌ B × D

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

(E₁.prod E₂).inverse = E₁.inverse.prod E₂.inverse


@[to_additive]
lemma mul_self (x : G) : x * x = 1

{G : Type u_1}
[Group G]
[IsKleinFour G]
(x : G)


@[to_additive]
theorem noncommProd_eq_prod {α : Type*} [CommMonoid α] (s : Multiset α) :
    (noncommProd s fun _ _ _ _ _ => Commute.all _ _) = prod s

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


theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
    map (f.extend I).symm (𝓝[range I] f.extend I y) = 𝓝 y

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{y : M}
(hy : y ∈ f.source)

Filter.map (↑(f.extend I).symm) (𝓝[Set.range ↑I] ↑(f.extend I) y) = 𝓝 y


@[to_additive]
theorem singleton_mul_ball : {x} * ball y δ = ball (x * y) δ

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(x y : E)

{x} * Metric.ball y δ = Metric.ball (x * y) δ


lemma fibration_iff_isLowerSet_image [Preorder α] [LE β] :
    Fibration (· ≤ ·) (· ≤ ·) f ↔ ∀ s, IsLowerSet s → IsLowerSet (f '' s)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[LE β]

Relation.Fibration (fun x x_1 => x ≤ x_1) (fun x x_1 => x ≤ x_1) f ↔ ∀ (s : Set α), IsLowerSet s → IsLowerSet (f '' s)


theorem NF.oadd {e a} (h₁ : NF e) (n) (h₂ : NFBelow a (repr e)) : NF (oadd e n a)

{e a : ONote}
(h₁ : e.NF)
(n : ℕ+)
(h₂ : a.NFBelow e.repr)


/-- Given any pullback diagram of the form

```
Z  ⟶ X₁
↓    ↓
X₂ ⟶ X
```

where `X₁ ⟶ X ← X₂` is a coproduct diagram, then `Z` is initial, and both `X₁ ⟶ X` and `X₂ ⟶ X`
are mono.
-/
class CoproductDisjoint (X₁ X₂ : C) where
  isInitialOfIsPullbackOfIsCoproduct :
    ∀ {X Z} {pX₁ : X₁ ⟶ X} {pX₂ : X₂ ⟶ X} {f : Z ⟶ X₁} {g : Z ⟶ X₂}
      (_cX : IsColimit (BinaryCofan.mk pX₁ pX₂)) {comm : f ≫ pX₁ = g ≫ pX₂},
      IsLimit (PullbackCone.mk _ _ comm) → IsInitial Z
  mono_inl : ∀ (X) (X₁ : X₁ ⟶ X) (X₂ : X₂ ⟶ X) (_cX : IsColimit (BinaryCofan.mk X₁ X₂)), Mono X₁
  mono_inr : ∀ (X) (X₁ : X₁ ⟶ X) (X₂ : X₂ ⟶ X) (_cX : IsColimit (BinaryCofan.mk X₁ X₂)), Mono X₂

[self : CategoryTheory.Limits.CoproductDisjoint X₁ X₂]

∀ (X₁_1 : X₁ ⟶ X) (X₂_1 : X₂ ⟶ X),
  CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.BinaryCofan.mk X₁_1 X₂_1) → CategoryTheory.Mono X₂_1


@[simp] lemma logOrderIso_symm : logOrderIso.symm = expOrderIso


/-- A helper function used in defining the Čech adjunction. -/
@[simps]
def equivalenceLeftToRight (X : SimplicialObject.Augmented C) (F : Arrow C)
    (G : Augmented.toArrow.obj X ⟶ F) : X ⟶ F.augmentedCechNerve

[∀ (n : ℕ) (f : CategoryTheory.Arrow C), CategoryTheory.Limits.HasWidePullback f.right (fun x => f.left) fun x => f.hom]

(X : CategoryTheory.SimplicialObject.Augmented C)

(G : CategoryTheory.SimplicialObject.Augmented.toArrow.obj X ⟶ F)

(CategoryTheory.SimplicialObject.equivalenceLeftToRight X F G).left.app x =
  CategoryTheory.Limits.WidePullback.lift (X.hom.app x ≫ G.right)
    (fun i => X.left.map ((SimplexCategory.mk 0).const (Opposite.unop x) i).op ≫ G.left) ⋯


@[to_additive (attr := simp)]
lemma stabilizer_finset_singleton (b : α) : stabilizer G ({b} : Finset α) = stabilizer G b

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
[DecidableEq α]
(b : α)

AddAction.stabilizer G {b} = AddAction.stabilizer G b


theorem not_prime_iff_exists_dvd_ne {n : ℕ} (h : 2 ≤ n) : (¬Prime n) ↔ ∃ m, m ∣ n ∧ m ≠ 1 ∧ m ≠ n

¬Nat.Prime n ↔ ∃ m, m ∣ n ∧ m ≠ 1 ∧ m ≠ n


@[to_additive sum_le_univ_sum_of_nonneg]
theorem prod_le_univ_prod_of_one_le' [Fintype ι] {s : Finset ι} (w : ∀ x, 1 ≤ f x) :
    ∏ x ∈ s, f x ≤ ∏ x, f x

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
{f : ι → N}
[Fintype ι]
{s : Finset ι}
(w : ∀ (x : ι), 0 ≤ f x)


theorem hom_eq_hom [Semiring S₂] (f g : MvPolynomial σ R →+* S₂) (hC : f.comp C = g.comp C)
    (hX : ∀ n : σ, f (X n) = g (X n)) (p : MvPolynomial σ R) : f p = g p

(hC : f.comp MvPolynomial.C = g.comp MvPolynomial.C)

(hX : ∀ (n : σ), f (MvPolynomial.X n) = g (MvPolynomial.X n))


/-- If `f` is surjective, `i` is injective, and there exists some `m` such that
`LinearMap.iterateMapComap f i m K = LinearMap.iterateMapComap f i (m + 1) K`,
then for any `n`,
`LinearMap.iterateMapComap f i n K = LinearMap.iterateMapComap f i (n + 1) K`.
In particular, by taking `n = 0`, the kernel of `f` is contained in `K`
(`LinearMap.ker_le_of_iterateMapComap_eq_succ`),
which is a consequence of `LinearMap.ker_le_comap`. -/
theorem iterateMapComap_eq_succ (K : Submodule R N)
    (m : ℕ) (heq : f.iterateMapComap i m K = f.iterateMapComap i (m + 1) K)
    (hf : Surjective f) (hi : Injective i) (n : ℕ) :
    f.iterateMapComap i n K = f.iterateMapComap i (n + 1) K


theorem lowerSemicontinuousWithinAt_biSup {p : ι → Prop} {f : ∀ i, p i → α → δ}
    (h : ∀ i hi, LowerSemicontinuousWithinAt (f i hi) s x) :
    LowerSemicontinuousWithinAt (fun x' => ⨆ (i) (hi), f i hi x') s x

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

LowerSemicontinuousWithinAt (fun x' => ⨆ i, ⨆ (hi : p i), f i hi x') s x


@[to_additive]
theorem measure_mul_right_null (y : G) : μ ((fun x => x * y) ⁻¹' s) = 0 ↔ μ s = 0

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
{s : Set G}
[MeasurableInv G]
[μ.IsMulLeftInvariant]
(y : G)


@[to_additive]
theorem norm_mul_le_of_le (h₁ : ‖a₁‖ ≤ r₁) (h₂ : ‖a₂‖ ≤ r₂) : ‖a₁ * a₂‖ ≤ r₁ + r₂

{E : Type u_6}
[SeminormedAddGroup E]
{a₁ a₂ : E}
{r₁ r₂ : ℝ}
(h₁ : ‖a₁‖ ≤ r₁)
(h₂ : ‖a₂‖ ≤ r₂)

‖a₁ + a₂‖ ≤ r₁ + r₂


@[to_additive]
theorem mul_inf_assoc (A B C : Subgroup G) (h : A ≤ C) :
    (A : Set G) * ↑(B ⊓ C) = (A : Set G) * (B : Set G) ∩ C

{G : Type u_2}
[Group G]
(A B C : Subgroup G)
(h : A ≤ C)


lemma nndist_inr (a b : A) : nndist (a : Unitization 𝕜 A) (b : Unitization 𝕜 A) = nndist a b

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


protected theorem lt_or_gt_of_ne {i j : Fin n} (h : i ≠ j) : i < j ∨ i > j


theorem sub_def (p q : ℚ≥0) : p - q = toNNRat (p - q)


lemma W_whiskerLeft_iff {P Q : Cᵒᵖ ⥤ A} (f : P ⟶ Q) :
    K.W (whiskerLeft G.op f) ↔ J.W f

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[(G.sheafPushforwardContinuous A K J).EssSurj]

K.W (CategoryTheory.whiskerLeft G.op f) ↔ J.W f


theorem Finite.toFinset_insert' [DecidableEq α] {a : α} {s : Set α} (hs : s.Finite) :
    (hs.insert a).toFinset = insert a hs.toFinset

{α : Type u}
[DecidableEq α]
{a : α}
{s : Set α}
(hs : s.Finite)


/-- **Pythagorean theorem**, if-and-only-if angle-at-point form. -/
theorem dist_sq_eq_dist_sq_add_dist_sq_iff_angle_eq_pi_div_two (p1 p2 p3 : P) :
    dist p1 p3 * dist p1 p3 = dist p1 p2 * dist p1 p2 + dist p3 p2 * dist p3 p2 ↔
      ∠ p1 p2 p3 = π / 2

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p1 p2 p3 : P)


@[simp] lemma bddBelow_smul_iff_of_neg (ha : a < 0) : BddBelow (a • s) ↔ BddAbove s

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
{s : Set β}
{a : α}
(ha : a < 0)


protected theorem HasAntitoneBasis.tendsto [Preorder ι] {l : Filter α} {s : ι → Set α}
    (hl : l.HasAntitoneBasis s) {φ : ι → α} (h : ∀ i : ι, φ i ∈ s i) : Tendsto φ atTop l

{ι : Type u_1}
{α : Type u_3}
[Preorder ι]
{l : Filter α}
{s : ι → Set α}
(hl : l.HasAntitoneBasis s)
{φ : ι → α}
(h : ∀ (i : ι), φ i ∈ s i)


@[simp]
theorem pell_eq (n : ℕ) : xn a1 n * xn a1 n - d a1 * yn a1 n * yn a1 n = 1

Pell.xn a1 n * Pell.xn a1 n - Pell.d a1 * Pell.yn a1 n * Pell.yn a1 n = 1


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

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


theorem determinant_aux (hyp : n = 0 ∨ ¬(↑s : GenContFract K).TerminatedAt (n - 1)) :
    ((↑s : GenContFract K).contsAux n).a * ((↑s : GenContFract K).contsAux (n + 1)).b -
      ((↑s : GenContFract K).contsAux n).b * ((↑s : GenContFract K).contsAux (n + 1)).a =
        (-1) ^ n

(hyp : n = 0 ∨ ¬(↑s).TerminatedAt (n - 1))

((↑s).contsAux n).a * ((↑s).contsAux (n + 1)).b - ((↑s).contsAux n).b * ((↑s).contsAux (n + 1)).a = (-1) ^ n


theorem natTrailingDegree_le_of_trailingDegree_le {n : ℕ} {hp : p ≠ 0}
    (H : (n : ℕ∞) ≤ trailingDegree p) : n ≤ natTrailingDegree p

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}
{hp : p ≠ 0}
(H : ↑n ≤ p.trailingDegree)


/--
The category of multicoforks is equivalent to the category of coforks over `∐ I.left ⇉ ∐ I.right`.
It then follows from `CategoryTheory.IsColimit.ofPreservesCoconeInitial` (or `reflects`) that
it preserves and reflects colimit cocones.
-/
@[simps]
noncomputable def multicoforkEquivSigmaCofork :
    Multicofork I ≌ Cofork I.fstSigmaMap I.sndSigmaMap

(I : CategoryTheory.Limits.MultispanIndex C)


@[to_additive]
theorem image_op_inv : op '' s⁻¹ = (op '' s)⁻¹

{α : Type u_2}
[InvolutiveInv α]
{s : Set α}

MulOpposite.op '' s⁻¹ = (MulOpposite.op '' s)⁻¹


theorem image_neg_Ioo : Neg.neg '' Ioo a b = Ioo (-b) (-a)

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

Neg.neg '' Set.Ioo a b = Set.Ioo (-b) (-a)


theorem two_cosh : 2 * cosh x = exp x + exp (-x)

2 * Complex.cosh x = Complex.exp x + Complex.exp (-x)


@[simp] theorem liftOrGet_some_some {f} {a b : α} :
  liftOrGet f (some a) (some b) = f a b

{α : Type u_1}
{f : α → α → α}
{a b : α}

Option.liftOrGet f (some a) (some b) = some (f a b)


theorem derivWithin_congr_set' (y : 𝕜) (h : s =ᶠ[𝓝[{y}ᶜ] x] t) :
    derivWithin f s x = derivWithin f t x

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


theorem nonempty_inter [PreconnectedSpace α] {s t : Set α} :
    IsOpen s → IsOpen t → s ∪ t = univ → s.Nonempty → t.Nonempty → (s ∩ t).Nonempty

{α : Type u}
[TopologicalSpace α]
[PreconnectedSpace α]
{s t : Set α}

IsOpen s → IsOpen t → s ∪ t = Set.univ → s.Nonempty → t.Nonempty → (s ∩ t).Nonempty


/-- The mean value theorem on a convex set in dimension 1: if the derivative of a function within
this set is bounded by `C`, then the function is `C`-Lipschitz. Version with `derivWithin` -/
theorem norm_image_sub_le_of_norm_derivWithin_le {C : ℝ} (hf : DifferentiableOn 𝕜 f s)
    (bound : ∀ x ∈ s, ‖derivWithin f s x‖ ≤ C) (hs : Convex ℝ s) (xs : x ∈ s) (ys : y ∈ s) :
    ‖f y - f x‖ ≤ C * ‖y - x‖


@[to_additive (attr := simp)]
theorem isComplement'_bot_left : IsComplement' ⊥ H ↔ H = ⊤

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


lemma stabilizerEquiv_invFun_eq (g : ∀ i, Perm {a // f a = i}) {a : α} {i : ι} (h : f a = i) :
    stabilizerEquiv_invFun g a = g i ⟨a, h⟩

(g : (i : ι) → Equiv.Perm { a // f a = i })

DomMulAct.stabilizerEquiv_invFun g a = ↑((g i) ⟨a, h⟩)


theorem isCompactOperator_iff_isCompact_closure_image_ball [ContinuousConstSMul 𝕜₂ M₂] [T2Space M₂]
    (f : M₁ →ₛₗ[σ₁₂] M₂) {r : ℝ} (hr : 0 < r) :
    IsCompactOperator f ↔ IsCompact (closure <| f '' Metric.ball 0 r)

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[SeminormedRing 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
{M₁ : Type u_3}
{M₂ : Type u_4}
[SeminormedAddCommGroup M₁]
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[NormedSpace 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[ContinuousConstSMul 𝕜₂ M₂]
[T2Space M₂]
(f : M₁ →ₛₗ[σ₁₂] M₂)
{r : ℝ}
(hr : 0 < r)

IsCompactOperator ⇑f ↔ IsCompact (closure (⇑f '' Metric.ball 0 r))


theorem addVal_pow (a : R) (n : ℕ) : addVal R (a ^ n) = n • addVal R a

{R : Type u_1}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
(a : R)
(n : ℕ)

(DiscreteValuationRing.addVal R) (a ^ n) = n • (DiscreteValuationRing.addVal R) a


theorem mul_eq_one_iff {x y : Associates α} : x * y = 1 ↔ x = 1 ∧ y = 1

{α : Type u_1}
[CommMonoid α]
{x y : Associates α}


@[reassoc]
lemma map₂_inv_hom_isIso {f g : a ⟶ b} (η : f ⟶ g) [IsIso η] :
    F.map₂ (inv η) ≫ F.map₂ η = 𝟙 (F.map g)

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.PrelaxFunctor B C)
{a b : B}
{f g : a ⟶ b}
(η : f ⟶ g)
[CategoryTheory.IsIso η]

CategoryTheory.CategoryStruct.comp (F.map₂ (CategoryTheory.inv η)) (F.map₂ η) =
  CategoryTheory.CategoryStruct.id (F.map g)


protected theorem inf_eq_bot_iff {α : Type*} [LinearOrder α] [BoundedOrder α] [Nontrivial α]
    {s : Finset ι} {f : ι → α} : s.inf f = ⊥ ↔ ∃ b ∈ s, f b = ⊥

{ι : Type u_5}
{α : Type u_7}
[LinearOrder α]
[BoundedOrder α]
[Nontrivial α]
{s : Finset ι}
{f : ι → α}


lemma summable_pow_mul_exp_neg_nat_mul (k : ℕ) {r : ℝ} (hr : 0 < r) :
    Summable fun n : ℕ ↦ n ^ k * exp (-r * n)

Summable fun n => ↑n ^ k * Real.exp (-r * ↑n)


theorem topologicalClosure_mono : Monotone (topologicalClosure : _ → StarSubalgebra R A)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[TopologicalSemiring A]
[ContinuousStar A]


theorem const_min (hf : LipschitzWith Kf f) (a : ℝ) : LipschitzWith Kf fun x => min a (f x)

{α : Type u}
[PseudoEMetricSpace α]
{f : α → ℝ}
{Kf : ℝ≥0}
(hf : LipschitzWith Kf f)
(a : ℝ)


theorem R.sound (m n : ℕ) (x y : K) (H : (frobenius K p)^[m] x = y) :
    mk K p (n, x) = mk K p (m + n, y)

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]
(m n : ℕ)
(x y : K)
(H : (⇑(frobenius K p))^[m] x = y)

PerfectClosure.mk K p (n, x) = PerfectClosure.mk K p (m + n, y)


{α : Type u_1}
[Semifield α]
[LinearOrder α]
[PosMulReflectLT α]
[ZeroLEOneClass α]
{a : α}


@[simp]
theorem guard_true {h : Decidable True} : @guard F _ True h = pure ()

{F : Type → Type v}
[Alternative F]
{h : Decidable True}


/-- Complete graphs are strongly regular. Note that `μ` can take any value
for complete graphs, since there are no distinct pairs of non-adjacent vertices. -/
theorem IsSRGWith.top :
    (⊤ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) μ

{V : Type u}
[Fintype V]
[DecidableEq V]
{μ : ℕ}

⊤.IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) μ


theorem grade_covBy_grade_iff : grade 𝕆 a ⋖ grade 𝕆 b ↔ a ⋖ b

{𝕆 : Type u_1}
{α : Type u_3}
[Preorder 𝕆]
[LinearOrder α]
[GradeOrder 𝕆 α]
{a b : α}


/-- A finitely generated `p ^ ∞`-torsion module over a PID is isomorphic to a direct sum of some
  `R ⧸ R ∙ (p ^ e i)` for some `e i`. -/
theorem torsion_by_prime_power_decomposition (hN : Module.IsTorsion' N (Submonoid.powers p))
    [h' : Module.Finite R N] :
    ∃ (d : ℕ) (k : Fin d → ℕ), Nonempty <| N ≃ₗ[R] ⨁ i : Fin d, R ⧸ R ∙ p ^ (k i : ℕ)

(hN : Module.IsTorsion' N ↥(Submonoid.powers p))

∃ d k, Nonempty (N ≃ₗ[R] ⨁ (i : Fin d), R ⧸ Submodule.span R {p ^ k i})


@[simp]
protected lemma sub_comp {n₁ n₂ n₁₂ : ℤ} (z₁ z₁' : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (z₁ - z₁').comp z₂ h = z₁.comp z₂ h - z₁'.comp z₂ h

(z₁ z₁' : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K n₂)


theorem equivalence_functor : (equivalence : SimplicialObject C ≌ _).functor = N


/-- The homology map data associated to the identity morphism of a short complex. -/
@[simps]
def id (h : S.HomologyData) : HomologyMapData (𝟙 S) h h

(CategoryTheory.ShortComplex.HomologyMapData.id h).right = CategoryTheory.ShortComplex.RightHomologyMapData.id h.right


@[simp]
lemma iso_hom_val_base_inv_val_base_apply {X Y : LocallyRingedSpace.{u}} (e : X ≅ Y) (x : X) :
    (e.inv.val.base (e.hom.val.base x)) = x

{X Y : AlgebraicGeometry.LocallyRingedSpace}


@[simp]
theorem natCast_eq_last (n) : (n : Fin (n + 1)) = Fin.last n


@[simp, norm_cast]
theorem coe_sup (s t : Closeds α) : (↑(s ⊔ t) : Set α) = ↑s ∪ ↑t

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


theorem exp_ℝ_ℂ_eq_exp_ℂ_ℂ : (exp ℝ : ℂ → ℂ) = exp ℂ


@[simp]
theorem iUnionLift_inclusion {i : ι} (x : S i) (h : S i ⊆ T) :
    iUnionLift S f hf T hT (Set.inclusion h x) = f i x

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

Set.iUnionLift S f hf T hT (Set.inclusion h x) = f i x


theorem Lp_add_le_tsum' {f g : ι → ℝ≥0} {p : ℝ} (hp : 1 ≤ p) (hf : Summable fun i => f i ^ p)
    (hg : Summable fun i => g i ^ p) :
    (∑' i, (f i + g i) ^ p) ^ (1 / p) ≤ (∑' i, f i ^ p) ^ (1 / p) + (∑' i, g i ^ p) ^ (1 / p)

{ι : Type u}
{f g : ι → ℝ≥0}
{p : ℝ}
(hp : 1 ≤ p)
(hf : Summable fun i => f i ^ p)
(hg : Summable fun i => g i ^ p)


@[simp]
theorem sublistsLen_succ_cons (n) (a : α) (l) :
    sublistsLen (n + 1) (a :: l) = sublistsLen (n + 1) l ++ (sublistsLen n l).map (cons a)

{α : Type u}
(n : ℕ)
(a : α)
(l : List α)

List.sublistsLen (n + 1) (a :: l) = List.sublistsLen (n + 1) l ++ List.map (List.cons a) (List.sublistsLen n l)


@[simp]
theorem fract_add_zspan (m : E) {v : E} (h : v ∈ span ℤ (Set.range b)) :
    fract b (m + v) = fract b m

(h : v ∈ Submodule.span ℤ (Set.range ⇑b))


theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S)
    (hE : (minpoly R pb.gen).Splits (algebraMap R F)) (hfx : IsSeparable R pb.gen) :
    algebraMap R F (norm R pb.gen) =
      (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).prod fun σ => σ pb.gen

(hE : Polynomial.Splits (algebraMap R F) (minpoly R pb.gen))

(algebraMap R F) ((Algebra.norm R) pb.gen) = ∏ σ : S →ₐ[R] F, σ pb.gen


@[to_additive (attr := simp)]
theorem mem_map {f : G →* N} {K : Subgroup G} {y : N} : y ∈ K.map f ↔ ∃ x ∈ K, f x = y

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{K : AddSubgroup G}
{y : N}

y ∈ AddSubgroup.map f K ↔ ∃ x ∈ K, f x = y


theorem Int.mem_zmultiples_iff {a b : ℤ} : b ∈ AddSubgroup.zmultiples a ↔ a ∣ b


theorem IsQF.toPrenexImpRight {φ : L.BoundedFormula α n} :
    ∀ {ψ : L.BoundedFormula α n}, IsQF ψ → φ.toPrenexImpRight ψ = φ.imp ψ

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
{φ ψ : L.BoundedFormula α n}


theorem groupoid_of_isCodetecting_empty (h : IsCodetecting (∅ : Set C)) {X Y : C} (f : X ⟶ Y) :
    IsIso f

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


lemma smul_left_of_tower (r : S) (x y : M) : B (r • x) y = r • B x y

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{S : Type u_3}
[CommSemiring S]
[Algebra S R]
[Module S M]
[IsScalarTower S R M]
{B : LinearMap.BilinForm R M}
(r : S)
(x y : M)


/-- `2` is a square modulo an odd prime `p` iff `p` is congruent to `1` or `7` mod `8`. -/
theorem exists_sq_eq_two_iff : IsSquare (2 : ZMod p) ↔ p % 8 = 1 ∨ p % 8 = 7

{p : ℕ}
[Fact (Nat.Prime p)]
(hp : p ≠ 2)


/-- `comp_change_of_variables m M N` is a bijection between `comp_partial_sum_source m M N`
and `comp_partial_sum_target m M N`, yielding equal sums for functions that correspond to each
other under the bijection. As `comp_change_of_variables m M N` is a dependent function, stating
that it is a bijection is not directly possible, but the consequence on sums can be stated
more easily. -/
theorem compChangeOfVariables_sum {α : Type*} [AddCommMonoid α] (m M N : ℕ)
    (f : (Σ n : ℕ, Fin n → ℕ) → α) (g : (Σ n, Composition n) → α)
    (h : ∀ (e) (he : e ∈ compPartialSumSource m M N), f e = g (compChangeOfVariables m M N e he)) :
    ∑ e ∈ compPartialSumSource m M N, f e = ∑ e ∈ compPartialSumTarget m M N, g e

(h :
  ∀ (e : (n : ℕ) × (Fin n → ℕ)) (he : e ∈ FormalMultilinearSeries.compPartialSumSource m M N),
    f e = g (FormalMultilinearSeries.compChangeOfVariables m M N e he))

∑ e ∈ FormalMultilinearSeries.compPartialSumSource m M N, f e =
  ∑ e ∈ FormalMultilinearSeries.compPartialSumTarget m M N, g e


theorem coe_range : AlgebraicIndependent R ((↑) : range x → A)

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)


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

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y p₁ : P}
(h : p₁ ∈ s)


lemma cast_card_sdiff [AddGroupWithOne R] (h : s ⊆ t) : ((t \ s).card : R) = t.card - s.card

{α : Type u_1}
{R : Type u_3}
{s t : Finset α}
[DecidableEq α]
[AddGroupWithOne R]
(h : s ⊆ t)


theorem init_iff (f : r ≼i s) {a : α} {b : β} : s b (f a) ↔ ∃ a', f a' = b ∧ r a' a

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ≼i s)
{a : α}
{b : β}


@[gcongr]
theorem Ioo_subset_Ioo_left (h : a₁ ≤ a₂) : Ioo a₂ b ⊆ Ioo a₁ b

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


theorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{r : R}
{a : A}

r ∈ resolventSet R a ↔ IsUnit ((algebraMap R A) r - a)


theorem toIocMod_neg (a b : α) : toIocMod hp a (-b) = p - toIcoMod hp (-a) b

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


/-- Elements of disjoint, normal subgroups commute. -/
@[to_additive "Elements of disjoint, normal subgroups commute."]
theorem commute_of_normal_of_disjoint (H₁ H₂ : Subgroup G) (hH₁ : H₁.Normal) (hH₂ : H₂.Normal)
    (hdis : Disjoint H₁ H₂) (x y : G) (hx : x ∈ H₁) (hy : y ∈ H₂) : Commute x y

{G : Type u_1}
[AddGroup G]
(H₁ H₂ : AddSubgroup G)
(hH₁ : H₁.Normal)
(hH₂ : H₂.Normal)
(hdis : Disjoint H₁ H₂)
(x y : G)
(hx : x ∈ H₁)
(hy : y ∈ H₂)


/-- A functor `C ⥤ D` computably lowers to a functor `ThinSkeleton C ⥤ ThinSkeleton D`. -/
@[simps]
def map (F : C ⥤ D) : ThinSkeleton C ⥤ ThinSkeleton D

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

∀ (a : X ⟶ Y),
  (CategoryTheory.ThinSkeleton.map F).map a =
    Quotient.recOnSubsingleton₂ (motive := fun x x_1 => (x ⟶ x_1) → (Quotient.map F.obj ⋯ x ⟶ Quotient.map F.obj ⋯ x_1))
      X Y (fun x y k => CategoryTheory.homOfLE ⋯) a


@[simp]
theorem tail_cons (x : α) (u : Fin m → α) : vecTail (vecCons x u) = u

{α : Type u}
{m : ℕ}
(x : α)
(u : Fin m → α)


theorem const_boundedAtFilter [Norm β] (l : Filter α) (c : β) :
    BoundedAtFilter l (Function.const α c : α → β)

{α : Type u_2}
{β : Type u_3}
[Norm β]
(l : Filter α)
(c : β)


theorem condexp_ae_eq_integral_condexpKernel' [NormedAddCommGroup F] {f : Ω → F}
    [NormedSpace ℝ F] [CompleteSpace F] (hf_int : Integrable f μ) :
    μ[f|m ⊓ mΩ] =ᵐ[μ] fun ω => ∫ y, f y ∂condexpKernel μ m ω

{Ω : Type u_1}
{F : Type u_2}
{m : MeasurableSpace Ω}
[mΩ : MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
[NormedAddCommGroup F]
{f : Ω → F}
[NormedSpace ℝ F]
[CompleteSpace F]
(hf_int : MeasureTheory.Integrable f μ)

μ[f|m ⊓ mΩ] =ᵐ[μ] fun ω => ∫ (y : Ω), f y ∂(ProbabilityTheory.condexpKernel μ m) ω


@[simp]
theorem map_const (f : α → β) (a : α) : map f (const a) = const (f a)

{α : Type u}
{β : Type v}
(f : α → β)
(a : α)

Stream'.map f (Stream'.const a) = Stream'.const (f a)


theorem Zoomed.toRootOrdered {cmp} :
    ∀ {path : Path α}, path.Zoomed (cmp v) → path.RootOrdered cmp v

{α : Type u_1}
{v : α}
{cmp : α → α → Ordering}
{path : Batteries.RBNode.Path α}

Batteries.RBNode.Path.Zoomed (cmp v) path → Batteries.RBNode.Path.RootOrdered cmp path v


/-- If two sets are nonempty and bounded in a metric space, they are at finite Hausdorff
edistance. -/
theorem hausdorffEdist_ne_top_of_nonempty_of_bounded (hs : s.Nonempty) (ht : t.Nonempty)
    (bs : IsBounded s) (bt : IsBounded t) : hausdorffEdist s t ≠ ⊤

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
(hs : s.Nonempty)
(ht : t.Nonempty)
(bs : Bornology.IsBounded s)
(bt : Bornology.IsBounded t)


theorem MapsTo.iterate_restrict {f : α → α} {s : Set α} (h : MapsTo f s s) (n : ℕ) :
    (h.restrict f s s)^[n] = (h.iterate n).restrict _ _ _

{α : Type u_1}
{f : α → α}
{s : Set α}
(h : Set.MapsTo f s s)
(n : ℕ)

(Set.MapsTo.restrict f s s h)^[n] = Set.MapsTo.restrict f^[n] s s ⋯


@[simp, norm_cast]
theorem cast_one : ((1 : ℤ) : R) = 1


theorem Filter.tendsto_nhds_max_left {l : Filter β} {a : α} (h : Tendsto f l (𝓝[>] a)) :
    Tendsto (fun i => max (f i) a) l (𝓝[>] a)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{f : β → α}
{l : Filter β}
{a : α}
(h : Filter.Tendsto f l (𝓝[>] a))

Filter.Tendsto (fun i => max (f i) a) l (𝓝[>] a)


theorem closure_preimage_le (f : R →+* S) (s : Set S) : closure (f ⁻¹' s) ≤ (closure s).comap f

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R →+* S)
(s : Set S)

Subring.closure (⇑f ⁻¹' s) ≤ Subring.comap f (Subring.closure s)


/-- A polynomial `p` that has as many roots as its degree
can be written `p = p.leadingCoeff * ∏(X - a)`, for `a` in `p.roots`. -/
theorem C_leadingCoeff_mul_prod_multiset_X_sub_C (hroots : Multiset.card p.roots = p.natDegree) :
    C p.leadingCoeff * (p.roots.map fun a => X - C a).prod = p

Polynomial.C p.leadingCoeff * (Multiset.map (fun a => Polynomial.X - Polynomial.C a) p.roots).prod = p


@[to_additive (attr := simp, norm_cast)]
lemma one_eq_coe : 1 = (a : WithBot α) ↔ a = 1


protected theorem inv_mul_cancel {x : tsze R M} (hx : fst x ≠ 0) : x⁻¹ * x = 1

{R : Type u}
{M : Type v}
[DivisionSemiring R]
[AddCommGroup M]
[Module Rᵐᵒᵖ M]
[Module R M]
{x : tsze R M}
(hx : x.fst ≠ 0)


theorem reverse_inv_prod_mul_prod (L : List (TransvectionStruct n R)) :
    (L.reverse.map (toMatrix ∘ TransvectionStruct.inv)).prod * (L.map toMatrix).prod = 1

(L : List (Matrix.TransvectionStruct n R))

(List.map (Matrix.TransvectionStruct.toMatrix ∘ Matrix.TransvectionStruct.inv) L.reverse).prod *
    (List.map Matrix.TransvectionStruct.toMatrix L).prod =
  1


theorem mulVec_conjTranspose [Fintype m] [StarRing α] (A : Matrix m n α) (x : m → α) :
    Aᴴ *ᵥ x = star (star x ᵥ* A)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalSemiring α]
[Fintype m]
[StarRing α]
(A : Matrix m n α)
(x : m → α)


@[simp]
theorem sInf_N (S : Set (I.Filtration M)) : (sInf S).N = sInf (Ideal.Filtration.N '' S)

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
(S : Set (I.Filtration M))


/-- If a set `s` is nowhere dense, so is its closure. -/
protected lemma IsNowhereDense.closure {s : Set X} (hs : IsNowhereDense s) :
    IsNowhereDense (closure s)

{X : Type u_5}
[TopologicalSpace X]
{s : Set X}
(hs : IsNowhereDense s)


@[to_additive]
theorem mem_rightTransversals_iff_bijective :
    S ∈ rightTransversals (H : Set G) ↔
      Function.Bijective (S.restrict (Quotient.mk'' : G → Quotient (QuotientGroup.rightRel H)))

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

S ∈ Subgroup.rightTransversals ↑H ↔ Function.Bijective (S.restrict Quotient.mk'')


theorem ext_iff {a b : ℍ[R]} :
    a = b ↔ a.re = b.re ∧ a.imI = b.imI ∧ a.imJ = b.imJ ∧ a.imK = b.imK

{R : Type u_3}
[CommRing R]
{a b : ℍ[R]}


theorem convexHull_insert (hs : s.Nonempty) :
    convexHull 𝕜 (insert x s) = convexJoin 𝕜 {x} (convexHull 𝕜 s)

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hs : s.Nonempty)

(convexHull 𝕜) (insert x s) = convexJoin 𝕜 {x} ((convexHull 𝕜) s)


theorem smul_set_symmDiff₀ (ha : a ≠ 0) : a • s ∆ t = (a • s) ∆ (a • t)

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{s t : Set β}
{a : α}
(ha : a ≠ 0)

a • symmDiff s t = symmDiff (a • s) (a • t)


theorem Prime.not_dvd_mul {p m n : ℕ} (pp : Prime p) (Hm : ¬p ∣ m) (Hn : ¬p ∣ n) : ¬p ∣ m * n

{p m n : ℕ}
(pp : Nat.Prime p)
(Hm : ¬p ∣ m)
(Hn : ¬p ∣ n)


theorem mk_apply (i : ι) : Basis.mk hli hsp i = v i

(hsp : ⊤ ≤ Submodule.span R (Set.range v))


theorem iUnionLift_of_mem (x : T) {i : ι} (hx : (x : α) ∈ S i) :
    iUnionLift S f hf T hT x = f i ⟨x, hx⟩

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

Set.iUnionLift S f hf T hT x = f i ⟨↑x, hx⟩


theorem I_union_F : (IF.I : Set P) ∪ IF.F = Set.univ

{P : Type u_1}
[Preorder P]
(IF : Order.Ideal.PrimePair P)


lemma eq_X_pow_iff_natTrailingDegree_eq_natDegree (h₁ : p.Monic) :
    p = X ^ p.natDegree ↔ p.natTrailingDegree = p.natDegree

{R : Type u}
[Semiring R]
{p : R[X]}
(h₁ : p.Monic)

p = Polynomial.X ^ p.natDegree ↔ p.natTrailingDegree = p.natDegree


/-- Auxiliary definition for `HomologicalComplex₂.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex₂ C c₁ c₂) ≅ flipFunctor C c₁ c₂ ⋙ flipFunctor C c₂ c₁

∀ (i_1 : I₂), (((HomologicalComplex₂.flipEquivalenceUnitIso C c₁ c₂).hom.app X).f i).f i_1 = 𝟙 ((X.X i).X i_1)


{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
(D : Derivation R A M)
(a : A)


/-- As a function from a relation to a predicate, `chain` is monotonic. -/
theorem chain_mono : Monotone (Chain : (α → α → Prop) → Cycle α → Prop)


/--
Cost structure given by a function.
Delete and insert cost the same, and substitution costs the greater value.
-/
@[simps]
def weightCost (f : α → ℕ) : Cost α α ℕ

(Levenshtein.weightCost f).substitute a b = max (f a) (f b)


@[simp]
theorem rightHom_comp_map : rightHom.comp (map f₁ f₂ h) = f₂.comp rightHom

(h : ∀ (g : G), f₁.comp (MulEquiv.toMonoidHom (φ g)) = (MulEquiv.toMonoidHom (φ₁ (f₂ g))).comp f₁)

SemidirectProduct.rightHom.comp (SemidirectProduct.map f₁ f₂ h) = f₂.comp SemidirectProduct.rightHom


@[to_additive (attr := simp, norm_cast)]
theorem toSubgroup_sup (U V : OpenSubgroup G) : (↑(U ⊔ V) : Subgroup G) = ↑U ⊔ ↑V

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[ContinuousMul G]
(U V : OpenSubgroup G)


@[to_additive existing (attr := simp)]
lemma mulRight_one : Equiv.mulRight (1 : α) = 1


@[simp]
theorem AddMonoid.End.smul_def [AddMonoid α] (f : AddMonoid.End α) (a : α) : f • a = f a

{α : Type u_6}
[AddMonoid α]
(f : AddMonoid.End α)
(a : α)


/-- The unbundled orthogonal projection is the unique point in `K`
with the orthogonality property.  This lemma is only intended for use
in setting up the bundled version and should not be used once that is
defined. -/
theorem eq_orthogonalProjectionFn_of_mem_of_inner_eq_zero {u v : E} (hvm : v ∈ K)
    (hvo : ∀ w ∈ K, ⟪u - v, w⟫ = 0) : orthogonalProjectionFn K u = v

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
{u v : E}
(hvm : v ∈ K)
(hvo : ∀ w ∈ K, ⟪u - v, w⟫_𝕜 = 0)


@[simp]
theorem toSheafedSpaceHom_base : (toSheafedSpaceHom Y f).base = f.base

{X : AlgebraicGeometry.PresheafedSpace C}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSheafedSpaceHom Y f).base = f.base


@[to_additive (attr := simp)]
theorem mem_stabilizer_iff {a : α} {g : G} : g ∈ stabilizer G a ↔ g • a = a

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{a : α}
{g : G}

g ∈ AddAction.stabilizer G a ↔ g +ᵥ a = a


theorem gcd_ne_zero_of_left (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0

{R : Type u_1}
[EuclideanDomain R]
[GCDMonoid R]
{p q : R}
(hp : p ≠ 0)


@[continuity, fun_prop]
theorem continuous_isRight : Continuous (isRight : X ⊕ Y → Bool)

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


protected theorem congr_fun (h : e = e') (x : M) : e x = e' x

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
{e e' : M ≃ₛₗ[σ] M₂}
(h : e = e')
(x : M)


private theorem exists_term_realize_eq_freeCommRing (p : FreeCommRing α) :
    ∃ t : Language.ring.Term α,
      (t.realize FreeCommRing.of : FreeCommRing α) = p

∃ t, FirstOrder.Language.Term.realize FreeCommRing.of t = p


theorem normal_exists_closure_subset [NormalSpace X] {s t : Set X} (hs : IsClosed s) (ht : IsOpen t)
    (hst : s ⊆ t) : ∃ u, IsOpen u ∧ s ⊆ u ∧ closure u ⊆ t

{X : Type u_1}
[TopologicalSpace X]
[NormalSpace X]
{s t : Set X}
(hs : IsClosed s)
(ht : IsOpen t)
(hst : s ⊆ t)


@[simp]
theorem mk_cancel (s : S) (m : M) : mk (s • m) s = mk m 1

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(s : ↥S)
(m : M)

LocalizedModule.mk (s • m) s = LocalizedModule.mk m 1


theorem fuzzy_congr {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ ‖ y₁ ↔ x₂ ‖ y₂

{x₁ y₁ x₂ y₂ : SetTheory.PGame}
(hx : x₁ ≈ x₂)
(hy : y₁ ≈ y₂)


@[norm_cast]
theorem coe_projIic (b x : α) : (projIic b x : α) = min b x

{α : Type u_1}
[LinearOrder α]
(b x : α)


theorem le_multiplicity_map {F : Type*} [FunLike F α β] [MonoidHomClass F α β]
    (f : F) {a b : α} : multiplicity a b ≤ multiplicity (f a) (f b)

{α : Type u_1}
{β : Type u_2}
[Monoid α]
[Monoid β]
[DecidableRel fun x x_1 => x ∣ x_1]
[DecidableRel fun x x_1 => x ∣ x_1]
{F : Type u_3}
[FunLike F α β]
[MonoidHomClass F α β]
(f : F)
{a b : α}


theorem slash_def (A : GL(2, ℝ)⁺) : f ∣[k] A = slash k A f


theorem pellZd_succ_succ (n) :
    pellZd a1 (n + 2) + pellZd a1 n = (2 * a : ℕ) * pellZd a1 (n + 1)

Pell.pellZd a1 (n + 2) + Pell.pellZd a1 n = ↑(2 * a) * Pell.pellZd a1 (n + 1)


theorem not_summable_of_ratio_norm_eventually_ge {α : Type*} [SeminormedAddCommGroup α] {f : ℕ → α}
    {r : ℝ} (hr : 1 < r) (hf : ∃ᶠ n in atTop, ‖f n‖ ≠ 0)
    (h : ∀ᶠ n in atTop, r * ‖f n‖ ≤ ‖f (n + 1)‖) : ¬Summable f

(hf : ∃ᶠ (n : ℕ) in Filter.atTop, ‖f n‖ ≠ 0)

(h : ∀ᶠ (n : ℕ) in Filter.atTop, r * ‖f n‖ ≤ ‖f (n + 1)‖)


@[simp]
theorem spanSingleton_mul_spanSingleton (x y : P) :
    spanSingleton S x * spanSingleton S y = spanSingleton S (x * y)

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

FractionalIdeal.spanSingleton S x * FractionalIdeal.spanSingleton S y = FractionalIdeal.spanSingleton S (x * y)


@[simp]
lemma normEDS_ofNat (n : ℕ) :
    normEDS b c d n = preNormEDS' (b ^ 4) c d n * if Even n then b else 1

{R : Type u}
[CommRing R]
(b c d : R)
(n : ℕ)

normEDS b c d ↑n = preNormEDS' (b ^ 4) c d n * if Even n then b else 1


theorem span_singleton_mul_right_inj [IsDomain R] {x : R} (hx : x ≠ 0) :
    span {x} * I = span {x} * J ↔ I = J

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
[IsDomain R]
{x : R}
(hx : x ≠ 0)

Ideal.span {x} * I = Ideal.span {x} * J ↔ I = J


/-- A small family of pre-games is bounded above. -/
lemma bddAbove_range_of_small {ι : Type*} [Small.{u} ι] (f : ι → PGame.{u}) :
    BddAbove (Set.range f)

{ι : Type u_1}
[Small.{u, u_1} ι]
(f : ι → SetTheory.PGame)


theorem BijOn.inter_mapsTo (h₁ : BijOn f s₁ t₁) (h₂ : MapsTo f s₂ t₂) (h₃ : s₁ ∩ f ⁻¹' t₂ ⊆ s₂) :
    BijOn f (s₁ ∩ s₂) (t₁ ∩ t₂)

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{t₁ t₂ : Set β}
{f : α → β}
(h₁ : Set.BijOn f s₁ t₁)
(h₂ : Set.MapsTo f s₂ t₂)
(h₃ : s₁ ∩ f ⁻¹' t₂ ⊆ s₂)


theorem isLittleO_const_mul_left_iff {f : α → 𝕜} {c : 𝕜} (hc : c ≠ 0) :
    (fun x => c * f x) =o[l] g ↔ f =o[l] g

{α : Type u_1}
{F : Type u_4}
{𝕜 : Type u_15}
[Norm F]
[NormedDivisionRing 𝕜]
{g : α → F}
{l : Filter α}
{f : α → 𝕜}
{c : 𝕜}
(hc : c ≠ 0)


theorem IsClosed.nhdsSet_le_sup' (h : IsClosed t) :
    𝓝ˢ s ≤ 𝓝ˢ (t ∩ s) ⊔ 𝓟 (tᶜ)

{X : Type u_1}
[TopologicalSpace X]
(s : Set X)
{t : Set X}
(h : IsClosed t)

𝓝ˢ s ≤ 𝓝ˢ (t ∩ s) ⊔ 𝓟 tᶜ


@[simp] theorem compl_ne_self [Nontrivial α] : aᶜ ≠ a

{α : Type u_2}
[HeytingAlgebra α]
{a : α}
[Nontrivial α]


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

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

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


theorem Filter.HasBasis.prod_nhds' {ιX ιY : Type*} {pX : ιX → Prop} {pY : ιY → Prop}
    {sx : ιX → Set X} {sy : ιY → Set Y} {p : X × Y} (hx : (𝓝 p.1).HasBasis pX sx)
    (hy : (𝓝 p.2).HasBasis pY sy) :
    (𝓝 p).HasBasis (fun i : ιX × ιY => pX i.1 ∧ pY i.2) fun i => sx i.1 ×ˢ sy i.2

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{ιX : Type u_5}
{ιY : Type u_6}
{pX : ιX → Prop}
{pY : ιY → Prop}
{sx : ιX → Set X}
{sy : ιY → Set Y}
{p : X × Y}
(hx : (𝓝 p.1).HasBasis pX sx)
(hy : (𝓝 p.2).HasBasis pY sy)

(𝓝 p).HasBasis (fun i => pX i.1 ∧ pY i.2) fun i => sx i.1 ×ˢ sy i.2


theorem eq_bot_of_rank_eq_zero [NoZeroDivisors R] (b : Basis ι R M) (N : Submodule R M)
    (rank_eq : ∀ {m : ℕ} (v : Fin m → N), LinearIndependent R ((↑) ∘ v : Fin m → M) → m = 0) :
    N = ⊥

(rank_eq : ∀ {m : ℕ} (v : Fin m → ↥N), LinearIndependent R (Subtype.val ∘ v) → m = 0)


theorem Lex.mono {r₁ r₂ : ι → ι → Prop} {s₁ s₂ : ∀ i, α i → α i → Prop}
    (hr : ∀ a b, r₁ a b → r₂ a b) (hs : ∀ i a b, s₁ i a b → s₂ i a b) {a b : Σ' i, α i}
    (h : Lex r₁ s₁ a b) : Lex r₂ s₂ a b

(hs : ∀ (i : ι) (a b : α i), s₁ i a b → s₂ i a b)


theorem IsOpen.openEmbedding_subtype_val {s : Set X} (hs : IsOpen s) :
    OpenEmbedding ((↑) : s → X)

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


/-- The injection into a pi group with the same values commutes. -/
@[to_additive "The injection into an additive pi group with the same values commutes."]
theorem Pi.mulSingle_apply_commute [∀ i, MulOneClass <| f i] (x : ∀ i, f i) (i j : I) :
    Commute (mulSingle i (x i)) (mulSingle j (x j))

{I : Type u}
{f : I → Type v}
[DecidableEq I]
[(i : I) → AddZeroClass (f i)]
(x : (i : I) → f i)
(i j : I)

AddCommute (Pi.single i (x i)) (Pi.single j (x j))


@[simp]
lemma opcyclesMap_id : opcyclesMap (𝟙 K) i = 𝟙 _

HomologicalComplex.opcyclesMap (𝟙 K) i = 𝟙 (K.opcycles i)


@[simp]
theorem nil_bagInter (l : List α) : [].bagInter l = []

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


@[simp]
theorem lift_comp_of' {N} [Monoid N] (f : CoprodI M →* N) :
    lift (fun i ↦ f.comp (of (i := i))) = f

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{N : Type u_4}
[Monoid N]
(f : Monoid.CoprodI M →* N)

(Monoid.CoprodI.lift fun i => f.comp Monoid.CoprodI.of) = f


@[to_additive (attr := simp)]
theorem noncommCoprod_unique (f : M × N →* P) :
    (f.comp (inl M N)).noncommCoprod (f.comp (inr M N)) (fun _ _ => (commute_inl_inr _ _).map f)
      = f

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass N]
[AddMonoid P]
(f : M × N →+ P)

(f.comp (AddMonoidHom.inl M N)).noncommCoprod (f.comp (AddMonoidHom.inr M N)) ⋯ = f


theorem rangeRestrict_surjective (f : R →ₙ+* S) : Function.Surjective f.rangeRestrict

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


/-- The L-series of a Dirichlet character mod `N > 0` does not converge absolutely at `s = 1`. -/
lemma not_LSeriesSummable_at_one {N : ℕ} (hN : N ≠ 0) (χ : DirichletCharacter ℂ N) :
    ¬ LSeriesSummable ↗χ 1


@[simp]
theorem coe_toNonneg {a : α} : (toNonneg a : α) = max a 0

{α : Type u_1}
[Zero α]
[LinearOrder α]
{a : α}


theorem set_finite (M : Matroid α) [M.Finite] (X : Set α) (hX : X ⊆ M.E := by aesop) : X.Finite

{α : Type u_1}
(M : Matroid α)
[M.Finite]
(X : Set α)
(hX : X ⊆ M.E := by aesop)


@[simp]
theorem piFinset_empty [Nonempty α] : piFinset (fun _ => ∅ : ∀ i, Finset (δ i)) = ∅

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{δ : α → Type u_3}
[Nonempty α]


@[simp]
theorem lift_lt_nat_iff {a : Cardinal.{u}} {n : ℕ} : lift.{v} a < n ↔ a < n


/-- If `f : R → ℝ` is a nonnegative multiplicatively bounded function and `x : R` is a unit with
  `f x ≠ 0`, then for every `n : ℕ`, we have `f (x ^ n) ≠ 0`. -/
theorem map_pow_ne_zero (f_nonneg : 0 ≤ f) {x : R} (hx : IsUnit x) (hfx : f x ≠ 0) (n : ℕ)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) : f (x ^ n) ≠ 0

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)


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

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


theorem Monotone.comp_antitone (hg : Monotone g) (hf : Antitone f) : Antitone (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
(hg : Monotone g)
(hf : Antitone f)


@[simp]
theorem sinh_neg : sinh (-x) = -sinh x


theorem localization_away_comap_range (S : Type v) [CommSemiring S] [Algebra R S] (r : R)
    [IsLocalization.Away r S] : Set.range (comap (algebraMap R S)) = basicOpen r

{R : Type u}
[CommSemiring R]
(S : Type v)
[CommSemiring S]
[Algebra R S]
(r : R)
[IsLocalization.Away r S]

Set.range ⇑(PrimeSpectrum.comap (algebraMap R S)) = ↑(PrimeSpectrum.basicOpen r)


@[simp]
theorem uniqueDiffOn_image (h : E ≃ₘ^n⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F) (hn : 1 ≤ n) {s : Set E} :
    UniqueDiffOn 𝕜 (h '' s) ↔ UniqueDiffOn 𝕜 s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(h : E ≃ₘ^n⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F)
(hn : 1 ≤ n)
{s : Set E}

UniqueDiffOn 𝕜 (⇑h '' s) ↔ UniqueDiffOn 𝕜 s


@[simp]
theorem coe_monoidWithZeroHom (f : α →*₀o β) : ⇑(f : α →*₀ β) = f

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


theorem ext_iff {f g : α →ᵈ β} : f = g ↔ ∀ x, f x = g x

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f g : α →ᵈ β}


theorem mem_invSubmonoid_iff_exists_mk' (x : S) :
    x ∈ invSubmonoid M S ↔ ∃ m : M, mk' S 1 m = x

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

x ∈ IsLocalization.invSubmonoid M S ↔ ∃ m, IsLocalization.mk' S 1 m = x


@[to_additive (attr := simp)]
theorem ofHom_apply {X Y : Type _} [CommGroup X] [CommGroup Y] (f : X →* Y) (x : X) :
    @DFunLike.coe (X →* Y) X (fun _ ↦ Y) _ (ofHom f) x = f x

{X Y : Type u_1}
[AddCommGroup X]
[AddCommGroup Y]
(f : X →+ Y)
(x : X)


@[simp]
theorem nodup_attach {l : List α} : Nodup (attach l) ↔ Nodup l


@[to_additive]
theorem pow_subset_pow (hst : s ⊆ t) : ∀ n : ℕ, s ^ n ⊆ t ^ n

{α : Type u_2}
[AddMonoid α]
{s t : Set α}
(hst : s ⊆ t)
(n : ℕ)


theorem isIntegral_iff {x : S} : IsIntegral K x ↔ IsIntegral K (x : L)

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{S : IntermediateField K L}
{x : ↥S}


@[simp]
theorem hom.congr_right {f g : Arrow T} {φ₁ φ₂ : f ⟶ g} (h : φ₁ = φ₂) : φ₁.right = φ₂.right

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
{φ₁ φ₂ : f ⟶ g}
(h : φ₁ = φ₂)


@[simp]
theorem coe_unitGroupMulEquiv_symm_apply (a : Aˣ) : ((A.unitGroupMulEquiv.symm a : Kˣ) : K) = a

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


@[to_additive]
lemma mulIndicator_biUnion (s : Finset ι) (t : ι → Set κ) {f : κ → β} :
    ((s : Set ι).PairwiseDisjoint t) →
      mulIndicator (⋃ i ∈ s, t i) f = fun a ↦ ∏ i ∈ s, mulIndicator (t i) f a

{ι : Type u_1}
{β : Type u_4}
[CommMonoid β]
{κ : Type u_7}
(s : Finset ι)
(t : ι → Set κ)
{f : κ → β}

(↑s).PairwiseDisjoint t → (⋃ i ∈ s, t i).mulIndicator f = fun a => ∏ i ∈ s, (t i).mulIndicator f a


@[reassoc (attr := simp)]
lemma π_homologyIsoSc'_hom :
    K.homologyπ j ≫ (K.homologyIsoSc' i j k hi hk).hom =
      (K.cyclesIsoSc' i j k hi hk).hom ≫ (K.sc' i j k).homologyπ


@[to_additive (attr := simp)]
theorem smul_filter_neBot_iff : (a • f).NeBot ↔ f.NeBot

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


theorem Nonempty.of_diff (h : (s \ t).Nonempty) : s.Nonempty

{α : Type u}
{s t : Set α}
(h : (s \ t).Nonempty)


theorem prod_span {ι : Type*} (s : Finset ι) (I : ι → Set R) :
    (∏ i ∈ s, Ideal.span (I i)) = Ideal.span (∏ i ∈ s, I i)

{R : Type u}
[CommSemiring R]
{ι : Type u_2}
(s : Finset ι)
(I : ι → Set R)

∏ i ∈ s, Ideal.span (I i) = Ideal.span (∏ i ∈ s, I i)


theorem stmts₁_supportsStmt_mono {S : Finset Λ} {q₁ q₂ : Stmt₂} (h : q₁ ∈ stmts₁ q₂)
    (hs : SupportsStmt S q₂) : SupportsStmt S q₁

{K : Type u_1}
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
{S : Finset Λ}
{q₁ q₂ : Turing.TM2.Stmt Γ Λ σ}
(h : q₁ ∈ Turing.TM2.stmts₁ q₂)
(hs : Turing.TM2.SupportsStmt S q₂)


protected theorem Nat.le_trans {n m k : Nat} : LE.le n m → LE.le m k → LE.le n k


/-- An orbit of a normal subgroup is a block -/
theorem orbit.isBlock_of_normal {N : Subgroup G} [N.Normal] (a : X) :
    IsBlock G (orbit N a)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{N : Subgroup G}
[N.Normal]
(a : X)

MulAction.IsBlock G (MulAction.orbit (↥N) a)


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

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

(CategoryTheory.Prod.fst C D).obj X = X.1


theorem LineDifferentiableAt.lineDifferentiableWithinAt (h : LineDifferentiableAt 𝕜 f x v) :
    LineDifferentiableWithinAt 𝕜 f s x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{s : Set E}
{x v : E}
(h : LineDifferentiableAt 𝕜 f x v)


theorem Filter.map_surjOn_Iic_iff_surjOn {s : Set α} {t : Set β} {m : α → β} :
    SurjOn (map m) (Iic <| 𝓟 s) (Iic <| 𝓟 t) ↔ SurjOn m s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{m : α → β}

Set.SurjOn (Filter.map m) (Set.Iic (𝓟 s)) (Set.Iic (𝓟 t)) ↔ Set.SurjOn m s t


/-- We can regard a complete lattice homomorphism as an order equivalence to its range. -/
@[simps! apply] noncomputable def toOrderIsoRangeOfInjective (hf : Injective f) : α ≃o f.range

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)
(hf : Function.Injective ⇑f)
(a : α)

(f.toOrderIsoRangeOfInjective hf) a = ⟨f a, ⋯⟩


theorem le_dualAnnihilator_iff_le_dualCoannihilator {U : Submodule R (Module.Dual R M)}
    {V : Submodule R M} : U ≤ V.dualAnnihilator ↔ V ≤ U.dualCoannihilator

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{U : Submodule R (Module.Dual R M)}
{V : Submodule R M}


theorem equitableOn_iff_le_le_add_one :
    EquitableOn (s : Set α) f ↔
      ∀ a ∈ s, (∑ i ∈ s, f i) / s.card ≤ f a ∧ f a ≤ (∑ i ∈ s, f i) / s.card + 1

{α : Type u_1}
{s : Finset α}
{f : α → ℕ}

(↑s).EquitableOn f ↔ ∀ a ∈ s, (∑ i ∈ s, f i) / s.card ≤ f a ∧ f a ≤ (∑ i ∈ s, f i) / s.card + 1


theorem eq_ofNat_of_zero_le {a : Int} (h : 0 ≤ a) : ∃ n : Nat, a = n


theorem preimage_inter (s t : Set β) : r.preimage (s ∩ t) ⊆ r.preimage s ∩ r.preimage t

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


theorem pairwise_filter (p : α → Prop) [DecidablePred p] {l : List α} :
    Pairwise R (filter p l) ↔ Pairwise (fun x y => p x → p y → R x y) l

{α : Type u_1}
{R : α → α → Prop}
(p : α → Prop)
[DecidablePred p]
{l : List α}

List.Pairwise R (List.filter (fun b => decide (p b)) l) ↔ List.Pairwise (fun x y => p x → p y → R x y) l


@[simp] lemma num_pos {a : ℚ} : 0 < a.num ↔ 0 < a


lemma isConjExponent_one_div (ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) :
    (1 / a).IsConjExponent (1 / b)


theorem isPartition_iff_iUnion_eq {π : Prepartition I} : π.IsPartition ↔ π.iUnion = I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π : BoxIntegral.Prepartition I}


theorem restrictScalars₁₂_injective : Function.Injective
    (LinearMap.restrictScalars₁₂ R' S' : (M →ₗ[R] N →ₗ[S] Pₗ) → (M →ₗ[R'] N →ₗ[S'] Pₗ))

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{M : Type u_5}
{N : Type u_6}
{Pₗ : Type u_12}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid Pₗ]
[Module R M]
[Module S N]
[Module R Pₗ]
[Module S Pₗ]
[SMulCommClass S R Pₗ]
(R' : Type u_16)
(S' : Type u_17)
[Semiring R']
[Semiring S']
[Module R' M]
[Module S' N]
[Module R' Pₗ]
[Module S' Pₗ]
[SMulCommClass S' R' Pₗ]
[SMul S' S]
[IsScalarTower S' S N]
[IsScalarTower S' S Pₗ]
[SMul R' R]
[IsScalarTower R' R M]
[IsScalarTower R' R Pₗ]

Function.Injective (LinearMap.restrictScalars₁₂ R' S')


/-- The functor `RightExtension L' F ⥤ RightExtension L F`
induced by a natural transformation `L ⋙ G ⟶ L'`. -/
@[simps!]
def RightExtension.postcomp₁ (f : L ⋙ G ⟶ L') (F : C ⥤ H) :
    RightExtension L' F ⥤ RightExtension L F

(X : CategoryTheory.Comma ((CategoryTheory.whiskeringLeft C D' H).obj L') (CategoryTheory.Functor.fromPUnit F))

∀ {X_1 Y : D} (f_1 : X_1 ⟶ Y),
  ((CategoryTheory.Functor.RightExtension.postcomp₁ G f F).obj X).left.map f_1 = X.left.map (G.map f_1)


private nonrec theorem mul_one (x : ⨁ i, A i) : x * 1 = x

{ι : Type u_1}
[DecidableEq ι]
(A : ι → Type u_2)
[(i : ι) → AddCommMonoid (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
(x : DirectSum ι fun i => A i)


theorem equiv_block_det (M : Matrix m m R) {p q : m → Prop} [DecidablePred p] [DecidablePred q]
    (e : ∀ x, q x ↔ p x) : (toSquareBlockProp M p).det = (toSquareBlockProp M q).det

{m : Type u_3}
{R : Type v}
[CommRing R]
[DecidableEq m]
[Fintype m]
(M : Matrix m m R)
{p q : m → Prop}
[DecidablePred p]
[DecidablePred q]
(e : ∀ (x : m), q x ↔ p x)

(M.toSquareBlockProp p).det = (M.toSquareBlockProp q).det


theorem comp {f : X → Y} {g : Y → Z} (hf : Conformal f) (hg : Conformal g) : Conformal (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[NormedAddCommGroup X]
[NormedAddCommGroup Y]
[NormedAddCommGroup Z]
[NormedSpace ℝ X]
[NormedSpace ℝ Y]
[NormedSpace ℝ Z]
{f : X → Y}
{g : Y → Z}
(hf : Conformal f)
(hg : Conformal g)


theorem perm_cons_erase [DecidableEq α] {a : α} {l : List α} (h : a ∈ l) : l ~ a :: l.erase a

{α : Type u_1}
[DecidableEq α]
{a : α}
{l : List α}
(h : a ∈ l)


theorem Prime.primeFactorsList_pow {p : ℕ} (hp : p.Prime) (n : ℕ) :
    (p ^ n).primeFactorsList = List.replicate n p


theorem derivFamily_lt_ord_lift {ι} {f : ι → Ordinal → Ordinal} {c} (hc : IsRegular c)
    (hι : Cardinal.lift.{v, u} #ι < c) (hc' : c ≠ ℵ₀)
    (hf : ∀ (i), ∀ b < c.ord, f i b < c.ord) {a} :
    a < c.ord → derivFamily.{u, v} f a < c.ord

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

(hf : ∀ (i : ι), ∀ b < c.ord, f i b < c.ord)

a < c.ord → Ordinal.derivFamily f a < c.ord


@[to_additive (attr := ext)]
lemma ext {X Y : CommMonCat} {f g : X ⟶ Y} (w : ∀ x : X, f x = g x) : f = g

{X Y : AddCommMonCat}
{f g : X ⟶ Y}
(w : ∀ (x : ↑X), f x = g x)


theorem isRelPrime_zero_left : IsRelPrime 0 x ↔ IsUnit x

{α : Type u_1}
[CommMonoidWithZero α]
{x : α}


theorem jacobiSymNat.even_odd₇ (a b c : ℕ) (r : ℤ) (ha : a % 2 = 0) (hb : b % 8 = 7)
    (hc : a / 2 = c) (hr : jacobiSymNat c b = r) : jacobiSymNat a b = r

(hr : Mathlib.Meta.NormNum.jacobiSymNat c b = r)

Mathlib.Meta.NormNum.jacobiSymNat a b = r


@[simp]
theorem dist_partial_sum (u : ℕ → α) (n : ℕ) :
    dist (∑ k ∈ range (n + 1), u k) (∑ k ∈ range n, u k) = ‖u n‖

{α : Type u_1}
[SeminormedAddCommGroup α]
(u : ℕ → α)
(n : ℕ)

dist (∑ k ∈ Finset.range (n + 1), u k) (∑ k ∈ Finset.range n, u k) = ‖u n‖


theorem mapIdxMAuxSpec_cons {β} (f : ℕ → α → m β) (start : ℕ) (a : α) (as : List α) :
    mapIdxMAuxSpec f start (a :: as) = cons <$> f start a <*> mapIdxMAuxSpec f (start + 1) as

{α : Type u}
{m : Type u → Type v}
[Monad m]
{β : Type u}
(f : ℕ → α → m β)
(start : ℕ)
(a : α)
(as : List α)

List.mapIdxMAuxSpec f start (a :: as) = Seq.seq (List.cons <$> f start a) fun x => List.mapIdxMAuxSpec f (start + 1) as


@[to_additive]
theorem Integrable.comp_mul_right {f : G → F} [IsMulRightInvariant μ] (hf : Integrable f μ)
    (g : G) : Integrable (fun t => f (t * g)) μ

{G : Type u_4}
{F : Type u_6}
[MeasurableSpace G]
[NormedAddCommGroup F]
{μ : MeasureTheory.Measure G}
[Group G]
[MeasurableMul G]
{f : G → F}
[μ.IsMulRightInvariant]
(hf : MeasureTheory.Integrable f μ)
(g : G)

MeasureTheory.Integrable (fun t => f (t * g)) μ


theorem le_add_iff_sub_le (a b c : Int) : a ≤ b + c ↔ a - c ≤ b


/-- A function `f : 𝕜 → 𝕜` is convex iff for any three points `x < y < z` the slope of the secant
line of `f` on `[x, y]` is less than the slope of the secant line of `f` on `[y, z]`. -/
theorem convexOn_iff_slope_mono_adjacent :
    ConvexOn 𝕜 s f ↔
      Convex 𝕜 s ∧ ∀ ⦃x y z : 𝕜⦄,
          x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{s : Set 𝕜}
{f : 𝕜 → 𝕜}


@[simp]
theorem adjugate_fin_three_of (a b c d e f g h i : α) :
    adjugate !![a, b, c; d, e, f; g, h, i] =
      !![  e * i  - f * h, -(b * i) + c * h,   b * f  - c * e;
         -(d * i) + f * g,   a * i  - c * g, -(a * f) + c * d;
           d * h  - e * g, -(a * h) + b * g,   a * e  - b * d]

{α : Type w}
[CommRing α]
(a b c d e f g h i : α)


theorem span_iUnion {ι} (s : ι → Set L) : lieSpan R L (⋃ i, s i) = ⨆ i, lieSpan R L (s i)

(R : Type u)
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{ι : Sort u_1}
(s : ι → Set L)

LieSubalgebra.lieSpan R L (⋃ i, s i) = ⨆ i, LieSubalgebra.lieSpan R L (s i)


theorem iInf_apply {ι : Sort*} [CompleteLattice β] (f : ι → α →o β) (x : α) :
    (⨅ i, f i) x = ⨅ i, f i x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
{ι : Sort u_3}
[CompleteLattice β]
(f : ι → α →o β)
(x : α)


theorem continuousAt_equivIoc : ContinuousAt (equivIoc p a) x

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
(p : 𝕜)
[hp : Fact (0 < p)]
(a : 𝕜)
[Archimedean 𝕜]
{x : AddCircle p}
(hx : x ≠ ↑a)

ContinuousAt (⇑(AddCircle.equivIoc p a)) x


lemma zero_lt_pairing_iff : 0 < P.pairing i j ↔ 0 < P.pairing j i

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[LinearOrderedCommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
{P : RootPairing ι R M N}
(B : M →ₗ[R] M →ₗ[R] R)
[P.IsRootPositive B]
(i j : ι)


theorem sign_ne_zero : sign a ≠ 0 ↔ a ≠ 0

{α : Type u_1}
[Zero α]
[LinearOrder α]
{a : α}


@[simp]
theorem coe_compl (s : UpperSet α) : (s.compl : Set α) = (↑s)ᶜ


/-- An element of `ℤ√d` has norm equal to `1` if and only if it is contained in the submonoid
of unitary elements. -/
theorem norm_eq_one_iff_mem_unitary {d : ℤ} {a : ℤ√d} : a.norm = 1 ↔ a ∈ unitary (ℤ√d)


@[deprecated get_insertNth_add_succ (since := "2023-01-05")]
theorem nthLe_insertNth_add_succ : ∀ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      rwa [length_insertNth _ _ (by omega), Nat.succ_lt_succ_iff])),
    (insertNth n x l).nthLe (n + k + 1) hk = nthLe l (n + k) hk'

(hk : n + k + 1 < (List.insertNth n x l).length := ⋯)

(List.insertNth n x l).nthLe (n + k + 1) hk = l.nthLe (n + k) hk'


@[simp]
theorem sepDegree_top : sepDegree F (⊤ : IntermediateField E K) = sepDegree F K

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

Field.sepDegree F ↥⊤ = Field.sepDegree F K


lemma Filter.tendsto_div_const_iff {G : Type*}
    [CommGroupWithZero G] [TopologicalSpace G] [ContinuousDiv G]
    {b : G} (hb : b ≠ 0) {c : G} {f : α → G} {l : Filter α} :
    Tendsto (f · / b) l (𝓝 (c / b)) ↔ Tendsto f l (𝓝 c)

{α : Type u}
{G : Type u_1}
[CommGroupWithZero G]
[TopologicalSpace G]
[ContinuousDiv G]
{b : G}
(hb : b ≠ 0)
{c : G}
{f : α → G}
{l : Filter α}

Filter.Tendsto (fun x => f x / b) l (𝓝 (c / b)) ↔ Filter.Tendsto f l (𝓝 c)


theorem _root_.AffineMap.isOpenMap {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
    [CompleteSpace F] {P Q : Type*} [MetricSpace P] [NormedAddTorsor E P] [MetricSpace Q]
    [NormedAddTorsor F Q] (f : P →ᵃ[𝕜] Q) (hf : Continuous f) (surj : Surjective f) :
    IsOpenMap f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_5}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{P : Type u_6}
{Q : Type u_7}
[MetricSpace P]
[NormedAddTorsor E P]
[MetricSpace Q]
[NormedAddTorsor F Q]
(f : P →ᵃ[𝕜] Q)
(hf : Continuous ⇑f)
(surj : Function.Surjective ⇑f)


@[simp] theorem get_swap_left (a : Array α) {i j : Fin a.size} : (a.swap i j)[i.val] = a[j]

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


/-- There is a natural equivalence when swapping the coefficients of a quaternion algebra. -/
@[simps]
def swapEquiv : ℍ[R,c₁,c₂] ≃ₐ[R] ℍ[R, c₂, c₁]

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

((QuaternionAlgebra.swapEquiv c₁ c₂).symm t).imI = t.imJ


/-- Continuous functions on products are continuous in their first argument -/
theorem Continuous.curry_left {f : X × Y → Z} (hf : Continuous f) {y : Y} :
    Continuous fun x ↦ f (x, y)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X × Y → Z}
(hf : Continuous f)
{y : Y}


@[to_additive (attr := simp)]
protected theorem SemiconjBy.map [MulHomClass F M N] (h : SemiconjBy a x y) (f : F) :
    SemiconjBy (f a) (f x) (f y)

{F : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Add M]
[Add N]
{a x y : M}
[FunLike F M N]
[AddHomClass F M N]
(h : AddSemiconjBy a x y)
(f : F)


theorem UniformSpace.has_seq_basis [IsCountablyGenerated <| 𝓤 α] :
    ∃ V : ℕ → Set (α × α), HasAntitoneBasis (𝓤 α) V ∧ ∀ n, SymmetricRel (V n)

(α : Type ua)
[UniformSpace α]
[(𝓤 α).IsCountablyGenerated]

∃ V, (𝓤 α).HasAntitoneBasis V ∧ ∀ (n : ℕ), SymmetricRel (V n)


@[simp]
theorem dualProdDualEquivDual_apply (φ : Module.Dual R M) (ψ : Module.Dual R M') :
    dualProdDualEquivDual R M M' (φ, ψ) = φ.coprod ψ

(R : Type uR)
(M : Type uM)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(M' : Type uM')
[AddCommMonoid M']
[Module R M']
(φ : Module.Dual R M)
(ψ : Module.Dual R M')

(Module.dualProdDualEquivDual R M M') (φ, ψ) = LinearMap.coprod φ ψ


theorem y_pos_of_mem_ball {D : ℝ} {x : E} (Dpos : 0 < D) (D_lt_one : D < 1)
    (hx : x ∈ ball (0 : E) (1 + D)) : 0 < y D x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{D : ℝ}
{x : E}
(Dpos : 0 < D)
(D_lt_one : D < 1)
(hx : x ∈ Metric.ball 0 (1 + D))


theorem ContMDiffOn.of_succ {n : ℕ} (h : ContMDiffOn I I' n.succ f s) : ContMDiffOn I I' n f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
{n : ℕ}
(h : ContMDiffOn I I' (↑n.succ) f s)


@[simp]
theorem Quiver.Hom.unop_op {X Y : C} (f : X ⟶ Y) : f.op.unop = f

{C : Type u₁}
[Quiver C]
{X Y : C}
(f : X ⟶ Y)


theorem subset_smul_finset_iff₀ (ha : a ≠ 0) : s ⊆ a • t ↔ a⁻¹ • s ⊆ t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[GroupWithZero α]
[MulAction α β]
{s t : Finset β}
{a : α}
(ha : a ≠ 0)

s ⊆ a • t ↔ a⁻¹ • s ⊆ t


/-- If `X` is a real random variable with Gaussian law with mean `μ` and variance `v`, then `X + y`
has Gaussian law with mean `μ + y` and variance `v`. -/
lemma gaussianReal_add_const {X : Ω → ℝ} (hX : Measure.map X ℙ = gaussianReal μ v) (y : ℝ) :
    Measure.map (fun ω ↦ X ω + y) ℙ = gaussianReal (μ + y) v

(hX : MeasureTheory.Measure.map X MeasureTheory.volume = ProbabilityTheory.gaussianReal μ v)

MeasureTheory.Measure.map (fun ω => X ω + y) MeasureTheory.volume = ProbabilityTheory.gaussianReal (μ + y) v


/-- Any endomorphism power can be computed as the sum of endomorphism powers less than the
dimension of the module. -/
theorem pow_eq_aeval_mod_charpoly (k : ℕ) : f ^ k = aeval f (X ^ k %ₘ f.charpoly)

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
(f : M →ₗ[R] M)
(k : ℕ)

f ^ k = (Polynomial.aeval f) (Polynomial.X ^ k %ₘ f.charpoly)


theorem pow_sub_dvd_iterate_derivative_pow (p : R[X]) (n m : ℕ) :
    p ^ (n - m) ∣ derivative^[m] (p ^ n)

{R : Type u}
[CommSemiring R]
(p : R[X])
(n m : ℕ)

p ^ (n - m) ∣ (⇑Polynomial.derivative)^[m] (p ^ n)


@[simp]
theorem coe_zsmulRec : ∀ z, ⇑(zsmulRec (· • ·) z f) = z • ⇑f

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)
(z : ℤ)

⇑(zsmulRec (fun x x_1 => x • x_1) z f) = z • ⇑f


theorem surjective_id : Surjective (@id α)


@[simp]
theorem center_toSubsemiring : (center R).toSubsemiring = Subsemiring.center R

(Subring.center R).toSubsemiring = Subsemiring.center R


theorem inl_injective : Function.Injective (inl : N → N ⋊[φ] G)

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}


@[norm_cast, simp]
theorem Int.dist_cast_rat (x y : ℤ) : dist (x : ℚ) y = dist x y


theorem core_inter (s t : Set β) : f.core (s ∩ t) = f.core s ∩ f.core t

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


@[to_additive] lemma mabs_choice (x : α) : |x|ₘ = x ∨ |x|ₘ = x⁻¹

{α : Type u_1}
[AddGroup α]
[LinearOrder α]
(x : α)


@[to_additive sum_pos_iff_of_nonneg]
lemma one_lt_prod_iff_of_one_le (hf : 1 ≤ f) : 1 < ∏ i, f i ↔ 1 < f

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCancelAddCommMonoid M]
{f : ι → M}
(hf : 0 ≤ f)


lemma adjoinRootXPowSubCEquiv_symm_eq_root :
    (adjoinRootXPowSubCEquiv hζ H hα).symm α = root _

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

[Polynomial.IsSplittingField K L (Polynomial.X ^ n - Polynomial.C a)]

(adjoinRootXPowSubCEquiv hζ H hα).symm α = AdjoinRoot.root (Polynomial.X ^ n - Polynomial.C a)


theorem ContinuousWithinAt.tendsto_nhdsWithin {f : α → β} {x : α} {s : Set α} {t : Set β}
    (h : ContinuousWithinAt f s x) (ht : MapsTo f s t) : Tendsto f (𝓝[s] x) (𝓝[t] f x)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{x : α}
{s : Set α}
{t : Set β}
(h : ContinuousWithinAt f s x)
(ht : Set.MapsTo f s t)


@[simp]
lemma leftHomologyMap_neg : leftHomologyMap (-φ) = -leftHomologyMap φ

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

CategoryTheory.ShortComplex.leftHomologyMap (-φ) = -CategoryTheory.ShortComplex.leftHomologyMap φ


theorem fuzzy_congr_left {x₁ x₂ y : PGame} (hx : x₁ ≈ x₂) : x₁ ‖ y ↔ x₂ ‖ y

{x₁ x₂ y : SetTheory.PGame}
(hx : x₁ ≈ x₂)


lemma coxeterWeight_swap : coxeterWeight P i j = coxeterWeight P j i

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i j : ι)

P.coxeterWeight i j = P.coxeterWeight j i


lemma pos_of_mem_primeFactors (hp : p ∈ n.primeFactors) : 0 < p


@[reassoc (attr := simp)]
lemma mapZ_p :
    data.mapZ φ ≫ (data.factorizationData g).p = (data.factorizationData f).p ≫ φ.right

{W₁ W₂ : CategoryTheory.MorphismProperty C}

(data : W₁.FunctorialFactorizationData W₂)

(φ : CategoryTheory.Arrow.mk f ⟶ CategoryTheory.Arrow.mk g)

CategoryTheory.CategoryStruct.comp (data.mapZ φ) (data.factorizationData g).p =
  CategoryTheory.CategoryStruct.comp (data.factorizationData f).p φ.right


@[simp]
theorem lt_le_top (f : r ≺i s) (g : s ≼i t) : (f.ltLe g).top = g f.top

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
(f : r ≺i s)
(g : s ≼i t)


theorem noetherianSpace_iff_of_homeomorph (f : α ≃ₜ β) : NoetherianSpace α ↔ NoetherianSpace β

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : α ≃ₜ β)

TopologicalSpace.NoetherianSpace α ↔ TopologicalSpace.NoetherianSpace β


@[to_additive (attr := simp)]
theorem mk'_self (x) (H : x ∈ S) : f.mk' x ⟨x, H⟩ = 1

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(x : M)
(H : x ∈ S)


lemma AEval'.X_smul_of (m : M) : (X : R[X]) • AEval'.of φ m = AEval'.of φ (φ m)

{R : Type u_2}
{M : Type u_1}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(φ : M →ₗ[R] M)
(m : M)

Polynomial.X • (Module.AEval'.of φ) m = (Module.AEval'.of φ) (φ m)


/-- Formula for the Fréchet derivative of `EuclideanGeometry.inversion c R`. -/
theorem hasFDerivAt_inversion (hx : x ≠ c) :
    HasFDerivAt (inversion c R)
      ((R / dist x c) ^ 2 • (reflection (ℝ ∙ (x - c))ᗮ : F →L[ℝ] F)) x

{F : Type u_2}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{c x : F}
{R : ℝ}
(hx : x ≠ c)

HasFDerivAt (EuclideanGeometry.inversion c R)
  ((R / dist x c) ^ 2 •
    ↑{ toLinearEquiv := (reflection (Submodule.span ℝ {x - c})ᗮ).toLinearEquiv, continuous_toFun := ⋯,
        continuous_invFun := ⋯ })
  x


@[simp]
theorem mem_dedup {a : α} {l : List α} : a ∈ dedup l ↔ a ∈ l

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


@[simp]
theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j)

QuaternionGroup.xa i * QuaternionGroup.a j = QuaternionGroup.xa (i + j)


/-- An order is dense if there is an element between any pair of distinct comparable elements. -/
class DenselyOrdered (α : Type*) [LT α] : Prop where
  /-- An order is dense if there is an element between any pair of distinct elements. -/
  dense : ∀ a₁ a₂ : α, a₁ < a₂ → ∃ a, a₁ < a ∧ a < a₂

{α : Type u_5}
[LT α]
[self : DenselyOrdered α]
(a₁ a₂ : α)


theorem StrictConvex.is_linear_preimage {s : Set F} (hs : StrictConvex 𝕜 s) {f : E → F}
    (h : IsLinearMap 𝕜 f) (hf : Continuous f) (hfinj : Injective f) :
    StrictConvex 𝕜 (s.preimage f)

{𝕜 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[TopologicalSpace F]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{s : Set F}
(hs : StrictConvex 𝕜 s)
{f : E → F}
(h : IsLinearMap 𝕜 f)
(hf : Continuous f)
(hfinj : Function.Injective f)