Groebner Package

Garry Helzer
Department of Mathematics
University of Maryland
College Park, MD 20742
USA
301-405-5176
g_helzer@math.umd.edu

Version 1.01                                                                                May, 1994

Overview

The Groebner package contains  functions for computing with Groebner bases of polynomial rings,  and their modules, over the field of rational numbers. The function Groebner computes Groebner bases with respect to a given term order.  The function NormalForm computes the remainder resulting from  the division algorithm.  The function ExtendedNormalForm computes the quotient polynomials as well as the remainder from the division algorithm and the function ExtendedGroebner computes the polynomial coefficients expressing the Groebner basis as a linear combination of the giver basis as well as the Groebner basis itself.  In addition a number of functions are provided that facilitate common Groebner basis calculations.
 
A number  of standard term orders are built into the package. In addition the user may define special term orders.  See the section on term orders below.

Module calculations are handled with placeholder variables.  That is, a tuple such as (x2 - y, z3)  is entered  as (x^2 - y)e1 + z^3e2  and  the Mathematica  variables e1 and e2 are flagged as placeholders.  See the section on placeholders below for details.

Computing Groebner Bases

The expression 

     Groebner[F,vars,pvars,order]
     
returns the reduced Groebner basis of the submodule generated by the the set of polynomials F.  The second argument is the list of variables in descending order and the third argument, which is optional, specifies which variables are placeholders. The fourth argument specifies the term order to be used. 

Example 1: 

G=Groebner[{1-x y, x^2+y^2-1}, {x,y}, deglex]

computes the reduced Groebner basis of the ideal of Q[x,y] generated by 1-xy and x2+y2-1   using the degree lexicographical order with  x>y.

Example 2:
    
   G=Groebner[{(1+x^2)e1 + y e2, z e1-x e2},{x,y,z,e1,e2},
                                                {e1,e2}, deglex]
   
computes the reduced Groebner basis of the submodule of  Q[x,y,z]2  generated by  the vectors (1+x2, y) and (z, -x).  The order of the variables is  x>y>z>e1>e2. This happens to be a term- over-postion order.  For information on module orders see the section on placeholder variables.

The option ShowProgress->True may be used to while away the time while the function executes. For an explanation of the output see the section on options.

A form with only two arguments is permitted. The expression

Groebner[F,vars]

simply calls Mathematica's built in GroebnerBasis function with the same arguments. The built-in function uses the lexocographical order. Options may not be used with this form.

The function ExtendedGroebner has the same syntax as Groebner except that a two argument form is not available.  It returns a list with two entries. The the second entry is the list of  polynomials in the Groebner basis and the first entry is a matrix of polynomial coefficients expressing the Groebner basis in terms of the given basis.

Example 3: Using the system of Example 2.
    
   F={(1+x^2)e1 + y e2, z e1-x e2};
  {T, G}=ExtendedGroebner[F,{x,y,z,e1,e2},{e1,e2}, deglex]
 
Computes the same G (up to constant factors) as Example 2  and in addition defines a matrix, T, of polynomials in  Q[x,y,z]  such that the matrix-vector product  T.F  is the vector G. (Since polynomial products are not automatically simplified in Mathematica  the simplest way to check this is to verify that the expression  Expand[G - T.F]  returns a zero vector.)  ExtendedGroebner is slower than Groebner  by a factor of about 2.

The polynomials returned by ExtendedGroebner are not primitive.  The function MakeMonic described in the section titled Other Functions may be used to adjust the coefficients.

Computing Normal Forms

The expression 

     NormalForm[F,vars,pvars,order][p]
     
performs a version of division algorithm on the module element p using the polynomials in the set F, returning the remainder.    The second argument is the list of variables in descending order and the third argument, which is optional, specifies which variables are placeholders. The fourth argument specifies the term order to be used.  If the set F is a Groebner basis with respect to the order specified then the result is the normal form of the element p with respect to the submodule generated by F.  If  F  is not a Groebner basis then the result depends upon the order of the elements of F. Note: If several elements of  F  have the same leading power product, this version keeps the first element and discards the rest.

Note that if several normal forms are to be computed with only  p  varying then one may
 save typing by defining
 
  NF=NormalForm[F,vars,pvars,order]
  
 and  computing  NF[p1],  NF[p2], and so on. 


Example: 

G=Groebner[{1-x y, x^2+y^2-1}, {x,y}, deglex];
NG=NormalForm[G,{x,y},deglex];
NG[1-x y]

should produce a zero.

The function NormalForm returns only the remainder.  The  'quotients'  may be obtained using the function  ExtendedNormalForm. ExtendedNormalForm has the same syntax as NormalForm  but returns a pair {T,r} where T is the vector of quotients. That is, if F is a list (vector) of polynomials and 

             {T,r}=ExtendedNormalForm[F,vars,order][p]

 then  p is T.F+r.  Since polynomial products are not automatically simplified in Mathematica the simplest way to check this is to verify that  Expand[p-(T.F+r)] returns a zero.
 
 The function NormalForm executes no faster than ExtendedNormalForm.  To check submodule membership the function MemberShipQ, which executes faster than NormalForm, is provided.  MembershipQ has the same syntax as the normal form functions but returns True if p  is in the ideal generated by F and False otherwise.

Other Functions

A number of functions useful in working with Groebner bases are provided

Ordering polynomials

The expressions 

 OrderForm[vars,order][p]  or  p//OrderForm[vars,order]
 
display the polynomial p, in a rather klunky format,  as a  descending sum of terms with respect to the given order. The argument  vars lists the variables in descending order. (Since only a sort is involved the placeholder variables need not be singled out for special treatement and so a placeholder argument is not needed.)

The expression 

 OrderSet[vars,order][F]
 
reorders the set of polynomials F in descending order by leading term with respect to the given order.

The expression 

 DisplaySet[vars,order][F]
 
applies OrderSet to F, then displays the result in a single column using OrderForm on the individual polynomials.

Leading terms

Functions for computing the leading term, leading coefficient, and leading power  product of a polynomial are provided.  These three functions all have the same syntax:

LeadingTerm[vars,order][p]

returns the leading term (= coefficient and power product) of p with respect to the given order.

LeadingCoefficient[vars,order][p]

returns the leading coefficient of p with respect to the given order.

LeadingPowerProduct[vars,order][p]

returns the leading power product of p with respect to the given order.

 The argument  vars lists the variables in descending order. (Since only a sort is involved the placeholder variables need not be singled out for special treatement and so a placeholder argument is not needed for the above functions.)
 
 The expression
 
 MakeMonic[vars, order][F]
 
 divides the polynomials in the set F  by their leading terms with respect to the given order.  If the argument F is of the form  {T,G}, the output of ExtendedGroebner, the matrix T is adjusted as well.
 
 It is sometimes useful to be able to automatically compute the multidegree vector of a monomial with respect to a set of variables.  The Mdeg function does this.  The syntax is 
 
       Mdeg[vars][m]
       
where vars is the list of variables in descending order and m is the monomial.

S-Polynomials

If G is a list of polynomials, the expression
 
 S=SPolynomials[vars,pvars,order][G]
 
stores in  S the set of S-polynomials formed from the elements of G using the specified order.  The argument vars lists the variables in descending order and the argument pvars, which is optional, specifies which elements of vars are to be considered placeholder variables.  S is a doubly nested array with S[[i,j]]  equal to the S-polynomial formed from the i-th and (i+j)-th elements of G.

In syzygy computations it is sometimes useful to know which pairs of polynomials produce nonzero S-polynomials.  The expression 
 
  ind=NonzeroIndices[S]
  
produces a the list of index pairs producing nonzero S-polynomials.  The elements of the array ind are of the proper form to be used as an argument to the MonomialSyzygy function. ( See the subsection on syzygys below).

Syzygys

The function MonomialSyzygys is used to construct syzygys for lists of monomials. The syntax is

   MonomialSyzygy[vars,pvars,order,monlist][{i,j}]
   
 Here vars is the list of variables in descending order, pvars, which is optional, is the list of placeholder variables, and order is the term order.  The variable monlist is the list of monomials and the pair {i, j} specifies the i, j-th syzygy.  See the worked example.

Term Orders

Built-in Term Orders

Any of the words listed below may be used to specify the term order for those functions that take a term order for one argument.  There is no distinction between orders for ideal case and orders for the submodule case. See the section on placeholder variables for futher information.

lex: The lexicographical term order.

deglex:  The degree or graded lexicographical order.

grlex: A synonym for deglex.

degrevlex: The degree reverse lexicographical order.

grevlex: A synonym for degrevlex.

