Ideal Membership Problem for Boolean Minority
aa r X i v : . [ c s . CC ] J un Ideal Membership Problem for Boolean Minority
Arpitha P. Bharathi [email protected] and Monaldo Mastrolilli [email protected] IDSIA-SUPSI, Switzerland
Abstract
The Ideal Membership Problem (IMP) tests if an input polynomial f ∈ F [ x , . . . , x n ]with coefficients from a field F belongs to a given ideal I ⊆ F [ x , . . . , x n ]. It is a well-known fundamental problem with many important applications, though notoriouslyintractable in the general case. In this paper we consider the IMP for polynomialideals encoding combinatorial problems and where the input polynomial f has degreeat most d = O (1) (we call this problem IMP d ).A dichotomy result between “hard” (NP-hard) and “easy” (polynomial time) IMP swas recently achieved for Constraint Satisfaction Problems over finite domains [2, 21](this is equivalent to
IMP ) and IMP d for the Boolean domain [13], both based on theclassification of the IMP through functions called polymorphisms. For the latter result,there are only six polymorphisms to be studied in order to achieve a full dichotomyresult for the
IMP d . The complexity of the IMP d for five of these polymorphisms hasbeen solved in [13] whereas for the ternary minority polymorphism it was incorrectlydeclared in [13] to have been resolved by a previous result. As a matter of fact thecomplexity of the IMP d for the ternary minority polymorphism is open.In this paper we provide the missing link by proving that the IMP d for Booleancombinatorial ideals whose constraints are closed under the minority polymorphismcan be solved in polynomial time.This is achieved by first showing that a Gr¨obner basis can be efficiently computedin the lexicographic order for these ideals. Since this is insufficient for the efficientsolvability of the IMP d , we show how this Gr¨obner basis can be converted to a d -truncated Gr¨obner basis in graded lexicographic order in polynomial time which ensuresthe achievement of the result. This result, along with the results in [13], completes theidentification of the precise borderline of tractability for the IMP d for constrainedproblems over the Boolean domain.This paper is motivated by the pursuit of understanding the recently raised issueof bit complexity of Sum-of-Squares proofs raised by O’Donnell [16]. Raghavendra andWeitz [17] show how the IMP d tractability for combinatorial ideals implies boundedcoefficients in Sum-of-Squares proofs. Introduction
A polynomial ideal is a subset of the polynomial ring F [ x , . . . , x n ] with two properties: forany two polynomials f, g in the ideal, f + g also belongs to the ideal and so does hf for anypolynomial h . The Hilbert Basis Theorem [8] states that every ideal I is finitely generatedby a set F = { f , . . . , f m } ⊂ I , i.e., any polynomial in I is a polynomial combination ofelements from F . The polynomial Ideal Membership Problem (IMP) is to find out if apolynomial f belongs to an ideal I or not, given a set of generators of the ideal. Thisfundamental algebraic complexity problem was first pioneered by David Hilbert [9] and hasimportant applications in solving polynomial systems and polynomial identity testing [5, 19].The IMP is, in general, EXPSPACE-complete and Mayr and Meyer show that the problemfor multivariate polynomials over the rationals is solvable in exponential space [14, 15]. TheIMP is intractable (can be decided in single exponential time [6]) even when the ideal inquestion is zero-dimensional (number of common zeros of generators is finite).The vanishing ideal of a set S ⊆ F n is the set of all polynomials in F [ x , . . . , x n ] thatvanish at every point of S . This set of polynomials forms an ideal. In this paper we considervanishing ideals of the sets S of feasible solutions that arise from Boolean combinatorialoptimization problems. The vanishing ideal of the solution space S is defined as its combi-natorial ideal . We consider the IMP for polynomial ideals encoding combinatorial problems.We call such problems where the input polynomial f has degree at most d = O (1) as IMP d .The polynomial ideals that arise from combinatorial optimization problems frequently havespecial properties: these ideals are finite domain and therefore zero-dimensional and radical.The question of identifying problem restrictions which are sufficient to ensure the IMP d tractability is important from both a practical and a theoretical viewpoint, and has animmediate application to Sum-of-Squares ( SoS ) proof systems (or Lasserre relaxations) asexplained in the following.The
SoS proof system is an increasingly popular tool to solve combinatorial optimiza-tion problems. Especially over the last few decades,
SoS has had several applications incontinuous and discrete optimization (see, e.g., [12]). It was generally believed that a de-gree d SoS proof could be computed (if one existed) via the Ellipsoid algorithm in n O ( d ) time. O’Donnell [16], who initially also believed this, gave a counterexample: a polynomialsystem and a polynomial which had degree two proofs of non-negativity with coefficientsof exponential bit-complexity that forced the Ellipsoid algorithm to take exponential time.O’Donnell [16] raised the open problem to establish useful conditions under which “small” SoS proof can be guaranteed automatically. A first elegant approach to this question is dueto Raghavendra and Weitz [17] by providing a sufficient condition on a polynomial systemthat implies bounded coefficients in
SoS proofs. In particular, the work of Raghavendra andWeitz [17] shows that the
IMP d tractability for combinatorial ideals implies polynomiallybounded coefficients in SoS proofs. Therefore, the
IMP d tractability yields to degree d SoS proof (if one exists) computation via the Ellipsoid algorithm in n O ( d ) time. Hence thefollowing question poses itself: Which restrictions on combinatorial problems can guaranteean efficient computation of the IMP d ?In this paper we consider restrictions on the so-called constraint language , namely a setof relations that is used to form the constraints of the considered combinatorial optimizationproblem. Each constraint language Γ gives rise to a particular polynomial ideal membership2roblem, denoted IMP d (Γ), and the goal is to describe the complexity of the IMP d (Γ)for all constraint languages Γ. This kind of restrictions on the constraint languages havebeen successfully applied to study the computational complexity classification (and otheralgorithmic properties) of the decision version of Constraint Satisfaction Problems ( CSP )over a fixed constraint language Γ on a finite domain, denoted
CSP (Γ) (see Section 1.1). Thisclassification started with the classic dichotomy result of Schaefer [18] for 0/1
CSP s, andculminated with the recent papers by Bulatov [2] and Zhuk [21], settling the long-standingFeder-Vardi dichotomy conjecture for finite domain
CSP s. We refer to [3] for an excellentsurvey. Note that
CSP (Γ) corresponds to the very special case of the
IMP d (Γ) with d = 0,i.e. where we are only interested in testing if the constant polynomial “1” belongs to thecombinatorial ideal (see Appendix B.1 for more details on Ideal-CSP correspondence). Inthis paper we are interested in the problem with d ≥ IMP d (Γ) that fully answersthe above question for 0/1 combinatorial problems: for any constant d ≥
1, the
IMP d (Γ)of Boolean combinatorial ideals is either decidable in polynomial time or it is NP-complete.Note that the solvability of CSP(Γ) (and therefore of the IMP (Γ)) in the Boolean domain isknown to admit a nice dichotomy result [18]: it is solvable in polynomial time if all constraintsare closed under one of six polymorphisms (majority, minority, MIN, MAX, constant 0 andconstant 1), else it is NP-complete. In [13] it is claimed that the IMP d (Γ) for the Booleandomain also has a nice dichotomy result: it is solvable in polynomial time if all constraintsare closed under one of four polymorphisms (majority, minority, MIN, MAX), else it is NP-complete. The complexity of the IMP d (Γ) for five of these polymorphisms has been solvedin [13] whereas for the ternary minority polymorphism it was incorrectly declared in [13] tohave been resolved by a previous result. As a matter of fact the complexity of the IMP d (Γ)for the ternary minority polymorphism is open.In this paper we solve this issue by providing the missing link and therefore establishingthe full dichotomy result claimed in [13]. To ensure efficiency of the IMP d , it is sufficient tocompute a d -truncated Gr¨obner basis in the graded lexicographic order (see Definition 1.5,Section 1.1, and Appendix B for definitions and more details). This is achieved by firstshowing that a Gr¨obner basis can be efficiently computed in the lexicographic order for theminority polymorphism. Since this is insufficient for the efficient solvability of the IMP d , weshow how this Gr¨obner basis can be converted to a d -truncated Gr¨obner basis in the gradedlexicographic order in polynomial time. This efficiently solves the IMP d for combinatorialideals whose constraints are over a language closed under the minority polymorphism. To-gether with the results in [13], our result allows to complete the answer of the aforementionedquestion by allowing to identify the precise borderline of tractability of the IMP d (Γ).Moreover, we believe the techniques described in this paper can be generalized for a finitedomain with prime p elements. The basis of this claim comes from the fact that constraintsthat are linear equations (mod p ) are associated with an affine polymorphism [11]. We claimthat the IMP d is tractable for problems that are constrained as linear equations (mod p ).The details are currently being worked out and will soon be updated in the full version ofthis paper. This is a first step towards the long term and challenging goal of generalizingthe dichotomy results of solvability of the IMP d for finite domains. Structure of the paper:
Section 1.1 contains the basic definitions required for thispaper, although a reader unfamiliar with
CSP s over a constraint language or algebraic3eometry and Gr¨obner bases is strongly recommended to read the standard literature [4, 5]or Appendix B.We concretely state our results in Section 1.2. In Section 2 we show that the reducedGr¨obner basis in lexicographic order can be efficiently computed for combinatorial problemsconstrained under the minority polymorphism. This is achieved in Section 2 by first comput-ing a Gr¨obner basis in modular arithmetic and then transforming it into a Gr¨obner basis G in regular arithmetic. However, this Gr¨obner basis is in the lexicographic monomial ordering,and does not guarantee the efficient solvability of the IMP d . In Section 3 we show how toconvert G to a d -truncated Gr¨obner basis G in graded lexicographic monomial ordering.We prove that this conversion can be obtained in polynomial time for any fixed d = O (1).A simple example is provided in Section 4. Let D denote a finite set ( domain ). By a k -ary relation R on a domain D we mean a subsetof the k -th cartesian power D k ; k is said to be the arity of the relation. We often use relationsand (affine) varieties interchangeably since both essentially represent a set of solutions. A constraint language Γ over D is a set of relations over D . A constraint language is finite if it contains finitely many relations, and is Boolean if it is over the two-element domain { , } . In this paper, D is the Boolean domain.A constraint over a constraint language Γ is an expression of the form R ( x , . . . , x k )where R is a relation of arity k contained in Γ, and the x i are variables. A constraint issatisfied by a mapping φ defined on the x i if ( φ ( x ) , . . . , φ ( x k )) ∈ R . Definition 1.1.
The (nonuniform)
Constraint Satisfaction Problem ( CSP ) asso-ciated with language Γ over D is the problem CSP (Γ) in which: an instance is a triple C = ( X, D, C ) where X = { x , . . . , x n } is a set of n variables and C is a set of constraintsover Γ with variables from X . The goal is to decide whether or not there exists a solution,i.e. a mapping φ : X → D satisfying all of the constraints. We will use Sol ( C ) to denotethe set of solutions of C . Moreover, we follow the algebraic approach to Schaefer’s dichotomy result [18] formulatedby Jeavons [10] where each class of CSPs that are polynomial time solvable is associated witha polymorphism.
Definition 1.2.
An operation f : D m → D is a polymorphism of a relation R ⊆ D k if for any choice of m tuples from R (allowing repetitions), it holds that the tuple obtainedfrom these m tuples by applying f coordinate-wise is in R . If this is the case we also saythat f preserves R , or that R is invariant or closed with respect to f . A polymorphism of aconstraint language Γ is an operation that is a polymorphism of every R ∈ Γ . In this paper we deal with the minority polymorphism:
Definition 1.3.
For a finite domain D , a ternary operation f is called a minority polymor-phism (denoted as Minority ) if f ( a, a, b ) = f ( a, b, a ) = f ( b, a, a ) = b for all a, b ∈ D . Note that there is only one minority polymorphism (
Minority in short) for the Booleandomain. 4 xample 1.1.
Consider relations R = { (0 , , , (1 , , , (0 , , , (1 , , } and R = { (1 , , (0 , } associated with language Γ over D = { , } . Observe that both R and R are closedunder Minority . Consider the instance ( X = { x, y, z } , D, C = { C , C } ) where constraint C = R ( x, y, z ) and C = R ( x, z ) . The assignment φ where φ ( x ) = 0 , φ ( y ) = 0 , φ ( z ) = 1 isa solution to this instance of CSP( Γ ). For a given instance C of CSP(Γ), the combinatorial ideal I ( Sol ( C )) is defined as thevanishing ideal of set Sol ( C ), (see Definition B.1 in Appendix B). We call polynomials of theform x i ( x i − domain polynomials , denoted by dom ( x i ), and it is easy to see that theybelong to I ( Sol ( C )) for every i ∈ [ n ] as they describe the fact that Sol ( C ) ⊆ D n . For a moredetailed Ideal-CSP correspondence we refer to Appendix B.1. Definition 1.4.
The
Ideal Membership Problem associated with language Γ is theproblem IMP (Γ) in which the input consists of a polynomial f ∈ F [ X ] and a CSP (Γ) instance C = ( X, D, C ) . The goal is to decide whether f lies in the combinatorial ideal I ( Sol ( C )) .We use IMP d (Γ) to denote IMP (Γ) when the input polynomial f has degree at most d . The Gr¨obner basis G of an ideal is a set of generators such that f ∈ h G i ⇐⇒ f | G = 0,where f | G denotes the remainder of f divided by G (see [5] or Appendix B.2 for more detailsand notations). Definition 1.5. If G is a Gr¨obner basis of an ideal, the d-truncated Gr¨obner basis G ′ of G is defined as G ′ = G ∩ F [ x , x , . . . , x n ] d , where F [ x , x , . . . , x n ] d is the set of polynomials of degree less than or equal to d . It is not necessary to compute a Gr¨obner basis of I ( Sol ( C )) in its entirety to solve the IMP d . Since the input polynomial f has degree d = O (1), the only polynomials from G thatcan possibly divide f , in the graded lexicographic order (see Definition B.5 in Appendix B.2),are those that are in G ′ . The remainders of such divisions are also in F [ x , x , . . . , x n ] d .Therefore, by Proposition B.3 and Corollary B.4, the membership test can be computed byusing only polynomials from G ′ and therefore we have f ∈ I ( Sol ( C )) ∩ F [ x , x , . . . , x n ] d ⇐⇒ f | G ′ = 0 . From the previous observations it follows that if we can compute G ′ in n O ( d ) then this yieldsan algorithm that runs in n O ( d ) time for the IMP d (note that the size of the input polynomial f is bounded by n O ( d ) ). In this paper we focus on instances C = ( X = { x , . . . , x n } , D = { , } , C ) of CSP(Γ)(see Definition 1.1) where Γ is a language that is closed under Minority (see Definition 1.3).We first produce the reduced Gr¨obner basis G of I ( Sol ( C )) according to the lexicographicorder. Note that this Gr¨obner basis does not guarantee finding a solution to the IMP d (Γ)in polynomial time. In Section 3 we show how to convert G to a d -truncated Gr¨obner basis G for a graded lexicographic monomial ordering. We prove that this computation can be5btained in polynomial time for any fixed d = O (1). As pointed out at the end of Section 1.1,an efficient computation of G yields an efficient algorithm for the IMP d . A simple exampleis provided in Section 4. Thus we have the following main results: Theorem 1.1.
The d -truncated reduced Gr¨obner basis of a Boolean combinatorial idealwhose constraints are closed under the minority polymorphism can be computed in n O ( d ) time, assuming the graded lexicographic ordering of monomials. This proves the following:
Corollary 1.2.
The
IMP d (Γ) , over the Boolean domain, can be solved in polynomial timefor d = O (1) if the solution space of every constraint in Γ is closed under the minoritypolymorphism.Structure of the proof: A high level description of the proof structure is as follows. Eachconstraint that is closed under the minority polymorphism can be written in terms of linearequations (mod 2) (see e.g. [4]). In Section 2, we first express these equations in theirreduced row echelon form: that is to say the ‘leading variable’ (the variable that comesfirst in the lexicographic order or lex in short, see Definition B.5) in each equation doesnot appear in any other (mod 2) equation. We then show how each polynomial in (mod 2)translates to a polynomial in regular arithmetic with exactly the same 0/1 solutions. The useof elementary symmetric polynomials allows for an efficient computation of the polynomialsin regular arithmetic. Using these, we produce a set of polynomials G and prove that G isthe reduced Gr¨obner basis of I ( Sol ( C )) in the lex order. As already mentioned, a Gr¨obnerbasis in the lex order does not guarantee the efficient solvability of the IMP d . We providea conversion algorithm in Section 3 which converts G to the d -truncated reduced Gr¨obnerbasis G of I ( Sol ( C )) in the graded lexicographic ordering ( grlex for short, see Definition B.5).In Section 3.1 we show how polynomials in G from Section 2 are handled so our conversionalgorithm in Section 3.2 works in polynomial time. Theorem 3.3 proves the correctness andpolynomial running time of the conversion algorithm. This gives the proof of the main resultsof the paper stated in Theorem 1.1 and Corollary 1.2. lex order Consider an instance C = ( X = { x , . . . , x n } , D = { , } , C ) of CSP(Γ) where Γ is a languagethat is closed under Minority . Any constraint of C can be written as a system of linearequations over GF(2) (see e.g. [4]). These linear systems with variables x , . . . , x n can besolved by Gaussian elimination. If there is no solution, then we have from Hilbert’s WeakNullstellensatz (Theorem B.2) that 1 ∈ I ( Sol ( C )) ⇐⇒ Sol ( C ) = ∅ ⇐⇒ I ( Sol ( C )) = R [ x ].If 1 ∈ I ( Sol ( C )) the reduced Gr¨obner basis is { } . We proceed only if Sol ( C ) = ∅ . In thissection, we assume the lex order > lex with x > lex x > lex · · · > lex x n . We also assume thatthe linear system has r ≤ n equations and is already in its reduced row echelon form with x i as the leading monomial of the i -th equation. Let Supp i ⊂ [ n ] such that { x j : j ∈ Supp i } is the set of variables appearing in the i -th equation of the linear system except for x i . Letthe i -th equation be R i = 0 (mod 2) where R i := x i ⊕ f i , (1)6ith i ∈ [ r ] and f i is the Boolean function ( L j ∈ Supp i x j ) ⊕ α i and α i = 0 / In this section, we show how to transform R i ’s into polynomials in regular arithmetic. Theidea is to map R i to a polynomial R ′ i over R [ x , . . . , x n ] such that a ∈ { , } n satisfies R i = 0if and only if a satisfies R ′ i = 0. Moreover, R i is such that it has the same leading term as R ′ i . We produce a set of polynomials G and prove that G is the reduced Gr¨obner basis of I ( Sol ( C )) over R [ x , . . . , x n ] in the lex ordering. We define R ′ i as R ′ i := x i − M ( f i ) (2)where M ( f i ) = | Supp i | P k =1 ( − k − · k − P { x j ,...,x jk }⊆ Supp i x j x j · · · x j k ! when α i = 01 + | Supp i | P k =1 ( − k · k − P { x j ,...,x jk }⊆ Supp i x j x j · · · x j k ! when α i = 1 (3) Lemma 2.1.
Consider the following set of polynomials: G = { R ′ , . . . , R ′ r , x r +1 − x r +1 , . . . , x n − x n } , (4) where R ′ i is from Eq. (2) . G is the reduced Gr¨obner basis of I ( Sol ( C )) in the lexicographicorder x > lex x > lex . . . , > lex x n .Proof. For any two Boolean variables x and y , x ⊕ y = x + y − xy. (5)By repeatedly using Eq. (5) to obtain the equivalent expression for f i , we see that R i =0 (mod 2) and R ′ i = 0 have the same set of 0/1 solutions. Therefore V ( h G i ) is equalto Sol ( C ). This implies that h G i ⊆ I ( Sol ( C )). Moreover, LM( R i ) = LM( R ′ i ) = x i , byconstruction. For every pair of polynomials in G the reduced S -polynomial is zero as theleading monomials of any two polynomials in G are relatively prime. By Buchberger’sCriterion (see Theorem B.5) it follows that G is a Gr¨obner basis of h G i over R [ x , . . . , x n ](according to the lex order). In fact, it can be seen by inspection that G is the reduced Gr¨obner basis of h G i . To prove that I ( Sol ( C )) = h G i , we need to prove that any p ∈ I ( Sol ( C )) = ⇒ p ∈ h G i . It is enough to prove that p | G = 0 as this implies p ∈ h G i .We have that p | G cannot contain variable x i for all 1 ≤ i ≤ r . Hence p | G is multilinearin x r +1 , x r +2 , . . . , x n . Each tuple of D n − r extends to exactly that n − tuple in Sol ( C ) whosecoordinate associated with x i (1 ≤ i ≤ r ) is the unique value x i takes to satisfy x i ⊕ f i = 0(see Eq. (1) and Eq. (2)). As p | G is multilinear in x r +1 , x r +2 , . . . , x n , there are at most 2 n − r coefficients. Since every point of D n − r is a solution of p | G , we see that every coefficeint of p | G is zero and hence p | G is the zero polynomial. Hence G is the reduced Gr¨obner basisof I ( Sol ( C )). 7 xample 2.1. Consider a system with just one equation with R := x ⊕ x ⊕ x = 0 where x > lex x > lex x . Then f := x ⊕ x and M ( f ) := x + x − x x . The polynomialcorresponding to Eq. (2) is R ′ := x − x − x + 2 x x . The equations R = 0 and R ′ = 0 have the same set of 0/1 solutions and LM( R ) =LM( R ′ ) = x . For every pair of polynomials in G = { R ′ , x − x , x − x } the reduced S -polynomial is zero. By Buchberger’s Criterion (see e.g. [5] or Theorem B.5 in the appendix)it follows that G is a Gr¨obner basis over R [ x , x , x ] (according to the specified lex order). Note that the reduced Gr¨obner basis in Eq. (4) can be “efficiently” computed by exploitingthe high degree of symmetry in each M ( f i ) and using a version of the elementary symmetricpolynomials. Now that we have the reduced Gr¨obner basis in lex order, we show how to obtain the d -truncated reduced Gr¨obner basis in grlex order in polynomial time for any fixed d = O (1).Before we describe our conversion algorithm, we show how to expand a product of Booleanfunctions. This expansion will play a crucial step in our algorithm. In this section, we show a relation between a product of Boolean functions and (mod 2) sumsof the Boolean functions, which is heavily used in our conversion algorithm in Section 3.2.We have already seen from Eq. (5) that if f, g are two Boolean functions, then2 · f · g = f + g − ( f ⊕ g ) . Hence it can be proved by repeated use of the above equation that the following holdsfor Boolean functions f , f , . . . , f m : f · f · · · f m = 12 m − (cid:20) X i ∈ [ m ] f i − X { i,j }⊂ [ m ] ( f i ⊕ f j ) + X { i,j,k }⊂ [ m ] ( f i ⊕ f j ⊕ f k ) + · · · +( − m − ( f ⊕ f ⊕ · · · ⊕ f m ) (cid:21) . (6)We call each Boolean function of the form ( f i ⊕ · · · ⊕ f i k ) in Eq. (6) as a Boolean term . Wecall the Boolean term ( f ⊕ f ⊕ · · · ⊕ f m ) as the longest Boolean term of the expansion.Thus, a product of Boolean functions can be expressed as a linear combination of Booleanterms. Note that Eq. (6) is symmetric with respect to f , f , . . . , f m as any f i interchangedwith f j produces the same expression. It is no coincidence that we chose the letter f in the We earlier considered Boolean variables, but the same holds for Boolean functions. f j from R j := x j ⊕ f j (see Section 2).When we use Eq. (6) in the conversion algorithm, we will have to evaluate a product of atmost d functions, i.e. m ≤ d = O (1). We now see in the right hand side of Eq. (6) that thecoefficient 1 / m − is of constant size and there are O (1) many Boolean terms. The FGLM [7] conversion algorithm is well known in computer algebra for converting agiven reduced Gr¨obner basis of a zero dimensional ideal in some ordering to the reducedGr¨obner basis in any other ordering. However, it does so with O ( nD ( h G i ) ) many arith-metic operations, where D ( h G i ) is the dimension of the R -vector space R [ x , . . . , x n ] / h G i (see Proposition 4.1 in [7]). D ( h G i ) is also equal to the number of common zeros (with mul-tiplicity) of the polynomials from h G i , which would imply that for the combinatorial idealsconsidered in this paper, D ( h G i ) = O (2 n − r ). This exponential running time is avoidedin our conversion algorithm by exploiting the symmetries in Eq. (3) and by truncating thecomputation up to degree d .Some notations necessary for the algorithm are as follows: G and G are the reducedGr¨obner basis of h G i in lex and grlex ordering respectively. LM( G i ) is the set of leadingmonomials of polynomials in G i for i ∈ { , } . Since we know G , we know LM( G ),whereas G and LM( G ) are constructed by the algorithm. B ( G ) is the set of monomialsthat cannot be divided (considering the lex order) by any monomial of LM( G ). Therefore, B ( G ) is the set of all multilinear monomials in variables x r +1 , . . . , x n . Similarly, B ( G ) isthe set of monomials that cannot by divided (considering the grlex order) by any monomialof LM( G ).Recall the definition of f i for i ≤ r from Section 2. For i > r , for notational purposes,we define the Boolean function f i := x i . Lemma 3.1.
Consider a monomial q such that deg ( q ) ≤ d . Then q | G can be expressed asa linear combination of Boolean terms.Proof. Consider q = x i x i · · · x i k where k ≤ d . Then from Eqs. (1) and (2), q | G = f i f i · · · f i k and the lemma holds using Eq. (6).Let elements b i of B ( G ) be arranged in increasing grlex order. We construct a set C inour algorithm such that its elements c i are defined as c i = b i | G written as linear combina-tions of Boolean terms using Lemma 3.1. We say that a Boolean term f of c i “appears in c j ” for some j < i if the longest Boolean term of c j is f ⊕ α where α = 0 / Q be the set of all monomials m such that 1 < grlex deg ( m ) ≤ grlex d . We recommendthe reader to refer to the example in Section 4 and Appendix A for an intuitive workingof the algorithm. We now describe the algorithm in full (we assume 1 / ∈ I ( Sol ( C )), else G = { } = G and we are done): Inputs:
Degree d , G , Q Initial states: G = ∅ , B ( G ) = { b ) } , C = { c ) } , q = x n . Outputs: d -Truncated versions of G , B ( G ).9 Main loop:
Find q | G , by which we simply replace any occurrence of x i by the Booleanfunctions f i . Expand q | G by using Eq. (6). – Suppose the longest Boolean term of q | G does not appear in any c ∈ C . Then q | G is written as a linear combination of b i | G and its longest Boolean term (seeLemma 3.2). This polynomial is added to C and q is added to B ( G ). Go to Termination check . – If the longest Boolean term of q | G appears in some c ∈ C , then every Booleanterm of q | G can be written as linear combinations of b j | G ’s. Note that if thelongest Boolean term f appears in c as f ⊕
1, then we use f ⊕ − ( f )(see Eq. (5)). Thus we have q | G = P j k j b j | G = ⇒ q − P j k j b j ∈ h G i . Thepolynomial q − P j k j b j is added to G and q to LM( G ). Go to Terminationcheck . • Termination check:
We delete the occurrence of q from Q . If q was added to LM( G )then we delete any monomial in Q that q can divide. The algorithm terminates if Q isempty, else go to Next monomial . • Next monomial:
Choose the smallest (according to grlex order) monomial in Q as q .Go to Main loop . Lemma 3.2.
The set C is such that every c i is a linear combination of existing b j | G ’s( j < i ) and the longest Boolean term of b i | G .Proof. By definition, element c i is added to C when a monomial q is added to B ( G ) where b i = q and c i = b i | G expressed in Boolean terms (see Main loop). This means that q is notdivisible by any monomial in LM( G ). We prove the lemma by induction on the degree of q . Note that b = 1 and hence c = b | G = 1.If deg ( q ) = 1, then q is some x i and x i | G is one of 0 , f i . If x i | G is either 0 or 1,then it then appears in c . We are now in the second case of the Main loop, so q should beadded to LM( G ) and not B ( G ). Hence x i | G can be neither 0 nor 1 and the lemma holdsfor deg ( q ) = 1 as f i is the longest Boolean term.Let us assume the statement holds true for all monomials with degree less than m .Consider q such that deg ( q ) = m and q = x i x i . . . x i m where i j ’s need not be distinct, andthe lemma holds for every monomial < grlex q . Then q | G = f i · f i · · · f i m . Let ( f j ⊕ · · · ⊕ f j k )be a Boolean term in the expansion of q | G (by using Eq. (6)), that is not the longest Booleanterm, so { j , . . . , j k } ⊂ { i , . . . , i m } and k < m . Consider the monomial x j x j . . . x j k . Wewill now prove that x j x j . . . x j k is in fact some b l ∈ B ( G ) and there exists c l ∈ C whichis a linear combination of b i | G ’s and ( f j ⊕ · · · ⊕ f j k ). The monomial x j x j . . . x j k eitherbelongs to LM ( G ) or B ( G ). If x j x j . . . x j k ∈ LM( G ) then it divides q , a contradiction toour choice of q . Therefore, x j x j . . . x j k = b l ∈ B ( G ). Clearly b l < grlex q and the inductionhypothesis applies, so there exists c l ∈ C such that b l | G = c l = X i The conversion algorithm terminates for every input G and correctly com-putes a d -truncated reduced Gr¨obner basis, with the grlex ordering, of the ideal h G i in poly-nomial time.Proof. The Main loop runs at most | Q | = O ( n d ) times. Evaluation of any q | G can be donein O ( n ) steps (see Eq. (6)), checking if previous c i ’s appear (and replacing every Booleanterm appropriately if it does) takes at most O ( n d ) steps since there are at most | Q | manyelements in C . Hence the running time of the algorithm is O ( n d ).Suppose the set of polynomials { g , g , . . . , g k } is the output of the algorithm for someinput G . Clearly, deg ( g i ) ≤ d for all i ∈ [ k ]. We now prove by contradiction that the outputis the d -truncated Gr¨obner basis of the ideal h G i with the grlex ordering. Suppose g is apolynomial of the ideal with deg ( g ) ≤ d , but no LM( g i ) can divide LM( g ). In fact, sinceevery g i ∈ h G i we can replace g by g | { g ,g ,...,g k } ( g generalises the reduced S -polynomial).The fact that g ∈ h G i and g | G = 0 implies that LM( g ) is a linear combination of monomialsthat are less than LM( g ) (in the grlex order) and hence must be in B ( G ), i.e g | G = 0 = ⇒ LM( g ) | G = X i k i b i | G where every b i ∈ B ( G ) and b i < grlex LM( g ). When the algorithm runs for q = LM( g ), since q was not added to LM( G ), LM( g ) | G = X j k j b j | G + f where f is the longest Boolean term of LM( g ) | G which does not appear in any previouselement of C . But the two equations above imply that P i k i b i | G = P j k j b j | G + f , whichproves that there exists some b l ∈ B ( G ) such that c l has f as its longest Boolean term, so f should have appeared in c l , a contradiction. Therefore the output is a d -truncated Gr¨obnerbasis. Although unnecessary for the IMP d , we also prove that the output is reduced: everynon leading monomial of every polynomial in the output comes from B ( G ) and no leadingmonomial is a multiple of another by construction (see Termination check).Thus we have proof of the main theorem and corollary (see Theorem 1.1 and Corol-lary 1.2). We provide a simple example in Table 1 where we convert the reduced Gr¨obner basis in lex order of a combinatorial ideal to one in grlex order. Consider the problem formulated by thefollowing (mod 2) equations: x ⊕ x ⊕ x = 0 and x ⊕ x ⊕ x ⊕ q B ( G ) C G ∅ x x x -2 x x x -3 x x x -4 x x x ⊕ x ⊕ x x x ⊕ x -6 x - - x − x x x x x [ x | G + x | G - − ( x ⊕ x )]8 x - - x − x x x - - x x − [ x + x + x − x x - - x x − [ − x + x + x ]11 x - - x − x x x - - x x − [ x + x + x − x x x x [ x | G + x | G - − ( x ⊕ x ⊕ x ⊕ x x - - x x − [ x + x + x − x - - x − x x x - - x x + x x − [ x + x + x + x − x x - - x x − [ x − x + x ]18 x x - - x x − [ x + x − x ]19 x x - - -20 x - - x − x Table 1: Example The IMP d tractability for combinatorial ideals has useful practical applications as it impliesbounded coefficients in Sum-of-Squares proofs. A dichotomy result between “hard” (NP-hard) and “easy” (polynomial time) IMP s was recently achieved for the IMP [2, 21]over the finite domain nearly thirty years after that over the Boolean domain [18]. The IMP d for d = O (1) over the Boolean domain was tackled by Mastrolilli [13] based on theclassification of the IMP through polymorphisms, where the complexity of the IMP d for fiveof six polymorphisms was solved. We solve the remaining problem, i.e. the complexity of the IMP d (Γ) when Γ is closed under the ternary minority polymorphism. This is achieved byshowing that the d -truncated reduced Gr¨obner basis can be computed in polynomial time,thus completing the missing link in the dichotomy result of [13].Moreover, we believe the techniques described in this paper can be generalized for a finitedomain with prime p elements, as constraints that are linear equations (mod p ) are associatedwith an affine polymorphism [11]. We claim that the IMP d is tractable for problems thatare constrained as linear equations (mod p ). This is a step in identifying the borderline oftractability, if it exists, for the general IMP d . We believe that generalizing the dichotomyresults of solvability of the IMP d for a finite domain is an interesting and challenging goal12hat we leave as an open problem. References [1] B. Buchberger. Bruno buchbergers phd thesis 1965: An algorithm for finding the basis ele-ments of the residue class ring of a zero dimensional polynomial ideal. Journal of SymbolicComputation , 41(3):475 – 511, 2006. Logic, Mathematics and Computer Science: Interactionsin honor of Bruno Buchberger (60th birthday).[2] A. A. Bulatov. A dichotomy theorem for nonuniform CSPs (best paper award). In , pages 319–330, 2017.[3] A. A. Bulatov. Constraint satisfaction problems: Complexity and algorithms. ACM SIGLOGNews , 5(4):4–24, Nov. 2018.[4] H. Chen. A rendezvous of logic, complexity, and algebra. ACM Comput. Surv. , 42(1):2:1–2:32,Dec. 2009.[5] D. A. Cox, J. Little, and D. O’Shea. Ideals, Varieties, and Algorithms: An Introduction toComputational Algebraic Geometry and Commutative Algebra . Springer Publishing Company,Incorporated, 4th edition, 2015.[6] A. Dickenstein, N. Fitchas, M. Giusti, and C. Sessa. The membership problem for unmixedpolynomial ideals is solvable in single exponential time. Discrete Applied Mathematics , 33:73–94, 1991.[7] J.-C. Faug`ere, P. M. Gianni, D. Lazard, and T. Mora. Efficient computation of zero-dimensional grbner bases by change of ordering. Journal of Symbolic Computation , 16(4):329– 344, 1993.[8] D. Hilbert. Ueber die theorie der algebraischen formen. Mathematische Annalen , 36:473 – 534,1890.[9] D. Hilbert. Ueber die vollen invariantensysteme. Mathematische Annalen , 42:313–373, 1893.[10] P. Jeavons. On the algebraic structure of combinatorial problems. Theoretical ComputerScience , 200(1):185 – 204, 1998.[11] P. Jeavons, D. Cohen, and M. Gyssens. A unifying framework for tractable constraints. InU. Montanari and F. Rossi, editors, Principles and Practice of Constraint Programming —CP ’95 , pages 276–291, Berlin, Heidelberg, 1995. Springer Berlin Heidelberg.[12] M. Laurent. Sums of Squares, Moment Matrices and Optimization Over Polynomials , pages157–270. Springer New York, New York, NY, 2009.[13] M. Mastrolilli. The complexity of the ideal membership problem for constrained problemsover the boolean domain. In Proceedings of the Thirtieth Annual ACM-SIAM Symposiumon Discrete Algorithms , SODA ’19, pages 456–475, Philadelphia, PA, USA, 2019. Society forIndustrial and Applied Mathematics. 14] E. W. Mayr. Membership in polynomial ideals over q is exponential space complete. InB. Monien and R. Cori, editors, STACS 89 , pages 400–406, Berlin, Heidelberg, 1989. SpringerBerlin Heidelberg.[15] E. W. Mayr and A. R. Meyer. The complexity of the word problems for commutative semi-groups and polynomial ideals. Advances in Mathematics , 46(3):305–329, 1982.[16] R. O’Donnell. SOS Is Not Obviously Automatizable, Even Approximately. In C. H. Papadim-itriou, editor, ,volume 67 of Leibniz International Proceedings in Informatics (LIPIcs) , pages 59:1–59:10,Dagstuhl, Germany, 2017. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik.[17] P. Raghavendra and B. Weitz. On the Bit Complexity of Sum-of-Squares Proofs. In I. Chatzi-giannakis, P. Indyk, F. Kuhn, and A. Muscholl, editors, , volume 80 of Leibniz InternationalProceedings in Informatics (LIPIcs) , pages 80:1–80:13, Dagstuhl, Germany, 2017. SchlossDagstuhl–Leibniz-Zentrum fuer Informatik.[18] T. J. Schaefer. The complexity of satisfiability problems. In Proceedings of the Tenth AnnualACM Symposium on Theory of Computing , STOC ’78, pages 216–226, New York, NY, USA,1978. ACM.[19] A. Shpilka. Recent results on polynomial identity testing. In A. Kulikov and N. Vereshchagin,editors, Computer Science – Theory and Applications , pages 397–400, Berlin, Heidelberg, 2011.Springer Berlin Heidelberg.[20] M. R. van Dongen. Constraints, Varieties, and Algorithms . PhD thesis, Department of Com-puter Science, University College, Cork, Ireland, 2002.[21] D. Zhuk. A proof of CSP dichotomy conjecture (best paper award). In , pages 331–342, 2017. Example (in detail) Note that f = x ⊕ x , f = x ⊕ x ⊕ f = x , f = x and f = x . The reduced Gr¨obnerbasis in the lex order is G = G = { x − M ( f ) , x − M ( f ), dom ( x ), dom ( x ), dom ( x ) } .We start with G = LM( G ) = ∅ , B ( G ) = C = { } (so b = c = 1) and q = x . For theproblem of d = 2, we have Q = { x , x , x , x , x , x , x x , x , x x ,x x , x , x x , x x , x x , x , x x , x x ,x x , x x , x } . We start with q = x and since q | G = x and does not appear as the longest Booleanterm of any element of C , we have that x is added to C (so c = x ) and x is added to B ( G ) (so b = x ). The Termination check of the algorithm deletes x from Q and Nextmonomial chooses q = x . The iterations are similar for q = x and q = x , so we have b = c = x and b = c = x and x , x are deleted from Q . When Next monomial chooses q = x , we have q | G = f = ( x ⊕ x ⊕ c ∈ C , we add ( x ⊕ x ⊕ 1) to C (so c = ( x ⊕ x ⊕ x to B ( G ) (so b = x ).For similar reasons, when q = x , we add c = ( x ⊕ x ) to C and b = x to B ( G ).After the 5-th iteration (see Table 1) is complete, we only have degree-two monomials in Q . Next monomial chooses q = x and q | G = x . Since c = x , x appears as a Boolean termin c . Since the longest Boolean term appears already in C , q | G must be a linear combinationof existing b i | G ’s. That is to say, x | G = c = b | G = x | G = ⇒ x | G = x | G , so thepolynomial x − x is added to G . Termination check adds x to LM( G ) and deletes x from Q . Next monomial chooses q = x x , so x x | G = f · f = 12 [ x + x − ( x ⊕ x )] = 12 [ x | G + x | G − ( x ⊕ x )] . The longest Boolean term of q | G is ( x ⊕ x ) which does not appear in any c ∈ C , so c = 1 / x | G + x | G − ( x ⊕ x )] is added to C and b = x x is added to B ( G ). Nextmonomial chooses q = x , this is similar to the case when q = x , we see that when q = x ,and x − x is added to G and x to LM( G ). When Next monomial chooses q = x x wehave x x | G = f · f = 12 [ x + x − ( x ⊕ x )] . Note that ( x ⊕ x ⊕ 1) appears in c ∈ C . We use the fact that ( f ⊕ 1) = 1 − f (see Mainloop ), and we have x x | G = 12 [ x + x − ( x ⊕ x )] = 12 [ x | G + x | G − (1 − ( x ⊕ x ⊕ x | G + x | G + x | G − | G ]and thus x x − [ x + x + x − 1] is added to G and x x to LM( G ). The rest of thepolynomials in B ( G ) , G , C are as shown in Table 1. It can be seen that after the 20-thiteration, Q becomes empty and Termination check halts the algorithm. This gives the 2-truncated reduced Gr¨obner basis G of the combinatorial ideal. Note that this is in fact thereduced Gr¨obner basis in its entirety for this example (see Termination check ).15 Ideals, Varieties and Constraints Let F denote an arbitrary field (for the applications of this paper F = R ). Let F [ x , . . . , x n ]be the ring of polynomials over a field F and indeterminates x , . . . , x n . Let F [ x , . . . , x n ] d denote the subspace of polynomials of degree at most d . Definition B.1. The ideal (of F [ x , . . . , x n ] ) generated by a finite set of polynomials { f ,. . . , f m } in F [ x , . . . , x n ] is defined as I ( f , . . . , f m ) def = ( m X i =1 t i f i | t , . . . , t m ∈ F [ x , . . . , x n ] ) . The set of polynomials that vanish in a given set S ⊂ F n is called the vanishing ideal of S and denoted: I ( S ) def = { f ∈ F [ x , . . . , x n ] : f ( a , . . . , a n ) = 0 ∀ ( a , . . . , a n ) ∈ S } . Definition B.2. An ideal I is radical if f m ∈ I for some integer m ≥ implies that f ∈ I . Another common way to denote I ( f , . . . , f m ) is by h f , . . . , f m i and we will use bothnotations interchangeably. Definition B.3. Let { f , . . . , f m } be a finite set of polynomials in F [ x , . . . , x n ] . We call V ( f , . . . , f m ) def = { ( a , . . . , a n ) ∈ F n | f i ( a , . . . , a n ) = 0 1 ≤ i ≤ m } the affine variety defined by f , . . . , f m . Definition B.4. Let I ⊆ F [ x , . . . , x n ] be an ideal. We will denote by V ( I ) the set V ( I ) = { ( a , . . . , a n ) ∈ F n | f ( a , . . . , a n ) = 0 ∀ f ∈ I } . Theorem B.1 ([5], Th.15, p.196) . If I and J are ideals in F [ x , . . . , x n ] , then V ( I ∩ J ) = V ( I ) ∪ V ( J ) . B.1 The Ideal-CSP Correspondence Indeed, let C = ( X, D, C ) be an instance of the CSP (Γ) (see Definition 1.1). Without lossof generality, we shall assume that D ⊂ N and D ⊆ F .Let Sol ( C ) be the (possibly empty) set of all feasible solutions of C . In the following, wemap Sol ( C ) to an ideal I C ⊆ F [ X ] such that Sol ( C ) = V ( I C ).Let Y = ( x i , . . . , x i k ) be a k -tuple of variables from X and let R ( Y ) be a non emptyconstraint from C . In the following, we map R ( Y ) to a generating system of an ideal suchthat the projection of the variety of this ideal onto Y is equal to R ( Y ) (see [20] for moredetails).Every v = ( v , . . . , v k ) ∈ R ( Y ) corresponds to some point v ∈ F k . It is easy to check [5]that I ( { v } ) = h x i − v , . . . , x i k − v k i , where h x i − v , . . . , x i k − v k i ⊆ F [ Y ] is radical. ByTheorem B.1, we have R ( Y ) = [ v ∈ R ( Y ) V ( I ( { v } )) = V (cid:0) I R ( Y ) (cid:1) where I R ( Y ) = \ v ∈ R ( Y ) I ( { v } ) , (7)16here I R ( Y ) ⊆ F [ Y ] is zero-dimensional and radical ideal since it is the intersection of radicalideals (see [5], Proposition 16, p.197). Equation (7) states that constraint R ( Y ) is a varietyof F k . It is easy to find a generating system for I R ( Y ) : I R ( Y ) = h Y v ∈ R (1 − k Y j =1 δ v j ( x i j )) , Y j ∈ D ( x i − j ) , . . . , Y j ∈ D ( x i k − j ) i , (8)where δ v j ( x i j ) are indicator polynomials, i.e. equal to one when x i j = v j and zero when x i j ∈ D \ { v j } ; polynomials Q j ∈ D ( x i k − j ) force variables to take values in D and will bedenoted as domain polynomials .The smallest ideal (with respect to inclusion) of F [ X ] containing I R ( Y ) ⊆ F [ x ] will bedenoted I F [ X ] R ( Y ) and it is called the F [ X ]-module of I . The set Sol ( C ) ⊂ F n of solutions of C = ( X, D, C ) is the intersection of the varieties of the constraints: Sol ( C ) = \ R ( Y ) ∈ C V (cid:16) I F [ X ] R ( Y ) (cid:17) = V ( I C ) , (9) I C = X R ( Y ) ∈ C I F [ X ] R ( Y ) . (10)The following properties follow from Hilbert’s Nullstellensatz. Theorem B.2. Let C be an instance of the CSP (Γ) and I C defined as in (10) . Then(Weak Nullstellensatz) (11) V ( I C ) = ∅ ⇔ ∈ I ( I C ) ⇔ I C = F [ X ] , (Strong Nullstellensatz) (12) I ( V ( I C )) = √ I C , (Radical Ideal) (13) √ I C = I C . Theorem B.2 follows from a simple application of the celebrated and basic result in alge-braic geometry known as Hilbert’s Nullstellensatz. In the general version of Nullstellensatzit is necessary to work in an algebraically closed field and take a radical of the ideal ofpolynomials. In our special case it is not needed due to the presence of domain polynomials.Indeed, the latter implies that we know a priori that the solutions must be in F (note thatwe are assuming D ⊆ F ). B.2 Gr¨obner bases. In this section we suppose a fixed monomial ordering > on F [ x , . . . , x n ] (see [5], Definition1, p.55), which will not be defined explicitly. We can reconstruct the monomial x α = x α · · · x α n n from the n -tuple of exponents α = ( α , . . . , α n ) ∈ Z n ≥ . This establishes a one-to-one correspondence between the monomials in F [ x , . . . , x n ] and Z n ≥ . Any ordering > weestablish on the space Z n ≥ will give us an ordering on monomials: if α > β according to thisordering, we will also say that x α > x β . The two monomial orderings that we use in thispaper are the lexicographic order > lex and the graded lexicographic ordering > grlex .17 efinition B.5. Let α = ( α , . . . , α n ) , β = ( β , . . . , β n ) ∈ Z n ≥ and | α | = P ni =1 α i , | β | = P ni =1 β i .(i) We say α > lex β if, in the vector difference α − β ∈ Z n , the left most nonzero entry ispositive. We will write x α > lex x β if α > lex β .(ii) We say α > grlex β if | α | > | β | , or | α | = | β | and α > lex β . Definition B.6. For any α = ( α , · · · , α n ) ∈ Z n ≥ let x α def = Q ni =1 x α i i . Let f = P α a α x α be anonzero polynomial in F [ x , . . . , x n ] and let > be a monomial order.(i) The multidegree of f is multideg( f ) def = max( α ∈ Z n ≥ : a α = 0) .(ii) The degree of f is deg ( f ) = | multideg( f ) | . In this paper, this is always according to grlex order.(iii) The leading coefficient of f is LC( f ) def = a multideg( f ) ∈ F .(iv) The leading monomial of f is LM( f ) def = x multideg( f ) (with coefficient 1).(v) The leading term of f is LT( f ) def = LC( f ) · LM( f ) . The concept of reduction , also called multivariate division or normal form computation , iscentral to Gr¨obner basis theory. It is a multivariate generalization of the Euclidean divisionof univariate polynomials. Definition B.7. Fix a monomial order and let G = { g , . . . , g t } ⊂ F [ x , . . . , x n ] . Given f ∈ F [ x , . . . , x n ] , we say that f reduces to r modulo G , written f → G r , if f can bewritten in the form f = A g + · · · + A t g t + r for some A , . . . , A t , r ∈ F [ x , . . . , x n ] , suchthat:(i) No term of r is divisible by any of LT( g ) , . . . , LT( g t ) .(ii) Whenever A i g i = 0 , we have multideg( f ) ≥ multideg( A i g i ) .The polynomial remainder r is called a normal form of f by G and will be denoted by f | G . A normal form of f by G , i.e. f | G , can be obtained by repeatedly performing the followinguntil it cannot be further applied: choose any g ∈ G such that LT( g ) divides some term t of f and replace f with f − t LT( g ) g . Note that the order we choose the polynomials g in thedivision process is not specified.In general a normal form f | G is not uniquely defined. Even when f belongs to the idealgenerated by G , i.e. f ∈ I ( G ), it is not always true that f | G = 0. Example B.1. Let f = xy − y and G = { g , g } , where g = xy − and g = y − .Consider the graded lexicographic order (with x > y ) and note that f = y · g − y · g + 0 and f = 0 · g + ( x − y ) · g + x − y . This non-uniqueness is the starting point of Gr¨obner basis theory.18 efinition B.8. Fix a monomial order on the polynomial ring F [ x , . . . , x n ] . A finite subset G = { g , . . . , g t } of an ideal I ⊆ F [ x , . . . , x n ] different from { } is said to be a Gr¨obnerbasis (or standard basis ) if h LT( g ) , . . . , LT( g t ) i = h LT( I ) i , where we denote by h LT( I ) i the ideal generated by the elements of the set LT( I ) of leading terms of nonzero elements of I . Definition B.9. A reduced Gr¨obner basis for a polynomial ideal I is a Gr¨obner basis G for I such that:(i) LC( g ) = 1 for all g ∈ G .(ii) For all g ∈ G , g cannot reduce any other polynomial from G , i.e f | g = f for every f ∈ G \ { g } . It is known (see [5], Theorem 5, p.93) that for a given monomial ordering, a polynomialideal I = { } has a reduced Gr¨obner basis (see Definition B.9), and the reduced Gr¨obnerbasis is unique. Proposition B.3 ([5], Proposition 1, p.83) . Let I ⊂ F [ x , . . . , x n ] be an ideal and let G = { g , . . . , g t } be a Gr¨obner basis for I . Then given f ∈ F [ x , . . . , x n ] , f can be written in theform f = A g + · · · + A t g t + r for some A , . . . , A t , r ∈ F [ x , . . . , x n ] , such that:(i) No term of r is divisible by any of LT( g ) , . . . , LT( g t ) .(ii) Whenever A i g i = 0 , we have multideg( f ) ≥ multideg( A i g i ) .(iii) There is a unique r ∈ F [ x , . . . , x n ] .In particular, r is the remainder on division of f by G no matter how the elements of G arelisted when using the division algorithm. Corollary B.4 ([5], Corollary 2, p.84) . Let G = { g , . . . , g t } be a Gr¨obner basis for I ⊆ F [ x , . . . , x n ] and let f ∈ F [ x , . . . , x n ] . Then f ∈ I if and only if the remainder on divisionof f by G is zero. Definition B.10. We will write f | F for the remainder of f by the ordered s -tuple F =( f , . . . , f s ) . If F is a Gr¨obner basis for h f , . . . , f s i , then we can regard F as a set (withoutany particular order) by Proposition B.3. The “obstruction” to { g , . . . , g t } being a Gr¨obner basis is the possible occurrence ofpolynomial combinations of the g i whose leading terms are not in the ideal generated by theLT( g i ). One way (actually the only way) this can occur is if the leading terms in a suitablecombination cancel, leaving only smaller terms. The latter is fully captured by the so called S -polynomials that play a fundamental role in Gr¨obner basis theory. Definition B.11. Let f, g ∈ F [ x , . . . , x n ] be nonzero polynomials. If multideg( f ) = α and multideg( g ) = β , then let γ = ( γ , . . . , γ n ) , where γ i = max( α i , β i ) for each i . We call x γ the least common multiple of LM( f ) and LM( g ) , written x γ = lcm(LM( f ) , LM( g )) . The S -polynomial of f and g is the combination S ( f, g ) = x γ LT( f ) · f − x γ LT( g ) · g . S -polynomials to eliminate leading terms of multivariate polynomials gener-alizes the row reduction algorithm for systems of linear equations. If we take a system ofhomogeneous linear equations (i.e.: the constant coefficient equals zero), then it is not hardto see that bringing the system in triangular form yields a Gr¨obner basis for the system. Theorem B.5 ( Buchberger’s Criterion ) . (See e.g. [5], Theorem 3, p.105) A basis G = { g , . . . , g t } for an ideal I is a Gr¨obner basis if and only if S ( g i , g j ) → G for all i = j . By Theorem B.5 it is easy to show whether a given basis is a Gr¨obner basis. Indeed,if G is a Gr¨obner basis then given f ∈ F [ x , . . . , x n ], f | G is unique and it is the remainderon division of f by G , no matter how the elements of G are listed when using the divisionalgorithm.Furthermore, Theorem B.5 leads naturally to an algorithm for computing Gr¨obner basesfor a given ideal I = h f , . . . , f s i : start with a basis G = { f , . . . , f s } and for any pair f, g ∈ G with S ( f, g ) | G = 0 add S ( f, g ) | G to G . This is known as Buchberger’s algorithm [1](for more details see Algorithm 1 in Section B.2.1).Note that Algorithm 1 is non-deterministic and the resulting Gr¨obner basis in notuniquely determined by the input. This is because the normal form S ( f, g ) | G (see Algo-rithm 1, line 8) is not unique as already remarked. We observe that one simple way toobtain a deterministic algorithm (see [5], Theorem 2, p. 91) is to replace h := S ( f, g ) | G inline 8 with h := S ( f, g ) | G (see Definition B.10), where in the latter G is an ordered tuple.However, this is potentially dangerous and inefficient. Indeed, there are simple cases wherethe combinatorial growth of set G in Algorithm 1 is out of control very soon. B.2.1 Construction of Gr¨obner Bases. Buchberger’s algorithm [1] can be formulated as in Algorithm 1. The pairs that get placed Input : A finite set F = { f , . . . , f s } of polynomials Output : A finite Gr¨obner basis G for h f , . . . , f s i G := F C := G × G while C = ∅ do Choose a pair ( f, g ) ∈ C C := C \ { ( f, g ) } h := S ( f, g ) | G if h = 0 then C := C ∪ ( G × { h } ) G := G ∪ { h } end if end while Return G Algorithm 1: