theorem frontier_Iic [NoMaxOrder α] {a : α} : frontier (Iic a) = {a}

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMaxOrder α]
{a : α}


theorem eq_prod_roots_of_monic_of_splits_id {p : K[X]} (m : Monic p)
    (hsplit : Splits (RingHom.id K) p) : p = (p.roots.map fun a => X - C a).prod

(hsplit : Polynomial.Splits (RingHom.id K) p)

p = (Multiset.map (fun a => Polynomial.X - Polynomial.C a) p.roots).prod


@[to_additive]
protected theorem mul_left_injective (h : IsUnit b) : Injective (· * b)

{M : Type u_1}
[Monoid M]
{b : M}
(h : IsUnit b)


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

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


theorem aestronglyMeasurable_smul_const_iff {f : α → 𝕜} {c : E} (hc : c ≠ 0) :
    AEStronglyMeasurable (fun x => f x • c) μ ↔ AEStronglyMeasurable f μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{𝕜 : Type u_4}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{E : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : α → 𝕜}
{c : E}
(hc : c ≠ 0)

MeasureTheory.AEStronglyMeasurable (fun x => f x • c) μ ↔ MeasureTheory.AEStronglyMeasurable f μ


@[to_additive]
theorem absolutelyContinuous_inv : μ ≪ μ.inv

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[μ.IsMulLeftInvariant]


@[simp]
theorem mem_homogeneousSubmodule [CommSemiring R] (n : ℕ) (p : MvPolynomial σ R) :
    p ∈ homogeneousSubmodule σ R n ↔ p.IsHomogeneous n

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
(n : ℕ)
(p : MvPolynomial σ R)

p ∈ MvPolynomial.homogeneousSubmodule σ R n ↔ p.IsHomogeneous n


@[simp]
theorem ae_restrict_iUnion_eq [Countable ι] (s : ι → Set α) :
    ae (μ.restrict (⋃ i, s i)) = ⨆ i, ae (μ.restrict (s i))

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable ι]
(s : ι → Set α)

MeasureTheory.ae (μ.restrict (⋃ i, s i)) = ⨆ i, MeasureTheory.ae (μ.restrict (s i))


@[simp] lemma singleton_sups : {a} ⊻ t = t.image (a ⊔ ·)

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{t : Finset α}
{a : α}

{a} ⊻ t = Finset.image (fun x => a ⊔ x) t


theorem Quot.subsingleton_iff (r : α → α → Prop) : Subsingleton (Quot r) ↔ EqvGen r = ⊤


theorem dualBasis_apply (i : ι) (m : M) : b.dualBasis i m = b.repr m i

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommRing R]
[AddCommGroup M]
[Module R M]
[DecidableEq ι]
(b : Basis ι R M)
[Finite ι]
(i : ι)
(m : M)


theorem mem_iff_eq_smul_annIdealGenerator {p : 𝕜[X]} (a : A) :
    p ∈ annIdeal 𝕜 a ↔ ∃ s : 𝕜[X], p = s • annIdealGenerator 𝕜 a

(𝕜 : Type u_1)
{A : Type u_2}
[Field 𝕜]
[Ring A]
[Algebra 𝕜 A]
{p : 𝕜[X]}
(a : A)

p ∈ Polynomial.annIdeal 𝕜 a ↔ ∃ s, p = s • Polynomial.annIdealGenerator 𝕜 a


theorem decomposeAux_coe {i : ι} (x : gradeBy R f i) :
    decomposeAux f ↑x = DirectSum.of (fun i => gradeBy R f i) i x

(x : ↥(AddMonoidAlgebra.gradeBy R (⇑f) i))

(AddMonoidAlgebra.decomposeAux f) ↑x = (DirectSum.of (fun i => ↥(AddMonoidAlgebra.gradeBy R (⇑f) i)) i) x


@[reassoc]
theorem rightUnitor_tensor (X Y : C) :
    (ρ_ (X ⊗ Y)).hom = (α_ X Y (𝟙_ C)).hom ≫ X ◁ (ρ_ Y).hom

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

(CategoryTheory.MonoidalCategory.rightUnitor (CategoryTheory.MonoidalCategory.tensorObj X Y)).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y (𝟙_ C)).hom
    (CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.MonoidalCategory.rightUnitor Y).hom)


theorem eLpNormEssSup_indicator_le (s : Set α) (f : α → G) :
    eLpNormEssSup (s.indicator f) μ ≤ eLpNormEssSup f μ

{α : Type u_1}
{G : Type u_4}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup G]
(s : Set α)
(f : α → G)

MeasureTheory.eLpNormEssSup (s.indicator f) μ ≤ MeasureTheory.eLpNormEssSup f μ


theorem volume_pi_pi [∀ i, MeasureSpace (α i)] [∀ i, SigmaFinite (volume : Measure (α i))]
    (s : ∀ i, Set (α i)) : volume (pi univ s) = ∏ i, volume (s i)

[(i : ι) → MeasureTheory.MeasureSpace (α i)]

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

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


theorem Base.ssubset_ground [h : RkPos M✶] (hB : M.Base B) : B ⊂ M.E

{α : Type u_1}
{M : Matroid α}
{B : Set α}
[h : M✶.RkPos]
(hB : M.Base B)


theorem UInt8.toNat_lt (x : UInt8) : x.toNat < 2 ^ 8


/-- Auxiliary definition for `mapBifunctorHomologicalComplex`. -/
@[simps!]
def mapBifunctorHomologicalComplexObj (K₁ : HomologicalComplex C₁ c₁) :
    HomologicalComplex C₂ c₂ ⥤ HomologicalComplex₂ D c₁ c₂

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

(((F.mapBifunctorHomologicalComplexObj c₂ K₁).obj K₂).d i₁ i₁').f i₂ = (F.map (K₁.d i₁ i₁')).app (K₂.X i₂)


@[to_additive Right.pow_nonpos]
theorem Right.pow_le_one_of_le (hx : x ≤ 1) : ∀ {n : ℕ}, x ^ n ≤ 1

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


theorem isCompl_principal (s : Set α) : IsCompl (𝓟 s) (𝓟 sᶜ)


lemma of_isPreimmersion {X Y : Scheme} (f : X ⟶ Y) [IsPreimmersion f]
    (hf : IsClosed (Set.range f.1.base)) : IsClosedImmersion f

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[AlgebraicGeometry.IsPreimmersion f]
(hf : IsClosed (Set.range ⇑f.val.base))


theorem sum_cond (μ ν : Measure α) : (sum fun b => cond b μ ν) = μ + ν

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)

(MeasureTheory.Measure.sum fun b => bif b then μ else ν) = μ + ν


lemma smul_basis_eq_zero {p q : R[X]} (hpq : p • (1 : W.CoordinateRing) + q • mk W Y = 0) :
    p = 0 ∧ q = 0

(hpq : p • 1 + q • (WeierstrassCurve.Affine.CoordinateRing.mk W) Y = 0)


theorem op_smul_one_eq_diagonal [DecidableEq m] (a : α) :
    MulOpposite.op a • (1 : Matrix m m α) = diagonal fun _ => a

{m : Type u_2}
{α : Type v}
[NonAssocSemiring α]
[DecidableEq m]
(a : α)

MulOpposite.op a • 1 = Matrix.diagonal fun x => a


theorem mem_toNat' : ∀ (a : Int) (n : Nat), toNat' a = some n ↔ a = n


theorem ofOption_eq_get {α} (o : Option α) : ofOption o = ⟨_, @Option.get _ o⟩

↑o = { Dom := o.isSome = true, get := o.get }


theorem iInter_false {s : False → Set α} : iInter s = univ


theorem rdropWhile_singleton (x : α) : rdropWhile p [x] = if p x then [] else [x]

List.rdropWhile p [x] = if p x = true then [] else [x]


theorem generateMeasurableRec_subset (s : Set (Set α)) {i j : ω₁} (h : i ≤ j) :
    generateMeasurableRec s i ⊆ generateMeasurableRec s j

{i j : (Quotient.out (Cardinal.aleph 1).ord).α}

MeasurableSpace.generateMeasurableRec s i ⊆ MeasurableSpace.generateMeasurableRec s j


@[reassoc (attr := simp)]
theorem leftDistributor_inv_comp_biproduct_π {J : Type} [Fintype J] (X : C) (f : J → C) (j : J) :
    (leftDistributor X f).inv ≫ (X ◁ biproduct.π _ j) = biproduct.π _ j

CategoryTheory.CategoryStruct.comp (CategoryTheory.leftDistributor X f).inv
    (CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.Limits.biproduct.π f j)) =
  CategoryTheory.Limits.biproduct.π (fun j => CategoryTheory.MonoidalCategory.tensorObj X (f j)) j


/-- Transposing Young diagrams is an `OrderIso`. -/
@[simps]
def transposeOrderIso : YoungDiagram ≃o YoungDiagram

YoungDiagram.transposeOrderIso μ = μ.transpose


/-- Submonoids are closed under natural powers. -/
@[to_additive
      "An `AddSubmonoid` is closed under multiplication by naturals."]
theorem IsSubmonoid.pow_mem {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : ∀ {n : ℕ}, a ^ n ∈ s

{M : Type u_1}
[Monoid M]
{s : Set M}
{a : M}
(hs : IsSubmonoid s)
(h : a ∈ s)
{n : ℕ}


theorem boundary_le_boundary_sup_sup_boundary_inf_left : ∂ a ≤ ∂ (a ⊔ b) ⊔ ∂ (a ⊓ b)

{α : Type u_1}
[CoheytingAlgebra α]
{a b : α}


@[continuity]
theorem Continuous.matrix_fromBlocks {A : X → Matrix n l R} {B : X → Matrix n m R}
    {C : X → Matrix p l R} {D : X → Matrix p m R} (hA : Continuous A) (hB : Continuous B)
    (hC : Continuous C) (hD : Continuous D) :
    Continuous fun x => Matrix.fromBlocks (A x) (B x) (C x) (D x)

{X : Type u_1}
{l : Type u_3}
{m : Type u_4}
{n : Type u_5}
{p : Type u_6}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
{A : X → Matrix n l R}
{B : X → Matrix n m R}
{C : X → Matrix p l R}
{D : X → Matrix p m R}
(hA : Continuous A)
(hB : Continuous B)
(hC : Continuous C)
(hD : Continuous D)


@[deprecated map_mul (since := "2024-06-26")]
protected theorem map_mul (x y) : φ (x * y) = φ x * φ y

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


lemma _root_.LocalRing.isRegular_iff_isWeaklyRegular_of_subset_maximalIdeal
    [LocalRing R] [Nontrivial M] [Module.Finite R M] {rs : List R}
    (h : ∀ r ∈ rs, r ∈ LocalRing.maximalIdeal R) :
    IsRegular M rs ↔ IsWeaklyRegular M rs

RingTheory.Sequence.IsRegular M rs ↔ RingTheory.Sequence.IsWeaklyRegular M rs


theorem isOfFinAddOrder_ofMul_iff : IsOfFinAddOrder (Additive.ofMul x) ↔ IsOfFinOrder x


@[to_additive]
theorem prod_apply [CommMonoid β] [ContinuousMul β] {ι : Type*} (s : Finset ι) (f : ι → C(α, β))
    (a : α) : (∏ i ∈ s, f i) a = ∏ i ∈ s, f i a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[AddCommMonoid β]
[ContinuousAdd β]
{ι : Type u_3}
(s : Finset ι)
(f : ι → C(α, β))
(a : α)


theorem aeval_gen_minpoly (α : E) : aeval (AdjoinSimple.gen F α) (minpoly F α) = 0

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

(Polynomial.aeval (IntermediateField.AdjoinSimple.gen F α)) (minpoly F α) = 0


@[simp] theorem loopyOn_ground (E : Set α) : (loopyOn E).E = E


@[reassoc (attr := simp)]
lemma homologyι_naturality :
    homologyMap φ i ≫ L.homologyι i = K.homologyι i ≫ opcyclesMap φ i

HomologicalComplex.homologyMap φ i ≫ L.homologyι i = K.homologyι i ≫ HomologicalComplex.opcyclesMap φ i


protected theorem ext_iff : f = g ↔ ∀ x, f x = g x

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}
{f g : M →ₛₗ[σ] M₃}


theorem mem_sup_right {S T : Submodule R M} : ∀ {x : M}, x ∈ T → x ∈ S ⊔ T

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{S T : Submodule R M}
{x : M}


theorem CauchySeq.prod_map {γ δ} [UniformSpace β] [Preorder γ] [Preorder δ] {u : γ → α}
    {v : δ → β} (hu : CauchySeq u) (hv : CauchySeq v) : CauchySeq (Prod.map u v)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
{γ : Type u_1}
{δ : Type u_2}
[UniformSpace β]
[Preorder γ]
[Preorder δ]
{u : γ → α}
{v : δ → β}
(hu : CauchySeq u)
(hv : CauchySeq v)


/-- Shows that the partial numerators `aᵢ` are equal to one. -/
theorem of_partNum_eq_one {a : K} (nth_partNum_eq : (of v).partNums.get? n = some a) :
    a = 1

(nth_partNum_eq : (GenContFract.of v).partNums.get? n = some a)


@[simp]
theorem IsClosed.closure_le_iff (hy : c.IsClosed y) : c x ≤ y ↔ x ≤ y

{α : Type u_1}
[PartialOrder α]
{c : ClosureOperator α}
{x y : α}
(hy : c.IsClosed y)


@[simp]
theorem polar_empty : B.polar ∅ = Set.univ

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedCommRing 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜)


theorem wOppSide_vadd_left_iff {s : AffineSubspace R P} {x y : P} {v : V} (hv : v ∈ s.direction) :
    s.WOppSide (v +ᵥ x) y ↔ s.WOppSide x y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
{v : V}
(hv : v ∈ s.direction)


@[simp]
theorem Complex.logDeriv_cosh : logDeriv (Complex.cosh) = Complex.tanh


