/-- If the maps in the directed system are injective, then the canonical maps
from the components to the direct limits are injective. -/
theorem of_injective [IsDirected ι (· ≤ ·)] [DirectedSystem G fun i j h => f' i j h]
    (hf : ∀ i j hij, Function.Injective (f' i j hij)) (i) :
    Function.Injective (of G (fun i j h => f' i j h) i)

[DirectedSystem G fun i j h => ⇑(f' i j h)]

(hf : ∀ (i j : ι) (hij : i ≤ j), Function.Injective ⇑(f' i j hij))

Function.Injective ⇑(Ring.DirectLimit.of G (fun i j h => ⇑(f' i j h)) i)


/-- Given sieve `S` and presheaf `P : Cᵒᵖ ⥤ A`, their natural associated cone admits at most one
    morphism from every cone in the same category (i.e. over the same diagram),
    iff `Hom (E, P -)`is separated for the sieve `S` and all `E : A`. -/
theorem subsingleton_iff_isSeparatedFor :
    (∀ c, Subsingleton (c ⟶ P.mapCone S.arrows.cocone.op)) ↔
      ∀ E : Aᵒᵖ, IsSeparatedFor (P ⋙ coyoneda.obj E) S.arrows

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A : Type u₂}
[CategoryTheory.Category.{v₂, u₂} A]
(P : CategoryTheory.Functor Cᵒᵖ A)
{X : C}
(S : CategoryTheory.Sieve X)

(∀ (c : CategoryTheory.Limits.Cone (S.arrows.diagram.op.comp P)), Subsingleton (c ⟶ P.mapCone S.arrows.cocone.op)) ↔
  ∀ (E : Aᵒᵖ), CategoryTheory.Presieve.IsSeparatedFor (P.comp (CategoryTheory.coyoneda.obj E)) S.arrows


@[to_additive (attr := simp)]
theorem quotient_liftOn_mk {β} (f : α → β) (h) (x : α) : Quotient.liftOn' (x : α ⧸ s) f h = f x

(h : ∀ (a b : α), Setoid.r a b → f a = f b)


theorem Disjoint.disjoint_support (h : Disjoint f g) : _root_.Disjoint f.support g.support

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


/-- The `vectorSpan` is the span of the pairwise subtractions with a given point on the left,
excluding the subtraction of that point from itself. -/
theorem vectorSpan_eq_span_vsub_set_left_ne {s : Set P} {p : P} (hp : p ∈ s) :
    vectorSpan k s = Submodule.span k ((p -ᵥ ·) '' (s \ {p}))

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
{p : P}
(hp : p ∈ s)

vectorSpan k s = Submodule.span k ((fun x => p -ᵥ x) '' (s \ {p}))


@[simp]
theorem comp_assoc {Q D : Type*} [Monoid Q] [AddMonoid D] [DistribMulAction Q D]
    {η : P →* Q} {θ : M →* Q} {ζ : N →* Q}
    (h : C →ₑ+[η] D) (g : B →ₑ+[ψ] C) (f : A →ₑ+[φ] B)
    [MonoidHom.CompTriple φ ψ χ] [MonoidHom.CompTriple χ η θ]
    [MonoidHom.CompTriple ψ η ζ] [MonoidHom.CompTriple φ ζ θ] :
    h.comp (g.comp f) = (h.comp g).comp f

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{P : Type u_3}
[Monoid P]
{φ : M →* N}
{ψ : N →* P}
{χ : M →* P}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
{C : Type u_7}
[AddMonoid C]
[DistribMulAction P C]
{Q : Type u_11}
{D : Type u_12}
[Monoid Q]
[AddMonoid D]
[DistribMulAction Q D]
{η : P →* Q}
{θ : M →* Q}
{ζ : N →* Q}
(h : C →ₑ+[η] D)
(g : B →ₑ+[ψ] C)
(f : A →ₑ+[φ] B)
[φ.CompTriple ψ χ]
[χ.CompTriple η θ]
[ψ.CompTriple η ζ]
[φ.CompTriple ζ θ]


lemma arg_exp_mul_I (θ : ℝ) :
    arg (exp (θ * I)) = toIocMod (mul_pos two_pos Real.pi_pos) (-π) θ

(Complex.exp (↑θ * Complex.I)).arg = toIocMod ⋯ (-π) θ


@[simp] theorem unzip_nil : ([] : List (α × β)).unzip = ([], [])

List.nil.unzip = { fst := List.nil, snd := List.nil }


{R : Type u_1}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]


@[to_additive (attr := simp)]
theorem mul_inv_cancel_right (a b : G) : a * b * b⁻¹ = a


/--
The `Fin.castSucc_zero` in `Lean` only applies in `Fin (n+1)`.
This one instead uses a `NeZero n` typeclass hypothesis.
-/
@[simp]
theorem castSucc_zero' [NeZero n] : castSucc (0 : Fin n) = 0


theorem Coprime.coprime_div_right (cmn : Coprime m n) (dvd : a ∣ n) : Coprime m (n / a)

{m n a : Nat}
(cmn : m.Coprime n)
(dvd : a ∣ n)


theorem tendsto_log_gamma {x : ℝ} (hx : 0 < x) :
    Tendsto (logGammaSeq x) atTop (𝓝 <| log (Gamma x))

Filter.Tendsto (Real.BohrMollerup.logGammaSeq x) Filter.atTop (𝓝 (Real.log (Real.Gamma x)))


theorem norm_iteratedFDerivWithin_eq_norm_iteratedDerivWithin :
    ‖iteratedFDerivWithin 𝕜 n f s x‖ = ‖iteratedDerivWithin n f s x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{s : Set 𝕜}
{x : 𝕜}


/-- If a group `G` acts on `X` by isometries, then `IsometryEquiv.constSMul` is the isometry of
`X` given by multiplication of a constant element of the group. -/
@[to_additive (attr := simps! toEquiv apply) "If an additive group `G` acts on `X` by isometries,
then `IsometryEquiv.constVAdd` is the isometry of `X` given by addition of a constant element of the
group."]
def constSMul (c : G) : X ≃ᵢ X

{G : Type v}
{X : Type w}
[PseudoEMetricSpace X]
[Group G]
[MulAction G X]
[IsometricSMul G X]
(c : G)
(x : X)


theorem pred : @Primrec' 1 fun v => v.head.pred


lemma shiftFunctorZero_op_hom_app (X : Cᵒᵖ) :
    (shiftFunctorZero Cᵒᵖ ℤ).hom.app X = (shiftFunctorOpIso C 0 0 (zero_add 0)).hom.app X ≫
      ((shiftFunctorZero C ℤ).inv.app X.unop).op

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(X : Cᵒᵖ)

(CategoryTheory.shiftFunctorZero Cᵒᵖ ℤ).hom.app X =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Pretriangulated.shiftFunctorOpIso C 0 0 ⋯).hom.app X)
    ((CategoryTheory.shiftFunctorZero C ℤ).inv.app (Opposite.unop X)).op


theorem changeOriginSeriesTerm_apply (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l)
    (x y : E) :
    (p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y) =
      p (k + l) (s.piecewise (fun _ => x) fun _ => y)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(k l : ℕ)
(s : Finset (Fin (k + l)))
(hs : s.card = l)
(x y : E)

(((p.changeOriginSeriesTerm k l s hs) fun x_1 => x) fun x => y) = (p (k + l)) (s.piecewise (fun x_1 => x) fun x => y)


/-- A symmetric block matrix `A.fromBlocks B C D` is diagonal
    if `A` and `D` are diagonal and `B` is `0`. -/
theorem IsDiag.fromBlocks_of_isSymm [Zero α] {A : Matrix m m α} {C : Matrix n m α}
    {D : Matrix n n α} (h : (A.fromBlocks 0 C D).IsSymm) (ha : A.IsDiag) (hd : D.IsDiag) :
    (A.fromBlocks 0 C D).IsDiag

(h : (Matrix.fromBlocks A 0 C D).IsSymm)


theorem antitone_iff_map_nonpos : Antitone (f : α → β) ↔ ∀ a, 0 ≤ a → f a ≤ 0

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommMonoid β]
[i : FunLike F α β]
(f : F)
[iamhc : AddMonoidHomClass F α β]

Antitone ⇑f ↔ ∀ (a : α), 0 ≤ a → f a ≤ 0


theorem im_T_inv_smul : (T⁻¹ • z).im = z.im


@[to_additive]
theorem disjoint_mulSupport_iff {f : α → M} {s : Set α} :
    Disjoint s (mulSupport f) ↔ EqOn f 1 s

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

Disjoint s (Function.mulSupport f) ↔ Set.EqOn f 1 s


theorem mem_sInf {S : Set (Subalgebra R A)} {x : A} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S : Set (Subalgebra R A)}
{x : A}


@[simp]
theorem append_head {i j k l} {w₁ : NeWord M i j} {hne : j ≠ k} {w₂ : NeWord M k l} :
    (append w₁ hne w₂).head = w₁.head

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i j k l : ι}
{w₁ : Monoid.CoprodI.NeWord M i j}
{hne : j ≠ k}
{w₂ : Monoid.CoprodI.NeWord M k l}


theorem rpow_add_int {x : ℝ} (hx : x ≠ 0) (y : ℝ) (n : ℤ) : x ^ (y + n) = x ^ y * x ^ n


theorem keys_subset_keys_of_entries_subset_entries
    {s₁ s₂ : AList β} (h : s₁.entries ⊆ s₂.entries) : s₁.keys ⊆ s₂.keys

{α : Type u}
{β : α → Type v}
{s₁ s₂ : AList β}
(h : s₁.entries ⊆ s₂.entries)


protected theorem Function.Injective.isLeftCancelMulZero
    [IsLeftCancelMulZero M₀'] : IsLeftCancelMulZero M₀

(mul : ∀ (x y : M₀), f (x * y) = f x * f y)


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

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddRightInvariant]
(g : G)

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


theorem tan_surjective : Function.Surjective tan


theorem smul_ne_zero [Zero R] [Zero M] [SMul R M] [NoZeroSMulDivisors R M] {c : R} {x : M}
    (hc : c ≠ 0) (hx : x ≠ 0) : c • x ≠ 0

{R : Type u_2}
{M : Type u_5}
[Zero R]
[Zero M]
[SMul R M]
[NoZeroSMulDivisors R M]
{c : R}
{x : M}
(hc : c ≠ 0)
(hx : x ≠ 0)


theorem models_iff_not_satisfiable (φ : L.Sentence) : T ⊨ᵇ φ ↔ ¬IsSatisfiable (T ∪ {φ.not})

{L : FirstOrder.Language}
{T : L.Theory}
(φ : L.Sentence)

T ⊨ᵇ φ ↔ ¬(T ∪ {FirstOrder.Language.Formula.not φ}).IsSatisfiable


theorem not_all_isQF (φ : L.BoundedFormula α (n + 1)) : ¬φ.all.IsQF

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
(φ : L.BoundedFormula α (n + 1))


@[simp]
lemma _root_.LinearIsometryEquiv.adjoint_eq_symm (e : H ≃ₗᵢ[𝕜] K) :
    adjoint (e : H →L[𝕜] K) = e.symm

{𝕜 : Type u_1}
[RCLike 𝕜]
{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace 𝕜 H]
[CompleteSpace H]
{K : Type u_6}
[NormedAddCommGroup K]
[InnerProductSpace 𝕜 K]
[CompleteSpace K]
(e : H ≃ₗᵢ[𝕜] K)

ContinuousLinearMap.adjoint ↑{ toLinearEquiv := e.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ } =
  ↑{ toLinearEquiv := e.symm.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }


theorem convex_univ : Convex 𝕜 (Set.univ : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]


/-- Postcomposing `f` with `Prod.fst` is `C^n` at `(x, y)` -/
theorem ContDiffAt.fst {f : E → F × G} {x : E} (hf : ContDiffAt 𝕜 n f x) :
    ContDiffAt 𝕜 n (fun x => (f x).1) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → F × G}
{x : E}
(hf : ContDiffAt 𝕜 n f x)


/-- If the sequence `SequentiallyComplete.seq` converges to `a`, then `f ≤ 𝓝 a`. -/
theorem le_nhds_of_seq_tendsto_nhds ⦃a : α⦄ (ha : Tendsto (seq hf U_mem) atTop (𝓝 a)) : f ≤ 𝓝 a

(ha : Filter.Tendsto (SequentiallyComplete.seq hf U_mem) Filter.atTop (𝓝 a))


@[simp]
theorem canonicalEquiv_self : canonicalEquiv S P P = RingEquiv.refl _

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

FractionalIdeal.canonicalEquiv S P P = RingEquiv.refl (FractionalIdeal S P)


@[simp] theorem size_mk (as : List α) : (Array.mk as).size = as.length


/-- The minimal polynomial (over `K`) of `σ : Gal(L/K)` is `X ^ (orderOf σ) - 1`. -/
lemma minpoly_algEquiv_toLinearMap (σ : L ≃ₐ[K] L) (hσ : IsOfFinOrder σ) :
    minpoly K σ.toLinearMap = X ^ (orderOf σ) - C 1

{K : Type u_1}
{L : Type u_2}
[Field K]
[CommRing L]
[IsDomain L]
[Algebra K L]
(σ : L ≃ₐ[K] L)
(hσ : IsOfFinOrder σ)

minpoly K σ.toLinearMap = Polynomial.X ^ orderOf σ - Polynomial.C 1


theorem foldr_induction
    {as : Array α} (motive : Nat → β → Prop) {init : β} (h0 : motive as.size init) {f : α → β → β}
    (hf : ∀ i : Fin as.size, ∀ b, motive (i.1 + 1) b → motive i.1 (f as[i] b)) :
    motive 0 (as.foldr f init)

{f : α → β → β}

(hf : ∀ (i : Fin as.size) (b : β), motive (↑i + 1) b → motive (↑i) (f as[i] b))

motive 0 (Array.foldr f init as as.size)


/-- Two simplices with the same points have the same centroid. -/
theorem centroid_eq_of_range_eq {n : ℕ} {s₁ s₂ : Simplex k P n}
    (h : Set.range s₁.points = Set.range s₂.points) :
    Finset.univ.centroid k s₁.points = Finset.univ.centroid k s₂.points

Finset.centroid k Finset.univ s₁.points = Finset.centroid k Finset.univ s₂.points


@[to_additive]
theorem apply_coe_mem_map (f : G →* N) (K : Subgroup G) (x : K) : f x ∈ K.map f

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)
(K : AddSubgroup G)
(x : ↥K)


theorem le_infEdist {d} : d ≤ infEdist x s ↔ ∀ y ∈ s, d ≤ edist x y

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s : Set α}
{d : ℝ≥0∞}

d ≤ EMetric.infEdist x s ↔ ∀ y ∈ s, d ≤ edist x y


@[to_additive Icc_add_Icc_subset]
theorem Icc_mul_Icc_subset' [LocallyFiniteOrder α] (a b c d : α) :
    Icc a b * Icc c d ⊆ Icc (a * c) (b * d)

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

[CovariantClass α α (Function.swap HMul.hMul) LE.le]

Finset.Icc a b * Finset.Icc c d ⊆ Finset.Icc (a * c) (b * d)


theorem antivary_const_left (g : ι → β) (a : α) : Antivary (const ι a) g

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(g : ι → β)
(a : α)


theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{F : I.Filtration M}
(h : F.Stable)

∃ n₀, ∀ (k : ℕ), F.N (n₀ + k) = I ^ k • F.N n₀


lemma schnirelmannDensity_lt_iff {x : ℝ} :
    schnirelmannDensity A < x ↔ ∃ n : ℕ, 0 < n ∧ ((Ioc 0 n).filter (· ∈ A)).card / n < x

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]
{x : ℝ}

schnirelmannDensity A < x ↔ ∃ n, 0 < n ∧ ↑(Finset.filter (fun x => x ∈ A) (Finset.Ioc 0 n)).card / ↑n < x


theorem coe_ne_zero : (r : ℝ≥0∞) ≠ 0 ↔ r ≠ 0

↑r ≠ 0 ↔ r ≠ 0


theorem add_one_mul_T_eq_poly_in_U (n : ℤ) :
    ((n : R[X]) + 1) * T R (n + 1) = X * U R n - (1 - X ^ 2) * derivative (U R n)

(↑n + 1) * Polynomial.Chebyshev.T R (n + 1) =
  Polynomial.X * Polynomial.Chebyshev.U R n -
    (1 - Polynomial.X ^ 2) * Polynomial.derivative (Polynomial.Chebyshev.U R n)


/-- Given a functor `F : Cᵒᵖ ⥤ Dᵒᵖ` we can take the "unopposite" functor `F : C ⥤ D`.
In informal mathematics no distinction is made between these.
-/
@[simps]
protected def unop (F : Cᵒᵖ ⥤ Dᵒᵖ) : C ⥤ D

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

∀ {X Y : C} (f : X ⟶ Y), F.unop.map f = (F.map f.op).unop


/-- If `S` is the localization of `R` away from `r`, we obtain a canonical generator mapping
to the inverse of `r`. -/
@[simps val, simps (config := .lemmasOnly) vars σ]
noncomputable
def localizationAway : Generators R S

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

(Algebra.Generators.localizationAway r).vars = Unit


theorem Disjoint.closure_right (hd : Disjoint s t) (hs : IsOpen s) :
    Disjoint s (closure t)

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


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

{f : ι → Ω → β}

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

ProbabilityTheory.IndepFun (f i + f j) (f k) μ


lemma copy_eq (s : Set α) (hs) : L.copy s hs = L

{α : Type u_1}
[CompleteLattice α]
(L : CompleteSublattice α)
(s : Set α)
(hs : s = ↑L)


@[simp]
theorem cos_pi_div_sixteen : cos (π / 16) = √(2 + √(2 + √2)) / 2


@[simp]
lemma sign_intCast {α : Type*} [OrderedRing α] [Nontrivial α]
    [DecidableRel ((· < ·) : α → α → Prop)] (n : ℤ) :
    sign (n : α) = sign n

{α : Type u_2}
[OrderedRing α]
[Nontrivial α]
[DecidableRel fun x x_1 => x < x_1]
(n : ℤ)


lemma totallyBounded_image_iff {f : α → β} {s : Set α} (hf : UniformInducing f) :
    TotallyBounded (f '' s) ↔ TotallyBounded s

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{f : α → β}
{s : Set α}
(hf : UniformInducing f)


theorem tendsto_ceil_left (n : ℤ) : Tendsto (fun x => ceil x : α → α) (𝓝[≤] n) (𝓝[≤] n)

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
(n : ℤ)

Filter.Tendsto (fun x => ↑⌈x⌉) (𝓝[≤] ↑n) (𝓝[≤] ↑n)


@[simp]
theorem insert_symm_apply_inl {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s)
    (b : s) : (Equiv.Set.insert H).symm (Sum.inl b) = ⟨b, Or.inr b.2⟩

{α : Type u}
{s : Set α}
[DecidablePred fun x => x ∈ s]
{a : α}
(H : a ∉ s)
(b : ↑s)

(Equiv.Set.insert H).symm (Sum.inl b) = ⟨↑b, ⋯⟩


/-- A decomposition is an equivalence between an additive monoid `M` and a direct sum of additive
submonoids `ℳ i` of that `M`, such that the "recomposition" is canonical. This definition also
works for additive groups and modules.

This is a version of `DirectSum.IsInternal` which comes with a constructive inverse to the
canonical "recomposition" rather than just a proof that the "recomposition" is bijective.

Often it is easier to construct a term of this type via `Decomposition.ofAddHom` or
`Decomposition.ofLinearMap`. -/
class Decomposition where
  decompose' : M → ⨁ i, ℳ i
  left_inv : Function.LeftInverse (DirectSum.coeAddMonoidHom ℳ) decompose'
  right_inv : Function.RightInverse (DirectSum.coeAddMonoidHom ℳ) decompose'

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
{ℳ : ι → σ}
[self : DirectSum.Decomposition ℳ]

Function.RightInverse (⇑(DirectSum.coeAddMonoidHom ℳ)) DirectSum.Decomposition.decompose'


@[simp]
theorem toList'_think (l : List α) (s : WSeq α) :
    Computation.corec (fun ⟨l, s⟩ =>
      match Seq.destruct s with
      | none => Sum.inl l.reverse
      | some (none, s') => Sum.inr (l, s')
      | some (some a, s') => Sum.inr (a::l, s')) (l, think s) =
      (Computation.corec (fun ⟨l, s⟩ =>
        match Seq.destruct s with
        | none => Sum.inl l.reverse
        | some (none, s') => Sum.inr (l, s')
        | some (some a, s') => Sum.inr (a::l, s')) (l, s)).think

{α : Type u}
(l : List α)
(s : Stream'.WSeq α)

Computation.corec
    (fun x =>
      match x with
      | (l, s) =>
        match Stream'.Seq.destruct s with
        | none => Sum.inl l.reverse
        | some (none, s') => Sum.inr (l, s')
        | some (some a, s') => Sum.inr (a :: l, s'))
    (l, s.think) =
  (Computation.corec
      (fun x =>
        match x with
        | (l, s) =>
          match Stream'.Seq.destruct s with
          | none => Sum.inl l.reverse
          | some (none, s') => Sum.inr (l, s')
          | some (some a, s') => Sum.inr (a :: l, s'))
      (l, s)).think


@[simp] lemma pi_cons (i : ι) (l : List ι) (t : ∀ j, List (α j)) :
    pi (i :: l) t = ((t i).bind fun b ↦ (pi l t).map <| Pi.cons _ _ b)

{ι : Type u_1}
[DecidableEq ι]
{α : ι → Type u_2}
(i : ι)
(l : List ι)
(t : (j : ι) → List (α j))

(i :: l).pi t = (t i).bind fun b => List.map (List.Pi.cons i l b) (l.pi t)


theorem IsTheta.isLittleO_congr_left (h : f' =Θ[l] g') : f' =o[l] k ↔ g' =o[l] k

{α : Type u_1}
{G : Type u_5}
{E' : Type u_6}
{F' : Type u_7}
[Norm G]
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{k : α → G}
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
(h : f' =Θ[l] g')


theorem ne_bot_of_gt (h : a < b) : b ≠ ⊥

{α : Type u}
[Preorder α]
[OrderBot α]
{a b : α}
(h : a < b)


theorem filter_cons_of_pos (a : α) (s : Finset α) (ha : a ∉ s) (hp : p a) :
    filter p (cons a s ha) = cons a (filter p s) (mem_filter.not.mpr <| mt And.left ha)

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(a : α)
(s : Finset α)
(ha : a ∉ s)
(hp : p a)

Finset.filter p (Finset.cons a s ha) = Finset.cons a (Finset.filter p s) ⋯


@[reassoc]
theorem leftUnitor_inv_naturality {X Y : C} (f : X ⟶ Y) :
    f ≫ (λ_ Y).inv = (λ_ X).inv ≫ _ ◁ f

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

CategoryTheory.CategoryStruct.comp f (CategoryTheory.MonoidalCategory.leftUnitor Y).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.leftUnitor X).inv
    (CategoryTheory.MonoidalCategory.whiskerLeft (𝟙_ C) f)


lemma IsLocalizedModule.eq_iff_exists [IsLocalizedModule S f] {x₁ x₂} :
    f x₁ = f x₂ ↔ ∃ c : S, c • x₁ = c • x₂

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


/-- A chosen extension of a commutative square into a morphism of distinguished triangles. -/
@[simps hom₁ hom₂]
def completeDistinguishedTriangleMorphism (T₁ T₂ : Triangle C)
    (hT₁ : T₁ ∈ distTriang C) (hT₂ : T₂ ∈ distTriang C)
    (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (comm : T₁.mor₁ ≫ b = a ≫ T₂.mor₁) :
    T₁ ⟶ T₂

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

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

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

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

(CategoryTheory.Pretriangulated.completeDistinguishedTriangleMorphism T₁ T₂ hT₁ hT₂ a b comm).hom₁ = a


@[simp]
lemma equivProdNatFactoredNumbers_apply' {s : Finset ℕ} {p : ℕ} (hp : p.Prime) (hs : p ∉ s)
    (x : ℕ × factoredNumbers s) :
    equivProdNatFactoredNumbers hp hs x = p ^ x.1 * x.2

{s : Finset ℕ}
{p : ℕ}
(hp : Nat.Prime p)
(hs : p ∉ s)
(x : ℕ × ↑(Nat.factoredNumbers s))

↑((Nat.equivProdNatFactoredNumbers hp hs) x) = p ^ x.1 * ↑x.2


theorem ConcaveOn.convex_strict_hypograph (hf : ConcaveOn 𝕜 s f) :
    Convex 𝕜 { p : E × β | p.1 ∈ s ∧ p.2 < f p.1 }

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


theorem max_le_of_forall_le (l : List α) (a : α) (h : ∀ x ∈ l, x ≤ a) : l.foldr max ⊥ ≤ a

{α : Type u_1}
[LinearOrder α]
[OrderBot α]
(l : List α)
(a : α)
(h : ∀ (x : α), x ∈ l → x ≤ a)


theorem exists_lt_of_tendsto_atTop [SemilatticeSup α] [Preorder β] [NoMaxOrder β] {u : α → β}
    (h : Tendsto u atTop atTop) (a : α) (b : β) : ∃ a' ≥ a, b < u a'

(h : Filter.Tendsto u Filter.atTop Filter.atTop)


theorem closedBall_smul_closedBall (p : Seminorm 𝕜 E) (r₁ r₂ : ℝ) :
    Metric.closedBall (0 : 𝕜) r₁ • p.closedBall 0 r₂ ⊆ p.closedBall 0 (r₁ * r₂)

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
(r₁ r₂ : ℝ)

Metric.closedBall 0 r₁ • p.closedBall 0 r₂ ⊆ p.closedBall 0 (r₁ * r₂)


@[deprecated isUnit_den_zero (since := "2024-07-11")]
theorem isUnit_den_of_num_eq_zero {x : K} (h : num A x = 0) : IsUnit (den A x : A)

{A : Type u_4}
[CommRing A]
[IsDomain A]
[UniqueFactorizationMonoid A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]
{x : K}
(h : IsFractionRing.num A x = 0)


lemma isLocallySurjective_of_le {K : GrothendieckTopology C} (hJK : J ≤ K) {F G : Cᵒᵖ ⥤ A}
    (f : F ⟶ G) (h : IsLocallySurjective J f) : IsLocallySurjective K f

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology C}

(h : CategoryTheory.Presheaf.IsLocallySurjective J f)


theorem ae_map_iff {f : α → β} (hf : AEMeasurable f μ) {p : β → Prop}
    (hp : MeasurableSet { x | p x }) : (∀ᵐ y ∂μ.map f, p y) ↔ ∀ᵐ x ∂μ, p (f x)

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)
{p : β → Prop}
(hp : MeasurableSet {x | p x})

(∀ᵐ (y : β) ∂MeasureTheory.Measure.map f μ, p y) ↔ ∀ᵐ (x : α) ∂μ, p (f x)


@[reassoc (attr := simp)]
lemma ΓSpecIso_naturality {R S : CommRingCat.{u}} (f : R ⟶ S) :
    (Spec.map f).app ⊤ ≫ (ΓSpecIso S).hom = (ΓSpecIso R).hom ≫ f

AlgebraicGeometry.Scheme.Hom.app (AlgebraicGeometry.Spec.map f) ⊤ ≫ (AlgebraicGeometry.Scheme.ΓSpecIso S).hom =
  (AlgebraicGeometry.Scheme.ΓSpecIso R).hom ≫ f


theorem valMinAbs_natAbs_eq_min {n : ℕ} [hpos : NeZero n] (a : ZMod n) :
    a.valMinAbs.natAbs = min a.val (n - a.val)


theorem IsLowerSet.image (hs : IsLowerSet s) (f : α ≃o β) : IsLowerSet (f '' s : Set β)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : Set α}
(hs : IsLowerSet s)
(f : α ≃o β)


@[norm_cast] lemma coe_ne_zero : (r : ℝ) ≠ 0 ↔ r ≠ 0

↑r ≠ 0 ↔ r ≠ 0


theorem prod_subset_preimage_fst (s : Set α) (t : Set β) : s ×ˢ t ⊆ Prod.fst ⁻¹' s

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


@[simp] theorem decide_False : decide False = false


theorem Zag.symm {j₁ j₂ : J} (h : Zag j₁ j₂) : Zag j₂ j₁

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{j₁ j₂ : J}
(h : CategoryTheory.Zag j₁ j₂)


@[simp]
theorem scanr_cons (f : α → β → β) (b : β) (a : α) (l : List α) :
    scanr f b (a :: l) = foldr f b (a :: l) :: scanr f b l

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

List.scanr f b (a :: l) = List.foldr f b (a :: l) :: List.scanr f b l


theorem mono (hf : RightInvOn f' f t) (ht : t₁ ⊆ t) : RightInvOn f' f t₁

{α : Type u_1}
{β : Type u_2}
{t t₁ : Set β}
{f : α → β}
{f' : β → α}
(hf : Set.RightInvOn f' f t)
(ht : t₁ ⊆ t)


theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r)
    (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{pf pg : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f pf x r)
(hg : HasFPowerSeriesOnBall g pg x r)


theorem map_nhds_eq (hf : ApproximatesLinearOn f f' s c) (f'symm : f'.NonlinearRightInverse) {x : E}
    (hs : s ∈ 𝓝 x) (hc : Subsingleton F ∨ c < f'symm.nnnorm⁻¹) : map f (𝓝 x) = 𝓝 (f x)


theorem dart_fst_fiber [DecidableEq V] (v : V) :
    (univ.filter fun d : G.Dart => d.fst = v) = univ.image (G.dartOfNeighborSet v)

{V : Type u}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
[DecidableEq V]
(v : V)

Finset.filter (fun d => d.toProd.1 = v) Finset.univ = Finset.image (G.dartOfNeighborSet v) Finset.univ


@[simp]
theorem normSq_intCast (z : ℤ) : normSq z = z * z


theorem not_forall_eq : (¬ ∀ x, s x) = (∃ x, ¬ s x)


theorem IsBigO.inv_rev {f : α → 𝕜} {g : α → 𝕜'} (h : f =O[l] g)
    (h₀ : ∀ᶠ x in l, f x = 0 → g x = 0) : (fun x => (g x)⁻¹) =O[l] fun x => (f x)⁻¹

(h₀ : ∀ᶠ (x : α) in l, f x = 0 → g x = 0)


protected theorem antilipschitz : AntilipschitzWith 1 f

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


theorem moveLeft_lt {x : PGame} (o : Numeric x) (i) : x.moveLeft i < x

{x : SetTheory.PGame}
(o : x.Numeric)
(i : x.LeftMoves)


/-- Composition by continuous linear maps on the left preserves `C^n` functions in a domain
at a point. -/
theorem ContDiffWithinAt.continuousLinearMap_comp (g : F →L[𝕜] G)
    (hf : ContDiffWithinAt 𝕜 n f s x) : ContDiffWithinAt 𝕜 n (g ∘ f) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
(g : F →L[𝕜] G)
(hf : ContDiffWithinAt 𝕜 n f s x)


protected theorem uniformInducing (h : α ≃ᵤ β) : UniformInducing h

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(h : α ≃ᵤ β)


theorem tendsto_pure_left {f : α → β} {a : α} {l : Filter β} :
    Tendsto f (pure a) l ↔ ∀ s ∈ l, f a ∈ s

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

Filter.Tendsto f (pure a) l ↔ ∀ s ∈ l, f a ∈ s


/-- Given three nonzero vectors, the angle between the first and the third minus the angle
between the first and the second equals the angle between the second and the third. -/
@[simp]
theorem oangle_sub_left {x y z : V} (hx : x ≠ 0) (hy : y ≠ 0) (hz : z ≠ 0) :
    o.oangle x z - o.oangle x y = o.oangle y z

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


theorem aestronglyMeasurable_iff [TopologicalSpace γ] [MetrizableSpace γ] [BorelSpace γ]
    (h : IdentDistrib f g μ ν) : AEStronglyMeasurable f μ ↔ AEStronglyMeasurable g ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

MeasureTheory.AEStronglyMeasurable f μ ↔ MeasureTheory.AEStronglyMeasurable g ν


theorem compProd_eq_sum_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] : κ ⊗ₖ η = Kernel.sum fun n => Kernel.sum fun m => seq κ n ⊗ₖ seq η m

(η : ProbabilityTheory.Kernel (α × β) γ)

κ.compProd η = ProbabilityTheory.Kernel.sum fun n => ProbabilityTheory.Kernel.sum fun m => (κ.seq n).compProd (η.seq m)


theorem mem_iff_one_sub_mem {t : β} : t ∈ Icc (0 : β) 1 ↔ 1 - t ∈ Icc (0 : β) 1


lemma isBoundedUnder_le_sum {κ : Type*} [AddCommMonoid R]
    [CovariantClass R R (fun a b ↦ a + b) (· ≤ ·)] [CovariantClass R R (fun a b ↦ b + a) (· ≤ ·)]
    {u : κ → α → R} (s : Finset κ) :
    (∀ k ∈ s, f.IsBoundedUnder (· ≤ ·) (u k)) → f.IsBoundedUnder (· ≤ ·) (∑ k ∈ s, u k)

[CovariantClass R R (fun a b => a + b) fun x x_1 => x ≤ x_1]

[CovariantClass R R (fun a b => b + a) fun x x_1 => x ≤ x_1]

(∀ k ∈ s, Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f (u k)) →
  Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f (∑ k ∈ s, u k)


/-- If `IsPrimePow (n : ℕ)`, `n ≠ 2` and `Irreducible (cyclotomic n K)` (in particular for
`K = ℚ`), then the norm of `ζ - 1` is `(n : ℕ).minFac`. -/
theorem sub_one_norm_isPrimePow (hn : IsPrimePow (n : ℕ)) [IsCyclotomicExtension {n} K L]
    (hirr : Irreducible (cyclotomic (n : ℕ) K)) (h : n ≠ 2) : norm K (ζ - 1) = (n : ℕ).minFac

(hirr : Irreducible (Polynomial.cyclotomic (↑n) K))


theorem isClosed_zeroLocus (s : Set R) : IsClosed (zeroLocus s)

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


@[simp]
theorem le_bot_iff : a ≤ ⊥ ↔ a = ⊥

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

a ≤ ⊥ ↔ a = ⊥


theorem transfer_center_eq_pow [FiniteIndex (center G)] (g : G) :
    transfer (MonoidHom.id (center G)) g = ⟨g ^ (center G).index, (center G).pow_index_mem g⟩

{G : Type u_1}
[Group G]
[(Subgroup.center G).FiniteIndex]
(g : G)

(MonoidHom.id ↥(Subgroup.center G)).transfer g = ⟨g ^ (Subgroup.center G).index, ⋯⟩


@[simp] theorem getElem_replicate (a : α) {n : Nat} {m} (h : m < (replicate n a).length) :
    (replicate n a)[m] = a

{α : Type u_1}
(a : α)
{n m : Nat}
(h : m < (List.replicate n a).length)


@[simp]
theorem eqToIso_map_trans (F : C ⥤ D) {X Y Z : C} (p : X = Y) (q : Y = Z) :
    F.mapIso (eqToIso p) ≪≫ F.mapIso (eqToIso q) = F.mapIso (eqToIso <| p.trans q)

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

F.mapIso (CategoryTheory.eqToIso p) ≪≫ F.mapIso (CategoryTheory.eqToIso q) = F.mapIso (CategoryTheory.eqToIso ⋯)


/-- The union of two ample sets is ample. -/
theorem union {s t : Set F} (hs : AmpleSet s) (ht : AmpleSet t) : AmpleSet (s ∪ t)

{F : Type u_1}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
{s t : Set F}
(hs : AmpleSet s)
(ht : AmpleSet t)


@[simp]
theorem map₂_none_right (f : α → β → γ) (a : Option α) : map₂ f a none = none

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


/-- The composition of morphisms of short complexes. -/
@[simps]
def Hom.comp (φ₁₂ : Hom S₁ S₂) (φ₂₃ : Hom S₂ S₃) : Hom S₁ S₃

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁₂.comp φ₂₃).τ₁ = CategoryTheory.CategoryStruct.comp φ₁₂.τ₁ φ₂₃.τ₁


lemma finsuppScalarRight_apply (t : M ⊗[R] (ι →₀ R)) (i : ι) :
    finsuppScalarRight R M ι t i = TensorProduct.rid R M ((Finsupp.lapply i).lTensor M t)

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
(t : M ⊗[R] (ι →₀ R))
(i : ι)

((TensorProduct.finsuppScalarRight R M ι) t) i = (TensorProduct.rid R M) ((LinearMap.lTensor M (Finsupp.lapply i)) t)


@[simp]
lemma opcyclesMap'_zero (h₁ : S₁.RightHomologyData) (h₂ : S₂.RightHomologyData) :
    opcyclesMap' 0 h₁ h₂ = 0

CategoryTheory.ShortComplex.opcyclesMap' 0 h₁ h₂ = 0


@[simp] lemma finsuppAntidiag_empty_of_ne_zero (hn : n ≠ 0) :
    finsuppAntidiag (∅ : Finset ι) n = ∅

{ι : Type u_1}
{μ : Type u_2}
[DecidableEq ι]
[AddCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
{n : μ}
(hn : n ≠ 0)


theorem le_iff' : v ≤ w ↔ ∀ i, v i ≤ w i

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[TopologicalSpace M]
[AddCommMonoid M]
[PartialOrder M]
{v w : MeasureTheory.VectorMeasure α M}


/-- The identity as a continuous function. -/
@[simps!]
def id : α →𝒄 α

{α : Type u}
[OmegaCompletePartialOrder α]
(a : α)

OmegaCompletePartialOrder.ContinuousHom.id a = a


/-- Helper lemma for calculating the derivative of the monomial that appears in Taylor
expansions. -/
theorem monomial_has_deriv_aux (t x : ℝ) (n : ℕ) :
    HasDerivAt (fun y => (x - y) ^ (n + 1)) (-(n + 1) * (x - t) ^ n) t


/-- A valuation has rank one if it is nontrivial and its image is contained in `ℝ≥0`.
  Note that this class includes the data of an inclusion morphism `Γ₀ → ℝ≥0`. -/
class RankOne (v : Valuation R Γ₀) where
  /-- The inclusion morphism from `Γ₀` to `ℝ≥0`. -/
  hom : Γ₀ →*₀ ℝ≥0
  strictMono' : StrictMono hom
  nontrivial' : ∃ r : R, v r ≠ 0 ∧ v r ≠ 1

{R : Type u_1}
[Ring R]
{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation R Γ₀}
[self : v.RankOne]


/-- An `I`-filtration on the module `M` is a sequence of decreasing submodules `N i` such that
`I • (N i) ≤ N (i + 1)`. Note that we do not require the filtration to start from `⊤`. -/
@[ext]
structure Ideal.Filtration (M : Type u) [AddCommGroup M] [Module R M] where
  N : ℕ → Submodule R M
  mono : ∀ i, N (i + 1) ≤ N i
  smul_le : ∀ i, I • N i ≤ N (i + 1)

{R : Type u}
[CommRing R]
{I : Ideal R}
{M : Type u}
[AddCommGroup M]
[Module R M]
(self : I.Filtration M)
(i : ℕ)


/-- The composition of morphisms in the category `Φ.Iteration ε j`. -/
@[simps]
def comp {iter₃ : Iteration ε j} (f : Hom iter₁ iter₂) (g : Hom iter₂ iter₃) :
    Hom iter₁ iter₃

{iter₁ iter₂ iter₃ : CategoryTheory.Functor.Iteration ε j}

(f.comp g).natTrans = CategoryTheory.CategoryStruct.comp f.natTrans g.natTrans


theorem mul_div_mul_comm_of_dvd_dvd {a b c d : R} (hac : c ∣ a) (hbd : d ∣ b) :
    a * b / (c * d) = a / c * (b / d)

{R : Type u}
[EuclideanDomain R]
{a b c d : R}
(hac : c ∣ a)
(hbd : d ∣ b)


theorem sublist_or_mem_of_sublist (h : l <+ l₁ ++ a :: l₂) : l <+ l₁ ++ l₂ ∨ a ∈ l

∀ {α : Type u_1} {l l₁ : List α} {a : α} {l₂ : List α}, l <+ l₁ ++ a :: l₂ → l <+ l₁ ++ l₂ ∨ a ∈ l


/-- For `n ≠ 0`, a translation by `T / 2 / n` negates the function `fourier n`. -/
theorem fourier_add_half_inv_index {n : ℤ} (hn : n ≠ 0) (hT : 0 < T) (x : AddCircle T) :
    @fourier T n (x + ↑(T / 2 / n)) = -fourier n x

{T : ℝ}
{n : ℤ}
(hn : n ≠ 0)
(hT : 0 < T)
(x : AddCircle T)

(fourier n) (x + ↑(T / 2 / ↑n)) = -(fourier n) x


lemma IsOpen.exterior_eq (h : IsOpen s) : exterior s = s

{α : Type u_3}
[TopologicalSpace α]
{s : Set α}
(h : IsOpen s)


theorem isRegular_of_isLeftRegular_det {A : Matrix n n α} (hA : IsLeftRegular A.det) :
    IsRegular A

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
{A : Matrix n n α}
(hA : IsLeftRegular A.det)


theorem ext_iff {w₁ w₂ : NormalWord d} : w₁ = w₂ ↔ w₁.head = w₂.head ∧ w₁.toList = w₂.toList

{d : Monoid.PushoutI.NormalWord.Transversal φ}


/-- The type of dependent functions on a sum type `ι ⊕ ι'` is equivalent to the type of pairs of
functions on `ι` and on `ι'`. This is a dependent version of `Equiv.sumArrowEquivProdArrow`. -/
@[simps]
def sumPiEquivProdPi (π : ι ⊕ ι' → Type*) : (∀ i, π i) ≃ (∀ i, π (inl i)) × ∀ i', π (inr i')

(g : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i')))

(Equiv.sumPiEquivProdPi π).symm g t = Sum.rec g.1 g.2 t


lemma div_helper (b : G₀) (h : a ≠ 0) : 1 / (a * b) * a = 1 / b

{G₀ : Type u_3}
[CommGroupWithZero G₀]
{a : G₀}
(b : G₀)
(h : a ≠ 0)


/-- If a function `f` tends to negative infinity along a filter, then `f` divided by
a positive constant also tends to negative infinity. -/
theorem Tendsto.atBot_div_const (hr : 0 < r) (hf : Tendsto f l atBot) :
    Tendsto (fun x => f x / r) l atBot

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atBot)

Filter.Tendsto (fun x => f x / r) l Filter.atBot


@[simp]
theorem trop_min (x y : R) : trop (min x y) = trop x + trop y

Tropical.trop (min x y) = Tropical.trop x + Tropical.trop y


theorem ae_not_liouvilleWith : ∀ᵐ x, ∀ p > (2 : ℝ), ¬LiouvilleWith p x


@[to_additive (attr := simp)]
theorem lift_comp_of : lift f ∘ of = f

{α : Type u}
{β : Type v}
[Semigroup β]
(f : α → β)

⇑(FreeSemigroup.lift f) ∘ FreeSemigroup.of = f


lemma smallHomMap_comp (f : SmallHom.{w} W₁ X Y) (g : SmallHom.{w} W₁ Y Z) :
    Φ.smallHomMap (f.comp g) = (Φ.smallHomMap f).comp (Φ.smallHomMap g)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

[CategoryTheory.Localization.HasSmallLocalizedHom W₁ X Y]

[CategoryTheory.Localization.HasSmallLocalizedHom W₁ Y Z]

[CategoryTheory.Localization.HasSmallLocalizedHom W₁ X Z]

[CategoryTheory.Localization.HasSmallLocalizedHom W₂ (Φ.functor.obj X) (Φ.functor.obj Y)]

[CategoryTheory.Localization.HasSmallLocalizedHom W₂ (Φ.functor.obj Y) (Φ.functor.obj Z)]

[CategoryTheory.Localization.HasSmallLocalizedHom W₂ (Φ.functor.obj X) (Φ.functor.obj Z)]

(f : CategoryTheory.Localization.SmallHom W₁ X Y)

(g : CategoryTheory.Localization.SmallHom W₁ Y Z)


theorem toAddMonoidHom_injective {f g : A →ₑ+[φ] B} (h : (f : A →+ B) = (g : A →+ B)) : f = g

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
{f g : A →ₑ+[φ] B}
(h : ↑f = ↑g)


theorem IsMinFilter.max (hf : IsMinFilter f l a) (hg : IsMinFilter g l a) :
    IsMinFilter (fun x => max (f x) (g x)) l a

{α : Type u}
{β : Type v}
[LinearOrder β]
{f g : α → β}
{a : α}
{l : Filter α}
(hf : IsMinFilter f l a)
(hg : IsMinFilter g l a)


@[mono]
theorem degreeLE_mono {m n : WithBot ℕ} (H : m ≤ n) : degreeLE R m ≤ degreeLE R n

{R : Type u}
[Semiring R]
{m n : WithBot ℕ}
(H : m ≤ n)

Polynomial.degreeLE R m ≤ Polynomial.degreeLE R n


/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m)

(X : CategoryTheory.Kleisli (CategoryTheory.ofTypeMonad m))


theorem coeff_zero_eq_aeval_zero' (p : R[X]) : algebraMap R A (p.coeff 0) = aeval (0 : A) p

{R : Type u}
{A : Type z}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(p : R[X])

(algebraMap R A) (p.coeff 0) = (Polynomial.aeval 0) p


theorem pointwise_smul_le_iff₀ {a : α} (ha : a ≠ 0) {S T : Submonoid M} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[GroupWithZero α]
[MulDistribMulAction α M]
{a : α}
(ha : a ≠ 0)
{S T : Submonoid M}

a • S ≤ T ↔ S ≤ a⁻¹ • T


lemma leftRightHomologyComparison'_compatibility (h₁ h₁' : S.LeftHomologyData)
    (h₂ h₂' : S.RightHomologyData) :
    leftRightHomologyComparison' h₁ h₂ = leftHomologyMap' (𝟙 S) h₁ h₁' ≫
      leftRightHomologyComparison' h₁' h₂' ≫ rightHomologyMap' (𝟙 S) _ _

CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂ =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.ShortComplex.leftHomologyMap' (CategoryTheory.CategoryStruct.id S) h₁ h₁')
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁' h₂')
      (CategoryTheory.ShortComplex.rightHomologyMap' (CategoryTheory.CategoryStruct.id S) h₂' h₂))


theorem le_of_nadd_le_nadd_right : ∀ {a b c}, b ♯ a ≤ c ♯ a → b ≤ c


theorem smul_Ioc : r • Ioc a b = Ioc (r • a) (r • b)

{K : Type u_2}
[LinearOrderedField K]
{a b r : K}
(hr : 0 < r)

r • Set.Ioc a b = Set.Ioc (r • a) (r • b)


/-- An element is in the closure of a two-element set if it is a linear combination of those two
elements. -/
@[to_additive
      "An element is in the closure of a two-element set if it is a linear combination of
      those two elements."]
theorem mem_closure_pair {A : Type*} [CommMonoid A] (a b c : A) :
    c ∈ Submonoid.closure ({a, b} : Set A) ↔ ∃ m n : ℕ, a ^ m * b ^ n = c

{A : Type u_4}
[CommMonoid A]
(a b c : A)

c ∈ Submonoid.closure {a, b} ↔ ∃ m n, a ^ m * b ^ n = c


@[to_additive (attr := simp)]
lemma units_top : (⊤ : Submonoid M).units = ⊤


@[simp]
theorem zeroIsoIsTerminal_hom {X : C} (t : IsTerminal X) : (zeroIsoIsTerminal t).hom = 0

(t : CategoryTheory.Limits.IsTerminal X)

(CategoryTheory.Limits.HasZeroObject.zeroIsoIsTerminal t).hom = 0


@[simp]
theorem mem_accumulate [LE α] {x : α} {z : β} : z ∈ Accumulate s x ↔ ∃ y ≤ x, z ∈ s y

{α : Type u_1}
{β : Type u_2}
{s : α → Set β}
[LE α]
{x : α}
{z : β}

z ∈ Set.Accumulate s x ↔ ∃ y ≤ x, z ∈ s y


@[ext]
theorem hom_ext {M N : SemiNormedGrp₁} (f g : M ⟶ N) (w : (f : M → N) = (g : M → N)) :
    f = g

{M N : SemiNormedGrp₁}
(f g : M ⟶ N)
(w : ⇑f = ⇑g)


/-- The basis on `ι →₀ M` with basis vectors `fun i ↦ single i 1`. -/
@[simps]
protected def basisSingleOne : Basis ι R (ι →₀ R)

{R : Type u_1}
{ι : Type u_3}
[Semiring R]

Finsupp.basisSingleOne.repr = LinearEquiv.refl R (ι →₀ R)


@[simp]
theorem lift_ι_apply {A : Type*} [Semiring A] [Algebra R A] (f : M →ₗ[R] A) (x) :
    lift R f (ι R x) = f x

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : M →ₗ[R] A)
(x : M)

((TensorAlgebra.lift R) f) ((TensorAlgebra.ι R) x) = f x


theorem toPointedCone_injective : Function.Injective ((↑) : ProperCone 𝕜 E → PointedCone 𝕜 E)

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]


/-- The lifting of a functor `C ⥤ D` inverting `W` as a functor `W.Localization ⥤ D` -/
@[simps!]
def lift : W.Localization ⥤ D

(a : CategoryTheory.Quotient (CategoryTheory.Localization.Construction.relations W))

(CategoryTheory.Localization.Construction.lift G hG).obj a = G.obj a.as.obj


@[simp]
theorem interior_empty : interior (∅ : Set X) = ∅


lemma le_centralizer_centralizer {R} [Semiring R] {s : Subsemiring R} :
    s ≤ centralizer (centralizer (s : Set R))

{R : Type u_1}
[Semiring R]
{s : Subsemiring R}

s ≤ Subsemiring.centralizer ↑(Subsemiring.centralizer ↑s)


/-- If two commuting elements `x` and `y` of a monoid have order `n` and `m`, there is an element
of order `lcm n m`. The result actually gives an explicit (computable) element, written as the
product of a power of `x` and a power of `y`. See also the result below if you don't need the
explicit formula. -/
@[to_additive "If two commuting elements `x` and `y` of an additive monoid have order `n` and `m`,
there is an element of order `lcm n m`. The result actually gives an explicit (computable) element,
written as the sum of a multiple of `x` and a multiple of `y`. See also the result below if you
don't need the explicit formula."]
lemma _root_.Commute.orderOf_mul_pow_eq_lcm {x y : G} (h : Commute x y) (hx : orderOf x ≠ 0)
    (hy : orderOf y ≠ 0) :
    orderOf (x ^ (orderOf x / (factorizationLCMLeft (orderOf x) (orderOf y))) *
      y ^ (orderOf y / factorizationLCMRight (orderOf x) (orderOf y))) =
      Nat.lcm (orderOf x) (orderOf y)

{G : Type u}
[AddMonoid G]
{x y : G}
(h : AddCommute x y)
(hx : addOrderOf x ≠ 0)
(hy : addOrderOf y ≠ 0)

addOrderOf
    ((addOrderOf x / (addOrderOf x).factorizationLCMLeft (addOrderOf y)) • x +
      (addOrderOf y / (addOrderOf x).factorizationLCMRight (addOrderOf y)) • y) =
  (addOrderOf x).lcm (addOrderOf y)


@[to_additive (attr := simp)]
theorem MulHom.coe_coe [MulHomClass F M N] (f : F) : ((f : MulHom M N) : M → N) = f

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[Add M]
[Add N]
[FunLike F M N]
[AddHomClass F M N]
(f : F)


/-- The minimal distance to a set is bounded by the distance to any point in this set. -/
theorem infDist_le_dist_of_mem (h : y ∈ s) : infDist x s ≤ dist x y

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x y : α}
(h : y ∈ s)


theorem two_mul_arctan_sub_pi {x : ℝ} (h : x < -1) :
    2 * arctan x = arctan (2 * x / (1 - x ^ 2)) - π

2 * Real.arctan x = Real.arctan (2 * x / (1 - x ^ 2)) - Real.pi


@[to_additive]
lemma units_iInf₂ {ι : Sort*} {κ : ι → Sort*} (f : (i : ι) → κ i → Submonoid M) :
    (⨅ (i : ι), ⨅ (j : κ i), f i j).units = ⨅ (i : ι), ⨅ (j : κ i), (f i j).units

{M : Type u_1}
[Monoid M]
{ι : Sort u_2}
{κ : ι → Sort u_3}
(f : (i : ι) → κ i → Submonoid M)

(⨅ i, ⨅ j, f i j).units = ⨅ i, ⨅ j, (f i j).units


lemma eLpNorm_top_piecewise {s : Set α} (f g : α → E) [DecidablePred (· ∈ s)]
    (hs : MeasurableSet s) :
    eLpNorm (Set.piecewise s f g) ∞ μ
      = max (eLpNorm f ∞ (μ.restrict s)) (eLpNorm g ∞ (μ.restrict sᶜ))

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
(f g : α → E)
[DecidablePred fun x => x ∈ s]
(hs : MeasurableSet s)

MeasureTheory.eLpNorm (s.piecewise f g) ⊤ μ =
  max (MeasureTheory.eLpNorm f ⊤ (μ.restrict s)) (MeasureTheory.eLpNorm g ⊤ (μ.restrict sᶜ))


@[simp]
theorem cancel_right {g₁ g₂ : FrameHom β γ} {f : FrameHom α β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[CompleteLattice α]
[CompleteLattice β]
[CompleteLattice γ]
{g₁ g₂ : FrameHom β γ}
{f : FrameHom α β}
(hf : Function.Surjective ⇑f)


@[simp]
theorem sigmaFinsuppEquivDFinsupp_add [AddZeroClass N] (f g : (Σi, η i) →₀ N) :
    sigmaFinsuppEquivDFinsupp (f + g) =
      (sigmaFinsuppEquivDFinsupp f + sigmaFinsuppEquivDFinsupp g : Π₀ i : ι, η i →₀ N)

{ι : Type u_1}
{η : ι → Type u_4}
{N : Type u_5}
[AddZeroClass N]
(f g : (i : ι) × η i →₀ N)

sigmaFinsuppEquivDFinsupp (f + g) = sigmaFinsuppEquivDFinsupp f + sigmaFinsuppEquivDFinsupp g


theorem sum_finsupport' (hx₀ : x₀ ∈ s) {I : Finset ι} (hI : ρ.finsupport x₀ ⊆ I) :
    ∑ i ∈ I, ρ i x₀ = 1

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(ρ : PartitionOfUnity ι X s)
{x₀ : X}
(hx₀ : x₀ ∈ s)
{I : Finset ι}
(hI : ρ.finsupport x₀ ⊆ I)


theorem cyclotomicRing_isIntegralClosure_of_prime :
    IsIntegralClosure (CyclotomicRing p ℤ ℚ) ℤ (CyclotomicField p ℚ)


theorem bex_def : (∃ (x : _) (_ : p x), q x) ↔ ∃ x, p x ∧ q x


theorem Perm.diff_right {l₁ l₂ : List α} (t : List α) (h : l₁ ~ l₂) : l₁.diff t ~ l₂.diff t

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


theorem NeBot.comap_of_image_mem {f : Filter β} {m : α → β} (hf : NeBot f) {s : Set α}
    (hs : m '' s ∈ f) : NeBot (comap m f)

{α : Type u}
{β : Type v}
{f : Filter β}
{m : α → β}
(hf : f.NeBot)
{s : Set α}
(hs : m '' s ∈ f)


@[to_additive]
theorem mem_leftTransversals_iff_existsUnique_inv_mul_mem :
    S ∈ leftTransversals T ↔ ∀ g : G, ∃! s : S, (s : G)⁻¹ * g ∈ T

S ∈ Subgroup.leftTransversals T ↔ ∀ (g : G), ∃! s, (↑s)⁻¹ * g ∈ T


lemma AntitoneOn.image_Ici_subset (h : AntitoneOn f (Ici a)) : f '' Ici a ⊆ Iic (f a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : AntitoneOn f (Set.Ici a))


/-- Product of a multiset of elements in a subgroup of a `CommGroup` is in the subgroup. -/
@[to_additive "Sum of a multiset of elements in an `AddSubgroup` of an `AddCommGroup` is in
 the `AddSubgroup`."]
protected theorem multiset_prod_mem {G} [CommGroup G] (K : Subgroup G) (g : Multiset G) :
    (∀ a ∈ g, a ∈ K) → g.prod ∈ K

{G : Type u_3}
[AddCommGroup G]
(K : AddSubgroup G)
(g : Multiset G)


theorem Nat.pow_add_pow {x y : ℕ} (hxy : p ∣ x + y) (hx : ¬p ∣ x) {n : ℕ} (hn : Odd n) :
    multiplicity p (x ^ n + y ^ n) = multiplicity p (x + y) + multiplicity p n

{p : ℕ}
(hp : Nat.Prime p)
(hp1 : Odd p)
{x y : ℕ}
(hxy : p ∣ x + y)
(hx : ¬p ∣ x)
{n : ℕ}
(hn : Odd n)


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

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

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


@[to_additive]
theorem mem_carrier {s : Submonoid M} {x : M} : x ∈ s.carrier ↔ x ∈ s

{M : Type u_1}
[AddZeroClass M]
{s : AddSubmonoid M}
{x : M}


@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B


/-- Equivalence of multiplicative ring norms is transitive. -/
lemma equiv_trans {f g k : MulRingNorm R} (hfg : equiv f g) (hgk : equiv g k) :
    equiv f k

{R : Type u_4}
[Ring R]
{f g k : MulRingNorm R}
(hfg : f.equiv g)
(hgk : g.equiv k)


/-- The category of algebras over an additive monad on a preadditive category is preadditive. -/
@[simps]
instance Monad.algebraPreadditive : Preadditive (Monad.Algebra T)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(T : CategoryTheory.Monad C)
[T.Additive]
(F G : T.Algebra)
(α : F ⟶ G)


@[simp]
theorem edgeSet_sdiff : (G₁ \ G₂).edgeSet = G₁.edgeSet \ G₂.edgeSet


@[simp]
lemma coe_smul {r : R} {x : I} : (r • x : R) = r * (x : R)

{R : Type u_1}
[Ring R]
(I : TwoSidedIdeal R)
{r : R}
{x : ↥I}


/-- If a discrete group acts on a T2 and first-countable space `X`,
then the action is properly discontinuous if and only if it is continuous in the second variable
and proper. -/
theorem FirstCountableTopology.properlyDiscontinuousSMul_iff_properSMul [T2Space X]
    [FirstCountableTopology X] [DiscreteTopology G] [ContinuousConstSMul G X] :
    ProperlyDiscontinuousSMul G X ↔ ProperSMul G X

{G : Type u_1}
{X : Type u_2}
[Group G]
[MulAction G X]
[TopologicalSpace G]
[TopologicalSpace X]
[T2Space X]
[FirstCountableTopology X]
[DiscreteTopology G]
[ContinuousConstSMul G X]


theorem onFun {α β : Sort*} {r : β → β → Prop} {f : α → β} :
    WellFounded r → WellFounded (r on f)

{α : Sort u_4}
{β : Sort u_5}
{r : β → β → Prop}
{f : α → β}


/-- Morphisms of short complexes are the commutative diagrams of the obvious shape. -/
@[ext]
structure Hom (S₁ S₂ : ShortComplex C) where
  /-- the morphism on the left objects -/
  τ₁ : S₁.X₁ ⟶ S₂.X₁
  /-- the morphism on the middle objects -/
  τ₂ : S₁.X₂ ⟶ S₂.X₂
  /-- the morphism on the right objects -/
  τ₃ : S₁.X₃ ⟶ S₂.X₃
  /-- the left commutative square of a morphism in `ShortComplex` -/
  comm₁₂ : τ₁ ≫ S₂.f = S₁.f ≫ τ₂ := by aesop_cat
  /-- the right commutative square of a morphism in `ShortComplex` -/
  comm₂₃ : τ₂ ≫ S₂.g = S₁.g ≫ τ₃ := by aesop_cat

CategoryTheory.CategoryStruct.comp self.τ₂ S₂.g = CategoryTheory.CategoryStruct.comp S₁.g self.τ₃


/-- A circular order is the analogue of a linear order where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic, antisymmetric and total.
`sbtw` is transitive. -/
class CircularOrder (α : Type*) extends CircularPartialOrder α where
  /-- For any triple of points, the second is between the other two one way or another. -/
  btw_total : ∀ a b c : α, btw a b c ∨ btw c b a

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


theorem span_sup : span R s ⊔ p = span R (s ∪ p)

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)
{s : Set M}

Submodule.span R s ⊔ p = Submodule.span R (s ∪ ↑p)


@[simp] lemma reverse_apply (p : RelSeries r) (i : Fin (p.length + 1)) :
    p.reverse i = p i.rev

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(i : Fin (p.length + 1))


/-- Consider a sigma-compact group acting continuously and transitively on a Baire space. Then
the orbit map is open around the identity. It follows in `isOpenMap_smul_of_sigmaCompact` that it
is open around any point. -/
@[to_additive "Consider a sigma-compact additive group acting continuously and transitively on a
Baire space. Then the orbit map is open around zero. It follows in
`isOpenMap_vadd_of_sigmaCompact` that it is open around any point."]
theorem smul_singleton_mem_nhds_of_sigmaCompact
    {U : Set G} (hU : U ∈ 𝓝 1) (x : X) : U • {x} ∈ 𝓝 x

{G : Type u_1}
{X : Type u_2}
[TopologicalSpace G]
[TopologicalSpace X]
[AddGroup G]
[TopologicalAddGroup G]
[AddAction G X]
[SigmaCompactSpace G]
[BaireSpace X]
[T2Space X]
[ContinuousVAdd G X]
[AddAction.IsPretransitive G X]
{U : Set G}
(hU : U ∈ 𝓝 0)
(x : X)


@[simp]
theorem subtypeEquiv_trans {p : α → Prop} {q : β → Prop} {r : γ → Prop} (e : α ≃ β) (f : β ≃ γ)
    (h : ∀ a : α, p a ↔ q (e a)) (h' : ∀ b : β, q b ↔ r (f b)) :
    (e.subtypeEquiv h).trans (f.subtypeEquiv h')
    = (e.trans f).subtypeEquiv fun a => (h a).trans (h' <| e a)

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{p : α → Prop}
{q : β → Prop}
{r : γ → Prop}
(e : α ≃ β)
(f : β ≃ γ)
(h : ∀ (a : α), p a ↔ q (e a))
(h' : ∀ (b : β), q b ↔ r (f b))

(e.subtypeEquiv h).trans (f.subtypeEquiv h') = (e.trans f).subtypeEquiv ⋯


@[simp]
theorem PreservesPullback.iso_hom : (PreservesPullback.iso G f g).hom = pullbackComparison G f g

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) G]

[CategoryTheory.Limits.HasPullback (G.map f) (G.map g)]

(CategoryTheory.Limits.PreservesPullback.iso G f g).hom = CategoryTheory.Limits.pullbackComparison G f g


@[simp]
theorem coe_sub (f g : Poly α) : ⇑(f - g) = f - g


@[to_additive]
theorem prehaar_nonneg (K₀ : PositiveCompacts G) {U : Set G} (K : Compacts G) :
    0 ≤ prehaar (K₀ : Set G) U K

(K₀ : TopologicalSpace.PositiveCompacts G)

0 ≤ MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K


theorem Ioc.infinite : Infinite (Ioc a b)

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


theorem cof_ne_zero {o} : cof o ≠ 0 ↔ o ≠ 0


protected theorem NormedSpace.unbounded_univ : ¬Bornology.IsBounded (univ : Set E)

(𝕜 : Type u_1)
(E : Type u_3)
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[Nontrivial E]


theorem t1Space_TFAE (X : Type u) [TopologicalSpace X] :
    List.TFAE [T1Space X,
      ∀ x, IsClosed ({ x } : Set X),
      ∀ x, IsOpen ({ x }ᶜ : Set X),
      Continuous (@CofiniteTopology.of X),
      ∀ ⦃x y : X⦄, x ≠ y → {y}ᶜ ∈ 𝓝 x,
      ∀ ⦃x y : X⦄, x ≠ y → ∃ s ∈ 𝓝 x, y ∉ s,
      ∀ ⦃x y : X⦄, x ≠ y → ∃ U : Set X, IsOpen U ∧ x ∈ U ∧ y ∉ U,
      ∀ ⦃x y : X⦄, x ≠ y → Disjoint (𝓝 x) (pure y),
      ∀ ⦃x y : X⦄, x ≠ y → Disjoint (pure x) (𝓝 y),
      ∀ ⦃x y : X⦄, x ⤳ y → x = y]

[T1Space X, ∀ (x : X), IsClosed {x}, ∀ (x : X), IsOpen {x}ᶜ, Continuous ⇑CofiniteTopology.of,
    ∀ ⦃x y : X⦄, x ≠ y → {y}ᶜ ∈ 𝓝 x, ∀ ⦃x y : X⦄, x ≠ y → ∃ s ∈ 𝓝 x, y ∉ s,
    ∀ ⦃x y : X⦄, x ≠ y → ∃ U, IsOpen U ∧ x ∈ U ∧ y ∉ U, ∀ ⦃x y : X⦄, x ≠ y → Disjoint (𝓝 x) (pure y),
    ∀ ⦃x y : X⦄, x ≠ y → Disjoint (pure x) (𝓝 y), ∀ ⦃x y : X⦄, x ⤳ y → x = y].TFAE


/-- The separable degree of an irreducible polynomial divides its degree. -/
theorem natSepDegree_dvd_natDegree (h : Irreducible f) :
    f.natSepDegree ∣ f.natDegree

{F : Type u}
[Field F]
{f : F[X]}
(h : Irreducible f)


@[to_additive]
theorem closure_iUnion {ι} (s : ι → Set M) : closure (⋃ i, s i) = ⨆ i, closure (s i)

{M : Type u_1}
[MulOneClass M]
{ι : Sort u_4}
(s : ι → Set M)

Submonoid.closure (⋃ i, s i) = ⨆ i, Submonoid.closure (s i)


theorem update_sup [∀ i, SemilatticeSup (π i)] (f : ∀ i, π i) (i : ι) (a b : π i) :
    update f i (a ⊔ b) = update f i a ⊔ update f i b

{ι : Type u_1}
{π : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → SemilatticeSup (π i)]
(f : (i : ι) → π i)
(i : ι)
(a b : π i)

Function.update f i (a ⊔ b) = Function.update f i a ⊔ Function.update f i b


theorem inl_injective : Function.Injective (inl : α → α ⊕ β)


/-- To prove Fermat Last Theorem in any semiring that is a `NormalizedGCDMonoid` one can assume
that the `gcd` of `{a, b, c}` is `1`. -/
lemma fermatLastTheoremWith_of_fermatLastTheoremWith_coprime {n : ℕ} {R : Type*} [CommSemiring R]
    [IsDomain R] [DecidableEq R] [NormalizedGCDMonoid R]
    (hn : ∀ a b c : R, a ≠ 0 → b ≠ 0 → c ≠ 0 → ({a, b, c} : Finset R).gcd id = 1 →
      a ^ n + b ^ n ≠ c ^ n) :
    FermatLastTheoremWith R n

(hn : ∀ (a b c : R), a ≠ 0 → b ≠ 0 → c ≠ 0 → {a, b, c}.gcd id = 1 → a ^ n + b ^ n ≠ c ^ n)


@[simp]
lemma mapMap_id : mapMap (𝟙 X) p = 𝟙 _

{I : Type u_1}
{J : Type u_2}
{C : Type u_4}
[CategoryTheory.Category.{u_5, u_4} C]
(X : CategoryTheory.GradedObject I C)
(p : I → J)
[X.HasMap p]

CategoryTheory.GradedObject.mapMap (CategoryTheory.CategoryStruct.id X) p =
  CategoryTheory.CategoryStruct.id (X.mapObj p)


@[simp] theorem runK_monadLift [Monad m] [MonadLiftT n m] (x : n α) (s : σ) (k : α → σ → m β)
    : (monadLift x : StateCpsT σ m α).runK s k = (monadLift x : m α) >>= (k . s)

{α σ : Type u}
{m : Type u → Type v}
{n : Type u → Type u_1}
{β : Type u}
[Monad m]
[MonadLiftT n m]
(x : n α)
(s : σ)
(k : α → σ → m β)

(monadLift x).runK s k = do
  let x ← monadLift x
  k x s


theorem ne_zero_of_out_nonempty (o : Ordinal) [h : Nonempty o.out.α] : o ≠ 0

(o : Ordinal.{u_3})
[h : Nonempty (Quotient.out o).α]


@[simp]
theorem modByMonicHom_root_pow (h : IsAdjoinRootMonic S f) {n : ℕ} (hdeg : n < natDegree f) :
    h.modByMonicHom (h.root ^ n) = X ^ n

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
{n : ℕ}
(hdeg : n < f.natDegree)

h.modByMonicHom (h.root ^ n) = Polynomial.X ^ n


@[simp]
theorem relNorm_bot : relNorm R (⊥ : Ideal S) = ⊥

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


@[simp]
theorem birkhoffSum_one' (f : α → α) (g : α → M) : birkhoffSum f g 1 = g

{α : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
(f : α → α)
(g : α → M)


@[to_additive]
theorem le_centralizer_iff : H ≤ centralizer K ↔ K ≤ centralizer H

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

H ≤ AddSubgroup.centralizer ↑K ↔ K ≤ AddSubgroup.centralizer ↑H


theorem Set.Finite.continuousOn [T1Space X] [TopologicalSpace Y] {s : Set X} (hs : s.Finite)
    (f : X → Y) : ContinuousOn f s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[T1Space X]
[TopologicalSpace Y]
{s : Set X}
(hs : s.Finite)
(f : X → Y)


/-- The cone of `F` corresponding to an element in `(F ⋙ coyoneda.obj X).sections`. -/
@[simps]
def Limits.coneOfSectionCompCoyoneda (F : J ⥤ C) (X : Cᵒᵖ)
    (s : (F ⋙ coyoneda.obj X).sections) : Cone F

(s : ↑(F ⋙ CategoryTheory.coyoneda.obj X).sections)

(CategoryTheory.Limits.coneOfSectionCompCoyoneda F X s).π =
  (CategoryTheory.Limits.compCoyonedaSectionsEquiv F (Opposite.unop X)) s


/-- A natural transformation between functors induces a functor between the categories of elements.
-/
@[simps]
def map {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : F₁.Elements ⥤ F₂.Elements

{F₁ F₂ : CategoryTheory.Functor C (Type w)}

↑((CategoryTheory.CategoryOfElements.map α).map k) = ↑k


theorem coe_of_s_rat_eq : ((of q).s.map (Pair.map ((↑))) : Stream'.Seq <| Pair K) = (of v).s

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}
{q : ℚ}
(v_eq_q : v = ↑q)

Stream'.Seq.map (GenContFract.Pair.map Rat.cast) (GenContFract.of q).s = (GenContFract.of v).s


@[to_additive]
lemma zpow_neg_coe_of_pos (a : G) : ∀ {n : ℕ}, 0 < n → a ^ (-(n : ℤ)) = (a ^ n)⁻¹

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


@[to_additive] lemma eq_or_eq_inv_of_mabs_eq (h : |a|ₘ = b) : a = b ∨ a = b⁻¹

{α : Type u_1}
[Group α]
[LinearOrder α]
{a b : α}
(h : mabs a = b)


@[to_additive]
theorem smul_iInter_subset (s : Set α) (t : ι → Set β) : (s • ⋂ i, t i) ⊆ ⋂ i, s • t i

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


/-- **Removable singularity** theorem: if a function `f : ℂ → E` is complex differentiable on a
punctured neighborhood of `c` and $f(z) - f(c)=o((z-c)^{-1})$, then `f` has a limit at `c`. -/
theorem tendsto_limUnder_of_differentiable_on_punctured_nhds_of_isLittleO {f : ℂ → E} {c : ℂ}
    (hd : ∀ᶠ z in 𝓝[≠] c, DifferentiableAt ℂ f z)
    (ho : (fun z => f z - f c) =o[𝓝[≠] c] fun z => (z - c)⁻¹) :
    Tendsto f (𝓝[≠] c) (𝓝 <| limUnder (𝓝[≠] c) f)

(hd : ∀ᶠ (z : ℂ) in 𝓝[≠] c, DifferentiableAt ℂ f z)

Filter.Tendsto f (𝓝[≠] c) (𝓝 (limUnder (𝓝[≠] c) f))


theorem gramSchmidtOrthonormalBasis_det [DecidableEq ι] :
    (gramSchmidtOrthonormalBasis h f).toBasis.det f =
      ∏ i, ⟪gramSchmidtOrthonormalBasis h f i, f i⟫

(h : FiniteDimensional.finrank 𝕜 E = Fintype.card ι)

(gramSchmidtOrthonormalBasis h f).toBasis.det f = ∏ i : ι, ⟪(gramSchmidtOrthonormalBasis h f) i, f i⟫_𝕜


@[simp]
theorem univ_unique [Unique α] : (univ : Finset α) = {default}


protected lemma trans (hr : ∀ (a : α) (b : β) (c : γ), r₁₂ a b → r₂₃ b c → r₁₃ a c) :
    LeftTotal r₁₂ → LeftTotal r₂₃ → LeftTotal r₁₃

Relator.LeftTotal r₁₂ → Relator.LeftTotal r₂₃ → Relator.LeftTotal r₁₃


theorem iInf₂_comm {ι₁ ι₂ : Sort*} {κ₁ : ι₁ → Sort*} {κ₂ : ι₂ → Sort*}
    (f : ∀ i₁, κ₁ i₁ → ∀ i₂, κ₂ i₂ → α) :
    ⨅ (i₁) (j₁) (i₂) (j₂), f i₁ j₁ i₂ j₂ = ⨅ (i₂) (j₂) (i₁) (j₁), f i₁ j₁ i₂ j₂

(f : (i₁ : ι₁) → κ₁ i₁ → (i₂ : ι₂) → κ₂ i₂ → α)

⨅ i₁, ⨅ j₁, ⨅ i₂, ⨅ j₂, f i₁ j₁ i₂ j₂ = ⨅ i₂, ⨅ j₂, ⨅ i₁, ⨅ j₁, f i₁ j₁ i₂ j₂


@[simp]
theorem of_f {i j hij x} : of R ι G f j (f i j hij x) = of R ι G f i x

{R : Type u}
[Ring R]
{ι : Type v}
[Preorder ι]
{G : ι → Type w}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
{f : (i j : ι) → i ≤ j → G i →ₗ[R] G j}
[DecidableEq ι]
{i j : ι}
{hij : i ≤ j}
{x : G i}

(Module.DirectLimit.of R ι G f j) ((f i j hij) x) = (Module.DirectLimit.of R ι G f i) x


@[to_additive]
theorem measurePreserving_mul_left (μ : Measure G) [IsMulLeftInvariant μ] (g : G) :
    MeasurePreserving (g * ·) μ μ

{G : Type u_2}
[MeasurableSpace G]
[Add G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddLeftInvariant]
(g : G)

MeasureTheory.MeasurePreserving (fun x => g + x) μ μ


@[gcongr]
theorem sqrt_le_sqrt (h : x ≤ y) : √x ≤ √y


@[simp]
theorem neLocus_add_right [AddRightCancelMonoid N] (f g h : α →₀ N) :
    (f + h).neLocus (g + h) = f.neLocus g

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddRightCancelMonoid N]
(f g h : α →₀ N)


lemma commShiftOfLocalization_iso_inv_app (a : A) (X : C) :
    letI := Functor.commShiftOfLocalization L W A F F'
    (F'.commShiftIso a).inv.app (L.obj X) =
      (shiftFunctor E a).map ((Lifting.iso L W F F').hom.app X) ≫
      (F.commShiftIso a).inv.app X ≫ (Lifting.iso L W F F').inv.app (X⟦a⟧) ≫
     F'.map ((L.commShiftIso a).hom.app X)

[CategoryTheory.Localization.Lifting L W F F']

(F'.commShiftIso a).inv.app (L.obj X) =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctor E a).map ((CategoryTheory.Localization.Lifting.iso L W F F').hom.app X))
    (CategoryTheory.CategoryStruct.comp ((F.commShiftIso a).inv.app X)
      (CategoryTheory.CategoryStruct.comp
        ((CategoryTheory.Localization.Lifting.iso L W F F').inv.app ((CategoryTheory.shiftFunctor C a).obj X))
        (F'.map ((L.commShiftIso a).hom.app X))))


/-- In a noncommutative ordered `*`-algebra over ℝ,
Tsirelson's bound for a CHSH tuple (A₀, A₁, B₀, B₁) is
`A₀ * B₀ + A₀ * B₁ + A₁ * B₀ - A₁ * B₁ ≤ 2^(3/2) • 1`.

We prove this by providing an explicit sum-of-squares decomposition
of the difference.

(We could work over `ℤ[2^(1/2), 2^(-1/2)]` if we really wanted to!)
-/
theorem tsirelson_inequality [OrderedRing R] [StarRing R] [StarOrderedRing R] [Algebra ℝ R]
    [OrderedSMul ℝ R] [StarModule ℝ R] (A₀ A₁ B₀ B₁ : R) (T : IsCHSHTuple A₀ A₁ B₀ B₁) :
    A₀ * B₀ + A₀ * B₁ + A₁ * B₀ - A₁ * B₁ ≤ √2 ^ 3 • (1 : R)

{R : Type u}
[OrderedRing R]
[StarRing R]
[StarOrderedRing R]
[Algebra ℝ R]
[OrderedSMul ℝ R]
[StarModule ℝ R]
(A₀ A₁ B₀ B₁ : R)
(T : IsCHSHTuple A₀ A₁ B₀ B₁)

A₀ * B₀ + A₀ * B₁ + A₁ * B₀ - A₁ * B₁ ≤ √2 ^ 3 • 1


lemma dual_injective :
    Function.Injective (dual A K : FractionalIdeal B⁰ L → FractionalIdeal B⁰ L)

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]

Function.Injective (FractionalIdeal.dual A K)


theorem Int.ceil_toNat (a : α) : ⌈a⌉.toNat = ⌈a⌉₊

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


@[to_additive (attr := simp)]
theorem smul_set_ae_le (c : G) {s t : Set α} : c • s ≤ᵐ[μ] c • t ↔ s ≤ᵐ[μ] t

[MeasureTheory.VAddInvariantMeasure G α μ]


lemma Γevaluation_ne_zero_iff_mem_basicOpen (x : X) (f : X.presheaf.obj (op ⊤)) :
    X.Γevaluation x f ≠ 0 ↔ x ∈ X.toRingedSpace.basicOpen f

(X.Γevaluation x) f ≠ 0 ↔ x ∈ X.toRingedSpace.basicOpen f


theorem ContMDiffOn.mdifferentiableOn (hf : ContMDiffOn I I' n f s) (hn : 1 ≤ n) :
    MDifferentiableOn I I' 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 : ℕ∞}
(hf : ContMDiffOn I I' n f s)
(hn : 1 ≤ n)


/--
Given a natural isomorphism `G ⋙ ℱ ≅ G ⋙ ℱ'` between presheaves of arbitrary category,
where `G` is locally-full and cover-dense, and `ℱ', ℱ` are sheaves,
we may obtain a natural isomorphism between presheaves.
-/
@[simps]
noncomputable def sheafIso {ℱ ℱ' : Sheaf K A} (i : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val) : ℱ ≅ ℱ'

{K : CategoryTheory.GrothendieckTopology D}

(i : G.op.comp ℱ.val ≅ G.op.comp ℱ'.val)

(CategoryTheory.Functor.IsCoverDense.sheafIso i).inv.val = (CategoryTheory.Functor.IsCoverDense.presheafIso i).inv


@[elab_as_elim]
protected theorem ind₂
    {motive : Quotient s₁ → Quotient s₂ → Prop}
    (h : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))
    (q₁ : Quotient s₁)
    (q₂ : Quotient s₂)
    : motive q₁ q₂

(h : ∀ (a : α) (b : β), motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))


@[simp]
theorem symm_dual_comp (g : sInfHom βᵒᵈ γᵒᵈ) (f : sInfHom αᵒᵈ βᵒᵈ) :
    sSupHom.dual.symm (g.comp f) = (sSupHom.dual.symm g).comp (sSupHom.dual.symm f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SupSet α]
[SupSet β]
[SupSet γ]
(g : sInfHom βᵒᵈ γᵒᵈ)
(f : sInfHom αᵒᵈ βᵒᵈ)


private lemma isCoprime_y_z : IsCoprime S.y S.z

(S : FermatLastTheoremForThreeGen.Solution hζ)

IsCoprime (FermatLastTheoremForThreeGen.Solution.y S) (FermatLastTheoremForThreeGen.Solution.z S)


theorem StrictConcaveOn.comp_strictConvexOn (hg : StrictConcaveOn 𝕜 (f '' s) g)
    (hf : StrictConvexOn 𝕜 s f) (hg' : StrictAntiOn g (f '' s)) (hf' : s.InjOn f) :
    StrictConcaveOn 𝕜 s (g ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{α : Type u_4}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 α]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
{g : β → α}
(hg : StrictConcaveOn 𝕜 (f '' s) g)
(hf : StrictConvexOn 𝕜 s f)
(hg' : StrictAntiOn g (f '' s))
(hf' : Set.InjOn f s)


/-- The function `expNegInvGlue` is nonnegative. -/
theorem nonneg (x : ℝ) : 0 ≤ expNegInvGlue x


lemma Rel'.symm {x y : X₁ ⊕ X₂} (h : Rel' f g x y) :
    Rel' f g y x

(h : CategoryTheory.Limits.Types.Pushout.Rel' f g x y)

CategoryTheory.Limits.Types.Pushout.Rel' f g y x


/-- A version of `Homeomorph.mulLeft a b⁻¹` that is defeq to `a / b`. -/
@[to_additive (attr := simps! (config := { simpRhs := true }))
  " A version of `Homeomorph.addLeft a (-b)` that is defeq to `a - b`. "]
def Homeomorph.divLeft (x : G) : G ≃ₜ G

{G : Type w}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
(x b : G)


@[simp]
theorem linearization_μ_hom (X Y : Action (Type u) (MonCat.of G)) :
    ((linearization k G).μ X Y).hom = (finsuppTensorFinsupp' k X.V Y.V).toLinearMap

{k G : Type u}
[CommRing k]
[Monoid G]
(X Y : Action (Type u) (MonCat.of G))

((Rep.linearization k G).μ X Y).hom = ↑(finsuppTensorFinsupp' k X.V Y.V)


/-- The cardinality of the fiber is preserved under isomorphisms. -/
lemma card_fiber_eq_of_iso {X Y : C} (i : X ≅ Y) : Nat.card (F.obj X) = Nat.card (F.obj Y)

(F : CategoryTheory.Functor C FintypeCat)

Nat.card ↑(F.obj X) = Nat.card ↑(F.obj Y)


@[to_additive coe_prod]
theorem coe_prod (f : M →ₙ* N) (g : M →ₙ* P) : ⇑(f.prod g) = Pi.prod f g

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[Add M]
[Add N]
[Add P]
(f : AddHom M N)
(g : AddHom M P)


theorem sigmaToiUnion_bijective (h : Pairwise fun i j => Disjoint (t i) (t j)) :
    Bijective (sigmaToiUnion t)


@[to_additive norm_toNNReal]
theorem norm_toNNReal' : ‖a‖.toNNReal = ‖a‖₊

{E : Type u_6}
[SeminormedAddGroup E]
{a : E}


lemma exp_neg (x : EReal) : exp (-x) = (exp x)⁻¹


/-- Every coefficient in the Cantor normal form `CNF b o` is less than `b`. -/
theorem CNF_snd_lt {b o : Ordinal.{u}} (hb : 1 < b) {x : Ordinal × Ordinal} :
    x ∈ CNF b o → x.2 < b

{b o : Ordinal.{u}}
(hb : 1 < b)
{x : Ordinal.{u} × Ordinal.{u}}


/-- A family of submodules in a commutative `R`-algebra `A` is a submodules basis if it satisfies
some axioms ensuring there is a topology on `A` which is compatible with the ring structure and
admits this family as a basis of neighborhoods of zero. -/
structure SubmodulesRingBasis (B : ι → Submodule R A) : Prop where
  /-- Condition for `B` to be a filter basis on `A`. -/
  inter : ∀ i j, ∃ k, B k ≤ B i ⊓ B j
  /-- For any element `a : A` and any set `B` in the submodule basis on `A`,
    there is another basis element `B'` such that `a • B'` is in `B`. -/
  leftMul : ∀ (a : A) (i), ∃ j, a • B j ≤ B i
  /-- For each set `B` in the submodule basis on `A`, there is another basis element `B'` such
    that the set-theoretic product `B' * B'` is in `B`. -/
  mul : ∀ i, ∃ j, (B j : Set A) * B j ⊆ B i

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommRing R]
[CommRing A]
[Algebra R A]
{B : ι → Submodule R A}
(self : SubmodulesRingBasis B)
(i : ι)


/-- See also `finprod_eq_of_bijective`, `Fintype.prod_bijective` and `Finset.prod_bij`. -/
@[to_additive "See also `finsum_eq_of_bijective`, `Fintype.sum_bijective` and `Finset.sum_bij`."]
theorem finprod_comp {g : β → M} (e : α → β) (he₀ : Function.Bijective e) :
    (∏ᶠ i, g (e i)) = ∏ᶠ j, g j

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
{g : β → M}
(e : α → β)
(he₀ : Function.Bijective e)


theorem lipschitzOnWith_iff_dist_le_mul [PseudoMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0}
    {s : Set α} {f : α → β} :
    LipschitzOnWith K f s ↔ ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ K * dist x y

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{s : Set α}
{f : α → β}

LipschitzOnWith K f s ↔ ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ ↑K * dist x y


theorem coe_injective : Injective ((↑) : Sym α n → Multiset α)


/-- Turn a limit for `F.rightOp : J ⥤ Cᵒᵖ` into a limit for `F : Jᵒᵖ ⥤ C`. -/
@[simps]
def isColimitCoconeOfConeRightOp (F : Jᵒᵖ ⥤ C) {c : Cone F.rightOp} (hc : IsLimit c) :
    IsColimit (coconeOfConeRightOp c)

{c : CategoryTheory.Limits.Cone F.rightOp}

(CategoryTheory.Limits.isColimitCoconeOfConeRightOp F hc).desc s =
  (hc.lift (CategoryTheory.Limits.coneRightOpOfCocone s)).unop


@[simp]
theorem leadingCoeff_X_pow_add_one {n : ℕ} (hn : 0 < n) : (X ^ n + 1 : R[X]).leadingCoeff = 1

{R : Type u}
[Semiring R]
{n : ℕ}
(hn : 0 < n)


theorem compatiblePreservingOfFlat {C : Type u₁} [Category.{v₁} C] {D : Type u₁} [Category.{v₁} D]
    (K : GrothendieckTopology D) (G : C ⥤ D) [RepresentablyFlat G] : CompatiblePreserving K G

(K : CategoryTheory.GrothendieckTopology D)


lemma add_of_X_ne {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2) :
    W.add P Q = addZ P Q •
      ![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        1]

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Equation P)
(hQ : W.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2)

W.add P Q =
  WeierstrassCurve.Jacobian.addZ P Q •
    ![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
        (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
      W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
        (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
      1]


@[deprecated getElem?_range' (since := "2024-06-12")]
theorem get?_range' (s step) {m n : Nat} (h : m < n) :
    get? (range' s n step) m = some (s + step * m)

(List.range' s n step).get? m = some (s + step * m)


@[simp]
lemma algebraMap_def :
    algebraMap (MvPolynomial σ R) (MvPolynomial σ S) = MvPolynomial.map (algebraMap R S)

{R : Type u_1}
{S : Type u_2}
{σ : Type u_3}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]


@[simp]
theorem divided_by_X_pow_order_of_X_eq_one : divided_by_X_pow_order X_ne_zero = (1 : R⟦X⟧)

{R : Type u_1}
[CommRing R]
[IsDomain R]

PowerSeries.divided_by_X_pow_order ⋯ = 1


theorem ae_le_of_forall_setIntegral_le {f g : α → ℝ} (hf : Integrable f μ) (hg : Integrable g μ)
    (hf_le : ∀ s, MeasurableSet s → μ s < ∞ → (∫ x in s, f x ∂μ) ≤ ∫ x in s, g x ∂μ) :
    f ≤ᵐ[μ] g

(hf_le : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, f x ∂μ ≤ ∫ (x : α) in s, g x ∂μ)


@[simp] theorem add_mul_emod_self {a b c : Int} : (a + b * c) % c = a % c


@[simp]
theorem pow_dvd_pow_iff {n : ℕ} (hn : n ≠ 0) {a b : R} : a ^ n ∣ b ^ n ↔ a ∣ b

{R : Type u_1}
[CommRing R]
[id : IsDomain R]
[iic : IsIntegrallyClosed R]
{n : ℕ}
(hn : n ≠ 0)
{a b : R}


@[simp]
theorem restrict_empty (f : α →ₛ β) : restrict f ∅ = 0

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]
(f : MeasureTheory.SimpleFunc α β)


theorem foldl_const (f : α → α) (a : α) (l : List β) :
    l.foldl (fun b _ ↦ f b) a = f^[l.length] a

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

List.foldl (fun b x => f b) a l = f^[l.length] a


/-- While `simp` can prove this, it is often convenient to avoid unfolding `lsum` into `sumAddHom`
with `DFinsupp.lsum_apply_apply`. -/
theorem lsum_single [Semiring S] [Module S N] [SMulCommClass R S N] (F : ∀ i, M i →ₗ[R] N) (i)
    (x : M i) : lsum S (M := M) F (single i x) = F i x

{ι : Type u_1}
{R : Type u_2}
(S : Type u_3)
{M : ι → Type u_4}
{N : Type u_5}
[Semiring R]
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
[AddCommMonoid N]
[Module R N]
[DecidableEq ι]
[Semiring S]
[Module S N]
[SMulCommClass R S N]
(F : (i : ι) → M i →ₗ[R] N)
(i : ι)
(x : M i)

((DFinsupp.lsum S) F) (DFinsupp.single i x) = (F i) x


/-- A representable functor is a sheaf for the canonical topology. -/
theorem isSheaf_of_representable (P : Cᵒᵖ ⥤ Type v) [P.Representable] :
    Presieve.IsSheaf (canonicalTopology C) P

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

CategoryTheory.Presieve.IsSheaf (CategoryTheory.Sheaf.canonicalTopology C) P


/-- `x ↦ x / a` as an order isomorphism. -/
@[to_additive (attr := simps!) "`x ↦ x - a` as an order isomorphism."]
def OrderIso.divRight (a : α) : α ≃o α

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


/-- Return the bound in terms of toNat. -/
theorem isLt (x : BitVec w) : x.toNat < 2^w


theorem ae_le_of_ae_le_trim {E} [LE E] {hm : m ≤ m0} {f₁ f₂ : α → E}
    (h12 : f₁ ≤ᵐ[μ.trim hm] f₂) : f₁ ≤ᵐ[μ] f₂

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_2}
[LE E]
{hm : m ≤ m0}
{f₁ f₂ : α → E}
(h12 : f₁ ≤ᵐ[μ.trim hm] f₂)


lemma measurableSet_succ_memPartition (t : ℕ → Set α) (n : ℕ) {s : Set α}
    (hs : s ∈ memPartition t n) :
    MeasurableSet[generateFrom (memPartition t (n + 1))] s

{α : Type u_1}
(t : ℕ → Set α)
(n : ℕ)
{s : Set α}
(hs : s ∈ memPartition t n)


/-- Subgroups of a group `G` are isomorphic to additive subgroups of `Additive G`. -/
@[simps!]
def Subgroup.toAddSubgroup : Subgroup G ≃o AddSubgroup (Additive G)

{G : Type u_1}
[Group G]
(S : AddSubgroup (Additive G))

↑((RelIso.symm Subgroup.toAddSubgroup) S) = ⇑Multiplicative.toAdd ⁻¹' ↑S


lemma withDensity_rnDeriv_eq_zero_iff_measure_eq_zero (κ η : Kernel α γ)
    [IsFiniteKernel κ] [IsFiniteKernel η] (a : α) :
    withDensity η (rnDeriv κ η) a = 0 ↔ κ a (mutuallySingularSetSlice κ η a)ᶜ = 0

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

(η.withDensity (κ.rnDeriv η)) a = 0 ↔ (κ a) (κ.mutuallySingularSetSlice η a)ᶜ = 0


@[simp]
theorem fract_nonneg (a : α) : 0 ≤ fract a

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


theorem InfiniteNeg.neg {x : ℝ*} : InfiniteNeg x → InfinitePos (-x)


theorem toSubmonoid_injective : Function.Injective (fun s : Subring R => s.toSubmonoid)

Function.Injective fun s => s.toSubmonoid


theorem edgeDensity_le_one (s : Finset α) (t : Finset β) : edgeDensity r s t ≤ 1

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


theorem CPolynomialOn.add {s : Set E} (hf : CPolynomialOn 𝕜 f s) (hg : CPolynomialOn 𝕜 g s) :
    CPolynomialOn 𝕜 (f + g) s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hf : CPolynomialOn 𝕜 f s)
(hg : CPolynomialOn 𝕜 g s)


@[simp] theorem mem_replicate {a b : α} : ∀ {n}, b ∈ replicate n a ↔ n ≠ 0 ∧ b = a


@[simp] theorem pow_eq {m n : Nat} : m.pow n = m ^ n


theorem mem_iInf_of_iInter {ι} {s : ι → Filter α} {U : Set α} {I : Set ι} (I_fin : I.Finite)
    {V : I → Set α} (hV : ∀ i, V i ∈ s i) (hU : ⋂ i, V i ⊆ U) : U ∈ ⨅ i, s i

{α : Type u}
{ι : Type u_2}
{s : ι → Filter α}
{U : Set α}
{I : Set ι}
(I_fin : I.Finite)
{V : ↑I → Set α}
(hV : ∀ (i : ↑I), V i ∈ s ↑i)
(hU : ⋂ i, V i ⊆ U)


{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}


@[simp]
theorem restrictScalars_zero : (0 : M →L[A] M₂).restrictScalars R = 0

{A : Type u_1}
{M : Type u_2}
{M₂ : Type u_3}
[Ring A]
[AddCommGroup M]
[AddCommGroup M₂]
[Module A M]
[Module A M₂]
[TopologicalSpace M]
[TopologicalSpace M₂]
{R : Type u_4}
[Ring R]
[Module R M]
[Module R M₂]
[LinearMap.CompatibleSMul M M₂ R A]

ContinuousLinearMap.restrictScalars R 0 = 0


/-- The category of single and double intersections of the `U i` maps into the category
of open sets below some `U i`.
-/
@[simps]
def pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U

{X : TopCat}
{ι : Type w}
(U : ι → TopologicalSpace.Opens ↑X)

∀ (a : CategoryTheory.Pairwise ι),
  (TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover U).obj a =
    TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCoverObj U a


theorem Commute.minimalPeriod_of_comp_dvd_mul {g : α → α} (h : Commute f g) :
    minimalPeriod (f ∘ g) x ∣ minimalPeriod f x * minimalPeriod g x

{α : Type u_1}
{f : α → α}
{x : α}
{g : α → α}
(h : Function.Commute f g)

Function.minimalPeriod (f ∘ g) x ∣ Function.minimalPeriod f x * Function.minimalPeriod g x


theorem card_biUnion_le_card_mul [DecidableEq β] (s : Finset ι) (f : ι → Finset β) (n : ℕ)
    (h : ∀ a ∈ s, (f a).card ≤ n) : (s.biUnion f).card ≤ s.card * n

{ι : Type u_1}
{β : Type u_3}
[DecidableEq β]
(s : Finset ι)
(f : ι → Finset β)
(n : ℕ)
(h : ∀ a ∈ s, (f a).card ≤ n)


/-- The composition of `Ext`, as a bilinear map. -/
@[simps!]
noncomputable def bilinearComp (a b c : ℕ) (h : a + b = c) :
    Ext X Y a →+ Ext Y Z b →+ Ext X Z c

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
(X Y Z : C)
(a b c : ℕ)
(h : a + b = c)
(α : CategoryTheory.Abelian.Ext X Y a)
(β : CategoryTheory.Abelian.Ext Y Z b)

((CategoryTheory.Abelian.Ext.bilinearComp X Y Z a b c h) α) β = α.comp β h


theorem moveRight_neg {x : PGame} (i) : (-x).moveRight (toRightMovesNeg i) = -x.moveLeft i

(-x).moveRight (SetTheory.PGame.toRightMovesNeg i) = -x.moveLeft i


@[to_additive]
theorem quasiMeasurePreserving_div_left [IsMulLeftInvariant μ] (g : G) :
    QuasiMeasurePreserving (fun h : G => g / h) μ μ

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddLeftInvariant]
(g : G)

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


theorem and_or_inj_left : ∀ {m x y : Bool}, (m && x) = (m && y) → (m || x) = (m || y) → x = y


/-- If `{ m_i }` is an `R`-basis of `M`, if `{ n_i }` is an `R`-basis of `N`,
such that the family `{ m_i * n_j }` in `S` is `R`-linearly independent,
then `M` and `N` are linearly disjoint. -/
theorem of_basis_mul {κ ι : Type*} (m : Basis κ R M) (n : Basis ι R N)
    (H : LinearIndependent R fun (i : κ × ι) ↦ (m i.1).1 * (n i.2).1) : M.LinearDisjoint N

(H : LinearIndependent R fun i => ↑(m i.1) * ↑(n i.2))


theorem formPerm_apply_mem_eq_next (hl : Nodup l) (x : α) (hx : x ∈ l) :
    formPerm l x = next l x hx

{α : Type u_1}
[DecidableEq α]
{l : List α}
(hl : l.Nodup)
(x : α)
(hx : x ∈ l)


theorem det_eq_zero_of_row_eq_zero {A : Matrix n n R} (i : n) (h : ∀ j, A i j = 0) : det A = 0

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{A : Matrix n n R}
(i : n)
(h : ∀ (j : n), A i j = 0)


theorem map_ceil (f : F) (hf : StrictMono f) (a : α) : ⌈f a⌉ = ⌈a⌉

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedRing β]
[FloorRing α]
[FloorRing β]
[FunLike F α β]
[RingHomClass F α β]
(f : F)
(hf : StrictMono ⇑f)
(a : α)


@[to_additive]
nonrec theorem IsUnit.aemeasurable_const_smul_iff {c : M} (hc : IsUnit c) :
    AEMeasurable (fun x => c • f x) μ ↔ AEMeasurable f μ

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[Monoid M]
[MulAction M β]
[MeasurableSMul M β]
[MeasurableSpace α]
{f : α → β}
{μ : MeasureTheory.Measure α}
{c : M}
(hc : IsUnit c)


protected theorem eqOn : EqOn (Prod.fst ∘ e) proj e.source

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(e : Pretrivialization F proj)


theorem HasDerivAt.scomp_hasDerivWithinAt_of_eq (hg : HasDerivAt g₁ g₁' y)
    (hh : HasDerivWithinAt h h' s x) (hy : y = h x) :
    HasDerivWithinAt (g₁ ∘ h) (h' • g₁') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(x : 𝕜)
{s : Set 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{h : 𝕜 → 𝕜'}
{h' : 𝕜'}
{g₁ : 𝕜' → F}
{g₁' : F}
{y : 𝕜'}
(hg : HasDerivAt g₁ g₁' y)
(hh : HasDerivWithinAt h h' s x)
(hy : y = h x)


theorem sup_id_eq_sSup [CompleteLattice α] (s : Finset α) : s.sup id = sSup s

{α : Type u_2}
[CompleteLattice α]
(s : Finset α)


protected theorem le_div_iff_mul_le (h0 : b ≠ 0 ∨ c ≠ 0) (ht : b ≠ ∞ ∨ c ≠ ∞) :
    a ≤ c / b ↔ a * b ≤ c

{a b c : ENNReal}
(h0 : b ≠ 0 ∨ c ≠ 0)
(ht : b ≠ ⊤ ∨ c ≠ ⊤)


@[simp]
theorem pow_pOrder_smul {p : R} (hM : IsTorsion' M <| Submonoid.powers p) (x : M)
    [∀ n : ℕ, Decidable (p ^ n • x = 0)] : p ^ pOrder hM x • x = 0

(hM : Module.IsTorsion' M ↥(Submonoid.powers p))


@[to_additive]
theorem isUnit_of_mul_isUnit_left [CommMonoid M] {x y : M} (hu : IsUnit (x * y)) : IsUnit x

{M : Type u_1}
[CommMonoid M]
{x y : M}
(hu : IsUnit (x * y))


theorem toNNReal_inv (a : ℝ≥0∞) : a⁻¹.toNNReal = a.toNNReal⁻¹


@[simp]
theorem nhdsWithin_Ico_eq_nhdsWithin_Iio (h : a < b) : 𝓝[Ico a b] b = 𝓝[<] b

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


/-- `(f x)⁻¹` is analytic away from `f x = 0` -/
theorem AnalyticAt.inv {f : E → 𝕝} {x : E} (fa : AnalyticAt 𝕜 f x) (f0 : f x ≠ 0) :
    AnalyticAt 𝕜 (fun x ↦ (f x)⁻¹) x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]
{f : E → 𝕝}
{x : E}
(fa : AnalyticAt 𝕜 f x)
(f0 : f x ≠ 0)


theorem filter_erase (a : α) (s : Finset α) : filter p (erase s a) = erase (filter p s) a

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
[DecidableEq α]
(a : α)
(s : Finset α)

Finset.filter p (s.erase a) = (Finset.filter p s).erase a


/-- The character of isomorphic representations is the same. -/
theorem char_iso {V W : FDRep k G} (i : V ≅ W) : V.character = W.character

{k : Type u}
[Field k]
{G : Type u}
[Monoid G]
{V W : FDRep k G}
(i : V ≅ W)


@[to_additive (attr := simp)]
theorem snd_one [One M] [One N] : (1 : M × N).2 = 1

{M : Type u_5}
{N : Type u_6}
[One M]
[One N]


@[simp]
theorem tsum_iSup_eq {α : Type*} (a : α) {f : α → ℝ≥0∞} : (∑' b : α, ⨆ _ : a = b, f b) = f a


/-- The map `Cocycle (K⟦a⟧) L n' → Cocycle K L n` when `n + a = n'`. -/
@[simps!]
def leftUnshift {n' a : ℤ} (γ : Cocycle (K⟦a⟧) L n') (n : ℤ) (hn : n + a = n') :
    Cocycle K L n

(γ : CochainComplex.HomComplex.Cocycle ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj K) L n')

↑(γ.leftUnshift n hn) = (↑γ).leftUnshift n hn


theorem product_inter_product [DecidableEq α] [DecidableEq β] :
    s ×ˢ t ∩ s' ×ˢ t' = (s ∩ s') ×ˢ (t ∩ t')

{α : Type u_1}
{β : Type u_2}
{s s' : Finset α}
{t t' : Finset β}
[DecidableEq α]
[DecidableEq β]


@[simp]
theorem coe_prod (K : PositiveCompacts α) (L : PositiveCompacts β) :
    (K.prod L : Set (α × β)) = (K : Set α) ×ˢ (L : Set β)

(K : TopologicalSpace.PositiveCompacts α)

(L : TopologicalSpace.PositiveCompacts β)


@[to_additive]
theorem relindex_subgroupOf (hKL : K ≤ L) :
    (H.subgroupOf L).relindex (K.subgroupOf L) = H.relindex K

{G : Type u_1}
[Group G]
{H K L : Subgroup G}
(hKL : K ≤ L)


/-- **Primitive element theorem**: a finite separable field extension `E` of `F` has a
  primitive element, i.e. there is an `α ∈ E` such that `F⟮α⟯ = (⊤ : Subalgebra F E)`. -/
theorem exists_primitive_element : ∃ α : E, F⟮α⟯ = ⊤

(F : Type u_1)
(E : Type u_2)
[Field F]
[Field E]
[Algebra F E]
[FiniteDimensional F E]
[Algebra.IsSeparable F E]

∃ α, F⟮α⟯ = ⊤


theorem roots_list_prod (L : List R[X]) :
    (0 : R[X]) ∉ L → L.prod.roots = (L : Multiset R[X]).bind roots

{R : Type u}
[CommRing R]
[IsDomain R]
(L : List (Polynomial R))

0 ∉ L → L.prod.roots = (↑L).bind Polynomial.roots


theorem add_add_one_le_ack (m n : ℕ) : m + n + 1 ≤ ack m n


@[simp]
theorem zero_rmatch (x : List α) : rmatch 0 x = false

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


@[simp]
theorem ofEq_coe {φ' : M → N} (h : φ = φ') (f : X →ₑ[φ] Y) :
    (f.ofEq h).toFun = f.toFun

{M : Type u_2}
{N : Type u_3}
{φ : M → N}
{X : Type u_5}
[SMul M X]
{Y : Type u_6}
[SMul N Y]
{φ' : M → N}
(h : φ = φ')
(f : X →ₑ[φ] Y)


/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `f = μ.rnDeriv ν`.

This theorem provides the uniqueness of the `rnDeriv` in the Lebesgue decomposition
theorem, while `MeasureTheory.Measure.eq_singularPart` provides the uniqueness of the
`singularPart`. Here, the uniqueness is given in terms of the measures, while the uniqueness in
terms of the functions is given in `eq_rnDeriv`. -/
theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : ν.withDensity f = ν.withDensity (μ.rnDeriv ν)

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν s : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : Measurable f)
(hs : s ⟂ₘ ν)
(hadd : μ = s + ν.withDensity f)


theorem liftPropAt_of_liftPropWithinAt (h : LiftPropWithinAt P g s x) (hs : s ∈ 𝓝 x) :
    LiftPropAt P g x

(h : ChartedSpace.LiftPropWithinAt P g s x)


@[simp]
theorem toFinset_zero : toFinset (0 : Multiset α) = ∅


@[to_additive (attr := simp) norm_nonneg]
theorem norm_nonneg' (a : E) : 0 ≤ ‖a‖

{E : Type u_6}
[SeminormedAddGroup E]
(a : E)


/-- The `v`-adic valuation of `r ∈ R` is less than `Multiplicative.ofAdd (-n)` if and only if
`vⁿ` divides the ideal `(r)`. -/
theorem intValuation_le_pow_iff_dvd (r : R) (n : ℕ) :
    v.intValuationDef r ≤ Multiplicative.ofAdd (-(n : ℤ)) ↔ v.asIdeal ^ n ∣ Ideal.span {r}

(v : IsDedekindDomain.HeightOneSpectrum R)

v.intValuationDef r ≤ ↑(Multiplicative.ofAdd (-↑n)) ↔ v.asIdeal ^ n ∣ Ideal.span {r}


theorem isPreconnected_iff_ordConnected {s : Set α} : IsPreconnected s ↔ OrdConnected s

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{s : Set α}


lemma length_eq_list_length (l : List Char) : (String.mk l).length = l.length


@[to_additive (attr := simp)]
theorem inv_insert (a : α) (s : Set α) : (insert a s)⁻¹ = insert a⁻¹ s⁻¹

{α : Type u_2}
[InvolutiveInv α]
(a : α)
(s : Set α)


/-- The image of a commutative square by a functor. -/
@[simps]
def map (sq : Square C) (F : C ⥤ D) : Square D

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


@[simp] theorem count_cons_self (a : α) (l : List α) : count a (a :: l) = count a l + 1

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

List.count a (a :: l) = List.count a l + 1


/-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F

(X : CategoryTheory.StructuredArrow PUnit.{w + 1} F)

(CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).inverse.obj X = ⟨X.right, X.hom PUnit.unit⟩


/-- If all elements of a `Finset` satisfy the predicate `p`, a product
over `s.subtype p` equals that product over `s`. -/
@[to_additive "If all elements of a `Finset` satisfy the predicate `p`, a sum
over `s.subtype p` equals that sum over `s`."]
theorem prod_subtype_of_mem (f : α → β) {p : α → Prop} [DecidablePred p] (h : ∀ x ∈ s, p x) :
    ∏ x ∈ s.subtype p, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[CommMonoid β]
(f : α → β)
{p : α → Prop}
[DecidablePred p]
(h : ∀ x ∈ s, p x)

∏ x ∈ Finset.subtype p s, f ↑x = ∏ x ∈ s, f x


/-- If an antitone function is equal at two points, it is equal between all of them -/
theorem Antitone.eq_of_le_of_le {a₁ a₂ : α} (h_anti : Antitone f) (h_fa : f a₁ = f a₂) {i : α}
    (h₁ : a₁ ≤ i) (h₂ : i ≤ a₂) : f i = f a₁

{α : Type u}
{β : Type v}
[LinearOrder α]
[PartialOrder β]
{f : α → β}
{a₁ a₂ : α}
(h_anti : Antitone f)
(h_fa : f a₁ = f a₂)
{i : α}
(h₁ : a₁ ≤ i)
(h₂ : i ≤ a₂)


theorem vec2_add [Add α] (a₀ a₁ b₀ b₁ : α) : ![a₀, a₁] + ![b₀, b₁] = ![a₀ + b₀, a₁ + b₁]


/-- **Tietze extension theorem** for real-valued bounded continuous maps, a version with a closed
embedding and bundled composition. If `e : C(X, Y)` is a closed embedding of a topological space
into a normal topological space and `f : X →ᵇ ℝ` is a bounded continuous function, then there exists
a bounded continuous function `g : Y →ᵇ ℝ` of the same norm such that `g ∘ e = f`. -/
theorem exists_extension_norm_eq_of_closedEmbedding' (f : X →ᵇ ℝ) (e : C(X, Y))
    (he : ClosedEmbedding e) : ∃ g : Y →ᵇ ℝ, ‖g‖ = ‖f‖ ∧ g.compContinuous e = f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[NormalSpace Y]
(f : X →ᵇ ℝ)
(e : C(X, Y))
(he : ClosedEmbedding ⇑e)


@[simp]
theorem toIocDiv_add_right (a b : α) : toIocDiv hp a (b + p) = toIocDiv hp a b + 1

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


/-- The finrank of a finite product is the sum of the finranks. -/
theorem FiniteDimensional.finrank_pi_fintype
    {ι : Type v} [Fintype ι] {M : ι → Type w} [∀ i : ι, AddCommGroup (M i)]
    [∀ i : ι, Module R (M i)] [∀ i : ι, Module.Free R (M i)] [∀ i : ι, Module.Finite R (M i)] :
    finrank R (∀ i, M i) = ∑ i, finrank R (M i)

(R : Type u)
[Ring R]
[StrongRankCondition R]
{ι : Type v}
[Fintype ι]
{M : ι → Type w}
[(i : ι) → AddCommGroup (M i)]
[(i : ι) → Module R (M i)]
[∀ (i : ι), Module.Free R (M i)]
[∀ (i : ι), Module.Finite R (M i)]

FiniteDimensional.finrank R ((i : ι) → M i) = ∑ i : ι, FiniteDimensional.finrank R (M i)


theorem Nonempty.not_subset_empty : s.Nonempty → ¬s ⊆ ∅


@[simp]
theorem preimage_neg_uIcc : @Neg.neg (Set α) Set.neg [[a, b]] = [[-a, -b]]

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


theorem norm_lt_iff_of_compact [CompactSpace α] {f : α →ᵇ β} {M : ℝ} (M0 : 0 < M) :
    ‖f‖ < M ↔ ∀ x, ‖f x‖ < M

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
[CompactSpace α]
{f : BoundedContinuousFunction α β}
{M : ℝ}
(M0 : 0 < M)


theorem integral_add_adjacent_intervals (hab : IntervalIntegrable f μ a b)
    (hbc : IntervalIntegrable f μ b c) :
    ((∫ x in a..b, f x ∂μ) + ∫ x in b..c, f x ∂μ) = ∫ x in a..c, f x ∂μ

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

∫ (x : ℝ) in a..b, f x ∂μ + ∫ (x : ℝ) in b..c, f x ∂μ = ∫ (x : ℝ) in a..c, f x ∂μ


@[simp]
theorem neg_snd : (-x).snd = -x.snd

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


theorem mem_union_left {x : α} {a : Set α} (b : Set α) : x ∈ a → x ∈ a ∪ b

{α : Type u}
{x : α}
{a : Set α}
(b : Set α)


lemma W_iff_isIso {X Y : C} (f : X ⟶ Y) (hX : P X) (hY : P Y) :
    W P f ↔ IsIso f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(P : C → Prop)
{X Y : C}
(f : X ⟶ Y)
(hX : P X)
(hY : P Y)

CategoryTheory.Localization.LeftBousfield.W P f ↔ CategoryTheory.IsIso f


@[simp] lemma pushforward_map (f : X ⟶ Y) {F F' : X.Sheaf C} (α : F ⟶ F') :
    ((pushforward C f).map α).1 = (Presheaf.pushforward C f).map α.1

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
(f : X ⟶ Y)
{F F' : TopCat.Sheaf C X}
(α : F ⟶ F')

((TopCat.Sheaf.pushforward C f).map α).val = (TopCat.Presheaf.pushforward C f).map α.val


@[to_additive three_nsmul]
lemma pow_three (a : M) : a ^ 3 = a * (a * a)


/-- The coercion `(fun x y => B x y) : E → (F → 𝕜)` is an embedding. -/
theorem embedding {B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜} (hB : Function.Injective B) :
    Embedding fun (x : WeakBilin B) y => B x y

{𝕜 : Type u_2}
{E : Type u_5}
{F : Type u_6}
[TopologicalSpace 𝕜]
[CommSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[AddCommMonoid F]
[Module 𝕜 F]
{B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜}
(hB : Function.Injective ⇑B)


theorem DimensionLEOne.eq_bot_of_lt [Ring.DimensionLEOne R] (p P : Ideal R) [p.IsPrime]
    [P.IsPrime] (hpP : p < P) : p = ⊥

{R : Type u_1}
[CommRing R]
[Ring.DimensionLEOne R]
(p P : Ideal R)
[p.IsPrime]
[P.IsPrime]
(hpP : p < P)


@[simp]
theorem mk_coe_of_dist_eq {α β} [PseudoMetricSpace α] [PseudoMetricSpace β] (f : α →ᵈ β) (h) :
    Dilation.mkOfDistEq f h = f

(f : α →ᵈ β)

(h : ∃ r, r ≠ 0 ∧ ∀ (x y : α), dist (f x) (f y) = ↑r * dist x y)


theorem hasFiniteLimits_of_hasTerminal_and_pullbacks [HasTerminal C] [HasPullbacks C] :
    HasFiniteLimits C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasTerminal C]
[CategoryTheory.Limits.HasPullbacks C]


lemma antidiagonal_eq_image (n : ℕ) :
    antidiagonal n = (range (n + 1)).image fun i ↦ (i, n - i)

Finset.antidiagonal n = Finset.image (fun i => (i, n - i)) (Finset.range (n + 1))


lemma piAntidiag_cons (hi : i ∉ s)  (n : μ) :
    piAntidiag (cons i s hi) n = (antidiagonal n).disjiUnion (fun p : μ × μ ↦
      (piAntidiag s p.snd).map (addRightEmbedding fun t ↦ if t = i then p.fst else 0))
        (pairwiseDisjoint_piAntidiag_map_addRightEmbedding hi _)

{ι : Type u_1}
{μ : Type u_2}
[DecidableEq ι]
[AddCancelCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
{i : ι}
{s : Finset ι}
(hi : i ∉ s)
(n : μ)

(Finset.cons i s hi).piAntidiag n =
  (Finset.antidiagonal n).disjiUnion
    (fun p => Finset.map (addRightEmbedding fun t => if t = i then p.1 else 0) (s.piAntidiag p.2)) ⋯


@[simp] lemma map_id : M.map id (injOn_id M.E) = M


/-- An equivalent expression of `Submonoid.FG` in terms of `Set.Finite` instead of `Finset`. -/
@[to_additive "An equivalent expression of `AddSubmonoid.FG` in terms of `Set.Finite` instead of
`Finset`."]
theorem Submonoid.fg_iff (P : Submonoid M) :
    Submonoid.FG P ↔ ∃ S : Set M, Submonoid.closure S = P ∧ S.Finite

{M : Type u_1}
[Monoid M]
(P : Submonoid M)

P.FG ↔ ∃ S, Submonoid.closure S = P ∧ S.Finite


@[simp]
theorem coe_mk (s : Set α) (h) : (mk s h : Set α) = s

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


theorem zero_smul_set_subset (s : Set β) : (0 : α) • s ⊆ 0

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
(s : Set β)


/-- A structure containing all the information from which one can build a nontrivial transvection.
This structure is easier to manipulate than transvections as one has a direct access to all the
relevant fields. -/
-- porting note (#5171): removed @[nolint has_nonempty_instance]
structure TransvectionStruct where
  (i j : n)
  hij : i ≠ j
  c : R

{n : Type u_1}
{R : Type u₂}
(self : Matrix.TransvectionStruct n R)


theorem isSt_symm_real {r s : ℝ} : IsSt r s ↔ IsSt s r


/-- `(n, m)` is in the transitive closure of a reflexive relation `~` if `i ~ succ i` and
  `succ i ~ i` for all `i` between `n` and `m`. -/
theorem transGen_of_succ_of_reflexive (r : α → α → Prop) {n m : α} (hr : Reflexive r)
    (h1 : ∀ i ∈ Ico n m, r i (succ i)) (h2 : ∀ i ∈ Ico m n, r (succ i) i) : TransGen r n m

(h1 : ∀ i ∈ Set.Ico n m, r i (Order.succ i))

(h2 : ∀ i ∈ Set.Ico m n, r (Order.succ i) i)


@[reassoc (attr := simp)]
theorem map_fromSpec {V : X.Opens} (hV : IsAffineOpen V) (f : op U ⟶ op V) :
    Spec.map (X.presheaf.map f) ≫ hU.fromSpec = hV.fromSpec

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
{V : X.Opens}
(hV : AlgebraicGeometry.IsAffineOpen V)
(f : Opposite.op U ⟶ Opposite.op V)

AlgebraicGeometry.Spec.map (X.presheaf.map f) ≫ hU.fromSpec = hV.fromSpec


theorem finSuccEquiv'_symm_coe_below {i : Fin (n + 1)} {m : Fin n} (h : Fin.castSucc m < i) :
    (finSuccEquiv' i).symm m = Fin.castSucc m

{n : ℕ}
{i : Fin (n + 1)}
{m : Fin n}
(h : m.castSucc < i)

(finSuccEquiv' i).symm (some m) = m.castSucc


@[simp]
theorem mem_orderedInsert {a b : α} {l : List α} :
    a ∈ orderedInsert r b l ↔ a = b ∨ a ∈ l

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
{a b : α}
{l : List α}

a ∈ List.orderedInsert r b l ↔ a = b ∨ a ∈ l


theorem fib_two_mul_add_one (n : ℕ) : fib (2 * n + 1) = fib (n + 1) ^ 2 + fib n ^ 2

Nat.fib (2 * n + 1) = Nat.fib (n + 1) ^ 2 + Nat.fib n ^ 2


theorem mk_diff_add_mk {S T : Set α} (h : T ⊆ S) : #(S \ T : Set α) + #T = #S

Cardinal.mk ↑(S \ T) + Cardinal.mk ↑T = Cardinal.mk ↑S


/-- Balls defined using the distance or the edistance coincide -/
@[simp]
theorem Metric.emetric_ball_nnreal {x : α} {ε : ℝ≥0} : EMetric.ball x ε = ball x ε

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


theorem isInt_isCoprime : {x y nx ny : ℤ} →
    IsInt x nx → IsInt y ny → IsCoprime nx ny → IsCoprime x y

Mathlib.Meta.NormNum.IsInt x nx → Mathlib.Meta.NormNum.IsInt y ny → IsCoprime nx ny → IsCoprime x y


/-- The functor from augmented objects to arrows. -/
@[simps!]
def toArrow : Augmented C ⥤ Arrow C

(X : CategoryTheory.CosimplicialObject.Augmented C)

(CategoryTheory.CosimplicialObject.Augmented.toArrow.obj X).left = X.left