Monomial order
A monomial order is a way of comparing monomials, such as and , that makes multivariate polynomials behave enough like univariate ones for division to work[1]. In one variable, monomials are ordered by degree and every polynomial has a leading term. In several variables there is no single natural choice, and one must be made: a monomial order is a total order on monomials that respects multiplication, so that implies , and in which every monomial is at least 1. It fixes the leading term of every polynomial, and with it the steps of multivariate division and the Gröbner basis of an ideal. The most common orders are lexicographic (lex), graded lexicographic (grlex) and graded reverse lexicographic (grevlex). The choice changes results and cost dramatically: lex bases eliminate variables and solve systems but are often huge, while grevlex bases are usually the cheapest to compute.
Definition
Identify a monomial with its exponent vector . A monomial order is a total order on such that
The second condition makes the order a well-order: by Dickson's lemma, every set of monomials has finitely many minimal elements under divisibility[6], from which it follows that every strictly decreasing sequence of monomials is finite. This is what guarantees that division, which replaces a leading term by smaller ones, terminates[1].
Common orders
With variables ordered , the standard orders are[1][8]:
Lexicographic order compares the exponents of first, then of , and so on, like words in a dictionary: . Graded lexicographic order compares total degree first and breaks ties lexicographically. Graded reverse lexicographic order compares total degree first; among monomials of equal degree, the one with the smaller exponent in the last variable where they differ is larger. The two graded orders agree for two variables but differ from three on: is larger than in grlex, since appears in it, but smaller in grevlex, since it has more .
Three orders as comparison functions on exponent arrays.
(* Lexicographic: compare the first variable, then the next ... *)let lex (a : mono) (b : mono) =let rec go i = if i = Array.length a then 0 else if a.(i) <> b.(i) then compare a.(i) b.(i) else go (i + 1) ingo 0(* Graded lexicographic: total degree first, ties broken by lex. *)let grlex a b = let c = compare (degree a) (degree b) in if c <> 0 then c else lex a b(* Graded reverse lexicographic: total degree first; on a tie, themonomial with the smaller exponent in the last variable that differsis larger. *)let grevlex a b =let c = compare (degree a) (degree b) inif c <> 0 then celselet rec go i = if i < 0 then 0 else if a.(i) <> b.(i) then compare b.(i) a.(i) else go (i - 1) ingo (Array.length a - 1)
One polynomial, written with its terms in decreasing order under each.
open Mpoly
Running it.
lex -5x^3 + 7x^2z^2 + 4xy^2z + 4z^2grlex 7x^2z^2 + 4xy^2z - 5x^3 + 4z^2grevlex 4xy^2z + 7x^2z^2 - 5x^3 + 4z^2grlex: xyz^2 > y^3z: truegrevlex: xyz^2 > y^3z: false
More generally, any order can be described by a matrix: compare the vectors and lexicographically, for a suitable real matrix . Robbiano showed that every monomial order arises this way[2]. Weight orders compare a weighted degree first; elimination orders, which make every monomial containing certain variables larger than every monomial without them, are what lex provides for all variables at once.
Division depends on the order
Dividing a polynomial by several others means repeatedly cancelling its leading term with a divisor whose leading term divides it. The leading terms, and therefore the quotients and the remainder, depend on the order, and with an arbitrary set of divisors the remainder depends even on the order in which the divisors are tried[1].
Dividing x²y + xy² + y² by xy − 1 and y² − 1, in both orders, then by a Gröbner basis of the same ideal.
open Mpoly
Running it.
dividing by (xy - 1, y^2 - 1): quotients x + y, 1, remainder x + y + 1dividing by (y^2 - 1, xy - 1): quotients x + 1, x, remainder 2x + 1Gröbner basis: x - y, y^2 - 1remainder by it, in either order: 2y + 1, 2y + 1
The two remainders differ, even though both divisions are correct. With a Gröbner basis as divisor set, the remainder is unique, whatever the order in which the divisors are tried.
Which order to use
Reduced Gröbner bases of three ideals under each order, with the number of reduction steps in Buchberger's algorithm.
open Mpoly(* The same ideals under three orders: size of the reduced Gröbner basisand the work Buchberger's algorithm does. *)let largest_digits g = List.fold_left (fun m p -> List.fold_left (fun m (_, c) ->max m (String.length (Z.to_string (Z.abs (Q.num c))) + String.length (Z.to_string (Q.den c)) - 1)) m p) 0 g
Running it.
system order basis size max degree largest coefficient digits reductionscircle, parabola, plane lex 3 4 1 6circle, parabola, plane grlex 3 2 1 4circle, parabola, plane grevlex 3 2 1 4three quadrics lex 3 8 6 241three quadrics grlex 7 4 2 41three quadrics grevlex 6 4 2 23a cubic system lex 3 18 4 1182a cubic system grlex 3 3 1 0a cubic system grevlex 3 3 1 0
Lex bases have the triangular shape that solves systems, with the last polynomial in a single variable, but their degrees and coefficients are much larger, and computing them costs far more. Grevlex usually gives the smallest bases; Bayer and Stillman explained its advantages through the regularity of ideals[5]. In the cubic system, the leading terms under the graded orders are pairwise coprime, so the input is already a Gröbner basis and no reduction is needed, while lex requires over a thousand steps. The common strategy is therefore to compute a grevlex basis and convert it: the FGLM algorithm does this by linear algebra for ideals with finitely many solutions[3], and the Gröbner walk moves through intermediate orders in general[4].
History
Orders on monomials were used implicitly by Macaulay and in the elimination theory of the early twentieth century. Buchberger's thesis of 1965, which introduced Gröbner bases, required a fixed order on terms[7], and Dickson's lemma of 1913 provided the finiteness argument[6]. Robbiano classified all monomial orders in 1985[2], Bayer and Stillman gave the theoretical case for grevlex in 1987[5], and methods for changing orders, FGLM in 1993 and the Gröbner walk in 1997, made the choice of order a matter of efficiency rather than of the answer needed[3][4].
see also
- Gröbner basisA Gröbner basis of an ideal of multivariate polynomials is a generating set with respect to which multivariate division behaves as in one variable: the remainder of any polynomial is unique, and it is zero exactly when the polynomial lies in the ideal. Formally, the leading terms of the basis, for a fixed monomial order, generate the ideal of all leading terms. Buchberger's algorithm computes one from any generating set by adding the remainders of S-polynomials until they all reduce to zero. Gröbner bases decide ideal membership, solve systems of polynomial equations, count their solutions and eliminate variables; Bruno Buchberger introduced them in 1965.
- Canonical formIn computer algebra, a canonical form is a representation in which mathematically equal expressions are written identically, so that equality becomes a syntactic comparison and zero-testing a look at the representation. A normal form is the weaker requirement that expressions equal to zero are represented by 0. Expanded polynomials with sorted terms, reduced rational functions and remainders modulo a Gröbner basis are canonical; for expressions with exponentials, logarithms and absolute values, Richardson proved in 1968 that zero-equivalence is undecidable, so no canonical form can exist. Where no canonical form is practical, randomized evaluation, justified by the Schwartz–Zippel lemma, tests identities with high confidence.
- KernelIn computer algebra, a kernel is a maximal subexpression that is not built from sums, products and integer powers, such as sin(x), exp(x + 1) or √x, which the system treats as an opaque variable so that polynomial and rational-function algorithms can operate on the expression around it. Expanding (sin x + 1)² treats sin x as a variable k and returns k² + 2k + 1 with k replaced by sin x. Equal kernels must be recognized as the same variable, which requires their arguments to be in canonical form. Kernels are not algebraically independent in general, as exp(2x) = exp(x)², and full simplification requires rewriting them into an independent set, which the structure theorems of Risch and Rosenlicht describe for elementary functions.
referenced by
further reading
- [1]D. Cox, J. Little, D. O’Shea, Ideals, Varieties, and Algorithms, ch. 2, Springer (4th ed., 2015).
- [2]L. Robbiano, “Term orderings on the polynomial ring”, EUROCAL, Lecture Notes in Computer Science 204 (1985).
- [3]J.-C. Faugère, P. Gianni, D. Lazard, T. Mora, “Efficient computation of zero-dimensional Gröbner bases by change of ordering”, Journal of Symbolic Computation 16 (1993).
- [4]S. Collart, M. Kalkbrener, D. Mall, “Converting bases with the Gröbner walk”, Journal of Symbolic Computation 24 (1997).
- [5]D. Bayer, M. Stillman, “A criterion for detecting m-regularity”, Inventiones Mathematicae 87 (1987).
- [6]L. E. Dickson, “Finiteness of the odd perfect and primitive abundant numbers with n distinct prime factors”, American Journal of Mathematics 35 (1913).
- [7]B. Buchberger, Ein Algorithmus zum Auffinden der Basiselemente des Restklassenringes nach einem nulldimensionalen Polynomideal, PhD thesis, University of Innsbruck (1965).
- [8]T. Becker, V. Weispfenning, Gröbner Bases: A Computational Approach to Commutative Algebra, Springer (1993).
last updated