/-- If two vectors `x` and `y` are linearly independent, so are their linear combinations
`a x + b y` and `c x + d y` provided the determinant `a * d - b * c` is nonzero. -/
lemma LinearIndependent.linear_combination_pair_of_det_ne_zero {R M : Type*} [CommRing R]
    [NoZeroDivisors R] [AddCommGroup M] [Module R M]
    {x y : M} (h : LinearIndependent R ![x, y])
    {a b c d : R} (h' : a * d - b * c ≠ 0) :
    LinearIndependent R ![a • x + b • y, c • x + d • y]

{R : Type u_8}
{M : Type u_9}
[CommRing R]
[NoZeroDivisors R]
[AddCommGroup M]
[Module R M]
{x y : M}
(h : LinearIndependent R ![x, y])
{a b c d : R}
(h' : a * d - b * c ≠ 0)


class IncidenceGeometry where
  Point : Type u₁
  Line : Type u₂
  Circle : Type u₃

  between : Point → Point → Point → Prop -- implies colinearity
  onLine : Point → Line → Prop
  onCircle : Point → Circle → Prop
  inCircle : Point → Circle → Prop
  centerCircle : Point → Circle → Prop
  circlesInter : Circle → Circle → Prop

  ne_23_of_between : ∀ {a b c : Point}, between a b c → b ≠ c
  line_unique_of_pts : ∀ {a b : Point}, ∀ {L M : Line},
    a ≠ b → onLine a L → onLine b L → onLine a M → onLine b M → L = M
  onLine_2_of_between : ∀ {a b c : Point}, ∀ {L : Line},
    between a b c → onLine a L → onLine c L → onLine b L
  line_of_pts : ∀ a b, ∃ L, onLine a L ∧ onLine b L
  circle_of_ne : ∀ a b, a ≠ b → ∃ C, centerCircle a C ∧ onCircle b C
  circlesInter_of_onCircle_inCircle :
    ∀ {a b α β}, onCircle b α → onCircle a β → inCircle a α →
    inCircle b β → circlesInter α β
  pts_of_circlesInter : ∀ {α β}, circlesInter α β →
    ∃ a b, a ≠ b ∧ onCircle a α ∧ onCircle a β ∧ onCircle b α ∧ onCircle b β
  inCircle_of_centerCircle : ∀ {a α}, centerCircle a α → inCircle a α

[self : IncidenceGeometry]
{α β : IncidenceGeometry.Circle}

IncidenceGeometry.circlesInter α β →
  ∃ a b,
    a ≠ b ∧
      IncidenceGeometry.onCircle a α ∧
        IncidenceGeometry.onCircle a β ∧ IncidenceGeometry.onCircle b α ∧ IncidenceGeometry.onCircle b β


@[to_additive] lemma inv_smul_eq_iff : g⁻¹ • a = b ↔ a = g • b

{G : Type u_3}
{α : Type u_7}
[Group G]
[MulAction G α]
{g : G}
{a b : α}


theorem of_restrictScalars_finite (R A M : Type*) [CommSemiring R] [Semiring A] [AddCommMonoid M]
    [Module R M] [Module A M] [Algebra R A] [IsScalarTower R A M] [hM : Finite R M] :
    Finite A M

(R : Type u_6)
(A : Type u_7)
(M : Type u_8)
[CommSemiring R]
[Semiring A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[Algebra R A]
[IsScalarTower R A M]
[hM : Module.Finite R M]


theorem hnot_eq_top_iff_exists_boundary : ￢a = ⊤ ↔ ∃ b, ∂ b = a

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


theorem convex_iff_pairwise_pos : Convex 𝕜 s ↔
    s.Pairwise fun x y => ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → a • x + b • y ∈ s

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


theorem sign_mul (f g : Perm α) : sign (f * g) = sign f * sign g

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

Equiv.Perm.sign (f * g) = Equiv.Perm.sign f * Equiv.Perm.sign g


theorem whiskerRight_id_bimod {X Y : Mon_ C} {M N : Bimod X Y} (f : M ⟶ N) :
    whiskerRight f (regular Y) = (rightUnitorBimod M).hom ≫ f ≫ (rightUnitorBimod N).inv

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

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

Bimod.whiskerRight f (Bimod.regular Y) = M.rightUnitorBimod.hom ≫ f ≫ N.rightUnitorBimod.inv


@[to_additive (attr := simp)]
theorem equivQuotientZPowOfEquiv_trans :
    (equivQuotientZPowOfEquiv e n).trans (equivQuotientZPowOfEquiv d n) =
      equivQuotientZPowOfEquiv (e.trans d) n

{A B C : Type u}
[CommGroup A]
[CommGroup B]
[CommGroup C]
(e : A ≃* B)
(d : B ≃* C)
(n : ℤ)

(QuotientGroup.equivQuotientZPowOfEquiv e n).trans (QuotientGroup.equivQuotientZPowOfEquiv d n) =
  QuotientGroup.equivQuotientZPowOfEquiv (e.trans d) n


@[simp]
lemma num_eq_zero {q : ℚ} : q.num = 0 ↔ q = 0


@[simp] lemma unop_tensor_μ {C : Type*} [Category C] [MonoidalCategory C]
    [BraidedCategory C] (X Y W Z : Cᵒᵖ) :
    (tensor_μ Cᵒᵖ (X, W) (Y, Z)).unop = tensor_μ C (X.unop, Y.unop) (W.unop, Z.unop)

{C : Type u_2}
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(X Y W Z : Cᵒᵖ)

(CategoryTheory.tensor_μ Cᵒᵖ (X, W) (Y, Z)).unop =
  CategoryTheory.tensor_μ C (Opposite.unop X, Opposite.unop Y) (Opposite.unop W, Opposite.unop Z)


@[simp] lemma ofEpiOfIsIsoOfMono_p : (ofEpiOfIsIsoOfMono φ h).p = inv φ.τ₂ ≫ h.p

(CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono φ h).p =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.inv φ.τ₂) h.p


theorem Fintype.prod_dvd_of_isRelPrime [Fintype I] (Hs : Pairwise (IsRelPrime on s))
    (Hs1 : ∀ i, s i ∣ z) : (∏ x, s x) ∣ z

{α : Type u_2}
{I : Type u_1}
[CommMonoid α]
[DecompositionMonoid α]
{z : α}
{s : I → α}
[Fintype I]
(Hs : Pairwise (IsRelPrime on s))
(Hs1 : ∀ (i : I), s i ∣ z)


theorem HasDerivWithinAt.div_const (hc : HasDerivWithinAt c c' s x) (d : 𝕜') :
    HasDerivWithinAt (fun x => c x / d) (c' / d) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c : 𝕜 → 𝕜'}
{c' : 𝕜'}
(hc : HasDerivWithinAt c c' s x)
(d : 𝕜')


lemma RightFraction.exists_leftFraction [W.HasLeftCalculusOfFractions] {X Y : C}
    (φ : W.RightFraction X Y) : ∃ (ψ : W.LeftFraction X Y), φ.f ≫ ψ.s = φ.s ≫ ψ.f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y : C}
(φ : W.RightFraction X Y)

∃ ψ, CategoryTheory.CategoryStruct.comp φ.f ψ.s = CategoryTheory.CategoryStruct.comp φ.s ψ.f


theorem one_eq : vectorsProdEqOne G 1 = {Vector.nil.cons 1}

Equiv.Perm.vectorsProdEqOne G 1 = {1 ::ᵥ Mathlib.Vector.nil}


theorem invFun_eq_of_injective_of_rightInverse {g : β → α} (hf : Injective f)
    (hg : RightInverse g f) : invFun f = g

{α : Sort u_1}
{β : Sort u_2}
[Nonempty α]
{f : α → β}
{g : β → α}
(hf : Function.Injective f)
(hg : Function.RightInverse g f)


/-- Powers of analytic functions (into a normed `𝕜`-algebra) are analytic. -/
lemma AnalyticOn.pow {f : E → A} {s : Set E} (hf : AnalyticOn 𝕜 f s) (n : ℕ) :
    AnalyticOn 𝕜 (fun x ↦ f x ^ n) s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{A : Type u_8}
[NormedRing A]
[NormedAlgebra 𝕜 A]
{f : E → A}
{s : Set E}
(hf : AnalyticOn 𝕜 f s)
(n : ℕ)


@[to_additive]
theorem not_mem_bot {x : M} : x ∉ (⊥ : Subsemigroup M)


/-- Right whiskering for morphisms of bimodule objects. -/
@[simps]
noncomputable def whiskerRight {X Y Z : Mon_ C} {M₁ M₂ : Bimod X Y} (f : M₁ ⟶ M₂) (N : Bimod Y Z) :
    M₁.tensorBimod N ⟶ M₂.tensorBimod N

(Bimod.whiskerRight f N).hom =
  CategoryTheory.Limits.colimMap
    (CategoryTheory.Limits.parallelPairHom (M₁.actRight ▷ N.X) ((α_ M₁.X Y.X N.X).hom ≫ M₁.X ◁ N.actLeft)
      (M₂.actRight ▷ N.X) ((α_ M₂.X Y.X N.X).hom ≫ M₂.X ◁ N.actLeft) (f.hom ▷ Y.X ▷ N.X) (f.hom ▷ N.X) ⋯ ⋯)


/-- The inverse rotation of triangles gives an endofunctor on the category of triangles in `C`.
-/
@[simps]
def invRotate : Triangle C ⥤ Triangle C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.HasShift C ℤ]

∀ {X Y : CategoryTheory.Pretriangulated.Triangle C} (f : X ⟶ Y),
  ((CategoryTheory.Pretriangulated.invRotate C).map f).hom₁ = (CategoryTheory.shiftFunctor C (-1)).map f.hom₃


/-- If `t` is a finite set of pairwise disjoint finite sets, then the product of `f a`
over `a ∈ ⋃₀ t` is the product over `s ∈ t` of the products of `f a` over `a ∈ s`. -/
@[to_additive
      "If `t` is a finite set of pairwise disjoint finite sets, then the sum of `f a` over
      `a ∈ ⋃₀ t` is the sum over `s ∈ t` of the sums of `f a` over `a ∈ s`."]
theorem finprod_mem_sUnion {t : Set (Set α)} (h : t.PairwiseDisjoint id) (ht₀ : t.Finite)
    (ht₁ : ∀ x ∈ t, Set.Finite x) : ∏ᶠ a ∈ ⋃₀ t, f a = ∏ᶠ s ∈ t, ∏ᶠ a ∈ s, f a

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{t : Set (Set α)}
(h : t.PairwiseDisjoint id)
(ht₀ : t.Finite)
(ht₁ : ∀ x ∈ t, x.Finite)

∑ᶠ (a : α) (_ : a ∈ ⋃₀ t), f a = ∑ᶠ (s : Set α) (_ : s ∈ t) (a : α) (_ : a ∈ s), f a


theorem linearIndependent_unique_iff (v : ι → M) [Unique ι] :
    LinearIndependent R v ↔ v default ≠ 0

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


@[simp]
theorem coe_star_inv (u : Rˣ) : ↑(star u)⁻¹ = (star ↑u⁻¹ : R)

{R : Type u}
[Monoid R]
[StarMul R]
(u : Rˣ)


theorem isLittleO_const_left_of_ne {c : E''} (hc : c ≠ 0) :
    (fun _x => c) =o[l] g ↔ Tendsto (fun x => ‖g x‖) l atTop

{α : Type u_1}
{F : Type u_4}
{E'' : Type u_9}
[Norm F]
[NormedAddCommGroup E'']
{g : α → F}
{l : Filter α}
{c : E''}
(hc : c ≠ 0)

(fun _x => c) =o[l] g ↔ Filter.Tendsto (fun x => ‖g x‖) l Filter.atTop


theorem pi_comp (g : P3 →ᵃ[k] P1) : (pi fp).comp g = pi (fun i => (fp i).comp g)

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

(AffineMap.pi fp).comp g = AffineMap.pi fun i => (fp i).comp g


/-- The range of a surjective ring homomorphism is the whole of the codomain. -/
@[simp]
theorem range_top_of_surjective (f : R →ₙ+* S) (hf : Function.Surjective f) :
    f.range = (⊤ : NonUnitalSubring S)

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


@[simp]
theorem unit_eq_unit : FreeMonoidalCategory.unit = 𝟙_ (F C)

CategoryTheory.FreeMonoidalCategory.unit = 𝟙_ (CategoryTheory.FreeMonoidalCategory C)


@[to_additive (attr := simp)]
theorem map_pure (f : α → β) (x) : (f <$> pure x : FreeSemigroup β) = pure (f x)


lemma subcanonical_zariskiTopology : Sheaf.Subcanonical zariskiTopology


@[to_additive const_add]
theorem Antitone.const_mul' [CovariantClass α α (· * ·) (· ≤ ·)] (hf : Antitone f) (a : α) :
    Antitone fun x => a * f x

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


lemma homMk'_mk_comp (f : S ⟶ T.obj Y) (g : Y ⟶ Y') (g' : Y' ⟶ Y'') :
    homMk' (mk f) (g ≫ g') = homMk' (mk f) g ≫ homMk' (mk (f ≫ T.map g)) g' ≫ eqToHom (by simp)

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

(CategoryTheory.StructuredArrow.mk f).homMk' (CategoryTheory.CategoryStruct.comp g g') =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.StructuredArrow.mk f).homMk' g)
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.StructuredArrow.mk (CategoryTheory.CategoryStruct.comp f (T.map g))).homMk' g')
      (CategoryTheory.eqToHom ⋯))


@[simp]
theorem edgeFinset_sdiff [DecidableEq V] :
    (G₁ \ G₂).edgeFinset = G₁.edgeFinset \ G₂.edgeFinset

{V : Type u_1}
{G₁ G₂ : SimpleGraph V}
[Fintype ↑G₁.edgeSet]
[Fintype ↑G₂.edgeSet]
[DecidableEq V]


/-- Shows that the sequence of denominators is monotone, that is `Bₙ ≤ Bₙ₊₁`. -/
theorem of_den_mono : (of v).dens n ≤ (of v).dens (n + 1)

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

(GenContFract.of v).dens n ≤ (GenContFract.of v).dens (n + 1)


/--
Cost structure for strings, where cost is the log base 2 length of the token.
-/
@[simps!]
def stringLogLengthCost : Cost String String ℕ

Levenshtein.stringLogLengthCost.substitute a b = max (a.length + 1).log2 (b.length + 1).log2


