The Computational Complexity of Groebner Bases MohamedSaeed Taha E-mail: [email protected] Supervisor: Prof. Brink vander Merwe Departmentof ComputerScience Universityof Stellenbosch [email protected] May2006 Contents Acknowledgements iii Abstract iv Introduction v 1 ReviewofRingTheoryandBuchberger’sAlgorithm 1 1.1 PolynomialRings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 MonomialOrderings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2.1 Generalized MonomialOrders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 PolynomialReduction andDivisionAlgorithm . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.1 NormalForms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.2 TheGeneralized DivisionAlgorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4 TheHilbertbasistheorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.5 S-polynomials andGroebnerBases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.5.1 TheS-polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.5.2 GroebnerBases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.5.3 ReducedGroebnerBases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.6 Buchberger Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.7 Gauss-Jordan andGroebnerBases: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2 GroebnerBasesandthe3-ColourProblem 16 2.1 3ColourProblem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 i CONTENTS ii 2.2 DefinitionofF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4 2.3 SolutionUsingGroebnerBases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3 TheComplexityofGroebnerBases 23 3.1 Introduction toComplexityTheory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2 TuringMachines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.2.1 Nondeterministic TuringMachines . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3 BigONotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.4 ComplexityClasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.4.1 FormalLanguages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.4.2 PVersusNP: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.4.3 NP-hardness andNP-completeness . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.5 GroebnerBasesComplexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.6 Improvements InBuchberger Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.6.1 Buchberger Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.6.2 TheRefinedBuchberger Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.7 Complexityofthe3-colour Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Conclusion 33 Appendix 33 Bibliography 42 AIMSEssay2006. MohamedSaeedTaha. Acknowledgements I want to thank everyone who helped me in my work, my supervisor prof Brink van der Merwe, AIMS’ director prof Fritz Hahne, Dr. Mike Pickles and my tutor Ilhem Benzaoui. I am so grateful to all of them, andtoallthepeoplewhosupported me. iii Abstract The main focus of this research is Buchberger’s algorithm. This algorithm is used to calculate Groebner bases. Inchapter 1thenecessary mathematical background and definitions aregiven. Inchapter 2wecon- sider the application ofGroebner bases tothe NP-complete problem ofdeciding ifagraph is3-colourable. Inthelastchapterweintroducethebasicnotionsofcomplexitytheoryandalsoprovidesomeimprovements toBuchberger’s algorithm. iv Introduction Groebner Baseswereintroduced in1965byBrunoBuchberger inhisPhDdissertation. Buchberger named themafterhisPhDadviser, WolfgangGroebner(Gro¨bnerinGerman). The two main applications of Groebner bases in computational algebra, is to solve systems of polynomial equations with coefficients from a field, and to solve the ideal membership problem. Groebner bases are also used in graph theory, integer programming, algebraic geometry, statistics, difference equations, and cryptography. BuchbergerdefinedGroebnerbasesin1965andalsogaveanalgorithmtocalculatethesebases. TheF4and F5algorithms, whichareimproved versions oftheprincipal Bucberger algorithm, wereintroduced in1999 and2002respectively. Inthefirstchapterweprovidethereaderwiththenecessarymathematicalbackground. Weintroducemono- mialorderings, which are required inthe definition of aGroebner bases. Next wediscuss the Hilbert basis theorem, whichstates thateveryideal inapolynomial ringoverafieldisfinitely generated. Inthelast part ofchapter 1,weintroduce GroebnerbasesandthebasicBuchberger algorithm. In the second chapter we discuss the problem of deciding if a graph is 3-colourable. Since this is a NP- complete problem, all NP-hard problems can bereduced in polynomial timeto this problem. Wesolve the 3-colourproblembyassociatingwitheachgraphanidealinapolynomialring. Thegraphisthe3-colourable ifandonlyif1isnotamemberoftheassociatedideal. Wethustranslatethe3-colourproblemintotheideal membershipproblem. Theidealmembershipproblem issolvedbyusingGroebnerbases. Inthethirdchapterwegiveabriefintroductiontothecomputationalcomplexity. Wegivealistofcomplexity classes with a brief description of each class. Next we discuss the complexity of Buchberger’s algorithm, andgiveanimprovedversionofBuchberger algorithm. v Chapter 1 Review of Ring Theory and Buchberger’s Algorithm 1.1 Polynomial Rings The purpose of this chapter is to provide the necessary mathematical background and definitions. We will alsogiveadescription ofBuchberger’s algorithm. Firstwegivethedefinitionofacommutativering. Definition1.1 Let(R,+,.)beanon-emptysetwithtwobinaryoperations,addition“+ ”andmultiplication “.”. WesaythatRisacommutativeringif: (R,+)isanabeliangroup; • “.”iscommutativeandassociative; • thedistribution lawholds, i.e. a.(b+c) = a.b+a.c a,b,c R; • ∀ ∈ Rhasamultiplicative identity. • Example1.1 (Z,+,.)isacommutativering. Definition1.2 (R,+,.)isafieldifitisacommutativeringandeverynonzeroelementinRhasamultiplica- tiveinverse inR. Example1.2 (Q,+,.), (R,+,.), (C,+,.)arefieldsundertheusualaddition andmultiplication. InfuturewewilldenotebyRacommutativeringandbykafield. 1 ReviewofRingTheoryandBuchberger’sAlgorithm 2 Definition1.3 Let R be any commutative ring. A polynomial f in the n indeterminates x ,x ,...,x , with 1 2 n coefficients in R, is a finite formal sum of terms of the form axα1xα2...xαn, where a R and α Z for 1 2 n ∈ i ∈ ≥0 1 i n. Thesetofpolynomials isacommutative ring,calledapolynomial ring,undertheusualaddition ≤ ≤ andmultiplication. Termsoftheformaxα1xα2...xαn arecalled monomials. 1 2 n Example1.3 f = x5y2z x4y3+ x3y2z2 xyz,withcoefficients fromanyringcontaining theintegers, isa − − polynomial. Theterms x5y2z, x4y3 , x3y2z2 and xyzaremonomials. Definition1.4 Let (R,+,.) be a commutative ring. A nonempty set I R is called an ideal if it is closed ⊆ underaddition andunderinside-outside multiplication. i.e f +g I f,g I; • ∈ ∀ ∈ h.f I h R, f I. • ∈ ∀ ∈ ∈ Definition1.5 Let F = f , f ,..., f be a finite set of polynomials. The ideal generated by F is denoted 1 2 s { } by F and is given by s h f h ,h ,...,h R[x ,...,x ] . Wesay that f , f ,..., f is a basis for the h i nPi=1 i i | 1 2 s ∈ 1 n o { 1 2 s} ideal I. Since F isfinite,wesay I isfinitelygenerated. 1.2 Monomial Orderings Definition1.6 Let Zn be the set of n-tuples with non-negative integer entries. A monomial ordering on 0 k[x ,x ,...,x ] is any≥relation > on Zn , or equivalently, any relation on the set of monomials xα with 1 2 n 0 α Zn ,satisfying: ≥ ∈ 0 ≥ >isatotalorderingonZn ,i.eifα,β Zn withα , β,theneitherα > βorβ> α; • 0 ∈ 0 ≥ ≥ ifα > βandγ Zn ,thenα+γ > β+γ; • ∈ 0 ≥ >isawell-definedorderingonZn ,inotherwordsasmallestelementalwaysexistsforanynon-empty • 0 subsetofZn . ≥ 0 ≥ Nextwedefinesomeofthewell-knownmomomialordering. Inthesedefinitions weassumethat x > x > > x . 1 2 n ··· Definition1.7 We define the lexicographic order on monomials as follows. Assume that α,β Zn , then ∈ 0 ≥ α > βiftheleftmostnonzero entryinα βispositive. lex − Example1.4 Letα = (1,2,0) and β = (0,3,4). Since α β = (1, 1, 4) wehave that α > βwithrespect − − − tothelexicographic ordering. AIMSEssay2006. MohamedSaeedTaha. ReviewofRingTheoryandBuchberger’sAlgorithm 3 Definition1.8 Wedefinethegradedlexorderonmonomialsasfollows. Ifα = (α ,α ,...,α ),wedefine themap : Zn Z by α = n α. Thenbydefinition, α > βif 1 2 n | | ≥0 −→ ≥0 | | Pi=1 i grlex α > β,orif α = β andα > βwithrespecttolex. | | | | | | | | Example1.5 Letα = (1,2,5)andβ= (1,1,5). Then α = 8, β = 7. Thusα > β. grlex • | | | | Let α = (2,3,4) and β = (1,4,4). Since α = 9, β = 9, but α β = (1, 1,0), it follows that • | | | | − − α > β. grlex Definition1.9 Wedefine the graded reverse lex order asfollows. Forα,β Zn , wehave that α > β ∈ 0 grevlex ≥ if α > β,orif α = β andtherightmostnonzero entryofα βisnegative. | | | | | | | | − Example1.6 Letα = (1,2,3)andβ= (1,1,4)Thenα > βsince α = β andα β= (0,1, 1) grevlex | | | | − − 1.2.1 GeneralizedMonomial Orders Inthispartweaimtointroduceageneralformulaforthemonomialordering,whichcanrepresentanyother monomialordering. Let’sconsiderthevectoru= (u ,u ,...,u ), 0inZn andfixamonomialorder> (itcanbe> or> 1 2 n 0 σ lex grevlex oranymonomialorder)onZn wedefineforα,β ≥Zn : 0 ∈ 0 ≥ ≥ α > β ifandonlyif u.α > u.β or u.α = u.βandα > β,where“.” isthedotproduct ofvectorsin u.σ σ Rn Wecallthisorderingtheweightedorder determinedbyuand> . σ Firstlet’sshowthatthisisamonomialordering: (i)> isatotalordering: u.σ Supposeα,β Zn ,thenu.α,u.β Z andu.α > u.β,u.β > u.α,oru.α = u.β,inthelastcaseifu.α = u.β ∈ ≥0 ∈ ≥0 thenwecompareαandβwith> andhence: eitherα > β,orβ > α. Itfollows: > isatotalordering. σ u.σ u.σ u.σ (ii)Supposeα > β. Thisimpliesu.α > u.β,orα > β. Nowletγ Zn then u.σ σ ∈ 0 ≥ u.(α+γ) = u.α+u.γ > u.β+u.γ = u.(β+γ) or α+γ > β+γ σ then α+γ > β+γ u.σ AIMSEssay2006. MohamedSaeedTaha. ReviewofRingTheoryandBuchberger’sAlgorithm 4 (iii)Itisclearthat> iswell-ordering, because>and> arewell-ordering, andeverynonemptysubsetof u.σ σ Zn hasasmallestelementunder> because ithasasmallestelementunder>or> . (cid:3) 0 u.σ σ ≥ After wehave shown the relation > is a monomial ordering we want to show that by a special selection u.σ forthevectoruandσwecanobtainothermonomialorderings. For example, if we take σ = lex and u = (1,1,...,1) Zn , we get the graded lex order, and if we choose ∈ 0 σ = revlexandu = (1,1,...,1) Zn ,wegetthegradedre≥versedlexorder. ∈ 0 ≥ Wenotice that from thedefinition of> , theorder > isused tobreak theties, i.e. incaseu.α = u.βthen u.σ σ we use the order > to compare α and β. Here we want to show that there always exists α , β Zn and σ ∈ 0 ≥ u.α = u.β. Consider firstthelinear equation u.x = u x +u x +...+u x = 0whereu , 0, andweshow 1 1 2 2 n n n thatthereexistsanonzero integersolution, x= (x ,x ,...,x )satisfying theequation u.x = 0: 1 2 n Take x = a u , x = a u , ..., x = a u wherea Z 1,6 i6 n 1. Nowourequation turnsto: 1 1 n 2 2 n n 1 n 1 n i − − ∈ − n 1 − auu + x u = 0 X i i n n n i=1 If we take x = n 1au Z, we find x = (a u ,a u ,..., n 1au), is a nonzero integer solution for n −Pi=−1 i i ∈ 1 n 2 n −Pi=−1 i i theequation u.x = 0. Nowifwechooseanyα , β Zn insuchawaythatα β= x,thenαandβaretwo ∈ 0 − ≥ differentsolutions foru.x = 0,andthisisalwayspossible because ifwetakeα = (x +1,x +1,...,x +1) 1 2 n andβ= (1,1,...,1),thenα , β,andu.α = u.β Example1.7 takeu = (1,2,3) Z3 ,thenwehavetheequation u.x = 1x +2x +3x = 0,andifwetake ∈ 0 1 2 3 ≥ a = a = 1,thenweget x = 3and x = 3. Hence x = 3,and x = (3,3, 3)isanonzero solution forthe 1 2 1 2 3 − − equation u.x = 0. Ifwechooseα = (4,5,1)andβ= (1,2,4),thenu.α = 1.4+2.5+3.1= 17,andu.β = 1.1+2.2+3.4 = 17. WecanalsobreakthetiesifwechangeourdefinitionalittlebitbytakinguinRn,andchoosing itscompo- nentsu ,u ,...,u linearlyindependent overQ. Soifα,β Zn . 1 2 n ∈ 0 ≥ α > β u.α > u.β u ⇔ Onecanseethatifα , β,noequalitycanoccurbecauseu ,u ,...,u arelinearly independent overQ. 1 2 n Example1.8 Let u = (1, √2), α = (α ,α ), and β = (β ,β ). Then u.α = α + √2α and 1 2 1 2 1 2 u.β = β + √2β ,and 1 2 u.α = u.β α = β andα = β α = β 1 1 2 2 ⇔ ⇔ Otherwise,α > β or β > α. u u The weighted order which we described above is a special case of weighted orders in general, which are AIMSEssay2006. MohamedSaeedTaha.