Verification of the Miller-Rabin probabilistic primality test

Abstract Using the HOL theorem prover, we apply our formalization of probability theory to specify and verify the Miller–Rabin probabilistic primality test. The version of the test commonly found in algorithm textbooks implicitly accepts probabilistic termination, but our own verified implementation satisfies the stronger property of guaranteed termination. Completing the proof of correctness requires a significant body of group theory and computational number theory to be formalized in the theorem prover. Once verified, the primality test can either be executed in the logic (using rewriting) and used to prove the compositeness of numbers, or manually extracted to standard ML and used to find highly probable primes.

[1]  Joe Hurd Predicate Subtyping with Predicate Sets , 2001, TPHOLs.

[2]  Joe Hurd,et al.  Formal verification of probabilistic algorithms , 2003 .

[3]  J. S. Moore,et al.  Proof Checking The RSA Public Key Encryption Algorithm , 1984 .

[4]  Vincent Zammit On the readability of machine checkable formal proofs , 1999 .

[5]  Joe Hurd Lightweight probability theory for verification , 2001 .

[6]  David M. Russinoff An experiment with the Boyer-Moore theorem prover: A proof of Wilson's theorem , 1985, Journal of Automated Reasoning.

[7]  A. Paz Probabilistic algorithms , 2003 .

[8]  Gary L. Miller,et al.  Riemann's Hypothesis and tests for primality , 1975, STOC.

[9]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[10]  A. Baker,et al.  A concise introduction to the theory of numbers , 1984 .

[11]  Godfrey H. Hardy,et al.  A mathematician's apology , 1941 .

[12]  Donald E. Knuth,et al.  The art of computer programming. Vol.2: Seminumerical algorithms , 1981 .

[13]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[14]  Florian Kammüller,et al.  A Formal Proof of Sylow's Theorem An Experiment in Abstract Algebra with Isabelle HOL , 1998 .

[15]  E. Gunter Doing Algebra in Simple Type Theory , 1989 .

[16]  Olga Caprotti,et al.  Formal and Efficient Primality Proofs by Use of Computer Algebra Oracles , 2001, J. Symb. Comput..

[17]  Florian Kammüller,et al.  A Formal Proof of Sylow's Theorem , 1999, Journal of Automated Reasoning.

[18]  E. Berlekamp Factoring polynomials over large finite fields* , 1971, SYMSAC '71.

[19]  Annabelle McIver,et al.  Probabilistic predicate transformers , 1996, TOPL.

[20]  Joseph F. Traub,et al.  Algorithms and Complexity: New Directions and Recent Results , 1976 .

[21]  Walter L. Smith Probability and Statistics , 1959, Nature.

[22]  Donald E. Knuth The Art of Computer Programming 2 / Seminumerical Algorithms , 1971 .

[23]  Bruno Barras Programming and Computing in HOL , 2000, TPHOLs.

[24]  Volker Strassen,et al.  A Fast Monte-Carlo Test for Primality , 1977, SIAM J. Comput..