/-- The composition of homology map data. -/
@[simps]
def comp {φ : S₁ ⟶ S₂} {φ' : S₂ ⟶ S₃} {h₁ : S₁.HomologyData}
    {h₂ : S₂.HomologyData} {h₃ : S₃.HomologyData}
    (ψ : HomologyMapData φ h₁ h₂) (ψ' : HomologyMapData φ' h₂ h₃) :
    HomologyMapData (φ ≫ φ') h₁ h₃

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

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

(ψ' : CategoryTheory.ShortComplex.HomologyMapData φ' h₂ h₃)

(ψ.comp ψ').right = ψ.right.comp ψ'.right


theorem pow (H : IsRelPrime x y) : IsRelPrime (x ^ m) (y ^ n)

{α : Type u_1}
[CommMonoid α]
[DecompositionMonoid α]
{x y : α}
{m n : ℕ}
(H : IsRelPrime x y)


/-- The cokernel of a zero morphism is an isomorphism -/
theorem cokernel.π_of_zero : IsIso (cokernel.π (0 : X ⟶ Y))


/-- Whiskering by an equivalence gives an equivalence between categories of cones.
-/
@[simps]
def whiskeringEquivalence (e : K ≌ J) : Cocone F ≌ Cocone (e.functor ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(e : K ≌ J)

(CategoryTheory.Limits.Cocones.whiskeringEquivalence e).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun s =>
      CategoryTheory.Limits.Cocones.ext
        (CategoryTheory.Iso.refl
          (((CategoryTheory.Limits.Cocones.whiskering e.inverse ⋙
                    CategoryTheory.Limits.Cocones.precompose
                      (F.leftUnitor.inv ≫
                        CategoryTheory.whiskerRight e.counitIso.inv F ≫ (e.inverse.associator e.functor F).inv)) ⋙
                  CategoryTheory.Limits.Cocones.whiskering e.functor).obj
              s).pt)
        ⋯)
    ⋯


theorem apply_mem_neighborSet {v w : V} (h : w ∈ G.neighborSet v) : f w ∈ G'.neighborSet (f v)

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
{v w : V}
(h : w ∈ G.neighborSet v)


lemma seq_eq_image2 (s : Set (α → β)) (t : Set α) : seq s t = image2 (fun f a ↦ f a) s t

{α : Type u}
{β : Type v}
(s : Set (α → β))
(t : Set α)

s.seq t = Set.image2 (fun f a => f a) s t


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

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

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


@[simp] theorem tail?_cons : @tail? α (a::l) = some l


@[simp]
theorem rightUnitor_inv_app {F : C ⥤ D} {X} :
    ((ρ_ F).inv : F ⟶ F ⊗ 𝟙_ _).app X = (ρ_ (F.obj X)).inv

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F : C ⥤ D}
{X : C}


@[to_additive]
lemma prod_eq_one_iff_of_le_one (hf : f ≤ 1) : ∏ i, f i = 1 ↔ f = 1

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


@[to_additive]
lemma units_inf (S T : Submonoid M) : (S ⊓ T).units = S.units ⊓ T.units

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


lemma eq_of_mem_parts (ht : t ∈ P.parts) (hu : u ∈ P.parts) (hat : a ∈ t) (hau : a ∈ u) : t = u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(P : Finpartition s)
{a : α}
(ht : t ∈ P.parts)
(hu : u ∈ P.parts)
(hat : a ∈ t)
(hau : a ∈ u)


theorem mapIdx_append_one : ∀ (f : ℕ → α → β) (l : List α) (e : α),
    mapIdx f (l ++ [e]) = mapIdx f l ++ [f l.length e]

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

List.mapIdx f (l ++ [e]) = List.mapIdx f l ++ [f l.length e]


@[simp]
theorem down_mul (s t : SetSemiring α) : down (s * t) = down s * down t

{α : Type u_1}
[Mul α]
(s t : SetSemiring α)

SetSemiring.down (s * t) = SetSemiring.down s * SetSemiring.down t


/-- Convert an unbundled `IsAbsoluteValue` to a bundled `AbsoluteValue`. -/
@[simps]
def toAbsoluteValue : AbsoluteValue R S

{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
(abv : R → S)
[IsAbsoluteValue abv]

∀ (a : R), (IsAbsoluteValue.toAbsoluteValue abv) a = abv a


lemma directedOn_le_Iic (b : α) : DirectedOn (· ≤ ·) (Iic b)

DirectedOn (fun x x_1 => x ≤ x_1) (Set.Iic b)


theorem comp_symmCompOfNondegenerate_apply (B₁ : BilinForm K V) {B₂ : BilinForm K V}
    (b₂ : B₂.Nondegenerate) (v : V) :
    B₂ (B₁.symmCompOfNondegenerate B₂ b₂ v) = B₁ v

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

B₂ ((B₁.symmCompOfNondegenerate B₂ b₂) v) = B₁ v


/-- The theorem that our isomorphism `Fun(Gⁿ, A) ≅ Hom(k[Gⁿ⁺¹], A)` (where the righthand side is
morphisms in `Rep k G`) commutes with the differentials in the complex of inhomogeneous cochains
and the homogeneous `linearYonedaObjResolution`. -/
@[nolint checkType] theorem d_eq :
    d n A =
      (diagonalHomEquiv n A).toModuleIso.inv ≫
        (linearYonedaObjResolution A).d n (n + 1) ≫
          (diagonalHomEquiv (n + 1) A).toModuleIso.hom

{k G : Type u}
[CommRing k]
(n : ℕ)
[Group G]
(A : Rep k G)

inhomogeneousCochains.d n A =
  (Rep.diagonalHomEquiv n A).toModuleIso.inv ≫
    (groupCohomology.linearYonedaObjResolution A).d n (n + 1) ≫ (Rep.diagonalHomEquiv (n + 1) A).toModuleIso.hom


@[simp]
theorem linearEquivAt_apply (e : Trivialization F (π F E)) [e.IsLinear R] (b : B)
    (hb : b ∈ e.baseSet) (v : E b) : e.linearEquivAt R b hb v = (e ⟨b, v⟩).2

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.linearEquivAt R e b hb) v = (↑e { proj := b, snd := v }).2


theorem rfindOpt {f : α → ℕ → Option σ} (hf : Computable₂ f) :
    Partrec fun a => Nat.rfindOpt (f a)

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{f : α → ℕ → Option σ}
(hf : Computable₂ f)


@[to_additive]
theorem tprod_subtype (s : Set β) (f : β → α) : ∏' x : s, f x = ∏' x, s.mulIndicator f x

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
(s : Set β)
(f : β → α)

∏' (x : ↑s), f ↑x = ∏' (x : β), s.mulIndicator f x


theorem type_eq {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s] :
    type r = type s ↔ Nonempty (r ≃r s)

{α β : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder α r]
[IsWellOrder β s]

Ordinal.type r = Ordinal.type s ↔ Nonempty (r ≃r s)


theorem Filter.EventuallyEq.continuousAt (h : f =ᶠ[𝓝 x] fun _ => y) :
    ContinuousAt f x

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{x : X}
{y : Y}
(h : f =ᶠ[𝓝 x] fun x => y)


protected lemma BddAbove.of_closure : BddAbove (closure s) → BddAbove s

{α : Type u}
[TopologicalSpace α]
[Preorder α]
{s : Set α}


@[to_additive (attr := simp)]
lemma inv_op_smul_finset_distrib (a : α) (s : Finset α) : (op a • s)⁻¹ = a⁻¹ • s⁻¹

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


theorem infix_cons : l₁ <:+: l₂ → l₁ <:+: a :: l₂

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


@[to_additive (attr := simp) card_nsmul_eq_zero]
theorem pow_card_eq_one : x ^ Fintype.card G = 1

{G : Type u_1}
[Group G]
[Fintype G]
{x : G}


theorem summable_apply [AddCommMonoid β] [ContinuousAdd β] {γ : Type*} {f : γ → C(α, β)}
    (hf : Summable f) (x : α) : Summable fun i : γ => f i x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[AddCommMonoid β]
[ContinuousAdd β]
{γ : Type u_3}
{f : γ → C(α, β)}
(hf : Summable f)
(x : α)


theorem cast_to_znum : ∀ n : PosNum, (n : ZNum) = ZNum.pos n


theorem pos_of_mem_ball (hx : x ∈ ball c f.rOut) : 0 < f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)
{x : E}
(hx : x ∈ Metric.ball c f.rOut)


@[simp]
lemma compares_eq [LT α] (a b : α) : Compares eq a b = (a = b)


/-- Implementation of `CommMon_.equivLaxBraidedFunctorPunit`. -/
@[simps]
def commMonToLaxBraided : CommMon_ C ⥤ LaxBraidedFunctor (Discrete PUnit.{u + 1}) C

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

∀ {X Y : CategoryTheory.Discrete PUnit.{u + 1}} (x : X ⟶ Y),
  ((CommMon_.EquivLaxBraidedFunctorPUnit.commMonToLaxBraided C).obj A).map x = 𝟙 ((fun x => A.X) X)


@[simp]
theorem sSup_coe_toSubmodule (S : Set (LieSubmodule R L M)) :
    (↑(sSup S) : Submodule R M) = sSup {(s : Submodule R M) | s ∈ S}

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(S : Set (LieSubmodule R L M))


theorem ContDiffOn.inv {f : E → 𝕜'} {n} (hf : ContDiffOn 𝕜 n f s) (h : ∀ x ∈ s, f x ≠ 0) :
    ContDiffOn 𝕜 n (fun x => (f x)⁻¹) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{𝕜' : Type u_4}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[CompleteSpace 𝕜']
{f : E → 𝕜'}
{n : ℕ∞}
(hf : ContDiffOn 𝕜 n f s)
(h : ∀ x ∈ s, f x ≠ 0)


/-- For any given denominator `b : M`, the map `a ↦ a / b` is an `AddMonoidHom` from `R` to
  `Localization M`-/
@[simps]
def mkAddMonoidHom (b : M) : R →+ Localization M

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(b : ↥M)
(a : R)

(Localization.mkAddMonoidHom b) a = Localization.mk a b


/-- Map an `Arrow.Relation` along a refinement `S ⟶ T`. -/
@[simps]
def Arrow.Relation.map {S T : J.Cover X} {I₁ I₂ : S.Arrow}
    (r : I₁.Relation I₂) (f : S ⟶ T) : (I₁.map f).Relation (I₂.map f)

{J : CategoryTheory.GrothendieckTopology C}


/-- Sum of elements in a `NonUnitalSubring` of a `NonUnitalRing` indexed by a `Finset`
is in the `NonUnitalSubring`. -/
protected theorem sum_mem {R : Type*} [NonUnitalNonAssocRing R] (s : NonUnitalSubring R)
    {ι : Type*} {t : Finset ι} {f : ι → R} (h : ∀ c ∈ t, f c ∈ s) : (∑ i ∈ t, f i) ∈ s

{R : Type u_1}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)
{ι : Type u_2}
{t : Finset ι}
{f : ι → R}
(h : ∀ c ∈ t, f c ∈ s)


private lemma div_ne_zero_of_ne_zero_of_pos (ha : a ≠ 0) (hb : 0 < b) : a / b ≠ 0

{α : Type u_4}
[LinearOrderedSemifield α]
{a b : α}
(ha : a ≠ 0)
(hb : 0 < b)


theorem sdiff_disjoint : Disjoint (t \ s) s

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


theorem comp_right_hasFDerivWithinAt_iff' {f : F → G} {s : Set F} {x : E} {f' : E →L[𝕜] G} :
    HasFDerivWithinAt (f ∘ iso) f' (iso ⁻¹' s) x ↔
      HasFDerivWithinAt f (f'.comp (iso.symm : F →L[𝕜] E)) s (iso x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃L[𝕜] F)
{f : F → G}
{s : Set F}
{x : E}
{f' : E →L[𝕜] G}

HasFDerivWithinAt (f ∘ ⇑iso) f' (⇑iso ⁻¹' s) x ↔ HasFDerivWithinAt f (f'.comp ↑iso.symm) s (iso x)


/-- If the multiplicative action of `M` on `N` is compatible with multiplication on `N`, then
`fun x ↦ x • 1` is a monoid homomorphism from `M` to `N`. -/
@[to_additive (attr := simps)
"If the additive action of `M` on `N` is compatible with addition on `N`, then
`fun x ↦ x +ᵥ 0` is an additive monoid homomorphism from `M` to `N`."]
def MonoidHom.smulOneHom {M N} [Monoid M] [MulOneClass N] [MulAction M N] [IsScalarTower M N N] :
    M →* N

{M : Type u_11}
{N : Type u_12}
[AddMonoid M]
[AddZeroClass N]
[AddAction M N]
[VAddAssocClass M N N]
(x : M)


@[to_additive (attr := simp, norm_cast)] lemma val_inv_eq_inv_val (u : αˣ) : ↑u⁻¹ = (u⁻¹ : α)

{α : Type u}
[DivisionMonoid α]
(u : αˣ)

↑u⁻¹ = (↑u)⁻¹


theorem _root_.Function.Semiconj.finset_map {f : α ↪ β} {ga : α ↪ α} {gb : β ↪ β}
    (h : Function.Semiconj f ga gb) : Function.Semiconj (map f) (map ga) (map gb)

{α : Type u_1}
{β : Type u_2}
{f : α ↪ β}
{ga : α ↪ α}
{gb : β ↪ β}
(h : Function.Semiconj ⇑f ⇑ga ⇑gb)

Function.Semiconj (Finset.map f) (Finset.map ga) (Finset.map gb)


lemma IsEllDivSequence.smul (h : IsEllDivSequence W) (x : R) : IsEllDivSequence (x • W)

{R : Type u}
[CommRing R]
{W : ℤ → R}
(h : IsEllDivSequence W)
(x : R)


theorem zeroLocus_bUnion (s : Set (Set R)) :
    zeroLocus (⋃ s' ∈ s, s' : Set R) = ⋂ s' ∈ s, zeroLocus s'

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

PrimeSpectrum.zeroLocus (⋃ s' ∈ s, s') = ⋂ s' ∈ s, PrimeSpectrum.zeroLocus s'


lemma IsPullback.of_iso {sq₁ sq₂ : Square C} (h : sq₁.IsPullback)
    (e : sq₁ ≅ sq₂) : sq₂.IsPullback

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq₁ sq₂ : CategoryTheory.Square C}
(h : sq₁.IsPullback)
(e : sq₁ ≅ sq₂)


theorem subset_iUnion (h : J ∈ π) : ↑J ⊆ π.iUnion

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
(h : J ∈ π)


lemma mem_corootSpace {x : H} :
    x ∈ corootSpace α ↔
    (x : L) ∈ Submodule.span R {⁅y, z⁆ | (y ∈ rootSpace H α) (z ∈ rootSpace H (-α))}

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{H : LieSubalgebra R L}
[LieAlgebra.IsNilpotent R ↥H]
[H.IsCartanSubalgebra]
[IsNoetherian R L]
(α : ↥H → R)
{x : ↥H}

x ∈ LieAlgebra.corootSpace α ↔
  ↑x ∈ Submodule.span R {x | ∃ y ∈ LieAlgebra.rootSpace H α, ∃ z ∈ LieAlgebra.rootSpace H (-α), ⁅y, z⁆ = x}


theorem add_const (hf : DiffContOnCl 𝕜 f s) (c : F) : DiffContOnCl 𝕜 (fun x => f x + c) s

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


theorem isCoprime_self : IsCoprime x x ↔ IsUnit x


@[to_additive]
protected lemma mul_mul_div (a : α) (h : IsUnit b) : a * b * (1 / b) = a

{α : Type u}
[DivisionMonoid α]
{b : α}
(a : α)
(h : IsUnit b)


@[simp] lemma coe_tosSupHom (f : CompleteLatticeHom α β) : ⇑f.tosSupHom = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)


@[simp]
theorem dual_Iio : Iio (toDual a) = ofDual ⁻¹' Ioi a

Set.Iio (OrderDual.toDual a) = ⇑OrderDual.ofDual ⁻¹' Set.Ioi a


/-- Pythagorean theorem, vector inner product form. -/
theorem norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero (x y : E) (h : ⟪x, y⟫ = 0) :
    ‖x + y‖ * ‖x + y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)