theorem tr_pred (q₁ q₂) : tr (Λ'.pred q₁ q₂) = pop' main (branch (fun s => s = some Γ'.bit0)
    ((push rev fun _ => Γ'.bit1) <| goto fun _ => Λ'.pred q₁ q₂) <|
    branch (fun s => natEnd s.iget) (goto fun _ => q₁)
      (peek' main <|
        branch (fun s => natEnd s.iget) (goto fun _ => unrev q₂)
          ((push rev fun _ => Γ'.bit0) <| goto fun _ => unrev q₂)))

Turing.PartrecToTM2.tr (q₁.pred q₂) =
  Turing.PartrecToTM2.pop' Turing.PartrecToTM2.K'.main
    (Turing.TM2.Stmt.branch (fun s => decide (s = some Turing.PartrecToTM2.Γ'.bit0))
      (Turing.TM2.Stmt.push Turing.PartrecToTM2.K'.rev (fun x => Turing.PartrecToTM2.Γ'.bit1)
        (Turing.TM2.Stmt.goto fun x => q₁.pred q₂))
      (Turing.TM2.Stmt.branch (fun s => Turing.PartrecToTM2.natEnd s.iget) (Turing.TM2.Stmt.goto fun x => q₁)
        (Turing.PartrecToTM2.peek' Turing.PartrecToTM2.K'.main
          (Turing.TM2.Stmt.branch (fun s => Turing.PartrecToTM2.natEnd s.iget)
            (Turing.TM2.Stmt.goto fun x => Turing.PartrecToTM2.unrev q₂)
            (Turing.TM2.Stmt.push Turing.PartrecToTM2.K'.rev (fun x => Turing.PartrecToTM2.Γ'.bit0)
              (Turing.TM2.Stmt.goto fun x => Turing.PartrecToTM2.unrev q₂))))))


theorem quotMapOfEquivQuotMapCMapSpanMk_symm_mk (x : AdjoinRoot f) :
    (quotMapOfEquivQuotMapCMapSpanMk I f).symm
        (Ideal.Quotient.mk ((I.map (C : R →+* R[X])).map (Ideal.Quotient.mk (span {f}))) x) =
      Ideal.Quotient.mk (I.map (of f)) x

{R : Type u}
[CommRing R]
(I : Ideal R)
(f : R[X])
(x : AdjoinRoot f)

(AdjoinRoot.quotMapOfEquivQuotMapCMapSpanMk I f).symm
    ((Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk (Ideal.span {f})) (Ideal.map Polynomial.C I))) x) =
  (Ideal.Quotient.mk (Ideal.map (AdjoinRoot.of f) I)) x


@[simp, norm_cast]
theorem coe_inj {s₁ s₂ : Finset α} : (s₁ : Set α) = s₂ ↔ s₁ = s₂

↑s₁ = ↑s₂ ↔ s₁ = s₂


theorem isTorsion_of_aeval_eq_zero [CommSemiring R] [NoZeroDivisors R] [Semiring A] [Algebra R A]
    [AddCommMonoid M] [Module A M] [Module R M] [IsScalarTower R A M]
    {p : R[X]} (h : aeval a p = 0) (h' : p ≠ 0) :
    IsTorsion R[X] (AEval R M a)

{R : Type u_1}
{M : Type u_3}
{A : Type u_4}
{a : A}
[CommSemiring R]
[NoZeroDivisors R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
{p : R[X]}
(h : (Polynomial.aeval a) p = 0)
(h' : p ≠ 0)

Module.IsTorsion R[X] (Module.AEval R M a)


@[simp] lemma nonempty_uIcc : [[a, b]].Nonempty


theorem argmax_concat (f : α → β) (a : α) (l : List α) :
    argmax f (l ++ [a]) =
      Option.casesOn (argmax f l) (some a) fun c => if f c < f a then some a else some c

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[DecidableRel fun x x_1 => x < x_1]
(f : α → β)
(a : α)
(l : List α)

List.argmax f (l ++ [a]) = Option.casesOn (List.argmax f l) (some a) fun c => if f c < f a then some a else some c


/-- Equivalent characterizations of a Galois extension of finite degree-/
theorem tfae [FiniteDimensional F E] : List.TFAE [
    IsGalois F E,
    IntermediateField.fixedField (⊤ : Subgroup (E ≃ₐ[F] E)) = ⊥,
    Fintype.card (E ≃ₐ[F] E) = finrank F E,
    ∃ p : F[X], p.Separable ∧ p.IsSplittingField F E]

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

[IsGalois F E, IntermediateField.fixedField ⊤ = ⊥, Fintype.card (E ≃ₐ[F] E) = FiniteDimensional.finrank F E,
    ∃ p, p.Separable ∧ Polynomial.IsSplittingField F E p].TFAE


@[to_additive]
theorem one_mem_one : (1 : α) ∈ (1 : Set α)


/-- `IsDirected α r` states that for any elements `a`, `b` there exists an element `c` such that
`r a c` and `r b c`. -/
class IsDirected (α : Type*) (r : α → α → Prop) : Prop where
  /-- For every pair of elements `a` and `b` there is a `c` such that `r a c` and `r b c` -/
  directed (a b : α) : ∃ c, r a c ∧ r b c

{α : Type u_1}
{r : α → α → Prop}
[self : IsDirected α r]
(a b : α)


@[simp 1100, norm_cast]
theorem coe_subset_coe : (s : Set α) ⊆ t ↔ t ≤ s

{α : Type u_1}
[LE α]
{s t : UpperSet α}

↑s ⊆ ↑t ↔ t ≤ s


lemma uIcc_of_not_ge (h : ¬b ≤ a) : [[a, b]] = Icc a b

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : ¬b ≤ a)


@[to_additive] lemma mabs_eq_max_inv : |a|ₘ = max a a⁻¹

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


theorem finite_coe_iff {s : Set α} : Finite s ↔ s.Finite


theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I

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


@[simp] theorem mk_succ_pow (m : ℕ) (x : K) : mk K p ⟨m + 1, x ^ p⟩ = mk K p ⟨m, x⟩

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]
(m : ℕ)
(x : K)

PerfectClosure.mk K p (m + 1, x ^ p) = PerfectClosure.mk K p (m, x)


theorem SimpleFunc.exists_lt_lintegral_simpleFunc_of_lt_lintegral {m : MeasurableSpace α}
    {μ : Measure α} [SigmaFinite μ] {f : α →ₛ ℝ≥0} {L : ℝ≥0∞} (hL : L < ∫⁻ x, f x ∂μ) :
    ∃ g : α →ₛ ℝ≥0, (∀ x, g x ≤ f x) ∧ ∫⁻ x, g x ∂μ < ∞ ∧ L < ∫⁻ x, g x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
{f : MeasureTheory.SimpleFunc α ℝ≥0}
{L : ℝ≥0∞}
(hL : L < ∫⁻ (x : α), ↑(↑f x) ∂μ)

∃ g, (∀ (x : α), ↑g x ≤ ↑f x) ∧ ∫⁻ (x : α), ↑(↑g x) ∂μ < ⊤ ∧ L < ∫⁻ (x : α), ↑(↑g x) ∂μ


protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegular μ] {f : α → β} (hf : Continuous f) :
    InnerRegular (Measure.map f μ)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[BorelSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
[h : μ.InnerRegular]
{f : α → β}
(hf : Continuous f)


theorem isMaxOn_dual_iff : IsMaxOn (toDual ∘ f) s a ↔ IsMinOn f s a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}

IsMaxOn (⇑OrderDual.toDual ∘ f) s a ↔ IsMinOn f s a


theorem map_add (e : M₁ ≃SL[σ₁₂] M₂) (x y : M₁) : e (x + y) = e x + e y

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


/-- The coefficient of a heterogeneous vertex operator, viewed as a formal power series with
coefficients in linear maps. -/
@[simps]
def coeff (A : HVertexOperator Γ R V W) (n : Γ) : V →ₗ[R] W

{Γ : Type u_1}
[PartialOrder Γ]
{R : Type u_2}
{V : Type u_3}
{W : Type u_4}
[CommRing R]
[AddCommGroup V]
[Module R V]
[AddCommGroup W]
[Module R W]
(A : HVertexOperator Γ R V W)
(n : Γ)
(v : V)

(A.coeff n) v = ((HahnModule.of R).symm (A v)).coeff n


lemma llr_tilted_left [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν)
    (hf : Integrable (fun x ↦ exp (f x)) μ) (hfν : AEMeasurable f ν) :
    (llr (μ.tilted f) ν) =ᵐ[μ] fun x ↦ f x - log (∫ z, exp (f z) ∂μ) + llr μ ν x

(hf : MeasureTheory.Integrable (fun x => rexp (f x)) μ)

MeasureTheory.llr (μ.tilted f) ν =ᵐ[μ] fun x => f x - Real.log (∫ (z : α), rexp (f z) ∂μ) + MeasureTheory.llr μ ν x


/-- The `tsupport`s of a partition of unity are locally finite. -/
theorem finite_tsupport : {i | x₀ ∈ tsupport (ρ i)}.Finite

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(ρ : PartitionOfUnity ι X s)
(x₀ : X)


/-- When the derivative of a function is nonnegative, then it is automatically integrable,
Ioc version. -/
theorem integrableOn_deriv_of_nonneg (hcont : ContinuousOn g (Icc a b))
    (hderiv : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (g'pos : ∀ x ∈ Ioo a b, 0 ≤ g' x) :
    IntegrableOn g' (Ioc a b)

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

MeasureTheory.IntegrableOn g' (Set.Ioc a b) MeasureTheory.volume


@[simp, norm_cast]
theorem coe_ennreal_mul : ∀ x y : ℝ≥0∞, ((x * y : ℝ≥0∞) : EReal) = (x : EReal) * y


lemma ConcaveOn.mul (hf : ConcaveOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g)
    (hf₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ f x) (hg₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ g x) (hfg : AntivaryOn f g s) :
    ConcaveOn 𝕜 s (f * g)

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set 𝕜}
[IsScalarTower 𝕜 E E]
[SMulCommClass 𝕜 E E]
{f g : 𝕜 → E}
(hf : ConcaveOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ f x)
(hg₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ g x)
(hfg : AntivaryOn f g s)


/-- The map `Cocycle K L n → Cocycle K (L⟦a⟧) n'` when `n' + a = n`. -/
@[simps!]
def rightShift (γ : Cocycle K L n) (a n' : ℤ) (hn' : n' + a = n) :
    Cocycle K (L⟦a⟧) n'

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

↑(γ.rightShift a n' hn') = (↑γ).rightShift a n' hn'


theorem Sbtw.wbtw {x y z : P} (h : Sbtw R x y z) : Wbtw R x y z

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


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

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

{α : Type u_13}
{β : Type u_14}
{γ : Type u_15}
[Zero γ]
(f : α ⊕ β →₀ γ)

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


@[reassoc (attr := simp)]
theorem πSummand_comp_cofan_inj_id_comp_PInfty_eq_PInfty (n : ℕ) :
    s.πSummand (IndexSet.id (op [n])) ≫ (s.cofan _).inj (IndexSet.id (op [n])) ≫ PInfty.f n =
      PInfty.f n

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X : CategoryTheory.SimplicialObject C}
(s : SimplicialObject.Splitting X)
[CategoryTheory.Preadditive C]
(n : ℕ)

s.πSummand (SimplicialObject.Splitting.IndexSet.id (Opposite.op [n])) ≫
    (s.cofan (Opposite.op [n])).inj (SimplicialObject.Splitting.IndexSet.id (Opposite.op [n])) ≫
      AlgebraicTopology.DoldKan.PInfty.f n =
  AlgebraicTopology.DoldKan.PInfty.f n


/--  The following two lemmas should be viewed as a hand-made "congr"-lemmas.
They achieve the following goals.
* They introduce *two* fresh metavariables replacing the given one `deg`,
  one for the `natDegree ≤` computation and one for the `coeff =` computation.
  This helps `compute_degree`, since it does not "pre-estimate" the degree,
  but it "picks it up along the way".
* They split checking the inequality `coeff p n ≠ 0` into the task of
  finding a value `c` for the `coeff` and then
  proving that this value is non-zero by `coeff_ne_zero`.
-/
theorem natDegree_eq_of_le_of_coeff_ne_zero' {deg m o : ℕ} {c : R} {p : R[X]}
    (h_natDeg_le : natDegree p ≤ m) (coeff_eq : coeff p o = c)
    (coeff_ne_zero : c ≠ 0) (deg_eq_deg : m = deg) (coeff_eq_deg : o = deg) :
    natDegree p = deg

{R : Type u_1}
[Semiring R]
{deg m o : ℕ}
{c : R}
{p : R[X]}
(h_natDeg_le : p.natDegree ≤ m)
(coeff_eq : p.coeff o = c)
(coeff_ne_zero : c ≠ 0)
(deg_eq_deg : m = deg)
(coeff_eq_deg : o = deg)


@[reassoc (attr := simp)]
lemma ι₁_π : ι₁ K ≫ π K = 𝟙 K

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (K.X i)]

[HomologicalComplex.HasHomotopyCofiber (CategoryTheory.Limits.biprod.lift (𝟙 K) (-𝟙 K))]

HomologicalComplex.cylinder.ι₁ K ≫ HomologicalComplex.cylinder.π K = 𝟙 K


protected theorem nhds (x : Rˣ) : { x : R | IsUnit x } ∈ 𝓝 (x : R)

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)


/-- `M` acts pretransitively on `α` if for any `x y` there is `g` such that `g +ᵥ x = y`.
  A transitive action should furthermore have `α` nonempty. -/
class AddAction.IsPretransitive (M α : Type*) [VAdd M α] : Prop where
  /-- There is `g` such that `g +ᵥ x = y`. -/
  exists_vadd_eq : ∀ x y : α, ∃ g : M, g +ᵥ x = y

{M : Type u_11}
{α : Type u_12}
[VAdd M α]
[self : AddAction.IsPretransitive M α]
(x y : α)


@[simp]
lemma smul_pos_iff_of_pos_right [SMulPosStrictMono α β] [SMulPosReflectLT α β] (hb : 0 < b) :
    0 < a • b ↔ 0 < a

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[Preorder α]
[Preorder β]
[SMulPosStrictMono α β]
[SMulPosReflectLT α β]
(hb : 0 < b)


theorem lt_add_right (ha : a ≠ ∞) (hb : b ≠ 0) : a < a + b


@[simp, deprecated toNat_ofNat (since := "2024-02-22")]
theorem toNat_zero (n : Nat) : (0#n).toNat = 0


@[simp]
theorem isOpen_image (h : X ≃ₜ Y) {s : Set X} : IsOpen (h '' s) ↔ IsOpen s

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


theorem target_subset_preimage_source : e.target ⊆ e.symm ⁻¹' e.source

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


@[simp] lemma shiftr_eq_shiftRight (p : Num) (n : Nat) : p.shiftr n = p >>> n


lemma le_comap_range_rTensor (q : Q) :
    LinearMap.range g ≤ (LinearMap.range (rTensor Q g)).comap
      ((TensorProduct.mk R P Q).flip q)

{R : Type u_1}
[CommSemiring R]
{N : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R N]
[Module R P]
[Module R Q]
(g : N →ₗ[R] P)
(q : Q)

LinearMap.range g ≤ Submodule.comap ((TensorProduct.mk R P Q).flip q) (LinearMap.range (LinearMap.rTensor Q g))


theorem map₂_swap (f : α → β → γ) (a : Option α) (b : Option β) :
    map₂ f a b = map₂ (fun a b => f b a) b a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(a : Option α)
(b : Option β)

Option.map₂ f a b = Option.map₂ (fun a b => f b a) b a


@[simp]
theorem orderIsoPUnitSumLex_toLex (a : α) : orderIsoPUnitSumLex ↑a = toLex (inr a)

WithBot.orderIsoPUnitSumLex ↑a = toLex (Sum.inr a)


@[simp]
theorem contLinear_map_vsub (f : P →ᴬ[R] Q) (p₁ p₂ : P) : f.contLinear (p₁ -ᵥ p₂) = f p₁ -ᵥ f p₂

{R : Type u_2}
{V : Type u_3}
{W : Type u_4}
{P : Type u_6}
{Q : Type u_7}
[NormedAddCommGroup V]
[MetricSpace P]
[NormedAddTorsor V P]
[NormedAddCommGroup W]
[MetricSpace Q]
[NormedAddTorsor W Q]
[NormedField R]
[NormedSpace R V]
[NormedSpace R W]
(f : P →ᴬ[R] Q)
(p₁ p₂ : P)


@[simp]
theorem lcm_dvd_iff {a : α} : s.lcm f ∣ a ↔ ∀ b ∈ s, f b ∣ a

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
{a : α}


theorem setOf_exists (p : ι → β → Prop) : { x | ∃ i, p i x } = ⋃ i, { x | p i x }

{β : Type u_2}
{ι : Sort u_4}
(p : ι → β → Prop)


@[simp]
theorem toSeminorm_apply {f : E →ₗ[𝕜] 𝕜} {x : E} : f.toSeminorm x = ‖f x‖

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{f : E →ₗ[𝕜] 𝕜}
{x : E}


theorem isOrtho_iff_inner_eq {U V : Submodule 𝕜 E} : U ⟂ V ↔ ∀ u ∈ U, ∀ v ∈ V, ⟪u, v⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U V : Submodule 𝕜 E}


@[to_additive]
lemma le_mulIndicator_apply (hfg : a ∈ s → y ≤ g a) (hf : a ∉ s → y ≤ 1) :
    y ≤ mulIndicator s g a

{α : Type u_2}
{M : Type u_4}
[LE M]
[Zero M]
{s : Set α}
{g : α → M}
{a : α}
{y : M}
(hfg : a ∈ s → y ≤ g a)
(hf : a ∉ s → y ≤ 0)


@[simp]
theorem aequiv_self (h : IsAdjoinRoot S f) : h.aequiv h = AlgEquiv.refl

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


theorem measure_subtype_coe_le_comap (hs : NullMeasurableSet s μ) (t : Set s) :
    μ (((↑) : s → α) '' t) ≤ μ.comap Subtype.val t

(hs : MeasureTheory.NullMeasurableSet s μ)

μ (Subtype.val '' t) ≤ (MeasureTheory.Measure.comap Subtype.val μ) t


theorem smul_mem (r : R) (h : x ∈ p) : r • x ∈ p

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{x : M}
(r : R)
(h : x ∈ p)


/-- A measurable subspace of a standard Borel space is standard Borel. -/
theorem _root_.MeasurableSet.standardBorel {s : Set α} (hs : MeasurableSet s) :
    StandardBorelSpace s

{α : Type u_1}
[MeasurableSpace α]
[StandardBorelSpace α]
{s : Set α}
(hs : MeasurableSet s)


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

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


theorem ball_disjoint_ball (h : δ + ε ≤ dist x y) : Disjoint (ball x δ) (ball y ε)

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{δ ε : ℝ}
(h : δ + ε ≤ dist x y)

Disjoint (Metric.ball x δ) (Metric.ball y ε)


/-- If `g` is a separable contraction of `f`, then the separable degree of `f` is equal to
the degree of `g`. -/
theorem IsSeparableContraction.natSepDegree_eq {g : Polynomial F} {q : ℕ} [ExpChar F q]
    (h : IsSeparableContraction q f g) : f.natSepDegree = g.natDegree

(h : Polynomial.IsSeparableContraction q f g)


/-- Dirac delta measures at two points are equal if every measurable set contains either both or
neither of the points. -/
lemma dirac_eq_dirac_iff_forall_mem_iff_mem {x y : α} :
    Measure.dirac x = Measure.dirac y ↔ ∀ A, MeasurableSet A → (x ∈ A ↔ y ∈ A)

{α : Type u_1}
[MeasurableSpace α]
{x y : α}

MeasureTheory.Measure.dirac x = MeasureTheory.Measure.dirac y ↔ ∀ (A : Set α), MeasurableSet A → (x ∈ A ↔ y ∈ A)


/-- The **law of total probability** for a random variable taking finitely many values: a measure
`μ` can be expressed as a linear combination of its conditional measures `μ[|X ← x]` on fibers of a
random variable `X` valued in a fintype. -/
lemma sum_meas_smul_cond_fiber {X : Ω → α} (hX : Measurable X) (μ : Measure Ω) [IsFiniteMeasure μ] :
    ∑ x, μ (X ⁻¹' {x}) • μ[|X ← x] = μ

{Ω : Type u_1}
{α : Type u_3}
{m : MeasurableSpace Ω}
[Fintype α]
[MeasurableSpace α]
[DiscreteMeasurableSpace α]
{X : Ω → α}
(hX : Measurable X)
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

∑ x : α, μ (X ⁻¹' {x}) • ProbabilityTheory.cond μ (X ⁻¹' {x}) = μ


@[simp]
theorem not_irreducible_zero [MonoidWithZero α] : ¬Irreducible (0 : α)


protected theorem ext_iff {e e' : PartialHomeomorph X Y} :
    e = e' ↔ (∀ x, e x = e' x) ∧ (∀ x, e.symm x = e'.symm x) ∧ e.source = e'.source

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e e' : PartialHomeomorph X Y}

e = e' ↔ (∀ (x : X), ↑e x = ↑e' x) ∧ (∀ (x : Y), ↑e.symm x = ↑e'.symm x) ∧ e.source = e'.source


@[simp]
theorem injective_frobenius : Injective (frobenius R p)

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]


theorem absNorm_eq_zero_iff {I : Ideal S} : Ideal.absNorm I = 0 ↔ I = ⊥

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
[Module.Finite ℤ S]
{I : Ideal S}


/-- The continuous homomorphism given by multiplication. -/
@[to_additive (attr := simps!) "The continuous homomorphism given by addition."]
def mul : ContinuousMonoidHom (E × E) E

(E : Type u_6)
[CommGroup E]
[TopologicalSpace E]
[TopologicalGroup E]

∀ (a : E × E), (ContinuousMonoidHom.mul E) a = a.1 * a.2


/-- `orthogonal` reverses the `≤` ordering of two
subspaces. -/
theorem orthogonal_le {K₁ K₂ : Submodule 𝕜 E} (h : K₁ ≤ K₂) : K₂ᗮ ≤ K₁ᗮ

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K₁ K₂ : Submodule 𝕜 E}
(h : K₁ ≤ K₂)


@[simp]
theorem stdBasis_same (i : ι) (b : φ i) : stdBasis R φ i b i = b

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
(i : ι)
(b : φ i)


@[to_additive (attr := simp)] theorem MonoidHom.id_grp_comp
    {G : Type u} [Group G] {H : Grp.{u}} (f : G →* H) : MonoidHom.comp (𝟙 H) f = f

{G : Type u}
[AddGroup G]
{H : AddGrp}
(f : G →+ ↑H)


/-- A ring `R` is isomorphic to `S × R` when `S` is the zero ring -/
@[simps]
def zeroRingProd : R ≃+* S × R

(R : Type u_3)
(S : Type u_5)
[NonAssocSemiring R]
[NonAssocSemiring S]
[Subsingleton S]
(x : R)


@[to_additive] lemma prod_eq_one (hl : ∀ x ∈ l, x = 1) : l.prod = 1

{M : Type u_4}
[Monoid M]
{l : List M}
(hl : ∀ x ∈ l, x = 1)


protected theorem compare_eq_eq {a b : Nat} : compare a b = .eq ↔ a = b


@[simp]
theorem upperBounds_lowerClosure : upperBounds (lowerClosure s : Set α) = upperBounds s

upperBounds ↑(lowerClosure s) = upperBounds s


theorem unmop_injective : Function.Injective (unmop : Cᴹᵒᵖ → C)


protected theorem add_lt_add_of_le_of_lt {a b c d : Nat} (hle : a ≤ b) (hlt : c < d) :
    a + c < b + d


theorem natAbs_norm_eq (x : ℤ[i]) :
    x.norm.natAbs = x.re.natAbs * x.re.natAbs + x.im.natAbs * x.im.natAbs

(Zsqrtd.norm x).natAbs = x.re.natAbs * x.re.natAbs + x.im.natAbs * x.im.natAbs


theorem cases_tail : ReflTransGen r a b → b = a ∨ ∃ c, ReflTransGen r a c ∧ r c b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}

Relation.ReflTransGen r a b → b = a ∨ ∃ c, Relation.ReflTransGen r a c ∧ r c b


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

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


@[simp]
theorem snd_comp_quotientMulEquivQuotientProd (I J : Ideal R) (coprime : IsCoprime I J) :
    (RingHom.snd _ _).comp
        (quotientMulEquivQuotientProd I J coprime : R ⧸ I * J →+* (R ⧸ I) × R ⧸ J) =
      Ideal.Quotient.factor (I * J) J mul_le_left

{R : Type u}
[CommRing R]
(I J : Ideal R)
(coprime : IsCoprime I J)

(RingHom.snd (R ⧸ I) (R ⧸ J)).comp ↑(I.quotientMulEquivQuotientProd J coprime) = Ideal.Quotient.factor (I * J) J ⋯


theorem RingHom.IsIntegral.to_finite (h : f.IsIntegral) (h' : f.FiniteType) : f.Finite

{R : Type u_1}
{S : Type u_4}
[CommRing R]
[CommRing S]
{f : R →+* S}
(h : f.IsIntegral)
(h' : f.FiniteType)


@[reassoc]
lemma map₂_leftUnitor_hom {a b : B} (f : a ⟶ b) :
    (λ_ (F.map f)).hom = F.mapId a ▷ F.map f ≫ F.mapComp (𝟙 a) f ≫ F.map₂ (λ_ f).hom

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.LaxFunctor B C)
{a b : B}
(f : a ⟶ b)

(CategoryTheory.Bicategory.leftUnitor (F.map f)).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapId a) (F.map f))
    (CategoryTheory.CategoryStruct.comp (F.mapComp (CategoryTheory.CategoryStruct.id a) f)
      (F.map₂ (CategoryTheory.Bicategory.leftUnitor f).hom))


theorem trinomial_trailing_coeff' (hkm : k < m) (hmn : m < n) :
    (trinomial k m n u v w).coeff k = u

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

(Polynomial.trinomial k m n u v w).coeff k = u


theorem MonovaryOn.comp_antitone_on_left (h : MonovaryOn f g s) (hf : Antitone f') :
    AntivaryOn (f' ∘ f) g s

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


theorem pow_lt_one_iff_of_nonneg (ha : 0 ≤ a) (hn : n ≠ 0) : a ^ n < 1 ↔ a < 1

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
(ha : 0 ≤ a)
(hn : n ≠ 0)


theorem conjTranspose_circulant [Star α] [AddGroup n] (v : n → α) :
    (circulant v)ᴴ = circulant (star fun i => v (-i))

{α : Type u_1}
{n : Type u_4}
[Star α]
[AddGroup n]
(v : n → α)

(Matrix.circulant v).conjTranspose = Matrix.circulant (star fun i => v (-i))


@[to_additive]
theorem mrange_inr' : mrange (inr M N) = comap (fst M N) ⊥

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]

MonoidHom.mrange (MonoidHom.inr M N) = Submonoid.comap (MonoidHom.fst M N) ⊥


@[simp, norm_cast] lemma coe_mul (ψ χ : AddChar A M) : ⇑(ψ * χ) = ψ * χ

{A : Type u_1}
{M : Type u_2}
[AddMonoid A]
[CommMonoid M]
(ψ χ : AddChar A M)

⇑(ψ * χ) = ⇑ψ * ⇑χ


theorem get_extract_loop_lt (as bs : Array α) (size start : Nat) (hlt : i < bs.size)
    (h := get_extract_loop_lt_aux as bs size start hlt) :
    (extract.loop as size start bs)[i] = bs[i]

(h : i < (Array.extract.loop as size start bs).size := ⋯)

(Array.extract.loop as size start bs)[i] = bs[i]


theorem IsMaximal.isCoatom (_ : IsMaximal I) : IsCoatom I

{P : Type u_1}
[LE P]
[IsDirected P fun x x_1 => x ≤ x_1]
[Nonempty P]
{I : Order.Ideal P}


theorem nonempty (μ : ProbabilityMeasure Ω) : Nonempty Ω

(μ : MeasureTheory.ProbabilityMeasure Ω)


@[to_additive]
theorem norm_le_norm_add_norm_div (u v : E) : ‖v‖ ≤ ‖u‖ + ‖u / v‖

{E : Type u_6}
[SeminormedGroup E]
(u v : E)

‖v‖ ≤ ‖u‖ + ‖u / v‖


protected theorem continuousOn : ContinuousOn e e.source

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


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

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


/-- If `f ≤ g` and `g` is monotone, then `f^[n] ≤ g^[n]`. -/
theorem le_iterate_of_le {g : α → α} (hg : Monotone g) (h : f ≤ g) (n : ℕ) : f^[n] ≤ g^[n]

{α : Type u_1}
[Preorder α]
{f g : α → α}
(hg : Monotone g)
(h : f ≤ g)
(n : ℕ)


theorem eLpNorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    eLpNorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal)

{α : Type u_1}
{G : Type u_4}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup G]
{s : Set α}
(c : G)
(p : ℝ≥0∞)