/-- A second countable space is mapped by an open quotient map to a second countable space. -/
theorem _root_.QuotientMap.secondCountableTopology [SecondCountableTopology X] (h' : QuotientMap π)
    (h : IsOpenMap π) : SecondCountableTopology Y

{X : Type u_1}
[TopologicalSpace X]
{Y : Type u_2}
[TopologicalSpace Y]
{π : X → Y}
[SecondCountableTopology X]
(h' : QuotientMap π)
(h : IsOpenMap π)


/-- The set `Set.pi Set.univ s` is equivalent to `Π a, s a`. -/
@[simps]
protected def univPi {α : Type*} {β : α → Type*} (s : ∀ a, Set (β a)) :
    pi univ s ≃ ∀ a, s a

{α : Type u_1}
{β : α → Type u_2}
(s : (a : α) → Set (β a))
(f : ↑(Set.univ.pi s))
(a : α)


theorem prod_X_sub_C_coeff (s : Multiset R) {k : ℕ} (h : k ≤ Multiset.card s) :
    (s.map fun t => X - C t).prod.coeff k =
    (-1) ^ (Multiset.card s - k) * s.esymm (Multiset.card s - k)

{R : Type u_1}
[CommRing R]
(s : Multiset R)
{k : ℕ}
(h : k ≤ Multiset.card s)

(Multiset.map (fun t => Polynomial.X - Polynomial.C t) s).prod.coeff k =
  (-1) ^ (Multiset.card s - k) * s.esymm (Multiset.card s - k)


theorem toLp_zero : toLp (0 : α →ₛ E) zero_memℒp = (0 : Lp.simpleFunc E p μ)

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}

MeasureTheory.Lp.simpleFunc.toLp 0 ⋯ = 0


theorem HasFiniteFPowerSeriesAt.congr (hf : HasFiniteFPowerSeriesAt f p x n) (hg : f =ᶠ[𝓝 x] g) :
    HasFiniteFPowerSeriesAt g p x n

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{n : ℕ}
(hf : HasFiniteFPowerSeriesAt f p x n)
(hg : f =ᶠ[𝓝 x] g)


theorem coe_affineMap_mk (f : P →ᵃ[R] Q) (h) : ((⟨f, h⟩ : P →ᴬ[R] Q) : P →ᵃ[R] Q) = f

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
(f : P →ᵃ[R] Q)
(h : Continuous f.toFun)

{ toAffineMap := f, cont := h }.toAffineMap = f


lemma isAffineHom_stableUnderBaseChange :
    MorphismProperty.StableUnderBaseChange @IsAffineHom


theorem dualAnnihilator_gc :
    GaloisConnection
      (OrderDual.toDual ∘ (dualAnnihilator : Submodule R M → Submodule R (Module.Dual R M)))
      (dualCoannihilator ∘ OrderDual.ofDual)

(R : Type u)
(M : Type v)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]

GaloisConnection (⇑OrderDual.toDual ∘ Submodule.dualAnnihilator) (Submodule.dualCoannihilator ∘ ⇑OrderDual.ofDual)


/-- If `C` is equivalent to `D`, then `C ⥤ E` is equivalent to `D ⥤ E`. -/
@[simps! functor inverse unitIso counitIso]
def congrLeft (e : C ≌ D) : C ⥤ E ≌ D ⥤ E

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

e.congrLeft.inverse = (CategoryTheory.whiskeringLeft C D E).obj e.functor


theorem sorted_zero_eq_min'_aux (s : Finset α) (h : 0 < (s.sort (· ≤ ·)).length) (H : s.Nonempty) :
    (s.sort (· ≤ ·)).get ⟨0, h⟩ = s.min' H

(h : 0 < (Finset.sort (fun x x_1 => x ≤ x_1) s).length)

(Finset.sort (fun x x_1 => x ≤ x_1) s).get ⟨0, h⟩ = s.min' H


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

{M : Type u_1}
[AddMonoid M]
{ι : Sort u_2}
(f : ι → AddSubmonoid M)


theorem dvd_of_pow_dvd {p k m : Nat} (hk : 1 ≤ k) (hpk : p ^ k ∣ m) : p ∣ m


@[simp]
theorem bind_some (a : α) (f : α → Part β) : (some a).bind f = f a

{α : Type u_1}
{β : Type u_2}
(a : α)
(f : α → Part β)


theorem quarter_mem_cantorSet : 1/4 ∈ cantorSet


/-- A cocone morphism between two cocones for the same diagram is a morphism of the cocone points
which commutes with the cocone legs. -/
structure CoconeMorphism (A B : Cocone F) where
  /-- A morphism between the (co)vertex objects in `C` -/
  hom : A.pt ⟶ B.pt
  /-- The triangle made from the two natural transformations and `hom` commutes -/
  w : ∀ j : J, A.ι.app j ≫ hom = B.ι.app j := by aesop_cat

(self : CategoryTheory.Limits.CoconeMorphism A B)


protected theorem Tendsto.eventually_gt_atTop [Preorder β] [NoMaxOrder β] {f : α → β} {l : Filter α}
    (hf : Tendsto f l atTop) (c : β) : ∀ᶠ x in l, c < f x

{α : Type u_3}
{β : Type u_4}
[Preorder β]
[NoMaxOrder β]
{f : α → β}
{l : Filter α}
(hf : Filter.Tendsto f l Filter.atTop)
(c : β)


theorem sigma_one_apply_prime_pow {p i : ℕ} (hp : p.Prime) :
    σ 1 (p ^ i) = ∑ k in .range (i + 1), p ^ k

(ArithmeticFunction.sigma 1) (p ^ i) = ∑ k ∈ Finset.range (i + 1), p ^ k


theorem tendsto_Lp_iff_tendsto_ℒp'' {ι} {fi : Filter ι} [Fact (1 ≤ p)] (f : ι → α → E)
    (f_ℒp : ∀ n, Memℒp (f n) p μ) (f_lim : α → E) (f_lim_ℒp : Memℒp f_lim p μ) :
    fi.Tendsto (fun n => (f_ℒp n).toLp (f n)) (𝓝 (f_lim_ℒp.toLp f_lim)) ↔
      fi.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0)

(f_ℒp : ∀ (n : ι), MeasureTheory.Memℒp (f n) p μ)

(f_lim_ℒp : MeasureTheory.Memℒp f_lim p μ)

Filter.Tendsto (fun n => MeasureTheory.Memℒp.toLp (f n) ⋯) fi (𝓝 (MeasureTheory.Memℒp.toLp f_lim f_lim_ℒp)) ↔
  Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - f_lim) p μ) fi (𝓝 0)


@[to_additive (attr := gcongr) addCentralizer_subset]
lemma centralizer_subset (h : S ⊆ T) : centralizer T ⊆ centralizer S

{M : Type u_1}
{S T : Set M}
[Mul M]
(h : S ⊆ T)


theorem Finite.exists_min [Finite α] [Nonempty α] [LinearOrder β] (f : α → β) :
    ∃ x₀ : α, ∀ x, f x₀ ≤ f x

{α : Type u_2}
{β : Type u_3}
[Finite α]
[Nonempty α]
[LinearOrder β]
(f : α → β)


theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) :
    ∃ x, IsRoot p x

{k : Type u}
[Field k]
[IsSepClosed k]
(p : k[X])
(hp : p.degree ≠ 0)
(hsep : p.Separable)


theorem Gamma_three_div_two_lt_one : Gamma (3 / 2) < 1


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

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

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

(hTT' : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : E), (T s) x ≤ (T' s) x)

(MeasureTheory.L1.setToL1 hT) f ≤ (MeasureTheory.L1.setToL1 hT') f


@[simp]
theorem map_id (S : L.Substructure M) : S.map (Hom.id L M) = S

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

FirstOrder.Language.Substructure.map (FirstOrder.Language.Hom.id L M) S = S


@[simp]
theorem apply_symm_apply (e : α ≃o β) (x : β) : e (e.symm x) = x

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


/--
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).inverse =
  TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquivInverse F U


@[to_additive]
protected theorem mul_apply [Mul X] [ContinuousMul X] {a₁ b₁ a₂ b₂ : X} (γ₁ : Path a₁ b₁)
    (γ₂ : Path a₂ b₂) (t : unitInterval) : (γ₁.mul γ₂) t = γ₁ t * γ₂ t

{X : Type u_1}
[TopologicalSpace X]
[Mul X]
[ContinuousMul X]
{a₁ b₁ a₂ b₂ : X}
(γ₁ : Path a₁ b₁)
(γ₂ : Path a₂ b₂)
(t : ↑I)


theorem eval_interpolate_at_node (hvs : Set.InjOn v s) (hi : i ∈ s) :
    eval (v i) (interpolate s v r) = r i

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{i : ι}
{v : ι → F}
(r : ι → F)
(hvs : Set.InjOn v ↑s)
(hi : i ∈ s)

Polynomial.eval (v i) ((Lagrange.interpolate s v) r) = r i


@[simp]
theorem equivMapDomain_zero {f : α ≃ β} : equivMapDomain f (0 : α →₀ M) = (0 : β →₀ M)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
{f : α ≃ β}


theorem mk_wcovBy_mk_iff_left : (a₁, b) ⩿ (a₂, b) ↔ a₁ ⩿ a₂

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
{a₁ a₂ : α}
{b : β}


/-- A map out of the free product corresponds to a family of maps out of the summands. This is the
universal property of the free product, characterizing it as a categorical coproduct. -/
@[simps symm_apply]
def lift : (∀ i, M i →* N) ≃ (CoprodI M →* N)

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

Monoid.CoprodI.lift.symm f i = f.comp Monoid.CoprodI.of


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

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


@[simp]
theorem cast_lt_ofNat : (m : α) < (no_index (OfNat.ofNat n)) ↔ m < OfNat.ofNat n

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


@[to_additive (attr := ext)]
theorem LeftCancelMonoid.ext {M : Type u} ⦃m₁ m₂ : LeftCancelMonoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂

{M : Type u}
⦃m₁ m₂ : AddLeftCancelMonoid M⦄
(h_mul : HAdd.hAdd = HAdd.hAdd)


theorem continuousOn_exp {s : Set ℝ} : ContinuousOn exp s


@[simp]
theorem ofLE_refl : ofLE (le_refl A) = id

{X : Type u_2}
[TopologicalSpace X]
{A : DiscreteQuotient X}


theorem Filter.Tendsto.log {f : α → ℝ} {l : Filter α} {x : ℝ} (h : Tendsto f l (𝓝 x)) (hx : x ≠ 0) :
    Tendsto (fun x => log (f x)) l (𝓝 (log x))

{α : Type u_1}
{f : α → ℝ}
{l : Filter α}
{x : ℝ}
(h : Filter.Tendsto f l (𝓝 x))
(hx : x ≠ 0)

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


theorem isConnected_of_isConnected_op [IsConnected Jᵒᵖ] : IsConnected J

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
[CategoryTheory.IsConnected Jᵒᵖ]


theorem posPart_map_norm (f : α →ₛ ℝ) : (posPart f).map norm = posPart f

{α : Type u_1}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α ℝ)

MeasureTheory.SimpleFunc.map norm f.posPart = f.posPart


lemma mul_one_div_cancel (h : a ≠ 0) : a * (1 / a) = 1

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


theorem pi_hyperplane (i : ι) [NoAtoms (μ i)] (x : α i) :
    Measure.pi μ { f : ∀ i, α i | f i = x } = 0

(μ : (i : ι) → MeasureTheory.Measure (α i))

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

(MeasureTheory.Measure.pi μ) {f | f i = x} = 0


theorem convex_Ici (r : β) : Convex 𝕜 (Ici r)

{𝕜 : Type u_1}
{β : Type u_4}
[OrderedSemiring 𝕜]
[OrderedAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r : β)


/-- When `B` is a smooth manifold with corners with respect to a model `IB` and `E` is a
topological vector bundle over `B` with fibers isomorphic to `F`, then `SmoothVectorBundle F E IB`
registers that the bundle is smooth, in the sense of having smooth transition functions.
This is a mixin, not carrying any new data. -/
class SmoothVectorBundle : Prop where
  protected smoothOn_coordChangeL :
    ∀ (e e' : Trivialization F (π F E)) [MemTrivializationAtlas e] [MemTrivializationAtlas e'],
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun b : B => (e.coordChangeL 𝕜 e' b : F →L[𝕜] F))
        (e.baseSet ∩ e'.baseSet)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun b => ↑(Trivialization.coordChangeL 𝕜 e e' b)) (e.baseSet ∩ e'.baseSet)


theorem prod_le_inf {s : Finset ι} {f : ι → Ideal R} : s.prod f ≤ s.inf f

{R : Type u}
{ι : Type u_1}
[CommSemiring R]
{s : Finset ι}
{f : ι → Ideal R}


@[simp]
theorem symm_trans_self (e : L₁ ≃ₗ⁅R⁆ L₂) : e.symm.trans e = refl

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
(e : L₁ ≃ₗ⁅R⁆ L₂)


@[to_additive (attr := simp)]
theorem head_mul (x y : FreeSemigroup α) : (x * y).1 = x.1


/-- Concatenating the first element of a tuple with its tail gives back the original tuple -/
@[simp, nolint simpNF] -- Porting note: linter claims LHS doesn't simplify
theorem cons_self_tail : cons (q 0) (tail q) = q

{n : ℕ}
{α : Fin (n + 1) → Type u}
(q : (i : Fin (n + 1)) → α i)


theorem mul_le_iff_le_inv {a b r : ℝ≥0} (hr : r ≠ 0) : r * a ≤ b ↔ a ≤ r⁻¹ * b


theorem next_stop : ∀ {s}, ValidFor l m r s → s.next ⟨utf8Len m⟩ = ⟨utf8Len m⟩

Substring.ValidFor l m r s → s.next { byteIdx := String.utf8Len m } = { byteIdx := String.utf8Len m }


@[ext]
theorem ext {f g : M₁ ≃SL[σ₁₂] M₂} (h : (f : M₁ → M₂) = g) : f = g

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
{f g : M₁ ≃SL[σ₁₂] M₂}
(h : ⇑f = ⇑g)


@[simp] -- Porting note: added `simp`
theorem trim_eq {s : Set α} (hs : MeasurableSet s) : m.trim s = m s

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


theorem of_surjective (hRA : FiniteType R A) (f : A →ₐ[R] B) (hf : Surjective f) : FiniteType R B

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(hRA : Algebra.FiniteType R A)
(f : A →ₐ[R] B)
(hf : Function.Surjective ⇑f)


{α : Type u_1}
[PartialOrder α]
(c : ClosureOperator α)


theorem Ioc_union_Ioc (h₁ : min a b ≤ max c d) (h₂ : min c d ≤ max a b) :
    Ioc a b ∪ Ioc c d = Ioc (min a c) (max b d)

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

Set.Ioc a b ∪ Set.Ioc c d = Set.Ioc (min a c) (max b d)


lemma CstarRing.norm_le_norm_of_nonneg_of_le {a b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) :
    ‖a‖ ≤ ‖b‖

{A : Type u_1}
[NonUnitalNormedRing A]
[CompleteSpace A]
[PartialOrder A]
[StarRing A]
[StarOrderedRing A]
[CstarRing A]
[NormedSpace ℂ A]
[StarModule ℂ A]
[SMulCommClass ℂ A A]
[IsScalarTower ℂ A A]
{a b : A}
(ha : 0 ≤ a := by cfc_tac)
(hab : a ≤ b)


theorem tsum_comp_le_tsum_of_inj {β : Type*} {f : α → ℝ} (hf : Summable f) (hn : ∀ a, 0 ≤ f a)
    {i : β → α} (hi : Function.Injective i) : tsum (f ∘ i) ≤ tsum f

{α : Type u_1}
{β : Type u_4}
{f : α → ℝ}
(hf : Summable f)
(hn : ∀ (a : α), 0 ≤ f a)
{i : β → α}
(hi : Function.Injective i)


theorem sum_condensed_le (hf : ∀ ⦃m n⦄, 1 < m → m ≤ n → f n ≤ f m) (n : ℕ) :
    (∑ k ∈ range (n + 1), 2 ^ k • f (2 ^ k)) ≤ f 1 + 2 • ∑ k ∈ Ico 2 (2 ^ n + 1), f k

(hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m)

∑ k ∈ Finset.range (n + 1), 2 ^ k • f (2 ^ k) ≤ f 1 + 2 • ∑ k ∈ Finset.Ico 2 (2 ^ n + 1), f k


/-- A configuration is nondegenerate if:
  1) there does not exist a line that passes through all of the points,
  2) there does not exist a point that is on all of the lines,
  3) there is at most one line through any two points,
  4) any two lines have at most one intersection point.
  Conditions 3 and 4 are equivalent. -/
