Gr¨obnerBases: Membership and Graph Colouring

by Mitchell Gallinger

A project submitted to the Department of Mathematical Sciences in conformity with the requirements for Math 4301 (Honour’s Seminar)

Lakehead University Thunder Bay, Ontario, Canada copyright c (2013) Mitchell Gallinger Abstract

When looking at polynomial ideals, a problem that often arises is how to determine if an arbitrary polynomial is a member of the ideal. In this project we introduce the concept of a Gr¨obnerBasis, which is an algebraic tool used to determine ideal membership. The Gr¨obnerbasis was developed by Bruno Buchberger in 1965 and named for his advisor Wolfgang Gr¨obner. Once we have established a working knowledge of the Gr¨obnerbasis, we will delve into an interesting application in graph theory. By expressing a given graph as a set of polynomials, we will use Gr¨obner bases to determine if the graph is 3-colourable, and if so, determine all possible 3-colourings.

i Acknowledgements

It comes with no surprise that thanks are in order. I would like to thank: (i) My supervisors, Dr. Adam Van Tuyl and Dr. Jennifer Biermann; their knowledge and resources have been invaluable in my research. (ii) The Algebra Gang, consisting of my supervisors, Dr. Greg Lee, Jesse Krauel, and myself; their input and our weekly meetings have assisted in resolving errors and preparing me to present my research. (iii) My girlfriend Bradey; in listening to my practice presentations, to encouraging me when I felt overwhelmed; she has been essential in my success.

ii Contents

Abstract i Acknowledgements ii Chapter 1. Introduction 1 Chapter 2. Rings, Polynomials and the Division Algorithm 2 1. Rings 2 2. Polynomials 3 3. Monomial Orderings and The Division Algorithm 4 Chapter 3. Gr¨obnerBases 9 1. Definition and Existence of Gr¨obnerBases 9 2. Computing Gr¨obnerBases: Buchberger’s Algorithm 12 Chapter 4. Gr¨obnerBases for Graph Colouring 17 1. Graph Colouring 17 Chapter 5. Concluding Remarks 22 Bibliography 23

iii CHAPTER 1

Introduction

In , students are introduced to numerous concepts pertaining to groups and rings. While there are many interesting types of rings and subrings, a particuarly interesting one (and the focus of this project) is the ideal. With additive closure and absorption under multiplication, ideals have interesting and desirable properties. A com- mon problem in abstract algebra is that of determining if an object is a member of a given ideal; essentially, we wish to determine if the object can be expressed as a sum of products of known members of the ideal. This can be a problem of varying difficulty. In the case of ideals in the ring Z or in the in one variable, division will suffice. In the case of polynomial rings in multiple variables, simple division is no longer sufficient. Finding a method to determine ideal membership in this case gives us the following motivating problem:

Problem 1.1. Given an ideal I in a polynomial ring R = k[x1, x2, ..., xn] over a field k, how can we determine if an element f of R belongs to I? The project will be structured as follows: In Chapter 2 we will define various algebraic concepts fundamental to better under- standing the ideal membership problem. We begin by reviewing concepts from ring theory. We continue with polynomials, defining the polynomial ring, the leading term, and degree of a polynomial. Next we look at monomial orders and the division algorithm; the concept of a is necessary to perform division on multiple variable polynomials, as it gives us a means to order terms. In Chapter 3, we present a solution to Problem 1.1 using Gr¨obnerbases. We begin the chapter by defining S-polynomials, essential to compute Gr¨obnerbases. We then define and prove the existence of the Gr¨obnerBasis. We conclude the chapter with a definition and proof of the Buchberger’s Algorithm. This algorithm is used to compute the Gr¨obner Basis. In the final chapter we begin to look at an application of Gr¨obnerbases. We investigate a method used to determine if a graph is 3-colourable. We will define the necessary terms to understand the graph theory aspects, and then we will outline the process of determining whether a graph is 3-colourable. This chapter is motivated by the problem: Problem 1.2. Given a graph Γ how can we determine if there exists a vertex 3- colouring of Γ? Our approach will be to translate Problem 1.2 into an ideal membership problem. 1 CHAPTER 2

Rings, Polynomials and the Division Algorithm

Before we can define Gr¨obnerBases, we will first review some ideas from abstract algebra. We will start by defining rings, ideals, and the polynomial ring, as well as the necessary related objects. At the end of the chapter, we will define the division algorithm and monomial orderings which are necessary to implement the algorithm for polynomials in one or more variables. Our primary sources for this chapter will be [1, 3].

1. Rings

Recall the following definition from abstract algebra, Definition 2.1. A ring R is a set under two binary operations, · and +, such that for all a, b, c ∈ R: (i) a + b = b + a, (commutative addition) (ii) (a + b) + c = a + (b + c), (associative addition) (iii) There exists some 0 ∈ R such that 0 + a = a for all a ∈ R. (iv) For every a ∈ R there exists some −a ∈ R such that a + (−a) = 0. (v) a(bc) = (ab)c (associative multiplication) (vi) a(b + c) = ab + ac and (b + c)a = ba + ca, (the distributive property) Definition 2.2. A ring R is said to have unity if there exists a multiplicative identity, an element 1 ∈ R such that 1 · a = a · 1 = a for all a ∈ R. Definition 2.3. A ring R is commutative if a · b = b · a for every a, b ∈ R. Definition 2.4. A ring R is said to be an integral domain if for every a, b ∈ R, if a · b = 0, then either a = 0 or b = 0. Definition 2.5. A ring R is said to be a field if it satisfies the following conditions: (i) R is a commutative ring. (ii) R has unity. (iii) There exists a multiplicative inverse in R, that is, for every a ∈ R, a 6= 0, there exists an element a−1 such that a · a−1 = 1.

Some important fields include the rational numbers, Q , the real numbers, R , and the complex numbers, C. It is also important to note that all fields are integral domains. Definition 2.6. Let R be a commutative ring. A subset I ⊂ R is said to be an ideal if it satisfies the following: 2 3 (i) 0 ∈ I (ii) if a, b ∈ I then a + b ∈ I (iii) if a ∈ I and c ∈ R, then a · c ∈ I.

