wiki

Swinnerton-Dyer polynomial

The Swinnerton-Dyer polynomials are a family of irreducible integer polynomials that split into many small factors modulo every prime[1]. For the first primes , is the product of over all choices of signs; expanding it leaves integer coefficients. The polynomial is irreducible over , yet modulo any prime it factors into linear and quadratic factors only. Factoring over the integers by Hensel lifting relies on modular factorizations that resemble the true one; for these polynomials no prime gives such a hint, and the recombination step must try exponentially many combinations of modular factors. Knuth attributes the example to Peter Swinnerton-Dyer[1], and it became the standard illustration of why the Berlekamp–Zassenhaus algorithm is exponential in the worst case and why lattice reduction was brought into factoring[4][5].

§ 01

Definition

The polynomial can be built one square root at a time. If is the polynomial for the first primes, then is the next; writing with integer polynomials and , the product is . The degree doubles with each prime.

Building SD_k by adjoining square roots.

open Zpoly
(* SD_k(x) = product over all signs of (x - sum ± sqrt(p_i)), built one
square root at a time: P(x + s) P(x - s) = u^2 - p v^2 where
P(x + s) = u + v s in Z[x][s]/(s^2 - p). *)
let adjoin p (f : t) =
let pz = Z.of_int p in
(* Horner's rule with x + s, on pairs (u, v) meaning u + v s *)
let u, v = Array.fold_right (fun c (u, v) ->
(* (u + v s)(x + s) + c = (x u + p v + c) + (u + x v) s *)
(add (add (shift u 1) (scale v pz)) (const c), add u (shift v 1))) f ([||], [||]) in
sub (mul u u) (scale (mul v v) pz)
let primes = [ 2; 3; 5; 7; 11; 13 ]
let swinnerton_dyer k = List.fold_left (fun f p -> adjoin p f) x (List.filteri (fun i _ -> i < k) primes)

The first five.

open Zpoly

Running it.

SD_1 = x^2 - 2
SD_2 = x^4 - 10x^2 + 1
SD_3 = x^8 - 40x^6 + 352x^4 - 960x^2 + 576
SD_4: degree 16, largest coefficient 13950764
SD_5: degree 32, largest coefficient 255690851718529024
§ 02

Irreducible over the integers

The roots of are the numbers , and each of them generates the field , which has degree over because square roots of distinct primes are linearly independent over the rationals[8]. A root therefore has a minimal polynomial of degree , which must be itself. The Galois group of this field is , each element flipping the signs of some of the square roots.

§ 03

Split modulo every prime

Modulo a prime not dividing the discriminant, the degrees of the irreducible factors of a polynomial are the cycle lengths of the Frobenius element of acting on its roots. Every element of has order 1 or 2, so every cycle has length 1 or 2, and every factor modulo has degree at most 2[2]. More concretely: contains a square root of every element of , so all roots of modulo lie in .

The degrees of the factors of SD₄ modulo small primes.

(* Degrees of the factors of SD_4, of degree 16, modulo the odd primes
below 60 that do not divide its discriminant. *)

Running it.

mod 11: 2 2 2 2 2 2 2 2
mod 13: 2 2 2 2 2 2 2 2
mod 17: 2 2 2 2 2 2 2 2
mod 19: 2 2 2 2 2 2 2 2
mod 23: 2 2 2 2 2 2 2 2
mod 29: 2 2 2 2 2 2 2 2
mod 31: 2 2 2 2 2 2 2 2
mod 37: 2 2 2 2 2 2 2 2
mod 41: 2 2 2 2 2 2 2 2
mod 47: 2 2 2 2 2 2 2 2
mod 53: 2 2 2 2 2 2 2 2
§ 04

The worst case for recombination

The Berlekamp–Zassenhaus algorithm factors modulo a prime, lifts, and tests subsets of the lifted factors for divisibility over the integers[7][1]. For an irreducible polynomial with modular factors, it tests subsets of up to half the factors before concluding that no proper subset gives a factor, some of them. For , for every prime, so the number of tests is doubly exponential in and exponential in the degree.

Running a Berlekamp–Zassenhaus factorizer on SD₂ to SD₅.

(* Zassenhaus's algorithm on SD_k: the number of modular factors and of
subsets tried before the polynomial is found to be irreducible. *)

Running it.

k degree prime modular factors subsets tried factors over Z
2 4 5 2 2 1
3 8 7 4 10 1
4 16 11 8 162 1
5 32 19 16 39202 1
1101001k10k100k2345number of square roots k (degree 2^k)count (log scale)subsets triedmodular factors
The number of modular factors doubles with each square root, and the number of subsets tested grows exponentially in it: from 162 for degree 16 to 39,202 for degree 32.

Kaltofen, Musser and Saunders generalized the construction to a wider class of polynomials that are hard for this approach[6]. Choosing the prime cleverly, or combining information from several primes, does not help, since every prime gives the same picture.

§ 05

Polynomial-time factoring

Lenstra, Lenstra and Lovász showed in 1982 that polynomials over the rationals can be factored in polynomial time, using lattice basis reduction to find a factor from a single modular factor lifted to high precision[4]. Their algorithm was slower than Berlekamp–Zassenhaus on typical inputs. Van Hoeij's algorithm of 2002 applies lattice reduction to the recombination problem itself, as a knapsack over traces of the modular factors, and handles Swinnerton-Dyer polynomials of high degree quickly; it is the method used in current computer algebra systems[5].

§ 06

History

Knuth's The Art of Computer Programming presents the polynomials, crediting Swinnerton-Dyer, as an example that defeats the heuristic of factoring modulo several primes and comparing the degrees of the factors[1]. The simplest polynomial with the same behaviour, , whose Galois group is also , had long been known to be irreducible over the integers and reducible modulo every prime[3]. Kaltofen, Musser and Saunders studied hard-to-factor classes in 1983[6], the LLL algorithm of 1982 made factoring polynomial in theory[4], and van Hoeij's 2002 algorithm made it fast in practice[5].

see also

referenced by

further reading

  1. [1]D. E. Knuth, The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, §4.6.2, Addison-Wesley (3rd ed., 1997).
  2. [2]J. von zur Gathen, J. Gerhard, Modern Computer Algebra, §15.3, Cambridge University Press (3rd ed., 2013).
  3. [3]E. R. Berlekamp, “Factoring polynomials over large finite fields”, Mathematics of Computation 24 (1970).
  4. [4]A. K. Lenstra, H. W. Lenstra, L. Lovász, “Factoring polynomials with rational coefficients”, Mathematische Annalen 261 (1982).
  5. [5]M. van Hoeij, “Factoring polynomials and the knapsack problem”, Journal of Number Theory 95 (2002).
  6. [6]E. Kaltofen, D. R. Musser, B. D. Saunders, “A generalized class of polynomials that are hard to factor”, SIAM Journal on Computing 12 (1983).
  7. [7]H. Zassenhaus, “On Hensel factorization, I”, Journal of Number Theory 1 (1969).
  8. [8]A. S. Besicovitch, “On the linear independence of fractional powers of integers”, Journal of the London Mathematical Society 15 (1940).

last updated