Gröbner Bases & their Computation Definitions + First Results Priyank Kalla Associate Professor Electrical and Computer Engineering, University of Utah kalla@ece.utah.edu http://www.ece.utah.edu/~kalla Oct 18, 2017 - onwards
Agenda: F={f 1,...,f s} Now that we know how to perform the reduction f + r Study Gröbner Bases (GB) Motivate GB through ideal membership testing Study how they are related to ideal of leading terms Study various definitions of GB Study Buchberger s S-polynomials and the Buchberger s algorithm to compute GB Minimal and Reduced GB Application to ideal membership testing P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 2 / 26
From the last lecture: Multivariate Division Algorithm Inputs: f,f 1,...,f s F[x 1,...,x n ],f i 0 Outputs: u 1,...,u s,r s.t. f = f i u i + r where r is reduced w.r.t. F = {f 1,...,f s } and max(lp(u 1 )lp(f 1 ),...,lp(u s )lp(f s ),lp(r)) = lp(f) 1: u i 0; r 0, h f 2: while (h 0 ) do 3: if i s.t. lm(f i ) lm(h) then 4: choose i least s.t. lm(f i ) lm(h) 5: u i = u i + lt(h) lt(f i ) 6: h = h lt(h) lt(f i ) f i 7: else 8: r = r +lt(h) 9: h = h lt(h) 10: end if 11: end while Algorithm 1: Multivariate Division of f by F = {f 1,...,f s } P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 3 / 26
Motivate Gröbner basis Let F = {f 1,...,f s }; J = f 1,...,f s and let f J. Then we should be able to represent f = u 1 f 1 + +u s f s +r where r = 0. If we were to divide f by F = {f 1,...,f s }, then we will obtain an intermediate remainder (say, h) after every one-step reduction. Note h J because f,f 1,...,f s are all in J. The leading term of every such remainder (LT(h)) should be divisible by the leading term of at least one of the polynomials in F. Only then we will have r = 0. Definition Let F = {f 1,...,f s }; G = {g 1,...,g t }; J = f 1,...,f s = g 1,...,g t. Then G is a Gröbner Basis of J f J (f 0), i : lm(g i ) lm(f) P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 4 / 26
Gröbner Basis Definition G = {g 1,...,g t } = GB(J) f J, g i s.t. lm(g i ) lm(f) As a consequence of the above definition: Definition G = GB(J) f J,f g 1,g 2,,g t + 0 Implies a decision procedure for ideal membership To check if f f 1,...,f s : Compute GB(f 1,...,f s ) = G = {g 1,...,g t } g 1,...,g t Reduce f + r, and check if r = 0 P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 5 / 26
Understanding GB through some examples J = f 1,f 2 Q[x,y], DEGLEX y > x f 1 = yx y, f 2 = y 2 x and let f = y 2 x x f = yf 1 +f 2 so f J Apply division: i.e. reduce f Solve it in classroom: r 1 = 0 f 2,f 1 Now try: f + r 2 = x 2 x f 1,f 2 + r 1 Does there exist f i s.t. lm(f i ) lm(r 2 )? G = {f 1,f 2,x 2 x} is a GB. Why? P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 6 / 26
It has got to do with Leading Monomials Let f J = f 1,f 2 : so f = h 1 f 1 +h 2 f 2 Consider only leading terms: If lt(f) lt(f 1 ),lt(f 2 ), then some lm(f i ) lm(f) [observe: this has to be true!] But, what if lt(f) / lt(f 1 ),lt(f 2 )? Refer to the example on the previous slide P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 7 / 26
It has got to do with Leading Monomials Let f J = f 1,f 2 : so f = h 1 f 1 +h 2 f 2 Consider only leading terms: If lt(f) lt(f 1 ),lt(f 2 ), then some lm(f i ) lm(f) [observe: this has to be true!] But, what if lt(f) / lt(f 1 ),lt(f 2 )? Refer to the example on the previous slide Cancellation of Leading Terms When f is a polynomial combination of (say) h i f i +h j f j, such that the leading terms of h i f i and h j f j cancel each other, then lt(f) / lt(f i ),lt(f j ). When does this happen? This happens when the leading term of some combination of f i,f j (ax α f i bx β f j ) cancel! P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 7 / 26
Buchberger s S-polynomial S(f,g) = L lt(f) f L lt(g) g L = LCM(lm(f),lm(g)) How to compute LCM of leading monomials? Let multideg(f) = X α,multideg(g) = X β, where X α = x α 1 1...xαn n, and let γ = (γ 1,...,γ n ), where γ i = max(α i,β i ). Then the x γ = LCM(lm(f), lm(g)). P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 8 / 26
Buchberger s S-polynomial S(f,g) = L lt(f) f L lt(g) g L = LCM(lm(f),lm(g)) How to compute LCM of leading monomials? Let multideg(f) = X α,multideg(g) = X β, where X α = x α 1 1...xαn n, and let γ = (γ 1,...,γ n ), where γ i = max(α i,β i ). Then the x γ = LCM(lm(f), lm(g)). This S-polynomial (S = syzygy) cancels lt(f), lt(g), gives a polynomial h = S(f,g) with a new lt(h). This S-polynomial with a new lt() is the missing piece of the GB puzzle! P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 8 / 26
Understanding S-poly some more... While S-poly gives new lt(h), it may still have some redundant information f = x 3 y 2 x 2 y 3 ; g = 3x 4 +y 2 Spoly(f,g) = x 3 y 3 +x 2 1 3 y3 x 3 y 3 can be composed of lt(f) Reduce: Spoly(f,g) f,g + r IN this case: r = x 2 y 4 1/3y 3 If r 0 then r provides new information regarding the basis P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 9 / 26
Buchberger s Theorem Theorem (Buchberger s Theorem [1]) Let G = {g 1,...,g t } be a set of non-zero polynomials in F[x 1,...,x n ]. Then G is a Grobner basis for the ideal J = g 1,...,g t if and only if for all i j S(g i,g j ) G + 0 P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 10 / 26
Buchberger s Theorem Theorem (Buchberger s Theorem [1]) Let G = {g 1,...,g t } be a set of non-zero polynomials in F[x 1,...,x n ]. Then G is a Grobner basis for the ideal J = g 1,...,g t if and only if for all i j S(g i,g j ) G + 0 Can you think of an algorithm to compute GB(J)? P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 10 / 26
Buchberger s Algorithm Computes a Gröbner Basis Buchberger s Algorithm INPUT : F = {f 1,...,f s } OUTPUT : G = {g 1,...,g t } G := F; REPEAT G := G For each pair {f,g},f g in G DO S(f,g) G + r IF r 0 THEN G := G {r} UNTIL G = G S(f,g) = L lt(f) f L lt(g) g L = LCM(lm(f),lm(g)), lm(f): leading monomial of f P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 11 / 26
With some more detail... Inputs: F = {f 1,...,f s } F[x 1,...,x n ],f i 0 Outputs: G = {g 1,...,g t }, a Gröbner basis for f 1,...,f s 1: Initialize: G := F; G := {{f i,f j } f i f j G} 2: while G do 3: Pick a pair {f,g} G 4: G := G {{f,g}} 5: Spoly(f,g) G + h 6: if h 0 then 7: G := G {{u,h} u G} 8: G := G {h} 9: end if 10: end while Algorithm 2: Buchberger s algorithm from [2] P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 12 / 26
Examples: From [2] F = {f 1,f 2 } Q[x,y], LEX y > x; f 1 = xy x; f 2 = y +x 2 Run Buchberger s algorithm: Polynomial Pair: there s only one {f 1,f 2 } Spoly(f 1,f 2 ) = xy xy f 1 xy y f 2 Spoly(f 1,f 2 ) = xy x xy +x 3 = x 3 x 0 Spoly(f 1,f 2 ) f1,f2 + x 3 x New basis: {f 1,f 2,f 3 = x 3 x} New pairs: {f 1,f 3 },{f 2,f 3 } Spoly(f 1,f 3 ) f 1,f 2,f 3 + = yx x 3 f 1,f 2,f 3 + 0 Spoly(f 2,f 3 ) f 1,f 2,f 3 + 0 No more polynomial pairs remaining, so f 1,f 2,f 3 is the GB P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 13 / 26
Change the term order F = {f 1,f 2 } Q[x,y], DEGLEX x > y; f 1 = xy x; f 2 = y +x 2 Then: f 1 = xy x; f 2 = x 2 y Spoly(f 1,f 2 ) f 1,f 2 + = x 2 +y 2 f 1,f 2 + y 2 y = f 3 ; Spoly(f 1,f 3 ) f 1,f 2,f 3 + = 0 Spoly(f 2,f 3 ) f 1,f 2,f 3 + = 0 P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 14 / 26
A more interesting example f 1 = x 2 +y 2 +1; f 2 = x 2 y +2xy +x in Z 5 [x,y] LEX x > y S(f 1,f 2 ) f 1,f 2 + f 3 = 3xy +4x +y 3 +y G := {{f 1,f 3 },{f 2,f 3 }} G = {f 1,f 2,f 3 } S(f 1,f 3 ) f 1,f 2,f 3 + f 4 = 4y 5 +3y 4 +y 2 +y +3 G := { {f 1,f 3 },{f 2,f 3 },{f 1,f 4 },{f 2,f 4 },{f 3,f 4 }} G = {f 1,...,f 4 } Now, all Spoly in G reduce to 0, so GB = {f 1,...,f 4 } P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 15 / 26
Complexity of Gröbner Bases Gröbner basis complexity is not very pleasant For J = f 1,...,f s F[x 1,...,x n ]: n variables, and let d be the degree of J Complexity of Gröbner basis Degree of polynomials in G is bounded by 2( 1 2 d2 +d) 2n 1 [3] Doubly-exponential in n and polynomial in the degree d This is the complexity of the GB problem, not of Buchberger s algorithm that s still a mystery In many practical cases, the behaviour is not that bad but it is still challenging to overcome this complexity Our objective: to glean more information from circuits to overcome this complexity we ll study these concepts a little later In general DEGREVLEX orders show better performance than LEX orders but for Boolean circuits, our experience is slightly different P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 16 / 26
Minimal GB A Gröbner basis G = {g 1,...,g t } is minimal if for all i, lc(g i ) = 1, and for all i j, lm(g i ) does not divide lm(g j ). Obtain a minimal GB: Test if lm(g i ) divides lm(g j ), remove g j. Then normalize the LC: Divide each g i by lc(g i ). Unfortunately, minimality is not unique Minimal GBs have same number of terms Minimal GBs have same leading terms P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 17 / 26
Make a GB minimal Over Z 5 [x,y], LEX x > y A Gröbner basis: f 1 = x 2 +y 2 +1 f 2 = x 2 y +2xy +x f 3 = 3xy +4x +y 3 +y f 4 = 4y 5 +3y 4 +y 2 +y +3 P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 18 / 26
Make a GB minimal Over Z 5 [x,y], LEX x > y A Gröbner basis: f 1 = x 2 +y 2 +1 f 2 = x 2 y +2xy +x f 3 = 3xy +4x +y 3 +y f 4 = 4y 5 +3y 4 +y 2 +y +3 A minimal Gröbner basis: f 1 = x 2 +y 2 +1 f 3 = xy +3x +2y 3 +2y 3 f 4 = y 5 +2y 4 +4y 2 +4y +2 4 P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 18 / 26
A Reduced (Minimal) GB A reduced GB for a polynomial ideal J is a GB G such that: lc(p) = 1, polynomialsp G p G, no monomial of p lies in LT(G {p}). In other words, no non-zero term in g i, is divisible by any lm(g j ), for i j. Reduced, minimal GB is a unique, canonical representation of an ideal! P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 19 / 26
To Reduce a Minimal GB, do the following: Compute a G.B. Make it minimal: remove g i if lp(g j ) divides lp(g i ). Make all LC = 1. Reduce it: G = {g 1,...,g t } is minimal G.B. Get H = {h 1,...,h t }: g 1 H 1 + h 1, where h 1 is reduced w.r.t. H 1 = {g 2,...,g t } g 2 H 2 + h 2, where h 2 is reduced w.r.t. H 2 = {h 1,g 3,...,g t } g 3 H 3 + h 3, where h 3 is reduced w.r.t. H 3 = {h 1,h 2,g 4,...,g t } g t H t + h t, where h t is reduced w.r.t. H t = {h 1,h 2,h 3,...,h t 1 } Then H = {h 1,...,h t } is a unique, minimal, reduced GB. P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 20 / 26
Reduce this minimal GB f 1 = x 2 +y 2 +1 f 2 = xy +3x +2y 3 +2y f 3 = y 5 +2y 4 +4y 2 +4y +2 P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 21 / 26
Reduce this minimal GB f 1 = x 2 +y 2 +1 f 2 = xy +3x +2y 3 +2y f 3 = y 5 +2y 4 +4y 2 +4y +2 It is already reduced! P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 21 / 26
Example: Non-uniqueness of minimal GB DEGLEX y > x in Q[x,y]: f 1 = y 2 +yx +x 2 f 2 = y +x f 3 = y f 4 = x 2 f 5 = x P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 22 / 26
Example: Non-uniqueness of minimal GB DEGLEX y > x in Q[x,y]: f 1 = y 2 +yx +x 2 f 2 = y +x f 3 = y f 4 = x 2 f 5 = x {f 3,f 5 } and {f 2,f 5 } are minimal GBs (non-unique) P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 22 / 26
Example: Non-uniqueness of minimal GB DEGLEX y > x in Q[x,y]: f 1 = y 2 +yx +x 2 f 2 = y +x f 3 = y f 4 = x 2 f 5 = x {f 3,f 5 } and {f 2,f 5 } are minimal GBs (non-unique) {f 3,f 5 } is a reduced GB P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 22 / 26
One (last) more definition of GB Gröbner bases as ideals of leading terms Let I = f 1,...,f s be an ideal Denote by LT(I) the set of leading terms of all elements of I. LT(I) = {cx α : f I with LT(f) = cx α } LT(I) denotes the (monomial) ideal generated by elements of LT(I). Contrast LT(I) with: lt(f 1 ),lt(f 2 ),...,lt(f s ) Is LT(I) = lt(f 1 ),lt(f 2 ),...,lt(f s )? Not always. Equality holds only when the set {f 1,...,f s } is a Gröbner basis! P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 23 / 26
See this example... Let f 1 = x 3 2xy; f 2 = x 2 y 2y 2 +x DEGLEX x > y Note: F = {f 1,f 2 } is not a GB! I = f 1,f 2, and x 2 = x f 2 yf 1 I x 2 = lt(x 2 ) LT(I) But, is x 2 lt(f 1 ),lt(f 2 )? Aside: BTW, what is a GB of a set of monomials? Compute GB(f 1,f 2 ) = {g 1 : 2y 2 x, g 2 : xy, g 3 : x 2 } Note that LT(I) = {lt(g 1 ) = 2y 2, lt(g 2 ) = xy, lt(g 3 ) = x 2 } Definition G = {g 1,...,g t } lt(i) = lt(g 1 ),...,lt(g t ) P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 24 / 26
Finally, to recap... Every ideal over F[x 1,...,x n ] is finitely generated J = f 1,...,f s F[x 1,...,x n ] Every such ideal J has a Gröbner basis G = {g 1,...,g t } which can always be computed J = f 1,...,f s = g 1,...,g t Definition G = {g 1,...,g t } = GB(J) f J, g i s.t. lm(g i ) lm(f) Definition G = GB(J) f J,f Definition g 1,g 2,,g t + 0 G = {g 1,...,g t } = GB(J) lt(j) = lt(g 1 ),...,lt(g t ) P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 25 / 26
Recap some more Buchberger s algorithm computes Gröbner basis Spoly(f,g) G + r cancels the leading terms of f,g and gives a polynomial with a new leading term A GB is computed when ALL Spoly(f,g) G + 0 GB should be made minimal and then reduced Reduced GB = unique, canonical form (subject to the term order) GB as a decision procedure for ideal membership testing G Compute G = GB(J), reduce f + r, and check if r = 0 Definition (Ideal Membership Testing Algorithm) f J f G + 0 where G = {g 1,...,g t } P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 26 / 26
[1] B. Buchberger, Ein Algorithmus zum Auffinden der Basiselemente des Restklassenringes nach einem nulldimensionalen Polynomideal, Ph.D. dissertation, University of Innsbruck, 1965. [2] W. W. Adams and P. Loustaunau, An Introduction to Gröbner Bases. American Mathematical Society, 1994. [3] T. W. Dube, The Structure of Polynomial Ideals and Gröbner bases, SIAM Journal of Computing, vol. 19, no. 4, pp. 750 773, 1990. P. Kalla (Univ. of Utah) Gröbner Bases Oct 18, 2017 - onwards 26 / 26