ProductOrder[ord1, ord2]:  This order requires that the  argument listing the variables be grouped into two sublists. The first sublist is ordered by ord1 and the second sublist is ordered by ord2. Any term containing a variable from the first list preceeds any term containing only variables from the second list. (The placeholder variable list is not grouped.)
Example:

     Groebner[F,{{x,y},{t,u,v}},ProductOrder[deglex, degrevlex]]
             
EliminationOrder: This is ProductOrder[degrevlex,degrevlex]. The variables must be grouped into sublists as for ProductOrder.
 
 BayerStillmanOrder[spvars]: The list spvars is a subset of the variable list.  Terms are orded by total degree in the variables specified in spvars with ties broken using the degrevlex order.  It is an elimination order designed to eliminate the variables of  spvars.
 Example:
      Groebner[F,{s,t,x,y,z},BayerStillmanOrder[{s,t}]]

Custom Orders

If none of the built-in orders suffice, custom orders may be defined. This subsection describes the process.

The algorithms order terms by operating on multidegree vectors with a matrix A.  ( If the variable ordering is z>x>y then the term y2z has multidegree vector (1, 0, 2).)  If v and w are two multidegree vectors, they are compared by comparing  v.A and w.A  in Mathematica's standard order,  which is lexicographical.  The built-in orders such as lex or deglex are simply function names that take the variable list as an argument and return the matrix A.  (To see the matrix returned by deglex, say, just execute the statement deglex[{x,y,z,w}]//MatrixForm.)

Thus defining a custom order consists of using standard Mathematica programming techniques to define a function that takes the variable list as an argument and returns the desired matrix.  For a one-time use this need not be a complicated procedure.  If, for example the matrix with rows {1,2}, {3,4} and {5,6} is desired just use the definition

              MySpecialOrder[_]={{1,2},{3,4},{5,6}}
              
For another example see the Worked Example section below.

Placeholder Variables

The algorithms of this package assume a ring R= Q[x1,x2,...,xn,y1,y2,...,ym] considered as a module over the subring A=Q[x1,x2,...,xn].  ( Q is the rational numbers.)  Term orders are defined on the ring R but elements of R are multiplied only by elements of A.  The variables y1, y2, . . . ,ym are called placeholder variables.  The algorithms of the package manipulate elements of R, ordering their terms with respect to the given order, but do not multiply together any two polynomials both of which contain variables yi.  Placeholder variables are used for module computations and, internally,  as 'catchers' to accumulate multipliers as the algorithms execute.
Suppose that the ring  A=Q[x1,x2,...,xn]  has a given term order  ord1 and we wish to compute with elements of the module A3.  We can  do this by mapping A3 into R=A[e1,e2,e3]  by (p1,p2,p3)->p1e1+p2e2+p3e3.  To extend the term order from A to R we can list the variables in the order {x1,. . .,xn,e1,e2,e3}  and specify the order as ProductOrder[ord1,lex]. This gives the term-over-position (TOP) order. The syntax is 

G=Groebner[F,{x1,. . .,xn,e1,e2,e3},{e1,e2,e3},
                                      ProductOrder[ord1,lex]]

Placing the ei before the xi and using ProductOrder[lex, ord1] will give the position-over- term order (POT).  These are not the only term orders possible.  Any term order on R, degrevlex for example, can be used to compute a Groebner basis for a submodule.

Another way to get a version of A3 is to map (p1,p2,p3)->p1e+p2e2+p3e3 in A[e] and define a suitable term order on A[e]. This is somewhat more efficient than the above scheme for the algorithms of the package because it results in shorter multidegree vectors.

Options

The options in version 1.0 apply only to the Groebner, NormalForm and MembershipQ functions and their extended variants.  The options are ShowProgress, SingleStep, Characteristic, and PreliminaryReduction.

Characteristic: The default value of Characteristic is 0.  The expression

Groebner[F,vars,ord,Characteristic->5]

causes the computations to be carried out modulo 5.  The polynomials in the set F should have integer coefficients.

ShowProgress: The default value of ShowProgress is False.  The expression

Groebner[F,vars,ord,ShowProgress->True]

causes certain information to be  printed as the function executes.  The terms used in the printed messages are explained below. 

The basic operation in division algorithms  is the replacement of a polynomial  p  by a polynomial  p-mf where m is a monomial and the polynomial  f  is one of the divisiors.  As an algorithm executes, the polynomial  mf  is created, used, and discarded.  Such polynomials will be referred to  as auxilliary polynomials.  

