@[to_additive]
theorem smul_set_inter : a • (s ∩ t) = a • s ∩ a • t

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s t : Set β}
{a : α}


@[to_additive (attr := simp)]
theorem tprod_const [T2Space G] (a : G) : ∏' _ : β, a = a ^ (Nat.card β)

{β : Type u_2}
{G : Type u_5}
[TopologicalSpace G]
[CommGroup G]
[TopologicalGroup G]
[T2Space G]
(a : G)


/--
Let `O` be the integers of the valuation `v` on some commutative ring `R`. For every element `x` in
`O`, `x` is a unit in `O` if and only if the image of `x` in `R` is a unit and has valuation 1.
-/
theorem isUnit_of_one (hv : Integers v O) {x : O} (hx : IsUnit (algebraMap O R x))
    (hvx : v (algebraMap O R x) = 1) : IsUnit x

{R : Type u}
{Γ₀ : Type v}
[CommRing R]
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation R Γ₀}
{O : Type w}
[CommRing O]
[Algebra O R]
(hv : v.Integers O)
{x : O}
(hx : IsUnit ((algebraMap O R) x))
(hvx : v ((algebraMap O R) x) = 1)


lemma toSheaf_map_sheafificationHomEquiv_symm
    {P : PresheafOfModules.{v} R₀} {F : SheafOfModules.{v} R}
    (g : P ⟶ (restrictScalars α).obj ((SheafOfModules.forget _).obj F)) :
    (SheafOfModules.toSheaf _).map ((sheafificationHomEquiv α).symm g) =
      (((sheafificationAdjunction J AddCommGrp).homEquiv
        P.presheaf ((SheafOfModules.toSheaf R).obj F)).symm g.hom)

{J : CategoryTheory.GrothendieckTopology C}

(g : P ⟶ (PresheafOfModules.restrictScalars α).obj ((SheafOfModules.forget R).obj F))

(SheafOfModules.toSheaf R).map ((PresheafOfModules.sheafificationHomEquiv α).symm g) =
  ((CategoryTheory.sheafificationAdjunction J AddCommGrp).homEquiv P.presheaf ((SheafOfModules.toSheaf R).obj F)).symm
    g.hom


@[simp]
theorem interior_eq_univ : interior s = univ ↔ s = univ

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


@[mono]
theorem coeSubmodule_strictMono : StrictMono (coeSubmodule K : Ideal R → Submodule R K)

{R : Type u_1}
[CommRing R]
{K : Type u_5}
[CommRing K]
[Algebra R K]
[IsFractionRing R K]


@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
    vecMulVec v (vecCons x w) = of fun i => v i • vecCons x w

{α : Type u}
{n : ℕ}
{m' : Type uₘ}
[NonUnitalNonAssocSemiring α]
(v : m' → α)
(x : α)
(w : Fin n → α)

Matrix.vecMulVec v (Matrix.vecCons x w) = Matrix.of fun i => v i • Matrix.vecCons x w


@[simp]
theorem star_snd (a : 𝓜(𝕜, A)) (b : A) : (star a).snd b = star (a.fst (star b))

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
[StarRing 𝕜]
[StarRing A]
[StarModule 𝕜 A]
[NormedStarGroup A]
(a : 𝓜(𝕜, A))
(b : A)

(star a).toProd.2 b = star (a.toProd.1 (star b))


@[simp]
theorem mem_ker {x : L} : x ∈ ker f ↔ f x = 0

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')
{x : L}


theorem count_add (a b : ℕ) : count p (a + b) = count p a + count (fun k ↦ p (a + k)) b

(p : ℕ → Prop)
[DecidablePred p]
(a b : ℕ)

Nat.count p (a + b) = Nat.count p a + Nat.count (fun k => p (a + k)) b


theorem IsClosed.vadd_right_of_isCompact {s : Set V} {t : Set P} (hs : IsClosed s)
    (ht : IsCompact t) : IsClosed (s +ᵥ t)

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{s : Set V}
{t : Set P}
(hs : IsClosed s)
(ht : IsCompact t)


theorem AEStronglyMeasurable.ae_integrable_condKernel_iff {f : α × Ω → F}
    (hf : AEStronglyMeasurable f ρ) :
    (∀ᵐ a ∂ρ.fst, Integrable (fun ω ↦ f (a, ω)) (ρ.condKernel a)) ∧
      Integrable (fun a ↦ ∫ ω, ‖f (a, ω)‖ ∂ρ.condKernel a) ρ.fst ↔ Integrable f ρ

(hf : MeasureTheory.AEStronglyMeasurable f ρ)

(∀ᵐ (a : α) ∂ρ.fst, MeasureTheory.Integrable (fun ω => f (a, ω)) (ρ.condKernel a)) ∧
    MeasureTheory.Integrable (fun a => ∫ (ω : Ω), ‖f (a, ω)‖ ∂ρ.condKernel a) ρ.fst ↔
  MeasureTheory.Integrable f ρ


theorem embedding_inr [Zero R] : Embedding (inr : M → tsze R M)

{R : Type u_3}
{M : Type u_4}
[TopologicalSpace R]
[TopologicalSpace M]
[Zero R]


/--
A semireal ring is a non-trivial commutative ring (with unit) in which `-1` is *not* a sum of
squares. Note that `-1` does not make sense in a semiring. Below we define the class `isSemiReal R`
for all additive monoid `R` equipped with a multiplication, a multiplicative unit and a negation.
-/
@[mk_iff]
class isSemireal [AddMonoid R] [Mul R] [One R] [Neg R] : Prop where
  non_trivial        : (0 : R) ≠ 1
  neg_one_not_SumSq  : ¬isSumSq (-1 : R)

(R : Type u_1)
[AddMonoid R]
[Mul R]
[One R]
[Neg R]


theorem sup_mul_le_mul_sup_of_nonneg [OrderBot R] (s : Finset ι) (ha : ∀ i ∈ s, 0 ≤ a i)
    (hb : ∀ i ∈ s, 0 ≤ b i) : s.sup (a * b) ≤ s.sup a * s.sup b

{ι : Type u_1}
{R : Type u_2}
[LinearOrderedSemiring R]
{a b : ι → R}
[OrderBot R]
(s : Finset ι)
(ha : ∀ i ∈ s, 0 ≤ a i)
(hb : ∀ i ∈ s, 0 ≤ b i)


lemma smul_naturality {M N : ModuleCat.{v} R} (f : M ⟶ N) (r : R) :
    (forget₂ (ModuleCat R) AddCommGrp).map f ≫ N.smul r =
      M.smul r ≫ (forget₂ (ModuleCat R) AddCommGrp).map f

{R : Type u}
[Ring R]
{M N : ModuleCat R}
(f : M ⟶ N)
(r : R)

(CategoryTheory.forget₂ (ModuleCat R) AddCommGrp).map f ≫ N.smul r =
  M.smul r ≫ (CategoryTheory.forget₂ (ModuleCat R) AddCommGrp).map f


/-- If the unit is an isomorphism, bundle one has an isomorphism `L ⋙ R ⋙ L ≅ L`. -/
@[simps!]
noncomputable def whiskerLeftLCounitIsoOfIsIsoUnit [IsIso h.unit] : L ⋙ R ⋙ L ≅ L

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

h.whiskerLeftLCounitIsoOfIsIsoUnit.hom.app X = h.counit.app (L.obj X)


theorem tr_supports {S} (ss : TM2.Supports M S) : TM1.Supports (tr M) (trSupp M S)

{K : Type u_1}
[DecidableEq K]
{Γ : K → Type u_2}
{Λ : Type u_3}
[Inhabited Λ]
{σ : Type u_4}
(M : Λ → Turing.TM2.Stmt Γ Λ σ)
{S : Finset Λ}
(ss : Turing.TM2.Supports M S)

Turing.TM1.Supports (Turing.TM2to1.tr M) (Turing.TM2to1.trSupp M S)


/-- If `M` is nondegenerate and `w * M * v = 0` for all `w`, then `v = 0`. -/
theorem Nondegenerate.eq_zero_of_ortho {M : Matrix m m R} (hM : Nondegenerate M) {v : m → R}
    (hv : ∀ w, Matrix.dotProduct v (M *ᵥ w) = 0) : v = 0

(hv : ∀ (w : m → R), Matrix.dotProduct v (M.mulVec w) = 0)


theorem HasFiniteIntegral.mono {f : α → β} {g : α → γ} (hg : HasFiniteIntegral g μ)
    (h : ∀ᵐ a ∂μ, ‖f a‖ ≤ ‖g a‖) : HasFiniteIntegral f μ

(hg : MeasureTheory.HasFiniteIntegral g μ)


lemma isInteriorPoint_iff {x : M} :
    I.IsInteriorPoint x ↔ extChartAt I x x ∈ interior (extChartAt I x).target

{𝕜 : 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}

I.IsInteriorPoint x ↔ ↑(extChartAt I x) x ∈ interior (extChartAt I x).target


{R : Type u}
[CommSemiring R]
{I J : Ideal R}


theorem comp_app {X Y Z : TopCat.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) :
    (f ≫ g : X → Z) x = g (f x)

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


theorem IsLocal.le_jacobson {I J : Ideal R} (hi : IsLocal I) (hij : I ≤ J) (hj : J ≠ ⊤) :
    J ≤ jacobson I

{R : Type u}
[CommRing R]
{I J : Ideal R}
(hi : I.IsLocal)
(hij : I ≤ J)
(hj : J ≠ ⊤)


lemma dualSubmodule_dualSubmodule_flip_of_basis {ι : Type*} [Finite ι]
    (hB : B.Nondegenerate) (b : Basis ι S M) :
    B.dualSubmodule (B.flip.dualSubmodule (Submodule.span R (Set.range b))) =
      Submodule.span R (Set.range b)

{R : Type u_4}
{S : Type u_2}
{M : Type u_3}
[CommRing R]
[Field S]
[AddCommGroup M]
[Algebra R S]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(B : LinearMap.BilinForm S M)
{ι : Type u_1}
[Finite ι]
(hB : B.Nondegenerate)
(b : Basis ι S M)

B.dualSubmodule (B.flip.dualSubmodule (Submodule.span R (Set.range ⇑b))) = Submodule.span R (Set.range ⇑b)


theorem mem_support_derivative [NoZeroSMulDivisors ℕ R] (p : R[X]) (n : ℕ) :
    n ∈ (derivative p).support ↔ n + 1 ∈ p.support

{R : Type u}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
(p : R[X])
(n : ℕ)

n ∈ (Polynomial.derivative p).support ↔ n + 1 ∈ p.support


@[to_additive]
theorem eq_bot_of_card_eq (h : card S = 1) : S = ⊥

{M : Type u_1}
[AddMonoid M]
{S : AddSubmonoid M}
[Fintype ↥S]
(h : Fintype.card ↥S = 1)


@[simp, norm_cast]
theorem coeComplex_one : ((1 : ℂ) : ℍ) = 1


@[to_additive]
protected theorem map_mul [FunLike F α β] [MulHomClass F α β] (m : F) :
    (f₁ * f₂).map m = f₁.map m * f₂.map m

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Add α]
[Add β]
{f₁ f₂ : Filter α}
[FunLike F α β]
[AddHomClass F α β]
(m : F)

Filter.map (⇑m) (f₁ + f₂) = Filter.map (⇑m) f₁ + Filter.map (⇑m) f₂


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

{M : Type u_2}
[AddZeroClass M]
(S : Set (AddSubmonoid Mᵃᵒᵖ))

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


/-- The topology of a `NormedSpace 𝕜 E` is induced by the seminorm `normSeminorm 𝕜 E`. -/
theorem norm_withSeminorms (𝕜 E) [NormedField 𝕜] [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] :
    WithSeminorms fun _ : Fin 1 => normSeminorm 𝕜 E

(𝕜 : Type u_10)
(E : Type u_11)
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]


@[to_additive]
theorem closure.isSubgroup (s : Set G) : IsSubgroup (closure s)


@[simp]
theorem toCoalgEquiv_eq_coe (f : A ≃ₐc[R] B) : f.toCoalgEquiv = f

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


theorem tsum_lt_tsum {f g : α → ℝ≥0} {i : α} (h : ∀ a : α, f a ≤ g a) (hi : f i < g i)
    (hg : Summable g) : ∑' n, f n < ∑' n, g n

{α : Type u_1}
{f g : α → ℝ≥0}
{i : α}
(h : ∀ (a : α), f a ≤ g a)
(hi : f i < g i)
(hg : Summable g)


private lemma formula2 :
    S.Y ^ 3 + S.u₄ * S.Z ^ 3 = S.u₅ * (λ ^ (S.multiplicity - 1) * S.X) ^ 3

(S : FermatLastTheoremForThreeGen.Solution hζ)

FermatLastTheoremForThreeGen.Solution.Y S ^ 3 +
    ↑(FermatLastTheoremForThreeGen.Solution.u₄ S) * FermatLastTheoremForThreeGen.Solution.Z S ^ 3 =
  ↑(FermatLastTheoremForThreeGen.Solution.u₅ S) *
    ((hζ.toInteger - 1) ^ (S.multiplicity - 1) * FermatLastTheoremForThreeGen.Solution.X S) ^ 3


theorem isHermitian_transpose_add_self (A : Matrix n n α) : (Aᴴ + A).IsHermitian

{α : Type u_1}
{n : Type u_4}
[AddCommMonoid α]
[StarAddMonoid α]
(A : Matrix n n α)


theorem mono_set' (hf : IntervalIntegrable f μ a b) (hsub : Ι c d ⊆ Ι a b) :
    IntervalIntegrable f μ c d

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b c d : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hf : IntervalIntegrable f μ a b)
(hsub : Ι c d ⊆ Ι a b)


@[to_additive]
theorem tendsto_inv_nhdsWithin_Ici {a : H} : Tendsto Inv.inv (𝓝[≥] a) (𝓝[≤] a⁻¹)

{H : Type x}
[TopologicalSpace H]
[OrderedCommGroup H]
[ContinuousInv H]
{a : H}

Filter.Tendsto Inv.inv (𝓝[≥] a) (𝓝[≤] a⁻¹)


@[simp]
theorem U_neg_two : U R (-2) = -1


lemma coe_injective [Nontrivial α] : Injective ((⇑) : Line α ι → α → ι → α)

{α : Type u_2}
{ι : Type u_3}
[Nontrivial α]

Function.Injective fun x x_1 i => (x.idxFun i).getD x_1


/-- A version of `ne_iff_lt_or_gt` with LHS and RHS reversed. -/
@[simp]
theorem lt_or_lt_iff_ne [LinearOrder α] {x y : α} : x < y ∨ y < x ↔ x ≠ y

{α : Type u_2}
[LinearOrder α]
{x y : α}


theorem OneOneEquiv.to_many_one {α β} [Primcodable α] [Primcodable β] {p : α → Prop}
    {q : β → Prop} : OneOneEquiv p q → ManyOneEquiv p q

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : α → Prop}
{q : β → Prop}


