Degrees and variables of polynomials
This file establishes many results about the degree and variable sets of a multivariate polynomial.
The variable set of a polynomial $P \in R[X]$ is a finset
containing each $x \in X$
that appears in a monomial in $P$.
The degree set of a polynomial $P \in R[X]$ is a multiset
containing, for each $x$ in the
variable set, $n$ copies of $x$, where $n$ is the maximum number of copies of $x$ appearing in a
monomial of $P$.
Main declarations
mv_polynomial.degrees p
: the multiset of variables representing the union of the multisets corresponding to each non-zero monomial inp
. For example if7 ≠ 0
inR
andp = x²y+7y³
thendegrees p = {x, x, y, y, y}
mv_polynomial.vars p
: the finset of variables occurring inp
. For example ifp = x⁴y+yz
thenvars p = {x, y, z}
mv_polynomial.degree_of n p : ℕ
-- the total degree ofp
with respect to the variablen
. For example ifp = x⁴y+yz
thendegree_of y p = 1
.mv_polynomial.total_degree p : ℕ
-- the max of the sizes of the multisetss
whose monomialsX^s
occur inp
. For example ifp = x⁴y+yz
thentotal_degree p = 5
.
Notation
As in other polynomial files, we typically use the notation:
σ τ : Type*
(indexing the variables)R : Type*
[comm_semiring R]
(the coefficients)s : σ →₀ ℕ
, a function fromσ
toℕ
which is zero away from a finite set. This will give rise to a monomial inmv_polynomial σ R
which mathematicians might callX^s
r : R
i : σ
, with corresponding monomialX i
, often denotedX_i
by mathematiciansp : mv_polynomial σ R
degrees
The maximal degrees of each variable in a multi-variable polynomial, expressed as a multiset.
(For example, degrees (x^2 * y + y^3)
would be {x, x, y, y, y}
.)
vars
vars p
is the set of variables appearing in the polynomial p
The variables of the product of a family of polynomials are a subset of the union of the sets of variables of each polynomial.
degree_of
degree_of n p
gives the highest power of X_n that appears in p
Equations
total_degree
total_degree p
gives the maximum |s| over the monomials X^s in p