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


theorem isConformalMap_complex_linear {map : ℂ →L[ℂ] E} (nonzero : map ≠ 0) :
    IsConformalMap (map.restrictScalars ℝ)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedSpace ℂ E]
{map : ℂ →L[ℂ] E}
(nonzero : map ≠ 0)

IsConformalMap (ContinuousLinearMap.restrictScalars ℝ map)


/-- Morphisms in `Bipointed`. -/
@[ext]
protected structure Hom (X Y : Bipointed.{u}) : Type u where
  /-- The underlying function of a morphism of bipointed types. -/
  toFun : X → Y
  map_fst : toFun X.toProd.1 = Y.toProd.1
  map_snd : toFun X.toProd.2 = Y.toProd.2


@[simp]
theorem blockDiagonal'_sub [AddGroup α] (M N : ∀ i, Matrix (m' i) (n' i) α) :
    blockDiagonal' (M - N) = blockDiagonal' M - blockDiagonal' N

(M N : (i : o) → Matrix (m' i) (n' i) α)

Matrix.blockDiagonal' (M - N) = Matrix.blockDiagonal' M - Matrix.blockDiagonal' N


theorem isEquivalent_zero_iff_eventually_zero : u ~[l] 0 ↔ u =ᶠ[l] 0

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u : α → β}
{l : Filter α}


/-- The strictly positive cone of an ordered module is always salient. -/
theorem salient_strictlyPositive : Salient (strictlyPositive 𝕜 E)

(𝕜 : Type u_1)
(E : Type u_2)
[OrderedSemiring 𝕜]
[OrderedAddCommGroup E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]


theorem exists_restrict_to_vars (R : Type*) [CommRing R] {F : MvPolynomial σ ℤ}
    (hF : ↑F.vars ⊆ s) : ∃ f : (s → R) → R, ∀ x : σ → R, f (x ∘ (↑) : s → R) = aeval x F

{σ : Type u_1}
{s : Set σ}
(R : Type u_3)
[CommRing R]
{F : MvPolynomial σ ℤ}
(hF : ↑F.vars ⊆ s)

∃ f, ∀ (x : σ → R), f (x ∘ Subtype.val) = (MvPolynomial.aeval x) F


theorem inverse_range : LinearMap.range (inverse f).toFun = f.domain

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f : E →ₗ.[R] F}
(hf : LinearMap.ker f.toFun = ⊥)

LinearMap.range f.inverse.toFun = f.domain


@[gcongr]
protected theorem mul_left (c : ℕ) (h : a ≡ b [MOD n]) : c * a ≡ c * b [MOD n]


@[simp]
theorem cos_sq_add_sin_sq (θ : Real.Angle) : cos θ ^ 2 + sin θ ^ 2 = 1


theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i ∈ s.filter (· < n), Set.indicator {ω | τ ω = i} (u i)

{Ω : Type u_1}
{ι : Type u_3}
{τ : Ω → ι}
{E : Type u_4}
{u : ι → Ω → E}
[LinearOrder ι]
[AddCommMonoid E]
{s : Finset ι}
(n : ι)
(hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s)

MeasureTheory.stoppedProcess u τ n =
  {a | n ≤ τ a}.indicator (u n) + ∑ i ∈ Finset.filter (fun x => x < n) s, {ω | τ ω = i}.indicator (u i)


theorem zero_ne_one : (0 : (Cauchy abv)) ≠ 1

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[DivisionRing β]
{abv : β → α}
[IsAbsoluteValue abv]


@[to_additive (attr := fun_prop)]
theorem ContinuousOn.const_smul (hg : ContinuousOn g s) (c : M) :
    ContinuousOn (fun x => c • g x) s

{M : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[VAdd M α]
[ContinuousConstVAdd M α]
[TopologicalSpace β]
{g : β → α}
{s : Set β}
(hg : ContinuousOn g s)
(c : M)


{α : Type u_1}
[Preorder α]
(L S : TopologicalSpace α)
[Topology.IsLawson α]
[Topology.IsScott α]


@[simp] theorem Matrix.mulVecLin_transpose [Fintype m] (M : Matrix m n R) :
    Mᵀ.mulVecLin = M.vecMulLinear

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[Fintype m]
(M : Matrix m n R)


@[to_additive (attr := simp)]
lemma units_top : (⊤ : Submonoid M).units = ⊤


theorem Nonempty.image2 : s.Nonempty → t.Nonempty → (image2 f s t).Nonempty

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

s.Nonempty → t.Nonempty → (Set.image2 f s t).Nonempty


/-- Let `M` be a `(n+1) × n` matrix whose column sums to zero. Then all the matrices obtained by
deleting one column have the same determinant up to a sign. -/
theorem submatrix_succAbove_det_eq_negOnePow_submatrix_succAbove_det' {n : ℕ}
    (M : Matrix (Fin n) (Fin (n + 1)) R) (hv : ∀ i, ∑ j, M i j = 0) (j₁ j₂ : Fin (n + 1)) :
    (M.submatrix id (Fin.succAbove j₁)).det =
      Int.negOnePow (j₁ - j₂) • (M.submatrix id (Fin.succAbove j₂)).det

(hv : ∀ (i : Fin n), ∑ j : Fin (n + 1), M i j = 0)

(M.submatrix id j₁.succAbove).det = (↑↑j₁ - ↑↑j₂).negOnePow • (M.submatrix id j₂.succAbove).det


/-- `Finset.cons` version of `Finset.Ioo_insert_left`. -/
theorem Ico_eq_cons_Ioo (h : a < b) : Ico a b = (Ioo a b).cons a left_not_mem_Ioo

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

Finset.Ico a b = Finset.cons a (Finset.Ioo a b) ⋯


protected theorem map_add (a b : M) : e (a + b) = e a + e b

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)
(a b : M)


@[simp]
theorem «forall» {p : PLift α → Prop} : (∀ x, p x) ↔ ∀ x : α, p (PLift.up x)

(∀ (x : PLift α), p x) ↔ ∀ (x : α), p { down := x }


@[reassoc]
theorem map_hom_inv (F : C ⥤ D) {X Y : C} (f : X ⟶ Y) [IsIso f] :
    F.map f ≫ F.map (inv f) = 𝟙 (F.obj X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.IsIso f]

CategoryTheory.CategoryStruct.comp (F.map f) (F.map (CategoryTheory.inv f)) = CategoryTheory.CategoryStruct.id (F.obj X)


@[simp]
protected theorem ContinuousLinearMap.fderiv : fderiv 𝕜 e x = e

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


/-- The functor `ComposableArrows C n ⥤ ComposableArrows D n` obtained by postcomposition
with a functor `C ⥤ D`. -/
@[simps!]
def Functor.mapComposableArrows :
    ComposableArrows C n ⥤ ComposableArrows D n

(F : CategoryTheory.Functor (Fin (n + 1)) C)

((G.mapComposableArrows n).obj F).obj X = G.obj (F.obj X)


@[simp]
theorem mul_invOf_mul_self_cancel' [Monoid α] (a b : α) {_ : Invertible b} : a * ⅟ b * b = a


@[to_additive]
lemma Prod.orderOf_mk : orderOf (a, b) = Nat.lcm (orderOf a) (orderOf b)

{α : Type u_4}
{β : Type u_5}
[AddMonoid α]
[AddMonoid β]
{a : α}
{b : β}

addOrderOf (a, b) = (addOrderOf a).lcm (addOrderOf b)


theorem apply_def (l : Line α ι) (x : α) : l x = fun i => (l.idxFun i).getD x

{α : Type u_2}
{ι : Type u_3}
(l : Combinatorics.Line α ι)
(x : α)

(fun x i => (l.idxFun i).getD x) x = fun i => (l.idxFun i).getD x


nonrec theorem sin_sub_sin : sin x - sin y = 2 * sin ((x - y) / 2) * cos ((x + y) / 2)

Real.sin x - Real.sin y = 2 * Real.sin ((x - y) / 2) * Real.cos ((x + y) / 2)


theorem sup'_union [DecidableEq β] {s₁ s₂ : Finset β} (h₁ : s₁.Nonempty) (h₂ : s₂.Nonempty)
    (f : β → α) :
    (s₁ ∪ s₂).sup' (h₁.mono subset_union_left) f = s₁.sup' h₁ f ⊔ s₂.sup' h₂ f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[DecidableEq β]
{s₁ s₂ : Finset β}
(h₁ : s₁.Nonempty)
(h₂ : s₂.Nonempty)
(f : β → α)

(s₁ ∪ s₂).sup' ⋯ f = s₁.sup' h₁ f ⊔ s₂.sup' h₂ f


/-- If `L / K` is a `p`-radical field extension, then it is purely inseparable. -/
theorem IsPRadical.isPurelyInseparable [IsPRadical (algebraMap K L) p] :
    IsPurelyInseparable K L

(K : Type u_1)
(L : Type u_2)
[Field K]
[Field L]
[Algebra K L]
(p : ℕ)
[ExpChar K p]
[IsPRadical (algebraMap K L) p]


@[simp]
lemma δ_shift (a m : ℤ) :
    δ n m (γ.shift a) = a.negOnePow • (δ n m γ).shift a

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

CochainComplex.HomComplex.δ n m (γ.shift a) = a.negOnePow • (CochainComplex.HomComplex.δ n m γ).shift a


@[to_additive (attr := measurability)]
theorem List.measurable_prod (l : List (α → M)) (hl : ∀ f ∈ l, Measurable f) :
    Measurable fun x => (l.map fun f : α → M => f x).prod

{M : Type u_2}
{α : Type u_3}
[AddMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
{m : MeasurableSpace α}
(l : List (α → M))
(hl : ∀ f ∈ l, Measurable f)

Measurable fun x => (List.map (fun f => f x) l).sum


@[to_additive (attr := simp, norm_cast)]
theorem coe_iInf {ι : Sort*} {S : ι → Submonoid M} : (↑(⨅ i, S i) : Set M) = ⋂ i, S i

{M : Type u_1}
[MulOneClass M]
{ι : Sort u_4}
{S : ι → Submonoid M}


protected theorem add_mul (φ₁ φ₂ φ₃ : MvPowerSeries σ R) : (φ₁ + φ₂) * φ₃ = φ₁ * φ₃ + φ₂ * φ₃

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(φ₁ φ₂ φ₃ : MvPowerSeries σ R)

(φ₁ + φ₂) * φ₃ = φ₁ * φ₃ + φ₂ * φ₃


@[simp]
theorem mem_uIcc : x ∈ uIcc a b ↔ a ⊓ b ≤ x ∧ x ≤ a ⊔ b

{α : Type u_1}
[Lattice α]
[LocallyFiniteOrder α]
{a b x : α}

x ∈ Finset.uIcc a b ↔ a ⊓ b ≤ x ∧ x ≤ a ⊔ b


theorem realPart_smul (z : ℂ) (a : A) : ℜ (z • a) = z.re • ℜ a - z.im • ℑ a

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
(z : ℂ)
(a : A)

realPart (z • a) = z.re • realPart a - z.im • imaginaryPart a


theorem exists_of_lt_mex {ι} {f : ι → Ordinal} {a} (ha : a < mex f) : ∃ i, f i = a

{ι : Type u_4}
{f : ι → Ordinal.{max u_5 u_4}}
{a : Ordinal.{max u_4 u_5}}
(ha : a < Ordinal.mex f)


/-- If `g : C(Y, Z)` is a topological embedding,
then the composition `ContinuousMap.comp g : C(X, Y) → C(X, Z)` is an embedding too. -/
theorem embedding_comp (g : C(Y, Z)) (hg : Embedding g) : Embedding (g.comp : C(X, Y) → C(X, Z))

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(g : C(Y, Z))
(hg : Embedding ⇑g)


@[to_additive (attr := simp)]
theorem self_le_mul_left (a b : α) : a ≤ b * a

{α : Type u}
[CanonicallyOrderedCommMonoid α]
(a b : α)


/--
In a monoidal category, we can take the tensor product of objects, `X ⊗ Y` and of morphisms `f ⊗ g`.
Tensor product does not need to be strictly associative on objects, but there is a
specified associator, `α_ X Y Z : (X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)`. There is a tensor unit `𝟙_ C`,
with specified left and right unitor isomorphisms `λ_ X : 𝟙_ C ⊗ X ≅ X` and `ρ_ X : X ⊗ 𝟙_ C ≅ X`.
These associators and unitors satisfy the pentagon and triangle equations.

See <https://stacks.math.columbia.edu/tag/0FFK>.
-/
-- Porting note: The Mathport did not translate the temporary notation
class MonoidalCategory (C : Type u) [𝒞 : Category.{v} C] extends MonoidalCategoryStruct C where
  tensorHom_def {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    f ⊗ g = (f ▷ X₂) ≫ (Y₁ ◁ g) := by
      aesop_cat
  /-- Tensor product of identity maps is the identity: `(𝟙 X₁ ⊗ 𝟙 X₂) = 𝟙 (X₁ ⊗ X₂)` -/
  tensor_id : ∀ X₁ X₂ : C, 𝟙 X₁ ⊗ 𝟙 X₂ = 𝟙 (X₁ ⊗ X₂) := by aesop_cat
  /--
  Composition of tensor products is tensor product of compositions:
  `(f₁ ⊗ g₁) ∘ (f₂ ⊗ g₂) = (f₁ ∘ f₂) ⊗ (g₁ ⊗ g₂)`
  -/
  tensor_comp :
    ∀ {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : Y₁ ⟶ Z₁) (g₂ : Y₂ ⟶ Z₂),
      (f₁ ≫ g₁) ⊗ (f₂ ≫ g₂) = (f₁ ⊗ f₂) ≫ (g₁ ⊗ g₂) := by
    aesop_cat
  whiskerLeft_id : ∀ (X Y : C), X ◁ 𝟙 Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  id_whiskerRight : ∀ (X Y : C), 𝟙 X ▷ Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  /-- Naturality of the associator isomorphism: `(f₁ ⊗ f₂) ⊗ f₃ ≃ f₁ ⊗ (f₂ ⊗ f₃)` -/
  associator_naturality :
    ∀ {X₁ X₂ X₃ Y₁ Y₂ Y₃ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃),
      ((f₁ ⊗ f₂) ⊗ f₃) ≫ (α_ Y₁ Y₂ Y₃).hom = (α_ X₁ X₂ X₃).hom ≫ (f₁ ⊗ (f₂ ⊗ f₃)) := by
    aesop_cat
  /--
  Naturality of the left unitor, commutativity of `𝟙_ C ⊗ X ⟶ 𝟙_ C ⊗ Y ⟶ Y` and `𝟙_ C ⊗ X ⟶ X ⟶ Y`
  -/
  leftUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), 𝟙_ _ ◁ f ≫ (λ_ Y).hom = (λ_ X).hom ≫ f := by
    aesop_cat
  /--
  Naturality of the right unitor: commutativity of `X ⊗ 𝟙_ C ⟶ Y ⊗ 𝟙_ C ⟶ Y` and `X ⊗ 𝟙_ C ⟶ X ⟶ Y`
  -/
  rightUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), f ▷ 𝟙_ _ ≫ (ρ_ Y).hom = (ρ_ X).hom ≫ f := by
    aesop_cat
  /--
  The pentagon identity relating the isomorphism between `X ⊗ (Y ⊗ (Z ⊗ W))` and `((X ⊗ Y) ⊗ Z) ⊗ W`
  -/
  pentagon :
    ∀ W X Y Z : C,
      (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom ≫ W ◁ (α_ X Y Z).hom =
        (α_ (W ⊗ X) Y Z).hom ≫ (α_ W X (Y ⊗ Z)).hom := by
    aesop_cat
  /--
  The identity relating the isomorphisms between `X ⊗ (𝟙_ C ⊗ Y)`, `(X ⊗ 𝟙_ C) ⊗ Y` and `X ⊗ Y`
  -/
  triangle :
    ∀ X Y : C, (α_ X (𝟙_ _) Y).hom ≫ X ◁ (λ_ Y).hom = (ρ_ X).hom ▷ Y := by
    aesop_cat

[self : CategoryTheory.MonoidalCategory C]

CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.comp f₁ g₁)
    (CategoryTheory.CategoryStruct.comp f₂ g₂) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom f₁ f₂)
    (CategoryTheory.MonoidalCategory.tensorHom g₁ g₂)


