Journal of Automated Reasoning

, Volume 43, Issue 3, pp 243–261 | Cite as

Formalizing an Analytic Proof of the Prime Number Theorem

  • John HarrisonEmail author


We describe the computer formalization of a complex-analytic proof of the Prime Number Theorem (PNT), a classic result from number theory characterizing the asymptotic density of the primes. The formalization, conducted using the HOL Light theorem prover, proceeds from the most basic axioms for mathematics yet builds from that foundation to develop the necessary analytic machinery including Cauchy’s integral formula, so that we are able to formalize a direct, modern and elegant proof instead of the more involved ‘elementary’ Erdös-Selberg argument. As well as setting the work in context and describing the highlights of the formalization, we analyze the relationship between the formal proof and its informal counterpart and so attempt to derive some general lessons about the formalization of mathematics.


Analytic proof Prime number theorem Computer formalization 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Agrawal, M., Kayal, N., Saxena, N.: PRIMES is in P. Ann. Math. 160, 781–793 (2004)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Avigad, J., Donnelly, K.: Formalizing O notation in Isabelle/HOL. In: Basin D., Rusinowitsch M. (eds.) Proceedings of the Second International Joint Conference on Automated Reasoning. Lecture Notes in Computer Science, vol. 3097, pp. 357–371. Springer, Cork (2004)Google Scholar
  3. 3.
    Avigad, J., Donnelly, K., Gray, D., Raff, P.: A formally verified proof of the prime number theorem. Acm Trans. Comput. Log. 9(1:2), 1–23 (2007)MathSciNetGoogle Scholar
  4. 4.
    Bak, J. Newman, D.J.: Complex Analysis. Springer, New York (1997)zbMATHGoogle Scholar
  5. 5.
    Boulton, R., Gordon, A., Gordon, M., Harrison, J., Herbert, J., Van Tassel, J.: Experience with embedding hardware description languages in HOL. In: Stavridou, V., Melham, T.F., Boute, R.T. (eds.) Proceedings of the IFIP TC10/WG 10.2 International Conference on Theorem Provers in Circuit Design: Theory, Practice and Experience. IFIP Transactions A: Computer Science and Technology, vol. A-10, pp. 129–156. North-Holland, Nijmegen (1993)Google Scholar
  6. 6.
    Conway, J. Kochen, S.: The free will theorem. Found. Phys. 36, 1441 (2006)Google Scholar
  7. 7.
    Davis, M.: Obvious logical inferences. In: Hayes, P.J. (ed.) Proceedings of the Seventh International Joint Conference on Artificial Intelligence, pp. 530–531. Kaufmann, Ingolstadt (1981)Google Scholar
  8. 8.
    Gordon, M.J.C.: Representing a logic in the LCF metalanguage. In: Néel, D. (ed.) Tools and Notions for Program Construction: An Advanced Course, pp. 163–185. Cambridge University Press, Cambridge (1982)Google Scholar
  9. 9.
    Gordon, M.J.C., Melham, T.F.: Introduction to HOL: A Theorem Proving Environment for Higher Order Logic. Cambridge University Press, Cambridge (1993)zbMATHGoogle Scholar
  10. 10.
    Gordon, M.J.C., Milner, R., Wadsworth, C.P.: Edinburgh LCF: A Mechanised Logic of Computation. Lecture Notes in Computer Science, vol. 78. Springer, Cambridge (1979)Google Scholar
  11. 11.
    Harrison, J.: Constructing the real numbers in HOL. In: Claesen, L.J.M., Gordon, M.J.C. (eds.) Proceedings of the IFIP TC10/WG10.2 International Workshop on Higher Order Logic Theorem Proving and its Applications. IFIP Transactions A: Computer Science and Technology, vol. A-20, pp. 145–164. IMEC, Leuven (1992)Google Scholar
  12. 12.
    Harrison, J.: Theorem Proving with the Real Numbers. Springer, New York (1998) (Revised version of author’s PhD thesis)zbMATHGoogle Scholar
  13. 13.
    Harrison, J.: Formal verification of floating point trigonometric functions. In: Hunt, W.A., Johnson, S.D. (eds.) Formal Methods in Computer-Aided Design: Third International Conference FMCAD 2000. Lecture Notes in Computer Science, vol. 1954, pp. 217–233. Springer, New York (2000)Google Scholar
  14. 14.
    Harrison, J.: Complex quantifier elimination in HOL. In: Boulton, R.J., Jackson, P.B. (eds.) TPHOLs 2001: Supplemental Proceedings, pp. 159–174. Division of Informatics, University of Edinburgh. Published as Informatics Report Series EDI-INF-RR-0046. (2001)
  15. 15.
    Harrison, J.: Isolating critical cases for reciprocals using integer factorization. In: Bajard, J.-C., Schulte, M. (eds.) Proceedings, 16th IEEE Symposium on Computer Arithmetic, pp. 148–157. Santiago de Compostela, Spain. IEEE Computer Society, Los Alamitos (2003) (
  16. 16.
    Harrison, J.: A HOL theory of Euclidean space. In: Hurd, J., Melham, T. (eds.) Theorem Proving in Higher Order Logics, 18th International Conference, TPHOLs 2005. Lecture Notes in Computer Science, vol. 3603, pp. 114–129. Springer, Oxford (2005)Google Scholar
  17. 17.
    Harrison, J.: The HOL light tutorial. (2006)
  18. 18.
    Harrison, J.: Formalizing basic complex analysis. In: Matuszewski, R., Zalewska, A. (eds.) From Insight to Proof: Festschrift in Honour of Andrzej Trybulec. Studies in Logic, Grammar and Rhetoric, vol. 10(23), pp. 151–165. University of Białystok, Białystok (2007)Google Scholar
  19. 19.
    Ingham, A.E.: The Distribution of Prime Numbers. Cambridge University Press, Cambridge (1932)Google Scholar
  20. 20.
    Jameson, G.J.O.: The Prime Number Theorem. London Mathematical Society Student Texts, vol. 53. Cambridge University Press, Cambridge (2003)Google Scholar
  21. 21.
    Newman, D.J.: Analytic Number Theory. Graduate Texts in Mathematics, vol. 177. Springer, New York (1998)zbMATHGoogle Scholar
  22. 22.
    Rudnicki, P.: Obvious inferences. J. Autom. Reason. 3, 383–393 (1987)zbMATHCrossRefMathSciNetGoogle Scholar
  23. 23.
    Tenenbaum, G., France, M.M.: The Prime Numbers and Their Distribution. Student Mathematical Library, vol. 6. American Mathematical Society, Providence (2000) (Translation by Philip G. Spain, from French original “Nombres premiers”, Presses Universitaires de France, 1997.)Google Scholar
  24. 24.
    Théry, L., Hanrot, G.: Primality proving with elliptic curves. In: Schneider, K., Brandt, J. (eds.) Proceedings of the 20th International Conference on Theorem Proving in Higher Order Logics, TPHOLs 2007. Lecture Notes in Computer Science, vol. 4732, pp. 319–333. Springer, Kaiserslautern (2007)CrossRefGoogle Scholar
  25. 25.
    Wiedijk, F.: The de Bruijn factor. (2000)
  26. 26.
    Wiedijk, F.: The seventeen provers of the world. In: Lecture Notes in Computer Science, vol. 3600. Springer, New York (2006)Google Scholar
  27. 27.
    Wos, L., Pieper, G.W.: A Fascinating Country in the World of Computing: Your Guide to Automated Reasoning. World Scientific, Singapore (1999)zbMATHGoogle Scholar
  28. 28.
    Zagier, D.: Newman’s short proof of the prime number theorem. Am. Math. Mon. 104, 705–708 (1997)zbMATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer Science+Business Media B.V. 2009

Authors and Affiliations

  1. 1.Intel CorporationHillsboroUSA

Personalised recommendations