A String of Pearls: Proofs of Fermat's Little Theorem


  • Hing Lun Chan Australian National University
  • Michael Norrish NICTA, also Australian National University




number theory, automated reasoning


We discuss mechanised proofs of Fermat's Little Theorem in a variety of styles, focusing in particular on an elegant combinatorial ``necklace'' proof that has not been mechanised previously.
What is elegant in prose turns out to be long-winded mechanically, and so we examine the effect of explicitly appealing to group theory. This has pleasant consequences both for the necklace proof, and also for some of the direct number-theoretic approaches.



Andrea Asperti and Cristian Armentano. A page in number theory. Journal of Formal Reasoning, 1(1):1–23, 2008.


Peter G. Anderson, Arthur T. Benjamin, and Jeremy A. Rouse. Combinatorial proofs of Fermat’s, Lucas’s, and Wilson’s Theorems. The American Mathematical Monthly, 112(3):266–

, 2005.


Manindra Agrawal, Neeraj Kayal, and Nitin Saxena. PRIMES is in P. Annals of Mathematics, 160(2):781–793, 2004.


Bob Burn. Fermat’s Little Theorem: Proofs that Fermat might have used. The Mathematical Gazette, 86(507):415–422, November 2002.


Hing-Lun Chan and Michael Norrish. A String of Pearls: Proofs of Fermat’s Little Theorem. In Chris Hawblitzel and Dale Miller, editors, Proceedings of Certified Programs and Proofs,

number 7679 in LNCS, pages 188–207. Springer, December 2012.


Keith Conrad. Group actions. http://www.math.uconn.edu/˜kconrad/blurbs/grouptheory/gpaction.pdf, 2008.


Leonard Eugene Dickson. History of the Theory of Numbers: Volume 1: Divisibility and Primality. Carnegie Institution of Washington, 1919.


Solomon W. Golomb. Combinatorial proof of Fermat’s “Little” Theorem. The American Mathematical Monthly, 63(10):718, 1956.


Elsa. L. Gunter. Doing algebra in simple type theory. Technical Report MS-CIS-89-38, Department of Computer and Information Science, Moore School of Engineering,University of

Pennsylvania, June 1989.


John Harrison. HOL Light Tutorial (for version 2.20). Intel JF1-13, 2011. Section 18.2: Fermat’s Little Theorem.


Benjamin V. Holt and Tyler J. Evans. A group action proof of Fermat’s Little Theorem. http://arxiv.org/abs/math/0508396.


Joe Hurd, Mike Gordon, and Anthony Fox. Formalized elliptic curve cryptography. In High Confidence Software and Systems: HCSS 2006, April 2006.


Joe Hurd. Predicate subtyping with predicate sets. In Richard J. Boulton and Paul B. Jackson, editors, 14th International Conference on Theorem Proving in Higher Order Logics: TPHOLs

, volume 2152 of Lecture Notes in Computer Science, pages 265–280. Springer, September 2001.


Michael S. Mahoney. The Mathematical Career of Pierre de Fermat, 1601-1665. Princeton University Press, 1994.


David Marshell, Edward Odell, and Michael Starbird. Number Theory Through Inquiry. Mathematical Association of America Textbooks, 2006. Chapter 4: Fermat’s Little Theorem and

Euler’s Theorem.


Martijn Oostdijk. Library pocklington.fermat. http://coq.inria.fr/pylons/contribs/files/Pocklington.fermat.html.


Jeremy Rouse. Combinatorial proofs of congruences. Master’s thesis, Harvey Mudd College, 2003.


David Russinoff. ACL2 Version 3.2 source: books/quadratic-reciprocity/fermat.lisp, 2007.


Edward Sandifer. How Euler Did It: Fermat’s Little Theorem. MAA Online, November 2003.


Chris J. Smyth. A coloring proof of a generalisation of Fermat’s Little Theorem. The American Mathematical Monthly, 93(6):469–471, 1986.


Konrad Slind and Michael Norrish. A brief overview of HOL4. In Otmane Ait Mohamed, César Mu˜ noz, and Sofiène Tahar, editors, Theorem Proving in Higher Order Logics, 21st International Conference, volume 5170 of Lecture Notes in Computer Science, pages 28–32. Springer, 2008.


André Weil. Number Theory: An Approach Through History from Hammurapi to Legendre. Birkhäuser Boston, 1984.


Wikipedia: Proofs of Fermat’s Little Theorem. http://en.wikipedia.org/wiki/Proofs_of_Fermat’s_little_theorem.




How to Cite

Chan, H. L., & Norrish, M. (2013). A String of Pearls: Proofs of Fermat’s Little Theorem. Journal of Formalized Reasoning, 6(1), 63–87. https://doi.org/10.6092/issn.1972-5787/3728