MeasureTheory.eLpNorm (s.indicator fun x => c) p μ ≤ ↑‖c‖₊ * μ s ^ (1 / p.toReal)


theorem withSeminorms_iInf {κ : ι → Type*} [Nonempty ((i : ι) × κ i)] [∀ i, Nonempty (κ i)]
    {p : (i : ι) → SeminormFamily 𝕜 E (κ i)} {t : ι → TopologicalSpace E}
    [∀ i, @TopologicalAddGroup E (t i) _] (hp : ∀ i, WithSeminorms (topology := t i) (p i)) :
    WithSeminorms (topology := ⨅ i, t i) (SeminormFamily.sigma p)


theorem normalClosure_eq_iSup_adjoin' [ne : Nonempty (K →ₐ[F] L)] [h : Normal F L] :
    normalClosure F K L = ⨆ x : K, adjoin F ((minpoly F x).rootSet L)

(F : Type u_1)
(K : Type u_2)
(L : Type u_3)
[Field F]
[Field K]
[Field L]
[Algebra F K]
[Algebra F L]
[ne : Nonempty (K →ₐ[F] L)]
[h : Normal F L]

normalClosure F K L = ⨆ x, IntermediateField.adjoin F ((minpoly F x).rootSet L)


@[to_additive]
theorem subset_interior_mul_right : s * interior t ⊆ interior (s * t)

{α : Type u}
[TopologicalSpace α]
[Group α]
[ContinuousConstSMul α α]
{s t : Set α}


theorem mod_eq_sub_mul_div {R : Type*} [EuclideanDomain R] (a b : R) : a % b = a - b * (a / b)

{R : Type u_1}
[EuclideanDomain R]
(a b : R)