Definition 2.7. An ideal I is said to be finitely generated if there exists h1, h2, ..., hn ∈ I, such that every g ∈ I can be expressed as

g = h1a1 + h2a2 + ... + hnan,

where ai ∈ R. We will express this as I = hh1, h2, ..., hni, the ideal generated by h1, h2, ..., hn. Definition 2.8. An ideal I in a ring R is a principal ideal if I = hai for some a ∈ R

It is useful to note that all ideals in Z are principal ideals.

2. Polynomials

Having now reviewed key algebra terms, we review the concept of a polynomial. We will define a monomial, a polynomial, the degree of a monomial and polynomial, and finally the polynomial ring.

Definition 2.9. A monomial f on the variables x1, x2, ..., xn is a product of the form

α1 α2 αn f = x1 x2 ··· xn where all αi are non-negative integers. Definition 2.10. A monomial ideal is an ideal generated by monomials.

α1 α2 αn Definition 2.11. We define the degree of a monomial f = x1 x2 ··· xn , denoted deg(f), as the sum i=n X f = αi. i=1 By convention, when f = 0 we say that f has all degrees.

Definition 2.12. A polynomial f on the variables x1, x2, ..., xn over a field k is a finite linear combination of monomials with coefficients in k, such that n X αi f = aix , i=1

αi αi1 αi2 αin where αi is a finite n-tuple, αi = (αi1, αi2, ..., αin) and x = x1 x2 ··· xn and ai ∈ k is the coefficient of xαi .

Definition 2.13. We define a set of all polynomials f with the variables x1, x2, ..., xn, over a field k, as the polynomial ring, expressed as k[x1, x2, ..., xn]. If the polynomial ring being studied is of a smaller number of variables, it is a common practice to assign each variable a different symbol. For example, k[x],k[x, y], and k[x, y, z] are the polynomial rings in 1,2, and 3 variables, respectively. 4 The polynomial ring is indeed a ring. To prove this we simply ensure the set meets all the criteria outlined in Definition 2.1. We will forego the proof in interest of preserving space.

3. Monomial Orderings and The Division Algorithm

In order to determine ideal membership of some element, it is necessary to see if the element can be expressed as a product of one or more elements of the ideal. In the case of ideals in the polynomial ring, this will require us to perform division on multiple variable polynomials. Polynomials with mulitple variables must be ordered in such a way that division is possible. As such, in this section, we will define a monomial ordering, as well as a few of the common monomial orderings. We will conclude this section by looking at the division algorithm.

3.1. Monomial Orderings.

Definition 2.14. A monomial ordering on k[x1, x2, ..., xn] is any relation > on the n non-negative integers, Z≥0 which satisfies the properties listed below: (i) For every pair of tuples α and β, only one of α < β, α = β, or α > β holds, that n is, > is a total or linear ordering on Z≥0 n (ii) If α > β and γ ∈ Z≥0, then α + γ > β + γ n (iii) Every non-empty subset of Z≥0 has a smallest element under >. That is, > is a well-ordering. Alternatively, we say a monomial ordering is any relation on the set of monomials xα, n where α ∈ Z≥0 which satisfies the properties listed above

Pn αi Definition 2.15. Fix a monomial order and let f = i=1 aix . (i) A term of f is any entry with a non-zero coefficient. Each term is a monomial with a constant coefficient. The leading term is the first entry with a non-zero co-efficient, denoted LT (f). (ii) The leading monomial of a polynomial is the monomial contained in the leading term, denoted LM(f). (i) The total degree of f, denoted deg(f), is the maximum degree of any term of f.

n Lemma 2.16. An order relation > on Z≥0 is a well-ordering if and only if every strictly n decreasing sequence in Z≥0, α(1) > α(2) > ... > α(m) has a least element α(m).

Now that we have defined a monomial order, we will look at three common monomial orders, lexicographical order, graded lexicographical order and reverse graded lexicographi- cal order. 5 n Definition 2.17. Let α = (α1, α2, ..., αn) and β = (β1, β2, ..., βn), where α,β ∈ Z . n We say α >lex β if the leftmost non-zero entry of the vector difference α − β ∈ Z≥0 is positive. α β α β For any two monomials x and x , x >lex x if α >lex β

This method is comparable to the way in which dictionaries order words.

Theorem 2.18. Lex ordering is a monomial ordering.

n Proof. Let α = (α1, α2, ..., αn) and β = (β1, β2, ..., βn), and α, β ∈ Z≥0. (i) From our definition of lex ordering, it follows that lex ordering is a total order.

(ii) If α >lex β, we have the leftmost, strictly positive entry of α−β, say αk −βk > 0. n α γ α+γ β γ β+γ Then for any γ ∈ Z≥0, we have x x = x and x x = x . We will find (α + γ) − (β + γ) = α + γ − β − γ = α − β which again yields αk − βk > 0. This will remain the leftmost entry as each α and β are increasing by the same integer γ.

(iii) Suppose >lex were not a well ordering. So by Lemma 2.16, there will exist a strictly decreasing subsequence,

α(1) >lex α(2) >lex ... >lex α(l) >lex α(l + 1) >lex ... which does not terminate.

We will now look at the first entry of each α(i). Since Z≥0 is well-ordered, the first entries of α(i) must stabilize eventually. Therefore, there exists some k such that for i ≥ k all first entries are equal. Once the first coordinate has stabilized, we will look at the second coordinate using a similar method. We will continue in this way for every entry until we find some l such that α(l) = α(l + 1), which will contradict the fact that α(l) >lex α(l + 1). Thus, lex ordering is well ordered and we know that lex ordering is a monomial order.  Example 2.19. Considering the lex order with x > y > z. Let f = x4 + x3y4 + y7 + xyz + z2 + x3z2, f ∈ k[x, y, z]. We will use lex order to order the terms of f. We have the terms x4, x3y4, y7, xyz, z2, x3z2. We will think of these monomials as a product of each variable, with the variables not present having exponent 0. For example x4 = x4y0z0. Once we have expressed each term in this fashion, we will use the exponents to create tuples. So x4 = x4y0z0 = (4, 0, 0). We will find the tuples of each term to be (4, 0, 0), (3, 4, 0), (0, 7, 0), (1, 1, 1), (0, 0, 2), (3, 0, 2).

