Introduction to grobner
=======================

grobner is a package for working with Groebner bases in Maxima.

A tutorial on Groebner Bases can be found at

http://www.geocities.com/CapeCanaveral/Hall/3131/

To use the following functions you must load the grobner.lisp package.

     load(grobner);

A demo can be started by

     demo("grobner.demo");

or

     batch("grobner.demo")

Some of the calculation in the demo will take a lot of time therefore the output grobner-demo.output of the demo can be found in the same directory as the demo file.

Notes on the grobner package
----------------------------

The package was written by

Marek Rychlik

http://alamos.math.arizona.edu

and is released 2002-05-24 under the terms of the General Public License(GPL) (see file grobner.lisp. This documentation was extracted from the files

README, grobner.lisp, grobner.demo, grobner-demo.output

by Günter Nowak. Suggestions for improvement of the documentation can be discussed at the maxima-mailing-list maxima@math.utexas.edu. The code is a little bit out of date now. Modern implementation use the fast F4 algorithm described in

     A new efficient algorithm for computing Gröbner bases (F4)
     Jean-Charles Faugère
     LIP6/CNRS Université Paris VI
     January 20, 1999

Implementations of admissible monomial orders in grobner
--------------------------------------------------------

  * lex

     pure lexicographic, default order for monomial comparisons

  * grlex

     total degree order, ties broken by lexicographic

  * grevlex

     total degree, ties broken by reverse lexicographic

  * invlex

     inverse lexicographic order

Functions and Variables for grobner
===================================

Global switches for grobner
---------------------------

 -- Option variable: poly_monomial_order
     Default value: lex

     This global switch controls which monomial order is used in polynomial and Groebner Bases calculations. If not set, lex will be used.

 -- Option variable: poly_coefficient_ring
     Default value: expression_ring

     This switch indicates the coefficient ring of the polynomials that will be used in grobner calculations. If not set, maxima's general expression ring will be used. This variable may be set to ring_of_integers if desired.

 -- Option variable: poly_primary_elimination_order
     Default value: false

     Name of the default order for eliminated variables in elimination-based functions. If not set, lex will be used.

 -- Option variable: poly_secondary_elimination_order
     Default value: false

     Name of the default order for kept variables in elimination-based functions. If not set, lex will be used.

 -- Option variable: poly_elimination_order
     Default value: false

     Name of the default elimination order used in elimination calculations. If set, it overrides the settings in variables poly_primary_elimination_order and poly_secondary_elimination_order. The user must ensure that this is a true elimination order valid for the number of eliminated variables.

 -- Option variable: poly_return_term_list
     Default value: false

     If set to true, all functions in this package will return each polynomial as a list of terms in the current monomial order rather than a maxima general expression.

 -- Option variable: poly_grobner_debug
     Default value: false

     If set to true, produce debugging and tracing output.

 -- Option variable: poly_grobner_algorithm
     Default value: buchberger

     Possible values:

       * buchberger

       * parallel_buchberger

       * gebauer_moeller

     The name of the algorithm used to find the Groebner Bases.

 -- Option variable: poly_top_reduction_only
     Default value: false

     If not false, use top reduction only whenever possible. Top reduction means that division algorithm stops after the first reduction.

Simple operators in grobner
---------------------------

poly_add, poly_subtract, poly_multiply and poly_expt are the arithmetical operations on polynomials. These are performed using the internal representation, but the results are converted back to the maxima general form.

 -- Function: poly_add (POLY1, POLY2, VARLIST)
     Adds two polynomials POLY1 and POLY2.

          (%i1) poly_add(z+x^2*y,x-z,[x,y,z]);
                                              2
          (%o1)                              x  y + x

 -- Function: poly_subtract (POLY1, POLY2, VARLIST)
     Subtracts a polynomial POLY2 from POLY1.

          (%i1) poly_subtract(z+x^2*y,x-z,[x,y,z]);
                                                2
          (%o1)                          2 z + x  y - x

 -- Function: poly_multiply (POLY1, POLY2, VARLIST)
     Returns the product of polynomials POLY1 and POLY2.

          (%i2) poly_multiply(z+x^2*y,x-z,[x,y,z])-(z+x^2*y)*(x-z),expand;
          (%o1)                                  0

 -- Function: poly_s_polynomial (POLY1, POLY2, VARLIST)
     Returns the syzygy polynomial (S-polynomial) of two polynomials POLY1 and POLY2.

 -- Function: poly_primitive_part (POLY1, VARLIST)
     Returns the polynomial POLY divided by the GCD of its coefficients.

          (%i1) poly_primitive_part(35*y+21*x,[x,y]);
          (%o1)                              5 y + 3 x

 -- Function: poly_normalize (POLY, VARLIST)
     Returns the polynomial POLY divided by the leading coefficient. It assumes that the division is possible, which may not always be the case in rings which are not fields.

Other functions in grobner
--------------------------

 -- Function: poly_expand (POLY, VARLIST)
     This function parses polynomials to internal form and back. It is equivalent to expand(poly) if POLY parses correctly to a polynomial. If the representation is not compatible with a polynomial in variables VARLIST, the result is an error. It can be used to test whether an expression correctly parses to the internal representation. The following examples illustrate that indexed and transcendental function variables are allowed.

          (%i1) poly_expand((x-y)*(y+x),[x,y]);
                                               2    2
          (%o1)                               x  - y
          (%i2) poly_expand((y+x)^2,[x,y]);
                                          2            2
          (%o2)                          y  + 2 x y + x
          (%i3) poly_expand((y+x)^5,[x,y]);
                            5      4         2  3       3  2      4      5
          (%o3)            y  + 5 x y  + 10 x  y  + 10 x  y  + 5 x  y + x
          (%i4) poly_expand(-1-x*exp(y)+x^2/sqrt(y),[x]);
                                                    2
                                            y      x
          (%o4)                       - x %e  + ------- - 1
                                                 sqrt(y)

          (%i5) poly_expand(-1-sin(x)^2+sin(x),[sin(x)]);
                                          2
          (%o5)                      - sin (x) + sin(x) - 1

 -- Function: poly_expt (POLY, NUMBER, VARLIST)
     exponentitates POLY by a positive integer NUMBER. If NUMBER is not a positive integer number an error will be raised.

          (%i1) poly_expt(x-y,3,[x,y])-(x-y)^3,expand;
          (%o1)                                  0

 -- Function: poly_content (POLY. VARLIST)
     poly_content extracts the GCD of its coefficients

          (%i1) poly_content(35*y+21*x,[x,y]);
          (%o1)                                  7

 -- Function: poly_pseudo_divide (POLY, POLYLIST, VARLIST)
     Pseudo-divide a polynomial POLY by the list of n polynomials POLYLIST. Return multiple values. The first value is a list of quotients a. The second value is the remainder r. The third argument is a scalar coefficient c, such that c*poly can be divided by POLYLIST within the ring of coefficients, which is not necessarily a field. Finally, the fourth value is an integer count of the number of reductions performed. The resulting objects satisfy the equation:

     c*poly=sum(a[i]*polylist[i],i=1...n)+r.

 -- Function: poly_exact_divide (POLY1, POLY2, VARLIST)
     Divide a polynomial POLY1 by another polynomial POLY2. Assumes that exact division with no remainder is possible. Returns the quotient.

 -- Function: poly_normal_form (POLY, POLYLIST, VARLIST)
     poly_normal_form finds the normal form of a polynomial POLY with respect to a set of polynomials POLYLIST.

 -- Function: poly_buchberger_criterion (POLYLIST, VARLIST)
     Returns true if POLYLIST is a Groebner basis with respect to the current term order, by using the Buchberger criterion: for every two polynomials h1 and h2 in POLYLIST the S-polynomial S(h1,h2) reduces to 0 modulo POLYLIST.

 -- Function: poly_buchberger (POLYLIST_FL VARLIST)
     poly_buchberger performs the Buchberger algorithm on a list of polynomials and returns the resulting Groebner basis.

Standard postprocessing of Groebner Bases
-----------------------------------------

The k-th elimination Ideal I_k of an Ideal I over K[ x[1],...,x[n] ] is the ideal intersect(I, K[ x[k+1],...,x[n] ]).

The colon ideal I:J is the ideal {h|for all w in J: w*h in I}.

The ideal I:p^inf is the ideal {h| there is a n in N: p^n*h in I}.

The ideal I:J^inf is the ideal {h| there is a n in N and a p in J: p^n*h in I}.

The radical ideal sqrt(I) is the ideal {h| there is a n in N : h^n in I }.

 -- Function: poly_reduction (POLYLIST, VARLIST)
     poly_reduction reduces a list of polynomials POLYLIST, so that each polynomial is fully reduced with respect to the other polynomials.

 -- Function: poly_minimization (POLYLIST, VARLIST)
     Returns a sublist of the polynomial list POLYLIST spanning the same monomial ideal as POLYLIST but minimal, i.e. no leading monomial of a polynomial in the sublist divides the leading monomial of another polynomial.

 -- Function: poly_normalize_list (POLYLIST, VARLIST)
     poly_normalize_list applies poly_normalize to each polynomial in the list. That means it divides every polynomial in a list POLYLIST by its leading coefficient.

 -- Function: poly_grobner (POLYLIST, VARLIST)
     Returns a Groebner basis of the ideal span by the polynomials POLYLIST. Affected by the global flags.

 -- Function: poly_reduced_grobner (POLYLIST, VARLIST)
     Returns a reduced Groebner basis of the ideal span by the polynomials POLYLIST. Affected by the global flags.

 -- Function: poly_depends_p (POLY, VAR, VARLIST)
     poly_depends tests whether a polynomial depends on a variable var.

 -- Function: poly_elimination_ideal (POLYLIST, NUMBER, VARLIST)

     poly_elimination_ideal returns the grobner basis of the number-th elimination ideal of an ideal specified as a list of generating polynomials (not necessarily Groebner basis

 -- Function: poly_colon_ideal (POLYLIST1, POLYLIST2, VARLIST)

     Returns the reduced Groebner basis of the colon ideal

     I(polylist1):I(polylist2)

     where polylist1 and polylist2 are two lists of polynomials.

 -- Function: poly_ideal_intersection (POLYLIST1, POLYLIST2, VARLIST)

     poly_ideal_intersection returns the intersection of two ideals.

 -- Function: poly_lcm (POLY1, POLY2, VARLIST)
     Returns the lowest common multiple of POLY1 and POLY2.

 -- Function: poly_gcd (POLY1, POLY2, VARLIST)
     Returns the greatest common divisor of POLY1 and POLY2.

 -- Function: poly_grobner_equal (POLYLIST1, POLYLIST2, VARLIST)
     poly_grobner_equal tests whether two Groebner Bases generate the same ideal. Returns true if two lists of polynomials POLYLIST1 and POLYLIST2, assumed to be Groebner Bases, generate the same ideal, and false otherwise. This is equivalent to checking that every polynomial of the first basis reduces to 0 modulo the second basis and vice versa. Note that in the example below the first list is not a Groebner basis, and thus the result is false.

          (%i1) poly_grobner_equal([y+x,x-y],[x,y],[x,y]);
          (%o1)                         false

 -- Function: poly_grobner_subsetp (POLYLIST1, POLYLIST2, VARLIST)

     poly_grobner_subsetp tests whether an ideal generated by POLYLIST1 is contained in the ideal generated by POLYLIST2. For this test to always succeed, POLYLIST2 must be a Groebner basis.

 -- Function: poly_grobner_member (POLY, POLYLIST, VARLIST)

     Returns true if a polynomial POLY belongs to the ideal generated by the polynomial list POLYLIST, which is assumed to be a Groebner basis. Returns false otherwise.

     poly_grobner_member tests whether a polynomial belongs to an ideal generated by a list of polynomials, which is assumed to be a Groebner basis. Equivalent to normal_form being 0.

 -- Function: poly_ideal_saturation1 (POLYLIST, POLY, VARLIST)
     Returns the reduced Groebner basis of the saturation of the ideal

     I(polylist):poly^inf

     Geometrically, over an algebraically closed field, this is the set of polynomials in the ideal generated by POLYLIST which do not identically vanish on the variety of POLY.

 -- Function: poly_ideal_saturation (POLYLIST1, POLYLIST2, VARLIST)
     Returns the reduced Groebner basis of the saturation of the ideal

     I(polylist1):I(polylist2)^inf

     Geometrically, over an algebraically closed field, this is the set of polynomials in the ideal generated by POLYLIST1 which do not identically vanish on the variety of POLYLIST2.

 -- Function: poly_ideal_polysaturation1 (POLYLIST1, POLYLIST2, VARLIST)
     POLYLIST2 ist a list of n polynomials [poly1,...,polyn]. Returns the reduced Groebner basis of the ideal

     I(polylist):poly1^inf:...:polyn^inf

     obtained by a sequence of successive saturations in the polynomials of the polynomial list POLYLIST2 of the ideal generated by the polynomial list POLYLIST1.

 -- Function: poly_ideal_polysaturation (POLYLIST, POLYLISTLIST, VARLIST)
     POLYLISTLIST is a list of n list of polynomials [polylist1,...,polylistn]. Returns the reduced Groebner basis of the saturation of the ideal

     I(polylist):I(polylist_1)^inf:...:I(polylist_n)^inf

 -- Function: poly_saturation_extension (POLY, POLYLIST, VARLIST1, VARLIST2)

     poly_saturation_extension implements the famous Rabinowitz trick.

 -- Function: poly_polysaturation_extension (POLY, POLYLIST, VARLIST1, VARLIST2)