class Nondegenerate : Prop where
  exists_point : ∀ l : L, ∃ p, p ∉ l
  exists_line : ∀ p, ∃ l : L, p ∉ l
  eq_or_eq : ∀ {p₁ p₂ : P} {l₁ l₂ : L}, p₁ ∈ l₁ → p₂ ∈ l₁ → p₁ ∈ l₂ → p₂ ∈ l₂ → p₁ = p₂ ∨ l₁ = l₂

[self : Configuration.Nondegenerate P L]


theorem Perfect.closure_nhds_inter {U : Set α} (hC : Perfect C) (x : α) (xC : x ∈ C) (xU : x ∈ U)
    (Uop : IsOpen U) : Perfect (closure (U ∩ C)) ∧ (closure (U ∩ C)).Nonempty

{α : Type u_1}
[TopologicalSpace α]
{C U : Set α}
(hC : Perfect C)
(x : α)
(xC : x ∈ C)
(xU : x ∈ U)
(Uop : IsOpen U)


@[simp]
theorem Ico_diff_Ico_right (a b c : α) : Ico a b \ Ico c b = Ico a (min b c)

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
(a b c : α)

Finset.Ico a b \ Finset.Ico c b = Finset.Ico a (min b c)


protected theorem neg_mul_eq_mul_neg (a b : Int) : -(a * b) = a * -b


/-- Composing on the left by a uniformly continuous function preserves uniform convergence -/
theorem UniformContinuous.comp_tendstoUniformly [UniformSpace γ] {g : β → γ}
    (hg : UniformContinuous g) (h : TendstoUniformly F f p) :
    TendstoUniformly (fun i => g ∘ F i) (g ∘ f) p

{α : Type u}
{β : Type v}
{γ : Type w}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
[UniformSpace γ]
{g : β → γ}
(hg : UniformContinuous g)
(h : TendstoUniformly F f p)


/-- The counit isomorphism upgrades to a monoidal isomorphism. -/
@[simps! hom inv]
def transportedMonoidalCounitIso (e : C ≌ D) :
    (fromTransported e).toLaxMonoidalFunctor ⊗⋙ (toTransported e).toLaxMonoidalFunctor ≅
      LaxMonoidalFunctor.id (Transported e)

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

(CategoryTheory.Monoidal.transportedMonoidalCounitIso e).hom =
  CategoryTheory.inv (CategoryTheory.monoidalUnit (CategoryTheory.Monoidal.fromTransported e) e.symm.toAdjunction)


@[to_additive]
theorem le_of_forall_one_lt_le_mul (h : ∀ ε : α, 1 < ε → a ≤ b * ε) : a ≤ b

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

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


/-- Balls containing the origin are absorbent. -/
theorem absorbent_ball (hx : ‖x‖ < r) : Absorbent 𝕜 (Metric.ball x r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{r : ℝ}
{x : E}
(hx : ‖x‖ < r)


/-- `X ⨿ -` has a monad structure. This is sometimes called the either monad. -/
@[simps!]
def coprodMonad : Monad C

(CategoryTheory.coprodMonad X).obj Y = (X ⨿ Y)


theorem reduceOption_singleton (x : Option α) : [x].reduceOption = x.toList


@[arith_mult]
theorem pdiv [CommGroupWithZero R] {f g : ArithmeticFunction R} (hf : IsMultiplicative f)
    (hg : IsMultiplicative g) : IsMultiplicative (pdiv f g)

{R : Type u_1}
[CommGroupWithZero R]
{f g : ArithmeticFunction R}
(hf : f.IsMultiplicative)
(hg : g.IsMultiplicative)


@[simp]
theorem get_zero : ∀ v : Vector α n.succ, get v 0 = head v

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


theorem Ioc_ae_eq_Icc' (ha : μ {a} = 0) : Ioc a b =ᵐ[μ] Icc a b

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[PartialOrder α]
{a b : α}
(ha : μ {a} = 0)


@[simp]
theorem coe_comp (φ₁ : B →ₗc[R] C) (φ₂ : A →ₗc[R] B) : ⇑(φ₁.comp φ₂) = φ₁ ∘ φ₂

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[AddCommMonoid C]
[Module R C]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
(φ₁ : B →ₗc[R] C)
(φ₂ : A →ₗc[R] B)

⇑(φ₁.comp φ₂) = ⇑φ₁ ∘ ⇑φ₂


@[to_additive (attr := simp)]
theorem mulRothNumber_map_mul_left :
    mulRothNumber (s.map <| mulLeftEmbedding a) = mulRothNumber s

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

mulRothNumber (Finset.map (mulLeftEmbedding a) s) = mulRothNumber s


theorem mem_upperBounds_image : a ∈ lowerBounds s → f a ∈ upperBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Antitone f)
{a : α}
{s : Set α}


/-- The closed form for the quaternion exponential on imaginary quaternions. -/
theorem exp_of_re_eq_zero (q : Quaternion ℝ) (hq : q.re = 0) :
    exp ℝ q = ↑(Real.cos ‖q‖) + (Real.sin ‖q‖ / ‖q‖) • q

NormedSpace.exp ℝ q = ↑(Real.cos ‖q‖) + (Real.sin ‖q‖ / ‖q‖) • q


@[to_additive (attr := simp)]
theorem nndist_div_left [Group G] [PseudoMetricSpace G] [IsometricSMul G G]
    [IsometricSMul Gᵐᵒᵖ G] (a b c : G) : nndist (a / b) (a / c) = nndist b c

{G : Type v}
[Group G]
[PseudoMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]
(a b c : G)


/-- A version of `algebraMap_strictMono` for use by `gcongr` since it currently does not preprocess
`Monotone` conclusions. -/
@[gcongr] protected lemma GCongr.algebraMap_lt_algebraMap {a₁ a₂ : α} (ha : a₁ < a₂) :
    algebraMap α β a₁ < algebraMap α β a₂

{α : Type u_1}
(β : Type u_2)
[OrderedCommSemiring α]
[StrictOrderedSemiring β]
[Algebra α β]
[SMulPosStrictMono α β]
{a₁ a₂ : α}
(ha : a₁ < a₂)

(algebraMap α β) a₁ < (algebraMap α β) a₂


@[simp]
theorem one_snd : (1 : X q).2 = 0


theorem lt_iff_exists_real_btwn {a b : EReal} : a < b ↔ ∃ x : ℝ, a < x ∧ (x : EReal) < b


/-- The antidiagonal of `n` does not contain duplicate entries. -/
@[simp]
theorem nodup_antidiagonal (n : ℕ) : Nodup (antidiagonal n)


@[simp]
theorem basicOpen_res {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = unop V ⊓ @basicOpen X (unop U) f

{U V : (TopologicalSpace.Opens ↑↑X.toPresheafedSpace)ᵒᵖ}

X.basicOpen ((X.presheaf.map i) f) = Opposite.unop V ⊓ X.basicOpen f


theorem add_right (x y z : M) : B x (y + z) = B x y + B x z

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(x y z : M)


theorem Coprime.gcd_eq_one : Coprime m n → gcd m n = 1


/-- Induction principle for `Finset`s in a linearly ordered type: a predicate is true on all
`s : Finset α` provided that:

* it is true on the empty `Finset`,
* for every `s : Finset α` and an element `a` strictly greater than all elements of `s`, `p s`
  implies `p (insert a s)`. -/
@[elab_as_elim]
theorem induction_on_max [DecidableEq α] {p : Finset α → Prop} (s : Finset α) (h0 : p ∅)
    (step : ∀ a s, (∀ x ∈ s, x < a) → p s → p (insert a s)) : p s

(step : ∀ (a : α) (s : Finset α), (∀ x ∈ s, x < a) → p s → p (insert a s))


theorem drop_append1' {α : TypeVec n} {β : Type*} : drop (append1 α β) = α

{n : ℕ}
{α : TypeVec.{u_1} n}
{β : Type u_1}


lemma mono_of_base_injective_of_stalk_epi {X Y : SheafedSpace C} (f : X ⟶ Y)
    (h₁ : Function.Injective f.base)
    (h₂ : ∀ x, Epi (f.stalkMap x)) : Mono f

{X Y : AlgebraicGeometry.SheafedSpace C}

(h₂ : ∀ (x : ↑↑X.toPresheafedSpace), CategoryTheory.Epi (AlgebraicGeometry.PresheafedSpace.Hom.stalkMap f x))


@[simp]
theorem zipRight_nil_right : zipRight as ([] : List β) = []


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the top side and `g` on the bottom side. -/
@[simps!]
def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C

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

(CategoryTheory.Square.fromArrowArrowFunctor'.obj f).f₁₂ = f.left.hom


theorem isCobounded_top : IsCobounded r ⊤ ↔ Nonempty α


@[to_additive]
protected lemma Continuous.mulIndicator (hs : ∀ a ∈ frontier s, f a = 1) (hf : Continuous f) :
    Continuous (mulIndicator s f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[One β]
{f : α → β}
{s : Set α}
(hs : ∀ a ∈ frontier s, f a = 1)
(hf : Continuous f)


/-- The 0th differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `A → Fun(G, A)`. It sends `(a, g) ↦ ρ_A(g)(a) - a.` -/
@[simps]
def dZero : A →ₗ[k] G → A

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)
(m : CoeSort.coe A)
(g : G)

(groupCohomology.dZero A) m g = (A.ρ g) m - m


theorem UniformSpace.comap_comap {α β γ} {uγ : UniformSpace γ} {f : α → β} {g : β → γ} :
    UniformSpace.comap (g ∘ f) uγ = UniformSpace.comap f (UniformSpace.comap g uγ)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{uγ : UniformSpace γ}
{f : α → β}
{g : β → γ}


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

{f : ι → Ω → β}

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

ProbabilityTheory.Kernel.IndepFun (f i * f j) (f k * f l) κ μ


theorem lt_succ {a : Fin n} : castSucc a < a.succ


theorem comp_toGerm (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) :
    (comp g hg f).toGerm = f.toGerm.map g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[TopologicalSpace γ]
(g : β → γ)
(hg : Continuous g)
(f : α →ₘ[μ] β)

(MeasureTheory.AEEqFun.comp g hg f).toGerm = Filter.Germ.map g f.toGerm


theorem wittStructureInt_prop (Φ : MvPolynomial idx ℤ) (n) :
    bind₁ (wittStructureInt p Φ) (wittPolynomial p ℤ n) =
      bind₁ (fun i => rename (Prod.mk i) (W_ ℤ n)) Φ

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
(Φ : MvPolynomial idx ℤ)
(n : ℕ)

(MvPolynomial.bind₁ (wittStructureInt p Φ)) (W_ ℤ n) =
  (MvPolynomial.bind₁ fun i => (MvPolynomial.rename (Prod.mk i)) (W_ ℤ n)) Φ


/-- If a derivation `D` is in the Killing orthogonal of the range of the adjoint action, then, for
any `x : L`, `ad (D x)` is also in this orthogonal. -/
lemma ad_mem_orthogonal_of_mem_orthogonal {D : LieDerivation R L L} (hD : D ∈ 𝕀ᗮ) (x : L) :
    ad R L (D x) ∈ 𝕀ᗮ

(hD : D ∈ (killingForm R (LieDerivation R L L)).orthogonal (LieDerivation.ad R L).range.toSubmodule)

(LieDerivation.ad R L) (D x) ∈ (killingForm R (LieDerivation R L L)).orthogonal (LieDerivation.ad R L).range.toSubmodule


@[to_additive]
lemma sup_mul_left [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
    sup (s * t) f = sup s fun x ↦ sup t (f <| x * ·)

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

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


theorem dotProduct_mulVec_adjMatrix [NonAssocSemiring α] (x y : V → α) :
    x ⬝ᵥ (G.adjMatrix α).mulVec y = ∑ i : V, ∑ j : V, if G.Adj i j then x i * y j else 0

{V : Type u_1}
{α : Type u_2}
{G : SimpleGraph V}
[DecidableRel G.Adj]
[Fintype V]
[NonAssocSemiring α]
(x y : V → α)

x ⬝ᵥ SimpleGraph.adjMatrix α G *ᵥ y = ∑ i : V, ∑ j : V, if G.Adj i j then x i * y j else 0


/-- Well-foundedness of the strict version of |, which is equivalent to the descending chain
condition on divisibility and to the ascending chain condition on
principal ideals in an integral domain.
  -/
class WfDvdMonoid (α : Type*) [CommMonoidWithZero α] : Prop where
  wellFounded_dvdNotUnit : WellFounded (@DvdNotUnit α _)

{α : Type u_2}
[CommMonoidWithZero α]
[self : WfDvdMonoid α]


theorem replicate_mem_sym (ha : a ∈ s) (n : ℕ) : Sym.replicate n a ∈ s.sym n

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a : α}
(ha : a ∈ s)
(n : ℕ)


@[simp]
lemma comp_assoc [HasSmallLocalizedHom.{w} W X Y] [HasSmallLocalizedHom.{w} W X Z]
    [HasSmallLocalizedHom.{w} W X T] [HasSmallLocalizedHom.{w} W Y Z]
    [HasSmallLocalizedHom.{w} W Y T] [HasSmallLocalizedHom.{w} W Z T]
    (α : SmallHom.{w} W X Y) (β : SmallHom.{w} W Y Z) (γ : SmallHom.{w} W Z T) :
    (α.comp β).comp γ = α.comp (β.comp γ)

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

[CategoryTheory.Localization.HasSmallLocalizedHom W X Z]

[CategoryTheory.Localization.HasSmallLocalizedHom W X T]

[CategoryTheory.Localization.HasSmallLocalizedHom W Y Z]

[CategoryTheory.Localization.HasSmallLocalizedHom W Y T]

[CategoryTheory.Localization.HasSmallLocalizedHom W Z T]

(α : CategoryTheory.Localization.SmallHom W X Y)

(β : CategoryTheory.Localization.SmallHom W Y Z)

(γ : CategoryTheory.Localization.SmallHom W Z T)


theorem mk_toOrderHom_apply {a b : SimplexCategory} (f : Fin (a.len + 1) →o Fin (b.len + 1))
    (i : Fin (a.len + 1)) : (mk f).toOrderHom i = f i

(SimplexCategory.Hom.mk f).toOrderHom i = f i


/-- If `f` is integrable on `I` along `l`, then for two sufficiently fine tagged prepartitions
(in the sense of the filter `BoxIntegral.IntegrationParams.toFilter l I`) such that they cover
the same part of `I`, the integral sums of `f` over `π₁` and `π₂` are very close to each other.  -/
theorem tendsto_integralSum_toFilter_prod_self_inf_iUnion_eq_uniformity (h : Integrable I l f vol) :
    Tendsto (fun π : TaggedPrepartition I × TaggedPrepartition I =>
      (integralSum f vol π.1, integralSum f vol π.2))
        ((l.toFilter I ×ˢ l.toFilter I) ⊓ 𝓟 {π | π.1.iUnion = π.2.iUnion}) (𝓤 F)

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
(h : BoxIntegral.Integrable I l f vol)

Filter.Tendsto (fun π => (BoxIntegral.integralSum f vol π.1, BoxIntegral.integralSum f vol π.2))
  (l.toFilter I ×ˢ l.toFilter I ⊓ 𝓟 {π | π.1.iUnion = π.2.iUnion}) (𝓤 F)


theorem _root_.BoundedVariationOn.sub_le {f : α → ℝ} {s : Set α} (h : BoundedVariationOn f s)
    {x y : α} (hx : x ∈ s) (hy : y ∈ s) : f x - f y ≤ (eVariationOn f s).toReal

{α : Type u_1}
[LinearOrder α]
{f : α → ℝ}
{s : Set α}
(h : BoundedVariationOn f s)
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)


@[simp]
theorem coe_comap (A : ValuationSubring L) (f : K →+* L) : (A.comap f : Set K) = f ⁻¹' A

{K : Type u}
[Field K]
{L : Type u_1}
[Field L]
(A : ValuationSubring L)
(f : K →+* L)


theorem kstar_mul_le_kstar : a∗ * a ≤ a∗

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


@[to_additive (attr := simp)]
theorem coe_comp' {G H K : Type _} [Group G] [Group H] [Group K] (f : G →* H) (g : H →* K) :
    @DFunLike.coe (G →* K) G (fun _ ↦ K) MonoidHom.instFunLike (CategoryStruct.comp
      (X := Grp.of G) (Y := Grp.of H) (Z := Grp.of K) f g) = g ∘ f

{G H K : Type u_1}
[Group G]
[Group H]
[Group K]
(f : G →* H)
(g : H →* K)


@[simp]
theorem polar_smul_right (a : R) (x y : M) : polar Q x (a • y) = a • polar Q x y

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)
(a : R)
(x y : M)

