theorem _root_.Continuous.comp_stronglyMeasurable {_ : MeasurableSpace α} [TopologicalSpace β]
    [TopologicalSpace γ] {g : β → γ} {f : α → β} (hg : Continuous g) (hf : StronglyMeasurable f) :
    StronglyMeasurable fun x => g (f x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] [inst_1 : TopologicalSpace γ] {g : β → γ} {f : α → β},
  Continuous g → MeasureTheory.StronglyMeasurable f → MeasureTheory.StronglyMeasurable fun x => g (f x)


/-- The functor sending `X : C` to the constant functor `J ⥤ C` sending everything to `X`.
-/
@[simps]
def const : C ⥤ J ⥤ C

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

∀ {X_1 Y : J} (x : X_1 ⟶ Y), ((CategoryTheory.Functor.const J).obj X).map x = 𝟙 X


@[simp]
theorem toLinearEquiv_trans (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) :
    (e₁.trans e₂).toLinearEquiv = e₁.toLinearEquiv.trans e₂.toLinearEquiv

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

(e₁.trans e₂).toLinearEquiv = e₁.toLinearEquiv ≪≫ₗ e₂.toLinearEquiv


theorem infDist_eq_iInf : infDist x s = ⨅ y : s, dist x y

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x : α}


/-- Pull back a cover along a morphism. -/
@[simps obj]
def pullback (f : Y ⟶ X) : J.Cover X ⥤ J.Cover Y

(J : CategoryTheory.GrothendieckTopology C)


theorem Equiv.Perm.decomposeOption_symm_of_none_apply {α : Type*} [DecidableEq α] (e : Perm α)
    (i : Option α) : Equiv.Perm.decomposeOption.symm (none, e) i = i.map e

{α : Type u_1}
[DecidableEq α]
(e : Equiv.Perm α)
(i : Option α)

(Equiv.Perm.decomposeOption.symm (none, e)) i = Option.map (⇑e) i


@[to_additive (attr := simp)]
theorem curry_inv [∀ a b, Inv (γ a b)] (x : (i : Σ a, β a) → γ i.1 i.2) :
    Sigma.curry (x⁻¹) = (Sigma.curry x)⁻¹

(x : (i : (a : α) × β a) → γ i.fst i.snd)


theorem hasSum_geometric_of_norm_lt_one (h : ‖ξ‖ < 1) : HasSum (fun n : ℕ ↦ ξ ^ n) (1 - ξ)⁻¹

{K : Type u_4}
[NormedDivisionRing K]
{ξ : K}
(h : ‖ξ‖ < 1)