(h : ⟪x, y⟫_𝕜 = 0)


theorem lift_strictMono : StrictMono lift


@[simp]
theorem NormedAddGroupHom.completion_coe_to_fun (f : NormedAddGroupHom G H) :
    (f.completion : Completion G → Completion H) = Completion.map f

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
(f : NormedAddGroupHom G H)

⇑f.completion = UniformSpace.Completion.map ⇑f


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

{α : Type u_2}
[Lattice α]
(L : Sublattice α)
(s : Set α)
(hs : s = ↑L)


@[to_additive]
lemma Subgroup.orderOf_le_card (s : Subgroup G) (hs : (s : Set G).Finite) (hx : x ∈ s) :
    orderOf x ≤ Nat.card s

{G : Type u_1}
[Group G]
{x : G}
(s : Subgroup G)
(hs : (↑s).Finite)
(hx : x ∈ s)


theorem xgcd_val (x y) : xgcd x y = (gcdA x y, gcdB x y)


@[simp]
theorem infs_subset_iff : s ⊼ t ⊆ u ↔ ∀ a ∈ s, ∀ b ∈ t, a ⊓ b ∈ u

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s t u : Finset α}


/-- If `n % 4 = 3`, then `χ₄ n = -1`. -/
theorem χ₄_nat_three_mod_four {n : ℕ} (hn : n % 4 = 3) : χ₄ n = -1


@[to_additive (attr := simp)]
theorem index_top : (⊤ : Subgroup G).index = 1


protected theorem StrictAnti.strictAntiOn (hf : StrictAnti f) (s : Set α) : StrictAntiOn f s

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


@[simp, measurability]
theorem measurableSet_Iic : MeasurableSet (Iic a)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[Preorder α]
[OrderClosedTopology α]
{a : α}


theorem roots_expand_pow_image_iterateFrobenius_subset [DecidableEq R] :
    (expand R (p ^ n) f).roots.toFinset.image (iterateFrobenius R p n) ⊆ f.roots.toFinset

{R : Type u_1}
[CommRing R]
[IsDomain R]
(p n : ℕ)
[ExpChar R p]
(f : R[X])
[DecidableEq R]

Finset.image (⇑(iterateFrobenius R p n)) ((Polynomial.expand R (p ^ n)) f).roots.toFinset ⊆ f.roots.toFinset


theorem MapsTo.countable_of_injOn {s : Set α} {t : Set β} {f : α → β} (hf : MapsTo f s t)
    (hf' : InjOn f s) (ht : t.Countable) : s.Countable

{α : Type u}
{β : Type v}
{s : Set α}
{t : Set β}
{f : α → β}
(hf : Set.MapsTo f s t)
(hf' : Set.InjOn f s)
(ht : t.Countable)


/-- The affine span of a single point, coerced to a set, contains just that point. -/
@[simp 1001] -- Porting note: this needs to take priority over `coe_affineSpan`
theorem coe_affineSpan_singleton (p : P) : (affineSpan k ({p} : Set P) : Set P) = {p}

(k : Type u_1)
(V : Type u_2)
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
(p : P)


@[simp]
theorem span_eq : span (I : Set α) = I


theorem Tendsto.atTop_zsmul_const {f : α → ℤ} (hr : 0 < r) (hf : Tendsto f l atTop) :
    Tendsto (fun x => f x • r) l atTop

{α : Type u_1}
{R : Type u_2}
{l : Filter α}
{r : R}
[LinearOrderedAddCommGroup R]
[Archimedean R]
{f : α → ℤ}
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => f x • r) l Filter.atTop


@[simp]
theorem OrderHom.antisymmetrization_apply_mk (f : α →o β) (a : α) :
    f.antisymmetrization (toAntisymmetrization _ a) = toAntisymmetrization _ (f a)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α →o β)
(a : α)

f.antisymmetrization (toAntisymmetrization (fun x x_1 => x ≤ x_1) a) = toAntisymmetrization (fun x x_1 => x ≤ x_1) (f a)


/-- If the derivative of a function defined on the real line is integrable close to `+∞`, then
the function has a limit at `+∞`. -/
theorem tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi [CompleteSpace E]
    (hderiv : ∀ x ∈ Ioi a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Ioi a)) :
    Tendsto f atTop (𝓝 (limUnder atTop f))

(hderiv : ∀ x ∈ Set.Ioi a, HasDerivAt f (f' x) x)

(f'int : MeasureTheory.IntegrableOn f' (Set.Ioi a) MeasureTheory.volume)

Filter.Tendsto f Filter.atTop (𝓝 (limUnder Filter.atTop f))


theorem powHalf_pos (n : ℕ) : 0 < powHalf n


/-- Auxiliary lemma for `IsAdjoinRoot.lift` -/
theorem eval₂_repr_eq_eval₂_of_map_eq (h : IsAdjoinRoot S f) (z : S) (w : R[X])
    (hzw : h.map w = z) : (h.repr z).eval₂ i x = w.eval₂ i x

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[CommRing T]
{i : R →+* T}
{x : T}
(hx : Polynomial.eval₂ i x f = 0)
(h : IsAdjoinRoot S f)
(z : S)
(w : R[X])
(hzw : h.map w = z)

Polynomial.eval₂ i x (h.repr z) = Polynomial.eval₂ i x w


@[simp]
theorem mem_union {a} {s₁ s₂ : Finmap β} : a ∈ s₁ ∪ s₂ ↔ a ∈ s₁ ∨ a ∈ s₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s₁ s₂ : Finmap β}

a ∈ s₁ ∪ s₂ ↔ a ∈ s₁ ∨ a ∈ s₂


@[simp, norm_cast]
theorem coe_toMonoidHom (f : A →ₐ[R] B) : ⇑(f : A →* B) = f

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)


theorem map_equiv_symm (e : α ≃ β) (f : Filter β) : map e.symm f = comap e f

{α : Type u}
{β : Type v}
(e : α ≃ β)
(f : Filter β)

Filter.map (⇑e.symm) f = Filter.comap (⇑e) f


@[simp]
theorem factors_pos (x : α) (hx : x ≠ 0) : 0 < factors x ↔ ¬IsUnit x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
(x : α)
(hx : x ≠ 0)

0 < UniqueFactorizationMonoid.factors x ↔ ¬IsUnit x


theorem natDegree_trunc_lt (f : R⟦X⟧) (n) : (trunc (n + 1) f).natDegree < n + 1

{R : Type u_1}
[Semiring R]
(f : PowerSeries R)
(n : ℕ)

(PowerSeries.trunc (n + 1) f).natDegree < n + 1


