Introduction to Gröbner bases

Math 239: Discrete Mathematics for the Life Sciences
Spring 2008
Lecture 4 — February 5
Lecturer: Lior Pachter
4.1
Scribe/ Editor: Michaeel Kazi/ Cynthia Vinzant
Introduction to Gröbner Bases
In this lecture we provide a brief introduction to Gröbner bases. Our presentation is based
on the introductory article [1] and lecture [2].
Gröbner Bases can be viewed as generalizations of Gaussian elimination, the Euclidean
algorithm, and the simplex algorithm for linear programming. To find a Gröbner Basis for
a finitely generated ideal of polynomials, we’ll use Buchberger’s Algorithm, whose input is a
set of generators and whose output is a Gröbner Basis for the ideal they generate.
Input: F = {f1 , f2 , ..., fn }, polynomials in several variables
Output: G = {g1 , g2 , ..., gm }, a Gröbner basis
The actual algorithm appears in a later section.
Example. Gaussian elimination.
Consider the following system of equations:
2x + 3y + 4z = 5
3x + 4y + 5z = 2.
We seek a simpler description of the solution set:
x = z − 14
y = 11 − 2z.
So using our algorithm or Gaussian elimination (which are the same in this linear case),
F = {2x + 3y + 4z − 5, 3x + 4y + 5z − 2}
G = {x − z + 14, y + 2z − 11}.
Here we have solved for x and y in terms of z. We could have also solved for x and z in
terms of y. In computing our Gröbner Basis G, the difference between these is our choice of
term order, (a total ordering of monomials), which we will discuss later. In our example, we
used an ordering with x > y > z, whereas solving for x and z in terms of y would correspond
to using an ordering with x > z > y.
4-1
Math 239
Lecture 4 — February 5
Spring 2008
Example. Euclidean algorithm for computing the GCD of two polynomials in one variable.
If we were to look for the greatest common divisor of two polynomials, f1 and f2 ,
f1 = x4 − 12x3 + 49x3 − 78x + 40
f2 = x5 − 5x4 + 5x3 + 5x2 − 6x,
Gaussian elimination would give us
gcd(f1 , f2 ) = x2 − 3x + 2.
With respect to our Gröbner basis algorithm we have input
F = {f1 , f2 } = {x4 − 12x3 + 49x2 − 78x + 40, x5 − 5x4 + 5x3 + 5x2 − 6x}
and output
G = {x2 − 3x + 2}.
Example. Integer Programming
Suppose we wanted to minimize the linear function P +N +D+Q subject to the constraint
P, N, D, Q ∈ Z≥0 and P + 5N + 10D + 25Q = 117. (This problem refers to making change
in US currency with the fewest number of coins.)
Our optimal solution would be (P, N, D, Q) = (2, 1, 1, 4).
We can solve this problem using Gröbner bases as follows. Replace the values of each
coin with polynomials:
F = {p5 − n, p10 − d, p25 − q}.
So one nickel is five pennies, etc. Then our algorithm outputs
G = {p5 − n, n2 − d, d2 n − q, d3 − nq},
which indicates the moves you may perform to reach an optimal solution. For example, we
start with 117 pennies and replace every 5 pennies by a nickel, every two nickels with a
dime, and so forth, leading to a solution with the fewest number of coins. Notice this is not
true of the relations we started out with, since you might have to increase your number of
coins (trading in two dimes and a nickel for twenty-five pennies) before reducing them again
(trading in those twenty-five pennies for a quarter).
4.2
Background Information
Let F be a set of polynomials in k[x1 , ..., xn ] = k[x], where k is some field.
The ideal generated by F is the set
< F >= {p1 f1 + . . . + pr fr : fi ∈ F and pi ∈ k[x]}.
4-2
Math 239
Lecture 4 — February 5
Spring 2008
Theorem 4.1. (Hilbert’s Basis Theorem) Every ideal of k[x1 , ..., xn ] is finitely generated.
Proof. Homework. (Hint: Noetherian rings have the ascending chain property.)
Looking back at our three examples, we see that the ideals generated by our input and
our output, < F > and < G >, are equal.
4.2.1
Term Order
Definition 4.2. A term order on the set of variables x1 , . . . , xn is a total order < on the set
of monomials xa = x1 a1 x2 a2 · · · xn an satisfying
1. If xa , xb , and xc are monomials, then xa < xb =⇒ xc xa < xc xb , and
2. 1 < xa , a 6= 0.
For example, for k[x], there is only one order: 1 < x < x2 < . . . < xn < . . . For k[x1 , x2 ],
there are many possibilities, such as
• Degree lexicographic: 1 < x1 < x2 < x21 < x1 x2 < x22 < x31 < . . .
• Pure lexicographic: 1 < x1 < x21 < x31 < . . . < x2 < x1 x2 < x21 x2 < . . .
Once we establish a term order we can speak of the initial ideal of an ideal I ⊂ k[x].
Definition 4.3. Every f ∈ k[x] has an initial monomial in< (f ), the largest monomial with
a nonzero coefficient.
Given an ideal I in k[x] we have
in< (I) := {in< (f ) : f ∈ I} =< in< (f ) : f ∈ I > .
Definition 4.4. A finite subset G of an ideal I is a Gröbner basis with respect to < if
in< (< G >) =< in< (g) : g ∈ G >= in< (I).
Notice that Gröbner bases are not unique. You can put any element of I into G that
isn’t already in it, and you will still have a Gröbner basis. For uniqueness we need . . .
Definition 4.5. A reduced Gröbner basis for an ideal I is a Gröbner basis G satisfying
1. For each g ∈ G the coefficient of in< (g) is 1.
2. The set of {in< (g) : g ∈ G} minimally generates in< (I).
3. No trailing (non-initial) terms of any g ∈ G lie in in< (I).
Theorem 4.6. The reduced Gröbner basis is unique.
Every Gröbner basis can be turned into a reduced Gröbner basis through autoreduction.
4-3
Math 239
4.3
4.3.1
Lecture 4 — February 5
Spring 2008
Buchberger’s Algorithm
Is G a Gröbner basis?
To test whether or not G is a Gröbner basis, we need to check that in< (G) generates in< (I),
that is check whether or not any elements of I have initials terms that are not divisible by
an element of in< (G).
For any g, g 0 ∈ G, the S-polynomial of g and g 0 is as follows:
Sg,g0 = m0 g − mg 0 ,
where m, m0 are the monomials of smallest degree that cancel out the leading terms of g
and g 0 .
Example. F = {x2 + 3x − 4, x3 − 5x + 4}
Form the S-polynomial of the first two polynomials:
S = x(x2 + 3x − 4) − 1(x3 − 5x + 4) = 3x2 + x − 4.
Definition 4.7. Let I ⊂ k[x] be an ideal with term order <. A monomial xa is standard if
it is not in the ideal in< (I).
Example.
in< (I) =< x31 , x42 , x53 >
The standard monomials are xa1 xb2 xc3 where a < 3, b < 4, c < 5.
Example.
in< (I) =< x31 , x42 , x1 x43 >
In this case, the number of standard monomials is infinite because xn3 is standard for every n.
In general, the set of standard monomials is a Q-vector space basis for the quotient Q[x]/I.
Therefore every polynomial modulo I can be expressed as a linear combination of standard
monomials. This expression is called its normal form.
Definition 4.8. The normal form of a polynomial f ∈ Q[x] with respect to I is the polynomial f mod I expressed in terms of standard monomials.
Theorem 4.9. G is a Gröbner basis iff the normal form of Sg,g0 is 0 for all g, g 0 ∈ G.
4-4
Math 239
4.3.2
Lecture 4 — February 5
Spring 2008
The Algorithm
Using S-polynomials to check whether G is a Gröbner basis motivates Buchberger’s algorithm
for constructing one.
Input: A set of polynomials, F .
1. Check if F is a Gröbner basis. That is, check if the normal form of Sg,g0 is zero for all
g, g 0 ∈ F .
2. If yes, then perform autoreduction and output the reduced Gröbner basis.
3. If not, then let Fnew = Fold ∪ {p} where p is the nonzero normal form of some Sg,g0 .
4. Repeat from Step 1.
Theorem 4.10. Buchberger’s algorithm terminates.
Proof. If p be a nonzero normal form of some Sg,g0 . Each time we add some p to our
collection F we (strictly) increase the size of the ideal generated by F ’s initial ideals. So:
< in< (Fold ) >=< in< (f1 ), . . . , in< (fd ) >(< in< (f1 ), . . . , in< (fd ), in< (p) >=< in< (Fnew ) >
This gives us an ascending chain of ideals, which must become stationary because k[x] is
Noetherian. Thus eventually we will not be able to find such a p and the algorithm will
terminate.
This algorithm has immense applications, for example in finding solutions to systems of
polynomial equations, which is useful in finding equilibria of dynamical systems.
4.4
Varieties and Parametrizations
Definition 4.11. If F is a set of polynomials then the variety defined by F is
V (F ) = {z = (z1 , . . . , zn ) ∈ Cn : fi (z) = 0 ∀fi ∈ F }
Note that V (F ) = V (< F >), so we might as well talk only about the variety of an ideal.
Definition 4.12. Let
I(S) = {f (x1 , . . . , xn ) ∈ C[x1 , . . . , xn ] : f (a1 , . . . , an ) = 0 ∀(a1 , . . . , an ) ∈ S}.
We call I(S) the vanishing ideal of S.
For our purposes, we are interested in a particular type of S, which you may think about
as a statistical model.
4-5
Math 239
Lecture 4 — February 5
Spring 2008
Definition 4.13. S is a polynomial parametrization if it takes the form
S = { (g1 (a), . . . gn (a)) : a ∈ Cs },
with parameters g1 , . . . , gn ∈ C[t1 , . . . , ts ].
Theorem 4.14. If S is a polynomial parametrization and I(S) =< f1 , . . . , fM >, then
V (f1 , . . . , fM ) and S differ by a set of dimension less than dim(S).
4-6
Bibliography
[1] B. Sturmfels What is a Gröbner basis? Notices of the American Mathematical Society,
52 (2005) 1199-1200.
[2] B. Sturmfels Gröbner bases MSRI lectures, available from http://www.msri.org.
7