theorem map_unop_mul (M N : Submodule R Aᵐᵒᵖ) :
    map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) (M * N) =
      map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) N *
        map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) M

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M N : Submodule R Aᵐᵒᵖ)

Submodule.map (↑(MulOpposite.opLinearEquiv R).symm) (M * N) =
  Submodule.map (↑(MulOpposite.opLinearEquiv R).symm) N * Submodule.map (↑(MulOpposite.opLinearEquiv R).symm) M


/-- Given a box `I₀` in `ℝⁿ⁺¹`, `f x : Box (Fin n) → G` is a family of functions indexed by a real
`x` and for `x ∈ [I₀.lower i, I₀.upper i]`, `f x` is box-additive on subboxes of the `i`-th face of
`I₀`, then `fun J ↦ f (J.upper i) (J.face i) - f (J.lower i) (J.face i)` is box-additive on subboxes
of `I₀`. -/
@[simps!]
def upperSubLower.{u} {G : Type u} [AddCommGroup G] (I₀ : Box (Fin (n + 1))) (i : Fin (n + 1))
    (f : ℝ → Box (Fin n) → G) (fb : Icc (I₀.lower i) (I₀.upper i) → Fin n →ᵇᵃ[I₀.face i] G)
    (hf : ∀ (x) (hx : x ∈ Icc (I₀.lower i) (I₀.upper i)) (J), f x J = fb ⟨x, hx⟩ J) :
    Fin (n + 1) →ᵇᵃ[I₀] G

(fb : ↑(Set.Icc (I₀.lower i) (I₀.upper i)) → BoxIntegral.BoxAdditiveMap (Fin n) G ↑(I₀.face i))

(hf : ∀ (x : ℝ) (hx : x ∈ Set.Icc (I₀.lower i) (I₀.upper i)) (J : BoxIntegral.Box (Fin n)), f x J = (fb ⟨x, hx⟩) J)

(BoxIntegral.BoxAdditiveMap.upperSubLower I₀ i f fb hf) J = f (J.upper i) (J.face i) - f (J.lower i) (J.face i)


theorem coeff_natTrailingDegree_eq_zero_of_trailingDegree_lt
    (h : trailingDegree p < trailingDegree q) : coeff q (natTrailingDegree p) = 0

(h : p.trailingDegree < q.trailingDegree)


@[simp]
theorem sum_bernoulli (n : ℕ) :
    (∑ k ∈ range n, (n.choose k : ℚ) * bernoulli k) = if n = 1 then 1 else 0

∑ k ∈ Finset.range n, ↑(n.choose k) * bernoulli k = if n = 1 then 1 else 0


{α : Type u_1}
[Preorder α]
(a : WithZero α)


@[to_additive (attr := simp)]
theorem dist_self_mul_right (a b : E) : dist a (a * b) = ‖b‖

{E : Type u_3}
[SeminormedCommGroup E]
(a b : E)


@[simp]
theorem inv_whiskerRight {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c) [IsIso η] :
    inv (η ▷ h) = inv η ▷ h

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
{f g : a ⟶ b}
(η : f ⟶ g)
(h : b ⟶ c)
[CategoryTheory.IsIso η]

CategoryTheory.inv (CategoryTheory.Bicategory.whiskerRight η h) =
  CategoryTheory.Bicategory.whiskerRight (CategoryTheory.inv η) h


/-- A given word `w` belongs to the language generated by a given context-free grammar `g` iff
`g` can derive the word `w` (wrapped as a string) from the initial nonterminal of `g` in some
number of steps. -/
@[simp]
lemma mem_language_iff (g : ContextFreeGrammar.{uN} T) (w : List T) :
    w ∈ g.language ↔ g.Derives [Symbol.nonterminal g.initial] (List.map Symbol.terminal w)

{T : Type uT}
(g : ContextFreeGrammar T)
(w : List T)


theorem Int.natAbs_eq_iff_associated {a b : ℤ} : a.natAbs = b.natAbs ↔ Associated a b


protected theorem dvd_of_mul_dvd_mul_right (kpos : 0 < k) (H : m * k ∣ n * k) : m ∣ n

{k m n : Nat}
(kpos : 0 < k)
(H : m * k ∣ n * k)


/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm 𝕜 E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm 𝕜 E) (E → ℝ)

(𝕜 : Type u_3)
(E : Type u_7)
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]

∀ (a : Seminorm 𝕜 E) (a_1 : E), (Seminorm.coeFnAddMonoidHom 𝕜 E) a a_1 = a a_1


@[simp]
theorem uncurryBilinear_apply (f : E →L[𝕜] F →L[𝕜] G) (m : Fin 2 → E × F) :
    f.uncurryBilinear m = f (m 0).1 (m 1).2

{𝕜 : 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]
(f : E →L[𝕜] F →L[𝕜] G)
(m : Fin 2 → E × F)

f.uncurryBilinear m = (f (m 0).1) (m 1).2


/-- This theorem is not intended to be used directly because it is rare for a set alone to
satisfy `[TietzeExtension t]`. For example, `Metric.ball` in `ℝ` only satisfies it when
the radius is strictly positive, so finding this as an instance will fail.

Instead, it is intended to be used as a constructor for theorems about sets which *do* satisfy
`[TietzeExtension t]` under some hypotheses. -/
theorem ContinuousMap.exists_forall_mem_restrict_eq {Y : Type v} [TopologicalSpace Y] (f : C(s, Y))
    {t : Set Y} (hf : ∀ x, f x ∈ t) [ht : TietzeExtension.{u, v} t] :
    ∃ (g : C(X, Y)), (∀ x, g x ∈ t) ∧ g.restrict s = f

{X : Type u}
[TopologicalSpace X]
[NormalSpace X]
{s : Set X}
(hs : IsClosed s)
{Y : Type v}
[TopologicalSpace Y]
(f : C(↑s, Y))
{t : Set Y}
(hf : ∀ (x : ↑s), f x ∈ t)
[ht : TietzeExtension ↑t]

∃ g, (∀ (x : X), g x ∈ t) ∧ ContinuousMap.restrict s g = f


/-- An algebra is integral if every element of the extension is integral over the base ring. -/
protected class Algebra.IsIntegral : Prop :=
  isIntegral : ∀ x : A, IsIntegral R x

{R : Type u_1}
{A : Type u_3}
[CommRing R]
[Ring A]
[Algebra R A]
[self : Algebra.IsIntegral R A]
(x : A)


/-- We say that the action of `M` on `α` has `MeasurableVAdd` if for each `c` the map `x ↦ c +ᵥ x`
is a measurable function and for each `x` the map `c ↦ c +ᵥ x` is a measurable function. -/
class MeasurableVAdd (M α : Type*) [VAdd M α] [MeasurableSpace M] [MeasurableSpace α] :
    Prop where
  measurable_const_vadd : ∀ c : M, Measurable (c +ᵥ · : α → α)
  measurable_vadd_const : ∀ x : α, Measurable (· +ᵥ x : M → α)

{M : Type u_2}
{α : Type u_3}
[VAdd M α]
[MeasurableSpace M]
[MeasurableSpace α]
[self : MeasurableVAdd M α]
(x : α)


theorem deriv_eq_id_of_nfp_eq_id {f : Ordinal → Ordinal} (h : nfp f = id) : deriv f = id

{f : Ordinal.{u_1} → Ordinal.{u_1}}
(h : Ordinal.nfp f = id)


@[simp]
theorem ker_rangeSRestrict (f : R →+* S) : ker f.rangeSRestrict = ker f

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

RingHom.ker f.rangeSRestrict = RingHom.ker f


lemma finrank_cotangentSpace_eq_zero_iff [IsNoetherianRing R] :
    finrank (ResidueField R) (CotangentSpace R) = 0 ↔ IsField R

{R : Type u_1}
[CommRing R]
[LocalRing R]
[IsNoetherianRing R]

FiniteDimensional.finrank (LocalRing.ResidueField R) (LocalRing.CotangentSpace R) = 0 ↔ IsField R


/-- **Euler's four-square identity**, a version for natural numbers. -/
theorem Nat.euler_four_squares (a b c d x y z w : ℕ) :
    ((a : ℤ) * x - b * y - c * z - d * w).natAbs ^ 2 +
      ((a : ℤ) * y + b * x + c * w - d * z).natAbs ^ 2 +
      ((a : ℤ) * z - b * w + c * x + d * y).natAbs ^ 2 +
      ((a : ℤ) * w + b * z - c * y + d * x).natAbs ^ 2 =
      (a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2 + w ^ 2)

(↑a * ↑x - ↑b * ↑y - ↑c * ↑z - ↑d * ↑w).natAbs ^ 2 + (↑a * ↑y + ↑b * ↑x + ↑c * ↑w - ↑d * ↑z).natAbs ^ 2 +
      (↑a * ↑z - ↑b * ↑w + ↑c * ↑x + ↑d * ↑y).natAbs ^ 2 +
    (↑a * ↑w + ↑b * ↑z - ↑c * ↑y + ↑d * ↑x).natAbs ^ 2 =
  (a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2 + w ^ 2)


theorem homMk_surjective {f f' : StructuredArrow S T} (φ : f ⟶ f') :
    ∃ (ψ : f.right ⟶ f'.right) (hψ : f.hom ≫ T.map ψ = f'.hom),
      φ = StructuredArrow.homMk ψ hψ

{f f' : CategoryTheory.StructuredArrow S T}

∃ ψ, ∃ (hψ : CategoryTheory.CategoryStruct.comp f.hom (T.map ψ) = f'.hom), φ = CategoryTheory.StructuredArrow.homMk ψ hψ


theorem sum {ι : Type*} (s : Finset ι) (φ : ι → MvPolynomial σ R) (n : ℕ)
    (h : ∀ i ∈ s, IsHomogeneous (φ i) n) : IsHomogeneous (∑ i ∈ s, φ i) n

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
{ι : Type u_5}
(s : Finset ι)
(φ : ι → MvPolynomial σ R)
(n : ℕ)
(h : ∀ i ∈ s, (φ i).IsHomogeneous n)


theorem eq_of_forall_dvd (h : ∀ c, a ∣ c ↔ b ∣ c) : a = b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a b : α}
[Subsingleton αˣ]
(h : ∀ (c : α), a ∣ c ↔ b ∣ c)


nonrec theorem cos_two_mul : cos (2 * x) = 2 * cos x ^ 2 - 1

Real.cos (2 * x) = 2 * Real.cos x ^ 2 - 1


theorem rel_of_liftRel {R : α → β → Prop} {ca cb} :
    LiftRel R ca cb → ∀ {a b}, a ∈ ca → b ∈ cb → R a b

{α : Type u}
{β : Type v}
{R : α → β → Prop}
{ca : Computation α}
{cb : Computation β}

Computation.LiftRel R ca cb → ∀ {a : α} {b : β}, a ∈ ca → b ∈ cb → R a b


lemma map_φ (n : ℤ) : (W.map f).φ n = (W.φ n).map (mapRingHom f)

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
(f : R →+* S)
(n : ℤ)

(W.map f).φ n = Polynomial.map (Polynomial.mapRingHom f) (W.φ n)


theorem norm_nonneg' (f : lp E p) : 0 ≤ ‖f‖

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
(f : ↥(lp E p))


/-- Note: this lemma is specifically about `Fintype.ofIsEmpty`. For a statement about
arbitrary `Fintype` instances, use `Fintype.card_eq_zero`. -/
@[simp]
theorem card_ofIsEmpty [IsEmpty α] : @Fintype.card α Fintype.ofIsEmpty = 0


/-- The equivalence between `FinBoolAlg` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : FinBoolAlg ≌ FinBoolAlg


@[simp]
theorem circulant_single_one (α n) [Zero α] [One α] [DecidableEq n] [AddGroup n] :
    circulant (Pi.single 0 1 : n → α) = (1 : Matrix n n α)

(α : Type u_6)
(n : Type u_7)
[Zero α]
[One α]
[DecidableEq n]
[AddGroup n]


/-- If the field `L` is an algebraic extension of the integral domain `A`,
the integral closure `C` of `A` in `L` has fraction field `L`. -/
theorem isFractionRing_of_algebraic [Algebra.IsAlgebraic A L]
    (inj : ∀ x, algebraMap A L x = 0 → x = 0) : IsFractionRing C L

(inj : ∀ (x : A), (algebraMap A L) x = 0 → x = 0)


lemma IsRatCondKernelCDFAux.tendsto_atBot_zero (hf : IsRatCondKernelCDFAux f κ ν) [IsFiniteKernel ν]
    (a : α) :
    ∀ᵐ t ∂(ν a), Tendsto (f (a, t)) atBot (𝓝 0)

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

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

∀ᵐ (t : β) ∂ν a, Filter.Tendsto (f (a, t)) Filter.atBot (𝓝 0)


@[symm]
theorem PreEnvelGroupRel.symm {R : Type u} [Rack R] {a b : PreEnvelGroup R} :
    PreEnvelGroupRel R a b → PreEnvelGroupRel R b a

{R : Type u}
[Rack R]
{a b : Rack.PreEnvelGroup R}

Rack.PreEnvelGroupRel R a b → Rack.PreEnvelGroupRel R b a


@[simp]
theorem prodLift_apply (f : α →. β) (g : α →. γ) (x : α) :
    f.prodLift g x = ⟨(f x).Dom ∧ (g x).Dom, fun h => ((f x).get h.1, (g x).get h.2)⟩

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α →. β)
(g : α →. γ)
(x : α)

f.prodLift g x = { Dom := (f x).Dom ∧ (g x).Dom, get := fun h => ((f x).get ⋯, (g x).get ⋯) }