QuadraticMap.polar (⇑Q) x (a • y) = a • QuadraticMap.polar (⇑Q) x y


/-- Implementation of `Mon_.equivLaxMonoidalFunctorPUnit`. -/
@[simps!]
def unitIso :
    𝟭 (LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C) ≅ laxMonoidalToMon C ⋙ monToLaxMonoidal C

(X : CategoryTheory.LaxMonoidalFunctor (CategoryTheory.Discrete PUnit.{u + 1}) C)

∀ (X_1 : CategoryTheory.Discrete PUnit.{u + 1}),
  ((Mon_.EquivLaxMonoidalFunctorPUnit.unitIso C).inv.app X).app X_1 =
    𝟙 (X.obj (𝟙_ (CategoryTheory.Discrete PUnit.{u + 1})))


@[simp]
theorem coe_opLinearEquiv_symm : ((opLinearEquiv R).symm : Mᵐᵒᵖ → M) = unop

(R : Type u)
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]

⇑(MulOpposite.opLinearEquiv R).symm = MulOpposite.unop


@[to_additive (attr := simp)]
theorem mulIndicator_one' {s : Set α} : s.mulIndicator (1 : α → M) = 1

{α : Type u_1}
(M : Type u_4)
[Zero M]
{s : Set α}


theorem Finset.card_univ_diff [DecidableEq α] [Fintype α] (s : Finset α) :
    (Finset.univ \ s).card = Fintype.card α - s.card

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


lemma epi_homologyMap_of_epi_of_not_rel (φ : K ⟶ L) (i : ι)
    [K.HasHomology i] [L.HasHomology i] [Epi (φ.f i)] (hi : ∀ j, ¬ c.Rel i j) :
    Epi (homologyMap φ i)

CategoryTheory.Epi (HomologicalComplex.homologyMap φ i)


theorem IsLocal.mem_jacobson_or_exists_inv {I : Ideal R} (hi : IsLocal I) (x : R) :
    x ∈ jacobson I ∨ ∃ y, y * x - 1 ∈ I

{R : Type u}
[CommRing R]
{I : Ideal R}
(hi : I.IsLocal)
(x : R)


/-- Corollary of Hahn-Banach. Given a nonzero element `x` of a normed space, there exists an
    element of the dual space, of norm `1`, whose value on `x` is `‖x‖`. -/
theorem exists_dual_vector (x : E) (h : x ≠ 0) : ∃ g : E →L[𝕜] 𝕜, ‖g‖ = 1 ∧ g x = ‖x‖

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


theorem sublists_cons_perm_append (a : α) (l : List α) :
    sublists (a :: l) ~ sublists l ++ map (cons a) (sublists l)

(a :: l).sublists.Perm (l.sublists ++ List.map (List.cons a) l.sublists)


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

{f : ι → α → δ}

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


/-- Universe lift functor for groups. -/
@[to_additive (attr := simps)
  "Universe lift functor for additive groups."]
def uliftFunctor : Grp.{u} ⥤ Grp.{max u v}

AddGrp.uliftFunctor.obj X = AddGrp.of (ULift.{v, u} ↑X)


/-- Symmetric statement to `Filter.map_map₂_right_anticomm`. -/
theorem map_map₂_antidistrib_right {n : γ → δ} {m' : β → α' → δ} {n' : α → α'}
    (h_antidistrib : ∀ a b, n (m a b) = m' b (n' a)) : (map₂ m f g).map n = map₂ m' g (f.map n')

{m : α → β → γ}

(h_antidistrib : ∀ (a : α) (b : β), n (m a b) = m' b (n' a))

Filter.map n (Filter.map₂ m f g) = Filter.map₂ m' g (Filter.map n' f)


/-- If a compact set is included in a measurable set, then so is its closure. -/
@[to_additive (attr := deprecated IsCompact.closure_subset_measurableSet (since := "2024-01-28"))]
lemma _root_.IsCompact.closure_subset_of_measurableSet_of_group {k s : Set G}
    (hk : IsCompact k) (hs : MeasurableSet s) (h : k ⊆ s) : closure k ⊆ s

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
[Group G]
[TopologicalGroup G]
{k s : Set G}
(hk : IsCompact k)
(hs : MeasurableSet s)
(h : k ⊆ s)


