# Gröbner basis

In mathematics, and more specifically in computer algebra, computational algebraic geometry, and computational commutative algebra, a Gröbner basis is a particular kind of generating set of an ideal in a polynomial ring K[x1, ..., xn] over a field K. A Gröbner basis allows many important properties of the ideal and the associated algebraic variety to be deduced easily, such as the dimension and the number of zeros when it is finite. Gröbner basis computation is one of the main practical tools for solving systems of polynomial equations and computing the images of algebraic varieties under projections or rational maps.

Gröbner basis computation can be seen as a multivariate, non-linear generalization of both Euclid's algorithm for computing polynomial greatest common divisors, and Gaussian elimination for linear systems.

Gröbner bases were introduced in 1965, together with an algorithm to compute them (Buchberger's algorithm), by Bruno Buchberger in his Ph.D. thesis. He named them after his advisor Wolfgang Gröbner. In 2007, Buchberger received the Association for Computing Machinery's Paris Kanellakis Theory and Practice Award for this work. However, the Russian mathematician Nikolai Günther had introduced a similar notion in 1913, published in various Russian mathematical journals. These papers were largely ignored by the mathematical community until their rediscovery in 1987 by Bodo Renschuch et al. An analogous concept for multivariate power series was developed independently by Heisuke Hironaka in 1964, who named them standard bases. This term has been used by some authors to also denote Gröbner bases.

The theory of Gröbner bases has been extended by many authors in various directions. It has been generalized to other structures such as polynomials over principal ideal rings or polynomial rings, and also some classes of non-commutative rings and algebras, like Ore algebras.

## Auxiliary tools

### Polynomial ring

Gröbner bases are primarily defined for ideals in a polynomial ring $R=K[x_{1},\ldots ,x_{n}]$  over a field K. Although the theory works for any field, most Gröbner basis computations are done either when K is the field of rationals or the integers modulo a prime number.

In the context of Gröbner bases, a nonzero polynomial in $R=K[x_{1},\ldots ,x_{n}]$  is commonly represented as a sum $c_{1}M_{1}+\cdots +c_{m}M_{m},$  where the $c_{i}$  are nonzero elements of K, called coefficients, and the $M_{i}$  are monomials (called power products by Buchberger and some of his followers) of the form $x_{1}^{a_{1}}\cdots x_{n}^{a_{n}},$  where the $a_{i}$  are nonnegative integers. The vector $A=[a_{1},\ldots ,a_{n}]$  is called the exponent vector of the monomial. When the list $X=[x_{1},\ldots ,x_{n}]$  of the variables is fixed, the notation of monomials is often abbreviated as $x_{1}^{a_{1}}\cdots x_{n}^{a_{n}}=X^{A}.$

Monomials are uniquely defined by their exponent vectors, and, when a monomial ordering (see below) is fixed, a polynomial is uniquely represented by the ordered list of the ordered pairs formed by an exponent vector and the corresponding coefficient. This representation of polynomials is especially efficient for Gröbner basis computation in computers, although it is less convenient for other computations such as polynomial factorization and polynomial greatest common divisor.

If $F=\{f_{1},\ldots ,f_{k}\}$  is a finite set of polynomials in the polynomial ring R, the ideal generated by F is the set of linear combinations of elements of F with coefficients in R; that is the set of polynomials that can be written ${\textstyle \sum _{i=1}^{k}g_{i}f_{i}}$  with $g_{1},\ldots ,g_{k}\in R.$

### Monomial ordering

All operations related to Gröbner bases require the choice of a total order on the monomials, with the following properties of compatibility with multiplication. For all monomials M, N, P,

1. $M\leq N\Longleftrightarrow MP\leq NP$
2. $M\leq MP$ .

A total order satisfying these condition is sometimes called an admissible ordering.

These conditions imply that the order is a well-order, that is, every strictly decreasing sequence of monomials is finite.

Although Gröbner basis theory does not depend on a particular choice of an admissible monomial ordering, three monomial orderings are specially important for the applications:

• Lexicographical ordering, commonly called lex or plex (for pure lexical ordering).
• Total degree reverse lexicographical ordering, commonly called degrevlex.
• Elimination ordering, lexdeg.

Gröbner basis theory was initially introduced for the lexicographical ordering. It was soon realised that the Gröbner basis for degrevlex is almost always much easier to compute, and that it is almost always easier to compute a lex Gröbner basis by first computing the degrevlex basis and then using a "change of ordering algorithm". When elimination is needed, degrevlex is not convenient; both lex and lexdeg may be used but, again, many computations are relatively easy with lexdeg and almost impossible with lex.

### Basic operations

#### Leading term, coefficient and monomial

Once a monomial ordering is fixed, the terms of a polynomial (product of a monomial with its nonzero coefficient) are naturally ordered by decreasing monomials (for this order). This makes the representation of a polynomial as a sorted list of pairs coefficient–exponent vector a canonical representation of the polynomials (that is, two polynomials are equal if and only they have the same representation.

The first (greatest) term of a polynomial p for this ordering and the corresponding monomial and coefficient are respectively called the leading term, leading monomial and leading coefficient and denoted, in this article, lt(p), lm(p) and lc(p).

Most polynomial operations related to Gröbner bases involve the leading terms. So, the representation of polynomials as sorted lists make the these operations particularly efficient (reading the first element of a list takes a constant time, independently fo the length of the list).

#### Polynomial operations

The other polynomial operations involved by Gröbner basis computations are also compatible with the monomial ordering; that is, they can be performed without reordering the result:

• The addition of two polynomials consists in a merge of the two corresponding lists of terms, with a special treatment in the case of a conflict (that is, when the same monomial appears in the two polynomials).
• The multiplication of a polynomial by a scalar consists of multiplying each coefficient by this scalar, without any other change in the representation.
• The multiplication of a polynomial by a monomial m consists of multiplying each monomial of the polynomial by m. This does not change the term ordering by definition of a monomial ordering.

#### Divisibility of monomials

Let $M=x_{1}^{a_{1}}\cdots x_{n}^{a_{n}}$  and $N=x_{1}^{b_{1}}\cdots x_{n}^{b_{n}}$  be two monomials, with exponent vectors $A=[a_{1},\ldots ,a_{n}]$  and $B=[b_{1},\ldots ,b_{n}].$

One says that M divides N, or that N is a multiple of M, if $a_{i}\leq b_{i}$  for every i; that is, if A is componentwise not greater than B. In this case, the quotient ${\textstyle {\frac {N}{M}}}$  is defined as ${\textstyle {\frac {N}{M}}=x_{1}^{b_{1}-a_{1}}\cdots x_{n}^{b_{n}-a_{n}}.}$  In other words, the exponent vector of ${\textstyle {\frac {N}{M}}}$  is the componentwise subtraction of the exponent vectors of N and M.

The greatest common divisor gcd(M, N) of M and N is the monomial ${\textstyle x_{1}^{\min(a_{1},b_{1})}\cdots x_{n}^{\min(a_{n},b_{n})}}$  whose exponent vector is the componentwise minimum of A and B. The least common multiple lcm(M, N) is defined similarly with max instead of min.

One has

$\operatorname {lcm} (M,N)={\frac {MN}{\gcd(M,N)}}.$

### Reduction

The concept of reduction, also called multivariate division or normal form computation, is central to Gröbner basis theory. It is a multivariate generalization of the Euclidean division of univariate polynomials.

In this section we suppose a fixed monomial ordering, which will not be defined explicitly.

Given two polynomials f and g, one says that f is reducible by g if some monomial m in f is a multiple of the leading monomial lm(g) of g. If m happens to be the leading monomial of f then one says that f is lead-reducible by g. If c is the coefficient of m in f and m = q lm(g), the one-step reduction of f by g is the operation that associates to f the polynomial

$\operatorname {red} _{1}(f,g)=f-{\frac {c}{\operatorname {lc} (g)}}\,q\,g.$

The main properties of this operation are that the resulting polynomial does not contain the monomial m and that the monomials greater than m (for the monomial ordering) remain unchanged. This operation is not, in general, uniquely defined; if several monomials in f are multiples of lm(g), then one may choose arbitrarily which one to reduce. In practice, it is better to choose the greatest one for the monomial ordering, because otherwise subsequent reductions could reintroduce the monomial that has just been removed.

Given a finite set G of polynomials, one says that f is reducible or lead-reducible by G if it is reducible or lead-reducible, respectively, by an element g of G. If it is the case, then one defines $\operatorname {red} _{1}(f,G)=\operatorname {red} _{1}(f,g)$ . The (complete) reduction of f by G consists in applying iteratively this operator $\operatorname {red} _{1}$  until getting a polynomial $\operatorname {red} (f,G)$ , which is irreducible by G. It is called a normal form of f by G. In general this form is not uniquely defined (this is not a canonical form); this non-uniqueness is the starting point of Gröbner basis theory.

For Gröbner basis computations, except at the end, it is not necessary to do a complete reduction: a lead-reduction is sufficient, which saves a large amount of computation.

The definition of the reduction shows immediately that, if h is a normal form of f by G, then we have

$f=h+\sum _{g\in G}q_{g}\,g,$

where the $q_{g}$  are polynomials. In the case of univariate polynomials, if G consists of a single element g, then h is the remainder of the Euclidean division of f by g, qg is the quotient and the division algorithm is exactly the process of lead-reduction. For this reason, some authors use the term multivariate division instead of reduction.

#### Examples of reduction

In the examples of this section, the polynomials have three indeterminates x, y, and z, and the monomial order that is used is the monomial order with $x\succ y\succ z;$  that is, for comparing two monomials, one compares first the exponents of x; only when the exponents of x are equal, one compares the exponents of y; and the exponents of z are compared only when the other exponents are equal.

For having a clear view of the reduction process, one has to rewrite polynomials with their terms in a decreasing order. For example, if

$P=xy^{3}z^{5}+x^{2}y^{6}+x^{4}yz+y^{2}z^{5}+yz^{4}+y^{3}+z^{3}+xy+xz+z^{2}+z,$

it must be rewritten

$P=x^{4}yz+x^{2}y^{6}+xy^{3}z^{5}+xy+xz+y^{3}+y^{2}z^{5}+yz^{4}+z^{3}+z^{2}+z.$

This allows having the leading monomial first (for the chosen order); here $\operatorname {lm} (P)=x^{4}yz.$

Consider the reduction of $f=2x^{3}-x^{2}y+y^{3}+3y\;$  by $\;G=\{g_{1},g_{2}\},$  with $g_{1}=x^{2}+y^{2}-1$  and $g_{2}=xy-2.$

For the first reduction step, either the first or the second term may be reduced. However, the reduction of a term amounts to remove this term at the cost of adding new lower terms, and, if it is not the first reducible term that is reduced, it is possible that a further reduction adds a similar term, which must be reduced again. It is therefore always better to reduce first the largest (for the monomial order) reducible term.

The leading term $2x^{3}$  of f is reducible by $g_{1}.$  So the first reduction step consists of multiplying $g_{1}$  by –2x and adding the result to f:

$f\;{\overset {-2xg_{1}}{\longrightarrow }}\;f_{1}=f-2xg_{1}=-x^{2}y-2xy^{2}+2x+y^{3}+3y.$

As the leading term $-x^{2}y$  of $f_{1}$  is a multiple of the leading monomials of both $g_{1}$  and $g_{2},$  one has two choices for the second reduction step. If one choses $g_{2},$  one gets a polynomial that can be reduced again by $g_{2}\colon$

$f\;{\overset {-2xg_{1}}{\longrightarrow }}\;f_{1}\;{\overset {xg_{2}}{\longrightarrow }}\;-2xy^{2}+y^{3}+3y\;{\overset {2yg_{2}}{\longrightarrow }}\;f_{2}=+y^{3}-y.$

No further reduction is possible, so $f_{2}$  can be chosen for the complete reduction of f. However, one gets a different result with the other choice for the second step:

$f\;{\overset {-2xg_{1}}{\longrightarrow }}\;f_{1}\;{\overset {yg_{1}}{\longrightarrow }}\;-2xy^{2}+2x+2y^{3}+2y\;{\overset {2yg_{2}}{\longrightarrow }}\;f_{3}=+2x+2y^{3}-2y.$

Therefore, the complete reduction of f can result in either $f_{2}$  or $f_{3}.$

Buchberger's algorithm has been introduced for solving the difficulties induced by this non-uniqueness. Roughly speaking it consists in adding to G the polynomials that are needed for the uniqueness of the reduction by G.

Here Buchberger's algorithm would begin by adding to G the polynomial

$g_{3}=yg_{1}-xg_{2}=2x+y^{3}-y.$

Indeed, $f_{3}$  can be further reduced by $g_{3},$  and this produces $f_{2}$  again. However, this does not complete Buchberger's algorithm, as xy gives different results, when reduced by $g_{2}$  or $g_{3}.$

## Formal definition

A Gröbner basis G of an ideal I in a polynomial ring R over a field is a generating set of I characterized by any one of the following properties, stated relative to some monomial order:

• the ideal generated by the leading terms of polynomials in I equals the ideal generated by the leading terms of G;
• the leading term of any polynomial in I is divisible by the leading term of some polynomial in G;
• the multivariate division of any polynomial in the polynomial ring R by G gives a unique remainder;
• the multivariate division by G of any polynomial in the ideal I gives the remainder 0.

All these properties are equivalent; different authors use different definitions depending on the topic they choose. The last two properties allow calculations in the factor ring R/I with the same facility as modular arithmetic. It is a significant fact of commutative algebra that Gröbner bases always exist, and can be effectively computed for any ideal given by a finite generating subset.

Multivariate division requires a monomial ordering, the basis depends on the monomial ordering chosen, and different orderings can give rise to radically different Gröbner bases. Two of the most commonly used orderings are lexicographic ordering, and degree reverse lexicographic order (also called graded reverse lexicographic order or simply total degree order). Lexicographic order eliminates variables, however the resulting Gröbner bases are often very large and expensive to compute. Degree reverse lexicographic order typically provides for the fastest Gröbner basis computations. In this order monomials are compared first by total degree, with ties broken by taking the smallest monomial with respect to lexicographic ordering with the variables reversed.

In most cases (polynomials in finitely many variables with complex coefficients or, more generally, coefficients over any field, for example), Gröbner bases exist for any monomial ordering. Buchberger's algorithm is the oldest and most well-known method for computing them. Other methods are the Faugère's F4 and F5 algorithms, based on the same mathematics as the Buchberger algorithm, and involutive approaches, based on ideas from differential algebra. There are also three algorithms for converting a Gröbner basis with respect to one monomial order to a Gröbner basis with respect to a different monomial order: the FGLM algorithm, the Hilbert-driven algorithm and the Gröbner walk algorithm. These algorithms are often employed to compute (difficult) lexicographic Gröbner bases from (easier) total degree Gröbner bases.

A Gröbner basis is termed reduced if the leading coefficient of each element of the basis is 1 and no monomial in any element of the basis is in the ideal generated by the leading terms of the other elements of the basis. In the worst case, computation of a Gröbner basis may require time that is exponential or even doubly exponential in the number of solutions of the polynomial system (for degree reverse lexicographic order and lexicographic order, respectively). Despite these complexity bounds, both standard and reduced Gröbner bases are often computable in practice, and most computer algebra systems contain routines to do so.

The concept and algorithms of Gröbner bases have been generalized to submodules of free modules over a polynomial ring. In fact, if L is a free module over a ring R, then one may consider RL as a ring by defining the product of two elements of L to be 0. This ring may be identified with $R[e_{1},\ldots ,e_{l}]/\left\langle \{e_{i}e_{j}|1\leq i\leq j\leq l\}\right\rangle$ , where $e_{1},\ldots ,e_{l}$  is a basis of L. This allows to identify a submodule of L generated by $g_{1},\ldots ,g_{k}$  with the ideal of $R[e_{1},\ldots ,e_{l}]$  generated by $g_{1},\ldots ,g_{k}$  and the products $e_{i}e_{j}$ , $1\leq i\leq j\leq l$ . If R is a polynomial ring, this reduces the theory and the algorithms of Gröbner bases of modules to the theory and the algorithms of Gröbner bases of ideals.

The concept and algorithms of Gröbner bases have also been generalized to ideals over various rings, commutative or not, like polynomial rings over a principal ideal ring or Weyl algebras.

## Example and counterexample

The zeroes of $f$  form the red parabola; the zeroes of $g$  form the three blue vertical lines. Their intersection consists of three points.

Let $R=\mathbb {Q} [x,y]$  be the ring of bivariate polynomials with rational coefficients and consider the ideal $I=\langle f,g\rangle$  generated by the polynomials

$f=x^{2}-y$ ,
$g=x^{3}-x$ .

By reducing g by f, one obtains a new polynomial k such that $I=\langle f,k\rangle :$

$k=g-xf=xy-x.$

None of f and k is reducible by the other, but xk is reducible by f, which gives another polynomial in I:

$h=xk-(y-1)f=y^{2}-y.$

Under lexicographic ordering with $x>y$  we have

lt(f) = x2
lt(k) = xy
lt(h) = y2

As f, k and h belong to I, and none of them is reducible by the others, none of $\{f,k\},$  $\{f,h\},$  and $\{h,k\}$  is a Gröbner basis of I.

On the other hand, {f, k, h} is a Gröbner basis of I, since the S-polynomials

{\begin{aligned}yf-xk&=y(x^{2}-y)-x(xy-x)=f-h\\yk-xh&=y(xy-x)-x(y^{2}-y)=0\\y^{2}f-x^{2}h&=y(yf-xk)+x(yk-xh)\end{aligned}}

can be reduced to zero by f, k and h.

The method that has been used here for finding h and k, and proving that {f, k, h} is a Gröbner basis is a direct application of Buchberger's algorithm. So, it can be applied mechanically to any similar example, although, in general, there are many polynomials and S-polynomials to consider, and the computation is generally too large for being done without a computer.

## Properties and applications of Gröbner bases

Unless explicitly stated, all the results that follow are true for any monomial ordering (see that article for the definitions of the different orders that are mentioned below).

It is a common misconception that the lexicographical order is needed for some of these results. On the contrary, the lexicographical order is, almost always, the most difficult to compute, and using it makes impractical many computations that are relatively easy with graded reverse lexicographic order (grevlex), or, when elimination is needed, the elimination order (lexdeg) which restricts to grevlex on each block of variables.

### Equality of ideals

Reduced Gröbner bases are unique for any given ideal and any monomial ordering. Thus two ideals are equal if and only if they have the same (reduced) Gröbner basis (usually a Gröbner basis software always produces reduced Gröbner bases).

### Membership and inclusion of ideals

The reduction of a polynomial f by the Gröbner basis G of an ideal I yields 0 if and only if f is in I. This allows to test the membership of an element in an ideal. Another method consists in verifying that the Gröbner basis of G∪{f} is equal to G.

To test if the ideal I generated by f1, …, fk is contained in the ideal J, it suffices to test that every fI is in J. One may also test the equality of the reduced Gröbner bases of J and J ∪ {f1, ...,fk}.

### Solutions of a system of algebraic equations

Any set of polynomials may be viewed as a system of polynomial equations by equating the polynomials to zero. The set of the solutions of such a system depends only on the generated ideal, and, therefore does not change when the given generating set is replaced by the Gröbner basis, for any ordering, of the generated ideal. Such a solution, with coordinates in an algebraically closed field containing the coefficients of the polynomials, is called a zero of the ideal. In the usual case of rational coefficients, this algebraically closed field is chosen as the complex field.

An ideal does not have any zero (the system of equations is inconsistent) if and only if 1 belongs to the ideal (this is Hilbert's Nullstellensatz), or, equivalently, if its Gröbner basis (for any monomial ordering) contains 1, or, also, if the corresponding reduced Gröbner basis is .

Given the Gröbner basis G of an ideal I, it has only a finite number of zeros, if and only if, for each variable x, G contains a polynomial with a leading monomial that is a power of x (without any other variable appearing in the leading term). If this is the case, then the number of zeros, counted with multiplicity, is equal to the number of monomials that are not multiples of any leading monomial of G. This number is called the degree of the ideal.

When the number of zeros is finite, the Gröbner basis for a lexicographical monomial ordering provides, theoretically, a solution: the first coordinate of a solution is a root of the greatest common divisor of polynomials of the basis that depend only on the first variable. After substituting this root in the basis, the second coordinate of this solution is a root of the greatest common divisor of the resulting polynomials that depend only on the second variable, and so on. This solving process is only theoretical, because it implies GCD computation and root-finding of polynomials with approximate coefficients, which are not practicable because of numeric instability. Therefore, other methods have been developed to solve polynomial systems through Gröbner bases (see System of polynomial equations for more details).

### Dimension, degree and Hilbert series

The dimension of an ideal I in a polynomial ring R is the Krull dimension of the ring R/I and is equal to the dimension of the algebraic set of the zeros of I. It is also equal to number of hyperplanes in general position which are needed to have an intersection with the algebraic set, which is a finite number of points. The degree of the ideal and of its associated algebraic set is the number of points of this finite intersection, counted with multiplicity. In particular, the degree of a hypersurface is equal to the degree of its definition polynomial.

Both degree and dimension depend only on the set of the leading monomials of the Gröbner basis of the ideal for any monomial ordering.

The dimension is the maximal size of a subset S of the variables such that there is no leading monomial depending only on the variables in S. Thus, if the ideal has dimension 0, then for each variable x there is a leading monomial in the Gröbner basis that is a power of x.

Both dimension and degree may be deduced from the Hilbert series of the ideal, which is the series ${\textstyle \sum _{i=0}^{\infty }d_{i}t^{i}}$ , where $d_{i}$  is the number of monomials of degree i that are not multiple of any leading monomial in the Gröbner basis. The Hilbert series may be summed into a rational fraction

$\sum _{i=0}^{\infty }d_{i}t^{i}={\frac {P(t)}{(1-t)^{d}}},$

where d is the dimension of the ideal and $P(t)$  is a polynomial such that $P(1)$  is the degree of the ideal.

Although the dimension and the degree do not depend on the choice of the monomial ordering, the Hilbert series and the polynomial $P(t)$  change when one changes the monomial ordering.

Most computer algebra systems that provide functions to compute Gröbner bases provide also functions for computing the Hilbert series, and thus also the dimension and the degree.

### Elimination

The computation of Gröbner bases for an elimination monomial ordering allows computational elimination theory. This is based on the following theorem.

Consider a polynomial ring $K[x_{1},\ldots ,x_{n},y_{1},\ldots ,y_{m}]=K[X,Y],$  in which the variables are split into two subsets X and Y. Let us also choose an elimination monomial ordering "eliminating" X, that is a monomial ordering for which two monomials are compared by comparing first the X-parts, and, in case of equality only, considering the Y-parts. This implies that a monomial containing an X-variable is greater than every monomial independent of X. If G is a Gröbner basis of an ideal I for this monomial ordering, then $G\cap K[Y]$  is a Gröbner basis of $I\cap K[Y]$  (this ideal is often called the elimination ideal). Moreover, $G\cap K[Y]$  consists exactly of the polynomials of G whose leading terms belong to K[Y] (this makes very easy the computation of $G\cap K[Y]$ , as only the leading monomials need to be checked).

This elimination property has many applications, some described in the next sections.

Another application, in algebraic geometry, is that elimination realizes the geometric operation of projection of an affine algebraic set into a subspace of the ambient space: with above notation, the (Zariski closure of) the projection of the algebraic set defined by the ideal I into the Y-subspace is defined by the ideal $I\cap K[Y].$

The lexicographical ordering such that $x_{1}>\cdots >x_{n}$  is an elimination ordering for every partition $\{x_{1},\ldots ,x_{k}\},\{x_{k+1},\ldots ,x_{n}\}.$  Thus a Gröbner basis for this ordering carries much more information than usually necessary. This may explain why Gröbner bases for the lexicographical ordering are usually the most difficult to compute.

### Intersecting ideals

If I and J are two ideals generated respectively by {f1, ..., fm} and {g1, ..., gk}, then a single Gröbner basis computation produces a Gröbner basis of their intersection I ∩ J. For this, one introduces a new indeterminate t, and one uses an elimination ordering such that the first block contains only t and the other block contains all the other variables (this means that a monomial containing t is greater than every monomial that does not contain t). With this monomial ordering, a Gröbner basis of I ∩ J consists in the polynomials that do not contain t, in the Gröbner basis of the ideal

$K=\langle tf_{1},\ldots ,tf_{m},(1-t)g_{1},\ldots ,(1-t)g_{k}\rangle .$

In other words, I ∩ J is obtained by eliminating t in K. This may be proven by remarking that the ideal K consists in the polynomials $(a-b)t+b$  such that $a\in I$  and $b\in J$ . Such a polynomial is independent of t if and only if a=b, which means that $b\in I\cap J.$

### Implicitization of a rational curve

A rational curve is an algebraic curve that has a set of parametric equations of the form

{\begin{aligned}x_{1}&={\frac {f_{1}(t)}{g_{1}(t)}}\\&\;\;\vdots \\x_{n}&={\frac {f_{n}(t)}{g_{n}(t)}},\end{aligned}}

where $f_{i}(t)$  and $g_{i}(t)$  are univariate polynomials for 1 ≤ in. One may (and will) suppose that $f_{i}(t)$  and $g_{i}(t)$  are coprime (they have no non-constant common factors).

Implicitization consists in computing the implicit equations of such a curve. In case of n = 2, that is for plane curves, this may be computed with the resultant. The implicit equation is the following resultant:

${\text{Res}}_{t}(g_{1}x_{1}-f_{1},g_{2}x_{2}-f_{2}).$

Elimination with Gröbner bases allows to implicitize for any value of n, simply by eliminating t in the ideal $\langle g_{1}x_{1}-f_{1},\ldots ,g_{n}x_{n}-f_{n}\rangle .$  If n = 2, the result is the same as with the resultant, if the map $t\mapsto (x_{1},x_{2})$  is injective for almost every t. In the other case, the resultant is a power of the result of the elimination.

### Saturation

When modeling a problem by polynomial equations, it is often assumed that some quantities are non-zero, so as to avoid degenerate cases. For example, when dealing with triangles, many properties become false if the triangle degenerates to a line segment, i.e. the length of one side is equal to the sum of the lengths of the other sides. In such situations, one cannot deduce relevant information from the polynomial system unless the degenerate solutions are ignored. More precisely, the system of equations defines an algebraic set which may have several irreducible components, and one must remove the components on which the degeneracy conditions are everywhere zero.

This is done by saturating the equations by the degeneracy conditions, which may be done via the elimination property of Gröbner bases.

#### Definition of the saturation

The localization of a ring consists in adjoining to it the formal inverses of some elements. This section concerns only the case of a single element, or equivalently a finite number of elements (adjoining the inverses of several elements is equivalent to adjoining the inverse of their product). The localization of a ring R by an element f is the ring $R_{f}=R[t]/(1-ft),$  where t is a new indeterminate representing the inverse of f. The localization of an ideal I of R is the ideal $R_{f}I$  of $I_{f}.$  When R is a polynomial ring, computing in $R_{f}$  is not efficient because of the need to manage the denominators. Therefore, localization is usually replaced by the operation of saturation.

The saturation with respect to f of an ideal I in R is the inverse image of $R_{f}I$  under the canonical map from R to $R_{f}.$  It is the ideal $I:f^{\infty }=\{g\in R|(\exists k\in \mathbb {N} )f^{k}g\in I\}$  consisting in all elements of R whose product with some power of f belongs to I.

If J is the ideal generated by I and 1−ft in R[t], then $I:f^{\infty }=J\cap R.$  It follows that, if R is a polynomial ring, a Gröbner basis computation eliminating t produces a Gröbner basis of the saturation of an ideal by a polynomial.

The important property of the saturation, which ensures that it removes from the algebraic set defined by the ideal I the irreducible components on which the polynomial f is zero, is the following: The primary decomposition of $I:f^{\infty }$  consists of the components of the primary decomposition of I that do not contain any power of f.

#### Computation of the saturation

A Gröbner basis of the saturation by f of a polynomial ideal generated by a finite set of polynomials F, may be obtained by eliminating t in $F\cup \{1-tf\},$  that is by keeping the polynomials independent of t in the Gröbner basis of $F\cup \{1-tf\}$  for an elimination ordering eliminating t.

Instead of using F, one may also start from a Gröbner basis of F. Which method is most efficient depends on the problem. However, if the saturation does not remove any component, that is if the ideal is equal to its saturated ideal, computing first the Gröbner basis of F is usually faster. On the other hand, if the saturation removes some components, the direct computation may be dramatically faster.

If one wants to saturate with respect to several polynomials $f_{1},\ldots ,f_{k}$  or with respect to a single polynomial which is a product $f=f_{1}\cdots f_{k},$  there are three ways to proceed which give the same result but may have very different computation times (it depends on the problem which is the most efficient).

• Saturating by $f=f_{1}\cdots f_{k}$  in a single Gröbner basis computation.
• Saturating by $f_{1},$  then saturating the result by $f_{2},$  and so on.
• Adding to F or to its Gröbner basis the polynomials $1-t_{1}f_{1},\ldots ,1-t_{k}f_{k},$  and eliminating the $t_{i}$  in a single Gröbner basis computation.

### Effective Nullstellensatz

Hilbert's Nullstellensatz has two versions. The first one asserts that a set of polynomials has no common zeros over an algebraic closure of the field of the coefficients, if and only if 1 belongs to the generated ideal. This is easily tested with a Gröbner basis computation, because 1 belongs to an ideal if and only if 1 belongs to the Gröbner basis of the ideal, for any monomial ordering.

The second version asserts that the set of common zeros (in an algebraic closure of the field of the coefficients) of an ideal is contained in the hypersurface of the zeros of a polynomial f, if and only if a power of f belongs to the ideal. This may be tested by saturating the ideal by f; in fact, a power of f belongs to the ideal if and only if the saturation by f provides a Gröbner basis containing 1.

### Implicitization in higher dimension

By definition, an affine rational variety of dimension k may be described by parametric equations of the form

{\begin{aligned}x_{1}&={\frac {p_{1}}{p_{0}}}\\&\;\;\vdots \\x_{n}&={\frac {p_{n}}{p_{0}}},\end{aligned}}

where $p_{0},\ldots ,p_{n}$  are n+1 polynomials in the k variables (parameters of the parameterization) $t_{1},\ldots ,t_{k}.$  Thus the parameters $t_{1},\ldots ,t_{k}$  and the coordinates $x_{1},\ldots ,x_{n}$  of the points of the variety are zeros of the ideal

$I=\left\langle p_{0}x_{1}-p_{1},\ldots ,p_{0}x_{n}-p_{n}\right\rangle .$

One could guess that it suffices to eliminate the parameters to obtain the implicit equations of the variety, as it has been done in the case of curves. Unfortunately this is not always the case. If the $p_{i}$  have a common zero (sometimes called base point), every irreducible component of the non-empty algebraic set defined by the $p_{i}$  is an irreducible component of the algebraic set defined by I. It follows that, in this case, the direct elimination of the $t_{i}$  provides an empty set of polynomials.

Therefore, if k>1, two Gröbner basis computations are needed to implicitize:

1. Saturate $I$  by $p_{0}$  to get a Gröbner basis $G$
2. Eliminate the $t_{i}$  from $G$  to get a Gröbner basis of the ideal (of the implicit equations) of the variety.

## Algorithms and implementations

Buchberger's algorithm is the oldest algorithm for computing Gröbner bases. It has been devised by Bruno Buchberger together with the Gröbner basis theory. It is straightforward to implement, but it appeared soon that raw implementations can solve only trivial problems. The main issues are the following ones:

1. Even when the resulting Gröbner basis is small, the intermediate polynomials can be huge. It result that most of the computing time may be spent in memory management. So, specialized memory management algorithms may be a fundamental part of an efficient implementation.
2. The integers occurring during a computation may be sufficiently large for making fast multiplication algorithms and multimodular arithmetic useful. For this reason, most optimized implementations use the GMPlibrary. Also, modular arithmetic, Chinese remainder theorem and Hensel lifting are used in optimized implementations
3. The choice of the S-polynomials to reduce and of the polynomials used for reducing them is devoted to heuristics. As in many computational problems, heuristics cannot detect most hidden simplifications, and if heuristic choices are avoided, one may get a dramatic improvement of the algorithm efficiency.
4. In most cases most S-polynomials that are computed are reduced to zero; that is, most computing time is spent to compute zero.
5. The monomial ordering that is most often needed for the applications (pure lexicographic) is not the ordering that leads to the easiest computation, generally the ordering degrevlex.

For solving 3. many improvements, variants and heuristics have been proposed before the introduction of F4 and F5 algorithms by Jean-Charles Faugère. As these algorithms are designed for integer coefficients or with coefficients in the integers modulo a prime number, Buchberger's algorithm remains useful for more general coefficients.

Roughly speaking, F4 algorithm solves 3. by replacing many S-polynomial reductions by the row reduction of a single large matrix for which advanced methods of linear algebra can be used. This solves partially issue 4., as reductions to zero in Buchberger's algorithm correspond to relations between rows of the matrix to be reduced, and the zero rows of the reduced matrix correspond to a basis of the vector space of these relations.

F5 algorithm improves F4 by introducing a criterion that allows reducing the size of the matrices to be reduced. This criterion is almost optimal, since the matrices to be reduced have full rank in sufficiently regular cases (in particular, when the input polynomials form a regular sequence). Tuning F5 for a general use is difficult, since its performances depend on an order on the input polynomials and a balance between the incrementation of the working polynomial degree and of the number of the input polynomials that are considered. To date (2022), there is no distributed implementation that is significantly more efficient than F4, but, over modular integers F5 as been used successfully for several cryptographic challenges; for example, for breaking HFE challenge.

Issue 5. has been solved by the discovery of basis conversion algorithms that start from the Gröbner basis for one monomial ordering for computing a Gröbner basis for another monomial ordering. FGLM algorithm is such a basis conversion algorithm that works only in the zero-dimensional case (where the polynomials have a finite number of complex common zeros) and has a polynomial complexity in the number of common zeros. A basis conversion algorithm that works is the general case is the Gröbner walk algorithm. In its original form, FGLM may be the critical step for solving systems of polynomial equations because FGML does not take into account the sparsity of involved matrices. This has been fixed by the introduction of sparse FGLM algorithms.

Most general-purpose computer algebra systems have implementations of one or several algorithms for Gröbner bases, often also embedded in other functions, such as for solving systems of polynomial equations or for simplifying trigonometric functions; this is the case, for example, of CoCoA, GAP , Macaulay 2, Magma, Maple, Mathematica, SINGULAR, SageMath and SymPy. When F4 is available, it is generally much more efficient than Buchberger's algorithm. The implementation techniques and algorithmic variants are not always documented, although they may have a dramatic effect on efficiency.

As of 2022, the fastest implementations of F4 and (sparse)-FGLM seem to be those of the library Msolve. Beside Gröbner algorithms, Msolve contains fast algorithms for real-root isolation, and combines all these functions in an algorithm for the real solutions of systems of polynomial equations that outperforms dramatically the other software for this problem (Maple and Magma). Msolve is available on GitHub, and is interfaced with Julia, Maple and SageMath; this means that Msolve can be used directly from within these software environments.

## Areas of Applications

### Error-Correcting Codes

Gröbner basis has been applied in the theory of error-correcting codes for algebraic decoding. By using Gröbner basis computation on various forms of error-correcting equations, decoding methods were developed for correcting errors of cyclic codes, affine variety codes, algebraic-geometric codes and even general linear block codes. Applying Gröbner basis in algebraic decoding is still a research area of channel coding theory.