algorithms for primes d j bernstein university of
play

Algorithms for primes D. J. Bernstein University of Illinois at - PDF document

Algorithms for primes D. J. Bernstein University of Illinois at Chicago Some literature: Recognizing primes: 1982 AtkinLarson On a primality test of Solovay and Strassen; 1995 Atkin Intelligent primality test offer Proving


  1. Algorithms for primes D. J. Bernstein University of Illinois at Chicago Some literature: Recognizing primes: 1982 Atkin–Larson “On a primality test of Solovay and Strassen”; 1995 Atkin “Intelligent primality test offer”

  2. Proving primes to be prime: 1993 Atkin–Morain “Elliptic curves and primality proving” Factoring integers into primes: 1993 Atkin–Morain “Finding suitable curves for the elliptic curve method of factorization” Enumerating small primes: 2004 Atkin–Bernstein “Prime sieves using binary quadratic forms”

  3. Recognizing primes Fermat: ✇ ✷ Z , prime ♥ ✷ Z ✮ ✇ ♥ � ✇ = 0 in Z ❂♥ . e.g. Fast proof of compositeness of ♥ = 314159265358979323: in Z ❂♥ compute 2 ♥ � 2 = 198079119221837430 ✻ = 0.

  4. Recognizing primes Fermat: ✇ ✷ Z , prime ♥ ✷ Z ✮ ✇ ♥ � ✇ = 0 in Z ❂♥ . e.g. Fast proof of compositeness of ♥ = 314159265358979323: in Z ❂♥ compute 2 ♥ � 2 = 198079119221837430 ✻ = 0. “Carmichael numbers” are composites that cannot be proven composite this way. 1994 Alford–Granville–Pomerance: # ❢ Carmichael numbers ❣ = ✶ .

  5. Refined Fermat: ✇ ✷ Z , prime ♥ ✷ 1 + 2 Z ✮ ✇ = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 2 + 1 = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 2 � 1 = 0 in Z ❂♥ . Proof: ✇ ♥ � ✇ = ✇ ( ✇ ♥ � 1 � 1) = ✇ ( ✇ ( ♥ � 1) ❂ 2 + 1)( ✇ ( ♥ � 1) ❂ 2 � 1).

  6. Doubly refined Fermat: ✇ ✷ Z , prime ♥ ✷ 1 + 4 Z ✮ ✇ = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 2 + 1 = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 4 + 1 = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 4 � 1 = 0 in Z ❂♥ . Proof: ✇ ♥ � ✇ = ✇ ( ✇ ♥ � 1 � 1) = ✇ ( ✇ ( ♥ � 1) ❂ 2 + 1)( ✇ ( ♥ � 1) ❂ 2 � 1); = ✇ ( ✇ ( ♥ � 1) ❂ 2 + 1) ( ✇ ( ♥ � 1) ❂ 4 +1)( ✇ ( ♥ � 1) ❂ 4 � 1).

  7. 1966 Artjuhov: ✇ ✷ Z , prime ♥ ✷ 1 + 2 ✉ + 2 ✉ +1 Z ✮ ✇ = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 2 + 1 = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 4 + 1 = 0 in Z ❂♥ . . . or ✇ ( ♥ � 1) ❂ 2 ✉ + 1 = 0 in Z ❂♥ or ✇ ( ♥ � 1) ❂ 2 ✉ � 1 = 0 in Z ❂♥ . e.g. Proof that 2821 is not prime: in Z ❂ 2821 have 2 1410 + 1 = 1521; 2 705 + 1 = 2606; 2 705 � 1 = 2604.

  8. Non-prime ♥ ✷ 1 + 2 Z ✮ uniform random ✇ ✷ ❢ 1 ❀ 2 ❀ ✿ ✿ ✿ ❀ ♥ � 1 ❣ has ✕ 75% chance to prove ♥ non-prime by this test. Try ❞ lg ♥ ❡ choices of ✇ . Conjecture: If this doesn’t prove ♥ non-prime then ♥ is prime. Messy history: Dubois, Selfridge, Miller, Rabin, Lehmer, Solovay– Strassen, Monier, Atkin–Larson.

  9. Time (lg ♥ ) 3+ ♦ (1) for (lg ♥ ) 1+ ♦ (1) exponentiations. Can we do better? ✝ ♣ lg ♥ ✞ e.g. Only choices of ✇ ?

  10. Time (lg ♥ ) 3+ ♦ (1) for (lg ♥ ) 1+ ♦ (1) exponentiations. Can we do better? ✝ ♣ lg ♥ ✞ e.g. Only choices of ✇ ? No! There are too many ♥ ’s that have too many failing ✇ ’s. e.g. 1982 Atkin–Larson: If 4 ❦ + 3 ❀ 8 ❦ + 5 are prime then ♥ = (4 ❦ + 3)(8 ❦ + 5) has (2 ❦ + 1)(4 ❦ + 2) failing ✇ ’s.

  11. Do better by extending Z ❂♥ ? Main credits: Lucas, Selfridge. e.g. Prime ♥ ✷ 1 + 2 Z , ✇ ✷ Z , ✇ 2 � 4 has Jacobi symbol � 1 in Z ❂♥ ✮ t ( ♥ +1) ❂ 2 ✷ ❢ 1 ❀ � 1 ❣ in ( Z ❂♥ )[ t ] ❂ ( t 2 � ✇t + 1). Proof: ❦ = ( Z ❂♥ )[ t ] ❂ ( t 2 � ✇t + 1) is a field. In ❦ [ ✉ ] have ✉ 2 � ✇✉ + 1 = ( ✉ � t )( ✉ � t ♥ ) so in ❦ have t ♥ +1 = 1.

  12. Geometric view: group scheme ● ( ①❀ ② ) : ① 2 � ✇①② + ② 2 = 1 ✟ ✠ = ; addition of ( ①❀ ② ) induced by mult of ② + ①t modulo t 2 � ✇t +1. ✇ 2 � 4 has Jacobi symbol � 1 so # ● ( Z ❂♥ ) = ♥ + 1 so ( ♥ + 1)(1 ❀ 0) = (0 ❀ 1) in ● ( Z ❂♥ ). Faster than ( Z ❂♥ ) ✄ ? No. More reliable than ( Z ❂♥ ) ✄ ?

  13. Geometric view: group scheme ● ( ①❀ ② ) : ① 2 � ✇①② + ② 2 = 1 ✟ ✠ = ; addition of ( ①❀ ② ) induced by mult of ② + ①t modulo t 2 � ✇t +1. ✇ 2 � 4 has Jacobi symbol � 1 so # ● ( Z ❂♥ ) = ♥ + 1 so ( ♥ + 1)(1 ❀ 0) = (0 ❀ 1) in ● ( Z ❂♥ ). Faster than ( Z ❂♥ ) ✄ ? No. More reliable than ( Z ❂♥ ) ✄ ? No. Easily construct many ♥ that have many bad ✇ .

  14. Try another group scheme? e.g. ❊ : ① 2 + ② 2 = 1 � 30 ① 2 ② 2 . Main obstacle: Find # ❊ ( Z ❂♥ ), assuming that ♥ is prime. 1986 Chudnovsky–Chudnovsky, 1987 Gordon: Build ❊ here using CM with class number 1. Faster than ( Z ❂♥ ) ✄ ? No. More reliable than ( Z ❂♥ ) ✄ ?

  15. Try another group scheme? e.g. ❊ : ① 2 + ② 2 = 1 � 30 ① 2 ② 2 . Main obstacle: Find # ❊ ( Z ❂♥ ), assuming that ♥ is prime. 1986 Chudnovsky–Chudnovsky, 1987 Gordon: Build ❊ here using CM with class number 1. Faster than ( Z ❂♥ ) ✄ ? No. More reliable than ( Z ❂♥ ) ✄ ? No. Easily construct many “elliptic pseudoprimes.”

  16. 1980 Baillie–Wagstaff, 1980 Pomerance–Selfridge–Wagstaff: One ① 2 � ✇①② + ② 2 = 1 test plus one ( Z ❂♥ ) ✄ exponentiation. Time (lg ♥ ) 2+ ♦ (1) . Much more reliable than two ( Z ❂♥ ) ✄ exponentiations! $620 for a counterexample, i.e., a non-proved non-prime.

  17. 1995 Atkin: one ( Z ❂♥ ) ✄ exponentiation plus one ① 2 � ✇①② + ② 2 = 1 test plus one cubic test. $2500 for a counterexample. Bad news: There should be infinitely many counterexamples to the 1980 tests (1984 Pomerance, adapting heuristic from 1956 Erd˝ os) and to Atkin’s test.

  18. Conjecture (new?): Continuing this series becomes perfectly reliable after only (lg ♥ ) ♦ (1) tests. Resulting algorithm determines primality of ♥ in time (lg ♥ ) 2+ ♦ (1) .

  19. Conjecture (new?): Continuing this series becomes perfectly reliable after only (lg ♥ ) ♦ (1) tests. Resulting algorithm determines primality of ♥ in time (lg ♥ ) 2+ ♦ (1) . To optimize ♦ (1): replace high-degree extensions with many elliptic curves.

  20. 1956 Erd˝ os heuristic: For each prime divisor ♣ of ♥ : Force frequent ✇ ♥ � 1 = 1 in Z ❂♣ by forcing ♥ � 1 ✷ ( ♣ � 1) Z or maybe ♥ � 1 ✷ (( ♣ � 1) ❂ 2) Z ✿ ✿ ✿

  21. 1956 Erd˝ os heuristic: For each prime divisor ♣ of ♥ : Force frequent ✇ ♥ � 1 = 1 in Z ❂♣ by forcing ♥ � 1 ✷ ( ♣ � 1) Z or maybe ♥ � 1 ✷ (( ♣ � 1) ❂ 2) Z ✿ ✿ ✿ “Chance” ✙ 1 ❂ lcm ❢ ♣ � 1 ❣ .

  22. 1956 Erd˝ os heuristic: For each prime divisor ♣ of ♥ : Force frequent ✇ ♥ � 1 = 1 in Z ❂♣ by forcing ♥ � 1 ✷ ( ♣ � 1) Z or maybe ♥ � 1 ✷ (( ♣ � 1) ❂ 2) Z ✿ ✿ ✿ “Chance” ✙ 1 ❂ lcm ❢ ♣ � 1 ❣ . Force small lcm by restricting to primes ♣ with ♣ � 1 = ◗ subset of ◗ 1 , where ◗ 1 is set of small primes.

  23. 1984 Pomerance heuristic: Choose disjoint ◗ 1 ❀ ◗ 2 . Restrict to primes ♣ with ♣ � 1 = ◗ subset of ◗ 1 and ♣ + 1 = ◗ subset of ◗ 2 . Build ♥ from these primes ♣ . Large chance that ♥ � 1 ✷ ( ♣ � 1) Z for all ♣ and ♥ + 1 ✷ ( ♣ + 1) Z for all ♣ .

  24. Obvious extension: Can similarly fool t tests starting with ◗ 1 ❀ ◗ 2 ❀ ✿ ✿ ✿ ❀ ◗ t . ✿ ✿ ✿ but quantitative analysis, generalizing Pomerance analysis, suggests that smallest ♥ is doubly exponential in t , i.e., t ✷ ❖ (lg lg ♥ ). My conjecture: t ✷ (lg ♥ ) ♦ (1) .

  25. Interlude: Building ❊ by CM How quickly can we build t elliptic curves ❊ with known # ❊ ( Z ❂♥ ), assuming ♥ is prime? (Maybe best: 4 extensions and t � 4 elliptic curves.) Assume t ✔ (lg ♥ ) 0 ✿ 3 . Compare to ECPP situation: t ✷ (lg ♥ ) 1+ ♦ (1) to find near-prime order.

  26. Adapting idea of FastECPP (1990 Shallit): Compute square roots of ❢ 1 ❀ 2 ❀ ✿ ✿ ✿ ❀ ❜ t 1 ❂ 2 ❝❣ in Z ❂♥ . Time t 1 ❂ 2 (lg ♥ ) 2+ ♦ (1) . (Surely t 1 ❂ 2 isn’t optimal.) Multiply to obtain square roots of all t 1 ❂ 2 -smooth discriminants ✔ t 2 . Time t 2 (lg ♥ ) 1+ ♦ (1) .

  27. Apply Cornacchia. Time t 2 (lg ♥ ) 1+ ♦ (1) . Now have ✙ t CM discriminants for ♥ , assuming standard heuristics. If ❁ t : tweak “ ✔ t 2 .” Find the curves by fast CM: t 2 (lg ♥ ) 1+ ♦ (1) + t (lg ♥ ) 2+ ♦ (1) ? Latest news: 2010.09 Sutherland.

  28. Proving primes to be prime ECPP finds proof of primality in conjectured time (lg ♥ ) 5+ ♦ (1) . FastECPP: (lg ♥ ) 4+ ♦ (1) . (1990 Shallit) Verifying proof: time (lg ♥ ) 3+ ♦ (1) . Current project, Bernstein– Lange–Peters–Swart: Accelerate (and simplify!) verification. (lg ♥ ) 3+ ♦ (1) , but better ♦ (1).

  29. Standard proof structure: elliptic curve ❊ over Z ❂♥ ; point ❲ ✷ ❊ ( Z ❂♥ ) of prime order q ❃ ( ♥ 1 ❂ 4 + 1) 2 ; recursive proof that q is prime. Verifier checks that q❲ = 0 in ❊ ( Z ❂♥ ) (so q❲ = 0 in each ❊ ( Z ❂♣ )); that ❲ is “stably nonzero” (so ❲ ✻ = 0 in each ❊ ( Z ❂♣ )); that q ❃ ( ♥ 1 ❂ 4 + 1) 2 ; and that q is prime.

  30. Bad news, part 1: Findable q ’s are close to ♥ , so recursion has many levels. Bad news, part 2: Arithmetic in ❊ ( Z ❂♥ ) is slow! Engineer’s defn of ❊ ( Z ❂♥ ) (e.g., 1986 Goldwasser–Kilian) computes gcd at each step.

Recommend


More recommend