@[simp]
theorem spanExt_app_left : (spanExt iX iY iZ wf wg).app WalkingSpan.left = iY

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Y}
{g : X ⟶ Z}
{f' : X' ⟶ Y'}
{g' : X' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iY.hom)
(wg : iX.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.spanExt iX iY iZ wf wg).app CategoryTheory.Limits.WalkingSpan.left = iY


protected theorem IsRightRegular.star [Mul R] [StarMul R] {x : R} (hx : IsRightRegular x) :
    IsLeftRegular (star x)

{R : Type u}
[Mul R]
[StarMul R]
{x : R}
(hx : IsRightRegular x)


theorem bijOn_image (h : Semiconj f fa fb) (ha : BijOn fa s t) (hf : InjOn f t) :
    BijOn fb (f '' s) (f '' t)

{α : Type u_1}
{β : Type u_2}
{fa : α → α}
{fb : β → β}
{f : α → β}
{s t : Set α}
(h : Function.Semiconj f fa fb)
(ha : Set.BijOn fa s t)
(hf : Set.InjOn f t)


/-- Composition of `BasedNatTrans`, given by composition of the underlying natural
transformations. -/
@[simps]
def comp {F G H : 𝒳 ⥤ᵇ 𝒴} (α : BasedNatTrans F G) (β : BasedNatTrans G H) : BasedNatTrans F H

{F G H : CategoryTheory.BasedFunctor 𝒳 𝒴}

(α.comp β).toNatTrans = α.vcomp β.toNatTrans


/-- ## The chain complex relation `d ≫ d`
-/
theorem d_squared (n : ℕ) : objD X (n + 1) ≫ objD X n = 0

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(X : CategoryTheory.SimplicialObject C)
(n : ℕ)

AlgebraicTopology.AlternatingFaceMapComplex.objD X (n + 1) ≫ AlgebraicTopology.AlternatingFaceMapComplex.objD X n = 0


@[simp]
theorem comp_eq_comp {A A' A'' : Coalgebra G} (f : A ⟶ A') (g : A' ⟶ A'') :
    Coalgebra.Hom.comp f g = f ≫ g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{G : CategoryTheory.Comonad C}
{A A' A'' : G.Coalgebra}
(f : A ⟶ A')
(g : A' ⟶ A'')

CategoryTheory.Comonad.Coalgebra.Hom.comp f g = CategoryTheory.CategoryStruct.comp f g


theorem le_of_forall_pos_le_add (h : ∀ ε : ℝ≥0, 0 < ε → b < ∞ → a ≤ b + ε) : a ≤ b

(h : ∀ (ε : ℝ≥0), 0 < ε → b < ⊤ → a ≤ b + ↑ε)


/-- Constructs an isomorphism of lattices from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : Lat.{u}} (e : α ≃o β) : α ≅ β


@[simp]
theorem piRing_apply (f : (ι → R) →ₗ[R] M) (i : ι) : piRing R M ι S f i = f (Pi.single i 1)

{R : Type u}
{M : Type v}
{ι : Type x}
[Semiring R]
(S : Type u_4)
[Fintype ι]
[DecidableEq ι]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[SMulCommClass R S M]
(f : (ι → R) →ₗ[R] M)
(i : ι)

(LinearEquiv.piRing R M ι S) f i = f (Pi.single i 1)


@[simp]
theorem eqToHom_map_comp_apply (p : X = Y) (q : Y = Z) (x : F.obj X) :
    F.map (eqToHom q) (F.map (eqToHom p) x) = F.map (eqToHom <| p.trans q) x

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : CategoryTheory.Functor C (Type w))
{X Y Z : C}
(p : X = Y)
(q : Y = Z)
(x : F.obj X)

F.map (CategoryTheory.eqToHom q) (F.map (CategoryTheory.eqToHom p) x) = F.map (CategoryTheory.eqToHom ⋯) x


@[simp]
theorem comp_assoc (f : sSupHom γ δ) (g : sSupHom β γ) (h : sSupHom α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[SupSet α]
[SupSet β]
[SupSet γ]
[SupSet δ]
(f : sSupHom γ δ)
(g : sSupHom β γ)
(h : sSupHom α β)


theorem convexOn_iff_pairwise_pos {s : Set E} {f : E → β} :
    ConvexOn 𝕜 s f ↔
      Convex 𝕜 s ∧
        s.Pairwise fun x y =>
          ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → f (a • x + b • y) ≤ a • f x + b • f y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
{s : Set E}
{f : E → β}


theorem ext_iff {p q : PMF α} : p = q ↔ ∀ x, p x = q x


@[simp]
theorem lift_adjoin (K : IntermediateField F E) (S : Set K) :
    lift (adjoin F S) = adjoin F (Subtype.val '' S)

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(K : IntermediateField F E)
(S : Set ↥K)

IntermediateField.lift (IntermediateField.adjoin F S) = IntermediateField.adjoin F (Subtype.val '' S)


theorem floor_lt' (hn : n ≠ 0) : ⌊a⌋₊ < n ↔ a < n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}
(hn : n ≠ 0)


@[reassoc (attr := simp)]
lemma ιTotal_totalFlipIso_f_hom
    (i₁ : I₁) (i₂ : I₂) (j : J) (h : ComplexShape.π c₂ c₁ c (i₂, i₁) = j) :
    K.flip.ιTotal c i₂ i₁ j h ≫ (K.totalFlipIso c).hom.f j =
      ComplexShape.σ c₁ c₂ c i₁ i₂ • K.ιTotal c i₁ i₂ j
        (by rw [← ComplexShape.π_symm c₁ c₂ c i₁ i₂, h])

{C : Type u_1}
{I₁ : Type u_2}
{I₂ : Type u_3}
{J : Type u_4}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c : ComplexShape J)
[TotalComplexShape c₁ c₂ c]
[TotalComplexShape c₂ c₁ c]
[TotalComplexShapeSymmetry c₁ c₂ c]
[K.HasTotal c]
[K.flip.HasTotal c]
[DecidableEq J]
(i₁ : I₁)
(i₂ : I₂)
(j : J)
(h : c₂.π c₁ c (i₂, i₁) = j)

K.flip.ιTotal c i₂ i₁ j h ≫ (K.totalFlipIso c).hom.f j = c₁.σ c₂ c i₁ i₂ • K.ιTotal c i₁ i₂ j ⋯


theorem log_le_iff_le_exp (hx : 0 < x) : log x ≤ y ↔ x ≤ exp y


theorem zag_symmetric : Symmetric (@Zag J _)

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


lemma prod_nonneg (h : ∀ a ∈ s, 0 ≤ a) : 0 ≤ s.prod

{R : Type u_1}
[OrderedCommSemiring R]
{s : Multiset R}
(h : ∀ a ∈ s, 0 ≤ a)


/-- `yoneda'` induces an equivalence of category between `Type u` and
`SheafOfTypes typesGrothendieckTopology`. -/
@[simps!]
noncomputable def typeEquiv : Type u ≌ SheafOfTypes typesGrothendieckTopology

(CategoryTheory.typeEquiv.functor.obj α).val.obj Y = (Opposite.unop Y ⟶ α)


/-- The uniform neighborhoods of all points of a dense indexed collection cover the whole space. -/
lemma DenseRange.iUnion_uniformity_ball {ι : Type*} {xs : ι → α}
    (xs_dense : DenseRange xs) {U : Set (α × α)} (hU : U ∈ uniformity α) :
    ⋃ i, UniformSpace.ball (xs i) U = univ

{α : Type ua}
[UniformSpace α]
{ι : Type u_2}
{xs : ι → α}
(xs_dense : DenseRange xs)
{U : Set (α × α)}
(hU : U ∈ 𝓤 α)

⋃ i, UniformSpace.ball (xs i) U = Set.univ


@[deprecated mem_coclosedCompact_iff (since := "2024-02-16")]
theorem mem_coclosedCompact : s ∈ coclosedCompact X ↔ ∃ t, IsClosed t ∧ IsCompact t ∧ tᶜ ⊆ s

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

s ∈ Filter.coclosedCompact X ↔ ∃ t, IsClosed t ∧ IsCompact t ∧ tᶜ ⊆ s


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

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


@[to_additive]
theorem le_hasProd' (hf : HasProd f a) (i : ι) : f i ≤ a

{ι : Type u_1}
{α : Type u_3}
[CanonicallyOrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a : α}
(hf : HasProd f a)
(i : ι)


@[simp]
theorem eval₂_smul (g : R →+* S) (p : R[X]) (x : S) {s : R} :
    eval₂ g x (s • p) = g s * eval₂ g x p

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(g : R →+* S)
(p : R[X])
(x : S)
{s : R}

Polynomial.eval₂ g x (s • p) = g s * Polynomial.eval₂ g x p


theorem add_overlap_pf (x : R) (e) (pq_pf : a + b = c) :
    x ^ e * a + x ^ e * b = x ^ e * c

{R : Type u_1}
[CommSemiring R]
{a b c : R}
(x : R)
(e : ℕ)
(pq_pf : a + b = c)


@[simp]
theorem nim_birthday (o : Ordinal) : (nim o).birthday = o


theorem monotone_rpow_of_nonneg {z : ℝ} (h : 0 ≤ z) : Monotone fun x : ℝ≥0∞ => x ^ z


lemma FamilyOfElements.isAmalgamation_iff_ofArrows (x : FamilyOfElements P (ofArrows X π))
    (t : P.obj (op B)) :
    x.IsAmalgamation t ↔ ∀ (i : I), P.map (π i).op t = x _ (ofArrows.mk i)

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

(x : CategoryTheory.Presieve.FamilyOfElements P (CategoryTheory.Presieve.ofArrows X π))

x.IsAmalgamation t ↔ ∀ (i : I), P.map (π i).op t = x (π i) ⋯


theorem dvd_lcm_left [GCDMonoid α] (a b : α) : a ∣ lcm a b

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


theorem map_continuousWithinAt (f : F) (s : Set α) (a : α) : ContinuousWithinAt f s a

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[FunLike F α β]
[ContinuousMapClass F α β]
(f : F)
(s : Set α)
(a : α)


@[simp]
theorem natDegree_C_mul_X (a : R) (ha : a ≠ 0) : natDegree (C a * X) = 1

{R : Type u}
[Semiring R]
(a : R)
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X).natDegree = 1


@[simp]
theorem mem_toAddSubmonoid {s : NonUnitalSubsemiring R} {x : R} : x ∈ s.toAddSubmonoid ↔ x ∈ s

{R : Type u}
[NonUnitalNonAssocSemiring R]
{s : NonUnitalSubsemiring R}
{x : R}


@[reassoc]
lemma d_fst_v (i j k : ℤ) (hij : i + 1 = j) (hjk : j + 1 = k) :
    (mappingCone φ).d i j ≫ (fst φ).1.v j k hjk =
      -(fst φ).1.v i j hij ≫ F.d j k

(CochainComplex.mappingCone φ).d i j ≫ (↑(CochainComplex.mappingCone.fst φ)).v j k hjk =
  -(↑(CochainComplex.mappingCone.fst φ)).v i j hij ≫ F.d j k


@[deprecated lebesgue_number_lemma_of_metric (since := "2024-02-24")]
nonrec theorem SeqCompact.lebesgue_number_lemma_of_metric {ι : Sort*} {c : ι → Set X} {s : Set X}
    (hs : IsSeqCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ δ > 0, ∀ a ∈ s, ∃ i, ball a δ ⊆ c i

{X : Type u_1}
[PseudoMetricSpace X]
{ι : Sort u_2}
{c : ι → Set X}
{s : Set X}
(hs : IsSeqCompact s)
(hc₁ : ∀ (i : ι), IsOpen (c i))
(hc₂ : s ⊆ ⋃ i, c i)

∃ δ > 0, ∀ a ∈ s, ∃ i, Metric.ball a δ ⊆ c i


theorem Cont.then_eval {k k' : Cont} {v} : (k.then k').eval v = k.eval v >>= k'.eval

{k k' : Turing.ToPartrec.Cont}
{v : List ℕ}


theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
    image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t

{α : Type u_1}
{β : Type u_3}
{f : α → α → β}
{s t : Set α}
(hf : ∀ (a b : α), f a b = f b a)

Set.image2 f (s ∪ t) (s ∩ t) ⊆ Set.image2 f s t


theorem clog_of_left_le_one {b : ℕ} (hb : b ≤ 1) (n : ℕ) : clog b n = 0


@[fun_prop]
theorem DifferentiableOn.const_sub (hf : DifferentiableOn 𝕜 f s) (c : F) :
    DifferentiableOn 𝕜 (fun y => c - f y) 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}
(hf : DifferentiableOn 𝕜 f s)
(c : F)


@[to_additive]
theorem tendsto_norm_div_self_punctured_nhds (a : E) :
    Tendsto (fun x => ‖x / a‖) (𝓝[≠] a) (𝓝[>] 0)

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

Filter.Tendsto (fun x => ‖x - a‖) (𝓝[≠] a) (𝓝[>] 0)


theorem not_dvd_of_natDegree_lt {p q : R[X]} (h0 : q ≠ 0) (hl : q.natDegree < p.natDegree) :
    ¬p ∣ q

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p q : R[X]}
(h0 : q ≠ 0)
(hl : q.natDegree < p.natDegree)


@[simp]
theorem disjoint_diagonal_offDiag : Disjoint (diagonal α) s.offDiag


theorem iSup_const [Nonempty ι] : ⨆ _ : ι, a = a

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{a : α}
[Nonempty ι]


@[simp]
theorem evenOddRec_odd {P : ℕ → Sort*} (h0 : P 0) (h_even : ∀ i, P i → P (2 * i))
    (h_odd : ∀ i, P i → P (2 * i + 1)) (H : h_even 0 h0 = h0) (n : ℕ) :
    (2 * n + 1).evenOddRec h0 h_even h_odd = h_odd n (evenOddRec h0 h_even h_odd n)

{P : ℕ → Sort u_1}
(h0 : P 0)
(h_even : (i : ℕ) → P i → P (2 * i))
(h_odd : (i : ℕ) → P i → P (2 * i + 1))
(H : h_even 0 h0 = h0)
(n : ℕ)

Nat.evenOddRec h0 h_even h_odd (2 * n + 1) = h_odd n (Nat.evenOddRec h0 h_even h_odd n)


/-- An intermediate field is closed under multiplication. -/
protected theorem mul_mem {x y : L} : x ∈ S → y ∈ S → x * y ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{x y : L}


@[deprecated getElem_range' (since := "2024-06-12")]
theorem get_range' {n m step} (i) (H : i < (range' n m step).length) :
    get (range' n m step) ⟨i, H⟩ = n + step * i

{n m step : Nat}
(i : Nat)
(H : i < (List.range' n m step).length)

(List.range' n m step).get ⟨i, H⟩ = n + step * i


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

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


theorem Sylow.coe_subgroup_smul {g : G} {P : Sylow p G} :
    ↑(g • P) = MulAut.conj g • (P : Subgroup G)

{p : ℕ}
{G : Type u_1}
[Group G]
{g : G}
{P : Sylow p G}


/-- If the multiplicative action of `M` on `α` is faithful,
then `fixedBy α m = Set.univ` implies that `m = 1`. -/
@[to_additive "If the additive action of `M` on `α` is faithful,
then `fixedBy α m = Set.univ` implies that `m = 1`."]
theorem fixedBy_eq_univ_iff_eq_one {m : M} : fixedBy α m = Set.univ ↔ m = 1

{α : Type u_1}
{M : Type u_3}
[AddMonoid M]
[AddAction M α]
[FaithfulVAdd M α]
{m : M}

AddAction.fixedBy α m = Set.univ ↔ m = 0


theorem le_csSup_of_le (hs : BddAbove s) (hb : b ∈ s) (h : a ≤ b) : a ≤ sSup s

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a b : α}
(hs : BddAbove s)
(hb : b ∈ s)
(h : a ≤ b)


/-- The cardinality of a Sylow subgroup is `p ^ n`
 where `n` is the multiplicity of `p` in the group order. -/
theorem card_eq_multiplicity [Finite G] {p : ℕ} [hp : Fact p.Prime] (P : Sylow p G) :
    Nat.card P = p ^ Nat.factorization (Nat.card G) p

{G : Type u}
[Group G]
[Finite G]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
(P : Sylow p G)

Nat.card ↥↑P = p ^ (Nat.card G).factorization p


/-- A pair of filters `l₁`, `l₂` has `TendstoIxxClass Ixx` property if `Ixx a b` tends to
`l₂.small_sets` as `a` and `b` tend to `l₁`. In all instances `Ixx` is one of `Set.Icc`, `Set.Ico`,
`Set.Ioc`, or `Set.Ioo`. The instances provide the best `l₂` for a given `l₁`. In many cases
`l₁ = l₂` but sometimes we can drop an endpoint from an interval: e.g., we prove
`TendstoIxxClass Set.Ico (𝓟 (Set.Iic a)) (𝓟 (Set.Iio a))`, i.e., if `u₁ n` and `u₂ n` belong
eventually to `Set.Iic a`, then the interval `Set.Ico (u₁ n) (u₂ n)` is eventually included in
`Set.Iio a`.

We mark `l₂` as an `outParam` so that Lean can automatically find an appropriate `l₂` based on
`Ixx` and `l₁`. This way, e.g., `tendsto.Ico h₁ h₂` works without specifying explicitly `l₂`. -/
class TendstoIxxClass (Ixx : α → α → Set α) (l₁ : Filter α) (l₂ : outParam <| Filter α) : Prop where
  /-- `Function.uncurry Ixx` tends to `l₂.smallSets` along `l₁ ×ˢ l₁`. In other words, for any
  `s ∈ l₂` there exists `t ∈ l₁` such that `Ixx x y ⊆ s` whenever `x ∈ t` and `y ∈ t`.

  Use lemmas like `Filter.Tendsto.Icc` instead. -/
  tendsto_Ixx : Tendsto (fun p : α × α => Ixx p.1 p.2) (l₁ ×ˢ l₁) l₂.smallSets

[self : Filter.TendstoIxxClass Ixx l₁ l₂]

Filter.Tendsto (fun p => Ixx p.1 p.2) (l₁ ×ˢ l₁) (Filter.smallSets l₂)


theorem commutator_le : ⁅H₁, H₂⁆ ≤ H₃ ↔ ∀ g₁ ∈ H₁, ∀ g₂ ∈ H₂, ⁅g₁, g₂⁆ ∈ H₃

{G : Type u_1}
[Group G]
{H₁ H₂ H₃ : Subgroup G}


@[simp, nolint simpNF] -- Porting note (#10959): simp cannot prove this
theorem norm_one [Nontrivial E] : ‖(1 : E)‖ = 1

{E : Type u_2}
[NormedRing E]
[StarRing E]
[CstarRing E]
[Nontrivial E]


@[simp]
theorem C_inv (r : k) : (C k r)⁻¹ = C k r⁻¹

((PowerSeries.C k) r)⁻¹ = (PowerSeries.C k) r⁻¹


/-- Corresponds to `norm_pos_iff`. -/
@[simp]
theorem hammingNorm_pos_iff {x : ∀ i, β i} : 0 < hammingNorm x ↔ x ≠ 0

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → Zero (β i)]
{x : (i : ι) → β i}


@[simp]
theorem homeomorphAddCircle_symm_apply_mk (hp : p ≠ 0) (hq : q ≠ 0) (x : 𝕜) :
    (homeomorphAddCircle p q hp hq).symm (x : 𝕜) = (x * (q⁻¹ * p) : 𝕜)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
(p q : 𝕜)
(hp : p ≠ 0)
(hq : q ≠ 0)
(x : 𝕜)

(AddCircle.homeomorphAddCircle p q hp hq).symm ↑x = ↑(x * (q⁻¹ * p))


/-- The triangle (polygon) inequality for sequences of points; `Finset.Ico` version. -/
theorem edist_le_Ico_sum_edist (f : ℕ → α) {m n} (h : m ≤ n) :
    edist (f m) (f n) ≤ ∑ i ∈ Finset.Ico m n, edist (f i) (f (i + 1))

{α : Type u}
[PseudoEMetricSpace α]
(f : ℕ → α)
{m n : ℕ}
(h : m ≤ n)


@[simp]
theorem linMulLin_comp (l r : M' →ₗ[R] M) :
    (linMulLin f g).comp l r = linMulLin (f.comp l) (g.comp r)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_7}
[AddCommMonoid M']
[Module R M']
{f g : M →ₗ[R] R}
(l r : M' →ₗ[R] M)

(LinearMap.BilinForm.linMulLin f g).comp l r = LinearMap.BilinForm.linMulLin (f ∘ₗ l) (g ∘ₗ r)


/--
The composition of the isomorphism `pullbackSepcIso R S T` (from the pullback of
`Spec S ⟶ Spec R` and `Spec T ⟶ Spec R` to `Spec (S ⊗[R] T)`) with the morphism
`Spec (S ⊗[R] T) ⟶ Spec S` obtained by applying `Spec.map` to the ring morphism `s ↦ s ⊗ₜ[R] 1`
is the first projection.
-/
@[reassoc (attr := simp)]
lemma pullbackSpecIso_hom_fst :
    (pullbackSpecIso R S T).hom ≫ Spec.map (ofHom includeLeftRingHom) = pullback.fst _ _

(R S T : Type u)
[CommRing R]
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]

(AlgebraicGeometry.pullbackSpecIso R S T).hom ≫
    AlgebraicGeometry.Spec.map (CommRingCat.ofHom Algebra.TensorProduct.includeLeftRingHom) =
  CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R S)))
    (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R T)))


theorem logb_neg_iff_of_base_lt_one (h : 0 < x) : logb b x < 0 ↔ 1 < x


protected theorem isCoatomic_iff [OrderTop α] [OrderTop β] (f : α ≃o β) :
    IsCoatomic α ↔ IsCoatomic β

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[PartialOrder β]
[OrderTop α]
[OrderTop β]
(f : α ≃o β)


/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1)

Filter.Tendsto (fun s => (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1)


@[simp]
theorem coe_ofLinearIsometry_symm (f : E →ₛₗᵢ[σ₁₂] E₂) (g : E₂ →ₛₗ[σ₂₁] E)
    (h₁ : f.toLinearMap.comp g = LinearMap.id) (h₂ : g.comp f.toLinearMap = LinearMap.id) :
    ((ofLinearIsometry f g h₁ h₂).symm : E₂ → E) = (g : E₂ → E)

(f : E →ₛₗᵢ[σ₁₂] E₂)

⇑(LinearIsometryEquiv.ofLinearIsometry f g h₁ h₂).symm = ⇑g


@[simp]
theorem coprod_inl_inr : coprod (inl R M M₂) (inr R M M₂) = LinearMap.id

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

(LinearMap.inl R M M₂).coprod (LinearMap.inr R M M₂) = LinearMap.id


/-- The explicit left homology data of a short complex of abelian group that is
given by a kernel and a quotient given by the `AddMonoidHom` API. -/
@[simps]
def abLeftHomologyData : S.LeftHomologyData

S.abLeftHomologyData.H = AddCommGrp.of (↥(AddMonoidHom.ker S.g) ⧸ S.abToCycles.range)


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


theorem ContDiffWithinAt.cosh {n} (hf : ContDiffWithinAt ℝ n f s x) :
    ContDiffWithinAt ℝ n (fun x => Real.cosh (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt ℝ n f s x)


protected theorem «exists» {p : ℚ → Prop} : (∃ r, p r) ↔ ∃ a b : ℤ, p (a / b)


/-- The units of the monoid of non-zero divisors of `M₀` are equivalent to the units of `M₀`. -/
@[simps]
def unitsNonZeroDivisorsEquiv : M₀⁰ˣ ≃* M₀ˣ

{M₀ : Type u_1}
[MonoidWithZero M₀]
(u : M₀ˣ)

↑↑(unitsNonZeroDivisorsEquiv.symm u) = ↑u


/-- `(h : DualBases e ε).basis` shows the family of vectors `e` forms a basis. -/
@[simps]
def basis : Basis ι R M

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{e : ι → M}
{ε : ι → Module.Dual R M}
[DecidableEq ι]
(h : Module.DualBases e ε)
(m : M)


protected theorem add_mem_iff_right : a ∈ I → (a + b ∈ I ↔ b ∈ I)

{α : Type u}
[Ring α]
(I : Ideal α)
{a b : α}


theorem linearIndependent_iUnion_finite {η : Type*} {ιs : η → Type*} {f : ∀ j : η, ιs j → M}
    (hindep : ∀ j, LinearIndependent R (f j))
    (hd : ∀ i, ∀ t : Set η,
      t.Finite → i ∉ t → Disjoint (span R (range (f i))) (⨆ i ∈ t, span R (range (f i)))) :
    LinearIndependent R fun ji : Σ j, ιs j => f ji.1 ji.2

(hindep : ∀ (j : η), LinearIndependent R (f j))

(hd :
  ∀ (i : η) (t : Set η),
    t.Finite → i ∉ t → Disjoint (Submodule.span R (Set.range (f i))) (⨆ i ∈ t, Submodule.span R (Set.range (f i))))

LinearIndependent R fun ji => f ji.fst ji.snd


@[simp] lemma mop_inv_leftUnitor (X : C) : (λ_ X).inv.mop = (ρ_ (mop X)).inv

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

(CategoryTheory.MonoidalCategory.leftUnitor X).inv.mop =
  (CategoryTheory.MonoidalCategory.rightUnitor { unmop := X }).inv


theorem pi_eq_zero (f : (i : ι) → M₂ →ₗ[R] φ i) : pi f = 0 ↔ ∀ i, f i = 0

{R : Type u}
{M₂ : Type w}
{ι : Type x}
[Semiring R]
[AddCommMonoid M₂]
[Module R M₂]
{φ : ι → Type i}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
(f : (i : ι) → M₂ →ₗ[R] φ i)


/-- The ideal `I` equals the finprod `∏_v v^(val_v(I))`, when both sides are regarded as fractional
ideals of `R`. -/
theorem finprod_heightOneSpectrum_factorization_coe {I : Ideal R} (hI : I ≠ 0) :
    (∏ᶠ v : HeightOneSpectrum R, (v.asIdeal : FractionalIdeal R⁰ K) ^
      ((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ)) = I

{R : Type u_1}
[CommRing R]
(K : Type u_2)
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDedekindDomain R]
{I : Ideal R}
(hI : I ≠ 0)

∏ᶠ (v : IsDedekindDomain.HeightOneSpectrum R),
    ↑v.asIdeal ^ ↑((Associates.mk v.asIdeal).count (Associates.mk I).factors) =
  ↑I


/-- The `cons` and `head`/`tail` functions are mutually inverse, unlike in the case of `List` where
this only holds for nonempty lists. -/
theorem ListBlank.exists_cons {Γ} [Inhabited Γ] (l : ListBlank Γ) :
    ∃ a l', l = ListBlank.cons a l'

{Γ : Type u_1}
[Inhabited Γ]
(l : Turing.ListBlank Γ)


protected theorem Function.Injective.uncountable [Uncountable α] {f : α → β} (hf : Injective f) :
    Uncountable β

{α : Sort u}
{β : Sort v}
[Uncountable α]
{f : α → β}
(hf : Function.Injective f)


theorem nodup_finRange (n : ℕ) : (finRange n).Nodup


/-- The terminal object in `Factorisation f`, with the codomain of `f` as its midpoint. -/
@[simps]
protected def terminal : Factorisation f

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


lemma smul_eq_zero_iff_right (hc : c ≠ 0) : c • x = 0 ↔ x = 0

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


theorem monotone_snd : Monotone (@Prod.snd α β)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]


theorem SuperpolynomialDecay.param_mul (hf : SuperpolynomialDecay l k f) :
    SuperpolynomialDecay l k (k * f)

(hf : Asymptotics.SuperpolynomialDecay l k f)

Asymptotics.SuperpolynomialDecay l k (k * f)


@[simp]
lemma UniformOnFun.ofFun_smul {M : Type*} [SMul M β] (c : M) (f : α → β) :
    ofFun 𝔖 (c • f) = c • ofFun 𝔖 f

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
{M : Type u_5}
[SMul M β]
(c : M)
(f : α → β)

(UniformOnFun.ofFun 𝔖) (c • f) = c • (UniformOnFun.ofFun 𝔖) f


lemma tendsto_eLpNorm_one_densityProcess_limitProcess (hκν : fst κ ≤ ν) [IsFiniteKernel ν]
    (a : α) {s : Set β} (hs : MeasurableSet s) :
    Tendsto (fun n ↦ eLpNorm ((fun x ↦ densityProcess κ ν n a x s)
      - (countableFiltration γ).limitProcess (fun n x ↦ densityProcess κ ν n a x s) (ν a))
      1 (ν a)) atTop (𝓝 0)

{κ : ProbabilityTheory.Kernel α (γ × β)}

Filter.Tendsto
  (fun n =>
    MeasureTheory.eLpNorm
      ((fun x => κ.densityProcess ν n a x s) -
        MeasureTheory.Filtration.limitProcess (fun n x => κ.densityProcess ν n a x s)
          (ProbabilityTheory.countableFiltration γ) (ν a))
      1 (ν a))
  Filter.atTop (𝓝 0)


@[simp]
theorem toRingHom_eq_coe (f : α →+*o β) : f.toRingHom = f

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


theorem lt_of_sum_four_squares_eq_mul {a b c d k m : ℕ}
    (h : a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = k * m)
    (ha : 2 * a < m) (hb : 2 * b < m) (hc : 2 * c < m) (hd : 2 * d < m) :
    k < m


nonrec theorem SmoothAt.prod_mk_space {f : M → E'} {g : M → F'} (hf : SmoothAt I 𝓘(𝕜, E') f x)
    (hg : SmoothAt I 𝓘(𝕜, F') g x) : SmoothAt I 𝓘(𝕜, E' × F') (fun x => (f x, g x)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{x : M}
{f : M → E'}
{g : M → F'}
(hf : SmoothAt I 𝓘(𝕜, E') f x)
(hg : SmoothAt I 𝓘(𝕜, F') g x)


protected theorem one_half_lt_one : (2⁻¹ : ℝ≥0∞) < 1


@[to_additive]
protected lemma div_eq_one_iff_eq (h : IsUnit b) : a / b = 1 ↔ a = b

{α : Type u}
[SubtractionMonoid α]
{a b : α}
(h : IsAddUnit b)


@[simp] lemma find_eq_zero (h : ∃ n : ℕ, p n) : Nat.find h = 0 ↔ p 0

{p : ℕ → Prop}
[DecidablePred p]
(h : ∃ n, p n)


/-- If `f : α → β` is a fibration between relations `rα` and `rβ`, and `a : α` is
  accessible under `rα`, then `f a` is accessible under `rβ`. -/
theorem _root_.Acc.of_fibration (fib : Fibration rα rβ f) {a} (ha : Acc rα a) : Acc rβ (f a)

{α : Type u_1}
{β : Type u_2}
{rα : α → α → Prop}
{rβ : β → β → Prop}
(f : α → β)
(fib : Relation.Fibration rα rβ f)
{a : α}
(ha : Acc rα a)


theorem fourierCoeff.const_mul (f : AddCircle T → ℂ) (c : ℂ) (n : ℤ) :
    fourierCoeff (fun x => c * f x) n = c * fourierCoeff f n

{T : ℝ}
[hT : Fact (0 < T)]
(f : AddCircle T → ℂ)
(c : ℂ)
(n : ℤ)


theorem exact {x y : PSet} : mk x = mk y → PSet.Equiv x y


lemma isCoboundedUnder_ge_of_le [Preorder α] (l : Filter ι) [NeBot l] {f : ι → α} {x : α}
    (hf : ∀ i, f i ≤ x) :
    IsCoboundedUnder (· ≥ ·) l f

{α : Type u_1}
{ι : Type u_4}
[Preorder α]
(l : Filter ι)
[l.NeBot]
{f : ι → α}
{x : α}
(hf : ∀ (i : ι), f i ≤ x)

Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) l f


theorem isPiSystem_Ico (f : ι → α) (g : ι' → α) :
    @IsPiSystem α { S | ∃ i j, f i < g j ∧ Ico (f i) (g j) = S }

{α : Type u_1}
{ι : Sort u_2}
{ι' : Sort u_3}
[LinearOrder α]
(f : ι → α)
(g : ι' → α)

IsPiSystem {S | ∃ i j, f i < g j ∧ Set.Ico (f i) (g j) = S}


/-- An alternative definition of the gauge using scalar multiplication on the element rather than on
the set. -/
theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ • x ∈ s}

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{x : E}

gauge s x = sInf {r | r ∈ Set.Ioi 0 ∧ r⁻¹ • x ∈ s}


theorem piIsoPi_hom_apply {ι : Type v} (α : ι → TopCat.{max v u}) (i : ι)
    (x : (∏ᶜ α : TopCat.{max v u})) : (piIsoPi α).hom x i = (Pi.π α i : _) x

{ι : Type v}
(α : ι → TopCat)
(i : ι)
(x : ↑(∏ᶜ α))

(TopCat.piIsoPi α).hom x i = (CategoryTheory.Limits.Pi.π α i) x


theorem Int.smul_one_eq_cast {R : Type*} [NonAssocRing R] (m : ℤ) : m • (1 : R) = ↑m


theorem toRingHom_unop (f : Aᵐᵒᵖ →ₐ[R] Bᵐᵒᵖ) : f.unop.toRingHom = RingHom.unop f.toRingHom

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : Aᵐᵒᵖ →ₐ[R] Bᵐᵒᵖ)

(AlgHom.unop f).toRingHom = RingHom.unop f.toRingHom


theorem isSheaf_iff_extensiveSheaf_of_projective [Preregular C] [FinitaryExtensive C]
    [∀ (X : C), Projective X] :
    IsSheaf (coherentTopology C) F ↔ IsSheaf (extensiveTopology C) F

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

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology C) F ↔
  CategoryTheory.Presheaf.IsSheaf (CategoryTheory.extensiveTopology C) F


theorem associator_naturality {X₁ X₂ X₃ Y₁ Y₂ Y₃ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃) :
    tensorHom ℬ (tensorHom ℬ f₁ f₂) f₃ ≫ (BinaryFan.associatorOfLimitCone ℬ Y₁ Y₂ Y₃).hom =
      (BinaryFan.associatorOfLimitCone ℬ X₁ X₂ X₃).hom ≫ tensorHom ℬ f₁ (tensorHom ℬ f₂ f₃)

(ℬ : (X Y : C) → CategoryTheory.Limits.LimitCone (CategoryTheory.Limits.pair X Y))

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ
      (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ f₁ f₂) f₃)
    (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ Y₁ Y₂ Y₃).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ X₁ X₂ X₃).hom
    (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ f₁
      (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ f₂ f₃))


theorem norm_setToL1S_le (T : Set α → E →L[ℝ] F) {C : ℝ}
    (hT_norm : ∀ s, MeasurableSet s → μ s < ∞ → ‖T s‖ ≤ C * (μ s).toReal) (f : α →₁ₛ[μ] E) :
    ‖setToL1S T f‖ ≤ C * ‖f‖

(hT_norm : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ‖T s‖ ≤ C * (μ s).toReal)

(f : ↥(MeasureTheory.Lp.simpleFunc E 1 μ))

‖MeasureTheory.L1.SimpleFunc.setToL1S T f‖ ≤ C * ‖f‖


theorem CompactExhaustion.isClosed [T2Space X] (K : CompactExhaustion X) (n : ℕ) : IsClosed (K n)

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
(K : CompactExhaustion X)
(n : ℕ)


@[to_additive]
theorem image_op_smul : (op '' s) • t = t * s


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

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


@[simp]
theorem arcsin_eq_pi_div_two {x : ℝ} : arcsin x = π / 2 ↔ 1 ≤ x


theorem IsBlock.image {H Y : Type*} [Group H] [MulAction H Y]
    {φ : G →* H} (j : X →ₑ[φ] Y)
    (hφ : Function.Surjective φ) (hj : Function.Injective j)
    {B : Set X} (hB : IsBlock G B) :
    IsBlock H (j '' B)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{H : Type u_3}
{Y : Type u_4}
[Group H]
[MulAction H Y]
{φ : G →* H}
(j : X →ₑ[⇑φ] Y)
(hφ : Function.Surjective ⇑φ)
(hj : Function.Injective ⇑j)
{B : Set X}
(hB : MulAction.IsBlock G B)


/-- An affine map is continuous iff its underlying linear map is continuous. See also
`AffineMap.continuous_linear_iff`. -/
theorem continuous_iff {f : E →ᵃ[R] F} : Continuous f ↔ Continuous f.linear

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[AddCommGroup E]
[TopologicalSpace E]
[AddCommGroup F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[Ring R]
[Module R E]
[Module R F]
{f : E →ᵃ[R] F}


@[to_additive (attr := simp)]
theorem comap_id (S : Submonoid P) : S.comap (MonoidHom.id P) = S

{P : Type u_3}
[MulOneClass P]
(S : Submonoid P)


@[simp] theorem add_im : (a + b).im = a.im + b.im

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


@[simp]
theorem start_one : (1 : εNFA α σ).start = univ


lemma HasFPowerSeriesWithinOnBall.mono {f : E → F} {p : FormalMultilinearSeries 𝕜 E F}
    {s t : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p t x r)
    (hs : s ⊆ t) : HasFPowerSeriesWithinOnBall f p s x r


theorem Disjoint.exists_uniform_thickening {A B : Set α} (hA : IsCompact A) (hB : IsClosed B)
    (h : Disjoint A B) : ∃ V ∈ 𝓤 α, Disjoint (⋃ x ∈ A, ball x V) (⋃ x ∈ B, ball x V)

{α : Type ua}
[UniformSpace α]
{A B : Set α}
(hA : IsCompact A)
(hB : IsClosed B)
(h : Disjoint A B)

∃ V ∈ 𝓤 α, Disjoint (⋃ x ∈ A, UniformSpace.ball x V) (⋃ x ∈ B, UniformSpace.ball x V)


theorem homEquiv_leftAdjointUniq_hom_app {F F' : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G)
    (x : C) : adj1.homEquiv _ _ ((leftAdjointUniq adj1 adj2).hom.app x) = adj2.unit.app x

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F F' : C ⥤ D}
{G : D ⥤ C}
(adj1 : F ⊣ G)
(adj2 : F' ⊣ G)
(x : C)

(adj1.homEquiv x (F'.obj x)) ((adj1.leftAdjointUniq adj2).hom.app x) = adj2.unit.app x


@[to_additive (attr := simp)]
theorem le_one_iff_eq_one : a ≤ 1 ↔ a = 1

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


/-- This right homology map data expresses compatibilities of the right homology data
constructed by `RightHomologyData.ofEpiOfIsIsoOfMono` -/
@[simps]
def ofEpiOfIsIsoOfMono (φ : S₁ ⟶ S₂) (h : RightHomologyData S₁)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    RightHomologyMapData φ h (RightHomologyData.ofEpiOfIsIsoOfMono φ h)

(CategoryTheory.ShortComplex.RightHomologyMapData.ofEpiOfIsIsoOfMono φ h).φQ = CategoryTheory.CategoryStruct.id h.Q


lemma mem_ofArrows_iff {I : Type*} {X : C} (Y : I → C) (f : ∀ i, Y i ⟶ X)
    {W : C} (g : W ⟶ X) :
    ofArrows Y f g ↔ ∃ (i : I) (a : W ⟶ Y i), g = a ≫ f i

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{I : Type u_1}
{X : C}
(Y : I → C)
(f : (i : I) → Y i ⟶ X)
{W : C}
(g : W ⟶ X)

(CategoryTheory.Sieve.ofArrows Y f).arrows g ↔ ∃ i a, g = CategoryTheory.CategoryStruct.comp a (f i)


@[to_additive (attr := simp)]
theorem mem_unop {x : G} {S : Subgroup Gᵐᵒᵖ} : x ∈ S.unop ↔ MulOpposite.op x ∈ S

{G : Type u_2}
[AddGroup G]
{x : G}
{S : AddSubgroup Gᵃᵒᵖ}


theorem ptendsto_def (f : α →. β) (l₁ : Filter α) (l₂ : Filter β) :
    PTendsto f l₁ l₂ ↔ ∀ s ∈ l₂, f.core s ∈ l₁

{α : Type u}
{β : Type v}
(f : α →. β)
(l₁ : Filter α)
(l₂ : Filter β)

Filter.PTendsto f l₁ l₂ ↔ ∀ s ∈ l₂, f.core s ∈ l₁


/-- Taking the `unop` of morphisms is a natural isomorphism. -/
@[simps!]
def objOpOp (X : C) : coyoneda.obj (op (op X)) ≅ yoneda.obj X

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

∀ (X_1 : Cᵒᵖ) (a : (CategoryTheory.yoneda.obj X).obj X_1),
  (CategoryTheory.Coyoneda.objOpOp X).inv.app X_1 a = (CategoryTheory.opEquiv (Opposite.op X) X_1).symm a


/-- A binomial ring is a ring for which ascending Pochhammer evaluations are uniquely divisible by
suitable factorials. We define this notion as a mixin for additive commutative monoids with natural
number powers, but retain the ring name. We introduce `Ring.multichoose` as the uniquely defined
quotient. -/
class BinomialRing (R : Type*) [AddCommMonoid R] [Pow R ℕ] where
  /-- Scalar multiplication by positive integers is injective -/
  nsmul_right_injective (n : ℕ) (h : n ≠ 0) : Injective (n • · : R → R)
  /-- A multichoose function, giving the quotient of Pochhammer evaluations by factorials. -/
  multichoose : R → ℕ → R
  /-- The `n`th ascending Pochhammer polynomial evaluated at any element is divisible by `n!` -/
  factorial_nsmul_multichoose (r : R) (n : ℕ) :
    n.factorial • multichoose r n = (ascPochhammer ℕ n).smeval r

{R : Type u_1}
[AddCommMonoid R]
[Pow R ℕ]
[self : BinomialRing R]
(n : ℕ)
(h : n ≠ 0)


/-- Transport `HasSheafify` along an equivalence of sites. -/
theorem hasSheafify : HasSheafify J A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]


/-- A Lie algebra is a module with compatible product, known as the bracket, satisfying the Jacobi
identity. Forgetting the scalar multiplication, every Lie algebra is a Lie ring. -/
class LieAlgebra (R : Type u) (L : Type v) [CommRing R] [LieRing L] extends Module R L where
  /-- A Lie algebra bracket is compatible with scalar multiplication in its second argument.

  The compatibility in the first argument is not a class property, but follows since every
  Lie algebra has a natural Lie module action on itself, see `LieModule`. -/
  protected lie_smul : ∀ (t : R) (x y : L), ⁅x, t • y⁆ = t • ⁅x, y⁆

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[self : LieAlgebra R L]
(t : R)
(x y : L)


theorem extend_left_inv {x : M} (hxf : x ∈ f.source) : (f.extend I).symm (f.extend I x) = x

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

↑(f.extend I).symm (↑(f.extend I) x) = x


@[continuity]
theorem continuous_equiv [∀ i, UniformSpace (β i)] : Continuous (WithLp.equiv p (∀ i, β i))

(p : ℝ≥0∞)
{ι : Type u_2}
(β : ι → Type u_4)
[(i : ι) → UniformSpace (β i)]

Continuous ⇑(WithLp.equiv p ((i : ι) → β i))


@[simp]
theorem Prop.bot_eq_false : (⊥ : Prop) = False


@[simp]
theorem approximatesLinearOn_empty (f : E → F) (f' : E →L[𝕜] F) (c : ℝ≥0) :
    ApproximatesLinearOn f f' ∅ c

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : E → F)
(f' : E →L[𝕜] F)
(c : ℝ≥0)


theorem IsCompact.continuous_sInf {f : γ → β → α} {K : Set β} (hK : IsCompact K)
    (hf : Continuous ↿f) : Continuous fun x => sInf (f x '' K)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[TopologicalSpace β]
[TopologicalSpace γ]
{f : γ → β → α}
{K : Set β}
(hK : IsCompact K)
(hf : Continuous ↿f)


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

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


@[simp]
theorem toFinmap_nil [DecidableEq α] : ([].toFinmap : Finmap β) = ∅

{α : Type u}
{β : α → Type v}
[DecidableEq α]


theorem PInfty_comp_map_mono_eq_zero (X : SimplicialObject C) {n : ℕ} {Δ' : SimplexCategory}
    (i : Δ' ⟶ [n]) [hi : Mono i] (h₁ : Δ'.len ≠ n) (h₂ : ¬Isδ₀ i) :
    PInfty.f n ≫ X.map i.op = 0

(h₂ : ¬AlgebraicTopology.DoldKan.Isδ₀ i)

AlgebraicTopology.DoldKan.PInfty.f n ≫ X.map i.op = 0


/-- If there is a primitive `n`-th root of unity in `K`, then
`cyclotomic' n K = (X ^ k - 1) /ₘ (∏ i ∈ Nat.properDivisors k, cyclotomic' i K)`. -/
theorem cyclotomic'_eq_X_pow_sub_one_div {K : Type*} [CommRing K] [IsDomain K] {ζ : K} {n : ℕ}
    (hpos : 0 < n) (h : IsPrimitiveRoot ζ n) :
    cyclotomic' n K = (X ^ n - 1) /ₘ ∏ i ∈ Nat.properDivisors n, cyclotomic' i K

{K : Type u_2}
[CommRing K]
[IsDomain K]
{ζ : K}
{n : ℕ}
(hpos : 0 < n)
(h : IsPrimitiveRoot ζ n)

Polynomial.cyclotomic' n K = (Polynomial.X ^ n - 1) /ₘ ∏ i ∈ n.properDivisors, Polynomial.cyclotomic' i K


protected theorem tsum_prod' {f : α × β → ℝ≥0∞} : ∑' p : α × β, f p = ∑' (a) (b), f (a, b)

{α : Type u_1}
{β : Type u_2}
{f : α × β → ℝ≥0∞}


lemma isUniform_one : G.IsUniform (1 : 𝕜) s t

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
(G : SimpleGraph α)
[DecidableRel G.Adj]
{s t : Finset α}


@[to_additive edist_eq_coe_nnnorm]
theorem edist_eq_coe_nnnorm' (x : E) : edist x 1 = (‖x‖₊ : ℝ≥0∞)

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


theorem exists_pos_sum_of_countable {ε : ℝ≥0∞} (hε : ε ≠ 0) (ι) [Countable ι] :
    ∃ ε' : ι → ℝ≥0, (∀ i, 0 < ε' i) ∧ (∑' i, (ε' i : ℝ≥0∞)) < ε

{ε : ℝ≥0∞}
(hε : ε ≠ 0)
(ι : Type u_4)
[Countable ι]


lemma exists_finiteIntegralAdele_iff (a : FiniteAdeleRing R K) : (∃ c : R_hat R K,
    a = c) ↔ ∀ (v : HeightOneSpectrum R), a v ∈ adicCompletionIntegers K v

(a : DedekindDomain.FiniteAdeleRing R K)

(∃ c, a = ↑c) ↔
  ∀ (v : IsDedekindDomain.HeightOneSpectrum R),
    (fun v => ↑a v) v ∈ IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers K v


/-- A weighted sum of pairwise subtractions, expressed as a subtraction of two
`weightedVSubOfPoint` expressions. -/
theorem sum_smul_vsub_eq_weightedVSubOfPoint_sub (w : ι → k) (p₁ p₂ : ι → P) (b : P) :
    (∑ i ∈ s, w i • (p₁ i -ᵥ p₂ i)) =
      s.weightedVSubOfPoint p₁ b w - s.weightedVSubOfPoint p₂ b w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p₁ p₂ : ι → P)
(b : P)

∑ i ∈ s, w i • (p₁ i -ᵥ p₂ i) = (s.weightedVSubOfPoint p₁ b) w - (s.weightedVSubOfPoint p₂ b) w


theorem IsInternal.collectedBasis_mem (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) (a : Σi, α i) : h.collectedBasis v a ∈ A a.1

{R : Type u}
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommMonoid M]
[Module R M]
{A : ι → Submodule R M}
(h : DirectSum.IsInternal A)
{α : ι → Type u_2}
(v : (i : ι) → Basis (α i) R ↥(A i))
(a : (i : ι) × α i)


protected theorem add_lt_add_iff_right : a ≠ ∞ → (b + a < c + a ↔ b < c)


theorem HomogeneousIdeal.isHomogeneous (I : HomogeneousIdeal 𝒜) : I.toIdeal.IsHomogeneous 𝒜

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[DecidableEq ι]
[AddMonoid ι]
[GradedRing 𝒜]
(I : HomogeneousIdeal 𝒜)


@[to_additive Pi.norm_def]
lemma Pi.norm_def' : ‖f‖ = ↑(Finset.univ.sup fun b => ‖f b‖₊)

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedGroup (π i)]
(f : (i : ι) → π i)


theorem sub_apply (v w : VectorMeasure α M) (i : Set α) : (v - w) i = v i - w i

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommGroup M]
[TopologicalSpace M]
[TopologicalAddGroup M]
(v w : MeasureTheory.VectorMeasure α M)
(i : Set α)


@[to_additive sub_zsmul] lemma zpow_sub (a : G) (m n : ℤ) : a ^ (m - n) = a ^ m * (a ^ n)⁻¹

{G : Type u_3}
[Group G]
(a : G)
(m n : ℤ)


theorem forall_mem_of_forall_mem_cons {p : α → Prop} {a : α} {l : List α} (h : ∀ x ∈ a :: l, p x) :
    ∀ x ∈ l, p x

{α : Type u}
{p : α → Prop}
{a : α}
{l : List α}
(h : ∀ (x : α), x ∈ a :: l → p x)
(x : α)


theorem infDegree_withTop_some_comp {s : AddMonoidAlgebra R A} (hs : s.support.Nonempty) :
    infDegree (WithTop.some ∘ D) s = infDegree D s

{R : Type u_1}
{A : Type u_3}
{T : Type u_4}
[Semiring R]
[SemilatticeInf T]
[OrderTop T]
{D : A → T}
{s : AddMonoidAlgebra R A}
(hs : s.support.Nonempty)

AddMonoidAlgebra.infDegree (WithTop.some ∘ D) s = ↑(AddMonoidAlgebra.infDegree D s)


theorem Codisjoint.sup_left (h : Codisjoint a b) : Codisjoint (a ⊔ c) b

{α : Type u_1}
[SemilatticeSup α]
[OrderTop α]
{a b : α}
(c : α)
(h : Codisjoint a b)


/-- Given `S' : Solution'`, the key factorization of `S'.a ^ 3 + S'.b ^ 3`. -/
lemma a_cube_add_b_cube_eq_mul :
    S'.a ^ 3 + S'.b ^ 3 = (S'.a + S'.b) * (S'.a + η * S'.b) * (S'.a + η ^ 2 * S'.b)

(S' : FermatLastTheoremForThreeGen.Solution' hζ)


/-- The **Schwarz Lemma**: if `f : ℂ → ℂ` sends an open disk with center `c` and a positive radius
`R₁` to an open disk with center `f c` and radius `R₂`, then the absolute value of the derivative of
`f` at `c` is at most the ratio `R₂ / R₁`. -/
theorem abs_deriv_le_div_of_mapsTo_ball (hd : DifferentiableOn ℂ f (ball c R₁))
    (h_maps : MapsTo f (ball c R₁) (ball (f c) R₂)) (h₀ : 0 < R₁) : abs (deriv f c) ≤ R₂ / R₁

(hd : DifferentiableOn ℂ f (Metric.ball c R₁))

(h_maps : Set.MapsTo f (Metric.ball c R₁) (Metric.ball (f c) R₂))


theorem le_iff_atom_le_imp {α} [BooleanAlgebra α] [IsAtomic α] {x y : α} :
    x ≤ y ↔ ∀ a, IsAtom a → a ≤ x → a ≤ y

{α : Type u_4}
[BooleanAlgebra α]
[IsAtomic α]
{x y : α}

x ≤ y ↔ ∀ (a : α), IsAtom a → a ≤ x → a ≤ y


@[simp] theorem map_iSup [SupSet α] [SupSet β] [sSupHomClass F α β] (f : F) (g : ι → α) :
    f (⨆ i, g i) = ⨆ i, f (g i)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
{ι : Sort u_6}
[FunLike F α β]
[SupSet α]
[SupSet β]
[sSupHomClass F α β]
(f : F)
(g : ι → α)


theorem coe_inj_iff : f = g ↔ (f : V₁ → V₂) = g

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{f g : NormedAddGroupHom V₁ V₂}


theorem differentiableAt_inv : DifferentiableAt 𝕜 (fun x => x⁻¹) x ↔ x ≠ 0

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


theorem card_mul_le_card_mul' [∀ a b, Decidable (r a b)]
    (hn : ∀ b ∈ t, n ≤ (s.bipartiteBelow r b).card)
    (hm : ∀ a ∈ s, (t.bipartiteAbove r a).card ≤ m) : t.card * n ≤ s.card * m

(hn : ∀ b ∈ t, n ≤ (Finset.bipartiteBelow r s b).card)

(hm : ∀ a ∈ s, (Finset.bipartiteAbove r t a).card ≤ m)


theorem coe_linearMapAt (e : Pretrivialization F (π F E)) [e.IsLinear R] (b : B) :
    ⇑(e.linearMapAt R b) = fun y => if b ∈ e.baseSet then (e ⟨b, y⟩).2 else 0

(e : Pretrivialization F Bundle.TotalSpace.proj)

⇑(Pretrivialization.linearMapAt R e b) = fun y => if b ∈ e.baseSet then (↑e { proj := b, snd := y }).2 else 0


@[simp]
lemma subtype_toEquiv {p : X → Prop} {q : Y → Prop} (h : X ≃ₜ Y) (h_iff : ∀ x, p x ↔ q (h x)) :
    (h.subtype h_iff).toEquiv = h.toEquiv.subtypeEquiv h_iff

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{p : X → Prop}
{q : Y → Prop}
(h : X ≃ₜ Y)
(h_iff : ∀ (x : X), p x ↔ q (h x))

(h.subtype h_iff).toEquiv = h.subtypeEquiv h_iff


@[to_additive (attr := simp)] theorem swap_inr (x : N) : swap M N (inr x) = inl x

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(x : N)

(AddMonoid.Coprod.swap M N) (AddMonoid.Coprod.inr x) = AddMonoid.Coprod.inl x


@[to_additive (attr := simp)]
theorem subtype_comp_inclusion {H K : Subgroup G} (hH : H ≤ K) :
    K.subtype.comp (inclusion hH) = H.subtype

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

K.subtype.comp (Subgroup.inclusion hH) = H.subtype


lemma IsRatCondKernelCDFAux.isRatStieltjesPoint_ae (hf : IsRatCondKernelCDFAux f κ ν)
    [IsFiniteKernel κ] [IsFiniteKernel ν] (a : α) :
    ∀ᵐ t ∂(ν a), IsRatStieltjesPoint f (a, t)

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

∀ᵐ (t : β) ∂ν a, ProbabilityTheory.IsRatStieltjesPoint f (a, t)


@[simp]
theorem commutant_commutant (S : VonNeumannAlgebra H) : S.commutant.commutant = S

{H : Type u}
[NormedAddCommGroup H]
[InnerProductSpace ℂ H]
[CompleteSpace H]
(S : VonNeumannAlgebra H)


theorem iInf_le_succ (u : ℕ → α) (n : ℕ) : ⨅ k ≤ n + 1, u k = (⨅ k ≤ n, u k) ⊓ u (n + 1)

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


theorem measurable_of_Iio {f : δ → α} (hf : ∀ x, MeasurableSet (f ⁻¹' Iio x)) : Measurable f

(hf : ∀ (x : α), MeasurableSet (f ⁻¹' Set.Iio x))


/-- The group homomorphism mapping an affine point $(x, y)$ of `W` to the class of the non-zero
fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
@[simps]
noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}

∀ (a : W.Point), WeierstrassCurve.Affine.Point.toClass a = a.toClassFun


theorem liftAux_apply_I (I' : A) (hI') : liftAux I' hI' I = I'

{A : Type u_1}
[Ring A]
[Algebra ℝ A]
(I' : A)
(hI' : I' * I' = -1)


@[simp]
theorem cosh_sub_sinh : cosh x - sinh x = exp (-x)

Real.cosh x - Real.sinh x = Real.exp (-x)


theorem MeasurableSet.biInter {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))


@[to_additive]
theorem mk'_surjective (z : N) : ∃ (x : _) (y : S), f.mk' x y = z

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(z : N)


/-- Given f : Y ⟶ X, we have an equivalence between (T/X)/f and T/Y -/
@[simps]
def iteratedSliceEquiv : Over f ≌ Over f.left

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

f.iteratedSliceEquiv.counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun g =>
      CategoryTheory.Over.isoMk
        (CategoryTheory.Iso.refl ((f.iteratedSliceBackward.comp f.iteratedSliceForward).obj g).left) ⋯)
    ⋯


/-- A lax monoidal functor is a functor `F : C ⥤ D` between monoidal categories,
equipped with morphisms `ε : 𝟙 _D ⟶ F.obj (𝟙_ C)` and `μ X Y : F.obj X ⊗ F.obj Y ⟶ F.obj (X ⊗ Y)`,
satisfying the appropriate coherences. -/
structure LaxMonoidalFunctor extends C ⥤ D where
  /-- unit morphism -/
  ε : 𝟙_ D ⟶ obj (𝟙_ C)
  /-- tensorator -/
  μ : ∀ X Y : C, obj X ⊗ obj Y ⟶ obj (X ⊗ Y)
  μ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      map f ▷ obj X' ≫ μ Y X' = μ X X' ≫ map (f ▷ X') := by
    aesop_cat
  μ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      obj X' ◁ map f ≫ μ X' Y = μ X' X ≫ map (X' ◁ f) := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      μ X Y ▷ obj Z ≫ μ (X ⊗ Y) Z ≫ map (α_ X Y Z).hom =
        (α_ (obj X) (obj Y) (obj Z)).hom ≫ obj X ◁ μ Y Z ≫ μ X (Y ⊗ Z) := by
    aesop_cat
  -- unitality
  left_unitality : ∀ X : C, (λ_ (obj X)).hom = ε ▷ obj X ≫ μ (𝟙_ C) X ≫ map (λ_ X).hom := by
    aesop_cat
  right_unitality : ∀ X : C, (ρ_ (obj X)).hom = obj X ◁ ε ≫ μ X (𝟙_ C) ≫ map (ρ_ X).hom := by
    aesop_cat

(self : CategoryTheory.LaxMonoidalFunctor C D)

(CategoryTheory.MonoidalCategory.rightUnitor (self.obj X)).hom =
  CategoryTheory.MonoidalCategory.whiskerLeft (self.obj X) self.ε ≫
    self.μ X (𝟙_ C) ≫ self.map (CategoryTheory.MonoidalCategory.rightUnitor X).hom


theorem ae_lineDifferentiableAt (hf : LipschitzWith C f) (v : E) :
    ∀ᵐ p ∂μ, LineDifferentiableAt ℝ f p v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{C : ℝ≥0}
{f : E → ℝ}
{μ : MeasureTheory.Measure E}
[μ.IsAddHaarMeasure]
(hf : LipschitzWith C f)
(v : E)

∀ᵐ (p : E) ∂μ, LineDifferentiableAt ℝ f p v


protected lemma le_def : p ≤ q ↔ p.num * q.den ≤ q.num * p.den


/-- A version of the **binomial theorem** for commuting elements in noncommutative semirings. -/
theorem add_pow (h : Commute x y) (n : ℕ) :
    (x + y) ^ n = ∑ m ∈ range (n + 1), x ^ m * y ^ (n - m) * choose n m

{R : Type u_1}
[Semiring R]
{x y : R}
(h : Commute x y)
(n : ℕ)

(x + y) ^ n = ∑ m ∈ Finset.range (n + 1), x ^ m * y ^ (n - m) * ↑(n.choose m)


lemma Odd.add_even (ha : Odd a) (hb : Even b) : Odd (a + b)

{α : Type u_2}
[Semiring α]
{a b : α}
(ha : Odd a)
(hb : Even b)


theorem gc_map_comap (f : F) : GaloisConnection (map f) (comap f)

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[Star B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
(f : F)

GaloisConnection (NonUnitalStarSubalgebra.map f) (NonUnitalStarSubalgebra.comap f)


theorem LipschitzWith.vadd [PseudoEMetricSpace α] {f : α → V} {g : α → P} {Kf Kg : ℝ≥0}
    (hf : LipschitzWith Kf f) (hg : LipschitzWith Kg g) : LipschitzWith (Kf + Kg) (f +ᵥ g)

{α : Type u_1}
{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[PseudoEMetricSpace α]
{f : α → V}
{g : α → P}
{Kf Kg : ℝ≥0}
(hf : LipschitzWith Kf f)
(hg : LipschitzWith Kg g)


@[to_additive]
theorem hasProd_nat_add_iff' {f : ℕ → G} (k : ℕ) :
    HasProd (fun n ↦ f (n + k)) (g / ∏ i ∈ range k, f i) ↔ HasProd f g

{G : Type u_2}
[AddCommGroup G]
{g : G}
[TopologicalSpace G]
[TopologicalAddGroup G]
{f : ℕ → G}
(k : ℕ)

HasSum (fun n => f (n + k)) (g - ∑ i ∈ Finset.range k, f i) ↔ HasSum f g


/-- A completion of `α` is the data of a complete separated uniform space (from the same universe)
and a map from `α` with dense range and inducing the original uniform structure on `α`. -/
structure AbstractCompletion (α : Type u) [UniformSpace α] where
  /-- The underlying space of the completion. -/
  space : Type u
  /-- A map from a space to its completion. -/
  coe : α → space
  /-- The completion carries a uniform structure. -/
  uniformStruct : UniformSpace space
  /-- The completion is complete. -/
  complete : CompleteSpace space
  /-- The completion is a T₀ space. -/
  separation : T0Space space
  /-- The map into the completion is uniform-inducing. -/
  uniformInducing : UniformInducing coe
  /-- The map into the completion has dense range. -/
  dense : DenseRange coe

{α : Type u}
[UniformSpace α]
(self : AbstractCompletion α)


@[simp]
theorem ofFnRec_ofFn {C : List α → Sort*} (h : ∀ (n) (f : Fin n → α), C (List.ofFn f)) {n : ℕ}
    (f : Fin n → α) : @ofFnRec _ C h (List.ofFn f) = h _ f

(h : (n : ℕ) → (f : Fin n → α) → C (List.ofFn f))


lemma IsLUB.exists_of_nonempty_of_not_isSuccLimit
    (hf : IsLUB (Set.range f) x) (hx : ¬ IsSuccLimit x) :
    ∃ i, f i = x

{ι : Type u_1}
{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
[Nonempty ι]
{f : ι → α}
{x : α}
(hf : IsLUB (Set.range f) x)
(hx : ¬Order.IsSuccLimit x)


theorem support_mapRange {f : M → N} {hf : f 0 = 0} {g : α →₀ M} :
    (mapRange f hf g).support ⊆ g.support

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
{f : M → N}
{hf : f 0 = 0}
{g : α →₀ M}

(Finsupp.mapRange f hf g).support ⊆ g.support


@[simp]
theorem top_coe : ((⊤ : LieSubalgebra R L) : Set L) = univ

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]


@[to_additive]
theorem eq_class_eq_leftCoset (s : Subgroup α) (g : α) :
    { x : α | (x : α ⧸ s) = g } = g • s

{α : Type u_1}
[Group α]
(s : Subgroup α)
(g : α)


private lemma le_min_of_lt_of_le (ha : a < b) (hb : a ≤ c) : a ≤ min b c

{R : Type u_2}
[LinearOrder R]
{a b c : R}
(ha : a < b)
(hb : a ≤ c)


@[continuity]
theorem continuous_set_coe (s : Set C(α, β)) (f : s) : Continuous (f : α → β)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(s : Set C(α, β))
(f : ↑s)


theorem eq_top_iff {S : NonUnitalSubalgebra R A} : S = ⊤ ↔ ∀ x : A, x ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S : NonUnitalSubalgebra R A}


@[simp] theorem up_compl [HasCompl α] (a : α) : up (aᶜ) = (up a)ᶜ


theorem pullback_fst_image_snd_preimage (f : X ⟶ Z) (g : Y ⟶ Z) (U : Set Y) :
    (pullback.fst f g) '' ((pullback.snd f g) ⁻¹' U) =
      f ⁻¹' (g '' U)

{X Y Z : TopCat}
(f : X ⟶ Z)
(g : Y ⟶ Z)
(U : Set ↑Y)

⇑(CategoryTheory.Limits.pullback.fst f g) '' (⇑(CategoryTheory.Limits.pullback.snd f g) ⁻¹' U) = ⇑f ⁻¹' (⇑g '' U)


theorem IsPreconnected.subset_connectedComponentIn {x : α} {F : Set α} (hs : IsPreconnected s)
    (hxs : x ∈ s) (hsF : s ⊆ F) : s ⊆ connectedComponentIn F x

{α : Type u}
[TopologicalSpace α]
{s : Set α}
{x : α}
{F : Set α}
(hs : IsPreconnected s)
(hxs : x ∈ s)
(hsF : s ⊆ F)


/-- Equipping a type with the trivial topology is right adjoint to the forgetful functor
`Top ⥤ Type`. -/
@[simps! unit counit]
def adj₂ : forget TopCat.{u} ⊣ trivial

TopCat.adj₂.unit = { app := fun X => { toFun := id, continuous_toFun := ⋯ }, naturality := TopCat.adj₂.proof_2 }


theorem coe_eq_of_eq_mk {a : { a // p a }} {b : α} (h : ↑a = b) : a = ⟨b, h ▸ a.2⟩

{α : Sort u_1}
{p : α → Prop}
{a : { a // p a }}
{b : α}
(h : ↑a = b)


theorem to_isAddGroupHom (f : R →+* S) : IsAddGroupHom f

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
(f : R →+* S)


theorem affineBasisCover_obj (X : Scheme.{u}) (i : X.affineBasisCover.J) :
    X.affineBasisCover.obj i = Spec (X.affineBasisCoverRing i)

(X : AlgebraicGeometry.Scheme)
(i : X.affineBasisCover.J)

X.affineBasisCover.obj i = AlgebraicGeometry.Spec (X.affineBasisCoverRing i)


theorem coe_iSup {ι : Sort*} {f : ι → ℝ≥0} (hf : BddAbove (range f)) :
    (↑(iSup f) : ℝ≥0∞) = ⨆ a, ↑(f a)

{ι : Sort u_3}
{f : ι → ℝ≥0}
(hf : BddAbove (Set.range f))


theorem card_fintypeIoo : Fintype.card (Set.Ioo a b) = b - a - 1

Fintype.card ↑(Set.Ioo a b) = ↑b - ↑a - 1


theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) :
    leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω)

{Ω : Type u_1}
{f : ℕ → Ω → ℝ}
(π : Ω → ℕ)
(r : ℝ)
(ω : Ω)
{n : ℕ}
(hπn : ∀ (ω : Ω), π ω ≤ n)

MeasureTheory.leastGE f r (π ω) ω = min (π ω) (MeasureTheory.leastGE f r n ω)


/-- The duality equivalence `WalkingSpanᵒᵖ ≌ WalkingCospan` -/
@[simps!]
def walkingSpanOpEquiv : WalkingSpanᵒᵖ ≌ WalkingCospan

(X : CategoryTheory.Limits.WidePullbackShape CategoryTheory.Limits.WalkingPair)

CategoryTheory.Limits.walkingSpanOpEquiv.inverse.obj X = Opposite.op X


theorem Perm.nil_eq {l : List α} (p : [] ~ l) : [] = l

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