Subresultant PRS
A polynomial remainder sequence (PRS) is the sequence of remainders produced by Euclid's algorithm applied to two polynomials. Over the integers, the remainders are computed by pseudo-division to avoid fractions, and then something must be done about coefficient growth: the plain pseudo-remainders grow exponentially, and dividing each by its content, as the primitive PRS does, requires a gcd of all its coefficients at every step[4]. The subresultant PRS divides each pseudo-remainder by a factor that can be predicted from the leading coefficients and degrees already seen, without any gcd computation. George Collins proved in 1967 that this division is always exact[1]. The resulting remainders are, up to sign, the subresultants of the two inputs, determinants built from their coefficients, and Hadamard's inequality then bounds their size linearly in the degree. The sequence gives the gcd of the inputs up to a constant factor and, from its last element, their resultant[2][5].
Resultants and subresultants
For and , the Sylvester matrix is the matrix whose rows are the coefficients of and . Its determinant is the resultant , which vanishes exactly when and have a common factor[6][10]. The -th subresultant is the polynomial of degree at most obtained from the submatrix that uses only shifts of and shifts of . Every subresultant is an integer combination with and , and its coefficients are determinants of integer matrices of size at most .
The fundamental theorem of subresultants says that the remainders of Euclid's algorithm, computed over the fraction field, are proportional to subresultants, and it gives the proportionality constants explicitly in terms of leading coefficients[1][2]. By Hadamard's inequality, the determinant of a matrix with entries bounded by is at most , so the coefficients of subresultants have bits: linear in the degree.
Algorithm
Let , with , and . For , with , the sequence continues as[3][4]:
until the pseudo-remainder is zero. Both divisions are exact; this is the content of Collins's theorem[1]. The are themselves leading coefficients of subresultants. When the sequence ends at a constant, the inputs are coprime and the resultant can be read off the last element with a sign correction; when it ends at a polynomial of positive degree, that polynomial is a multiple of the gcd and its primitive part is the gcd.
The subresultant PRS and the resultant computed from it, and a determinant of the Sylvester matrix by fraction-free elimination for comparison.
(* The subresultant polynomial remainder sequence: each pseudo-remainderis divided by g h^delta, which is exact, and the remainders are thenthe subresultants of the inputs (up to sign). *)let subresultant_prs a b =let a, b = if deg a >= deg b then (a, b) else (b, a) inlet rec go u v g h acc =if is_zero v then List.rev accelselet delta = deg u - deg v inlet r = prem u v inif is_zero r then List.rev (v :: acc)elselet r = divexact_const r (Z.mul g (Z.pow h delta)) inlet g' = lc v inlet h' = if delta = 0 then h else Z.divexact (Z.pow g' delta) (Z.pow h (delta - 1)) ingo v r g' h' (v :: acc)ingo a b Z.one Z.one [ a ](* The resultant, following the same sequence (Cohen, Algorithm 3.3.7). *)let resultant a b =if is_zero a || is_zero b then Z.zeroelse beginlet signed_content p = let c = content p in if Z.sign (lc p) < 0 then Z.neg c else c inlet t = Z.mul (Z.pow (signed_content a) (deg b)) (Z.pow (signed_content b) (deg a)) inlet a = primitive a and b = primitive b inlet s = ref (if deg a < deg b && deg a mod 2 = 1 && deg b mod 2 = 1 then -1 else 1) inlet a, b = if deg a >= deg b then (a, b) else (b, a) inlet rec go a b g h =if is_zero b then Z.zeroelse if deg b = 0 thenif deg a = 0 then Z.mul (Z.of_int !s) telse Z.mul (Z.of_int !s) (Z.mul t (Z.divexact (Z.pow (lc b) (deg a)) (Z.pow h (deg a - 1))))else beginlet delta = deg a - deg b inif deg a mod 2 = 1 && deg b mod 2 = 1 then s := - !s;let r = prem a b inif is_zero r then Z.zeroelselet r = divexact_const r (Z.mul g (Z.pow h delta)) inlet g' = lc b inlet h' = if delta = 0 then h else Z.divexact (Z.pow g' delta) (Z.pow h (delta - 1)) ingo b r g' h'endingo a b Z.one Z.oneend
Knuth's example.
open Zpoly
Running it.
x^8 + x^6 - 3x^4 - 3x^3 + 8x^2 + 2x - 53x^6 + 5x^4 - 4x^2 - 9x + 21-15x^4 + 3x^2 - 965x^2 + 125x - 245-9326x + 12300260708resultant from the sequence: 260708Sylvester determinant: 260708
The coefficients 15, 65, 9326 and the resultant 260708 are the subresultants of the two polynomials; they match the determinant of the Sylvester matrix computed independently.
Coefficient growth
Bits in the largest coefficient of each remainder, for a random pair of degree 20 and 19 with one-digit coefficients.
open Zpoly(* Remainder sequences of two random polynomials of degree 20 and 19 withcoefficients between -9 and 9: bits in the largest coefficient of eachremainder, for three ways of keeping the sequence in the integers. *)let rec seq step a b = if is_zero b then [] else b :: seq step b (step a b)
Running it; the pseudo-remainder sequence was stopped after nine steps.
degree pseudo-remainders primitive PRS subresultant PRS19 4 4 418 8 8 817 16 16 1616 36 22 2215 84 29 2914 199 36 3813 478 44 4512 1152 53 5311 2779 59 5910 64 699 75 788 86 877 97 976 107 1075 116 1164 125 1253 133 1332 136 1421 147 1490 1 156
The subresultants are sometimes slightly larger than the primitive remainders, since they are not reduced by their content, but they are obtained without a single gcd of coefficients, which on large inputs is the more expensive operation[3]. For computing gcds of polynomials over the integers, both are now superseded by the modular algorithm, whose intermediate numbers are as small as the answer; subresultants remain the method of choice when the resultant itself or the subresultants are wanted.
Applications
Resultants eliminate variables: the resultant of two bivariate polynomials with respect to is a polynomial in whose roots are the -coordinates of their common zeros. Discriminants, which detect repeated roots, are resultants of a polynomial and its derivative. Collins developed the subresultant theory in part for his cylindrical algebraic decomposition, which decides the first-order theory of the real numbers and computes subresultant coefficients of many pairs of polynomials[9]. Sturm–Habicht sequences, built from subresultants, count real roots without fractions[7][11].
History
Sylvester introduced the matrix of the resultant in 1840 and subresultants in his memoir of 1853[6]. Habicht used them in 1948 for a fraction-free version of Sturm's theorem[7]. With the arrival of computer algebra, Collins proved the fundamental theorem and gave the reduced and subresultant PRS algorithms in 1967[1], and Brown and Traub reformulated the theory in 1971[2]. Brown's 1978 paper gave the algorithm in its standard form[3], and Knuth's presentation as Algorithm C made it widely known[4]. Ducos gave an improved version in 2000 that reduces the cost of the exact divisions[8].
see also
- Pseudo-divisionPseudo-division is division of polynomials over an integral domain that is not a field, such as the integers or a ring of polynomials in other variables. To avoid fractions, the dividend a is first multiplied by lc(b)^(deg a − deg b + 1), the leading coefficient of the divisor raised to one more than the degree difference; then ordinary long division succeeds and yields a pseudo-quotient q and pseudo-remainder r with lc(b)^e a = q b + r and deg r < deg b. It is the basic step of polynomial remainder sequences over the integers, of resultant and gcd computation, and of Wu's method in geometry theorem proving. Iterated naively, it makes coefficients grow exponentially.
- Modular GCDThe modular GCD algorithm computes the greatest common divisor of two polynomials with integer coefficients by computing it modulo many machine-word primes, where coefficients never grow, and reconstructing the integer coefficients with the Chinese remainder theorem once the product of the primes exceeds twice a bound on them. Primes that divide the leading coefficients are skipped, unlucky primes that give an image of too high a degree are detected and discarded, and a final trial division certifies the result. The intermediate numbers are no larger than the answer, which makes it far faster than remainder-sequence methods; it was introduced by Brown in 1971.
- Landau–Mignotte boundThe Landau–Mignotte bound limits the coefficients of any factor of an integer polynomial in terms of the polynomial itself: if g of degree k divides f, then each coefficient of g is at most binom(k, j) times the Euclidean norm of f, up to the ratio of leading coefficients, so all are below 2^k ‖f‖₂. It follows from Landau's inequality for the Mahler measure. Computer algebra algorithms use it to decide how large a modulus is needed to recover a factor or a gcd from its image modulo a prime power or a product of primes, as in Hensel lifting and the modular gcd. Factors can have larger coefficients than the polynomial they divide, so some such bound is necessary.
- Gröbner basisA Gröbner basis of an ideal of multivariate polynomials is a generating set with respect to which multivariate division behaves as in one variable: the remainder of any polynomial is unique, and it is zero exactly when the polynomial lies in the ideal. Formally, the leading terms of the basis, for a fixed monomial order, generate the ideal of all leading terms. Buchberger's algorithm computes one from any generating set by adding the remainders of S-polynomials until they all reduce to zero. Gröbner bases decide ideal membership, solve systems of polynomial equations, count their solutions and eliminate variables; Bruno Buchberger introduced them in 1965.
- Hermite reductionHermite reduction is the step of symbolic integration that splits the integral of a rational function A/D into a rational function and an integral whose denominator is square-free, using only gcds and the extended Euclidean algorithm, with no factorization of D. The rational part of the antiderivative comes entirely from the repeated factors of D, and each reduction step lowers their multiplicity by one. What remains integrates to a sum of logarithms, whose coefficients are the roots of the Rothstein–Trager resultant. Together the two steps integrate any rational function over a field of characteristic zero exactly, introducing algebraic numbers only where the answer needs them.
referenced by
further reading
- [1]G. E. Collins, “Subresultants and reduced polynomial remainder sequences”, Journal of the ACM 14 (1967).
- [2]W. S. Brown, J. F. Traub, “On Euclid’s algorithm and the theory of subresultants”, Journal of the ACM 18 (1971).
- [3]W. S. Brown, “The subresultant PRS algorithm”, ACM Transactions on Mathematical Software 4 (1978).
- [4]D. E. Knuth, The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, §4.6.1, Addison-Wesley (3rd ed., 1997).
- [5]H. Cohen, A Course in Computational Algebraic Number Theory, §3.3, Springer (1993).
- [6]J. J. Sylvester, “On a theory of the syzygetic relations of two rational integral functions”, Philosophical Transactions of the Royal Society of London 143 (1853).
- [7]W. Habicht, “Eine Verallgemeinerung des Sturmschen Wurzelzählverfahrens”, Commentarii Mathematici Helvetici 21 (1948).
- [8]L. Ducos, “Optimizations of the subresultant algorithm”, Journal of Pure and Applied Algebra 145 (2000).
- [9]G. E. Collins, “Quantifier elimination for real closed fields by cylindrical algebraic decomposition”, Automata Theory and Formal Languages, Lecture Notes in Computer Science 33 (1975).
- [10]J. von zur Gathen, J. Gerhard, Modern Computer Algebra, ch. 6, Cambridge University Press (3rd ed., 2013).
- [11]S. Basu, R. Pollack, M.-F. Roy, Algorithms in Real Algebraic Geometry, ch. 8, Springer (2nd ed., 2006).
last updated