next up previous contents
: Computing Gröbner basis in : Gröbner basis and Syzygy : Gröbner basis and Syzygy   目次

Computing Gröbner or standard basis in the ring of the polynomials

Example 7   Obtain the Gröbner basis of the ideal generated by the polynomials $x^2+y^2-4$ and $xy-1$ in terms of the graded reverse lexicographic order :

\begin{displaymath}1 < x < y < x^2 < xy < y^2 < \cdots. \end{displaymath}

All inputs must be homogenized to get Gröbner basis by the command groebner. Usually, the variable $h$ is used for the homogenization. In this example, Gröbner bases in ${\bf Q}[x,y,h]$ are computed, but rational coefficients in the input is not allowed. All coefficients must be integers.

The operator groebner_sugar is for non-homogenized computation of Gröbner basis.

The following code is a convinient template to obtain Gröbner bases.

% gbrev.sm1
[
 (y,x)  % Change here. Declare the variables that you use.
 ring_of_polynomials 
 0  % Change here. Define the characteristic here.
] define_ring

/inputp
 [                   % Polynomials must be enclosed by ( and  ). or $ and $.
  ( x^2+y^2-4*h^2 ). % Change here. Write a polynomial for input.
  (x*y-h^2).         % Change here. Write a polynomial for input.
 ] 
def

[inputp] groebner /ans set
ans dehomogenize ::

The letters after the symbol % are ignored by kan/sm1 ; comments begin with the symbol %. If one needs to compute Gröbner basis of a given set of polynomials, one may only change the lines marked by the comment % Change here.

Grammer 1   Any string of alphabets can be used as a name of a variable except h, E, H and e_. For $q$-difference operators, q is also reserved. Upper and lower case letters are distinct.

Example 8   Obtain the Gröbner basis of the ideal generated by the polynomials $x^2+y^2-4$ and $xy-1$ in terms of the lexicographic order :

\begin{displaymath}1 < x < x^2 < x^3 < \cdots < y < yx < yx^2 < \cdots. \end{displaymath}

% gblex.sm1
[
 (y,x)  % Change here. Declare the variables that you use.
 ring_of_polynomials 
 [[(y) 1] [(x) 1]] weight_vector
 0  % Change here. Define the characteristic here.
] define_ring

/inputp
 [                   % Polynomials must be enclosed by ( and  ). or $ and $.
  ( x^2+y^2-4 ).     % Change here. Write a polynomial for input.
  ( x*y-1 ).         % Change here. Write a polynomial for input.
 ] 
def

[inputp] groebner_sugar /ans set
ans ::
In this example, the order is specified by the weight vector. If the line
[vec1 vec2 ...] weight_vector is given in the definition of the ring, monomials are compared by the weight vector vec1. If two monomials have the same weight, then they are compared by the weight vector vec2. This procedure will be repeated until all weight vectors are used.

The weigth vector is expressed in the form [v1 w1 v2 w2 ... vp wp ], which means that the variable v1 has the weight w1, the variable v2 has the weight w2, $\ldots$. For example, when the ring is defined by

  [(x,y,z) ring_of_polynomials 
   [[(x) 1 (y) 3]  [(z) -5]] weight_vector 0]
  define_ring
two monomials $x^a y^b z^c \succ x^A y^B z^C$ if and only if $ a+3b > A+3B$ or ($ a+3b = A+3B$ and $ -5 c > -5 C$) or ($ a+3b = A+3B$ and $ -5 c = -5 C$ and $(a,b,c) \succ_{grlex} (A,B,C)$) where $\succ_{grlex}$ denotes the graded reverse lexicographic order.

The Buchberger's criterion 1 is turned off by default, because it does not work in case of the ring of differential operators. To turn it on, input
[(UseCriterion1) 1] system_variable

The operator groebner outputs the status of degree by degree computation of Gröbner basis. To turn off this message, input [(KanGBmessage) 0] system_variable

Example 9   Obtain the Gröbner basis of the ideal generated by the polynomials

\begin{displaymath}x^2+y^2+z^2-1,xy+yz+zx-1, xyz-1 \end{displaymath}

in terms of the elimination order $ x,y > z. $

% gbelim.sm1
[
 (x,y,z)  % Change here. Declare the variables that you use.
 ring_of_polynomials 
 [[(x) 1 (y) 1]] weight_vector
 0  % Change here. Define the characteristic here.
] define_ring

/inputp
 [                   % Polynomials must be enclosed by ( and  ). or $ and $.
  ( x^2+y^2+z^2-1 ). % Change here. Write a polynomial for input.
  ( x*y+y*z+z*x-1 ). % Change here. Write a polynomial for input.
  ( x*y*z-1 ).       % Change here. Write a polynomial for input.
 ] 
def

[inputp] groebner_sugar /ans set
ans dehomogenize ::


next up previous contents
: Computing Gröbner basis in : Gröbner basis and Syzygy : Gröbner basis and Syzygy   目次
Nobuki Takayama 平成20年1月30日