The main algorithm of this package proceeds roughly as follows.  Given a set of polynomials, it first forms all the S-polynomials that might be needed, it then generates all the auxilliary polynomials that might be needed to interreduce the original set of polynomials and the S-polynomials they generate.  The algorithm then does the equivlent of changing all these polynomials to vectors of coefficients,  making the vectors the rows of a matrix,  row reducing the matrix to reduced echelon form over the rationals, changing back to polynomials and discarding the remains of the auxilliaries.  The Dickson basis of the monoid of leading terms is then computed.  The algorithm loops through this process until the Dickson basis stops changing. The polynomials with leading power products from the Dickson basis are then returned.  They are the (completely interreduced) Groebner basis sought.

When the option ShowProgress is set to True, each time through the loop the algorithm prints: the total number of S-polynomials generated, the number of auxilliary polynomials generated, The total number of polynomials (=  number of rows of the matrix), the total number of power products (= number of columns of the matrix), the cpu time for the matrix reduction, the number of polynomials in the result, and the number of Dickson basis elements (= number of polynomials in the tentative reduced basis).  All computations with coefficients, including the accumulation of the quotients in the extended versions of the algorithms, take place during the "interreduction phase" for which the cpu time is reported.  The rest of the code involves only computations, including sorts, with multidegree vectors.  In particular, the S-polynomial  S(f,g) is not explicitly formed, rather f and g are multiplied by the appropriate power products (a multidegree computation) and the resulting pair is passed on to the row reduction phase. If two such pairs have a polynomial in common, one is discared resulting in a fractional number of S-polynomials.

RecordStats: The default value of  RecordStats is False.  The expression RecordStats->True produces the same information as ShowProgress->True but instead of being displayed as the function executes the information is stored in a global variable named GroebnerStatistics. GroebnerStatistics is a matrix with seven columns and one row for each time the function executes its main loop. The numbers in each row are the samequantities described, and in the same order, as in the discussion of ShowProgress above. The variable GroebnerStatistics is reset to {} each time a Groebner function begins execution with RecordStats->True.

PreliminaryReduction: The default value of  PreliminaryReduction is True in the Groebner and NormalForm functions and False for the MembershipQ functions The Groebner, NormalForm and MembershipQ functions perform a preliminary computation on the set of input polynomials. The Groebner functions do a preliminary interreduction and the NormalForm and MembershipQ functions discard polynomials with repeated leading terms.  The option  PreliminaryReduction->False causes this preliminary calculation to be skipped, saving a bit of time if the set of polynomials is already of the proper form.  This is useful when one of the the NormalForm functions is being used with a known Groebner basis or when one of  the Groebner  functions is being used with the single step option.  It is assumed that the MembershipQ function would normally be used with a Groebner Basis.

SingleStep: The default value of the SingleStep option is False.  The option applies only to the Groebner functions.  SingleStep->True   causes the Groebner functions to exit after one pass through their main loop.  Thus they take the set of input polynomials, compute all S-polynomials that cannot be shown unnecessary, interreduce the set, and return the result. This result is another basis of the same ideal,  but not necessarily a Groebner basis.

Useful  Mathematica  Expressions

There are three Mathematica techniques that are quite useful for manipulating lists of polynomials: mulitiple assignment, mapping functions over lists, and pure functions.  The last two are usually used together.  

