Solving Zero-Dimensional Algebraic Systems
Solving Zero-Dimensional Algebraic Systems
It is shown that a good output for a solver of algebraic systemsof dimension zero consists of
a family of "triangular sets of polynomials". Such an output is simple, readable and contains
all information which may be wanted,
Different algorithms are described for handling triangular systemsand obtaining them from
Gr/Sbner bases. These algorithms are practicable, and most of them are polynomial in the
number of solutions.
1. Introduction
In m a n y computer algebra problems it is difficult to define what a good solution is.
Algebraic systems are typical for such a situation: an algebraic system is a finite set of
multivariate polynomials over some field K. Solving it means finding the common zeros
of the input polynomials, in an algebraic closure of K.
W h a t does "finding" mean? I f the solutions are finite in number, it means "giving the
list o f the solutions" and we are led to a new question: What is a solution?
When the set of solutions is not finite, another question appears. It is no longer possible
to list the solutions and we have to describe them in some useful way. The most natural
way is to express the variables as functions of some parameters which may be some of
the variables. Unfortunately such an expression is generally impossible with rational
functions. So we are led to another question: H o w to describe an infinite set of solutions?
We leave this last question to another paper (Lazard, 1990) and shall restrict ourselves
to the simpler and important case of a finite number of solutions. This number may be
large and we are faced with a new question which is not very different from the last one:
H o w to describe a large number of solutions?
Most papers on algebraic systems are mainly concerned with algorithms for finding
the solutions. Surprisingly, they do not focus on the form of the provided solutions and
on above questions, except in most recent papers (Kobayashi et aL, 1988; Gianni & Mora,
1987). These ask for solutions in a form which is a special ease of what we call below a
triangular set of polynomials. Unfortunately, to get such a special form, linear change of
variables are needed which do not preserve sparseness. In recent software, M~ller (pers.
comm.) gives the solutions in the same form as in the present paper, but uses another
m e t h o d for computing them.
In this p a p e r we show that "triangular sets of polynomials" is a good data structure
for representing the solutions. We give different algorithms for transforming triangular
sets and obtain them f r o m Gr5bner bases. They work with the initial set of variables and
thus preserve sparseness as far as it is possible.
The algorithm to obtain triangular sets from a G r f b n e r base for lexicographical ordering
is particularly simple. It seems (this has not yet been checked) that it follows from
Langemyr (1991) that it is polynomial in the number of solutions.
0747-7171/92/020117 + 15 $03,00/0 9 1992 Academic Press Limited
118 D. Lazard
Thus, the best method for solving zero-dimensional systems appears to be the following:
compute the GrSbner base for the degree-reverse-lexicographical ordering by the Buchber-
ger algorithm; deduce from it the GrSbner base for the pure lexicographical ordering by
the algorithm of Faug~re et al. (1989); then simplify the result as a family of triangular sets.
If input polynomials have degree d in n variables, the whole process is essentially
polynomial in d" (Lazard, 1983; Lakshman, 1990 and 1991; Lazard & Lakshman, 1991;
Faug~re et al., 1989; Langemyr, 1991). Thus, these algorithms are nearly optimal: the
number of solutions may be d", by the Bezout theorem.
Let us now describe the structure of the paper. We begin with some examples showing
what kind of solutions provide some classical algorithms and what kind of solutions
would be useful (section 2). Then, in section 3 we present our data structure for describing
the solutions, triangular sets o f polynomials. Computing modulo, such a set of polynomials
is very close to computation in an algebraic field extension; thus, in section 4, we present
method D5, which is actualty the best tool for such computations. In section 5, we show
that the non-unicity of the description of the solution by triangular sets of polynomials
is not a drawback, because it is easy to pass from one description to another.
In sections 6 and 7 we show how the triangular sets may be obtained from a GrSbner
basis with good efficiency (nearly optimal) in the finite case; we start in section 6 from
any Gr6bner basis and in section 7 from a GrSbner basis for a lexicographical ordering,
with a better algorithm. The latter is intended to be used with the efficient algorithm for
changing the ordering described in Faug~re et al. (1989). This gives a polynomial algorithm
(in some natural meaning) for all the processes of resolution if the set of solutions is
finite even at infinity.
In section 8, algorithms are given in order to pass from solutions given as triangular
sets to solutions in the special form used in Kobayashi et al. (1988) and in Gianni &
Mora (1987); in this form, only the first polynomial in the triangular set (the one which
is univariate) is non-linear in its main variable. This form is more suitable for numeric
resolution, but needs changes of variable. It is the only place in this paper where changes
of variable are needed.
The fact that our main algorithm is polynomial for a natural measure of complexity
shows that the method of resolution is nearly optimal. However, in some cases we get a
complicated solution where a simpler form exists, and it would be useful to get this
simpler solution. This requires, at least, to have information on the Galois structure of
the set of solutions; this is far outside the goal of this paper. But the fact that we do not
need any change of variable also has the advantage that some information on the Galois
structure may remain apparent in the result and is not necessarily hidden by the choice
of generic coordinates.
Finally, it should also be noticed that our problem is a special case of a much more
difficult problem, the computation of a primary decomposition which is studied in Gianni
et al. (1988).
2. Some Examples
In this section we give some simple examples and show how the results of the classical
algorithms are not satisfactory. We first compare the raw results of a GrSbner base
computation (for two different orderings) and of the Wu Wen-Tsiin (1987) algorithm
with the simple result which would be the natural solution of a solver.
Zero-dimensional Algebraic Systems 119
c2d6-c2d2-d4+ l.
Even simpler, we may remark that the second polynomial of (2) is a square; adding
its square root b + d, we get as a new GrSbner base
( a + c, b + d, c 2 d 2 - 1 ) (6)
which generates the radical of the ideal defined by (1).
The members of (5) and (6) are triangular ideals in the sense that the ith variable may
only a p p e a r in the first i polynomials. We will show that each zero-dimensional system
(a system with a finite number o f solutions) m a y be solved as a finite union of such
triangular ideals and we will provide efficient algorithms for finding such decompositions.
The preceding system is not zero-dimensional. Thus, let us give another less easy
example, the same as before but with one more variable:
a+b+c+d+e
ab + bc + cd + de + ea
a b c d e - 1.
This system has 70 solutions. The Gr6bner base is not so easy to compute. In triangular
form, the solutions are
These solutions are rather simple. However, the two last groups of 10 solutions seem to
be more involved than the others. It is an artefact due to the choice of the ordering of
the variables. In fact, the five groups of 10 solutions are the five circular permutations
of solutions of the form
The simplification o f solutions like the two last groups is a very difficult unsolved
problem which hardly depends on the Galois structure of the ideal.
Zero-dimensional Algebraic Systems 121
PROPOSITION 5, (i) I f (P1, . . " , P,) is a triangular system such that P k = P'k. P~ modulo
( P1 . . . . , Pk-1) (this means factorization, not derivatives), then (PI, . . . , P,) is equivalent to
( ( P , , . . . , P k - , , P'~, '
Pk+l,, 9 9 P ,') , ( P , , 9 9 9 , P~-,, P k ," P k +"l , 9 9 9 e~)),
where P~ and P'.', ( i > k) are obtained by reducing P, by P~ , . . . , Pk-~ and P~ or P'~ respectively.
(ii) I f ( P 1 , . . . , P,) and ( Q1 . . . . , Q,) are two triangular sets such that P~= Qtfor i < k,
that the degrees o f Pi and Qt are the same for i > k , and that GCD(Pk, Qk) =
1 r o o d ( P 1 , . . . , Pk-l), then ( ( P l , . . . , P,), ( Q 1 , . . . , Q~)) is equivalent to
( P 1 , . . . , Pk-1, PkQk, Rk+l, . . . , R , ) where the Rt are computed by the Chinese remainder
theorem.
We could also combine fifth and sixth triangular sets in (8) and the result with the
fourth set o f (8). We get another equivalent family which consists of the first three
triangular sets of (g) and
(a 15+ 122a l~ - 122a 5 - 1 ,
275b2+ (16a 11+ 1958a 6 - 1 1 4 9 a ) b + 42a12 + 5126a 7 - 4893a ~,
1375 c + (1 l a i n + 1353a 5 + 11)b + 4 a H + 517aa+ 3604a, (12)
275d - 8a11- 979a ~+ 712a,
1375e + ( - 1 l a 1~- 1353a5 + 1364)b + 36a 11+ 4378a 6 - 5789a).
REMARK 1. It is important to note that the non-unieity of the family of reduced triangular
sets equivalent to a given system is not a drawback, for the reason that passing from one
family to another is rather easy. However, a unique minimal equivalent reduced family
does not always exist. For example,
((Xl, X2) , (Xl, X2"~-1), (X 1 + 1, x2))
may be combined by part (ii) of the last proposition in
( (x~, x~ + x2), (x, + 1, x2) )
or
((x~+ x~, x2), (x,, x~+ 1))
or
Procedure 1 Triangular(G, K, m, n)
Input:
K : a field;
m: index o f the first variable (n = 1 for the main call of Triangular);
n: index o f the last variable - initial number of variables
G: G r S b n e r base of an ideal in K [ X , , , . . . , X,];
Auxiliary fun ctions :
Factor(P, K ) : factorize the polynomial P over the field K ;
ElimPol(G, K, m, n): returns a polynomial in K [ X . ] the roots of which are the values
o f x. for the c o m m o n zeros of G (algorithm given below);
Zero-dimensional Algebraic Systems 125
DSgriJbner(G, rood, m, n): returns the Grrbner bases of the ideal generated by G over
the D5-field of the polynomials in x l , . . . , xm-i modulo mod;
Begin
I f G is triangular then return append(mod, G);
P := DSelimpol(G, rood, m, n);
rood := endcons( P, rood);
G := DSgriibner( G, rood, m + 1, n);
DStriangular(G, mod, rn + 1, n);
end.
This algorithm is exactly the same as Triangular, except that the loop does not appear
explicitly but is implicitly created by D5.
REMARK 4. Both Triangular and D5triangular may return non-reduced triangular ideals.
This may be avoided by a post-computation of square-free decompositions or by continu-
ing recursive calls until m = n: D5 system considers only square-free moduli (here and
in the following, we call moduli the members of a triangular system when computations
are done modulo this system); if a modulus is not square-free, it is automatically split
by D5 by square-free decomposition; on the other hand, in Triangular, the loop on the
factors removes also the multiplicities.
REMARK 5. The algorithm DSgri~bner is exactly the standard Buchberger's one managed
by D5. Thus it may split the moduli. It would be possible to replace it by an algorithm
without splitting: it is easy to define GrSbner bases over a reduced artinian ring; the
computation would be essentially the same as the classical Buehberger's algorithm on
the ideal generated by append(G, mod) with the following ordering: lexicographical on
x l , . . . , Xm-t and considering the powers of x~,...,xm_~ only when the powers of
x , , , . . . , x, are the same for the monomials to be compared. However, split problems are
generally much easier than the initial problem and it is probably more efficient to use
DSgriJbner.
We now present two ways for implementing ElimPol. The first one is classical and
appears at least in Kobayashi et al. (1988).
Procedure 3 ElimPolMin(G, K, m, a)
Input: G: a Grrbner base of an ideal in K[xm . . . . . xn];
Output: the minimal univariate polynomial in K[xm] which is in the ideal generated by G;
Begin
monom := 1; nfm := NormalForm( G, monom);
Inf:= []; listmonom := [];
while nfm is not a linear combination over K of elements in Inf do
lnf := cons(nfm, Inf);
listrnonom :--- cons( monom, listmonorn );
monom := Xm * monom;
nfm := NorraalForra( O, monom )
{We have nfm = ~e~t,: ace with a, e K}
return monom-~..e~t,y ao mon with mort being the element of list-monom corresponding
to e in lnf
end.
Zero-dimensional Algebraic Systems 127
As NormaIForm is a linear map, it is clear that this algorithm returns the relation of
2
least degree (modulo G) between 1, xm, Xm,.... It is clear that the linear algebra part
needs O ( D 3) operations. We refer to Faug~re et al. (1989) for an implementation of
ElimPoIMin with O(D 3) field operations and for a complexity analysis; in fact, ElimPolMin
is the beginning of NewBase described there; in the generic case where all solutions of
the system are simple and have distinct xm-component, ElimPolMin and NewBase become
equivalent.
The second implementation of ElimPol is less efficient; however, it may be easier to
implement in some Computer Algebra systems. Moreover, it gives information on multi-
plicities; in most cases, this information permits us to avoid D5-splitting in DStriangular;
thus an implementation of it is possible without D5, which works well on most (not too
singular) problems.
Procedure 4 ElimPolChar(G, K, m, n)
Input: G: a Gr6bner base of an ideal in K [ x m , . . . , xn];
Output: a univariate polynomial in K[xm] of degree D;
Begin
For each monomial mon which is in normal form relative to G, let Normal-
Form(xm *mon, G) = Y, a . . . . . * m (sum over the monomials in normal form);
return the characteristic polynomial of the matrix (amo,.m)
end.
PROPOSITION 6. The multiplicity of a root x of the result of ElimPolChar is the sum of the
multiplicities of the solutions of G (viewed as a system of equations) with x as x,~-component.
This was essentially proved in Lazard (1981), Here is a direct proof. We may suppose
w.l.o.g, that m = 1. The ring A = K[x~, . . . , x , ] / G is a product of local artinian rings with
maximal ideal (over an algebraic closure of K) of the form ( x l - a ~ , . . . , x , - a,), The
multiplicity of the solution is the multiplicity of the corresponding local ring, that is its
length or its dimension as a vector space. If x~- at is in the maximal ideal of a local
artinian ring, some power of it is zero; i.e. there exists a k such that (xa- al) k is zero in
this local ring. This means that the product of the local rings corresponding to the solutions
with first component x~ is exactly the union of the kernels of the endomorphisms "product
by a power of xl - ~1", that is the multiplicity of x~ as an eigenvalue of the endomorphism
"product by xl" in A.
This function ElimPolChar is very easy to implement but it needs 0 (D 4) field operations
instead of O ( D 3) for ElimPolMin. On the other hand, in most examples, the factors given
by the square-free decomposition of the result of ElimPoIChar suffice to avoid further
splittings by D5. For example, on system (7) they give all the decomposition needed to
find the solution (11).
128 D. Lazard
The easiest application of this theorem is for numerically solving systems, i.e. when
the target field is an algebraic closure of K. But this result works with any target field
and makes the computation of an equivalent triangular family very easy and possible
without any new computation of a GrSbner base. As before, we give two versions of the
corresponding algorithm; the first one use factorizations and works with algebraic
extensions as target fields; the second one, using D5, works without any factorization.
Procedure 5 Lextriangular
Input: G: a GrSbner base of a zero-dimensional ideal of polynomials in x l , . . . , x,, sorted
by increasing leading monomials, for the lexicographical ordering such that x~ < . . 9<
xn;
Output: T: a triangular family equivalent with G;
Subf onctions :
Reduce(p, rood): reduces p modulo mod;
Inverse(p, rood): returns the inverse of p modulo mod;
Leading(p, x): returns the leading coefficient of p as a univariate polynomial in x;
Factor (p, rood): returns the list of irreducible monic factors of p modulo rood
Begin
T:=[[]];
for i :--- 1 to n do
H :-- the sublist o f the elements of G which depends on x; but not on x~+,,..., x,;
U : = T; T : = [ ] ;
for rood in U do
repeat
p :---first(H);
H := rest(H);
q := Leading(p, xj);
q :--- Inverse(q, mod);
until q ~ 0;
for q in Factor(p, rood) do
T := cons(cons(q, rood), T)
return ( T)
end.
Procedure 6 D51extriangular
Input: G: a Gr6bner base o f a zero-dimensional ideal of polynomials in x l , . . . , x~, sorted
by increasing leading monomials, for the lexicographical ordering such that xl < " 9 9<
xn;
Output: T: a triangular family equivalent with G;
Subfonctions:
Reduce(p, rood): reduces p modulo rood;
Inverse (p, raod): returns the inverse o f p modulo rood or 0 i f p reduces to 0 modulo rood;
Leading(p, x): returns the leading coefficient of p as a univariate polynomial in x;
Begin
rood := [];
for i:= 1 to n do
H := the sublist o f the elements of G which depends on xi but not on xi+l,. 9 9 x,;
repeat
p :=first(H);
H := rest(H);
q := Leading(p, xt);
q := Inverse(q, rood);
until q ~ O;
p:= Reduce(p * q, rood);
rood := cons(p, rood)
return(rood)
end.
Both algorithms are directly based on Theorem 1: at each step of the loop on i, the
polynomials in x - 1 , . . . , xl modulo mod form a field (or a D5-field) and Gianni-
Kalkbrenner theorem applies.
In each step of the loop on the moduli these algorithms need only one inversion of
the leading coefficient, one product by the inverse and one factorization or splitting for
each element of G which is visited. Let D be the number of monomials which are
irreducible by the input Gr6bner base; the sum of the degrees of the triangular sets (see
Definition 1) in the triangular family which is returned is at most D (equality if all
solutions are simple). Thus the time needed by Lextriangular or D51extriangular is at
most the length of G times the time needed for one inversion and one faetorization or
product of a polynomial by a constant. The length of G is at most nD (see Faug~re et
al., 1989), where n is the n u m b e r of variables; thus the above algorithms are polynomial
in D and n provided that the needed arithmetic operations are polynomial in the degrees
o f the triangular set of moduli and of the polynomial to be inverted or factorized. This
has been done in Langemyr (1991).
8. Numeric Resolution
We have seen above that numeric solutions may be easily obtained from triangular
sets by solving successive univariate polynomials. In fact, this is not so easy because,
after the first step, the coefficients are not integers. This is a problem on some computer
algebra systems which only provide a function for computing the roots for integer
coefficients. More importantly, finding the roots of a polynomial is a very unstable problem
130 D. Lazard
(see Wilkinson, 1959 or Davenport et al., 1986). Thus it is necessary to solve only univadate
polynomials with integer coefficients. This is easy from a triangular system.
The following algorithm starts with a triangular system and returns a list o f univariate
polynomials fo . . . . . f~ such that the set o f the evaluations of ( f l , . . . , f , ) at the roots of
f0 is exactly the set o f the c o m m o n zeros o f the triangular set. This algorithm is probably
not new, b u t has to be restated in terms o f triangular sets.
Procedure 7 Generic
Input: T = ( T I , . . . , T~): a triangular reduced set in the variables x ~ , . . . , x,;
Output: f = ( f o , . . . ,f~): a list o f univariate polynomials as specified above;
Begin
fo:= subst(z, x,, T1);
f l : = z;
for i= 2 to n do
p := s u b x t ( [ f l , . . . ,f~-d, [ x ~ , . . . , X~-l], T~);
if degree(p, x~) = 1 then
fi :---P - x ~ {p is monic};
else
for A in 1, - 1 , 2, - 2 , . 9 repeat
f := subst(z + hxi, z, fo);
q :-- subst(z+kx~, z,p);
r := resultant(f, q, xt)
until the last non-constant (in xi) subresultant is of degree 1 and the coefficient
o f xt in it has a constant G C D with r;
s :----this subresultant;
fo := r;
f~ := subst(O, x , s)/coeff(x, s) mod r {this quotient is congruent to a polynomial
m o d u l o r};
for j = 1 to i - 1 do fj:= subst(z + Af, z, fj);
end.
REMARK 6. In practice, it is much better to factor f0 at each step and to split the triangular
set being constructed: the lower the degree offo, the faster is the computation and smaller
are the coefficients which appear, For the same reason, if the leading coefficient o f the
subresultant o f degree 1 has a common factor with the resultant, this may be used for
splitting the problem (for example with D5). The same decomposition comes from the
factorization o f the resulting fo, but an earlier decomposition leads to lower values of )t.
Zero-dimensional Algebraic Systems 131
References
Davenport, J. H. (1987). Looking at a set of equations. Technical report 8%06, University of Bath.
Davenport, J. H., Siret, Y., Tournier, E. (1986). CalculForrnel, Syst~meset algorithmes de manipulation alggbriques.
Masson. English translation: Computer Algebra. Pads: Academic Press, 1988.
Della Dora, J., Dicreseenzo, C., Duval, D. (1985). About a new method for computing in algebraic number
fields. Proc. EUROCAL '85, Vos 2. Lecture Notes in Computer Science 204, 289-290.
Dierescenzo, C., Dural, D. (1985). Algebraic computations on algebraic numbers. In: Computersand Computing.
Chenin, P. et aL (ed.). Paris: Masson and Wiley, 54-61.
Dicrescenzo, C., Duval, D. (1988). Algebraic extensions and algebraic closure in SCRATCHPAD II. Symbolic
and Algebraic Computation, International Symposium ISSAC '88 (P. Gianni, ed.). Lecture Notes in
Computer Science 358, 440-455.
Duval, D. (1987). Diverses questions relatives au calcul formel avee des nombres alg6bfiques. Th~se d'Etat,
Grenoble.
Faug~re, J. C., Gianni, P., Lazard, D., Mora, T. (1988). Efficient computation of zero-dimensional Grgbner
bases by change of ordering. Technical Report LITP 89-52. J. Symbolic Computation (submitted).
Gianni, P. (1987). Properties of Gr~bner bases under specializations. European Conference on Computer
Algebra, Leipzig, GDR, 1987 (J. H. Davenport, ed.). Lecture Notes in Computer Science 378, 293-297.
Gianni, P., Mora T. (1987). Algebraic solution of systems of polynomial equations using Gr6bner bases. Applied
Algebra, Algebraic Algorithms and Error-Correcting Codes (AAECC 5), Menorca, Spain, 1987. Lecture
Notes in Computer Science 356, 247-257.
Gianni, P., Trager, B., Zacharias, G. (1988). Grgbner bases and primary decomposition of polynomial ideals.
Z Symbolic Computation 6, 149-167.
Kalkbrenner, M. (1987). Solving systems of algebraic equations by using Gri~bner bases. European Conference
on Computer Algebra, Leipzig, GDR, 1987 (J. H. Davenport, ed.). Lecture Notes in Computer Science 378,
282-292.
Kobayashi, H., Fujise, T., Furukawa, A. (1988). Solving systems of algebraic equations by general elimination
method. J. Symbolic Computation 5, 303-320.
Kobayashi, H., Moritsugu, S., Hogan, R. W. (1988). On solving systems of algebraic equations. Symbolic and
Algebraic Computation, International Symposium ISSAC '88 (P. Gianni, ed.). Lecture Notes in Computer
Science 358, 139-149.
Lakshman, Y. N. (1990). On the complexity of computing a Grgbner basis for the radical of a zero dimensional
ideal. Proc. STOCS '90.
Lakshman, Y. N. (1991). A single exponential bound on the complexity of computing (3rSbner bases of zero
dimensional ideals. In: Effective Methods in Algebraic Geometry, Mora, T., Traverso, C. (eds). Progress
in Math. (Birkhiiuser) 14, 227-234.
Lakshman, Y. N., Lazard, D. (1991). On the complexity of zero-dimensional algebraic systems. In: Effective
Methods in Algebraic Geometry, Mora, T., Traverso, C. (eds). Progress in Math. (Birkh~iuser) 14, 217-225.
Langemyr, L. (1991). Algorithms for a multiple algebraic extension. In: Effective Methods in Algebraic Geometry,
Mora, T., Traverso, C. (eds). Progress in Math. (Birkh[iuser) 14, 235-248.
Lazard, D. (1981). R6solution des syst~mes d'6quations alg6bdques. Theor. Comp. Sci. 15, 77-110.
Lazard, D. (1983). GrSbner bases, gaussian elimination and resolution of systems of algebraic equations. Proc.
EUROCAL '83. Lecture Notes in Computer Science 162, 146-157.
Lazard, D. (1990). A new method for solving algebraic systems of positive dimension. Technical Report LITP
89-77. Distr. Appl. Math. (to appear).
Wilkinson, J. H. (1959). The evaluation of the zeros of ill.conditioned polynomials. Num. Math. 1, 150-180.
Wu Wen-Tsiin (1987). A zero structure theorem for polynomial equation solving. Math.-Mechanization Research
Preprints 1, 2-12, Academica Siniea, Beijing.