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 σ
and an AddCommMonoid M
, as well as a function w : σ → M
.
Finsupp.weight
of a finitely supported functionf : σ →₀ ℕ
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
when `M = ℕ``Finsupp.le_weight_of_nonneg'
says thatw s ≤ f.weight w
forOrderedAddCommMonoid M
, whenf s ≠ 0
and allw i
are nonnegative.Finsupp.le_weight'
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
forNonTorsion Weight w
andCanonicallyOrderedAddCommMonoid M
.For
w : σ → ℕ
andFinite σ
,Finsupp.finite_of_nat_weight_le
proves that there are finitely manyf : σ →₀ ℕ
of bounded weight.
Degree #
Finsupp.degree
: the weight when all components ofw
are equal to1 : ℕ
. 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
. 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 #
The relevant generality of these constructions is not clear. It could probably be generalized to
w : σ → M
andf : σ →₀ N
, providedN
is a commutative semiring andM
is anN
-module.Maybe
Finsupp.weight w
andFinsupp.degree
should have similar types, bothAddCommMonoidHom
or both functions.
The weight
of the finitely supported function f : σ →₀ ℕ
with respect to w : σ → M
is the sum ∑(f i)•(w i)
.
Equations
- Finsupp.weight w = (Finsupp.linearCombination ℕ w).toAddMonoidHom
Instances For
Alias of Finsupp.weight
.
The weight
of the finitely supported function f : σ →₀ ℕ
with respect to w : σ → M
is the sum ∑(f i)•(w i)
.
Equations
Instances For
Alias of Finsupp.weight_apply
.
A weight function is nontorsion if its values are not torsion.
Instances
Without zero divisors, nonzero weight is a NonTorsionWeight
Equations
- ⋯ = ⋯
If M
is a CanonicallyOrderedAddCommMonoid
, then weight f
is zero iff `f=0.
Alias of Finsupp.degree
.
The degree of a finsupp function.
Equations
Instances For
Alias of Finsupp.degree_eq_zero_iff
.
Alias of Finsupp.degree_eq_weight_one
.