Multiple assignments: The left side of an assignment expression need not consist of a single variable name. The ExtendedGroebner  function returns  a pair consisting of a matrix and a Groebner basis.  To assign the matrix to the variable T and the Groebner basis to the variable G use the expression 

                       {T,G}=ExtendedGroebner[ . . . 

Functions on lists:  Given a function of a single argument, f[x], and a list of arguments L={x1, x2,  . . .} one often needs the list of values  {f[x1], f[x2],  . . . }.  This is called mapping f over L and is effected using the  Mathematica function Map, which is abbreviated  /@.  Given f and L use the expression

                        f/@L or Map[f,L]
                        
Usually  the function f, however, has several arguments, only one of which is to be varied. In this case one uses pure functions.

Pure functions:  The expression

       Function[x, 1+x^2]
       
denotes the function that takes  x to 1+x2.  The first argument is the dummy variable and the second argument is a formula for the function in terms of the dummy variable.  The above expression is usually written in the abbreviated form

                       1+#^2&

here the symbol  #   is understood to stand for the dummy variable and  the symbol & is a postfix abbreviation for the name Function.

Example 1:  Suppose that a polynomial  p in the variables  x, y, z is given and one wishes to display the leading term of  p  with respect to the orders  lex,  deglex, and  degrevlex  where x > y > z.  An expression that does this is 

LeadingTerm[{x,y,z},#][p]&/@{lex,deglex,degrevlex}

Example 2:  This time the leading term with respect to lex is sought for various orderings of the  variables.

LeadingTerm[#,lex][p]&/@{{x,y,z},{x,z,y},{y,x,z},{y,z,x}}

Example 3:  Suppose that a list L of pairs is given and a list consisting of the first element of each pair is desired. (This problem comes up in the worked example below.)  An expression that computes the list of first elements is

         #[[1]]&/@L
         
 This works because the double brackets are simply an abbreviation for the Mathematica function Part.  That is,   x[[3]]  is an abbreviation for   Part[x,3].

Worked Example

This example parallels a sequence of examples in Adams & Loustaunau, An Introduction to Gröbner Bases (Nov. 6, 1993 Draft), in order to clarify notational differences between the package and the literature.

The problem (Example 3.6.1, p. 104) is to compute the module of syzygys  for the set F={f1, f2 , f3, f4} in  Q[x, y]3 where
       f1=(xy, y ,x),   f2=(x2+x, y+x2, y),   f3=(– y ,x, y),   f4=(x2, x, y).
 The lex term order is taken on Q[x,y]  with  y > x  and the term-over-position order is taken on Q[x, y]3  with  e1 > e2 > e3.  In terms of placeholder variables, this amounts to taking the lex term order on  Q[x, y, e1, e2, e3]  with y > x > e1 > e2 > e3 .
 
 Assume that the package has been loaded using whatever commands are necessary on the local system.  The first step is to compute a Groebner basis, G, for the submodule generated by F.  We also need  a matrix of coefficients, T, for expressing G in terms of F.  The function  ExtendedGroebner is used when a matrix T is needed.  First enter and execute the expression

F={x y e1+y e2+x e3,
  (x^2+x)e1+(y+x^2)e2+y e3,
  -y e1+x e2+y e3,
   x^2e1+x e2+y e3};

to define the set F and then enter and execute

{T,G}=ExtendedGroebner[F,{y,x,e1,e2,e3},
             {e1,e2,e3},lex,ShowProgress->True]

The ShowProgress option, if included, gives some indication of how the computation is proceeding (see the section on options for an explanation of the messages). The resulting G is displayed by Mathematica as

This is essentially the same basis as the one given in Adams and Loustaunau but the order is different and, in version 1.0 at least, the first polynomial is not primitive.

The matrix T has been edited from the display to save space.  This matrix differs from the corresponding matrix in Example 3.6.1 in two ways.  First of all, it is the transpose of the matrix given in Adams and Loustaunau and multiplies the set F on the left rather than the right.  Note that expressing the module elements  fi as polynomials in Q[x, y, e1, e2, e3] gives us a representation of  F, and G as well,  as a vector instead of a matrix of column vectors. The relation between F and G is given by the matrix-vector product:  G=TF.  The easiest way to check this relation is (recall that matrix multiplication is "." in Mathematica ):

Expand[G-T.F]

The entries of T are unexpanded products and the expression  T=Expand[T]  often reduces the display.

After transposing this T we still do not have the matrix given in Adams and Loustaunau, the two differ in the last two columns.  This merely illustrates the fact that such matrices are not unique and depend on the details of the algorithm's implementation.

To compute syzygys we also need a matrix of coefficients S such that  F=SG.  The matrix S is obtained by applying the division algoritm to the set F.  Using the standard Mathematica  idiom for applying a function to a set of arguments we have (see the section on useful Mathematica  expressions):

nfF=ExtendedNormalForm[G,{y,x,e1,e2,e3},
             {e1,e2,e3},lex,ShowProgress->True]/@F

Now the output of the ExtendedNormalForm function on a single polynomial is a pair {q, r}  where r is the remainder and  q is the list of quotients. Thus the output of this expression is a list of four such pairs which Mathematica displays as  (editing out the ShowProgress messages):

which is of the form {{q1, r1}, {q2, r2}, {q3, r3}, {q4, r4}}.  The qi are the rows (columns in Adams and Loustaunau) of the matrix S. Thus the expression (see the section on useful Mathematica  expressions):

S=#[[1]]&/@nfF

gives the desired matrix S.  Note that this S is essentially the transpose of that of Example 3.7.7. As in that example, the rows of  I – ST make no contribution to the syzygy module:

IdentityMatrix[4]-S.T

Next we compute the syzygys of the set G.  Start with the set of S polynomials, given by the expressions:

spg=SPolynomials[{y,x,e1,e2,e3},
                      {e1,e2,e3},lex][G];

spg=Flatten[spg,1]

where one layer of brackets has been flattened out since the doubly nested structure of the S-polynomial array is not desirable here.  Next we need the quotients of the S-polynimials upon division by G.  As in the computation of S above we have:

syz1=ExtendedNormalForm[G,{y,x,e1,e2,e3},
          {e1,e2,e3},lex,ShowProgress->True]/@spg;
syz1=#[[1]]&/@syz1

Mathematica's Expand function could be used to simplify the fractions.  Next we need the syzygys of the set of leading terms of G.

leads=LeadingTerm[{y,x,e1,e2,e3},lex]/@G

The function MonomialSyzygy produces a single syzygy given the monomial list and a pair of indices  i, j.  To get all the syzygys we need to apply the function to all pairs of indices (i, j) with  i < j.  The Table function can be used to generate the index pairs:

ind=Table[{i,i+j},{i,1,5},{j,1,6-i}];
ind=Flatten[ind,1];
ms=MonomialSyzygy[{y,x,e1,e2,e3},{e1,e2,e3},
                                      leads]/@ind

and the syzygys of the set G are generated by the rows of the matrix  ms – syz1. This matrix has only three nonzero rows and they are given by:

syzG=Expand[ms-syz1];
syzG=DeleteCases[syzG,{0 ..}]

To check that these polynomials are indeed syzygys, compute Expand[syzG.G] (note the order of the factors).  A set of generators for the syzygys of F, the original problem, is now given by the matrix product  syzF=syzG.T (again, note the order).  The list syzF is not displayed to save space.  Unlike Example 3.7.7, all three entries of the list are nonzero and it is not apparent that the syzygy module is principal.  To discover this we can compute a Groebner basis of the syzygy module with respect to some term order.  First shift from tuple notation to placeholder variables and then compute a Groebner basis.

F2=Expand[syzG.T].{e1,e2,e3,e4}

G2=Groebner[F2,{y,x,e1,e2,e3,e4},{e1,e2,e3,e4},
                      degrevlex,ShowProgress->True]

Which is the generator of Example 3.7.7.

Finally, as an example of a custom built term order, consider the set syzG found above.  This set is a Groebner basis of the syzygy module with respect to a special term order.  To work with this term order, first define 6  placeholder variables and switch the set syzG from tuples to placeholder notation.

vars=Join[{y,x},Table[e[i],{i,1,6}]]

syzG2=syzG.Table[e[i],{i,1,6}]

Now we need to define a function, call it SpecialOrder, that will return the appropriate matrix when applied to the argument vars above (see the section on term orders above).  To each variable e[i]  we assign the multidegree vector of the leading term of the i-th polynomial in the Groebner basis G.  These vectors are:

b1=Mdeg[{y,x,e1,e2,e3}]/@leads

Then, for example, x2ye[1] is assigned multidegree vector (0,1,0,0,0)+(2,0,0,0,0)+(0,3,0,1,0) = (2,4,0,1,0).  This can be accomplished by multiplying the ordinary multidegreee vector of x2ye[1], (1,2,1,0,0,0,0,0), by a matrix the last 6 rows of which are the above multidegree vectors and the first two rows of which are  I2  padded to the right with zeros.  Then, for comparison purposes, multiply again by the order matrix of the original order.  The original order here is lex so the order matrix is just the identitiy. Finally we need to patch in an identity matrix with rows reversed to break ties (Lemma 3.7.9 in Adams and Loustaunau).  The package has a function, ColJoin, to aid in such constructions.

a=ColJoin[IdentityMatrix[2],Table[0,{2},{9}]];
b=ColJoin[b1,Reverse[IdentityMatrix[6]]];
SpecialOrder[_]=Join[a,b]

So in this ordering, the leading terms of the syzygys are:

LeadingTerm[vars,SpecialOrder]/@syzG2

which, except for sign and a permutation of indices, is the result of Example 3.10.3.