We will now sort these tuples by comparing all leftmost entries of the tuples. We know 4 > 3 = 3 > 1. This means we have determined our first four terms. However, since we have two tuples with 3 in the x position, we must now compare their second terms. Since 4 > 0 we get our first four tuples as (4, 0, 0), (3, 4, 0), (3, 0, 2), (1, 1, 1). 6 We will now do the same to compare the tuples with 0 in the leftmost column, and then again with the tuples containing 0 in the leftmost and center spot to get (4, 0, 0), (3, 4, 0), (3, 0, 2), (1, 1, 1), (0, 7, 0), (0, 0, 2).

We will now return these tuples to monomial form and have our ordered polynomial, f = x4 + x3y4 + x3z2 + xyz + y7 + z2.

We have now shown that lex ordering is a monomial ordering. You will have noticed from the examples that regardless of the degree of the monomial, the x1’s or x’s were at the front, and the rest went in numerical or alphabetical order. As was mentioned before, this is identical to how a dictionary works. However, it may be useful to order our monomials in such a way that larger degree mononomials will be toward the front of the polynomial.

Definition 2.20. Graded lexicographical order, or simply graded lex order is defined n as follows: given α, β ∈ Z≥0 we say α >grlex β if n n X X |α| = αi > |β| = βi. i=1 i=1

However, should |α| = |β|, then α >grlex β if α >lex β. In other words, we can say that lex order is used to “break ties”.

To prove that graded lex order is a monomial order, we would use a similar constuction as with lex order, so in the interest of preserving space, the proof will be omitted.

Example 2.21. Using the ordered polynomial from Example 2.19, f = x4 + x3y4 + x3z2 + xyz + y7 + z2, we will now reorder the polynomial using graded lex order. As before, we will express the terms in tuple form to get (4, 0, 0), (3, 4, 0), (3, 0, 2), (1, 1, 1), (0, 7, 0), (0, 0, 2).

Next we add each entry of each tuple to get the total degree, and find 4, 7, 5, 3, 7, 2. We now sort these numbers in terms of magnitude to find 7, 7, 5, 4, 3, 2. Notice we have two total degrees of 7, we will use lex ordering to determine which has higher order.

Since (3, 4, 0) >lex (0, 7, 0) we get our ordered tuples to be (3, 4, 0), (0, 7, 0), (3, 0, 2), (4, 0, 0), (1, 1, 1), (0, 0, 2) and our polynomial f = x3y4 + y7 + x3z2 + x4 + xyz + z2.

Definition 2.22. Graded Reverse Lexicographical Order or simply grevlex order, is n defined as follows: given α, β ∈ Z≥0 we say α >grevlex β if |α| > |β| or |α| = |β| and the rightmost non-zero entry of α − β is negative 7 Much like with grlex order, grevlex order will follow a similar proof as lex order, and as such, the proof has been omitted. Example 2.23. Using our ordered polynomial from Example 2.21, we have f = x3y4 + y7 + x3z2 + x4 + xyz + z2, which we will now order using grevlex order. As with graded lex, we begin ordering by total degree to get 7, 7, 5, 4, 3, 2, yet again we will have a tie. In grevlex, we break ties in a different way. Instead of taking the tuple with the largest leftmost non-zero entry to be greater, we take the tuple with the smallest rightmost non- zero entry to be greater. Using the tuple expression of the monomials, (3, 4, 0), (0, 7, 0) we will subtract them from each other. We have two possibilities: (3, 4, 0) − (0, 7, 0) = (3, −3, 0) or (0, 7, 0) − (3, 4, 0) = (−3, 3, 0). We will take whichever expression yields a negative number in the rightmost non-zero

column, in this case (3, −3, 0), which implies (3, 4, 0) >grevlex (0, 7, 0), and we get the ordered polynomial f = x3y4 + y7 + x3z2 + x4 + xyz + z2.

Notice in this example we produced the same ordering on our polynomial as in Example 2.21. It is important to note that this is not always the case.

3.2. The Division Algorithm. To determine ideal membership, one must deter- mine if an object can be expressed as a product of some members of an ideal. In the case of polynomials, this means we must establish a method of dividing polynomials. We will now introduce the division algorithm. While this is a familiar concept, we must modify it to allow division by polynomials in multiple variables. We will now define the division algorithm for polynomials. Theorem 2.24. The Division Algorithm Fix a monomial order. Let f1, f2, ..., fs, g ∈ k[x1, x2, ..., xn]. Then there exists some h1, h2, ..., hs, r ∈ k[x1, x2, ..., xn] such that s X g = h1f1 + h2f2 + ... + hsfs + r = ( higi) + r i=1

where no LT (fi) divides any term of the remainder r.

Below is an algorithm to find h1, h2, ..., hs, r:

(i) If for some i, LT (fi) divides LT (g), we take the first such fi and define LT (g) g1 = g − fi. LT (fi)

If not, then we let r1 = LT (g) and g1 = g − r1. (ii) Repeat step i with g1 in place of g. Continue in this fashion until gi = 0.

To prove this algorithm terminates involves simply demonstrating that each iteration will reduce the degree of the leading term, which can only be done finitely many times. 8 Example 2.25. Using lex order. take x+y, xy +z, y −z, xz +z ∈ k[x, y, z]. Using the division algorithm we will let g = xz+z and divide by the others.Let f1 = x+y,f2 = xy+z, and f3 = y − z.

(i) Dividing g by f1 gives xz + z = (z)(x + y) + yz − z. ∗ ∗ Let yz −z = r be the current remainder. Notice LT (f1) does not divide LT (r ). ∗ (ii) We continue by dividing r by f2 to get

xz + z = (z)(f1) + (0)(xy + z) + yz − z. ∗ ∗ Notice r stays the same and neither LT (f1) nor LT (f2) divides LT (r ). ∗ (iii) We now divide r by f3 to get 2 xz + z = (z)(f1) + (0)(f2) + (−z)(y − z) + z + z. 2 ∗ ∗ ∗ We now set z + z = r . Since no fi divides r we may set r = r to be our final remainder. Thus, we know that xz + z divided by x + y,xy + z, and y − z may be expressed as xz + z = (z)(x + y) + (0)(xy + z) + (−z)(y − z) + z2 + z.

