Let Rmathend000# be a ring and
X = {x1,..., xn}
mathend000#
be a finite set of variables.
The multivariate polynomial ring R[X]
mathend000#
can be implemented in different ways.
RECURSIVELY.
If n = 1
mathend000# we can use a univariate representation
otherwise we can view R[X]
mathend000# as a univariate
polynomial ring with a multivariate polynomial
ring as coefficient ring, say for instance
R[x1,..., xn-1][xn]
mathend000#.
This implies to choose an ordering on the variables
and a representation for univariate polynomials.
AS LINEAR COMBINATIONS OF MONOMIALS.
By monomial we mean any product of variables.
The product of variable is assumed to be commutative
and induces a commutative multiplication for monomials.
Each polynomial can be viewed as a linear combination
of monomials (with coefficients in Rmathend000#).
Then the polynomial
p = a1m1 + ... + apmp.
(36)
where the mimathend000# are pairwise different monomials
and the aimathend000# are nonzero coefficients,
can be represented as
an aggregate of terms
[ai, mi]
mathend000#.
This provides us with a canonical representation.
To have a fast equality-test, the aggregate of terms
must be linear. In other words, there
should be a first term, a second term, ...
Thus this aggregate should better be a list
or an array and the monomials should be totally
ordered.
Two types of monomial orderings are frequently used.
The lexicographical ordering. With
X = {x > y > z}
mathend000#
we have
1 < z < ... < zn ... < y < yz < ... < yzn ... < y2 < y2z < ... < y2zn ...
(37)
The degree-lexicographical ordering. With
X = {x > y > z}
mathend000#
we have
1 < z < y < x < z2 < zy < y2 < zx < xy < x2 < ... <