theorem abs_toReal_measure_sub_le_measure_symmDiff [IsFiniteMeasure μ]
    (hs : MeasurableSet s) (ht : MeasurableSet t) :
    |(μ s).toReal - (μ t).toReal| ≤ (μ (s ∆ t)).toReal

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
[MeasureTheory.IsFiniteMeasure μ]
(hs : MeasurableSet s)
(ht : MeasurableSet t)

|(μ s).toReal - (μ t).toReal| ≤ (μ (symmDiff s t)).toReal


@[fun_prop]
protected theorem ContinuousLinearMap.hasStrictFDerivAt {x : E} : HasStrictFDerivAt e e x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(e : E →L[𝕜] F)
{x : E}


theorem appendFun_comp_splitFun {α γ : TypeVec n} {β δ : Type*} {ε : TypeVec (n + 1)}
    (f₀ : drop ε ⟹ α) (f₁ : α ⟹ γ) (g₀ : last ε → β) (g₁ : β → δ) :
    appendFun f₁ g₁ ⊚ splitFun f₀ g₀ = splitFun (α' := γ.append1 δ) (f₁ ⊚ f₀) (g₁ ∘ g₀)

{n : ℕ}
{α : TypeVec.{u_1} n}
{γ : TypeVec.{u_2} n}
{β : Type u_1}
{δ : Type u_2}
{ε : TypeVec.{u_3} (n + 1)}
(f₀ : ε.drop.Arrow α)
(f₁ : α.Arrow γ)
(g₀ : ε.last → β)
(g₁ : β → δ)

TypeVec.comp (f₁ ::: g₁) (TypeVec.splitFun f₀ g₀) = TypeVec.splitFun (TypeVec.comp f₁ f₀) (g₁ ∘ g₀)


/-- A homology data for a short complex `S` induces a homology data for `S.op`. -/
@[simps]
def op (h : S.HomologyData) : S.op.HomologyData


theorem mapLMultilinear_opNorm : ‖mapLMultilinear 𝕜 E E'‖ ≤ 1

[(i : ι) → SeminormedAddCommGroup (E i)]

[(i : ι) → SeminormedAddCommGroup (E' i)]

‖PiTensorProduct.mapLMultilinear 𝕜 E E'‖ ≤ 1


@[to_additive] lemma mabs_inf_div_inf_le_mabs (a b c : α) : |(a ⊓ c) / (b ⊓ c)|ₘ ≤ |a / b|ₘ

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


@[to_additive (attr := mono) sum_mono]
theorem prod_mono' : Monotone fun f : ι → M ↦ ∏ i, f i

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedAddCommMonoid M]


@[to_additive (attr := simp)]
lemma _root_.Function.const_mul [Mul β] (a b : β) : const α a * const α b = const α (a * b)

{α : Type u_1}
{β : Type u_2}
[Mul β]
(a b : β)

Function.const α a * Function.const α b = Function.const α (a * b)


/-- Change of variable formula for differentiable functions, set version: if a function `f` is
injective and differentiable on a measurable set `s`, then the measure of `f '' s` is given by the
integral of `|(f' x).det|` on `s`.
Note that the measurability of `f '' s` is given by `measurable_image_of_fderivWithin`. -/
theorem lintegral_abs_det_fderiv_eq_addHaar_image (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
    (∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) = μ (f '' s)

∫⁻ (x : E) in s, ENNReal.ofReal |(f' x).det| ∂μ = μ (f '' s)


/-- Assemble an `I`-indexed family of equivalences of categories
into a single equivalence. -/
@[simps]
def pi (E : ∀ i, C i ≌ D i) : (∀ i, C i) ≌ (∀ i, D i)

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

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

(CategoryTheory.Equivalence.pi E).unitIso = CategoryTheory.NatIso.pi fun i => (E i).unitIso


/-- A morphism is `QuasiSeparated` if diagonal map is quasi-compact. -/
@[mk_iff]
class QuasiSeparated (f : X ⟶ Y) : Prop where
  /-- A morphism is `QuasiSeparated` if diagonal map is quasi-compact. -/
  diagonalQuasiCompact : QuasiCompact (pullback.diagonal f) := by infer_instance

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)

AlgebraicGeometry.QuasiSeparated f ↔
  autoParam (AlgebraicGeometry.QuasiCompact (CategoryTheory.Limits.pullback.diagonal f)) _auto✝


@[simp]
theorem not_isBot [NoBotOrder α] (a : α) : ¬IsBot a

{α : Type u_1}
[LE α]
[NoBotOrder α]
(a : α)


@[simp]
theorem constantCoeff_wittSub (n : ℕ) : constantCoeff (wittSub p n) = 0

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)

MvPolynomial.constantCoeff (WittVector.wittSub p n) = 0


theorem DifferentiableOn.div (hc : DifferentiableOn 𝕜 c s) (hd : DifferentiableOn 𝕜 d s)
    (hx : ∀ x ∈ s, d x ≠ 0) : DifferentiableOn 𝕜 (fun x => c x / d x) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{s : Set 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c d : 𝕜 → 𝕜'}
(hc : DifferentiableOn 𝕜 c s)
(hd : DifferentiableOn 𝕜 d s)
(hx : ∀ x ∈ s, d x ≠ 0)


@[to_additive]
theorem Bornology.IsBounded.of_mul (hst : IsBounded (s * t)) : IsBounded s ∨ IsBounded t

{E : Type u_1}
[SeminormedAddGroup E]
{s t : Set E}
(hst : Bornology.IsBounded (s + t))

Bornology.IsBounded s ∨ Bornology.IsBounded t


theorem eq_of_eq_counts {a b : Associates α} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : ∀ p : Associates α, Irreducible p → p.count a.factors = p.count b.factors) : a = b

[(p : Associates α) → Decidable (Irreducible p)]

(h : ∀ (p : Associates α), Irreducible p → p.count a.factors = p.count b.factors)


theorem div_sub_div_same (a b c : K) : a / c - b / c = (a - b) / c

{K : Type u_3}
[DivisionRing K]
(a b c : K)


/-- homotopy is a transitive relation. -/
@[simps!, trans]
def trans {e f g : C ⟶ D} (h : Homotopy e f) (k : Homotopy f g) : Homotopy e g

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{e f g : C ⟶ D}
(h : Homotopy e f)
(k : Homotopy f g)
(i j : ι)

(h.trans k).hom i j = h.hom i j + k.hom i j


@[simp]
theorem comm_trans_rTensorOne :
    (TensorProduct.comm R _ _).trans M.rTensorOne = M.lTensorOne

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

TensorProduct.comm R ↥⊥ ↥M ≪≫ₗ M.rTensorOne = M.lTensorOne


theorem ne_one (h : Irrational x) : x ≠ 1


@[simp] theorem SeparationQuotient.edist_mk [PseudoEMetricSpace X] (x y : X) :
    edist (mk x) (mk y) = edist x y

{X : Type u_1}
[PseudoEMetricSpace X]
(x y : X)

edist (SeparationQuotient.mk x) (SeparationQuotient.mk y) = edist x y


/-- Conditions for an element to be additively central -/
structure IsAddCentral [Add M] (z : M) : Prop where
  /-- addition commutes -/
  comm (a : M) : z + a = a + z
  /-- associative property for left addition -/
  left_assoc (b c : M) : z + (b + c) = (z + b) + c
  /-- middle associative addition property -/
  mid_assoc (a c : M) : (a + z) + c = a + (z + c)
  /-- associative property for right addition -/
  right_assoc (a b : M) : (a + b) + z = a + (b + z)

{M : Type u_1}
[Add M]
{z : M}
(self : IsAddCentral z)
(a c : M)


theorem inf_eq_bot (h : IsCompl x y) : x ⊓ y = ⊥

{α : Type u_1}
[Lattice α]
[BoundedOrder α]
{x y : α}
(h : IsCompl x y)


theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
    i * j ∈ I * J

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I J : FractionalIdeal S P}
{i j : P}
(hi : i ∈ I)
(hj : j ∈ J)


/-- Product over a sigma type equals the product of fiberwise products. For rewriting
in the reverse direction, use `Finset.prod_sigma'`.  -/
@[to_additive "Sum over a sigma type equals the sum of fiberwise sums. For rewriting
in the reverse direction, use `Finset.sum_sigma'`"]
theorem prod_sigma {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
    ∏ x ∈ s.sigma t, f x = ∏ a ∈ s, ∏ s ∈ t a, f ⟨a, s⟩

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
{σ : α → Type u_6}
(s : Finset α)
(t : (a : α) → Finset (σ a))
(f : Sigma σ → β)

∑ x ∈ s.sigma t, f x = ∑ a ∈ s, ∑ s ∈ t a, f ⟨a, s⟩


theorem comap_iSup {ι} {f : ι → Filter β} {m : α → β} : comap m (iSup f) = ⨆ i, comap m (f i)

{α : Type u}
{β : Type v}
{ι : Sort u_2}
{f : ι → Filter β}
{m : α → β}

Filter.comap m (iSup f) = ⨆ i, Filter.comap m (f i)


@[simp]
theorem length_Ioc (a b : ℝ) : f.length (Ioc a b) = ofReal (f b - f a)

f.length (Set.Ioc a b) = ENNReal.ofReal (↑f b - ↑f a)


protected theorem injective (e : α ≃o β) : Function.Injective e

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)


theorem mdifferentiableOn_fst {s : Set (M × M')} : MDifferentiableOn (I.prod I') I Prod.fst 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]
[SmoothManifoldWithCorners I 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']
[SmoothManifoldWithCorners I' M']
{s : Set (M × M')}


/-- An auxiliary lemma for manipulating sequence indices. -/
theorem lift_index_right {f : PadicSeq p} (hf : ¬f ≈ 0) (v1 v2 : ℕ) :
    padicNorm p (f (stationaryPoint hf)) =
    padicNorm p (f (max v1 (max v2 (stationaryPoint hf))))

{p : ℕ}
[Fact (Nat.Prime p)]
{f : PadicSeq p}
(hf : ¬f ≈ 0)
(v1 v2 : ℕ)

padicNorm p (↑f (PadicSeq.stationaryPoint hf)) = padicNorm p (↑f (max v1 (max v2 (PadicSeq.stationaryPoint hf))))


/-- In a `p ^ (k + 1)`-th cyclotomic extension of `ℚ`, we have that
  `ζ - 1` divides `p` in `𝓞 K`. -/
lemma toInteger_sub_one_dvd_prime [hcycl : IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) : ((hζ.toInteger - 1)) ∣ p


/-- Given an open cover on `X`, we may pull them back along a morphism `W ⟶ X` to obtain
an open cover of `W`. -/
@[simps]
def OpenCover.pullbackCover {X W : Scheme.{u}} (𝒰 : X.OpenCover) (f : W ⟶ X) :
    W.OpenCover

{X W : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : W ⟶ X)
(x : 𝒰.J)

(𝒰.pullbackCover f).map x = CategoryTheory.Limits.pullback.fst f (𝒰.map x)


lemma rel_π₁ {i₁ i₁' : I₁} (h : c₁.Rel i₁ i₁') (i₂ : I₂) :
    c₁₂.Rel (π c₁ c₂ c₁₂ ⟨i₁, i₂⟩) (π c₁ c₂ c₁₂ ⟨i₁', i₂⟩)

{I₁ : Type u_1}
{I₂ : Type u_2}
{I₁₂ : Type u_3}
{c₁ : ComplexShape I₁}
(c₂ : ComplexShape I₂)
(c₁₂ : ComplexShape I₁₂)
[TotalComplexShape c₁ c₂ c₁₂]
{i₁ i₁' : I₁}
(h : c₁.Rel i₁ i₁')
(i₂ : I₂)

c₁₂.Rel (c₁.π c₂ c₁₂ (i₁, i₂)) (c₁.π c₂ c₁₂ (i₁', i₂))


lemma toENatAux_ofENat : ∀ n : ℕ∞, toENatAux n = n


theorem prod_map_left (f : α → β) (F : Filter α) (G : Filter γ) :
    map f F ×ˢ G = map (Prod.map f id) (F ×ˢ G)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β)
(F : Filter α)
(G : Filter γ)

Filter.map f F ×ˢ G = Filter.map (Prod.map f id) (F ×ˢ G)


/-- The exponential map in a complete normed field `𝕂` of characteristic zero has derivative
`exp 𝕂 x` at any point `x` in the disk of convergence. -/
theorem hasDerivAt_exp_of_mem_ball [CharZero 𝕂] {x : 𝕂}
    (hx : x ∈ EMetric.ball (0 : 𝕂) (expSeries 𝕂 𝕂).radius) : HasDerivAt (exp 𝕂) (exp 𝕂 x) x

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝕂).radius)

HasDerivAt (NormedSpace.exp 𝕂) (NormedSpace.exp 𝕂 x) x


@[to_additive (attr := simp)]
theorem cancel_right {g₁ g₂ : β →*o γ} {f : α →*o β} (hf : Function.Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[MulOneClass α]
[MulOneClass β]
[MulOneClass γ]
{g₁ g₂ : β →*o γ}
{f : α →*o β}
(hf : Function.Surjective ⇑f)


/-- **Fermat's Theorem**: the derivative of a function at a local minimum equals zero. -/
theorem IsLocalMin.hasFDerivAt_eq_zero (h : IsLocalMin f a) (hf : HasFDerivAt f f' a) : f' = 0

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{a : E}
(h : IsLocalMin f a)
(hf : HasFDerivAt f f' a)


lemma pow {I : Ideal A} {x y : A} (n : ℕ) (hxy : x ≡ y [SMOD I]) :
    x ^ n ≡ y ^ n [SMOD I]

{A : Type u_2}
[CommRing A]
{I : Ideal A}
{x y : A}
(n : ℕ)
(hxy : x ≡ y [SMOD I])


/-- Recurrence for the `GenContFract.of` an element `v` of `K` in terms of that of the inverse of
the fractional part of `v`.
-/
theorem of_s_succ (n : ℕ) : (of v).s.get? (n + 1) = (of (fract v)⁻¹).s.get? n

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

(GenContFract.of v).s.get? (n + 1) = (GenContFract.of (Int.fract v)⁻¹).s.get? n


@[simp]
theorem coe_continuous_linearProjOfClosedCompl (h : IsCompl p q) (hp : IsClosed (p : Set E))
    (hq : IsClosed (q : Set E)) :
    (p.linearProjOfClosedCompl q h hp hq : E →ₗ[𝕜] p) = p.linearProjOfIsCompl q h

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{p q : Subspace 𝕜 E}
(h : IsCompl p q)
(hp : IsClosed ↑p)
(hq : IsClosed ↑q)

↑(Submodule.linearProjOfClosedCompl p q h hp hq) = Submodule.linearProjOfIsCompl p q h


theorem fderivWithin_snd {s : Set (E × F)} (hs : UniqueDiffWithinAt 𝕜 s p) :
    fderivWithin 𝕜 Prod.snd s p = snd 𝕜 E F

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}
{s : Set (E × F)}
(hs : UniqueDiffWithinAt 𝕜 s p)

fderivWithin 𝕜 Prod.snd s p = ContinuousLinearMap.snd 𝕜 E F


theorem cos_ofReal_re (x : ℝ) : (cos x).re = Real.cos x


/-- A family of injective functions with pairwise disjoint
domains and pairwise disjoint ranges can be glued together
to form an injective function. -/
theorem piecewise_inj {β : Type*} {f : ι → α → β}
    (h_injOn : ∀ i, InjOn (f i) (s i))
    (h_disjoint : PairwiseDisjoint (univ : Set ι) fun i => (f i) '' (s i)) :
    Injective (piecewise hs f)

{f : ι → α → β}

(h_injOn : ∀ (i : ι), Set.InjOn (f i) (s i))

(h_disjoint : Set.univ.PairwiseDisjoint fun i => f i '' s i)


/-- The power series expansion of `Complex.arctan`, valid on the open unit disc. -/
theorem hasSum_arctan {z : ℂ} (hz : ‖z‖ < 1) :
    HasSum (fun n : ℕ ↦ (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)) (arctan z)


theorem eq_of_add [AddGroup α] (p : (a:α) = b) (H : (a' - b') - (a - b) = 0) : a' = b'

{α : Type u_1}
{a a' b b' : α}
[AddGroup α]
(p : a = b)
(H : a' - b' - (a - b) = 0)


theorem primorial_le_4_pow (n : ℕ) : n# ≤ 4 ^ n


theorem op_sInf (S : Set (Subalgebra R A)) : (sInf S).op = sInf (.unop ⁻¹' S)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Set (Subalgebra R A))

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


theorem smul_measure_iff (c : ℝ≥0∞) (hc_ne_zero : c ≠ 0) (hc_ne_top : c ≠ ∞) :
    FinMeasAdditive (c • μ) T ↔ FinMeasAdditive μ T

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_7}
[AddCommMonoid β]
{T : Set α → β}
(c : ℝ≥0∞)
(hc_ne_zero : c ≠ 0)
(hc_ne_top : c ≠ ⊤)

MeasureTheory.FinMeasAdditive (c • μ) T ↔ MeasureTheory.FinMeasAdditive μ T


protected theorem ext_iff : f = g ↔ ∀ s, s ∈ f ↔ s ∈ g


lemma lift_f (p q : ℤ) (hpq : p + 1 = q) :
    (lift φ α β eq).f p = α.1.v p q hpq ≫
      (inl φ).v q p (by omega) + β.v p p (add_zero p) ≫ (inr φ).f p

(α : CochainComplex.HomComplex.Cocycle K F 1)

(β : CochainComplex.HomComplex.Cochain K G 0)

(eq : CochainComplex.HomComplex.δ 0 1 β + (↑α).comp (CochainComplex.HomComplex.Cochain.ofHom φ) ⋯ = 0)

(CochainComplex.mappingCone.lift φ α β eq).f p =
  (↑α).v p q hpq ≫ (CochainComplex.mappingCone.inl φ).v q p ⋯ + β.v p p ⋯ ≫ (CochainComplex.mappingCone.inr φ).f p


theorem differentiable_exp : Differentiable ℝ exp


theorem le_inf_support_list_prod (degt0 : 0 ≤ degt 0)
    (degtm : ∀ a b, degt a + degt b ≤ degt (a + b)) (l : List R[A]) :
    (l.map fun f : R[A] => f.support.inf degt).sum ≤ l.prod.support.inf degt

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

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

(degtm : ∀ (a b : A), degt a + degt b ≤ degt (a + b))

(List.map (fun f => f.support.inf degt) l).sum ≤ l.prod.support.inf degt


/-- A topological field is completable if it is separated and the image under
the mapping x ↦ x⁻¹ of every Cauchy filter (with respect to the additive uniform structure)
which does not have a cluster point at 0 is a Cauchy filter
(with respect to the additive uniform structure). This ensures the completion is
a field.
-/
class CompletableTopField extends T0Space K : Prop where
  nice : ∀ F : Filter K, Cauchy F → 𝓝 0 ⊓ F = ⊥ → Cauchy (map (fun x => x⁻¹) F)

{K : Type u_1}
[Field K]
[UniformSpace K]
[self : CompletableTopField K]
(F : Filter K)

Cauchy F → 𝓝 0 ⊓ F = ⊥ → Cauchy (Filter.map (fun x => x⁻¹) F)


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


@[to_additive]
lemma piFinset_smul_finset [∀ i, SMul (α i) (β i)] (a : ∀ i, α i) (s : ∀ i, Finset (β i)) :
    piFinset (fun i ↦ a i • s i) = a • piFinset s

{ι : Type u_5}
{α : ι → Type u_6}
{β : ι → Type u_7}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → SMul (α i) (β i)]
(a : (i : ι) → α i)
(s : (i : ι) → Finset (β i))

(Fintype.piFinset fun i => a i • s i) = a • Fintype.piFinset s


theorem nhds_right' (a : Ordinal) : 𝓝[>] a = ⊥


theorem union_iUnion_nat_succ (u : ℕ → Set α) : (u 0 ∪ ⋃ i, u (i + 1)) = ⋃ i, u i


theorem foldrM_eq_reverse_foldlM_data.aux [Monad m]
    (f : α → β → m β) (arr : Array α) (init : β) (i h) :
    (arr.data.take i).reverse.foldlM (fun x y => f y x) init = foldrM.fold f arr 0 i h init

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m β)
(arr : Array α)
(init : β)
(i : Nat)
(h : i ≤ arr.size)

List.foldlM (fun x y => f y x) init (List.take i arr.data).reverse = Array.foldrM.fold f arr 0 i h init


/-- Constructor for isomorphisms in the category `SheafedSpace C`. -/
@[simps]
def isoMk {X Y : SheafedSpace C} (e : X.toPresheafedSpace ≅ Y.toPresheafedSpace) : X ≅ Y

{X Y : AlgebraicGeometry.SheafedSpace C}

(AlgebraicGeometry.SheafedSpace.isoMk e).inv = e.inv


/-- A morphism of monoid objects. -/
@[ext]
structure Hom (M N : Mon_ C) where
  hom : M.X ⟶ N.X
  one_hom : M.one ≫ hom = N.one := by aesop_cat
  mul_hom : M.mul ≫ hom = (hom ⊗ hom) ≫ N.mul := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{M N : Mon_ C}
(self : M.Hom N)


protected theorem Preconnected.ofBoxProdRight [Nonempty α] (h : (G □ H).Preconnected) :
    H.Preconnected

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{H : SimpleGraph β}
[Nonempty α]
(h : (G □ H).Preconnected)


theorem contDiff_sin {n} : ContDiff ℂ n sin


theorem ae_nonneg_restrict_of_forall_setIntegral_nonneg {f : α → ℝ}
    (hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
    (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) {t : Set α}
    (ht : MeasurableSet t) (hμt : μ t ≠ ∞) : 0 ≤ᵐ[μ.restrict t] f

(hf_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn f s μ)

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


/-- The exponent of a generalized eigenvalue is never 0. -/
theorem exp_ne_zero_of_hasGenEigenvalue {f : End R M} {μ : R} {k : ℕ}
    (h : f.HasGenEigenvalue μ k) : k ≠ 0

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
{k : ℕ}
(h : f.HasGenEigenvalue μ k)


/-- There exists a minimal positive integer with absolute value smaller than 1. -/
lemma exists_minimal_nat_zero_lt_mulRingNorm_lt_one : ∃ p : ℕ, (0 < f p ∧ f p < 1) ∧
    ∀ m : ℕ, 0 < f m ∧ f m < 1 → p ≤ m

{f : MulRingNorm ℚ}
(hf_nontriv : f ≠ 1)
(bdd : ∀ (n : ℕ), f ↑n ≤ 1)

∃ p, (0 < f ↑p ∧ f ↑p < 1) ∧ ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m


theorem nmul_le_nmul_of_nonneg_right (h₁ : a ≤ b) (h₂ : 0 ≤ c) : a ⨳ c ≤ b ⨳ c

{a b c : Ordinal.{u}}
(h₁ : a ≤ b)
(h₂ : 0 ≤ c)


/-- A rewrite lemma for `padicValRat p (q * r)` with conditions `q ≠ 0`, `r ≠ 0`. -/
protected theorem mul {q r : ℚ} (hq : q ≠ 0) (hr : r ≠ 0) :
    padicValRat p (q * r) = padicValRat p q + padicValRat p r

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{q r : ℚ}
(hq : q ≠ 0)
(hr : r ≠ 0)


@[simp]
theorem det_coe_symm {R : Type*} [Field R] {M : Type*} [TopologicalSpace M] [AddCommGroup M]
    [Module R M] (A : M ≃L[R] M) : (A.symm : M →L[R] M).det = (A : M →L[R] M).det⁻¹

{R : Type u_1}
[Field R]
{M : Type u_2}
[TopologicalSpace M]
[AddCommGroup M]
[Module R M]
(A : M ≃L[R] M)


@[simp]
theorem mk_cancel_common_left (s' s : S) (m : M) : mk (s' • m) (s' * s) = mk m s

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

LocalizedModule.mk (s' • m) (s' * s) = LocalizedModule.mk m s


@[simp]
theorem get_add {x y : PartENat} (h : (x + y).Dom) : get (x + y) h = x.get h.1 + y.get h.2


/-- If a function coincides with a measurable function outside of a countable set, it is
measurable. -/
theorem Measurable.measurable_of_countable_ne [MeasurableSingletonClass α] (hf : Measurable f)
    (h : Set.Countable { x | f x ≠ g x }) : Measurable g

{α : Type u_1}
{β : Type u_2}
{f g : α → β}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
[MeasurableSingletonClass α]
(hf : Measurable f)
(h : {x | f x ≠ g x}.Countable)


theorem cons_subset_cons {l₁ l₂ : List α} (a : α) (s : l₁ ⊆ l₂) : a :: l₁ ⊆ a :: l₂

{α : Type u_1}
{l₁ l₂ : List α}
(a : α)
(s : l₁ ⊆ l₂)


@[simp]
theorem Ioo_insert_right (h : a < b) : insert b (Ioo a b) = Ioc a b

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


lemma ContinuousAt.finset_inf' (hne : s.Nonempty) (hs : ∀ i ∈ s, ContinuousAt (f i) x) :
    ContinuousAt (s.inf' hne f) x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeInf L]
[ContinuousInf L]
{s : Finset ι}
{f : ι → X → L}
{x : X}
(hne : s.Nonempty)
(hs : ∀ i ∈ s, ContinuousAt (f i) x)


@[measurability]
lemma measurableSet_eq_fun' {β : Type*} [CanonicallyOrderedAddCommMonoid β] [Sub β] [OrderedSub β]
    {_ : MeasurableSpace β} [MeasurableSub₂ β] [MeasurableSingletonClass β]
    {f g : α → β} (hf : Measurable f) (hg : Measurable g) :
    MeasurableSet {x | f x = g x}

{α : Type u_3}
{m : MeasurableSpace α}
{β : Type u_4}
[CanonicallyOrderedAddCommMonoid β]
[Sub β]
[OrderedSub β]

∀ {x : MeasurableSpace β} [inst : MeasurableSub₂ β] [inst : MeasurableSingletonClass β] {f g : α → β},
  Measurable f → Measurable g → MeasurableSet {x | f x = g x}


/-- Special case of **Chebyshev's Sum Inequality** or the **Cauchy-Schwarz Inequality**: The square
of the sum is less than the size of the set times the sum of the squares. -/
theorem sq_sum_le_card_mul_sum_sq : (∑ i ∈ s, f i) ^ 2 ≤ s.card * ∑ i ∈ s, f i ^ 2

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{s : Finset ι}
{f : ι → α}

(∑ i ∈ s, f i) ^ 2 ≤ ↑s.card * ∑ i ∈ s, f i ^ 2


@[simp]
theorem C_inj {σ : Type*} (R : Type*) [CommSemiring R] (r s : R) :
    (C r : MvPolynomial σ R) = C s ↔ r = s

{σ : Type u_2}
(R : Type u_3)
[CommSemiring R]
(r s : R)

MvPolynomial.C r = MvPolynomial.C s ↔ r = s


lemma Presheaf.IsSheaf.isSeparated {F : Cᵒᵖ ⥤ A} [ConcreteCategory A]
    [J.HasSheafCompose (forget A)] (hF : Presheaf.IsSheaf J F) :
    Presheaf.IsSeparated J F

{J : CategoryTheory.GrothendieckTopology C}

(hF : CategoryTheory.Presheaf.IsSheaf J F)


theorem mem_prod {s : NonUnitalSubring R} {t : NonUnitalSubring S} {p : R × S} :
    p ∈ s.prod t ↔ p.1 ∈ s ∧ p.2 ∈ t

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
{s : NonUnitalSubring R}
{t : NonUnitalSubring S}
{p : R × S}


@[simp]
theorem quotQuotEquivQuotOfLE_symm_mk (x : R) (h : I ≤ J) :
    (quotQuotEquivQuotOfLE h).symm ((Ideal.Quotient.mk J) x) = quotQuotMk I J x

{R : Type u}
[CommRing R]
{I J : Ideal R}
(x : R)
(h : I ≤ J)

(DoubleQuot.quotQuotEquivQuotOfLE h).symm ((Ideal.Quotient.mk J) x) = (DoubleQuot.quotQuotMk I J) x


lemma epi_iff_isPushout : Epi f ↔ IsPushout f f (𝟙 Y) (𝟙 Y)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X Y : C}
(f : X ⟶ Y)

CategoryTheory.Epi f ↔
  CategoryTheory.IsPushout f f (CategoryTheory.CategoryStruct.id Y) (CategoryTheory.CategoryStruct.id Y)


@[norm_cast] -- Porting note (#10618): simp can prove this
theorem coe_zero : ((0 : PowerSeries R) : LaurentSeries R) = 0


/--
For two preorders `α, β`, if `f : α → β` is surjective and strictly comonotonic, then a
strict series of `β` can be pulled back to a strict chain of `α` by
`b₀ < b₁ < ... < bₙ ↦ f⁻¹ b₀ < f⁻¹ b₁ < ... < f⁻¹ bₙ` where `f⁻¹ bᵢ` is an arbitrary element in the
preimage of `f⁻¹ {bᵢ}`.
-/
@[simps!]
noncomputable def comap (p : LTSeries β) (f : α → β)
  (comap : ∀ ⦃x y⦄, f x < f y → x < y)
  (surjective : Function.Surjective f) :
  LTSeries α

(comap : ∀ ⦃x y : α⦄, f x < f y → x < y)

(p.comap f comap surjective).length = p.length


lemma _root_.MeasurableEmbedding.singularPart_map (hf : MeasurableEmbedding f)
    (μ ν : Measure α) [SigmaFinite μ] [SigmaFinite ν] :
    (μ.map f).singularPart (ν.map f) = (μ.singularPart ν).map f

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : α → β}
(hf : MeasurableEmbedding f)
(μ ν : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]

(MeasureTheory.Measure.map f μ).singularPart (MeasureTheory.Measure.map f ν) =
  MeasureTheory.Measure.map f (μ.singularPart ν)


theorem xor_left_comm : ∀ (x y z : Bool), xor x (xor y z) = xor y (xor x z)


theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s

{α : Type u_1}
{s : Set α}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[LinearOrder α]
[OrderClosedTopology α]
(h : s.OrdConnected)


/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K

{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace ℝ H]
[CompleteSpace H]
(K : ConvexCone ℝ H)
(ne : (↑K).Nonempty)
(hc : IsClosed ↑K)


theorem list_sum_pow_char_pow (l : List R) : l.sum ^ p ^ n = (l.map (· ^ p ^ n : R → R)).sum

{R : Type u}
[CommSemiring R]
(p : ℕ)
[ExpChar R p]
(n : ℕ)
(l : List R)

l.sum ^ p ^ n = (List.map (fun x => x ^ p ^ n) l).sum


theorem cauchy_tendsto_of_tendsto {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ)
    (f_lim : α → E) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
    (h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm (f n - f m) p μ < B N)
    (h_lim : ∀ᵐ x : α ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))) :
    atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0)

(hf : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

{B : ℕ → ℝ≥0∞}

(h_cau : ∀ (N n m : ℕ), N ≤ n → N ≤ m → MeasureTheory.eLpNorm (f n - f m) p μ < B N)

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

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - f_lim) p μ) Filter.atTop (𝓝 0)


theorem mulVec_add [Fintype n] (A : Matrix m n α) (x y : n → α) :
    A *ᵥ (x + y) = A *ᵥ x + A *ᵥ y

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


theorem setToFun_mono_left {T T' : Set α → E →L[ℝ] G''} {C C' : ℝ}
    (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C')
    (hTT' : ∀ s x, T s x ≤ T' s x) (f : α →₁[μ] E) : setToFun μ T hT f ≤ setToFun μ T' hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(hTT' : ∀ (s : Set α) (x : E), (T s) x ≤ (T' s) x)

MeasureTheory.setToFun μ T hT ↑↑f ≤ MeasureTheory.setToFun μ T' hT' ↑↑f


/-- The angle at the apex of an isosceles triangle is `π` minus twice a base angle, oriented
vector angle form. -/
theorem oangle_eq_pi_sub_two_zsmul_oangle_sub_of_norm_eq {x y : V} (hn : x ≠ y) (h : ‖x‖ = ‖y‖) :
    o.oangle y x = π - (2 : ℤ) • o.oangle (y - x) y

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

o.oangle y x = ↑π - 2 • o.oangle (y - x) y


@[simp]
theorem finsetCongr_apply (e : α ≃ β) (s : Finset α) : e.finsetCongr s = s.map e.toEmbedding

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(s : Finset α)

e.finsetCongr s = Finset.map e.toEmbedding s


theorem eLpNorm_le_add_measure_left (f : α → F) (μ ν : Measure α) {p : ℝ≥0∞} :
    eLpNorm f p ν ≤ eLpNorm f p (μ + ν)

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
[NormedAddCommGroup F]
(f : α → F)
(μ ν : MeasureTheory.Measure α)
{p : ℝ≥0∞}

MeasureTheory.eLpNorm f p ν ≤ MeasureTheory.eLpNorm f p (μ + ν)


/-- The map `v ↦ v +ᵥ b` as an affine equivalence between a module `V` and an affine space `P` with
tangent space `V`. -/
@[simps! linear apply symm_apply]
def vaddConst (b : P₁) : V₁ ≃ᵃ[k] P₁

(k : Type u_1)
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(b p' : P₁)

(AffineEquiv.vaddConst k b).symm p' = p' -ᵥ b


/--
Cones over `diagram U ⋙ F` are the same as a cones over the usual sheaf condition equalizer diagram.
-/
@[simps]
def coneEquiv :
    Limits.Cone ((diagram U).op ⋙ F) ≌
      Limits.Cone (SheafConditionEqualizerProducts.diagram F U)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasProducts C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{ι : Type v'}
(U : ι → TopologicalSpace.Opens ↑X)

(TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquiv F U).counitIso =
  TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquivCounitIso F U


theorem image_prod_mk_subset_prod {f : α → β} {g : α → γ} {s : Set α} :
    (fun x => (f x, g x)) '' s ⊆ (f '' s) ×ˢ (g '' s)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{g : α → γ}
{s : Set α}


/-- Definition of `x ≤ y` on numeric pre-games, in terms of `<` -/
theorem le_iff_forall_lt {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) :
    x ≤ y ↔ (∀ i, x.moveLeft i < y) ∧ ∀ j, x < y.moveRight j

{x y : SetTheory.PGame}
(ox : x.Numeric)
(oy : y.Numeric)

x ≤ y ↔ (∀ (i : x.LeftMoves), x.moveLeft i < y) ∧ ∀ (j : y.RightMoves), x < y.moveRight j


@[to_additive]
theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Multiset α) (s : Finset α)
    (hs : m.toFinset ⊆ s) : m.prod = ∏ i ∈ s, i ^ m.count i

{α : Type u_3}
[DecidableEq α]
[CommMonoid α]
(m : Multiset α)
(s : Finset α)
(hs : m.toFinset ⊆ s)

m.prod = ∏ i ∈ s, i ^ Multiset.count i m


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


/-- Given a normal subgroup `Γ` of a topological group `G` with Haar measure `μ`, which is also
  right-invariant, and a finite volume fundamental domain `𝓕`, the quotient map to `G ⧸ Γ`,
  properly normalized, satisfies `QuotientMeasureEqMeasurePreimage`. -/
@[to_additive "Given a
normal subgroup `Γ` of an additive topological group `G` with Haar measure `μ`, which is also
right-invariant, and a finite volume fundamental domain `𝓕`, the quotient map to `G ⧸ Γ`,
properly normalized, satisfies `AddQuotientMeasureEqMeasurePreimage`."]
theorem IsFundamentalDomain.QuotientMeasureEqMeasurePreimage_smulHaarMeasure {𝓕 : Set G}
    (h𝓕 : IsFundamentalDomain Γ.op 𝓕 ν) (h𝓕_finite : ν 𝓕 ≠ ⊤) :
    QuotientMeasureEqMeasurePreimage ν
      ((ν ((π ⁻¹' (K : Set (G ⧸ Γ))) ∩ 𝓕)) • haarMeasure K)

(K : TopologicalSpace.PositiveCompacts (G ⧸ Γ))

(h𝓕 : MeasureTheory.IsFundamentalDomain (↥Γ.op) 𝓕 ν)

MeasureTheory.QuotientMeasureEqMeasurePreimage ν (ν (QuotientGroup.mk ⁻¹' ↑K ∩ 𝓕) • MeasureTheory.Measure.haarMeasure K)


theorem liftAux_map_smul (f : X → L) (t : R) (a : lib R X) :
    liftAux R f (t • a) = t • liftAux R f a

(R : Type u)
{X : Type v}
[CommRing R]
{L : Type w}
[LieRing L]
[LieAlgebra R L]
(f : X → L)
(t : R)
(a : lib R X)

(FreeLieAlgebra.liftAux R f) (t • a) = t • (FreeLieAlgebra.liftAux R f) a


theorem tendsto_const_mul_pow_nhds_iff' {n : ℕ} {c d : 𝕜} :
    Tendsto (fun x : 𝕜 => c * x ^ n) atTop (𝓝 d) ↔ (c = 0 ∨ n = 0) ∧ c = d

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{n : ℕ}
{c d : 𝕜}

Filter.Tendsto (fun x => c * x ^ n) Filter.atTop (𝓝 d) ↔ (c = 0 ∨ n = 0) ∧ c = d


@[simp] theorem update_idem (f : α →₀ M) (a : α) (b c : M) :
    update (update f a b) a c = update f a c

{α : Type u_1}
{M : Type u_5}
[Zero M]
(f : α →₀ M)
(a : α)
(b c : M)

(f.update a b).update a c = f.update a c


/-- The set of good rational approximations to a real number `ξ` is infinite if and only if
`ξ` is irrational. -/
theorem Real.infinite_rat_abs_sub_lt_one_div_den_sq_iff_irrational (ξ : ℝ) :
    {q : ℚ | |ξ - q| < 1 / (q.den : ℝ) ^ 2}.Infinite ↔ Irrational ξ

{q | |ξ - ↑q| < 1 / ↑q.den ^ 2}.Infinite ↔ Irrational ξ


theorem isIdempotentComplete_iff_opposite : IsIdempotentComplete Cᵒᵖ ↔ IsIdempotentComplete C

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]

CategoryTheory.IsIdempotentComplete Cᵒᵖ ↔ CategoryTheory.IsIdempotentComplete C


theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →+* P) (x) :
    F x = lift G f P (fun i => F.comp <| of G f i) (fun i j hij x => by simp [of_f]) x

{ι : Type v}
[Preorder ι]
{G : ι → Type w}
[(i : ι) → CommRing (G i)]
{f : (i j : ι) → i ≤ j → G i → G j}
(P : Type u₁)
[CommRing P]
[IsDirected ι fun x x_1 => x ≤ x_1]
(F : Ring.DirectLimit G f →+* P)
(x : Ring.DirectLimit G f)

F x = (Ring.DirectLimit.lift G f P (fun i => F.comp (Ring.DirectLimit.of G f i)) ⋯) x


theorem base_injective (hφ : ∀ i, Function.Injective (φ i)) :
    Function.Injective (base φ)

(hφ : ∀ (i : ι), Function.Injective ⇑(φ i))


/-- If `f` has a computable right-inverse, then the quotient by its kernel is equivalent to its
domain. -/
@[simps]
def quotientKerEquivOfRightInverse (g : β → α) (hf : Function.RightInverse g f) :
    Quotient (ker f) ≃ β

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(g : β → α)
(hf : Function.RightInverse g f)
(b : β)

(Setoid.quotientKerEquivOfRightInverse f g hf).symm b = Quotient.mk'' (g b)


theorem single_pow {b : ℕ} (_ : (a : R) ^ b = c) : (a + 0) ^ b = c + 0

{R : Type u_1}
[CommSemiring R]
{a c : R}
{b : ℕ}


theorem finite_approx_of_totallyBounded {s : Set α} (hs : TotallyBounded s) :
    ∀ ε > 0, ∃ t, t ⊆ s ∧ Set.Finite t ∧ s ⊆ ⋃ y ∈ t, ball y ε

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(hs : TotallyBounded s)
(ε : ℝ)

ε > 0 → ∃ t ⊆ s, t.Finite ∧ s ⊆ ⋃ y ∈ t, Metric.ball y ε


protected theorem mul_div_cancel' {a b : R} (hb : b ≠ 0) (hab : b ∣ a) : b * (a / b) = a

{R : Type u}
[EuclideanDomain R]
{a b : R}
(hb : b ≠ 0)
(hab : b ∣ a)


@[simp]
theorem coprime_mul_left_add_right (m n k : ℕ) : Coprime m (m * k + n) ↔ Coprime m n


@[csimp] theorem unzip_eq_unzipTR : @unzip = @unzipTR


@[continuity]
theorem continuous_normSq : Continuous (normSq : K → ℝ)


@[simp]
theorem toFinset_ssubset [Fintype s] {t : Finset α} : s.toFinset ⊂ t ↔ s ⊂ t

{α : Type u_1}
{s : Set α}
[Fintype ↑s]
{t : Finset α}


theorem rightInverse_symm (e : A ≃⋆+* B) : Function.RightInverse e.symm e

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
(e : A ≃⋆+* B)


lemma Set.biUnion_finsetSigma_univ' (s : Finset ι) (f : Π i, κ i → Set α) :
    ⋃ i ∈ s, ⋃ j, f i j = ⋃ ij ∈ s.sigma fun _ ↦ Finset.univ, f ij.1 ij.2

{ι : Type u_1}
{α : Type u_2}
{κ : ι → Type u_5}
[(i : ι) → Fintype (κ i)]
(s : Finset ι)
(f : (i : ι) → κ i → Set α)

⋃ i ∈ s, ⋃ j, f i j = ⋃ ij ∈ s.sigma fun x => Finset.univ, f ij.fst ij.snd


/-- The closure of a compact set in an R₁ space is a compact set. -/
protected theorem IsCompact.closure {K : Set X} (hK : IsCompact K) : IsCompact (closure K)

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
{K : Set X}
(hK : IsCompact K)


@[simp]
theorem filterMap_length_eq_length {l} :
    (filterMap f l).length = l.length ↔ ∀ a ∈ l, (f a).isSome

∀ {α : Type u_1} {α_1 : Type u_2} {f : α → Option α_1} {l : List α},
  (List.filterMap f l).length = l.length ↔ ∀ (a : α), a ∈ l → (f a).isSome = true


theorem GoodProducts.max_eq_o_cons_tail (l : MaxProducts C ho) :
    l.val.val = (term I ho) :: l.val.Tail.val

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(l : ↑(Profinite.NobelingProof.GoodProducts.MaxProducts C ho))

↑↑l = Profinite.NobelingProof.term I ho :: ↑(↑l).Tail


@[simp]
theorem comp_symm (e : A₁ ≃ₐ[R] A₂) : AlgHom.comp (e : A₁ →ₐ[R] A₂) ↑e.symm = AlgHom.id R A₂

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)


@[to_additive]
theorem Nonempty.one_mem_div (h : s.Nonempty) : (1 : α) ∈ s / s

{α : Type u_2}
[Group α]
{s : Set α}
(h : s.Nonempty)


theorem mem_of_mem_filter {a : α} {s} (h : a ∈ filter p s) : a ∈ s

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{a : α}
{s : Multiset α}
(h : a ∈ Multiset.filter p s)


theorem const_mul {f : α → 𝕜} (hf : Memℓp f p) (c : 𝕜) : Memℓp (fun x => c * f x) p

{α : Type u_1}
{p : ℝ≥0∞}
{𝕜 : Type u_3}
[NormedRing 𝕜]
{f : α → 𝕜}
(hf : Memℓp f p)
(c : 𝕜)


lemma mem_mutuallySingularSetSlice (κ η : Kernel α γ) (a : α) (x : γ) :
    x ∈ mutuallySingularSetSlice κ η a ↔ 1 ≤ rnDerivAux κ (κ + η) a x

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

x ∈ κ.mutuallySingularSetSlice η a ↔ 1 ≤ κ.rnDerivAux (κ + η) a x


@[simp]
theorem id_right (U : Under X) : CommaMorphism.right (𝟙 U) = 𝟙 U.right

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
(U : CategoryTheory.Under X)

(CategoryTheory.CategoryStruct.id U).right = CategoryTheory.CategoryStruct.id U.right


theorem strictMono_id [Preorder α] : StrictMono (id : α → α)


theorem inclusion_apply {I₁ I₂ : LieIdeal R L} (h : I₁ ≤ I₂) (x : I₁) :
    inclusion h x = ⟨x.1, h x.2⟩

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{I₁ I₂ : LieIdeal R L}
(h : I₁ ≤ I₂)
(x : ↥I₁)


@[simp]
lemma ofHom_neg (φ : F ⟶ G) :
    Cochain.ofHom (-φ) = -Cochain.ofHom φ

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(φ : F ⟶ G)

CochainComplex.HomComplex.Cochain.ofHom (-φ) = -CochainComplex.HomComplex.Cochain.ofHom φ


@[simp] protected theorem «forall» {p : α ⊕ β → Prop} :
    (∀ x, p x) ↔ (∀ a, p (inl a)) ∧ ∀ b, p (inr b)

{α : Type u_1}
{β : Type u_2}
{p : α ⊕ β → Prop}

(∀ (x : α ⊕ β), p x) ↔ (∀ (a : α), p (Sum.inl a)) ∧ ∀ (b : β), p (Sum.inr b)


/--
A semireal ring is a non-trivial commutative ring (with unit) in which `-1` is *not* a sum of
squares. Note that `-1` does not make sense in a semiring. Below we define the class `isSemiReal R`
for all additive monoid `R` equipped with a multiplication, a multiplicative unit and a negation.
-/
@[mk_iff]
class isSemireal [AddMonoid R] [Mul R] [One R] [Neg R] : Prop where
  non_trivial        : (0 : R) ≠ 1
  neg_one_not_SumSq  : ¬isSumSq (-1 : R)

{R : Type u_1}
[AddMonoid R]
[Mul R]
[One R]
[Neg R]
[self : isSemireal R]


@[simp]
theorem toPNat'_zero : Nat.toPNat' 0 = 1


theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(p : T.CompleteType α)
(φ : L[[α]].Sentence)

FirstOrder.Language.Formula.not φ ∈ p ↔ φ ∉ p


lemma opcyclesMap'_eq : opcyclesMap' φ h₁.right h₂.right = γ.right.φQ

(γ : CategoryTheory.ShortComplex.HomologyMapData φ h₁ h₂)

CategoryTheory.ShortComplex.opcyclesMap' φ h₁.right h₂.right = γ.right.φQ


theorem cylinder_anti (x : ∀ n, E n) {m n : ℕ} (h : m ≤ n) : cylinder x n ⊆ cylinder x m

{E : ℕ → Type u_1}
(x : (n : ℕ) → E n)
{m n : ℕ}
(h : m ≤ n)


theorem degree_add_eq_of_leadingCoeff_add_ne_zero (h : leadingCoeff p + leadingCoeff q ≠ 0) :
    degree (p + q) = max p.degree q.degree

(h : p.leadingCoeff + q.leadingCoeff ≠ 0)


@[to_additive (attr := simp, norm_cast)]
theorem coe_lt_coe : (p : E → ℝ) < q ↔ p < q

{E : Type u_4}
[AddGroup E]
{p q : AddGroupNorm E}


@[simp]
theorem lift_le {a b : Cardinal.{v}} : lift.{u, v} a ≤ lift.{u, v} b ↔ a ≤ b

Cardinal.lift.{u, v} a ≤ Cardinal.lift.{u, v} b ↔ a ≤ b


theorem finSuccEquiv'_symm_coe_above {i : Fin (n + 1)} {m : Fin n} (h : i ≤ Fin.castSucc m) :
    (finSuccEquiv' i).symm m = m.succ

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

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


protected theorem le_of_neg_le_neg {a b : Int} (h : -b ≤ -a) : a ≤ b


@[ext]
lemma ext (z₁ z₂ : Cocycle F G n) (h : (z₁ : Cochain F G n) = z₂) : z₁ = z₂

(z₁ z₂ : CochainComplex.HomComplex.Cocycle F G n)


@[simp]
lemma LSeries_smul (f : ℕ → ℂ) (c s : ℂ) : LSeries (c • f) s = c * LSeries f s


theorem equiv_symm_eq_apply {X : C} {P : Cᵒᵖ ⥤ D} {S : J.Cover X} [HasMultiequalizer (S.index P)]
    (x : Meq P S) (I : S.Arrow) :
    Multiequalizer.ι (S.index P) I ((Meq.equiv P S).symm x) = x I

{J : CategoryTheory.GrothendieckTopology C}

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

(CategoryTheory.Limits.Multiequalizer.ι (S.index P) I) ((CategoryTheory.Meq.equiv P S).symm x) = ↑x I


theorem span_gcd [DecidableEq α] (x y : α) :
    span ({gcd x y} : Set α) = span ({x, y} : Set α)

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

Ideal.span {EuclideanDomain.gcd x y} = Ideal.span {x, y}


@[to_additive (attr := simp)]
theorem iterate_map_inv {M F : Type*} [Group M] [FunLike F M M] [MonoidHomClass F M M]
    (f : F) (n : ℕ) (x : M) :
    f^[n] x⁻¹ = (f^[n] x)⁻¹

{M : Type u_5}
{F : Type u_6}
[AddGroup M]
[FunLike F M M]
[AddMonoidHomClass F M M]
(f : F)
(n : ℕ)
(x : M)


theorem eval_polynomial_eval_finSuccEquiv {n : ℕ} {x : Fin n → R}
    [CommSemiring R] (f : MvPolynomial (Fin (n + 1)) R) (q : MvPolynomial (Fin n) R) :
    (eval x) (Polynomial.eval q (finSuccEquiv R n f)) = eval (Fin.cases (eval x q) x) f

{R : Type u_1}
{n : ℕ}
{x : Fin n → R}
[CommSemiring R]
(f : MvPolynomial (Fin (n + 1)) R)
(q : MvPolynomial (Fin n) R)

(MvPolynomial.eval x) (Polynomial.eval q ((MvPolynomial.finSuccEquiv R n) f)) =
  (MvPolynomial.eval fun i => Fin.cases ((MvPolynomial.eval x) q) x i) f


theorem Squarefree.gcd_right (a : α) {b : α} (hb : Squarefree b) : Squarefree (gcd a b)

{α : Type u_2}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(a : α)
{b : α}
(hb : Squarefree b)


lemma zpow_right₀ (h : Commute a b) : ∀ m : ℤ, Commute a (b ^ m)

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(h : Commute a b)
(m : ℤ)


lemma isLocallyInjective_of_isLocallyInjective_of_isLocallySurjective_fac
    {F₁ F₂ F₃ : Cᵒᵖ ⥤ A} {f₁ : F₁ ⟶ F₂} {f₂ : F₂ ⟶ F₃} (f₃ : F₁ ⟶ F₃) (fac : f₁ ≫ f₂ = f₃)
    [IsLocallyInjective J f₃] [IsLocallySurjective J f₁] :
    IsLocallyInjective J f₂

(J : CategoryTheory.GrothendieckTopology C)


@[simp]
theorem toDual_bihimp : toDual (a ⇔ b) = toDual a ∆ toDual b

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
(a b : α)

OrderDual.toDual (a ⇔ b) = OrderDual.toDual a ∆ OrderDual.toDual b


protected theorem MeasurableSet.biUnion {f : β → Set α} {s : Set β} (hs : s.Countable)
    (h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋃ b ∈ s, f b)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{f : β → Set α}
{s : Set β}
(hs : s.Countable)
(h : ∀ b ∈ s, MeasurableSet (f b))


theorem disjoint_principal_nhdsSet : Disjoint (𝓟 s) (𝓝ˢ t) ↔ Disjoint (closure s) t

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


@[to_additive]
theorem mulIndicator_symmDiff (s t : Set α) (f : α → M) :
    mulIndicator (s ∆ t) f = mulIndicator (s \ t) f * mulIndicator (t \ s) f

{α : Type u_1}
{M : Type u_4}
[AddZeroClass M]
(s t : Set α)
(f : α → M)

(symmDiff s t).indicator f = (s \ t).indicator f + (t \ s).indicator f


@[simp, norm_cast]
lemma cast_multiset_prod [CommSemiring β] (s : Multiset ℕ) : (↑s.prod : β) = (s.map (↑)).prod

{β : Type u_3}
[CommSemiring β]
(s : Multiset ℕ)

↑s.prod = (Multiset.map Nat.cast s).prod


/-- Scalar multiplication commutes with direct sums. -/
theorem mk_smul (s : Finset ι) (c : R) (x) : mk M s (c • x) = c • mk M s x

(R : Type u)
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
(s : Finset ι)
(c : R)
(x : (i : ↑↑s) → M ↑i)

(DirectSum.mk M s) (c • x) = c • (DirectSum.mk M s) x


/--
The continuous functions from `α` to `β` are the same as the plain functions when `α` is discrete.
-/
@[simps]
def equivFnOfDiscrete [DiscreteTopology α] : C(α, β) ≃ (α → β)

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[TopologicalSpace β]
[DiscreteTopology α]
(f : α → β)

∀ (a : α), ((ContinuousMap.equivFnOfDiscrete α β).symm f) a = f a


@[simp]
lemma withDensity_zero_left (f : α → ℝ≥0∞) : (0 : Measure α).withDensity f = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
(f : α → ℝ≥0∞)

MeasureTheory.Measure.withDensity 0 f = 0


theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
    (hf' : f' ∈ maximalAtlas I M) {x : E} (hx : x ∈ ((f'.extend I).symm ≫ f.extend I).source) :
    ContDiffWithinAt 𝕜 ⊤ (f.extend I ∘ (f'.extend I).symm) (range I) x

(hf : f ∈ SmoothManifoldWithCorners.maximalAtlas I M)

(hf' : f' ∈ SmoothManifoldWithCorners.maximalAtlas I M)

ContDiffWithinAt 𝕜 ⊤ (↑(f.extend I) ∘ ↑(f'.extend I).symm) (Set.range ↑I) x


@[simp]
theorem coe_quotQuotMkₐ : ⇑(quotQuotMkₐ R I J) = quotQuotMk I J

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

⇑(DoubleQuot.quotQuotMkₐ R I J) = ⇑(DoubleQuot.quotQuotMk I J)


theorem DifferentiableOn.arsinh (h : DifferentiableOn ℝ f s) :
    DifferentiableOn ℝ (fun x => arsinh (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
(h : DifferentiableOn ℝ f s)

DifferentiableOn ℝ (fun x => Real.arsinh (f x)) s


@[simp, norm_cast] lemma coe_mk (s : Multiset α) (h : Multiset.card s = n) : mk s h = s

{α : Type u_1}
{n : ℕ}
(s : Multiset α)
(h : Multiset.card s = n)


theorem lcm_comm (m n : Nat) : lcm m n = lcm n m


theorem summable_mul_left_iff (h : a ≠ 0) : (Summable fun i ↦ a * f i) ↔ Summable f

{ι : Type u_1}
{α : Type u_4}
[DivisionSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
{a : α}
(h : a ≠ 0)

(Summable fun i => a * f i) ↔ Summable f


@[to_additive (attr := simp)]
lemma lipschitzWith_inv_iff : LipschitzWith K f⁻¹ ↔ LipschitzWith K f

{α : Type u_5}
{E : Type u_6}
[SeminormedCommGroup E]
[PseudoEMetricSpace α]
{K : ℝ≥0}
{f : α → E}


@[simp] theorem imp_iff_left_iff  : (b ↔ a → b) ↔ a ∨ b


@[simp]
theorem mk_right (f : S ⟶ T.obj Y) : (mk f).right = Y

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{S : D}
{Y : C}
{T : CategoryTheory.Functor C D}
(f : S ⟶ T.obj Y)

(CategoryTheory.StructuredArrow.mk f).right = Y


theorem isClassified_of_normalize_isPrimitiveClassified (hc : h.normalize.IsPrimitiveClassified) :
    h.IsClassified

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(hc : ⋯.IsPrimitiveClassified)


theorem id_tensor_π_preserves_coequalizer_inv_desc {W X Y Z : C} (f g : X ⟶ Y) (h : Z ⊗ Y ⟶ W)
    (wh : (Z ◁ f) ≫ h = (Z ◁ g) ≫ h) :
    (Z ◁ coequalizer.π f g) ≫
        (PreservesCoequalizer.iso (tensorLeft Z) f g).inv ≫ coequalizer.desc h wh =
      h

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

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


theorem unbounded_gt_iff [LinearOrder α] : Unbounded (· > ·) s ↔ ∀ a, ∃ b ∈ s, b ≤ a

{α : Type u_1}
{s : Set α}
[LinearOrder α]

Set.Unbounded (fun x x_1 => x > x_1) s ↔ ∀ (a : α), ∃ b ∈ s, b ≤ a


@[simp] lemma add_right_inj (μ ν₁ ν₂ : Measure α) [SigmaFinite μ] :
    μ + ν₁ = μ + ν₂ ↔ ν₁ = ν₂

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ ν₁ ν₂ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]

μ + ν₁ = μ + ν₂ ↔ ν₁ = ν₂


/-- Equivalent types give rise to multiplicatively equivalent free groups.

The converse can be found in `GroupTheory.FreeAbelianGroupFinsupp`,
as `Equiv.of_freeGroupEquiv`
 -/
@[to_additive (attr := simps apply)
  "Equivalent types give rise to additively equivalent additive free groups."]
def freeGroupCongr {α β} (e : α ≃ β) : FreeGroup α ≃* FreeGroup β

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(a : FreeGroup α)

(FreeGroup.freeGroupCongr e) a = (FreeGroup.map ⇑e) a


theorem pullback_lift_map_isPullback {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S')
    (g' : Y' ⟶ S') (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f')
    (e₂ : g ≫ i₃ = i₂ ≫ g') [Mono i₃] :
    IsPullback (pullback.lift (pullback.map f g f' g' i₁ i₂ i₃ e₁ e₂) (fst _ _) (lift_fst _ _ _))
      (pullback.lift (pullback.map f g f' g' i₁ i₂ i₃ e₁ e₂) (snd _ _) (lift_snd _ _ _))
      (pullback.fst _ _) (pullback.fst _ _)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y S X' Y' S' : C}
(f : X ⟶ S)
(g : Y ⟶ S)
(f' : X' ⟶ S')
(g' : Y' ⟶ S')
(i₁ : X ⟶ X')
(i₂ : Y ⟶ Y')
(i₃ : S ⟶ S')
(e₁ : f ≫ i₃ = i₁ ≫ f')
(e₂ : g ≫ i₃ = i₂ ≫ g')
[CategoryTheory.Mono i₃]

CategoryTheory.IsPullback
  (CategoryTheory.Limits.pullback.lift (CategoryTheory.Limits.pullback.map f g f' g' i₁ i₂ i₃ e₁ e₂)
    (CategoryTheory.Limits.pullback.fst f g) ⋯)
  (CategoryTheory.Limits.pullback.lift (CategoryTheory.Limits.pullback.map f g f' g' i₁ i₂ i₃ e₁ e₂)
    (CategoryTheory.Limits.pullback.snd f g) ⋯)
  (CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst f' g') i₁)
  (CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.snd f' g') i₂)


theorem hasSum_toReal {f : α → ℝ≥0∞} (hsum : ∑' x, f x ≠ ∞) :
    HasSum (fun x => (f x).toReal) (∑' x, (f x).toReal)

{α : Type u_1}
{f : α → ℝ≥0∞}
(hsum : ∑' (x : α), f x ≠ ⊤)

HasSum (fun x => (f x).toReal) (∑' (x : α), (f x).toReal)


theorem restrict_apply' (κ : Kernel α β) (hs : MeasurableSet s) (a : α) (ht : MeasurableSet t) :
    κ.restrict hs a t = (κ a) (t ∩ s)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{s t : Set β}
(κ : ProbabilityTheory.Kernel α β)
(hs : MeasurableSet s)
(a : α)
(ht : MeasurableSet t)


@[simp]
lemma NNReal.nndist_zero_eq_val' (z : ℝ≥0) : nndist z 0 = z


theorem subset_pointwise_smul_iff {g : G} {S T : ValuationSubring K} : S ≤ g • T ↔ g⁻¹ • S ≤ T

{K : Type u}
[Field K]
{G : Type u_1}
[Group G]
[MulSemiringAction G K]
{g : G}
{S T : ValuationSubring K}

S ≤ g • T ↔ g⁻¹ • S ≤ T


theorem iterate_toEnd_mem_lowerCentralSeries₂ (x y : L) (m : M) (k : ℕ) :
    (toEnd R L M x ∘ₗ toEnd R L M y)^[k] m ∈
      lowerCentralSeries R L M (2 * k)

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x y : L)
(m : M)
(k : ℕ)

(⇑((LieModule.toEnd R L M) x ∘ₗ (LieModule.toEnd R L M) y))^[k] m ∈ LieModule.lowerCentralSeries R L M (2 * k)


theorem not_compactSpace_iff : ¬CompactSpace X ↔ NoncompactSpace X


theorem false_of_true_iff_false (h : True ↔ False) : False


theorem image_inter {f : α → β} {s t : Set α} (H : Injective f) : f '' (s ∩ t) = f '' s ∩ f '' t

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


/-- A finite subgroup of the unit group of an integral domain is cyclic. -/
theorem isCyclic_of_subgroup_isDomain [Finite G] (f : G →* R) (hf : Injective f) : IsCyclic G

{R : Type u_1}
{G : Type u_2}
[CommRing R]
[IsDomain R]
[Group G]
[Finite G]
(f : G →* R)
(hf : Function.Injective ⇑f)


@[to_additive]
theorem prod_isUnit : ∀ {L : List M}, (∀ m ∈ L, IsUnit m) → IsUnit L.prod

{M : Type u_4}
[AddMonoid M]
{L : List M}

(∀ m ∈ L, IsAddUnit m) → IsAddUnit L.sum


theorem image_image₂_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
    (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
    (image₂ f s t).image g = image₂ f' (s.image g₁) (t.image g₂)

{f : α → β → γ}

(h_distrib : ∀ (a : α) (b : β), g (f a b) = f' (g₁ a) (g₂ b))

Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' (Finset.image g₁ s) (Finset.image g₂ t)


@[to_additive]
theorem prod_univ_three [CommMonoid β] (f : Fin 3 → β) : ∏ i, f i = f 0 * f 1 * f 2

{β : Type u_2}
[CommMonoid β]
(f : Fin 3 → β)


theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n

{x y p : ℕ}
[hp : Fact (Nat.Prime p)]
(hp1 : Odd p)
(hyx : y < x)
(hxy : p ∣ x - y)
(hx : ¬p ∣ x)
{n : ℕ}
(hn : n ≠ 0)


private theorem isLUB_sSup (s : Set (Seminorm 𝕜 E)) (hs₁ : BddAbove s) (hs₂ : s.Nonempty) :
    IsLUB s (sSup s)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(s : Set (Seminorm 𝕜 E))
(hs₁ : BddAbove s)
(hs₂ : s.Nonempty)


/-- A subgroup `H` of `G` determines a subgroup `H.op` of the opposite group `Gᵐᵒᵖ`. -/
@[to_additive (attr := simps) "An additive subgroup `H` of `G` determines an additive subgroup
`H.op` of the opposite additive group `Gᵃᵒᵖ`."]
def opEquiv : Subgroup G ≃o Subgroup Gᵐᵒᵖ

{G : Type u_2}
[AddGroup G]
(H : AddSubgroup G)


lemma spec : ∀ x : ℕ, (x : R) = 0 ↔ ringChar R ∣ x

(R : Type u_1)
[NonAssocSemiring R]
(x : ℕ)


lemma sup_image₂_right (g : γ → δ) : sup (image₂ f s t) g = sup t fun y ↦ sup s (g <| f · y)

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

(Finset.image₂ f s t).sup g = t.sup fun y => s.sup fun x => g (f x y)


lemma norm_map (φ : F) (a : A) : ‖φ a‖ = ‖a‖

{F : Type u_1}
{A : Type u_2}
{B : Type u_3}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[NormedRing B]
[NormedAlgebra ℂ B]
[CompleteSpace B]
[StarRing B]
[CstarRing B]
[EquivLike F A B]
[NonUnitalAlgEquivClass F ℂ A B]
[StarAlgEquivClass F ℂ A B]
(φ : F)
(a : A)


theorem isPairSelfAdjoint_equiv (e : M₁ ≃ₗ[R] M) (f : Module.End R M) :
    IsPairSelfAdjoint B F f ↔
      IsPairSelfAdjoint (B.compl₁₂ ↑e ↑e) (F.compl₁₂ ↑e ↑e) (e.symm.conj f)

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
{M₂ : Type u_7}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₁]
[Module R M₁]
[AddCommGroup M₂]
[Module R M₂]
{B F : M →ₗ[R] M →ₗ[R] M₂}
(e : M₁ ≃ₗ[R] M)
(f : Module.End R M)

B.IsPairSelfAdjoint F f ↔ (B.compl₁₂ ↑e ↑e).IsPairSelfAdjoint (F.compl₁₂ ↑e ↑e) (e.symm.conj f)


@[to_additive]
theorem SeminormedCommGroup.mem_closure_iff :
    a ∈ closure s ↔ ∀ ε, 0 < ε → ∃ b ∈ s, ‖a / b‖ < ε

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

a ∈ closure s ↔ ∀ (ε : ℝ), 0 < ε → ∃ b ∈ s, ‖a - b‖ < ε


@[aesop safe 20 apply (rule_sets := [Measurable])]
protected theorem sup [SemilatticeSup β] [ContinuousSup β] (hf : AEStronglyMeasurable f μ)
    (hg : AEStronglyMeasurable g μ) : AEStronglyMeasurable (f ⊔ g) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEStronglyMeasurable (f ⊔ g) μ


@[simp]
theorem restrict_toMeasure_support [MeasurableSingletonClass α] (p : PMF α) :
    Measure.restrict (toMeasure p) (support p) = toMeasure p

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

p.toMeasure.restrict p.support = p.toMeasure


/-- A right homology data for a short complex `S` induces a left homology data for `S.op`. -/
@[simps]
def op (h : S.RightHomologyData) : S.op.LeftHomologyData


theorem strictConvex_Iio (r : β) : StrictConvex 𝕜 (Iio r)

{𝕜 : Type u_1}
{β : Type u_5}
[OrderedSemiring 𝕜]
[TopologicalSpace β]
[LinearOrderedCancelAddCommMonoid β]
[OrderTopology β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r : β)


@[simp]
lemma aeval_equivPolynomial {S : Type*} [CommRing S] [Algebra S R]
    (f : PolynomialModule S S) (x : R) :
    aeval x (equivPolynomial f) = eval x (map R (Algebra.linearMap S R) f)

{R : Type u_1}
[CommRing R]
{S : Type u_6}
[CommRing S]
[Algebra S R]
(f : PolynomialModule S S)
(x : R)

(Polynomial.aeval x) (PolynomialModule.equivPolynomial f) =
  (PolynomialModule.eval x) ((PolynomialModule.map R (Algebra.linearMap S R)) f)


theorem IsCoatom.lt_iff (h : IsCoatom a) : a < x ↔ x = ⊤

{α : Type u_2}
[PartialOrder α]
[OrderTop α]
{a x : α}
(h : IsCoatom a)


@[simp]
theorem toAlgHom_toLinearMap : (e : A₁ →ₐ[R] A₂).toLinearMap = e.toLinearMap

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)


@[simp]
theorem Ioc_eq_empty (h : ¬a < b) : Ioc a b = ∅

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


@[to_additive]
theorem finprod_mem_eq_toFinset_prod (f : α → M) (s : Set α) [Fintype s] :
    ∏ᶠ i ∈ s, f i = ∏ i ∈ s.toFinset, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)
(s : Set α)
[Fintype ↑s]

∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ s.toFinset, f i


theorem isPartition_splitCenter (I : Box ι) : IsPartition (splitCenter I)

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)


@[simp]
theorem singleton_entries (a : α) (b : β a) : (singleton a b).entries = [Sigma.mk a b]

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

(AList.singleton a b).entries = [⟨a, b⟩]


@[simp]
theorem stereographic_neg_apply (v : sphere (0 : E) 1) :
    stereographic (norm_eq_of_mem_sphere (-v)) v = 0

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(v : ↑(Metric.sphere 0 1))


/-- Uses `right` co(ntra)variant. -/
@[to_additive (attr := simp) "Uses `right` co(ntra)variant."]
theorem Right.one_le_inv_iff : 1 ≤ a⁻¹ ↔ a ≤ 1

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

1 ≤ a⁻¹ ↔ a ≤ 1


@[simp]
theorem inv_lt_top {x : ℝ≥0∞} : x⁻¹ < ∞ ↔ 0 < x


/-- The unique `RingHom` from `ℤ√d` to a ring `R`, constructed by replacing `√d` with the provided
root. Conversely, this associates to every mapping `ℤ√d →+* R` a value of `√d` in `R`. -/
@[simps]
def lift {d : ℤ} : { r : R // r * r = ↑d } ≃ (ℤ√d →+* R)

{R : Type}
[CommRing R]
{d : ℤ}
(r : { r // r * r = ↑d })
(a : ℤ√d)


@[simp]
theorem card_vector [Fintype α] (n : ℕ) : Fintype.card (Vector α n) = Fintype.card α ^ n

Fintype.card (Mathlib.Vector α n) = Fintype.card α ^ n


lemma dist_anti_right_pi : AntitoneOn (dist x) (Iic x)


/-- If a set `W` is path-connected, then it is also path-connected when seen as a set in a smaller
ambient type `U` (when `U` contains `W`). -/
theorem IsPathConnected.preimage_coe {U W : Set X} (hW : IsPathConnected W) (hWU : W ⊆ U) :
    IsPathConnected (((↑) : U → X) ⁻¹' W)

{X : Type u_1}
[TopologicalSpace X]
{U W : Set X}
(hW : IsPathConnected W)
(hWU : W ⊆ U)


@[to_additive]
theorem prod_add_index [∀ i, AddCommMonoid (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    [CommMonoid γ] {f g : Π₀ i, β i} {h : ∀ i, β i → γ} (h_zero : ∀ i, h i 0 = 1)
    (h_add : ∀ i b₁ b₂, h i (b₁ + b₂) = h i b₁ * h i b₂) : (f + g).prod h = f.prod h * g.prod h

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

(h_add : ∀ (i : ι) (b₁ b₂ : β i), h i (b₁ + b₂) = h i b₁ + h i b₂)


lemma leRecOn_injective {C : ℕ → Sort*} {n m} (hnm : n ≤ m) (next : ∀ {k}, C k → C (k + 1))
    (Hnext : ∀ n, Injective (@next n)) : Injective (@leRecOn C n m hnm next)

(Hnext : ∀ (n : ℕ), Function.Injective next)

Function.Injective (Nat.leRecOn hnm fun {k} => next)


theorem fourier_one {x : AddCircle T} : fourier 1 x = toCircle x


/-- Given a map `p : I → J`, this is the functor `GradedObject I C ⥤ GradedObject J C` which
sends an `I`-object `X` to the graded object `X.mapObj p` which in degree `j : J` is given
by the coproduct of those `X i` such that `p i = j`. -/
@[simps]
noncomputable def map [∀ (j : J), HasColimitsOfShape (Discrete (p ⁻¹' {j})) C] :
    GradedObject I C ⥤ GradedObject J C

[∀ (j : J), CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete ↑(p ⁻¹' {j})) C]

(CategoryTheory.GradedObject.map C p).obj X = X.mapObj p


@[to_additive]
private theorem smul'_char (r₁ : R) (r₂ : X) (s₁ s₂ : S) (u : S) (v : R) (huv : u * r₁ = v * s₂) :
    OreLocalization.smul' r₁ s₁ r₂ s₂ = v • r₂ /ₒ (u * s₁)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[MulAction R X]
(r₁ : R)
(r₂ : X)
(s₁ s₂ u : ↥S)
(v : R)
(huv : ↑u * r₁ = v * ↑s₂)


lemma lsmul_eq_DistribMulAction_toLinearMap (r : R) :
    lsmul R M r = DistribMulAction.toLinearMap R M r

{R : Type u_1}
[CommSemiring R]
(M : Type u_5)
[AddCommMonoid M]
[Module R M]
(r : R)

(LinearMap.lsmul R M) r = DistribMulAction.toLinearMap R M r


@[simp]
theorem symm_trans_apply (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) (x : A₃) :
    (e₁.trans e₂).symm x = e₁.symm (e₂.symm x)

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
{A₃ : Type uA₃}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Semiring A₃]
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₃]
(e₁ : A₁ ≃ₐ[R] A₂)
(e₂ : A₂ ≃ₐ[R] A₃)
(x : A₃)


/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α)


@[to_additive]
lemma isUnit_pow_succ_iff : IsUnit (a ^ (n + 1)) ↔ IsUnit a

{M : Type u_1}
[Monoid M]
{n : ℕ}
{a : M}


/-- `m` is `s`-factored if and only if `m` is nonzero and all prime divisors `≤ m` of `m`
are in `s`. -/
lemma mem_factoredNumbers_iff_forall_le {s : Finset ℕ} {m : ℕ} :
    m ∈ factoredNumbers s ↔ m ≠ 0 ∧ ∀ p ≤ m, p.Prime → p ∣ m → p ∈ s

m ∈ Nat.factoredNumbers s ↔ m ≠ 0 ∧ ∀ p ≤ m, Nat.Prime p → p ∣ m → p ∈ s


theorem symmDiff_eq' : a ∆ b = (a ⊔ b) ⊓ (aᶜ ⊔ bᶜ)

{α : Type u_2}
[BooleanAlgebra α]
(a b : α)


@[to_additive]
theorem contMDiffWithinAt_finset_prod' (h : ∀ i ∈ t, ContMDiffWithinAt I' I n (f i) s x) :
    ContMDiffWithinAt I' I n (∏ i ∈ t, f i) s x


theorem dist_le_infDist_add_diam (hs : IsBounded s) (hy : y ∈ s) :
    dist x y ≤ infDist x s + diam s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x y : α}
(hs : Bornology.IsBounded s)
(hy : y ∈ s)

dist x y ≤ Metric.infDist x s + Metric.diam s


theorem r_one_pow_n : r (1 : ZMod n) ^ n = 1


@[simp, norm_cast]
theorem coe_sInf [@DecidableRel α (· ≤ ·)] (S : Set (Interval α)) :
    ↑(sInf S) = ⋂ s ∈ S, (s : Set α)

{α : Type u_1}
[CompleteLattice α]
[DecidableRel fun x x_1 => x ≤ x_1]
(S : Set (Interval α))


theorem zeroLocus_anti_mono {s t : Set R} (h : s ⊆ t) : zeroLocus t ⊆ zeroLocus s

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

PrimeSpectrum.zeroLocus t ⊆ PrimeSpectrum.zeroLocus s


@[to_additive (attr := simp)]
theorem mclosure_range (f : F) : closure (Set.range f) = mrange f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_5}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(f : F)

Submonoid.closure (Set.range ⇑f) = MonoidHom.mrange f


/-- The right whiskering of an isomorphism is an isomorphism. -/
@[simps!]
def whiskerRightIso {X Y : C} (f : X ≅ Y) (Z : C) : X ⊗ Z ≅ Y ⊗ Z

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

(CategoryTheory.MonoidalCategory.whiskerRightIso f Z).inv = CategoryTheory.MonoidalCategory.whiskerRight f.inv Z


@[simp]
theorem truncateFun_mul (x y : 𝕎 R) :
    truncateFun n (x * y) = truncateFun n x * truncateFun n y

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

WittVector.truncateFun n (x * y) = WittVector.truncateFun n x * WittVector.truncateFun n y


@[to_additive]
theorem isClosed [ContinuousMul G] (U : OpenSubgroup G) : IsClosed (U : Set G)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[ContinuousAdd G]
(U : OpenAddSubgroup G)


/-- For each object in `C`, there is a triangle of the form `(X,X,0,𝟙 X,0,0)`
-/
@[simps!]
def contractibleTriangle (X : C) : Triangle C

(CategoryTheory.Pretriangulated.contractibleTriangle X).obj₁ = X


theorem gcd_dvd_gcd_mul_left (m n k : Nat) : gcd m n ∣ gcd (k * m) n


theorem accumulate_subset_iUnion [Preorder α] (x : α) : Accumulate s x ⊆ ⋃ i, s i

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


theorem Ideal.dvdNotUnit_iff_lt {I J : Ideal A} : DvdNotUnit I J ↔ J < I

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


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


@[simp]
theorem range_map [DecidableEq γ] (g : β → γ) (f : α →ₛ β) : (f.map g).range = f.range.image g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[DecidableEq γ]
(g : β → γ)
(f : MeasureTheory.SimpleFunc α β)

(MeasureTheory.SimpleFunc.map g f).range = Finset.image g f.range


/-- The right adjoint of evaluation. -/
@[simps]
def evaluationRightAdjoint (c : C) : D ⥤ C ⥤ D

[∀ (a b : C), CategoryTheory.Limits.HasProductsOfShape (a ⟶ b) D]

∀ {X Y : C} (f : X ⟶ Y),
  ((CategoryTheory.evaluationRightAdjoint D c).obj d).map f =
    CategoryTheory.Limits.Pi.lift fun g =>
      CategoryTheory.Limits.Pi.π (fun x => d) (CategoryTheory.CategoryStruct.comp f g)


lemma binaryBiproductTriangle_distinguished (X₁ X₂ : C) :
    binaryBiproductTriangle X₁ X₂ ∈ distTriang C

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

CategoryTheory.Pretriangulated.binaryBiproductTriangle X₁ X₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


@[simp]
lemma piecewise_insert_of_ne [DecidableEq ι] {i j : ι} [∀ i, Decidable (i ∈ insert j s)]
    (h : i ≠ j) : (insert j s).piecewise f g i = s.piecewise f g i

{ι : Type u_1}
{π : ι → Sort u_2}
(s : Finset ι)
(f g : (i : ι) → π i)
[(j : ι) → Decidable (j ∈ s)]
[DecidableEq ι]
{i j : ι}
[(i : ι) → Decidable (i ∈ insert j s)]
(h : i ≠ j)


/-- If `n` is non-zero, converting the value of a `Fin n` to `Fin n` results
in the same value.  -/
@[simp] theorem cast_val_eq_self {n : ℕ} [NeZero n] (a : Fin n) : (a.val : Fin n) = a


theorem top_apply' (s : Set α) : (⊤ : OuterMeasure α) s = ⨅ h : s = ∅, 0


/-- `OneMemClass S M` says `S` is a type of subsets `s ≤ M`, such that `1 ∈ s` for all `s`. -/
class OneMemClass (S : Type*) (M : Type*) [One M] [SetLike S M] : Prop where
  /-- By definition, if we have `OneMemClass S M`, we have `1 ∈ s` for all `s : S`. -/
  one_mem : ∀ s : S, (1 : M) ∈ s

{S : Type u_4}
{M : Type u_5}
[One M]
[SetLike S M]
[self : OneMemClass S M]
(s : S)


theorem comp_le_lemma {X Y Z : Dial C} (F : Dial.Hom X Y) (G : Dial.Hom Y Z) :
    (Subobject.pullback π(π₁, π(π₁, prod.map F.f (𝟙 _) ≫ G.F) ≫ F.F)).obj X.rel ≤
    (Subobject.pullback (prod.map (F.f ≫ G.f) (𝟙 Z.tgt))).obj Z.rel

(CategoryTheory.Subobject.pullback
        (CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst
          (CategoryTheory.CategoryStruct.comp
            (CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst
              (CategoryTheory.CategoryStruct.comp
                (CategoryTheory.Limits.prod.map F.f (CategoryTheory.CategoryStruct.id Z.tgt)) G.F))
            F.F))).obj
    X.rel ≤
  (CategoryTheory.Subobject.pullback
        (CategoryTheory.Limits.prod.map (CategoryTheory.CategoryStruct.comp F.f G.f)
          (CategoryTheory.CategoryStruct.id Z.tgt))).obj
    Z.rel


@[to_additive min_le_of_add_le_two_nsmul]
theorem min_le_of_mul_le_sq {a b c : M} (h : a * b ≤ c ^ 2) : min a b ≤ c

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

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


/-- The image under a monotone function on a set `t` of a subset which has a lower bound in `t`
  is bounded below. -/
theorem map_bddBelow (Hf : MonotoneOn f t) (Hst : s ⊆ t) :
    (lowerBounds s ∩ t).Nonempty → BddBelow (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
(Hf : MonotoneOn f t)
(Hst : s ⊆ t)


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

(F : CategoryTheory.MonoidalFunctor V W)


theorem Iio_mem_nhdsSet_Ico (h : b ≤ c) : Iio c ∈ 𝓝ˢ (Ico a b)

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


/-- **Kolmogorov's 0-1 law**, kernel version: any event in the tail σ-algebra of an independent
sequence of sub-σ-algebras has probability 0 or 1 almost surely. -/
theorem Kernel.measure_zero_or_one_of_measurableSet_limsup_atBot (h_le : ∀ n, s n ≤ m0)
    (h_indep : iIndep s κ μα) {t : Set Ω} (ht_tail : MeasurableSet[limsup s atBot] t) :
    ∀ᵐ a ∂μα, κ a t = 0 ∨ κ a t = 1

(h_indep : ProbabilityTheory.Kernel.iIndep s κ μα)

∀ᵐ (a : α) ∂μα, (κ a) t = 0 ∨ (κ a) t = 1


theorem sum_const_nat (m n : ℕ) : sum (replicate m n) = m * n


/-- A scheme is locally Noetherian if and only if it is covered by affine opens whose sections
are noetherian rings.

See [Har77], Proposition II.3.2. -/
theorem isLocallyNoetherian_iff_of_iSup_eq_top {ι} {S : ι → X.affineOpens}
    (hS : (⨆ i, S i : X.Opens) = ⊤) :
    IsLocallyNoetherian X ↔ ∀ i, IsNoetherianRing Γ(X, S i)

{X : AlgebraicGeometry.Scheme}
{ι : Sort u_1}
{S : ι → ↑X.affineOpens}
(hS : ⨆ i, ↑(S i) = ⊤)

AlgebraicGeometry.IsLocallyNoetherian X ↔ ∀ (i : ι), IsNoetherianRing ↑Γ(X, ↑(S i))


theorem map_add_le (x y : V) : e (x + y) ≤ e x + e y

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(e : ENorm 𝕜 V)
(x y : V)


theorem toNonUnitalSubring_inj {S U : NonUnitalSubalgebra R A} :
    S.toNonUnitalSubring = U.toNonUnitalSubring ↔ S = U

{R : Type u}
{A : Type v}
[CommRing R]
[NonUnitalNonAssocRing A]
[Module R A]
{S U : NonUnitalSubalgebra R A}


theorem iInf₂_eq_top {f : ∀ i, κ i → α} : ⨅ (i) (j), f i j = ⊤ ↔ ∀ i j, f i j = ⊤

{α : Type u_1}
{ι : Sort u_5}
{κ : ι → Sort u_7}
[CompleteLattice α]
{f : (i : ι) → κ i → α}

⨅ i, ⨅ j, f i j = ⊤ ↔ ∀ (i : ι) (j : κ i), f i j = ⊤


@[to_additive]
theorem mulIndicator_div' (s : Set α) (f g : α → G) :
    mulIndicator s (f / g) = mulIndicator s f / mulIndicator s g

{α : Type u_1}
{G : Type u_6}
[Group G]
(s : Set α)
(f g : α → G)

s.mulIndicator (f / g) = s.mulIndicator f / s.mulIndicator g


@[simp]
theorem Factors.piQuotientEquiv_map (p : Ideal R) (hp : map (algebraMap R S) p ≠ ⊥) (x : R) :
    Factors.piQuotientEquiv p hp (algebraMap _ _ x) = fun _ =>
      Ideal.Quotient.mk _ (algebraMap _ _ x)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
[IsDedekindDomain S]
[Algebra R S]
(p : Ideal R)
(hp : Ideal.map (algebraMap R S) p ≠ ⊥)
(x : R)

(Ideal.Factors.piQuotientEquiv p hp) ((algebraMap R (S ⧸ Ideal.map (algebraMap R S) p)) x) = fun x_1 =>
  (Ideal.Quotient.mk (↑x_1 ^ Ideal.ramificationIdx (algebraMap R S) p ↑x_1)) ((algebraMap R S) x)


theorem mdifferentiableAt_id : MDifferentiableAt I I (@id M) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{x : M}


/-- Chord-length is always less than arc-length. -/
lemma norm_sub_le_angle (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) : ‖x - y‖ ≤ angle x y

‖x - y‖ ≤ InnerProductGeometry.angle x y


theorem mapAccumr₂_eq_foldr {σ φ : Type*} (f : α → β → σ → σ × φ) :
    ∀ (as : List α) (bs : List β) (s : σ),
    mapAccumr₂ f as bs s = foldr (fun ab s =>
                              let r := f ab.1 ab.2 s.1
                              (r.1, r.2 :: s.2)
                            ) (s, []) (as.zip bs)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
{φ : Type u_5}
(f : α → β → σ → σ × φ)
(as : List α)
(bs : List β)
(s : σ)

List.mapAccumr₂ f as bs s =
  List.foldr
    (fun ab s =>
      let r := f ab.1 ab.2 s.1;
      (r.1, r.2 :: s.2))
    (s, []) (as.zip bs)


@[norm_cast, simp]
theorem Rat.coe_nnabs (x : ℚ) : (Rat.nnabs x : ℚ) = abs x


@[simp] theorem counit_eq_from (A : Comon_ C) : A.counit = terminal.from A.X

A.counit = CategoryTheory.Limits.terminal.from A.X


@[simp]
theorem trans_refl (e : α ≃o β) : e.trans (refl β) = e

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)


/-- Torsion submonoids are torsion. -/
@[to_additive "Additive torsion submonoids are additively torsion."]
theorem torsion.isTorsion : IsTorsion <| torsion G


theorem comap_injective {f : α → β} (hf : Surjective f) : Injective (comap f)

{α : Type u}
{β : Type v}
{f : α → β}
(hf : Function.Surjective f)


theorem finite_of_encard_eq_coe {k : ℕ} (h : s.encard = k) : s.Finite

{α : Type u_1}
{s : Set α}
{k : ℕ}
(h : s.encard = ↑k)


/-- The second element of a chain is irreducible. -/
theorem second_of_chain_is_irreducible {q : Associates M} {n : ℕ} (hn : n ≠ 0)
    {c : Fin (n + 1) → Associates M} (h₁ : StrictMono c) (h₂ : ∀ {r}, r ≤ q ↔ ∃ i, r = c i)
    (hq : q ≠ 0) : Irreducible (c 1)

(h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i)


@[reassoc (attr := simp)]
lemma singleObjHomologySelfIso_hom_singleObjHomologySelfIso_inv :
    (singleObjCyclesSelfIso c j A).hom ≫ (singleObjHomologySelfIso c j A).inv =
      ((single C c j).obj A).homologyπ j

(HomologicalComplex.singleObjCyclesSelfIso c j A).hom ≫ (HomologicalComplex.singleObjHomologySelfIso c j A).inv =
  ((HomologicalComplex.single C c j).obj A).homologyπ j


@[simp] lemma nil_nil : (nil : G.Walk u u).Nil

{V : Type u}
{G : SimpleGraph V}
{u : V}


protected theorem Reachable.elim_path {p : Prop} {u v : V} (h : G.Reachable u v)
    (hp : G.Path u v → p) : p

{V : Type u}
{G : SimpleGraph V}
{p : Prop}
{u v : V}
(h : G.Reachable u v)
(hp : G.Path u v → p)


@[simp] theorem floor_sub_one (a : α) : ⌊a - 1⌋ = ⌊a⌋ - 1

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


protected theorem image_compl {α β} (f : Equiv α β) (s : Set α) : f '' sᶜ = (f '' s)ᶜ

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


theorem total_onFinset {s : Finset α} {f : α → R} (g : α → M) (hf : ∀ a, f a ≠ 0 → a ∈ s) :
    Finsupp.total α M R g (Finsupp.onFinset s f hf) = Finset.sum s fun x : α => f x • g x

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Finset α}
{f : α → R}
(g : α → M)
(hf : ∀ (a : α), f a ≠ 0 → a ∈ s)

(Finsupp.total α M R g) (Finsupp.onFinset s f hf) = ∑ x ∈ s, f x • g x


@[to_additive (attr := ext)]
theorem ext : (∀ x, p x = q x) → p = q

{E : Type u_4}
[Group E]
{p q : GroupSeminorm E}


/-- The `R`-subalgebra of `S`-integers of `K`. -/
@[simps!]
def integer : Subalgebra R K

(S : Set (IsDedekindDomain.HeightOneSpectrum R))

↑(S.integer K) = {x | ∀ v ∉ S, v.valuation x ≤ 1}


theorem associated_isUnit_mul_left_iff {β : Type*} [CommMonoid β] {u a b : β} (hu : IsUnit u) :
    Associated (u * a) b ↔ Associated a b

{β : Type u_5}
[CommMonoid β]
{u a b : β}
(hu : IsUnit u)


@[simp]
theorem pairFunction_left (X Y : C) : pairFunction X Y left = X

CategoryTheory.Limits.pairFunction X Y CategoryTheory.Limits.WalkingPair.left = X


/-- Define what it means for a functor `F : C ⥤ D` to reflect isomorphisms: for any
morphism `f : A ⟶ B`, if `F.map f` is an isomorphism then `f` is as well.
Note that we do not assume or require that `F` is faithful.
-/
class Functor.ReflectsIsomorphisms (F : C ⥤ D) : Prop where
  /-- For any `f`, if `F.map f` is an iso, then so was `f`-/
  reflects : ∀ {A B : C} (f : A ⟶ B) [IsIso (F.map f)], IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
[self : F.ReflectsIsomorphisms]
{A B : C}
(f : A ⟶ B)
[CategoryTheory.IsIso (F.map f)]


theorem isStrictWeakOrder_of_isTotalPreorder {α : Sort u} {le : α → α → Prop} {lt : α → α → Prop}
    [DecidableRel le] [IsTotalPreorder α le] (h : ∀ a b, lt a b ↔ ¬le b a) :
    IsStrictWeakOrder α lt

{α : Sort u}
{le lt : α → α → Prop}
[DecidableRel le]
[IsTotalPreorder α le]
(h : ∀ (a b : α), lt a b ↔ ¬le b a)


@[simp]
theorem div_I (z : ℂ) : z / I = -(z * I)


/-- Local instance for `OrientedOrd (ord.on f)`. -/
theorem OrientedOrd.instOn [ord : Ord β] [OrientedOrd β] (f : α → β) : @OrientedOrd _ (ord.on f)

{β : Type u_1}
{α : Type u_2}
[ord : Ord β]
[Batteries.OrientedOrd β]
(f : α → β)


/-- We compute the absolute discriminant of a `p`-th cyclotomic field where `p` is prime. -/
theorem absdiscr_prime [IsCyclotomicExtension {p} ℚ K] :
    haveI : NumberField K := IsCyclotomicExtension.numberField {p} ℚ K
    NumberField.discr K = (-1) ^ (((p : ℕ) - 1) / 2) * p ^ ((p : ℕ) - 2)

(p : ℕ+)
(K : Type u)
[Field K]
[CharZero K]
[hp : Fact (Nat.Prime ↑p)]
[IsCyclotomicExtension {p} ℚ K]

NumberField.discr K = (-1) ^ ((↑p - 1) / 2) * ↑↑p ^ (↑p - 2)


/-- Dropping the elements up to `n` in `l₁ ++ l₂` is the same as dropping the elements up to `n`
in `l₁`, dropping the elements up to `n - l₁.length` in `l₂`, and appending them. -/
theorem drop_append_eq_append_drop {l₁ l₂ : List α} {n : Nat} :
    drop n (l₁ ++ l₂) = drop n l₁ ++ drop (n - l₁.length) l₂

{α : Type u_1}
{l₁ l₂ : List α}
{n : Nat}

List.drop n (l₁ ++ l₂) = List.drop n l₁ ++ List.drop (n - l₁.length) l₂


@[simp]
theorem coe_of (α : Type*) [CompleteLattice α] : ↥(of α) = α


theorem Finset.prod_nonneg_of_card_nonpos_even {α β : Type*} [LinearOrderedCommRing β] {f : α → β}
    [DecidablePred fun x => f x ≤ 0] {s : Finset α} (h0 : Even (s.filter fun x => f x ≤ 0).card) :
    0 ≤ ∏ x ∈ s, f x

(h0 : Even (Finset.filter (fun x => f x ≤ 0) s).card)


/-- If A is an R-algebra all of whose elements are integral over R,
and x is an element of an A-algebra that is integral over A, then x is integral over R. -/
theorem isIntegral_trans [Algebra.IsIntegral R A] (x : B) (hx : IsIntegral A x) :
    IsIntegral R x

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommRing R]
[CommRing A]
[Ring B]
[Algebra A B]
[Algebra R B]
[Algebra R A]
[IsScalarTower R A B]
[Algebra.IsIntegral R A]
(x : B)
(hx : IsIntegral A x)


theorem of_rat_sub (h : Irrational (q - x)) : Irrational x

(q : ℚ)
{x : ℝ}
(h : Irrational (↑q - x))


/-- If a measure `μ` is left-invariant and satisfies the right scaling condition, then it
  satisfies `QuotientMeasureEqMeasurePreimage`. -/
@[to_additive "If a measure `μ` is
left-invariant and satisfies the right scaling condition, then it satisfies
`AddQuotientMeasureEqMeasurePreimage`."]
theorem MeasureTheory.leftInvariantIsQuotientMeasureEqMeasurePreimage [IsFiniteMeasure μ]
    [hasFun : HasFundamentalDomain Γ.op G ν]
    (h : covolume Γ.op G ν = μ univ) : QuotientMeasureEqMeasurePreimage ν μ

[hasFun : MeasureTheory.HasAddFundamentalDomain (↥Γ.op) G ν]

(h : MeasureTheory.addCovolume (↥Γ.op) G ν = μ Set.univ)


/-- If `x ≠ y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x ∈ closedBall z r) (hy : y ∈ closedBall z r)
    (hne : x ≠ y) : openSegment ℝ x y ⊆ ball z r

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y z : E}
{r : ℝ}
(hx : x ∈ Metric.closedBall z r)
(hy : y ∈ Metric.closedBall z r)
(hne : x ≠ y)


/-- Bounding the Hausdorff distance by bounding the distance of any point
in each set to the other set -/
theorem hausdorffDist_le_of_infDist {r : ℝ} (hr : 0 ≤ r) (H1 : ∀ x ∈ s, infDist x t ≤ r)
    (H2 : ∀ x ∈ t, infDist x s ≤ r) : hausdorffDist s t ≤ r

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
{r : ℝ}
(hr : 0 ≤ r)
(H1 : ∀ x ∈ s, Metric.infDist x t ≤ r)
(H2 : ∀ x ∈ t, Metric.infDist x s ≤ r)


theorem iInf_iSup_ge_nat_add :
    ∀ (f : ℕ → α) (k : ℕ), ⨅ n, ⨆ i ≥ n, f (i + k) = ⨅ n, ⨆ i ≥ n, f i

{α : Type u_1}
[CompleteLattice α]
(f : ℕ → α)
(k : ℕ)

⨅ n, ⨆ i, ⨆ (_ : i ≥ n), f (i + k) = ⨅ n, ⨆ i, ⨆ (_ : i ≥ n), f i


theorem Monad.left_comparison (h : L ⊣ R) : L ⋙ Monad.comparison h = h.toMonad.free

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

L.comp (CategoryTheory.Monad.comparison h) = h.toMonad.free


@[simp]
theorem filter_apply_pos {a : α} (h : p a) : f.filter p a = f a

{α : Type u_1}
{M : Type u_5}
[Zero M]
(p : α → Prop)
[DecidablePred p]
(f : α →₀ M)
{a : α}
(h : p a)


theorem UniformSpace.toCore_toTopologicalSpace (u : UniformSpace α) :
    u.toCore.toTopologicalSpace = u.toTopologicalSpace


lemma dist_pi_le_iff {f g : ∀ b, π b} {r : ℝ} (hr : 0 ≤ r) :
    dist f g ≤ r ↔ ∀ b, dist (f b) (g b) ≤ r

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoMetricSpace (π b)]
{f g : (b : β) → π b}
{r : ℝ}
(hr : 0 ≤ r)

dist f g ≤ r ↔ ∀ (b : β), dist (f b) (g b) ≤ r


lemma Module.finitePresentation_of_free [Module.Free R M] [Module.Finite R M] :
    Module.FinitePresentation R M

(R : Type u_1)
(M : Type u_2)
[Ring R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]


lemma CFC.eq_zero_of_spectrum_subset_zero (h_spec : spectrum R a ⊆ {0}) (ha : p a := by cfc_tac) :
    a = 0

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
(a : A)
(h_spec : spectrum R a ⊆ {0})
(ha : p a := by cfc_tac)


@[to_additive (attr := simp)]
theorem leftInvEquiv_symm_fromLeftInv (x : S.leftInv) :
    (S.leftInvEquiv hS).symm (S.fromLeftInv x) = x

{M : Type u_1}
[CommMonoid M]
(S : Submonoid M)
(hS : S ≤ IsUnit.submonoid M)
(x : ↥S.leftInv)


lemma sum_pow_eq_sum_piAntidiag (s : Finset α) (f : α → R) (n : ℕ) :
    (∑ i in s, f i) ^ n = ∑ k in piAntidiag s n, multinomial s k * ∏ i in s, f i ^ k i

{α : Type u_1}
{R : Type u_2}
[DecidableEq α]
[CommSemiring R]
(s : Finset α)
(f : α → R)
(n : ℕ)

(∑ i ∈ s, f i) ^ n = ∑ k ∈ s.piAntidiag n, ↑(Nat.multinomial s k) * ∏ i ∈ s, f i ^ k i


theorem gcd_union [DecidableEq β] : (s₁ ∪ s₂).gcd f = GCDMonoid.gcd (s₁.gcd f) (s₂.gcd f)

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s₁ s₂ : Finset β}
{f : β → α}
[DecidableEq β]

(s₁ ∪ s₂).gcd f = gcd (s₁.gcd f) (s₂.gcd f)


theorem transAssocReparamAux_one : transAssocReparamAux 1 = 1

Path.Homotopy.transAssocReparamAux 1 = 1


theorem proj_apply (i : ι) (b : (i : ι) → φ i) : (proj i : ((i : ι) → φ i) →ₗ[R] φ i) b = b i

{R : Type u}
{ι : Type x}
[Semiring R]
{φ : ι → Type i}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
(i : ι)
(b : (i : ι) → φ i)


@[simp, norm_cast]
theorem coe_comp' (h : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) : ⇑(h.comp f) = h ∘ f

{R₁ : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₂ M₂]
[Module R₃ M₃]
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(h : M₂ →SL[σ₂₃] M₃)
(f : M₁ →SL[σ₁₂] M₂)


/-- The norm of `a : S` in `R` can be computed in `Sₘ`. -/
lemma Algebra.norm_eq_iff [Module.Free R S] [Module.Finite R S] {a : S} {b : R}
    (hM : M ≤ nonZeroDivisors R) : Algebra.norm R a = b ↔
      (Algebra.norm Rₘ) ((algebraMap S Sₘ) a) = algebraMap R Rₘ b

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

(Algebra.norm R) a = b ↔ (Algebra.norm Rₘ) ((algebraMap S Sₘ) a) = (algebraMap R Rₘ) b


@[reassoc (attr := simp)]
lemma homologyι_comp_fromOpcycles :
    K.homologyι i ≫ K.fromOpcycles i j = 0


theorem LinearIndependent.ne_zero [Nontrivial R] (i : ι) (hv : LinearIndependent R v) : v i ≠ 0

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Nontrivial R]
(i : ι)
(hv : LinearIndependent R v)


theorem lt_iff_lt_of_le_iff_le' {β} [Preorder α] [Preorder β] {a b : α} {c d : β}
    (H : a ≤ b ↔ c ≤ d) (H' : b ≤ a ↔ d ≤ c) : b < a ↔ d < c

{α : Type u_2}
{β : Type u_5}
[Preorder α]
[Preorder β]
{a b : α}
{c d : β}
(H : a ≤ b ↔ c ≤ d)
(H' : b ≤ a ↔ d ≤ c)


theorem pow_add {b₁ b₂ : ℕ} {d : R}
    (_ : a ^ b₁ = c₁) (_ : a ^ b₂ = c₂) (_ : c₁ * c₂ = d) : (a : R) ^ (b₁ + b₂) = d

{R : Type u_1}
[CommSemiring R]
{a c₁ c₂ : R}
{b₁ b₂ : ℕ}
{d : R}

a ^ b₁ = c₁ → a ^ b₂ = c₂ → c₁ * c₂ = d → a ^ (b₁ + b₂) = d


theorem mkPiRing_apply_one_eq_self (f : ContinuousMultilinearMap R (fun _ : ι => R) M) :
    ContinuousMultilinearMap.mkPiRing R ι (f fun _ => 1) = f

(f : ContinuousMultilinearMap R (fun x => R) M)

ContinuousMultilinearMap.mkPiRing R ι (f fun x => 1) = f


@[simp]
theorem decode_prod_val (n : ℕ) :
    (@decode (α × β) _ n : Option (α × β))
      = (decode n.unpair.1).bind fun a => (decode n.unpair.2).map <| Prod.mk a

{α : Type u_1}
{β : Type u_2}
[Encodable α]
[Encodable β]
(n : ℕ)

Encodable.decode n =
  (Encodable.decode (Nat.unpair n).1).bind fun a => Option.map (Prod.mk a) (Encodable.decode (Nat.unpair n).2)


@[simp, norm_cast]
protected theorem coe_nnnorm (f : Lp E p μ) : (‖f‖₊ : ℝ) = ‖f‖

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p μ))


theorem eq_of_le_of_domain_eq {f g : E →ₗ.[R] F} (hle : f ≤ g) (heq : f.domain = g.domain) :
    f = g

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f g : E →ₗ.[R] F}
(hle : f ≤ g)
(heq : f.domain = g.domain)


theorem Ico_mem_nhdsSet_Ico (h : a < b) (h' : c ≤ d) : Ico a d ∈ 𝓝ˢ (Ico b c)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c d : α}
(h : a < b)
(h' : c ≤ d)


theorem y_mul_dvd (n) : ∀ k, yn a1 n ∣ yn a1 (n * k)


@[simp, norm_cast]
theorem _root_.Submodule.coe_subtypeL (p : Submodule R₁ M₁) :
    (p.subtypeL : p →ₗ[R₁] M₁) = p.subtype

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


@[reassoc]
theorem prod.map_id_comp {X Y Z W : C} (f : X ⟶ Y) (g : Y ⟶ Z) [HasBinaryProduct W X]
    [HasBinaryProduct W Y] [HasBinaryProduct W Z] :
    prod.map (𝟙 W) (f ≫ g) = prod.map (𝟙 W) f ≫ prod.map (𝟙 W) g

CategoryTheory.Limits.prod.map (𝟙 W) (f ≫ g) =
  CategoryTheory.Limits.prod.map (𝟙 W) f ≫ CategoryTheory.Limits.prod.map (𝟙 W) g


@[simp]
theorem mul_integral_comp_mul_right : (c * ∫ x in a..b, f (x * c)) = ∫ x in a * c..b * c, f x

c * ∫ (x : ℝ) in a..b, f (x * c) = ∫ (x : ℝ) in a * c..b * c, f x


/-- Construct a closure operator from an inflationary function `f` and a "closedness" predicate `p`
witnessing minimality of `f x` among closed elements greater than `x`. -/
@[simps!]
def ofPred (f : α → α) (p : α → Prop) (hf : ∀ x, x ≤ f x) (hfp : ∀ x, p (f x))
    (hmin : ∀ ⦃x y⦄, x ≤ y → p y → f x ≤ y) : ClosureOperator α

(hmin : ∀ ⦃x y : α⦄, x ≤ y → p y → f x ≤ y)

∀ (a : α), (ClosureOperator.ofPred f p hf hfp hmin) a = f a


lemma Continuous.bounded_above_of_compact_support (hf : Continuous f) (h : HasCompactSupport f) :
    ∃ C, ∀ x, ‖f x‖ ≤ C

{α : Type u_1}
{E : Type u_3}
[NormedAddGroup E]
[TopologicalSpace α]
{f : α → E}
(hf : Continuous f)
(h : HasCompactSupport f)


theorem embeddingPiTangent_injective (f : SmoothBumpCovering ι I M) :
    Injective f.embeddingPiTangent

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[T2Space M]
[hi : Fintype ι]
(f : SmoothBumpCovering ι I M)


protected theorem bijective : Bijective e

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


theorem ext_iff {α β} {f g : Embedding α β} : (∀ x, f x = g x) ↔ f = g

{α : Sort u_1}
{β : Sort u_2}
{f g : α ↪ β}


theorem frontier_prod_eq (s : Set X) (t : Set Y) :
    frontier (s ×ˢ t) = closure s ×ˢ frontier t ∪ frontier s ×ˢ closure t

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(s : Set X)
(t : Set Y)


/-- A type-class stating that the following diagram of scalar towers
R  →  S
↓     ↓
R' →  S'
is a pushout diagram (i.e. `S' = S ⊗[R] R'`)
-/
@[mk_iff]
class Algebra.IsPushout : Prop where
  out : IsBaseChange S (toAlgHom R R' S').toLinearMap

{R : Type u_1}
{S : Type v₃}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
{R' : Type u_6}
{S' : Type u_7}
[CommSemiring R']
[CommSemiring S']
[Algebra R R']
[Algebra S S']
[Algebra R' S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
[self : Algebra.IsPushout R S R' S']

IsBaseChange S (IsScalarTower.toAlgHom R R' S').toLinearMap


lemma lt_add_one [One α] [AddZeroClass α] [PartialOrder α] [ZeroLEOneClass α]
    [NeZero (1 : α)] [CovariantClass α α (·+·) (·<·)] (a : α) : a < a + 1

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


theorem fourier_add {m n : ℤ} {x : AddCircle T} : fourier (m+n) x = fourier m x * fourier n x

(fourier (m + n)) x = (fourier m) x * (fourier n) x


@[simp]
protected theorem coe_coe {F : Type*} [FunLike F A B] [AlgHomClass F R A B]
    [StarAlgHomClass F R A B] (f : F) :
    ⇑(f : A →⋆ₐ[R] B) = f

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
{F : Type u_7}
[FunLike F A B]
[AlgHomClass F R A B]
[StarAlgHomClass F R A B]
(f : F)


theorem num_denom_add (x y : RatFunc K) :
    (x + y).num * (x.denom * y.denom) = (x.num * y.denom + x.denom * y.num) * (x + y).denom

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


/-- Intermediate stage of assembling the unit. -/
@[simps! hom]
def unitAux (η : Over A) : (restrictedYoneda A ⋙ costructuredArrowPresheafToOver A).obj η ≅ η

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

(CategoryTheory.OverPresheafAux.unitAux η).hom =
  { left := (CategoryTheory.OverPresheafAux.unitAuxAux η.hom).hom,
    right := CategoryTheory.CategoryStruct.id { as := PUnit.unit }, w := ⋯ }


/-- Homotopy between morphisms of short complexes is compatible with precomposition. -/
@[simps]
def compLeft (h : Homotopy φ₁ φ₂) (ψ : S₃ ⟶ S₁) : Homotopy (ψ ≫ φ₁) (ψ ≫ φ₂)

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

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

(h.compLeft ψ).h₂ = CategoryTheory.CategoryStruct.comp ψ.τ₃ h.h₂


@[to_additive add.instNeBot]
protected lemma mul.instNeBot [NeBot f] [NeBot g] : NeBot (f * g)


theorem IndepFun.comp {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'}
    {_mγ : MeasurableSpace γ} {_mγ' : MeasurableSpace γ'} {φ : β → γ} {ψ : β' → γ'}
    (hfg : IndepFun f g μ) (hφ : Measurable φ) (hψ : Measurable ψ) :
    IndepFun (φ ∘ f) (ψ ∘ g) μ

(hfg : ProbabilityTheory.IndepFun f g μ)

ProbabilityTheory.IndepFun (φ ∘ f) (ψ ∘ g) μ


theorem fromGlued_open_map : IsOpenMap 𝒰.fromGlued.1.base

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)


@[simp]
theorem map₂_bot_left : map₂ m ⊥ g = ⊥

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{g : Filter β}


@[simp]
theorem differentiableOn_const_add_iff (c : F) :
    DifferentiableOn 𝕜 (fun y => c + f y) s ↔ DifferentiableOn 𝕜 f s

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


theorem Set.Finite.closure_biUnion {ι : Type*} {s : Set ι} (hs : s.Finite) (f : ι → Set X) :
    closure (⋃ i ∈ s, f i) = ⋃ i ∈ s, closure (f i)

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


theorem algebraMap_quotient_injective {I : Ideal A} [Algebra R A] :
    Function.Injective (algebraMap (R ⧸ I.comap (algebraMap R A)) (A ⧸ I))

{R : Type u}
[CommRing R]
{A : Type u_3}
[CommRing A]
{I : Ideal A}
[Algebra R A]

Function.Injective ⇑(algebraMap (R ⧸ Ideal.comap (algebraMap R A) I) (A ⧸ I))


@[simp] theorem getLeft_eq_iff (h : x.isLeft) : x.getLeft h = a ↔ x = inl a

∀ {α : Type u_1} {a : α} {β : Type u_2} {x : α ⊕ β} (h : x.isLeft = true), x.getLeft h = a ↔ x = Sum.inl a


theorem isBounded_Ioc (a b : α) : IsBounded (Ioc a b)

{α : Type u}
[PseudoMetricSpace α]
[Preorder α]
[CompactIccSpace α]
(a b : α)


theorem mem_setOf {a : α} {p : α → Prop} : a ∈ { x | p x } ↔ p a


theorem add_conj (z : K) : z + conj z = 2 * re z

z + (starRingEnd K) z = 2 * ↑(RCLike.re z)


theorem one_def : (1 : G →+c[a, a] G) = .id


theorem map_specializes (f : C(α, β)) {x y : α} (h : x ⤳ y) : f x ⤳ f y

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : C(α, β))
{x y : α}
(h : x ⤳ y)


/-- Since `colimit_limit_to_limit_colimit` is a morphism from a colimit to a limit,
this lemma characterises it.
-/
@[reassoc (attr := simp)]
theorem ι_colimitLimitToLimitColimit_π (j) (k) :
    colimit.ι _ k ≫ colimitLimitToLimitColimit F ≫ limit.π _ j =
      limit.π ((curry.obj (Prod.swap K J ⋙ F)).obj k) j ≫ colimit.ι ((curry.obj F).obj j) k

CategoryTheory.Limits.colimit.ι
      (CategoryTheory.curry.obj (CategoryTheory.Prod.swap K J ⋙ F) ⋙ CategoryTheory.Limits.lim) k ≫
    CategoryTheory.Limits.colimitLimitToLimitColimit F ≫
      CategoryTheory.Limits.limit.π (CategoryTheory.curry.obj F ⋙ CategoryTheory.Limits.colim) j =
  CategoryTheory.Limits.limit.π ((CategoryTheory.curry.obj (CategoryTheory.Prod.swap K J ⋙ F)).obj k) j ≫
    CategoryTheory.Limits.colimit.ι ((CategoryTheory.curry.obj F).obj j) k


theorem mul_slash_SL2 (k1 k2 : ℤ) (A : SL(2, ℤ)) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = f ∣[k1] A * g ∣[k2] A


@[to_additive (attr := simp)]
theorem zpow_smul_mod_minimalPeriod (n : ℤ) :
    a ^ (n % (minimalPeriod (a • ·) b : ℤ)) • b = a ^ n • b

{α : Type v}
{G : Type u}
[Group G]
[MulAction G α]
(a : G)
(b : α)
(n : ℤ)

a ^ (n % ↑(Function.minimalPeriod (fun x => a • x) b)) • b = a ^ n • b


@[to_additive (attr := simp)]
theorem quot_mk_eq_coe {M : Type*} [Mul M] (c : Con M) (x : M) : Quot.mk c x = (x : c.Quotient)

{M : Type u_4}
[Add M]
(c : AddCon M)
(x : M)


theorem comap_apply (κ : Kernel α β) (hg : Measurable g) (c : γ) : comap κ g hg c = κ (g c)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{g : γ → α}
(κ : ProbabilityTheory.Kernel α β)
(hg : Measurable g)
(c : γ)


lemma Equation.map {x y : R} (h : W.Equation x y) : Equation (W.map f) (f x) (f y)

{R : Type u}
[CommRing R]
{W : WeierstrassCurve.Affine R}
{S : Type v}
[CommRing S]
(f : R →+* S)
{x y : R}
(h : W.Equation x y)

WeierstrassCurve.Affine.Equation (WeierstrassCurve.map W f) (f x) (f y)


theorem cpow_neg (x y : ℂ) : x ^ (-y) = (x ^ y)⁻¹


@[to_additive]
theorem self_pow (a : M) (n : ℕ) : Commute a (a ^ n)

{M : Type u_2}
[Monoid M]
(a : M)
(n : ℕ)


protected theorem tendsto_nhds_of_Icc {f : Filter α} {u : α → ℝ≥0∞} {a : ℝ≥0∞}
    (h : ∀ ε > 0, ∀ᶠ x in f, u x ∈ Icc (a - ε) (a + ε)) : Tendsto u f (𝓝 a)

{u : α → ℝ≥0∞}

(h : ∀ ε > 0, ∀ᶠ (x : α) in f, u x ∈ Set.Icc (a - ε) (a + ε))


lemma reverse_surjective : Function.Surjective (reverse : Language α → _)


/-- The function `x ^ (-1 / x)` tends to `1` at `+∞`. -/
theorem tendsto_rpow_neg_div : Tendsto (fun x => x ^ (-(1 : ℝ) / x)) atTop (𝓝 1)

Filter.Tendsto (fun x => x ^ (-1 / x)) Filter.atTop (𝓝 1)


lemma isLeftAdjoint_functor : e.functor.IsLeftAdjoint

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


theorem map_eq {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f : P.B a ⟹ α) :
    @MvFunctor.map _ P.Obj _ _ _ g ⟨a, f⟩ = ⟨a, g ⊚ f⟩

{n : ℕ}
(P : MvPFunctor.{u} n)
{α β : TypeVec.{u} n}
(g : α ⟹ β)
(a : P.A)
(f : P.B a ⟹ α)


/-- The negated addition of two affine points in `W` on a sloped line lies in `W`. -/
lemma equation_negAdd {x₁ x₂ y₁ y₂ : F} (h₁ : W.Equation x₁ y₁) (h₂ : W.Equation x₂ y₂)
    (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) : W.Equation
      (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.negAddY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
(h₁ : W.Equation x₁ y₁)
(h₂ : W.Equation x₂ y₂)
(hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂)

W.Equation (W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂)) (W.negAddY x₁ x₂ y₁ (W.slope x₁ x₂ y₁ y₂))


@[simp]
theorem Orientation.map_positiveOrientation_of_isEmpty [IsEmpty ι] (f : M ≃ₗ[R] N) :
    Orientation.map ι f positiveOrientation = positiveOrientation

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
(ι : Type u_4)
[IsEmpty ι]
(f : M ≃ₗ[R] N)

(Orientation.map ι f) positiveOrientation = positiveOrientation


@[to_additive]
theorem mulSupport_const {c : M} (hc : c ≠ 1) : (mulSupport fun _ : α => c) = Set.univ

{α : Type u_1}
{M : Type u_5}
[One M]
{c : M}
(hc : c ≠ 1)

(Function.mulSupport fun x => c) = Set.univ


@[simp]
theorem iInf_adj {f : ι → SimpleGraph V} : (⨅ i, f i).Adj a b ↔ (∀ i, (f i).Adj a b) ∧ a ≠ b

{ι : Sort u_1}
{V : Type u}
{a b : V}
{f : ι → SimpleGraph V}

(⨅ i, f i).Adj a b ↔ (∀ (i : ι), (f i).Adj a b) ∧ a ≠ b


lemma mul_def {n m : ℕ} {χ : DirichletCharacter R n} {ψ : DirichletCharacter R m} :
    χ.primitive_mul ψ = primitiveCharacter (mul χ ψ)

{R : Type u_1}
[CommMonoidWithZero R]
{n m : ℕ}
{χ : DirichletCharacter R n}
{ψ : DirichletCharacter R m}

χ.primitive_mul ψ = (χ.mul ψ).primitiveCharacter


theorem add_eq_coe :
    ∀ {a b : WithTop α} {c : α}, a + b = c ↔ ∃ a' b' : α, ↑a' = a ∧ ↑b' = b ∧ a' + b' = c

{α : Type u}
[Add α]
{a b : WithTop α}
{c : α}

a + b = ↑c ↔ ∃ a' b', ↑a' = a ∧ ↑b' = b ∧ a' + b' = c


@[to_additive]
theorem comap_iInf_map_of_injective (S : ι → Subsemigroup M) :
    (⨅ i, (S i).map f).comap f = iInf S

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{ι : Type u_5}
{f : AddHom M N}
(hf : Function.Injective ⇑f)
(S : ι → AddSubsemigroup M)

AddSubsemigroup.comap f (⨅ i, AddSubsemigroup.map f (S i)) = iInf S


@[to_additive]
theorem mem_div : a ∈ s / t ↔ ∃ b ∈ s, ∃ c ∈ t, b / c = a

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


@[simp]
theorem coe_algebraMap : (algebraMap ℝ ℂ : ℝ → ℂ) = ((↑) : ℝ → ℂ)


theorem fun_eq_funMulInvSnorm_mul_eLpNorm {p : ℝ} (f : α → ℝ≥0∞)
    (hf_nonzero : (∫⁻ a, f a ^ p ∂μ) ≠ 0) (hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) {a : α} :
    f a = funMulInvSnorm f p μ a * (∫⁻ c, f c ^ p ∂μ) ^ (1 / p)

(hf_nonzero : ∫⁻ (a : α), f a ^ p ∂μ ≠ 0)

f a = ENNReal.funMulInvSnorm f p μ a * (∫⁻ (c : α), f c ^ p ∂μ) ^ (1 / p)


theorem map {f : A →ₐ[R] A'} (hf_inj : Set.InjOn f (adjoin R (range x))) :
    AlgebraicIndependent R (f ∘ x)

(hf_inj : Set.InjOn ⇑f ↑(Algebra.adjoin R (Set.range x)))


/-- Given `f : β → ℝ`, if `f` sends `{i | p i}` to a set of positive numbers
accumulating to zero, then `f i`-neighborhoods of the diagonal form a basis of `𝓤 α`.

For specific bases see `uniformity_basis_dist`, `uniformity_basis_dist_inv_nat_succ`,
and `uniformity_basis_dist_inv_nat_pos`. -/
protected theorem mk_uniformity_basis {β : Type*} {p : β → Prop} {f : β → ℝ}
    (hf₀ : ∀ i, p i → 0 < f i) (hf : ∀ ⦃ε⦄, 0 < ε → ∃ i, p i ∧ f i ≤ ε) :
    (𝓤 α).HasBasis p fun i => { p : α × α | dist p.1 p.2 < f i }

(hf : ∀ ⦃ε : ℝ⦄, 0 < ε → ∃ i, p i ∧ f i ≤ ε)

(𝓤 α).HasBasis p fun i => {p | dist p.1 p.2 < f i}


theorem Monovary.comp_right (h : Monovary f g) (k : ι' → ι) : Monovary (f ∘ k) (g ∘ k)

{ι : Type u_1}
{ι' : Type u_2}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
(h : Monovary f g)
(k : ι' → ι)


/-- We can turn any limit cone over a pair into a bicone. -/
@[simps]
def BinaryBicone.ofLimitCone {X Y : C} {t : Cone (pair X Y)} (ht : IsLimit t) :
    BinaryBicone X Y

{t : CategoryTheory.Limits.Cone (CategoryTheory.Limits.pair X Y)}

(CategoryTheory.Limits.BinaryBicone.ofLimitCone ht).inl = ht.lift (CategoryTheory.Limits.BinaryFan.mk (𝟙 X) 0)


theorem Rel.countP_eq (r : α → α → Prop) [IsTrans α r] [IsSymm α r] {s t : Multiset α} (x : α)
    [DecidablePred (r x)] (h : Rel r s t) : countP (r x) s = countP (r x) t

{α : Type u_1}
(r : α → α → Prop)
[IsTrans α r]
[IsSymm α r]
{s t : Multiset α}
(x : α)
[DecidablePred (r x)]
(h : Multiset.Rel r s t)

Multiset.countP (r x) s = Multiset.countP (r x) t


theorem hcomp_apply (F : Homotopy p₀ q₀) (G : Homotopy p₁ q₁) (x : I × I) :
    F.hcomp G x =
      if h : (x.2 : ℝ) ≤ 1 / 2 then
        F.eval x.1 ⟨2 * x.2, (unitInterval.mul_pos_mem_iff zero_lt_two).2 ⟨x.2.2.1, h⟩⟩
      else
        G.eval x.1
          ⟨2 * x.2 - 1, unitInterval.two_mul_sub_one_mem_iff.2 ⟨(not_le.1 h).le, x.2.2.2⟩⟩

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ x₂ : X}
{p₀ q₀ : Path x₀ x₁}
{p₁ q₁ : Path x₁ x₂}
(F : p₀.Homotopy q₀)
(G : p₁.Homotopy q₁)
(x : ↑I × ↑I)

(F.hcomp G) x = if h : ↑x.2 ≤ 1 / 2 then (F.eval x.1) ⟨2 * ↑x.2, ⋯⟩ else (G.eval x.1) ⟨2 * ↑x.2 - 1, ⋯⟩