Fundamental Problems in Algorithmic Algebra Chee Keng Yap Courant Institute of Mathematical Sciences New York University 251 Mercer Street New York, NY 10012 September 8, 1993 TO BE PUBLISHED BY PRINCETON UNIVERSITY PRESS Copyright Reserve: This preliminary version may be copied, in part or wholly, for private use provided this copyrightpageiskeptintactwitheachpartialorwholecopy. Forclassroomdistribution,pleaserequestpermis- sion. Contacttheauthorattheaboveaddressfortheon-goingchangestothemanuscript. Thereaderiskindly requested to inform the author of any errors, typographical or otherwise. All suggestions welcome. Electronic mail: [email protected]. (cid:13)c Chee-Keng Yap September 8, 1993 Contents 0. Introduction I. Basic Arithmetic II. The GCD III. Subresultants IV. Modular Techniques: Chinese Remainder V. Fundamental Theorem of Algebra VI. Roots of Polynomials VII. Sturm Theory VIII. Gaussian Lattice Reduction IX. Lattices and Polynomial Factorization X. Elimination Theory XI. Gr¨obner Bases XII. Continued Fractions (cid:13)c Chee-Keng Yap September 8, 1993 PREFACE These notes were first written for a course on Algebraic Computing: Solving Systems of Poly- nomial Equations, given in the Spring Semester of 1989 at the Free University of Berlin. They werethoroughlyrevisedfollowingasimilarcourseattheCourantInstituteintheSpringof1992. Prerequisites are an undergraduate course in algebra and a graduate course in algorithmics. I regard this course as an introduction to computer algebra. The subject matter (‘starting from the Fundamental Theorem of Algebra’) is as classical as one gets in theoretical computer science, and yet it is refreshingly contemporary in interest. This is because the complexity viewpoint exposes many classicalquestions to new light. There is a common misunderstanding that equates computational mathematics with numerical analysis. In fact, it seems to me that the older name of “symbolic manipulation” given to our field arose as a direct contrast to “numerical computation”. The preferred name today is “computer algebra”, although I feel that “algorithmic algebra” gives a better emphasis to the fundamental nature of the subject. Inanycase,computeralgebrausesquite distincttechniques,andsatisfiesrequirementsdistinct from that in numerical analysis. In many areas of computer application (robotics, computer- aided design, geometricmodeling, etc) computer algebrais now recognizedas anessentialtool. This is partly driven by the wide-spread availability of powerful computer work-stations, and the rise of a new generation of computer algebra systems to take advantage of this computing power. The full spectrum of activity in computer algebra today covers many important areas that we do not even give a hint of in these lectures: it ranges from more specialized topics such as algorithmic integration theory, to implementation issues in computer algebra systems, to a highly developed and beautiful complexity theory of algebraic problems, to problems in allied applicationareassuchasrobotmotionplanning. Ourmaterialisnecessarilyselective,although we feel that if one must cut one swathfrom the elementaryinto the deeper parts of the subject inanintroductorycourse,this isachoicecut. Historically,whatweidentifiedas“Fundamental problems” in these lectures were clearly central to the development of algebra and even of mathematics. Thereisanenormousamountofrelevantclassicalliteratureonthesefundamental problems, in part a testimony to the strong algorithmic nature of mathematics before the twentieth century. Even when restricted to this corpus of knowledge (classical, supplemented by modern algorithmic development), my colleagues will surely notice important gaps. But I hope they may still find this book useful as a launching point into their own favorite areas. We have tried to keep the style of the book close to the lecture form in which this material originally existed. Of course, we have considerably expanded on the lecture material. This mainly consisted of the filling in of mathematical background: a well-equipped student may skip this. The teacher could convey the central ideas quickly at the expense of generality, for instance, by assuming that the rings under discussion are the “canonical examples” ( and Z F[X]). One teaching plan is to choose a subset of the material in each Lecture Section of this book for presentation in a 2-hour class (the typical length of class at Courant), with the rest assigned for further reading. I thank Frau Schottke from the Free University for her dedicated transcription of my original hand-written notes into the computer. (cid:13)c Chee-Keng Yap September 8, 1993 Chee Yap Greenwich Village September 8, 1993 (cid:13)c Chee-Keng Yap September 8, 1993 §1. Problem of Algebra Lecture 0 Page 1 Lecture 0 INTRODUCTION Thislectureisanorientationonthe centralproblemsthatconcernus. Specifically,weidentifythree families of “Fundamental Problems”in algorithmic algebra( 1 – 3). In the restof the lecture ( 4– § § § 9),webrieflydiscussthecomplexity-theoreticbackground. 10collectssomecommonmathematical § § terminology while 11 introduces computer algebra systems. The reader may prefer to skip 4-11 § § on a first reading, and only use them as a reference. All our rings will contain unity which is denoted 1 (and distinct from 0). They are commutative except in the case of matrix rings. The main algebraic structures of interest are: N = natural numbers 0,1,2,... Z = integers Q = rational numbers R = reals C = complex numbers R[X] = polynomial ring in d 1 variables X=(X ,...,X ) 1 n ≥ with coefficients from a ring R. Let R be any ring. For a univariate polynomial P R[X], we let deg(P) and lead(P) denote its ∈ degreeandleading coefficient(orleadingcoefficient). IfP =0thenbydefinition,deg(P)= and −∞ lead(P)=0;otherwisedeg(P) 0andlead(P)=0. WesayP isa(respectively)integer,rational, ≥ 6 real or complex polynomial, depending on whether R is Z,Q,R or C. In the course of this book, we will encounter other rings: (e.g., I.1). With the exception of matrix § rings, all our rings are commutative. The basic algebra we assume can be obtained from classics such as van der Waerden [22] or Zariski-Samuel[27, 28]. §1. Fundamental Problem of Algebra Consider an integer polynomial n P(X)= a Xi (a Z,a =0). (1) i i n ∈ 6 i=0 X Many of the oldest problems in mathematics stem from attempts to solve the equation P(X)=0, (2) i.e., to find numbers α such that P(α) = 0. We call such an α a solution of equation (2); alterna- tively,αisarootorzeroofthepolynomialP(X). Bydefinition,analgebraic numberisazeroofsome polynomial P Z[X]. The Fundamental Theorem of Algebra states that every non-constant poly- ∈ nomial P(X) C[X]has a root α C. Put another way,C is algebraicallyclosed. d’Alembert first ∈ ∈ formulated this theorem in 1746 but Gauss gave the first complete proof in his 1799 doctoral thesis (cid:13)c Chee-Keng Yap March 6, 2000 §1. Problem of Algebra Lecture 0 Page 2 atHelmstedt. Itfollowsthattherearen(notnecessarilydistinct)complexnumbersα ,...,α C 1 n ∈ such that the polynomial in (1) is equal to n P(X) a (X α ). (3) n i ≡ − i=1 Y To see this, suppose α is a root of P(X) as guaranteed by the Fundamental Theorem. Using the 1 synthetic division algorithm to divide P(X) by X α , we get 1 − P(X)=Q (X) (X α )+β 1 1 1 · − where Q (X) is a polynomial of degree n 1 with coefficients in C and β C. On substituting 1 1 − ∈ X = α , the left-hand side vanishes and the right-hand side becomes β . Hence β = 0. If n = 1, 1 1 1 then Q (X) = a and we are done. Otherwise, this argument can be repeated on Q (X) to yield 1 n 1 equation (3). The computational version of the Fundamental Theorem of Algebra is the problem of finding roots of a univariate polynomial. We may dub this the Fundamental Problem of Computational Algebra (or Fundamental Computational Problem of Algebra). The FundamentalTheoremis about complex numbers. For our purposes, we slightly extend the context as follows. If R R are rings, the 0 1 ⊆ Fundamental Problem for the pair (R ,R ) is this: 0 1 Given P(X) R [X], solve the equation P(X)=0 in R . 0 1 ∈ We are mainly interested in cases where Z R R C. The three main versions are where 0 1 ⊆ ⊆ ⊆ (R ,R ) equals (Z,Z),(Z,R) and (Z,C), respectively. We call them the Diophantine, real and 0 1 complex versions (respectively) of the Fundamental Problem. What does it mean “to solveP(X)=0 in R ”? The most naturalinterpretationis that we wantto 1 enumeratealltherootsofP thatlieinR . Besidesthisenumeration interpretation,weconsidertwo 1 other possibilities: the existential interpretation simply wants to know if P has a root in R , and 1 the counting interpretation wants to know the number of such roots. To enumerate1 roots,we must addressthe representationof these roots. For instance,we will study a representationvia “isolating intervals”. Recall another classical version of the Fundamental Problem. Let R = Z and R denote the 0 1 complex subring comprising all those elements that can be obtained by applying a finite number of field operations (ring operations plus division by non-zero) and taking nth roots (n 2), starting ≥ fromZ. Thisisthefamoussolutionbyradicals versionoftheFundamentalProblem. Itiswellknown thatwhendegP =2,thereisalwaysasolutioninR . WhatifdegP >2? Thiswasamajorquestion 1 of the 16th century, challenging the best mathematicians of its day. We now know that solution by radicals exists for degP =3 (Tartaglia, 1499-1557)and degP =4 (variously ascribed to Ferrari (1522-1565)or Bombelli (1579)). These methods were widely discussed, especially after they were published by Cardan (1501-1576) in his classic Ars magna, “The Great Art”, (1545). This was the algebra book until Descartes’ (1637) and Euler’s Algebra (1770). Abel (1824) (also Wantzel) show thatthereis nosolutionbyradicalsfora generalpolynomialofdegree5. Ruffinihadapriorthough incomplete proof. This kills the hope fora single formula whichsolvesall quintic polynomials. This still leaves open the possibility that for each quintic polynomial, there is a formula to extract its roots. But itis nothardto dismiss this possibility: forexample, anexplicit quintic polynomialthat 1Thereispossibleconfusionhere: theword“enumerate”meansto“count”aswellasto“listbyname”. Sincewe areinterestedinbothmeaningshere,wehavetoappropriatetheword“enumerate”foronlyoneofthesetwosenses. Inthisbook,wetrytouseitonlyinthelattersense. (cid:13)c Chee-Keng Yap March 6, 2000 §2. Algebraic Geometry Lecture 0 Page 3 does not admit solution by radicals is P(X) = X5 16X +2 (see [3, p.574]). Miller and Landau − [12] (also[26]) revisitsthese questionfroma complexity viewpoint. The abovehistoricalcomments may be pursued more fully in, for example, Struik’s volume [21]. Remarks:. The Fundamental Problem of algebra used to come under the rubric “theory of equa- tions”, which nowadays is absorbed into other areas of mathematics. In these lectures, we are interested in general and effective methods, and we are mainly interested in real solutions. §2. Fundamental Problem of Classical Algebraic Geometry To generalizethe Fundamental Problemof algebra,we continue to fix two rings,Z R R C. 0 1 ⊆ ⊆ ⊆ First consider a bivariate polynomial P(X,Y) R [X,Y]. (4) 0 ∈ Let Zero(P) denote the set of R -solutions of the equation P = 0, i.e., (α,β) R2 such that P(α,β) = 0. The zero set Zero(1P) of P is generally an infinite set. In case R∈ =1R, the set 1 Zero(P) is a planar curve that can be plotted and visualized. Just as solutions to equation (2) are called algebraic numbers, the zero sets of bivariate integer polynomials are called algebraic curves. But there is no reason to stop at two variables. For d 3 variables, the zero set of an integer ≥ polynomial in d variables is called an algebraic hypersurface: we reserve the term surface for the special case d=3. Given two surfaces defined by the equations P(X,Y,Z) = 0 and Q(X,Y,Z)= 0, their intersection is generally a curvilinear set of triples (α,β,γ) R3, consisting of all simultaneous solutions to the ∈ 1 pair of simultaneous equations P = 0, Q = 0. We may extend our previous notation and write Zero(P,Q) for this intersection. Moregenerally,we wantthe simultaneous solutions to a system of m 1 polynomial equations in d 1 variables: ≥ ≥ P =0 1 P =0 2 ... (where Pi ∈R0[X1,...,Xd]) (5) P =0 m A point (α ,...,α ) Rd is called a solution of the system of equations (5) or a zero of the set 1 d ∈ 1 P ,...,P provided P (α ,...,α ) = 0 for i = 1,...,m. In general, for any subset J R [X], 1 m i 1 d 0 {let Zero(J)} Rd denote the zero set of J. To denote the dependence on R , we may a⊆lso write Zero (J). ⊆If R1 is a field, we also call a zero set an algebraic set. Since1the primary objects R1 1 of study in classical algebraic geometry are algebraic sets, we may call the problem of solving the system (5) the Fundamental (Computational) Problem of classical algebraic geometry. If each P is i linear in (5), we arelooking ata systemof linear equations. One mightcallthis is the Fundamental (Computational) Problem of linear algebra. Ofcourse,linearsystems arewellunderstood,andtheir solution technique will form the basis for solving nonlinear systems. Again,wehavethreenaturalmeaningstotheexpression“solvingthesystemofequations(5)inR ”: 1 (i)TheexistentialinterpretationasksifZero(P ,...,P )isempty. (ii)Thecountinginterpretation 1 m asks for the cardinality of the zero set. In case the cardinality is “infinity”, we could refine the question by asking for the dimension of the zero set. (iii) Finally, the enumeration interpretation poses no problems when there are only finitely many solutions. This is because the coordinates of these solutions turn out to be algebraic numbers and so they could be explicitly enumerated. It becomes problematic when the zero set is infinite. Luckily, when R = R or C, such zero sets are 1 well-behaved topologically, and each zero set consists of a finite number of connected components. (cid:13)c Chee-Keng Yap March 6, 2000 §3. Ideal Theory Lecture 0 Page 4 (For that matter, the counting interpretation can be re-interpreted to mean counting the number of components of each dimension.) A typical interpretation of “enumeration” is “give at least one sample point from each connected component”. For real planar curves, this interpretation is useful for plotting the curve since the usual method is to “trace” each component by starting from any point in the component. Note thatwe havemovedfromalgebra(numbers)to geometry(curvesandsurfaces). Inrecognition ofthis,weadoptthegeometriclanguageof“pointsandspace”. ThesetRd(d-foldCartesianproduct 1 ofR )iscalledthed-dimensional affine spaceofR ,denotedAd(R ). ElementsofAd(R )arecalled 1 1 1 1 d-points or simply points. Our zero sets are subsets of this affine space Ad(R ). In fact, Ad(R ) can 1 1 be given a topology (the Zariski topology) in which zero sets are the closed sets. There are classical techniques via elimination theory for solving these Fundamental Problems. The recent years has seen a revival of these techniques as well as major advances. In one line of work, Wu Wen-tsun exploited Ritt’s idea of characteristic sets to give new methods for solving (5) rather efficiently in the complex case, R =C. These methods turn out to be useful for proving theorems 1 in elementary geometry as well [25]. But many applications are confined to the real case (R =R). 1 Unfortunately, it is a general phenomenon that real algebraic sets do not behave as regularly as the corresponding complex ones. This is already evident in the univariate case: the Fundamental Theorem of Algebra fails for realsolutions. In view of this, most mathematical literature treats the complex case. More generally, they apply to any algebraically closed field. There is now a growing body of results for real algebraic sets. Another step traditionally taken to “regularize” algebraic sets is to consider projective sets, which abolishthe distinction between finite andinfinite points. A projective d-dimensional point is simply anequivalenceclassofthesetAd+1(R ) (0,...,0) ,wheretwonon-zero(d+1)-pointsareequivalent 1 \{ } if one is a constant multiple of the other. We use Pd(R ) to denote the d-dimensional projective 1 space of R . 1 Semialgebraic sets. The realcase admits a generalizationof the system(5). We canview (5) as a conjunction of basic predicates of the form “P =0”: i (P =0) (P =0) (P =0). 1 2 m ∧ ∧···∧ We generalizethis to an arbitraryBooleancombination of basic predicates,where a basic predicate now has the form (P =0) or (P >0) or (P 0). For instance, ≥ ((P =0) (Q>0)) (R 0) ∧ ∨ ¬ ≥ is a Boolean combination of three basic predicates where P,Q,R are polynomials. The set of real solutions to such a predicate is called a semi-algebraic set (or a Tarski set). We have effective methods of computing semi-algebraic sets, thanks to the pioneering work of Tarski and Collins [7]. Recent work by various researchers have reduced the complexity of these algorithms from double exponentialtime tosingleexponentialspace[15]. This surveyalsodescribestoapplicationsofsemi- algebraic in algorithmic robotics, solid modeling and geometric theorem proving. Recent books on real algebraic sets include [4, 2, 10]. §3. Fundamental Problem of Ideal Theory Algebraic sets are basically geometric objects: witness the language of “space, points, curves, sur- faces”. Nowweswitchfromthegeometricviewpoint(back!) toanalgebraicone. Oneofthebeauties of this subject is this interplay between geometry and algebra. (cid:13)c Chee-Keng Yap March 6, 2000 §3. Ideal Theory Lecture 0 Page 5 Fix Z R R C as before. A polynomial P(X) R [X] is said to vanish on a subset 0 1 0 ⊆ ⊆ ⊆ ∈ U Ad(R ) if for all a U, P(a)=0. Define 1 ⊆ ∈ Ideal(U) R [X] 0 ⊆ to comprise allpolynomials P R [X] that vanishon U. The set Ideal(U) is an ideal. Recallthat 0 ∈ a non-empty subset J R of a ring R is an ideal if it satisfies the properties ⊆ 1. a,b J a b J ∈ ⇒ − ∈ 2. c R, a J ca J. ∈ ∈ ⇒ ∈ For any a1,...,am R and R′ R, the set (a1,...,am)R′ defined by ∈ ⊇ m (a1,...,am)R′:= aibi :b1,...,bm R′ { ∈ } i=1 X is an ideal, the ideal generated by a ,...,a in R′. We usually omit the subscript R′ if this is 1 m understood. The FundamentalProblemofclassicalalgebraicgeometry(see Equation(5))canbe viewedascom- puting (some characteristic property of) the zero set defined by the input polynomials P ,...,P . 1 m But note that Zero(P ,...,P )=Zero(I) 1 m where I is the ideal generated by P ,...,P . Hence we might as well assume that the input to the 1 m FundamentalProblemis the idealI (representedby a setofgenerators). This suggests that we view ideals to be the algebraic analogue of zero sets. We may then ask for the algebraic analogue of the FundamentalProblemofclassicalalgebraicgeometry. Anaive answeris that, “givenP ,...,P , to 1 m enumerate the set (P ,...,P )”. Of course, this is impossible. But we effectively “know” a set S 1 m if, for any purported member x, we can decisively say whether or not x is a member of S. Thus we reformulate the enumerative problem as the Ideal Membership Problem: Given P ,P ,...,P R [X], is P in (P ,...,P )? 0 1 m 0 0 1 m ∈ WheredoesR comein? Well,theideal(P ,...,P )isassumedtobegeneratedinR [X]. Weshall 1 1 m 1 introduce effective methods to solve this problem. The technique of Gr¨obner bases (as popularized by Buchberger) is notable. There is strong historical basis for our claim that the ideal membership problem is fundamental: van der Waerden [22, vol. 2, p. 159] calls it the “main problem of ideal theory in polynomial rings”. Macaulay in the introduction to his 1916 monograph [14] states that the “object of the algebraic theory [of ideals] is to discover those general properties of [an ideal] which will afford a means of answering the question whether a given polynomial is a member of a given [ideal] or not”. How generalarethe ideals ofthe form(P ,...,P )? The onlyideals that mightnotbe ofthis form 1 m are those that cannot be generated by a finite number of polynomials. The answer is provided by what is perhaps the starting point of modern algebraic geometry: the Hilbert!Basis Theore. A ring R is called Noetherian if all its ideals are finitely generated. For example, if R is a field, then it is Noetherian since its only ideals are (0) and (1). The Hilbert Basis Theorem says that R[X] is Noetherianif R is Noetherian. This theoremis crucial2 froma constructiveviewpoint: it assuresus that although ideals are potentially infinite sets, they are finitely describable. 2The paradox is, many view the original proof of this theorem as initiating the modern tendencies toward non- constructiveproofmethods. (cid:13)c Chee-Keng Yap March 6, 2000 §3. Ideal Theory Lecture 0 Page 6 We now have a mapping U Ideal(U) (6) 7→ from subsets of Ad(R ) to the ideals of R [X], and conversely a mapping 1 0 J Zero(J) (7) 7→ from subsets of R [X] to algebraic sets of Ad(R ). It is not hard to see that 0 1 J Ideal(Zero(J)), U Zero(Ideal(U)) (8) ⊆ ⊆ for all subsets J R [X] and U Ad(R ). Two other basic identities are: 0 1 ⊆ ⊆ Zero(Ideal(Zero(J))) = Zero(J), J R [X], 0 ⊆ Ideal(Zero(Ideal(U))) = Ideal(U), U Ad(R ), (9) 1 ⊆ We prove the first equality: If a Zero(J) then for all P Ideal(Zero(J)), P(a) = 0. Hence a Zero(Ideal(Zero(J)). Co∈nversely, if a Zero(Ide∈al(Zero(J)) then P(a) = 0 for all P ∈ Ideal(Zero(J)). But since J Ideal(Ze∈ro(J)), this means that P(a) = 0 for all P J. He∈nce a Zero(J). The second equ⊆ality (9) is left as an exercise. ∈ ∈ If we restrict the domain of the map in (6) to algebraic sets and the domain of the map in (7) to ideals, would these two maps be inverses of each other? The answer is no, based on a simple observation: AnidealI iscalledradical ifforallintegersn 1,Pn I impliesP I. Itisnothard to check that Ideal(U) is radical. On the other hand, the≥ideal (X∈2) Z[X] is cl∈early non-radical. ∈ It turns out that if we restrict the ideals to radical ideals, then Ideal() and Zero() would be · · inverses of each other. This is captured in the Hilbert Nullstellensatz (or, Hilbert’s Zero Theorem in English). After the Basis Theorem, this is perhaps the next fundamental theorem of algebraic geometry. ItstatesthatifP vanishesonthe zerosetofanidealI thensomepowerPn ofP belongs to I. As a consequence, I =Ideal(Zero(I)) I is radical. ⇔ Inproof: Clearlythe left-handside impliesI isradical. Conversely,ifI is radical,itsuffices toshow that Ideal(Zero(I)) I. Say P Ideal(Zero(I)). Then the Nullstellensatz implies Pn I for ⊆ ∈ ∈ some n. Hence P I since I is radical, completing our proof. ∈ We nowhaveabijective correspondencebetweenalgebraicsetsandradicalideals. This implies that ideals in general carry more information than algebraic sets. For instance, the ideals (X) and (X2) have the same zero set, viz., X =0. But the unique zero of (X2) has multiplicity 2. Theideal-theoreticapproach(oftenattachedtothenameofE.Noether)characterizesthetransition from classical to “modern” algebraic geometry. “Post-modern” algebraic geometry has gone on to more abstract objects such as schemes. Not much constructive questions are raised at this level, perhaps because the abstract questions are hard enough. The reader interested in the profound transformation that algebraic geometry has undergone over the centuries may consult Dieudonn´e [9] who described the subject in “seven epochs”. The current challenge for constructive algebraic geometry appears to be at the levels of classicalalgebraic geometry and at the ideal-theoretic level. For instance, Brownawell [6]and others have recently given us effective versions of classical results such as the Hilbert Nullstellensatz. Such results yields complexity bounds that are necessary for efficient algorithms (see Exercise). This concludes our orientation to the central problems that motivates this book. This exercise is pedagogically useful for simplifying the algebraic-geometric landscape for students. However, the richness of this subject and its complex historical development ensures that, in the opinion of some (cid:13)c Chee-Keng Yap March 6, 2000