Ab out the Polynomial System Solve Facility of Axiom,
Macsyma, Maple, Mathematica, MuPAD, and Reduce
Hans-Gert Grab e
Institut fur Informatik, Universitat Leipzig, Germany
February 23, 1998
In memoriam to Renate.
Abstract
We rep ort on some exp eriences with the general purp ose Computer Algebra Systems
(CAS) Axiom, Macsyma, Maple, Mathematica, MuPAD, and Reduce solving systems of
p olynomial equations and the way they present their solutions. This snapshot (taken
in the spring 1996) of the current power of the di erent systems in a sp ecial area
concentrates b oth on CPU-times and the quality of the output.
1 Intro duction
Let S := k [x ;::: ;x ] be the p olynomial ring in the variables x ;::: ;x over the eld
1 n 1 n
k and B := ff ;::: ;f g S be a nite system of p olynomials. Denote by I (B ) the
1 m
ideal generated by these p olynomials. One of the ma jor tasks of constructive commutative
n
algebra is the derivation of information ab out the structure of Z (B ) := fa 2 k : 8 f 2
B such that f (a)=0g, the set of common zero es of the system B over the algebraic closure
k of k .
Splitting the system into smaller ones, solving them separately, and patching all solu-
tions together is often a go o d guess for a quick solution of even highly nontrivial problems.
This can b e done by several techniques, e.g. characteristic sets, resultants, the Grobner fac-
torizer or some ad ho c metho ds. Of course, such a strategy makes sense only for problems
that really will split, i.e. for reducible varieties of solutions. Surprisingly, problems coming
from \real life" often ful ll this condition.
Among the metho ds to split p olynomial systems into smaller pieces probably the
Grobner factorizer metho d attracted the most theoretical attention, see Czap or ([4 , 5]),
Davenp ort ([6 ]), Melenk, Moller and Neun ([17 , 18 ]) and Grab e ([13 , 14]). General pur-
p ose Computer Algebra Systems (CAS) are well suited for such an approach, since they
make available b oth a (more or less) well tuned implementation of the classical Grobner
algorithm on the one side and an e ective multivariate p olynomial factorizer on the other
side.
Partially supp orted by the DFG grant Gr 1230/1-2. 1
Of course, for sp ecial purp oses a general CAS as a multipurp ose mathematical assis-
tant can't o er the same power as sp ecialized software with eciently implemented and
well adapted algorithms and data typ es. For p olynomial system solving such sp ecialized
software has to implement two algorithmically complex tasks, solving and splitting, and
until recently none of the sp ecialized systems (as e.g. GB, Macaulay, Singular, CoCoA etc.)
did b oth eciently. Meanwhile b eing very ecient computing (classical) Grobner bases,
development e orts are also directed, not only for p erformance reasons, towards a b etter
inclusion of factorization into such sp ecialized systems. It turned out that the Grobner
factorizer is not only a go o d heuristic approach for splitting, but its output is also usually
a collection of almost prime comp onents. Their description allows a much deep er under-
standing of the structure of the set of zero es compared to the result of a sole Grobner basis
computation.
On the other hand it needs some skill to force a sp ecial system to answer questions
and the user will probably rst try its \home system" for an answer. Thus the p olynomial
systems solving facility of the di erent CAS should b ehave esp ecially well on such systems
of p olynomials that are hard enough not to b e done by hand, but not real ly hard to require
sp ecial e orts. It should invoke a convenientinterface to get the solutions in a form that is
(correct and) well suited for further analysis in the familiar environment of the given CAS
as the p ersonal mathematical assistant.
Below we give a short review of theoretical results ab out the way a set of zero es of a
p olynomial system should be presented, discuss by means of examples the Solve facility
of Axiom (2.0), Macsyma (420), Maple (V.3), Mathematica (2.2), MuPAD (1.2.9), and
Reduce (3.6), and investigate how far the di erent implementations meet the theoretical
demands. The examples chosen for this review came from di erent applications and many
of them were already used as b enchmarks in other places.
Note that cho osing such a sample has a twofold risk. First, typical p olynomial systems
from other application areas may have a di erent sp ecial structure taken into account by
the di erent solvers' heuristics or not. This esp ecially applies to parametric p olynomial
systems. Since there is not yet develop ed a concise theory of e ective algorithms to solve
(generically) p olynomial systems with many parameters in the co ecient domain they
remained (except ex. 10) outside the scop e of this pap er regardless the fact that such
systems o ccur quite often in applications from rob otics, electrical engineering, chemistry or
geometry theorem proving. The same applies to p olynomial systems with more advanced
co ecient domains as, e.g., nite elds or algebraic extensions of the rationals.
Second, discussing the preparation of a review like this with the system's develop ers
usually stimulates their activities to improve their systems in the direction under review.
This esp ecially concerned the systems Macsyma and MuPAD. This makes it hard for the
reviewer to draw fair conclusions, esp ecially if there are additionally time lags b etween the
main exp eriments (spring 1996), the rst presentation (at IMACS 96), a preprintversion
(end of 1996) and this publication. To resolve this problem the main text of our pap er
presents a snapshot of the state of the art implemented in the current versions of the
di erent systems during our exp eriments in the spring 1996. A separate chapter \What's
going on ?" rep orts the main improvements we b ecame aware during the further preparation
of this pap er. 2
Version and
Version used in
System
packages tested
the main part
for the addendum
Axiom 2.0 |
Macsyma 420 algsys, triangsys
Maple V.3 V.4, charsets
Mathematica 2.2 3.0
MuPAD 1.2.9. 1.4.0
Reduce 3.6. |
Versions and packages of the di erent CAS tested in this review.
The main computations were executed on an HP 9000/735 except those with Axiom,
whichwere executed on an IBM RS/6000.
2 Solving p olynomial systems { A short overview
Let's rst collect together some theoretical results and give a survey ab out the way solutions
of p olynomial systems may b e represented. We only sketch the results b elow and refer the
reader for more details to the pap ers [13 , 14 ].
Solving systems of p olynomial equations in an ultimate way means to nd a decomp o-
sition of the variety of solutions into irreducible comp onents, i.e. a representation of the
radical Rad I (B ) of the de ning ideal as an intersection of prime ideals, and to present
them in a way that is well suited for further computations. Usually one tries rst to solve
this problem over the ground eld k , since the corresp onding transformations may b e p er-
formed without intro ducing new algebraic quantities. Only in a second step k (or another
extension of k )isinvolved. Since for general univariate p olynomials of higher degree there
are no closed formulae for their zero es using radicals and moreover even for equations of
degree 3 and 4 the closed form causes great diculties during subsequent simpli cations,
nowadays in most of the CAS the second step is by default not executed (in exact mo de),
1
but encapsulated in the functional symbol RootOf (p(x);x) , representing the sequence, set,
list etc. of solutions of the equation p(x) = 0 for a certain (in most cases not necessarily
irreducible) p olynomial p(x). Hence we will not address the second step in the rest of this
pap er, to o.
Attempting to nd a full prime decomp osition leads to quite dicult computations
(the approach describ ed in [9 ], and re ned meanwhile in a series of pap ers, needs several
Grobner basis computations over di erent transcendental extensions of the ground eld),
involving generic co ordinate changes in the general case. The latter o ccurs e.g., if one tries
2 2 2
to separate the solution set of fx 2;y 2g over Q into the comp onents fx 2;y xg
2
and fx 2;y + xg.
2 2
Since the system fx 2;y 2g is already in a form convenient for computational
purp oses, one may wish not to ask for a completely splitted but a triangular solution set.
It turns out that every zero dimensional system of p olynomials may b e decomp osed over k
into such pieces even without factorization.
1
We use this symb ol to represent ro ots of univariate p olynomials symb olically in a concise way, that is
present in similar versions, but under di erent names in almost all of the CAS under consideration. 3
2.1 Solving zero dimensional p olynomial systems
The notion of triangular systems was intro duced for zero dimensional ideals by Lazard in
[15 ] and meanwhile b ecame widely accepted, see the monograph [19 ].
A set of p olynomials ff (x );f (x ;x );::: ;f (x ;::: ;x )g is a (zero dimensional)
1 1 2 1 2 n 1 n
triangular system (reduced triangular set in [15 ]) if, for k = 1;::: ;n, f (x ;::: ;x ) is
1
k k
monic (i.e. has an invertible leading co ecient) regarded as a p olynomial in x over
k
k [x ;::: ;x ], and the ideal I = I (f ;::: ;f ) is radical, i.e. is an intersection of prime
1 1 n
k 1
ideals. For such a triangular system S=I is a nite sum of algebraic eld extensions of
k . One can e ectively compute in such extensions, as was discussed in [15 ]. Lazard pro-
p osed to apply the D5 algorithm to decomp ose a zero dimensional p olynomial system into
triangular ones. There is also another approach, suggested in [20 ].
Prop osition 1 ([15 , 20 ]) Let B bea zero dimensional polynomial system.
1. If I (B ) is a prime ideal then a lexicographic Grobner basis of B is triangular.
2. For an arbitrary B there is an algorithm that computes a nite number of triangular
systems T ;::: ;T , such that
1 m
[
Z (B )= Z(T )
i
i
is a decomposition (over k ) of Z (B ) into pairwise disjoint sets of points.
Note that although such a decomp osition may be found not involving any (full) fac-
torization but only gcd computations, it is usually of great b ene t to try to factor the
system B rst into smaller pieces, since the size of the systems drastically in uences the
computational amount necessary for a triangulation.
2.2 Polynomial systems with in nitely many solutions
If P = I (B ) is a prime ideal of p ositive dimension the corresp onding variety Z (B )maybe
parameterized by the generic zero of P using reduction to dimension zero.
To describ e this reduction wehave to recall the notion of indep endent sets: For a given
ideal I S , and a subset V f1;::: ;ng, the set of variables (x ;v 2 V )isanindependent
v
set i I \ k [x ;v 2 V ] = (0). That is the variables (x ;v 2 V ) are algebraically indep endent
v v
mod I . Hence if (x ;v 2 V ) is a maximal (with resp ect to inclusion) indep endent set for the
v
ideal I (B ), these variables can b e regarded as parameters whereas the remaining variables
dep end algebraically on them.
~
This corresp onds to a change of the base ring S ! S := k (x ;v 2 V )[x ;v 62 V ], where
v v
~
S is the ring of p olynomials in x ;v 62 V with co ecients in the function eld k (x ;v 2 V ).
v v
This base ring extension corresp onds to a lo calization at the multiplicative set of nonzero
~
p olynomials in the variables (x ;v 2 V ). The extension ideal I S is a zero dimensional
v
~
ideal in S and the algorithms mentioned so far can be applied. For a prime ideal, we
~
get I = I S \ S , i.e. the generic zero describ es a prime ideal I completely, presenting
~ ~
the quotient ring Q(S=I ) = Q(S=I ) as a nite algebraic extension of k (x : v 2 V ). For
v
arbitrary ideals I (B ), the lo calization may cut o some of the comp onents of Z (B ) that
must b e parameterized separately. This can b e done in an e ectiveway, see [14 ]. 4
As for zero dimensional ideals, such a presentation is not restricted to prime ideals. In
more generality, let T = ff ;f ;::: ;f g b e a set of p olynomials in S . Wesay that T forms
1 2 m
a triangular system with respect to the maximal independent set (x ;v 2 V ) of I = I (T ),
v
~ ~
if the extension T of T to S := k (x ;v 2 V )[x ;v 62 V ] forms a triangular system for the
v v
~ ~
(zero dimensional) extension ideal I := I S .
~
Such a triangular system may be regarded as a parameterization of Z (I S \ S ), i.e. of
the comp onents of Z (T ) missing the multiplicative set k [x ;v 2 V ] nf0g. Hence a general
v
p olynomial system solver should (at least) decomp ose a given system of p olynomials B into
triangular systems, de ning for each of them the indep endentvariables, extracting the part
of Z (B ) parameterized this way, and describing recursively the remaining part of Z (B ).
Altogether we can formulate the following
Polynomial System Solving Problem:
Given a nite set B S of polynomials, ndacol lection (T ;V ) of triangular
k k
systems T with respect to V fx ;::: ;x g, such that
1 n
k k
I := I (T ) k (x ;v 2 V )[x ;v 62 V ] \ S is a pure dimensional radical
v v
k k k k
ideal with V as a maximal strongly independent set,
k
S
Z (B )= Z(I ), and
k
this decomposition is minimal.
Note that due to denominators o ccuring in k (x ;v 2 V ) the system T yields a param-
v
k k
eterization of only \almost all" p oints of Z (I ). By geometric reasons one cannot exp ect
k
more, since even simple examples of algebraic varieties show that a rational parameteriza-
tion may miss some p oints on the variety, see e.g. [3, ch. 3] for details. Since Z (I )isthe
k
algebraic closure of the parameterized part, for each p oint X 2 Z (I ) there is at least a
k
curve of parameterized p oints approaching X .
Let's conclude this section with a little example:
3 2
Consider the system B = fx y ;xy zg. A lexicographic Grobner basis computation
5 3 2 4 2 3 3 2
yields G = fy z ;xz y ;x z y ;xy z; x y g. Hence (z ) is a maximal indep endent
0 5 3 2 4
set by [11 ] and G = fy z ;x(z ) y g a triangular system with resp ect to (z ) (and a
~
minimal Grobner basis of I (G) S ). Rewinding this tower of extensions over k we get as
parameterization of Z (B ) the ve branches
2 3
5 5
f(z ;z ;z) : z 2 kg
p
5
corresp onding to the di erentchoices of the branchof z. Note that these branches may
b e parameterized by a unique formula
2 3 5
Z (B )=f(t ;t ;t ) : t 2 kg;
i.e. the variety is rational. It's a deep geometric question to decide whether an irreducible
variety admits a rational parameterization and in the case it do es to nd one, see e.g., [21 ].
Since none of the CAS under consideration invokes such algorithms with their solver, we
will not address this question here. Note that moreover in most applications the structure 5
of the prime comp onents is very easy. Often they may be either regularly (polynomial ly)
parameterized (reg. par.)
fx p (x ;::: ;x ) j k = d +1;::: ;ng; p 2 k[x ;::: ;x ];
1 1
k k d k d
rational ly parameterized (rat. par.)
fx p (x ;::: ;x ) j k = d +1;::: ;ng; p 2 k(x ;::: ;x )
1 1
k k d k d
or are zero-dimensional primes in general position (g.p.)
fx p (x ) j k =1;::: ;n 1g[fp (x )g; p 2 k[x ]:
n n n n
k k k
3 A rst example
To get a rst impression ab out the p ower of the p olynomial system solver implemented in
di erent CAS, let's Solve avery simple one dimensional system like the Arnb org example
A4, cf. [6].
vars := fw ; x; y ; z g
pol y s := fwxy + wxz + wy z + xy z ; w x + wz + xy + yz ; w + x + y + z; wxyz 1g
The Grobner factorizer yields easily the following (already prime) decomp osition into
two one dimensional comp onents:
ffw + y; x + z; yz 1g; fw + y; x + z; yz +1gg
MuPAD, Macsyma, and Mathematica obviously don't use the Grobner factorizer. For
example, MuPAD returns the answer
5
z z
f[w = x y z; x = ;
4
z 1
2 3 3 2
z = RootOf ( y z + y z + y z ;z);
4 2 2 2 6
y = RootOf ( z y z + y z +1;y)]g
This lo oks like the result of a Grobner basis computation without factorization. Besides
5
z z
the fact that may b e further simpli ed to z , the answer is very unsatisfactory since the
4
z 1
last two expressions suggest that the zero set is nite. This can't b e checked immediately,
since there is no direct way to extract approximate solutions from this result.
Macsyma returns as answer the list
1 1
ffw = %r5;x = ;y = %r5;z = g;
%r5 %r5
1 1
;y = %r6;z = g; fw = %r6;x =
%r6 %r6
fw = i; x = i; y = i; z = ig; fw = i; x = i; y = i; z = ig;
fw = 1;x =1;y =1;z = 1g;fw =1;x = 1;y = 1;z =1g;
fw = i; x = i; y = i; z = ig; fw = i; x = i; y = i; z = ig;
fw =1;x =1;y = 1;z = 1g;fw = 1;x = 1;y =1;z =1gg
that contains the two exp ected one dimensional comp onents together with a list of emb ed-
ded p oints. 6
Mathematica returns the following result
1 1 1 1
ffw ! ;y ! ;x ! zg;fw ! ;y ! ;x ! zg;
z z z z
1 1 1 1
fx! ;z ! ;w ! yg;fx ! ;z ! ;w ! ygg
y y y y
together with a warning
Solve::svars: Warning: Equations may not give solutions for all "solve"
variables.
We obtain four instead of two solution sets, p ossibly according to the fact whether z 6=0
or y 6=0 in yz 1 resp ectively yz + 1. Sucha distinction is unnecessary, since yz = 1
implies y; z 6=0.
Maple and Reduce return the solution in the exp ected form