As mentioned before, in order to determine whether an object is a member of an ideal, we must be able to express the object as a sum of products of known members of the ideal. The division algorithm allows us to do this, and in the case of ideals in Z or k[x], it is a sufficient method. In integer ideals, the division algorithm will a remainder of 0 if and only if the integer is in the ideal. In the more abstract case of polynomials in multiple variables however, without the proper divisors, we may terminate the algorithm with a non-zero remainder when in fact the polynomial is a member of the ideal. Take for example: Example 2.26. Using lex order. Take x + y, xy + z, y − z, xz + z ∈ k[x, y, z] and let I = hxy + z, x + y, y − zi. We will now attempt to use division to see if xz + z ∈ I. From Example 2.25 we know that xz + z = (z)(x + y) + (0)(xy + z) + (−z)(y − z) + z2 + z. Since division yields a remainder r = z2 − z we want to conclude that xz + z∈ / I. Unfortunately, xz +z may be written as (xy +z)−x(y −z), which shows it is in the ideal.

Thus we must establish a method to state absolutely whether a polynomial is contained in an ideal or not. CHAPTER 3

Gr¨obnerBases

We will now discuss the main idea of this paper. Using the tools from the previous chapter, we will now define the Gr¨obner basis, prove its existence, and then learn the techniques to compute this basis. Our main resources for this chapter will be [1, 3, 2]

1. Definition and Existence of Gr¨obnerBases

In this section we will be looking in depth at the requirements and properties necessary to define the Gr¨obnerbasis. Starting with the definition of the Gr¨obner basis, we will then prove its existence in ideals in the polynomial ring.

Definition 3.1. Let I ⊂ k[x1, x2, ..., xn] be an ideal. The initial ideal of I, or the leading term ideal, will be defined such that, LT (I) = hLT (g): g ∈ Ii. By convention, we have that LT (h0i) = h0i.

In other words, the initial ideal is an ideal such that each generator is the leading term of the polynomials of I. It is important to note that LT (I) does not necessarily equal I. Additionally, LT (I) is a monomial ideal since the leading term of a polynomial is actually a monomial multiplied by a constant coefficient.

Definition 3.2. Let I ⊂ k[x1, x2, ..., xn] be an ideal. A Gr¨obnerBasis for I is a collection of non-zero polynomials

G = {f1, f2, ..., fs} ⊂ I

such that LT (f1), LT (f2), ..., LT (fs) generate LT (I).

A Gr¨obnerbasis will actually generate I, which we will prove in Corollary 3.4. We will now propose a solution to Problem 1.1. We will show that using Gr¨obnerbases, we can find generators for an ideal such that if a polynomial g is not divisible by the generators, it cannot belong to the ideal.

Proposition 3.3. Fix a monomial order. For any ideal I ⊂ k[x1, x2, ..., xn], dividing a polynomial g by a Gr¨obnerbasis {f1, f2, ..., fs} of I will terminate in a finite number of steps. We will have either:

(i) If the division algorithm returns g = h1f1 + h2f2 + ··· + hsfs, where the hi are polynomials and there is no remainder term, then we have g ∈ I. 9 10

(ii) If the division algorithm returns g = h1f1 + h2f2 + ··· + hnfn + r, such that r is some polynomial where LT (r) is not divisible by any LT (fi), then g∈ / hLT (fi)i and as such g∈ / I.

Notice that the conditions presented in this proposition have results that determine if a polynomial is not only in LT (I), but in I itself. Thus, proving the following corollary will in effect prove Proposition 3.3.

Corollary 3.4. Fix a monomial order. Let I ⊂ k[x1, x2, ..., xn] be an ideal. If G = {f1, f2, ..., fs} is a Gr¨obnerbasis for I, then I = hf1, f2, ..., fsi. To prove the corollary, we will require the following key lemma.

α1 α2 αn n Lemma 3.5. Fix a monomial order. Let I = hx , x , ..., x i where αi ∈ Z≥0. If we have some monomial m ∈ I, then xαi |m for some xαi ∈ I.

Proof. Let xβ be a monomial in I. Then we can write β X α(i) x = x wi i β where wi are polynonomials. In particular, we will find that x appears in the right hand α(i) β side as a product of x wi for some i. As such, we conclude that x is divisible by α(i) x ∈ I. 

Proof of Corollary 3.4. To prove I = hf1, f2, ..., fsi, we have two cases to dis- cuss. (i) The division algorithm terminates with r = 0. If this should happen, we know

that g = h1f1 + h2f2 + ··· + hsfs, which will obviously be contained in I, so we are done. (ii) The division algorithm terminates with r 6= 0. We must show that g∈ / I if

the division algorithm terminates in this manner. We know that LT (gj) is not divisible by any LT (fi) for any i and

LT (gj) ∈/ hLT (f1), LT (f2), ..., LT (fs)i

where gj is the form of g after j iterations of the algorithm. By Lemma 3.5 we conclude that gj ∈/ I, and by the relationship between g and gj we can garantee that g∈ / I.  Now that we have shown this desirable property of a Gr¨obnerbasis, we must prove that each ideal in a polynomial ring will yield a Gr¨obnerbasis. To prove this, we will start by first showing that monomial ideals are finitely generated. We will then show that all polynomial ideals are finitely generated. Proposition 3.6 (Noether’s Proposition). Let R be a ring. The following statements are equivalent: 11 (i) every ideal I ⊂ R is finitely generated. (ii) every ascending chain of ideals

I0 ⊂ I1 ⊂ · · · In ⊂ · · ·

terminates.

That is, IN = IN+1 for large enough N. A ring satisfying (i) and (ii) is called a Noetherian ring.

Proof. (⇒) Suppose every ideal I in a ring R is finitely generated. Consider [ I∞ = In n

which is an ideal in R. Choose generators g1, g2, ..., gr ∈ I∞, where each gi ∈ Ini . Thus, if N = max(n1, n2, ..., nr) then we will find I∞ = IN , thus terminating the ascending chain. (⇐) Suppose every ascending chain of ideals terminates. Let I be an ideal in R, such that

I = hfα(i)iα∈A where α is in some set A. If I is not generated by a finite number of α, then we may construct an infinite sequence, fα(1), fα(2), ..., fα(n), ..., such that

Ir = hfα(1), ..., fα(r)i ( hfα(1), ..., fα(r), fα(r+1)i = Ir+1 for each r. This contradicts the terminating chain assumption. Thus, I must be finitely generated.  Proposition 3.7 (Dickson’s Lemma). Every monomial ideal in a polynomial ring over a field k is generated by a finite collection of monomials.

Proof. Fix a monomial order. Let J ⊂ k[x1, x2, ..., xn] be a monomial ideal. We want to find a finite number of monomials xα(1), ..., xα(s) ∈ J generating J. This proof will be done by induction on n, where n is the number of variables. The case of n = 1 α β produces k[x1]. If x1 is the minimal degree monomial in J, and x1 ∈ J, then α ≤ β and α β α x1 | x1 . So J = hx1 i.

For the inductive step, we will assume this relationship holds for k[x1, x2, ..., xn], and we will look at the case of k[x1, x2, ..., xn, y]. If we consider the set J ⊂ k[x1, x2, ..., xn] and α α m Jm = hx ∈ k[x1, x2, ..., xn]: x y ∈ Ji which will give us an ascending chain of ideals of the form

J0 ⊂ J1 ⊂ J2 ⊂ · · · 12

By Proposition 3.6 we know that this ascending chain must terminate at some JN . There- fore, there is a finite sequence of monomials

α(0,1) α(0,n0) hx , ..., x i = J0

α(1,1) α(1,n1) hx , ..., x i = J1 . .

α(N,1) α(N,nN ) hx , ..., x i = JN

which will generate each Jm for m ≥ N. The ideal J will therefore be generated by the α(m,j) m finite number of terms x y for m = 0, 1, ..., N. 

Corollary 3.8 (Hilbert Basis Theorem). Every polynomial ideal I ⊂ k[x1, x2, ..., xn] is finitely generated.

Proof. Fix a monomial order. Since the Gr¨obner basis of an ideal I generates LT (I), we choose f1, f2, ...fr ∈ I such that

LT (I) = hLT (f1), LT (f2), ..., LT (fr)i,

and by Corollary 3.4, I = hf1, f2, ...fri. Thus we may look at the leading term ideal, which is a monomial ideal with constant coefficients. As a result, to show every monomial ideal is finitely generated will be sufficient to complete the proof. Therefore, by Theorem 3.7 we are done. 

Theorem 3.9 (Existence Theorem). Fix a monomial order. Let I ⊂ k[x1, x2, ..., xn] be an arbitrary non-zero ideal. The ideal I will admit a finite Gr¨obnerbasis under the monomial order.

Using the Hilbert Basis theorem, we may reduce the existence theorem to a case of monomial ideals, and through Theorem 3.7, we may prove this easily.

2. Computing Gr¨obnerBases: Buchberger’s Algorithm

Now that we have defined and shown the existence of the Gr¨obnerbasis, we will learn how to compute this powerful tool. We will start by defining the least common multiple of a monomial and the S-polynomial. Then we will look at Buchberger’s Criterion and Buchberger’s Algorithm. These will give us the tools and techniques to find Gr¨obnerbases. Definition 3.10. Fix a monomial order. The least common multiple of two monomials α β x , x ∈ k[x1, x2, ..., xn] can be expressed as

α β max(α1,β1) max(α2,β2) max(αn,βn) LCM(x , x ) = x1 x2 ··· xn

In other words, the exponent of each xi will correspond to the larger of αi, βi. Example 3.11. Using lex order. Find the LCM of x2z, xy ∈ k[x, y, z]. We have LCM(x2z, xy) = xmax(2,1)ymax(0,1)zmax(1,0) = x2yz 13 Unless you are working with a Gr¨obnerbasis, the division algorithm is inconclusive with regards to ideal membership. You will find terms you know must be in the ideal, but the generators alone are not sufficient in expressing this membership. This is because

for an ideal I ∈ k[x1, x2, ..., xn] there may exist some set of generators f1, f2, ..., fs such that hLT (f1), LT (f2), ..., LT (f3)i does not generate LT (I). Computing a Gr¨obnerbasis is equivalent to finding the polynomials that will make the division algorithm definitive in finding ideal membership. A necessary tool in finding a Gr¨obnerbasis is the S-polynomial.

Definition 3.12. Fix a monomial order. Let f1, f2 ∈ k[x1, x2, ..., xn]. If we let γ(1,2) x = LCM(LM(f1), LM(f2)), we will define the S-polynomial, S(f1, f2) to be xγ(1,2) xγ(1,2) S(f1, f2) = f1 − f2. LT (f1) LT (f2)

You will notice that the S-polynomial will remove the original leading terms of f1 and f2. This introduces a new leading term which may or may not be accounted for by our generators, which is the most important function of the S-polynomial.

Example 3.13. We will use lex order to compute the S-polynomial of f1 = x+y, f2 = xy + z ∈ k[x, y, z]. First, xγ(1,2) = xy since xy is the LCM of the leading terms. Now we have xy xy S(f , f ) = (x + y) − (xy + z) 1 2 x xy = y(x + y) − (xy + z) = xy + y2 − xy − z = y2 − z.

2 Thus we have S(f1, f2) = y − z.

We will now see how the S-polynomial relates to the Gr¨obnerbasis through Buch- berger’s Criterion.

Theorem 3.14 (Buchberger’s Criterion). Fix a monomial order. Let f1, f2, ..., fr ∈ k[x1, x2, ..., xn]. The following statements are equivalent:

(i) f1, f2, ..., fn form a Gr¨obnerbasis for I = hf1, f2, ..., fni. (ii) Each S-polynomial S(fi, fj) yields remainder zero upon applying the division al- gorithm with respect to all fk ∈ I.

Proof. Fix a monomial order. (⇒) Each S-polynomial will be contained in I. If we have a Gr¨obnerbasis, the division algorithm will terminate with r X (2.1) S(fi, fj) = h(ij)lfl, LM(S(fi, fj)) ≥ LM(h(ij)lfl). l=i 14 Specifically, this will yield r = 0. (⇐) Suppose each S-polynomial yields r = 0 with respect to the generators of I. So,

for each i, j we have (2.1). If the fk do not form a Gr¨obnerbasis, then some g ∈ I does not have a leading term contained in hLM(f1), LM(f2), ..., LM(fr)i. We will choose a representation of this g so that

(2.2) g = h1f1 + h2f2 + ··· + hrfr which will satisfy the following properties: δ (i) x = maxj{LM(fjhj)} is minimal δ (ii) the number of indices j realizing the maximal, LM(fjhj) = x is minimal.

After reordering the fjs we may assume δ LM(f1h1) = LM(f2h2) = ··· = LM(fmhm) = x δ δ but LM(fjhj) < x for some j > m. We know m ≥ 2 because x will cancel in our representation in (2.2). For i = 1 and j = 2, the division algorithm will yield r X S(f1, f2) = h(12)lfl, LM(S(f1, f2)) ≥ LM(h(12)lfl). l=1

If we write out S(f1, f2) by the definition, we will get γ(12) γ(12) r x x X γ(12) (2.3) f1 − − h(12)lfl = 0 x > LM(h(12)lfl). LT (f1) LT (f2) l=1 δ γ(12) δ γ(12) Since LM(fihi) = x , i = 1, 2 we know x | x and µx = LT (f1)LT (h1) for some monomial µ. If we now subtract µ times (2.3) from (2.2) we will get ˜ ˜ ˜ h = h1f1 + h2f2 + ... + hrfr δ ˜ such that x ≥ LM(fjhj) with strict inequality for j > m and j = 1. As we can see, this will contradict the minimal assumption of (2.2). Thus, if each S-polynomial yields zero when applying the division algorithm, we must have a Gr¨obnerbasis!  Buchberger’s Criterion gives us a very powerful condition, by giving us a definitive way to determine whether or not we have found a Gr¨obnerbasis. Now we will actually learn how to compute a Gr¨obnerbasis.

Definition 3.15 (Buchberger’s Algorithm). Fix a monomial order. Take f1, f2, ..., fr ∈ k[x1, x2, ..., xn], we will find a Gr¨obnerbasis for I = hf1, f2, ..., fri through iteration of the following procedure:

For each 1 ≤ i < j ≤ r apply the division algorithm to S(fi, fj) with respect to each generator of I to get r X S(fi, fj) = h(ij)lfl + r(ij) LM(S(fi, fj)) ≥ LM(h(ij)lfl), l=1 15 where each LM(r(ij)) is not divisible by any LM(fl). (i) If each r(ij) = 0, then we already have a Gr¨obnerbasis and we may stop.

(ii) If not, let fr+1, fr+2, ..., fr+s denote each non-zero r(ij) found this way, and add these to the set of generators to get

f1, f2, ..., fr, fr+1, ..., fr+s. (iii) Repeat this process until r(ij) = 0 for all i, j.

We must now establish whether or not Buchberger’s Algorithm will terminate. Theorem 3.16. Buchberger’s Algorithm will eventually terminate

Proof. Fix a monomial order. Suppose I = hf1, f2, ..., fsi, S1 = {f1, f2, ..., fr} and J1 = hLM(f1), LM(f2), ..., LM(fr)i. If J1 = LT (I) we are done. If not, then by Buchberger’s Criterion there is at least one non-zero remainder upon dividing the S- polynomials of S1 by the generators of I. Consider S2 = {f1, f2, ..., fr, fr+1, ..., fr+m} and let J2 denote the ideal generated by the leading monomials of those polynomials. Continuing in this fashion, we will obtain an ascending chain of monomial ideals

J1 ( J2 ( ... ⊂ LT (I) and subsets S1 ( S2 ( ... ⊂ I. If Jk ( LT (I) Buchberger’s Criterion guarantees that Jk ( Jk+1. Since k[x1, x2, ..., xn] is Noetherian, we know that this ascending chain must stabilize at some JN . Therefore, we will eventually reach a point where JN = JN+1 = ... = LT (I) and the resulting SN must be a Gr¨obnerbasis of I.  Now with this new algorithm, time, and effort, we may compute a Gr¨obnerbasis of any polynomial ideal. With the ability to compute a Gr¨obnerbasis of an ideal, we now have the ability to determine whether or not an arbitrary polynomial is a member of a polynomial ideal. Example 3.17. Using lex order. Recall from Example 2.26, with the ideal I = hx + y, xy + z, y − zi ⊂ k[x, y, z] we were unable to conclude that xz − z ∈ I using the division algorithm. Using the Gr¨obnerbasis, we will not have that problem.

Let f1 = x + y,f2 = xy + z, and f3 = y − z. We must now compute the S-polynomial of each fi and divide by each fi to find the Gr¨obnerbasis. We will do this for S(f1, f2) in the example and compute the rest using CoCoA, which is a computer program capable of difficult and lengthy computations. 2 From Example 3.13 we know that S(f1, f2) = y − z. Dividing this by each fi yields y2 − z = (0)(x + y) + (0)(xy + z) + (y + z)(y − z) + z2 − z. 2 Since division yields a non-zero remainder, we must now add f4 = z − z to the Gr¨obner basis. 16 Computing the Gr¨obnerbasis using CoCoA gives us G(I) = hxy+z, x+y, y−z, z2 −zi. Dividing xz − z by this new set of generators yields xz − z = (z)(x + y) + (0)(xy + z) + (z)(y − z) + (1)(z2 − z) We no longer have a remainder. We may now conclude with absolute certainty that xz − z ∈ I.

You will notice that our Gr¨obnerbasis actually contained our earlier remainder. This was a very convenient case and is by no means the usual result. Clearly the Gr¨obnerbasis is a powerful tool. It has found applications in many different areas. We will be looking at one such application in the next chapter. CHAPTER 4

Gr¨obnerBases for Graph Colouring

The concept of a Gr¨obnerbasis may be applied to other areas of mathematics. One such case pertains to graph theory, establishing whether or not graphs are 3-colourable by expressing the graph itself in polynomial terms.

1. Graph Colouring

In this section, we will look at a graph Γ, and determine first how to express the graph in polynomial terms and then how to determine whether the graph is 3-colourable. This section is based off of Tutorial 26 of [4].

1.1. Key Terms. It is necessary to define some graph theory terms that we will be using. Definition 4.1. A graph is an ordered pair Γ(V,E), consisting of a nonempty set V (Γ)of vertices and a set E(Γ) of edges. Each edge is associated with one or two vertices, and is said to connect the associated vertices.

Definition 4.2. Given a graph Γ we say two vertices vi, vj ∈ V (Γ) are adjacent if there exists an edge ek ∈ E(Γ) such that ek connects viand vj. Definition 4.3. Given a graph Γ, a vertex colouring of Γ is determined by assigning colours or values to each vertex vi ∈ V (Γ) such that no adjacent vertices share a colour or value. A vertex n-colouring of Γ is a colouring as above using n or fewer colours or values.

When we look for n-colourings of graphs, we look strictly at graphs with edges con- nected two distinct vertices. If an edge were to connect a vertex to itself, we would find the graph to be uncolourable. A common problem in graph theory is to determine whether or not a graph Γ is vertex n-colourable for some n. Normally, mathematicians are more interesting in finding the least number of colours needed to colour a graph. We will now look at a method to use Gr¨obnerbases to determine whether or not a graph is vertex 3-colourable.

1.2. Determining a Graph 3-Colouring. Given a graph Γ with vertex set V (Γ) =

{v1, v2, ..., vn}, our goal is to assign three colours to each vertex such that no two adjacent vertices share a colour, or determine that such a colouring is not possible. In order to express this as a Gr¨obnerbasis problem, we must first express Γ as a set of polynomials. 17 18 In order to do this, we must choose a polynomial ring with desirable properties. Let our field be F3 = Z/(3), the integers mod 3. Let our polynomial ring be F3[x1, x2, ..., xn], the polynomials with coefficients in the integers mod 3, where n is the number of vertices of Γ, and each xi corresponds to exactly one vertex vi. We now need our three colours. Since the colours are arbitrary, we will let our colours be {-1,0,1}.

It is now necessary to determine all possible colourings for each vertex vi ∈ Γ.

3 3 3 Theorem 4.4. The zeros of the ideal I = hx1−x1, x2−x2, ..., xn−xni ∈ F3[x1, x2, ..., xn] allow for each vertex vi ∈ V (Γ) to be any of the three colours {−1, 0, 1} .

3 3 3 Proof. Let I = hx1 − x1, x2 − x2, ..., xn − xni ∈ F3[x1, x2, ..., xn] and n V (I) = {(v1, v2, ..., vn) ∈ F3 |f(v1, v2, ..., vn) = 0} n 3 for all f ∈ I. So, V (I) = {(v1, v2, ..., vn) ∈ F3 |vi − vi = 0 for i = 1, 2, ..., n}.

Since any ai ∈ F3, then all ai = −1, 0, 1 and we have (−1)3 − (−1) = 0 (0)3 − (0) = 0 (1)3 − (1) = 0

Thus, each ai ∈ Γ can be coloured one of {−1, 0, 1}.  We have now established a polynomial representation for all possible colours of the vertices of Γ. Now we must determine polynomials which indicate that two adjacent vertices do not share a colour. We must establish a polynomial such that the result when entering two different values from {−1, 0, 1} we will always get zero, and when we input identical numbers, we will get 2 2 a non-zero output. The polynomial xi + xixj + xj − 1 will satisfy this property, yielding an output of zero if and only if xi 6= xj. We will prove this now.

Theorem 4.5. For every vi, vj ∈ V (Γ), vi does not share a colour with vj if and only 2 2 if the colouring is a zero of the polynomial f(xi, xj) = xi + xixj + xj − 1. We will call this the adjacency polynomial.

Proof. (⇒) Given vi, vj with different colours we want to show that

(xi, xj) ∈ {(−1, 0), (−1, 1), (0, −1), (0, 1), (1, −1), (1, 0)}

will yield zero upon input into f(xi, xj). We may reduce these six cases to three because of the symmetry, and we have f(−1, 0) = (−1)2 + (−1)(0) + (0)2 − 1 = 0 f(−1, 1) = (−1)2 + (−1)(1) + (1)2 − 1 = 0 f(0, 1) = (0)2 + (0)(1) + (1)2 − 1 = 0. 19

Thus, if vi, vj are different colours, they yield a zero in f(xi, xj) 2 2 (⇐) Given xi + xixj + xj − 1 = 0, we want to show that xi 6= xj. Using the contra- 2 2 positive, if xi + xixj + xj − 1 6= 0 then xi = xj. This will give us three cases,

(xi, xj) = {(−1, −1), (0, 0), (1, 1)}. Substituting these values into the polynomial yields (−1)2 + (−1)(−1) + (−1)2 − 1 = 2 6= 0 (0)2 + (0)(0) + (0)2 − 1 = −1 6= 0 (1)2 + (1)(1) + (1)2 − 1 = 2 6= 0

Thus, if the polynomial yields zero, xi 6= xj, and our if and only if statement holds.  Now if we apply this polynomial to Γ, we may create the colouring ideal 2 2 Ic = hxi + xixj + xj − 1|eij ∈ E(Γ)i. Computing a Gr¨obner basis of this ideal will give us the polynomial equations for every possible colouring. The problem with simply using the above ideal is that in order to determine any colouring, you must solve the polynomials, which can be lengthy. One way to prevent the lengthy computations of that is to fix two adjacent vertices on Γ. This will no longer yield every possible colouring, but it will make it far simpler to calculate one or more colourings given the two fixed vertices. Let us do this now.

Take two adjacent vertices of Γ, say x1, x2. Let us colour them such that x1 = 0 and x2 = 1. This will give us two more polynomials to add to our ideal: x1 and x2 − 1, since the zeros of these polynomials gives us our desired colourings. Adding these to our ideal gives us an ideal of the form 2 2 Ic = hx1, x2 − 1, xi + xixj + xj − 1|eij ∈ E(Γ)i, and computing the Gr¨obnerbasis of this ideal will give us every possible colouring of Γ where x1 = 0 and x2 = 1, and knowing those values will allow us to solve for the colourings with ease. If the Gr¨obnerbasis of either of the above ideals contains 1, no possible colouring exists. We will prove this.

2 2 Theorem 4.6. Let Γ be a graph with a colouring ideal Ic = hx1, x2 −1, xi +xixj +xj − 1|eij ∈ E(Γ)i. The Gr¨obnerbasis of Ic contains the element 1 if and only if no possible 3-colouring of Γ exists.

Proof. (⇒)

Given a graph Γ and the colouring ideal of Γ Ic, assume the Gr¨obner basis G of Ic contains the element 1. Since the zeros of the generators of Ic correspond to all possible colourings of Γ, we get 1 = 0 for some colour. But 1 6= 0, so Γ cannot be vertex 3- colourable. 20 (⇐)

Given a graph Γ and the colouring ideal Ic, assume Γ is vertex 3-colourable. Then each generator of the Gr¨obner basis G of Ic has a solution f(c1, c2) = 0 where f is some generator of G computed for two distinct colours c1, c2 ∈ {−1, 0, 1}. As such, f(c1, c2) 6= 1 since 1 6= 0. 

We are now able to use a Gr¨obnerbasis to determine whether a graph is 3-colourable, as well as specific 3-colourings of the graph.

Example 4.7. Let Γ be x9 x1 x2 x3 ¨ ¨ @ @ x ¨¨ t t @ t @ t ¨8 HH @ @ t H @ @ HH @ @ x7 x6 x5 x4 t t t t The labelling is arbitrary

Using lex order, we establishing our adjacency polynomials, and fix adjacent vertices x1 = 0 and x2 = 1 to get the following set:

2 2 2 2 2 2 x1 + x1x2 + x2 − 1, x1 + x1x6 + x6 − 1, x1 + x1x9 + x9 − 1, 2 2 2 2 2 2 x1 + x1x5 + x5 − 1, x2 + x2x3 + x3 − 1, x2 + x2x4 + x4 − 1, 2 2 2 2 2 2 x2 + x2x5 + x5 − 1, x2 + x2x6 + x6 − 1, x3 + x3x4 + x4 − 1, 2 2 2 2 2 2 x4 + x4x5 + x5 − 1, x6 + x6x7 + x7 − 1, x7 + x7x8 + x8 − 1, 2 2 2 2 x7 + x7x9 + x9 − 1, x8 + x8x9 + x9 − 1, x1, x2 − 1. (1.1)

Using these polynomials as generators of an ideal I ⊂ F3[x1, x2, ..., x9], we will now compute the Gr¨obnerbasis. Specifically, we get 2 2 G(I)=h x1, x2 − 1, −x3 − 1, x4, x5 + 1, x6 + 1, −x7 − x8 − x9, x8 + x8x9 + x9 − 1, 2 −x8x9 − x8 − x9 − 1, −x9 + 1 i. Since 1 ∈/ G(I) we know that Γ is 3-colourable. Finding the zeroes of each polynomial in the Gr¨obnerbasis will give us all possible colourings corresponding to our fixed x1 and x2. Doing so yields x1 = 0, x2 = 1, x3 = −1, x4 = 0, x5 = −1, x6 = −1, x9 = −1 or 1, notice that x7 and x8 depend on the value of x9.

If x9 = 1, then x7 = 0 and x8 = −1. If x9 = −1, then both x7 and x8 may be 0 or 1 depending on the other. Thus, given our graph Γ, and fixing x1 and x2 we have found three unique 3-colourings. The three colourings are shown below. 21

If we let x9 = 1, then x7 = 0 and x8 = −1, and we have the following 3-colouring:

1 0 1 −1 ¨¨ @ @ −1 ¨ t t t t ¨¨ @ @ HH @ @ t H @ @ HH @ @ 0 −1 −1 0 t t t t

If we let x9 = −1 and x7 = 1 and x8 = 0, we have the following 3-colouring:

−1 0 1 −1 ¨¨ @ @ 0 ¨ t t t t ¨¨ @ @ HH @ @ t H @ @ HH @ @ 1 −1 −1 0 t t t t

If x9 stays the same and we switch the colours of x7 and x8, we have the following 3-colouring:

−1 0 1 −1 ¨ ¨ @ @ 1 ¨¨ t t @ t @ t ¨ HH @ @ t H @ @ HH @ @ 0 −1 −1 0 t t t t We have now seen a method of determining 3-colourings of graphs using Gr¨obner bases. CHAPTER 5

Concluding Remarks

Using Gr¨obnerbases, we have successfully solved the ideal membership problem for polynomials in multiple variables. This was, needless to say, a celebrated discovery and led to many applications. It is worthwhile to mention that while it is possible to compute Gr¨obnerbases by hand, it is much more time efficient to use software in the calculations. For my project I used CoCoA for computing the Gr¨obnerbases. After determining how to compute the Gr¨obnerbasis, we looked at an application in graph theory. A celebrated theorem in this field of study is the Four Colour theorem, which says that if a graph is planar then it can be coloured with 4 or fewer colours. In this project we looked at using Gr¨obnerbases to determine vertex 3-colourings of graphs. Clearly these two problems are similar, and it was exciting to work with concepts so closely related to such a celebrated theorem. Determining ideal membership and graph colouring are by no means all that Gr¨obner Basis Theory may be applied to. There are numerous other algebraic and mathematical applications, as well as applications in robotics, engineering, cryptography, and more! Should my research into Gr¨obnerbases continue, I would like to look into the crypto- graphic applications.

22 Bibliography

[1] D.Cox, J.Little, D.O’Shea, Ideals, Varieties, and Algorithms. Springer, 2007. 2, 9 [2] V. Ene, J. Herzog, Gr¨obnerBases in Commutative Algebra. (Graduate Studies in Mathematics; v.130) American Mathematical Society, 2012. 9 [3] B.Hasset, Introduction to Algebraic Geometry. Cambridge, 2007. 2, 9 [4] M.Kreuzer, L.Robbiano, Computational Commutative Algebra 1. Springer, 2000. 17

23