2 * Introduction to grobner ::
3 * Functions and Variables for grobner ::
6 @node Introduction to grobner, Functions and Variables for grobner, Top, Top
7 @section Introduction to grobner
9 @code{grobner} is a package for working with Groebner bases in Maxima.
12 To use the following functions you must load the @file{grobner.lisp} package.
19 A demo can be started by
31 Some of the calculation in the demo will take a lot of time
32 therefore the output @file{grobner-demo.output} of the demo can
33 be found in the same directory as the demo file.
35 @subsection Notes on the grobner package
36 The package was written by
42 @url{http://alamos.math.arizona.edu}
45 and is released 2002-05-24 under the terms of the General Public License(GPL) (see file @file{grobner.lisp}).
46 This documentation was extracted from the files
48 @file{README}, @file{grobner.lisp}, @file{grobner.demo}, @file{grobner-demo.output}
52 by G@"unter Nowak. Suggestions for improvement of the documentation can
53 be discussed at the @emph{maxima}-mailing-list @email{maxima@@math.utexas.edu}.
54 The code is a little bit out of date now. Modern implementation use the fast @emph{F4} algorithm described in
56 A new efficient algorithm for computing Gr@"obner bases (F4)
57 Jean-Charles Faug@`ere
58 LIP6/CNRS Universit@'e Paris VI
62 @opencatbox{Categories:}
63 @category{Groebner bases}
64 @category{Share packages}
65 @category{Package grobner}
68 @subsection Implementations of admissible monomial orders in grobner
74 default order for monomial comparisons
77 total degree order, ties broken by lexicographic
81 total degree, ties broken by reverse lexicographic
85 inverse lexicographic order
89 @node Functions and Variables for grobner, , Introduction to grobner, Top
90 @section Functions and Variables for grobner
92 @subsection Global switches for grobner
94 @defvr {Option variable} poly_monomial_order
95 Default value: @code{lex}
97 This global switch controls which monomial order is used in polynomial and Groebner Bases calculations. If not set, @code{lex} will be used.
99 @opencatbox{Categories:}
100 @category{Package grobner}
106 @defvr {Option variable} poly_coefficient_ring
107 Default value: @code{expression_ring}
109 This switch indicates the coefficient ring of the polynomials that
110 will be used in grobner calculations. If not set, @emph{maxima's} general
111 expression ring will be used. This variable may be set to
112 @code{ring_of_integers} if desired.
114 @opencatbox{Categories:}
115 @category{Package grobner}
120 @defvr {Option variable} poly_primary_elimination_order
121 Default value: @code{false}
123 Name of the default order for eliminated variables in
124 elimination-based functions. If not set, @code{lex} will be used.
126 @opencatbox{Categories:}
127 @category{Package grobner}
132 @defvr {Option variable} poly_secondary_elimination_order
133 Default value: @code{false}
135 Name of the default order for kept variables in elimination-based functions. If not set, @code{lex} will be used.
137 @opencatbox{Categories:}
138 @category{Package grobner}
143 @defvr {Option variable} poly_elimination_order
144 Default value: @code{false}
146 Name of the default elimination order used in elimination
147 calculations. If set, it overrides the settings in variables
148 @code{poly_primary_elimination_order} and @code{poly_secondary_elimination_order}.
149 The user must ensure that this is a true elimination order valid
150 for the number of eliminated variables.
152 @opencatbox{Categories:}
153 @category{Package grobner}
158 @defvr {Option variable} poly_return_term_list
159 Default value: @code{false}
161 If set to @code{true}, all functions in this package will return each
162 polynomial as a list of terms in the current monomial order rather
163 than a @emph{maxima} general expression.
165 @opencatbox{Categories:}
166 @category{Package grobner}
171 @defvr {Option variable} poly_grobner_debug
172 Default value: @code{false}
174 If set to @code{true}, produce debugging and tracing output.
176 @opencatbox{Categories:}
177 @category{Package grobner}
182 @defvr {Option variable} poly_grobner_algorithm
183 Default value: @code{buchberger}
187 @item @code{buchberger}
188 @item @code{parallel_buchberger}
189 @item @code{gebauer_moeller}
192 The name of the algorithm used to find the Groebner Bases.
194 @opencatbox{Categories:}
195 @category{Package grobner}
200 @defvr {Option variable} poly_top_reduction_only
201 Default value: @code{false}
203 If not @code{false}, use top reduction only whenever possible. Top
204 reduction means that division algorithm stops after the first
207 @opencatbox{Categories:}
208 @category{Package grobner}
213 @subsection Simple operators in grobner
214 @code{poly_add}, @code{poly_subtract}, @code{poly_multiply} and @code{poly_expt}
215 are the arithmetical operations on polynomials.
216 These are performed using the internal representation, but the results are converted back to the
217 @emph{maxima} general form.
220 @deffn {Function} poly_add (@var{poly1}, @var{poly2}, @var{varlist})
221 Adds two polynomials @var{poly1} and @var{poly2}.
224 (%i1) poly_add(z+x^2*y,x-z,[x,y,z]);
229 @opencatbox{Categories:}
230 @category{Package grobner}
235 @anchor{poly_subtract}
236 @deffn {Function} poly_subtract (@var{poly1}, @var{poly2}, @var{varlist})
237 Subtracts a polynomial @var{poly2} from @var{poly1}.
240 (%i1) poly_subtract(z+x^2*y,x-z,[x,y,z]);
245 @opencatbox{Categories:}
246 @category{Package grobner}
251 @anchor{poly_multiply}
252 @deffn {Function} poly_multiply (@var{poly1}, @var{poly2}, @var{varlist})
253 Returns the product of polynomials @var{poly1} and @var{poly2}.
256 (%i2) poly_multiply(z+x^2*y,x-z,[x,y,z])-(z+x^2*y)*(x-z),expand;
260 @opencatbox{Categories:}
261 @category{Package grobner}
266 @anchor{poly_s_polynomial}
267 @deffn {Function} poly_s_polynomial (@var{poly1}, @var{poly2}, @var{varlist})
268 Returns the @emph{syzygy polynomial} (@emph{S-polynomial}) of two polynomials @var{poly1} and @var{poly2}.
270 @opencatbox{Categories:}
271 @category{Package grobner}
276 @anchor{poly_primitive_part}
277 @deffn {Function} poly_primitive_part (@var{poly1}, @var{varlist})
278 Returns the polynomial @var{poly} divided by the GCD of its coefficients.
281 (%i1) poly_primitive_part(35*y+21*x,[x,y]);
285 @opencatbox{Categories:}
286 @category{Package grobner}
291 @anchor{poly_normalize}
292 @deffn {Function} poly_normalize (@var{poly}, @var{varlist})
293 Returns the polynomial @var{poly} divided by the leading coefficient.
294 It assumes that the division is possible, which may not always be the
295 case in rings which are not fields.
297 @opencatbox{Categories:}
298 @category{Package grobner}
303 @subsection Other functions in grobner
306 @deffn {Function} poly_expand (@var{poly}, @var{varlist})
307 This function parses polynomials to internal form and back. It
308 is equivalent to @code{expand(@var{poly})} if @var{poly} parses correctly to
309 a polynomial. If the representation is not compatible with a
310 polynomial in variables @var{varlist}, the result is an error.
311 It can be used to test whether an expression correctly parses to the
312 internal representation. The following examples illustrate that
313 indexed and transcendental function variables are allowed.
316 (%i1) poly_expand((x-y)*(y+x),[x,y]);
319 (%i2) poly_expand((y+x)^2,[x,y]);
322 (%i3) poly_expand((y+x)^5,[x,y]);
324 (%o3) y + 5 x y + 10 x y + 10 x y + 5 x y + x
325 (%i4) poly_expand(-1-x*exp(y)+x^2/sqrt(y),[x]);
328 (%o4) - x %e + ------- - 1
331 (%i5) poly_expand(-1-sin(x)^2+sin(x),[sin(x)]);
333 (%o5) - sin (x) + sin(x) - 1
337 @opencatbox{Categories:}
338 @category{Package grobner}
344 @deffn {Function} poly_expt (@var{poly}, @var{number}, @var{varlist})
345 exponentitates @var{poly} by a positive integer @var{number}. If @var{number} is not a positive integer number an error will be raised.
348 (%i1) poly_expt(x-y,3,[x,y])-(x-y)^3,expand;
352 @opencatbox{Categories:}
353 @category{Package grobner}
358 @anchor{poly_content}
359 @deffn {Function} poly_content (@var{poly}. @var{varlist})
360 @code{poly_content} extracts the GCD of its coefficients
363 (%i1) poly_content(35*y+21*x,[x,y]);
367 @opencatbox{Categories:}
368 @category{Package grobner}
373 @anchor{poly_pseudo_divide}
374 @deffn {Function} poly_pseudo_divide (@var{poly}, @var{polylist}, @var{varlist})
375 Pseudo-divide a polynomial @var{poly} by the list of @math{n} polynomials @var{polylist}. Return
376 multiple values. The first value is a list of quotients @math{a}. The
377 second value is the remainder @math{r}. The third argument is a scalar
378 coefficient @math{c}, such that @math{c*poly} can be divided by @var{polylist} within the ring
379 of coefficients, which is not necessarily a field. Finally, the
380 fourth value is an integer count of the number of reductions
381 performed. The resulting objects satisfy the equation:
385 $$c*poly=\sum_{i=1}^{n}({a}_{i}*{polylist}_{i})+r$$
389 @math{c*poly=sum(a[i]*polylist[i],i=1...n)+r}.
392 @opencatbox{Categories:}
393 @category{Package grobner}
398 @anchor{poly_exact_divide}
399 @deffn {Function} poly_exact_divide (@var{poly1}, @var{poly2}, @var{varlist})
400 Divide a polynomial @var{poly1} by another polynomial @var{poly2}. Assumes that exact
401 division with no remainder is possible. Returns the quotient.
403 @opencatbox{Categories:}
404 @category{Package grobner}
409 @anchor{poly_normal_form}
410 @deffn {Function} poly_normal_form (@var{poly}, @var{polylist}, @var{varlist})
411 @code{poly_normal_form} finds the normal form of a polynomial @var{poly} with respect
412 to a set of polynomials @var{polylist}.
414 @opencatbox{Categories:}
415 @category{Package grobner}
420 @anchor{poly_buchberger_criterion}
421 @deffn {Function} poly_buchberger_criterion (@var{polylist}, @var{varlist})
422 Returns @code{true} if @var{polylist} is a Groebner basis with respect to the current term
423 order, by using the Buchberger
424 criterion: for every two polynomials @math{h1} and @math{h2} in @var{polylist} the
425 S-polynomial @math{S(h1,h2)} reduces to 0 @math{modulo} @var{polylist}.
427 @opencatbox{Categories:}
428 @category{Package grobner}
433 @anchor{poly_buchberger}
434 @deffn {Function} poly_buchberger (@var{polylist_fl} @var{varlist})
435 @code{poly_buchberger} performs the Buchberger algorithm on a list of
436 polynomials and returns the resulting Groebner basis.
438 @opencatbox{Categories:}
439 @category{Package grobner}
445 @subsection Standard postprocessing of Groebner Bases
449 The \emph{k-th elimination ideal} $I_k$ of an ideal $I$ over
450 $K [ x_1, ...,x_1 ]$ is $I \cap K [ x_{k + 1}, ..., x_n ]$.
453 The \emph{colon ideal} $I : J$ is the ideal $\{ h|\forall w \in J : wh \in
457 The ideal $I : p^{\infty}$ is the ideal $\{ h|\exists n \in N : p^n h \in I \}$.@*
460 The ideal $I : J^{\infty}$ is the ideal $\{ h|\exists n \in N, \exists p \in J: p^n h \in I \}$.@*
463 The \emph{radical ideal} $\sqrt{I}$ is the ideal $\{ h| \exists n \in N :
470 The @emph{k-th elimination Ideal} @math{I_k} of an Ideal @math{I} over @math{K[ x[1],...,x[n] ]} is the ideal @math{intersect(I, K[ x[k+1],...,x[n] ])}.@*
472 The @emph{colon ideal} @math{I:J} is the ideal @math{@{h|for all w in J: w*h in I@}}.@*
474 The ideal @math{I:p^inf} is the ideal @math{@{h| there is a n in N: p^n*h in I@}}.@*
476 The ideal @math{I:J^inf} is the ideal @math{@{h| there is a n in N and a p in J: p^n*h in I@}}.@*
478 The @emph{radical ideal} @math{sqrt(I)} is the ideal
479 @math{@{h| there is a n in N : h^n in I @}}.
483 @anchor{poly_reduction}
484 @deffn {Function} poly_reduction (@var{polylist}, @var{varlist})
485 @code{poly_reduction} reduces a list of polynomials @var{polylist}, so that
486 each polynomial is fully reduced with respect to the other polynomials.
488 @opencatbox{Categories:}
489 @category{Package grobner}
494 @anchor{poly_minimization}
495 @deffn {Function} poly_minimization (@var{polylist}, @var{varlist})
496 Returns a sublist of the polynomial list @var{polylist} spanning the same
497 monomial ideal as @var{polylist} but minimal, i.e. no leading monomial
498 of a polynomial in the sublist divides the leading monomial
499 of another polynomial.
501 @opencatbox{Categories:}
502 @category{Package grobner}
508 @anchor{poly_normalize_list}
509 @deffn {Function} poly_normalize_list (@var{polylist}, @var{varlist})
510 @code{poly_normalize_list} applies @code{poly_normalize} to each polynomial in the list.
511 That means it divides every polynomial in a list @var{polylist} by its leading coefficient.
513 @opencatbox{Categories:}
514 @category{Package grobner}
519 @anchor{poly_grobner}
520 @deffn {Function} poly_grobner (@var{polylist}, @var{varlist})
521 Returns a Groebner basis of the ideal span by the polynomials @var{polylist}. Affected by the global flags.
523 @opencatbox{Categories:}
524 @category{Package grobner}
529 @anchor{poly_reduced_grobner}
530 @deffn {Function} poly_reduced_grobner (@var{polylist}, @var{varlist})
531 Returns a reduced Groebner basis of the ideal span by the polynomials @var{polylist}. Affected by the global flags.
533 @opencatbox{Categories:}
534 @category{Package grobner}
540 @anchor{poly_depends_p}
541 @deffn {Function} poly_depends_p (@var{poly}, @var{var}, @var{varlist})
542 @code{poly_depends} tests whether a polynomial depends on a variable @var{var}.
544 @opencatbox{Categories:}
545 @category{Package grobner}
546 @category{Predicate functions}
552 @anchor{poly_elimination_ideal}
553 @deffn {Function} poly_elimination_ideal (@var{polylist}, @var{number}, @var{varlist})
556 @code{poly_elimination_ideal} returns the grobner basis of the @math{number}-th elimination ideal of an
557 ideal specified as a list of generating polynomials (not necessarily Groebner basis).
559 @opencatbox{Categories:}
560 @category{Package grobner}
565 @anchor{poly_colon_ideal}
566 @deffn {Function} poly_colon_ideal (@var{polylist1}, @var{polylist2}, @var{varlist})
568 Returns the reduced Groebner basis of the colon ideal
570 @math{I(polylist1):I(polylist2)}
573 where @math{polylist1} and @math{polylist2} are two lists of polynomials.
575 @opencatbox{Categories:}
576 @category{Package grobner}
581 @anchor{poly_ideal_intersection}
582 @deffn {Function} poly_ideal_intersection (@var{polylist1}, @var{polylist2}, @var{varlist})
584 @code{poly_ideal_intersection} returns the intersection of two ideals.
586 @opencatbox{Categories:}
587 @category{Package grobner}
594 @deffn {Function} poly_lcm (@var{poly1}, @var{poly2}, @var{varlist})
595 Returns the lowest common multiple of @var{poly1} and @var{poly2}.
597 @opencatbox{Categories:}
598 @category{Package grobner}
603 @c -----------------------------------------------------------------------------
605 @deffn {Function} poly_gcd (@var{poly1}, @var{poly2}, @var{varlist})
607 Returns the greatest common divisor of @var{poly1} and @var{poly2}.
609 See also @mrefcomma{ezgcd} @mrefcomma{gcd} @mrefcomma{gcdex} and
615 (%i1) p1:6*x^3+19*x^2+19*x+6;
617 (%o1) 6 x + 19 x + 19 x + 6
618 (%i2) p2:6*x^5+13*x^4+12*x^3+13*x^2+6*x;
620 (%o2) 6 x + 13 x + 12 x + 13 x + 6 x
621 (%i3) poly_gcd(p1, p2, [x]);
626 @opencatbox{Categories:}
627 @category{Package grobner}
631 @anchor{poly_grobner_equal}
632 @deffn {Function} poly_grobner_equal (@var{polylist1}, @var{polylist2}, @var{varlist})
633 @code{poly_grobner_equal} tests whether two Groebner Bases generate the same ideal.
634 Returns @code{true} if two lists of polynomials @var{polylist1} and @var{polylist2}, assumed to be Groebner Bases,
635 generate the same ideal, and @code{false} otherwise.
636 This is equivalent to checking that every polynomial of the first basis reduces to 0
637 modulo the second basis and vice versa. Note that in the example below the
638 first list is not a Groebner basis, and thus the result is @code{false}.
641 (%i1) poly_grobner_equal([y+x,x-y],[x,y],[x,y]);
645 @opencatbox{Categories:}
646 @category{Package grobner}
651 @anchor{poly_grobner_subsetp}
652 @deffn {Function} poly_grobner_subsetp (@var{polylist1}, @var{polylist2}, @var{varlist})
654 @code{poly_grobner_subsetp} tests whether an ideal generated by @var{polylist1}
655 is contained in the ideal generated by @var{polylist2}. For this test to always succeed,
656 @var{polylist2} must be a Groebner basis.
658 @opencatbox{Categories:}
659 @category{Package grobner}
660 @category{Predicate functions}
665 @anchor{poly_grobner_member}
666 @deffn {Function} poly_grobner_member (@var{poly}, @var{polylist}, @var{varlist})
668 Returns @code{true} if a polynomial @var{poly} belongs to the ideal generated by the
669 polynomial list @var{polylist}, which is assumed to be a Groebner basis. Returns @code{false} otherwise.
671 @code{poly_grobner_member} tests whether a polynomial belongs to an ideal generated by a list of polynomials,
672 which is assumed to be a Groebner basis. Equivalent to @code{normal_form} being 0.
674 @opencatbox{Categories:}
675 @category{Package grobner}
680 @anchor{poly_ideal_saturation1}
681 @deffn {Function} poly_ideal_saturation1 (@var{polylist}, @var{poly}, @var{varlist})
682 Returns the reduced Groebner basis of the saturation of the ideal
685 $$I(polylist):poly^\infty$$
694 Geometrically, over an algebraically closed field, this is the set
695 of polynomials in the ideal generated by @var{polylist} which do not identically
696 vanish on the variety of @var{poly}.
698 @opencatbox{Categories:}
699 @category{Package grobner}
704 @anchor{poly_ideal_saturation}
705 @deffn {Function} poly_ideal_saturation (@var{polylist1}, @var{polylist2}, @var{varlist})
706 Returns the reduced Groebner basis of the saturation of the ideal
709 $$I(polylist1):I(polylist2)^\infty$$
714 I(polylist1):I(polylist2)^inf
718 Geometrically, over an algebraically closed field, this is the set of polynomials in
719 the ideal generated by @var{polylist1} which do not identically vanish on the
720 variety of @var{polylist2}.
722 @opencatbox{Categories:}
723 @category{Package grobner}
728 @anchor{poly_ideal_polysaturation1}
729 @deffn {Function} poly_ideal_polysaturation1 (@var{polylist1}, @var{polylist2}, @var{varlist})
730 @var{polylist2} is a list of n polynomials @code{[poly1,...,polyn]}.
731 Returns the reduced Groebner basis of the ideal
734 $$I(polylist):poly1^\infty:...:polyn^\infty$$
739 I(polylist):poly1^inf:...:polyn^inf
744 sequence of successive saturations in the polynomials
745 of the polynomial list @var{polylist2} of the ideal generated by the
746 polynomial list @var{polylist1}.
748 @opencatbox{Categories:}
749 @category{Package grobner}
754 @anchor{poly_ideal_polysaturation}
755 @deffn {Function} poly_ideal_polysaturation (@var{polylist}, @var{polylistlist}, @var{varlist})
756 @var{polylistlist} is a list of n list of polynomials @code{[polylist1,...,polylistn]}.
757 Returns the reduced Groebner basis of the saturation of the ideal
760 $$I(polylist):I(polylist_1)^\infty:...:I(polylist_n)^\infty$$
765 I(polylist):I(polylist_1)^inf:...:I(polylist_n)^inf
768 @opencatbox{Categories:}
769 @category{Package grobner}
774 @anchor{poly_saturation_extension}
775 @deffn {Function} poly_saturation_extension (@var{poly}, @var{polylist}, @var{varlist1}, @var{varlist2})
777 @code{poly_saturation_extension} implements the famous Rabinowitz trick.
779 @opencatbox{Categories:}
780 @category{Package grobner}
785 @anchor{poly_polysaturation_extension}
786 @deffn {Function} poly_polysaturation_extension (@var{poly}, @var{polylist}, @var{varlist1}, @var{varlist2})
788 @opencatbox{Categories:}
789 @category{Package grobner}