@[reassoc (attr := simp)]
lemma colimitHomIsoLimitYoneda'_inv_comp_π [HasLimitsOfShape I (Type u₂)] (A : C) (i : I) :
    (colimitHomIsoLimitYoneda' F A).inv ≫ (coyoneda.map (colimit.ι F ⟨i⟩).op).app A
      = limit.π (F.rightOp ⋙ yoneda.obj A) i

[CategoryTheory.Limits.HasLimitsOfShape I (Type u₂)]

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.colimitHomIsoLimitYoneda' F A).inv
    ((CategoryTheory.coyoneda.map (CategoryTheory.Limits.colimit.ι F (Opposite.op i)).op).app A) =
  CategoryTheory.Limits.limit.π (F.rightOp.comp (CategoryTheory.yoneda.obj A)) i


theorem uniformIntegrable_congr_ae {g : ι → α → β} (hfg : ∀ n, f n =ᵐ[μ] g n) :
    UniformIntegrable f p μ ↔ UniformIntegrable g p μ

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{p : ℝ≥0∞}
{f g : ι → α → β}
(hfg : ∀ (n : ι), f n =ᵐ[μ] g n)

MeasureTheory.UniformIntegrable f p μ ↔ MeasureTheory.UniformIntegrable g p μ


theorem fderivWithin_csin (hf : DifferentiableWithinAt ℂ f s x) (hxs : UniqueDiffWithinAt ℂ s x) :
    fderivWithin ℂ (fun x => Complex.sin (f x)) s x = Complex.cos (f x) • fderivWithin ℂ f s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℂ f s x)
(hxs : UniqueDiffWithinAt ℂ s x)


@[to_additive (attr := simp)]
theorem map_comap_map {f : M →ₙ* N} : ((S.map f).comap f).map f = S.map f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(S : Subsemigroup M)
{f : M →ₙ* N}

Subsemigroup.map f (Subsemigroup.comap f (Subsemigroup.map f S)) = Subsemigroup.map f S


@[to_additive (attr := simp)]
theorem traverse_pure' : traverse F ∘ pure = fun x ↦ (pure <$> F x : m (FreeMagma β))

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)

traverse F ∘ pure = fun x => pure <$> F x


/-- `R` is integrally closed iff all integral elements of its fraction field `K`
are also elements of `R`. -/
theorem isIntegrallyClosed_iff :
    IsIntegrallyClosed R ↔ ∀ {x : K}, IsIntegral R x → ∃ y, algebraMap R K y = x

{R : Type u_1}
[CommRing R]
(K : Type u_4)
[CommRing K]
[Algebra R K]
[IsFractionRing R K]

IsIntegrallyClosed R ↔ ∀ {x : K}, IsIntegral R x → ∃ y, (algebraMap R K) y = x


lemma unitsMap_def (hm : n ∣ m) : unitsMap hm = Units.map (castHom hm (ZMod n))

ZMod.unitsMap hm = Units.map ↑(ZMod.castHom hm (ZMod n))


@[simp]
theorem snoc_last : snoc p x (last n) = x

{n : ℕ}
{α : Fin (n + 1) → Type u}
(x : α (Fin.last n))
(p : (i : Fin n) → α i.castSucc)


@[simp]
theorem encode_false : encode false = 0


