Documentation

Mathlib.Data.Finsupp.Weight

weights of Finsupp functions #

The theory of multivariate polynomials and power series is built on the type σ →₀ ℕ which gives the exponents of the monomials. Many aspects of the theory (degree, order, graded ring structure) require classifying these exponents according to their total sum ∑ i, f i, or variants, and this file provides some API for that.

Weight #

We fix a type σ, a semiring R, an R-module M, as well as a function w : σ → M. (The important case is R = ℕ.)

Degree #

TODO #

noncomputable def Finsupp.weight {σ : Type u_1} {M : Type u_2} {R : Type u_3} [Semiring R] (w : σM) [AddCommMonoid M] [Module R M] :
(σ →₀ R) →+ M

The weight of the finitely supported function f : σ →₀ R with respect to w : σ → M is the sum ∑ i, f i • w i.

Equations
    Instances For
      theorem Finsupp.weight_apply {σ : Type u_1} {M : Type u_2} {R : Type u_3} [Semiring R] (w : σM) [AddCommMonoid M] [Module R M] (f : σ →₀ R) :
      (weight w) f = f.sum fun (i : σ) (c : R) => c w i
      theorem Finsupp.weight_single_index {σ : Type u_1} {M : Type u_2} {R : Type u_3} [Semiring R] [AddCommMonoid M] [Module R M] [DecidableEq σ] (s : σ) (c : M) (f : σ →₀ R) :
      (weight (Pi.single s c)) f = f s c
      theorem Finsupp.weight_single_one_apply {σ : Type u_1} {R : Type u_3} [Semiring R] [DecidableEq σ] (s : σ) (f : σ →₀ R) :
      (weight (Pi.single s 1)) f = f s
      theorem Finsupp.weight_single {σ : Type u_1} {M : Type u_2} {R : Type u_3} [Semiring R] (w : σM) [AddCommMonoid M] [Module R M] (s : σ) (r : R) :
      ((weight w) fun₀ | s => r) = r w s
      class Finsupp.NonTorsionWeight {σ : Type u_1} {M : Type u_2} (R : Type u_3) [Semiring R] [AddCommMonoid M] [Module R M] (w : σM) :

      A weight function is nontorsion if its values are not torsion.

      • eq_zero_of_smul_eq_zero {r : R} {s : σ} (h : r w s = 0) : r = 0
      Instances
        theorem Finsupp.nonTorsionWeight_of {σ : Type u_1} {M : Type u_2} (R : Type u_3) [Semiring R] (w : σM) [AddCommMonoid M] [Module R M] [IsDomain R] [Module.IsTorsionFree R M] (hw : ∀ (i : σ), w i 0) :

        Without zero divisors, nonzero weight is a NonTorsionWeight

        theorem Finsupp.NonTorsionWeight.ne_zero {σ : Type u_1} {M : Type u_2} (R : Type u_3) [Semiring R] (w : σM) [AddCommMonoid M] [Module R M] [Nontrivial R] [NonTorsionWeight R w] (s : σ) :
        w s 0
        theorem Finsupp.weight_sub_single_add {σ : Type u_1} {M : Type u_2} {w : σM} [AddCommMonoid M] {f : σ →₀ } {i : σ} (hi : f i 0) :
        (weight w) (f - fun₀ | i => 1) + w i = (weight w) f
        theorem Finsupp.le_weight {σ : Type u_1} (w : σ) {s : σ} (hs : w s 0) (f : σ →₀ ) :
        f s (weight w) f
        theorem Finsupp.le_weight_of_ne_zero {σ : Type u_1} {M : Type u_2} [AddCommMonoid M] [PartialOrder M] [IsOrderedAddMonoid M] {w : σM} (hw : ∀ (s : σ), 0 w s) {s : σ} {f : σ →₀ } (hs : f s 0) :
        w s (weight w) f
        theorem Finsupp.le_weight_of_ne_zero' {σ : Type u_1} {M : Type u_4} [AddCommMonoid M] [PartialOrder M] [IsOrderedAddMonoid M] [CanonicallyOrderedAdd M] (w : σM) {s : σ} {f : σ →₀ } (hs : f s 0) :
        w s (weight w) f
        theorem Finsupp.weight_eq_zero_iff_eq_zero {σ : Type u_1} {M : Type u_4} [AddCommMonoid M] [PartialOrder M] [IsOrderedAddMonoid M] [CanonicallyOrderedAdd M] (w : σM) [NonTorsionWeight w] {f : σ →₀ } :
        (weight w) f = 0 f = 0

        If M is a CanonicallyOrderedAddCommMonoid, then weight f is zero iff f = 0.

        theorem Finsupp.finite_of_nat_weight_le {σ : Type u_1} [Finite σ] (w : σ) (hw : ∀ (x : σ), w x 0) (n : ) :
        {d : σ →₀ | (weight w) d n}.Finite
        def Finsupp.degree {σ : Type u_1} {R : Type u_4} [AddCommMonoid R] :
        (σ →₀ R) →+ R

        The degree of a finsupp function.

        Equations
          Instances For
            @[deprecated map_add (since := "2025-12-09")]
            theorem Finsupp.degree_add {M : Type u_4} {N : Type u_5} {F : Type u_9} [Add M] [Add N] [FunLike F M N] [AddHomClass F M N] (f : F) (x y : M) :
            f (x + y) = f x + f y

            Alias of map_add.

            @[deprecated map_zero (since := "2025-12-09")]
            theorem Finsupp.degree_zero {M : Type u_4} {N : Type u_5} {F : Type u_9} [Zero M] [Zero N] [FunLike F M N] [ZeroHomClass F M N] (f : F) :
            f 0 = 0

            Alias of map_zero.

            theorem Finsupp.degree_apply {σ : Type u_1} {R : Type u_4} [AddCommMonoid R] (d : σ →₀ R) :
            degree d = id.support, d i
            @[deprecated Finsupp.degree_apply (since := "2025-12-09")]
            theorem Finsupp.degree_def {σ : Type u_1} {R : Type u_4} [AddCommMonoid R] (d : σ →₀ R) :
            degree d = id.support, d i

            Alias of Finsupp.degree_apply.

            theorem Finsupp.degree_eq_sum {σ : Type u_1} {R : Type u_4} [AddCommMonoid R] [Fintype σ] (f : σ →₀ R) :
            degree f = i : σ, f i
            @[simp]
            theorem Finsupp.degree_single {σ : Type u_1} {R : Type u_4} [AddCommMonoid R] (a : σ) (r : R) :
            (degree fun₀ | a => r) = r
            theorem Finsupp.le_degree {σ : Type u_1} {R : Type u_5} [AddCommMonoid R] [PartialOrder R] [CanonicallyOrderedAdd R] (s : σ) (f : σ →₀ R) :
            f s degree f
            theorem Finsupp.degree_eq_weight_one {σ : Type u_1} {R : Type u_5} [Semiring R] :
            degree = weight fun (x : σ) => 1
            theorem Finsupp.range_single_one {σ : Type u_1} :
            (Set.range fun (a : σ) => fun₀ | a => 1) = {d : σ →₀ | degree d = 1}
            theorem Finsupp.exists_le_degree_eq {σ : Type u_5} (f : σ →₀ ) (n : ) (hn : n degree f) :
            gf, degree g = n
            theorem Finsupp.degree_preimage_nsmul {σ : Type u_5} (s : Set ) (n : ) (hn : n 0) :
            degree ⁻¹' (n s) = n degree ⁻¹' s
            theorem Finsupp.nsmul_single_one_image {α : Type u_5} {n : } {s : Set α} :
            n (fun (x : α) => fun₀ | x => 1) '' s = {x : α →₀ | degree x = n x.support s}
            theorem Finsupp.image_pow_eq_finsuppProd_image {α : Type u_5} {β : Type u_6} [CommMonoid β] {f : αβ} {n : } {s : Set α} :
            (f '' s) ^ n = (fun (x : α →₀ ) => x.prod fun (x1 : α) (x2 : ) => f x1 ^ x2) '' {x : α →₀ | degree x = n x.support s}