Mathematics for Computer Algebra Maurice Mignotte Mathematics for Computer Algebra Translated by Catherine Mignotte Springer-Verlag New York Berlin Heidelberg London Paris Tokyo Hong Kong Barcelona Budapest Maurice Mignotte Universite Louis Pasteur Department de Mathematique 67084 Strasbourg France Mathematics Subject Classification: 11 YOS, 11 Y11, l2DSO, l2YOS, 13POS, 68Q40 This book was originally published in French by the Presses Universitaires de France, 1989. The French edition is entitled Mathernatiques pour Ie calculfonnel. Library of Congress Cataloging-in-Publication Data Mignotte, Maurice. [Mathematiques pour Ie calcul forme!. English] Mathematics for computer algebra / Maurice Mignotte : translated by Catherine Mignotte. p. cm. Translation of: Mathematiques pour Ie ca1cul forme!. Includes bibliographical references and index. ISBN-13: 978-1-4613-9173-9 e-ISBN-13: 978-1-4613-9171-5 DOl: 10.1007/978-1-4613-9171-5 1. Algebra - Data processing. I. Title. QAI55.7.E4M5213 1991 512-dc20 91-33024 Printed on acid-free paper. © 1992 Springer-Verlag New York, Inc. Softcover reprint of the hardcover 1s t editiona 1992 All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer-Verlag New York, Inc., 175 Fifth Avenue, New York, NY 10010, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereaf ter developed is forbidden. The use of general descriptive names, trade names, trademarks, etc., in this publication, even if the former are not especially identified, is not to be taken as a sign that such names, as understood by the Trade Marks and Merchandise Marks Act, may accordingly be used freely by anyone. Production managed by Henry Krell; manufacturing supervised by Robert Paella. Camera ready copy provided by the author. 987654321 PREFACE This book corresponds to a mathematical course given in 1986/87 at the University Louis Pasteur, Strasbourg. This work is primarily intended for graduate students. The following are necessary prerequisites : a few standard definitions in set theory, the definition of rational integers, some elementary facts in Combinatorics (maybe only Newton's binomial formula), some theorems of Analysis at the level of high schools, and some elementary Algebra (basic results about groups, rings, fields and linear algebra). An important place is given to exercises. These exercises are only rarely direct applications of the course. More often, they constitute complements to the text. Mostly, hints or references are given so that the reader should be able to find solutions. Chapters one and two deal with elementary results of Number Theory, for example : the euclidean algorithm, the Chinese remainder theorem and Fermat's little theorem. These results are useful by themselves, but they also constitute a concrete introduction to some notions in abstract algebra (for example, euclidean rings, principal rings ... ). Algorithms are given for arithmetical operations with long integers. The rest of the book, chapters 3 through 7, deals with polynomials. We give general results on polynomials over arbitrary rings. Then polynomials with complex coefficients are studied in chapter 4, including many estimates on the complex roots of polynomials. Some of these estimates are very useful in the subsequent chapters. Chapter 5 introduces polynomials with real coefficients. The main theme of this chapter is the separation of the real roots of real polynomials. We recall many results of the last century, which generally do not appear in modern textbooks. Among them are Sturm's method, the rules of Descartes vi PREFACE and Budan-Fourier and Vincent's theorem. These works are very important in real geometry, a domain which is now very active. The sixth chapter deals with polynomials over finite fieids. It piays an essential role in this book. It contains Berlekamp's algorithm to factorize polynomials with coefficients in finite fields. Many exercises were inspired by the very complete book of R. Lidl and H. Niederreiter, Finite fields which was published in 1983 by Addison Wesley. In the last chapter, we study methods to factorize polynomials with integer coefficients. We present the famous L3 algorithm of Lenstra-Lenstra Lovaz. This algorithm uses many of the results of the preceding chapters. This course has been much influenced by the remarkable book of D. Knuth The Art of Programming, vol. 2, second edition, Addison-Wesley. First published in French under the title "MatMmatiques pour Ie calcul formel", P.U.F., Paris, 1989, it was translated by my wife, Catherine Mignotte, to whom I am very grateful. More than twenty exercises have been added to the French edition, as well as two sections about companions matrices and linear recursive sequences and an appendix about determinants. The English version has been read by my colleague Philippe Glesser and by Professors Attila Peth6 and David Saunders who corrected many mistakes and made valuable suggestions. I am very grateful to them. This new version was typed using 'lEX, and I am very grateful to my colleague Raymond Seroul who helped me to use this system. Maurice Mignotte Strasbourg, September 1991 CONTENTS PREFACE v NOTATIONS xiii CHAPTER 1 Elementary Arithmetics 1 1. Representation of an integer in basis B 1 1. Lexicographical order 1 2. Development in basis B, existence 2 3. From development to number 3 4. From number to development in basis B 4 5. Case of general rational numbers 6 6. Comparing two numbers 7 2. Addition 8 1. Case of two positive numbers 8 2. Case of two numbers of any sign 9 3. Subtraction 10 4. Multiplication 11 5. Euclidean division 13 1. Existence 13 2. Computation 14 6. The cost of multiplication and division 16 1. The cost of multiplication 16 2. The cost of division 18 7. How to compute powers 20 1. First algorithm 20 2. Second algorithm 21 3. One application 25 4. Complexity of this problem 26 viii CONTENTS 8. The g.c.d. 27 1. Existence. Relation of Bezout. Theorem of Euclid-Gauss 27 2. How to compute the g.c.d. 29 3. The cost of the algorithm of Euclid 31 4. The I.c.m. 32 9. The group G(n) 32 1. Definition 32 2. The theorem of Euler 33 3. Computation of the inverse in G(n) 34 4. Computation of the coefficients of the relation of Bezout 35 10. The Chinese remainder theorem 37 1. The theorem 37 2. Constructive proof 38 3. Effective computations 39 11. The prime numbers 40 CHAPTER 2 Number Theory, Complements 53 1. Study of the group G (n) 53 1. Some lemmas on finite groups 53 2. Application to G(p) 56 3. Structure of G(pk), k :?: 2, p odd prime 58 4. Structure of G (2k) 59 5. Structure of G(n) 60 2. Tests of primality 62 1. A general theorem 62 2. A simple test of primality 66 3. Elementary tests 67 4. Statistics on G (n) 69 3. Factorization of rational integers 71 1. Methods by successive divisions 71 2. Method of Fermat 72 3. Method of Sherman Lehman 73 4. Pollard's rho method 75 CONTENTS ix CHAPTER 3 Polynomials, Algebraic Study 85 1. Definitions and elementary properties 85 1. First definitions 85 2. Elementary arithmetic operations 85 3. Notions of degree 86 4. Case of an integral domain 87 2. Euclidean division 88 1. Monic polynomials 88 2. Euclidean division 89 3. The case of a field 90 4. Pseudo-division 92 3. The Chinese remainder theorem 92 4. Factorization 95 1. Case of a field 95 2. Case of a factorial ring 96 5. Polynomial functions 99 1. Definition 99 2. Roots of a polynomial 100 3. Multiplicity of a root 101 4. Derivatives and roots 102 5. Taylor's formula 102 6. The resultant 104 7. Companion matrix 107 8. Linear recursive sequences 114 CHAPTER 4 Polynomials with complex coefficients 141 1. The theorem of d'Alembert 141 1. Statement 141 2. Analytic properties 141 3. Demonstration of the theorem 143 4. Irreducible real polynomials 144 2. Estimates of the roots 144 1. Principle of the demonstration 144 2. An analytic lemma 145 3. Bounds for the roots 146 x CONTENTS 3. The measure of a polynomial 148 1. Definition 148 2. An algebraic lemma 151 3. An upper bound for M(P) 151 4. Other upper bounds 152 5. Analytic results 153 6. A method for the computation of M(P) 155 7. An example of the evaluation of M(P) 156 4. Bounds for size of the factors of a polynomial 158 1. Definitions 158 2. Upper bounds for the factors in the case of a single variable 158 3. Definition of the measure in the case of several variables 159 4. Bounds for the factors of a polynomial, case of several variables 160 5. An example in the case of one variable 162 5. The distribution of the roots of a polynomial 163 1. An upper bound for the number of real roots 164 2. Distribution of the arguments of the roots of a polynomial 166 6. Separation of the roots of a polynomial 166 1. Notations 166 2. A lower bound for sep(P) 167 3. Other lower bounds for the distance between two roots 168 4. Use of Galois properties 169 5. An example 170 CHAPTER 5 Polynomials with real coefficients 187 1. Polynomials irreducible over lR 187 2. The theorem of Rolle 188 1. The theorem of intermediate values 188 2. The theorem of Rolle 189 3. Estimates of real roots 190 CONTENTS Xl 1. The rule of Newton 190 2. The rule of Lagrange and MacLaurin 191 3. A special case of the rule of Descartes 191 4. The rule of Cauchy 192 5. An example of an estimation of the real roots of a polynomial 192 4. The number of zeros of a polynomial in a real interval 193 1. The rule of Sturm 193 2. The theorem of Budan-Fourier 196 3. The rule of Descartes 197 4. Case of the polynomials whose all roots are real 198 5. A detailed example 199 6. Vincent's theorem 202 5. Equations whose roots have a negative real part 210 CHAPTER 6 / Polynomials over finite fields 229 1. Finite fields 229 1. General results 229 2. The operations in a finite field 231 3. Determination of a primitive element of lF~ 233 4. Determination of z such that lFq = lFp[z] 234 5. An example: lFa 235 2. Statistics on lFq[X] 236 1. The function of Mobius 236 2. Counting irreducible polynomials 237 3. Number of squarefree polynomials 238 4. Study of the number of irreducible factors of a polynomial 239 3. Factorization into a product of squarefree polynomials 241 1. Definitions and generalites 241 2. Case of characteristic zero 243 3. Case of non zero characteristic 243 4. Algorithms of decomposition into a product of squarefree polynomials . 244