/-- General version of `preimage_smul_setₛₗ` -/
theorem preimage_smul_setₛₗ'
    (hc : Function.Surjective (fun (m : M) ↦ c • m))
    (hc' : Function.Injective (fun (n : N) ↦ σ c • n)) :
    h ⁻¹' (σ c • t) = c • h ⁻¹' t

(hc : Function.Surjective fun m => c • m)

(hc' : Function.Injective fun n => σ c • n)


theorem IsSubordinate.infPrepartition [Fintype ι] (h : IsSubordinate π r) (π' : Prepartition I) :
    IsSubordinate (π.infPrepartition π') r

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π : BoxIntegral.TaggedPrepartition I}
{r : (ι → ℝ) → ↑(Set.Ioi 0)}
[Fintype ι]
(h : π.IsSubordinate r)
(π' : BoxIntegral.Prepartition I)


@[simp]
theorem toDualTopEquiv_symm_coe [LE α] (a : α) :
    WithBot.toDualTopEquiv.symm (toDual (a : WithTop α)) = ↑(toDual a)

WithBot.toDualTopEquiv.symm (OrderDual.toDual ↑a) = ↑(OrderDual.toDual a)


@[to_additive]
theorem submonoidMap_surjective (f : M →* N) (M' : Submonoid M) :
    Function.Surjective (f.submonoidMap M')

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)
(M' : Submonoid M)


@[reassoc (attr := simp)]
lemma rightDerivedNatTrans_comp (τ : F ⟶ F') (τ' : F' ⟶ F'') :
    rightDerivedNatTrans RF RF' α α' W τ ≫ rightDerivedNatTrans RF' RF'' α' α'' W τ' =
    rightDerivedNatTrans RF RF'' α α'' W (τ ≫ τ')

(RF RF' RF'' : CategoryTheory.Functor D H)

CategoryTheory.CategoryStruct.comp (RF.rightDerivedNatTrans RF' α α' W τ) (RF'.rightDerivedNatTrans RF'' α' α'' W τ') =
  RF.rightDerivedNatTrans RF'' α α'' W (CategoryTheory.CategoryStruct.comp τ τ')


/-- If a function tends to negative infinity along a filter,
then `f` multiplied by a negative constant (on the right) tends to positive infinity. -/
theorem Tendsto.atBot_mul_const_of_neg (hr : r < 0) (hf : Tendsto f l atBot) :
    Tendsto (fun x => f x * r) l atTop

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

Filter.Tendsto (fun x => f x * r) l Filter.atTop


theorem ofPow {i} (a : A i) (n : ℕ) :
    of _ i a ^ n = of _ (n • i) (GradedMonoid.GMonoid.gnpow _ a)

{ι : Type u_1}
[DecidableEq ι]
(A : ι → Type u_2)
[(i : ι) → AddCommMonoid (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
{i : ι}
(a : A i)
(n : ℕ)

(DirectSum.of A i) a ^ n = (DirectSum.of A (n • i)) (GradedMonoid.GMonoid.gnpow n a)


theorem approxOn_mem {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
    [SeparableSpace s] (n : ℕ) (x : β) : approxOn f hf s y₀ h₀ n x ∈ s

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[PseudoEMetricSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : Measurable f)
{s : Set α}
{y₀ : α}
(h₀ : y₀ ∈ s)
[TopologicalSpace.SeparableSpace ↑s]
(n : ℕ)
(x : β)

↑(MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ n) x ∈ s


/-- In characteristic zero if there is no torsion, a finite root system is determined entirely by
its roots. -/
@[ext]
protected lemma ext [CharZero R] [NoZeroSMulDivisors R M]
    {P₁ P₂ : RootSystem ι R M N}
    (he : P₁.toLin = P₂.toLin)
    (hr : P₁.root = P₂.root) :
    P₁ = P₂

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Finite ι]
[CharZero R]
[NoZeroSMulDivisors R M]
{P₁ P₂ : RootSystem ι R M N}
(he : P₁.toLin = P₂.toLin)
(hr : P₁.root = P₂.root)


theorem copy_eq (f : FrameHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : FrameHom α β)
(f' : α → β)
(h : f' = ⇑f)


@[simp, rclike_simps]
theorem I_im (z : K) : im z * im (I : K) = im z

RCLike.im z * RCLike.im RCLike.I = RCLike.im z


theorem le_measure_diff : μ s₁ - μ s₂ ≤ μ (s₁ \ s₂)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ : Set α}

μ s₁ - μ s₂ ≤ μ (s₁ \ s₂)


@[simp]
theorem toDual_compares_toDual [LT α] {a b : α} {o : Ordering} :
    Compares o (toDual a) (toDual b) ↔ Compares o b a

{α : Type u_1}
[LT α]
{a b : α}
{o : Ordering}

o.Compares (OrderDual.toDual a) (OrderDual.toDual b) ↔ o.Compares b a


theorem lineMap_apply_one_sub (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ (1 - c) = lineMap p₁ p₀ c

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(p₀ p₁ : P1)
(c : k)

(AffineMap.lineMap p₀ p₁) (1 - c) = (AffineMap.lineMap p₁ p₀) c


@[simp] theorem Function.Embedding.sumSet_range {s t : Set α} (h : Disjoint s t) :
    range (Function.Embedding.sumSet h) = s ∪ t

{α : Type u_1}
{s t : Set α}
(h : Disjoint s t)

Set.range ⇑(Function.Embedding.sumSet h) = s ∪ t


/-- Bind operation for `SupIndep`. -/
theorem SupIndep.biUnion [DecidableEq ι] {s : Finset ι'} {g : ι' → Finset ι} {f : ι → α}
    (hs : s.SupIndep fun i => (g i).sup f) (hg : ∀ i' ∈ s, (g i').SupIndep f) :
    (s.biUnion g).SupIndep f

{α : Type u_1}
{ι : Type u_3}
{ι' : Type u_4}
[DistribLattice α]
[OrderBot α]
[DecidableEq ι]
{s : Finset ι'}
{g : ι' → Finset ι}
{f : ι → α}
(hs : s.SupIndep fun i => (g i).sup f)
(hg : ∀ i' ∈ s, (g i').SupIndep f)


@[to_additive (attr := simp)]
theorem smul_univ {s : Set α} (hs : s.Nonempty) : s • (univ : Set β) = univ

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s : Set α}
(hs : s.Nonempty)


lemma tendsto_densityProcess_atTop_empty_of_antitone (κ : Kernel α (γ × β)) (ν : Kernel α γ)
    [IsFiniteKernel κ] (n : ℕ) (a : α) (x : γ)
    (seq : ℕ → Set β) (hseq : Antitone seq) (hseq_iInter : ⋂ i, seq i = ∅)
    (hseq_meas : ∀ m, MeasurableSet (seq m)) :
    Tendsto (fun m ↦ densityProcess κ ν n a x (seq m)) atTop
      (𝓝 (densityProcess κ ν n a x ∅))

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

(hseq_meas : ∀ (m : ℕ), MeasurableSet (seq m))

Filter.Tendsto (fun m => κ.densityProcess ν n a x (seq m)) Filter.atTop (𝓝 (κ.densityProcess ν n a x ∅))


@[simp] lemma mem_primeFactorsList' {n p} : p ∈ n.primeFactorsList ↔ p.Prime ∧ p ∣ n ∧ n ≠ 0

p ∈ n.primeFactorsList ↔ Nat.Prime p ∧ p ∣ n ∧ n ≠ 0


@[simp] theorem minNatAbs_nil : ([] : List Int).minNatAbs = 0


theorem _root_.MeasureTheory.SignedMeasure.re_toComplexMeasure (s t : SignedMeasure α) :
    ComplexMeasure.re (SignedMeasure.toComplexMeasure s t) = s

{α : Type u_1}
{m : MeasurableSpace α}
(s t : MeasureTheory.SignedMeasure α)

MeasureTheory.ComplexMeasure.re (s.toComplexMeasure t) = s


[Submodule.IsPrincipal (Ideal.span {x, y})]


theorem den_div_intCast_eq_one_iff (m n : ℤ) (hn : n ≠ 0) : ((m : ℚ) / n).den = 1 ↔ n ∣ m


/-- If `a ∈ s` is known, see also `Finset.card_insert_of_mem` and `Finset.card_insert_of_not_mem`.
-/
theorem card_insert_eq_ite : card (insert a s) = if a ∈ s then s.card else s.card + 1

{α : Type u_1}
{s : Finset α}
{a : α}
[DecidableEq α]

(insert a s).card = if a ∈ s then s.card else s.card + 1


Polynomial.C (a + b) = Polynomial.C a + Polynomial.C b


theorem padicValNat_mul_pow_right {q : ℕ} [hp : Fact p.Prime] [hq : Fact q.Prime]
    (n m : ℕ) (neq : q ≠ p) : padicValNat q (p^n * q^m) = m

{p q : ℕ}
[hp : Fact (Nat.Prime p)]
[hq : Fact (Nat.Prime q)]
(n m : ℕ)
(neq : q ≠ p)


theorem meas_essSup_lt
    (hf : IsBoundedUnder (· ≤ ·) (ae μ) f := by isBoundedDefault) :
    μ { y | essSup f μ < f y } = 0

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) (MeasureTheory.ae μ) f := by isBoundedDefault)


/-- A version of **Lebesgue's density theorem** for a sequence of closed balls whose centers are
not required to be fixed.

See also `Besicovitch.ae_tendsto_measure_inter_div`. -/
theorem ae_tendsto_measure_inter_div (S : Set α) (K : ℝ) : ∀ᵐ x ∂μ.restrict S,
    ∀ {ι : Type*} {l : Filter ι} (w : ι → α) (δ : ι → ℝ) (δlim : Tendsto δ l (𝓝[>] 0))
      (xmem : ∀ᶠ j in l, x ∈ closedBall (w j) (K * δ j)),
      Tendsto (fun j => μ (S ∩ closedBall (w j) (δ j)) / μ (closedBall (w j) (δ j))) l (𝓝 1)

∀ᵐ (x : α) ∂μ.restrict S,
  ∀ {ι : Type u_3} {l : Filter ι} (w : ι → α) (δ : ι → ℝ),
    Filter.Tendsto δ l (𝓝[>] 0) →
      (∀ᶠ (j : ι) in l, x ∈ Metric.closedBall (w j) (K * δ j)) →
        Filter.Tendsto (fun j => μ (S ∩ Metric.closedBall (w j) (δ j)) / μ (Metric.closedBall (w j) (δ j))) l (𝓝 1)


@[simp]
theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
    (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r

{H : ∀ (a₁ a₂ b₁ b₂ : α), Setoid.r a₁ b₁ → Setoid.r a₂ b₂ → r a₁ a₂ = r b₁ b₂}

(WellFounded fun x y => x.liftOn₂' y r H) ↔ WellFounded r


protected theorem congr_arg (η : ApplicativeTransformation F G) {α : Type u} {x y : F α}
    (h : x = y) : η x = η y

{F : Type u → Type v}
[Applicative F]
{G : Type u → Type w}
[Applicative G]
(η : ApplicativeTransformation F G)
{α : Type u}
{x y : F α}
(h : x = y)

(fun {α} => η.app α) x = (fun {α} => η.app α) y


@[simp]
theorem uniqueUpToIso_hom_right (P : IsKan s) (Q : IsKan t) :
    (uniqueUpToIso P Q).hom.right = P.desc t

{s t : CategoryTheory.Bicategory.LeftLift f g}

(P.uniqueUpToIso Q).hom.right = P.desc t


@[simp] theorem data_drop (s : String) (n : Nat) : (s.drop n).1 = s.1.drop n


(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem hasStrictDerivAt_tan {x : ℝ} (h : cos x ≠ 0) : HasStrictDerivAt tan (1 / cos x ^ 2) x

HasStrictDerivAt Real.tan (1 / Real.cos x ^ 2) x


theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Subsemiring R} (hS : Directed (· ≤ ·) S)
    {x : R} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i

(hS : Directed (fun x x_1 => x ≤ x_1) S)


@[to_additive add_abs_eq_two_nsmul_posPart]
lemma mul_mabs_eq_oneLePart_sq (a : α) : a * |a|ₘ = a⁺ᵐ ^ 2

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


@[simp]
theorem mem_toList {a : α} {s : Multiset α} : a ∈ s.toList ↔ a ∈ s


@[simp]
theorem T_pow_mul_apply_one (n : ℤ) (g : SL(2, ℤ)) : ↑ₘ(T ^ n * g) 1 = ↑ₘg 1

(g : Matrix.SpecialLinearGroup (Fin 2) ℤ)


theorem rpow_sub_nat {x : ℝ} (hx : x ≠ 0) (y : ℝ) (n : ℕ) : x ^ (y - n) = x ^ y / x ^ n


@[simp]
lemma leftHomologyMap'_neg :
    leftHomologyMap' (-φ) h₁ h₂ = -leftHomologyMap' φ h₁ h₂

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
{φ : S₁ ⟶ S₂}
(h₁ : S₁.LeftHomologyData)
(h₂ : S₂.LeftHomologyData)

CategoryTheory.ShortComplex.leftHomologyMap' (-φ) h₁ h₂ = -CategoryTheory.ShortComplex.leftHomologyMap' φ h₁ h₂


theorem totient_mul {m n : ℕ} (h : m.Coprime n) : φ (m * n) = φ m * φ n


@[simp]
theorem isBigOWith_neg_right : (IsBigOWith c l f fun x => -g' x) ↔ IsBigOWith c l f g'

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
[Norm E]
[SeminormedAddCommGroup F']
{c : ℝ}
{f : α → E}
{g' : α → F'}
{l : Filter α}

(Asymptotics.IsBigOWith c l f fun x => -g' x) ↔ Asymptotics.IsBigOWith c l f g'


@[simp]
theorem continuousWithinAt_Ico_iff_Ici (h : a < b) :
    ContinuousWithinAt f (Ico a b) a ↔ ContinuousWithinAt f (Ici a) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
[TopologicalSpace β]
{a b : α}
{f : α → β}
(h : a < b)

ContinuousWithinAt f (Set.Ico a b) a ↔ ContinuousWithinAt f (Set.Ici a) a


theorem eqOn_sup {φ ψ : F} {S T : Subalgebra R A} (hS : Set.EqOn φ ψ S) (hT : Set.EqOn φ ψ T) :
    Set.EqOn φ ψ ↑(S ⊔ T)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{F : Type u_4}
[FunLike F A B]
[AlgHomClass F R A B]
{φ ψ : F}
{S T : Subalgebra R A}
(hS : Set.EqOn ⇑φ ⇑ψ ↑S)
(hT : Set.EqOn ⇑φ ⇑ψ ↑T)


theorem IsSt.neg {x : ℝ*} {r : ℝ} (hxr : IsSt x r) : IsSt (-x) (-r)


@[to_additive (attr := simp)]
theorem preimage_mul_left_closedBall [IsometricSMul G G] (a b : G) (r : ℝ≥0∞) :
    (a * ·) ⁻¹' closedBall b r = closedBall (a⁻¹ * b) r

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
(a b : G)
(r : ℝ≥0∞)

(fun x => a + x) ⁻¹' EMetric.closedBall b r = EMetric.closedBall (-a + b) r


@[simp]
theorem abs_to_nat : ∀ n, (abs n : ℕ) = Int.natAbs n


theorem forall_mem_empty {p : α → Prop} : (∀ x ∈ (∅ : Set α), p x) ↔ True


private theorem comap_center_subst {H₁ H₂ : Subgroup G} [Normal H₁] [Normal H₂] (h : H₁ = H₂) :
    comap (mk' H₁) (center (G ⧸ H₁)) = comap (mk' H₂) (center (G ⧸ H₂))

{G : Type u_1}
[Group G]
{H₁ H₂ : Subgroup G}
[H₁.Normal]
[H₂.Normal]
(h : H₁ = H₂)

Subgroup.comap (QuotientGroup.mk' H₁) (Subgroup.center (G ⧸ H₁)) =
  Subgroup.comap (QuotientGroup.mk' H₂) (Subgroup.center (G ⧸ H₂))


/-- The `DFinsupp` version of `Finsupp.liftAddHom`,-/
@[simps apply symm_apply]
def liftAddHom [∀ i, AddZeroClass (β i)] [AddCommMonoid γ] :
    (∀ i, β i →+ γ) ≃+ ((Π₀ i, β i) →+ γ)

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → AddZeroClass (β i)]
[AddCommMonoid γ]
(φ : (i : ι) → β i →+ γ)

DFinsupp.liftAddHom φ = DFinsupp.sumAddHom φ


@[simp]
theorem fullSubcategoryInclusion.map {X Y} {f : X ⟶ Y} : (fullSubcategoryInclusion Z).map f = f

{X Y : CategoryTheory.FullSubcategory Z}

(CategoryTheory.fullSubcategoryInclusion Z).map f = f


@[simp]
theorem add_linMulLin (f g h : M →ₗ[R] A) : linMulLin (f + g) h = linMulLin f h + linMulLin g h

{R : Type u_3}
{M : Type u_4}
{A : Type u_7}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[AddCommMonoid M]
[Module R M]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
(f g h : M →ₗ[R] A)

QuadraticMap.linMulLin (f + g) h = QuadraticMap.linMulLin f h + QuadraticMap.linMulLin g h


@[mono] lemma dens_mono : Monotone (dens : Finset α → ℚ≥0)


@[to_additive]
theorem uniformity_eq_comap_inv_mul_nhds_one :
    𝓤 α = comap (fun x : α × α => x.1⁻¹ * x.2) (𝓝 (1 : α))

{α : Type u_1}
[UniformSpace α]
[Group α]
[UniformGroup α]

𝓤 α = Filter.comap (fun x => x.1⁻¹ * x.2) (𝓝 1)


@[simp]
theorem constantCoeff_invUnitsSub (u : Rˣ) : constantCoeff R (invUnitsSub u) = 1 /ₚ u

(PowerSeries.constantCoeff R) (PowerSeries.invUnitsSub u) = 1 /ₚ u


/-- `OrderMonoidWithZeroHom α β` is the type of functions `α → β` that preserve
the `MonoidWithZero` structure.

`OrderMonoidWithZeroHom` is also used for group homomorphisms.

When possible, instead of parametrizing results over `(f : α →+ β)`,
you should parametrize over `(F : Type*) [OrderMonoidWithZeroHomClass F α β] (f : F)`.

When you extend this structure, make sure to extend `OrderMonoidWithZeroHomClass`. -/
structure OrderMonoidWithZeroHom (α β : Type*) [Preorder α] [Preorder β] [MulZeroOneClass α]
  [MulZeroOneClass β] extends α →*₀ β where
  /-- An `OrderMonoidWithZeroHom` is a monotone function. -/
  monotone' : Monotone toFun

{α : Type u_6}
{β : Type u_7}
[Preorder α]
[Preorder β]
[MulZeroOneClass α]
[MulZeroOneClass β]
(self : α →*₀o β)


@[simp] lemma r_f (i : ι) : e.r (e.f i) = some i

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
(e : c.Embedding c')
(i : ι)


/-- If an integral domain has a primitive `k`-th root of unity, then it has `φ k` of them. -/
theorem card_primitiveRoots {ζ : R} {k : ℕ} (h : IsPrimitiveRoot ζ k) :
    (primitiveRoots k R).card = φ k

{R : Type u_4}
[CommRing R]
[IsDomain R]
{ζ : R}
{k : ℕ}
(h : IsPrimitiveRoot ζ k)


theorem mul_le_mul_of_nonpos_of_nonpos' [ExistsAddOfLE α] [PosMulMono α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hca : c ≤ a) (hdb : d ≤ b) (ha : a ≤ 0) (hd : d ≤ 0) : a * b ≤ c * d

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

[ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[to_additive]
theorem inf_subgroupOf_inf_normal_of_right (A B' B : Subgroup G) (hB : B' ≤ B)
    [hN : (B'.subgroupOf B).Normal] : ((A ⊓ B').subgroupOf (A ⊓ B)).Normal

{G : Type u_1}
[Group G]
(A B' B : Subgroup G)
(hB : B' ≤ B)
[hN : (B'.subgroupOf B).Normal]


theorem card_lt_of_injective_of_not_mem (f : α → β) (h : Function.Injective f) {b : β}
    (w : b ∉ Set.range f) : card α < card β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : α → β)
(h : Function.Injective f)
{b : β}
(w : b ∉ Set.range f)


@[simp] -- Porting note: proof adjusted to account for @[simps] on all fields of colim
theorem colimit.map_desc (c : Cocone G) :
    colimMap α ≫ colimit.desc G c = colimit.desc F ((Cocones.precompose α).obj c)

CategoryTheory.Limits.colimMap α ≫ CategoryTheory.Limits.colimit.desc G c =
  CategoryTheory.Limits.colimit.desc F ((CategoryTheory.Limits.Cocones.precompose α).obj c)


/-- This relies on `default ℕ = 0`. -/
theorem headI_le_sum (L : List ℕ) : L.headI ≤ L.sum


theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

(hd : ∀ (x : β), x ∈ closure (Set.range e))

∃ c, Filter.Tendsto f (Filter.comap e (𝓝 b)) (𝓝 c)


@[simp]
theorem self_diff_frontier (s : Set X) : s \ frontier s = interior s

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


/-- **Kolmogorov's 0-1 law** : any event in the tail σ-algebra of an independent sequence of
sub-σ-algebras has probability 0 or 1.
The tail σ-algebra `limsup s atTop` is the same as `⋂ n, ⋃ i ≥ n, s i`. -/
theorem measure_zero_or_one_of_measurableSet_limsup_atTop (h_le : ∀ n, s n ≤ m0)
    (h_indep : iIndep s μ) {t : Set Ω} (ht_tail : MeasurableSet[limsup s atTop] t) :
    μ t = 0 ∨ μ t = 1

(h_indep : ProbabilityTheory.iIndep s μ)


theorem le_iff_ultrafilter {f₁ f₂ : Filter α} : f₁ ≤ f₂ ↔ ∀ g : Ultrafilter α, ↑g ≤ f₁ → ↑g ≤ f₂

f₁ ≤ f₂ ↔ ∀ (g : Ultrafilter α), ↑g ≤ f₁ → ↑g ≤ f₂


@[simp]
theorem eqToHom_left (X Y : Comma L R) (H : X = Y) :
    CommaMorphism.left (eqToHom H) = eqToHom (by cases H; rfl)

{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)
(H : X = Y)

(CategoryTheory.eqToHom H).left = CategoryTheory.eqToHom ⋯


theorem mapsTo_insertNth_face_Icc {n} (I : Box (Fin (n + 1))) {i : Fin (n + 1)} {x : ℝ}
    (hx : x ∈ Icc (I.lower i) (I.upper i)) :
    MapsTo (i.insertNth x) (Box.Icc (I.face i)) (Box.Icc I)

(hx : x ∈ Set.Icc (I.lower i) (I.upper i))

Set.MapsTo (i.insertNth x) (BoxIntegral.Box.Icc (I.face i)) (BoxIntegral.Box.Icc I)


theorem Iff.not_right (h : ¬a ↔ b) : a ↔ ¬b


@[to_additive (attr := simp, norm_cast) coe_le_zero]
theorem coe_le_one [LE α] {a : α} : (a : WithTop α) ≤ 1 ↔ a ≤ 1

↑a ≤ 1 ↔ a ≤ 1


theorem totalVariation_zero : (0 : SignedMeasure α).totalVariation = 0

MeasureTheory.SignedMeasure.totalVariation 0 = 0


theorem nat_gcd_helper_2 (d x y a b : ℕ) (hu : x % d = 0) (hv : y % d = 0)
    (h : x * a = y * b + d) : Nat.gcd x y = d


@[to_additive]
theorem smooth_finprod_cond (hc : ∀ i, p i → Smooth I' I (f i))
    (hf : LocallyFinite fun i => mulSupport (f i)) :
    Smooth I' I fun x => ∏ᶠ (i) (_ : p i), f i x

(hc : ∀ (i : ι), p i → Smooth I' I (f i))

(hf : LocallyFinite fun i => Function.mulSupport (f i))

Smooth I' I fun x => ∏ᶠ (i : ι) (_ : p i), f i x


@[simp]
theorem typein.principalSeg_coe (r : α → α → Prop) [IsWellOrder α r] :
    (typein.principalSeg r : α → Ordinal) = typein r

{α : Type u}
(r : α → α → Prop)
[IsWellOrder α r]

⇑(Ordinal.typein.principalSeg r).toRelEmbedding = Ordinal.typein r


/-- The cycles functor `ShortComplex C ⥤ C` which sends a short complex `S` to `S.cycles`
which is a kernel of `S.g : S.X₂ ⟶ S.X₃`. -/
@[simps]
noncomputable def cyclesFunctor : ShortComplex C ⥤ C

∀ {X Y : CategoryTheory.ShortComplex C} (φ : X ⟶ Y),
  (CategoryTheory.ShortComplex.cyclesFunctor C).map φ = CategoryTheory.ShortComplex.cyclesMap φ


@[simp]
theorem coe_ofComplex : ⇑ofComplex = coeComplex


lemma powers_le {n : M} {P : Submonoid M} : powers n ≤ P ↔ n ∈ P

{M : Type u_1}
[Monoid M]
{n : M}
{P : Submonoid M}


theorem prod_ofNatMultiset (v : Multiset ℕ) (h) :
    ((ofNatMultiset v h).prod : ℕ) = (v.prod : ℕ)

(v : Multiset ℕ)
(h : ∀ p ∈ v, Nat.Prime p)

↑(PrimeMultiset.ofNatMultiset v h).prod = v.prod


@[simp]
protected theorem coe_coe {F : Type*} [FunLike F A B] [NonUnitalRingHomClass F A B]
    [NonUnitalStarRingHomClass F A B] (f : F) : ⇑(f : A →⋆ₙ+* B) = f

{A : Type u_1}
{B : Type u_2}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
{F : Type u_5}
[FunLike F A B]
[NonUnitalRingHomClass F A B]
[NonUnitalStarRingHomClass F A B]
(f : F)


/-- Construct an isomorphism in the comma category given isomorphisms of the objects whose forward
directions give a commutative square.
-/
@[simps]
def isoMk {X Y : Comma L₁ R₁} (l : X.left ≅ Y.left) (r : X.right ≅ Y.right)
    (h : L₁.map l.hom ≫ Y.hom = X.hom ≫ R₁.map r.hom := by aesop_cat) : X ≅ Y

(h :
  CategoryTheory.CategoryStruct.comp (L₁.map l.hom) Y.hom =
    CategoryTheory.CategoryStruct.comp X.hom (R₁.map r.hom) := by
  aesop_cat)

(CategoryTheory.Comma.isoMk l r h).inv.right = r.inv


theorem Sbtw.mem_image_Ioo {x y z : P} (h : Sbtw R x y z) :
    y ∈ lineMap x z '' Set.Ioo (0 : R) 1

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Sbtw R x y z)

y ∈ ⇑(AffineMap.lineMap x z) '' Set.Ioo 0 1


@[to_additive]
theorem LipschitzWith.norm_div_le_of_le {f : E → F} {C : ℝ≥0} (h : LipschitzWith C f)
    (hr : ‖a / b‖ ≤ r) : ‖f a / f b‖ ≤ C * r

{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
{a b : E}
{r : ℝ}
{f : E → F}
{C : ℝ≥0}
(h : LipschitzWith C f)
(hr : ‖a - b‖ ≤ r)


/-- The map `(eVariationOn · s)` is lower semicontinuous for uniform convergence on `s`.  -/
theorem lowerSemicontinuous_uniformOn (s : Set α) :
    LowerSemicontinuous fun f : α →ᵤ[{s}] E => eVariationOn f s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(s : Set α)

LowerSemicontinuous fun f => eVariationOn f s


@[to_additive]
protected theorem inj_left [Mul α] [IsSymmOp α α (· * ·)] [PartialOrder α] {a b c : α}
    (hc : MulLECancellable c) :
    a * c = b * c ↔ a = b

{α : Type u_1}
[Mul α]
[IsSymmOp α α fun x x_1 => x * x_1]
[PartialOrder α]
{a b c : α}
(hc : MulLECancellable c)


theorem Commute.tsum_right (a) (h : ∀ i, Commute a (f i)) : Commute a (∑' i, f i)

{ι : Type u_1}
{α : Type u_4}
[NonUnitalNonAssocSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
[T2Space α]
(a : α)
(h : ∀ (i : ι), Commute a (f i))


theorem affineIndependent_minCardFinsetOfMemConvexHull :
    AffineIndependent 𝕜 ((↑) : minCardFinsetOfMemConvexHull hx → E)

{𝕜 : Type u_1}
{E : Type u}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hx : x ∈ (convexHull 𝕜) s)


theorem HasGradientWithinAt.congr (h : HasGradientWithinAt f f' s x) (hs : ∀ x ∈ s, f₁ x = f x)
    (hx : f₁ x = f x) : HasGradientWithinAt f₁ f' s x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s : Set F}
{f₁ : F → 𝕜}
(h : HasGradientWithinAt f f' s x)
(hs : ∀ x ∈ s, f₁ x = f x)
(hx : f₁ x = f x)


/-- For a morphism from a connected object `A` to a Galois object `B` and an automorphism
of `A`, there exists a unique automorphism of `B` making the canonical diagram commute. -/
lemma exists_autMap {A B : C} (f : A ⟶ B) [IsConnected A] [IsGalois B] (σ : Aut A) :
    ∃! (τ : Aut B), f ≫ τ.hom = σ.hom ≫ f

∃! τ, CategoryTheory.CategoryStruct.comp f τ.hom = CategoryTheory.CategoryStruct.comp σ.hom f


theorem sub (hf : Martingale f ℱ μ) (hg : Martingale g ℱ μ) : Martingale (f - g) ℱ μ

{Ω : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[Preorder ι]
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f g : ι → Ω → E}
{ℱ : MeasureTheory.Filtration ι m0}
(hf : MeasureTheory.Martingale f ℱ μ)
(hg : MeasureTheory.Martingale g ℱ μ)


@[simp, mfld_simps]
theorem inter_univ (a : Set α) : a ∩ univ = a


@[to_additive]
theorem center_le_normalizer : center G ≤ H.normalizer

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


@[simps!]
def StarAlgHom.restrictScalars (f : A →⋆ₐ[S] B) : A →⋆ₐ[R] B

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
[Star A]
[Star B]
(f : A →⋆ₐ[S] B)

∀ (a : A), (StarAlgHom.restrictScalars R f) a = f a


protected theorem mul_left_comm (n m k : Nat) : n * (m * k) = m * (n * k)


theorem mul [Mul R] [IsScalarTower R R M] (ra : IsSMulRegular M a) (rb : IsSMulRegular M b) :
    IsSMulRegular M (a * b)

{R : Type u_1}
{M : Type u_3}
{a b : R}
[SMul R M]
[Mul R]
[IsScalarTower R R M]
(ra : IsSMulRegular M a)
(rb : IsSMulRegular M b)


@[to_additive] lemma MonovaryOn.div_left (h₁ : MonovaryOn f₁ g s) (h₂ : AntivaryOn f₂ g s) :
    MonovaryOn (f₁ / f₂) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{s : Set ι}
{f₁ f₂ : ι → α}
{g : ι → β}
(h₁ : MonovaryOn f₁ g s)
(h₂ : AntivaryOn f₂ g s)


/--
`SatisfiesM` distributes over `<$>`, weakest precondition version.
(Use this for reasoning backward from the goal.)
-/
theorem map_pre [Functor m] [LawfulFunctor m] {x : m α}
    (hx : SatisfiesM (fun a => p (f a)) x) : SatisfiesM p (f <$> x)

{m : Type u_1 → Type u_2}
{α : Type u_1}

∀ {α_1 : Type u_1} {p : α_1 → Prop} {f : α → α_1} [inst : Functor m] [inst_1 : LawfulFunctor m] {x : m α},
  SatisfiesM (fun a => p (f a)) x → SatisfiesM p (f <$> x)


/-- `Precoherent` is preserved by equivalence of categories. -/
theorem precoherent : Precoherent D

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_2} D]
(e : C ≌ D)
[CategoryTheory.Precoherent C]


@[to_additive (attr := simp low+1)]
theorem singleton_smul : ({a} : Set α) • t = a • t

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{t : Set β}
{a : α}


@[simp]
lemma stalkMap_germ'_apply
    (U : Opens Y) (x : X) (hx : f.val.base x ∈ U) (y : Y.presheaf.obj (op U)) :
    f.stalkMap x (Y.presheaf.germ (U := U) ⟨f.val.base x, hx⟩ y) =
      X.presheaf.germ (U := (Opens.map f.val.base).obj U) ⟨x, hx⟩ (f.val.c.app (op U) y)

{X Y : AlgebraicGeometry.LocallyRingedSpace}

(U : TopologicalSpace.Opens ↑Y.toTopCat)

(AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap f x) ((Y.presheaf.germ ⟨f.val.base x, hx⟩) y) =
  (X.presheaf.germ ⟨x, hx⟩) ((f.val.c.app (Opposite.op U)) y)


theorem reverseAux_eq_append (as bs : List α) : reverseAux as bs = reverseAux as [] ++ bs

as.reverseAux bs = as.reverseAux List.nil ++ bs


theorem dist_partial_sum_le_of_le_geometric (hf : ∀ n, ‖f n‖ ≤ C * r ^ n) (n : ℕ) :
    dist (∑ i ∈ range n, f i) (∑ i ∈ range (n + 1), f i) ≤ C * r ^ n

{α : Type u_1}
[SeminormedAddCommGroup α]
{r C : ℝ}
{f : ℕ → α}
(hf : ∀ (n : ℕ), ‖f n‖ ≤ C * r ^ n)
(n : ℕ)

dist (∑ i ∈ Finset.range n, f i) (∑ i ∈ Finset.range (n + 1), f i) ≤ C * r ^ n


lemma isIso₁_of_isIso₂₃ {T T' : Triangle C} (φ : T ⟶ T') (hT : T ∈ distTriang C)
    (hT' : T' ∈ distTriang C) (h₂ : IsIso φ.hom₂) (h₃ : IsIso φ.hom₃) : IsIso φ.hom₁

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

{T T' : CategoryTheory.Pretriangulated.Triangle C}

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

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


theorem RingHom.iterate_map_frobenius (f : R →+* R) (p : ℕ) [ExpChar R p] (n : ℕ) :
    f^[n] (frobenius R p x) = frobenius R p (f^[n] x)

{R : Type u}
[CommSemiring R]
(x : R)
(f : R →+* R)
(p : ℕ)
[ExpChar R p]
(n : ℕ)

(⇑f)^[n] ((frobenius R p) x) = (frobenius R p) ((⇑f)^[n] x)


/-- The monoidal functor from the endomorphisms of the single object
when we promote a monoidal category to a single object bicategory,
to the original monoidal category.

We subsequently show this is an equivalence.
-/
@[simps]
def endMonoidalStarFunctor : MonoidalFunctor (EndMonoidal (MonoidalSingleObj.star C)) C

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

(CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctor C).ε = CategoryTheory.CategoryStruct.id (𝟙_ C)


@[simp]
theorem emod_sub_cancel (x y : Int): (x - y)%y = x%y


/-- The embedding map is always a semi-contraction. -/
theorem embeddingOfSubset_dist_le (a b : α) :
    dist (embeddingOfSubset x a) (embeddingOfSubset x b) ≤ dist a b

{α : Type u}
[MetricSpace α]
(x : ℕ → α)
(a b : α)

dist (KuratowskiEmbedding.embeddingOfSubset x a) (KuratowskiEmbedding.embeddingOfSubset x b) ≤ dist a b


theorem UniqueDiffWithinAt.eq_deriv (s : Set 𝕜) (H : UniqueDiffWithinAt 𝕜 s x)
    (h : HasDerivWithinAt f f' s x) (h₁ : HasDerivWithinAt f f₁' s x) : f' = f₁'

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' f₁' : F}
{x : 𝕜}
(s : Set 𝕜)
(H : UniqueDiffWithinAt 𝕜 s x)
(h : HasDerivWithinAt f f' s x)
(h₁ : HasDerivWithinAt f f₁' s x)


theorem contDiffOn_succ_iff_fderiv_apply [FiniteDimensional 𝕜 E] {n : ℕ} {f : E → F} {s : Set E}
    (hs : UniqueDiffOn 𝕜 s) :
    ContDiffOn 𝕜 (n + 1 : ℕ) f s ↔
      DifferentiableOn 𝕜 f s ∧ ∀ y, ContDiffOn 𝕜 n (fun x => fderivWithin 𝕜 f s x y) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
[FiniteDimensional 𝕜 E]
{n : ℕ}
{f : E → F}
{s : Set E}
(hs : UniqueDiffOn 𝕜 s)

ContDiffOn 𝕜 (↑(n + 1)) f s ↔
  DifferentiableOn 𝕜 f s ∧ ∀ (y : E), ContDiffOn 𝕜 (↑n) (fun x => (fderivWithin 𝕜 f s x) y) s


@[simp]
theorem map_smul [DecidableEq ι] (m : ι → M) (i : ι) (c : R) (x : M) :
    f (update m i (c • x)) = c • f (update m i x)

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
[DecidableEq ι]
(m : ι → M)
(i : ι)
(c : R)
(x : M)

f (Function.update m i (c • x)) = c • f (Function.update m i x)


/-- Functor translating a comonoid object in a functor category
to a functor into the category of comonoid objects.
-/
@[simps]
def functor : Comon_ (C ⥤ D) ⥤ C ⥤ Comon_ D

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

∀ {X Y : Comon_ (C ⥤ D)} (f : X ⟶ Y) (X_1 : C),
  ((CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.functor.map f).app X_1).hom = f.hom.app X_1


@[to_additive (attr := simp)]
theorem image_mul_right : image (· * b) t = preimage t (· * b⁻¹) (mul_left_injective _).injOn

{α : Type u_2}
[DecidableEq α]
[Group α]
{t : Finset α}
{b : α}

Finset.image (fun x => x * b) t = t.preimage (fun x => x * b⁻¹) ⋯


lemma card_isUnramified [NumberField k] [IsGalois k K] :
    Finset.card (univ.filter <| IsUnramified k (K := K)) =
      Finset.card (univ.filter <| IsUnramifiedIn K (k := k)) * (finrank k K)

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

(Finset.filter (NumberField.InfinitePlace.IsUnramified k) Finset.univ).card =
  (Finset.filter (NumberField.InfinitePlace.IsUnramifiedIn K) Finset.univ).card * FiniteDimensional.finrank k K


theorem exists_measurable_extend (hf : MeasurableEmbedding f) {g : α → γ} (hg : Measurable g)
    (hne : β → Nonempty γ) : ∃ g' : β → γ, Measurable g' ∧ g' ∘ f = g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{mα : MeasurableSpace α}
[MeasurableSpace β]
[MeasurableSpace γ]
{f : α → β}
(hf : MeasurableEmbedding f)
{g : α → γ}
(hg : Measurable g)
(hne : β → Nonempty γ)


@[ext]
theorem supp_injective :
    Function.Injective (ConnectedComponent.supp : G.ConnectedComponent → Set V)


theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹

{G₀ : Type u_3}
[GroupWithZero G₀]
{a x y : G₀}
(h : SemiconjBy a x y)


theorem piecewise_apply (a : α) : piecewise hs κ η a = if a ∈ s then κ a else η a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ η : ProbabilityTheory.Kernel α β}
{s : Set α}
{hs : MeasurableSet s}
[DecidablePred fun x => x ∈ s]
(a : α)

(ProbabilityTheory.Kernel.piecewise hs κ η) a = if a ∈ s then κ a else η a


lemma Ioc_filter_dvd_eq : (Ioc a b).filter (r ∣ ·) =
    (Ioc ⌊a / (r : ℚ)⌋ ⌊b / (r : ℚ)⌋).map ⟨(· * r), mul_left_injective₀ hr.ne'⟩

Finset.filter (fun x => r ∣ x) (Finset.Ioc a b) =
  Finset.map { toFun := fun x => x * r, inj' := ⋯ } (Finset.Ioc ⌊↑a / ↑r⌋ ⌊↑b / ↑r⌋)


/-- Given an open set in a finite-dimensional real manifold, there exists a nonnegative smooth
function with support equal to `s`. -/
theorem IsOpen.exists_msmooth_support_eq {s : Set M} (hs : IsOpen s) :
    ∃ f : M → ℝ, f.support = s ∧ Smooth I 𝓘(ℝ) f ∧ ∀ x, 0 ≤ f x

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
(I : ModelWithCorners ℝ E H)
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[SigmaCompactSpace M]
[T2Space M]
{s : Set M}
(hs : IsOpen s)

∃ f, Function.support f = s ∧ Smooth I 𝓘(ℝ, ℝ) f ∧ ∀ (x : M), 0 ≤ f x


@[simp]
lemma comp_assoc_of_third_is_zero_cochain {n₁ n₂ n₁₂ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (z₃ : Cochain K L 0) (h₁₂ : n₁ + n₂ = n₁₂) :
    (z₁.comp z₂ h₁₂).comp z₃ (add_zero n₁₂) = z₁.comp (z₂.comp z₃ (add_zero n₂)) h₁₂

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

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

(z₃ : CochainComplex.HomComplex.Cochain K L 0)

(z₁.comp z₂ h₁₂).comp z₃ ⋯ = z₁.comp (z₂.comp z₃ ⋯) h₁₂


lemma zpow_ne_zero {a : G₀} : ∀ n : ℤ, a ≠ 0 → a ^ n ≠ 0

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
(n : ℤ)


@[to_additive]
theorem tprod_le_of_prod_le (hf : Multipliable f) (h : ∀ s, ∏ i ∈ s, f i ≤ a₂) : ∏' i, f i ≤ a₂

(h : ∀ (s : Finset ι), ∏ i ∈ s, f i ≤ a₂)


@[simp]
lemma ε_down_ℕ (n : ℕ) : (ComplexShape.down ℕ).ε n = (-1 : ℤˣ) ^ n


theorem one_le_zpow_of_nonneg (ha : 1 ≤ a) (hn : 0 ≤ n) : 1 ≤ a ^ n

{α : Type u_1}
[LinearOrderedSemifield α]
{a : α}
{n : ℤ}
(ha : 1 ≤ a)
(hn : 0 ≤ n)


lemma single_mul (i : ι) (x y : α i) : single i (x * y) = single i x * single i y

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → MulZeroClass (α i)]
[DecidableEq ι]
(i : ι)
(x y : α i)

Pi.single i (x * y) = Pi.single i x * Pi.single i y


@[simp]
theorem _root_.BoundedContinuousFunction.norm_toContinuousMap_eq (f : α →ᵇ E) :
    ‖f.toContinuousMap‖ = ‖f‖

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : α →ᵇ E)


theorem le_of_le_smul_of_le_jacobson_bot {R M} [CommRing R] [AddCommGroup M] [Module R M]
    {I : Ideal R} {N N' : Submodule R M} (hN' : N'.FG)
    (hIJ : I ≤ jacobson ⊥) (hNN : N' ≤ N ⊔ I • N') : N' ≤ N

{R : Type u_3}
{M : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{N N' : Submodule R M}
(hN' : N'.FG)
(hIJ : I ≤ ⊥.jacobson)
(hNN : N' ≤ N ⊔ I • N')


/-- If a map `α × β → γ` is continuous, then its curried form `α → C(β, γ)` is continuous. -/
@[deprecated ContinuousMap.curry (since := "2024-03-05")]
theorem continuous_curry' (f : C(X × Y, Z)) : Continuous (curry' f)

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(f : C(X × Y, Z))


@[to_additive]
lemma prod_mul_eq_prod_mul_of_exists [Zero M] [CommMonoid N]
    {f : α →₀ M} {g : α → M → N} {n₁ n₂ : N}
    (a : α) (ha : a ∈ f.support)
    (h : g a (f a) * n₁ = g a (f a) * n₂) :
    f.prod g * n₁ = f.prod g * n₂

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
{f : α →₀ M}
{g : α → M → N}
{n₁ n₂ : N}
(a : α)
(ha : a ∈ f.support)
(h : g a (f a) + n₁ = g a (f a) + n₂)


theorem hasDerivWithinAt_inter' (h : t ∈ 𝓝[s] x) :
    HasDerivWithinAt f f' (s ∩ t) x ↔ HasDerivWithinAt f f' s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s t : Set 𝕜}
(h : t ∈ 𝓝[s] x)


/-- Compactness of candidates (in `BoundedContinuousFunction`s) follows. -/
private theorem isCompact_candidatesB : IsCompact (candidatesB X Y)

{X : Type u}
{Y : Type v}
[MetricSpace X]
[CompactSpace X]
[MetricSpace Y]
[CompactSpace Y]

IsCompact (GromovHausdorff.candidatesB X Y)


theorem coimageImageComparison_eq_coimageImageComparison' :
    coimageImageComparison f = coimageImageComparison' f

CategoryTheory.Abelian.coimageImageComparison f = CategoryTheory.Abelian.coimageImageComparison' f


@[simp, push_cast] theorem coe_mul (f g : G →+c[a, a] G) : ⇑(f * g) = f ∘ g

{G : Type u_1}
[Add G]
{a : G}
(f g : AddConstMap G G a a)


theorem one_sub {p : R} (h : IsIdempotentElem p) : IsIdempotentElem (1 - p)

{R : Type u_6}
[NonAssocRing R]
{p : R}
(h : IsIdempotentElem p)


@[simp]
protected theorem sub_right_inj (i j k : Int) : (i - k = j - k) ↔ i = j


@[to_additive] lemma threeGPFree_smul_set : ThreeGPFree (a • s) ↔ ThreeGPFree s

{α : Type u_2}
[CancelCommMonoid α]
{s : Set α}
{a : α}


theorem Ioo_eq_finset_map :
    Ioo a b =
      (Finset.range (b - a - 1).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding (a + 1))

Finset.Ioo a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding (a + 1))) (Finset.range (b - a - 1).toNat)


@[simp]
theorem unitors_equal : (λ_ (𝟙 a)).hom = (ρ_ (𝟙 a)).hom

{B : Type u}
[CategoryTheory.Bicategory B]
{a : B}

(CategoryTheory.Bicategory.leftUnitor (CategoryTheory.CategoryStruct.id a)).hom =
  (CategoryTheory.Bicategory.rightUnitor (CategoryTheory.CategoryStruct.id a)).hom


theorem mul_def (e e' : P₁ ≃ᵃ[k] P₁) : e * e' = e'.trans e

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


theorem Sbtw.trans_wbtw_left_ne [NoZeroSMulDivisors R V] {w x y z : P} (h₁ : Sbtw R w y z)
    (h₂ : Wbtw R w x y) : x ≠ z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{w x y z : P}
(h₁ : Sbtw R w y z)
(h₂ : Wbtw R w x y)


theorem linOrd_dual_comp_forget_to_Lat :
    LinOrd.dual ⋙ forget₂ LinOrd Lat = forget₂ LinOrd Lat ⋙ Lat.dual

LinOrd.dual ⋙ CategoryTheory.forget₂ LinOrd Lat = CategoryTheory.forget₂ LinOrd Lat ⋙ Lat.dual


/-- Given an embedding of a topological space into a metrizable space, the source space is also
metrizable. -/
theorem _root_.Embedding.metrizableSpace [MetrizableSpace Y] {f : X → Y} (hf : Embedding f) :
    MetrizableSpace X

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace.MetrizableSpace Y]
{f : X → Y}
(hf : Embedding f)


theorem mem_closure_iff :
    x ∈ closure s ↔ ∀ o, IsOpen o → x ∈ o → (o ∩ s).Nonempty

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

x ∈ closure s ↔ ∀ (o : Set X), IsOpen o → x ∈ o → (o ∩ s).Nonempty


theorem singletonChartedSpace_chartAt_eq {f : α → H} (h : OpenEmbedding f) {x : α} :
    ⇑(@chartAt H _ α _ h.singletonChartedSpace x) = f

{H : Type u}
[TopologicalSpace H]
{α : Type u_5}
[TopologicalSpace α]
[Nonempty α]
{f : α → H}
(h : OpenEmbedding f)
{x : α}


/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed

partialFunEquivPointed.inverse.obj X = { x // ¬x = X.point }


@[simp]
theorem join_filter_not_isEmpty  :
    ∀ {L : List (List α)}, join (L.filter fun l => !l.isEmpty) = L.join

(List.filter (fun l => !l.isEmpty) L).join = L.join


theorem image_mk_segment_right (x : E) (y₁ y₂ : F) :
    (fun y => (x, y)) '' [y₁ -[𝕜] y₂] = [(x, y₁) -[𝕜] (x, y₂)]

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(x : E)
(y₁ y₂ : F)


@[simp]
theorem image2_eq_empty_iff : image2 f s t = ∅ ↔ s = ∅ ∨ t = ∅

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}


theorem neg_apply (x : M) : neg R x = -x

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommGroup M]
[Module R M]
(x : M)


theorem AlgHom.bijective [FiniteDimensional K L] (ϕ : L →ₐ[K] L) : Function.Bijective ϕ

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
(ϕ : L →ₐ[K] L)


theorem mulHom_apply (a b : ⨁ i, A i) : mulHom A a b = a * b


/-- The empty normalized word, representing the identity element of the group. -/
@[simps!]
def empty : NormalWord d

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


theorem hasFiniteIntegral_coeFn (f : α →₁[μ] β) : HasFiniteIntegral f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f : ↥(MeasureTheory.Lp β 1 μ))


lemma EdgeDisjointTriangles.card_edgeFinset_le (hG : G.EdgeDisjointTriangles) :
    3 * (G.cliqueFinset 3).card ≤ G.edgeFinset.card

{α : Type u_1}
{G : SimpleGraph α}
[DecidableEq α]
[Fintype α]
[DecidableRel G.Adj]
(hG : G.EdgeDisjointTriangles)


lemma hasExt_iff [HasDerivedCategory.{w'} C] :
    HasExt.{w} C ↔ ∀ (X Y : C) (n : ℤ), Small.{w}
      ((DerivedCategory.singleFunctor C 0).obj X ⟶
        (((DerivedCategory.singleFunctor C 0).obj Y)⟦n⟧))

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[HasDerivedCategory C]

CategoryTheory.HasExt C ↔
  ∀ (X Y : C) (n : ℤ),
    Small.{w, w'}
      ((DerivedCategory.singleFunctor C 0).obj X ⟶
        (CategoryTheory.shiftFunctor (DerivedCategory C) n).obj ((DerivedCategory.singleFunctor C 0).obj Y))


@[to_additive mul_zsmul'] lemma zpow_mul (a : α) : ∀ m n : ℤ, a ^ (m * n) = (a ^ m) ^ n

{α : Type u_1}
[SubtractionMonoid α]
(a : α)
(m n : ℤ)


@[simp]
theorem card_range (n : ℕ) : (range n).card = n


protected theorem add_lt_add_iff_left [CovariantClass α α (· + ·) (· < ·)]
    [ContravariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊥) : a + b < a + c ↔ b < c

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

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


/-- If `I` is initial, then `X ⨯ I` is isomorphic to it. -/
@[simps! hom]
noncomputable def mulIsInitial (X : C) [HasBinaryProduct X I] (hI : IsInitial I) : X ⨯ I ≅ I

(hI : CategoryTheory.Limits.IsInitial I)

(CategoryTheory.Limits.mulIsInitial X hI).hom = CategoryTheory.Limits.prod.snd


theorem AnalyticOn.aeval_polynomial (hf : AnalyticOn 𝕜 f s) (p : A[X]) :
    AnalyticOn 𝕜 (fun x ↦ aeval (f x) p) s

{𝕜 : Type u_1}
{E : Type u_2}
{A : Type u_3}
{B : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CommSemiring A]
{s : Set E}
[NormedRing B]
[NormedAlgebra 𝕜 B]
[Algebra A B]
{f : E → B}
(hf : AnalyticOn 𝕜 f s)
(p : Polynomial A)

AnalyticOn 𝕜 (fun x => (Polynomial.aeval (f x)) p) s


theorem head_supports {S k q} (H : (q : Λ').Supports S) : (head k q).Supports S

(H : Turing.PartrecToTM2.Λ'.Supports S q)

Turing.PartrecToTM2.Λ'.Supports S (Turing.PartrecToTM2.head k q)


/-- If the angle between two vectors is π, the inner product equals the negative product
of the norms. -/
theorem inner_eq_neg_mul_norm_of_angle_eq_pi {x y : V} (h : angle x y = π) :
    ⟪x, y⟫ = -(‖x‖ * ‖y‖)

(h : InnerProductGeometry.angle x y = π)


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

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

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


/-- A subfamily of an orthonormal family (i.e., a composition with an injective map) is an
orthonormal family. -/
theorem Orthonormal.comp {ι' : Type*} {v : ι → E} (hv : Orthonormal 𝕜 v) (f : ι' → ι)
    (hf : Function.Injective f) : Orthonormal 𝕜 (v ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{ι' : Type u_5}
{v : ι → E}
(hv : Orthonormal 𝕜 v)
(f : ι' → ι)
(hf : Function.Injective f)


lemma MorphismProperty.le_def {P Q : MorphismProperty C} :
    P ≤ Q ↔ ∀ {X Y : C} (f : X ⟶ Y), P f → Q f

{P Q : CategoryTheory.MorphismProperty C}


lemma subsingleton_Icc_of_ge (hba : b ≤ a) : Set.Subsingleton (Icc a b)

{α : Type u_1}
[PartialOrder α]
{a b : α}
(hba : b ≤ a)


@[simp] lemma nnnorm_ofAdd (x : E) : ‖ofAdd x‖₊ = ‖x‖₊


/-- Given a t-structure `t` on a pretriangulated category `C`, the property `t.IsLE X n`
holds if `X : C` is `≤ n` for the t-structure. -/
class IsLE (X : C) (n : ℤ) : Prop where
  le : t.LE n X

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

{t : CategoryTheory.Triangulated.TStructure C}


/-- Change constants `a` and `b` in `(f : G →+c[a, b] H)` to improve definitional equalities. -/
@[simps (config := .asFn)]
def replaceConsts (f : G →+c[a, b] H) (a' b') (ha : a = a') (hb : b = b') :
    G →+c[a', b'] H

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
(f : AddConstMap G H a b)
(a' : G)
(b' : H)
(ha : a = a')
(hb : b = b')


@[to_additive (attr := simp)]
theorem nndist_mul_right [PseudoMetricSpace M] [Mul M] [IsometricSMul Mᵐᵒᵖ M] (a b c : M) :
    nndist (a * c) (b * c) = nndist a b

{M : Type u}
[PseudoMetricSpace M]
[Mul M]
[IsometricSMul Mᵐᵒᵖ M]
(a b c : M)


@[simp, norm_cast]
theorem coe_imI : (x : ℍ[R,c₁,c₂]).imI = 0

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x : R)


@[to_additive]
theorem prod_univ_def [CommMonoid β] {n : ℕ} (f : Fin n → β) :
    ∏ i, f i = ((List.finRange n).map f).prod

{β : Type u_2}
[AddCommMonoid β]
{n : ℕ}
(f : Fin n → β)

∑ i : Fin n, f i = (List.map f (List.finRange n)).sum


@[simp]
theorem comp_val_c {X Y Z : LocallyRingedSpace.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f.1 ≫ g.1).c = g.val.c ≫ (Presheaf.pushforward _ g.val.base).map f.val.c

{X Y Z : AlgebraicGeometry.LocallyRingedSpace}

(f.val ≫ g.val).c = g.val.c ≫ (TopCat.Presheaf.pushforward CommRingCat g.val.base).map f.val.c


@[simp]
theorem mem_comap {f : E →L[ℝ] F} {S : ProperCone ℝ F} {x : E} : x ∈ S.comap f ↔ f x ∈ S

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{F : Type u_2}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{f : E →L[ℝ] F}
{S : ProperCone ℝ F}
{x : E}


@[simp]
theorem dist_lineMap_left (p₁ p₂ : P) (c : 𝕜) : dist (lineMap p₁ p₂ c) p₁ = ‖c‖ * dist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

dist ((AffineMap.lineMap p₁ p₂) c) p₁ = ‖c‖ * dist p₁ p₂


theorem toReal_coe_eq_self_add_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ + 2 * π ↔ θ ∈ Set.Ioc (-3 * π) (-π)

(↑θ).toReal = θ + 2 * π ↔ θ ∈ Set.Ioc (-3 * π) (-π)


@[simp] theorem add_imJ : (a + b).imJ = a.imJ + b.imJ

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


@[simp] theorem PLift.down_inj {a b : PLift α} : a.down = b.down ↔ a = b


theorem ball_subset_interior_closedBall : ball x ε ⊆ interior (closedBall x ε)

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

Metric.ball x ε ⊆ interior (Metric.closedBall x ε)


@[simp]
theorem inverseAssociator_obj_inr_inr (X) : (inverseAssociator C D E).obj (inr (inr X)) = inr X

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

(CategoryTheory.sum.inverseAssociator C D E).obj (Sum.inr (Sum.inr X)) = Sum.inr X


theorem ascPochhammer_eval_zero {n : ℕ} : (ascPochhammer S n).eval 0 = if n = 0 then 1 else 0

Polynomial.eval 0 (ascPochhammer S n) = if n = 0 then 1 else 0


@[simp]
theorem head_iterate (f : α → α) (a : α) : head (iterate f a) = a


@[simp]
theorem pi_univ_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t

{ι : Type u_1}
{α : ι → Type u_2}
(s : Set ι)
[DecidablePred fun x => x ∈ s]
(t : (i : ι) → Set (α i))

(Set.univ.pi fun i => if i ∈ s then t i else Set.univ) = s.pi t


theorem MapsTo.union_union (h₁ : MapsTo f s₁ t₁) (h₂ : MapsTo f s₂ t₂) :
    MapsTo f (s₁ ∪ s₂) (t₁ ∪ t₂)

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


@[simp]
theorem map_snd {F : C ⥤ Type w} {p q : F.Elements} (f : p ⟶ q) : (F.map f.val) p.2 = q.2

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : CategoryTheory.Functor C (Type w)}
{p q : F.Elements}
(f : p ⟶ q)


lemma rnDeriv_le_one_of_le (hμν : μ ≤ ν) [SigmaFinite ν] : μ.rnDeriv ν ≤ᵐ[ν] 1

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(hμν : μ ≤ ν)
[MeasureTheory.SigmaFinite ν]


@[simp]
theorem basisUnique_repr_eq_zero_iff {ι : Type*} [Unique ι]
    {h : finrank R M = 1} {v : M} {i : ι} :
    (basisUnique ι h).repr v i = 0 ↔ v = 0

{R : Type u}
{M : Type v}
[Ring R]
[StrongRankCondition R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
{ι : Type u_1}
[Unique ι]
{h : FiniteDimensional.finrank R M = 1}
{v : M}
{i : ι}

((FiniteDimensional.basisUnique ι h).repr v) i = 0 ↔ v = 0


theorem emod_pos_of_not_dvd {a b : Nat} (h : ¬ a ∣ b) : 0 < b % a


@[to_additive]
theorem prod_hom [CommMonoid β] (s : Multiset α) {F : Type*} [FunLike F α β]
    [MonoidHomClass F α β] (f : F) :
    (s.map f).prod = f s.prod

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid α]
[AddCommMonoid β]
(s : Multiset α)
{F : Type u_6}
[FunLike F α β]
[AddMonoidHomClass F α β]
(f : F)


@[simp, norm_cast]
theorem coe_inj : (φ : PowerSeries R) = ψ ↔ φ = ψ

{R : Type u_2}
[CommSemiring R]
{φ ψ : Polynomial R}

↑φ = ↑ψ ↔ φ = ψ


theorem swap_mul_eq_mul_swap (f : Perm α) (x y : α) : swap x y * f = f * swap (f⁻¹ x) (f⁻¹ y)

{α : Type u}
[DecidableEq α]
(f : Equiv.Perm α)
(x y : α)

Equiv.swap x y * f = f * Equiv.swap (f⁻¹ x) (f⁻¹ y)


lemma topCatAdjunctionCounit_bijective (X : TopCat.{u+1}) :
    Function.Bijective (topCatAdjunctionCounit X)


@[simp]
theorem val_add : ∀ y1 y2 : HomogeneousLocalization 𝒜 x, (y1 + y2).val = y1.val + y2.val

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[AddCommMonoid ι]
[DecidableEq ι]
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
[GradedAlgebra 𝒜]
{x : Submonoid A}
(y1 y2 : HomogeneousLocalization 𝒜 x)


protected theorem Monotone.comp (hg : Monotone g) (hf : Monotone f) : Monotone (g ∘ f)

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


theorem inv_le_of_inv_le (ha : 0 < a) (h : a⁻¹ ≤ b) : b⁻¹ ≤ a

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)
(h : a⁻¹ ≤ b)


/-- When `S.g = 0`, this is the canonical isomorphism `S.cycles ≅ S.X₂` induced by `S.iCycles`. -/
@[simps! hom]
noncomputable def cyclesIsoX₂ (hg : S.g = 0) : S.cycles ≅ S.X₂


/-- The identity function is locally Lipschitz. -/
protected lemma id : LocallyLipschitz (@id α)


theorem degree_map_eq_of_injective (hf : Injective f) (p : R[X]) : degree (p.map f) = degree p

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{f : R →+* S}
(hf : Function.Injective ⇑f)
(p : R[X])


theorem IsBounded.isCobounded_le [Preorder α] [NeBot f] (h : f.IsBounded (· ≥ ·)) :
    f.IsCobounded (· ≤ ·)

(h : Filter.IsBounded (fun x x_1 => x ≥ x_1) f)

Filter.IsCobounded (fun x x_1 => x ≤ x_1) f


theorem Scheme.eq_emptyTo {X : Scheme.{u}} (f : ∅ ⟶ X) : f = Scheme.emptyTo X

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


lemma mem_next [e.IsTruncGE] {j : ι} {k' : ι'} (h : c'.Rel (e.f j) k') : ∃ k, e.f k = k'

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
(e : c.Embedding c')
[e.IsTruncGE]
{j : ι}
{k' : ι'}
(h : c'.Rel (e.f j) k')


theorem lt_def {a b : Fin n} : a < b ↔ a.1 < b.1


@[to_additive (attr := simp)]
lemma symm_mk_pow [Monoid M] (a : Mᵈᵐᵃ) (n : ℕ) : mk.symm (a ^ n) = mk.symm a ^ n

{M : Type u_1}
[AddMonoid M]
(a : Mᵈᵃᵃ)
(n : ℕ)

DomAddAct.mk.symm (n • a) = n • DomAddAct.mk.symm a


theorem LineDifferentiableWithinAt.mono_of_mem (h : LineDifferentiableWithinAt 𝕜 f s x v)
    (hst : s ∈ 𝓝[t] x) : LineDifferentiableWithinAt 𝕜 f t x v


theorem map_sub_swap (x y : R) : v (x - y) = v (y - x)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation R Γ₀)
(x y : R)


@[simp]
lemma homologyMap'_id (h : S.HomologyData) :
    homologyMap' (𝟙 S) h h = 𝟙 _

CategoryTheory.ShortComplex.homologyMap' (CategoryTheory.CategoryStruct.id S) h h =
  CategoryTheory.CategoryStruct.id h.left.H


theorem vsub_union : s -ᵥ (t₁ ∪ t₂) = s -ᵥ t₁ ∪ (s -ᵥ t₂)

{α : Type u_2}
{β : Type u_3}
[VSub α β]
[DecidableEq α]
{s t₁ t₂ : Finset β}
[DecidableEq β]


/-- Construct a morphism between whiskered extensions. -/
@[simps! right]
def whiskerHom (i : s ⟶ t) {x : B} (h : c ⟶ x) :
    s.whisker h ⟶ t.whisker h

{s t : CategoryTheory.Bicategory.LeftExtension f g}

(CategoryTheory.Bicategory.LeftExtension.whiskerHom i h).right = CategoryTheory.Bicategory.whiskerRight i.right h


@[simp]
theorem fst_prod (f : M →ₗ[R] M₂) (g : M →ₗ[R] M₃) : (fst R M₂ M₃).comp (prod f g) = f

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M →ₗ[R] M₂)
(g : M →ₗ[R] M₃)


/-- If `n` is a nonzero natural number and `p ≠ 1`, then there are natural numbers `e`
and `n'` such that `n'` is not divisible by `p` and `n = p^e * n'`. -/
theorem exists_eq_pow_mul_and_not_dvd {n : ℕ} (hn : n ≠ 0) (p : ℕ) (hp : p ≠ 1) :
    ∃ e n' : ℕ, ¬p ∣ n' ∧ n = p ^ e * n'


/-- Let `R` be a ring, and `f i` a finite collection of elements of `R` generating the unit ideal.
If the localization of `R` at each `f i` is noetherian, so is `R`.

We follow the proof given in [Har77], Proposition II.3.2 -/
theorem isNoetherianRing_of_away : IsNoetherianRing R

(hN : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s))


/-- The product of two arithmetic functions defines the same function as the Dirichlet convolution
of the functions defined by them. -/
lemma ArithmeticFunction.coe_mul {R : Type*} [Semiring R] (f g : ArithmeticFunction R) :
    f ⍟ g = ⇑(f * g)

{R : Type u_1}
[Semiring R]
(f g : ArithmeticFunction R)


theorem mono {m'} (hf : AEStronglyMeasurable' m f μ) (hm : m ≤ m') :
    AEStronglyMeasurable' m' f μ

(hf : MeasureTheory.AEStronglyMeasurable' m f μ)

MeasureTheory.AEStronglyMeasurable' m' f μ


theorem setLIntegral_le_lintegral (s : Set α) (f : α → ℝ≥0∞) :
    ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : Set α)
(f : α → ℝ≥0∞)

∫⁻ (x : α) in s, f x ∂μ ≤ ∫⁻ (x : α), f x ∂μ


protected theorem nonempty_coe {U : Opens α} : (U : Set α).Nonempty ↔ ∃ x, x ∈ U

{α : Type u_2}
[TopologicalSpace α]
{U : TopologicalSpace.Opens α}


/-- Cantor's intersection theorem for `sInter`:
the intersection of a directed family of nonempty compact closed sets is nonempty. -/
theorem IsCompact.nonempty_sInter_of_directed_nonempty_isCompact_isClosed
    {S : Set (Set X)} [hS : Nonempty S] (hSd : DirectedOn (· ⊇ ·) S) (hSn : ∀ U ∈ S, U.Nonempty)
    (hSc : ∀ U ∈ S, IsCompact U) (hScl : ∀ U ∈ S, IsClosed U) : (⋂₀ S).Nonempty

(hSd : DirectedOn (fun x x_1 => x ⊇ x_1) S)


theorem closure_singleton (x) : closure ({x} : Set (PrimeSpectrum R)) = zeroLocus x.asIdeal

{R : Type u}
[CommSemiring R]
(x : PrimeSpectrum R)

closure {x} = PrimeSpectrum.zeroLocus ↑x.asIdeal


@[to_additive]
theorem normalizer_isSubgroup (s : Set G) : IsSubgroup (normalizer s)


theorem sSameSide_lineMap_right {s : AffineSubspace R P} {x y : P} (hx : x ∈ s) (hy : y ∉ s) {t : R}
    (ht : 0 < t) : s.SSameSide y (lineMap x y t)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
(hx : x ∈ s)
(hy : y ∉ s)
{t : R}
(ht : 0 < t)

s.SSameSide y ((AffineMap.lineMap x y) t)


theorem IsVonNBounded.of_sub_right (hst : IsVonNBounded 𝕜 (s - t)) (hs : s.Nonempty) :
    IsVonNBounded 𝕜 t

(hst : Bornology.IsVonNBounded 𝕜 (s - t))


theorem of_isBilimit {b : BinaryBicone X Y} (h : b.IsBilimit) :
    IsPullback b.fst b.snd (0 : X ⟶ 0) (0 : Y ⟶ 0)

{b : CategoryTheory.Limits.BinaryBicone X Y}

CategoryTheory.IsPullback b.fst b.snd 0 0


@[to_additive]
theorem Commute.isUnit_mul_iff (h : Commute a b) : IsUnit (a * b) ↔ IsUnit a ∧ IsUnit b

{M : Type u_1}
[AddMonoid M]
{a b : M}
(h : AddCommute a b)

IsAddUnit (a + b) ↔ IsAddUnit a ∧ IsAddUnit b


theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] :
    ∀ x, Mono <| (stalkFunctor C x).map f.1

CategoryTheory.Mono ((TopCat.Presheaf.stalkFunctor C x).map f.val)


/-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them.
-/
theorem set_has_maximal_iff_noetherian :
    (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M

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

(∀ (a : Set (Submodule R M)), a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M


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

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

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


/-- Two equal natural transformations `R₁ ⟶ R₂` yield naturally isomorphic functors
    `Comma L R₁ ⥤ Comma L R₂`. -/
@[simps!]
def mapRightEq (r r' : R₁ ⟶ R₂) (h : r = r') : mapRight L r ≅ mapRight L r'

{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₁ R₂ : CategoryTheory.Functor B T}
(r r' : R₁ ⟶ R₂)
(h : r = r')
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightEq L r r' h).inv.app X).right = CategoryTheory.CategoryStruct.id X.right


@[to_additive]
nonrec theorem SmoothAt.div_const (hf : SmoothAt I' I f x) :
    SmoothAt I' I (fun x ↦ f x / c) x

{𝕜 : 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}
[SubNegMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
{x : M}
(c : G)
(hf : SmoothAt I' I f x)


@[to_additive Prod.nnnorm_def']
lemma Prod.nnorm_def (x : E × F) : ‖x‖₊ = max ‖x.1‖₊ ‖x.2‖₊

{E : Type u_2}
{F : Type u_3}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
(x : E × F)


@[simp]
lemma normEDS_neg (n : ℤ) : normEDS b c d (-n) = -normEDS b c d n

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


/-- Corollary of the Chinese remainder theorem: given elements `x i : R / P i ^ e i`,
we can choose a representative `y : R` such that `y ≡ x i (mod P i ^ e i)`. -/
theorem IsDedekindDomain.exists_representative_mod_finset {ι : Type*} {s : Finset ι}
    (P : ι → Ideal R) (e : ι → ℕ) (prime : ∀ i ∈ s, Prime (P i))
    (coprime : ∀ᵉ (i ∈ s) (j ∈ s), i ≠ j → P i ≠ P j) (x : ∀ i : s, R ⧸ P i ^ e i) :
    ∃ y, ∀ (i) (hi : i ∈ s), Ideal.Quotient.mk (P i ^ e i) y = x ⟨i, hi⟩

(coprime : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → P i ≠ P j)

(x : (i : { x // x ∈ s }) → R ⧸ P ↑i ^ e ↑i)

∃ y, ∀ (i : ι) (hi : i ∈ s), (Ideal.Quotient.mk (P i ^ e i)) y = x ⟨i, hi⟩


@[simp] theorem abs_bot : (⊥ : EReal).abs = ⊤


@[to_additive (attr := mono)]
theorem smul_subset_smul : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ • t₁ ⊆ s₂ • t₂

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s₁ s₂ : Finset α}
{t₁ t₂ : Finset β}

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ +ᵥ t₁ ⊆ s₂ +ᵥ t₂


theorem dualAnnihilator_dualAnnihilator_eq_map (W : Subspace K V) [FiniteDimensional K W] :
    W.dualAnnihilator.dualAnnihilator = W.map (Dual.eval K V)

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
(W : Subspace K V)
[FiniteDimensional K ↥W]

(Submodule.dualAnnihilator W).dualAnnihilator = Submodule.map (Module.Dual.eval K V) W


@[ext]
lemma hom_ext {X Y : FintypeCat} (f g : X ⟶ Y) (h : ∀ x, f x = g x) : f = g

{X Y : FintypeCat}
(f g : X ⟶ Y)
(h : ∀ (x : ↑X), f x = g x)


@[to_additive]
theorem contMDiffAt_finprod
    (lf : LocallyFinite fun i ↦ mulSupport <| f i) (h : ∀ i, ContMDiffAt I' I n (f i) x₀) :
    ContMDiffAt I' I n (fun x ↦ ∏ᶠ i, f i x) x₀

(lf : LocallyFinite fun i => Function.mulSupport (f i))

(h : ∀ (i : ι), ContMDiffAt I' I n (f i) x₀)

ContMDiffAt I' I n (fun x => ∏ᶠ (i : ι), f i x) x₀


lemma constVAdd_coe [ContinuousConstVAdd V₁ P₁] (v : V₁) :
    (constVAdd k P₁ v).toAffineEquiv = .constVAdd k P₁ v

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[TopologicalSpace P₁]
[ContinuousConstVAdd V₁ P₁]
(v : V₁)

↑(ContinuousAffineEquiv.constVAdd k P₁ v) = AffineEquiv.constVAdd k P₁ v


@[simp]
theorem Ioo_succ_right (a b : α) : Ioo a (succ b) = Ioc a b

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


@[to_additive (attr := gcongr) nsmul_lt_nsmul_left]
theorem pow_lt_pow_right' [CovariantClass M M (· * ·) (· < ·)] {a : M} {n m : ℕ} (ha : 1 < a)
    (h : n < m) : a ^ n < a ^ m

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

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


theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≤ t) (x : E) : ‖t • x‖ = t * ‖x‖

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{t : ℝ}
(ht : 0 ≤ t)
(x : E)


/-- An alternative characterization of a maximal linearly independent family,
quantifying over types (in the same universe as `M`) into which the indexing family injects.
-/
theorem LinearIndependent.maximal_iff {ι : Type w} {R : Type u} [Ring R] [Nontrivial R] {M : Type v}
    [AddCommGroup M] [Module R M] {v : ι → M} (i : LinearIndependent R v) :
    i.Maximal ↔
      ∀ (κ : Type v) (w : κ → M) (_i' : LinearIndependent R w) (j : ι → κ) (_h : w ∘ j = v),
        Surjective j

i.Maximal ↔ ∀ (κ : Type v) (w : κ → M), LinearIndependent R w → ∀ (j : ι → κ), w ∘ j = v → Function.Surjective j


/-- The Weierstrass curve mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps]
def map : WeierstrassCurve A

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


@[simp] lemma compl_lt_compl_iff_lt : yᶜ < xᶜ ↔ x < y

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


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

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

‖a - b‖₊ ≤ ‖a‖₊ + ‖b‖₊


theorem Algebra.isSeparable_tower_bot_of_isSeparable [h : Algebra.IsSeparable F E] :
    Algebra.IsSeparable F K

(F : Type u_1)
(K : Type u_2)
(E : Type u_3)
[Field F]
[Field K]
[Field E]
[Algebra F K]
[Algebra F E]
[Algebra K E]
[IsScalarTower F K E]
[h : Algebra.IsSeparable F E]


@[simp]
theorem top_apply (a : α) : (⊤ : sInfHom α β) a = ⊤

{α : Type u_2}
{β : Type u_3}
[InfSet α]
[CompleteLattice β]
(a : α)


protected theorem mul_le_mul_of_nonneg_left {a b c : Int}
    (h₁ : a ≤ b) (h₂ : 0 ≤ c) : c * a ≤ c * b


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

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


theorem separable_prod_X_sub_C_iff {ι : Sort _} [Fintype ι] {f : ι → F} :
    (∏ i, (X - C (f i))).Separable ↔ Function.Injective f

{F : Type u}
[Field F]
{ι : Type u_1}
[Fintype ι]
{f : ι → F}

(∏ i : ι, (Polynomial.X - Polynomial.C (f i))).Separable ↔ Function.Injective f


theorem adj_of_length_eq_one {u v : V} : ∀ {p : G.Walk u v}, p.length = 1 → G.Adj u v

{V : Type u}
{G : SimpleGraph V}
{u v : V}
{p : G.Walk u v}


theorem ker_nhds_eq_specializes : (𝓝 x).ker = {y | y ⤳ x}

{X : Type u_1}
[TopologicalSpace X]
{x : X}


@[simp]
theorem Quiver.Hom.unop_op' {X Y : Cᵒᵖ} {x} :
    @Quiver.Hom.unop C _ X Y no_index (Opposite.op (unop := x)) = x

{C : Type u₁}
[Quiver C]
{X Y : Cᵒᵖ}
{x : Opposite.unop Y ⟶ Opposite.unop X}


theorem infinitePos_mul_of_infiniteNeg_not_infinitesimal_neg {x y : ℝ*} :
    InfiniteNeg x → ¬Infinitesimal y → y < 0 → InfinitePos (x * y)

x.InfiniteNeg → ¬y.Infinitesimal → y < 0 → (x * y).InfinitePos


/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C)

{F G H : CategoryTheory.OplaxFunctor B C}

(CategoryTheory.Bicategory.associator η θ ι).hom.app a =
  (CategoryTheory.Bicategory.associator (η.app a) (θ.app a) (ι.app a)).hom


/-- Double integrals commute with subtraction. -/
theorem integral_integral_sub ⦃f g : α × β → E⦄ (hf : Integrable f (μ.prod ν))
    (hg : Integrable g (μ.prod ν)) :
    (∫ x, ∫ y, f (x, y) - g (x, y) ∂ν ∂μ) = (∫ x, ∫ y, f (x, y) ∂ν ∂μ) - ∫ x, ∫ y, g (x, y) ∂ν ∂μ

⦃f g : α × β → E⦄

(hf : MeasureTheory.Integrable f (μ.prod ν))

(hg : MeasureTheory.Integrable g (μ.prod ν))

∫ (x : α), ∫ (y : β), f (x, y) - g (x, y) ∂ν ∂μ =
  ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ - ∫ (x : α), ∫ (y : β), g (x, y) ∂ν ∂μ


@[simp, norm_cast]
theorem coe_prod : ((s ×ˢ t : LowerSet (α × β)) : Set (α × β)) = (s : Set α) ×ˢ t

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(s : LowerSet α)
(t : LowerSet β)

↑(s ×ˢ t) = ↑s ×ˢ ↑t


theorem LinearIndependent.total_comp_repr :
    (Finsupp.total ι M R v).comp hv.repr = Submodule.subtype _

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

Finsupp.total ι M R v ∘ₗ hv.repr = (Submodule.span R (Set.range v)).subtype


@[csimp] theorem modifyNth_eq_modifyNthTR : @modifyNth = @modifyNthTR


/-- The inclusion of `R_hat` in `K_hat` as a homomorphism of additive monoids. -/
@[simps]
def Coe.addMonoidHom : AddMonoidHom (R_hat R K) (K_hat R K)

(x : DedekindDomain.FiniteIntegralAdeles R K)

(v : IsDedekindDomain.HeightOneSpectrum R)

(DedekindDomain.FiniteIntegralAdeles.Coe.addMonoidHom R K) x v = ↑(x v)


@[simp] theorem not_cons (x : BitVec w) (b : Bool) : ~~~(cons b x) = cons (!b) (~~~x)

~~~BitVec.cons b x = BitVec.cons (!b) (~~~x)


theorem mem_leadingCoeffNth_zero (x) : x ∈ I.leadingCoeffNth 0 ↔ C x ∈ I

{R : Type u}
[CommSemiring R]
(I : Ideal R[X])
(x : R)

x ∈ I.leadingCoeffNth 0 ↔ Polynomial.C x ∈ I


@[reassoc (attr := simp)]
theorem comp_p {P Q : Karoubi C} (f : Hom P Q) : f.f ≫ Q.p = f.f

{P Q : CategoryTheory.Idempotents.Karoubi C}

CategoryTheory.CategoryStruct.comp f.f Q.p = f.f


@[simp, norm_cast] lemma one_le_coe [One α] : 1 ≤ (a : WithZero α) ↔ 1 ≤ a

{α : Type u_1}
[Preorder α]
{a : α}
[One α]

1 ≤ ↑a ↔ 1 ≤ a


protected lemma IsBigO.sqrt (hfg : f =O[l] g) (hg : 0 ≤ᶠ[l] g) :
    (Real.sqrt <| f ·) =O[l] (Real.sqrt <| g ·)

{α : Type u_1}
{l : Filter α}
{f g : α → ℝ}
(hfg : f =O[l] g)
(hg : 0 ≤ᶠ[l] g)


@[simp] theorem Bool.and_false (b : Bool) : (b && false) = false


@[to_additive]
theorem mem_leftTransversals_iff_bijective :
    S ∈ leftTransversals (H : Set G) ↔
      Function.Bijective (S.restrict (Quotient.mk'' : G → Quotient (QuotientGroup.leftRel H)))

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
{S : Set G}

S ∈ AddSubgroup.leftTransversals ↑H ↔ Function.Bijective (S.restrict Quotient.mk'')


lemma exists₂_weightSpace_smul_add_eq_bot :
    ∃ᵉ (p < (0 : ℤ)) (q > (0 : ℤ)),
      weightSpace M (p • χ₁ + χ₂) = ⊥ ∧
      weightSpace M (q • χ₁ + χ₂) = ⊥

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
(χ₁ χ₂ : L → R)
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(hχ₁ : χ₁ ≠ 0)

∃ p < 0, ∃ q > 0, LieModule.weightSpace M (p • χ₁ + χ₂) = ⊥ ∧ LieModule.weightSpace M (q • χ₁ + χ₂) = ⊥


@[simp]
theorem card_insert {a : α} (s : Set α) [Fintype s] (h : a ∉ s)
    {d : Fintype.{u} (insert a s : Set α)} : @Fintype.card _ d = Fintype.card s + 1

{α : Type u}
{a : α}
(s : Set α)
[Fintype ↑s]
(h : a ∉ s)
{d : Fintype ↑(insert a s)}

Fintype.card ↑(insert a s) = Fintype.card ↑s + 1


@[simp]
theorem mk'_apply {f : M → M₂} (lin : IsLinearMap R f) (x : M) : mk' f lin x = f x

{R : Type u_1}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
{f : M → M₂}
(lin : IsLinearMap R f)
(x : M)


@[simp]
theorem bliminf_sup_le_and_aux_left : bliminf u f p ≤ bliminf u f fun x => p x ∧ q x

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}

Filter.bliminf u f p ≤ Filter.bliminf u f fun x => p x ∧ q x


theorem pi_lift (γ : ∀ i, Path (as i) (bs i)) :
    (Path.Homotopic.pi fun i => ⟦γ i⟧) = ⟦Path.pi γ⟧

{ι : Type u_1}
{X : ι → Type u_2}
[(i : ι) → TopologicalSpace (X i)]
{as bs : (i : ι) → X i}
(γ : (i : ι) → Path (as i) (bs i))


@[simp] theorem encard_empty : (∅ : Set α).encard = 0


@[to_additive]
theorem unop_sSup (S : Set (Submonoid Mᵐᵒᵖ)) : (sSup S).unop = sSup (.op ⁻¹' S)

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

(sSup S).unop = sSup (Submonoid.op ⁻¹' S)


theorem seq_subset {s : Set (α → β)} {t : Set α} {u : Set β} :
    seq s t ⊆ u ↔ ∀ f ∈ s, ∀ a ∈ t, (f : α → β) a ∈ u

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


theorem _root_.ContinuousOn.angle_sign_comp {α : Type*} [TopologicalSpace α] {f : α → Angle}
    {s : Set α} (hf : ContinuousOn f s) (hs : ∀ z ∈ s, f z ≠ 0 ∧ f z ≠ π) :
    ContinuousOn (sign ∘ f) s

{α : Type u_1}
[TopologicalSpace α]
{f : α → Real.Angle}
{s : Set α}
(hf : ContinuousOn f s)
(hs : ∀ z ∈ s, f z ≠ 0 ∧ f z ≠ ↑π)


theorem Trivialization.smoothOn_iff {f : M → TotalSpace F E} {s : Set M}
    (he : MapsTo f s e.source) :
    SmoothOn IM (IB.prod 𝓘(𝕜, F)) f s ↔
      SmoothOn IM IB (fun x => (f x).proj) s ∧ SmoothOn IM 𝓘(𝕜, F) (fun x ↦ (e (f x)).2) s

[TopologicalSpace (Bundle.TotalSpace F E)]

{e : Trivialization F Bundle.TotalSpace.proj}

SmoothOn IM (IB.prod 𝓘(𝕜, F)) f s ↔
  SmoothOn IM IB (fun x => (f x).proj) s ∧ SmoothOn IM 𝓘(𝕜, F) (fun x => (↑e (f x)).2) s


protected theorem surjective (e : M₁ ≃SL[σ₁₂] M₂) : Function.Surjective e

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


theorem coeff_sum {X : Type*} (s : Finset X) (f : X → MvPolynomial σ R) (m : σ →₀ ℕ) :
    coeff m (∑ x ∈ s, f x) = ∑ x ∈ s, coeff m (f x)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{X : Type u_2}
(s : Finset X)
(f : X → MvPolynomial σ R)
(m : σ →₀ ℕ)

MvPolynomial.coeff m (∑ x ∈ s, f x) = ∑ x ∈ s, MvPolynomial.coeff m (f x)


@[simp]
theorem det_symm (f : M ≃ₗ[R] M) : LinearEquiv.det f.symm = LinearEquiv.det f⁻¹

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(f : M ≃ₗ[R] M)


theorem withDensity_ae_eq {β : Type} {f g : α → β} {d : α → ℝ≥0∞}
    (hd : AEMeasurable d μ) (h_ae_nonneg : ∀ᵐ x ∂μ, d x ≠ 0) :
    f =ᵐ[μ.withDensity d] g ↔ f =ᵐ[μ] g

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type}
{f g : α → β}
{d : α → ℝ≥0∞}
(hd : AEMeasurable d μ)
(h_ae_nonneg : ∀ᵐ (x : α) ∂μ, d x ≠ 0)


@[simp]
theorem zmodEquivZPowers_symm_apply_pow (i : ℕ) :
    h.zmodEquivZPowers.symm (Additive.ofMul (⟨ζ ^ i, i, rfl⟩ : Subgroup.zpowers ζ)) = i

{R : Type u_4}
{k : ℕ}
[CommRing R]
{ζ : Rˣ}
(h : IsPrimitiveRoot ζ k)
(i : ℕ)

h.zmodEquivZPowers.symm (Additive.ofMul ⟨ζ ^ i, ⋯⟩) = ↑i


/-- The `vectorSpan` is the span of the pairwise subtractions with a given point on the right,
excluding the subtraction of that point from itself. -/
theorem vectorSpan_eq_span_vsub_finset_right_ne [DecidableEq P] [DecidableEq V] {s : Finset P}
    {p : P} (hp : p ∈ s) :
    vectorSpan k (s : Set P) = Submodule.span k ((s.erase p).image (· -ᵥ p))

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

vectorSpan k ↑s = Submodule.span k ↑(Finset.image (fun x => x -ᵥ p) (s.erase p))


theorem geom_sum_alternating_of_le_neg_one [StrictOrderedRing α] (hx : x + 1 ≤ 0) (n : ℕ) :
    if Even n then (∑ i ∈ range n, x ^ i) ≤ 0 else 1 ≤ ∑ i ∈ range n, x ^ i

{α : Type u}
{x : α}
[StrictOrderedRing α]
(hx : x + 1 ≤ 0)
(n : ℕ)

if Even n then ∑ i ∈ Finset.range n, x ^ i ≤ 0 else 1 ≤ ∑ i ∈ Finset.range n, x ^ i


theorem mem_grade_iff (m : M) (a : R[M]) : a ∈ grade R m ↔ a.support ⊆ {m}

{M : Type u_1}
(R : Type u_3)
[CommSemiring R]
(m : M)
(a : AddMonoidAlgebra R M)

a ∈ AddMonoidAlgebra.grade R m ↔ a.support ⊆ {m}


@[simp]
theorem decompose_symm_sub (x y : ⨁ i, ℳ i) :
    (decompose ℳ).symm (x - y) = (decompose ℳ).symm x - (decompose ℳ).symm y

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommGroup M]
[SetLike σ M]
[AddSubgroupClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]
(x y : ⨁ (i : ι), ↥(ℳ i))

(DirectSum.decompose ℳ).symm (x - y) = (DirectSum.decompose ℳ).symm x - (DirectSum.decompose ℳ).symm y


@[to_additive]
theorem comap_map_eq_self {f : G →* N} {H : Subgroup G} (h : f.ker ≤ H) :
    comap f (map f H) = H

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{H : AddSubgroup G}
(h : f.ker ≤ H)

AddSubgroup.comap f (AddSubgroup.map f H) = H


lemma isUnit_dblZ_of_Y_ne {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3) : IsUnit (W.dblZ P)

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


protected theorem floor_def' (a : ℚ) : a.floor = a.num / a.den


@[simp] theorem decomposeLinearEquiv_symm_apply (m : ⨁ i, ℳ i) :
    (decomposeLinearEquiv ℳ).symm m = (decompose ℳ).symm m

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
[DecidableEq ι]
[Semiring R]
[AddCommMonoid M]
[Module R M]
(ℳ : ι → Submodule R M)
[DirectSum.Decomposition ℳ]
(m : ⨁ (i : ι), ↥(ℳ i))

(DirectSum.decomposeLinearEquiv ℳ).symm m = (DirectSum.decompose ℳ).symm m


lemma iff_rTensor_preserves_shortComplex_exact :
    Flat R M ↔
    ∀ (C : ShortComplex $ ModuleCat R) (_ : C.Exact), (C.map (tensorRight M) |>.Exact)

{R : Type u}
[CommRing R]
(M : ModuleCat R)

Module.Flat R ↑M ↔
  ∀ (C : CategoryTheory.ShortComplex (ModuleCat R)),
    C.Exact → (C.map (CategoryTheory.MonoidalCategory.tensorRight M)).Exact


@[simp] theorem dist_toMul (a b : Additive X) : dist (toMul a) (toMul b) = dist a b

{X : Type u_1}
[Dist X]
(a b : Additive X)

dist (Additive.toMul a) (Additive.toMul b) = dist a b


@[reassoc (attr := simp)]
theorem PInftyToNormalizedMooreComplex_naturality {X Y : SimplicialObject A} (f : X ⟶ Y) :
    AlternatingFaceMapComplex.map f ≫ PInftyToNormalizedMooreComplex Y =
      PInftyToNormalizedMooreComplex X ≫ NormalizedMooreComplex.map f

{X Y : CategoryTheory.SimplicialObject A}

AlgebraicTopology.AlternatingFaceMapComplex.map f ≫ AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex Y =
  AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex X ≫ AlgebraicTopology.NormalizedMooreComplex.map f


theorem restrict_iInf {ι} [Nonempty ι] (s : Set α) (m : ι → OuterMeasure α) :
    restrict s (⨅ i, m i) = ⨅ i, restrict s (m i)

{α : Type u_1}
{ι : Sort u_2}
[Nonempty ι]
(s : Set α)
(m : ι → MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.restrict s) (⨅ i, m i) = ⨅ i, (MeasureTheory.OuterMeasure.restrict s) (m i)


@[simp] theorem ofFin_lt (x : Fin (2^n)) (y : BitVec n) :
  BitVec.ofFin x < y ↔ x < y.toFin

{n : Nat}
(x : Fin (2 ^ n))
(y : BitVec n)


@[simp]
theorem pow_toGerm (f : α →ₘ[μ] γ) (n : ℕ) : (f ^ n).toGerm = f.toGerm ^ n

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
[Monoid γ]
[ContinuousMul γ]
(f : α →ₘ[μ] γ)
(n : ℕ)


@[fun_prop]
protected theorem DifferentiableWithinAt.fst (h : DifferentiableWithinAt 𝕜 f₂ s x) :
    DifferentiableWithinAt 𝕜 (fun x => (f₂ x).1) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{s : Set E}
{f₂ : E → F × G}
(h : DifferentiableWithinAt 𝕜 f₂ s x)


theorem isPiSystem_image_Iic (s : Set α) : IsPiSystem (Iic '' s)

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


@[simp]
theorem snd_smul [SMul S R] [SMul S A] (s : S) (x : Unitization R A) : (s • x).snd = s • x.snd

{S : Type u_2}
{R : Type u_3}
{A : Type u_4}
[SMul S R]
[SMul S A]
(s : S)
(x : Unitization R A)


@[simp]
theorem primeFactorsList_zero : primeFactorsList 0 = []


theorem chainHeight_add_le_chainHeight_add (s : Set α) (t : Set β) (n m : ℕ) :
    s.chainHeight + n ≤ t.chainHeight + m ↔
      ∀ l ∈ s.subchain, ∃ l' ∈ t.subchain, length l + n ≤ length l' + m

{α : Type u_1}
{β : Type u_2}
[LT α]
[LT β]
(s : Set α)
(t : Set β)
(n m : ℕ)

s.chainHeight + ↑n ≤ t.chainHeight + ↑m ↔ ∀ l ∈ s.subchain, ∃ l' ∈ t.subchain, l.length + n ≤ l'.length + m


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

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


/-- If `e : S₁ ≅ S₂` is an isomorphism of short complexes and `h₁ : HomologyData S₁`,
this is the homology data for `S₂` deduced from the isomorphism. -/
@[simps!]
noncomputable def ofIso (e : S₁ ≅ S₂) (h : HomologyData S₁)

(CategoryTheory.ShortComplex.HomologyData.ofIso e h).left.i = CategoryTheory.CategoryStruct.comp h.left.i e.hom.τ₂


@[simp]
theorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
{a b : A}

(LinearMap.mul' R A) (a ⊗ₜ[R] b) = a * b


@[simp]
theorem toTrivSqZeroExt_ι (x : M) [Module Rᵐᵒᵖ M] [IsCentralScalar R M] :
    toTrivSqZeroExt (ι R x) = TrivSqZeroExt.inr x

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
(x : M)
[Module Rᵐᵒᵖ M]
[IsCentralScalar R M]

TensorAlgebra.toTrivSqZeroExt ((TensorAlgebra.ι R) x) = TrivSqZeroExt.inr x


@[simp]
lemma zeroLocus_empty_eq_univ {U : Opens X} :
    X.zeroLocus (∅ : Set (X.presheaf.obj (op U))) = Set.univ

{U : TopologicalSpace.Opens ↑↑X.toPresheafedSpace}


/-- The type of `Γ₀`-valued valuations on `R`.

When you extend this structure, make sure to extend `ValuationClass`. -/
structure Valuation extends R →*₀ Γ₀ where
  /-- The valuation of a a sum is less that the sum of the valuations -/
  map_add_le_max' : ∀ x y, toFun (x + y) ≤ max (toFun x) (toFun y)

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedCommMonoidWithZero Γ₀]
[Ring R]
(self : Valuation R Γ₀)
(x y : R)

(↑self.toMonoidWithZeroHom).toFun (x + y) ≤
  max ((↑self.toMonoidWithZeroHom).toFun x) ((↑self.toMonoidWithZeroHom).toFun y)


@[simp]
theorem coe_ne_top : (a : WithTop α) ≠ ⊤


@[simp]
theorem coe_eq_zero {z : 𝔻} : (z : ℂ) = 0 ↔ z = 0


@[simp high]
theorem SL_neg_smul (g : SL(2, ℤ)) (z : ℍ) : -g • z = g • z


@[simp]
theorem ack_le_iff_right {m n₁ n₂ : ℕ} : ack m n₁ ≤ ack m n₂ ↔ n₁ ≤ n₂


@[ext 1050]
lemma Pi.hom_ext {f : β → C} [HasProduct f] {X : C} (g₁ g₂ : X ⟶ ∏ᶜ f)
    (h : ∀ (b : β), g₁ ≫ Pi.π f b = g₂ ≫ Pi.π f b) : g₁ = g₂

(h : ∀ (b : β), g₁ ≫ CategoryTheory.Limits.Pi.π f b = g₂ ≫ CategoryTheory.Limits.Pi.π f b)


@[simp]
lemma sectionsMap_comp {M N P : PresheafOfModules.{v} R} (f : M ⟶ N) (g : N ⟶ P) (s : M.sections) :
    sectionsMap (f ≫ g) s = sectionsMap g (sectionsMap f s)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
{M N P : PresheafOfModules R}
(f : M ⟶ N)
(g : N ⟶ P)
(s : M.sections)

PresheafOfModules.sectionsMap (f ≫ g) s = PresheafOfModules.sectionsMap g (PresheafOfModules.sectionsMap f s)