theorem isRelPrime_of_no_irreducible_factors {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
    (H : ∀ z : α, Irreducible z → z ∣ x → ¬z ∣ y) : IsRelPrime x y

(H : ∀ (z : α), Irreducible z → z ∣ x → ¬z ∣ y)


@[simp]
lemma equivalence_counitIso_app (X : C₂) :
    (equivalence L₁ W₁ L₂ W₂ G G' F F' α β).counitIso.app (L₂.obj X) =
      (Lifting.iso L₂ W₂ (F ⋙ G') (F' ⋙ G')).app X ≪≫ β.app X

(W₁ : CategoryTheory.MorphismProperty C₁)

(W₂ : CategoryTheory.MorphismProperty C₂)

[CategoryTheory.Localization.Lifting L₁ W₁ G G']

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

(CategoryTheory.Localization.equivalence L₁ W₁ L₂ W₂ G G' F F' α β).counitIso.app (L₂.obj X) =
  (CategoryTheory.Localization.Lifting.iso L₂ W₂ (F.comp G') (F'.comp G')).app X ≪≫ β.app X


theorem iUnion₂_subset {s : ∀ i, κ i → Set α} {t : Set α} (h : ∀ i j, s i j ⊆ t) :
    ⋃ (i) (j), s i j ⊆ t

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}
{t : Set α}
(h : ∀ (i : ι) (j : κ i), s i j ⊆ t)


@[simp]
theorem degrees_X [Nontrivial R] (n : σ) : degrees (X n : MvPolynomial σ R) = {n}

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[Nontrivial R]
(n : σ)


theorem mem_pointwise_smul_iff_inv_smul_mem₀ {a : α} (ha : a ≠ 0) (S : AddSubmonoid A) (x : A) :
    x ∈ a • S ↔ a⁻¹ • x ∈ S

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[GroupWithZero α]
[DistribMulAction α A]
{a : α}
(ha : a ≠ 0)
(S : AddSubmonoid A)
(x : A)

x ∈ a • S ↔ a⁻¹ • x ∈ S


/-- The injective seminorm on `⨂[𝕜] i, Eᵢ`. Morally, it sends `x` in `⨂[𝕜] i, Eᵢ` to the
`sup` of the operator norms of the `PiTensorProduct.toDualContinuousMultilinearMap F x`, for all
normed vector spaces `F`. In fact, we only take in the same universe as `⨂[𝕜] i, Eᵢ`, and then
prove in `PiTensorProduct.norm_eval_le_injectiveSeminorm` that this gives the same result.
-/
noncomputable irreducible_def injectiveSeminorm : Seminorm 𝕜 (⨂[𝕜] i, E i)

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

PiTensorProduct.injectiveSeminorm =
  sSup
    {p |
      ∃ G x x_1,
        p =
          (normSeminorm 𝕜 (ContinuousMultilinearMap 𝕜 E G →L[𝕜] G)).comp
            (PiTensorProduct.toDualContinuousMultilinearMap G)}


@[simp]
theorem nodupKeys_nil : @NodupKeys α β []


theorem ReflTransGen.lift' {p : β → β → Prop} {a b : α} (f : α → β)
    (h : ∀ a b, r a b → ReflTransGen p (f a) (f b))
    (hab : ReflTransGen r a b) : ReflTransGen p (f a) (f b)

(h : ∀ (a b : α), r a b → Relation.ReflTransGen p (f a) (f b))


theorem norm_incl {V' : AddSubgroup V} (x : V') : ‖incl _ x‖ = ‖x‖

{V : Type u_1}
[SeminormedAddCommGroup V]
{V' : AddSubgroup V}
(x : ↥V')


theorem Icc_mem_nhdsWithin_Ioi' {a b : α} (H : a < b) : Icc a b ∈ 𝓝[>] a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(H : a < b)


@[to_additive]
theorem coe_ker (f : G →* M) : (f.ker : Set G) = (f : G → M) ⁻¹' {1}

{G : Type u_1}
[Group G]
{M : Type u_7}
[MulOneClass M]
(f : G →* M)


protected theorem IsMax.grade (h : IsMax a) : IsMax (grade 𝕆 a)

(𝕆 : Type u_1)
{α : Type u_3}
[Preorder 𝕆]
[Preorder α]
[GradeMaxOrder 𝕆 α]
{a : α}
(h : IsMax a)


@[to_additive (attr := simp)]
lemma op_smul [SMul α β] (a : α) (b : β) : op (a • b) = a • op b

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

AddOpposite.op (a +ᵥ b) = a +ᵥ AddOpposite.op b


theorem lt_add_one_iff {a b : Int} : a < b + 1 ↔ a ≤ b


lemma rank_le_finrank : rank R L ≤ finrank R L

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]

LieAlgebra.rank R L ≤ FiniteDimensional.finrank R L


@[simp]
theorem preimage_const_mul_Ioi_of_neg (a : α) {c : α} (h : c < 0) :
    (c * ·) ⁻¹' Ioi a = Iio (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a : α)
{c : α}
(h : c < 0)

(fun x => c * x) ⁻¹' Set.Ioi a = Set.Iio (a / c)


theorem pmap_eq_map (p : α → Prop) (f : α → β) (s : Multiset α) :
    ∀ H, @pmap _ _ p (fun a _ => f a) s H = map f s

{α : Type u_1}
{β : Type v}
(p : α → Prop)
(f : α → β)
(s : Multiset α)
(H : ∀ a ∈ s, p a)

Multiset.pmap (fun a x => f a) s H = Multiset.map f s


theorem fromLocalizedModule.surj : Function.Surjective <| fromLocalizedModule S f

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

Function.Surjective ⇑(IsLocalizedModule.fromLocalizedModule S f)


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


/-- A monotone map sends a least element of a set to a least element of its image. -/
theorem map_isLeast (Hf : MonotoneOn f t) (Ha : IsLeast t a) : IsLeast (f '' t) (f a)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{t : Set α}
{a : α}
(Hf : MonotoneOn f t)
(Ha : IsLeast t a)


theorem zeroLocus_mul_homogeneousIdeal (I J : HomogeneousIdeal 𝒜) :
    zeroLocus 𝒜 ((I * J : HomogeneousIdeal 𝒜) : Set A) = zeroLocus 𝒜 I ∪ zeroLocus 𝒜 J

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(I J : HomogeneousIdeal 𝒜)

ProjectiveSpectrum.zeroLocus 𝒜 ↑(I * J) = ProjectiveSpectrum.zeroLocus 𝒜 ↑I ∪ ProjectiveSpectrum.zeroLocus 𝒜 ↑J


@[simp]
theorem sInf_toSubfield (S : Set (IntermediateField F E)) :
    (sInf S).toSubfield = sInf (toSubfield '' S)

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

(sInf S).toSubfield = sInf (IntermediateField.toSubfield '' S)


@[simp]
theorem Basis.det_comp_basis [Module A M'] (b : Basis ι A M) (b' : Basis ι A M') (f : M →ₗ[A] M') :
    b'.det (f ∘ b) = LinearMap.det (f ∘ₗ (b'.equiv b (Equiv.refl ι) : M' →ₗ[A] M))

{M : Type u_2}
[AddCommGroup M]
{M' : Type u_3}
[AddCommGroup M']
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
{A : Type u_5}
[CommRing A]
[Module A M]
[Module A M']
(b : Basis ι A M)
(b' : Basis ι A M')
(f : M →ₗ[A] M')

b'.det (⇑f ∘ ⇑b) = LinearMap.det (f ∘ₗ ↑(b'.equiv b (Equiv.refl ι)))


@[simp] theorem zero_imK : (0 : ℍ[R,c₁,c₂]).imK = 0


theorem _root_.Finset.esymm_map_val {σ} (f : σ → R) (s : Finset σ) (n : ℕ) :
    (s.val.map f).esymm n = (s.powersetCard n).sum fun t => t.prod f

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

(Multiset.map f s.val).esymm n = ∑ t ∈ Finset.powersetCard n s, t.prod f


@[to_additive (attr := simp)]
theorem red_invRev_iff : Red (invRev L₁) (invRev L₂) ↔ Red L₁ L₂

FreeGroup.Red (FreeGroup.invRev L₁) (FreeGroup.invRev L₂) ↔ FreeGroup.Red L₁ L₂


theorem card_support_swap {x y : α} (hxy : x ≠ y) : (swap x y).support.card = 2

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{x y : α}
(hxy : x ≠ y)


/-- If `L : C ⥤ D` is a localization for `W : MorphismProperty C`, then it is also
the case of a functor obtained by post-composing `L` with an equivalence of categories. -/
theorem of_equivalence_target {E : Type*} [Category E] (L' : C ⥤ E) (eq : D ≌ E)
    [L.IsLocalization W] (e : L ⋙ eq.functor ≅ L') : L'.IsLocalization W

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_7, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
{E : Type u_4}
[CategoryTheory.Category.{u_5, u_4} E]
(L' : CategoryTheory.Functor C E)
(eq : D ≌ E)
[L.IsLocalization W]
(e : L.comp eq.functor ≅ L')


theorem dedup_eq_self {s : Multiset α} : dedup s = s ↔ Nodup s

{α : Type u_1}
[DecidableEq α]
{s : Multiset α}


theorem count_not_le_count_add_one (hl : Chain' (· ≠ ·) l) (b : Bool) :
    count (!b) l ≤ count b l + 1

(hl : List.Chain' (fun x x_1 => x ≠ x_1) l)


@[to_additive vadd.instNeBot]
lemma smul.instNeBot [NeBot f] [NeBot g] : NeBot (f • g)

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter α}
{g : Filter β}
[f.NeBot]
[g.NeBot]


@[to_additive (attr := simp, aesop safe apply (rule_sets := [finsetNonempty]))]
theorem div_nonempty : (s / t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

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


@[simp]
theorem map_wittStructureInt (Φ : MvPolynomial idx ℤ) (n : ℕ) :
    map (Int.castRingHom ℚ) (wittStructureInt p Φ n) =
      wittStructureRat p (map (Int.castRingHom ℚ) Φ) n

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

(MvPolynomial.map (Int.castRingHom ℚ)) (wittStructureInt p Φ n) =
  wittStructureRat p ((MvPolynomial.map (Int.castRingHom ℚ)) Φ) n


theorem natCast_fin_three (n : ℕ) :
    (n : Matrix (Fin 3) (Fin 3) α) = !![↑n, 0, 0; 0, ↑n, 0; 0, 0, ↑n]

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)


@[simp] lemma floorRoot_one_left (a : ℕ) : floorRoot 1 a = a


theorem zero_rpow_eq_iff {x : ℝ} {a : ℝ} : 0 ^ x = a ↔ x ≠ 0 ∧ a = 0 ∨ x = 0 ∧ a = 1


@[simp]
protected theorem inv_lt_inv : a⁻¹ < b⁻¹ ↔ b < a


/-- A function is integrable for the counting measure iff its norm is summable. -/
lemma integrable_count_iff :
    Integrable f Measure.count ↔ Summable (‖f ·‖)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[NormedAddCommGroup β]
[MeasurableSingletonClass α]
{f : α → β}

MeasureTheory.Integrable f MeasureTheory.Measure.count ↔ Summable fun x => ‖f x‖


theorem Mem.mk {α : Type u} (A : α → PSet) (a : α) : A a ∈ mk α A


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

(CategoryTheory.coprodMonad X).μ.app Y =
  CategoryTheory.Limits.coprod.desc CategoryTheory.Limits.coprod.inl (CategoryTheory.CategoryStruct.id (X ⨿ Y))


@[simp]
theorem comp_toFunctor (f : M →* N) {P : Type w} [Monoid P] (g : N →* P) :
    (g.comp f).toFunctor = f.toFunctor ⋙ g.toFunctor

{M : Type u}
{N : Type v}
[Monoid M]
[Monoid N]
(f : M →* N)
{P : Type w}
[Monoid P]
(g : N →* P)


theorem eq (H K : Subgroup G) (a b : G) :
    mk H K a = mk H K b ↔ ∃ h ∈ H, ∃ k ∈ K, b = h * a * k

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

Doset.mk H K a = Doset.mk H K b ↔ ∃ h ∈ H, ∃ k ∈ K, b = h * a * k


theorem hasConstantSpeedOnWith_iff_ordered :
    HasConstantSpeedOnWith f s l ↔ ∀ ⦃x⦄ (_ : x ∈ s) ⦃y⦄ (_ : y ∈ s),
      x ≤ y → eVariationOn f (s ∩ Icc x y) = ENNReal.ofReal (l * (y - x))

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{s : Set ℝ}
{l : ℝ≥0}

HasConstantSpeedOnWith f s l ↔
  ∀ ⦃x : ℝ⦄, x ∈ s → ∀ ⦃y : ℝ⦄, y ∈ s → x ≤ y → eVariationOn f (s ∩ Set.Icc x y) = ENNReal.ofReal (↑l * (y - x))


@[norm_cast] lemma coe_floorDiv (f : ι →₀ β) (a : α) : f ⌊/⌋ a = fun i ↦ f i ⌊/⌋ a

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[FloorDiv α β]
(f : ι →₀ β)
(a : α)


@[simp low] theorem not_forall {p : α → Prop} : (¬∀ x, p x) ↔ ∃ x, ¬p x


/-- `x^m`, `m : ℤ` is convex on `(0, +∞)` for all `m` except `0` and `1`. -/
theorem strictConvexOn_zpow {m : ℤ} (hm₀ : m ≠ 0) (hm₁ : m ≠ 1) :
    StrictConvexOn ℝ (Ioi 0) fun x : ℝ => x ^ m

StrictConvexOn ℝ (Set.Ioi 0) fun x => x ^ m


theorem count_injective_image [MeasurableSingletonClass α] [MeasurableSingletonClass β] {f : β → α}
    (hf : Function.Injective f) (s : Set β) : count (f '' s) = count s

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSingletonClass α]
[MeasurableSingletonClass β]
{f : β → α}
(hf : Function.Injective f)
(s : Set β)

MeasureTheory.Measure.count (f '' s) = MeasureTheory.Measure.count s


theorem linearIndependent_sum {v : ι ⊕ ι' → M} :
    LinearIndependent R v ↔
      LinearIndependent R (v ∘ Sum.inl) ∧
        LinearIndependent R (v ∘ Sum.inr) ∧
          Disjoint (Submodule.span R (range (v ∘ Sum.inl)))
            (Submodule.span R (range (v ∘ Sum.inr)))

{ι : Type u'}
{ι' : Type u_1}
{R : Type u_2}
{M : Type u_4}
[Ring R]
[AddCommGroup M]
[Module R M]
{v : ι ⊕ ι' → M}

LinearIndependent R v ↔
  LinearIndependent R (v ∘ Sum.inl) ∧
    LinearIndependent R (v ∘ Sum.inr) ∧
      Disjoint (Submodule.span R (Set.range (v ∘ Sum.inl))) (Submodule.span R (Set.range (v ∘ Sum.inr)))


@[simp]
theorem realize_foldr_sup (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊔ ·) ⊥).Realize v xs ↔ ∃ φ ∈ l, BoundedFormula.Realize φ v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n : ℕ}
(l : List (L.BoundedFormula α n))
(v : α → M)
(xs : Fin n → M)

(List.foldr (fun x x_1 => x ⊔ x_1) ⊥ l).Realize v xs ↔ ∃ φ ∈ l, φ.Realize v xs


theorem exists_associated_pow_of_mul_eq_pow [GCDMonoid α] {a b c : α} (hab : IsUnit (gcd a b))
    {k : ℕ} (h : a * b = c ^ k) : ∃ d : α, Associated (d ^ k) a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{a b c : α}
(hab : IsUnit (gcd a b))
{k : ℕ}
(h : a * b = c ^ k)


@[simp]
theorem inter_cons_of_not_mem (l₁ : List α) (h : a ∉ l₂) : (a :: l₁) ∩ l₂ = l₁ ∩ l₂

{α : Type u_1}
{l₂ : List α}
{a : α}
[DecidableEq α]
(l₁ : List α)
(h : ¬a ∈ l₂)


theorem Irreducible.coprime_or_dvd {p : R} (hp : Irreducible p) (i : R) : IsCoprime p i ∨ p ∣ i

{R : Type u}
[CommRing R]
[IsBezout R]
{p : R}
(hp : Irreducible p)
(i : R)


/-- The Legendre symbol of `a^2` at `p` is 1 if `p ∤ a`. -/
theorem sq_one' {a : ℤ} (ha : (a : ZMod p) ≠ 0) : legendreSym p (a ^ 2) = 1

(p : ℕ)
[Fact (Nat.Prime p)]
{a : ℤ}
(ha : ↑a ≠ 0)


/-- An auxiliary type for the proof of Urysohn's lemma: a pair of a closed set `C` and its
open neighborhood `U`, together with the assumption that `C` satisfies the property `P C`. The
latter assumption will make it possible to prove simultaneously both versions of Urysohn's lemma,
in normal spaces (with `P` always true) and in locally compact spaces (with `P = IsCompact`).
We put also in the structure the assumption that, for any such pair, one may find an intermediate
pair inbetween satisfying `P`, to avoid carrying it around in the argument. -/
structure CU {X : Type*} [TopologicalSpace X] (P : Set X → Prop) where
  /-- The inner set in the inductive construction towards Urysohn's lemma -/
  protected C : Set X
  /-- The outer set in the inductive construction towards Urysohn's lemma -/
  protected U : Set X
  protected P_C : P C
  protected closed_C : IsClosed C
  protected open_U : IsOpen U
  protected subset : C ⊆ U
  protected hP : ∀ {c u : Set X}, IsClosed c → P c → IsOpen u → c ⊆ u →
    ∃ v, IsOpen v ∧ c ⊆ v ∧ closure v ⊆ u ∧ P (closure v)

{X : Type u_2}
[TopologicalSpace X]
{P : Set X → Prop}
(self : Urysohns.CU P)


@[to_additive (attr := simp)]
theorem toEquiv_mulLeft (g : G) : (mulLeft g).toEquiv = Equiv.mulLeft g

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(g : G)

(MeasurableEquiv.addLeft g).toEquiv = Equiv.addLeft g


theorem hasFiniteIntegral_of_bounded [IsFiniteMeasure μ] {f : α → β} {C : ℝ}
    (hC : ∀ᵐ a ∂μ, ‖f a‖ ≤ C) : HasFiniteIntegral f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
[MeasureTheory.IsFiniteMeasure μ]
{f : α → β}
{C : ℝ}
(hC : ∀ᵐ (a : α) ∂μ, ‖f a‖ ≤ C)


theorem toSubsemiring_injective :
    Function.Injective (toSubsemiring : StarSubsemiring R → Subsemiring R)

{R : Type v}
[NonAssocSemiring R]
[StarRing R]


lemma top_div_of_pos_ne_top {a : EReal} (h : 0 < a) (h' : a ≠ ⊤) : ⊤ / a = ⊤


@[simp]
lemma ofNat_lt_toNNReal {r : ℝ} {n : ℕ} [n.AtLeastTwo] :
    no_index (OfNat.ofNat n) < r.toNNReal ↔ n < r


/-- Let $L$ be the graph Laplacian and let $x \in \mathbb{R}$, then
$$x^{\top} L x = \sum_{i \sim j} (x_{i}-x_{j})^{2}$$,
where $\sim$ denotes the adjacency relation -/
theorem lapMatrix_toLinearMap₂' [Field R] [CharZero R] (x : V → R) :
    toLinearMap₂' R (G.lapMatrix R) x x =
    (∑ i : V, ∑ j : V, if G.Adj i j then (x i - x j)^2 else 0) / 2

{V : Type u_1}
(R : Type u_2)
[Fintype V]
[DecidableEq V]
(G : SimpleGraph V)
[DecidableRel G.Adj]
[Field R]
[CharZero R]
(x : V → R)

(((Matrix.toLinearMap₂' R) (SimpleGraph.lapMatrix R G)) x) x =
  (∑ i : V, ∑ j : V, if G.Adj i j then (x i - x j) ^ 2 else 0) / 2


lemma cosZeta_neg (a : UnitAddCircle) (s : ℂ) :
    cosZeta (-a) s = cosZeta a s

HurwitzZeta.cosZeta (-a) s = HurwitzZeta.cosZeta a s


@[simp, push_cast]
theorem nnnorm_eq_hammingNorm [∀ i, AddCommGroup (β i)] (x : Hamming β) :
    ‖x‖₊ = hammingNorm (ofHamming x)

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

‖x‖₊ = ↑(hammingNorm (Hamming.ofHamming x))


theorem antidiagonalTuple_two (n : ℕ) :
    antidiagonalTuple 2 n = (antidiagonal n).map fun i => ![i.1, i.2]

List.Nat.antidiagonalTuple 2 n = List.map (fun i => ![i.1, i.2]) (List.Nat.antidiagonal n)


theorem rightZigzag_idempotent_of_left_triangle
    (η : 𝟙 a ⟶ f ≫ g) (ε : g ≫ f ⟶ 𝟙 b) (h : leftZigzag η ε = (λ_ _).hom ≫ (ρ_ _).inv) :
    rightZigzag η ε ⊗≫ rightZigzag η ε = rightZigzag η ε

(η : CategoryTheory.CategoryStruct.id a ⟶ CategoryTheory.CategoryStruct.comp f g)

(ε : CategoryTheory.CategoryStruct.comp g f ⟶ CategoryTheory.CategoryStruct.id b)

(h :
  CategoryTheory.Bicategory.leftZigzag η ε =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor f).hom
      (CategoryTheory.Bicategory.rightUnitor f).inv)

CategoryTheory.bicategoricalComp (CategoryTheory.Bicategory.rightZigzag η ε)
    (CategoryTheory.Bicategory.rightZigzag η ε) =
  CategoryTheory.Bicategory.rightZigzag η ε


theorem Sbtw.left_ne_right {x y z : P} (h : Sbtw R x y z) : x ≠ z

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


theorem count_bind [DecidableEq α] {m : Multiset β} {f : β → Multiset α} {a : α} :
    count a (bind m f) = sum (m.map fun b => count a <| f b)

{α : Type u_1}
{β : Type v}
[DecidableEq α]
{m : Multiset β}
{f : β → Multiset α}
{a : α}

Multiset.count a (m.bind f) = (Multiset.map (fun b => Multiset.count a (f b)) m).sum


protected theorem iff_le_add_mul {f : α → ℝ} {K : ℝ≥0} :
    LipschitzWith K f ↔ ∀ x y, f x ≤ f y + K * dist x y

{α : Type u}
[PseudoMetricSpace α]
{f : α → ℝ}
{K : ℝ≥0}

LipschitzWith K f ↔ ∀ (x y : α), f x ≤ f y + ↑K * dist x y


@[simp] theorem lt_succ_self (n : Nat) : n < succ n


/-- An element of a group acting on a Type is regular. This relies on the availability
of the inverse given by groups, since there is no `LeftCancelSMul` typeclass. -/
theorem isSMulRegular_of_group [MulAction G R] (g : G) : IsSMulRegular R g

{R : Type u_1}
{G : Type u_4}
[Group G]
[MulAction G R]
(g : G)


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

{M : Type u_1}
[AddCommMonoid M]
(S : AddSubmonoid M)
(hS : S ≤ IsAddUnit.addSubmonoid M)
(x : ↥S)

S.fromLeftNeg ((S.leftNegEquiv hS).symm x) = x


/-- Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover
of a proper metric space by nonempty open balls can be shrunk to a new cover by nonempty open balls
so that each of the new balls has strictly smaller radius than the old one. -/
theorem exists_iUnion_ball_eq_radius_pos_lt {r : ι → ℝ} (hr : ∀ i, 0 < r i)
    (uf : ∀ x, { i | x ∈ ball (c i) (r i) }.Finite) (uU : ⋃ i, ball (c i) (r i) = univ) :
    ∃ r' : ι → ℝ, ⋃ i, ball (c i) (r' i) = univ ∧ ∀ i, r' i ∈ Ioo 0 (r i)

(uf : ∀ (x : α), {i | x ∈ Metric.ball (c i) (r i)}.Finite)

(uU : ⋃ i, Metric.ball (c i) (r i) = Set.univ)

∃ r', ⋃ i, Metric.ball (c i) (r' i) = Set.univ ∧ ∀ (i : ι), r' i ∈ Set.Ioo 0 (r i)


@[simp, norm_cast]
theorem coe_sub [∀ i, AddGroup (β i)] (g₁ g₂ : Π₀ i, β i) : ⇑(g₁ - g₂) = g₁ - g₂

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddGroup (β i)]
(g₁ g₂ : Π₀ (i : ι), β i)


theorem congr_fun (h : D1 = D2) (a : A) : D1 a = D2 a

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
{D1 D2 : Derivation R A M}
(h : D1 = D2)
(a : A)


theorem isNormal_iff_lt_succ_and_blsub_eq {f : Ordinal.{u} → Ordinal.{max u v}} :
    IsNormal f ↔ (∀ a, f a < f (succ a)) ∧
      ∀ o, IsLimit o → (blsub.{_, v} o fun x _ => f x) = f o

Ordinal.IsNormal f ↔
  (∀ (a : Ordinal.{u}), f a < f (Order.succ a)) ∧ ∀ (o : Ordinal.{u}), o.IsLimit → (o.blsub fun x x_1 => f x) = f o


/-- From a natural transformation `α : G → F` we get a functor from
algebras of `F` to algebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : G ⟶ F) : Algebra F ⥤ Algebra G

(A : CategoryTheory.Endofunctor.Algebra F)

((CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α).obj A).str =
  CategoryTheory.CategoryStruct.comp (α.app A.a) A.str


@[to_additive]
theorem smul_Lp_ae_eq (c : Mᵈᵐᵃ) (f : Lp E p μ) : c • f =ᵐ[μ] (f <| mk.symm c • ·)

[MeasureTheory.SMulInvariantMeasure M α μ]

↑↑(c • f) =ᵐ[μ] fun x => ↑↑f (DomMulAct.mk.symm c • x)


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

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

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

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

(h.compLeft ψ).h₀ = CategoryTheory.CategoryStruct.comp ψ.τ₁ h.h₀


@[simp] lemma neg_one_pow_mul_eq_zero_iff : (-1) ^ n * a = 0 ↔ a = 0


protected theorem map_list_prod (L : List R[X]) : L.prod.map f = (L.map <| map f).prod

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

Polynomial.map f L.prod = (List.map (Polynomial.map f) L).prod


theorem and_iff_not_or_not : a ∧ b ↔ ¬(¬a ∨ ¬b)

a ∧ b ↔ ¬(¬a ∨ ¬b)


theorem const (x : σ) : Primrec₂ fun (_ : α) (_ : β) => x

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
(x : σ)


theorem Finite.of_surjective {α β : Sort*} [Finite α] (f : α → β) (H : Surjective f) : Finite β

{α : Sort u_4}
{β : Sort u_5}
[Finite α]
(f : α → β)
(H : Function.Surjective f)


/-- A function `f` from `Finset α` is strictly monotone if and only if `f s < f (cons a s ha)` for
all `s` and `a ∉ s`. -/
lemma strictMono_iff_forall_lt_cons : StrictMono f ↔ ∀ s ⦃a⦄ ha, f s < f (cons a s ha)

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f : Finset α → β}

StrictMono f ↔ ∀ (s : Finset α) ⦃a : α⦄ (ha : a ∉ s), f s < f (Finset.cons a s ha)


@[simp]
theorem _root_.Basis.coe_toOrthonormalBasis_repr (v : Basis ι 𝕜 E) (hv : Orthonormal 𝕜 v) :
    ((v.toOrthonormalBasis hv).repr : E → EuclideanSpace 𝕜 ι) = v.equivFun

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
(v : Basis ι 𝕜 E)
(hv : Orthonormal 𝕜 ⇑v)

⇑(v.toOrthonormalBasis hv).repr = ⇑v.equivFun


@[simp]
theorem map_refl : map (OrderIso.refl α) = OrderIso.refl _

UpperSet.map (OrderIso.refl α) = OrderIso.refl (UpperSet α)


@[simp]
lemma integrable_add_iff_integrable_right {f g : α → β} (hf : Integrable f μ) :
    Integrable (f + g) μ ↔ Integrable g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f g : α → β}
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (f + g) μ ↔ MeasureTheory.Integrable g μ


/-- When the affine space is also a vector space, the affine span is contained within the linear
span. -/
lemma affineSpan_le_toAffineSubspace_span {s : Set V} :
    affineSpan k s ≤ (Submodule.span k s).toAffineSubspace

{k : Type u_1}
{V : Type u_2}
[Ring k]
[AddCommGroup V]
[Module k V]
{s : Set V}


theorem Pairwise.perm {R : α → α → Prop} {l l' : List α} (hR : l.Pairwise R) (hl : l ~ l')
    (hsymm : ∀ {x y}, R x y → R y x) : l'.Pairwise R

{α : Type u_1}
{R : α → α → Prop}
{l l' : List α}
(hR : List.Pairwise R l)
(hl : l ~ l')
(hsymm : ∀ {x y : α}, R x y → R y x)


/-- The functor sending an object `X` in the comma category to `X.right`. -/
@[simps]
def snd : Comma L R ⥤ B

{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} (f : X ⟶ Y), (CategoryTheory.Comma.snd L R).map f = f.right


@[reassoc (attr := simp)] lemma w₀₂_τ₃ : S.v₀₁.τ₃ ≫ S.v₁₂.τ₃ = 0

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp S.v₀₁.τ₃ S.v₁₂.τ₃ = 0


theorem lpMeas.ae_eq_zero_of_forall_setIntegral_eq_zero (hm : m ≤ m0) (f : lpMeas E' 𝕜 m p μ)
    (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    -- Porting note: needed to add explicit casts in the next two hypotheses
    (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn (f : Lp E' p μ) s μ)
    (hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, (f : Lp E' p μ) x ∂μ = 0) :
    f =ᵐ[μ] (0 : α → E')

(f : ↥(MeasureTheory.lpMeas E' 𝕜 m p μ))

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

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

↑↑↑f =ᵐ[μ] 0


@[simp, elementwise, reassoc]
theorem restrictStalkIso_inv_eq_germ {U : TopCat} (X : PresheafedSpace.{_, _, v} C)
    {f : U ⟶ (X : TopCat.{v})} (h : OpenEmbedding f) (V : Opens U) (x : U) (hx : x ∈ V) :
    X.presheaf.germ ⟨f x, show f x ∈ h.isOpenMap.functor.obj V from ⟨x, hx, rfl⟩⟩ ≫
        (restrictStalkIso X h x).inv =
      (X.restrict h).presheaf.germ ⟨x, hx⟩

(X : AlgebraicGeometry.PresheafedSpace C)

X.presheaf.germ ⟨f x, ⋯⟩ ≫ (X.restrictStalkIso h x).inv = (X.restrict h).presheaf.germ ⟨x, hx⟩


/-- If the domain of a `DenseEmbedding` is a separable space, then so is its codomain. -/
protected theorem separableSpace [SeparableSpace α] : SeparableSpace β

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{e : α → β}
(de : DenseEmbedding e)
[TopologicalSpace.SeparableSpace α]


theorem lt_iff_le_and_lf {x y : PGame} : x < y ↔ x ≤ y ∧ x ⧏ y


/-- A ring `R` has Krull dimension at most one if all nonzero prime ideals are maximal. -/
class Ring.DimensionLEOne : Prop :=
  (maximalOfPrime : ∀ {p : Ideal R}, p ≠ ⊥ → p.IsPrime → p.IsMaximal)

{R : Type u_1}
[CommRing R]
[self : Ring.DimensionLEOne R]
{p : Ideal R}


@[simp]
theorem ciSup_of_empty [IsEmpty ι] (f : ι → α) : ⨆ i, f i = ⊥

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLinearOrderBot α]
[IsEmpty ι]
(f : ι → α)


/-- The image of a closed ball under addition with a singleton is another closed ball. -/
theorem vadd_closedBall (p : Seminorm 𝕜 E) : x +ᵥ p.closedBall y r = p.closedBall (x +ᵥ y) r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
{x y : E}
{r : ℝ}
(p : Seminorm 𝕜 E)


@[to_additive (attr := simp)]
theorem coprodAssoc_apply_inl_inr (x : N) : coprodAssoc M N P (inl (inr x)) = inr (inl x)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddMonoid M]
[AddMonoid N]
[AddMonoid P]
(x : N)

(AddMonoid.MulEquiv.coprodAssoc M N P) (AddMonoid.Coprod.inl (AddMonoid.Coprod.inr x)) =
  AddMonoid.Coprod.inr (AddMonoid.Coprod.inl x)


theorem lt_of_mul_lt_mul_left [PosMulReflectLT α] (h : a * b < a * c) (a0 : 0 ≤ a) : b < c

{α : Type u_1}
{a b c : α}
[Mul α]
[Zero α]
[Preorder α]
[PosMulReflectLT α]
(h : a * b < a * c)
(a0 : 0 ≤ a)


@[to_additive (attr := simp)]
theorem prod_mk [CommMonoid β] (s : Multiset α) (hs : s.Nodup) (f : α → β) :
    (⟨s, hs⟩ : Finset α).prod f = (s.map f).prod

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
(s : Multiset α)
(hs : s.Nodup)
(f : α → β)

{ val := s, nodup := hs }.prod f = (Multiset.map f s).prod


theorem supp_eq {α : Type u} (a : P.A) (f : P.B a → α) :
    @supp.{u} P.Obj _ α (⟨a, f⟩ : P α) = f '' univ

{P : PFunctor.{u}}
{α : Type u}
(a : P.A)
(f : P.B a → α)


theorem eq_of_mem_uIcc_of_mem_uIcc : a ∈ [[b, c]] → b ∈ [[a, c]] → a = b

{α : Type u_2}
[DistribLattice α]
[LocallyFiniteOrder α]
{a b c : α}


@[to_additive]
theorem lt_of_lt_mul_of_le_one_right [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α}
    (h : a < b * c) (hle : b ≤ 1) :
    a < c

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


theorem integrableOn_congr_fun_ae (hst : f =ᵐ[μ.restrict s] g) :
    IntegrableOn f s μ ↔ IntegrableOn g s μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f g : α → E}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hst : f =ᵐ[μ.restrict s] g)

MeasureTheory.IntegrableOn f s μ ↔ MeasureTheory.IntegrableOn g s μ


@[simp]
lemma piecewise_eq_of_mem {i : ι} (hi : i ∈ s) : s.piecewise f g i = f i

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


@[simp]
theorem erase_val (s : Finset α) (a : α) : (erase s a).1 = s.1.erase a

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


lemma lt_of_lt_pred (h : m < n - 1) : m < n


theorem subset_append_of_subset_left (l₂ : List α) : l ⊆ l₁ → l ⊆ l₁ ++ l₂

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


@[to_additive (attr := simp)]
theorem symm_mulLeft (g : G) : (mulLeft g).symm = mulLeft g⁻¹

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(g : G)

(MeasurableEquiv.addLeft g).symm = MeasurableEquiv.addLeft (-g)


theorem factorization_factorial_eq_zero_of_lt (h : n < p) : (factorial n).factorization p = 0


@[simp]
theorem coe_toFinset (l : List α) : (l : Cycle α).toFinset = l.toFinset

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


theorem inter_diff_distrib_right (s t u : Set α) : s \ t ∩ u = (s ∩ u) \ (t ∩ u)


/-- Taking the first `n` elements in `l₁ ++ l₂` is the same as appending the first `n` elements
of `l₁` to the first `n - l₁.length` elements of `l₂`. -/
theorem take_append_eq_append_take {l₁ l₂ : List α} {n : Nat} :
    take n (l₁ ++ l₂) = take n l₁ ++ take (n - l₁.length) l₂

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

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


theorem involute_eq_of_mem_even {x : CliffordAlgebra Q} (h : x ∈ evenOdd Q 0) : involute x = x

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
{x : CliffordAlgebra Q}
(h : x ∈ CliffordAlgebra.evenOdd Q 0)


@[simp] protected theorem sub_add_cancel (a b : Int) : a - b + b = a


@[measurability]
theorem AEMeasurable.coe_real_ereal {f : α → ℝ} {μ : Measure α} (hf : AEMeasurable f μ) :
    AEMeasurable (fun x => (f x : EReal)) μ

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ}
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable f μ)


theorem pi_pi_aux [∀ i, SigmaFinite (μ i)] (s : ∀ i, Set (α i)) (hs : ∀ i, MeasurableSet (s i)) :
    Measure.pi μ (pi univ s) = ∏ i, μ i (s i)

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

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

(MeasureTheory.Measure.pi μ) (Set.univ.pi s) = ∏ i : ι, (μ i) (s i)


theorem lowerSemicontinuousOn_univ_iff : LowerSemicontinuousOn f univ ↔ LowerSemicontinuous f

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}

LowerSemicontinuousOn f Set.univ ↔ LowerSemicontinuous f


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem toFinset_nonempty {s : Set α} [Fintype s] : s.toFinset.Nonempty ↔ s.Nonempty


theorem pos_of_dvd {a b : α} (hfin : Finite a b) (hdiv : a ∣ b) :
    0 < (multiplicity a b).get hfin

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
(hfin : multiplicity.Finite a b)
(hdiv : a ∣ b)


/-- The pushforward of sheaves of modules that is induced by a continuous functor `F`
and a morphism of sheaves of rings `φ : S ⟶ (F.sheafPushforwardContinuous RingCat J K).obj R`. -/
@[simps]
noncomputable def pushforward : SheafOfModules.{v} R ⥤ SheafOfModules.{v} S

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

(φ : S ⟶ (F.sheafPushforwardContinuous RingCat J K).obj R)

∀ {X Y : SheafOfModules R} (f : X ⟶ Y),
  ((SheafOfModules.pushforward φ).map f).val = (PresheafOfModules.pushforward φ.val).map f.val


@[to_additive prod_le_iff]
theorem prod_le_iff {s : Submonoid M} {t : Submonoid N} {u : Submonoid (M × N)} :
    s.prod t ≤ u ↔ s.map (inl M N) ≤ u ∧ t.map (inr M N) ≤ u

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{s : Submonoid M}
{t : Submonoid N}
{u : Submonoid (M × N)}

s.prod t ≤ u ↔ Submonoid.map (MonoidHom.inl M N) s ≤ u ∧ Submonoid.map (MonoidHom.inr M N) t ≤ u


/-- Continuity within a set at a point can be read under right composition with a local
homeomorphism, if the point is in its target -/
theorem continuousWithinAt_iff_continuousWithinAt_comp_right {f : Y → Z} {s : Set Y} {x : Y}
    (h : x ∈ e.target) :
    ContinuousWithinAt f s x ↔ ContinuousWithinAt (f ∘ e) (e ⁻¹' s) (e.symm x)

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
{f : Y → Z}
{s : Set Y}
{x : Y}
(h : x ∈ e.target)

ContinuousWithinAt f s x ↔ ContinuousWithinAt (f ∘ ↑e) (↑e ⁻¹' s) (↑e.symm x)


/-- If a global section is nilpotent on each member of a finite open cover, then `f` is
nilpotent. -/
lemma isNilpotent_of_isNilpotent_cover {X : Scheme.{u}} {U : X.Opens} (s : Γ(X, U))
    (𝒰 : X.OpenCover) [Finite 𝒰.J] (h : ∀ i : 𝒰.J, IsNilpotent ((𝒰.map i).app U s)) :
    IsNilpotent s

(h : ∀ (i : 𝒰.J), IsNilpotent ((AlgebraicGeometry.Scheme.Hom.app (𝒰.map i) U) s))


@[refl]
theorem SemanticallyEquivalent.refl (φ : L.BoundedFormula α n) : T.SemanticallyEquivalent φ φ

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
(φ : L.BoundedFormula α n)


@[simp]
lemma mk_fst (s : yoneda.obj X ⟶ A) (x : F.obj (op (CostructuredArrow.mk s))) : (mk s x).fst = s

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

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

(x : F.obj (Opposite.op (CategoryTheory.CostructuredArrow.mk s)))

(CategoryTheory.OverPresheafAux.YonedaCollection.mk s x).fst = s


@[simp]
theorem coe_neg (s : Cₛ^n⟮I; F, V⟯) : ⇑(-s : Cₛ^n⟮I; F, V⟯) = -s

[TopologicalSpace (Bundle.TotalSpace F V)]


theorem reindex_dioph (f : α → β) : Dioph S → Dioph {v | v ∘ f ∈ S}

{α : Type u}
(β : Type u)
{S : Set (α → ℕ)}
(f : α → β)


@[simp] lemma isSublattice_preimage_ofDual :
    IsSublattice (ofDual ⁻¹' s) ↔ IsSublattice s

IsSublattice (⇑OrderDual.ofDual ⁻¹' s) ↔ IsSublattice s


/-- A denumerable type is (constructively) bijective with `ℕ`. Typeclass equivalent of `α ≃ ℕ`. -/
class Denumerable (α : Type*) extends Encodable α where
  /-- `decode` and `encode` are inverses. -/
  decode_inv : ∀ n, ∃ a ∈ decode n, encode a = n

{α : Type u_3}
[self : Denumerable α]
(n : ℕ)

∃ a ∈ Encodable.decode n, Encodable.encode a = n


theorem X_eq_normalizeX : (X : k⟦X⟧) = normalize X


lemma rnDeriv_tilted_left_self [SigmaFinite μ] (hf : AEMeasurable f μ) :
    (μ.tilted f).rnDeriv μ =ᵐ[μ] fun x ↦ ENNReal.ofReal (exp (f x) / ∫ x, exp (f x) ∂μ)

{α : Type u_1}
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
[MeasureTheory.SigmaFinite μ]
(hf : AEMeasurable f μ)

(μ.tilted f).rnDeriv μ =ᵐ[μ] fun x => ENNReal.ofReal (rexp (f x) / ∫ (x : α), rexp (f x) ∂μ)


theorem iff_iff_not_or_and_or_not : (a ↔ b) ↔ (¬a ∨ b) ∧ (a ∨ ¬b)


/-- If `A` and `B` are isomorphic, then an ind-object presentation of `A` can be extended to an
    ind-object presentation of `B`. -/
@[simps!]
noncomputable def extend {A B : Cᵒᵖ ⥤ Type v} (P : IndObjectPresentation A) (η : A ⟶ B) [IsIso η] :
    IndObjectPresentation B

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

(P : CategoryTheory.Limits.IndObjectPresentation A)

∀ (X_1 : Cᵒᵖ) (a : ((Opposite.unop (Opposite.op (P.F.comp CategoryTheory.yoneda))).obj X).obj X_1),
  ((P.extend η).ι.app X).app X_1 a = η.app X_1 ((P.cocone.ι.app X).app X_1 a)


lemma IsPointwiseLeftKanExtension.hasLeftKanExtension :
    HasLeftKanExtension L F

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
[CategoryTheory.Category.{u_5, u_3} H]
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{E : L.LeftExtension F}
(h : E.IsPointwiseLeftKanExtension)


theorem SkyscraperPresheafFunctor.map'_id {a : C} :
    SkyscraperPresheafFunctor.map' p₀ (𝟙 a) = 𝟙 _

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

SkyscraperPresheafFunctor.map' p₀ (𝟙 a) = 𝟙 (skyscraperPresheaf p₀ a)


@[simp]
theorem compClosure_eq_self [h : Congruence r] :
    CompClosure r = r

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(r : HomRel C)
[h : CategoryTheory.Congruence r]

CategoryTheory.Quotient.CompClosure r = r


theorem mem_ae_of_mem_ae_map {f : α → β} (hf : AEMeasurable f μ) {s : Set β}
    (hs : s ∈ ae (μ.map f)) : f ⁻¹' s ∈ ae μ

(hs : s ∈ MeasureTheory.ae (MeasureTheory.Measure.map f μ))


/-- If `f : R → ℝ` is a nonnegative function and `x : R` is submultiplicative for `f`, then
  `seminormFromBounded' f x = f x`. -/
theorem seminormFromBounded_of_mul_le (f_nonneg : 0 ≤ f) {x : R}
    (hx : ∀ y : R, f (x * y) ≤ f x * f y) (h_one : f 1 ≤ 1) : seminormFromBounded' f x = f x

{R : Type u_1}
[CommRing R]
{f : R → ℝ}
(f_nonneg : 0 ≤ f)
{x : R}
(hx : ∀ (y : R), f (x * y) ≤ f x * f y)
(h_one : f 1 ≤ 1)


theorem decode₂_eq_some [Encodable α] {n : ℕ} {a : α} : decode₂ α n = some a ↔ encode a = n

{α : Type u_1}
[Encodable α]
{n : ℕ}
{a : α}

Encodable.decode₂ α n = some a ↔ Encodable.encode a = n


@[to_additive (attr := simp)]
lemma univ_div_univ : (univ / univ : Set α) = univ


theorem HasDerivAt.cpow_const (hf : HasDerivAt f f' x) (h0 : f x ∈ slitPlane) :
    HasDerivAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') x

{f : ℂ → ℂ}
{f' x c : ℂ}
(hf : HasDerivAt f f' x)
(h0 : f x ∈ Complex.slitPlane)


theorem card_rootsOfUnity : Fintype.card (rootsOfUnity k R) ≤ k

(R : Type u_4)
(k : ℕ+)
[CommRing R]
[IsDomain R]


theorem sInf_le_iff {s : Set ℝ} (h : BddBelow s) (h' : s.Nonempty) {a : ℝ} :
    sInf s ≤ a ↔ ∀ ε, 0 < ε → ∃ x ∈ s, x < a + ε

sInf s ≤ a ↔ ∀ (ε : ℝ), 0 < ε → ∃ x ∈ s, x < a + ε


/-- Each of the sums in this lemma is the cardinality of the set of integer points in each of the
  two triangles formed by the diagonal of the rectangle `(0, p/2) × (0, q/2)`. Adding them
  gives the number of points in the rectangle. -/
theorem sum_mul_div_add_sum_mul_div_eq_mul (p q : ℕ) [hp : Fact p.Prime] (hq0 : (q : ZMod p) ≠ 0) :
    ∑ a ∈ Ico 1 (p / 2).succ, a * q / p + ∑ a ∈ Ico 1 (q / 2).succ, a * p / q =
    p / 2 * (q / 2)

(p q : ℕ)
[hp : Fact (Nat.Prime p)]
(hq0 : ↑q ≠ 0)

∑ a ∈ Finset.Ico 1 (p / 2).succ, a * q / p + ∑ a ∈ Finset.Ico 1 (q / 2).succ, a * p / q = p / 2 * (q / 2)


@[simp]
theorem elim_of_mem (hl : (i :: l).Nodup) (hj : j ∈ l) (v : TProd α (i :: l)) :
    v.elim (mem_cons_of_mem _ hj) = TProd.elim v.2 hj

{ι : Type u}
{α : ι → Type v}
{i j : ι}
{l : List ι}
[DecidableEq ι]
(hl : (i :: l).Nodup)
(hj : j ∈ l)
(v : List.TProd α (i :: l))


/-- If there are more pigeons than pigeonholes, then there are two pigeons in the same pigeonhole.
-/
theorem exists_ne_map_eq_of_card_lt_of_maps_to {t : Finset β} (hc : t.card < s.card) {f : α → β}
    (hf : ∀ a ∈ s, f a ∈ t) : ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ f x = f y

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(hc : t.card < s.card)
{f : α → β}
(hf : ∀ a ∈ s, f a ∈ t)


theorem toPartialHomeomorph_mdifferentiable (h : M ≃ₘ^n⟮I, J⟯ N) (hn : 1 ≤ n) :
    h.toHomeomorph.toPartialHomeomorph.MDifferentiable I J

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)
(hn : 1 ≤ n)

PartialHomeomorph.MDifferentiable I J h.toHomeomorph.toPartialHomeomorph


theorem Kernel.indep_limsup_self (h_le : ∀ n, s n ≤ m0) (h_indep : iIndep s κ μα)
    (hf : ∀ t, p t → tᶜ ∈ f)
    (hns : Directed (· ≤ ·) ns) (hnsp : ∀ a, p (ns a)) (hns_univ : ∀ n, ∃ a, n ∈ ns a) :
    Indep (limsup s f) (limsup s f) κ μα

{α : Type u_1}
{Ω : Type u_2}
{ι : Type u_3}
{_mα : MeasurableSpace α}
{s : ι → MeasurableSpace Ω}
{m0 : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μα : MeasureTheory.Measure α}
[ProbabilityTheory.IsMarkovKernel κ]

∀ {α_1 : Type u_4} {p : Set ι → Prop} {f : Filter ι} {ns : α_1 → Set ι},
  (∀ (n : ι), s n ≤ m0) →
    ProbabilityTheory.Kernel.iIndep s κ μα →
      (∀ (t : Set ι), p t → tᶜ ∈ f) →
        Directed (fun x x_1 => x ≤ x_1) ns →
          (∀ (a : α_1), p (ns a)) →
            (∀ (n : ι), ∃ a, n ∈ ns a) → ProbabilityTheory.Kernel.Indep (Filter.limsup s f) (Filter.limsup s f) κ μα


theorem _root_.IsSelfAdjoint.exp [T2Space 𝔸] [StarRing 𝔸] [ContinuousStar 𝔸] {x : 𝔸}
    (h : IsSelfAdjoint x) : IsSelfAdjoint (exp 𝕂 x)

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[Field 𝕂]
[Ring 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[T2Space 𝔸]
[StarRing 𝔸]
[ContinuousStar 𝔸]
{x : 𝔸}
(h : IsSelfAdjoint x)


@[simp]
theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j)

QuaternionGroup.a i * QuaternionGroup.a j = QuaternionGroup.a (i + j)


@[to_additive]
lemma IsMulFreimanHom.mono (hmn : m ≤ n) (hf : IsMulFreimanHom n A B f) :
    IsMulFreimanHom m A B f

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCancelCommMonoid β]
{A : Set α}
{B : Set β}
{f : α → β}
{m n : ℕ}
(hmn : m ≤ n)
(hf : IsAddFreimanHom n A B f)


/-- Every positive `x` is between two successive integer powers of
another `y` greater than one. This is the same as `exists_mem_Ico_zpow`,
but with ≤ and < the other way around. -/
theorem exists_mem_Ioc_zpow (hx : 0 < x) (hy : 1 < y) : ∃ n : ℤ, x ∈ Ioc (y ^ n) (y ^ (n + 1))

{α : Type u_1}
[LinearOrderedSemifield α]
[Archimedean α]
[ExistsAddOfLE α]
{x y : α}
(hx : 0 < x)
(hy : 1 < y)


lemma inverseImage_map_eq_of_isEquivalence
    (P : MorphismProperty C) [P.RespectsIso] (F : C ⥤ D) [F.IsEquivalence] :
    (P.map F).inverseImage F = P

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(P : CategoryTheory.MorphismProperty C)
[P.RespectsIso]
(F : C ⥤ D)
[F.IsEquivalence]


theorem closedBall_add_ball (hε : 0 ≤ ε) (hδ : 0 < δ) (a b : E) :
    closedBall a ε + ball b δ = ball (a + b) (ε + δ)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
(hε : 0 ≤ ε)
(hδ : 0 < δ)
(a b : E)

Metric.closedBall a ε + Metric.ball b δ = Metric.ball (a + b) (ε + δ)


/-- Shiftleft on successor with multiple moved inside. -/
theorem shiftLeft_succ_inside (m n : Nat) : m <<< (n+1) = (2*m) <<< n


/-- An alternative constructor of `LTSeries` from a strictly monotone function. -/
@[simps]
def mk (length : ℕ) (toFun : Fin (length + 1) → α) (strictMono : StrictMono toFun) :
    LTSeries α

{α : Type u_1}
[Preorder α]
(length : ℕ)
(toFun : Fin (length + 1) → α)
(strictMono : StrictMono toFun)

(LTSeries.mk length toFun strictMono).length = length


theorem DifferentiableOn.congr_mono (h : DifferentiableOn 𝕜 f s) (h' : ∀ x ∈ t, f₁ x = f x)
    (h₁ : t ⊆ s) : DifferentiableOn 𝕜 f₁ t

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{s t : Set E}
(h : DifferentiableOn 𝕜 f s)
(h' : ∀ x ∈ t, f₁ x = f x)
(h₁ : t ⊆ s)


@[symm]
protected theorem MonovaryOn.symm (h : MonovaryOn f g s) : MonovaryOn g f s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[LinearOrder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}
(h : MonovaryOn f g s)


theorem Iso.reachable_iff {G : SimpleGraph V} {G' : SimpleGraph V'} {φ : G ≃g G'} {u v : V} :
    G'.Reachable (φ u) (φ v) ↔ G.Reachable u v

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{φ : G ≃g G'}
{u v : V}


theorem pointReflection_involutive (x : P₁) : Involutive (pointReflection k x : P₁ → P₁)

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

Function.Involutive ⇑(AffineEquiv.pointReflection k x)


theorem Filter.HasBasis.uniformEquicontinuous_iff_left {p : κ → Prop}
    {s : κ → Set (β × β)} {F : ι → β → α} (hβ : (𝓤 β).HasBasis p s) :
    UniformEquicontinuous F ↔
      ∀ U ∈ 𝓤 α, ∃ k, p k ∧ ∀ x y, (x, y) ∈ s k → ∀ i, (F i x, F i y) ∈ U

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{p : κ → Prop}
{s : κ → Set (β × β)}
{F : ι → β → α}
(hβ : (uniformity β).HasBasis p s)

UniformEquicontinuous F ↔ ∀ U ∈ uniformity α, ∃ k, p k ∧ ∀ (x y : β), (x, y) ∈ s k → ∀ (i : ι), (F i x, F i y) ∈ U


lemma coeff_preΨ₄_ne_zero (h : (2 : R) ≠ 0) : W.preΨ₄.coeff 6 ≠ 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(h : 2 ≠ 0)


@[to_additive]
theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
    (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) (ha : a ∉ s → f a = 1) (hb : b ∉ s → f b = 1) :
    ∏ x ∈ s, f x = f a * f b

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{s : Finset α}
{f : α → β}
(a b : α)
(hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1)
(ha : a ∉ s → f a = 1)
(hb : b ∉ s → f b = 1)


lemma apply_apply_eq_zero [Zero P] (h : Exact f g) (x : M) :
    g (f x) = 0

{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
{f : M → N}
{g : N → P}
[Zero P]
(h : Function.Exact f g)
(x : M)


/-- A normed additive group is complete if any absolutely convergent series converges in the
space.  -/
lemma NormedAddCommGroup.completeSpace_of_summable_imp_tendsto
    (h : ∀ u : ℕ → E,
      Summable (‖u ·‖) → ∃ a, Tendsto (fun n => ∑ i ∈ range n, u i) atTop (𝓝 a)) :
    CompleteSpace E

(h :
  ∀ (u : ℕ → E),
    (Summable fun x => ‖u x‖) → ∃ a, Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, u i) Filter.atTop (𝓝 a))


/-- Promote an isomorphism in `SemiNormedGrp` to an isomorphism in `SemiNormedGrp₁`. -/
@[simps]
def mkIso {M N : SemiNormedGrp} (f : M ≅ N) (i : f.hom.NormNoninc) (i' : f.inv.NormNoninc) :
    SemiNormedGrp₁.of M ≅ SemiNormedGrp₁.of N

(i : NormedAddGroupHom.NormNoninc f.hom)

(i' : NormedAddGroupHom.NormNoninc f.inv)

(SemiNormedGrp₁.mkIso f i i').inv = SemiNormedGrp₁.mkHom f.inv i'


theorem Biprod.column_nonzero_of_iso {W X Y Z : C} (f : W ⊞ X ⟶ Y ⊞ Z) [IsIso f] :
    𝟙 W = 0 ∨ biprod.inl ≫ f ≫ biprod.fst ≠ 0 ∨ biprod.inl ≫ f ≫ biprod.snd ≠ 0

𝟙 W = 0 ∨
  CategoryTheory.Limits.biprod.inl ≫ f ≫ CategoryTheory.Limits.biprod.fst ≠ 0 ∨
    CategoryTheory.Limits.biprod.inl ≫ f ≫ CategoryTheory.Limits.biprod.snd ≠ 0


@[to_additive]
theorem comap_iInf {ι : Sort*} (f : G →* N) (s : ι → Subgroup N) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{ι : Sort u_7}
(f : G →* N)
(s : ι → Subgroup N)

Subgroup.comap f (iInf s) = ⨅ i, Subgroup.comap f (s i)


/-- Flipping arguments of monoid morphisms (`MonoidHom.flip`) as a monoid morphism. -/
@[to_additive (attr := simps)
      "Flipping arguments of additive monoid morphisms (`AddMonoidHom.flip`)
      as an additive monoid morphism."]
def flipHom {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} :
    (M →* N →* P) →* N →* M →* P

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

∀ {x : AddZeroClass M} {x_1 : AddZeroClass N} {x_2 : AddCommMonoid P} (f : M →+ N →+ P), AddMonoidHom.flipHom f = f.flip


@[simp]
theorem irrational_nat_sub_iff : Irrational (n - x) ↔ Irrational x


theorem BilinForm.mul_toMatrix_mul (B : BilinForm R₂ M₂) (M : Matrix o n R₂) (N : Matrix n o R₂) :
    M * BilinForm.toMatrix b B * N =
      BilinForm.toMatrix c (B.comp (Matrix.toLin c b Mᵀ) (Matrix.toLin c b N))

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
{o : Type u_12}
[Fintype n]
[Fintype o]
[DecidableEq n]
(b : Basis n R₂ M₂)
{M₂' : Type u_13}
[AddCommMonoid M₂']
[Module R₂ M₂']
(c : Basis o R₂ M₂')
[DecidableEq o]
(B : LinearMap.BilinForm R₂ M₂)
(M : Matrix o n R₂)
(N : Matrix n o R₂)

M * (BilinForm.toMatrix b) B * N =
  (BilinForm.toMatrix c) (B.comp ((Matrix.toLin c b) M.transpose) ((Matrix.toLin c b) N))


theorem map_pure_sublist_sublists (l : List α) : map pure l <+ sublists l


@[simp]
theorem union_le_iff : s ∪ t ≤ u ↔ s ≤ u ∧ t ≤ u

{α : Type u_1}
[DecidableEq α]
{s t u : Multiset α}


theorem Basis.basis_sUnion {Xs : Set (Set α)} (hne : Xs.Nonempty) (h : ∀ X ∈ Xs, M.Basis I X) :
    M.Basis I (⋃₀ Xs)

{α : Type u_1}
{M : Matroid α}
{I : Set α}
{Xs : Set (Set α)}
(hne : Xs.Nonempty)
(h : ∀ X ∈ Xs, M.Basis I X)


/-- The `i`th homology functor `HomologicalComplex C c ⥤ C`. -/
@[simps]
noncomputable def homologyFunctor [CategoryWithHomology C] : HomologicalComplex C c ⥤ C

(HomologicalComplex.homologyFunctor C c i).obj K = K.homology i


/-- Degree of `W(a,b)` is strictly less than the sum of degrees of `a` and `b` (both nonzero). -/
theorem degree_wronskian_lt_add {a b : R[X]} (ha : a ≠ 0) (hb : b ≠ 0) :
    (wronskian a b).degree < a.degree + b.degree

{R : Type u_1}
[CommRing R]
{a b : R[X]}
(ha : a ≠ 0)
(hb : b ≠ 0)

(a.wronskian b).degree < a.degree + b.degree


/-- The tautological 1-pre-hypercover induced by `S : J.Cover X`. Its index type `I₀`
is given by `S.Arrow` (i.e. all the morphisms in the sieve `S`), while `I₁` is given
by all possible pullback cones. -/
@[simps]
def preOneHypercover : PreOneHypercover.{max u v} X

{J : CategoryTheory.GrothendieckTopology C}

∀ (x x_1 : S.Arrow) (r : x.Relation x_1), S.preOneHypercover.p₁ r = r.g₁


@[simp]
theorem beckEqualizer_lift (s : Fork (T.toFunctor.map X.a) (T.δ.app X.A)) :
    (beckEqualizer X).lift s = s.ι ≫ T.ε.app _

(s : CategoryTheory.Limits.Fork (T.map X.a) (T.δ.app X.A))

(CategoryTheory.Comonad.beckEqualizer X).lift s = CategoryTheory.CategoryStruct.comp s.ι (T.ε.app X.A)


@[simp]
theorem le_maximum_of_length_pos_iff {b : α} (h : 0 < l.length) :
    b ≤ maximum_of_length_pos h ↔ b ≤ l.maximum

{α : Type u_1}
[LinearOrder α]
{l : List α}
{b : α}
(h : 0 < l.length)

b ≤ List.maximum_of_length_pos h ↔ ↑b ≤ l.maximum


@[simp]
theorem Functorial.map_id {F : C → D} [Functorial.{v₁, v₂} F] {X : C} : map F (𝟙 X) = 𝟙 (F X)

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

CategoryTheory.map F (CategoryTheory.CategoryStruct.id X) = CategoryTheory.CategoryStruct.id (F X)


lemma mem_of_isAtom_of_le_sSup_atoms (hS : BooleanGenerators S) (a : α) (ha : IsAtom a)
    (haS : a ≤ sSup S) : a ∈ S

(hS : IsCompactlyGenerated.BooleanGenerators S)


protected theorem Subsingleton.pairwise (h : s.Subsingleton) (r : α → α → Prop) : s.Pairwise r

{α : Type u_1}
{s : Set α}
(h : s.Subsingleton)
(r : α → α → Prop)


/-- For every finite open cover `Uᵢ` of a compact set, there exists a compact cover `Kᵢ ⊆ Uᵢ`. -/
theorem IsCompact.finite_compact_cover {s : Set X} (hs : IsCompact s) {ι : Type*}
    (t : Finset ι) (U : ι → Set X) (hU : ∀ i ∈ t, IsOpen (U i)) (hsC : s ⊆ ⋃ i ∈ t, U i) :
    ∃ K : ι → Set X, (∀ i, IsCompact (K i)) ∧ (∀ i, K i ⊆ U i) ∧ s = ⋃ i ∈ t, K i

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
{s : Set X}
(hs : IsCompact s)
{ι : Type u_3}
(t : Finset ι)
(U : ι → Set X)
(hU : ∀ i ∈ t, IsOpen (U i))
(hsC : s ⊆ ⋃ i ∈ t, U i)

∃ K, (∀ (i : ι), IsCompact (K i)) ∧ (∀ (i : ι), K i ⊆ U i) ∧ s = ⋃ i ∈ t, K i


theorem derivative_of_natDegree_zero {p : R[X]} (hp : p.natDegree = 0) : derivative p = 0

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p.natDegree = 0)


theorem compl_sInf : (sInf s)ᶜ = ⨆ i ∈ s, iᶜ

{α : Type u}
[CompleteBooleanAlgebra α]
{s : Set α}


theorem tsub_add_tsub_comm (hba : b ≤ a) (hdc : d ≤ c) : a - b + (c - d) = a + c - (b + d)

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


@[to_additive]
theorem inv_div_inv : a⁻¹ / b⁻¹ = b / a

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


/-- A `SubNegMonoid` is an `AddMonoid` with unary `-` and binary `-` operations
satisfying `sub_eq_add_neg : ∀ a b, a - b = a + -b`.

The default for `sub` is such that `a - b = a + -b` holds by definition.

Adding `sub` as a field rather than defining `a - b := a + -b` allows us to
avoid certain classes of unification failures, for example:
Let `foo X` be a type with a `∀ X, Sub (Foo X)` instance but no
`∀ X, Neg (Foo X)`. Suppose we also have an instance
`∀ X [Cromulent X], AddGroup (Foo X)`. Then the `(-)` coming from
`AddGroup.sub` cannot be definitionally equal to the `(-)` coming from
`Foo.Sub`.

In the same way, adding a `zsmul` field makes it possible to avoid definitional failures
in diamonds. See the definition of `AddMonoid` and Note [forgetful inheritance] for more
explanations on this.
-/
class SubNegMonoid (G : Type u) extends AddMonoid G, Neg G, Sub G where
  protected sub := SubNegMonoid.sub'
  protected sub_eq_add_neg : ∀ a b : G, a - b = a + -b := by intros; rfl
  /-- Multiplication by an integer.
  Set this to `zsmulRec` unless `Module` diamonds are possible. -/
  protected zsmul : ℤ → G → G
  protected zsmul_zero' : ∀ a : G, zsmul 0 a = 0 := by intros; rfl
  protected zsmul_succ' (n : ℕ) (a : G) :
      zsmul (Int.ofNat n.succ) a = zsmul (Int.ofNat n) a + a := by
    intros; rfl
  protected zsmul_neg' (n : ℕ) (a : G) : zsmul (Int.negSucc n) a = -zsmul n.succ a := by
    intros; rfl

{G : Type u}
[self : SubNegMonoid G]
(a b : G)


theorem and_not_not_of_not_or (h : ¬ (p ∨ q)) : ¬ p ∧ ¬ q


/-- A version of `inv_add_inv'` for `Ring.inverse`. -/
theorem Ring.inverse_add_inverse [Semiring α] {a b : α} (h : IsUnit a ↔ IsUnit b) :
    Ring.inverse a + Ring.inverse b = Ring.inverse a * (a + b) * Ring.inverse b

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


@[to_additive (attr := simp)]
protected theorem smul_cancel' {r₁ : R} {r₂ : X} {s t : S} :
    ((r₁ * s) /ₒ t) • (r₂ /ₒ s) = (r₁ • r₂) /ₒ t

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{X : Type u_2}
[AddAction R X]
{r₁ : R}
{r₂ : X}
{s t : ↥S}

r₁ + ↑s -ₒ t +ᵥ (r₂ -ₒ s) = r₁ +ᵥ r₂ -ₒ t


/-- A non-unital ring hom `α →ₙ+* β` can equivalently be viewed as a non-unital ring hom
`αᵐᵒᵖ →+* βᵐᵒᵖ`. This is the action of the (fully faithful) `ᵐᵒᵖ`-functor on morphisms. -/
@[simps]
def NonUnitalRingHom.op {α β} [NonUnitalNonAssocSemiring α] [NonUnitalNonAssocSemiring β] :
    (α →ₙ+* β) ≃ (αᵐᵒᵖ →ₙ+* βᵐᵒᵖ)

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(f : α →ₙ+* β)

∀ (a : αᵐᵒᵖ), (NonUnitalRingHom.op f) a = (↑(AddMonoidHom.mulOp f.toAddMonoidHom)).toFun a


theorem pow_le {κ μ : Cardinal.{u}} (H1 : ℵ₀ ≤ κ) (H2 : μ < ℵ₀) : κ ^ μ ≤ κ


@[to_additive (attr := simp)]
lemma smul_one_mul {M N} [MulOneClass N] [SMul M N] [IsScalarTower M N N] (x : M) (y : N) :
    x • (1 : N) * y = x • y

{M : Type u_11}
{N : Type u_12}
[MulOneClass N]
[SMul M N]
[IsScalarTower M N N]
(x : M)
(y : N)


theorem opNNNorm_le_iff {C : ℝ≥0} : ‖f‖₊ ≤ C ↔ ∀ m, ‖f m‖₊ ≤ C * ∏ i, ‖m i‖₊

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

‖f‖₊ ≤ C ↔ ∀ (m : (i : ι) → E i), ‖f m‖₊ ≤ C * ∏ i : ι, ‖m i‖₊


@[to_additive]
theorem minimalPeriod_eq_card [Fintype (orbit (zpowers a) b)] :
    minimalPeriod (a • ·) b = Fintype.card (orbit (zpowers a) b)

[Fintype ↑(MulAction.orbit (↥(Subgroup.zpowers a)) b)]

Function.minimalPeriod (fun x => a • x) b = Fintype.card ↑(MulAction.orbit (↥(Subgroup.zpowers a)) b)


theorem MonovaryOn.comp_antitoneOn_right (h : MonovaryOn f g s) (hg : AntitoneOn g' (g '' s)) :
    AntivaryOn f (g' ∘ g) s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[LinearOrder β]
[Preorder γ]
{f : ι → α}
{g : ι → β}
{g' : β → γ}
{s : Set ι}
(h : MonovaryOn f g s)
(hg : AntitoneOn g' (g '' s))


/-- When a ring is not a field, the maximal ideals are nontrivial. -/
theorem ne_bot_of_isMaximal_of_not_isField [Nontrivial R] {M : Ideal R} (max : M.IsMaximal)
    (not_field : ¬IsField R) : M ≠ ⊥

{R : Type u_1}
[CommSemiring R]
[Nontrivial R]
{M : Ideal R}
(max : M.IsMaximal)
(not_field : ¬IsField R)


theorem star_mul_self_pos [Nontrivial R] {x : R} (hx : IsRegular x) : 0 < star x * x

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
[Nontrivial R]
{x : R}
(hx : IsRegular x)


@[to_additive]
theorem lintegral_eq_tsum (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
    ∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in g • s, f x ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

(f : α → ℝ≥0∞)

∫⁻ (x : α), f x ∂μ = ∑' (g : G), ∫⁻ (x : α) in g • s, f x ∂μ


/-- A dilation maps spheres to spheres and scales the radius by `ratio f`. -/
theorem mapsTo_sphere (x : α) (r' : ℝ) :
    MapsTo (f : α → β) (Metric.sphere x r') (Metric.sphere (f x) (ratio f * r'))

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)
(x : α)
(r' : ℝ)

Set.MapsTo (⇑f) (Metric.sphere x r') (Metric.sphere (f x) (↑(Dilation.ratio f) * r'))


@[simp]
theorem ceil_natCast (n : ℕ) : ⌈(n : α)⌉ = n

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


@[simp]
theorem symm_apply_apply (x : P) : e.symm (e x) = x

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


theorem _root_.Module.isTorsionBySet_annihilator_top :
    Module.IsTorsionBySet R M (⊤ : Submodule R M).annihilator

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

Module.IsTorsionBySet R M ↑⊤.annihilator


theorem hasDerivWithinAt_congr_set {s t : Set 𝕜} (h : s =ᶠ[𝓝 x] t) :
    HasDerivWithinAt f f' s x ↔ HasDerivWithinAt f f' t x

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


theorem condexp_stopping_time_ae_eq_restrict_eq_const_of_le_const (h : Martingale f ℱ μ)
    (hτ : IsStoppingTime ℱ τ) (hτ_le : ∀ x, τ x ≤ n)
    [SigmaFinite (μ.trim (hτ.measurableSpace_le_of_le hτ_le))] (i : ι) :
    μ[f n|hτ.measurableSpace] =ᵐ[μ.restrict {x | τ x = i}] f i


theorem tan_ofReal_re (x : ℝ) : (tan x).re = Real.tan x


lemma LocalizedModule.subsingleton_iff {S : Submonoid R} :
    Subsingleton (LocalizedModule S M) ↔ ∀ m : M, ∃ r ∈ S, r • m = 0

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{S : Submonoid R}

Subsingleton (LocalizedModule S M) ↔ ∀ (m : M), ∃ r ∈ S, r • m = 0


@[simp]
theorem sqrt_le_sqrt_iff (hy : 0 ≤ y) : √x ≤ √y ↔ x ≤ y

√x ≤ √y ↔ x ≤ y


lemma mono_homologyMap_of_mono_of_not_rel (φ : K ⟶ L) (j : ι)
    [K.HasHomology j] [L.HasHomology j] [Mono (φ.f j)] (hj : ∀ i, ¬ c.Rel i j) :
    Mono (homologyMap φ j)

CategoryTheory.Mono (HomologicalComplex.homologyMap φ j)


private theorem mem_aux {e : PartialHomeomorph (B × F) (B × F)} :
    (e ∈ ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
      (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
      (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
        {e | e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn
          h2φ.continuousOn)}) ↔
      ∃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
        (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
        (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
          e.EqOnSource
            (FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)

{𝕜 : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{EB : Type u_4}
[NormedAddCommGroup EB]
[NormedSpace 𝕜 EB]
{HB : Type u_5}
[TopologicalSpace HB]
[ChartedSpace HB B]
{IB : ModelWithCorners 𝕜 EB HB}
{e : PartialHomeomorph (B × F) (B × F)}

e ∈
    ⋃ φ,
      ⋃ U,
        ⋃ (hU : IsOpen U),
          ⋃ (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U),
            ⋃ (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x).symm) U),
              {e | e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU ⋯ ⋯)} ↔
  ∃ φ U,
    ∃ (hU : IsOpen U) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) U) (h2φ :
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x).symm) U), e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU ⋯ ⋯)


@[simp]
theorem coe_id : ⇑(PseudoEpimorphism.id α) = id


/-- Every split mono whose retraction is mono is an iso. -/
theorem IsIso.of_mono_retraction' {X Y : C} {f : X ⟶ Y} (hf : SplitMono f) [Mono <| hf.retraction] :
    IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
{f : X ⟶ Y}
(hf : CategoryTheory.SplitMono f)
[CategoryTheory.Mono hf.retraction]


theorem disjoint_iff : Disjoint a b ↔ a ⊓ b = ⊥

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{a b : α}


theorem gal_isSolvable_of_splits {p q : F[X]}
    (_ : Fact (p.Splits (algebraMap F q.SplittingField))) (hq : IsSolvable q.Gal) :
    IsSolvable p.Gal

Fact (Polynomial.Splits (algebraMap F q.SplittingField) p) → IsSolvable q.Gal → IsSolvable p.Gal


lemma guitartExact_iff_initial :
    w.GuitartExact ↔ ∀ (X₂ : C₂), (w.structuredArrowDownwards X₂).Initial

{C₁ : Type u₁}
{C₂ : Type u₂}
{C₃ : Type u₃}
{C₄ : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C₁]
[CategoryTheory.Category.{v₂, u₂} C₂]
[CategoryTheory.Category.{v₃, u₃} C₃]
[CategoryTheory.Category.{v₄, u₄} C₄]
{T : CategoryTheory.Functor C₁ C₂}
{L : CategoryTheory.Functor C₁ C₃}
{R : CategoryTheory.Functor C₂ C₄}
{B : CategoryTheory.Functor C₃ C₄}
(w : CategoryTheory.TwoSquare T L R B)


/-- The pullback cone whose cone point is the explicit pullback. -/
@[simps! pt π]
def pullback.cone : Limits.PullbackCone f g

{X Y B : LightProfinite}
(f : X ⟶ B)
(g : Y ⟶ B)

(LightProfinite.pullback.cone f g).π =
  {
    app := fun j =>
      Option.rec (CategoryTheory.CategoryStruct.comp (LightProfinite.pullback.fst f g) f)
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (LightProfinite.pullback.fst f g) (LightProfinite.pullback.snd f g) val)
        j,
    naturality := ⋯ }


theorem comp_ker_subtype (f : M →ₛₗ[τ₁₂] M₂) : f.comp f.ker.subtype = 0

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
(f : M →ₛₗ[τ₁₂] M₂)


theorem comp_inf_eq_inf_comp [SemilatticeInf γ] [OrderTop γ] {s : Finset β} {f : β → α} (g : α → γ)
    (g_inf : ∀ x y, g (x ⊓ y) = g x ⊓ g y) (top : g ⊤ = ⊤) : g (s.inf f) = s.inf (g ∘ f)

(g_inf : ∀ (x y : α), g (x ⊓ y) = g x ⊓ g y)


theorem iIsOrtho_def {n : Type w} {B : BilinForm R M} {v : n → M} :
    B.iIsOrtho v ↔ ∀ i j : n, i ≠ j → B (v i) (v j) = 0

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n : Type w}
{B : LinearMap.BilinForm R M}
{v : n → M}

B.iIsOrtho v ↔ ∀ (i j : n), i ≠ j → (B (v i)) (v j) = 0


@[simp]
theorem smul_top_eq_map {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S]
    (I : Ideal R) : I • (⊤ : Submodule R S) = (I.map (algebraMap R S)).restrictScalars R

{R : Type u_4}
{S : Type u_5}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
(I : Ideal R)

I • ⊤ = Submodule.restrictScalars R (Ideal.map (algebraMap R S) I)


/--
Equivalent preregular categories give equivalent regular toposes.
-/
@[simps!]
def sheafCongrPreregular : haveI := e.preregular
    Sheaf (regularTopology C) A ≌ Sheaf (regularTopology D) A

(F : CategoryTheory.Sheaf (CategoryTheory.regularTopology D) A)

((e.sheafCongrPreregular A).inverse.obj F).val.obj X = F.val.obj (Opposite.op (e.functor.obj (Opposite.unop X)))


theorem algebra_compatible_smul (r : R) (m : M) : r • m = (algebraMap R A) r • m

{R : Type u_1}
[CommSemiring R]
(A : Type u_2)
[Semiring A]
[Algebra R A]
{M : Type u_3}
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
(r : R)
(m : M)


lemma subset_of_eq [IsRefl α (· ⊆ ·)] : a = b → a ⊆ b

{α : Type u}
[HasSubset α]
{a b : α}
[IsRefl α fun x x_1 => x ⊆ x_1]


/-- The equivalence `(ULift (Multiplicative ℤ) →* α) ≃ α` for any group `α`. -/
@[simps!]
def fromULiftMultiplicativeIntEquiv (α : Type u) [Group α] :
    (ULift.{u} (Multiplicative ℤ) →* α) ≃ α

∀ (a : α) (a_1 : ULift.{u, 0} (Multiplicative ℤ)),
  ((MonoidHom.fromULiftMultiplicativeIntEquiv α).symm a) a_1 = a ^ Multiplicative.toAdd (MulEquiv.ulift a_1)


@[simp, norm_cast] lemma ratCast_imI (q : ℚ) : (q : ℍ[R]).imI = 0

{R : Type u_1}
[LinearOrderedField R]
(q : ℚ)


theorem forall_infs_iff {p : α → Prop} : (∀ c ∈ s ⊼ t, p c) ↔ ∀ a ∈ s, ∀ b ∈ t, p (a ⊓ b)

{α : Type u_2}
[SemilatticeInf α]
{s t : Set α}
{p : α → Prop}


@[ext]
theorem val_injective : Function.Injective (HomogeneousLocalization.val (𝒜 := 𝒜) (x := x))

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
(x : Submonoid A)


@[simp]
theorem mk_right_unitor_inv : Quot.mk _ (Hom₂.right_unitor_inv f) = (ρ_ f).inv

{B : Type u}
[Quiver B]
{a b : CategoryTheory.FreeBicategory B}
(f : a ⟶ b)

Quot.mk CategoryTheory.FreeBicategory.Rel (CategoryTheory.FreeBicategory.Hom₂.right_unitor_inv f) =
  (CategoryTheory.Bicategory.rightUnitor f).inv


@[fun_prop]
lemma Units.continuousOn_inv₀_spectrum (a : Aˣ) : ContinuousOn (· ⁻¹) (spectrum R (a : A))

{R : Type u_1}
{A : Type u_2}
[Semifield R]
[MetricSpace R]
[HasContinuousInv₀ R]
[Ring A]
[Algebra R A]
(a : Aˣ)

ContinuousOn (fun x => x⁻¹) (spectrum R ↑a)


@[to_additive (attr := simp)]
theorem ofMulEquivOfDom_apply {k : P ≃* M} (H : T.map k.toMonoidHom = S) (x) :
    (f.ofMulEquivOfDom H).toMap x = f.toMap (k x)

(H : AddSubmonoid.map k.toAddMonoidHom T = S)

(f.ofAddEquivOfDom H).toMap x = f.toMap (k x)


/-- An isomorphism of short complexes `S₁ ≅ S₂` induces an isomorphism on the `K` fields
of left homology data of `S₁` and `S₂`. -/
@[simps]
def cyclesMapIso' (e : S₁ ≅ S₂) (h₁ : S₁.LeftHomologyData)
    (h₂ : S₂.LeftHomologyData) : h₁.K ≅ h₂.K

(CategoryTheory.ShortComplex.cyclesMapIso' e h₁ h₂).hom = CategoryTheory.ShortComplex.cyclesMap' e.hom h₁ h₂


theorem not_mem_of_not_mem_closure {s : Set R} {P : R} (hP : P ∉ closure s) : P ∉ s

{R : Type u}
[NonUnitalNonAssocRing R]
{s : Set R}
{P : R}
(hP : P ∉ NonUnitalSubring.closure s)


/-- `sigmaPreimageEquiv f` for `f : α → β` is the natural equivalence between
the type of all preimages of points under `f` and the total space `α`. -/
@[simps!]
def sigmaPreimageEquiv {α β} (f : α → β) : (Σb, f ⁻¹' {b}) ≃ α

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

↑((Equiv.sigmaPreimageEquiv f).symm x).snd = x


theorem integral_mono_ae_restrict (h : f ≤ᵐ[μ.restrict (Icc a b)] g) :
    (∫ u in a..b, f u ∂μ) ≤ ∫ u in a..b, g u ∂μ

{f g : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hab : a ≤ b)
(hf : IntervalIntegrable f μ a b)
(hg : IntervalIntegrable g μ a b)
(h : f ≤ᵐ[μ.restrict (Set.Icc a b)] g)

∫ (u : ℝ) in a..b, f u ∂μ ≤ ∫ (u : ℝ) in a..b, g u ∂μ


theorem mul_inv_cancel : ∀ {p : RatFunc K}, p ≠ 0 → p * p⁻¹ = 1

{K : Type u}
[CommRing K]
[IsDomain K]
{p : RatFunc K}


theorem sSup_univ : sSup (@Set.univ ℝ) = 0


@[to_additive]
theorem le_def : p ≤ q ↔ (p : E → ℝ) ≤ q

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

p ≤ q ↔ ⇑p ≤ ⇑q


theorem bind_replicate {β} (f : α → List β) : (replicate n a).bind f = (replicate n (f a)).join

{α : Type u_1}
{n : Nat}
{a : α}
{β : Type u_2}
(f : α → List β)

(List.replicate n a).bind f = (List.replicate n (f a)).join


@[simp]
theorem limsSup_top : limsSup (⊤ : Filter α) = ⊤


@[simp]
theorem coe_mk (S : StarSubalgebra ℂ (H →L[ℂ] H)) (h) :
    ((⟨S, h⟩ : VonNeumannAlgebra H) : Set (H →L[ℂ] H)) = S

(h : S.carrier.centralizer.centralizer = S.carrier)

↑{ toStarSubalgebra := S, centralizer_centralizer' := h } = ↑S


theorem Antitone.quasilinearOn (hf : Antitone f) : QuasilinearOn 𝕜 univ f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{f : E → β}
(hf : Antitone f)


theorem tendsto_nhds_unique [T2Space X] {f : Y → X} {l : Filter Y} {a b : X} [NeBot l]
    (ha : Tendsto f l (𝓝 a)) (hb : Tendsto f l (𝓝 b)) : a = b

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[T2Space X]
{f : Y → X}
{l : Filter Y}
{a b : X}
[l.NeBot]
(ha : Filter.Tendsto f l (𝓝 a))
(hb : Filter.Tendsto f l (𝓝 b))


theorem isCoprime_of_irreducible_dvd {x y : R} (nonzero : ¬(x = 0 ∧ y = 0))
    (H : ∀ z : R, Irreducible z → z ∣ x → ¬z ∣ y) : IsCoprime x y

(H : ∀ (z : R), Irreducible z → z ∣ x → ¬z ∣ y)


theorem incidence_other_neighbor_edge {v w : V} (h : w ∈ G.neighborSet v) :
    G.otherVertexOfIncident (G.mem_incidence_iff_neighbor.mpr h) = w

{V : Type u}
(G : SimpleGraph V)
[DecidableEq V]
{v w : V}
(h : w ∈ G.neighborSet v)


theorem Filter.Eventually.prod_nhdsSet {p : X × Y → Prop} {px : X → Prop} {py : Y → Prop}
    (hp : ∀ {x : X}, px x → ∀ {y : Y}, py y → p (x, y)) (hs : ∀ᶠ x in 𝓝ˢ s, px x)
    (ht : ∀ᶠ y in 𝓝ˢ t, py y) : ∀ᶠ q in 𝓝ˢ (s ×ˢ t), p q


/-- A trivial bundle is equivalent to the product `B × F`. -/
@[simps (config := { attrs := [`mfld_simps] })]
def TotalSpace.toProd (B F : Type*) : (TotalSpace F fun _ : B => F) ≃ B × F

(B : Type u_4)
(F : Type u_5)
(x : B × F)

((Bundle.TotalSpace.toProd B F).symm x).snd = x.2


theorem opNorm_le_of_lipschitz {f : NormedAddGroupHom V₁ V₂} {K : ℝ≥0} (hf : LipschitzWith K f) :
    ‖f‖ ≤ K

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{f : NormedAddGroupHom V₁ V₂}
{K : ℝ≥0}
(hf : LipschitzWith K ⇑f)


@[to_additive (attr := simp, norm_cast)]
theorem val_le_val [Monoid α] [Preorder α] {a b : αˣ} : (a : α) ≤ b ↔ a ≤ b

{α : Type u_1}
[AddMonoid α]
[Preorder α]
{a b : AddUnits α}

↑a ≤ ↑b ↔ a ≤ b


@[simp]
theorem linearIsometryBoundedOfCompact_apply_apply (f : C(α, E)) (a : α) :
    (linearIsometryBoundedOfCompact α E 𝕜 f) a = f a

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
{𝕜 : Type u_4}
[NormedField 𝕜]
[NormedSpace 𝕜 E]
(f : C(α, E))
(a : α)

((ContinuousMap.linearIsometryBoundedOfCompact α E 𝕜) f) a = f a


/-- An inner product with a sum on the right. -/
theorem inner_sum {ι : Type*} (s : Finset ι) (f : ι → E) (x : E) :
    ⟪x, ∑ i ∈ s, f i⟫ = ∑ i ∈ s, ⟪x, f i⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
(s : Finset ι)
(f : ι → E)
(x : E)

⟪x, ∑ i ∈ s, f i⟫_𝕜 = ∑ i ∈ s, ⟪x, f i⟫_𝕜


/-- If `g : FreeAbelianGroup X` and `A` is an abelian group then `liftAddGroupHom g`
is the additive group homomorphism sending a function `X → A` to the term of type `A`
corresponding to the evaluation of the induced map `FreeAbelianGroup X → A` at `g`. -/
@[simps!]  -- Porting note: Changed `simps` to `simps!`.
def liftAddGroupHom {α} (β) [AddCommGroup β] (a : FreeAbelianGroup α) : (α → β) →+ β

{α : Type u_1}
(β : Type u_2)
[AddCommGroup β]
(a : FreeAbelianGroup α)
(f : α → β)

(FreeAbelianGroup.liftAddGroupHom β a) f = (FreeAbelianGroup.lift f) a


theorem sameRay_iff_norm_sub : SameRay ℝ x y ↔ ‖x - y‖ = |‖x‖ - ‖y‖|

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y : E}


protected theorem Adj.adj_sub {H : G.Subgraph} {u v : V} (h : H.Adj u v) : G.Adj u v

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}
{u v : V}
(h : H.Adj u v)


theorem and_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a ∧ b) = False


theorem lex_def (r : α → α → Prop) (s : β → β → Prop) {p q : α × β} :
    Prod.Lex r s p q ↔ r p.1 q.1 ∨ p.1 = q.1 ∧ s p.2 q.2

{α : Type u}
{β : Type v}
(r : α → α → Prop)
(s : β → β → Prop)
{p q : α × β}

Prod.Lex r s p q ↔ r p.fst q.fst ∨ p.fst = q.fst ∧ s p.snd q.snd


@[simp]
theorem sub_apply (n : ℕ) (f g : AdicCauchySequence I M) : (f - g) n = f n - g n

(f g : AdicCompletion.AdicCauchySequence I M)


theorem union_cancel {s₁ s₂ s₃ : Finmap β} (h : Disjoint s₁ s₃) (h' : Disjoint s₂ s₃) :
    s₁ ∪ s₃ = s₂ ∪ s₃ ↔ s₁ = s₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{s₁ s₂ s₃ : Finmap β}
(h : s₁.Disjoint s₃)
(h' : s₂.Disjoint s₃)

s₁ ∪ s₃ = s₂ ∪ s₃ ↔ s₁ = s₂


/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R]

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

(KaehlerDifferential.quotKerTotalEquiv R S).symm a =
  (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential a


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

partialFunEquivPointed.unitIso.inv.app X =
  pointedToPartialFun.map { toFun := Option.elim' none fun a => some ⟨some a, ⋯⟩, map_point := ⋯ } ≫
    pointedToPartialFun.map (Pointed.Iso.mk (Equiv.optionSubtypeNe none) ⋯).hom ≫
      (PartialFun.Iso.mk
          { toFun := fun a => ⟨some a, ⋯⟩, invFun := fun a => (↑a).get ⋯, left_inv := ⋯, right_inv := ⋯ }).inv


theorem prod_ne_zero {ι} (f : ι → Cardinal) : prod f ≠ 0 ↔ ∀ i, f i ≠ 0

Cardinal.prod f ≠ 0 ↔ ∀ (i : ι), f i ≠ 0


@[to_additive (attr := simp)]
theorem prod_one_cons : (1 :: l).prod = l.prod

{M : Type u_4}
[MulOneClass M]
{l : List M}


@[simp] theorem range_eq_nil {n : Nat} : range n = [] ↔ n = 0


theorem principal_mul_of_le_two {o : Ordinal} (ho : o ≤ 2) : Principal (· * ·) o

Ordinal.Principal (fun x x_1 => x * x_1) o


/-- This is a special case of `WithTop.coe_sub` in the `ENNReal` namespace -/
@[simp] theorem coe_sub : (↑(r - p) : ℝ≥0∞) = ↑r - ↑p


theorem prod_toSubmodule : toSubmodule (S.prod S₁) = (toSubmodule S).prod (toSubmodule S₁)

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

Subalgebra.toSubmodule (S.prod S₁) = (Subalgebra.toSubmodule S).prod (Subalgebra.toSubmodule S₁)


theorem nhds_basis_Ioo' [OrderTopology α] {a : α} (hl : ∃ l, l < a) (hu : ∃ u, a < u) :
    (𝓝 a).HasBasis (fun b : α × α => b.1 < a ∧ a < b.2) fun b => Ioo b.1 b.2

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
(hl : ∃ l, l < a)
(hu : ∃ u, a < u)

(𝓝 a).HasBasis (fun b => b.1 < a ∧ a < b.2) fun b => Set.Ioo b.1 b.2


/-- See also `Finset.prod_dite_eq`. -/
@[to_additive "See also `Finset.sum_dite_eq`."] lemma prod_dite_eq (i : ι) (f : ∀ j, i = j → α) :
    ∏ j, (if h : i = j then f j h else 1) = f i rfl

{ι : Type u_6}
{α : Type u_8}
[Fintype ι]
[CommMonoid α]
[DecidableEq ι]
(i : ι)
(f : (j : ι) → i = j → α)

(∏ j : ι, if h : i = j then f j h else 1) = f i ⋯


/--
Given `[Estimator a ε]`
* we have `bound a e ≤ a.get`, and
* `improve a e` returns none iff `bound a e = a.get`,
  and otherwise it returns a strictly better bound.
-/
class Estimator [Preorder α] (a : Thunk α) (ε : Type*) extends EstimatorData a ε where
  /-- The calculated bounds are always lower bounds. -/
  bound_le e : bound e ≤ a.get
  /-- Calling `improve` either gives a strictly better bound,
  or a proof that the current bound is exact. -/
  improve_spec e : match improve e with
    | none => bound e = a.get
    | some e' => bound e < bound e'

{α : Type u_1}
[Preorder α]
{a : Thunk α}
{ε : Type u_3}
[self : Estimator a ε]
(e : ε)

match EstimatorData.improve a e with
| none => EstimatorData.bound a e = a.get
| some e' => EstimatorData.bound a e < EstimatorData.bound a e'


lemma mk_surjective (f : CostructuredArrow S T) :
    ∃ (Y : C) (g : S.obj Y ⟶ T), f = mk g

(f : CategoryTheory.CostructuredArrow S T)

∃ Y g, f = CategoryTheory.CostructuredArrow.mk g


/-- `OrderedSub α` means that `α` has a subtraction characterized by `a - b ≤ c ↔ a ≤ c + b`.
In other words, `a - b` is the least `c` such that `a ≤ b + c`.

This is satisfied both by the subtraction in additive ordered groups and by truncated subtraction
in canonically ordered monoids on many specific types.
-/
class OrderedSub (α : Type*) [LE α] [Add α] [Sub α] : Prop where
  /-- `a - b` provides a lower bound on `c` such that `a ≤ c + b`. -/
  tsub_le_iff_right : ∀ a b c : α, a - b ≤ c ↔ a ≤ c + b

{α : Type u_3}
[LE α]
[Add α]
[Sub α]
[self : OrderedSub α]
(a b c : α)


lemma findGreatest_mono_right (P : ℕ → Prop) [DecidablePred P] {m n} (hmn : m ≤ n) :
    Nat.findGreatest P m ≤ Nat.findGreatest P n

(P : ℕ → Prop)
[DecidablePred P]
{m n : ℕ}
(hmn : m ≤ n)


@[reassoc]
theorem head_desc : head arrows ≫ desc f fs w = f

[CategoryTheory.Limits.HasWidePushout B objs arrows]

CategoryTheory.Limits.WidePushout.head arrows ≫ CategoryTheory.Limits.WidePushout.desc f fs w = f


theorem mul_pow {ea₁ b c₁ : ℕ} {xa₁ : R}
    (_ : ea₁ * b = c₁) (_ : a₂ ^ b = c₂) : (xa₁ ^ ea₁ * a₂ : R) ^ b = xa₁ ^ c₁ * c₂

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

ea₁ * b = c₁ → a₂ ^ b = c₂ → (xa₁ ^ ea₁ * a₂) ^ b = xa₁ ^ c₁ * c₂


/-- A function is strongly measurable if and only if it is measurable and has separable
range. -/
theorem _root_.stronglyMeasurable_iff_measurable_separable {m : MeasurableSpace α}
    [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β] :
    StronglyMeasurable f ↔ Measurable f ∧ IsSeparable (range f)

MeasureTheory.StronglyMeasurable f ↔ Measurable f ∧ TopologicalSpace.IsSeparable (Set.range f)


/-- Two orthonormal bases with the same orientation determine the same "determinant" top-dimensional
form on `E`, and conversely. -/
theorem same_orientation_iff_det_eq_det :
    e.toBasis.det = f.toBasis.det ↔ e.toBasis.orientation = f.toBasis.orientation

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
{e f : OrthonormalBasis ι ℝ E}


/-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the left morphism of `sq`
to the right morphism of `sq`. -/
@[simps!]
def toArrowArrowFunctor : Square C ⥤ Arrow (Arrow C)

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), (CategoryTheory.Square.toArrowArrowFunctor.map φ).left.right = φ.τ₃


theorem mem_of_ne_of_mem {a y : α} {l : List α} (h₁ : a ≠ y) (h₂ : a ∈ y :: l) : a ∈ l

{α : Type u_1}
{a y : α}
{l : List α}
(h₁ : a ≠ y)
(h₂ : a ∈ y :: l)


/-- If three points are not collinear, the angle between them is nonzero. -/
theorem angle_ne_zero_of_not_collinear {p₁ p₂ p₃ : P} (h : ¬Collinear ℝ ({p₁, p₂, p₃} : Set P)) :
    ∠ p₁ p₂ p₃ ≠ 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ¬Collinear ℝ {p₁, p₂, p₃})


theorem disjoint_left : Disjoint s t ↔ ∀ ⦃a⦄, a ∈ s → a ∉ t


@[to_additive]
-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it.
protected theorem map_one [FunLike F α β] [OneHomClass F α β] (φ : F) : map φ 1 = 1

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[One α]
[One β]
[FunLike F α β]
[OneHomClass F α β]
(φ : F)


lemma isLocallyInjective_of_whisker (hH : CoverPreserving J K H)
    [H.IsCoverDense K] [IsLocallyInjective J (whiskerLeft H.op f)] : IsLocallyInjective K f

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

(hH : CategoryTheory.CoverPreserving J K H)

[CategoryTheory.Presheaf.IsLocallyInjective J (CategoryTheory.whiskerLeft H.op f)]


theorem Connected.set_univ_walk_nonempty (hconn : G.Connected) (u v : V) :
    (Set.univ : Set (G.Walk u v)).Nonempty

{V : Type u}
{G : SimpleGraph V}
(hconn : G.Connected)
(u v : V)


@[to_additive (attr := simp)]
theorem equivLike_inv_eq_symm (f : M ≃* N) : EquivLike.inv f = f.symm

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(f : M ≃* N)


theorem mkPiRing_eq_zero_iff (z : M) : ContinuousMultilinearMap.mkPiRing R ι z = 0 ↔ z = 0

{R : Type u}
{ι : Type v}
{M : Type u_1}
[Fintype ι]
[CommRing R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace R]
[TopologicalSpace M]
[ContinuousMul R]
[ContinuousSMul R M]
(z : M)


@[to_additive lt_add_of_pos_left]
theorem lt_mul_of_one_lt_left' [CovariantClass α α (swap (· * ·)) (· < ·)] (a : α) {b : α}
    (h : 1 < b) :
    a < b * a

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


@[simp]
theorem degree_of_d_ne_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) (hd : P.d ≠ 0) :
    P.toPoly.degree = 0

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
(hc : P.c = 0)
(hd : P.d ≠ 0)


/-- The cosine of an angle in a right-angled triangle as a ratio of sides. -/
theorem cos_angle_add_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    Real.cos (angle x (x + y)) = ‖x‖ / ‖x + y‖

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

Real.cos (InnerProductGeometry.angle x (x + y)) = ‖x‖ / ‖x + y‖


nonrec theorem IsLocalMax.bicomp_mono [Preorder δ] {op : β → γ → δ}
    (hop : ((· ≤ ·) ⇒ (· ≤ ·) ⇒ (· ≤ ·)) op op) (hf : IsLocalMax f a) {g : α → γ}
    (hg : IsLocalMax g a) : IsLocalMax (fun x => op (f x) (g x)) a

{op : β → γ → δ}

(hop : ((fun x x_1 => x ≤ x_1) ⇒ (fun x x_1 => x ≤ x_1) ⇒ fun x x_1 => x ≤ x_1) op op)


@[simp]
theorem max_singleton {a : α} : Finset.max {a} = (a : WithBot α)


@[to_additive]
theorem Multipliable.multipliable_of_eq_one_or_self (hf : Multipliable f)
    (h : ∀ b, g b = 1 ∨ g b = f b) : Multipliable g

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
{f g : β → α}
[CompleteSpace α]
(hf : Summable f)
(h : ∀ (b : β), g b = 0 ∨ g b = f b)


lemma EssFiniteType.of_id : EssFiniteType R R


@[simp] lemma univ_infs_univ [Fintype α] : (univ : Finset α) ⊼ univ = univ

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
[Fintype α]


theorem min'_erase_ne_self {s : Finset α} (s0 : (s.erase x).Nonempty) : (s.erase x).min' s0 ≠ x

{α : Type u_2}
[LinearOrder α]
{x : α}
{s : Finset α}
(s0 : (s.erase x).Nonempty)


@[simp]
theorem coe_mkOfNNDistEq {α β} [PseudoMetricSpace α] [PseudoMetricSpace β] (f : α → β) (h) :
    ⇑(mkOfNNDistEq f h : α →ᵈ β) = f

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


@[simp]
theorem mult_ne_zero {w : InfinitePlace K} : mult w ≠ 0

{K : Type u_2}
[Field K]
{w : NumberField.InfinitePlace K}


theorem pow_sup_eq_top {n : ℕ} (h : I ⊔ J = ⊤) : I ^ n ⊔ J = ⊤

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
{n : ℕ}
(h : I ⊔ J = ⊤)


theorem eraseP_sublist (l : List α) : l.eraseP p <+ l

{α : Type u_1}
{p : α → Bool}
(l : List α)


theorem CompleteLattice.setIndependent_iUnion_of_directed {η : Type*} {s : η → Set α}
    (hs : Directed (· ⊆ ·) s) (h : ∀ i, CompleteLattice.SetIndependent (s i)) :
    CompleteLattice.SetIndependent (⋃ i, s i)

(hs : Directed (fun x x_1 => x ⊆ x_1) s)

(h : ∀ (i : η), CompleteLattice.SetIndependent (s i))


@[simp]
theorem compl₂_id : f.compl₂ LinearMap.id = f

{R : Type u_1}
[CommSemiring R]
{R₂ : Type u_2}
[CommSemiring R₂]
{R₃ : Type u_3}
[CommSemiring R₃]
{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R₂ N]
[Module R₃ P]
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
(f : M →ₛₗ[σ₁₃] N →ₛₗ[σ₂₃] P)


protected theorem Chain'.sublist [IsTrans α R] (hl : l₂.Chain' R) (h : l₁ <+ l₂) : l₁.Chain' R

{α : Type u}
{R : α → α → Prop}
{l₁ l₂ : List α}
[IsTrans α R]
(hl : List.Chain' R l₂)
(h : l₁.Sublist l₂)


@[deprecated (since := "2024-06-12")]
theorem get?_append {l₁ l₂ : List α} {n : Nat} (hn : n < l₁.length) :
    (l₁ ++ l₂).get? n = l₁.get? n

{α : Type u_1}
{l₁ l₂ : List α}
{n : Nat}
(hn : n < l₁.length)


@[simp, nolint simpNF] protected lemma bot_eq_zero : ⊥ = 0


theorem bernoulliFun_endpoints_eq_of_ne_one {k : ℕ} (hk : k ≠ 1) :
    bernoulliFun k 1 = bernoulliFun k 0


theorem iInter_inter_distrib (s : ι → Set β) (t : ι → Set β) :
    ⋂ i, s i ∩ t i = (⋂ i, s i) ∩ ⋂ i, t i

{β : Type u_2}
{ι : Sort u_4}
(s t : ι → Set β)


theorem psub_add (m n k) :
    psub m (n + k) = (do psub (← psub m n) k)

m.psub (n + k) = do
  let __do_lift ← m.psub n
  __do_lift.psub k


@[to_additive] lemma mulEnergy_eq_sum_sq' (s t : Finset α) :
    Eₘ[s, t] = ∑ a ∈ s * t, ((s ×ˢ t).filter fun (x, y) ↦ x * y = a).card ^ 2

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

s.addEnergy t =
  ∑ a ∈ s + t,
    (Finset.filter (fun x => Finset.addEnergy_eq_sum_sq'.match_1 (fun x => Prop) x fun x y => x + y = a)
          (s ×ˢ t)).card ^
      2


@[simp]
theorem lineMap_apply_one (p₀ p₁ : P1) : lineMap p₀ p₁ (1 : k) = p₁

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


lemma mk₂_surjective (X : ComposableArrows C 2) :
    ∃ (X₀ X₁ X₂ : C) (f₀ : X₀ ⟶ X₁) (f₁ : X₁ ⟶ X₂), X = mk₂ f₀ f₁

(X : CategoryTheory.ComposableArrows C 2)

∃ X₀ X₁ X₂ f₀ f₁, X = CategoryTheory.ComposableArrows.mk₂ f₀ f₁


lemma exists_iso_binaryBiproduct_of_distTriang (T : Triangle C) (hT : T ∈ distTriang C)
    (zero : T.mor₃ = 0) :
    ∃ (e : T.obj₂ ≅ T.obj₁ ⊞ T.obj₃), T.mor₁ ≫ e.hom = biprod.inl ∧
      T.mor₂ = e.hom ≫ biprod.snd

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

∃ e, T.mor₁ ≫ e.hom = CategoryTheory.Limits.biprod.inl ∧ T.mor₂ = e.hom ≫ CategoryTheory.Limits.biprod.snd


theorem LieEquiv.isEngelian_iff (e : L ≃ₗ⁅R⁆ L₂) :
    LieAlgebra.IsEngelian.{u₁, u₂, u₄} R L ↔ LieAlgebra.IsEngelian.{u₁, u₃, u₄} R L₂

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

LieAlgebra.IsEngelian R L ↔ LieAlgebra.IsEngelian R L₂


@[simp]
theorem preimage_Ioc {a b : α} (ha : 0 ≤ a) (hb : 0 ≤ b) :
    (Nat.cast : ℕ → α) ⁻¹' Set.Ioc a b = Set.Ioc ⌊a⌋₊ ⌊b⌋₊

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a b : α}
(ha : 0 ≤ a)
(hb : 0 ≤ b)

Nat.cast ⁻¹' Set.Ioc a b = Set.Ioc ⌊a⌋₊ ⌊b⌋₊


theorem pmul_comm [CommMonoidWithZero R] (f g : ArithmeticFunction R) : f.pmul g = g.pmul f

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


theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : ℕ) (x : E) :
    ‖p.changeOriginSeries k l fun _ => x‖₊ ≤
      ∑' _ : { s : Finset (Fin (k + l)) // s.card = l }, ‖p (k + l)‖₊ * ‖x‖₊ ^ l

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(k l : ℕ)
(x : E)

‖(p.changeOriginSeries k l) fun x_1 => x‖₊ ≤ ∑' (x_1 : { s // s.card = l }), ‖p (k + l)‖₊ * ‖x‖₊ ^ l


/-- The odd kernel is continuous on `Ioi 0`. -/
lemma continuousOn_oddKernel (a : UnitAddCircle) : ContinuousOn (oddKernel a) (Ioi 0)

ContinuousOn (HurwitzZeta.oddKernel a) (Set.Ioi 0)


@[simp]
lemma turanGraph_zero : turanGraph n 0 = ⊤


theorem lift_adjoin_simple (K : IntermediateField F E) (α : K) :
    lift (adjoin F {α}) = adjoin F {α.1}

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


/-- Division by a monic polynomial doesn't change the leading coefficient. -/
theorem leadingCoeff_divByMonic_of_monic {R : Type u} [CommRing R] {p q : R[X]} (hmonic : q.Monic)
    (hdegree : q.degree ≤ p.degree) : (p /ₘ q).leadingCoeff = p.leadingCoeff


theorem fderiv_sum (h : ∀ i ∈ u, DifferentiableAt 𝕜 (A i) x) :
    fderiv 𝕜 (fun y => ∑ i ∈ u, A i y) x = ∑ i ∈ u, fderiv 𝕜 (A i) x