@[simp, norm_cast]
theorem coe_sort_coe : ((p : Set B) : Type _) = p

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]
(p : A)


/-- The `n+1`-th iterated derivative can be obtained by taking the `n`-th derivative of the
derivative. -/
theorem iteratedDeriv_succ' : iteratedDeriv (n + 1) f = iteratedDeriv n (deriv f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}


theorem Equiv.trans : ∀ {l₁ l₂ l₃ : Lists α}, l₁ ~ l₂ → l₂ ~ l₃ → l₁ ~ l₃


@[to_additive]
lemma Commute.smul_right [Mul α] [SMulCommClass M α α] [IsScalarTower M α α] {a b : α}
    (h : Commute a b) (r : M) : Commute a (r • b)

{M : Type u_1}
{α : Type u_7}
[VAdd M α]
[Add α]
[VAddCommClass M α α]
[VAddAssocClass M α α]
{a b : α}
(h : AddCommute a b)
(r : M)


@[simp]
theorem lift_self_apply (h : IsAdjoinRoot S f) (x : S) :
    h.lift (algebraMap R S) h.root h.aeval_root x = x

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{f : R[X]}
(h : IsAdjoinRoot S f)
(x : S)

(IsAdjoinRoot.lift (algebraMap R S) h.root ⋯ h) x = x


/-- Subtracting a multiple of the first vector passed to `oangle` from the second vector does
not change the sign of the angle. -/
@[simp]
theorem oangle_sign_sub_smul_right (x y : V) (r : ℝ) :
    (o.oangle x (y - r • x)).sign = (o.oangle x y).sign

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


theorem CondIndepFun.neg_right {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β']
    [MeasurableNeg β'] (hfg : CondIndepFun m' hm' f g μ)  :
    CondIndepFun m' hm' f (-g) μ

(hfg : ProbabilityTheory.CondIndepFun m' hm' f g μ)

ProbabilityTheory.CondIndepFun m' hm' f (-g) μ


theorem ortho_comm {x y} : IsOrtho B x y ↔ IsOrtho B y x

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
(H : B.IsRefl)
{x y : M₁}


@[to_additive]
theorem mem_prod_list_ofFn {a : α} {s : Fin n → Set α} :
    a ∈ (List.ofFn s).prod ↔ ∃ f : ∀ i : Fin n, s i, (List.ofFn fun i ↦ (f i : α)).prod = a

{α : Type u_2}
[Monoid α]
{n : ℕ}
{a : α}
{s : Fin n → Set α}

a ∈ (List.ofFn s).prod ↔ ∃ f, (List.ofFn fun i => ↑(f i)).prod = a


/-- All points have distance from the circumcenter equal to the
circumradius. -/
@[simp]
theorem dist_circumcenter_eq_circumradius {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n + 1)) :
    dist (s.points i) s.circumcenter = s.circumradius

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)
(i : Fin (n + 1))


lemma map_rootsOfUnity {S F} [CommRing S] [IsDomain S] [FunLike F R S] [MonoidHomClass F R S]
    {ζ : R} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) {f : F} (hf : Function.Injective f) :
    (rootsOfUnity n R).map (Units.map f) = rootsOfUnity n S

{R : Type u_4}
[CommRing R]
[IsDomain R]
{S : Type u_7}
{F : Type u_8}
[CommRing S]
[IsDomain S]
[FunLike F R S]
[MonoidHomClass F R S]
{ζ : R}
{n : ℕ+}
(hζ : IsPrimitiveRoot ζ ↑n)
{f : F}
(hf : Function.Injective ⇑f)

Subgroup.map (Units.map ↑f) (rootsOfUnity n R) = rootsOfUnity n S


@[simp]
theorem toIocMod_add_left (a b : α) : toIocMod hp a (p + b) = toIocMod hp a b

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


@[to_additive (attr := simp)]
lemma fiberEquiv_symm_apply (f : α →* H) (a b : α) (g : f ⁻¹' {f b}) :
    (f.fiberEquiv a b).symm g = a * (b⁻¹ * g)

{α : Type u_1}
[Group α]
{H : Type u_2}
[Group H]
(f : α →* H)
(a b : α)
(g : ↑(⇑f ⁻¹' {f b}))

↑((f.fiberEquiv a b).symm g) = a * (b⁻¹ * ↑g)


theorem uniqueDiffOn_Iic (a : ℝ) : UniqueDiffOn ℝ (Iic a)


theorem Finite.of_prod_right (h : (s ×ˢ t : Set (α × β)).Finite) : s.Nonempty → t.Finite

{α : Type u}
{β : Type v}
{s : Set α}
{t : Set β}
(h : (s ×ˢ t).Finite)


theorem iteratedDerivWithin_const_smul (c : R) (hf : ContDiffOn 𝕜 n f s) :
    iteratedDerivWithin n (c • f) s x = c • iteratedDerivWithin n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{R : Type u_3}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
{n : ℕ}
{x : 𝕜}
{s : Set 𝕜}
(hx : x ∈ s)
(h : UniqueDiffOn 𝕜 s)
{f : 𝕜 → F}
(c : R)
(hf : ContDiffOn 𝕜 (↑n) f s)


@[to_additive (attr := simp)]
theorem mk_prod {G ι : Type*} [CommGroup G] (N : Subgroup G) (s : Finset ι) {f : ι → G} :
    ((Finset.prod s f : G) : G ⧸ N) = Finset.prod s (fun i => (f i : G ⧸ N))

{G : Type u_1}
{ι : Type u_2}
[CommGroup G]
(N : Subgroup G)
(s : Finset ι)
{f : ι → G}


theorem compProd_eq_sum_compProd_right (κ : Kernel α β) (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] : κ ⊗ₖ η = Kernel.sum fun n => κ ⊗ₖ seq η n

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

κ.compProd η = ProbabilityTheory.Kernel.sum fun n => κ.compProd (η.seq n)


lemma im_mul_ofReal (z : ℂ) (r : ℝ) : (z * r).im = z.im *  r


theorem HasBasis.sup_principal (hl : l.HasBasis p s) (t : Set α) :
    (l ⊔ 𝓟 t).HasBasis p fun i => s i ∪ t

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(hl : l.HasBasis p s)
(t : Set α)


theorem continuousLinearMapToWeakSpace_bijective :
    Function.Bijective (continuousLinearMapToWeakSpace 𝕜 E)

{𝕜 : Type u_2}
{E : Type u_5}
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[TopologicalSpace E]

Function.Bijective ⇑(continuousLinearMapToWeakSpace 𝕜 E)


/-- Compute the source of the composition of two partial homeomorphisms induced by fiberwise linear
equivalences. -/
theorem source_trans_partialHomeomorph (hU : IsOpen U)
    (hφ : ContinuousOn (fun x => φ x : B → F →L[𝕜] F) U)
    (h2φ : ContinuousOn (fun x => (φ x).symm : B → F →L[𝕜] F) U) (hU' : IsOpen U')
    (hφ' : ContinuousOn (fun x => φ' x : B → F →L[𝕜] F) U')
    (h2φ' : ContinuousOn (fun x => (φ' x).symm : B → F →L[𝕜] F) U') :
    (FiberwiseLinear.partialHomeomorph φ hU hφ h2φ ≫ₕ
          FiberwiseLinear.partialHomeomorph φ' hU' hφ' h2φ').source =
      (U ∩ U') ×ˢ univ

(h2φ : ContinuousOn (fun x => ↑(φ x).symm) U)

(hφ' : ContinuousOn (fun x => ↑(φ' x)) U')

(h2φ' : ContinuousOn (fun x => ↑(φ' x).symm) U')

(FiberwiseLinear.partialHomeomorph φ hU hφ h2φ ≫ₕ FiberwiseLinear.partialHomeomorph φ' hU' hφ' h2φ').source =
  (U ∩ U') ×ˢ Set.univ


@[simp]
theorem fract_add_int (a : α) (m : ℤ) : fract (a + m) = fract a

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


theorem smoothAt_pi_space :
    SmoothAt I 𝓘(𝕜, ∀ i, Fi i) φ x ↔ ∀ i, SmoothAt I 𝓘(𝕜, Fi i) (fun x => φ x i) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{x : M}
{ι : Type u_21}
[Fintype ι]
{Fi : ι → Type u_22}
[(i : ι) → NormedAddCommGroup (Fi i)]
[(i : ι) → NormedSpace 𝕜 (Fi i)]
{φ : M → (i : ι) → Fi i}

SmoothAt I 𝓘(𝕜, (i : ι) → Fi i) φ x ↔ ∀ (i : ι), SmoothAt I 𝓘(𝕜, Fi i) (fun x => φ x i) x


@[to_additive]
lemma eq_mul_of_ne_all {x y z : G} (hx : x ≠ 1)
    (hy : y ≠ 1) (hxy : x ≠ y) (hz : z ≠ 1) (hzx : z ≠ x) (hzy : z ≠ y) : z = x * y

{G : Type u_1}
[AddGroup G]
[IsAddKleinFour G]
{x y z : G}
(hx : x ≠ 0)
(hy : y ≠ 0)
(hxy : x ≠ y)
(hz : z ≠ 0)
(hzx : z ≠ x)
(hzy : z ≠ y)


protected theorem isTrans : ∀ (_ : r ↪r s) [IsTrans β s], IsTrans α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}

r ↪r s → ∀ [inst : IsTrans β s], IsTrans α r


theorem tendstoLocallyUniformly_iff_forall_tendsto :
    TendstoLocallyUniformly F f p ↔
      ∀ x, Tendsto (fun y : ι × α => (f y.2, F y.1 y.2)) (p ×ˢ 𝓝 x) (𝓤 β)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
[TopologicalSpace α]

TendstoLocallyUniformly F f p ↔ ∀ (x : α), Filter.Tendsto (fun y => (f y.2, F y.1 y.2)) (p ×ˢ 𝓝 x) (𝓤 β)


theorem inter_iInter_nat_succ (u : ℕ → Set α) : (u 0 ∩ ⋂ i, u (i + 1)) = ⋂ i, u i


/-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded, subadditive function that preserves
  zero and negation, then `seminormFromBounded' f` is a norm if and only if `f⁻¹' {0} = {0}`. -/
theorem seminormFromBounded_is_norm_iff (f_zero : f 0 = 0) (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y)
    (f_add : ∀ a b, f (a + b) ≤ f a + f b) (f_neg : ∀ x : R, f (-x) = f x) :
    (∀ x : R, (seminormFromBounded f_zero f_nonneg f_mul f_add f_neg).toFun x = 0 → x = 0) ↔
      f ⁻¹' {0} = {0}

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)

(f_add : ∀ (a b : R), f (a + b) ≤ f a + f b)

(∀ (x : R), (seminormFromBounded f_zero f_nonneg f_mul f_add f_neg).toFun x = 0 → x = 0) ↔ f ⁻¹' {0} = {0}


lemma isInt_ediv_neg {a b q q' : ℤ} (h : IsInt (a / -b) q) (hq : -q = q') : IsInt (a / b) q'

(h : Mathlib.Meta.NormNum.IsInt (a / -b) q)


@[fun_prop]
theorem DifferentiableAt.const_mul (ha : DifferentiableAt 𝕜 a x) (b : 𝔸) :
    DifferentiableAt 𝕜 (fun y => b * a y) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
(ha : DifferentiableAt 𝕜 a x)
(b : 𝔸)


theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟶ Y) (g : X ⟶ Y') :
    f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm

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

CategoryTheory.CategoryStruct.comp f (CategoryTheory.eqToHom p) = g ↔
  f = CategoryTheory.CategoryStruct.comp g (CategoryTheory.eqToHom ⋯)


@[to_additive (attr := simp)]
theorem Step.not_rev {x b} : Step (L₁ ++ (x, !b) :: (x, b) :: L₂) (L₁ ++ L₂)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
{x : α}
{b : Bool}

FreeAddGroup.Red.Step (L₁ ++ (x, !b) :: (x, b) :: L₂) (L₁ ++ L₂)


lemma ringEquivCongr_ringEquivCongr_apply {a b c : ℕ} (hab : a = b) (hbc : b = c) (x : ZMod a) :
    ringEquivCongr hbc (ringEquivCongr hab x) = ringEquivCongr (hab.trans hbc) x

(ZMod.ringEquivCongr hbc) ((ZMod.ringEquivCongr hab) x) = (ZMod.ringEquivCongr ⋯) x


@[reassoc (attr := simp)]
lemma finiteCoproduct.ι_desc {B : Stonean.{u}} (e : (a : α) → (X a ⟶ B)) (a : α) :
    finiteCoproduct.ι X a ≫ finiteCoproduct.desc X e = e a

{α : Type}
[Finite α]
(X : α → Stonean)
{B : Stonean}
(e : (a : α) → X a ⟶ B)
(a : α)

Stonean.finiteCoproduct.ι X a ≫ Stonean.finiteCoproduct.desc X e = e a


lemma homologyFunctor_inverts_quasiIso (i : ι) :
    (quasiIso C c).IsInvertedBy (homologyFunctor C c i)

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
{ι : Type u_2}
(c : ComplexShape ι)
[CategoryTheory.Preadditive C]
[CategoryTheory.CategoryWithHomology C]
(i : ι)

(HomotopyCategory.quasiIso C c).IsInvertedBy (HomotopyCategory.homologyFunctor C c i)


/-- The infimum distance to `s` and `t` are the same, up to the Hausdorff distance
between `s` and `t` -/
theorem infDist_le_infDist_add_hausdorffDist (fin : hausdorffEdist s t ≠ ⊤) :
    infDist x t ≤ infDist x s + hausdorffDist s t

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
{x : α}
(fin : EMetric.hausdorffEdist s t ≠ ⊤)

Metric.infDist x t ≤ Metric.infDist x s + Metric.hausdorffDist s t


@[simp]
theorem length_reverse {u v : V} (p : G.Walk u v) : p.reverse.length = p.length

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


lemma addY_self {P : Fin 3 → R} (hP : W'.Equation P) : W'.addY P P = 0

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P : Fin 3 → R}
(hP : W'.Equation P)


/-- A simplicial complex in a `𝕜`-module is a collection of simplices which glue nicely together.
Note that the textbook meaning of "glue nicely" is given in
`Geometry.SimplicialComplex.disjoint_or_exists_inter_eq_convexHull`. It is mostly useless, as
`Geometry.SimplicialComplex.convexHull_inter_convexHull` is enough for all purposes. -/
@[ext]
structure SimplicialComplex where
  /-- the faces of this simplicial complex: currently, given by their spanning vertices -/
  faces : Set (Finset E)
  /-- the empty set is not a face: hence, all faces are non-empty -/
  not_empty_mem : ∅ ∉ faces
  /-- the vertices in each face are affine independent: this is an implementation detail -/
  indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E)
  /-- faces are downward closed: a non-empty subset of its spanning vertices spans another face -/
  down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces
  inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces →
    convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(self : Geometry.SimplicialComplex 𝕜 E)
{s : Finset E}

s ∈ self.faces → AffineIndependent 𝕜 Subtype.val


lemma finrank_ker_add_one_of_ne_zero :
    finrank K (LinearMap.ker f) + 1 = finrank K V₁

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
[AddCommGroup V₁]
[Module K V₁]
[FiniteDimensional K V₁]
{f : Module.Dual K V₁}
(hf : f ≠ 0)

FiniteDimensional.finrank K ↥(LinearMap.ker f) + 1 = FiniteDimensional.finrank K V₁


theorem frontier_closure_subset : frontier (closure s) ⊆ frontier s

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


@[simp]
theorem blockDiagonal'_pow [∀ i, DecidableEq (m' i)] [Fintype o] [∀ i, Fintype (m' i)] [Semiring α]
    (M : ∀ i, Matrix (m' i) (m' i) α) (n : ℕ) : blockDiagonal' (M ^ n) = blockDiagonal' M ^ n

{o : Type u_4}
{m' : o → Type u_7}
{α : Type u_12}
[DecidableEq o]
[(i : o) → DecidableEq (m' i)]
[Fintype o]
[(i : o) → Fintype (m' i)]
[Semiring α]
(M : (i : o) → Matrix (m' i) (m' i) α)
(n : ℕ)

Matrix.blockDiagonal' (M ^ n) = Matrix.blockDiagonal' M ^ n


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

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


theorem maximals_Icc (hab : a ≤ b) : maximals (· ≤ ·) (Icc a b) = {b}

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

maximals (fun x x_1 => x ≤ x_1) (Set.Icc a b) = {b}


theorem associator_hom (X Y Z : C) :
    (α_ X Y Z).hom =
      coprod.desc (coprod.desc coprod.inl (coprod.inl ≫ coprod.inr)) (coprod.inr ≫ coprod.inr)

(CategoryTheory.MonoidalCategory.associator X Y Z).hom =
  CategoryTheory.Limits.coprod.desc
    (CategoryTheory.Limits.coprod.desc CategoryTheory.Limits.coprod.inl
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.coprod.inl CategoryTheory.Limits.coprod.inr))
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.coprod.inr CategoryTheory.Limits.coprod.inr)


/-- Homotopy between morphisms of short complexes is compatible with addition. -/
@[simps]
def add (h : Homotopy φ₁ φ₂) (h' : Homotopy φ₃ φ₄) : Homotopy (φ₁ + φ₃) (φ₂ + φ₄)

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

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

(h' : CategoryTheory.ShortComplex.Homotopy φ₃ φ₄)


theorem ofDigits_one (L : List ℕ) : ofDigits 1 L = L.sum


/-- Integrally closed domains are precisely the domains for in which Gauss's lemma holds
    for monic polynomials -/
theorem isIntegrallyClosed_iff' :
    IsIntegrallyClosed R ↔
      ∀ p : R[X], p.Monic → (Irreducible p ↔ Irreducible (p.map <| algebraMap R K))

{R : Type u_1}
[CommRing R]
{K : Type u_2}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDomain R]

IsIntegrallyClosed R ↔ ∀ (p : R[X]), p.Monic → (Irreducible p ↔ Irreducible (Polynomial.map (algebraMap R K) p))


private lemma adic_surj : Function.Surjective (map I f)

{R : Type u}
[CommRing R]
(I : Ideal R)
(M : Type u)
[AddCommGroup M]
[Module R M]
{ι : Type}
(f : (ι → R) →ₗ[R] M)
(hf : Function.Surjective ⇑f)

Function.Surjective ⇑(AdicCompletion.map I f)


@[to_additive] lemma Perm.prod_eq (h : Perm l₁ l₂) : prod l₁ = prod l₂

{M : Type u_4}
[CommMonoid M]
{l₁ l₂ : List M}
(h : l₁ ~ l₂)


theorem Disjoint.cycleFactorsFinset_mul_eq_union {f g : Perm α} (h : Disjoint f g) :
    cycleFactorsFinset (f * g) = cycleFactorsFinset f ∪ cycleFactorsFinset g

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

(f * g).cycleFactorsFinset = f.cycleFactorsFinset ∪ g.cycleFactorsFinset


@[simp]
theorem mem_orbit_conjAct {g h : G} : g ∈ orbit (ConjAct G) h ↔ IsConj g h

g ∈ MulAction.orbit (ConjAct G) h ↔ IsConj g h


@[simp]
theorem mapPresheaf_map_c (F : C ⥤ D) {X Y : PresheafedSpace C} (f : X ⟶ Y) :
    (F.mapPresheaf.map f).c = whiskerRight f.c F

{X Y : AlgebraicGeometry.PresheafedSpace C}

(F.mapPresheaf.map f).c = CategoryTheory.whiskerRight f.c F


theorem hammingDist_comp_le_hammingDist (f : ∀ i, γ i → β i) {x y : ∀ i, γ i} :
    (hammingDist (fun i => f i (x i)) fun i => f i (y i)) ≤ hammingDist x y

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
{γ : ι → Type u_4}
[(i : ι) → DecidableEq (γ i)]
(f : (i : ι) → γ i → β i)
{x y : (i : ι) → γ i}


@[to_additive (attr := deprecated IsCompact.measure_closure (since := "2024-01-28"))]
lemma _root_.IsCompact.measure_closure_eq_of_group {k : Set G} (hk : IsCompact k) (μ : Measure G) :
    μ (closure k) = μ k

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{k : Set G}
(hk : IsCompact k)
(μ : MeasureTheory.Measure G)


theorem range_mem_nhds (hf : IsOpenMap f) (x : X) : range f ∈ 𝓝 (f x)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)
(x : X)


@[simp]
lemma leftUnitor_inv_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x : K.obj Δ) :
    (λ_ K).inv.app Δ x = ⟨PUnit.unit, x⟩

(K : SSet)
{Δ : SimplexCategoryᵒᵖ}
(x : K.obj Δ)


lemma hasSum_jacobiTheta₂_term (z : ℂ) {τ : ℂ} (hτ : 0 < im τ) :
    HasSum (fun n ↦ jacobiTheta₂_term n z τ) (jacobiTheta₂ z τ)

HasSum (fun n => jacobiTheta₂_term n z τ) (jacobiTheta₂ z τ)


protected theorem Eventually.and {p q : α → Prop} {f : Filter α} :
    f.Eventually p → f.Eventually q → ∀ᶠ x in f, p x ∧ q x

{α : Type u}
{p q : α → Prop}
{f : Filter α}

Filter.Eventually p f → Filter.Eventually q f → ∀ᶠ (x : α) in f, p x ∧ q x


theorem eq_set_map_one_map_mul [Nontrivial 𝕜] :
    characterSpace 𝕜 A = {φ : WeakDual 𝕜 A | φ 1 = 1 ∧ ∀ x y : A, φ (x * y) = φ x * φ y}

{𝕜 : Type u_1}
{A : Type u_2}
[CommRing 𝕜]
[NoZeroDivisors 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[TopologicalSpace A]
[Semiring A]
[Algebra 𝕜 A]
[Nontrivial 𝕜]

WeakDual.characterSpace 𝕜 A = {φ | φ 1 = 1 ∧ ∀ (x y : A), φ (x * y) = φ x * φ y}


theorem lsum_single (f : α → M →ₗ[R] N) (i : α) (m : M) :
    Finsupp.lsum S f (Finsupp.single i m) = f i m

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{R : Type u_5}
(S : Type u_6)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Module S N]
[SMulCommClass R S N]
(f : α → M →ₗ[R] N)
(i : α)
(m : M)

((Finsupp.lsum S) f) (Finsupp.single i m) = (f i) m


@[simp]
theorem linearEquivFunOnFinite_single [DecidableEq α] (x : α) (m : M) :
    (linearEquivFunOnFinite R M α) (single x m) = Pi.single x m

(R : Type u_1)
(M : Type u_3)
(α : Type u_4)
[Finite α]
[AddCommMonoid M]
[Semiring R]
[Module R M]
[DecidableEq α]
(x : α)
(m : M)

(Finsupp.linearEquivFunOnFinite R M α) (Finsupp.single x m) = Pi.single x m


/-- The formula x(P₁ + P₂) = x(P₁ - P₂) - ψ(P₁)ψ(P₂) / (x(P₂) - x(P₁))²,
where ψ(x,y) = 2y + a₁x + a₃. -/
lemma addX_eq_addX_negY_sub :
    W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂) = W.addX x₁ x₂ (W.slope x₁ x₂ y₁ (W.negY x₂ y₂))
      - (y₁ - W.negY x₁ y₁) * (y₂ - W.negY x₂ y₂) / (x₂ - x₁) ^ 2

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ : F}
(y₁ y₂ : F)
(hx : x₁ ≠ x₂)


/-- The full set is a (trivial) block -/
theorem isBlock_top : IsBlock G (⊤ : Set X)

{G : Type u_1}
[Group G]
(X : Type u_2)
[MulAction G X]


theorem sInf_union {s t : Set α} : sInf (s ∪ t) = sInf s ⊓ sInf t

{α : Type u_1}
[CompleteLattice α]
{s t : Set α}


@[simp]
lemma piecewise_idem_right (f g₁ g₂ : ∀ a, π a) :
    s.piecewise f (s.piecewise g₁ g₂) = s.piecewise f g₂

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


/-- The terms in the sequence `seminormFromConst_seq c f x` are nonnegative. -/
theorem seminormFromConst_seq_nonneg (x : R) : 0 ≤ seminormFromConst_seq c f x

{R : Type u_1}
[CommRing R]
(c : R)
(f : RingSeminorm R)
(x : R)


@[simp]
theorem id_comp (f : A →⋆ₐ[R] B) : (StarAlgHom.id _ _).comp f = f

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


theorem union_eq_sdiff_union_sdiff_union_inter (s t : Finset α) : s ∪ t = s \ t ∪ t \ s ∪ s ∩ t

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


@[simp] theorem dropLast_take {n : ℕ} {xs : Stream' α} :
    (Stream'.take n xs).dropLast = Stream'.take (n-1) xs

(Stream'.take n xs).dropLast = Stream'.take (n - 1) xs


@[simp]
theorem comp_apply (f : LatticeHom β γ) (g : LatticeHom α β) (a : α) : (f.comp g) a = f (g a)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
(f : LatticeHom β γ)
(g : LatticeHom α β)
(a : α)


theorem measurableSet_sup {m₁ m₂ : MeasurableSpace α} {s : Set α} :
    MeasurableSet[m₁ ⊔ m₂] s ↔ GenerateMeasurable (MeasurableSet[m₁] ∪ MeasurableSet[m₂]) s

{α : Type u_1}
{m₁ m₂ : MeasurableSpace α}
{s : Set α}

MeasurableSet s ↔ MeasurableSpace.GenerateMeasurable (MeasurableSet ∪ MeasurableSet) s


@[simp]
theorem algebraMap_star_comm (r : R) : algebraMap R A (star r) = star (algebraMap R A r)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarMul A]
[Algebra R A]
[StarModule R A]
(r : R)

(algebraMap R A) (star r) = star ((algebraMap R A) r)


theorem mem_discrete_iff {c d : C} (f : c ⟶ d) :
    f ∈ discrete.arrows c d ↔ ∃ h : c = d, f = eqToHom h

{C : Type u}
[CategoryTheory.Groupoid C]
{c d : C}
(f : c ⟶ d)

f ∈ CategoryTheory.Subgroupoid.discrete.arrows c d ↔ ∃ (h : c = d), f = CategoryTheory.eqToHom h


theorem ne_false_of_self : p → p ≠ False


theorem Continuous.fin_insertNth {n} {π : Fin (n + 1) → Type*} [∀ i, TopologicalSpace (π i)]
    (i : Fin (n + 1)) {f : X → π i} (hf : Continuous f) {g : X → ∀ j : Fin n, π (i.succAbove j)}
    (hg : Continuous g) : Continuous fun a => i.insertNth (f a) (g a)

[(i : Fin (n + 1)) → TopologicalSpace (π i)]

{g : X → (j : Fin n) → π (i.succAbove j)}


protected theorem continuous' [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousConstSMul 𝕜 E]
    {p : Seminorm 𝕜 E} {r : ℝ} (hp : p.closedBall 0 r ∈ (𝓝 0 : Filter E)) :
    Continuous p

{𝕜 : Type u_3}
{E : Type u_7}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{p : Seminorm 𝕜 E}
{r : ℝ}
(hp : p.closedBall 0 r ∈ 𝓝 0)


theorem continuousWithinAt_arg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0) (him : z.im = 0) :
    ContinuousWithinAt arg { z : ℂ | 0 ≤ z.im } z

ContinuousWithinAt Complex.arg {z | 0 ≤ z.im} z


theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(X : CategoryTheory.SimplicialObject C)
{n q : ℕ}
(i : Fin (n + 1))
(hi : n + 1 ≤ ↑i + q)

X.σ i ≫ (AlgebraicTopology.DoldKan.P q).f (n + 1) = 0


@[to_additive] lemma oneLePart_le_one : a⁺ᵐ ≤ 1 ↔ a ≤ 1

{α : Type u_1}
[Lattice α]
[Group α]
{a : α}

a⁺ᵐ ≤ 1 ↔ a ≤ 1


/-- The equivalence `Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α`. -/
@[simps!]
def karoubiChainComplexEquivalence : Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α

(P : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C (ComplexShape.down α)))

(((CategoryTheory.Idempotents.karoubiChainComplexEquivalence C α).functor.obj P).d i j).f =
  CategoryTheory.CategoryStruct.comp (P.X.d i j) (P.p.f j)


theorem epi_of_cokernel_π_eq_zero (h : cokernel.π f = 0) : Epi f

(h : CategoryTheory.Limits.cokernel.π f = 0)


theorem isMittagLeffler_of_exists_finite_range
    (h : ∀ j : J, ∃ (i : _) (f : i ⟶ j), (range <| F.map f).Finite) : F.IsMittagLeffler

(h : ∀ (j : J), ∃ i f, (Set.range (F.map f)).Finite)


theorem symm_image_target_inter_eq (s : Set β) :
    e.symm '' (e.target ∩ s) = e.source ∩ e ⁻¹' (e.target ∩ s)

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(s : Set β)

↑e.symm '' (e.target ∩ s) = e.source ∩ ↑e ⁻¹' (e.target ∩ s)


theorem minimum_of_length_pos_le_of_mem (h : a ∈ l) (w : 0 < l.length) :
    l.minimum_of_length_pos w ≤ a

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


@[simp]
theorem toSubring_zero : toSubring (0 : R[X]) T (by simp [coeffs]) = 0


/-- In the range `[0, π / 2]`, we have a linear lower bound on `sin`. This inequality forms one half
of Jordan's inequality, the other half is `Real.sin_lt` -/
theorem mul_le_sin {x : ℝ} (hx : 0 ≤ x) (hx' : x ≤ π / 2) : 2 / π * x ≤ sin x

{x : ℝ}
(hx : 0 ≤ x)
(hx' : x ≤ Real.pi / 2)


theorem coeff_add_eq_left_of_lt (qn : q.natDegree < n) : (p + q).coeff n = p.coeff n

{R : Type u}
{n : ℕ}
[Semiring R]
{p q : R[X]}
(qn : q.natDegree < n)


@[to_additive]
theorem div_mul : a / b * c = a / (b / c)

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


theorem prev_mem (s : Cycle α) (hs : Nodup s) (x : α) (hx : x ∈ s) : s.prev hs x hx ∈ s

{α : Type u_1}
[DecidableEq α]
(s : Cycle α)
(hs : s.Nodup)
(x : α)
(hx : x ∈ s)


@[simp]
theorem mem_powersetCard {n : ℕ} {s t : Multiset α} : s ∈ powersetCard n t ↔ s ≤ t ∧ card s = n

{α : Type u_1}
{n : ℕ}
{s t : Multiset α}

s ∈ Multiset.powersetCard n t ↔ s ≤ t ∧ Multiset.card s = n


/-- An additive character is nontrivial iff it is not the trivial character. -/
@[deprecated ne_one_iff (since := "2024-06-06")]
lemma isNontrivial_iff_ne_trivial (ψ : AddChar A M) : IsNontrivial ψ ↔ ψ ≠ 1

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)


/-- Reinterpret `α →+ Additive β` as `Multiplicative α →* β`. -/
@[simps]
def AddMonoidHom.toMultiplicative'' [AddZeroClass α] [MulOneClass β] :
    (α →+ Additive β) ≃ (Multiplicative α →* β)

{α : Type u}
{β : Type v}
[AddZeroClass α]
[MulOneClass β]
(f : α →+ Additive β)
(a : Multiplicative α)

(AddMonoidHom.toMultiplicative'' f) a = Additive.toMul (f (Multiplicative.toAdd a))


lemma isLocalization_C_mk' (a : R) (m : M) :
    C (IsLocalization.mk' S a m) = IsLocalization.mk' (MvPolynomial σ S) (C (σ := σ) a)
      ⟨C m, Submonoid.mem_map_of_mem C m.property⟩

{σ : Type u_1}
{R : Type u_2}
[CommRing R]
(M : Submonoid R)
(S : Type u_3)
[CommRing S]
[Algebra R S]
[IsLocalization M S]
(a : R)
(m : ↥M)

MvPolynomial.C (IsLocalization.mk' S a m) =
  IsLocalization.mk' (MvPolynomial σ S) (MvPolynomial.C a) ⟨MvPolynomial.C ↑m, ⋯⟩


theorem inter_left' (u : Set α) (h : Disjoint s t) : Disjoint (u ∩ s) t

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


/-- Auxiliary definition for the `MonoidalCategory` instance on `Center C`. -/
@[simps]
def tensorHom {X₁ Y₁ X₂ Y₂ : Center C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    tensorObj X₁ X₂ ⟶ tensorObj Y₁ Y₂

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

(CategoryTheory.Center.tensorHom f g).f = f.f ⊗ g.f


@[to_additive]
theorem pow_mem_ball {n : ℕ} (hn : 0 < n) (h : a ∈ ball b r) : a ^ n ∈ ball (b ^ n) (n • r)

{E : Type u_6}
[SeminormedCommGroup E]
{a b : E}
{r : ℝ}
{n : ℕ}
(hn : 0 < n)
(h : a ∈ Metric.ball b r)


theorem lt_bsup_of_ne_bsup {o : Ordinal.{u}} {f : ∀ a < o, Ordinal.{max u v}} :
    (∀ i h, f i h ≠ bsup.{_, v} o f) ↔ ∀ i h, f i h < bsup.{_, v} o f

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v}}

(∀ (i : Ordinal.{u}) (h : i < o), f i h ≠ o.bsup f) ↔ ∀ (i : Ordinal.{u}) (h : i < o), f i h < o.bsup f


theorem productMap_left_apply (a : A) : productMap f g (a ⊗ₜ 1) = f a

{R : Type uR}
{S : Type uS}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[CommSemiring S]
[Algebra R A]
[Algebra R B]
[Algebra R S]
(f : A →ₐ[R] S)
(g : B →ₐ[R] S)
(a : A)

(Algebra.TensorProduct.productMap f g) (a ⊗ₜ[R] 1) = f a


@[reassoc]
lemma ι_totalShift₂Iso_inv_f (a b n : ℤ) (h : a + b = n) (b' n' : ℤ)
    (hb' : a + b' = n') (hn' : n' = n + y) :
    K.ιTotal (up ℤ) a b' n' hb' ≫
      (CochainComplex.shiftFunctorObjXIso (K.total (up ℤ)) y n n' hn').inv ≫
        (K.totalShift₂Iso y).inv.f n =
      (a * y).negOnePow • (K.shiftFunctor₂XXIso a b y b' (by omega)).inv ≫
        ((shiftFunctor₂ C y).obj K).ιTotal (up ℤ) a b n h

(K : HomologicalComplex₂ C (ComplexShape.up ℤ) (ComplexShape.up ℤ))

K.ιTotal (ComplexShape.up ℤ) a b' n' hb' ≫
    (CochainComplex.shiftFunctorObjXIso (K.total (ComplexShape.up ℤ)) y n n' hn').inv ≫ (K.totalShift₂Iso y).inv.f n =
  (a * y).negOnePow •
    (K.shiftFunctor₂XXIso a b y b' ⋯).inv ≫
      ((HomologicalComplex₂.shiftFunctor₂ C y).obj K).ιTotal (ComplexShape.up ℤ) a b n h


theorem IsPositive.add {T S : E →L[𝕜] E} (hT : T.IsPositive) (hS : S.IsPositive) :
    (T + S).IsPositive

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{T S : E →L[𝕜] E}
(hT : T.IsPositive)
(hS : S.IsPositive)


@[to_additive]
theorem le_centralizer [h : H.IsCommutative] : H ≤ centralizer H

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
[h : H.IsCommutative]


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

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


theorem mulVec_injective_iff_isUnit {A : Matrix m m K} :
    Function.Injective A.mulVec ↔ IsUnit A

{m : Type u}
[DecidableEq m]
{K : Type u_3}
[Field K]
[Fintype m]
{A : Matrix m m K}


@[simp]
theorem mul_apply' (x y : 𝕜') : mul 𝕜 𝕜' x y = x * y

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(𝕜' : Type u_3)
[NonUnitalSeminormedRing 𝕜']
[NormedSpace 𝕜 𝕜']
[IsScalarTower 𝕜 𝕜' 𝕜']
[SMulCommClass 𝕜 𝕜' 𝕜']
(x y : 𝕜')

((ContinuousLinearMap.mul 𝕜 𝕜') x) y = x * y


lemma isClopen_sUnion (hS : ∀ s ∈ S, IsClopen s) : IsClopen (⋃₀ S)

{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
{S : Set (Set α)}
(hS : ∀ s ∈ S, IsClopen s)


@[simp]
theorem IsSymm.map {A : Matrix n n α} (h : A.IsSymm) (f : α → β) : (A.map f).IsSymm

{α : Type u_1}
{β : Type u_2}
{n : Type u_3}
{A : Matrix n n α}
(h : A.IsSymm)
(f : α → β)


/-- A chosen extension of a commutative square into a morphism of distinguished triangles. -/
@[simps hom₁ hom₂]
def completeDistinguishedTriangleMorphism (T₁ T₂ : Triangle C)
    (hT₁ : T₁ ∈ distTriang C) (hT₂ : T₂ ∈ distTriang C)
    (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (comm : T₁.mor₁ ≫ b = a ≫ T₂.mor₁) :
    T₁ ⟶ T₂

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

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C)

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

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

(CategoryTheory.Pretriangulated.completeDistinguishedTriangleMorphism T₁ T₂ hT₁ hT₂ a b comm).hom₂ = b


theorem add_mem_Icc_iff_left : a + b ∈ Set.Icc c d ↔ a ∈ Set.Icc (c - b) (d - b)

{α : Type u_1}
[OrderedAddCommGroup α]
{a b c d : α}


lemma cfcₙHom_eq_restrict (f : C(S, R)) (halg : UniformEmbedding (algebraMap R S)) {a : A}
    (hpa : p a) (hqa : q a) (h : QuasispectrumRestricts a f) [CompactSpace (σₙ S a)] :
    cfcₙHom hpa = h.nonUnitalStarAlgHom (cfcₙHom hqa)

(halg : UniformEmbedding ⇑(algebraMap R S))

cfcₙHom hpa = QuasispectrumRestricts.nonUnitalStarAlgHom (cfcₙHom hqa) h


theorem Submodule.span_range_natDegree_eq_adjoin {R A} [CommRing R] [Semiring A] [Algebra R A]
    {x : A} {f : R[X]} (hf : f.Monic) (hfx : aeval x f = 0) :
    span R (Finset.image (x ^ ·) (Finset.range (natDegree f))) =
      Subalgebra.toSubmodule (Algebra.adjoin R {x})

{R : Type u_5}
{A : Type u_6}
[CommRing R]
[Semiring A]
[Algebra R A]
{x : A}
{f : R[X]}
(hf : f.Monic)
(hfx : (Polynomial.aeval x) f = 0)

Submodule.span R ↑(Finset.image (fun x_1 => x ^ x_1) (Finset.range f.natDegree)) =
  Subalgebra.toSubmodule (Algebra.adjoin R {x})


theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
    trop s.sum = Multiset.prod (s.map trop)

{R : Type u_1}
[AddCommMonoid R]
(s : Multiset R)

Tropical.trop s.sum = (Multiset.map Tropical.trop s).prod


/-- The formula
ψ(P₁ + P₂) = (ψ(P₂)(x(P₁) - x(P₃)) - ψ(P₁)(x(P₂) - x(P₃))) / (x(P₂) - x(P₁)),
where ψ(x,y) = 2y + a₁x + a₃. -/
lemma addY_sub_negY_addY :
    letI x₃ := W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂)
    letI y₃ := W.addY x₁ x₂ y₁ (W.slope x₁ x₂ y₁ y₂)
    y₃ - W.negY x₃ y₃ =
      ((y₂ - W.negY x₂ y₂) * (x₁ - x₃) - (y₁ - W.negY x₁ y₁) * (x₂ - x₃)) / (x₂ - x₁)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ : F}
(y₁ y₂ : F)
(hx : x₁ ≠ x₂)

W.addY x₁ x₂ y₁ (W.slope x₁ x₂ y₁ y₂) -
    W.negY (W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂)) (W.addY x₁ x₂ y₁ (W.slope x₁ x₂ y₁ y₂)) =
  ((y₂ - W.negY x₂ y₂) * (x₁ - W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂)) -
      (y₁ - W.negY x₁ y₁) * (x₂ - W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂))) /
    (x₂ - x₁)


@[simp]
theorem homTensorHomEquiv_toLinearMap :
    (homTensorHomEquiv R M N P Q).toLinearMap = homTensorHomMap R M N P Q

(R : Type u)
(M : Type v₁)
(N : Type v₂)
(P : Type v₃)
(Q : Type v₄)
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[AddCommGroup Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
[Module.Free R M]
[Module.Finite R M]
[Module.Free R N]
[Module.Finite R N]

↑(homTensorHomEquiv R M N P Q) = TensorProduct.homTensorHomMap R M N P Q


@[simp]
theorem le_zero [LE R] [OrderTop R] (x : Tropical R) : x ≤ 0

{R : Type u}
[LE R]
[OrderTop R]
(x : Tropical R)


@[elab_as_elim]
theorem cons_induction_on {α : Type*} {p : Finset α → Prop} (s : Finset α) (h₁ : p ∅)
    (h₂ : ∀ ⦃a : α⦄ {s : Finset α} (h : a ∉ s), p s → p (cons a s h)) : p s

(h₂ : ∀ ⦃a : α⦄ {s : Finset α} (h : a ∉ s), p s → p (Finset.cons a s h))


theorem dyadic_aux {m₁ m₂ : ℤ} {y₁ y₂ : ℕ} (h₂ : m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂) :
    m₁ * powHalf y₂ = m₂ * powHalf y₁

↑m₁ * Surreal.powHalf y₂ = ↑m₂ * Surreal.powHalf y₁


@[to_additive (attr := simp)] lemma monovary_inv_left : Monovary f⁻¹ g ↔ Antivary f g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{f : ι → α}
{g : ι → β}


@[simp, norm_cast]
theorem real_le_real {x y : ℝ} : (x : ℂ) ≤ (y : ℂ) ↔ x ≤ y

↑x ≤ ↑y ↔ x ≤ y


/-- If a function `f` is `Periodic` with positive period `c`, then for all `x` there exists some
  `y ∈ Ico a (a + c)` such that `f x = f y`. -/
theorem Periodic.exists_mem_Ico [LinearOrderedAddCommGroup α] [Archimedean α] (h : Periodic f c)
    (hc : 0 < c) (x a) : ∃ y ∈ Ico a (a + c), f x = f y

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[LinearOrderedAddCommGroup α]
[Archimedean α]
(h : Function.Periodic f c)
(hc : 0 < c)
(x a : α)


lemma map_add_right_Icc (a b c : α) : ((Icc a b).map fun x => x + c) = Icc (a + c) (b + c)

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
(a b c : α)

Multiset.map (fun x => x + c) (Multiset.Icc a b) = Multiset.Icc (a + c) (b + c)


@[simp] theorem Decidable.not_not [Decidable p] : ¬¬p ↔ p


theorem toSpanSingleton_homothety (x : E) (c : 𝕜) :
    ‖LinearMap.toSpanSingleton 𝕜 E x c‖ = ‖x‖ * ‖c‖

(𝕜 : Type u_1)
{E : Type u_2}
[NormedDivisionRing 𝕜]
[SeminormedAddCommGroup E]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
(x : E)
(c : 𝕜)

‖(LinearMap.toSpanSingleton 𝕜 E x) c‖ = ‖x‖ * ‖c‖


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

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Inf β]
(f : InfHom α β)
(f' : α → β)
(h : f' = ⇑f)


theorem widePullback_ext {B : C} {ι : Type w} {X : ι → C} (f : ∀ j : ι, X j ⟶ B)
    [HasWidePullback B X f] [PreservesLimit (wideCospan B X f) (forget C)]
    (x y : ↑(widePullback B X f)) (h₀ : base f x = base f y) (h : ∀ j, π f j x = π f j y) :
    x = y

[CategoryTheory.Limits.HasWidePullback B X f]

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.WidePullbackShape.wideCospan B X f)
    (CategoryTheory.forget C)]

(x y : (CategoryTheory.forget C).obj (CategoryTheory.Limits.widePullback B X f))

(h₀ : (CategoryTheory.Limits.WidePullback.base f) x = (CategoryTheory.Limits.WidePullback.base f) y)

(h : ∀ (j : ι), (CategoryTheory.Limits.WidePullback.π f j) x = (CategoryTheory.Limits.WidePullback.π f j) y)


theorem ne_zero_of_dvd_ne_zero {p q : α} (h₁ : q ≠ 0) (h₂ : p ∣ q) : p ≠ 0

{α : Type u_1}
[MonoidWithZero α]
{p q : α}
(h₁ : q ≠ 0)
(h₂ : p ∣ q)


theorem comap_liftQ (f : M →ₛₗ[τ₁₂] M₂) (h) : q.comap (p.liftQ f h) = (q.comap f).map (mkQ p)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{R₂ : Type u_3}
{M₂ : Type u_4}
[Ring R₂]
[AddCommGroup M₂]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
(q : Submodule R₂ M₂)
(f : M →ₛₗ[τ₁₂] M₂)
(h : p ≤ LinearMap.ker f)

Submodule.comap (p.liftQ f h) q = Submodule.map p.mkQ (Submodule.comap f q)


theorem tendsto_nhds_iff {f : ι → Y} {l : Filter ι} {y : Y} (hg : Inducing g) :
    Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y))

{Y : Type u_2}
{Z : Type u_3}
{ι : Type u_4}
{g : Y → Z}
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : ι → Y}
{l : Filter ι}
{y : Y}
(hg : Inducing g)

Filter.Tendsto f l (𝓝 y) ↔ Filter.Tendsto (g ∘ f) l (𝓝 (g y))


theorem GoodProducts.linearIndependent (hC : IsClosed C) :
    LinearIndependent ℤ (GoodProducts.eval C)

{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]
(C : Set (I → Bool))
(hC : IsClosed C)

LinearIndependent ℤ (Profinite.NobelingProof.GoodProducts.eval C)


/-- Monomials are weighted homogeneous. -/
theorem isWeightedHomogeneous_monomial (w : σ → M) (d : σ →₀ ℕ) (r : R) {m : M}
    (hm : weight w d = m) : IsWeightedHomogeneous w (monomial d r) m

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
(w : σ → M)
(d : σ →₀ ℕ)
(r : R)
{m : M}
(hm : (Finsupp.weight w) d = m)

MvPolynomial.IsWeightedHomogeneous w ((MvPolynomial.monomial d) r) m


@[to_additive Summable.nat_add_neg_add_one]
lemma Multipliable.nat_mul_neg_add_one {f : ℤ → M} (hf : Multipliable f) :
    Multipliable (fun n : ℕ ↦ f n * f (-(n + 1)))

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
{f : ℤ → M}
(hf : Summable f)


@[to_additive (attr := simp, norm_cast)]
theorem op_natCast [NatCast α] (n : ℕ) : op (n : α) = n


@[simp] theorem infinitesimal_real_iff {r : ℝ} : Infinitesimal r ↔ r = 0


@[simp] lemma natCast_mul_natCast_mul (h : Commute a b) (m n : ℕ) : Commute (m * a) (n * b)

{α : Type u_1}
[Semiring α]
{a b : α}
(h : Commute a b)
(m n : ℕ)


@[to_additive]
theorem Set.piecewise_div [∀ i, Div (f i)] (s : Set I) [∀ i, Decidable (i ∈ s)]
    (f₁ f₂ g₁ g₂ : ∀ i, f i) :
    s.piecewise (f₁ / f₂) (g₁ / g₂) = s.piecewise f₁ g₁ / s.piecewise f₂ g₂

{I : Type u}
{f : I → Type v}
[(i : I) → Div (f i)]
(s : Set I)
[(i : I) → Decidable (i ∈ s)]
(f₁ f₂ g₁ g₂ : (i : I) → f i)


theorem Ioc_disjoint_Ioi_same : Disjoint (Ioc a b) (Ioi b)


/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` is continuous
from the left or from the right at `a`, then `u ↦ ∫ x in u..b, f x` has left (resp., right)
derivative `-f a` at `a`. -/
theorem integral_hasDerivWithinAt_left (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
    [FTCFilter a (𝓝[s] a) (𝓝[t] a)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] a))
    (ha : ContinuousWithinAt f t a) : HasDerivWithinAt (fun u => ∫ x in u..b, f x) (-f a) s a

(hf : IntervalIntegrable f MeasureTheory.volume a b)

[intervalIntegral.FTCFilter a (𝓝[s] a) (𝓝[t] a)]

(hmeas : StronglyMeasurableAtFilter f (𝓝[t] a) MeasureTheory.volume)

HasDerivWithinAt (fun u => ∫ (x : ℝ) in u..b, f x) (-f a) s a


theorem HasFiniteIntegral.mono_measure {f : α → β} (h : HasFiniteIntegral f ν) (hμ : μ ≤ ν) :
    HasFiniteIntegral f μ

(h : MeasureTheory.HasFiniteIntegral f ν)

(hμ : μ ≤ ν)


lemma exists_leftFraction₂ {X Y : C} (f f' : L.obj X ⟶ L.obj Y) :
    ∃ (φ : W.LeftFraction₂ X Y), f = φ.fst.map L (inverts L W) ∧
      f' = φ.snd.map L (inverts L W)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f f' : L.obj X ⟶ L.obj Y)

∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯


theorem iCondIndepSet.condIndep_generateFrom_of_disjoint {s : ι → Set Ω}
    (hsm : ∀ n, MeasurableSet (s n)) (hs : iCondIndepSet m' hm' s μ) (S T : Set ι)
    (hST : Disjoint S T) :
    CondIndep m' (generateFrom { t | ∃ n ∈ S, s n = t })
      (generateFrom { t | ∃ k ∈ T, s k = t }) hm' μ

(hs : ProbabilityTheory.iCondIndepSet m' hm' s μ)

ProbabilityTheory.CondIndep m' (MeasurableSpace.generateFrom {t | ∃ n ∈ S, s n = t})
  (MeasurableSpace.generateFrom {t | ∃ k ∈ T, s k = t}) hm' μ


/-- Alias of `Nat.cast_lt` specialized to `PartENat` --/
theorem coe_lt_coe {x y : ℕ} : (x : PartENat) < y ↔ x < y


theorem multiplicity_eq_zero_of_coprime {p a b : ℕ} (hp : p ≠ 1)
    (hle : multiplicity p a ≤ multiplicity p b) (hab : Nat.Coprime a b) : multiplicity p a = 0


theorem nnnorm_smul (r : α) (x : β) : ‖r • x‖₊ = ‖r‖₊ * ‖x‖₊

{α : Type u_1}
{β : Type u_2}
[NormedDivisionRing α]
[SeminormedAddGroup β]
[MulActionWithZero α β]
[BoundedSMul α β]
(r : α)
(x : β)

‖r • x‖₊ = ‖r‖₊ * ‖x‖₊


theorem prod_univ {s : Set α} : s ×ˢ (univ : Set β) = Prod.fst ⁻¹' s

{α : Type u_1}
{β : Type u_2}
{s : Set α}


@[simp] lemma right_eq_union : s = t ∪ s ↔ t ⊆ s

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


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

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


theorem ball_subset_univBall_target (c : P) (r : ℝ) : ball c r ⊆ (univBall c r).target

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{P : Type u_2}
[PseudoMetricSpace P]
[NormedAddTorsor E P]
(c : P)
(r : ℝ)

Metric.ball c r ⊆ (PartialHomeomorph.univBall c r).target


theorem normalize_mul_left {a : Nat} (d0 : d ≠ 0) (a0 : a ≠ 0) :
    normalize (↑a * n) (a * d) (Nat.mul_ne_zero a0 d0) = normalize n d d0

Rat.normalize (↑a * n) (a * d) ⋯ = Rat.normalize n d d0


theorem not_forall_of_exists_not {p : α → Prop} : (∃ x, ¬p x) → ¬∀ x, p x


@[simp]
theorem inf_compl_self (a : α) : a ⊓ aᶜ = ⊥

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


{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{ρ : MeasureTheory.Measure (α × β)}


theorem IndepFun.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (hX : AEStronglyMeasurable X μ)
    (hY : AEStronglyMeasurable Y μ) : mgf (X + Y) μ t = mgf X μ t * mgf Y μ t

(h_indep : ProbabilityTheory.IndepFun X Y μ)

(hX : MeasureTheory.AEStronglyMeasurable X μ)

(hY : MeasureTheory.AEStronglyMeasurable Y μ)

ProbabilityTheory.mgf (X + Y) μ t = ProbabilityTheory.mgf X μ t * ProbabilityTheory.mgf Y μ t


/-- The image of a 1-pre-hypercover by a functor. -/
@[simps]
def map : PreOneHypercover (F.obj X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{X : C}
(E : CategoryTheory.PreOneHypercover X)
(F : CategoryTheory.Functor C D)

∀ (x x_1 : E.I₀) (j : E.I₁ x x_1), (E.map F).p₂ j = F.map (E.p₂ j)


/-- If we have a functor `F : J ⥤ Π i, C i` into a category of indexed families,
and colimits exist for each of the `F ⋙ Pi.eval C i`,
there is a colimit for `F`.
-/
theorem hasColimit_of_hasColimit_comp_eval : HasColimit F

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

[∀ (i : I), CategoryTheory.Limits.HasColimit (F ⋙ CategoryTheory.Pi.eval C i)]


theorem fromCoset_ne_of_nin_range {b : B} (hb : b ∉ f.range) :
    fromCoset ⟨b • ↑f.range, b, rfl⟩ ≠ fromCoset ⟨f.range, 1, one_leftCoset _⟩

{A B : Grp}
(f : A ⟶ B)
{b : ↑B}
(hb : b ∉ MonoidHom.range f)

Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩ ≠
  Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨↑(MonoidHom.range f), ⋯⟩


protected theorem sub_eq_of_eq_add (hb : b ≠ ∞) : a = c + b → a - b = c


@[simp]
lemma mk_v (v : ∀ (p q : ℤ) (_ : p + n = q), F.X p ⟶ G.X q) (p q : ℤ) (hpq : p + n = q) :
    (Cochain.mk v).v p q hpq = v p q hpq

(v : (p q : ℤ) → p + n = q → (F.X p ⟶ G.X q))

(CochainComplex.HomComplex.Cochain.mk v).v p q hpq = v p q hpq


@[simp]
theorem toFun_embedding_empty (f : M ↪ N) : (Embedding.empty f : M → N) = f


/-- A bialgebra over a commutative (semi)ring `R` is both an algebra and a coalgebra over `R`, such
that the counit and comultiplication are algebra morphisms. -/
class Bialgebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends
    Algebra R A, Coalgebra R A where
  -- The counit is an algebra morphism
  /-- The counit on a bialgebra preserves 1. -/
  counit_one : counit 1 = 1
  /-- The counit on a bialgebra preserves multiplication. Note that this is written
  in a rather obscure way: it says that two bilinear maps `A →ₗ[R] A →ₗ[R]` are equal.
  The two corresponding equal linear maps `A ⊗[R] A →ₗ[R]`
  are the following: the first factors through `A` and is multiplication on `A` followed
  by `counit`. The second factors through `R ⊗[R] R`, and is `counit ⊗ counit` followed by
  multiplication on `R`.

  See `Bialgebra.mk'` for a constructor for bialgebras which uses
  the more familiar but mathematically equivalent `counit (a * b) = counit a * counit b`. -/
  mul_compr₂_counit : (LinearMap.mul R A).compr₂ counit = (LinearMap.mul R R).compl₁₂ counit counit
  -- The comultiplication is an algebra morphism
  /-- The comultiplication on a bialgebra preserves `1`. -/
  comul_one : comul 1 = 1
  /-- The comultiplication on a bialgebra preserves multiplication. This is written in
  a rather obscure way: it says that two bilinear maps `A →ₗ[R] A →ₗ[R] (A ⊗[R] A)`
  are equal. The corresponding equal linear maps `A ⊗[R] A →ₗ[R] A ⊗[R] A`
  are firstly multiplcation followed by `comul`, and secondly `comul ⊗ comul` followed
  by multiplication on `A ⊗[R] A`.

  See `Bialgebra.mk'` for a constructor for bialgebras which uses the more familiar
  but mathematically equivalent `comul (a * b) = comul a * comul b`. -/
  mul_compr₂_comul :
    (LinearMap.mul R A).compr₂ comul = (LinearMap.mul R (A ⊗[R] A)).compl₁₂ comul comul

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[self : Bialgebra R A]

(LinearMap.mul R A).compr₂ Coalgebra.counit = (LinearMap.mul R R).compl₁₂ Coalgebra.counit Coalgebra.counit


@[simp]
theorem midpoint_add_sub (x y : V) : midpoint R (x + y) (x - y) = x

(R : Type u_1)
{V : Type u_2}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
(x y : V)


theorem map_inf_comap_of_surjective (I J : Ideal S) : (I.comap f ⊓ J.comap f).map f = I ⊓ J

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(hf : Function.Surjective ⇑f)
(I J : Ideal S)

Ideal.map f (Ideal.comap f I ⊓ Ideal.comap f J) = I ⊓ J


theorem gcd_eq_of_dvd_sub {s : Finset β} {f g : β → α} {a : α}
    (h : ∀ x : β, x ∈ s → a ∣ f x - g x) :
    GCDMonoid.gcd a (s.gcd f) = GCDMonoid.gcd a (s.gcd g)

{α : Type u_2}
{β : Type u_3}
[CommRing α]
[IsDomain α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f g : β → α}
{a : α}
(h : ∀ x ∈ s, a ∣ f x - g x)


@[simp]
theorem empty.nonempty_equiv_iff :
    Nonempty (M ≃[Language.empty] N) ↔ Cardinal.lift.{w'} #M = Cardinal.lift.{w} #N

{M : Type w}
{N : Type w'}
[FirstOrder.Language.empty.Structure M]
[FirstOrder.Language.empty.Structure N]

Nonempty (FirstOrder.Language.empty.Equiv M N) ↔ Cardinal.lift.{w', w} #M = Cardinal.lift.{w, w'} #N


theorem of_decide_eq_true [inst : Decidable p] : Eq (decide p) true → p


lemma Submodule.one_le_traceDual_one :
    (1 : Submodule B L) ≤ 1ᵛ

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[FiniteDimensional K L]
[IsIntegrallyClosed A]


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

∀ {X Y : (CategoryTheory.Limits.WidePullbackShape CategoryTheory.Limits.WalkingPair)ᵒᵖ} (f : X ⟶ Y),
  CategoryTheory.Limits.walkingCospanOpEquiv.functor.map f =
    (CategoryTheory.Limits.widePullbackShapeOpMap CategoryTheory.Limits.WalkingPair (Opposite.unop Y) (Opposite.unop X)
        f.unop).unop


@[measurability, fun_prop]
theorem Measurable.ennreal_toNNReal {f : α → ℝ≥0∞} (hf : Measurable f) :
    Measurable fun x => (f x).toNNReal

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ≥0∞}
(hf : Measurable f)


/-- The Gram operator T†T is a positive operator. -/
theorem re_inner_adjoint_mul_self_nonneg (T : E →ₗ[𝕜] E) (x : E) :
    0 ≤ re ⟪x, (LinearMap.adjoint T * T) x⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[FiniteDimensional 𝕜 E]
(T : E →ₗ[𝕜] E)
(x : E)

0 ≤ RCLike.re ⟪x, (LinearMap.adjoint T * T) x⟫_𝕜


theorem taylor_within_apply (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) :
    taylorWithinEval f n s x₀ x =
      ∑ k ∈ Finset.range (n + 1), ((k ! : ℝ)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
(n : ℕ)
(s : Set ℝ)
(x₀ x : ℝ)

taylorWithinEval f n s x₀ x = ∑ k ∈ Finset.range (n + 1), ((↑k !)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀


@[simp]
theorem subtype_substructureEquivMap (f : M ↪[L] N) (s : L.Substructure M) :
    (subtype _).comp (f.substructureEquivMap s).toEmbedding = f.comp (subtype _)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(f : L.Embedding M N)
(s : L.Substructure M)

(FirstOrder.Language.Substructure.map f.toHom s).subtype.comp (f.substructureEquivMap s).toEmbedding = f.comp s.subtype


/-- Given right homology map data for morphisms `φ` and `φ'`, this is the induced
right homology map data for `φ + φ'`. -/
@[simps]
def add : RightHomologyMapData (φ + φ') h₁ h₂

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

(γ' : CategoryTheory.ShortComplex.RightHomologyMapData φ' h₁ h₂)


theorem minpoly_powerBasis_gen_of_monic (hf : f.Monic) (hf' : f ≠ 0 := hf.ne_zero) :
    minpoly K (powerBasis hf').gen = f

{K : Type w}
[Field K]
{f : K[X]}
(hf : f.Monic)
(hf' : f ≠ 0 := ⋯)

minpoly K (AdjoinRoot.powerBasis hf').gen = f


/-- A Kleene Algebra is an idempotent semiring with an additional unary operator `kstar` (for Kleene
star) that satisfies the following properties:
* `1 + a * a∗ ≤ a∗`
* `1 + a∗ * a ≤ a∗`
* If `a * c + b ≤ c`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b

{α : Type u_5}
[self : KleeneAlgebra α]
(a : α)


/-- Order isomorphism between bundled monotone maps `α →o Π i, π i` and families of bundled monotone
maps `Π i, α →o π i`. -/
@[simps]
def piIso : (α →o ∀ i, π i) ≃o ∀ i, α →o π i

{α : Type u_2}
[Preorder α]
{ι : Type u_6}
{π : ι → Type u_7}
[(i : ι) → Preorder (π i)]
(f : (i : ι) → α →o π i)

(RelIso.symm OrderHom.piIso) f = OrderHom.pi f


lemma proj_comp_transitionMap' (n : ℕ) : S.transitionMap n ∘ S.proj (n + 1) = S.proj n

⇑(S.transitionMap n) ∘ ⇑(S.proj (n + 1)) = ⇑(S.proj n)


/-- The functor `LeftExtension L' F ⥤ LeftExtension L F`
induced by a natural transformation `L' ⟶ L ⋙ G'`. -/
@[simps!]
def LeftExtension.postcomp₁ (f : L' ⟶ L ⋙ G) (F : C ⥤ H) :
    LeftExtension L' F ⥤ LeftExtension L F

{X Y : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit F) ((CategoryTheory.whiskeringLeft C D' H).obj L')}

((CategoryTheory.Functor.LeftExtension.postcomp₁ G f F).map φ).left = CategoryTheory.CategoryStruct.id X.left


@[simp]
theorem star_sum [AddCommMonoid R] [StarAddMonoid R] {α : Type*} (s : Finset α) (f : α → R) :
    star (∑ x ∈ s, f x) = ∑ x ∈ s, star (f x)

{R : Type u_1}
[AddCommMonoid R]
[StarAddMonoid R]
{α : Type u_2}
(s : Finset α)
(f : α → R)


@[simp]
theorem objDown_objUp {C} (A : C) : (ULiftHom.objUp A).objDown = A

(CategoryTheory.ULiftHom.objUp A).objDown = A


@[ext]
theorem ext {f g : Π₀ i, β i} (h : ∀ i, f i = g i) : f = g

{ι : Type u}
{β : ι → Type v}
[(i : ι) → Zero (β i)]
{f g : Π₀ (i : ι), β i}
(h : ∀ (i : ι), f i = g i)


theorem Summable.unop {f : β → αᵐᵒᵖ} (hf : Summable f) : Summable (unop ∘ f)

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → αᵐᵒᵖ}
(hf : Summable f)


theorem deriv_sqrt_mul_log' :
    (deriv fun x => √x * log x) = fun x => (2 + log x) / (2 * √x)

(deriv fun x => √x * Real.log x) = fun x => (2 + Real.log x) / (2 * √x)


@[simp]
theorem range_toAlternatingMap :
    Set.range (toAlternatingMap : M [⋀^ι]→L[R] N → (M [⋀^ι]→ₗ[R] N)) =
      {f : M [⋀^ι]→ₗ[R] N | Continuous f}

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]

Set.range ContinuousAlternatingMap.toAlternatingMap = {f | Continuous ⇑f}


/-- A discrete category is equivalent to its opposite category. -/
@[simps! functor_obj_as inverse_obj]
protected def opposite (α : Type u₁) : (Discrete α)ᵒᵖ ≌ Discrete α

∀ (a : CategoryTheory.Discrete α), (CategoryTheory.Discrete.opposite α).inverse.obj a = Opposite.op a


@[to_additive]
theorem mul_subset_iff : s * t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, x * y ∈ u

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


@[to_additive (attr := simp)]
lemma symm_mk_inv [Inv M] (a : Mᵈᵐᵃ) : mk.symm (a⁻¹) = (mk.symm a)⁻¹

DomMulAct.mk.symm a⁻¹ = (DomMulAct.mk.symm a)⁻¹


theorem tsub_eq_zero_iff_le : a - b = 0 ↔ a ≤ b

{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
{a b : α}


@[to_additive]
theorem mono_iff_injective : Mono f ↔ Function.Injective f

CategoryTheory.Mono f ↔ Function.Injective ⇑f


theorem powerset_insert [DecidableEq α] (s : Finset α) (a : α) :
    powerset (insert a s) = s.powerset ∪ s.powerset.image (insert a)

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

(insert a s).powerset = s.powerset ∪ Finset.image (insert a) s.powerset


theorem toPrimeSpectrum_injective : (@toPrimeSpectrum R _).Injective


@[simp]
theorem homOfLE_refl {x : X} (h : x ≤ x) : h.hom = 𝟙 x

{X : Type u}
[Preorder X]
{x : X}
(h : x ≤ x)

h.hom = CategoryTheory.CategoryStruct.id x


@[simp]
theorem nilpotencyLength_eq_one_iff [Nontrivial M] :
    nilpotencyLength R L M = 1 ↔ IsTrivial L M

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[Nontrivial M]

LieModule.nilpotencyLength R L M = 1 ↔ LieModule.IsTrivial L M


@[simp] theorem addNat_one {i : Fin n} : addNat i 1 = i.succ


theorem ext_iff' : μ₁ = μ₂ ↔ ∀ s, μ₁ s = μ₂ s

{α : Type u_1}
[MeasurableSpace α]
{μ₁ μ₂ : MeasureTheory.Measure α}


@[simp]
theorem card_univ : card univ.{u,v} = Cardinal.univ.{u,v}

Ordinal.univ.{u, v}.card = Cardinal.univ.{u, v}


theorem isIntegral_coe (x : 𝓞 K) : IsIntegral ℤ (algebraMap _ K x)

{K : Type u_1}
[Field K]
(x : NumberField.RingOfIntegers K)

IsIntegral ℤ ((algebraMap (NumberField.RingOfIntegers K) K) x)


/-- A `LeftCancelSemigroup` is a semigroup such that `a * b = a * c` implies `b = c`. -/
@[ext]
class LeftCancelSemigroup (G : Type u) extends Semigroup G where
  protected mul_left_cancel : ∀ a b c : G, a * b = a * c → b = c

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


@[to_additive]
theorem apply_mulSingle (f' : ∀ i, f i → g i) (hf' : ∀ i, f' i 1 = 1) (i : I) (x : f i) (j : I) :
    f' j (mulSingle i x j) = mulSingle i (f' i x) j

{I : Type u}
{f : I → Type v₁}
{g : I → Type v₂}
[DecidableEq I]
[(i : I) → One (f i)]
[(i : I) → One (g i)]
(f' : (i : I) → f i → g i)
(hf' : ∀ (i : I), f' i 1 = 1)
(i : I)
(x : f i)
(j : I)

f' j (Pi.mulSingle i x j) = Pi.mulSingle i (f' i x) j


private lemma x_spec : S.a + S.b = λ ^ (3 * S.multiplicity - 2) * S.x

(S : FermatLastTheoremForThreeGen.Solution hζ)

S.a + S.b = (hζ.toInteger - 1) ^ (3 * S.multiplicity - 2) * FermatLastTheoremForThreeGen.Solution.x S


theorem Covariant.flip (h : Covariant M N μ r) : Covariant M N μ (flip r)

{M : Type u_1}
{N : Type u_2}
{μ : M → N → N}
{r : N → N → Prop}
(h : Covariant M N μ r)


@[simp]
lemma rightUnshift_smul {n' a : ℤ} (γ : Cochain K (L⟦a⟧) n') (n : ℤ) (hn : n' + a = n) (x : R) :
    (x • γ).rightUnshift n hn = x • γ.rightUnshift n hn

(γ : CochainComplex.HomComplex.Cochain K ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj L) n')


/-- `SemilinearEquivClass F σ M M₂` asserts `F` is a type of bundled `σ`-semilinear equivs
`M → M₂`.

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

A map `f` between an `R`-module and an `S`-module over a ring homomorphism `σ : R →+* S`
is semilinear if it satisfies the two properties `f (x + y) = f x + f y` and
`f (c • x) = (σ c) • f x`. -/
class SemilinearEquivClass (F : Type*) {R S : outParam Type*} [Semiring R] [Semiring S]
  (σ : outParam <| R →+* S) {σ' : outParam <| S →+* R} [RingHomInvPair σ σ'] [RingHomInvPair σ' σ]
  (M M₂ : outParam Type*) [AddCommMonoid M] [AddCommMonoid M₂] [Module R M] [Module S M₂]
  [EquivLike F M M₂]
  extends AddEquivClass F M M₂ : Prop where
  /-- Applying a semilinear equivalence `f` over `σ` to `r • x` equals `σ r • f x`. -/
  map_smulₛₗ : ∀ (f : F) (r : R) (x : M), f (r • x) = σ r • f x

{F : Type u_17}
{R : outParam (Type u_18)}
{S : outParam (Type u_19)}
[Semiring R]
[Semiring S]
{σ : outParam (R →+* S)}
{σ' : outParam (S →+* R)}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
{M : outParam (Type u_20)}
{M₂ : outParam (Type u_21)}
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module S M₂]
[EquivLike F M M₂]
[self : SemilinearEquivClass F σ M M₂]
(f : F)
(r : R)
(x : M)


/-- Local instance for `TransOrd lexOrd`. -/
theorem TransOrd.instLexOrd [Ord α] [Ord β]
    [TransOrd α] [TransOrd β] : @TransOrd (α × β) lexOrd

{α : Type u_1}
{β : Type u_2}
[Ord α]
[Ord β]
[Batteries.TransOrd α]
[Batteries.TransOrd β]


/-- The set of vectors in the same ray as `x` is connected. -/
theorem isConnected_setOf_sameRay (x : E) : IsConnected { y | SameRay ℝ x y }

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(x : E)


@[to_additive]
protected theorem hasBasis (B : GroupFilterBasis G) (x : G) :
    HasBasis (B.N x) (fun V : Set G ↦ V ∈ B) fun V ↦ (fun y ↦ x * y) '' V

{G : Type u}
[Group G]
(B : GroupFilterBasis G)
(x : G)

(B.N x).HasBasis (fun V => V ∈ B) fun V => (fun y => x * y) '' V


@[simp] theorem cliqueFree_map_iff {f : α ↪ β} [Nonempty α] :
    (G.map f).CliqueFree n ↔ G.CliqueFree n

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{n : ℕ}
{f : α ↪ β}
[Nonempty α]

(SimpleGraph.map f G).CliqueFree n ↔ G.CliqueFree n


@[simp]
theorem frequently_true_iff_neBot (f : Filter α) : (∃ᶠ _ in f, True) ↔ NeBot f


theorem meas_le_ae_eq_meas_lt {R : Type*} [LinearOrder R] [MeasurableSpace R]
    (ν : Measure R) [NoAtoms ν] (g : α → R) :
    (fun t => μ {a : α | t ≤ g a}) =ᵐ[ν] fun t => μ {a : α | t < g a}

{α : Type u_1}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
{R : Type u_3}
[LinearOrder R]
[MeasurableSpace R]
(ν : MeasureTheory.Measure R)
[MeasureTheory.NoAtoms ν]
(g : α → R)

(fun t => μ {a | t ≤ g a}) =ᵐ[ν] fun t => μ {a | t < g a}


@[simp]
theorem trans_refl (e : P₁ ≃ᵃL[k] P₂) : e.trans (refl k P₂) = e

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)

e.trans (ContinuousAffineEquiv.refl k P₂) = e


@[elab_as_elim]
protected theorem induction_on {M : R[X] → Prop} (p : R[X]) (h_C : ∀ a, M (C a))
    (h_add : ∀ p q, M p → M q → M (p + q))
    (h_monomial : ∀ (n : ℕ) (a : R), M (C a * X ^ n) → M (C a * X ^ (n + 1))) : M p

(h_add : ∀ (p q : Polynomial R), M p → M q → M (p + q))

(h_monomial : ∀ (n : ℕ) (a : R), M (Polynomial.C a * Polynomial.X ^ n) → M (Polynomial.C a * Polynomial.X ^ (n + 1)))


/-- The `atBot` filter for an open interval `Iic a` comes from the `atBot` filter in the ambient
order. -/
theorem atBot_Iic_eq [SemilatticeInf α] (a : α) : atBot = comap ((↑) : Iic a → α) atBot

{α : Type u_3}
[SemilatticeInf α]
(a : α)

Filter.atBot = Filter.comap Subtype.val Filter.atBot


@[to_additive (attr := simp)]
theorem one_comp [One γ] (g : C(α, β)) : (1 : C(β, γ)).comp g = 1

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[One γ]
(g : C(α, β))


theorem next_mem (h : x ∈ l) : l.next x h ∈ l

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


theorem id_traverse {α : Type*} (x : Multiset α) : traverse (pure : α → Id α) x = x


theorem foldl_induction
    {as : Array α} (motive : Nat → β → Prop) {init : β} (h0 : motive 0 init) {f : β → α → β}
    (hf : ∀ i : Fin as.size, ∀ b, motive i.1 b → motive (i.1 + 1) (f b as[i])) :
    motive as.size (as.foldl f init)

{f : β → α → β}

(hf : ∀ (i : Fin as.size) (b : β), motive (↑i) b → motive (↑i + 1) (f b as[i]))

motive as.size (Array.foldl f init as 0)


@[simp]
theorem ofLE_proj (h : A ≤ B) (x : X) : ofLE h (A.proj x) = B.proj x

{X : Type u_2}
[TopologicalSpace X]
{A B : DiscreteQuotient X}
(h : A ≤ B)
(x : X)

DiscreteQuotient.ofLE h (A.proj x) = B.proj x


protected theorem le_total (a b : Char) : a ≤ b ∨ b ≤ a


/-- Fundamental theorem of calculus-2: If `f : ℝ → E` is continuous on `[a, b]` and
  has a right derivative at `f' x` for all `x` in `[a, b)`, and `f'` is integrable on `[a, b]` then
  `∫ y in a..b, f' y` equals `f b - f a`. -/
theorem integral_eq_sub_of_hasDeriv_right (hcont : ContinuousOn f (uIcc a b))
    (hderiv : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
    (hint : IntervalIntegrable f' volume a b) : ∫ y in a..b, f' y = f b - f a

(hderiv : ∀ x ∈ Set.Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Set.Ioi x) x)

(hint : IntervalIntegrable f' MeasureTheory.volume a b)


/-- A fan over `f : β → C` consists of a collection of maps from an object `P` to every `f b`. -/
@[simps! pt π_app]
def Fan.mk {f : β → C} (P : C) (p : ∀ b, P ⟶ f b) : Fan f

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : β → C}
(P : C)
(p : (b : β) → P ⟶ f b)

(CategoryTheory.Limits.Fan.mk P p).pt = P


theorem le_def [LE β] : ((· ≤ ·) : Germ l β → Germ l β → Prop) = LiftRel (· ≤ ·)

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[LE β]

(fun x x_1 => x ≤ x_1) = Filter.Germ.LiftRel fun x x_1 => x ≤ x_1


@[simp]
theorem ofMul_toMul (x : Additive α) : ofMul (toMul x) = x


theorem ContMDiffWithinAt.mono (hf : ContMDiffWithinAt I I' n f s x) (hts : t ⊆ s) :
    ContMDiffWithinAt I I' n f t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s t : Set M}
{x : M}
{n : ℕ∞}
(hf : ContMDiffWithinAt I I' n f s x)
(hts : t ⊆ s)


@[to_additive]
lemma smul_one_smul {M} (N) [Monoid N] [SMul M N] [MulAction N α] [SMul M α]
    [IsScalarTower M N α] (x : M) (y : α) : (x • (1 : N)) • y = x • y

{α : Type u_7}
{M : Type u_11}
(N : Type u_12)
[Monoid N]
[SMul M N]
[MulAction N α]
[SMul M α]
[IsScalarTower M N α]
(x : M)
(y : α)


theorem map_mk_eq_bot_of_le {I J : Ideal R} (h : I ≤ J) : I.map (Quotient.mk J) = ⊥

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


theorem irrational_sqrt_of_multiplicity_odd (m : ℤ) (hm : 0 < m) (p : ℕ) [hp : Fact p.Prime]
    (Hpv :
      (multiplicity (p : ℤ) m).get (finite_int_iff.2 ⟨hp.1.ne_one, (ne_of_lt hm).symm⟩) % 2 = 1) :
    Irrational (√m)

(Hpv : (multiplicity (↑p) m).get ⋯ % 2 = 1)


theorem lt_iff_not_ge (x y : α) : x < y ↔ ¬x ≥ y


@[reassoc (attr := simp)]
theorem bicone_ι_π_ne {F : J → C} (B : Bicone F) {j j' : J} (h : j ≠ j') : B.ι j ≫ B.π j' = 0


@[simp]
theorem inclusion_self {S : Subalgebra R A} : inclusion (le_refl S) = AlgHom.id R S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S : Subalgebra R A}


theorem exists_dvd_of_not_prime2 {n : ℕ} (n2 : 2 ≤ n) (np : ¬Prime n) :
    ∃ m, m ∣ n ∧ 2 ≤ m ∧ m < n

{n : ℕ}
(n2 : 2 ≤ n)
(np : ¬Nat.Prime n)


protected theorem continuousAt {x} : ContinuousAt I x

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


@[simp] theorem fst_comp_inl : fst R M M₂ ∘ₗ inl R M M₂ = id

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.fst R M M₂ ∘ₗ LinearMap.inl R M M₂ = LinearMap.id


/-- We say that a 1-morphism `h` commutes with the left Kan lift `f₊ g` if the whiskered left lift
for `f₊ g` by `h` is a Kan lift of `h ≫ g` along `f`. -/
class LanLift.CommuteWith
    (f : b ⟶ a) (g : c ⟶ a) [HasLeftKanLift f g] {x : B} (h : x ⟶ c) : Prop where
  commute : Nonempty <| IsKan <| (lanLiftLeftLift f g).whisker h

[self : CategoryTheory.Bicategory.LanLift.CommuteWith f g h]

Nonempty ((CategoryTheory.Bicategory.lanLiftLeftLift f g).whisker h).IsKan


theorem norm_indicatorConstLp_top (hμs_ne_zero : μ s ≠ 0) :
    ‖indicatorConstLp ∞ hs hμs c‖ = ‖c‖

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{c : E}
(hμs_ne_zero : μ s ≠ 0)

‖MeasureTheory.indicatorConstLp ⊤ hs hμs c‖ = ‖c‖


theorem coprime_comm : Coprime n m ↔ Coprime m n


theorem restrict_eq_freeOn_iff : M ↾ I = freeOn I ↔ M.Indep I

{α : Type u_1}
{M : Matroid α}
{I : Set α}

M.restrict I = Matroid.freeOn I ↔ M.Indep I


/-- Given `I : S.Arrow` and a morphism `g : Z ⟶ I.Y`, this is the obvious relation
from `I.precomp g` to `I`. -/
@[simps]
def Arrow.precompRelation {S : J.Cover X} (I : S.Arrow) {Z : C} (g : Z ⟶ I.Y) :
    (I.precomp g).Relation I

{J : CategoryTheory.GrothendieckTopology C}

(I.precompRelation g).Z = (I.precomp g).Y


@[simp] theorem nth_false (n : ℕ) : nth (fun _ ↦ False) n = 0


/-- An elliptic curve over a commutative ring. Note that this definition is only mathematically
accurate for certain rings whose Picard group has trivial 12-torsion, such as a field or a PID. -/
@[ext]
structure EllipticCurve (R : Type u) [CommRing R] extends WeierstrassCurve R where
  /-- The discriminant `Δ'` of an elliptic curve over `R`, which is given as a unit in `R`. -/
  Δ' : Rˣ
  /-- The discriminant of `E` is equal to the discriminant of `E` as a Weierstrass curve. -/
  coe_Δ' : Δ' = toWeierstrassCurve.Δ

{R : Type u}
[CommRing R]
(self : EllipticCurve R)


/-- Construct an isomorphism in the over category given isomorphisms of the objects whose forward
direction gives a commutative triangle.
-/
@[simps!]
def isoMk {f g : Over X} (hl : f.left ≅ g.left) (hw : hl.hom ≫ g.hom = f.hom := by aesop_cat) :
    f ≅ g

(hw : CategoryTheory.CategoryStruct.comp hl.hom g.hom = f.hom := by aesop_cat)


theorem setToSimpleFunc_mono_left {m : MeasurableSpace α} (T T' : Set α → F →L[ℝ] G'')
    (hTT' : ∀ s x, T s x ≤ T' s x) (f : α →ₛ F) : setToSimpleFunc T f ≤ setToSimpleFunc T' f

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

MeasureTheory.SimpleFunc.setToSimpleFunc T f ≤ MeasureTheory.SimpleFunc.setToSimpleFunc T' f


@[simp, norm_cast]
theorem coe_units_zpow (u : Mˣ) : ∀ n : ℤ, ((u ^ n : Mˣ) : M) = (u : M) ^ n

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(u : (Matrix n' n' R)ˣ)
(n : ℤ)


@[simp, norm_cast]
theorem coe_snd [Module R₁ M₂] : ↑(snd R₁ M₁ M₂) = LinearMap.snd R₁ M₁ M₂

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₁ M₂]

↑(ContinuousLinearMap.snd R₁ M₁ M₂) = LinearMap.snd R₁ M₁ M₂


theorem smulRight_apply (f : M₁ →ₗ[R] S) (x : M) (c : M₁) : smulRight f x c = f c • x

{R : Type u_1}
{S : Type u_4}
{M : Type u_5}
{M₁ : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₁]
[Module R M]
[Module R M₁]
[Semiring S]
[Module R S]
[Module S M]
[IsScalarTower R S M]
(f : M₁ →ₗ[R] S)
(x : M)
(c : M₁)


theorem iff_of_isAffine [IsAffine Y] : P f ↔ Q f

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


theorem comap_injective [T0Space β] : Injective (comap : C(α, β) → FrameHom (Opens β) (Opens α))

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[T0Space β]


@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ

{G : Type u_1}
[AddCommGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[MeasurableSpace G]
[BorelSpace G]
(μ : MeasureTheory.Measure G)
[μ.IsAddHaarMeasure]
[CompactSpace G]
[DivisibleBy G ℤ]
{n : ℤ}
(hn : n ≠ 0)

MeasureTheory.MeasurePreserving (fun g => n • g) μ μ


lemma aeval_natDegree_le {R : Type*} [CommSemiring R] {m n : ℕ}
    (F : MvPolynomial σ R) (hF : F.totalDegree ≤ m)
    (f : σ → Polynomial R) (hf : ∀ i, (f i).natDegree ≤ n) :
    (MvPolynomial.aeval f F).natDegree ≤ m * n

{σ : Type v}
{R : Type u_2}
[CommSemiring R]
{m n : ℕ}
(F : MvPolynomial σ R)
(hF : F.totalDegree ≤ m)
(f : σ → R[X])
(hf : ∀ (i : σ), (f i).natDegree ≤ n)

((MvPolynomial.aeval f) F).natDegree ≤ m * n


lemma isPrimitive_one_level_one : IsPrimitive (1 : DirichletCharacter R 1)


/-- The integral of an almost-everywhere strongly measurable function over `UnitAddCircle` is
equal to the integral over an interval (t, t + 1] in `ℝ` of its lift to `ℝ`. -/
protected theorem intervalIntegral_preimage (t : ℝ) (f : UnitAddCircle → E) :
    ∫ a in t..t + 1, f a = ∫ b : UnitAddCircle, f b

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(t : ℝ)
(f : UnitAddCircle → E)

∫ (a : ℝ) in t..t + 1, f ↑a = ∫ (b : UnitAddCircle), f b


theorem IsGδ.iInter_of_isOpen [Countable ι'] {f : ι' → Set X} (hf : ∀ i, IsOpen (f i)) :
    IsGδ (⋂ i, f i)

{X : Type u_1}
{ι' : Sort u_4}
[TopologicalSpace X]
[Countable ι']
{f : ι' → Set X}
(hf : ∀ (i : ι'), IsOpen (f i))


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

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square C)

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


theorem disjoint_symmDiff_inf : Disjoint (a ∆ b) (a ⊓ b)

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


@[to_additive]
theorem embedding_embedProduct : Embedding (embedProduct M)

{M : Type u_1}
[TopologicalSpace M]
[Monoid M]


theorem Ideal.homogeneousHull.gc : GaloisConnection (Ideal.homogeneousHull 𝒜) toIdeal

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

GaloisConnection (Ideal.homogeneousHull 𝒜) HomogeneousIdeal.toIdeal


/-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function, then
  `seminormFromBounded' f` is nonnegative. -/
theorem seminormFromBounded_nonneg (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y)  :
    0 ≤ seminormFromBounded' f

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)


@[simp]
theorem Nonempty.subset_preimage_const {s : Set α} (hs : Set.Nonempty s) (t : Set β) (a : β) :
    s ⊆ (fun _ => a) ⁻¹' t ↔ a ∈ t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
(hs : s.Nonempty)
(t : Set β)
(a : β)


theorem mono_of_kernel_iso_zero {X Y : C} {f : X ⟶ Y} [HasLimit (parallelPair f 0)]
    (w : kernel f ≅ 0) : Mono f

[CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.parallelPair f 0)]

(w : CategoryTheory.Limits.kernel f ≅ 0)


protected theorem map_mul {A'} [Semiring A'] [Algebra R A'] (f : A →ₐ[R] A') :
    map f.toLinearMap (M * N) = map f.toLinearMap M * map f.toLinearMap N

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M N : Submodule R A)
{A' : Type u_1}
[Semiring A']
[Algebra R A']
(f : A →ₐ[R] A')

Submodule.map f.toLinearMap (M * N) = Submodule.map f.toLinearMap M * Submodule.map f.toLinearMap N


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


theorem dotProduct_vecMul_hadamard [DecidableEq m] [DecidableEq n] (v : m → α) (w : n → α) :
    dotProduct (v ᵥ* (A ⊙ B)) w = trace (diagonal v * A * (B * diagonal w)ᵀ)

{α : Type u_1}
{m : Type u_4}
{n : Type u_5}
(A B : Matrix m n α)
[Fintype m]
[Fintype n]
[Semiring α]
[DecidableEq m]
[DecidableEq n]
(v : m → α)
(w : n → α)

Matrix.dotProduct (Matrix.vecMul v (A.hadamard B)) w = (Matrix.diagonal v * A * (B * Matrix.diagonal w).transpose).trace


theorem inner_smul_real_right (x y : E) (r : ℝ) : ⟪x, (r : 𝕜) • y⟫ = r • ⟪x, y⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)
(r : ℝ)


theorem Wbtw.left_mem_image_Ici_of_right_ne {x y z : P} (h : Wbtw R x y z) (hne : z ≠ y) :
    x ∈ lineMap z y '' Set.Ici (1 : R)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Wbtw R x y z)
(hne : z ≠ y)

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


@[to_additive IsAddHaarMeasure.smul]
theorem IsHaarMeasure.smul {c : ℝ≥0∞} (cpos : c ≠ 0) (ctop : c ≠ ∞) : IsHaarMeasure (c • μ)

{G : Type u_2}
[MeasurableSpace G]
[Group G]
[TopologicalSpace G]
(μ : MeasureTheory.Measure G)
[μ.IsHaarMeasure]
{c : ℝ≥0∞}
(cpos : c ≠ 0)
(ctop : c ≠ ⊤)


@[simp, reassoc]
theorem whiskerRight_comp {G H K : C ⥤ D} (α : G ⟶ H) (β : H ⟶ K) (F : D ⥤ E) :
    whiskerRight (α ≫ β) F = whiskerRight α F ≫ whiskerRight β F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{G H K : CategoryTheory.Functor C D}
(α : G ⟶ H)
(β : H ⟶ K)
(F : CategoryTheory.Functor D E)

CategoryTheory.whiskerRight (CategoryTheory.CategoryStruct.comp α β) F =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight α F) (CategoryTheory.whiskerRight β F)


theorem algEquiv_symm_apply (e : α ≃ β) [Semiring β] [Algebra R β] (b : β) : by
    letI := Equiv.semiring e
    letI := Equiv.algebra R e
    exact (algEquiv R e).symm b = e.symm b

{α : Type u}
{β : Type v}
(R : Type u_1)
[CommSemiring R]
(e : α ≃ β)
[Semiring β]
[Algebra R β]
(b : β)

(AlgEquiv.symm (Equiv.algEquiv R e)) b = e.symm b


theorem Prime.pos {p : ℕ} (pp : Prime p) : 0 < p


theorem integral_unique [Unique α] (f : α → E) : ∫ x, f x ∂μ = (μ univ).toReal • f default

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[hE : CompleteSpace E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Unique α]
(f : α → E)

∫ (x : α), f x ∂μ = (μ Set.univ).toReal • f default


@[simp] theorem imp_and_neg_imp_iff (p q : Prop) : (p → q) ∧ (¬p → q) ↔ q


theorem ofLists_moveRight {L R : List PGame} (i : Fin R.length) :
    (ofLists L R).moveRight (toOfListsRightMoves i) = R.get i

{L R : List SetTheory.PGame}
(i : Fin R.length)

(SetTheory.PGame.ofLists L R).moveRight (SetTheory.PGame.toOfListsRightMoves i) = R.get i


theorem map {f : α →. β} {g : α → β → σ} (hf : Partrec f) (hg : Computable₂ g) :
    Partrec fun a => (f a).map (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α →. β}
{g : α → β → σ}
(hf : Partrec f)
(hg : Computable₂ g)


/-- If two `MonoidHom`s agree on `-1` and the naturals then they are equal. -/
@[ext]
theorem ext_int {f g : ℤ →* M} (h_neg_one : f (-1) = g (-1))
    (h_nat : f.comp Int.ofNatHom.toMonoidHom = g.comp Int.ofNatHom.toMonoidHom) : f = g

(h_nat : f.comp ↑Int.ofNatHom = g.comp ↑Int.ofNatHom)


/-- Composing a functor which `HasSheafCompose`, yields a functor between sheaf categories. -/
@[simps]
def sheafCompose : Sheaf J A ⥤ Sheaf J B

(J : CategoryTheory.GrothendieckTopology C)

∀ {X Y : CategoryTheory.Sheaf J A} (η : X ⟶ Y),
  ((CategoryTheory.sheafCompose J F).map η).val = CategoryTheory.whiskerRight η.val F


/-- We have the bound `log (stirlingSeq n) - log (stirlingSeq (n+1))` ≤ 1/(4 n^2)
-/
theorem log_stirlingSeq_sub_log_stirlingSeq_succ (n : ℕ) :
    log (stirlingSeq (n + 1)) - log (stirlingSeq (n + 2)) ≤ 1 / (4 * (↑(n + 1) : ℝ) ^ 2)

Real.log (Stirling.stirlingSeq (n + 1)) - Real.log (Stirling.stirlingSeq (n + 2)) ≤ 1 / (4 * ↑(n + 1) ^ 2)


@[simp] theorem and_one_is_mod (x : Nat) : x &&& 1 = x % 2


theorem continuousOn_dslope (h : s ∈ 𝓝 a) :
    ContinuousOn (dslope f a) s ↔ ContinuousOn f s ∧ DifferentiableAt 𝕜 f a

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{a : 𝕜}
{s : Set 𝕜}
(h : s ∈ 𝓝 a)


/-- The subsemigroup generated by a set includes the set. -/
@[to_additive (attr := simp, aesop safe 20 apply (rule_sets := [SetLike]))
  "The `AddSubsemigroup` generated by a set includes the set."]
theorem subset_closure : s ⊆ closure s


lemma schnirelmannDensity_nonneg : 0 ≤ schnirelmannDensity A

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]


theorem mulMap_comm : mulMap N M = (mulMap M N).comp (TensorProduct.comm R N M).toLinearMap

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

N.mulMap M = M.mulMap N ∘ₗ ↑(TensorProduct.comm R ↥N ↥M)


/-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/
theorem iff_singleton :
    IsCyclotomicExtension {n} A B ↔
      (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1}

(n : ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]

IsCyclotomicExtension {n} A B ↔ (∃ r, IsPrimitiveRoot r ↑n) ∧ ∀ (x : B), x ∈ Algebra.adjoin A {b | b ^ ↑n = 1}


/-- For a perfect ring, it itself is the perfection. -/
theorem id [PerfectRing R p] : PerfectionMap p (RingHom.id R)

(p : ℕ)
[Fact (Nat.Prime p)]
(R : Type u₁)
[CommSemiring R]
[CharP R p]
[PerfectRing R p]


theorem finite_iff_dom [DecidableRel ((· ∣ ·) : α → α → Prop)] {a b : α} :
    Finite a b ↔ (multiplicity a b).Dom

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}

multiplicity.Finite a b ↔ (multiplicity a b).Dom


theorem RingHom.ofLocalizationSpan_iff_finite :
    RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P

(P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop)

RingHom.OfLocalizationSpan P ↔ RingHom.OfLocalizationFiniteSpan P


protected theorem lt_tsub_of_add_lt_right (hc : AddLECancellable c) (h : a + c < b) : a < b - c

{α : Type u_1}
[PartialOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b c : α}
(hc : AddLECancellable c)
(h : a + c < b)


/--
If `g` is a linear map `M → M''` such that all scalar multiplication by `s : S` is invertible, then
`lift g m s = s⁻¹ • g m`.
-/
theorem lift_mk
    (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit (algebraMap R (Module.End R M'') x)) (m : M) (s : S) :
    LocalizedModule.lift S g h (LocalizedModule.mk m s) = (h s).unit⁻¹.val (g m)

(h : ∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M'')) ↑x))

(LocalizedModule.lift S g h) (LocalizedModule.mk m s) = ↑⋯.unit⁻¹ (g m)


@[simp]
theorem head_ofFn {n : ℕ} (f : Fin n.succ → α) : head (ofFn f) = f 0

{α : Type u_1}
{n : ℕ}
(f : Fin n.succ → α)


@[to_additive]
theorem Nonempty.smul : s.Nonempty → t.Nonempty → (s • t).Nonempty

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

s.Nonempty → t.Nonempty → (s +ᵥ t).Nonempty


@[simp]
theorem toDFinsupp_inter (s t : Multiset α) : toDFinsupp (s ∩ t) = toDFinsupp s ⊓ toDFinsupp t

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

Multiset.toDFinsupp (s ∩ t) = Multiset.toDFinsupp s ⊓ Multiset.toDFinsupp t


theorem HasStrictFDerivAt.rpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
    (h : 0 < f x) : HasStrictFDerivAt (fun x => f x ^ g x)
      ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * Real.log (f x)) • g') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : E → ℝ}
{f' g' : E →L[ℝ] ℝ}
{x : E}
(hf : HasStrictFDerivAt f f' x)
(hg : HasStrictFDerivAt g g' x)
(h : 0 < f x)


@[fun_prop]
theorem IsBoundedBilinearMap.differentiableAt (h : IsBoundedBilinearMap 𝕜 b) (p : E × F) :
    DifferentiableAt 𝕜 b p

{𝕜 : 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]
{b : E × F → G}
(h : IsBoundedBilinearMap 𝕜 b)
(p : E × F)


lemma coherentTopology.presheafIsLocallySurjective_iff {F G : Cᵒᵖ ⥤ D} (f : F ⟶ G)
    [Preregular C] [FinitaryPreExtensive C] [PreservesFiniteProducts F] [PreservesFiniteProducts G]
      [PreservesFiniteProducts (forget D)] :
        Presheaf.IsLocallySurjective (coherentTopology C) f ↔
          Presheaf.IsLocallySurjective (regularTopology C) f

CategoryTheory.Presheaf.IsLocallySurjective (CategoryTheory.coherentTopology C) f ↔
  CategoryTheory.Presheaf.IsLocallySurjective (CategoryTheory.regularTopology C) f


@[simp]
theorem coe_toEquiv (e : P₁ ≃ᵃL[k] P₂) : ⇑e.toEquiv = e

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)


/-- `Equiv` between `PartENat` and `ℕ∞` (for the order isomorphism see
`withTopOrderIso`). -/
@[simps]
noncomputable def withTopEquiv : PartENat ≃ ℕ∞


/-- For vectors `a x y : E`, the identity `⟪a, x⟫ * ω a y - ω a x * ⟪a, y⟫ = ‖a‖ ^ 2 * ω x y`. -/
theorem inner_mul_areaForm_sub (a x y : E) : ⟪a, x⟫ * ω a y - ω a x * ⟪a, y⟫ = ‖a‖ ^ 2 * ω x y

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

⟪a, x⟫_ℝ * (o.areaForm a) y - (o.areaForm a) x * ⟪a, y⟫_ℝ = ‖a‖ ^ 2 * (o.areaForm x) y


@[to_additive]
theorem multipliable_congr (hfg : ∀ b, f b = g b) : Multipliable f ↔ Multipliable g

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f g : β → α}
(hfg : ∀ (b : β), f b = g b)


lemma cardinalInter_ofCardinalGenerate (hc : 2 < c) :
    CardinalInterFilter (cardinalGenerate g hc) c

{α : Type u}
{c : Cardinal.{u}}
(g : Set (Set α))
(hc : 2 < c)

CardinalInterFilter (Filter.cardinalGenerate g hc) c


theorem preimage_closure (s : Set Y) : e.source ∩ e ⁻¹' closure s = e.source ∩ closure (e ⁻¹' s)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
(s : Set Y)

e.source ∩ ↑e ⁻¹' closure s = e.source ∩ closure (↑e ⁻¹' s)


@[simp]
lemma baseChange_bot : (⊥ : Submodule R M).baseChange A = ⊥

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


theorem fdiv_neg' : ∀ {a b : Int}, a < 0 → 0 < b → a.fdiv b < 0


@[simp]
theorem antisymm_toFun [IsWellOrder β s] (f : r ≼i s) (g : s ≼i r) : (antisymm f g : α → β) = f

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder β s]
(f : r ≼i s)
(g : s ≼i r)


theorem trinomial_monic (hkm : k < m) (hmn : m < n) : (trinomial k m n u v 1).Monic

{R : Type u_1}
[Semiring R]
{k m n : ℕ}
{u v : R}
(hkm : k < m)
(hmn : m < n)

(Polynomial.trinomial k m n u v 1).Monic


@[simp, norm_cast]
theorem cast_max {α} [LinearOrderedSemiring α] {a b : ℕ} : ((max a b : ℕ) : α) = max (a : α) b

{α : Type u_3}
[LinearOrderedSemiring α]
{a b : ℕ}


/--  `Fin.predAbove p` as an `OrderHom`. -/
@[simps!] def predAboveOrderHom (p : Fin n) : Fin (n + 1) →o Fin n


lemma b_relation : 4 * W.b₈ = W.b₂ * W.b₆ - W.b₄ ^ 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)


theorem measure_Ici {l : ℝ} (hf : Tendsto f atTop (𝓝 l)) (x : ℝ) :
    f.measure (Ici x) = ofReal (l - leftLim f x)

(hf : Filter.Tendsto (↑f) Filter.atTop (𝓝 l))

f.measure (Set.Ici x) = ENNReal.ofReal (l - Function.leftLim (↑f) x)