Math 239: Discrete Mathematics for the Life Sciences Spring 2008 Lecture 4 February 5 Lecturer: Lior Pachter Scribe/ Editor: Michaeel Kazi/ Cynthia Vinzant 4.1 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 = {f 1, f 2,..., f n }, polynomials in several variables Output: G = {g 1, g 2,..., g m }, 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
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, f 1 and f 2, f 1 = x 4 12x 3 + 49x 3 78x + 40 f 2 = x 5 5x 4 + 5x 3 + 5x 2 6x, Gaussian elimination would give us gcd(f 1, f 2 ) = x 2 3x + 2. With respect to our Gröbner basis algorithm we have input F = {f 1, f 2 } = {x 4 12x 3 + 49x 2 78x + 40, x 5 5x 4 + 5x 3 + 5x 2 6x} and output G = {x 2 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 = {p 5 n, p 10 d, p 25 q}. So one nickel is five pennies, etc. Then our algorithm outputs G = {p 5 n, n 2 d, d 2 n q, d 3 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[x 1,..., x n ] = k[x], where k is some field. The ideal generated by F is the set < F >= {p 1 f 1 +... + p r f r : f i F and p i k[x]}. 4-2
Theorem 4.1. (Hilbert s Basis Theorem) Every ideal of k[x 1,..., x n ] 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 x 1,..., x n is a total order < on the set of monomials x a a = x 1 a2 a 1 x 2 x n n satisfying 1. If x a, x b, and x c are monomials, then x a < x b = x c x a < x c x b, and 2. 1 < x a, a 0. For example, for k[x], there is only one order: 1 < x < x 2 <... < x n <... For k[x 1, x 2 ], there are many possibilities, such as Degree lexicographic: 1 < x 1 < x 2 < x 2 1 < x 1 x 2 < x 2 2 < x 3 1 <... Pure lexicographic: 1 < x 1 < x 2 1 < x 3 1 <... < x 2 < x 1 x 2 < x 2 1x 2 <... 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
4.3 Buchberger s Algorithm 4.3.1 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 G, the S-polynomial of g and g is as follows: S g,g = m g mg, where m, m are the monomials of smallest degree that cancel out the leading terms of g and g. Example. F = {x 2 + 3x 4, x 3 5x + 4} Form the S-polynomial of the first two polynomials: S = x(x 2 + 3x 4) 1(x 3 5x + 4) = 3x 2 + x 4. Definition 4.7. Let I k[x] be an ideal with term order <. A monomial x a is standard if it is not in the ideal in < (I). Example. in < (I) =< x 3 1, x 4 2, x 5 3 > The standard monomials are x a 1x b 2x c 3 where a < 3, b < 4, c < 5. Example. in < (I) =< x 3 1, x 4 2, x 1 x 4 3 > In this case, the number of standard monomials is infinite because x n 3 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 S g,g is 0 for all g, g G. 4-4
4.3.2 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 S g,g is zero for all g, g F. 2. If yes, then perform autoreduction and output the reduced Gröbner basis. 3. If not, then let F new = F old {p} where p is the nonzero normal form of some S g,g. 4. Repeat from Step 1. Theorem 4.10. Buchberger s algorithm terminates. Proof. If p be a nonzero normal form of some S g,g. 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 < (F old ) >=< in < (f 1 ),..., in < (f d ) > < in < (f 1 ),..., in < (f d ), in < (p) >=< in < (F new ) > 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 = (z 1,..., z n ) C n : f i (z) = 0 f i 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(x 1,..., x n ) C[x 1,..., x n ] : f(a 1,..., a n ) = 0 (a 1,..., a n ) 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
Definition 4.13. S is a polynomial parametrization if it takes the form with parameters g 1,..., g n C[t 1,..., t s ]. S = { (g 1 (a),... g n (a)) : a C s }, Theorem 4.14. If S is a polynomial parametrization and I(S) =< f 1,..., f M V (f 1,..., f M ) and S differ by a set of dimension less than dim(s). >, then 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