Gröbner basis
A Gröbner basis is a particular generating set of a polynomial ideal, chosen so that the ideal becomes computable[1][2]. For polynomials in one variable, the Euclidean algorithm reduces any ideal to a single generator, and divisibility by it decides membership. In several variables, ideals need several generators, and dividing by an arbitrary set of them gives remainders that depend on the order of division and need not be zero for members of the ideal. A Gröbner basis, defined relative to a monomial order, repairs this: its leading terms generate the leading terms of every polynomial in the ideal, and as a consequence every polynomial has a unique remainder on division by it, the normal form, which is zero exactly for members. Bruno Buchberger defined Gröbner bases, named them after his advisor Wolfgang Gröbner, and gave an algorithm to compute them in his thesis of 1965[1]. They underlie the polynomial system solving of every computer algebra system.
Definition
Fix a monomial order and let be an ideal in . A finite set is a Gröbner basis of if
that is, the leading term of every element of is divisible by the leading term of some element of . Then division by in any order gives the same remainder, and if and only if that remainder is zero[2]. Every ideal has a Gröbner basis, by Hilbert's basis theorem applied to the ideal of leading terms[9], and a unique reduced one, in which every element is monic and no term of any element is divisible by the leading term of another.
Buchberger's algorithm
For polynomials and with leading monomials whose least common multiple is , the S-polynomial
cancels both leading terms. Buchberger's criterion states that is a Gröbner basis if and only if every has remainder zero on division by [1][10]. The algorithm follows: compute the remainders of all S-polynomials, add the nonzero ones to the basis, and repeat for the new pairs. It terminates because each added remainder enlarges the ideal of leading terms, and ascending chains of monomial ideals are finite.
Division, S-polynomials, and Buchberger's algorithm with the criterion that skips pairs with coprime leading monomials.
(* The S-polynomial cancels the leading terms of f and g. *)let spoly ord f g =let l = lcm (lm f) (lm g) insub ord (mul_term ord (mono_div l (lm f), Q.div Q.one (lc f)) f)(mul_term ord (mono_div l (lm g), Q.div Q.one (lc g)) g)let pairs_considered = ref 0(* Buchberger's algorithm. With criterion = true, pairs whose leadingmonomials are coprime are skipped (Buchberger's first criterion). *)let buchberger ?(criterion = true) ?(trace = fun _ _ _ _ -> ()) ord (fs : poly list) =let basis = ref (List.filter (( <> ) []) fs) inlet pairs = ref [] inList.iteri (fun i _ -> for j = 0 to i - 1 do pairs := (j, i) :: !pairs done) !basis;pairs := List.rev !pairs;while !pairs <> [] dolet (i, j) = List.hd !pairs inpairs := List.tl !pairs;let f = List.nth !basis i and g = List.nth !basis j inlet coprime = Array.for_all2 (fun a b -> a = 0 || b = 0) (lm f) (lm g) inif not (criterion && coprime) then beginincr pairs_considered;let r = remainder ord (spoly ord f g) !basis intrace i j (spoly ord f g) r;if r <> [] then beginlet n = List.length !basis inbasis := !basis @ [ r ];pairs := !pairs @ List.init n (fun k -> (k, n))endenddone;!basis
A trace on the example of Cox, Little and O'Shea, in graded lexicographic order.
open Mpoly
Running it.
S(f1, f2) = -x^2 reduces to -x^2 (added)S(f1, f3) = -2xy reduces to -2xy (added)S(f2, f3) = -2y^2 + x reduces to -2y^2 + x (added)S(f1, f4) = -2xy^2 reduces to 0S(f2, f4) = -2y^2 + x reduces to 0S(f3, f4) = 0 reduces to 0S(f2, f5) = 1/2x^3 - 2y^3 + xy reduces to 0S(f4, f5) = 1/2x^2 reduces to 0basis: x^3 - 2xy, x^2y - 2y^2 + x, -x^2, -2xy, -2y^2 + xreduced: x^2, xy, y^2 - 1/2x
Applications
Ideal membership
A polynomial is in the ideal exactly when its remainder by a Gröbner basis is zero. Remainders are canonical representatives of the classes modulo the ideal, so equality in the quotient ring becomes equality of normal forms; see canonical form.
Solving systems
For lexicographic order with , the elimination theorem says that is a Gröbner basis of the ideal's intersection with that subring[2]. A lex basis of a system with finitely many solutions is therefore triangular: one polynomial in alone, then polynomials that introduce the other variables one at a time, and the system can be solved by back substitution.
Solving a system of a sphere, a paraboloid and a plane with a lexicographic basis, and testing membership.
open Mpoly(* x^2 + y^2 + z^2 = 1, x^2 + z^2 = y, x = z: a lexicographic Gröbnerbasis is triangular, ending in a polynomial in z alone. *)
Running it.
x - zy - 2z^2z^4 + 1/2z^2 - 1/4y^2 + 2z^2 - 1 in the ideal: truey - 1 in the ideal: false
The last polynomial, , gives four values of ; the others determine and . The number of standard monomials counts the solutions, with multiplicity, for any order. Gröbner bases are also used to find implicit equations of parametrized curves and surfaces, to prove geometric theorems, to analyze robot kinematics, and in algebraic cryptanalysis: Faugère and Joux broke the first HFE cryptographic challenge in 2002 by computing a Gröbner basis[7].
Complexity and faster algorithms
In the worst case Gröbner bases are expensive: Mayr and Meyer showed that ideal membership requires exponential space, and the degrees in a basis can be doubly exponential in the number of variables[3]. In practice the cost depends heavily on the order and the strategy. Most S-polynomials reduce to zero and are wasted work; Buchberger's criteria and the refinements of Gebauer and Möller detect many of them in advance[4].
Pairs reduced with and without Buchberger's first criterion.
open Mpoly(* S-polynomials reduced, with and without skipping pairs whose leadingmonomials are coprime. The reduced bases are the same either way. *)
Running it.
system order pairs reduced (with criterion / without)three quadrics grevlex 9 / 15three quadrics lex 43 / 78twisted cubic grevlex 4 / 6twisted cubic lex 7 / 10cubic system grevlex 0 / 3cubic system lex 111 / 136
Faugère's F4 algorithm reduces many S-polynomials at once as rows of a sparse matrix, and F5 uses signatures to avoid reductions to zero almost entirely[5][6]. These algorithms, in systems such as Magma, Singular and Maple, handle problems far beyond Buchberger's original algorithm.
History
Hilbert's basis theorem of 1890 showed that every polynomial ideal is finitely generated[9]. Buchberger, working under Wolfgang Gröbner at Innsbruck, gave in his 1965 thesis the definition, the criterion and the algorithm, in order to compute in quotient rings of zero-dimensional ideals[1]; he popularized the name Gröbner basis in the 1970s[10]. Hironaka had introduced the analogous standard bases for power series in 1964 in his work on resolution of singularities[8]. Implementations spread in the 1980s[4], the complexity results of Mayr and Meyer appeared in 1982[3], and Faugère's F4 and F5 of 1999 and 2002 made large computations practical[5][6]. Textbooks by Becker and Weispfenning[11] and by Cox, Little and O'Shea[2] made the theory standard.
see also
- Monomial orderA monomial order is a total order on the monomials of a polynomial ring that is compatible with multiplication and has 1 as its smallest element. It determines the leading term of every polynomial, and with it the result of multivariate division and the shape of Gröbner bases. The standard choices are lexicographic order, which compares exponents variable by variable and is used for eliminating variables; graded lexicographic order; and graded reverse lexicographic order, which usually gives the smallest Gröbner bases and the fastest computations. Dickson's lemma guarantees that every monomial order is a well-order, so that division and Buchberger's algorithm terminate.
- 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.
- Pseudo-divisionPseudo-division is division of polynomials over an integral domain that is not a field, such as the integers or a ring of polynomials in other variables. To avoid fractions, the dividend a is first multiplied by lc(b)^(deg a − deg b + 1), the leading coefficient of the divisor raised to one more than the degree difference; then ordinary long division succeeds and yields a pseudo-quotient q and pseudo-remainder r with lc(b)^e a = q b + r and deg r < deg b. It is the basic step of polynomial remainder sequences over the integers, of resultant and gcd computation, and of Wu's method in geometry theorem proving. Iterated naively, it makes coefficients grow exponentially.
- Subresultant PRSThe subresultant polynomial remainder sequence is a way of running Euclid's algorithm on polynomials over the integers, or any integral domain, without fractions and without the exponential coefficient growth of plain pseudo-division. After each pseudo-division, the remainder is divided by a factor computed from the previous leading coefficients and degree differences; the division is always exact, and the remainders obtained are the subresultants of the input, determinants of submatrices of the Sylvester matrix, whose size grows only linearly with the degree. The sequence yields the gcd, up to a constant, and the resultant. It was introduced by Collins in 1967 and developed by Brown and Traub.
- 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.
further reading
- [1]B. Buchberger, Ein Algorithmus zum Auffinden der Basiselemente des Restklassenringes nach einem nulldimensionalen Polynomideal, PhD thesis, University of Innsbruck (1965).
- [2]D. Cox, J. Little, D. O’Shea, Ideals, Varieties, and Algorithms, ch. 2–3, Springer (4th ed., 2015).
- [3]E. W. Mayr, A. R. Meyer, “The complexity of the word problems for commutative semigroups and polynomial ideals”, Advances in Mathematics 46 (1982).
- [4]R. Gebauer, H. M. Möller, “On an installation of Buchberger’s algorithm”, Journal of Symbolic Computation 6 (1988).
- [5]J.-C. Faugère, “A new efficient algorithm for computing Gröbner bases (F4)”, Journal of Pure and Applied Algebra 139 (1999).
- [6]J.-C. Faugère, “A new efficient algorithm for computing Gröbner bases without reduction to zero (F5)”, ISSAC (2002).
- [7]J.-C. Faugère, A. Joux, “Algebraic cryptanalysis of hidden field equation (HFE) cryptosystems using Gröbner bases”, CRYPTO (2003).
- [8]H. Hironaka, “Resolution of singularities of an algebraic variety over a field of characteristic zero”, Annals of Mathematics 79 (1964).
- [9]D. Hilbert, “Über die Theorie der algebraischen Formen”, Mathematische Annalen 36 (1890).
- [10]B. Buchberger, “A theoretical basis for the reduction of polynomials to canonical forms”, ACM SIGSAM Bulletin 10 (1976).
- [11]T. Becker, V. Weispfenning, Gröbner Bases: A Computational Approach to Commutative Algebra, Springer (1993).
last updated