@[simp]
lemma inr_comp_binaryCoproductIso_hom :
    Limits.coprod.inr ≫ (binaryCoproductIso F G).hom = coprod.inr

(F G : CategoryTheory.Functor C (Type w))

CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.coprod.inr
    (CategoryTheory.FunctorToTypes.binaryCoproductIso F G).hom =
  CategoryTheory.FunctorToTypes.coprod.inr


theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      rwa [length_insertNth _ _ (by omega), Nat.succ_lt_succ_iff])) :
    (insertNth n x l).get ⟨n + k + 1, hk⟩ = get l ⟨n + k, hk'⟩

(hk : n + k + 1 < (List.insertNth n x l).length := ⋯)

(List.insertNth n x l).get ⟨n + k + 1, hk⟩ = l.get ⟨n + k, hk'⟩


lemma _root_.CovBy.exists_finset_insert (h : s ⋖ t) : ∃ a ∉ s, insert a s = t

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


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

(i : (SetTheory.PGame.nim 1).RightMoves)

SetTheory.PGame.toRightMovesNim.symm i = ⟨0, ⋯⟩


theorem cos_eq_iff_coe_eq_or_eq_neg {θ ψ : ℝ} :
    cos θ = cos ψ ↔ (θ : Angle) = ψ ∨ (θ : Angle) = -ψ

Real.cos θ = Real.cos ψ ↔ ↑θ = ↑ψ ∨ ↑θ = -↑ψ


protected theorem add_right_cancel' (c : ℕ) (h : a + c ≡ b + c [MOD n]) : a ≡ b [MOD n]

{n a b : ℕ}
(c : ℕ)
(h : a + c ≡ b + c [MOD n])


@[simp]
lemma d_map (a : A) : D.d (f a) = 0

{A B : CommRingCat}
{M : ModuleCat ↑B}
{f : A ⟶ B}
(D : M.Derivation f)
(a : ↑A)


@[to_additive (attr := simp)]
theorem mul_inv_cancel_left (a b : G) : a * (a⁻¹ * b) = b


theorem ack_ack_lt_ack_max_add_two (m n k : ℕ) : ack m (ack n k) < ack (max m n + 2) k


@[fun_prop]
theorem measurable_of_continuousOn_compl_singleton [T1Space α] {f : α → γ} (a : α)
    (hf : ContinuousOn f {a}ᶜ) : Measurable f

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[TopologicalSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
[T1Space α]
{f : α → γ}
(a : α)
(hf : ContinuousOn f {a}ᶜ)


theorem Indep.subset (hJ : M.Indep J) (hIJ : I ⊆ J) : M.Indep I

{α : Type u_1}
{M : Matroid α}
{I J : Set α}
(hJ : M.Indep J)
(hIJ : I ⊆ J)


theorem of_nat_add (m : ℕ) (h : Irrational (m + x)) : Irrational x

{x : ℝ}
(m : ℕ)
(h : Irrational (↑m + x))


private theorem norm_deriv_eq : ‖F.derivative.eval ncs.lim‖ = ‖F.derivative.eval a‖

(ncs_der_val :
  ∀ (n : ℕ), ‖Polynomial.eval (↑ncs n) (Polynomial.derivative F)‖ = ‖Polynomial.eval a (Polynomial.derivative F)‖)

‖Polynomial.eval ncs.lim (Polynomial.derivative F)‖ = ‖Polynomial.eval a (Polynomial.derivative F)‖


theorem Iic_succ (a : α) : Iic (succ a) = insert (succ a) (Iic a)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
(a : α)

Set.Iic (Order.succ a) = insert (Order.succ a) (Set.Iic a)


@[deprecated Subarray.start_le_stop (since := "2024-04-13")]
theorem Subarray.h₁ (s : Subarray α) : s.start ≤ s.stop


@[simp]
theorem integral_indicator_const [CompleteSpace E] (e : E) ⦃s : Set X⦄ (s_meas : MeasurableSet s) :
    ∫ x : X, s.indicator (fun _ : X => e) x ∂μ = (μ s).toReal • e

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure X}
[CompleteSpace E]
(e : E)
⦃s : Set X⦄
(s_meas : MeasurableSet s)

∫ (x : X), s.indicator (fun x => e) x ∂μ = (μ s).toReal • e


@[simp] theorem nhdsSet_Ioi : 𝓝ˢ (Ioi a) = 𝓟 (Ioi a)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a : α}


theorem trans_single_of_mem {a : α} {b : β} (c : γ) {f : α ≃. β} (h : b ∈ f a) :
    f.trans (single b c) = single a c

{α : Type u}
{β : Type v}
{γ : Type w}
[DecidableEq α]
[DecidableEq β]
[DecidableEq γ]
{a : α}
{b : β}
(c : γ)
{f : α ≃. β}
(h : b ∈ f a)

f.trans (PEquiv.single b c) = PEquiv.single a c


/-- The position of the Monge point in relation to the circumcenter
and centroid. -/
theorem mongePoint_eq_smul_vsub_vadd_circumcenter {n : ℕ} (s : Simplex ℝ P n) :
    s.mongePoint =
      (((n + 1 : ℕ) : ℝ) / ((n - 1 : ℕ) : ℝ)) •
          ((univ : Finset (Fin (n + 1))).centroid ℝ s.points -ᵥ s.circumcenter) +ᵥ
        s.circumcenter

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

s.mongePoint = (↑(n + 1) / ↑(n - 1)) • (Finset.centroid ℝ Finset.univ s.points -ᵥ s.circumcenter) +ᵥ s.circumcenter


theorem set_support_mul_subset : { x | (p * q) x ≠ x } ⊆ { x | p x ≠ x } ∪ { x | q x ≠ x }

{x | (p * q) x ≠ x} ⊆ {x | p x ≠ x} ∪ {x | q x ≠ x}


/-- `val_v(I) = 0` for all but finitely many maximal ideals of `R`. -/
theorem finite_factors (I : FractionalIdeal R⁰ K) :
    ∀ᶠ v : HeightOneSpectrum R in Filter.cofinite, count K v I = 0

{R : Type u_1}
[CommRing R]
{K : Type u_2}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDedekindDomain R]
(I : FractionalIdeal R⁰ K)

∀ᶠ (v : IsDedekindDomain.HeightOneSpectrum R) in Filter.cofinite, FractionalIdeal.count K v I = 0


/-- If `e : S₁ ≅ S₂` is an isomorphism of short complexes and `h₁ : HomologyData S₁`,
this is the homology data for `S₂` deduced from the isomorphism. -/
@[simps!]
noncomputable def ofIso (e : S₁ ≅ S₂) (h : HomologyData S₁)

(CategoryTheory.ShortComplex.HomologyData.ofIso e h).right.p =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.inv e.hom.τ₂) h.right.p


theorem omegaLimit_inter : ω f ϕ (s₁ ∩ s₂) ⊆ ω f ϕ s₁ ∩ ω f ϕ s₂

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
(f : Filter τ)
(ϕ : τ → α → β)
(s₁ s₂ : Set α)

omegaLimit f ϕ (s₁ ∩ s₂) ⊆ omegaLimit f ϕ s₁ ∩ omegaLimit f ϕ s₂


@[simp]
theorem eventuallyEq_univ {s : Set α} {l : Filter α} : s =ᶠ[l] univ ↔ s ∈ l


theorem ne_zero_of_b_ne_zero (hb : P.b ≠ 0) : P.toPoly ≠ 0

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(hb : P.b ≠ 0)


/--
The rule set used by an Aesop tactic call. A local rule set is produced by
combining several global rule sets and possibly adding or erasing some
individual rules.
-/
structure LocalRuleSet extends BaseRuleSet where
  /--
  The simp theorems used by the builtin norm simp rule.
  -/
  simpTheoremsArray : Array (Name × SimpTheorems)
  /--
  The simp theorems array must contain at least one `SimpTheorems` structure.
  When a simp theorem is added to a `LocalRuleSet`, it is stored in this first
  `SimpTheorems` structure.
  -/
  simpTheoremsArrayNonempty : 0 < simpTheoremsArray.size
  /--
  The simprocs used by the builtin norm simp rule.
  -/
  simprocsArray : Array (Name × Simprocs)
  /--
  The simprocs array must contain at least one `Simprocs` structure, for the
  same reason as above.
  -/
  simprocsArrayNonempty : 0 < simprocsArray.size
  /--
  FVars that were explicitly added as simp rules.
  -/
  localNormSimpRules : Array LocalNormSimpRule


theorem tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe :
    TendstoLocallyUniformlyOn F f p s ↔
      TendstoLocallyUniformly (fun i (x : s) => F i x) (f ∘ (↑)) p

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

TendstoLocallyUniformlyOn F f p s ↔ TendstoLocallyUniformly (fun i x => F i ↑x) (f ∘ Subtype.val) p


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


theorem isEquivalent_of_tendsto_one (hz : ∀ᶠ x in l, v x = 0 → u x = 0)
    (huv : Tendsto (u / v) l (𝓝 1)) : u ~[l] v

(hz : ∀ᶠ (x : α) in l, v x = 0 → u x = 0)

(huv : Filter.Tendsto (u / v) l (nhds 1))


@[simp]
theorem coe_copy (f : α →o β) (f' : α → β) (h : f' = f) : (f.copy f' h) = f'

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


theorem integral_Icc_eq_integral_Ioc' (hx : μ {x} = 0) :
    ∫ t in Icc x y, f t ∂μ = ∫ t in Ioc x y, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x y : X}
(hx : μ {x} = 0)

∫ (t : X) in Set.Icc x y, f t ∂μ = ∫ (t : X) in Set.Ioc x y, f t ∂μ


@[simp]
theorem coe_copy (f : CompleteLatticeHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

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


theorem summable_matrix_blockDiagonal' [DecidableEq l] {f : X → ∀ i, Matrix (m' i) (n' i) R} :
    (Summable fun x => blockDiagonal' (f x)) ↔ Summable f

{f : X → (i : l) → Matrix (m' i) (n' i) R}

(Summable fun x => Matrix.blockDiagonal' (f x)) ↔ Summable f


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

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

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


theorem leftInverse_symm (e : A ≃⋆+* B) : Function.LeftInverse e.symm e

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
(e : A ≃⋆+* B)


protected lemma map_smul (x : R[X]) (y : W.CoordinateRing) :
    map W f (x • y) = x.map f • map W f y

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
{W : WeierstrassCurve.Affine R}
(f : R →+* S)
(x : R[X])
(y : W.CoordinateRing)

(WeierstrassCurve.Affine.CoordinateRing.map W f) (x • y) =
  Polynomial.map f x • (WeierstrassCurve.Affine.CoordinateRing.map W f) y


protected theorem mul_div_cancel' (h0 : a ≠ 0) (hI : a ≠ ∞) : a * (b / a) = b

{a b : ENNReal}
(h0 : a ≠ 0)
(hI : a ≠ ⊤)


@[to_additive prod_mono]
theorem prod_mono {s₁ s₂ : Submonoid M} {t₁ t₂ : Submonoid N} (hs : s₁ ≤ s₂) (ht : t₁ ≤ t₂) :
    s₁.prod t₁ ≤ s₂.prod t₂

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{s₁ s₂ : AddSubmonoid M}
{t₁ t₂ : AddSubmonoid N}
(hs : s₁ ≤ s₂)
(ht : t₁ ≤ t₂)


@[fun_prop]
theorem DifferentiableAt.comp_differentiableWithinAt {g : F → G} (hg : DifferentiableAt 𝕜 g (f x))
    (hf : DifferentiableWithinAt 𝕜 f s x) : DifferentiableWithinAt 𝕜 (g ∘ f) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F}
(x : E)
{s : Set E}
{g : F → G}
(hg : DifferentiableAt 𝕜 g (f x))
(hf : DifferentiableWithinAt 𝕜 f s x)


theorem iterate_derivative_X_add_pow (n k : ℕ) (c : R) :
    derivative^[k] ((X + C c) ^ n) = Nat.descFactorial n k • (X + C c) ^ (n - k)

{R : Type u}
[CommSemiring R]
(n k : ℕ)
(c : R)

(⇑Polynomial.derivative)^[k] ((Polynomial.X + Polynomial.C c) ^ n) =
  n.descFactorial k • (Polynomial.X + Polynomial.C c) ^ (n - k)


theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
    Embedding (s.restrictPreimage f)

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


@[simp] lemma ofIsLimitKernelFork_g' (hf : S.f = 0) (c : KernelFork S.g)
    (hc : IsLimit c) : (ofIsLimitKernelFork S hf c hc).g' = S.g

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.RightHomologyData.ofIsLimitKernelFork S hf c hc).g' = S.g


/--
The light condensed object associated to a presheaf on `LightProfinite` whose postcomposition with
the forgetful functor preserves finite products and satisfies the equalizer condition.
-/
@[simps]
noncomputable def ofSheafForgetLightProfinite
    [ConcreteCategory A] [ReflectsFiniteLimits (CategoryTheory.forget A)]
    (F : LightProfinite.{u}ᵒᵖ ⥤ A) [PreservesFiniteProducts (F ⋙ CategoryTheory.forget A)]
    (hF : EqualizerCondition (F ⋙ CategoryTheory.forget A)) : LightCondensed A

[CategoryTheory.Limits.PreservesFiniteProducts (F ⋙ CategoryTheory.forget A)]

(hF : CategoryTheory.regularTopology.EqualizerCondition (F ⋙ CategoryTheory.forget A))

(LightCondensed.ofSheafForgetLightProfinite F hF).val = F


@[to_additive (attr := simp, norm_cast)]
theorem coe_top : ((⊤ : OpenSubgroup G) : Set G) = Set.univ

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]


protected theorem lipschitz : LipschitzWith v.C f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f : v.FunSpace)


@[to_additive (attr := simp) Even.zsmul']
lemma Even.isSquare_zpow [Group α] {n : ℤ} : Even n → ∀ a : α, IsSquare (a ^ n)


theorem set_biUnion_insert (a : α) (s : Finset α) (t : α → Set β) :
    ⋃ x ∈ insert a s, t x = t a ∪ ⋃ x ∈ s, t x

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
(a : α)
(s : Finset α)
(t : α → Set β)


theorem biproduct.map_eq [HasFiniteBiproducts C] {f g : J → C} {h : ∀ j, f j ⟶ g j} :
    biproduct.map h = ∑ j : J, biproduct.π f j ≫ h j ≫ biproduct.ι g j

CategoryTheory.Limits.biproduct.map h =
  ∑ j : J, CategoryTheory.Limits.biproduct.π f j ≫ h j ≫ CategoryTheory.Limits.biproduct.ι g j


theorem cos_add (θ₁ θ₂ : Real.Angle) : cos (θ₁ + θ₂) = cos θ₁ * cos θ₂ - sin θ₁ * sin θ₂

(θ₁ + θ₂).cos = θ₁.cos * θ₂.cos - θ₁.sin * θ₂.sin


theorem balanced_iUnion {f : ι → Set E} (h : ∀ i, Balanced 𝕜 (f i)) : Balanced 𝕜 (⋃ i, f i)

{𝕜 : Type u_1}
{E : Type u_3}
{ι : Sort u_4}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
{f : ι → Set E}
(h : ∀ (i : ι), Balanced 𝕜 (f i))


/-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/
protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] :
    Module.Finite A B