@[simp]
theorem isLittleO_zero_right_iff : (f'' =o[l] fun _x => (0 : F')) ↔ f'' =ᶠ[l] 0

{α : Type u_1}
{F' : Type u_7}
{E'' : Type u_9}
[SeminormedAddCommGroup F']
[NormedAddCommGroup E'']
{f'' : α → E''}
{l : Filter α}


theorem pimage_subset {t : Finset β} : s.pimage f ⊆ t ↔ ∀ x ∈ s, ∀ y ∈ f x, y ∈ t

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α →. β}
[(x : α) → Decidable (f x).Dom]
{s : Finset α}
{t : Finset β}

Finset.pimage f s ⊆ t ↔ ∀ x ∈ s, ∀ y ∈ f x, y ∈ t


theorem mem_equiv_left {l : Lists' α true} : ∀ {a a'}, a ~ a' → (a ∈ l ↔ a' ∈ l)

{α : Type u_1}
{l : Lists' α true}
{a a' : Lists α}


theorem IsClosed.mono (hs : IsClosed[t₂] s) (h : t₁ ≤ t₂) : IsClosed[t₁] s

{α : Type u_1}
{t₁ t₂ : TopologicalSpace α}
{s : Set α}
(hs : IsClosed s)
(h : t₁ ≤ t₂)


theorem map_subtype_embedding_Ioc : (Ioc a b).map (Embedding.subtype _) = Ioc ↑a ↑b

Finset.map (Function.Embedding.subtype fun n => 0 < n) (Finset.Ioc a b) = Finset.Ioc ↑a ↑b


theorem one_le_iff_pos {o : Ordinal} : 1 ≤ o ↔ 0 < o


/-- The functor `(Φ.op.RightResolution X₂)ᵒᵖ ⥤ Φ.LeftResolution X₂.unop`. -/
@[simps]
def RightResolution.unopFunctor (X₂ : C₂ᵒᵖ) [W₁.IsMultiplicative] :
    (Φ.op.RightResolution X₂)ᵒᵖ ⥤ Φ.LeftResolution X₂.unop

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

(CategoryTheory.LocalizerMorphism.RightResolution.unopFunctor Φ X₂).obj R = (Opposite.unop R).unop


lemma exists_abs_lt {α : Type*} [LinearOrderedRing α] (a : α) : ∃ b > 0, |a| < b

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


/-- `Fin.castSucc` as an `Embedding`, `castSuccEmb i` embeds `i : Fin n` in `Fin (n+1)`. -/
@[simps! apply]
def castSuccEmb : Fin n ↪ Fin (n + 1)


protected lemma partialSups (hf : ∀ k ≤ n, Tendsto (f k) l (𝓝 (g k))) :
    Tendsto (partialSups f n) l (𝓝 (partialSups g n))

(hf : ∀ k ≤ n, Filter.Tendsto (f k) l (𝓝 (g k)))

Filter.Tendsto ((partialSups f) n) l (𝓝 ((partialSups g) n))


theorem comap_equiv_eq_map_symm (f : R ≃+* S) (K : Subring S) :
    K.comap (f : R →+* S) = K.map f.symm

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R ≃+* S)
(K : Subring S)

Subring.comap (↑f) K = Subring.map (↑f.symm) K


@[simp]
lemma add_of_Y_eq {x₁ x₂ y₁ y₂ : F} {h₁ : W.Nonsingular x₁ y₁} {h₂ : W.Nonsingular x₂ y₂}
    (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂) : some h₁ + some h₂ = 0

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
{h₁ : W.Nonsingular x₁ y₁}
{h₂ : W.Nonsingular x₂ y₂}
(hx : x₁ = x₂)
(hy : y₁ = W.negY x₂ y₂)

WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ = 0


/-- An element of `R[M]` is in the subalgebra generated by its support. -/
theorem mem_adjoin_support (f : R[M]) : f ∈ adjoin R (of' R M '' f.support)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddMonoid M]
(f : AddMonoidAlgebra R M)

f ∈ Algebra.adjoin R (AddMonoidAlgebra.of' R M '' ↑f.support)


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

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


/-- The reduction of the graph `G` along partition `P` has edges between `ε`-uniform pairs of parts
that have edge density at least `δ`. -/
@[simps] def regularityReduced (ε δ : 𝕜) : SimpleGraph α

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
(P : Finpartition A)
(G : SimpleGraph α)
[DecidableRel G.Adj]
(ε δ : 𝕜)
(a b : α)

(SimpleGraph.regularityReduced P G ε δ).Adj a b =
  (G.Adj a b ∧ ∃ U ∈ P.parts, ∃ V ∈ P.parts, a ∈ U ∧ b ∈ V ∧ U ≠ V ∧ G.IsUniform ε U V ∧ δ ≤ ↑(G.edgeDensity U V))


lemma differentiableAt_expZeta (a : UnitAddCircle) (s : ℂ) (hs : s ≠ 1 ∨ a ≠ 0) :
    DifferentiableAt ℂ (expZeta a) s

DifferentiableAt ℂ (HurwitzZeta.expZeta a) s


@[simp]
theorem sum_right {ι : Type*} [Countable ι] {ν : ι → Measure α} : μ ⟂ₘ sum ν ↔ ∀ i, μ ⟂ₘ ν i

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{ι : Type u_2}
[Countable ι]
{ν : ι → MeasureTheory.Measure α}

μ ⟂ₘ MeasureTheory.Measure.sum ν ↔ ∀ (i : ι), μ ⟂ₘ ν i


theorem bddBelow_measureOfNegatives : BddBelow s.measureOfNegatives

{α : Type u_1}
[MeasurableSpace α]
{s : MeasureTheory.SignedMeasure α}


/-- A complete nontrivially normed field has cardinality at least continuum. -/
theorem continuum_le_cardinal_of_nontriviallyNormedField
    (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] : 𝔠 ≤ #𝕜

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]


@[to_additive]
theorem IsLowerSet.mul_left (ht : IsLowerSet t) : IsLowerSet (s * t)

{α : Type u_1}
[OrderedCommGroup α]
{s t : Set α}
(ht : IsLowerSet t)


theorem StrictMono.maximal_of_maximal_image (hf : StrictMono f) {a} (hmax : ∀ p, p ≤ f a) (x : α) :
    x ≤ a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
(hf : StrictMono f)
{a : α}
(hmax : ∀ (p : β), p ≤ f a)
(x : α)


theorem toSpanSingleton_one (x : M) : toSpanSingleton R M x 1 = x

(R : Type u_1)
(M : Type u_4)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)


theorem pow_apply (f : G →+c[a, a] G) (n : ℕ) (x : G) : (f ^ n) x = f^[n] x

{G : Type u_1}
[Add G]
{a : G}
(f : AddConstMap G G a a)
(n : ℕ)
(x : G)


theorem compl_mem_hyperfilter_of_finite {s : Set α} (hf : Set.Finite s) : sᶜ ∈ hyperfilter α

{α : Type u}
[Infinite α]
{s : Set α}
(hf : s.Finite)


@[simp]
theorem add_sigma (s t : Multiset α) (u : ∀ a, Multiset (σ a)) :
    (s + t).sigma u = s.sigma u + t.sigma u

{α : Type u_1}
{σ : α → Type u_4}
(s t : Multiset α)
(u : (a : α) → Multiset (σ a))


/-- Constructor for `Cover.Relation` which takes as an input
`r : I₁.Relation I₂` with `I₁ I₂ : S.Arrow`. -/
@[simps]
def Relation.mk' {S : J.Cover X} {fst snd : S.Arrow} (r : fst.Relation snd) :
    S.Relation

{J : CategoryTheory.GrothendieckTopology C}

(CategoryTheory.GrothendieckTopology.Cover.Relation.mk' r).snd = snd


protected theorem nonempty (e : α ≃ β) [Nonempty β] : Nonempty α

{α : Sort u}
{β : Sort v}
(e : α ≃ β)
[Nonempty β]


@[to_additive]
lemma mem_orbit_of_mem_orbit_subgroup {H : Subgroup G} {a b : α} (h : a ∈ orbit H b) :
    a ∈ orbit G b

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
{H : Subgroup G}
{a b : α}
(h : a ∈ MulAction.orbit (↥H) b)


/-- When both `S.f` and `S.g` are zero, the middle object `S.X₂` gives a left homology data on S -/
@[simps]
def ofZeros (hf : S.f = 0) (hg : S.g = 0) : S.LeftHomologyData

(CategoryTheory.ShortComplex.LeftHomologyData.ofZeros S hf hg).π = CategoryTheory.CategoryStruct.id S.X₂


theorem measurableSet_support [MeasurableSpace α] (f : α →ₛ β) : MeasurableSet (support f)

{α : Type u_1}
{β : Type u_2}
[Zero β]
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)


/-- The restriction of `Proj π J` to a subset, mapping to its image. -/
@[simps!]
def ProjRestrict : C → π C J

{I : Type u}
(C : Set (I → Bool))
(J : I → Prop)
[(i : I) → Decidable (J i)]

∀ (a : ↑C) (a_1 : I), ↑(Profinite.NobelingProof.ProjRestrict C J a) a_1 = Profinite.NobelingProof.Proj J (↑a) a_1


@[simp]
theorem _root_.ContinuousLinearEquiv.compContinuousAlternatingMap_coe
    (e : N ≃L[R] N') (f : M [⋀^ι]→L[R] N) : ⇑(e.compContinuousAlternatingMap f) = e ∘ f

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{N' : Type u_5}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
[AddCommMonoid N']
[Module R N']
[TopologicalSpace N']
(e : N ≃L[R] N')
(f : M [⋀^ι]→L[R] N)

⇑(e.compContinuousAlternatingMap f) = ⇑e ∘ ⇑f


/-- A generalized eigenvalue for some exponent `k` is also
    a generalized eigenvalue for exponents larger than `k`. -/
theorem hasGenEigenvalue_of_hasGenEigenvalue_of_le {f : End R M} {μ : R} {k : ℕ}
    {m : ℕ} (hm : k ≤ m) (hk : f.HasGenEigenvalue μ k) :
    f.HasGenEigenvalue μ m

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
{k m : ℕ}
(hm : k ≤ m)
(hk : f.HasGenEigenvalue μ k)


@[simp]
theorem toAffineEquiv_refl : (refl 𝕜 P).toAffineEquiv = AffineEquiv.refl 𝕜 P

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]

(AffineIsometryEquiv.refl 𝕜 P).toAffineEquiv = AffineEquiv.refl 𝕜 P


theorem nhds_basis_eball : (𝓝 x).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) (ball x)

{α : Type u}
[PseudoEMetricSpace α]
{x : α}

(𝓝 x).HasBasis (fun ε => 0 < ε) (EMetric.ball x)


@[simp, norm_cast]
theorem Complex.coe_smul {E : Type*} [AddCommGroup E] [Module ℂ E] (x : ℝ) (y : E) :
    (x : ℂ) • y = x • y

{E : Type u_1}
[AddCommGroup E]
[Module ℂ E]
(x : ℝ)
(y : E)


/-- A version of `FractionalIdeal.den_mul_self_eq_num` in terms of fractional ideals. -/
theorem den_mul_self_eq_num' (I : FractionalIdeal S P) :
    spanSingleton S (algebraMap R P I.den) * I = I.num

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
(P : Type u_2)
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
(I : FractionalIdeal S P)

FractionalIdeal.spanSingleton S ((algebraMap R P) ↑I.den) * I = ↑I.num


/-- If `f` is `C^1` within a convex set `s` at `x`, then it is Lipschitz on a neighborhood of `x`
within `s`. -/
theorem ContDiffWithinAt.exists_lipschitzOnWith {E F : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F} {s : Set E} {x : E}
    (hf : ContDiffWithinAt ℝ 1 f s x) (hs : Convex ℝ s) :
    ∃ K : ℝ≥0, ∃ t ∈ 𝓝[s] x, LipschitzOnWith K f t

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{f : E → F}
{s : Set E}
{x : E}
(hf : ContDiffWithinAt ℝ 1 f s x)
(hs : Convex ℝ s)

∃ K, ∃ t ∈ 𝓝[s] x, LipschitzOnWith K f t


lemma Finset.univ_eq_elems {α : Type*} [Fintype α] (elems : Finset α)
    (complete : ∀ x : α, x ∈ elems) :
    Finset.univ = elems

{α : Type u_1}
[Fintype α]
(elems : Finset α)
(complete : ∀ (x : α), x ∈ elems)


theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o

(H₂ : ∀ (o : Ordinal.{u_4}), b ≤ o ↔ ∀ a ∈ p, a ≤ o)


/-- Evaluation of continuous maps at a point, bundled as a star algebra homomorphism. -/
@[simps!]
def ContinuousMap.evalStarAlgHom [StarRing R] [ContinuousStar R] (x : X) :
    C(X, R) →⋆ₐ[S] R

{X : Type u_1}
(S : Type u_2)
(R : Type u_3)
[TopologicalSpace X]
[CommSemiring S]
[CommSemiring R]
[Algebra S R]
[TopologicalSpace R]
[TopologicalSemiring R]
[StarRing R]
[ContinuousStar R]
(x : X)
(f : C(X, R))

(ContinuousMap.evalStarAlgHom S R x) f = f x


@[simp]
theorem mk_le_mk {S S' : NonUnitalSubsemiring R} (h h') :
    (⟨S, h⟩ : NonUnitalSubring R) ≤ (⟨S', h'⟩ : NonUnitalSubring R) ↔ S ≤ S'

(h : ∀ {x : R}, x ∈ S.carrier → -x ∈ S.carrier)

(h' : ∀ {x : R}, x ∈ S'.carrier → -x ∈ S'.carrier)

{ toNonUnitalSubsemiring := S, neg_mem' := h } ≤ { toNonUnitalSubsemiring := S', neg_mem' := h' } ↔ S ≤ S'


/-- **Leibniz's series for `π`**. The alternating sum of odd number reciprocals is `π / 4`,
proved by using Abel's limit theorem to extend the Maclaurin series of `arctan` to 1. -/
theorem tendsto_sum_pi_div_four :
    Tendsto (fun k => ∑ i ∈ range k, (-1 : ℝ) ^ i / (2 * i + 1)) atTop (𝓝 (π / 4))

Filter.Tendsto (fun k => ∑ i ∈ Finset.range k, (-1) ^ i / (2 * ↑i + 1)) Filter.atTop (nhds (Real.pi / 4))


@[csimp] theorem map_eq_mapTR : @map = @mapTR


@[simp]
theorem Ici_iSup (f : ι → α) : Ici (⨆ i, f i) = ⨆ i, Ici (f i)

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

UpperSet.Ici (⨆ i, f i) = ⨆ i, UpperSet.Ici (f i)


/-- The inner product between a multiple of a vector and a `π / 2` rotation of that vector is
zero. -/
@[simp]
theorem inner_rotation_pi_div_two_right_smul (x : V) (r : ℝ) :
    ⟪r • x, o.rotation (π / 2 : ℝ) x⟫ = 0

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


/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => ⨂[R]^n M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(n : ℕ)
(x : Fin n → M)

(List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)).prod =
  GradedMonoid.mk n ((PiTensorProduct.tprod R) x)


/-- An `𝕆`-graded order where maximal elements have maximal grades. -/
class GradeMaxOrder (𝕆 α : Type*) [Preorder 𝕆] [Preorder α] extends GradeOrder 𝕆 α where
  /-- Maximal elements have maximal grades. -/
  isMax_grade ⦃a : α⦄ : IsMax a → IsMax (grade a)

{𝕆 : Type u_5}
{α : Type u_6}
[Preorder 𝕆]
[Preorder α]
[self : GradeMaxOrder 𝕆 α]
⦃a : α⦄


theorem Measurable.eventuallyMeasurable (hf : Measurable f) : EventuallyMeasurable m l f

{α : Type u_1}
{m : MeasurableSpace α}
{l : Filter α}
[CountableInterFilter l]
{β : Type u_2}
[MeasurableSpace β]
{f : α → β}
(hf : Measurable f)


@[to_additive]
theorem eqOn_mulIndicator : EqOn (mulIndicator s f) f s

{α : Type u_1}
{M : Type u_4}
[Zero M]
{s : Set α}
{f : α → M}


theorem continuousOn_zpow₀ (m : ℤ) : ContinuousOn (fun x : G₀ => x ^ m) {0}ᶜ

{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]
(m : ℤ)


@[simp]
theorem edist_toL1_toL1 (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) :
    edist (hf.toL1 f) (hg.toL1 g) = ∫⁻ a, edist (f a) (g a) ∂μ

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

edist (MeasureTheory.Integrable.toL1 f hf) (MeasureTheory.Integrable.toL1 g hg) = ∫⁻ (a : α), edist (f a) (g a) ∂μ


@[simp] lemma chainBot_zero : chainBot 0 β = β

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(β : LieModule.Weight R L M)


@[to_additive]
lemma MulAction.IsPretransitive.of_isScalarTower (M : Type*) {N α : Type*} [Monoid N] [SMul M N]
    [MulAction N α] [SMul M α] [IsScalarTower M N α] [IsPretransitive M α] : IsPretransitive N α

(M : Type u_11)
{N : Type u_12}
{α : Type u_13}
[Monoid N]
[SMul M N]
[MulAction N α]
[SMul M α]
[IsScalarTower M N α]
[MulAction.IsPretransitive M α]


lemma toFin_zsmul (z : ℤ) (x : BitVec w)  : toFin (z • x) = z • x.toFin


@[simp] theorem foldrM_reverse [Monad m] (l : List α) (f : α → β → m β) (b) :
    l.reverse.foldrM f b = l.foldlM (fun x y => f y x) b

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(l : List α)
(f : α → β → m β)
(b : β)

List.foldrM f b l.reverse = List.foldlM (fun x y => f y x) b l


theorem zero (v : VectorMeasure α N) : (0 : VectorMeasure α M) ≪ᵥ v

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[TopologicalSpace M]
[AddCommMonoid N]
[TopologicalSpace N]
(v : MeasureTheory.VectorMeasure α N)


lemma integrable_densityProcess (hκν : fst κ ≤ ν) [IsFiniteKernel ν] (n : ℕ)
    (a : α) {s : Set β} (hs : MeasurableSet s) :
    Integrable (fun x ↦ densityProcess κ ν n a x s) (ν a)

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

MeasureTheory.Integrable (fun x => κ.densityProcess ν n a x s) (ν a)


/-- Convenience constructor for an isomorphism in monomorphisms over `X`. -/
@[simps]
def isoMk {f g : MonoOver X} (h : f.obj.left ≅ g.obj.left)
    (w : h.hom ≫ g.arrow = f.arrow := by aesop_cat) : f ≅ g

(w : CategoryTheory.CategoryStruct.comp h.hom g.arrow = f.arrow := by aesop_cat)

(CategoryTheory.MonoOver.isoMk h w).hom = CategoryTheory.MonoOver.homMk h.hom w


theorem pow_sub_lt_descFactorial' {n : ℕ} :
    ∀ {k : ℕ}, k + 2 ≤ n → (n - (k + 1)) ^ (k + 2) < n.descFactorial (k + 2)


theorem mapIdx_induction (as : Array α) (f : Fin as.size → α → β)
    (motive : Nat → Prop) (h0 : motive 0)
    (p : Fin as.size → β → Prop)
    (hs : ∀ i, motive i.1 → p i (f i as[i]) ∧ motive (i + 1)) :
    motive as.size ∧ ∃ eq : (Array.mapIdx as f).size = as.size,
      ∀ i h, p ⟨i, h⟩ ((Array.mapIdx as f)[i])

(hs : ∀ (i : Fin as.size), motive ↑i → p i (f i as[i]) ∧ motive (↑i + 1))

motive as.size ∧ ∃ eq, ∀ (i : Nat) (h : i < as.size), p ⟨i, h⟩ (as.mapIdx f)[i]


theorem WellFounded.finite_of_independent (hwf : WellFounded ((· > ·) : α → α → Prop)) {ι : Type*}
    {t : ι → α} (ht : Independent t) (h_ne_bot : ∀ i, t i ≠ ⊥) : Finite ι

(hwf : WellFounded fun x x_1 => x > x_1)


theorem Preorder.dual_dual (α : Type*) [H : Preorder α] : OrderDual.instPreorder αᵒᵈ = H


/-- The nilpotency class of a nilpotent `G` is equal to the length of the lower central series. -/
theorem lowerCentralSeries_length_eq_nilpotencyClass :
    Nat.find (nilpotent_iff_lowerCentralSeries.mp hG) = Group.nilpotencyClass (G := G)

{G : Type u_1}
[Group G]
[hG : Group.IsNilpotent G]


/-- If `f` tends to infinity along a nontrivial filter,
`fun x ↦ f x / r` tends to negative infinity if and only if `r < 0. `-/
lemma tendsto_div_const_atBot_iff_neg [NeBot l] (h : Tendsto f l atTop) :
    Tendsto (fun x ↦ f x / r) l atBot ↔ r < 0

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
[l.NeBot]
(h : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => f x / r) l Filter.atBot ↔ r < 0


@[to_additive (attr := simp)]
theorem prod_properDivisors_prime_pow {α : Type*} [CommMonoid α] {k p : ℕ} {f : ℕ → α}
    (h : p.Prime) : (∏ x ∈ (p ^ k).properDivisors, f x) = ∏ x ∈ range k, f (p ^ x)

{α : Type u_1}
[CommMonoid α]
{k p : ℕ}
{f : ℕ → α}
(h : Nat.Prime p)

∏ x ∈ (p ^ k).properDivisors, f x = ∏ x ∈ Finset.range k, f (p ^ x)


@[simp]
theorem Ioc_diff_Iic : Ioc a b \ Iic c = Ioc (max a c) b

{α : Type u_1}
[LinearOrder α]
{a b c : α}

Set.Ioc a b \ Set.Iic c = Set.Ioc (max a c) b


/-- When a function has a limit at infinity, and its derivative is nonpositive, then the derivative
is automatically integrable on `(a, +∞)`. Version assuming differentiability
on `(a, +∞)` and continuity at `a⁺`. -/
theorem integrableOn_Ioi_deriv_of_nonpos (hcont : ContinuousWithinAt g (Ici a) a)
    (hderiv : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (g'neg : ∀ x ∈ Ioi a, g' x ≤ 0)
    (hg : Tendsto g atTop (𝓝 l)) : IntegrableOn g' (Ioi a)

(hcont : ContinuousWithinAt g (Set.Ici a) a)

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

(hg : Filter.Tendsto g Filter.atTop (𝓝 l))

MeasureTheory.IntegrableOn g' (Set.Ioi a) MeasureTheory.volume


theorem AlgHom.closure_ker_inter {F S K A : Type*} [CommRing K] [Ring A] [Algebra K A]
    [TopologicalSpace K] [T1Space K] [TopologicalSpace A] [ContinuousSub A] [ContinuousSMul K A]
    [FunLike F A K] [AlgHomClass F K A K] [SetLike S A] [OneMemClass S A] [AddSubgroupClass S A]
    [SMulMemClass S K A] (φ : F) (hφ : Continuous φ) (s : S) :
    closure (s ∩ RingHom.ker φ) = closure s ∩ (ker φ : Set A)

{F : Type u_3}
{S : Type u_4}
{K : Type u_5}
{A : Type u_6}
[CommRing K]
[Ring A]
[Algebra K A]
[TopologicalSpace K]
[T1Space K]
[TopologicalSpace A]
[ContinuousSub A]
[ContinuousSMul K A]
[FunLike F A K]
[AlgHomClass F K A K]
[SetLike S A]
[OneMemClass S A]
[AddSubgroupClass S A]
[SMulMemClass S K A]
(φ : F)
(hφ : Continuous ⇑φ)
(s : S)

closure (↑s ∩ ↑(RingHom.ker φ)) = closure ↑s ∩ ↑(RingHom.ker φ)


/-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is non-strictly above the
segment `[(a, f a), (b, f b)]` if and only if `slope f c b ≤ slope f a c`. -/
theorem lineMap_le_map_iff_slope_le_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) :
    lineMap (f a) (f b) r ≤ f c ↔ slope f c b ≤ slope f a c

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(hab : a < b)
(h₀ : 0 < r)
(h₁ : r < 1)

(AffineMap.lineMap (f a) (f b)) r ≤ f ((AffineMap.lineMap a b) r) ↔
  slope f ((AffineMap.lineMap a b) r) b ≤ slope f a ((AffineMap.lineMap a b) r)


@[simp]
theorem bot_toSubalgebra : (⊥ : IntermediateField F E).toSubalgebra = ⊥

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]


@[reassoc (attr := simp)]
theorem hom_comp_ι (K₁ K₂ : Multifork I) (f : K₁ ⟶ K₂) (j : I.L) : f.hom ≫ K₂.ι j = K₁.ι j

{I : CategoryTheory.Limits.MulticospanIndex C}

(K₁ K₂ : CategoryTheory.Limits.Multifork I)

CategoryTheory.CategoryStruct.comp f.hom (K₂.ι j) = K₁.ι j


theorem ofAlgHom_symm (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ h₂) :
    (ofAlgHom f g h₁ h₂).symm = ofAlgHom g f h₂ h₁

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(f : A₁ →ₐ[R] A₂)
(g : A₂ →ₐ[R] A₁)
(h₁ : f.comp g = AlgHom.id R A₂)
(h₂ : g.comp f = AlgHom.id R A₁)

(AlgEquiv.ofAlgHom f g h₁ h₂).symm = AlgEquiv.ofAlgHom g f h₂ h₁


@[to_additive]
theorem prod_update_of_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s) (f : α → β) (b : β) :
    ∏ x ∈ s, Function.update f i b x = b * ∏ x ∈ s \ singleton i, f x

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
{s : Finset α}
{i : α}
(h : i ∈ s)
(f : α → β)
(b : β)

∏ x ∈ s, Function.update f i b x = b * ∏ x ∈ s \ {i}, f x


@[norm_cast]
theorem coe_intCast (z : ℤ) : ↑(z : R) = (z : ℍ[R])


@[to_additive]
theorem orderOf_mul_dvd_lcm (h : Commute x y) :
    orderOf (x * y) ∣ Nat.lcm (orderOf x) (orderOf y)

{G : Type u_1}
[Monoid G]
{x y : G}
(h : Commute x y)

orderOf (x * y) ∣ (orderOf x).lcm (orderOf y)


@[simp, norm_cast]
theorem intCast_imJ (z : ℤ) : (z : ℍ[R,c₁,c₂]).imJ = 0

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


@[simp]
theorem encode_sigma_val (a b) : @encode (Sigma γ) _ ⟨a, b⟩ = pair (encode a) (encode b)

{α : Type u_1}
{γ : α → Type u_3}
[Encodable α]
[(a : α) → Encodable (γ a)]
(a : α)
(b : γ a)

Encodable.encode ⟨a, b⟩ = Nat.pair (Encodable.encode a) (Encodable.encode b)


/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2)

(R : Type u_1)
{k : Type u_2}
{V1 : Type u_3}
{V2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[AddCommGroup V2]
[Module k V1]
[Module k V2]
[Semiring R]
[Module R V2]
[SMulCommClass k R V2]
(f : V1 →ᵃ[k] V2)

(AffineMap.toConstProdLinearMap R) f = (f 0, f.linear)


@[simp]
theorem insepDegree_self : insepDegree F F = 1


@[simp]
theorem preimage_const_mul_Ioc (a b : α) {c : α} (h : 0 < c) :
    (c * ·) ⁻¹' Ioc a b = Ioc (a / c) (b / c)

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

(fun x => c * x) ⁻¹' Set.Ioc a b = Set.Ioc (a / c) (b / c)


theorem nsmul_replicate {a : α} (n m : ℕ) : n • replicate m a = replicate (n * m) a

n • Multiset.replicate m a = Multiset.replicate (n * m) a


lemma exp_log (a : A) (ha₂ : ∀ x ∈ spectrum ℝ a, 0 < x) (ha₁ : IsSelfAdjoint a := by cfc_tac) :
    NormedSpace.exp ℝ (log a) = a


theorem coeff_mul [DecidableEq σ] :
    coeff R n (φ * ψ) = ∑ p ∈ antidiagonal n, coeff R p.1 φ * coeff R p.2 ψ

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(n : σ →₀ ℕ)
(φ ψ : MvPowerSeries σ R)
[DecidableEq σ]

(MvPowerSeries.coeff R n) (φ * ψ) =
  ∑ p ∈ Finset.antidiagonal n, (MvPowerSeries.coeff R p.1) φ * (MvPowerSeries.coeff R p.2) ψ


/-- Useful in proofs by induction. -/
theorem forall_of_forall_insert [DecidableEq α] {p : α → Prop} {a : α} {s : Finset α}
    (H : ∀ x, x ∈ insert a s → p x) (x) (h : x ∈ s) : p x

{α : Type u_1}
[DecidableEq α]
{p : α → Prop}
{a : α}
{s : Finset α}
(H : ∀ x ∈ insert a s, p x)
(x : α)
(h : x ∈ s)


@[simp]
theorem prodUnique_symm_apply [Unique β] (x : α) :
    (prodUnique α β).symm x = (x, default)

{β : Type u_1}
{α : Type u_2}
[Unique β]
(x : α)

(Equiv.prodUnique α β).symm x = (x, default)


theorem ae_eq_zero_of_eLpNorm'_eq_zero {f : α → E} (hq0 : 0 ≤ q) (hf : AEStronglyMeasurable f μ)
    (h : eLpNorm' f q μ = 0) : f =ᵐ[μ] 0

(hf : MeasureTheory.AEStronglyMeasurable f μ)


protected theorem disjoint_sup_right : Disjoint a (s.sup f) ↔ ∀ ⦃i⦄, i ∈ s → Disjoint a (f i)

{α : Type u_2}
{ι : Type u_5}
[DistribLattice α]
[OrderBot α]
{s : Finset ι}
{f : ι → α}
{a : α}

Disjoint a (s.sup f) ↔ ∀ ⦃i : ι⦄, i ∈ s → Disjoint a (f i)


protected theorem AntivaryOn.subset (hst : s ⊆ t) (h : AntivaryOn f g t) : AntivaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s t : Set ι}
(hst : s ⊆ t)
(h : AntivaryOn f g t)


theorem integral_union_eq_left_of_forall₀ {f : X → E} (ht : NullMeasurableSet t μ)
    (ht_eq : ∀ x ∈ t, f x = 0) : ∫ x in s ∪ t, f x ∂μ = ∫ x in s, f x ∂μ

(ht : MeasureTheory.NullMeasurableSet t μ)

∫ (x : X) in s ∪ t, f x ∂μ = ∫ (x : X) in s, f x ∂μ


theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
(a : A)
(r : Rˣ)


/-- Show that the functor given by `leftAdjointOfEquiv` is indeed left adjoint to `G`. Dual
to `adjunctionOfRightEquiv`. -/
@[simps!]
def adjunctionOfEquivLeft : leftAdjointOfEquiv e he ⊣ G

(e : (X : C) → (Y : D) → (F_obj X ⟶ Y) ≃ (X ⟶ G.obj Y))

(he :
  ∀ (X : C) (Y Y' : D) (g : Y ⟶ Y') (h : F_obj X ⟶ Y),
    (e X Y') (CategoryTheory.CategoryStruct.comp h g) = CategoryTheory.CategoryStruct.comp ((e X Y) h) (G.map g))

(CategoryTheory.Adjunction.adjunctionOfEquivLeft e he).counit.app Y =
  (e (G.obj Y) Y).symm (CategoryTheory.CategoryStruct.id (G.obj Y))


/-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ/nℤ` for multiset.

Any multiset of at least `2 * n - 1` elements of `ℤ` contains a submultiset of `n` elements whose
sum is divisible by `n`. -/
theorem ZMod.erdos_ginzburg_ziv_multiset (s : Multiset (ZMod n))
    (hs : 2 * n - 1 ≤ Multiset.card s) : ∃ t ≤ s, Multiset.card t = n ∧ t.sum = 0

{n : ℕ}
(s : Multiset (ZMod n))
(hs : 2 * n - 1 ≤ Multiset.card s)


@[reassoc]
lemma comp_add (f : X' ⟶ Y') (g₁ g₂ : Y' ⟶ Z') :
    f ≫ add W eY eZ g₁ g₂ = add W eX eZ (f ≫ g₁) (f ≫ g₂)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y Z : C}
{X' Y' Z' : D}
(eX : L.obj X ≅ X')
(eY : L.obj Y ≅ Y')
(eZ : L.obj Z ≅ Z')
(f : X' ⟶ Y')
(g₁ g₂ : Y' ⟶ Z')

CategoryTheory.CategoryStruct.comp f (CategoryTheory.Localization.Preadditive.add W eY eZ g₁ g₂) =
  CategoryTheory.Localization.Preadditive.add W eX eZ (CategoryTheory.CategoryStruct.comp f g₁)
    (CategoryTheory.CategoryStruct.comp f g₂)


theorem Matrix.vecMul_injective_iff {R : Type*} [CommRing R] {M : Matrix m n R} :
    Function.Injective M.vecMul ↔ LinearIndependent R (fun i ↦ M i)

{m : Type u_3}
{n : Type u_4}
[Fintype m]
{R : Type u_5}
[CommRing R]
{M : Matrix m n R}

(Function.Injective fun v => v ᵥ* M) ↔ LinearIndependent R fun i => M i


theorem eq_bot_of_subsingleton [Subsingleton p] : p = ⊥

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p : Submodule R M}
[Subsingleton ↥p]


theorem hom_ext [PerfectRing R p] {S : Type u₂} [CommSemiring S] [CharP S p] {P : Type u₃}
    [CommSemiring P] [CharP P p] [PerfectRing P p] (π : P →+* S) (m : PerfectionMap p π)
    {f g : R →+* P} (hfg : ∀ x, π (f x) = π (g x)) : f = g

{p : ℕ}
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
[PerfectRing R p]
{S : Type u₂}
[CommSemiring S]
[CharP S p]
{P : Type u₃}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
(π : P →+* S)
(m : PerfectionMap p π)
{f g : R →+* P}
(hfg : ∀ (x : R), π (f x) = π (g x))


theorem average_congr {f g : α → E} (h : f =ᵐ[μ] g) : ⨍ x, f x ∂μ = ⨍ x, g x ∂μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure α}
{f g : α → E}
(h : f =ᵐ[μ] g)


@[simp]
theorem trivial_eq_bot : trivial C = ⊥

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

CategoryTheory.GrothendieckTopology.trivial C = ⊥


@[to_additive (attr := simp)]
theorem one_eq_inv : 1 = a⁻¹ ↔ a = 1

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


@[to_additive le_of_add_le_add_right]
theorem le_of_mul_le_mul_right' [i : ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α}
    (bc : b * a ≤ c * a) :
    b ≤ c

[i : ContravariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


protected theorem disjoint_iff : Disjoint s t ↔ s ∩ t ⊆ ∅


theorem of_constant_on_preconnected_clopens [LocallyConnectedSpace X] {f : X → Y}
    (h : ∀ U : Set X, IsPreconnected U → IsClopen U → ∀ x ∈ U, ∀ y ∈ U, f y = f x) :
    IsLocallyConstant f

(h : ∀ (U : Set X), IsPreconnected U → IsClopen U → ∀ x ∈ U, ∀ y ∈ U, f y = f x)


@[simp]
theorem EuclideanSpace.dist_single_same (i : ι) (a b : 𝕜) :
    dist (EuclideanSpace.single i (a : 𝕜)) (EuclideanSpace.single i (b : 𝕜)) = dist a b

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
[DecidableEq ι]
[Fintype ι]
(i : ι)
(a b : 𝕜)

dist (EuclideanSpace.single i a) (EuclideanSpace.single i b) = dist a b


theorem IsRelPrime.isUnit_of_dvd (H : IsRelPrime x y) (d : x ∣ y) : IsUnit x

{α : Type u_1}
[CommMonoid α]
{x y : α}
(H : IsRelPrime x y)
(d : x ∣ y)


theorem eval_eq_sum_degreeLTEquiv {n : ℕ} {p : R[X]} (hp : p ∈ degreeLT R n) (x : R) :
    p.eval x = ∑ i, degreeLTEquiv _ _ ⟨p, hp⟩ i * x ^ (i : ℕ)

{R : Type u}
[Semiring R]
{n : ℕ}
{p : R[X]}
(hp : p ∈ Polynomial.degreeLT R n)
(x : R)

Polynomial.eval x p = ∑ i : Fin n, (Polynomial.degreeLTEquiv R n) ⟨p, hp⟩ i * x ^ ↑i


theorem le_lift' {f : Filter α} {h : Set α → Set β} {g : Filter β} :
    g ≤ f.lift' h ↔ ∀ s ∈ f, h s ∈ g

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{h : Set α → Set β}
{g : Filter β}


theorem _root_.Subalgebra.starClosure_eq_adjoin (S : Subalgebra R A) :
    S.starClosure = adjoin R (S : Set A)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(S : Subalgebra R A)


theorem le_def {p q : ℚ≥0} : p ≤ q ↔ p.num * q.den ≤ q.num * p.den


@[simp]
theorem truncate_mk' (f : ℕ → R) :
    truncate n (@mk' p _ f) = TruncatedWittVector.mk _ fun k => f k

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)
{R : Type u_1}
[CommRing R]
(f : ℕ → R)

(WittVector.truncate n) { coeff := f } = TruncatedWittVector.mk p fun k => f ↑k


/-- `nthRoots n` as a `Finset` is equal to the union of `primitiveRoots i R` for `i ∣ n`
if there is a primitive root of unity in `R`. -/
theorem nthRoots_one_eq_biUnion_primitiveRoots {ζ : R} {n : ℕ} (h : IsPrimitiveRoot ζ n) :
    nthRootsFinset n R = (Nat.divisors n).biUnion fun i => primitiveRoots i R

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

Polynomial.nthRootsFinset n R = n.divisors.biUnion fun i => primitiveRoots i R


@[norm_cast, simp]
theorem dist_cast_real (x y : ℕ) : dist (x : ℝ) y = dist x y


theorem normalize_of_nonneg {z : ℤ} (h : 0 ≤ z) : normalize z = z


theorem sclosure_preimage_le (f : F) (s : Set S) :
    closure ((f : R → S) ⁻¹' s) ≤ (closure s).comap f

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)
(s : Set S)

NonUnitalSubsemiring.closure (⇑f ⁻¹' s) ≤ NonUnitalSubsemiring.comap f (NonUnitalSubsemiring.closure s)


theorem aleph0_le_beth (o : Ordinal) : ℵ₀ ≤ beth o


theorem Subset.ndinter_eq_left {s t : Multiset α} (h : s ⊆ t) : s.ndinter t = s

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


theorem tendsto_zpow_atTop_zero {n : ℤ} (hn : n < 0) :
    Tendsto (fun x : 𝕜 => x ^ n) atTop (𝓝 0)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{n : ℤ}
(hn : n < 0)

Filter.Tendsto (fun x => x ^ n) Filter.atTop (𝓝 0)


@[simp]
theorem unique_single_eq_iff [Unique α] {b' : M} : single a b = single a' b' ↔ b = b'

{α : Type u_1}
{M : Type u_5}
[Zero M]
{a a' : α}
{b : M}
[Unique α]
{b' : M}

Finsupp.single a b = Finsupp.single a' b' ↔ b = b'


theorem eq_lift_of_comp_eq (g : X ⟶ widePullback _ _ arrows) :
    (∀ j : J, g ≫ π arrows j = fs j) → g ≫ base arrows = f → g = lift f fs w

[CategoryTheory.Limits.HasWidePullback B objs arrows]

(g : X ⟶ CategoryTheory.Limits.widePullback B objs arrows)

(∀ (j : J), g ≫ CategoryTheory.Limits.WidePullback.π arrows j = fs j) →
  g ≫ CategoryTheory.Limits.WidePullback.base arrows = f → g = CategoryTheory.Limits.WidePullback.lift f fs w


@[to_additive]
lemma orbitRel_le_fst :
    orbitRel G (α × β) ≤ (orbitRel G α).comap Prod.fst

(G : Type u_1)
(α : Type u_2)
(β : Type u_3)
[Group G]
[MulAction G α]
[MulAction G β]

MulAction.orbitRel G (α × β) ≤ Setoid.comap Prod.fst (MulAction.orbitRel G α)


@[to_additive]
theorem index_iInf_le {ι : Type*} [Fintype ι] (f : ι → Subgroup G) :
    (⨅ i, f i).index ≤ ∏ i, (f i).index

{G : Type u_1}
[AddGroup G]
{ι : Type u_3}
[Fintype ι]
(f : ι → AddSubgroup G)


lemma part_mem (ha : a ∈ s) : P.part a ∈ P.parts

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


lemma isIntegralCurveAt_comp_add {dt : ℝ} :
    IsIntegralCurveAt γ v t₀ ↔ IsIntegralCurveAt (γ ∘ (· + dt)) v (t₀ - dt)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{t₀ dt : ℝ}

IsIntegralCurveAt γ v t₀ ↔ IsIntegralCurveAt (γ ∘ fun x => x + dt) v (t₀ - dt)


@[simp]
theorem inducedMap_zero : inducedMap α β 0 = 0


theorem geom_sum_ne_zero [LinearOrderedRing α] (hx : x ≠ -1) (hn : n ≠ 0) :
    ∑ i ∈ range n, x ^ i ≠ 0

{α : Type u}
{n : ℕ}
{x : α}
[LinearOrderedRing α]
(hx : x ≠ -1)
(hn : n ≠ 0)


theorem closure_singleton_one : closure ({1} : Set M) = ⊥


theorem eq_or_ne_mem_of_mem {a b : α} {l : List α} (h' : a ∈ b :: l) : a = b ∨ (a ≠ b ∧ a ∈ l)

{α : Type u_1}
{a b : α}
{l : List α}
(h' : a ∈ b :: l)


@[arith_mult]
theorem mul [CommSemiring R] {f g : ArithmeticFunction R} (hf : f.IsMultiplicative)
    (hg : g.IsMultiplicative) : IsMultiplicative (f * g)

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


/-- A family of continuous linear maps is continuous on `s` if all its applications are. -/
theorem continuousOn_clm_apply {X : Type*} [TopologicalSpace X] [FiniteDimensional 𝕜 E]
    {f : X → E →L[𝕜] F} {s : Set X} : ContinuousOn f s ↔ ∀ y, ContinuousOn (fun x => f x y) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
{X : Type u_1}
[TopologicalSpace X]
[FiniteDimensional 𝕜 E]
{f : X → E →L[𝕜] F}
{s : Set X}

ContinuousOn f s ↔ ∀ (y : E), ContinuousOn (fun x => (f x) y) s


/-- **Strict inequality case of the Rearrangement Inequality**: Pointwise scalar multiplication of
`f` and `g`, which monovary together, is strictly decreased by a permutation if and only if
`f` and `g ∘ σ` do not monovary together. Stated by permuting the entries of `g`. -/
theorem Monovary.sum_smul_comp_perm_lt_sum_smul_iff (hfg : Monovary f g) :
    ∑ i, f i • g (σ i) < ∑ i, f i • g i ↔ ¬Monovary f (g ∘ σ)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Monovary f g)

∑ i : ι, f i • g (σ i) < ∑ i : ι, f i • g i ↔ ¬Monovary f (g ∘ ⇑σ)


theorem map_comm {f₁ : α → β} {f₂ : α → γ} {g₁ : β → δ} {g₂ : γ → δ} (h : g₁ ∘ f₁ = g₂ ∘ f₂)
    (a : α) :
    (Option.map f₁ a).map g₁ = (Option.map f₂ a).map g₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{f₁ : α → β}
{f₂ : α → γ}
{g₁ : β → δ}
{g₂ : γ → δ}
(h : g₁ ∘ f₁ = g₂ ∘ f₂)
(a : α)

Option.map g₁ (Option.map f₁ (some a)) = Option.map g₂ (Option.map f₂ (some a))


theorem measurableSet_of_mem_nhdsWithin_Ioi_aux {s : Set α} (h : ∀ x ∈ s, s ∈ 𝓝[>] x)
    (h' : ∀ x ∈ s, ∃ y, x < y) : MeasurableSet s

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{s : Set α}
(h : ∀ x ∈ s, s ∈ 𝓝[>] x)
(h' : ∀ x ∈ s, ∃ y, x < y)


@[simp]
theorem Groupoid.inv_eq_inv (f : X ⟶ Y) : Groupoid.inv f = CategoryTheory.inv f

{C : Type u}
[CategoryTheory.Groupoid C]
{X Y : C}
(f : X ⟶ Y)

CategoryTheory.Groupoid.inv f = CategoryTheory.inv f


@[to_additive (attr := simp)]
theorem unit_of_val_units {a : Mˣ} (h : IsUnit (a : M)) : h.unit = a

{M : Type u_1}
[AddMonoid M]
{a : AddUnits M}
(h : IsAddUnit ↑a)


/--
We can upgrade `F` to a monoidal functor from `D` to `E` with the induced structure.
-/
@[simps]
def fromInduced [MonoidalCategoryStruct D] (F : D ⥤ C) [F.Faithful]
    (fData : InducingFunctorData F) :
    letI := induced F fData
    MonoidalFunctor D C

(fData : CategoryTheory.Monoidal.InducingFunctorData F)

(CategoryTheory.Monoidal.fromInduced F fData).toFunctor = F


/-- The category of actions of `G` in the category `V`
is equivalent to the functor category `singleObj G ⥤ V`.
-/
@[simps]
def functorCategoryEquivalence : Action V G ≌ SingleObj G ⥤ V

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)

(Action.functorCategoryEquivalence V G).unitIso = Action.FunctorCategoryEquivalence.unitIso


/-- A pseudometric space is proper if all closed balls are compact. -/
class ProperSpace (α : Type u) [PseudoMetricSpace α] : Prop where
  isCompact_closedBall : ∀ x : α, ∀ r, IsCompact (closedBall x r)

{α : Type u}
[PseudoMetricSpace α]
[self : ProperSpace α]
(x : α)
(r : ℝ)


@[simp]
theorem sup'_insert [DecidableEq β] {b : β} :
    (insert b s).sup' (insert_nonempty _ _) f = f b ⊔ s.sup' H f

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

(insert b s).sup' ⋯ f = f b ⊔ s.sup' H f


@[simp]
theorem coeff_smul [SMulZeroClass S R] (r : S) (p : R[X]) (n : ℕ) :
    coeff (r • p) n = r • coeff p n

{R : Type u}
{S : Type v}
[Semiring R]
[SMulZeroClass S R]
(r : S)
(p : R[X])
(n : ℕ)


@[to_additive]
theorem aemeasurable_const_smul_iff (c : G) :
    AEMeasurable (fun x => c • f x) μ ↔ AEMeasurable f μ

{β : Type u_3}
{α : Type u_4}
[MeasurableSpace β]
[MeasurableSpace α]
{f : α → β}
{μ : MeasureTheory.Measure α}
{G : Type u_5}
[AddGroup G]
[MeasurableSpace G]
[AddAction G β]
[MeasurableVAdd G β]
(c : G)

AEMeasurable (fun x => c +ᵥ f x) μ ↔ AEMeasurable f μ


/--
The discrete condensed object associated to an object of `C` is the constant sheaf at that object.
-/
@[simps!]
noncomputable def LightCondensed.discrete : C ⥤ LightCondensed.{u} C

[CategoryTheory.HasSheafify (CategoryTheory.coherentTopology LightProfinite) C]

(LightCondensed.discrete C).obj X =
  (CategoryTheory.presheafToSheaf (CategoryTheory.coherentTopology LightProfinite) C).obj
    ((CategoryTheory.Functor.const LightProfiniteᵒᵖ).obj X)


/-- The exponentiation map is an isomorphism from the additive monoid on natural numbers to powers
when it is injective. The inverse is given by the logarithms. -/
@[simps]
def powLogEquiv [DecidableEq M] {n : M} (h : Function.Injective fun m : ℕ => n ^ m) :
    Multiplicative ℕ ≃* powers n

{M : Type u_1}
[Monoid M]
[DecidableEq M]
{n : M}
(h : Function.Injective fun m => n ^ m)
(m : Multiplicative ℕ)

(Submonoid.powLogEquiv h) m = Submonoid.pow n (Multiplicative.toAdd m)


@[simp]
theorem dlookup_kunion_right {a} {l₁ l₂ : List (Sigma β)} (h : a ∉ l₁.keys) :
    dlookup a (kunion l₁ l₂) = dlookup a l₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{l₁ l₂ : List (Sigma β)}
(h : a ∉ l₁.keys)

List.dlookup a (l₁.kunion l₂) = List.dlookup a l₂


theorem LineDifferentiableAt.of_comp {v : E'} (hf : LineDifferentiableAt 𝕜 (f ∘ L) x v) :
    LineDifferentiableAt 𝕜 f (L x) (L v)

(hf : LineDifferentiableAt 𝕜 (f ∘ ⇑L) x v)


protected theorem acc (a : α) : Acc (· < ·) (f a) → Acc (· < ·) a

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α ↪o β)
(a : α)

Acc (fun x x_1 => x < x_1) (f a) → Acc (fun x x_1 => x < x_1) a


theorem map_span_le [RingHomSurjective σ₁₂] (f : F) (s : Set M) (N : Submodule R₂ M₂) :
    map f (span R s) ≤ N ↔ ∀ m ∈ s, f m ∈ N

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[AddCommMonoid M₂]
[Module R₂ M₂]
{F : Type u_8}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
(f : F)
(s : Set M)
(N : Submodule R₂ M₂)

Submodule.map f (Submodule.span R s) ≤ N ↔ ∀ m ∈ s, f m ∈ N


theorem IsBilimit.total {f : J → C} {b : Bicone f} (i : b.IsBilimit) :
    ∑ j : J, b.π j ≫ b.ι j = 𝟙 b.pt

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{J : Type}
[Fintype J]
{f : J → C}
{b : CategoryTheory.Limits.Bicone f}
(i : b.IsBilimit)


/-- The type of flags, aka maximal chains, of an order. -/
structure Flag (α : Type*) [LE α] where
  /-- The `carrier` of a flag is the underlying set. -/
  carrier : Set α
  /-- By definition, a flag is a chain -/
  Chain' : IsChain (· ≤ ·) carrier
  /-- By definition, a flag is a maximal chain -/
  max_chain' : ∀ ⦃s⦄, IsChain (· ≤ ·) s → carrier ⊆ s → carrier = s

{α : Type u_3}
[LE α]
(self : Flag α)
⦃s : Set α⦄

IsChain (fun x x_1 => x ≤ x_1) s → self.carrier ⊆ s → self.carrier = s


@[simp]
theorem interUnionPullbackCone_fst :
    (interUnionPullbackCone F U V).fst = F.1.map (homOfLE le_sup_left).op

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(F : TopCat.Sheaf C X)
(U V : TopologicalSpace.Opens ↑X)

(F.interUnionPullbackCone U V).fst = F.val.map (CategoryTheory.homOfLE ⋯).op


theorem natDegree_sum_le (f : ι → S[X]) :
    natDegree (∑ i ∈ s, f i) ≤ s.fold max 0 (natDegree ∘ f)

{ι : Type w}
(s : Finset ι)
{S : Type u_1}
[Semiring S]
(f : ι → S[X])

(∑ i ∈ s, f i).natDegree ≤ Finset.fold max 0 (Polynomial.natDegree ∘ f) s


lemma quotOfListConsSMulTopEquivQuotSMulTopInner_naturality (f : M →ₗ[R] M₂) :
    (quotOfListConsSMulTopEquivQuotSMulTopInner M₂ r rs).toLinearMap ∘ₗ
        mapQ _ _ _ (smul_top_le_comap_smul_top (Ideal.ofList (r :: rs)) f) =
      mapQ _ _ _ (smul_top_le_comap_smul_top _ (QuotSMulTop.map r f)) ∘ₗ
        (quotOfListConsSMulTopEquivQuotSMulTopInner M r rs).toLinearMap

{R : Type u_1}
{M : Type u_3}
{M₂ : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R M₂]
(r : R)
(rs : List R)
(f : M →ₗ[R] M₂)

↑(Submodule.quotOfListConsSMulTopEquivQuotSMulTopInner M₂ r rs) ∘ₗ
    (Ideal.ofList (r :: rs) • ⊤).mapQ (Ideal.ofList (r :: rs) • ⊤) f ⋯ =
  (Ideal.ofList rs • ⊤).mapQ (Ideal.ofList rs • ⊤) ((QuotSMulTop.map r) f) ⋯ ∘ₗ
    ↑(Submodule.quotOfListConsSMulTopEquivQuotSMulTopInner M r rs)


theorem iSup_ord {ι} {f : ι → Cardinal} (hf : BddAbove (range f)) :
    (iSup f).ord = ⨆ i, (f i).ord

{ι : Sort u_4}
{f : ι → Cardinal.{u_5}}
(hf : BddAbove (Set.range f))


/-- If `Irreducible (cyclotomic (p ^ (k + 1)) K)` (in particular for `K = ℚ`) and `p` is an odd
prime, then the norm of `ζ - 1` is `p`. -/
theorem norm_sub_one_of_prime_ne_two {k : ℕ} (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1)))
    [hpri : Fact (p : ℕ).Prime] [IsCyclotomicExtension {p ^ (k + 1)} K L]
    (hirr : Irreducible (cyclotomic (↑(p ^ (k + 1)) : ℕ) K)) (h : p ≠ 2) : norm K (ζ - 1) = p

(hirr : Irreducible (Polynomial.cyclotomic (↑(p ^ (k + 1))) K))


@[fun_prop]
theorem hasFDerivAt_prod_mk_left (e₀ : E) (f₀ : F) :
    HasFDerivAt (fun e : E => (e, f₀)) (inl 𝕜 E F) e₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(e₀ : E)
(f₀ : F)

HasFDerivAt (fun e => (e, f₀)) (ContinuousLinearMap.inl 𝕜 E F) e₀


@[simp]
theorem evenOdd_map_reverse (n : ZMod 2) :
    (evenOdd Q n).map (reverse : CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q) = evenOdd Q n

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(n : ZMod 2)

Submodule.map CliffordAlgebra.reverse (CliffordAlgebra.evenOdd Q n) = CliffordAlgebra.evenOdd Q n


theorem ext' {g h : M ⊗[R] N →ₗ[R] P} (H : ∀ x y, g (x ⊗ₜ y) = h (x ⊗ₜ y)) : g = h


@[reassoc]
lemma shiftFunctorAdd_assoc_inv_app (a₁ a₂ a₃ : A) (X : C) :
    ((shiftFunctorAdd C a₁ a₂).inv.app X)⟦a₃⟧' ≫
      (shiftFunctorAdd C (a₁ + a₂) a₃).inv.app X =
    (shiftFunctorAdd C a₂ a₃).inv.app (X⟦a₁⟧) ≫
      (shiftFunctorAdd' C a₁ (a₂ + a₃) (a₁ + a₂ + a₃) (add_assoc _ _ _).symm).inv.app X

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
[CategoryTheory.HasShift C A]
(a₁ a₂ a₃ : A)
(X : C)

CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctor C a₃).map ((CategoryTheory.shiftFunctorAdd C a₁ a₂).inv.app X))
    ((CategoryTheory.shiftFunctorAdd C (a₁ + a₂) a₃).inv.app X) =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctorAdd C a₂ a₃).inv.app ((CategoryTheory.shiftFunctor C a₁).obj X))
    ((CategoryTheory.shiftFunctorAdd' C a₁ (a₂ + a₃) (a₁ + a₂ + a₃) ⋯).inv.app X)


@[to_additive]
lemma single_le_prod [OrderedCommMonoid M] {l : List M} (hl₁ : ∀ x ∈ l, (1 : M) ≤ x) :
    ∀ x ∈ l, x ≤ l.prod

{M : Type u_3}
[OrderedCommMonoid M]
{l : List M}
(hl₁ : ∀ x ∈ l, 1 ≤ x)
(x : M)


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

{M : Type u_2}
[AddZeroClass M]
(S : Set (AddSubmonoid Mᵃᵒᵖ))

(sInf S).unop = sInf (AddSubmonoid.op ⁻¹' S)


@[to_additive (attr := simp)]
lemma Submonoid.ofUnits_units_le (S : Submonoid M) : S.units.ofUnits ≤ S

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


theorem image_preimage_inl_union_image_preimage_inr (s : Set (α ⊕ β)) :
    Sum.inl '' (Sum.inl ⁻¹' s) ∪ Sum.inr '' (Sum.inr ⁻¹' s) = s

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


@[simp]
theorem toDFinsupp_le_toDFinsupp : toDFinsupp s ≤ toDFinsupp t ↔ s ≤ t

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

Multiset.toDFinsupp s ≤ Multiset.toDFinsupp t ↔ s ≤ t


theorem IsNormal.le_iff_eq {f} (H : IsNormal f) {a} : f a ≤ a ↔ f a = a

{f : Ordinal.{u_4} → Ordinal.{u_4}}
(H : Ordinal.IsNormal f)
{a : Ordinal.{u_4}}


theorem zero_le_of_contsAux_b : 0 ≤ ((of v).contsAux n).b

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


/-- Fundamental theorem of calculus for set integrals, `nhdsWithin` version: if `μ` is a locally
finite measure, `f` is continuous on a measurable set `t`, and `a ∈ t`, then `∫ x in (s i), f x ∂μ =
μ (s i) • f a + o(μ (s i))` at `li` provided that `s i` tends to `(𝓝[t] a).smallSets` along `li`.
Since `μ (s i)` is an `ℝ≥0∞` number, we use `(μ (s i)).toReal` in the actual statement.

Often there is a good formula for `(μ (s i)).toReal`, so the formalization can take an optional
argument `m` with this formula and a proof of `(fun i => (μ (s i)).toReal) =ᶠ[li] m`. Without these
arguments, `m i = (μ (s i)).toReal` is used in the output. -/
theorem ContinuousOn.integral_sub_linear_isLittleO_ae [TopologicalSpace X] [OpensMeasurableSpace X]
    [SecondCountableTopologyEither X E] {μ : Measure X}
    [IsLocallyFiniteMeasure μ] {x : X} {t : Set X} {f : X → E} (hft : ContinuousOn f t) (hx : x ∈ t)
    (ht : MeasurableSet t) {s : ι → Set X} {li : Filter ι} (hs : Tendsto s li (𝓝[t] x).smallSets)
    (m : ι → ℝ := fun i => (μ (s i)).toReal)
    (hsμ : (fun i => (μ (s i)).toReal) =ᶠ[li] m := by rfl) :
    (fun i => (∫ x in s i, f x ∂μ) - m i • f x) =o[li] m

(hs : Filter.Tendsto s li (𝓝[t] x).smallSets)

(fun i => ∫ (x : X) in s i, f x ∂μ - m i • f x) =o[li] m


/-- Let `S` be a nontrivial additive subgroup in an archimedean linear ordered additive commutative
group `G` with order topology. If the set of positive elements of `S` does not have a minimal
element, then `S` is dense `G`. -/
theorem dense_of_no_min (S : AddSubgroup G) (hbot : S ≠ ⊥)
    (H : ¬∃ a : G, IsLeast { g : G | g ∈ S ∧ 0 < g } a) : Dense (S : Set G)

(H : ¬∃ a, IsLeast {g | g ∈ S ∧ 0 < g} a)


/-- homotopy is closed under composition (on the right) -/
@[simps]
def compRight {e f : C ⟶ D} (h : Homotopy e f) (g : D ⟶ E) : Homotopy (e ≫ g) (f ≫ g)

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D E : HomologicalComplex V c}
{e f : C ⟶ D}
(h : Homotopy e f)
(g : D ⟶ E)
(i j : ι)

(h.compRight g).hom i j = h.hom i j ≫ g.f j


/-- If `A` is a non-unital `R`-algebra, then the subgroup of units of `Unitization R A` whose
scalar part is `1 : R` (i.e., `Unitization.unitsFstOne`) is isomorphic to the group of units of
`PreQuasiregular A`. -/
@[simps]
def unitsFstOne_mulEquiv_quasiregular : unitsFstOne R A ≃* (PreQuasiregular A)ˣ

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(x : ↥(Unitization.unitsFstOne R A))

↑((Unitization.unitsFstOne_mulEquiv_quasiregular R) x)⁻¹ = PreQuasiregular.equiv (↑↑x⁻¹).snd


theorem iterate_injective (h : Injective f') : ∀ n : ℕ, Injective (f' ^ n)

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{f' : M →ₗ[R] M}
(h : Function.Injective ⇑f')
(n : ℕ)


@[simp] theorem mul_apply : ⇑(A * B) = A.1 * B.1

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]
(A B : ↥(Matrix.unitaryGroup n α))


/-- The `v`-adic valuation of `r ∈ R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
theorem intValuation_lt_one_iff_dvd (r : R) :
    v.intValuationDef r < 1 ↔ v.asIdeal ∣ Ideal.span {r}

(v : IsDedekindDomain.HeightOneSpectrum R)


@[simp]
theorem equivTuple_apply {R : Type*} (c₁ c₂ : R) (x : ℍ[R,c₁,c₂]) :
    equivTuple c₁ c₂ x = ![x.re, x.imI, x.imJ, x.imK]

{R : Type u_1}
(c₁ c₂ : R)
(x : ℍ[R,c₁,c₂])

(QuaternionAlgebra.equivTuple c₁ c₂) x = ![x.re, x.imI, x.imJ, x.imK]


theorem isArtinian_of_range_eq_ker [IsArtinian R M] [IsArtinian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P)
    (hf : Function.Injective f) (hg : Function.Surjective g)
    (h : LinearMap.range f = LinearMap.ker g) : IsArtinian R N


theorem coeff_det_X_add_C_card (A B : Matrix n n α) :
    coeff (det ((X : α[X]) • A.map C + B.map C)) (Fintype.card n) = det A

{n : Type u_1}
{α : Type u_2}
[DecidableEq n]
[Fintype n]
[CommRing α]
(A B : Matrix n n α)

(Polynomial.X • A.map ⇑Polynomial.C + B.map ⇑Polynomial.C).det.coeff (Fintype.card n) = A.det


@[to_additive (attr := measurability)]
theorem _root_.Finset.aestronglyMeasurable_prod' {ι : Type*} {f : ι → α → M} (s : Finset ι)
    (hf : ∀ i ∈ s, AEStronglyMeasurable (f i) μ) : AEStronglyMeasurable (∏ i ∈ s, f i) μ

(hf : ∀ i ∈ s, MeasureTheory.AEStronglyMeasurable (f i) μ)

MeasureTheory.AEStronglyMeasurable (∑ i ∈ s, f i) μ


theorem differentiableAt_sin : DifferentiableAt ℝ sin x


@[to_additive]
theorem _root_.dfinsupp_prod_mem [∀ i, Zero (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    [CommMonoid γ] {S : Type*} [SetLike S γ] [SubmonoidClass S γ]
    (s : S) (f : Π₀ i, β i) (g : ∀ i, β i → γ)
    (h : ∀ c, f c ≠ 0 → g c (f c) ∈ s) : f.prod g ∈ s

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]

(h : ∀ (c : ι), f c ≠ 0 → g c (f c) ∈ s)


@[continuity, fun_prop]
theorem continuous_ofReal : Continuous ((↑) : ℝ → ℂ)


theorem isTheta_cpow_rpow (hl_im : IsBoundedUnder (· ≤ ·) l fun x => |(g x).im|)
    (hl : ∀ᶠ x in l, f x = 0 → re (g x) = 0 → g x = 0) :
    (fun x => f x ^ g x) =Θ[l] fun x => abs (f x) ^ (g x).re

(hl_im : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => |(g x).im|)

(hl : ∀ᶠ (x : α) in l, f x = 0 → (g x).re = 0 → g x = 0)

(fun x => f x ^ g x) =Θ[l] fun x => Complex.abs (f x) ^ (g x).re


@[to_additive]
protected theorem MonoidHom.map_zpow' [DivInvMonoid M] [DivInvMonoid N] (f : M →* N)
    (hf : ∀ x, f x⁻¹ = (f x)⁻¹) (a : M) (n : ℤ) :
    f (a ^ n) = f a ^ n

{M : Type u_4}
{N : Type u_5}
[SubNegMonoid M]
[SubNegMonoid N]
(f : M →+ N)
(hf : ∀ (x : M), f (-x) = -f x)
(a : M)
(n : ℤ)


@[simp] theorem ForInStep.bindList_cons [Monad m]
    (f : α → β → m (ForInStep β)) (s : ForInStep β) (a l) :
    s.bindList f (a::l) = s.bind fun b => f a b >>= (·.bindList f l)

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m (ForInStep β))
(s : ForInStep β)
(a : α)
(l : List α)

ForInStep.bindList f (a :: l) s =
  s.bind fun b => do
    let x ← f a b
    ForInStep.bindList f l x


theorem not_le_iff_exists : ¬p ≤ q ↔ ∃ x ∈ p, x ∉ q

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


theorem insertRec_insert {C : AList β → Sort*} (H0 : C ∅)
    (IH : ∀ (a : α) (b : β a) (l : AList β), a ∉ l → C l → C (l.insert a b)) {c : Sigma β}
    {l : AList β} (h : c.1 ∉ l) :
    @insertRec α β _ C H0 IH (l.insert c.1 c.2) = IH c.1 c.2 l h (@insertRec α β _ C H0 IH l)

(IH : (a : α) → (b : β a) → (l : AList β) → a ∉ l → C l → C (AList.insert a b l))

AList.insertRec H0 IH (AList.insert c.fst c.snd l) = IH c.fst c.snd l h (AList.insertRec H0 IH l)


theorem Coprime.lcm_eq_mul {m n : ℕ} (h : Coprime m n) : lcm m n = m * n


lemma pow_toEnd_f_ne_zero_of_eq_nat
    [CharZero R] [NoZeroSMulDivisors R M]
    {n : ℕ} (hn : μ = n) {i} (hi : i ≤ n) : (ψ i) ≠ 0

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{h e f : L}
{m : M}
{μ : R}
{t : IsSl2Triple h e f}
(P : t.HasPrimitiveVectorWith m μ)
[CharZero R]
[NoZeroSMulDivisors R M]
{n : ℕ}
(hn : μ = ↑n)
{i : ℕ}
(hi : i ≤ n)


/-- An ordered scalar multiplication is a bi-monotone scalar multiplication. Note that this is
different from `OrderedSMul`, which uses strict inequality, requires `G` to be a semiring, and the
defining conditions are restricted to positive elements of `G`. -/
@[to_additive]
class IsOrderedSMul (G P : Type*) [LE G] [LE P] [SMul G P] : Prop where
  protected smul_le_smul_left : ∀ a b : P, a ≤ b → ∀ c : G, c • a ≤ c • b
  protected smul_le_smul_right : ∀ c d : G, c ≤ d → ∀ a : P, c • a ≤ d • a

{G : Type u_3}
{P : Type u_4}
[LE G]
[LE P]
[SMul G P]
[self : IsOrderedSMul G P]
(a b : P)


/-- A preconnected set `s` has the property that every map to a
discrete space that is continuous on `s` is constant on `s` -/
theorem IsPreconnected.constant {Y : Type*} [TopologicalSpace Y] [DiscreteTopology Y] {s : Set α}
    (hs : IsPreconnected s) {f : α → Y} (hf : ContinuousOn f s) {x y : α} (hx : x ∈ s)
    (hy : y ∈ s) : f x = f y

{α : Type u}
[TopologicalSpace α]
{Y : Type u_3}
[TopologicalSpace Y]
[DiscreteTopology Y]
{s : Set α}
(hs : IsPreconnected s)
{f : α → Y}
(hf : ContinuousOn f s)
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)


lemma mulOption_lt_of_lt (hy : y.Numeric) (ihxy : IH1 x y) (ihyx : IH1 y x) (i j k l)
    (h : x.moveLeft i < x.moveLeft j) :
    (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧

{x y : SetTheory.PGame}
(hy : y.Numeric)
(ihxy : Surreal.Multiplication.IH1 x y)
(ihyx : Surreal.Multiplication.IH1 y x)
(i j : x.LeftMoves)
(k : y.LeftMoves)
(l : (-y).LeftMoves)
(h : x.moveLeft i < x.moveLeft j)

⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧


/-- `s` is an additive subgroup: a set containing 0 and closed under addition and negation. -/
structure IsAddSubgroup (s : Set A) extends IsAddSubmonoid s : Prop where
  /-- The proposition that `s` is closed under negation. -/
  neg_mem {a} : a ∈ s → -a ∈ s

{A : Type u_3}
[AddGroup A]
{s : Set A}
(self : IsAddSubgroup s)
{a : A}


@[measurability]
theorem measurable_mk (h : AEMeasurable f μ) : Measurable (h.mk f)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ : MeasureTheory.Measure α}
(h : AEMeasurable f μ)


theorem image_closure (h : X ≃ₜ Y) (s : Set X) : h '' closure s = closure (h '' s)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)
(s : Set X)


/-- `Sigma.uncurry` as a monotone function. -/
@[simps]
def monotoneUncurry [(x y : _) → Preorder <| γ x y] :
    (∀ (a) (b : β a), γ a b) →o ∀ x : Σa, β a, γ x.1 x.2

[(x : α) → (y : β x) → Preorder (γ x y)]

(Pi.monotoneUncurry α β γ) f x = Sigma.uncurry f x


theorem lt_rpow_inv_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x < y ^ z⁻¹ ↔ x ^z < y


@[simp]
theorem tmul_tensorComm_apply
    (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) (x : M₁ ⊗[R] M₂) :
    Q₂.tmul Q₁ (TensorProduct.comm R M₁ M₂ x) = Q₁.tmul Q₂ x

{R : Type uR}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
[Invertible 2]
(Q₁ : QuadraticForm R M₁)
(Q₂ : QuadraticForm R M₂)
(x : M₁ ⊗[R] M₂)

(Q₂.tmul Q₁) ((TensorProduct.comm R M₁ M₂) x) = (Q₁.tmul Q₂) x


theorem opensImagePreimageMap_app' (i j k : D.J) (U : Opens (D.U i).carrier) :
    ∃ eq,
      D.opensImagePreimageMap i j U ≫ (D.f j k).c.app _ =
        ((π₁ j, i, k) ≫ D.t j i ≫ D.f i j).c.app (op U) ≫
          (π₂⁻¹ j, i, k) (unop _) ≫ (D.V (j, k)).presheaf.map (eqToHom eq)

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

∃ (eq :
  Opposite.op
      ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
            (CategoryTheory.Limits.pullback.snd (D.f j i) (D.f j k))).obj
        (Opposite.unop
          (Opposite.op
            ((TopologicalSpace.Opens.map
                    (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).base).toPrefunctor.1
              (Opposite.unop (Opposite.op U)))))) =
    (TopologicalSpace.Opens.map (D.f j k).base).op.obj
      (Opposite.op ((TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U)))),
  D.opensImagePreimageMap i j U ≫
      (D.f j k).c.app (Opposite.op ((TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U))) =
    (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).c.app (Opposite.op U) ≫
      AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f j i) (D.f j k))
          (Opposite.unop
            (Opposite.op
              ((TopologicalSpace.Opens.map
                      (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).base).toPrefunctor.1
                (Opposite.unop (Opposite.op U))))) ≫
        (D.V (j, k)).presheaf.map (CategoryTheory.eqToHom eq)


lemma shiftFunctorAdd_add_zero_inv_app (a : A) (X : C) : (shiftFunctorAdd C a 0).inv.app X =
    (shiftFunctorZero C A).hom.app (X⟦a⟧) ≫ eqToHom (by dsimp; rw [add_zero])

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
[CategoryTheory.HasShift C A]
(a : A)
(X : C)

(CategoryTheory.shiftFunctorAdd C a 0).inv.app X =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctorZero C A).hom.app ((CategoryTheory.shiftFunctor C a).obj X)) (CategoryTheory.eqToHom ⋯)