lemma mem_mapTriangle_essImage_of_distinguished
    [F.IsTriangulated] [F.mapArrow.EssSurj] (T : Triangle D) (hT : T ∈ distTriang D) :
    ∃ (T' : Triangle C) (_ : T' ∈ distTriang C), Nonempty (F.mapTriangle.obj T' ≅ T)

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

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

(T : CategoryTheory.Pretriangulated.Triangle D)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

∃ T', ∃ (_ : T' ∈ CategoryTheory.Pretriangulated.distinguishedTriangles), Nonempty (F.mapTriangle.obj T' ≅ T)


@[ext]
theorem ModularForm.ext {f g : ModularForm Γ k} (h : ∀ x, f x = g x) : f = g

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
{f g : ModularForm Γ k}
(h : ∀ (x : ℍ), f x = g x)


@[simp]
theorem compl_bihimp_self : aᶜ ⇔ a = ⊥

{α : Type u_2}
[HeytingAlgebra α]
(a : α)


theorem Algebra.restrictScalars_adjoin (F : Type*) [CommSemiring F] {E : Type*} [CommSemiring E]
    [Algebra F E] (K : Subalgebra F E) (S : Set E) :
    (Algebra.adjoin K S).restrictScalars F = Algebra.adjoin F (K ∪ S)

(F : Type u_4)
[CommSemiring F]
{E : Type u_5}
[CommSemiring E]
[Algebra F E]
(K : Subalgebra F E)
(S : Set E)

Subalgebra.restrictScalars F (Algebra.adjoin (↥K) S) = Algebra.adjoin F (↑K ∪ S)


theorem lcm_ne_zero (hm : m ≠ 0) (hn : n ≠ 0) : lcm m n ≠ 0


lemma isIso_counit_app_iff_mem_essImage [L.Faithful] [L.Full] {X : D} :
    IsIso (h.counit.app X) ↔ X ∈ L.essImage

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

CategoryTheory.IsIso (h.counit.app X) ↔ X ∈ L.essImage


@[simp]
theorem eval₂_X : X.eval₂ f x = x

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


@[simp]
lemma map_neg : (-z).map Φ = -z.map Φ

(z : CochainComplex.HomComplex.Cochain K L n)


protected theorem tsum_comm {f : α → β → ℝ≥0∞} : ∑' a, ∑' b, f a b = ∑' b, ∑' a, f a b

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


theorem _root_.Pairwise.exists_mem_filter_basis_of_disjoint {I} [Finite I] {l : I → Filter α}
    {ι : I → Sort*} {p : ∀ i, ι i → Prop} {s : ∀ i, ι i → Set α} (hd : Pairwise (Disjoint on l))
    (h : ∀ i, (l i).HasBasis (p i) (s i)) :
    ∃ ind : ∀ i, ι i, (∀ i, p i (ind i)) ∧ Pairwise (Disjoint on fun i => s i (ind i))

(h : ∀ (i : I), (l i).HasBasis (p i) (s i))

∃ ind, (∀ (i : I), p i (ind i)) ∧ Pairwise (Disjoint on fun i => s i (ind i))


theorem length_mono {s₁ s₂ : Set ℝ} (h : s₁ ⊆ s₂) : f.length s₁ ≤ f.length s₂

(f : StieltjesFunction)
{s₁ s₂ : Set ℝ}
(h : s₁ ⊆ s₂)


@[to_additive]
theorem Multipliable.inv (hf : Multipliable f) : Multipliable fun b ↦ (f b)⁻¹

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
(hf : Multipliable f)


theorem map_isCycle_iff_of_injective {p : G.Walk u u} (hinj : Function.Injective f) :
    (p.map f).IsCycle ↔ p.IsCycle

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{f : G →g G'}
{u : V}
{p : G.Walk u u}
(hinj : Function.Injective ⇑f)

(SimpleGraph.Walk.map f p).IsCycle ↔ p.IsCycle


@[simp]
theorem mem_ball : y ∈ ball x ε ↔ dist y x < ε

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


theorem tsum_eval [T2Space F] {α : Type*} {p : α → ContinuousMultilinearMap 𝕜 E F} (hp : Summable p)
    (m : Π i, E i) : (∑' a, p a) m = ∑' a, p a m


lemma IsMeasurableRatCDF.measurable_measure_stieltjesFunction :
    Measurable fun a ↦ (hf.stieltjesFunction a).measure

{f : α → ℚ → ℝ}

(hf : ProbabilityTheory.IsMeasurableRatCDF f)

Measurable fun a => (hf.stieltjesFunction a).measure


theorem NoTopOrder.to_noMaxOrder (α : Type*) [LinearOrder α] [NoTopOrder α] : NoMaxOrder α

(α : Type u_3)
[LinearOrder α]
[NoTopOrder α]


/-- `SemilinearIsometryClass F σ E E₂` asserts `F` is a type of bundled `σ`-semilinear isometries
`E → E₂`.

See also `LinearIsometryClass F R E E₂` for the case where `σ` is the identity map on `R`.

A map `f` between an `R`-module and an `S`-module over a ring homomorphism `σ : R →+* S`
is semilinear if it satisfies the two properties `f (x + y) = f x + f y` and
`f (c • x) = (σ c) • f x`. -/
class SemilinearIsometryClass (𝓕 : Type*) {R R₂ : outParam Type*} [Semiring R] [Semiring R₂]
  (σ₁₂ : outParam <| R →+* R₂) (E E₂ : outParam Type*) [SeminormedAddCommGroup E]
  [SeminormedAddCommGroup E₂] [Module R E] [Module R₂ E₂] [FunLike 𝓕 E E₂] extends
  SemilinearMapClass 𝓕 σ₁₂ E E₂ : Prop where
  norm_map : ∀ (f : 𝓕) (x : E), ‖f x‖ = ‖x‖

[self : SemilinearIsometryClass 𝓕 σ₁₂ E E₂]


theorem aecover_Ico [NoMaxOrder α] : AECover μ l fun i => Ico (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
(ha : Filter.Tendsto a l Filter.atBot)
(hb : Filter.Tendsto b l Filter.atTop)
[NoMaxOrder α]

MeasureTheory.AECover μ l fun i => Set.Ico (a i) (b i)


/-- Extract the isomorphism between the left objects from an isomorphism in the comma category. -/
@[simps!]
def leftIso {X Y : Comma L₁ R₁} (α : X ≅ Y) : X.left ≅ Y.left

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

(CategoryTheory.Comma.leftIso α).inv = α.inv.left


@[simp]
theorem irrational_mul_nat_iff : Irrational (x * n) ↔ n ≠ 0 ∧ Irrational x

Irrational (x * ↑n) ↔ n ≠ 0 ∧ Irrational x


lemma Hom.comp_eq {X Y Z : C} (z₁ : W.LeftFraction X Y) (z₂ : W.LeftFraction Y Z) :
    Hom.comp (mk z₁) (mk z₂) = z₁.comp z₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y Z : C}
(z₁ : W.LeftFraction X Y)
(z₂ : W.LeftFraction Y Z)

(CategoryTheory.MorphismProperty.LeftFraction.Localization.Hom.mk z₁).comp
    (CategoryTheory.MorphismProperty.LeftFraction.Localization.Hom.mk z₂) =
  z₁.comp z₂


@[to_additive]
theorem prod_isUnit_iff {α : Type*} [CommMonoid α] {L : List α} :
    IsUnit L.prod ↔ ∀ m ∈ L, IsUnit m

{α : Type u_8}
[AddCommMonoid α]
{L : List α}


lemma eval₂_minpolyDiv_of_eval₂_eq_zero {T} [CommRing T]
    [IsDomain T] [DecidableEq T] {x y}
    (σ : S →+* T) (hy : eval₂ (σ.comp (algebraMap R S)) y (minpoly R x) = 0) :
    eval₂ σ y (minpolyDiv R x) =
      if σ x = y then σ (aeval x (derivative <| minpoly R x)) else 0

(hy : Polynomial.eval₂ (σ.comp (algebraMap R S)) y (minpoly R x) = 0)

Polynomial.eval₂ σ y (minpolyDiv R x) =
  if σ x = y then σ ((Polynomial.aeval x) (Polynomial.derivative (minpoly R x))) else 0


@[simp]
theorem coe_neg (f : SlashInvariantForm Γ k) : ⇑(-f) = -f

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f : SlashInvariantForm Γ k)


theorem iInf_Ioi_eq (f : StieltjesFunction) (x : ℝ) : ⨅ r : Ioi x, f r = f x


theorem prod_of_left {α β γ} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ]
    {f : α × β → γ} {μ : Measure α} {ν : Measure β} {τ : Measure γ} (hf : Measurable f)
    [SFinite μ] [SFinite ν]
    (h2f : ∀ᵐ y ∂ν, QuasiMeasurePreserving (fun x => f (x, y)) μ τ) :
    QuasiMeasurePreserving f (μ.prod ν) τ

{f : α × β → γ}

(h2f : ∀ᵐ (y : β) ∂ν, MeasureTheory.Measure.QuasiMeasurePreserving (fun x => f (x, y)) μ τ)

MeasureTheory.Measure.QuasiMeasurePreserving f (μ.prod ν) τ


/-- Implementation: If each costructured arrow category on `G` has a terminal object, an equivalence
which is helpful for constructing a right adjoint to `G`.
-/
@[simps]
def rightAdjointOfCostructuredArrowTerminalsAux (B : D) (A : C) :
    (G.obj B ⟶ A) ≃ (B ⟶ (⊤_ CostructuredArrow G A).left)

[∀ (A : C), CategoryTheory.Limits.HasTerminal (CategoryTheory.CostructuredArrow G A)]

(g : B ⟶ (⊤_ CategoryTheory.CostructuredArrow G A).left)

(CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAux G B A).symm g =
  CategoryTheory.CategoryStruct.comp (G.map g) (⊤_ CategoryTheory.CostructuredArrow G A).hom


/-- A component of a transposed version of the inverse mates correspondence. -/
theorem unit_mateEquiv_symm (α : R₁ ⋙ G ⟶ H ⋙ R₂) (c : C) :
    G.map (adj₁.unit.app c) ≫ α.app _ =
      adj₂.unit.app _ ≫ R₂.map (((mateEquiv adj₁ adj₂).symm α).app _)

{C : Type u₁}
{D : Type u₂}
{E : Type u₃}
{F : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.Category.{v₃, u₃} E]
[CategoryTheory.Category.{v₄, u₄} F]
{G : CategoryTheory.Functor C E}
{H : CategoryTheory.Functor D F}
{L₁ : CategoryTheory.Functor C D}
{R₁ : CategoryTheory.Functor D C}
{L₂ : CategoryTheory.Functor E F}
{R₂ : CategoryTheory.Functor F E}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(α : R₁.comp G ⟶ H.comp R₂)
(c : C)

CategoryTheory.CategoryStruct.comp (G.map (adj₁.unit.app c)) (α.app (L₁.obj c)) =
  CategoryTheory.CategoryStruct.comp (adj₂.unit.app (G.obj ((CategoryTheory.Functor.id C).obj c)))
    (R₂.map (((CategoryTheory.mateEquiv adj₁ adj₂).symm α).app ((CategoryTheory.Functor.id C).obj c)))


/-- Inductive construction of isomorphisms in `ComposableArrows C (n + 1)`: in order to
construct an isomorphism `F ≅ G`, it suffices to provide `α : F.obj' 0 ≅ G.obj' 0` and
`β : F.δ₀ ≅ G.δ₀` such that `F.map' 0 1 ≫ app' β.hom 0 = α.hom ≫ G.map' 0 1`. -/
@[simps]
def isoMkSucc {F G : ComposableArrows C (n + 1)} (α : F.obj' 0 ≅ G.obj' 0)
    (β : F.δ₀ ≅ G.δ₀) (w : F.map' 0 1 ≫ app' β.hom 0 = α.hom ≫ G.map' 0 1) : F ≅ G

{F G : CategoryTheory.ComposableArrows C (n + 1)}

(w :
  CategoryTheory.CategoryStruct.comp (F.map' 0 1 ⋯ ⋯) (CategoryTheory.ComposableArrows.app' β.hom 0 ⋯) =
    CategoryTheory.CategoryStruct.comp α.hom (G.map' 0 1 ⋯ ⋯))

(CategoryTheory.ComposableArrows.isoMkSucc α β w).inv = CategoryTheory.ComposableArrows.homMkSucc α.inv β.inv ⋯


/-- To prove a property of a finite product, it suffices to prove that the property is
multiplicative and holds on factors. -/
@[to_additive
      "To prove a property of a finite sum, it suffices to prove that the property is
      additive and holds on summands."]
theorem finprod_mem_induction (p : M → Prop) (hp₀ : p 1) (hp₁ : ∀ x y, p x → p y → p (x * y))
    (hp₂ : ∀ x ∈ s, p <| f x) : p (∏ᶠ i ∈ s, f i)

(hp₁ : ∀ (x y : M), p x → p y → p (x + y))


theorem sbtw_cyclic_left {a b c : α} (h : sbtw a b c) : sbtw b c a

{α : Type u_1}
[CircularPreorder α]
{a b c : α}
(h : sbtw a b c)


theorem Sized.node3R {l x m y r} (hl : @Sized α l) (hm : Sized m) (hr : Sized r) :
    Sized (node3R l x m y r)

{α : Type u_1}
{l : Ordnode α}
{x : α}
{m : Ordnode α}
{y : α}
{r : Ordnode α}
(hl : l.Sized)
(hm : m.Sized)
(hr : r.Sized)


theorem HasDerivWithinAt.cpow (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x)
    (h0 : f x ∈ slitPlane) : HasDerivWithinAt (fun x => f x ^ g x)
      (g x * f x ^ (g x - 1) * f' + f x ^ g x * Complex.log (f x) * g') s x

{f g : ℂ → ℂ}
{s : Set ℂ}
{f' g' x : ℂ}
(hf : HasDerivWithinAt f f' s x)
(hg : HasDerivWithinAt g g' s x)
(h0 : f x ∈ Complex.slitPlane)


/-- `ContinuousMap.Homotopy f₀ f₁` is the type of homotopies from `f₀` to `f₁`.

When possible, instead of parametrizing results over `(f : Homotopy f₀ f₁)`,
you should parametrize over `{F : Type*} [HomotopyLike F f₀ f₁] (f : F)`.

When you extend this structure, make sure to extend `ContinuousMap.HomotopyLike`. -/
structure Homotopy (f₀ f₁ : C(X, Y)) extends C(I × X, Y) where
  /-- value of the homotopy at 0 -/
  map_zero_left : ∀ x, toFun (0, x) = f₀ x
  /-- value of the homotopy at 1 -/
  map_one_left : ∀ x, toFun (1, x) = f₁ x

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
(self : f₀.Homotopy f₁)
(x : X)


theorem coe_to_lieHom (e : L₁ ≃ₗ⁅R⁆ L₂) : ⇑(e : L₁ →ₗ⁅R⁆ L₂) = e

{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₂)


theorem range_eq_top : f.range = ⊤ ↔ Function.Surjective f

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


/-- If the restrictions of a measure to countably many open sets covering the space are
outer regular, then the measure itself is outer regular. -/
lemma of_restrict [OpensMeasurableSpace α] {μ : Measure α} {s : ℕ → Set α}
    (h : ∀ n, OuterRegular (μ.restrict (s n))) (h' : ∀ n, IsOpen (s n)) (h'' : univ ⊆ ⋃ n, s n) :
    OuterRegular μ

(h : ∀ (n : ℕ), (μ.restrict (s n)).OuterRegular)


theorem StructureGroupoid.mem_iff_of_eqOnSource {G : StructureGroupoid H}
    {e e' : PartialHomeomorph H H} (h : e ≈ e') : e ∈ G ↔ e' ∈ G

{H : Type u}
[TopologicalSpace H]
{G : StructureGroupoid H}
{e e' : PartialHomeomorph H H}
(h : e ≈ e')


/-- The canonical isomorphism `(F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle`. -/
@[simps!]
def mapTriangleCompIso : (F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((F.mapTriangleCompIso G).hom.app X).hom₂ = CategoryTheory.CategoryStruct.id (G.obj (F.obj X.obj₂))


protected theorem mul_min_mul_right (a b c : Nat) : min (a * c) (b * c) = min a b * c


theorem measure_Ioi_pos [NoMaxOrder X] (a : X) : 0 < μ (Ioi a)

{X : Type u_1}
[TopologicalSpace X]
[LinearOrder X]
[OrderTopology X]
{m : MeasurableSpace X}
(μ : MeasureTheory.Measure X)
[μ.IsOpenPosMeasure]
[NoMaxOrder X]
(a : X)


lemma nonempty_iInter_Ici_iff [Preorder α] {f : ι → α} :
    (⋂ i, Ici (f i)).Nonempty ↔ BddAbove (range f)

{α : Type u_1}
{ι : Sort u_4}
[Preorder α]
{f : ι → α}

(⋂ i, Set.Ici (f i)).Nonempty ↔ BddAbove (Set.range f)


lemma gaussianPDFReal_sub {μ : ℝ} {v : ℝ≥0} (x y : ℝ) :
    gaussianPDFReal μ v (x - y) = gaussianPDFReal (μ + y) v x

ProbabilityTheory.gaussianPDFReal μ v (x - y) = ProbabilityTheory.gaussianPDFReal (μ + y) v x


@[simp] theorem ofNat_toNat (m : Nat) (x : BitVec n) : BitVec.ofNat m x.toNat = truncate m x

BitVec.ofNat m x.toNat = BitVec.truncate m x


theorem Ioo_ae_eq_Ico' (ha : μ {a} = 0) : Ioo a b =ᵐ[μ] Ico a b

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


@[deprecated measure_sUnion_null_iff (since := "2024-05-14")]
theorem sUnion_null_iff (m : OuterMeasure α) {S : Set (Set α)} (hS : S.Countable) :
    m (⋃₀ S) = 0 ↔ ∀ s ∈ S, m s = 0

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)
{S : Set (Set α)}
(hS : S.Countable)


lemma map_polynomial : (W'.map f).toJacobian.polynomial = MvPolynomial.map f W'.polynomial

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)

(WeierstrassCurve.map W' f).toJacobian.polynomial = (MvPolynomial.map f) W'.polynomial


theorem Nodup.diff [DecidableEq α] : l₁.Nodup → (l₁.diff l₂).Nodup

{α : Type u}
{l₁ l₂ : List α}
[DecidableEq α]


@[simp]
lemma factorizationLCMLeft_zero_right : factorizationLCMLeft a 0 = 1


theorem mem_restrict (x : E) : x ∈ restrict h ↔ x.1 ∈ F

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{F E : IntermediateField K L}
(h : F ≤ E)
(x : ↥E)

x ∈ IntermediateField.restrict h ↔ ↑x ∈ F


@[ext]
lemma FunctorsInverting.ext {W : MorphismProperty C} {F₁ F₂ : FunctorsInverting W D}
    (h : F₁.obj = F₂.obj) : F₁ = F₂

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


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

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

(CategoryTheory.CostructuredArrow.mk f).right = { as := PUnit.unit }


theorem exists_ball_subset_ball (h : y ∈ ball x ε) : ∃ ε' > 0, ball y ε' ⊆ ball x ε

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{ε : ℝ}
(h : y ∈ Metric.ball x ε)

∃ ε' > 0, Metric.ball y ε' ⊆ Metric.ball x ε


theorem galoisConnection_map_comap (hφ : Function.Injective φ.obj) :
    GaloisConnection (map φ hφ) (comap φ)

{C : Type u}
[CategoryTheory.Groupoid C]
{D : Type u_1}
[CategoryTheory.Groupoid D]
(φ : CategoryTheory.Functor C D)
(hφ : Function.Injective φ.obj)

GaloisConnection (CategoryTheory.Subgroupoid.map φ hφ) (CategoryTheory.Subgroupoid.comap φ)


@[simp]
theorem col_empty (v : Fin 0 → α) : col ι v = vecEmpty

{α : Type u}
{ι : Type u_1}
(v : Fin 0 → α)


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


@[simp, norm_cast]
theorem coe_pi : (pi I p : Set ((i : ι) → φ i)) = Set.pi I fun i => p i

{R : Type u}
{ι : Type x}
[Semiring R]
{φ : ι → Type u_1}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
{I : Set ι}
{p : (i : ι) → Submodule R (φ i)}

↑(Submodule.pi I p) = I.pi fun i => ↑(p i)


@[simp]
theorem toFinset_symmDiff [Fintype (s ∆ t : Set _)] :
    (s ∆ t).toFinset = s.toFinset ∆ t.toFinset

{α : Type u_1}
(s t : Set α)
[DecidableEq α]
[Fintype ↑s]
[Fintype ↑t]
[Fintype ↑(symmDiff s t)]

(symmDiff s t).toFinset = symmDiff s.toFinset t.toFinset


theorem fderivWithin_congr (hs : EqOn f₁ f s) (hx : f₁ x = f x) :
    fderivWithin 𝕜 f₁ s x = fderivWithin 𝕜 f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{x : E}
{s : Set E}
(hs : Set.EqOn f₁ f s)
(hx : f₁ x = f x)


/-- Given a subgroup `Γ` of a topological group `G` with measure `ν`, and a measure 'μ' on the
  quotient `G ⧸ Γ` satisfying `QuotientMeasureEqMeasurePreimage`, the restriction
  of `ν` to a fundamental domain is measure-preserving with respect to `μ`. -/
@[to_additive]
theorem measurePreserving_quotientGroup_mk_of_QuotientMeasureEqMeasurePreimage
    {𝓕 : Set G} (h𝓕 : IsFundamentalDomain Γ.op 𝓕 ν) (μ : Measure (G ⧸ Γ))
    [QuotientMeasureEqMeasurePreimage ν μ] :
    MeasurePreserving (@QuotientGroup.mk G _ Γ) (ν.restrict 𝓕) μ

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

MeasureTheory.MeasurePreserving QuotientGroup.mk (ν.restrict 𝓕) μ


@[simp]
theorem repr_ofNat (n : ℕ) : repr (ofNat n) = n


theorem functionField_isFractionRing_of_isAffineOpen [IsIntegral X] (U : X.Opens)
    (hU : IsAffineOpen U) [Nonempty U] :
    IsFractionRing Γ(X, U) X.functionField

(X : AlgebraicGeometry.Scheme)
[AlgebraicGeometry.IsIntegral X]
(U : X.Opens)
(hU : AlgebraicGeometry.IsAffineOpen U)
[Nonempty ↑↑(↑U).toPresheafedSpace]

IsFractionRing ↑(X.presheaf.obj (Opposite.op U)) ↑X.functionField


theorem mem_span_singleton_mul {x y : A} : x ∈ span R {y} * P ↔ ∃ z ∈ P, y * z = x

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
{P : Submodule R A}
{x y : A}

x ∈ Submodule.span R {y} * P ↔ ∃ z ∈ P, y * z = x


protected theorem beq [DecidableEq α] : Primrec₂ (@BEq.beq α _)

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


/-- An `EquivFunctor` is only functorial with respect to equivalences.

To construct an `EquivFunctor`, it suffices to supply just the function `f α → f β` from
an equivalence `α ≃ β`, and then prove the functor laws. It's then a consequence that
this function is part of an equivalence, provided by `EquivFunctor.mapEquiv`.
-/
class EquivFunctor (f : Type u₀ → Type u₁) where
  /-- The action of `f` on isomorphisms. -/
  map : ∀ {α β}, α ≃ β → f α → f β
  /-- `map` of `f` preserves the identity morphism. -/
  map_refl' : ∀ α, map (Equiv.refl α) = @id (f α) := by rfl
  /-- `map` is functorial on equivalences. -/
  map_trans' : ∀ {α β γ} (k : α ≃ β) (h : β ≃ γ), map (k.trans h) = map h ∘ map k := by rfl

{f : Type u₀ → Type u₁}
[self : EquivFunctor f]
{α β γ : Type u₀}
(k : α ≃ β)
(h : β ≃ γ)

EquivFunctor.map (k.trans h) = EquivFunctor.map h ∘ EquivFunctor.map k


/-- A function `f` has the continuous linear map `f'` as derivative along the filter `L` if
`f x' = f x + f' (x' - x) + o (x' - x)` when `x'` converges along the filter `L`. This definition
is designed to be specialized for `L = 𝓝 x` (in `HasFDerivAt`), giving rise to the usual notion
of Fréchet derivative, and for `L = 𝓝[s] x` (in `HasFDerivWithinAt`), giving rise to
the notion of Fréchet derivative along the set `s`. -/
@[mk_iff hasFDerivAtFilter_iff_isLittleO]
structure HasFDerivAtFilter (f : E → F) (f' : E →L[𝕜] F) (x : E) (L : Filter E) : Prop where
  of_isLittleO :: isLittleO : (fun x' => f x' - f x - f' (x' - x)) =o[L] fun x' => x' - x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{L : Filter E}
(self : HasFDerivAtFilter f f' x L)


/-- The Yoneda embedding, as a functor from `C` into presheaves on `C`.

See <https://stacks.math.columbia.edu/tag/001O>.
-/
@[simps]
def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁

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

∀ {X_1 Y : Cᵒᵖ} (f : X_1 ⟶ Y) (g : Opposite.unop X_1 ⟶ X),
  (CategoryTheory.yoneda.obj X).map f g = CategoryTheory.CategoryStruct.comp f.unop g


theorem ordConnected_of_Ioo {α : Type*} [PartialOrder α] {s : Set α}
    (hs : ∀ x ∈ s, ∀ y ∈ s, x < y → Ioo x y ⊆ s) : OrdConnected s

(hs : ∀ x ∈ s, ∀ y ∈ s, x < y → Set.Ioo x y ⊆ s)


theorem ofFractionRing_zero : (ofFractionRing 0 : RatFunc K) = 0


@[simp]
theorem hnot_sup_self (a : α) : ￢a ⊔ a = ⊤

{α : Type u_2}
[CoheytingAlgebra α]
(a : α)


/-- The preimage of a compact set in the image of an inducing map is compact. -/
lemma Inducing.isCompact_preimage' {f : X → Y} (hf : Inducing f) {K : Set Y}
    (hK : IsCompact K) (Kf : K ⊆ range f) : IsCompact (f ⁻¹' K)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Inducing f)
{K : Set Y}
(hK : IsCompact K)
(Kf : K ⊆ Set.range f)


theorem contMDiff_iff_contDiff {f : E → E'} : ContMDiff 𝓘(𝕜, E) 𝓘(𝕜, E') n f ↔ ContDiff 𝕜 n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{n : ℕ∞}
{f : E → E'}


@[simp]
theorem primPart_mul {p q : R[X]} (h0 : p * q ≠ 0) :
    (p * q).primPart = p.primPart * q.primPart

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p q : Polynomial R}
(h0 : p * q ≠ 0)


@[to_additive]
theorem nnnorm_le_nnnorm_add_nnnorm_div' (a b : E) : ‖a‖₊ ≤ ‖b‖₊ + ‖a / b‖₊

{E : Type u_6}
[SeminormedGroup E]
(a b : E)

‖a‖₊ ≤ ‖b‖₊ + ‖a / b‖₊


protected theorem Ne.ite_eq_left_iff (h : a ≠ b) : ite P a b = a ↔ P

{α : Sort u_1}
{P : Prop}
[Decidable P]
{a b : α}
(h : a ≠ b)


theorem forall_mem_inter_of_forall_left (h : ∀ x ∈ l₁, p x) (l₂ : List α) :
    ∀ x, x ∈ l₁ ∩ l₂ → p x

{α : Type u_1}
{l₁ : List α}
{p : α → Prop}
[DecidableEq α]
(h : ∀ (x : α), x ∈ l₁ → p x)
(l₂ : List α)
(x : α)

x ∈ l₁ ∩ l₂ → p x


@[norm_cast]
theorem mul_to_nat (m) : ∀ n, ((m * n : PosNum) : ℕ) = m * n


theorem HasSum.const_smul {a : α} (b : γ) (hf : HasSum f a) : HasSum (fun i ↦ b • f i) (b • a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Monoid γ]
[TopologicalSpace α]
[AddCommMonoid α]
[DistribMulAction γ α]
[ContinuousConstSMul γ α]
{f : β → α}
{a : α}
(b : γ)
(hf : HasSum f a)


@[simp] theorem divInt_zero (n) : n /. 0 = 0


theorem Mon.mul_denote (ctx : Context) (m₁ m₂ : Mon) : (m₁.mul m₂).denote ctx = m₁.denote ctx * m₂.denote ctx

(ctx : Nat.Linear.Context)
(m₁ m₂ : Nat.SOM.Mon)

Nat.SOM.Mon.denote ctx (m₁.mul m₂) = Nat.SOM.Mon.denote ctx m₁ * Nat.SOM.Mon.denote ctx m₂


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

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


theorem isIdempotent_right [Std.IdempotentOp ga] (h : Semiconj₂ f ga gb) (h_surj : Surjective f) :
    Std.IdempotentOp gb

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{ga : α → α → α}
{gb : β → β → β}
[Std.IdempotentOp ga]
(h : Function.Semiconj₂ f ga gb)
(h_surj : Function.Surjective f)


/-- The forward direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def toCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : F.Elementsᵒᵖ ⥤ CostructuredArrow yoneda F

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

(CategoryTheory.CategoryOfElements.toCostructuredArrow F).obj X =
  CategoryTheory.CostructuredArrow.mk (CategoryTheory.yonedaEquiv.symm (Opposite.unop X).snd)


theorem mul_le_mul_right : c ≠ 0 → c ≠ ∞ → (a * c ≤ b * c ↔ a ≤ b)


/-- Reinterpret a finitary infimum homomorphism as a finitary supremum homomorphism between the dual
lattices. -/
@[simps]
protected def dual : InfTopHom α β ≃ SupBotHom αᵒᵈ βᵒᵈ

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
(f : SupBotHom αᵒᵈ βᵒᵈ)

(InfTopHom.dual.symm f).toInfHom = InfHom.dual.symm f.toSupHom


@[simp]
theorem imageToKernel_zero_left [HasKernels V] [HasZeroObject V] {w} :
    imageToKernel (0 : A ⟶ B) g w = 0


@[mfld_simps]
theorem prod_mk_mem_set_prod_eq : ((a, b) ∈ s ×ˢ t) = (a ∈ s ∧ b ∈ t)

{α : Type u}
{β : Type v}
{a : α}
{b : β}
{s : Set α}
{t : Set β}


@[simp]
theorem prod_add : ∀ a b : FactorSet α, (a + b).prod = a.prod * b.prod

{α : Type u_1}
[CancelCommMonoidWithZero α]
(a b : Associates.FactorSet α)


theorem log_conj (x : ℂ) (h : x.arg ≠ π) : log (conj x) = conj (log x)

Complex.log ((starRingEnd ℂ) x) = (starRingEnd ℂ) (Complex.log x)


@[simp]
theorem smul_apply (f : MultilinearMap A M₁ M₂) (c : R') (m : ∀ i, M₁ i) : (c • f) m = c • f m

{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
{R' : Type u_1}
{A : Type u_2}
[Monoid R']
[Semiring A]
[(i : ι) → Module A (M₁ i)]
[DistribMulAction R' M₂]
[Module A M₂]
[SMulCommClass A R' M₂]
(f : MultilinearMap A M₁ M₂)
(c : R')
(m : (i : ι) → M₁ i)


theorem cobounded_pi : cobounded (∀ i, π i) = Filter.coprodᵢ fun i => cobounded (π i)

{ι : Type u_3}
{π : ι → Type u_4}
[(i : ι) → Bornology (π i)]

Bornology.cobounded ((i : ι) → π i) = Filter.coprodᵢ fun i => Bornology.cobounded (π i)


theorem inducing_nhds : Inducing (𝓝 : X → Filter X)


theorem toZNumNeg_succ : ∀ n : Num, n.succ.toZNumNeg = n.toZNumNeg.pred


theorem natDegree_eq_card_roots {p : K[X]} {i : K →+* L} (hsplit : Splits i p) :
    p.natDegree = Multiset.card (p.map i).roots

{K : Type v}
{L : Type w}
[Field K]
[Field L]
{p : K[X]}
{i : K →+* L}
(hsplit : Polynomial.Splits i p)

p.natDegree = Multiset.card (Polynomial.map i p).roots


@[to_additive (attr := simp)]
theorem inv_one : (1 : G)⁻¹ = 1


theorem HasStrictDerivAt.congr_deriv (h : HasStrictDerivAt f f' x) (h' : f' = g') :
    HasStrictDerivAt f g' x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' g' : F}
{x : 𝕜}
(h : HasStrictDerivAt f f' x)
(h' : f' = g')


/-- If the sequence has not terminated before position `n + 1`, the value at `n + 1` gets
squashed into position `n`. -/
theorem squashSeq_nth_of_not_terminated {gp_n gp_succ_n : Pair K} (s_nth_eq : s.get? n = some gp_n)
    (s_succ_nth_eq : s.get? (n + 1) = some gp_succ_n) :
    (squashSeq s n).get? n = some ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩

(GenContFract.squashSeq s n).get? n = some { a := gp_n.a, b := gp_n.b + gp_succ_n.a / gp_succ_n.b }


@[to_additive]
theorem torsionMulEquiv_symm_apply_coe (tG : IsTorsion G) (a : G) :
    tG.torsionMulEquiv.symm a = ⟨Submonoid.topEquiv.symm a, tG _⟩

{G : Type u_1}
[AddCommMonoid G]
(tG : AddMonoid.IsTorsion G)
(a : G)

tG.torsionAddEquiv.symm a = ⟨↑(AddSubmonoid.topEquiv.symm a), ⋯⟩


theorem KaehlerDifferential.quotKerTotalEquiv_symm_comp_D :
    (KaehlerDifferential.quotKerTotalEquiv R S).symm.toLinearMap.compDer
        (KaehlerDifferential.D R S) =
      KaehlerDifferential.derivationQuotKerTotal R S

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

(↑(KaehlerDifferential.quotKerTotalEquiv R S).symm).compDer (KaehlerDifferential.D R S) =
  KaehlerDifferential.derivationQuotKerTotal R S


/-- The second simplicial identity -/
@[reassoc]
theorem δ_comp_σ_of_le {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : i ≤ Fin.castSucc j) :
    X.σ j.succ ≫ X.δ (Fin.castSucc i) = X.δ i ≫ X.σ j

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
{i : Fin (n + 2)}
{j : Fin (n + 1)}
(H : i ≤ j.castSucc)

X.σ j.succ ≫ X.δ i.castSucc = X.δ i ≫ X.σ j


/-- The functor of adjoining a neutral element `one` to a semigroup.
 -/
@[to_additive (attr := simps) "The functor of adjoining a neutral element `zero` to a semigroup"]
def adjoinOne : Semigrp.{u} ⥤ MonCat.{u}

∀ {X Y : Semigrp} (f : ↑X →ₙ* ↑Y), MonCat.adjoinOne.map f = WithOne.map f


@[reassoc (attr := simp)]
theorem w_mk_right {f : Arrow T} {X Y : T} {g : X ⟶ Y} (sq : f ⟶ mk g) :
    sq.left ≫ g = f.hom ≫ sq.right

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f : CategoryTheory.Arrow T}
{X Y : T}
{g : X ⟶ Y}
(sq : f ⟶ CategoryTheory.Arrow.mk g)

CategoryTheory.CategoryStruct.comp sq.left g = CategoryTheory.CategoryStruct.comp f.hom sq.right


@[simp]
theorem self_comp_symm (f : M ≃[L] N) : f.comp f.symm = refl L N

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(f : L.Equiv M N)

f.comp f.symm = FirstOrder.Language.Equiv.refl L N


@[simp]
theorem relMap_apply₂ (r : r₂) (x y : M) :
    @Structure.RelMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 2 r ![x, y] = r₂' r x y

{M : Type w}
{c f₁ f₂ : Type u}
{r₁ r₂ : Type v}
{c' : c → M}
{f₁' : f₁ → M → M}
{f₂' : f₂ → M → M → M}
{r₁' : r₁ → Set M}
{r₂' : r₂ → M → M → Prop}
(r : r₂)
(x y : M)

FirstOrder.Language.Structure.RelMap r ![x, y] = r₂' r x y


lemma singleton_eq_univ [Subsingleton α] (a : α) : ({a} : Finset α) = univ

{α : Type u_1}
[Fintype α]
[Subsingleton α]
(a : α)


theorem free_of_flat_of_localRing [Module.FinitePresentation R P] [Module.Flat R P] :
    Module.Free R P

{R : Type u_1}
[CommRing R]
[LocalRing R]
{P : Type u_2}
[AddCommGroup P]
[Module R P]
[Module.FinitePresentation R P]
[Module.Flat R P]


@[to_additive]
theorem unop_closure (s : Set Mᵐᵒᵖ) : (closure s).unop = closure (MulOpposite.op ⁻¹' s)

{M : Type u_2}
[MulOneClass M]
(s : Set Mᵐᵒᵖ)

(Submonoid.closure s).unop = Submonoid.closure (MulOpposite.op ⁻¹' s)


@[simp]
theorem isSquare_ofNat_iff {n : ℕ} :
    IsSquare (no_index (OfNat.ofNat n) : ℚ) ↔ IsSquare (OfNat.ofNat n : ℕ)

IsSquare (OfNat.ofNat n) ↔ IsSquare (OfNat.ofNat n)


@[to_additive]
theorem leftInv_leftInv_le : S.leftInv.leftInv ≤ S

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)


lemma quasiIso_of_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) [∀ i, K.HasHomology i]
    [∀ i, L.HasHomology i] [∀ i, M.HasHomology i]
    [hφ : QuasiIso φ'] [hφφ' : QuasiIso (φ ≫ φ')] :
    QuasiIso φ


@[to_additive]
theorem OneHom.cancel_right [One M] [One N] [One P] {g₁ g₂ : OneHom N P} {f : OneHom M N}
    (hf : Function.Surjective f) : g₁.comp f = g₂.comp f ↔ g₁ = g₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[One M]
[One N]
[One P]
{g₁ g₂ : OneHom N P}
{f : OneHom M N}
(hf : Function.Surjective ⇑f)


@[to_additive]
theorem symm_comp_eq {α : Type*} (e : M ≃* N) (f : α → M) (g : α → N) :
    e.symm ∘ g = f ↔ g = e ∘ f

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
{α : Type u_12}
(e : M ≃+ N)
(f : α → M)
(g : α → N)


/-- Every element of the π-system generated by the union of a family of π-systems
is a finite intersection of elements from the π-systems.
For an indexed union version, see `mem_generatePiSystem_iUnion_elim'`. -/
theorem mem_generatePiSystem_iUnion_elim {α β} {g : β → Set (Set α)} (h_pi : ∀ b, IsPiSystem (g b))
    (t : Set α) (h_t : t ∈ generatePiSystem (⋃ b, g b)) :
    ∃ (T : Finset β) (f : β → Set α), (t = ⋂ b ∈ T, f b) ∧ ∀ b ∈ T, f b ∈ g b

{α : Type u_1}
{β : Type u_2}
{g : β → Set (Set α)}
(h_pi : ∀ (b : β), IsPiSystem (g b))
(t : Set α)
(h_t : t ∈ generatePiSystem (⋃ b, g b))

∃ T f, t = ⋂ b ∈ T, f b ∧ ∀ b ∈ T, f b ∈ g b


theorem equicontinuousAt_finite [Finite ι] {F : ι → X → α} {x₀ : X} :
    EquicontinuousAt F x₀ ↔ ∀ i, ContinuousAt (F i) x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
[Finite ι]
{F : ι → X → α}
{x₀ : X}

EquicontinuousAt F x₀ ↔ ∀ (i : ι), ContinuousAt (F i) x₀


theorem neg_val {n : ℕ} [NeZero n] (a : ZMod n) : (-a).val = if a = 0 then 0 else n - a.val


@[reassoc, simp]
theorem sub_comp : (f - f') ≫ g = f ≫ g - f' ≫ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{P Q R : C}
(f f' : P ⟶ Q)
(g : Q ⟶ R)


@[to_additive]
theorem map_inv₂ {_ : Group M} {_ : MulOneClass N} {_ : CommGroup P} (f : M →* N →* P) (m : M)
    (n : N) : f m⁻¹ n = (f m n)⁻¹

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

∀ {x : Group M} {x_1 : MulOneClass N} {x_2 : CommGroup P} (f : M →* N →* P) (m : M) (n : N), (f m⁻¹) n = ((f m) n)⁻¹


theorem IsPathConnected.exists_path_through_family' {n : ℕ}
    {s : Set X} (h : IsPathConnected s) (p : Fin (n + 1) → X) (hp : ∀ i, p i ∈ s) :
    ∃ (γ : Path (p 0) (p n)) (t : Fin (n + 1) → I), (∀ t, γ t ∈ s) ∧ ∀ i, γ (t i) = p i

{X : Type u_1}
[TopologicalSpace X]
{n : ℕ}
{s : Set X}
(h : IsPathConnected s)
(p : Fin (n + 1) → X)
(hp : ∀ (i : Fin (n + 1)), p i ∈ s)

∃ γ t, (∀ (t : ↑I), γ t ∈ s) ∧ ∀ (i : Fin (n + 1)), γ (t i) = p i


@[to_additive (attr := simp)]
theorem fst_div [Div G] [Div H] (a b : G × H) : (a / b).1 = a.1 / b.1

{G : Type u_3}
{H : Type u_4}
[Div G]
[Div H]
(a b : G × H)


/-- If an integer `a` and a prime `p` satisfy `gcd a p = 1`, then `a : ZMod p` is nonzero. -/
theorem ne_zero_of_gcd_eq_one {a : ℤ} {p : ℕ} (pp : p.Prime) (h : a.gcd p = 1) : (a : ZMod p) ≠ 0

{a : ℤ}
{p : ℕ}
(pp : Nat.Prime p)
(h : a.gcd ↑p = 1)


theorem IsAlgebraic.of_finite (e : A) [FiniteDimensional K A] : IsAlgebraic K e

(K : Type u_1)
{A : Type u_5}
[Field K]
[Ring A]
[Algebra K A]
(e : A)
[FiniteDimensional K A]


lemma surjective_respectsIso : RingHom.RespectsIso (fun f ↦ Function.Surjective f)

RingHom.RespectsIso fun {R S} [CommRing R] [CommRing S] f => Function.Surjective ⇑f


theorem Int.uniformEmbedding_coe_rat : UniformEmbedding ((↑) : ℤ → ℚ)


@[mono]
theorem toENNReal_mono : Monotone ((↑) : ℕ∞ → ℝ≥0∞)


@[simp]
lemma factoredNumbers_empty : factoredNumbers ∅ = {1}


/-- This is a helper construction that can be useful when verifying that a category has all
    pullbacks. Given `F : WalkingCospan ⥤ C`, which is really the same as
    `cospan (F.map inl) (F.map inr)`, and a pullback cone on `F.map inl` and `F.map inr`, we
    get a cone on `F`.

    If you're thinking about using this, have a look at `hasPullbacks_of_hasLimit_cospan`,
    which you may find to be an easier way of achieving your goal. -/
@[simps]
def Cone.ofPullbackCone {F : WalkingCospan ⥤ C} (t : PullbackCone (F.map inl) (F.map inr)) :
    Cone F

{F : CategoryTheory.Limits.WalkingCospan ⥤ C}

(t :
  CategoryTheory.Limits.PullbackCone (F.map CategoryTheory.Limits.WalkingCospan.Hom.inl)
    (F.map CategoryTheory.Limits.WalkingCospan.Hom.inr))

(CategoryTheory.Limits.Cone.ofPullbackCone t).pt = t.pt


/-- Construct a pseudofunctor from an oplax functor whose `mapId` and `mapComp` are isomorphisms. -/
@[simps]
def mkOfOplax (F : OplaxFunctor B C) (F' : F.PseudoCore) : Pseudofunctor B C

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.OplaxFunctor B C)
(F' : F.PseudoCore)

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


lemma NumberField.InfinitePlace.isUnramifiedIn [IsUnramifiedAtInfinitePlaces k K]
    (w : InfinitePlace k) : IsUnramifiedIn K w

{k : Type u_1}
[Field k]
(K : Type u_2)
[Field K]
[Algebra k K]
[IsUnramifiedAtInfinitePlaces k K]
(w : NumberField.InfinitePlace k)


@[continuity]
theorem continuous_fst : Continuous (@Prod.fst X Y)

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


theorem hermite_monic (n : ℕ) : (hermite n).Monic


@[to_additive]
theorem continuousWithinAt_const_smul_iff (c : G) :
    ContinuousWithinAt (fun x => c • f x) s b ↔ ContinuousWithinAt f s b

{α : Type u_2}
{β : Type u_3}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
[TopologicalSpace β]
{f : β → α}
{b : β}
{s : Set β}
(c : G)


theorem sublist_append_of_sublist_right (s : l <+ l₂) : l <+ l₁ ++ l₂

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


@[simp]
theorem isRefl_neg {B : BilinForm R₁ M₁} : (-B).IsRefl ↔ B.IsRefl

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B : LinearMap.BilinForm R₁ M₁}


@[fun_prop]
theorem HasFDerivWithinAt.restrictScalars (h : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt f (f'.restrictScalars 𝕜) s x

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{f : E → F}
{f' : E →L[𝕜'] F}
{s : Set E}
{x : E}
(h : HasFDerivWithinAt f f' s x)

HasFDerivWithinAt f (ContinuousLinearMap.restrictScalars 𝕜 f') s x


lemma AnalyticWithinAt.continuousWithinAt {f : E → F} {s : Set E} {x : E}
    (h : AnalyticWithinAt 𝕜 f s x) : ContinuousWithinAt f s x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
{x : E}
(h : AnalyticWithinAt 𝕜 f s x)


/-- Any module isomorphism induces a quadratic isomorphism between the corresponding `dual_prod.` -/
@[simps!]
def dualProdIsometry (f : M ≃ₗ[R] N) : (dualProd R M).IsometryEquiv (dualProd R N)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : M ≃ₗ[R] N)

∀ (a : Module.Dual R M × M), (QuadraticForm.dualProdIsometry f) a = ((↑f.symm.dualMap).prodCongr ↑f) a


theorem toNNReal_top_mul (a : ℝ≥0∞) : ENNReal.toNNReal (∞ * a) = 0


/-- Every Yoneda-presheaf is a sheaf for the coherent topology. -/
theorem isSheaf_yoneda_obj (W : C) : Presieve.IsSheaf (coherentTopology C) (yoneda.obj W)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Precoherent C]
(W : C)

CategoryTheory.Presieve.IsSheaf (CategoryTheory.coherentTopology C) (CategoryTheory.yoneda.obj W)


theorem swapRight_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set (γ × β)} (hs : MeasurableSet s) :
    swapRight κ a s = κ a {p | p.swap ∈ s}

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

(κ.swapRight a) s = (κ a) {p | p.swap ∈ s}


theorem terminates_map_iff (f : α → β) (s : Computation α) : Terminates (map f s) ↔ Terminates s

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

(Computation.map f s).Terminates ↔ s.Terminates


theorem prod_eq_generateFrom :
    instTopologicalSpaceProd =
      generateFrom { g | ∃ (s : Set X) (t : Set Y), IsOpen s ∧ IsOpen t ∧ g = s ×ˢ t }

instTopologicalSpaceProd = TopologicalSpace.generateFrom {g | ∃ s t, IsOpen s ∧ IsOpen t ∧ g = s ×ˢ t}


theorem continuous_qRight : Continuous qRight


/-- A version of `bot_lt_iff_ne_bot` for `WithBot` that only requires `LT α`, not
`PartialOrder α`. -/
protected theorem bot_lt_iff_ne_bot : ∀ {x : WithBot α}, ⊥ < x ↔ x ≠ ⊥

⊥ < x ↔ x ≠ ⊥


theorem trailingDegree_lt_wf : WellFounded fun p q : R[X] => trailingDegree p < trailingDegree q

WellFounded fun p q => p.trailingDegree < q.trailingDegree


/-- An additive `n`-Freiman homomorphism from a set `A` to a set `B` is a map which preserves sums
of `n` elements. -/
structure IsAddFreimanHom [AddCommMonoid α] [AddCommMonoid β] (n : ℕ) (A : Set α) (B : Set β)
    (f : α → β) : Prop where
  mapsTo : MapsTo f A B
  /-- An additive `n`-Freiman homomorphism preserves sums of `n` elements. -/
  map_sum_eq_map_sum ⦃s t : Multiset α⦄ (hsA : ∀ ⦃x⦄, x ∈ s → x ∈ A) (htA : ∀ ⦃x⦄, x ∈ t → x ∈ A)
    (hs : Multiset.card s = n) (ht : Multiset.card t = n) (h : s.sum = t.sum) :
    (s.map f).sum = (t.map f).sum

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{n : ℕ}
{A : Set α}
{B : Set β}
{f : α → β}
(self : IsAddFreimanHom n A B f)


lemma condKernel_const [CountableOrCountablyGenerated α β] (ρ : Measure (β × Ω)) [IsFiniteMeasure ρ]
    (a : α) :
    (fun b ↦ Kernel.condKernel (Kernel.const α ρ) (a, b)) =ᵐ[ρ.fst] ρ.condKernel

(fun b => (ProbabilityTheory.Kernel.const α ρ).condKernel (a, b)) =ᵐ[ρ.fst] ⇑ρ.condKernel


@[simp]
theorem coe_comap (s : Subsemiring S) (f : R →+* S) : (s.comap f : Set R) = f ⁻¹' s

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


lemma Integrable.fst {f : α → E × F} (hf : Integrable f μ) : Integrable (fun x ↦ (f x).1) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
{F : Type u_6}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{f : α → E × F}
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (fun x => (f x).1) μ


@[simp 1100]
theorem prevD_zero_cochainComplex (f : ∀ i j, P.X i ⟶ Q.X j) : prevD 0 f = 0

{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{P Q : CochainComplex V ℕ}
(f : (i j : ℕ) → P.X i ⟶ Q.X j)


@[simp]
theorem length_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).length = p.length + q.length

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(p : G.Walk u v)
(q : G.Walk v w)


theorem piecewise_le_piecewise {δ : α → Type*} [∀ i, Preorder (δ i)] {s : Set α}
    [∀ j, Decidable (j ∈ s)] {f₁ f₂ g₁ g₂ : ∀ i, δ i} (h₁ : ∀ i ∈ s, f₁ i ≤ g₁ i)
    (h₂ : ∀ i ∉ s, f₂ i ≤ g₂ i) : s.piecewise f₁ f₂ ≤ s.piecewise g₁ g₂

{α : Type u_1}
{δ : α → Type u_7}
[(i : α) → Preorder (δ i)]
{s : Set α}
[(j : α) → Decidable (j ∈ s)]
{f₁ f₂ g₁ g₂ : (i : α) → δ i}
(h₁ : ∀ i ∈ s, f₁ i ≤ g₁ i)
(h₂ : ∀ i ∉ s, f₂ i ≤ g₂ i)


/-- Given rings `R` and `S` of characteristic `p`, with `R` being perfect,
any homomorphism `R →+* S` can be lifted to a homomorphism `R →+* P`,
where `P` is any perfection of `S`. -/
@[simps]
noncomputable def lift [PerfectRing R p] (S : Type u₂) [CommSemiring S] [CharP S p] (P : Type u₃)
    [CommSemiring P] [CharP P p] [PerfectRing P p] (π : P →+* S) (m : PerfectionMap p π) :
    (R →+* S) ≃ (R →+* P)

(p : ℕ)
[Fact (Nat.Prime p)]
(R : Type u₁)
[CommSemiring R]
[CharP R p]
[PerfectRing R p]
(S : Type u₂)
[CommSemiring S]
[CharP S p]
(P : Type u₃)
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
(π : P →+* S)
(m : PerfectionMap p π)
(f : R →+* P)

(PerfectionMap.lift p R S P π m).symm f = π.comp f


@[simp]
theorem conjTranspose_eq_ofNat [DecidableEq n] [Semiring α] [StarRing α]
    {M : Matrix n n α} {d : ℕ} [d.AtLeastTwo] :
    Mᴴ = no_index (OfNat.ofNat d) ↔ M = OfNat.ofNat d

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Semiring α]
[StarRing α]
{M : Matrix n n α}
{d : ℕ}
[d.AtLeastTwo]


/-- The `map` function preserves the balance invariants. -/
protected theorem Balanced.map {t : RBNode α} : t.Balanced c n → (t.map f).Balanced c n

{α : Type u_1}
{c : Batteries.RBColor}
{n : Nat}

∀ {α_1 : Type u_2} {f : α → α_1} {t : Batteries.RBNode α}, t.Balanced c n → (Batteries.RBNode.map f t).Balanced c n


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

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


@[simp]
theorem preimage_Iio : ((↑) : ℤ → α) ⁻¹' Set.Iio a = Set.Iio ⌈a⌉

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


/--
If `G : C ⥤ D` exhibits `(C, J)` as a dense subsite of `(D, K)`,
it induces an equivalence of category of sheaves valued in a category with suitable limits.
-/
@[simps! functor inverse]
noncomputable def sheafEquiv : Sheaf J A ≌ Sheaf K A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[∀ (X : Dᵒᵖ), CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.StructuredArrow X G.op) A]

[CategoryTheory.Functor.IsDenseSubsite J K G]

(CategoryTheory.Functor.IsDenseSubsite.sheafEquiv G J K A).inverse = G.sheafPushforwardContinuous A J K


theorem tendsto_atBot_atTop [Nonempty α] [SemilatticeInf α] [Preorder β] {f : α → β} :
    Tendsto f atBot atTop ↔ ∀ b : β, ∃ i : α, ∀ a : α, a ≤ i → b ≤ f a

{α : Type u_3}
{β : Type u_4}
[Nonempty α]
[SemilatticeInf α]
[Preorder β]
{f : α → β}

Filter.Tendsto f Filter.atBot Filter.atTop ↔ ∀ (b : β), ∃ i, ∀ a ≤ i, b ≤ f a


@[simp]
theorem equiv_symm_zero : (WithLp.equiv p V).symm 0 = 0

(p : ℝ≥0∞)
{V : Type uV}
[AddCommGroup V]


theorem AEStronglyMeasurable.convolution_integrand_snd (hf : AEStronglyMeasurable f μ)
    (hg : AEStronglyMeasurable g μ) (x : G) :
    AEStronglyMeasurable (fun t => L (f t) (g (x - t))) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEStronglyMeasurable (fun t => (L (f t)) (g (x - t))) μ


theorem lift_apply' (F : Multiplicative G →* A) (f : MonoidAlgebra k G) :
    lift k G A F f = f.sum fun a b => algebraMap k A b * F (Multiplicative.ofAdd a)

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[AddMonoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : Multiplicative G →* A)
(f : MonoidAlgebra k G)

((AddMonoidAlgebra.lift k G A) F) f = Finsupp.sum f fun a b => (algebraMap k A) b * F (Multiplicative.ofAdd a)


/-- `choose n r` is maximised when `r` is `n/2`. -/
theorem choose_le_middle (r n : ℕ) : choose n r ≤ choose n (n / 2)


theorem abs_exp_sub_one_le {x : ℝ} (hx : |x| ≤ 1) : |exp x - 1| ≤ 2 * |x|


theorem extend_function {α β : Type*} {s : Set α} (f : s ↪ β)
    (h : Nonempty ((sᶜ : Set α) ≃ ((range f)ᶜ : Set β))) : ∃ g : α ≃ β, ∀ x : s, g x = f x

{α : Type u_1}
{β : Type u_2}
{s : Set α}
(f : ↑s ↪ β)
(h : Nonempty (↑sᶜ ≃ ↑(Set.range ⇑f)ᶜ))


@[to_additive]
theorem mulETransformRight.card :
    (mulETransformLeft e x).2.card + (mulETransformRight e x).2.card = 2 * x.2.card

{α : Type u_1}
[DecidableEq α]
[Group α]
(e : α)
(x : Finset α × Finset α)

(Finset.mulETransformLeft e x).2.card + (Finset.mulETransformRight e x).2.card = 2 * x.2.card


@[simp] lemma optionSubtypeNe_none (a : α) : optionSubtypeNe a none = a


lemma OrthogonalIdempotents.iff_mul_eq [DecidableEq I] :
    OrthogonalIdempotents e ↔ ∀ i j, e i * e j = if i = j then e i else 0

{R : Type u_1}
[Ring R]
{I : Type u_3}
{e : I → R}
[DecidableEq I]

OrthogonalIdempotents e ↔ ∀ (i j : I), e i * e j = if i = j then e i else 0


@[simp]
theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1

(Finset.uIcc a b).card = (b - a).natAbs + 1


lemma filter_eq_self : s.filter p = s ↔ ∀ x ∈ s, p x

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Finset α}


/-- A set is ample iff its affine translation is. -/
theorem vadd_iff [ContinuousAdd E] {s : Set E} {y : E} :
    AmpleSet (y +ᵥ s) ↔ AmpleSet s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[ContinuousAdd E]
{s : Set E}
{y : E}


theorem const_apply' (f g : R) (U : Opens (PrimeSpectrum.Top R))
    (hu : ∀ x ∈ U, g ∈ (x : PrimeSpectrum.Top R).asIdeal.primeCompl) (x : U)
    (hx : g ∈ (x : PrimeSpectrum.Top R).asIdeal.primeCompl) :
    (const R f g U hu).1 x = IsLocalization.mk' _ f ⟨g, hx⟩

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(hu : ∀ x ∈ U, g ∈ x.asIdeal.primeCompl)

↑(AlgebraicGeometry.StructureSheaf.const R f g U hu) x =
  IsLocalization.mk' (AlgebraicGeometry.StructureSheaf.Localizations R ↑x) f ⟨g, hx⟩


theorem disjoint_compl_right_iff : Disjoint x yᶜ ↔ x ≤ y

{α : Type u}
{x y : α}
[BooleanAlgebra α]


theorem filter_inter_distrib (s t : Finset α) : (s ∩ t).filter p = s.filter p ∩ t.filter p

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

Finset.filter p (s ∩ t) = Finset.filter p s ∩ Finset.filter p t


@[to_additive]
theorem tprod_div (hf : Multipliable f) (hg : Multipliable g) :
    ∏' b, (f b / g b) = (∏' b, f b) / ∏' b, g b

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f g : β → α}
[T2Space α]
(hf : Summable f)
(hg : Summable g)


/-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)

{W₁ W₂ : CategoryTheory.MorphismProperty C}

(self : W₁.FunctorialFactorizationData W₂)

CategoryTheory.CategoryStruct.comp self.i self.p = CategoryTheory.Arrow.leftToRight


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

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

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


@[simp]
theorem multifork_π_app_left (a) :
    (Multiequalizer.multifork I).π.app (WalkingMulticospan.left a) = Multiequalizer.ι I a

(I : CategoryTheory.Limits.MulticospanIndex C)

(CategoryTheory.Limits.Multiequalizer.multifork I).π.app (CategoryTheory.Limits.WalkingMulticospan.left a) =
  CategoryTheory.Limits.Multiequalizer.ι I a


theorem congrFun₃ {β : α → Sort _} {γ : ∀ a, β a → Sort _} {δ : ∀ a b, γ a b → Sort _}
      {f g : ∀ a b c, δ a b c} (h : f = g) (a : α) (b : β a) (c : γ a b) :
    f a b c = g a b c

{δ : (a : α) → (b : β a) → γ a b → Sort u_4}

{f g : (a : α) → (b : β a) → (c : γ a b) → δ a b c}


/-- The `v`-adic valuation on `R` is bounded above by 1. -/
theorem valuation_le_one (r : R) : v.valuation (algebraMap R K r) ≤ 1

(v : IsDedekindDomain.HeightOneSpectrum R)


/-- We define `Scheme` as an `X : LocallyRingedSpace`,
along with a proof that every point has an open neighbourhood `U`
so that the restriction of `X` to `U` is isomorphic,
as a locally ringed space, to `Spec.toLocallyRingedSpace.obj (op R)`
for some `R : CommRingCat`.
-/
structure Scheme extends LocallyRingedSpace where
  local_affine :
    ∀ x : toLocallyRingedSpace,
      ∃ (U : OpenNhds x) (R : CommRingCat),
        Nonempty
          (toLocallyRingedSpace.restrict U.openEmbedding ≅ Spec.toLocallyRingedSpace.obj (op R))

(self : AlgebraicGeometry.Scheme)
(x : ↑self.toTopCat)

∃ U R, Nonempty (self.restrict ⋯ ≅ AlgebraicGeometry.Spec.toLocallyRingedSpace.obj (Opposite.op R))


@[simp]
theorem isRotated_reverse_iff : l.reverse ~r l'.reverse ↔ l ~r l'


@[simp]
theorem image_snd_divisorsAntidiagonal : (divisorsAntidiagonal n).image Prod.snd = divisors n

Finset.image Prod.snd n.divisorsAntidiagonal = n.divisors


@[simp]
theorem toPGame_eq_iff {a b : Ordinal} : a.toPGame = b.toPGame ↔ a = b


@[simp]
theorem to_leftMoves_one_toPGame_symm (i) :
    (@toLeftMovesToPGame 1).symm i = ⟨0, Set.mem_Iio.mpr zero_lt_one⟩

Ordinal.toLeftMovesToPGame.symm i = ⟨0, ⋯⟩


theorem exists_integer_of_is_root_of_monic {p : A[X]} (hp : Monic p) {r : K} (hr : aeval r p = 0) :
    ∃ r' : A, r = algebraMap A K r' ∧ r' ∣ p.coeff 0

{A : Type u_1}
{K : Type u_2}
[CommRing A]
[IsDomain A]
[UniqueFactorizationMonoid A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
{p : A[X]}
(hp : p.Monic)
{r : K}
(hr : (Polynomial.aeval r) p = 0)

∃ r', r = (algebraMap A K) r' ∧ r' ∣ p.coeff 0


/-- A Hölder continuous function is uniformly continuous -/
protected theorem uniformContinuousOn (hf : HolderOnWith C r f s) (h0 : 0 < r) :
    UniformContinuousOn f s

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
{s : Set X}
(hf : HolderOnWith C r f s)
(h0 : 0 < r)


/-- `1 * x` is equivalent to `x`. -/
theorem one_mul_equiv (x : PGame) : 1 * x ≈ x


/-- A commuting square of isomorphisms induces an isomorphism of cokernels. -/
@[simps]
def cokernel.mapIso {X' Y' : C} (f' : X' ⟶ Y') [HasCokernel f'] (p : X ≅ X') (q : Y ≅ Y')
    (w : f ≫ q.hom = p.hom ≫ f') : cokernel f ≅ cokernel f'

(CategoryTheory.Limits.cokernel.mapIso f f' p q w).inv = CategoryTheory.Limits.cokernel.map f' f p.inv q.inv ⋯


theorem hasSum_conj {f : α → ℂ} {x : ℂ} : HasSum (fun x => conj (f x)) x ↔ HasSum f (conj x)

HasSum (fun x => (starRingEnd ℂ) (f x)) x ↔ HasSum f ((starRingEnd ℂ) x)


/-- The expectation of the truncated version of `Xᵢ` behaves asymptotically like the whole
expectation. This follows from convergence and Cesàro averaging. -/
theorem strong_law_aux3 :
    (fun n => 𝔼[∑ i ∈ range n, truncation (X i) i] - n * 𝔼[X 0]) =o[atTop] ((↑) : ℕ → ℝ)

(X : ℕ → Ω → ℝ)

(hint : MeasureTheory.Integrable (X 0) ℙ)

(hident : ∀ (i : ℕ), ProbabilityTheory.IdentDistrib (X i) (X 0) ℙ ℙ)

(fun n =>
    (∫ (a : Ω), (∑ i ∈ Finset.range n, ProbabilityTheory.truncation (X i) ↑i) a) -
      ↑n * ∫ (a : Ω), X 0 a) =o[Filter.atTop]
  Nat.cast


theorem smul_eval_smul (m : M) (f : S[X]) (x : S) : (m • f).eval (m • x) = m • f.eval x

{M : Type u_1}
[Monoid M]
(S : Type u_3)
[CommSemiring S]
[MulSemiringAction M S]
(m : M)
(f : S[X])
(x : S)

Polynomial.eval (m • x) (m • f) = m • Polynomial.eval x f


theorem one_le_padicValNat_of_dvd {n : ℕ} [hp : Fact p.Prime] (hn : 0 < n) (div : p ∣ n) :
    1 ≤ padicValNat p n

{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(hn : 0 < n)
(div : p ∣ n)


@[simp]
theorem mapEquiv_symm (h : M ≃* N) : (mapEquiv h).symm = mapEquiv h.symm

{M : Type u_6}
{N : Type u_7}
[Monoid M]
[Monoid N]
(h : M ≃* N)

(Units.mapEquiv h).symm = Units.mapEquiv h.symm


/-- The one-edge subgraph. -/
@[simps]
def subgraphOfAdj (G : SimpleGraph V) {v w : V} (hvw : G.Adj v w) : G.Subgraph

{V : Type u}
(G : SimpleGraph V)
{v w : V}
(hvw : G.Adj v w)
(a b : V)

(G.subgraphOfAdj hvw).Adj a b = (s(v, w) = s(a, b))


theorem IsPullback.map_iff {D : Type*} [Category D] (F : C ⥤ D) [PreservesLimit (cospan h i) F]
    [ReflectsLimit (cospan h i) F] (e : f ≫ h = g ≫ i) :
    IsPullback (F.map f) (F.map g) (F.map h) (F.map i) ↔ IsPullback f g h i

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan h i) F]

[CategoryTheory.Limits.ReflectsLimit (CategoryTheory.Limits.cospan h i) F]

CategoryTheory.IsPullback (F.map f) (F.map g) (F.map h) (F.map i) ↔ CategoryTheory.IsPullback f g h i


theorem adjoin_le_iff {S : StarSubalgebra R A} {s : Set A} : adjoin R s ≤ S ↔ s ⊆ S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S : StarSubalgebra R A}
{s : Set A}


/-- On objects, the functor which sends a formal direct factor `P` of a
functor `F : J ⥤ C` to the functor `J ⥤ Karoubi C` which sends `(j : J)` to
the corresponding direct factor of `F.obj j`. -/
@[simps]
def obj (P : Karoubi (J ⥤ C)) : J ⥤ Karoubi C

(P : CategoryTheory.Idempotents.Karoubi (J ⥤ C))

((CategoryTheory.Idempotents.KaroubiFunctorCategoryEmbedding.obj P).obj j).X = P.X.obj j


theorem Valid'.rotateL_lemma₁ {a b c : ℕ} (H2 : 3 * a ≤ b + c) (hb₂ : c ≤ 3 * b) : a ≤ 3 * b


@[simp]
nonrec theorem sin_sq_add_cos_sq : sin x ^ 2 + cos x ^ 2 = 1


theorem rpow_add_of_nonneg {x : ℝ≥0∞} (y z : ℝ) (hy : 0 ≤ y) (hz : 0 ≤ z) :
    x ^ (y + z) = x ^ y * x ^ z


@[simp]
theorem DFinsupp.toFinsupp_support (f : Π₀ _ : ι, M) : f.toFinsupp.support = f.support

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Zero M]
[(m : M) → Decidable (m ≠ 0)]
(f : Π₀ (x : ι), M)


theorem mul_neg {α} [StrictOrderedRing α] {a b : α} (ha : a < 0) (hb : 0 < b) : b * a < 0

{α : Type u_1}
[StrictOrderedRing α]
{a b : α}
(ha : a < 0)
(hb : 0 < b)


@[simp]
theorem toIcoMod_add_toIcoDiv_zsmul (a b : α) : toIcoMod hp a b + toIcoDiv hp a b • p = b

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


/-- Finite groups are torsion groups. -/
@[to_additive is_add_torsion_of_finite "Finite additive groups are additive torsion groups."]
theorem isTorsion_of_finite [Finite G] : IsTorsion G


@[to_additive (attr := simp)]
theorem _root_.Subgroup.subtype_range (H : Subgroup G) : H.subtype.range = H

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


/-- A product can be partitioned into a product of products, each equivalent under a setoid. -/
@[to_additive "A sum can be partitioned into a sum of sums, each equivalent under a setoid."]
theorem prod_partition (R : Setoid α) [DecidableRel R.r] :
    ∏ x ∈ s, f x = ∏ xbar ∈ s.image Quotient.mk'', ∏ y ∈ s.filter (⟦·⟧ = xbar), f y

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f : α → β}
[CommMonoid β]
(R : Setoid α)
[DecidableRel Setoid.r]

∏ x ∈ s, f x = ∏ xbar ∈ Finset.image Quotient.mk'' s, ∏ y ∈ Finset.filter (fun x => ⟦x⟧ = xbar) s, f y


theorem eq_of_associated_left {a b c : α} (h : Associated a b) :
    multiplicity b c = multiplicity a c

{α : Type u_1}
[CommMonoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b c : α}
(h : Associated a b)


@[to_additive]
theorem top_mul_of_one_le (hf : 1 ≤ f) : ⊤ * f = ⊤

{α : Type u_2}
[Monoid α]
{f : Filter α}
(hf : 1 ≤ f)


@[simp]
theorem mem_comap {f : P₁ →ᵃ[k] P₂} {x : P₁} {s : AffineSubspace k P₂} : x ∈ s.comap f ↔ f x ∈ s

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
{f : P₁ →ᵃ[k] P₂}
{x : P₁}
{s : AffineSubspace k P₂}


lemma map_sub_eq_div (ψ : AddChar A M) (a b : A) : ψ (a - b) = ψ a / ψ b

{A : Type u_1}
{M : Type u_2}
[AddCommGroup A]
[DivisionCommMonoid M]
(ψ : AddChar A M)
(a b : A)


@[simp]
theorem span_right {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) : (span f g).obj WalkingSpan.right = Z

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

(CategoryTheory.Limits.span f g).obj CategoryTheory.Limits.WalkingSpan.right = Z


theorem to_ne : ∀ {l₁ l₂ : List α}, Lex (· ≠ ·) l₁ l₂ → l₁ ≠ l₂

List.Lex (fun x x_1 => x ≠ x_1) l₁ l₂ → l₁ ≠ l₂


theorem exists_not_mem_one_of_ne_bot [IsDedekindDomain A] {I : Ideal A} (hI0 : I ≠ ⊥)
    (hI1 : I ≠ ⊤) : ∃ x ∈ (I⁻¹ : FractionalIdeal A⁰ K), x ∉ (1 : FractionalIdeal A⁰ K)

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
[IsDedekindDomain A]
{I : Ideal A}
(hI0 : I ≠ ⊥)
(hI1 : I ≠ ⊤)


@[simp]
theorem sigmaCurry_add [∀ i j, AddZeroClass (δ i j)] (f g : Π₀ (i : Σ _, _), δ i.1 i.2) :
    sigmaCurry (f + g) = sigmaCurry f + sigmaCurry g

[(i : ι) → (j : α i) → AddZeroClass (δ i j)]

(f g : Π₀ (i : (x : ι) × α x), δ i.fst i.snd)

(f + g).sigmaCurry = f.sigmaCurry + g.sigmaCurry


theorem isClosed_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
    IsClosed s ↔ ∀ i, IsClosed ((↑) ⁻¹' s : Set (U i))

{β : Type u_2}
[TopologicalSpace β]
{ι : Type u_3}
{U : ι → TopologicalSpace.Opens β}
(hU : iSup U = ⊤)
(s : Set β)

IsClosed s ↔ ∀ (i : ι), IsClosed (Subtype.val ⁻¹' s)


/-- The empty set is meagre. -/
lemma meagre_empty : IsMeagre (∅ : Set X)


theorem continuous_extend_of_cauchy {e : α → β} {f : α → γ} (de : DenseInducing e)
    (h : ∀ b : β, Cauchy (map f (comap e <| 𝓝 b))) : Continuous (de.extend f)

(h : ∀ (b : β), Cauchy (Filter.map f (Filter.comap e (𝓝 b))))


@[to_additive (attr := simp)]
theorem pure_pow : pure a ^ n = pure (a ^ n)

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

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

NonemptyInterval.pure a ^ n = NonemptyInterval.pure (a ^ n)


@[to_additive]
theorem rank_closure_finset_le_card (s : Finset G) : Group.rank (closure (s : Set G)) ≤ s.card

{G : Type u_3}
[AddGroup G]
(s : Finset G)

AddGroup.rank ↥(AddSubgroup.closure ↑s) ≤ s.card


@[norm_cast]
theorem coe_sub (a b : R) :
    (↑(a - b : R) : A) = ↑a - ↑b

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
(a b : R)


theorem Decidable.or_iff_not_imp_right [Decidable b] : a ∨ b ↔ (¬b → a)

a ∨ b ↔ ¬b → a


@[to_additive (attr := simp)]
lemma rangeRestrict_injective_iff {f : G →* N} : Injective f.rangeRestrict ↔ Injective f

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

Function.Injective ⇑f.rangeRestrict ↔ Function.Injective ⇑f


@[reassoc]
lemma toOpen_toSpec_val_c_app (f) (U) :
    StructureSheaf.toOpen (A⁰_ f) U.unop ≫ (toSpec 𝒜 f).val.c.app U =
      awayToΓ 𝒜 f ≫ (Proj| pbo f).presheaf.map (homOfLE le_top).op

(U :
  (TopologicalSpace.Opens
      ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj
              (CommRingCat.of (HomogeneousLocalization.Away 𝒜 f))).toPresheafedSpace)ᵒᵖ)

CategoryTheory.CategoryStruct.comp
    (AlgebraicGeometry.StructureSheaf.toOpen (HomogeneousLocalization.Away 𝒜 f) (Opposite.unop U))
    ((AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f).val.c.app U) =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.ProjectiveSpectrum.Proj.awayToΓ 𝒜 f)
    (((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).presheaf.map (CategoryTheory.homOfLE ⋯).op)


/-- The forget functor `Scheme ⥤ LocallyRingedSpace` is fully faithful. -/
@[simps!]
def fullyFaithfulForgetToLocallyRingedSpace :
    forgetToLocallyRingedSpace.FullyFaithful

∀
  {X Y :
    CategoryTheory.InducedCategory AlgebraicGeometry.LocallyRingedSpace AlgebraicGeometry.Scheme.toLocallyRingedSpace}
  (f :
    (CategoryTheory.inducedFunctor AlgebraicGeometry.Scheme.toLocallyRingedSpace).obj X ⟶
      (CategoryTheory.inducedFunctor AlgebraicGeometry.Scheme.toLocallyRingedSpace).obj Y),
  AlgebraicGeometry.Scheme.fullyFaithfulForgetToLocallyRingedSpace.preimage f = f


/-- `DFinsupp.filter` as a `LinearMap`. -/
@[simps]
def filterLinearMap [Semiring γ] [∀ i, AddCommMonoid (β i)] [∀ i, Module γ (β i)] (p : ι → Prop)
    [DecidablePred p] : (Π₀ i, β i) →ₗ[γ] Π₀ i, β i

{ι : Type u}
(γ : Type w)
(β : ι → Type v)
[Semiring γ]
[(i : ι) → AddCommMonoid (β i)]
[(i : ι) → Module γ (β i)]
(p : ι → Prop)
[DecidablePred p]
(x : Π₀ (i : ι), β i)

(DFinsupp.filterLinearMap γ β p) x = DFinsupp.filter p x


theorem eq_zero_of_ne_zero_of_mul_right_eq_zero [NoZeroDivisors M] {x y : M} (hnx : x ≠ 0)
    (hxy : y * x = 0) : y = 0

{M : Type u_2}
[MonoidWithZero M]
[NoZeroDivisors M]
{x y : M}
(hnx : x ≠ 0)
(hxy : y * x = 0)


theorem norm_abs_eq_norm (a : α) : ‖|a|‖ = ‖a‖

{α : Type u_1}
[NormedLatticeAddCommGroup α]
(a : α)


{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)


theorem nndist_triangle_right (x y z : α) : nndist x y ≤ nndist x z + nndist y z

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


/-- `Equiv.Perm.sumCongr` as a `MonoidHom`, with its two arguments bundled into a single `Prod`.

This is particularly useful for its `MonoidHom.range` projection, which is the subgroup of
permutations which do not exchange elements between `α` and `β`. -/
@[simps]
def sumCongrHom (α β : Type*) : Perm α × Perm β →* Perm (α ⊕ β)

(α : Type u_1)
(β : Type u_2)
(a : Equiv.Perm α × Equiv.Perm β)

(Equiv.Perm.sumCongrHom α β) a = a.1.sumCongr a.2


theorem coe_pow (x : (𝓞 K)ˣ) (n : ℕ) : ((x ^ n : (𝓞 K)ˣ) : K) = (x : K) ^ n

{K : Type u_1}
[Field K]
(x : (𝓞 K)ˣ)
(n : ℕ)

(algebraMap (𝓞 K) K) ↑(x ^ n) = (algebraMap (𝓞 K) K) ↑x ^ n


lemma iSup_sigma' {κ : β → Type*} (f : ∀ i, κ i → α) :
    (⨆ i, ⨆ j, f i j) = ⨆ x : Σ i, κ i, f x.1 x.2

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{κ : β → Type u_9}
(f : (i : β) → κ i → α)


/-- If two maps are homotopic relative to a set, then they are homotopic. -/
protected theorem homotopic {f₀ f₁ : C(X, Y)} (h : HomotopicRel f₀ f₁ S) : Homotopic f₀ f₁

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{S : Set X}
{f₀ f₁ : C(X, Y)}
(h : f₀.HomotopicRel f₁ S)


theorem toZ_mono {i j : ι} (h_le : i ≤ j) : toZ i0 i ≤ toZ i0 j

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 i j : ι}
(h_le : i ≤ j)


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


theorem tendsto_atBot_add_nonpos_left (hf : ∀ x, f x ≤ 0) (hg : Tendsto g l atBot) :
    Tendsto (fun x => f x + g x) l atBot

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(hf : ∀ (x : α), f x ≤ 0)
(hg : Filter.Tendsto g l Filter.atBot)

Filter.Tendsto (fun x => f x + g x) l Filter.atBot


lemma deriv_lt_slope (hfc : StrictConcaveOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableAt ℝ f y) :
    deriv f y < slope f x y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y : ℝ}
(hfc : StrictConcaveOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hfd : DifferentiableAt ℝ f y)


theorem toCocone_ι_app_mk (B : Bicone F) (j : J) : B.toCocone.ι.app ⟨j⟩ = B.ι j


@[simp]
theorem Real.LogDeriv_exp : logDeriv (Real.exp) = 1


@[fun_prop]
theorem differentiableWithinAt_inverse {x : R} (hx : IsUnit x) (s : Set R) :
    DifferentiableWithinAt 𝕜 (@Ring.inverse R _) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{R : Type u_6}
[NormedRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{x : R}
(hx : IsUnit x)
(s : Set R)

DifferentiableWithinAt 𝕜 Ring.inverse s x


@[to_additive]
theorem mem_closure_iff_nhds_one {x : G} {s : Set G} :
    x ∈ closure s ↔ ∀ U ∈ (𝓝 1 : Filter G), ∃ y ∈ s, y / x ∈ U

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{x : G}
{s : Set G}

x ∈ closure s ↔ ∀ U ∈ 𝓝 0, ∃ y ∈ s, y - x ∈ U


/-- The *Euler Product* for multiplicative (on coprime arguments) functions.

If `f : ℕ → R`, where `R` is a complete normed commutative ring, `f 0 = 0`, `f 1 = 1`, `f` is
multiplicative on coprime arguments, and `‖f ·‖` is summable, then
`∏' p : {p : ℕ | p.Prime}, ∑' e, f (p ^ e) = ∑' n, f n`.
This is a version using convergence of finite partial products. -/
theorem eulerProduct (hsum : Summable (‖f ·‖)) (hf₀ : f 0 = 0) :
    Tendsto (fun n : ℕ ↦ ∏ p ∈ primesBelow n, ∑' e, f (p ^ e)) atTop (𝓝 (∑' n, f n))

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)

Filter.Tendsto (fun n => ∏ p ∈ n.primesBelow, ∑' (e : ℕ), f (p ^ e)) Filter.atTop (𝓝 (∑' (n : ℕ), f n))


theorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a

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

r + s ∈ spectrum R ((algebraMap R A) s + a) ↔ r ∈ spectrum R a


@[simp]
theorem zeroth_num_eq_h : g.nums 0 = g.h

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]


theorem argmin_eq_some_iff :
    argmin f l = some m ↔
      m ∈ l ∧ (∀ a ∈ l, f m ≤ f a) ∧ ∀ a ∈ l, f a ≤ f m → l.indexOf m ≤ l.indexOf a

{α : Type u_1}
{β : Type u_2}
[LinearOrder β]
{f : α → β}
{l : List α}
{m : α}
[DecidableEq α]

List.argmin f l = some m ↔
  m ∈ l ∧ (∀ (a : α), a ∈ l → f m ≤ f a) ∧ ∀ (a : α), a ∈ l → f a ≤ f m → List.indexOf m l ≤ List.indexOf a l


theorem embDomain_mapRange (f : α ↪ β) (g : M → N) (p : α →₀ M) (hg : g 0 = 0) :
    embDomain f (mapRange g hg p) = mapRange g hg (embDomain f p)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
(f : α ↪ β)
(g : M → N)
(p : α →₀ M)
(hg : g 0 = 0)

Finsupp.embDomain f (Finsupp.mapRange g hg p) = Finsupp.mapRange g hg (Finsupp.embDomain f p)


/-- Given three points on a circle, the radius of that circle may be expressed explicitly as half
the distance between two of those points divided by the absolute value of the sine of the angle
at the third point (a version of the law of sines or sine rule). -/
theorem dist_div_sin_oangle_div_two_eq_radius {s : Sphere P} {p₁ p₂ p₃ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) (hp₃ : p₃ ∈ s) (hp₁p₂ : p₁ ≠ p₂) (hp₁p₃ : p₁ ≠ p₃) (hp₂p₃ : p₂ ≠ p₃) :
    dist p₁ p₃ / |Real.Angle.sin (∡ p₁ p₂ p₃)| / 2 = s.radius

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

dist p₁ p₃ / |(∡ p₁ p₂ p₃).sin| / 2 = s.radius


@[to_additive (attr := simp)]
theorem map_comp (f : α →ₙ* β) (g : β →ₙ* γ) : map (g.comp f) = (map g).comp (map f)

{α : Type u}
{β : Type v}
{γ : Type w}
[Mul α]
[Mul β]
[Mul γ]
(f : α →ₙ* β)
(g : β →ₙ* γ)

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


theorem differentiableOn_zpow (m : ℤ) (s : Set 𝕜) (h : (0 : 𝕜) ∉ s ∨ 0 ≤ m) :
    DifferentiableOn 𝕜 (fun x => x ^ m) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(m : ℤ)
(s : Set 𝕜)
(h : 0 ∉ s ∨ 0 ≤ m)


/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma
algebra has cardinality at most `(max #s 2) ^ ℵ₀`. -/
theorem cardinalMeasurableSet_le (s : Set (Set α)) :
    #{ t | @MeasurableSet α (generateFrom s) t } ≤ max #s 2 ^ aleph0.{u}

#↑{t | MeasurableSet t} ≤ max (#↑s) 2 ^ ℵ₀


/-- Postcomposing `f` with `Prod.snd` is continuous -/
@[fun_prop]
theorem Continuous.snd {f : X → Y × Z} (hf : Continuous f) : Continuous fun x : X => (f x).2

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


theorem limsup_const_mul [CountableInterFilter f] {u : α → ℝ≥0∞} {a : ℝ≥0∞} :
    f.limsup (a * u ·) = a * f.limsup u

{α : Type u_1}
{f : Filter α}
[CountableInterFilter f]
{u : α → ℝ≥0∞}
{a : ℝ≥0∞}

Filter.limsup (fun x => a * u x) f = a * Filter.limsup u f


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `f'` is nonnegative, then
`f` is a monotone function on `D`. -/
theorem monotoneOn_of_deriv_nonneg {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : DifferentiableOn ℝ f (interior D))
    (hf'_nonneg : ∀ x ∈ interior D, 0 ≤ deriv f x) : MonotoneOn f D


theorem essInf_const_top : essInf (fun _ : α => (⊤ : β)) μ = (⊤ : β)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[CompleteLattice β]


/-- `padicValRat p 0` is `0` for any `p`. -/
@[simp]
protected theorem zero : padicValRat p 0 = 0


theorem single_mem_supported {s : Set α} {a : α} (b : M) (h : a ∈ s) :
    single a b ∈ supported M R s

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set α}
{a : α}
(b : M)
(h : a ∈ s)

Finsupp.single a b ∈ Finsupp.supported M R s


theorem funext [Infinite R] {p q : R[X]} (ext : ∀ r : R, p.eval r = q.eval r) : p = q

(ext : ∀ (r : R), Polynomial.eval r p = Polynomial.eval r q)


@[to_additive]
theorem prod_Ico_succ_div_top (hmn : m ≤ n) :
    (∏ i ∈ Ico m (n + 1), f i) / f n = ∏ i ∈ Ico m n, f i

{M : Type u_3}
(f : ℕ → M)
{m n : ℕ}
[AddCommGroup M]
(hmn : m ≤ n)

∑ i ∈ Finset.Ico m (n + 1), f i - f n = ∑ i ∈ Finset.Ico m n, f i


@[simp]
theorem isTheta_zero_left : (fun _ ↦ (0 : E')) =Θ[l] g'' ↔ g'' =ᶠ[l] 0

{α : Type u_1}
{E' : Type u_6}
{F'' : Type u_10}
[SeminormedAddCommGroup E']
[NormedAddCommGroup F'']
{g'' : α → F''}
{l : Filter α}


/-- Application of a natural transformation at a fixed object,
as group homomorphism -/
@[simps]
def appLinearMap (X : C) : (F ⟶ G) →ₗ[R] F.obj X ⟶ G.obj X

{R : Type u_1}
[Semiring R]
{C : Type u_2}
{D : Type u_3}
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.Category.{u_5, u_3} D]
[CategoryTheory.Preadditive D]
[CategoryTheory.Linear R D]
{F G : CategoryTheory.Functor C D}
(X : C)
(α : F ⟶ G)

(CategoryTheory.NatTrans.appLinearMap X) α = α.app X


theorem add_one_nmul : ∀ a b, (a + 1) ⨳ b = a ⨳ b ♯ b


/-- An additive subgroup of an archimedean linear ordered additive commutative group with order
topology is dense provided that for all positive `ε` there exists a positive element of the
subgroup that is less than `ε`. -/
theorem dense_of_not_isolated_zero (S : AddSubgroup G) (hS : ∀ ε > 0, ∃ g ∈ S, g ∈ Ioo 0 ε) :
    Dense (S : Set G)

(hS : ∀ ε > 0, ∃ g ∈ S, g ∈ Set.Ioo 0 ε)


@[measurability]
theorem AEMeasurable.sup_const (hf : AEMeasurable f μ) (c : M) :
    AEMeasurable (fun x => f x ⊔ c) μ

{M : Type u_1}
[MeasurableSpace M]
{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → M}
[Sup M]
[MeasurableSup M]
(hf : AEMeasurable f μ)
(c : M)


theorem sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow [∀ a b, Decidable (r a b)] :
    (∑ a ∈ s, (t.bipartiteAbove r a).card) = ∑ b ∈ t, (s.bipartiteBelow r b).card

{α : Type u_1}
{β : Type u_2}
(r : α → β → Prop)
{s : Finset α}
{t : Finset β}
[(a : α) → (b : β) → Decidable (r a b)]

∑ a ∈ s, (Finset.bipartiteAbove r t a).card = ∑ b ∈ t, (Finset.bipartiteBelow r s b).card


theorem mem_span_insert_exchange :
    x ∈ span K (insert y s) → x ∉ span K s → y ∈ span K (insert x s)

{K : Type u_3}
{V : Type u}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{s : Set V}
{x y : V}

x ∈ Submodule.span K (insert y s) → x ∉ Submodule.span K s → y ∈ Submodule.span K (insert x s)


theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(s : Multiset α)
(hs : s ≠ 0)

∃ t, s = Multiset.map (fun x => s.gcd * x) t ∧ t.gcd = 1


@[to_additive]
theorem continuous_of_mulTSupport [TopologicalSpace β] {f : α → β}
    (hf : ∀ x ∈ mulTSupport f, ContinuousAt f x) : Continuous f

(hf : ∀ x ∈ tsupport f, ContinuousAt f x)


@[to_additive (attr := simp)]
theorem ker_rangeRestrict (f : G →* N) : ker (rangeRestrict f) = ker f

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


theorem cos_int_mul_two_pi_add_pi (n : ℤ) : cos (n * (2 * π) + π) = -1

Complex.cos (↑n * (2 * ↑Real.pi) + ↑Real.pi) = -1


theorem mod_injOn_Ico (n a : ℕ) : Set.InjOn (· % a) (Finset.Ico n (n + a))

Set.InjOn (fun x => x % a) ↑(Finset.Ico n (n + a))


protected theorem mdifferentiableAt : MDifferentiableAt 𝓘(𝕜, E) 𝓘(𝕜, E') f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
(f : E →L[𝕜] E')
{x : E}

MDifferentiableAt 𝓘(𝕜, E) 𝓘(𝕜, E') (⇑f) x


/-- A split epimorphism is a morphism `f : X ⟶ Y` with a given section `section_ f : Y ⟶ X`
such that `section_ f ≫ f = 𝟙 Y`.
(Note that `section` is a reserved keyword, so we append an underscore.)

Every split epimorphism is an epimorphism.
-/
/- Porting note(#5171): removed @[nolint has_nonempty_instance] -/
/- Porting note: `@[ext]` used to accept lemmas like this. Now we add an aesop rule -/
@[ext, aesop apply safe (rule_sets := [CategoryTheory])]
structure SplitEpi {X Y : C} (f : X ⟶ Y) where
  /-- The map splitting `f` -/
  section_ : Y ⟶ X
  /--  `section_` composed with `f` is the identity -/
  id : section_ ≫ f = 𝟙 Y := by aesop_cat

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

CategoryTheory.CategoryStruct.comp self.section_ f = CategoryTheory.CategoryStruct.id Y


@[simp]
theorem IsSplitEqualizer.asFork_ι {W : C} {h : W ⟶ X} (t : IsSplitEqualizer f g h) :
    t.asFork.ι = h

(t : CategoryTheory.IsSplitEqualizer f g h)


theorem symm_comp_self (h : α ≃ᵢ β) : (h.symm : β → α) ∘ h = id

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)


theorem exists_of_liftRel_left {R : α → β → Prop} {s t} (H : LiftRel R s t) {a} (h : a ∈ s) :
    ∃ b, b ∈ t ∧ R a b

{α : Type u}
{β : Type v}
{R : α → β → Prop}
{s : Stream'.WSeq α}
{t : Stream'.WSeq β}
(H : Stream'.WSeq.LiftRel R s t)
{a : α}
(h : a ∈ s)


@[to_additive]
theorem union_div : (s₁ ∪ s₂) / t = s₁ / t ∪ s₂ / t

{α : Type u_2}
[DecidableEq α]
[Div α]
{s₁ s₂ t : Finset α}


@[simp, norm_cast]
theorem cast_ite [AddGroupWithOne α] (P : Prop) [Decidable P] (m n : ℤ) :
    ((ite P m n : ℤ) : α) = ite P (m : α) (n : α)

{α : Type u_3}
[AddGroupWithOne α]
(P : Prop)
[Decidable P]
(m n : ℤ)

↑(if P then m else n) = if P then ↑m else ↑n


theorem eval_preimage [DecidableEq ι] {s : Set (α i)} :
    eval i ⁻¹' s = pi univ (update (fun i => univ) i s)

{ι : Type u_1}
{α : ι → Type u_2}
{i : ι}
[DecidableEq ι]
{s : Set (α i)}

Function.eval i ⁻¹' s = Set.univ.pi (Function.update (fun i => Set.univ) i s)


lemma Even.neg_one_zpow (h : Even n) : (-1 : α) ^ n = 1

{α : Type u_2}
[DivisionMonoid α]
[HasDistribNeg α]
{n : ℤ}
(h : Even n)


theorem map_sum_lt' {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hg : 0 < g)
    (hf : ∀ i ∈ s, v (f i) < g) : v (∑ i ∈ s, f i) < g

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
{ι : Type u_7}
{s : Finset ι}
{f : ι → R}
{g : Γ₀}
(hg : 0 < g)
(hf : ∀ i ∈ s, v (f i) < g)


/--
The `Applicative` typeclass only contains the operations of an applicative functor.
`LawfulApplicative` further asserts that these operations satisfy the laws of an applicative functor:
```
pure id <*> v = v
pure (·∘·) <*> u <*> v <*> w = u <*> (v <*> w)
pure f <*> pure x = pure (f x)
u <*> pure y = pure (· y) <*> u
```
-/
class LawfulApplicative (f : Type u → Type v) [Applicative f] extends LawfulFunctor f : Prop where
  seqLeft_eq  (x : f α) (y : f β)     : x <* y = const β <$> x <*> y
  seqRight_eq (x : f α) (y : f β)     : x *> y = const α id <$> x <*> y
  pure_seq    (g : α → β) (x : f α)   : pure g <*> x = g <$> x
  map_pure    (g : α → β) (x : α)     : g <$> (pure x : f α) = pure (g x)
  seq_pure    {α β : Type u} (g : f (α → β)) (x : α) : g <*> pure x = (fun h => h x) <$> g
  seq_assoc   {α β γ : Type u} (x : f α) (g : f (α → β)) (h : f (β → γ)) : h <*> (g <*> x) = ((@comp α β γ) <$> h) <*> g <*> x
  comp_map g h x := (by
    repeat rw [← pure_seq]
    simp [seq_assoc, map_pure, seq_pure])

{f : Type u → Type v}
[Applicative f]
[self : LawfulApplicative f]
{α β : Type u}
(x : f α)
(y : f β)

(SeqLeft.seqLeft x fun x => y) = Seq.seq (Function.const β <$> x) fun x => y


theorem TendstoLocallyUniformlyOn.congr {G : ι → α → β} (hf : TendstoLocallyUniformlyOn F f p s)
    (hg : ∀ n, s.EqOn (F n) (G n)) : TendstoLocallyUniformlyOn G f p s

{F : ι → α → β}

{G : ι → α → β}

(hg : ∀ (n : ι), Set.EqOn (F n) (G n) s)


@[simp]
lemma toUnder_comp_forget (F : S ⥤ T) (X : T) (f : (Y : S) → X ⟶ F.obj Y)
    (h : ∀ {Y Z : S} (g : Y ⟶ Z), f Y ≫ F.map g = f Z) : F.toUnder X f h ⋙ Under.forget _ = F

(h : ∀ {Y Z : S} (g : Y ⟶ Z), CategoryTheory.CategoryStruct.comp (f Y) (F.map g) = f Z)

(F.toUnder X f ⋯).comp (CategoryTheory.Under.forget X) = F


@[to_additive ne_zero_of_mem_unit_sphere]
theorem ne_one_of_mem_unit_sphere (x : sphere (1 : E) 1) : (x : E) ≠ 1

{E : Type u_6}
[SeminormedGroup E]
(x : ↑(Metric.sphere 1 1))


@[simp]
theorem forget₂_Mon_map_hom {A B : CommMon_ C} (f : A ⟶ B) : ((forget₂Mon_ C).map f).hom = f.hom

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{A B : CommMon_ C}
(f : A ⟶ B)

((CommMon_.forget₂Mon_ C).map f).hom = f.hom


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

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


@[to_additive]
lemma single_le_prod : (∀ x ∈ s, (1 : α) ≤ x) → ∀ x ∈ s, x ≤ s.prod

{α : Type u_2}
[OrderedCommMonoid α]
{s : Multiset α}


/-- The torsion submodule of the torsion submodule (viewed as a module) is the full
torsion module. -/
-- @[simp] Porting note (#10618): simp can prove this
theorem torsion_torsion_eq_top : torsion R (torsion R M) = ⊤

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]

Submodule.torsion R ↥(Submodule.torsion R M) = ⊤


@[simp]
theorem R_apply : (𝑹 I g) h = h * g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(I : ModelWithCorners 𝕜 E H)
{G : Type u_4}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
(g h : G)


/-- The `p`- and `q`-primary components are disjoint for `p ≠ q`. -/
@[to_additive "The `p`- and `q`-primary components are disjoint for `p ≠ q`."]
theorem primaryComponent.disjoint {p' : ℕ} [hp' : Fact p'.Prime] (hne : p ≠ p') :
    Disjoint (CommMonoid.primaryComponent G p) (CommMonoid.primaryComponent G p')

{G : Type u_1}
[CommMonoid G]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
{p' : ℕ}
[hp' : Fact (Nat.Prime p')]
(hne : p ≠ p')


@[simp]
theorem prod_hom_add_index [AddZeroClass M] [CommMonoid N] {f g : α →₀ M}
    (h : α → Multiplicative M →* N) :
    ((f + g).prod fun a b => h a (Multiplicative.ofAdd b)) =
      (f.prod fun a b => h a (Multiplicative.ofAdd b)) *
        g.prod fun a b => h a (Multiplicative.ofAdd b)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[AddZeroClass M]
[CommMonoid N]
{f g : α →₀ M}
(h : α → Multiplicative M →* N)

((f + g).prod fun a b => (h a) (Multiplicative.ofAdd b)) =
  (f.prod fun a b => (h a) (Multiplicative.ofAdd b)) * g.prod fun a b => (h a) (Multiplicative.ofAdd b)


/--
This is a proof that the number produced using `psp_from_prime` is actually pseudoprime to base `b`.
The primary purpose of this lemma is to help prove `exists_infinite_pseudoprimes`.

We use <https://primes.utm.edu/notes/proofs/a_pseudoprimes.html> as a rough outline of the proof.
-/
private theorem psp_from_prime_psp {b : ℕ} (b_ge_two : 2 ≤ b) {p : ℕ} (p_prime : p.Prime)
    (p_gt_two : 2 < p) (not_dvd : ¬p ∣ b * (b ^ 2 - 1)) : FermatPsp (psp_from_prime b p) b

{b : ℕ}
(b_ge_two : 2 ≤ b)
{p : ℕ}
(p_prime : Nat.Prime p)
(p_gt_two : 2 < p)
(not_dvd : ¬p ∣ b * (b ^ 2 - 1))


theorem derivWithin_congr (hs : EqOn f₁ f s) (hx : f₁ x = f x) :
    derivWithin f₁ s x = derivWithin f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(hs : Set.EqOn f₁ f s)
(hx : f₁ x = f x)


@[simp]
theorem grundyValue_zero : grundyValue 0 = 0


theorem coeff_congr {s : R} (rs : r = s) : coeff f n = s

{R : Type u_1}
[Semiring R]
{m n : ℕ}
{f : R[X]}
{r : R}
(h : f.coeff m = r)
(natDeg_eq_coeff : m = n)
{s : R}
(rs : r = s)


/-- *Rademacher's theorem*: a function between finite-dimensional real vector spaces which is
Lipschitz on a set is differentiable almost everywere in this set. -/
theorem ae_differentiableWithinAt_of_mem {f : E → F} (hf : LipschitzOnWith C f s) :
    ∀ᵐ x ∂μ, x ∈ s → DifferentiableWithinAt ℝ f s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{C : ℝ≥0}
{s : Set E}
{μ : MeasureTheory.Measure E}
[μ.IsAddHaarMeasure]
[FiniteDimensional ℝ F]
{f : E → F}
(hf : LipschitzOnWith C f s)

∀ᵐ (x : E) ∂μ, x ∈ s → DifferentiableWithinAt ℝ f s x


/-- This property implies `IsRatCondKernelCDF`. The measurability, integrability and integral
conditions are the same, but the limit properties of `IsRatCondKernelCDF` are replaced by
limits of integrals. -/
structure IsRatCondKernelCDFAux (f : α × β → ℚ → ℝ) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable : Measurable f
  mono' (a : α) {q r : ℚ} (_hqr : q ≤ r) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ f (a, c) r
  nonneg' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), 0 ≤ f (a, c) q
  le_one' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ 1
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atBot (𝓝 0)` but slightly easier
  to prove in the current applications of this definition (some integral convergence lemmas
  currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_antitone (a : α) (seq : ℕ → ℚ) (_hs : Antitone seq)
    (_hs_tendsto : Tendsto seq atTop atBot) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 0)
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atTop (𝓝 (ν a univ).toReal)` but
  slightly easier to prove in the current applications of this definition (some integral convergence
  lemmas currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_monotone (a : α) (seq : ℕ → ℚ) (_hs : Monotone seq)
    (_hs_tendsto : Tendsto seq atTop atTop) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 (ν a univ).toReal)
  integrable (a : α) (q : ℚ) : Integrable (fun c ↦ f (a, c) q) (ν a)
  setIntegral (a : α) {A : Set β} (_hA : MeasurableSet A) (q : ℚ) :
    ∫ c in A, f (a, c) q ∂(ν a) = (κ a (A ×ˢ Iic ↑q)).toReal

{f : α × β → ℚ → ℝ}

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

(self : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

∀ᵐ (c : β) ∂ν a, f (a, c) q ≤ f (a, c) r


@[simp]
theorem affineCombinationSingleWeights_apply_of_ne [DecidableEq ι] {i j : ι} (h : j ≠ i) :
    affineCombinationSingleWeights k i j = 0

(k : Type u_1)
[Ring k]
{ι : Type u_4}
[DecidableEq ι]
{i j : ι}
(h : j ≠ i)

Finset.affineCombinationSingleWeights k i j = 0


theorem diag_union : (s ∪ t).diag = s.diag ∪ t.diag

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


lemma fourierIntegralInv_eq (f : V → E) (w : V) :
    𝓕⁻ f w = ∫ v, 𝐞 ⟪v, w⟫ • f v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MeasurableSpace V]
[BorelSpace V]
[FiniteDimensional ℝ V]
(f : V → E)
(w : V)

Real.fourierIntegralInv f w = ∫ (v : V), Real.fourierChar ⟪v, w⟫_ℝ • f v


lemma IsOpen.exists_msmooth_support_eq_aux {s : Set H} (hs : IsOpen s) :
    ∃ f : H → ℝ, f.support = s ∧ Smooth I 𝓘(ℝ) f ∧ Set.range f ⊆ Set.Icc 0 1

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
(I : ModelWithCorners ℝ E H)
{s : Set H}
(hs : IsOpen s)

∃ f, Function.support f = s ∧ Smooth I 𝓘(ℝ, ℝ) f ∧ Set.range f ⊆ Set.Icc 0 1


/-- Multiplicative congruence relations preserve integer powers. -/
@[to_additive "Additive congruence relations preserve integer scaling."]
protected theorem zpow : ∀ (n : ℤ) {w x}, c w x → c (w ^ n) (x ^ n)

{M : Type u_1}
[AddGroup M]
(c : AddCon M)
(n : ℤ)
{w x : M}


@[to_additive]
theorem contMDiffAt_finset_prod (h : ∀ i ∈ t, ContMDiffAt I' I n (f i) x) :
    ContMDiffAt I' I n (fun x => ∏ i ∈ t, f i x) x

ContMDiffAt I' I n (fun x => ∑ i ∈ t, f i x) x


theorem HasDerivAt.deriv (h : HasDerivAt f f' x) : deriv f x = f'

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
(h : HasDerivAt f f' x)


/-- The identity map is a coalgebra equivalence. -/
@[refl, simps!]
def refl : A ≃ₗc[R] A

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[CoalgebraStruct R A]

∀ (a : A), (CoalgEquiv.refl R A).invFun a = a


@[simp]
theorem swap_sup [Sup α] [Sup β] (p q : α × β) : (p ⊔ q).swap = p.swap ⊔ q.swap

(α : Type u)
(β : Type v)
[Sup α]
[Sup β]
(p q : α × β)


theorem realize_sentence_iff (h : T.IsComplete) (φ : L.Sentence) (M : Type*) [L.Structure M]
    [M ⊨ T] [Nonempty M] : M ⊨ φ ↔ T ⊨ᵇ φ

{L : FirstOrder.Language}
{T : L.Theory}
(h : T.IsComplete)
(φ : L.Sentence)
(M : Type u_1)
[L.Structure M]
[M ⊨ T]
[Nonempty M]

M ⊨ φ ↔ T ⊨ᵇ φ


/-- We construct the (candidate) limit of a functor `F : J ⥤ Mon_ C`
by interpreting it as a functor `Mon_ (J ⥤ C)`,
and noting that taking limits is a lax monoidal functor,
and hence sends monoid objects to monoid objects.
-/
@[simps!]
def limit (F : J ⥤ Mon_ C) : Mon_ C

(Mon_.limit F).mul =
  CategoryTheory.Limits.limit.lift (F ⋙ Mon_.forget C)
    ((CategoryTheory.Limits.Cones.postcompose
          (CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.inverseObj F).mul).obj
      {
        pt :=
          CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.Limits.limit (F ⋙ Mon_.forget C))
            (CategoryTheory.Limits.limit (F ⋙ Mon_.forget C)),
        π :=
          {
            app := fun j =>
              CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.Limits.limit.π (F ⋙ Mon_.forget C) j)
                (CategoryTheory.Limits.limit.π (F ⋙ Mon_.forget C) j),
            naturality := ⋯ } })


theorem isClosed_ker {V₂ : Type*} [NormedAddCommGroup V₂] (f : NormedAddGroupHom V₁ V₂) :
    IsClosed (f.ker : Set V₁)

{V₁ : Type u_3}
[SeminormedAddCommGroup V₁]
{V₂ : Type u_6}
[NormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)


/-- A prime that does not divide the cardinality of a finite commutative ring `R`
is a unit in `R`. -/
theorem not_isUnit_prime_of_dvd_card {R : Type*} [CommRing R] [Fintype R] (p : ℕ) [Fact p.Prime]
    (hp : p ∣ Fintype.card R) : ¬IsUnit (p : R)

{R : Type u_1}
[CommRing R]
[Fintype R]
(p : ℕ)
[Fact (Nat.Prime p)]
(hp : p ∣ Fintype.card R)


theorem add_one (n : Nat) : n + 1 = succ n


@[simp]
theorem toFinset_reverse {l : List α} : toFinset l.reverse = l.toFinset

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


protected theorem TransCmp.compareOfLessAndEq_of_le
    [LT α] [LE α] [DecidableRel (LT.lt (α := α))] [DecidableEq α]
    (lt_irrefl : ∀ x : α, ¬x < x)
    (lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
    (not_lt : ∀ {x y : α}, ¬x < y → y ≤ x)
    (le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
    TransCmp (α := α) (compareOfLessAndEq · ·)

Batteries.TransCmp fun x x_1 => compareOfLessAndEq x x_1


@[to_additive]
lemma orbitRel_subgroup_le (H : Subgroup G) : orbitRel H α ≤ orbitRel G α

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

AddAction.orbitRel (↥H) α ≤ AddAction.orbitRel G α


theorem Units.nnnorm_pos [Nontrivial α] (x : αˣ) : 0 < ‖(x : α)‖₊

{α : Type u_1}
[NormedRing α]
[Nontrivial α]
(x : αˣ)


@[simp]
lemma mapDomainAlgHom_comp (k A) {G₁ G₂ G₃} [CommSemiring k] [Semiring A] [Algebra k A]
    [AddMonoid G₁] [AddMonoid G₂] [AddMonoid G₃] (f : G₁ →+ G₂) (g : G₂ →+ G₃) :
    mapDomainAlgHom k A (g.comp f) = (mapDomainAlgHom k A g).comp (mapDomainAlgHom k A f)

(k : Type u_3)
(A : Type u_4)
{G₁ : Type u_5}
{G₂ : Type u_6}
{G₃ : Type u_7}
[CommSemiring k]
[Semiring A]
[Algebra k A]
[AddMonoid G₁]
[AddMonoid G₂]
[AddMonoid G₃]
(f : G₁ →+ G₂)
(g : G₂ →+ G₃)

AddMonoidAlgebra.mapDomainAlgHom k A (g.comp f) =
  (AddMonoidAlgebra.mapDomainAlgHom k A g).comp (AddMonoidAlgebra.mapDomainAlgHom k A f)


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


∀ {α : Type u_1} {x : α} {β : Type u_2} {y : β}, (x, y).fst = x


theorem HasGradientAtFilter.congr_of_eventuallyEq (h : HasGradientAtFilter f f' x L)
    (hL : f₁ =ᶠ[L] f) (hx : f₁ x = f x) : HasGradientAtFilter f₁ f' x L

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{L : Filter F}
{f₁ : F → 𝕜}
(h : HasGradientAtFilter f f' x L)
(hL : f₁ =ᶠ[L] f)
(hx : f₁ x = f x)


/-- Predicate asserting that the word `w₁` can be reduced to `w₂` in one step, i.e. there are words
`w₃ w₄` and letter `x` such that `w₁ = w₃xx⁻¹w₄` and `w₂ = w₃w₄`  -/
@[to_additive "Predicate asserting that the word `w₁` can be reduced to `w₂` in one step, i.e. there
  are words `w₃ w₄` and letter `x` such that `w₁ = w₃ + x + (-x) + w₄` and `w₂ = w₃w₄`"]
theorem Step.length : ∀ {L₁ L₂ : List (α × Bool)}, Step L₁ L₂ → L₂.length + 2 = L₁.length

FreeGroup.Red.Step L₁ L₂ → L₂.length + 2 = L₁.length


/-- Without zero divisors, nonzero weight is a `NonTorsionWeight` -/
theorem nonTorsionWeight_of [NoZeroSMulDivisors ℕ M] (hw : ∀ i : σ, w i ≠ 0) :
    NonTorsionWeight w

{σ : Type u_1}
{M : Type u_2}
(w : σ → M)
[AddCommMonoid M]
[NoZeroSMulDivisors ℕ M]
(hw : ∀ (i : σ), w i ≠ 0)


theorem IsCompact.nhdsSet_inf_eq_biSup {K : Set X} (hK : IsCompact K) (l : Filter X) :
    (𝓝ˢ K) ⊓ l = ⨆ x ∈ K, 𝓝 x ⊓ l

{X : Type u}
[TopologicalSpace X]
{K : Set X}
(hK : IsCompact K)
(l : Filter X)


@[to_additive]
protected lemma _root_.MonoidHom.map_multiset_prod (f : α →* β) (s : Multiset α) :
    f s.prod = (s.map f).prod

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


@[simp] theorem filter_cons_of_neg {p : α → Bool} {a : α} (l) (pa : ¬ p a) :
    filter p (a :: l) = filter p l

{α : Type u_1}
{p : α → Bool}
{a : α}
(l : List α)
(pa : ¬p a = true)

List.filter p (a :: l) = List.filter p l


@[simp]
theorem toNatOrdinal_cast_nat (n : ℕ) : toNatOrdinal n = n


@[simp]
theorem neighborSet_bot (v : V) : (⊥ : G.Subgraph).neighborSet v = ∅

{V : Type u}
{G : SimpleGraph V}
(v : V)


/-- A vector in `(𝕜 ∙ u)ᗮ` is orthogonal to `u`. -/
theorem mem_orthogonal_singleton_iff_inner_left {u v : E} : v ∈ (𝕜 ∙ u)ᗮ ↔ ⟪v, u⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{u v : E}

v ∈ (Submodule.span 𝕜 {u})ᗮ ↔ ⟪v, u⟫_𝕜 = 0


/-- `Matrix.conjTranspose` as an `AddEquiv` -/
@[simps apply]
def conjTransposeAddEquiv [AddMonoid α] [StarAddMonoid α] : Matrix m n α ≃+ Matrix n m α

(m : Type u_2)
(n : Type u_3)
(α : Type v)
[AddMonoid α]
[StarAddMonoid α]
(M : Matrix m n α)

(Matrix.conjTransposeAddEquiv m n α) M = Mᴴ


theorem IsLittleO.tendsto_inv_smul_nhds_zero [Module 𝕜 E'] [BoundedSMul 𝕜 E']
    {f : α → E'} {g : α → 𝕜}
    {l : Filter α} (h : f =o[l] g) : Tendsto (fun x => (g x)⁻¹ • f x) l (𝓝 0)

{α : Type u_1}
{E' : Type u_6}
{𝕜 : Type u_15}
[SeminormedAddCommGroup E']
[NormedDivisionRing 𝕜]
[Module 𝕜 E']
[BoundedSMul 𝕜 E']
{f : α → E'}
{g : α → 𝕜}
{l : Filter α}
(h : f =o[l] g)

Filter.Tendsto (fun x => (g x)⁻¹ • f x) l (𝓝 0)


theorem le_radius_cauchyPowerSeries (f : ℂ → E) (c : ℂ) (R : ℝ≥0) :
    ↑R ≤ (cauchyPowerSeries f c R).radius

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : ℂ → E)
(c : ℂ)
(R : ℝ≥0)


theorem effectiveEpi_tfae
    {B X : CompHaus.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ]

[CategoryTheory.EffectiveEpi π, CategoryTheory.Epi π, Function.Surjective ⇑π].TFAE


/--
`Antisymm (·≤·)` says that `(·≤·)` is antisymmetric, that is, `a ≤ b → b ≤ a → a = b`.
-/
class Antisymm {α : Sort u} (r : α → α → Prop) where
  /-- An antisymmetric relation `(·≤·)` satisfies `a ≤ b → b ≤ a → a = b`. -/
  antisymm {a b : α} : r a b → r b a → a = b

{α : Sort u}
{r : α → α → Prop}
[self : Antisymm r]
{a b : α}


@[simp]
lemma preimage_coe_Ici (x : ℝ) : Real.toEReal ⁻¹' Ici x = Ici x


theorem Finite.loopyOn_finite (hE : E.Finite) : Matroid.Finite (loopyOn E)

{α : Type u_1}
{E : Set α}
(hE : E.Finite)


theorem length_take_le' (n) (l : List α) : length (take n l) ≤ l.length


@[simp]
theorem add_eq_zero_iff (f g : Π₀ i, α i) : f + g = 0 ↔ f = 0 ∧ g = 0

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]


theorem Nat.tendsto_pow_atTop_atTop_of_one_lt {m : ℕ} (h : 1 < m) :
    Tendsto (fun n : ℕ ↦ m ^ n) atTop atTop

Filter.Tendsto (fun n => m ^ n) Filter.atTop Filter.atTop


protected theorem toFinset_inter [DecidableEq α] (hs : s.Finite) (ht : t.Finite)
    (h : (s ∩ t).Finite) : h.toFinset = hs.toFinset ∩ ht.toFinset

{α : Type u}
{s t : Set α}
[DecidableEq α]
(hs : s.Finite)
(ht : t.Finite)
(h : (s ∩ t).Finite)


@[simp]
theorem ofMulAction_apply {G H : Type u} [Monoid G] [MulAction G H] (g : G) (x : H) :
    (ofMulAction G H).ρ g x = (g • x : H)


@[to_additive exponent_eq_zero_addOrder_zero]
theorem exponent_eq_zero_of_order_zero {g : G} (hg : orderOf g = 0) : exponent G = 0

{G : Type u}
[AddMonoid G]
{g : G}
(hg : addOrderOf g = 0)


lemma measure_univ_eq (hP : IsProjectiveMeasureFamily P) (I J : Finset ι) :
    P I univ = P J univ

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

(hP : MeasureTheory.IsProjectiveMeasureFamily P)


theorem locallyIntegrable_lineDeriv (hf : LipschitzWith C f) (v : E) :
    LocallyIntegrable (fun x ↦ lineDeriv ℝ f x 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)

MeasureTheory.LocallyIntegrable (fun x => lineDeriv ℝ f x v) μ


@[simp]
theorem mop_comp {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z} :
    (f ≫ g).mop = f.mop ≫ g.mop

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


protected theorem lt_add_of_pos_left : 0 < k → n < k + n


@[to_additive (attr := simp)] lemma unop_one [One α] : unop (1 : αᵐᵒᵖ) = 1


@[simp]
theorem AddSubgroup.toIntSubmodule_symm :
    ⇑(AddSubgroup.toIntSubmodule.symm : _ ≃o AddSubgroup M) = Submodule.toAddSubgroup


theorem IsLocalMinOn.inter (hf : IsLocalMinOn f s a) (t) : IsLocalMinOn f (s ∩ t) a

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


@[simp]
protected lemma «exists» {p : Multiplicative α → Prop} : (∃ a, p a) ↔ ∃ a, p (ofAdd a)

{α : Type u}
{p : Multiplicative α → Prop}

(∃ a, p a) ↔ ∃ a, p (Multiplicative.ofAdd a)


@[to_additive card_nsmul_add_sum]
theorem pow_card_mul_prod {b : β} : b ^ s.card * ∏ a ∈ s, f a = ∏ a ∈ s, b * f a

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f : α → β}
[CommMonoid β]
{b : β}


@[simp]
theorem mulVec_cons {α} [CommSemiring α] (A : m' → Fin n.succ → α) (x : α) (v : Fin n → α) :
    (of A) *ᵥ (vecCons x v) = x • vecHead ∘ A + (of (vecTail ∘ A)) *ᵥ v

{n : ℕ}
{m' : Type uₘ}
{α : Type u_1}
[CommSemiring α]
(A : m' → Fin n.succ → α)
(x : α)
(v : Fin n → α)

(Matrix.of A).mulVec (Matrix.vecCons x v) = x • Matrix.vecHead ∘ A + (Matrix.of (Matrix.vecTail ∘ A)).mulVec v


theorem range_eq_top {f : M →[L] N} : range f = ⊤ ↔ Function.Surjective f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}


theorem multichoose_two (k : ℕ) : multichoose (2 : R) k = k + 1

{R : Type u_2}
[NonAssocSemiring R]
[Pow R ℕ]
[NatPowAssoc R]
[BinomialRing R]
(k : ℕ)


theorem sdiff_sdiff_right' : x \ (y \ z) = x \ y ⊔ x ⊓ z

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]