3
Monomial orders and the division algorithm
We address the problem of deciding which term of a polynomial is the leading term. We noted above that, unlike in the univariate case, the total degree does not solve this problem for multivariate polynomials.3.1
Ordering the set of monomials
The first point to make is that the set of monomials in the ring k[x1, . . . , xn] is in
natural bijection with Nn via
(a1, . . . , an)←→xa11· · ·x an
n
This is a semigroup isomorphism, in fact, meaning only that addition in Nn
corre-sponds under this map to multiplication of monomials. Because of this, it is very common to blur the distinction betweenNnand the set of monomials ink[x
1, . . . , xn].
Definition 11 A monomial order > on k[x1, . . . , xn] is a total ordering on the set
of monomials of k[x1, . . . , xn] having two additional properties:
(1) m >1 for every monomial m6= 1.
(2) whenever m1 > m2 and n is a monomial, then nm1 > nm2.
We will see a lot of examples of monomial orders in a moment, but note first in passing that a monomial order gives a natural way to identify the leading term of a polynomial, which is what we really wanted.
Definition 12 Let > be a monomial order on k[x1, . . . , xn]. For f =
P
amm ∈
k[x1, . . . , xn] define the leading monomial off to be
LM(f) = max>{m : am 6= 0}.
Also define the leading term of f as LT(f) = amm and the leading coefficient of f
as LC(f) = am, where LM(f) =m.
Of course, the max> in this definition simply means take the largest element of the
finite set of monomials {m : am 6= 0} with respect to the monomial order >.
The most important monomial orders of them all There are, in fact,
in-finitely many monomial orders on k[x1, . . . , xn] (at least when n ≥ 2), and a great
many of them are useful. But three stand out from the crowd. We define these now, and we will use them almost exclusively when calculating examples for most of these notes.
Definition 13 The lexicographic order >lex on k[x1, . . . , xn] with
x1 >lex x2 >lex · · · >lex xn
is defined as follows: for two non-equal monomials
xa1 1 · · ·x an n >lex xb11· · ·x bn n if and only if ai > bi
The phrase ‘lexicographic order’ is usually abbreviated to ‘lex’. As with all orders, we are not confused by writing m2 < m1 as a synonym for m1 > m2, even though
we only defined the latter.
Lex is an intuitive monomial order. A monomial m1 is bigger than m2 if the
power of x1 appearing in m1 is greater than that appearing in m2. Of course, x1
may appear to the same power in both monomials, in which case you compare the power of x2 in each monomial. If those are also equal, then you look at the power
of x3, and so on. Notice that lex has nothing much to do with the total order of a
monomial: x1 >lex x1002 , for instance.
When the names of the variables are ordinary letters, such as in the ringk[x, y, z], it is tempting to think of lex order as being alphabetical order. For instance, with the lex order on k[x, y, z] with x >lex y >lex z, it is certainly true that xy >lex xz,
and it is also true that these two ‘words’ are in alphabetical order and accordingly xy would appear in the dictionary before xz if it could. But this is not a rule: xy comes before xyz in the dictionary but xyz >lex xy. Notice, too, that we cannot
write a list of monomials in increasing lex order, at least not in the usual way: in k[x, y, z], the lex order would give
1< z < z2 <· · ·< y < yz <· · ·< y2 < y2z <· · ·< x < xz < . . . where in each case the dots replace infinitely many monomials.
It is convenient to express the definition of the lex order in terms of tuples of exponents inNn: if a= (a1, . . . , an) andb= (b1, . . . , bn), thena >lex b if and only if
the leftmost nonzero entry of the vector a−b is positive.
It is important to remember that the lex order involves fixing in advance some sequential order on the variables. In the definition we have decided thatx1 is bigger
than x2, which is bigger than x3 and so on, when measured by >lex . We could
have chosen a different sequential order on the variables, and indeed there is a lex order, defined in exactly the same way, for any choice of sequential order.
Definition 14 Let σ ∈ Sym(n) be a permutation of {1, . . . , n}. The lexicographic order >lex,σ on k[x1, . . . , xn] with respect to σ is defined as follows: for two
non-equal monomials xa1 1 · · ·x an n >lex,σ xb11· · ·x bn
n if and only if aσ(i) > bσ(i)
where i is the smallest number in {1, . . . , n} for which aσ(i)6=bσ(i).
Two graded monomial orders The next monomial order involves a very small
twist on the lex order in sympathy with our instinct that the total order of a mono-mial ought to be an important part of deciding which of two monomono-mials is the bigger.
Definition 15 The graded lexicographic order >glex on k[x1, . . . , xn] with
is defined as follows:
m1 >glex m2 if and only if degm1 >degm2,
or degm1 = degm2 and m1 >lex m2.
The phrase ‘graded lexicographic order’ is usually abbreviated to ‘glex’, ‘grlex’ or ‘dlex’ (where the ‘d’ stands for ‘degree’).
In this order, we can write down monomials in an increasing list: in k[x, y, z] we write
1< z < y < x < z2 < yz < y2 < xz < xy < x2 < z3 <· · · .
There is a third starring monomial order, called thegraded reverse lexicographic order and denoted >grevlex , which appears prominantly because it has good
com-putational properties. It is easiest to define >grevlex inNn first: if a= (a1, . . . , an)
and b = (b1, . . . , bn), then a >grevlex b if and only if the rightmost nonzero entry of
the vector a−b is negative. The corresponding monomial order (with some choice of order of the variables) follows as for lex. The phrase ‘graded reverse lexicographic order’ is usually abbreviated to ‘grevlex’. With respect to grevlex, we can again write down monomials in an increasing list: ink[x, y, z] we write
1< z < y < x < z2 < yz < xz < y2 < xy < x2 < z3 <· · ·
which is different from the glex order.
3.2
The division algorithm and reduction
Example 1 Consider the lex order (with x > y) on k[x, y]. We divide f by the
pair of polynomials f1, f2, comparing leading terms and subtracting as usual. Since
LT(f) = xy2 and LT(f
1) = y2, we compute f −xf1 = xy+x+y3 + 1. This has
leading term xywhich is not divisible by LT(f1), but it is divisible by LT(f2) so we
computef−yf1−f2 =x+y3. This has leading termx, and this is not divisible by
either LT(f1) or LT(f2). When doing long division for univariate polynomials, we
would stop now and declare x+y3 to be the remainder after division. But we do
not do that here. Instead, we move x into the remainder, and continue working on the rest of the polynomial. So we set the remainderr to bex, at least for the time being. What is left isy3. This is divisible by LT(f
1) and so we computey3−yf1 =y.
This has leading term y, which again is not divisible by either leading term. So we add y to the remainder: r =x+y. There is nothing left, so see that
f = (x+y)f1+f2+r, wherer =x+y.
This is the complete division with remainder, although we must admit that it has not yet given the expression f = yf1 + (y+ 1)f2 that we might have been hoping
As an array, we work out this calculation as follows. q1: x+y q2: 1 r: x+y f1: y2−1 f2: xy+ 1 f: xy2+xy+y3+ 1 xf1: xy2−x xy+x+y3+ 1 f2: xy+ 1 x+y3
At this point we add x to the remainder and continue with y3 as the working
polynomial. ♥
During the division process, a term under consideration is added to the remainder r exactly when there is no LM(fi) that divides it. So no term of the resulting
remainder r is divisible by any LM(fi).
Definition 16 Let f1, . . . , fs ∈ k[x1, . . . , xn]. A polynomial g ∈ k[x1, . . . , xn] is
reduced with respect to{f1, . . . , fs} if and only if for every term t in g there is no
fi such that LT(fi) divides t.
Notice that, by definition, a polynomial is reduced with respect to a set of polyno-mials: the order of f1, . . . , fs does not matter in the definition.
We formalise the division process used in the example above as an algorithm.
Algorithm 1 (The division algorithm)
input f1, . . . , fs, f ∈k[x1, . . . , xn]
output q1, . . . , qs ∈k[x1, . . . , xn] and r∈k[x1, . . . , xn] reduced w.r.t. f1, . . . , fs
start q1 := 0, . . . , qs:= 0, r := 0, q:=f repeat i:= 1 repeat if LT(fi) divides LT(q) then qi :=qi+ LT(q)/LT(fi) q :=q−LT(q)/LT(fi)fi i:=n+ 2 else i:=i+ 1 end if untili≥n+ 1 if i=n+ 1 then q :=q−LT(q) r:=r+ LT(q) end if untilq = 0
Proof of Algorithm 1 We must check that every calculation can be performed, that the algorithm does terminate, and that the final values of the qi and r are as
claimed.
Since we work in a ring, the only troublesome arithmetic operation is division. But the algorithm only ever divides by a term, and then only after checking that the division works; so there is no problem there.
There are two ways of coming out of the repeat loop lines 3 to 11: either no LT(fi) divided LT(q) andiclocked up ton+ 1, or some division did take place and
iwas set by force to n+ 2. In the former case, the leading term ofq is moved to the remainder r, so the leading term of q reduces. In the latter case, the leading term of q is removed again, because this time we use some fi to cancel it.
We need to check thatris reduced at the end of the algorithm. But this is clear: a term is only added to r during the algorithm if it is not divisible by the leading term of any fi, and this is what it means to be reduced. Q.E.D.
We can formulate the division algorithm as a theorem.
Theorem 17 Fix a monomial order on k[x1, . . . , xn] and polynomials f1, . . . , fs ∈
k[x1, . . . , xn]. Then for any f ∈ k[x1, . . . , xn] there are polynomials q1, . . . , qs, r ∈
k[x1, . . . , xn] such that
f =q1f1+· · ·+qsfs+r
where r is reduced with respect to {f1, . . . , fs}.
Proof The division algorithm returns such an expression, and we have already
noted that the remainder is reduced as claimed. Q.E.D. This theorem is a little bit weaker than the division algorithm. The point is that the division algorithm is deterministic: if you run it twice with the same input it will return the same collection of polynomials q1, . . . , qs, r and moreover they will
satisfy LT(f)≥LT(qi) LT(fi) for each i= 1, . . . , s. However, the theorem does not
claim that these polynomials are uniquely determined for given input, which is good because they certainly are not.
So while it is tempting to definef mod f1, . . . , fsto be the remainderr
guaran-teed by the theorem, this is not well defined. But we can use the division algorithm itself to make this definition.
Definition 18 The reduction off byf1, . . . , fs is the polynomialr returned by the
division algorithm, Algorithm 3.2, which is applied strictly and with the fi in the
given order. This reduction is denoted by either ff1,...,fs or f mod f1, . . . , fs, and
the division algorithm process is denoted by f −→f1,...,f+s r.
The division algorithm has some idiosyncracies. If you change the order of the polynomials f1, . . . , fs, the resulting quotients qi and remainder r will change. In
fact, even if f = P
piqi is expressed in terms of the fi with no remainder, it may
happen that the division algorithm computes a different expression in which the remainder is nonzero. In the end, we will want to assign a meaning to the ‘remainder’ after division of a polynomialf by the whole ideal generated by f , . . . , f , and this
seems to defy us at the very first step. Indeed, setting I = (f1, . . . , fs) and f is
a polynomial, then if r = 0 after division we know that f ∈ I, but the converse does not hold. This problem cannot be solved directly. Instead, we will characterise those sets of polynomials for which the problem does not happen.
Example 1 (continued) Check that using the division algorithm to divide f by
f2, f1 in that order yields the expression
f =yf1+ (y+ 1)f2.
The divisors and remainder in this expression are not the same as those forf divided
byf1, f2. ♥
Homework
Exercise 1 Write the following monomials in decreasing order with respect to the
lexicographic monomial order with x1 > x2 > x3:
x31x22x3, x32, x3, x31x22, x91, x22x3.
Repeat it with glex and grevlex, and also change the starting order on the xi, for
example to x2 > x3 > x1.
Exercise 2 (Recall the bijection between monomials of k[x, y] and N2.) Sketch the region of N2 that consists of monomials m satisfying m ≤ x2y3 with respect to the
lex monomial order with x < y.
Repeat with glex and grevlex, both with x < y and x > y.
Exercise 3 Carry out the division algorithm forf divided byf1, f2 of the example in
the text several different times using lex, glex and grevlex and both x > y and y > x
and choosing eitherf1 first or f2 first. How many different division expressions with
remainder do you get?
Exercise 4 Let f1 =x−t3, f2 =y−t2 and f =x2−y3. Compute the division of
f byf1, f2 with respect to the lex order x > y > t.