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] ])}.@*
473 The @emph{colon ideal} @math{I:J} is the ideal @math{@{h|for all w in J: w*h in I@}}.@*
476 The ideal @math{I:p^inf} is the ideal @math{@{h| there is a n in N: p^n*h in I@}}.@*
479 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@}}.@*
482 The @emph{radical ideal} @math{sqrt(I)} is the ideal
483 @math{@{h| there is a n in N : h^n in I @}}.
487 @anchor{poly_reduction}
488 @deffn {Function} poly_reduction (@var{polylist}, @var{varlist})
489 @code{poly_reduction} reduces a list of polynomials @var{polylist}, so that
490 each polynomial is fully reduced with respect to the other polynomials.
492 @opencatbox{Categories:}
493 @category{Package grobner}
498 @anchor{poly_minimization}
499 @deffn {Function} poly_minimization (@var{polylist}, @var{varlist})
500 Returns a sublist of the polynomial list @var{polylist} spanning the same
501 monomial ideal as @var{polylist} but minimal, i.e. no leading monomial
502 of a polynomial in the sublist divides the leading monomial
503 of another polynomial.
505 @opencatbox{Categories:}
506 @category{Package grobner}
512 @anchor{poly_normalize_list}
513 @deffn {Function} poly_normalize_list (@var{polylist}, @var{varlist})
514 @code{poly_normalize_list} applies @code{poly_normalize} to each polynomial in the list.
515 That means it divides every polynomial in a list @var{polylist} by its leading coefficient.
517 @opencatbox{Categories:}
518 @category{Package grobner}
523 @anchor{poly_grobner}
524 @deffn {Function} poly_grobner (@var{polylist}, @var{varlist})
525 Returns a Groebner basis of the ideal span by the polynomials @var{polylist}. Affected by the global flags.
527 @opencatbox{Categories:}
528 @category{Package grobner}
533 @anchor{poly_reduced_grobner}
534 @deffn {Function} poly_reduced_grobner (@var{polylist}, @var{varlist})
535 Returns a reduced Groebner basis of the ideal span by the polynomials @var{polylist}. Affected by the global flags.
537 @opencatbox{Categories:}
538 @category{Package grobner}
544 @anchor{poly_depends_p}
545 @deffn {Function} poly_depends_p (@var{poly}, @var{var}, @var{varlist})
546 @code{poly_depends} tests whether a polynomial depends on a variable @var{var}.
548 @opencatbox{Categories:}
549 @category{Package grobner}
550 @category{Predicate functions}
556 @anchor{poly_elimination_ideal}
557 @deffn {Function} poly_elimination_ideal (@var{polylist}, @var{number}, @var{varlist})
560 @code{poly_elimination_ideal} returns the grobner basis of the @math{number}-th elimination ideal of an
561 ideal specified as a list of generating polynomials (not necessarily Groebner basis).
563 @opencatbox{Categories:}
564 @category{Package grobner}
569 @anchor{poly_colon_ideal}
570 @deffn {Function} poly_colon_ideal (@var{polylist1}, @var{polylist2}, @var{varlist})
572 Returns the reduced Groebner basis of the colon ideal
574 @math{I(polylist1):I(polylist2)}
577 where @math{polylist1} and @math{polylist2} are two lists of polynomials.
579 @opencatbox{Categories:}
580 @category{Package grobner}
585 @anchor{poly_ideal_intersection}
586 @deffn {Function} poly_ideal_intersection (@var{polylist1}, @var{polylist2}, @var{varlist})
588 @code{poly_ideal_intersection} returns the intersection of two ideals.
590 @opencatbox{Categories:}
591 @category{Package grobner}
598 @deffn {Function} poly_lcm (@var{poly1}, @var{poly2}, @var{varlist})
599 Returns the lowest common multiple of @var{poly1} and @var{poly2}.
601 @opencatbox{Categories:}
602 @category{Package grobner}
607 @c -----------------------------------------------------------------------------
609 @deffn {Function} poly_gcd (@var{poly1}, @var{poly2}, @var{varlist})
611 Returns the greatest common divisor of @var{poly1} and @var{poly2}.
613 See also @mrefcomma{ezgcd} @mrefcomma{gcd} @mrefcomma{gcdex} and
619 (%i1) p1:6*x^3+19*x^2+19*x+6;
621 (%o1) 6 x + 19 x + 19 x + 6
622 (%i2) p2:6*x^5+13*x^4+12*x^3+13*x^2+6*x;
624 (%o2) 6 x + 13 x + 12 x + 13 x + 6 x
625 (%i3) poly_gcd(p1, p2, [x]);
630 @opencatbox{Categories:}
631 @category{Package grobner}
635 @anchor{poly_grobner_equal}
636 @deffn {Function} poly_grobner_equal (@var{polylist1}, @var{polylist2}, @var{varlist})
637 @code{poly_grobner_equal} tests whether two Groebner Bases generate the same ideal.
638 Returns @code{true} if two lists of polynomials @var{polylist1} and @var{polylist2}, assumed to be Groebner Bases,
639 generate the same ideal, and @code{false} otherwise.
640 This is equivalent to checking that every polynomial of the first basis reduces to 0
641 modulo the second basis and vice versa. Note that in the example below the
642 first list is not a Groebner basis, and thus the result is @code{false}.
645 (%i1) poly_grobner_equal([y+x,x-y],[x,y],[x,y]);
649 @opencatbox{Categories:}
650 @category{Package grobner}
655 @anchor{poly_grobner_subsetp}
656 @deffn {Function} poly_grobner_subsetp (@var{polylist1}, @var{polylist2}, @var{varlist})
658 @code{poly_grobner_subsetp} tests whether an ideal generated by @var{polylist1}
659 is contained in the ideal generated by @var{polylist2}. For this test to always succeed,
660 @var{polylist2} must be a Groebner basis.
662 @opencatbox{Categories:}
663 @category{Package grobner}
664 @category{Predicate functions}
669 @anchor{poly_grobner_member}
670 @deffn {Function} poly_grobner_member (@var{poly}, @var{polylist}, @var{varlist})
672 Returns @code{true} if a polynomial @var{poly} belongs to the ideal generated by the
673 polynomial list @var{polylist}, which is assumed to be a Groebner basis. Returns @code{false} otherwise.
675 @code{poly_grobner_member} tests whether a polynomial belongs to an ideal generated by a list of polynomials,
676 which is assumed to be a Groebner basis. Equivalent to @code{normal_form} being 0.
678 @opencatbox{Categories:}
679 @category{Package grobner}
684 @anchor{poly_ideal_saturation1}
685 @deffn {Function} poly_ideal_saturation1 (@var{polylist}, @var{poly}, @var{varlist})
686 Returns the reduced Groebner basis of the saturation of the ideal
689 $$I(polylist):poly^\infty$$
698 Geometrically, over an algebraically closed field, this is the set
699 of polynomials in the ideal generated by @var{polylist} which do not identically
700 vanish on the variety of @var{poly}.
702 @opencatbox{Categories:}
703 @category{Package grobner}
708 @anchor{poly_ideal_saturation}
709 @deffn {Function} poly_ideal_saturation (@var{polylist1}, @var{polylist2}, @var{varlist})
710 Returns the reduced Groebner basis of the saturation of the ideal
713 $$I(polylist1):I(polylist2)^\infty$$
718 I(polylist1):I(polylist2)^inf
722 Geometrically, over an algebraically closed field, this is the set of polynomials in
723 the ideal generated by @var{polylist1} which do not identically vanish on the
724 variety of @var{polylist2}.
726 @opencatbox{Categories:}
727 @category{Package grobner}
732 @anchor{poly_ideal_polysaturation1}
733 @deffn {Function} poly_ideal_polysaturation1 (@var{polylist1}, @var{polylist2}, @var{varlist})
734 @var{polylist2} is a list of n polynomials @code{[poly1,...,polyn]}.
735 Returns the reduced Groebner basis of the ideal
738 $$I(polylist):poly1^\infty:...:polyn^\infty$$
743 I(polylist):poly1^inf:...:polyn^inf
748 sequence of successive saturations in the polynomials
749 of the polynomial list @var{polylist2} of the ideal generated by the
750 polynomial list @var{polylist1}.
752 @opencatbox{Categories:}
753 @category{Package grobner}
758 @anchor{poly_ideal_polysaturation}
759 @deffn {Function} poly_ideal_polysaturation (@var{polylist}, @var{polylistlist}, @var{varlist})
760 @var{polylistlist} is a list of n list of polynomials @code{[polylist1,...,polylistn]}.
761 Returns the reduced Groebner basis of the saturation of the ideal
764 $$I(polylist):I(polylist_1)^\infty:...:I(polylist_n)^\infty$$
769 I(polylist):I(polylist_1)^inf:...:I(polylist_n)^inf
772 @opencatbox{Categories:}
773 @category{Package grobner}
778 @anchor{poly_saturation_extension}
779 @deffn {Function} poly_saturation_extension (@var{poly}, @var{polylist}, @var{varlist1}, @var{varlist2})
781 @code{poly_saturation_extension} implements the famous Rabinowitz trick.
783 @opencatbox{Categories:}
784 @category{Package grobner}
789 @anchor{poly_polysaturation_extension}
790 @deffn {Function} poly_polysaturation_extension (@var{poly}, @var{polylist}, @var{varlist1}, @var{varlist2})
792 @opencatbox{Categories:}
793 @category{Package grobner}