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 to classify these exponents according to their total sum
∑ i, f i
, or variants, and this files 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 = ℕ
.)
Finsupp.weight
of a finitely supported functionf : σ →₀ R
with respect tow
: it is the sum∑ (f i) • (w i)
. It is anAddMonoidHom
map defined usingFinsupp.linearCombination
.Finsupp.le_weight
says thatf s ≤ f.weight w
whenM = ℕ
Finsupp.le_weight_of_ne_zero
says thatw s ≤ f.weight w
forOrderedAddCommMonoid M
, whenf s ≠ 0
and allw i
are nonnegative.Finsupp.le_weight_of_ne_zero'
is the same statement forCanonicallyOrderedAddCommMonoid M
.NonTorsionWeight
: all valuesw s
are non torsion inM
.Finsupp.weight_eq_zero_iff_eq_zero
says thatf.weight w = 0
ifff = 0
forNonTorsionWeight w
andCanonicallyOrderedAddCommMonoid M
.For
w : σ → ℕ
andFinite σ
,Finsupp.finite_of_nat_weight_le
proves that there are finitely manyf : σ →₀ ℕ
of bounded weight.
Degree #
Finsupp.degree f
is the sum of allf s
, fors ∈ f.support
. The present choice is to have it defined as a plain function.Finsupp.degree_eq_zero_iff
says thatf.degree = 0
ifff = 0
.Finsupp.le_degree
says thatf s ≤ f.degree
.Finsupp.degree_eq_weight_one
saysf.degree = f.weight 1
whenR
is a semiring. This is useful to access the additivity properties ofFinsupp.degree
For
Finite σ
,Finsupp.finite_of_degree_le
proves that there are finitely manyf : σ →₀ ℕ
of bounded degree.
TODO #
- Maybe
Finsupp.weight w
andFinsupp.degree
should have similar types, bothAddMonoidHom
or both functions.
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
Without zero divisors, nonzero weight is a NonTorsionWeight
If M
is a CanonicallyOrderedAddCommMonoid
, then weight f
is zero iff `f=0.
The degree of a finsupp function.