lemma shatters_of_forall_subset (h : ∀ t, t ⊆ s → t ∈ 𝒜) : 𝒜.Shatters s

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
(h : ∀ t ⊆ s, t ∈ 𝒜)


lemma conjTranspose_invOf [Invertible A] [Invertible Aᴴ] : (⅟A)ᴴ = ⅟(Aᴴ)

{n : Type u_2}
{α : Type u_3}
[Fintype n]
[DecidableEq n]
[Semiring α]
[StarRing α]
(A : Matrix n n α)
[Invertible A]
[Invertible Aᴴ]


theorem coequalizer.cofork_ι_app_one : (coequalizer.cofork f g).ι.app one = coequalizer.π f g

(CategoryTheory.Limits.coequalizer.cofork f g).ι.app CategoryTheory.Limits.WalkingParallelPair.one =
  CategoryTheory.Limits.coequalizer.π f g


protected theorem sub_mul (M M' : Matrix m n α) (N : Matrix n o α) :
    (M - M') * N = M * N - M' * N

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[NonUnitalNonAssocRing α]
[Fintype n]
(M M' : Matrix m n α)
(N : Matrix n o α)


@[to_additive]
theorem csInf_mul (hs₀ : s.Nonempty) (hs₁ : BddBelow s) (ht₀ : t.Nonempty) (ht₁ : BddBelow t) :
    sInf (s * t) = sInf s * sInf t

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

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


lemma differentiable_fourierChar_neg_bilinear_left (w : W) :
    Differentiable ℝ (fun v ↦ (𝐞 (-L v w) : ℂ))

{V : Type u_1}
{W : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedAddCommGroup W]
[NormedSpace ℝ W]
(L : V →L[ℝ] W →L[ℝ] ℝ)
(w : W)

Differentiable ℝ fun v => ↑(𝐞 (-(L v) w))


@[simp]
theorem bind_apply (b : β) : p.bind f b = ∑' a, p a * f a b

{α : Type u_1}
{β : Type u_2}
(p : PMF α)
(f : α → PMF β)
(b : β)

(p.bind f) b = ∑' (a : α), p a * (f a) b


theorem Continuous.comp_lowerSemicontinuous {g : γ → δ} {f : α → γ} (hg : Continuous g)
    (hf : LowerSemicontinuous f) (gmon : Monotone g) : LowerSemicontinuous (g ∘ f)

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{δ : Type u_4}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderTopology δ]
{g : γ → δ}
{f : α → γ}
(hg : Continuous g)
(hf : LowerSemicontinuous f)
(gmon : Monotone g)


@[to_additive]
theorem smoothAt_finset_prod' (h : ∀ i ∈ t, SmoothAt I' I (f i) x) :
    SmoothAt I' I (∏ i ∈ t, f i) x

{ι : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{H : Type u_3}
[TopologicalSpace H]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[CommMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{x : M}
{t : Finset ι}
{f : ι → M → G}
(h : ∀ i ∈ t, SmoothAt I' I (f i) x)


theorem rpow_add {x : ℝ≥0} (hx : x ≠ 0) (y z : ℝ) : x ^ (y + z) = x ^ y * x ^ z


@[simp]
protected lemma mem_gen {f g : α →ᵤ β} {V : Set (β × β)} :
    (f, g) ∈ UniformFun.gen α β V ↔ ∀ x, (toFun f x, toFun g x) ∈ V

{α : Type u_1}
{β : Type u_2}
{f g : α →ᵤ β}
{V : Set (β × β)}

(f, g) ∈ UniformFun.gen α β V ↔ ∀ (x : α), (UniformFun.toFun f x, UniformFun.toFun g x) ∈ V


@[ext]
theorem limit.hom_ext {F : J ⥤ C} [HasLimit F] {X : C} {f f' : X ⟶ limit F}
    (w : ∀ j, f ≫ limit.π F j = f' ≫ limit.π F j) : f = f'

{f f' : X ⟶ CategoryTheory.Limits.limit F}

(w : ∀ (j : J), f ≫ CategoryTheory.Limits.limit.π F j = f' ≫ CategoryTheory.Limits.limit.π F j)


theorem mul_lt_of_le_one_of_lt' [PosMulStrictMono α] [MulPosMono α] (ha : a ≤ 1) (bc : b < c)
    (a0 : 0 < a) (c0 : 0 ≤ c) : a * b < c

{α : Type u_1}
{a b c : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulStrictMono α]
[MulPosMono α]
(ha : a ≤ 1)
(bc : b < c)
(a0 : 0 < a)
(c0 : 0 ≤ c)


/-- The convex hull of a finite set is the image of the standard simplex in `s → ℝ`
under the linear map sending each function `w` to `∑ x ∈ s, w x • x`.

Since we have no sums over finite sets, we use sum over `@Finset.univ _ hs.fintype`.
The map is defined in terms of operations on `(s → ℝ) →ₗ[ℝ] ℝ` so that later we will not need
to prove that this map is linear. -/
theorem Set.Finite.convexHull_eq_image {s : Set E} (hs : s.Finite) : convexHull R s =
    haveI := hs.fintype
    (⇑(∑ x : s, (@LinearMap.proj R s _ (fun _ => R) _ _ x).smulRight x.1)) '' stdSimplex R s

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s : Set E}
(hs : s.Finite)

(convexHull R) s = ⇑(∑ x : ↑s, (LinearMap.proj x).smulRight ↑x) '' stdSimplex R ↑s


theorem sign_eq_zero_iff {θ : Angle} : θ.sign = 0 ↔ θ = 0 ∨ θ = π


theorem UInt8.toNat_modn (x : UInt8) (n) : (x.modn n).toNat = x.toNat % n


@[simp]
theorem prevD_eq_toPrev_dTo (f : ∀ i j, C.X i ⟶ D.X j) (j : ι) :
    prevD j f = toPrev j f ≫ D.dTo j

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
(f : (i j : ι) → C.X i ⟶ D.X j)
(j : ι)


theorem map_sInf (hf : RightOrdContinuous f) (s : Set α) : f (sInf s) = ⨅ x ∈ s, f x

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


theorem nhds_eq_comap_inf_principal {x} (hx : x ∈ e.source) :
    𝓝 x = comap e (𝓝 (e x)) ⊓ 𝓟 e.source

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : X}
(hx : x ∈ e.source)

𝓝 x = Filter.comap (↑e) (𝓝 (↑e x)) ⊓ 𝓟 e.source


@[to_additive]
theorem inv_ne_one : a⁻¹ ≠ 1 ↔ a ≠ 1

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


theorem reverse_natDegree_le (f : R[X]) : f.reverse.natDegree ≤ f.natDegree

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


/-- A morphism of schemes `X ⟶ Y` is a closed immersion if the underlying
topological map is a closed embedding and the induced stalk maps are surjective. -/
@[mk_iff]
class IsClosedImmersion {X Y : Scheme} (f : X ⟶ Y) : Prop where
  base_closed : ClosedEmbedding f.1.base
  surj_on_stalks : ∀ x, Function.Surjective (f.stalkMap x)

[self : AlgebraicGeometry.IsClosedImmersion f]

Function.Surjective ⇑(AlgebraicGeometry.Scheme.Hom.stalkMap f x)


@[simp] theorem dual_coindep_iff : M✶.Coindep X ↔ M.Indep X

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


theorem nonempty_embedding_to_cardinal : Nonempty (σ ↪ Cardinal.{u})


theorem toDualRight_symm_toDualLeft (x : M) :
    p.toDualRight.symm.dualMap (p.toDualLeft x) = Dual.eval R M x

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)
(x : M)

p.toDualRight.symm.dualMap (p.toDualLeft x) = (Module.Dual.eval R M) x


theorem Set.Finite.isCompact_sUnion {S : Set (Set X)} (hf : S.Finite) (hc : ∀ s ∈ S, IsCompact s) :
    IsCompact (⋃₀ S)

{X : Type u}
[TopologicalSpace X]
{S : Set (Set X)}
(hf : S.Finite)
(hc : ∀ s ∈ S, IsCompact s)


/-- `nsmul` is equal to any other module structure via a cast. -/
@[deprecated Nat.cast_smul_eq_nsmul (since := "2024-07-23")]
lemma nsmul_eq_smul_cast (n : ℕ) (b : M) : n • b = (n : R) • b

(R : Type u_2)
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(n : ℕ)
(b : M)


theorem mapsTo_univ (f : α → β) (s : Set α) : MapsTo f s univ

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


theorem mem_weightSpaceOf (χ : R) (x : L) (m : M) :
    m ∈ weightSpaceOf M χ x ↔ ∃ k : ℕ, ((toEnd R L M x - χ • ↑1) ^ k) m = 0

{R : Type u_2}
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(χ : R)
(x : L)
(m : M)

m ∈ LieModule.weightSpaceOf M χ x ↔ ∃ k, (((LieModule.toEnd R L M) x - χ • 1) ^ k) m = 0


lemma SurjOn.comp_left (hf : SurjOn f s t) (g : β → γ) : SurjOn (g ∘ f) s (g '' t)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{f : α → β}
(hf : Set.SurjOn f s t)
(g : β → γ)


/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsDedekindDomain R]
[Fintype (ClassGroup R)]


theorem mul_mono_left (h : I ≤ J) : I * K ≤ J * K

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


theorem isPreconnected_uIcc : IsPreconnected (uIcc a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}


theorem GradedAlgebra.ι_apply (m : M) :
    GradedAlgebra.ι R M m =
      DirectSum.of (fun i : ℕ => ⋀[R]^i M) 1
        ⟨ι R m, by simpa only [pow_one] using LinearMap.mem_range_self _ m⟩

(R : Type u_1)
(M : Type u_2)
[CommRing R]
[AddCommGroup M]
[Module R M]
(m : M)

(ExteriorAlgebra.GradedAlgebra.ι R M) m = (DirectSum.of (fun i => ↥(⋀[R]^i M)) 1) ⟨(ExteriorAlgebra.ι R) m, ⋯⟩


theorem head!_le_of_lt [Inhabited I] {q l : Products I} (h : q < l) (hq : q.val ≠ []) :
    q.val.head! ≤ l.val.head!

{q l : Profinite.NobelingProof.Products I}


/-- An n-ary version of `Set.mul_mem_mul`. -/
@[to_additive " An n-ary version of `Set.add_mem_add`. "]
theorem list_prod_mem_list_prod (t : List ι) (f : ι → Set α) (g : ι → α) (hg : ∀ i ∈ t, g i ∈ f i) :
    (t.map g).prod ∈ (t.map f).prod

{ι : Type u_1}
{α : Type u_2}
[CommMonoid α]
(t : List ι)
(f : ι → Set α)
(g : ι → α)
(hg : ∀ i ∈ t, g i ∈ f i)

(List.map g t).prod ∈ (List.map f t).prod


theorem nth_injOn (hf : (setOf p).Finite) : (Set.Iio hf.toFinset.card).InjOn (nth p)

Set.InjOn (Nat.nth p) (Set.Iio hf.toFinset.card)


@[to_additive]
theorem mem_iSup {ι : Sort*} (p : ι → Submonoid M) {m : M} :
    (m ∈ ⨆ i, p i) ↔ ∀ N, (∀ i, p i ≤ N) → m ∈ N

{M : Type u_1}
[AddZeroClass M]
{ι : Sort u_4}
(p : ι → AddSubmonoid M)
{m : M}

m ∈ ⨆ i, p i ↔ ∀ (N : AddSubmonoid M), (∀ (i : ι), p i ≤ N) → m ∈ N


lemma inter_ground_subset_closure (M : Matroid α) (X : Set α) : X ∩ M.E ⊆ M.closure X

{α : Type u_2}
(M : Matroid α)
(X : Set α)


/-- If a finset `u` is contained in the scalar product of two sets `s • t`, we can find two finsets
`s'`, `t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' • t'`. -/
@[to_additive
      "If a finset `u` is contained in the scalar sum of two sets `s +ᵥ t`, we can find two
      finsets `s'`, `t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' +ᵥ t'`."]
theorem subset_smul {s : Set α} {t : Set β} :
    ↑u ⊆ s • t → ∃ (s' : Finset α) (t' : Finset β), ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' • t'

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

↑u ⊆ s +ᵥ t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' +ᵥ t'


/--
`SatisfiesM` distributes over `<*>`, weakest precondition version 2.
(Use this when `f` and the goal are known and `x` is a subgoal.)
-/
protected theorem seq_pre' [Applicative m] [LawfulApplicative m] {x : m α}
    (hf : SatisfiesM p₁ f) (hx : SatisfiesM (fun a => ∀ {f}, p₁ f → q (f a)) x) :
    SatisfiesM q (f <*> x)

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

∀ {α_1 : Type u_1} {p₁ : (α → α_1) → Prop} {f : m (α → α_1)} {q : α_1 → Prop} [inst : Applicative m]
  [inst_1 : LawfulApplicative m] {x : m α},
  SatisfiesM p₁ f → SatisfiesM (fun a => ∀ {f : α → α_1}, p₁ f → q (f a)) x → SatisfiesM q (Seq.seq f fun x_1 => x)


/-- (Implementation Detail) The glue data associated to a disjoint union. -/
@[simps! J V U f t]
noncomputable
def disjointGlueData : Scheme.GlueData

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)

∀ (a : (AlgebraicGeometry.disjointGlueData' f).J), (AlgebraicGeometry.disjointGlueData f).U a = f a


theorem smul_mulActionHom_apply (c : Mᵈᵐᵃ) (f : α →[N] β) (a : α) :
    (c • f) a = f (mk.symm c • a)

{M : Type u_1}
{α : Type u_2}
{N : Type u_3}
{β : Type u_4}
[SMul M α]
[SMul N α]
[SMulCommClass M N α]
[SMul N β]
(c : Mᵈᵐᵃ)
(f : α →ₑ[id] β)
(a : α)


@[to_additive]
lemma inv_mem_units_iff (S : Submonoid M) {x : Mˣ} : x⁻¹ ∈ S.units ↔ x ∈ S.units

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


/-- A version of `contDiffWithinAt_succ_iff_hasFDerivWithinAt` where all derivatives
  are taken within the same set. -/
theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt' {n : ℕ} :
    ContDiffWithinAt 𝕜 (n + 1 : ℕ) f s x ↔
      ∃ u ∈ 𝓝[insert x s] x, u ⊆ insert x s ∧ ∃ f' : E → E →L[𝕜] F,
        (∀ x ∈ u, HasFDerivWithinAt f (f' x) s x) ∧ ContDiffWithinAt 𝕜 n f' s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ}

ContDiffWithinAt 𝕜 (↑(n + 1)) f s x ↔
  ∃ u ∈ 𝓝[insert x s] x,
    u ⊆ insert x s ∧ ∃ f', (∀ x ∈ u, HasFDerivWithinAt f (f' x) s x) ∧ ContDiffWithinAt 𝕜 (↑n) f' s x


/-- In a nontrivial topological vector space over a complete nontrivially normed field, any
countable set has dense complement. -/
theorem Set.Countable.dense_compl
    {E : Type u} (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] [AddCommGroup E]
    [Module 𝕜 E] [Nontrivial E] [TopologicalSpace E] [ContinuousAdd E] [ContinuousSMul 𝕜 E]
    {s : Set E} (hs : s.Countable) : Dense sᶜ

{E : Type u}
(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nontrivial E]
[TopologicalSpace E]
[ContinuousAdd E]
[ContinuousSMul 𝕜 E]
{s : Set E}
(hs : s.Countable)


/-- The additive equivalence between `(α ⊕ β) →₀ M` and `(α →₀ M) × (β →₀ M)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps! apply symm_apply]
def sumFinsuppAddEquivProdFinsupp {α β : Type*} : (α ⊕ β →₀ M) ≃+ (α →₀ M) × (β →₀ M)

{M : Type u_5}
[AddMonoid M]
{α : Type u_13}
{β : Type u_14}
(f : α ⊕ β →₀ M)

Finsupp.sumFinsuppAddEquivProdFinsupp f = (Finsupp.comapDomain Sum.inl f ⋯, Finsupp.comapDomain Sum.inr f ⋯)


/-- The fiber of any object in a Galois category is represented by a Galois object. -/
lemma exists_galois_representative (X : C) : ∃ (A : C) (a : F.obj A),
    IsGalois A ∧ Function.Bijective (fun (f : A ⟶ X) ↦ F.map f a)

(F : CategoryTheory.Functor C FintypeCat)

∃ A a, CategoryTheory.PreGaloisCategory.IsGalois A ∧ Function.Bijective fun f => F.map f a


theorem le_cof_iff_blsub {b : Ordinal} {a : Cardinal} :
    a ≤ cof b ↔ ∀ {o} (f : ∀ a < o, Ordinal), blsub.{u, u} o f = b → a ≤ o.card

a ≤ b.cof ↔ ∀ {o : Ordinal.{u}} (f : (a : Ordinal.{u}) → a < o → Ordinal.{u}), o.blsub f = b → a ≤ o.card


protected theorem mono (ht : Absorbent M s) (hsub : s ⊆ t) : Absorbent M t

{M : Type u_1}
{α : Type u_2}
[Bornology M]
[SMul M α]
{s t : Set α}
(ht : Absorbent M s)
(hsub : s ⊆ t)


theorem hexagon_forward_iso (X Y Z : C) :
    α_ X Y Z ≪≫ β_ X (Y ⊗ Z) ≪≫ α_ Y Z X =
      whiskerRightIso (β_ X Y) Z ≪≫ α_ Y X Z ≪≫ whiskerLeftIso Y (β_ X Z)

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

α_ X Y Z ≪≫ β_ X (Y ⊗ Z) ≪≫ α_ Y Z X =
  CategoryTheory.MonoidalCategory.whiskerRightIso (β_ X Y) Z ≪≫
    α_ Y X Z ≪≫ CategoryTheory.MonoidalCategory.whiskerLeftIso Y (β_ X Z)


@[simp]
theorem comp_const (f : C(β, γ)) (b : β) : f.comp (const α b) = const α (f b)

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

f.comp (ContinuousMap.const α b) = ContinuousMap.const α (f b)


theorem convs_stable_of_terminated (n_le_m : n ≤ m) (terminatedAt_n : g.TerminatedAt n) :
    g.convs m = g.convs n

{K : Type u_1}
{g : GenContFract K}
{n m : ℕ}
[DivisionRing K]
(n_le_m : n ≤ m)
(terminatedAt_n : g.TerminatedAt n)


theorem prevn : ∀ {it}, ValidFor l r it →
      ∀ n, n ≤ l.length → ValidFor (l.drop n) ((l.take n).reverse ++ r) (it.prevn n)

{l r : List Char}
{it : String.Iterator}

String.Iterator.ValidFor l r it →
  ∀ (n : Nat), n ≤ l.length → String.Iterator.ValidFor (List.drop n l) ((List.take n l).reverse ++ r) (it.prevn n)


/-- The closure of a set `s` is dense if and only if `s` is dense. -/
@[simp]
theorem dense_closure : Dense (closure s) ↔ Dense s

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


@[simp 1100] theorem headD_nil : @headD α [] d = d


@[simp]
theorem quot_neg (x : Prequotient F) :
    -- Porting note: Lean can't see `Quot.mk Setoid.r x` is a `ColimitType F` even with type
    -- annotation unless we use `by exact` to change the elaboration order.
    (by exact Quot.mk Setoid.r (neg x) : ColimitType F) = -(by exact Quot.mk Setoid.r x)

(x : CommRingCat.Colimits.Prequotient F)

Quot.mk Setoid.r x.neg = -Quot.mk Setoid.r x


@[simp]
protected theorem sup_le_iff {a : α} : s.sup f ≤ a ↔ ∀ b ∈ s, f b ≤ a

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s : Finset β}
{f : β → α}
{a : α}


@[simp]
theorem fderiv_star :
    fderiv 𝕜 (fun y => star (f y)) x = ((starL' 𝕜 : F ≃L[𝕜] F) : F →L[𝕜] F) ∘L fderiv 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[StarRing 𝕜]
[TrivialStar 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[StarAddMonoid F]
[NormedSpace 𝕜 F]
[StarModule 𝕜 F]
[ContinuousStar F]
{f : E → F}
{x : E}

fderiv 𝕜 (fun y => star (f y)) x = (↑(starL' 𝕜)).comp (fderiv 𝕜 f x)


theorem LocallyConvexSpace.convex_open_basis_zero [LocallyConvexSpace 𝕜 E] :
    (𝓝 0 : Filter E).HasBasis (fun s => (0 : E) ∈ s ∧ IsOpen s ∧ Convex 𝕜 s) id

(𝕜 : Type u_1)
(E : Type u_2)
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[LocallyConvexSpace 𝕜 E]

(𝓝 0).HasBasis (fun s => 0 ∈ s ∧ IsOpen s ∧ Convex 𝕜 s) id


theorem map_comp_eq (f : X ⟶ Y) (g : Y ⟶ Z) : map (f ≫ g) = map g ⋙ map f

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

TopologicalSpace.Opens.map (f ≫ g) = TopologicalSpace.Opens.map g ⋙ TopologicalSpace.Opens.map f


/-- If we repeat a column of a matrix, we get a matrix of determinant zero. -/
theorem det_updateColumn_eq_zero (h : i ≠ j) :
    (M.updateColumn j (fun k ↦ M k i)).det = 0

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{M : Matrix n n R}
{i j : n}
(h : i ≠ j)

(M.updateColumn j fun k => M k i).det = 0


theorem extendScalars_injective :
    Function.Injective fun E : { E : Subfield L // F ≤ E } ↦ extendScalars E.2

{L : Type u_2}
[Field L]
(F : Subfield L)

Function.Injective fun E => Subfield.extendScalars ⋯


theorem isCompact_of_bounded_of_closed [ProperSpace 𝕜] {s : Set (WeakDual 𝕜 E)}
    (hb : IsBounded (Dual.toWeakDual ⁻¹' s)) (hc : IsClosed s) : IsCompact s

(hb : Bornology.IsBounded (⇑NormedSpace.Dual.toWeakDual ⁻¹' s))


protected theorem of_le_add {f : α → ℝ} (h : ∀ x y, f x ≤ f y + dist x y) : LipschitzWith 1 f

{α : Type u}
[PseudoMetricSpace α]
{f : α → ℝ}
(h : ∀ (x y : α), f x ≤ f y + dist x y)


@[simp]
theorem cmpUsing_eq_gt [IsStrictOrder α lt] (a b : α) : cmpUsing lt a b = Ordering.gt ↔ lt b a

{α : Type u}
{lt : α → α → Prop}
[DecidableRel lt]
[IsStrictOrder α lt]
(a b : α)


lemma prod_apply_symm (s : Set (α × β)) (s_mble : MeasurableSet s) :
    μ.prod ν s = ENNReal.toNNReal (∫⁻ y, μ.toMeasure ((fun x ↦ ⟨x, y⟩) ⁻¹' s) ∂ν)

(μ : MeasureTheory.ProbabilityMeasure α)

(ν : MeasureTheory.ProbabilityMeasure β)

(μ.prod ν) s = (∫⁻ (y : β), ↑μ ((fun x => (x, y)) ⁻¹' s) ∂↑ν).toNNReal


@[simp]
theorem app_zsmul (X : C) (α : F ⟶ G) (n : ℤ) : (n • α).app X = n • α.app X

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


/-- (Impl) Prove that the lifted cone is limiting. -/
@[simps]
def liftedConeIsLimit : IsLimit (liftedCone D c t)

(D : CategoryTheory.Functor J T.Algebra)

(c : CategoryTheory.Limits.Cone (D.comp T.forget))

((CategoryTheory.Monad.ForgetCreatesLimits.liftedConeIsLimit D c t).lift s).f = t.lift (T.forget.mapCone s)


theorem linearly_dependent_of_isLocalExtrOn (hT : IsSelfAdjoint T) {x₀ : F}
    (hextr : IsLocalExtrOn T.reApplyInnerSelf (sphere (0 : F) ‖x₀‖) x₀) :
    ∃ a b : ℝ, (a, b) ≠ 0 ∧ a • x₀ + b • T x₀ = 0

(hextr : IsLocalExtrOn T.reApplyInnerSelf (Metric.sphere 0 ‖x₀‖) x₀)

∃ a b, (a, b) ≠ 0 ∧ a • x₀ + b • T x₀ = 0


/-- If `GenContFract.of v` terminates, then there is `n : ℕ` such that the `n`th convergent is
exactly `v`.
-/
theorem of_correctness_of_terminates (terminates : (of v).Terminates) :
    ∃ n : ℕ, v = (of v).convs n

(terminates : (GenContFract.of v).Terminates)


theorem liftNC_mul {g_hom : Type*} [FunLike g_hom G R] [MulHomClass g_hom G R]
    (f : k →+* R) (g : g_hom) (a b : MonoidAlgebra k G)
    (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g y)) :
    liftNC (f : k →+ R) g (a * b) = liftNC (f : k →+ R) g a * liftNC (f : k →+ R) g b

(h_comm : ∀ {x y : G}, y ∈ a.support → Commute (f (b x)) (g y))

(MonoidAlgebra.liftNC ↑f ⇑g) (a * b) = (MonoidAlgebra.liftNC ↑f ⇑g) a * (MonoidAlgebra.liftNC ↑f ⇑g) b


@[simp]
theorem representative_arrow (Y : Subobject X) : (representative.obj Y).arrow = Y.arrow

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

(CategoryTheory.Subobject.representative.obj Y).arrow = Y.arrow


/-- An alternative definition of `Tor`, where we left-derive in the first factor instead. -/
@[simps! obj_obj]
def Tor' (n : ℕ) : C ⥤ C ⥤ C

((CategoryTheory.Tor' C n).obj k).obj j =
  (((CategoryTheory.MonoidalCategory.tensoringRight C).obj j).leftDerived n).obj k


theorem isSymm_mul_transpose_self [Fintype n] [CommSemiring α] (A : Matrix n n α) :
    (A * Aᵀ).IsSymm

{α : Type u_1}
{n : Type u_3}
[Fintype n]
[CommSemiring α]
(A : Matrix n n α)


/-- If three points lie in the affine span of two points, those five points are collinear. -/
theorem collinear_insert_insert_insert_of_mem_affineSpan_pair {p₁ p₂ p₃ p₄ p₅ : P}
    (h₁ : p₁ ∈ line[k, p₄, p₅]) (h₂ : p₂ ∈ line[k, p₄, p₅]) (h₃ : p₃ ∈ line[k, p₄, p₅]) :
    Collinear k ({p₁, p₂, p₃, p₄, p₅} : Set P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ p₃ p₄ p₅ : P}
(h₁ : p₁ ∈ affineSpan k {p₄, p₅})
(h₂ : p₂ ∈ affineSpan k {p₄, p₅})
(h₃ : p₃ ∈ affineSpan k {p₄, p₅})


@[simp]
lemma dens_sdiff_add_dens_inter (s t : Finset α) : dens (s \ t) + dens (s ∩ t) = dens s

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


@[to_additive]
theorem leftInverse_mul_left_div (c : G) : Function.LeftInverse (fun x ↦ x * c) fun x ↦ x / c

Function.LeftInverse (fun x => x * c) fun x => x / c


/-- An intermediate field is closed under addition. -/
protected theorem add_mem {x y : L} : x ∈ S → y ∈ S → x + y ∈ S

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


@[simp]
lemma Hom.toAlgHom_comp_apply (f : Hom P P') (g : Hom P' P'') (x) :
    (g.comp f).toAlgHom x = g.toAlgHom (f.toAlgHom x)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u_1}
{S' : Type u_2}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
{R'' : Type u_4}
{S'' : Type u_5}
[CommRing R'']
[CommRing S'']
[Algebra R'' S'']
{P'' : Algebra.Generators R'' S''}
[Algebra R R'']
[Algebra S S'']
[Algebra R' R'']
[Algebra S' S'']
[Algebra R' S'']
[IsScalarTower R' R'' S'']
[IsScalarTower R' S' S'']
[IsScalarTower R R' R'']
[IsScalarTower S S' S'']
(f : P.Hom P')
(g : P'.Hom P'')
(x : P.Ring)


theorem zeta_apply_ne {x : ℕ} (h : x ≠ 0) : ζ x = 1


theorem decay_neg_aux (k n : ℕ) (f : 𝓢(E, F)) (x : E) :
    ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (-f : E → F) x‖ = ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(k n : ℕ)
(f : SchwartzMap E F)
(x : E)

‖x‖ ^ k * ‖iteratedFDeriv ℝ n (-⇑f) x‖ = ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖


/-- Norm of `const α b` is less than or equal to `‖b‖`. If `α` is nonempty,
then it is equal to `‖b‖`. -/
theorem norm_const_le (b : β) : ‖const α b‖ ≤ ‖b‖

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(b : β)

‖BoundedContinuousFunction.const α b‖ ≤ ‖b‖


@[simp]
theorem one_apply (x : A₁) : (1 : A₁ ≃ₐ[R] A₁) x = x

{R : Type uR}
{A₁ : Type uA₁}
[CommSemiring R]
[Semiring A₁]
[Algebra R A₁]
(x : A₁)


@[simp]
theorem image_div_const_uIcc (a b c : α) : (fun x => x / a) '' [[b, c]] = [[b / a, c / a]]

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


/-- A relation `r` is said to be infinite dimensional iff there exists relation series of arbitrary
  length. -/
class InfiniteDimensional : Prop where
  /-- A relation `r` is said to be infinite dimensional iff there exists relation series of
    arbitrary length. -/
  exists_relSeries_with_length : ∀ n : ℕ, ∃ x : RelSeries r, x.length = n

{α : Type u_1}
{r : Rel α α}
[self : r.InfiniteDimensional]
(n : ℕ)


@[simp]
theorem lieConj_symm : e.lieConj.symm = e.symm.lieConj

{R : Type u}
{M₁ : Type v}
{M₂ : Type w}
[CommRing R]
[AddCommGroup M₁]
[Module R M₁]
[AddCommGroup M₂]
[Module R M₂]
(e : M₁ ≃ₗ[R] M₂)


@[to_additive]
lemma exists_smul_eq (x y : α) : ∃ m : M, m • x = y

(M : Type u_1)
{α : Type u_7}
[VAdd M α]
[AddAction.IsPretransitive M α]
(x y : α)


/-- If `a b c : ℤ` are such that `¬ 3 ∣ a * b * c`, then `a ^ 3 + b ^ 3 ≠ c ^ 3`. -/
theorem fermatLastTheoremThree_case_1 {a b c : ℤ} (hdvd : ¬ 3 ∣ a * b * c) :
    a ^ 3 + b ^ 3 ≠ c ^ 3


/--
If `g` and `h` commute, then `g` moves `h • x` iff `g` moves `x`.
This is equivalent to say that the set `(fixedBy α g)ᶜ` is fixed by `h`.
-/
@[to_additive "If `g` and `h` commute, then `g` moves `h +ᵥ x` iff `g` moves `x`.
This is equivalent to say that the set `(fixedBy α g)ᶜ` is fixed by `h`."]
theorem movedBy_mem_fixedBy_of_commute {g h : G} (comm : Commute g h) :
    (fixedBy α g)ᶜ ∈ fixedBy (Set α) h

{α : Type u_1}
{G : Type u_2}
[AddGroup G]
[AddAction G α]
{g h : G}
(comm : AddCommute g h)

(AddAction.fixedBy α g)ᶜ ∈ AddAction.fixedBy (Set α) h


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

{f : α × β → γ}

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

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


theorem norm_of_nonneg {r : ℝ} (h : 0 ≤ r) : ‖(r : K)‖ = r

{K : Type u_1}
[RCLike K]
{r : ℝ}
(h : 0 ≤ r)


lemma addMonoidHom_ker_eq (hfg : Exact f g) :
    ker g = range f

{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
[AddGroup M]
[AddGroup N]
[AddGroup P]
{f : M →+ N}
{g : N →+ P}
(hfg : Function.Exact ⇑f ⇑g)


@[to_additive]
theorem one_neBot : (1 : Filter α).NeBot


/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
(P : Type u_2)
[CommRing P]
[Algebra R P]
(I : FractionalIdeal S P)

(FractionalIdeal.coeSubmoduleHom S P) I = ↑I