(S : Set ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]
[IsDomain B]
[h₁ : Finite ↑S]
[h₂ : IsCyclotomicExtension S A B]


@[trans]
theorem lt_of_le_of_lt : ∀ {a b c : α}, a ≤ b → b < c → a < c


@[simp]
theorem type_out (o : Ordinal) : Ordinal.type o.out.r = o


theorem map_sub_le {x y g} (hx : v x ≤ g) (hy : v y ≤ g) : v (x - y) ≤ g

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


@[simp]
theorem nondegenerate_toMatrix₂'_iff {B : (ι → R₁) →ₗ[R₁] (ι → R₁) →ₗ[R₁] R₁} :
    (LinearMap.toMatrix₂' R₁ B).Nondegenerate ↔ B.SeparatingLeft

((LinearMap.toMatrix₂' R₁) B).Nondegenerate ↔ B.SeparatingLeft


lemma gc_floorDiv_mul (ha : 0 < a) : GaloisConnection (a * ·) (· ⌊/⌋ a)

{α : Type u_2}
[OrderedSemiring α]
[FloorDiv α α]
{a : α}
(ha : 0 < a)

GaloisConnection (fun x => a * x) fun x => x ⌊/⌋ a


@[simp]
theorem of_natCast (n : ℕ) : of A 0 n = n

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


/-- A `StrongFEPair` structure with `f = oddKernel a` and `g = sinKernel a`. -/
@[simps]
def hurwitzOddFEPair (a : UnitAddCircle) : StrongFEPair ℂ


@[reassoc (attr := simp)]
theorem factorThru_comp {P X E : C} [Projective P] (f : P ⟶ X) (e : E ⟶ X) [Epi e] :
    factorThru f e ≫ e = f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P X E : C}
[CategoryTheory.Projective P]
(f : P ⟶ X)
(e : E ⟶ X)
[CategoryTheory.Epi e]

CategoryTheory.Projective.factorThru f e ≫ e = f


theorem get?_add (s : WSeq α) (m n) : get? s (m + n) = get? (drop s m) n

{α : Type u}
(s : Stream'.WSeq α)
(m n : ℕ)


/-- If `CommMonoid` homs `g : M →* P, l : P →* A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`. -/
@[to_additive
    "If `AddCommMonoid` homs `g : M →+ P, l : P →+ A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`."]
theorem map_comp_map {A : Type*} [CommMonoid A] {U : Submonoid A} {R} [CommMonoid R]
    (j : LocalizationMap U R) {l : P →* A} (hl : ∀ w : T, l w ∈ U) :
    (k.map hl j).comp (f.map hy k) =
    f.map (fun x ↦ show l.comp g x ∈ U from hl ⟨g x, hy x⟩) j

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{g : M →+ P}
{T : AddSubmonoid P}
(hy : ∀ (y : ↥S), g ↑y ∈ T)
{Q : Type u_4}
[AddCommMonoid Q]
{k : T.LocalizationMap Q}
{A : Type u_5}
[AddCommMonoid A]
{U : AddSubmonoid A}
{R : Type u_6}
[AddCommMonoid R]
(j : U.LocalizationMap R)
{l : P →+ A}
(hl : ∀ (w : ↥T), l ↑w ∈ U)

(k.map hl j).comp (f.map hy k) = f.map ⋯ j


@[simp]
theorem blockDiagonal'_transpose (M : ∀ i, Matrix (m' i) (n' i) α) :
    (blockDiagonal' M)ᵀ = blockDiagonal' fun k => (M k)ᵀ

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

(Matrix.blockDiagonal' M)ᵀ = Matrix.blockDiagonal' fun k => (M k)ᵀ


@[simp]
theorem mk_smul_addMonoidHom_apply (c : M) (f : A →+ B) (a : A) : (mk c • f) a = f (c • a)

{A : Type u_5}
{B : Type u_6}
{M : Type u_7}
[AddMonoid A]
[DistribSMul M A]
[AddZeroClass B]
(c : M)
(f : A →+ B)
(a : A)


/-- The `Subsemiring` generated by a multiplicative submonoid coincides with the
`Subsemiring.closure` of the submonoid itself . -/
theorem subsemiringClosure_eq_closure : M.subsemiringClosure = Subsemiring.closure (M : Set R)

{R : Type u}
[NonAssocSemiring R]
(M : Submonoid R)

M.subsemiringClosure = Subsemiring.closure ↑M


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


theorem offDiag_union (h : Disjoint s t) :
    (s ∪ t).offDiag = s.offDiag ∪ t.offDiag ∪ s ×ˢ t ∪ t ×ˢ s

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


/-- The category of sheaves taking values in `A` on a grothendieck topology. -/
structure Sheaf where
  /-- the underlying presheaf -/
  val : Cᵒᵖ ⥤ A
  /-- the condition that the presheaf is a sheaf -/
  cond : Presheaf.IsSheaf J val

{J : CategoryTheory.GrothendieckTopology C}


@[simp]
protected theorem ofNat (n : ℕ) [n.AtLeastTwo] :
    IsSelfAdjoint (no_index (OfNat.ofNat n : R))

{R : Type u_1}
[Semiring R]
[StarRing R]
(n : ℕ)
[n.AtLeastTwo]


/-- The identity natural transformation is a based natural isomorphism. -/
@[simps]
def id (F : 𝒳 ⥤ᵇ 𝒴) : F ≅ F

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
{𝒳 : CategoryTheory.BasedCategory 𝒮}
{𝒴 : CategoryTheory.BasedCategory 𝒮}
(F : CategoryTheory.BasedFunctor 𝒳 𝒴)

(CategoryTheory.BasedNatIso.id F).inv = CategoryTheory.CategoryStruct.id F


@[simp] lemma mk_nnratCast (q : ℚ≥0) : (⟨q, q.cast_nonneg⟩ : {x : α // 0 ≤ x}) = q

{α : Type u_1}
[LinearOrderedSemifield α]
(q : ℚ≥0)

⟨↑q, ⋯⟩ = ↑q


protected theorem of_injective [Small.{v} R] (inj : Module.Injective R Q) : Module.Baer R Q

{R : Type u}
[Ring R]
{Q : Type v}
[AddCommGroup Q]
[Module R Q]
[Small.{v, u} R]
(inj : Module.Injective R Q)


@[simp]
theorem clog_zero_right (b : ℕ) : clog b (0 : R) = 0

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
(b : ℕ)


/-- When a function has a limit at infinity `l`, and its derivative is nonnegative, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg'`). Version assuming differentiability on `[a, +∞)`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonneg' (hderiv : ∀ x ∈ Ici a, HasDerivAt g (g' x) x)
    (g'pos : ∀ x ∈ Ioi a, 0 ≤ g' x) (hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a

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

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


/-- A complete type over a given theory in a certain type of variables is a maximally
  consistent (with the theory) set of formulas in that type. -/
structure CompleteType where
  toTheory : L[[α]].Theory
  subset' : (L.lhomWithConstants α).onTheory T ⊆ toTheory
  isMaximal' : toTheory.IsMaximal

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(self : T.CompleteType α)


@[simp]
theorem Matrix.toBilin_apply (M : Matrix n n R₂) (x y : M₂) :
    Matrix.toBilin b M x y = ∑ i, ∑ j, b.repr x i * M i j * b.repr y j

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(b : Basis n R₂ M₂)
(M : Matrix n n R₂)
(x y : M₂)

(((Matrix.toBilin b) M) x) y = ∑ i : n, ∑ j : n, (b.repr x) i * M i j * (b.repr y) j


/-- If a vector space has a basis indexed by elements of a finite set, then it is
finite-dimensional. -/
theorem of_finite_basis {ι : Type w} {s : Set ι} (h : Basis s K V) (hs : Set.Finite s) :
    FiniteDimensional K V

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{ι : Type w}
{s : Set ι}
(h : Basis (↑s) K V)
(hs : s.Finite)


@[simp]
theorem diag_map {X Y : C} (f : X ⟶ Y) : (diag C).map f = (f, f)

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

(CategoryTheory.Functor.diag C).map f = (f, f)


theorem Kernel.measure_zero_or_one_of_measurableSet_limsup_atTop (h_le : ∀ n, s n ≤ m0)
    (h_indep : iIndep s κ μα) {t : Set Ω} (ht_tail : MeasurableSet[limsup s atTop] t) :
    ∀ᵐ a ∂μα, κ a t = 0 ∨ κ a t = 1

(h_indep : ProbabilityTheory.Kernel.iIndep s κ μα)

∀ᵐ (a : α) ∂μα, (κ a) t = 0 ∨ (κ a) t = 1


@[to_additive (attr := simp) mem_nonneg] lemma mem_oneLE : a ∈ oneLE M ↔ 1 ≤ a

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


@[simps (config := .lemmasOnly)]
instance instMonoidalCategoryStruct : MonoidalCategoryStruct (ModuleCat.{u} R)

{R : Type u}
[CommRing R]
(M : ModuleCat R)

CategoryTheory.MonoidalCategory.leftUnitor M = ModuleCat.MonoidalCategory.leftUnitor M


@[simp]
theorem mk_eq_aleph0 (α : Type*) [Countable α] [Infinite α] : #α = ℵ₀

(α : Type u_1)
[Countable α]
[Infinite α]


theorem Eventually.eval_pi {i : ι} (hf : ∀ᶠ x : α i in f i, p i x) :
    ∀ᶠ x : ∀ i : ι, α i in pi f, p i (x i)

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
{p : (i : ι) → α i → Prop}
{i : ι}
(hf : ∀ᶠ (x : α i) in f i, p i x)

∀ᶠ (x : (i : ι) → α i) in Filter.pi f, p i (x i)


/-- An alternative statement of the Stone-Weierstrass theorem,
for those who like their epsilons and don't like bundled continuous functions.

If `A` is a subalgebra of `C(X, ℝ)` which separates points (and `X` is compact),
every real-valued continuous function on `X` is within any `ε > 0` of some element of `A`.
-/
theorem exists_mem_subalgebra_near_continuous_of_separatesPoints (A : Subalgebra ℝ C(X, ℝ))
    (w : A.SeparatesPoints) (f : X → ℝ) (c : Continuous f) (ε : ℝ) (pos : 0 < ε) :
    ∃ g : A, ∀ x, ‖(g : X → ℝ) x - f x‖ < ε

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(A : Subalgebra ℝ C(X, ℝ))
(w : A.SeparatesPoints)
(f : X → ℝ)
(c : Continuous f)
(ε : ℝ)
(pos : 0 < ε)


theorem length_pos_iff_exists_cons :
    ∀ {l : List α}, 0 < l.length ↔ ∃ h t, l = h :: t


/-- The application of a natural isomorphism to an object. We put this definition in a different
namespace, so that we can use `α.app` -/
@[simps]
def app {F G : C ⥤ D} (α : F ≅ G) (X : C) :
    F.obj X ≅ G.obj X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ D}
(α : F ≅ G)
(X : C)


theorem le_of_mul_le_of_one_le_of_nonneg_left [PosMulMono α] (h : a * b ≤ c) (hb : 1 ≤ b)
    (ha : 0 ≤ a) : a ≤ c

{α : Type u_1}
{a b c : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulMono α]
(h : a * b ≤ c)
(hb : 1 ≤ b)
(ha : 0 ≤ a)


theorem listTransvecRow_get (i : Fin (listTransvecRow M).length) :
    (listTransvecRow M).get i =
      letI i' := Fin.cast (length_listTransvecRow M) i
      transvection (inr unit) (inl i') <| -M (inr unit) (inl i') / M (inr unit) (inr unit)

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

(i : Fin (Matrix.Pivot.listTransvecRow M).length)

(Matrix.Pivot.listTransvecRow M).get i =
  Matrix.transvection (Sum.inr ()) (Sum.inl (Fin.cast ⋯ i))
    (-M (Sum.inr ()) (Sum.inl (Fin.cast ⋯ i)) / M (Sum.inr ()) (Sum.inr ()))


theorem coe_T_inv : ↑ₘT⁻¹ = !![1, -1; 0, 1]


/-- If the unique morphism from `A` to a terminal object is a monomorphism, `A` is subterminal.
The converse of `IsSubterminal.mono_isTerminal_from`.
-/
theorem isSubterminal_of_mono_isTerminal_from {T : C} (hT : IsTerminal T) [Mono (hT.from A)] :
    IsSubterminal A

(hT : CategoryTheory.Limits.IsTerminal T)


theorem mem_smul_pointwise_iff_exists (m : A) (a : α) (S : AddSubmonoid A) :
    m ∈ a • S ↔ ∃ s : A, s ∈ S ∧ a • s = m

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[Monoid α]
[DistribMulAction α A]
(m : A)
(a : α)
(S : AddSubmonoid A)


@[simp]
theorem dom_coe (f : α → β) : (f : α →. β).Dom = Set.univ

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


/-- `α ↪ β` is a bundled injective function. -/
structure Embedding (α : Sort*) (β : Sort*) where
  /-- An embedding as a function. Use coercion instead. -/
  toFun : α → β
  /-- An embedding is an injective function. Use `Function.Embedding.injective` instead. -/
  inj' : Injective toFun

{α : Sort u_1}
{β : Sort u_2}
(self : α ↪ β)


theorem le_floor_map_map_zero : ⌊f 0⌋ + ⌊g 0⌋ ≤ ⌊f (g 0)⌋


@[simp]
theorem inclusion_obj (X : N C) :
    inclusion.obj X = inclusionObj X.as

(X : (CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)

CategoryTheory.FreeMonoidalCategory.inclusion.obj X = CategoryTheory.FreeMonoidalCategory.inclusionObj X.as


/-- Given an open cover `{ Yᵢ }` of `Y`, then `X ×[Z] Y` is covered by `X ×[Z] Yᵢ`. -/
@[simps! J obj map]
def openCoverOfRight (𝒰 : OpenCover Y) (f : X ⟶ Z) (g : Y ⟶ Z) : OpenCover (pullback f g)

{X Y Z : AlgebraicGeometry.Scheme}
(𝒰 : Y.OpenCover)
(f : X ⟶ Z)
(g : Y ⟶ Z)
(i : 𝒰.J)

(AlgebraicGeometry.Scheme.Pullback.openCoverOfRight 𝒰 f g).map i =
  CategoryTheory.Limits.pullback.map f (𝒰.map i ≫ g) f g (𝟙 X) (𝒰.map i) (𝟙 Z) ⋯ ⋯


theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x)

{F : Type u → Type u}
[q : QPF F]
{α : Type u}
(g : F α → α)
(x : F (QPF.Fix F))

QPF.Fix.rec g (QPF.Fix.mk x) = g (QPF.Fix.rec g <$> x)


@[simp]
theorem neg_modEq_neg : -a ≡ -b [PMOD p] ↔ a ≡ b [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b : α}


@[to_additive]
theorem isClosed_mulTSupport (f : X → α) : IsClosed (mulTSupport f)

{X : Type u_1}
{α : Type u_2}
[Zero α]
[TopologicalSpace X]
(f : X → α)


theorem blocksFun_mem_blocks (i : Fin c.length) : c.blocksFun i ∈ c.blocks

{n : ℕ}
(c : Composition n)
(i : Fin c.length)


@[to_additive]
theorem Submonoid.FG.map_injective {M' : Type*} [Monoid M'] {P : Submonoid M} (e : M →* M')
    (he : Function.Injective e) (h : (P.map e).FG) : P.FG

{M : Type u_1}
[Monoid M]
{M' : Type u_3}
[Monoid M']
{P : Submonoid M}
(e : M →* M')
(he : Function.Injective ⇑e)
(h : (Submonoid.map e P).FG)


theorem finrank_eq_nat_card_basis (h : Basis ι R M) :
    finrank R M = Nat.card ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{ι : Type w}
[StrongRankCondition R]
(h : Basis ι R M)

FiniteDimensional.finrank R M = Nat.card ι


theorem _root_.IsCompact.exists_infDist_eq_dist (h : IsCompact s) (hne : s.Nonempty) (x : α) :
    ∃ y ∈ s, infDist x s = dist x y

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(h : IsCompact s)
(hne : s.Nonempty)
(x : α)


@[simp]
theorem image_id' [DecidableEq α] : (s.image fun x => x) = s

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


/-- Conditioning first on `s` and then on `t` results in the same measure as conditioning
on `s ∩ t`. -/
theorem cond_cond_eq_cond_inter [IsFiniteMeasure μ] (hms : MeasurableSet s)
    (hmt : MeasurableSet t) : μ[|s][|t] = μ[|s ∩ t]

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s t : Set Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hms : MeasurableSet s)
(hmt : MeasurableSet t)

ProbabilityTheory.cond (ProbabilityTheory.cond μ s) t = ProbabilityTheory.cond μ (s ∩ t)


@[simp]
theorem mem {n m l : ℕ} : l ∈ Ico n m ↔ n ≤ l ∧ l < m


@[simp]
lemma prod_eq_zero_iff : f.prod g = 0 ↔ ∃ i ∈ f.support, g i (f i) = 0

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
[CommMonoidWithZero γ]
[Nontrivial γ]
[NoZeroDivisors γ]
[(i : ι) → DecidableEq (β i)]
{f : Π₀ (i : ι), β i}
{g : (i : ι) → β i → γ}


theorem rnDeriv_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
    [t.HaveLebesgueDecomposition μ] [(s + t).HaveLebesgueDecomposition μ] :
    (s + t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ + t.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
(s t : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)
[s.HaveLebesgueDecomposition μ]
[t.HaveLebesgueDecomposition μ]
[(s + t).HaveLebesgueDecomposition μ]


/-- If the arguments are linearly dependent then the result is `0`. -/
theorem map_linearDependent {K : Type*} [Ring K] {M : Type*} [AddCommGroup M] [Module K M]
    {N : Type*} [AddCommGroup N] [Module K N] [NoZeroSMulDivisors K N] (f : M [⋀^ι]→ₗ[K] N)
    (v : ι → M) (h : ¬LinearIndependent K v) : f v = 0

{ι : Type u_7}
{K : Type u_12}
[Ring K]
{M : Type u_13}
[AddCommGroup M]
[Module K M]
{N : Type u_14}
[AddCommGroup N]
[Module K N]
[NoZeroSMulDivisors K N]
(f : M [⋀^ι]→ₗ[K] N)
(v : ι → M)
(h : ¬LinearIndependent K v)


theorem smul_map_volume_mul_right {a : ℝ} (h : a ≠ 0) :
    ENNReal.ofReal |a| • Measure.map (· * a) volume = volume

ENNReal.ofReal |a| • MeasureTheory.Measure.map (fun x => x * a) MeasureTheory.volume = MeasureTheory.volume


@[norm_cast] theorem ofNat_add (n m : Nat) : (↑(n + m) : Int) = n + m


theorem tendsto_add_one_pow_atTop_atTop_of_pos [LinearOrderedSemiring α] [Archimedean α] {r : α}
    (h : 0 < r) : Tendsto (fun n : ℕ ↦ (r + 1) ^ n) atTop atTop

{α : Type u_1}
[LinearOrderedSemiring α]
[Archimedean α]
{r : α}
(h : 0 < r)

Filter.Tendsto (fun n => (r + 1) ^ n) Filter.atTop Filter.atTop


/-- In a first-countable space, a cluster point `x` of a sequence
is the limit of some subsequence. -/
theorem tendsto_subseq [FirstCountableTopology α] {u : ℕ → α} {x : α}
    (hx : MapClusterPt x atTop u) : ∃ ψ : ℕ → ℕ, StrictMono ψ ∧ Tendsto (u ∘ ψ) atTop (𝓝 x)

{α : Type u}
[t : TopologicalSpace α]
[FirstCountableTopology α]
{u : ℕ → α}
{x : α}
(hx : MapClusterPt x Filter.atTop u)

∃ ψ, StrictMono ψ ∧ Filter.Tendsto (u ∘ ψ) Filter.atTop (𝓝 x)


@[simp]
theorem Surjective.of_comp_iff (f : α → β) {g : γ → α} (hg : Surjective g) :
    Surjective (f ∘ g) ↔ Surjective f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(f : α → β)
{g : γ → α}
(hg : Function.Surjective g)

Function.Surjective (f ∘ g) ↔ Function.Surjective f


theorem upperSemicontinuous_iInf {f : ι → α → δ} (h : ∀ i, UpperSemicontinuous (f i)) :
    UpperSemicontinuous fun x' => ⨅ i, f i x'

{f : ι → α → δ}

(h : ∀ (i : ι), UpperSemicontinuous (f i))


theorem map_filterMap_some_eq_filter_map_is_some (f : α → Option β) (l : List α) :
    (l.filterMap f).map some = (l.map f).filter fun b => b.isSome

{α : Type u_1}
{β : Type u_2}
(f : α → Option β)
(l : List α)

List.map some (List.filterMap f l) = List.filter (fun b => b.isSome) (List.map f l)


theorem min_order_le_order_add {Γ} [Zero Γ] [LinearOrder Γ] {x y : HahnSeries Γ R}
    (hxy : x + y ≠ 0) : min x.order y.order ≤ (x + y).order

{R : Type u_2}
[AddMonoid R]
{Γ : Type u_3}
[Zero Γ]
[LinearOrder Γ]
{x y : HahnSeries Γ R}
(hxy : x + y ≠ 0)


@[simp]
theorem flip_apply (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (m : M) (n : N) : flip f n m = f m n

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{R₂ : Type u_3}
[Semiring R₂]
{S₂ : Type u_4}
[Semiring S₂]
{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module S N]
[Module R₂ P]
[Module S₂ P]
[SMulCommClass S₂ R₂ P]
{ρ₁₂ : R →+* R₂}
{σ₁₂ : S →+* S₂}
(f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P)
(m : M)
(n : N)


theorem flag_le_ker_dual (b : Basis (Fin n) R M) (k : Fin n) :
    b.flag k.castSucc ≤ LinearMap.ker (b.dualBasis k)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{n : ℕ}
(b : Basis (Fin n) R M)
(k : Fin n)


theorem min_eq_inf_withTop (s : Finset α) : s.min = inf s (↑)

{α : Type u_2}
[LinearOrder α]
(s : Finset α)


theorem fst_openEmbedding_of_right_openEmbedding {X Y S : TopCat} (f : X ⟶ S) {g : Y ⟶ S}
    (H : OpenEmbedding g) : OpenEmbedding <| ⇑(pullback.fst f g)

{X Y S : TopCat}
(f : X ⟶ S)
{g : Y ⟶ S}
(H : OpenEmbedding ⇑g)

OpenEmbedding ⇑(CategoryTheory.Limits.pullback.fst f g)


theorem dist_pair_smul (x₁ x₂ : α) (y : β) : dist (x₁ • y) (x₂ • y) ≤ dist x₁ x₂ * dist y 0

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[Zero α]
[Zero β]
[SMul α β]
[BoundedSMul α β]
(x₁ x₂ : α)
(y : β)


private theorem eq_strictMono_iff_eq_range_aux {f g : β → γ} (hf : StrictMono f)
    (hg : StrictMono g) (hfg : Set.range f = Set.range g) {b : β} (H : ∀ a < b, f a = g a) :
    f b ≤ g b

{β : Type u_2}
{γ : Type u_3}
[LinearOrder β]
[PartialOrder γ]
{f g : β → γ}
(hf : StrictMono f)
(hg : StrictMono g)
(hfg : Set.range f = Set.range g)
{b : β}
(H : ∀ a < b, f a = g a)


@[to_additive]
protected theorem Finset.multipliable_compl_iff (s : Finset β) :
    (Multipliable fun x : { x // x ∉ s } ↦ f x) ↔ Multipliable f

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

(Multipliable fun x => f ↑x) ↔ Multipliable f


@[simp]
theorem ofOption_dom {α} : ∀ o : Option α, (ofOption o).Dom ↔ o.isSome


@[simp]
theorem reverse_reverse (s : Cycle α) : s.reverse.reverse = s


theorem polyOfInterest_vars (n : ℕ) : (polyOfInterest p n).vars ⊆ univ ×ˢ range (n + 1)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)

(WittVector.polyOfInterest p n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)


@[simp]
theorem map_inl_disjUnion_map_inr :
    (s.map Embedding.inl).disjUnion (t.map Embedding.inr) (disjoint_map_inl_map_inr _ _) =
      s.disjSum t

{α : Type u_1}
{β : Type u_2}
(s : Finset α)
(t : Finset β)

(Finset.map Function.Embedding.inl s).disjUnion (Finset.map Function.Embedding.inr t) ⋯ = s.disjSum t


@[simp]
theorem extentClosure_iUnion (f : ι → Set β) :
    extentClosure r (⋃ i, f i) = ⋂ i, extentClosure r (f i)

{ι : Sort u_1}
{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)
(f : ι → Set β)


theorem starConvex_iInter {ι : Sort*} {s : ι → Set E} (h : ∀ i, StarConvex 𝕜 x (s i)) :
    StarConvex 𝕜 x (⋂ i, s i)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{x : E}
{ι : Sort u_4}
{s : ι → Set E}
(h : ∀ (i : ι), StarConvex 𝕜 x (s i))


/-- Given a natural transformation `α : F.leftOp ⟶ G.leftOp`, for `F G : C ⥤ Dᵒᵖ`,
taking `op` of each component gives a natural transformation `G ⟶ F`.
-/
@[simps]
protected def removeLeftOp (α : F.leftOp ⟶ G.leftOp) : G ⟶ F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor C Dᵒᵖ}
(α : F.leftOp ⟶ G.leftOp)
(X : C)

(CategoryTheory.NatTrans.removeLeftOp α).app X = (α.app (Opposite.op X)).op


theorem subtype_Ioo_eq : Ioo a b = (Ioo (a : α) b).subtype p

{α : Type u_1}
[Preorder α]
(p : α → Prop)
[DecidablePred p]
[LocallyFiniteOrder α]
(a b : Subtype p)

Finset.Ioo a b = Finset.subtype p (Finset.Ioo ↑a ↑b)


theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f

{R : Type u_1}
[CommSemiring R]
(r : R)
(f : PowerSeries R)

(r • f).derivativeFun = r • f.derivativeFun


lemma chromaticNumber_eq_card_iff_forall_surjective [Fintype α] (hG : G.Colorable (card α)) :
    G.chromaticNumber = card α ↔ ∀ C : G.Coloring α, Surjective C

{V : Type u}
{G : SimpleGraph V}
{α : Type u_1}
[Fintype α]
(hG : G.Colorable (Fintype.card α))

G.chromaticNumber = ↑(Fintype.card α) ↔ ∀ (C : G.Coloring α), Function.Surjective ⇑C


/-- A left homology data for a short complex `S` in the opposite category
induces a right homology data for `S.unop`. -/
@[simps]
def unop {S : ShortComplex Cᵒᵖ} (h : S.LeftHomologyData) : S.unop.RightHomologyData


/-- If `R` is a ring, then prime ideals in the localization at `M`
correspond to prime ideals in the original ring `R` that are disjoint from `M`.
This lemma gives the particular case for an ideal and its map,
see `le_rel_iso_of_prime` for the more general relation isomorphism, and the reverse implication -/
theorem isPrime_of_isPrime_disjoint (I : Ideal R) (hp : I.IsPrime) (hd : Disjoint (M : Set R) ↑I) :
    (Ideal.map (algebraMap R S) I).IsPrime

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(I : Ideal R)
(hp : I.IsPrime)
(hd : Disjoint ↑M ↑I)


theorem nonneg (x : ℝ) : 0 ≤ smoothTransition x


@[simp]
theorem sum_affineCombinationLineMapWeights [DecidableEq ι] {i j : ι} (hi : i ∈ s) (hj : j ∈ s)
    (c : k) : ∑ t ∈ s, affineCombinationLineMapWeights i j c t = 1

{k : Type u_1}
[Ring k]
{ι : Type u_4}
(s : Finset ι)
[DecidableEq ι]
{i j : ι}
(hi : i ∈ s)
(hj : j ∈ s)
(c : k)

∑ t ∈ s, Finset.affineCombinationLineMapWeights i j c t = 1


/-- The **multinomial theorem**. -/
theorem sum_pow_of_commute [Semiring R] (x : α → R) (s : Finset α)
    (hc : (s : Set α).Pairwise fun i j => Commute (x i) (x j)) :
    ∀ n,
      s.sum x ^ n =
        ∑ k : s.sym n,
          k.1.1.multinomial *
            (k.1.1.map <| x).noncommProd
              (Multiset.map_set_pairwise <| hc.mono <| mem_sym_iff.1 k.2)

(hc : (↑s).Pairwise fun i j => Commute (x i) (x j))

s.sum x ^ n = ∑ k : { x // x ∈ s.sym n }, ↑(↑↑k).multinomial * (Multiset.map x ↑↑k).noncommProd ⋯


lemma one_lt_of_mem_properDivisors {m n : ℕ} (h : m ∈ n.properDivisors) : 1 < n


lemma natCast_injective : Injective (Nat.cast : ℕ → ℚ)


@[simp, mfld_simps]
theorem trivializationAt_target (x : M) :
    (trivializationAt E (TangentSpace I) x).target = (chartAt H x).source ×ˢ univ

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u_6)
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(x : M)

(trivializationAt E (TangentSpace I) x).target = (chartAt H x).source ×ˢ Set.univ


@[simp] lemma head_cons (p : RelSeries r) (newHead : α) (rel : r newHead p.head) :
    (p.cons newHead rel).head = newHead

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(newHead : α)
(rel : r newHead p.head)


@[simp]
theorem leadingCoeff_zero : leadingCoeff (0 : HahnSeries Γ R) = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]


@[simp]
theorem coe_toOrderIso_symm (f : CircleDeg1Liftˣ) :
    ⇑(toOrderIso f).symm = (f⁻¹ : CircleDeg1Liftˣ)

⇑(CircleDeg1Lift.toOrderIso f).symm = ⇑↑f⁻¹


lemma UniformConcaveOn.mono (hψφ : ψ ≤ φ) (hf : UniformConcaveOn s φ f) : UniformConcaveOn s ψ f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{φ ψ : ℝ → ℝ}
{s : Set E}
{f : E → ℝ}
(hψφ : ψ ≤ φ)
(hf : UniformConcaveOn s φ f)


theorem sqrt_ne_zero (h : 0 ≤ x) : √x ≠ 0 ↔ x ≠ 0

√x ≠ 0 ↔ x ≠ 0


@[simp]
lemma obj_succ (i : ℕ) (hi : i + 1 < n + 1 + 1) : obj F X ⟨i + 1, hi⟩ = F.obj' i

(F : CategoryTheory.ComposableArrows C n)

CategoryTheory.ComposableArrows.Precomp.obj F X ⟨i + 1, hi⟩ = F.obj' i ⋯


lemma le_algebraMap_of_spectrum_le {r : R} {a : A} (h : ∀ x ∈ spectrum R a, x ≤ r)
    (ha : p a := by cfc_tac) : a ≤ algebraMap R A r

[∀ (α : Type u_1) [inst : TopologicalSpace α], StarOrderedRing C(α, R)]


/-- A refinement of `Finset.centerMass_mem_convexHull` when the indexed family is a `Finset` of
the space. -/
theorem Finset.centerMass_id_mem_convexHull (t : Finset E) {w : E → R} (hw₀ : ∀ i ∈ t, 0 ≤ w i)
    (hws : 0 < ∑ i ∈ t, w i) : t.centerMass w id ∈ convexHull R (t : Set E)

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(t : Finset E)
{w : E → R}
(hw₀ : ∀ i ∈ t, 0 ≤ w i)
(hws : 0 < ∑ i ∈ t, w i)


theorem finsetIntegerMultiple_image [DecidableEq M] (s : Finset M') :
    f '' finsetIntegerMultiple S f s = commonDenomOfFinset S f s • (s : Set M')

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

⇑f '' ↑(IsLocalizedModule.finsetIntegerMultiple S f s) = IsLocalizedModule.commonDenomOfFinset S f s • ↑s


@[to_additive /-(attr := simp)-/] -- Porting note: `simp` cannot simplify LHS
theorem exists_inv_mem_iff_exists_mem {P : G → Prop} :
    (∃ x : G, x ∈ H ∧ P x⁻¹) ↔ ∃ x ∈ H, P x

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
{H : S}
[SetLike S G]
[AddSubgroupClass S G]
{P : G → Prop}


@[simp]
theorem toIcoMod_sub' (a b : α) : toIcoMod hp (a - p) b = toIcoMod hp a b - p

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


@[to_additive (attr := simp)]
theorem prod_insert [DecidableEq α] : a ∉ s → ∏ x ∈ insert a s, f x = f a * ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{a : α}
{f : α → β}
[AddCommMonoid β]
[DecidableEq α]

a ∉ s → ∑ x ∈ insert a s, f x = f a + ∑ x ∈ s, f x


theorem IsLittleO.congr_left (h : f₁ =o[l] g) (hf : ∀ x, f₁ x = f₂ x) : f₂ =o[l] g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E}
(h : f₁ =o[l] g)
(hf : ∀ (x : α), f₁ x = f₂ x)


lemma Even.pow_pos (hn : Even n) (ha : a ≠ 0) : 0 < a ^ n

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
[ExistsAddOfLE R]
(hn : Even n)
(ha : a ≠ 0)


@[simp]
theorem coe_toTopMap {x y : SimplexCategory} (f : x ⟶ y) (g : x.toTopObj) (i : y) :
    toTopMap f g i = ∑ j ∈ Finset.univ.filter (f · = i), g j

(i : (CategoryTheory.forget SimplexCategory).obj y)

↑(SimplexCategory.toTopMap f g) i = ∑ j ∈ Finset.filter (fun x_1 => f x_1 = i) Finset.univ, ↑g j


theorem isBounded_biUnion_finset (s : Finset ι) {f : ι → Set α} :
    IsBounded (⋃ i ∈ s, f i) ↔ ∀ i ∈ s, IsBounded (f i)

{ι : Type u_1}
{α : Type u_2}
[Bornology α]
(s : Finset ι)
{f : ι → Set α}

Bornology.IsBounded (⋃ i ∈ s, f i) ↔ ∀ i ∈ s, Bornology.IsBounded (f i)


/-- A morphism of monoid objects induces a "restriction" or "comap" functor
between the categories of module objects.
-/
@[simps]
def comap {A B : Mon_ C} (f : A ⟶ B) : Mod_ B ⥤ Mod_ A

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

∀ {X Y : Mod_ B} (g : X ⟶ Y), ((Mod_.comap f).map g).hom = g.hom


protected theorem _root_.StrictMonoOn.strictMono (h : StrictMonoOn f s) :
    StrictMono (f ∘ Subtype.val : s → β)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f : α → β}
[Preorder α]
[Preorder β]
(h : StrictMonoOn f s)


theorem leadingCoeff_eraseLead_eq_nextCoeff (h : f.nextCoeff ≠ 0) :
    f.eraseLead.leadingCoeff = f.nextCoeff

{R : Type u_1}
[Semiring R]
{f : R[X]}
(h : f.nextCoeff ≠ 0)


@[simp]
theorem tsum_coe (p : PMF α) : ∑' a, p a = 1


@[simp]
theorem curryFinFinset_apply {k l n : ℕ} {s : Finset (Fin n)} (hk : s.card = k) (hl : sᶜ.card = l)
    (f : MultilinearMap R (fun _ : Fin n => M') M₂) (mk : Fin k → M') (ml : Fin l → M') :
    curryFinFinset R M₂ M' hk hl f mk ml =
      f fun i => Sum.elim mk ml ((finSumEquivOfFinset hk hl).symm i)

{R : Type uR}
{M₂ : Type v₂}
{M' : Type v'}
[CommSemiring R]
[AddCommMonoid M']
[AddCommMonoid M₂]
[Module R M']
[Module R M₂]
{k l n : ℕ}
{s : Finset (Fin n)}
(hk : s.card = k)
(hl : sᶜ.card = l)
(f : MultilinearMap R (fun x => M') M₂)
(mk : Fin k → M')
(ml : Fin l → M')

(((MultilinearMap.curryFinFinset R M₂ M' hk hl) f) mk) ml =
  f fun i => Sum.elim mk ml ((finSumEquivOfFinset hk hl).symm i)


/-- The infimum of 2 equivalence relations r and s is the same relation as the infimum
    of the underlying binary operations. -/
theorem inf_def {r s : Setoid α} : (r ⊓ s).Rel = r.Rel ⊓ s.Rel


/-- Given a tower of scalar actions `M → α → β`, if we use `SMul.comp`
to pull back both of `M`'s actions by a map `g : N → M`, then we obtain a new
tower of scalar actions `N → α → β`.

This cannot be an instance because it can cause infinite loops whenever the `SMul` arguments
are still metavariables. -/
@[to_additive
"Given a tower of additive actions `M → α → β`, if we use `SMul.comp` to pull back both of
`M`'s actions by a map `g : N → M`, then we obtain a new tower of scalar actions `N → α → β`.

This cannot be an instance because it can cause infinite loops whenever the `SMul` arguments
are still metavariables."]
lemma comp.isScalarTower [SMul M β] [SMul α β] [IsScalarTower M α β] (g : N → M) : by
    haveI := comp α g; haveI := comp β g; exact IsScalarTower N α β

{M : Type u_1}
{N : Type u_2}
{α : Type u_7}
{β : Type u_8}
[VAdd M α]
[VAdd M β]
[VAdd α β]
[VAddAssocClass M α β]
(g : N → M)


@[to_additive prod_mk_sum]
theorem prod_mk_prod {α β γ : Type*} [CommMonoid α] [CommMonoid β] (s : Finset γ) (f : γ → α)
    (g : γ → β) : (∏ x ∈ s, f x, ∏ x ∈ s, g x) = ∏ x ∈ s, (f x, g x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
(s : Finset γ)
(f : γ → α)
(g : γ → β)

(∑ x ∈ s, f x, ∑ x ∈ s, g x) = ∑ x ∈ s, (f x, g x)


@[simp]
theorem toPGame_lt_iff {a b : Ordinal} : a.toPGame < b.toPGame ↔ a < b


theorem add_mk_self (a b c) : (mk a b : Localization M) + mk c b = mk (a + c) b

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

Localization.mk a b + Localization.mk c b = Localization.mk (a + c) b


theorem integral_norm_eq_pos_sub_neg {f : X → ℝ} (hfi : Integrable f μ) :
    ∫ x, ‖f x‖ ∂μ = ∫ x in {x | 0 ≤ f x}, f x ∂μ - ∫ x in {x | f x ≤ 0}, f x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f : X → ℝ}
(hfi : MeasureTheory.Integrable f μ)

∫ (x : X), ‖f x‖ ∂μ = ∫ (x : X) in {x | 0 ≤ f x}, f x ∂μ - ∫ (x : X) in {x | f x ≤ 0}, f x ∂μ


theorem NoMinOrder.not_acc [LT α] [NoMinOrder α] (a : α) : ¬Acc (· < ·) a

{α : Type u_1}
[LT α]
[NoMinOrder α]
(a : α)


theorem isBounded_ge_atTop : (atTop : Filter α).IsBounded (· ≥ ·)

{α : Type u_1}
[Preorder α]
[Nonempty α]

Filter.IsBounded (fun x x_1 => x ≥ x_1) Filter.atTop


lemma baseChange_addPolynomial (x y L : A) :
    (W.baseChange B).toAffine.addPolynomial (f x) (f y) (f L) =
      ((W.baseChange A).toAffine.addPolynomial x y L).map f

{R : Type r}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type s}
[CommRing S]
[Algebra R S]
{A : Type u}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type v}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
(f : A →ₐ[S] B)
(x y L : A)

(WeierstrassCurve.baseChange W B).toAffine.addPolynomial (f x) (f y) (f L) =
  Polynomial.map (↑f) ((WeierstrassCurve.baseChange W A).toAffine.addPolynomial x y L)


theorem dvd_antisymm {a b : Ordinal} (h₁ : a ∣ b) (h₂ : b ∣ a) : a = b

{a b : Ordinal.{u_4}}
(h₁ : a ∣ b)
(h₂ : b ∣ a)


protected theorem HasFDerivAt.fderiv (h : HasFDerivAt f f' x) : fderiv 𝕜 f x = f'

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


theorem lift_self_apply [PerfectRing L p] (x : L) : lift i i p x = x

{K : Type u_1}
{L : Type u_2}
[CommRing K]
[CommRing L]
(i : K →+* L)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[IsPRadical i p]
[PerfectRing L p]
(x : L)


theorem UInt8.toNat_add (x y : UInt8) : (x + y).toNat = (x.toNat + y.toNat) % UInt8.size


theorem commutator_prod_prod (K₁ K₂ : Subgroup G') :
    ⁅H₁.prod K₁, H₂.prod K₂⁆ = ⁅H₁, H₂⁆.prod ⁅K₁, K₂⁆

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(H₁ H₂ : Subgroup G)
(K₁ K₂ : Subgroup G')


@[simp]
theorem GradedAlgebra.proj_apply (i : ι) (r : A) :
    GradedAlgebra.proj 𝒜 i r = (decompose 𝒜 r : ⨁ i, 𝒜 i) i

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[DecidableEq ι]
[AddMonoid ι]
[CommSemiring R]
[Semiring A]
[Algebra R A]
(𝒜 : ι → Submodule R A)
[GradedAlgebra 𝒜]
(i : ι)
(r : A)

(GradedAlgebra.proj 𝒜 i) r = ↑(((DirectSum.decompose 𝒜) r) i)


/-- The natural isomorphism comparing between
pulling back along two propositionally equal functions.
-/
@[simps]
def comapEq {β γ : Type w} {f g : β → γ} (h : f = g) : comap C f ≅ comap C g

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{β γ : Type w}
{f g : β → γ}
(h : f = g)
(X : CategoryTheory.GradedObject γ C)
(b : β)

(CategoryTheory.GradedObject.comapEq C h).hom.app X b = CategoryTheory.eqToHom ⋯


protected theorem polynomial : FiniteType R R[X]


theorem isMinOn_dual_iff : IsMinOn (toDual ∘ f) s a ↔ IsMaxOn f s a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}

IsMinOn (⇑OrderDual.toDual ∘ f) s a ↔ IsMaxOn f s a


@[simp]
theorem zeroLocus_singleton_one : zeroLocus ({1} : Set R) = ∅


/-- The square with `0 : 0 ⟶ 0` on the right and `𝟙 X` on the left is a pushout square. -/
@[simp]
theorem zero_right (X : C) : IsPushout (0 : X ⟶ 0) (𝟙 X) (0 : (0 : C) ⟶ 0) (0 : X ⟶ 0)


/-- The Riemann-Lebesgue lemma, formulated in terms of `VectorFourier.fourierIntegral` (with the
pairing in the definition of `fourier_integral` taken to be the canonical pairing between `V` and
its dual space). -/
theorem Real.zero_at_infty_vector_fourierIntegral (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (VectorFourier.fourierIntegral 𝐞 μ (topDualPairing ℝ V).flip f) (cocompact (V →L[ℝ] ℝ))
      (𝓝 0)

{E : Type u_1}
{V : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : V → E)
[AddCommGroup V]
[TopologicalSpace V]
[TopologicalAddGroup V]
[T2Space V]
[MeasurableSpace V]
[BorelSpace V]
[Module ℝ V]
[ContinuousSMul ℝ V]
[FiniteDimensional ℝ V]
(μ : MeasureTheory.Measure V)
[μ.IsAddHaarMeasure]

Filter.Tendsto (VectorFourier.fourierIntegral 𝐞 μ (topDualPairing ℝ V).flip f) (Filter.cocompact (V →L[ℝ] ℝ)) (𝓝 0)


theorem atTop_finset_eq_iInf : (atTop : Filter (Finset α)) = ⨅ x : α, 𝓟 (Ici {x})


@[simp]
theorem flip_separatingLeft {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M} :
    B.flip.SeparatingLeft ↔ SeparatingRight B

{R : Type u_1}
{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_5}
{M₁ : Type u_6}
{M₂ : Type u_7}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{I₁ : R₁ →+* R}
{I₂ : R₂ →+* R}
{B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M}


theorem seq_le_seq (hf : Monotone f) (n : ℕ) (h₀ : x 0 ≤ y 0) (hx : ∀ k < n, x (k + 1) ≤ f (x k))
    (hy : ∀ k < n, f (y k) ≤ y (k + 1)) : x n ≤ y n

(hx : ∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k))

(hy : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1))


theorem algebraMap_exp_comm (x : 𝕂) : algebraMap 𝕂 𝔸 (exp 𝕂 x) = exp 𝕂 (algebraMap 𝕂 𝔸 x)

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
(x : 𝕂)

(algebraMap 𝕂 𝔸) (NormedSpace.exp 𝕂 x) = NormedSpace.exp 𝕂 ((algebraMap 𝕂 𝔸) x)


@[to_additive (attr := simp)]
theorem div_eq_empty : s / t = ∅ ↔ s = ∅ ∨ t = ∅


@[simp]
theorem not_mem_nil : ∀ a, a ∉ @nil α


theorem HasFPowerSeriesOnBall.mono (hf : HasFPowerSeriesOnBall f p x r) (r'_pos : 0 < r')
    (hr : r' ≤ r) : HasFPowerSeriesOnBall f p x r'

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r r' : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
(r'_pos : 0 < r')
(hr : r' ≤ r)


/-- If an affine subspace contains a set of points, it contains the `spanPoints` of that set. -/
theorem spanPoints_subset_coe_of_subset_coe {s : Set P} {s1 : AffineSubspace k P} (h : s ⊆ s1) :
    spanPoints k s ⊆ s1

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
{s1 : AffineSubspace k P}
(h : s ⊆ ↑s1)


theorem minimalPeriod_apply_iterate (hx : x ∈ periodicPts f) (n : ℕ) :
    minimalPeriod f (f^[n] x) = minimalPeriod f x

{α : Type u_1}
{f : α → α}
{x : α}
(hx : x ∈ Function.periodicPts f)
(n : ℕ)

Function.minimalPeriod f (f^[n] x) = Function.minimalPeriod f x


/-- A nonzero vector equals a rotation of that vector if and only if the angle is zero. -/
@[simp]
theorem eq_rotation_self_iff_angle_eq_zero {x : V} (hx : x ≠ 0) (θ : Real.Angle) :
    x = o.rotation θ x ↔ θ = 0

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


theorem TFAE.out {l} (h : TFAE l) (n₁ n₂) {a b} (h₁ : List.get? l n₁ = some a := by rfl)
    (h₂ : List.get? l n₂ = some b := by rfl) : a ↔ b

{l : List Prop}
(h : l.TFAE)
(n₁ n₂ : Nat)
{a b : Prop}
(h₁ : l.get? n₁ = some a := by rfl)
(h₂ : l.get? n₂ = some b := by rfl)


/-- If an action is transitive, then composing this action with a surjective homomorphism gives
again a transitive action. -/
@[to_additive]
lemma isPretransitive_compHom {E F G : Type*} [Monoid E] [Monoid F] [MulAction F G]
    [IsPretransitive F G] {f : E →* F} (hf : Surjective f) :
    letI : MulAction E G := MulAction.compHom _ f
    IsPretransitive E G

{E : Type u_11}
{F : Type u_12}
{G : Type u_13}
[Monoid E]
[Monoid F]
[MulAction F G]
[MulAction.IsPretransitive F G]
{f : E →* F}
(hf : Function.Surjective ⇑f)


theorem StrictMonoOn.exists_slope_lt_deriv {x y : ℝ} {f : ℝ → ℝ} (hf : ContinuousOn f (Icc x y))
    (hxy : x < y) (hf'_mono : StrictMonoOn (deriv f) (Ioo x y)) :
    ∃ a ∈ Ioo x y, (f y - f x) / (y - x) < deriv f a

(hf'_mono : StrictMonoOn (deriv f) (Set.Ioo x y))

∃ a ∈ Set.Ioo x y, (f y - f x) / (y - x) < deriv f a


theorem skeletalFunctor.coe_map {Δ₁ Δ₂ : SimplexCategory} (f : Δ₁ ⟶ Δ₂) :
    ↑(skeletalFunctor.map f) = f.toOrderHom

SimplexCategory.skeletalFunctor.map f = SimplexCategory.Hom.toOrderHom f


@[simps! ωSup_fst ωSup_snd]
instance : OmegaCompletePartialOrder (α × β)

(c : OmegaCompletePartialOrder.Chain (α × β))

(OmegaCompletePartialOrder.ωSup c).1 = OmegaCompletePartialOrder.ωSup (c.map OrderHom.fst)


/--
The closure of a singleton `{a}` in the upper topology is the left-infinite right-closed interval
(-∞,a].
-/
@[simp]
theorem closure_singleton (a : α) : closure {a} = Iic a

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsUpper α]
(a : α)


theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
    Integrable fun x : ℝ => ↑x * cexp (-b * (x : ℂ) ^ 2)

MeasureTheory.Integrable (fun x => ↑x * cexp (-b * ↑x ^ 2)) MeasureTheory.volume


@[elab_as_elim]
protected theorem inductionOn₂
    {motive : Quotient s₁ → Quotient s₂ → Prop}
    (q₁ : Quotient s₁)
    (q₂ : Quotient s₂)
    (h : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))
    : motive q₁ q₂

(h : ∀ (a : α) (b : β), motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))


/-- If a function is `C^n` with `1 ≤ n`, then the derivative of `f` is also a strict derivative. -/
theorem ContDiff.hasStrictDerivAt {f : 𝕂 → F'} {x : 𝕂} (hf : ContDiff 𝕂 n f) (hn : 1 ≤ n) :
    HasStrictDerivAt f (deriv f x) x

{n : ℕ∞}
{𝕂 : Type u_1}
[RCLike 𝕂]
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace 𝕂 F']
{f : 𝕂 → F'}
{x : 𝕂}
(hf : ContDiff 𝕂 n f)
(hn : 1 ≤ n)


theorem not_or_of_imp : (a → b) → ¬a ∨ b


/-- If `K` is a complete subset, then any cauchy sequence in `K` converges to a point in `K` -/
theorem cauchySeq_tendsto_of_isComplete [Preorder β] {K : Set α} (h₁ : IsComplete K)
    {u : β → α} (h₂ : ∀ n, u n ∈ K) (h₃ : CauchySeq u) : ∃ v ∈ K, Tendsto u atTop (𝓝 v)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[Preorder β]
{K : Set α}
(h₁ : IsComplete K)
{u : β → α}
(h₂ : ∀ (n : β), u n ∈ K)
(h₃ : CauchySeq u)

∃ v ∈ K, Filter.Tendsto u Filter.atTop (𝓝 v)


@[simp]
theorem length_nil : length (@nil α) = 0


@[to_additive]
theorem closure_eq_mclosure {s : Set G} : closure s = Monoid.Closure (s ∪ Inv.inv ⁻¹' s)

AddGroup.closure s = AddMonoid.Closure (s ∪ Neg.neg ⁻¹' s)


protected theorem Monotone.IciExtend {f : Ici a → β} (hf : Monotone f) : Monotone (IciExtend f)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{a : α}
{f : ↑(Set.Ici a) → β}
(hf : Monotone f)


/-- Distance from the center of an inversion to the image of a point under the inversion. This
formula accidentally works for `x = c`. -/
theorem dist_center_inversion (c x : P) (R : ℝ) : dist c (inversion c R x) = R ^ 2 / dist c x

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(c x : P)
(R : ℝ)

dist c (EuclideanGeometry.inversion c R x) = R ^ 2 / dist c x


theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
    trunc n f.derivativeFun = derivative (trunc (n + 1) f)

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

PowerSeries.trunc n f.derivativeFun = Polynomial.derivative (PowerSeries.trunc (n + 1) f)


/-- A sum of finite numbers is still finite -/
theorem sum_lt_top {s : Finset α} {f : α → ℝ≥0∞} (h : ∀ a ∈ s, f a ≠ ∞) : ∑ a ∈ s, f a < ∞

{α : Type u_1}
{s : Finset α}
{f : α → ℝ≥0∞}
(h : ∀ a ∈ s, f a ≠ ⊤)


@[to_additive]
theorem mem_center_iff {z : G} : z ∈ center G ↔ ∀ g, g * z = z * g

z ∈ Subgroup.center G ↔ ∀ (g : G), g * z = z * g


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

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(r r' : R₁ ⟶ R₂)
(h : r = r')
(X : CategoryTheory.Comma L R₁)

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


@[aesop unsafe 30% (rule_sets := [Matroid])]
theorem Indep.subset_ground (hI : M.Indep I) : I ⊆ M.E

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)


theorem Filter.HasBasis.lift'_interior_eq_self {l : Filter X} {p : ι → Prop} {s : ι → Set X}
    (h : l.HasBasis p s) (ho : ∀ i, p i → IsOpen (s i)) : l.lift' interior = l

{X : Type u}
{ι : Sort w}
[TopologicalSpace X]
{l : Filter X}
{p : ι → Prop}
{s : ι → Set X}
(h : l.HasBasis p s)
(ho : ∀ (i : ι), p i → IsOpen (s i))


@[simp]
theorem mem_toFinset {a : α} {s : Multiset α} : a ∈ s.toFinset ↔ a ∈ s

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


theorem nonpos_iff {a : SignType} : a ≤ 0 ↔ a = -1 ∨ a = 0


theorem zero_rpow_def (y : ℝ) : (0 : ℝ≥0∞) ^ y = if 0 < y then 0 else if y = 0 then 1 else ⊤

0 ^ y = if 0 < y then 0 else if y = 0 then 1 else ⊤


nonrec theorem ContMDiffAt.prod_mk_space {f : M → E'} {g : M → F'}
    (hf : ContMDiffAt I 𝓘(𝕜, E') n f x) (hg : ContMDiffAt I 𝓘(𝕜, F') n g x) :
    ContMDiffAt I 𝓘(𝕜, E' × F') n (fun x => (f x, g x)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{x : M}
{n : ℕ∞}
{f : M → E'}
{g : M → F'}
(hf : ContMDiffAt I 𝓘(𝕜, E') n f x)
(hg : ContMDiffAt I 𝓘(𝕜, F') n g x)


@[to_additive neg.instNeBot]
lemma inv.instNeBot [NeBot f] : NeBot f⁻¹

{α : Type u_2}
[Neg α]
{f : Filter α}
[f.NeBot]


theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E → F} {f' : E →L[𝕜] F} {a : E}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) (h : LinearMap.range f' = ⊤) :
    map f (𝓝 a) = 𝓝 (f a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
[CompleteSpace F]
{f : E → F}
{f' : E →L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f f' a)
(h : LinearMap.range f' = ⊤)


@[simp]
theorem toENNRealVectorMeasure_add (μ ν : Measure α) :
    (μ + ν).toENNRealVectorMeasure = μ.toENNRealVectorMeasure + ν.toENNRealVectorMeasure

{α : Type u_1}
{m : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)


/--
(Implementation). The maps given in `appIso` is inverse to each other and gives a `ℱ(X) ≅ ℱ'(X)`.
-/
@[simps]
noncomputable def appIso {ℱ ℱ' : SheafOfTypes.{v} K} (i : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val)
    (X : D) : ℱ.val.obj (op X) ≅ ℱ'.val.obj (op X)

{K : CategoryTheory.GrothendieckTopology D}

(i : G.op.comp ℱ.val ≅ G.op.comp ℱ'.val)

∀ (a : ℱ'.val.obj (Opposite.op X)),
  (CategoryTheory.Functor.IsCoverDense.Types.appIso i X).inv a =
    CategoryTheory.Functor.IsCoverDense.Types.appHom i.inv X a


@[simp]
theorem getElem_iterate (f : α → α) (a : α) (n : ℕ) (i : Nat) (h : i < (iterate f a n).length) :
    (iterate f a n)[i] = f^[↑i] a

{α : Type u_1}
(f : α → α)
(a : α)
(n i : ℕ)
(h : i < (List.iterate f a n).length)


theorem toRingEquiv_unop (f : Aᵐᵒᵖ ≃ₐ[R] Bᵐᵒᵖ) :
    (AlgEquiv.unop f).toRingEquiv = RingEquiv.unop f.toRingEquiv

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : Aᵐᵒᵖ ≃ₐ[R] Bᵐᵒᵖ)


@[simp] theorem col_eq_zero [Zero α] [Nonempty ι] (v : m → α) : col ι v = 0 ↔ v = 0

{m : Type u_2}
{α : Type v}
{ι : Type u_6}
[Zero α]
[Nonempty ι]
(v : m → α)


lemma volumeIoiPow_apply_Iio (n : ℕ) (x : Ioi (0 : ℝ)) :
    volumeIoiPow n (Iio x) = ENNReal.ofReal (x.1 ^ (n + 1) / (n + 1))

(MeasureTheory.Measure.volumeIoiPow n) (Set.Iio x) = ENNReal.ofReal (↑x ^ (n + 1) / (↑n + 1))


theorem mem_span_pow' {x y : S} {d : ℕ} :
    y ∈ Submodule.span R (Set.range fun i : Fin d => x ^ (i : ℕ)) ↔
      ∃ f : R[X], f.degree < d ∧ y = aeval x f

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{x y : S}
{d : ℕ}

y ∈ Submodule.span R (Set.range fun i => x ^ ↑i) ↔ ∃ f, f.degree < ↑d ∧ y = (Polynomial.aeval x) f


@[higher_order tsnd_id]
theorem id_tsnd : ∀ {α β} (x : t α β), tsnd (F := Id) pure x = pure x

{t : Type u → Type u → Type u}
[Bitraversable t]
[LawfulBitraversable t]
{α β : Type u}


@[simp] lemma coe_covBy_coe : (s : Set α) ⋖ t ↔ s ⋖ t

↑s ⋖ ↑t ↔ s ⋖ t


lemma weightSpace_zsmul_add_ne_bot {n : ℤ}
    (hn : -chainBotCoeff α β ≤ n) (hn' : n ≤ chainTopCoeff α β) :
      weightSpace M (n • α + β : L → R) ≠ ⊥

(hn : -↑(LieModule.chainBotCoeff α β) ≤ n)

(hn' : n ≤ ↑(LieModule.chainTopCoeff α β))

LieModule.weightSpace M (n • α + ⇑β) ≠ ⊥


theorem Hereditary.is_equiv_invariant_of_fg (h : Hereditary K)
    (fg : ∀ M : Bundled.{w} L.Structure, M ∈ K → Structure.FG L M) (M N : Bundled.{w} L.Structure)
    (hn : Nonempty (M ≃[L] N)) : M ∈ K ↔ N ∈ K

{K : Set (CategoryTheory.Bundled L.Structure)}

(fg : ∀ M ∈ K, FirstOrder.Language.Structure.FG L ↑M)

(M N : CategoryTheory.Bundled L.Structure)


theorem fderivWithin_of_mem_nhds (h : s ∈ 𝓝 x) : fderivWithin 𝕜 f s x = fderiv 𝕜 f x

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


@[simp] protected theorem zero_add (x : BitVec n) : 0#n + x = x