Fermat's little theorem, Euler's theorem, and Wilson's theorem
Anchor (Master): Fermat 1640 letter to Frénicle de Bessy (originator, no proof); Euler 1736 *Comm. Acad. Sci. Petrop.* 8 (first proof of FLT) and 1763 *Novi Comm. Acad. Sci. Petrop.* 8 (totient version); Lagrange 1771 *Nouv. Mém. Acad. Berlin* 2 (first proof of Wilson); Gauss 1801 *Disquisitiones Arithmeticae* arts. 50-83 (canonical modern formulation); Hardy-Wright 2008 6e §VI; Carmichael 1910 *Bull. AMS* 16; Alford-Granville-Pomerance 1994 *Annals* 140; Agrawal-Kayal-Saxena 2004 *Annals* 160 (PRIMES is in P)
Intuition Beginner
A surprising regularity in modular arithmetic: whenever you raise a number to a carefully chosen power and then read the answer modulo a prime, you always land on . This is Fermat's little theorem, discovered by Pierre de Fermat in 1640. For a prime and any integer that is not a multiple of , raising to the power and reading the answer modulo gives — every time, without exception.
The cleanest illustration uses . Take . Fermat predicts . Compute: ; (since ); . The theorem holds. Try : , , . Still works. The pattern is universal for every nonzero residue.
Euler's theorem is the generalisation to composite moduli. For an arbitrary positive integer , write for the count of integers in that share no common factor with . The function is the Euler totient introduced in 21.01.03. Then for every integer coprime to , . The prime case recovers Fermat: , so Euler's theorem specialises to .
A second surprise, due to John Wilson 1770 and proved by Joseph-Louis Lagrange 1771: the product of all integers from to — what is called — leaves remainder when divided by , whenever is prime. For : . For : . Wilson's theorem is even more striking because the converse also holds: if , then must be prime. So Wilson gives an exact primality criterion — at least in principle.
The applied importance of these theorems is hard to overstate. Every secure web connection routes through Euler's theorem. The RSA cryptosystem, invented by Rivest-Shamir-Adleman in 1978, encrypts a message by computing where is the product of two large primes. The decryption works because , so by Euler — without the theorem, RSA would not exist. Primality testing — the Fermat test, Miller-Rabin, AKS — also begins with Fermat's little theorem as the entry point: if for some coprime to , then is composite.
Visual Beginner
A picture of a circular clock with positions, labelled through . Six arrows trace the orbit of under repeated multiplication modulo : at position ; at position ; at position ; at position ; at position ; at position . The orbit visits every nonzero position exactly once and returns to after steps. The arrow from to closes the loop.
The picture captures the central fact. The nonzero residues modulo a prime form a cyclic structure under multiplication, and any element raised to the size of that structure returns to the identity . The visualised orbit of modulo has length exactly , but for some elements the orbit is shorter: modulo has orbit length (since ), and the orbit length always divides . The theorem is the rigorous statement of this cyclic-return phenomenon.
Worked example Beginner
Compute modulo and verify Fermat's little theorem for , .
Step 1. Fermat predicts , because is prime and .
Step 2. Compute the powers of modulo by successive squaring: ; ; .
Step 3. Combine: .
Step 4. The prediction is confirmed: , so as Fermat said.
What this tells us: once we know Fermat's little theorem, we never need to compute directly to know its residue modulo — the answer is by the theorem alone. The same principle lets us compute modulo at a glance: , so . Modular exponentiation collapses to almost nothing once the cyclic-return structure is known.
Check your understanding Beginner
Formal definition Intermediate+
The Fermat-Euler-Wilson theorems live inside the unit-group structure of developed in 21.01.03. We restate the definitions in their canonical form and then prove the three signature theorems.
Definition (order of an element). Let be a finite group with identity and let . The order of , written , is the least positive integer such that . Such a exists because is finite (the powers cannot all be distinct, so some with gives ). The order divides every with .
Definition (Euler totient ). For ,
$$
\varphi(n) ;=; # {, a \in {1, 2, \ldots, n} : \gcd(a, n) = 1 ,} ;=; #(\mathbb{Z}/n\mathbb{Z})^\times.
$$
By 21.01.03 Theorem 2, is multiplicative on coprime arguments ( for ), satisfies on prime powers, and has the closed form .
Definition (Carmichael function ). The exponent of the group — the least positive integer such that for every coprime to — is denoted and called the Carmichael function. It always divides , with equality if and only if is cyclic, which happens precisely for with an odd prime [Carmichael 1910].
Counterexamples to common slips
"Fermat's little theorem holds for every integer , including multiples of ." The statement requires . The case gives , not . The unrestricted form (which both forms imply for ) does cover ().
"Euler's theorem applies to every modulus the same way." The exponent is the group order, not necessarily the group exponent. For , but : every coprime to satisfies , a strict refinement of . The tight bound is , not ; this matters for cryptographic key-strength estimates.
"Wilson's theorem extends to composite moduli as ." False — and decisively so. For composite , : the factors contain both factors of any non-degenerate factorisation with (with separable for ; the case is the lone exception). The converse — if then is prime — is a genuine primality criterion.
Key theorem with proof Intermediate+
The signature theorem of this unit is Fermat's little theorem in its modern group-theoretic form. We give the proof via Lagrange's theorem applied to , and then deduce Euler's and Wilson's theorems as direct consequences.
Theorem (Fermat's little theorem). Let be a prime and an integer with . Then . Equivalently, for every integer .
Proof. The set of nonzero residues modulo is a group under multiplication, with identity and order (every nonzero residue is a unit because is prime; this is the field property of from 21.01.03).
Since , the residue lies in . By Lagrange's theorem on finite groups (proved in 01.02.01), the order of any element divides the order of the group:
$$
\mathrm{ord}([a]_p) ;\big|; #(\mathbb{Z}/p\mathbb{Z})^\times = p - 1.
$$
Writing for some positive integer :
$$
[a]_p^{p-1} ;=; \left([a]_p^{\mathrm{ord}([a]_p)}\right)^k ;=; [1]_p^k ;=; [1]_p.
$$
Hence .
To extend to the form for every integer : if , multiply both sides of by to get . If , then , so both and are .
Bridge. Fermat's little theorem builds toward 21.01.05 primitive roots, where the cyclic structure of is sharpened to the existence of an element of order exactly — the order-divides-group-order fact above promoted to an order-equals-group-order witness. The central insight is exactly that the multiplicative cyclic structure of nonzero residues modulo a prime is the operational content of the field property of ; this is the bridge from elementary number theory to 01.02.18 pending finite fields and Frobenius. The pattern generalises: replacing by an arbitrary integer and by gives Euler's theorem; replacing by the group exponent gives the tight Carmichael refinement; identifying the orbit of in with the action of the Frobenius on identifies Fermat's theorem with the splitting structure of finite Galois extensions. The same identification appears again in 01.02.18 pending as the statement that fixes pointwise. Putting these together with Lagrange and the order-divides-group-order pattern, Fermat is the prototype of every "group acting by multiplication has finite orbits of divisor length" theorem in algebra.
Exercises Intermediate+
Lean formalization Intermediate+
Mathlib supplies all three signature theorems and the operative supporting machinery. The Lean module Codex.NumberTheory.Elementary.FermatEulerWilson would package the unit's identifications alongside the standard Mathlib API.
-- Operative imports: Mathlib.Data.ZMod.Basic, Mathlib.Data.Nat.Totient,
-- Mathlib.NumberTheory.LucasLehmer, Mathlib.NumberTheory.Wilson,
-- Mathlib.GroupTheory.OrderOfElement, Mathlib.RingTheory.Polynomial.Cyclotomic.Basic
#check @ZMod.pow_card_sub_one_eq_one
-- Fermat's little theorem: for p prime, a : ZMod p with a ≠ 0 satisfies a^(p - 1) = 1.
#check @ZMod.pow_card
-- The unrestricted form: a^p ≡ a (mod p) for every integer a.
#check @ZMod.pow_totient
-- Euler's theorem: for n : ℕ with Coprime a n, a^(Nat.totient n) ≡ 1 (mod n).
#check @ZMod.wilsons_lemma
-- Wilson's theorem: for p prime, (p - 1)! ≡ -1 (mod p).
#check @Nat.totient
-- The Euler totient function, defined as the cardinality of the unit group.
#check @Nat.totient_prime_pow
-- φ(p^k) = p^(k - 1) * (p - 1) for p prime and k ≥ 1.
#check @orderOf_dvd_card
-- The general Lagrange-consequence: orderOf g divides Fintype.card G in a finite group.The Fermat-Euler-Wilson trio in Mathlib rests on orderOf_dvd_card — the Lagrange-theorem consequence that the order of any element divides the group order. The polynomial-identity proof of Wilson is ZMod.wilsons_lemma and rests on the factorisation in . What Mathlib does not yet supply as a unified module — the Carmichael function with explicit prime-power formula, Korselt's criterion, the smallest Carmichael number , the Miller-Rabin and AKS primality tests, and Gauss's generalised Wilson product — is the formalisation target documented in the unit metadata Mathlib gap analysis.
Advanced results Master
Theorem 1 (combinatorial / necklace proof of Fermat's little theorem). For prime and any integer , the number of distinct necklaces of length over an alphabet of letters is , hence divides . The count: there are words of length ; the cyclic group acts by rotation; orbits of monochromatic words have size (there are of these), and orbits of non-monochromatic words have size dividing , hence equal to (since is prime). So is divisible by . The argument generalises to Burnside-counting orbits of any prime-power group action; see Hardy-Wright 2008 §6.3 [Hardy-Wright 2008]. The combinatorial proof predates Euler's algebraic proof and is the natural argument for -adic-flavoured generalisations.
Theorem 2 (Euler's induction proof of Fermat). Fermat's little theorem in the form follows by induction on using [Euler 1736]. The induction step uses the freshman's dream: in , , because every middle binomial coefficient for is divisible by (the formula contains in the numerator with no compensating factor in the denominator). Iterating from the base case gives for every positive integer . Euler 1736 Comm. Acad. Sci. Petrop. 8 published this as the first proof of Fermat's little theorem; the freshman's-dream identity is also the operational content of the Frobenius endomorphism , , being a ring homomorphism — the bridge to 01.02.18 pending finite fields.
Theorem 3 (Carmichael function and its prime-power formula). The Carmichael function , the exponent of , has values , , for , for an odd prime, and for . [Carmichael 1910]. Always , with equality if and only if is cyclic, which characterises for an odd prime. The Carmichael function is the tight exponent in Euler's theorem: for every coprime to , and is the least such integer. RSA security depends on , not : the private exponent satisfies as the necessary condition, with for .
Theorem 4 (Korselt's criterion and Carmichael numbers; Korselt 1899, Alford-Granville-Pomerance 1994). A composite integer is a Carmichael number (satisfying for every coprime to ) if and only if is squarefree and for every prime dividing [Korselt 1899]. The smallest Carmichael number is : squarefree, and , , . The next few are , (Ramanujan's taxicab), . Alford-Granville-Pomerance 1994 Annals 140, 703 [Alford-Granville-Pomerance 1994] proved the count of Carmichael numbers up to satisfies , settling Carmichael's 1912 conjecture. Carmichael numbers are precisely the composite false-positives of the Fermat primality test, motivating the strong-pseudoprime refinement of Miller-Rabin.
Theorem 5 (Miller-Rabin probabilistic primality test; Miller 1976, Rabin 1980). Let with odd. A composite is called a strong pseudoprime to base if or for some . For every composite , at most of bases are strong-pseudoprime witnesses [Rabin 1980]. The Miller-Rabin algorithm: for randomly chosen bases , declare "probably prime" if every is a strong-pseudoprime witness; declare composite otherwise. The false-positive probability is for composite inputs. With , the false-positive rate is below — well below cosmic-ray bit-flip error rates. Standard library implementations (OpenSSL, GMP, Java's BigInteger.isProbablePrime) use Miller-Rabin with ranging from to for RSA key generation. Miller 1976 originally proved a deterministic variant assuming the generalised Riemann hypothesis.
Theorem 6 (AKS deterministic polynomial-time primality test; Agrawal-Kayal-Saxena 2004). PRIMES is in P: there exists a deterministic algorithm that decides primality of in time polynomial in [AKS 2004]. The Agrawal-Kayal-Saxena algorithm rests on a polynomial-identity strengthening of Fermat's little theorem: for coprime to , is prime if and only if as a polynomial identity in , for an appropriately chosen of order in . The original algorithm runs in ; Lenstra-Pomerance refinements bring it to . AKS settled a long-standing open question — whether primality is in deterministic polynomial time — and confirmed that the polynomial-identity criterion is essentially the "right" generalisation of Fermat's congruence. In practice Miller-Rabin remains faster for RSA key generation, but AKS is the deterministic certificate of theoretical interest.
Theorem 7 (Gauss's generalised Wilson; Gauss 1801 art. 78). For , $$ \prod_{\gcd(a, n) = 1, , 1 \leq a \leq n} a ;\equiv; \begin{cases} -1 \pmod n, & n \in {4, p^e, 2 p^e} \text{ for an odd prime,} \ +1 \pmod n, & \text{otherwise.} \end{cases} $$ [Gauss 1801]. The sign tracks whether has exactly one element of order (in which case the unpaired self-inverse contributes the ) or more than one (in which case the product of self-inverses collapses to ). The classification of cyclic — itself due to Gauss 1801 §III — supplies the case structure: is cyclic iff for an odd prime, and exactly these moduli (with the degenerate cases) give the branch.
Theorem 8 (RSA correctness and security; Rivest-Shamir-Adleman 1978). *Let be a product of two distinct primes, an integer coprime to , and the modular inverse of modulo . For every integer with , * [Rivest-Shamir-Adleman 1978]. *Proof.* If , then by Euler , so . If , then or (not both, since ); CRT on and separately gives in each factor, hence modulo . Security rests on the assumption that factoring is computationally hard: Coppersmith 1996 and Boneh-Durfee 2000 showed that knowing (or even partial knowledge of when is small) reduces to factoring; Shor 1994 showed that quantum algorithms factor in polynomial time, motivating post-quantum cryptography. RSA underpinned essentially all of e-commerce from 1995 until the post-quantum transition began in the late 2010s.
Synthesis. The Fermat-Euler-Wilson trio is the foundational reason that the multiplicative structure of finite fields and finite cyclic groups governs every elementary primality and exponentiation result in number theory. The central insight is exactly that the order of any element divides the order of the group containing it — Lagrange's theorem applied to and — and the entire chain of theorems above unfolds from this single fact. Putting these together with the Carmichael refinement, the tight exponent of is not , and this is exactly the operational content that makes the Fermat test fail on Carmichael numbers, the Miller-Rabin test recover correctness via strong pseudoprimes, and the AKS criterion supply a deterministic polynomial-identity replacement.
The pattern generalises in multiple directions. Replacing the discrete group by the elliptic-curve group identifies Fermat's theorem with the Hasse-Weil bound and underwrites elliptic-curve primality proving and ECDSA; replacing the integer modulus by a polynomial modulus identifies Fermat with the Frobenius decomposition fixing pointwise, the bridge to 01.02.18 pending finite fields and Frobenius; replacing the multiplicative group by an additive flavour identifies Wilson with the sum formulas for . The bridge is everywhere the same: a finite-order multiplicative structure produces a cancellation identity, and primality is exactly the condition for the structure to be cyclic of maximal order.
The applied consequences are pervasive. RSA decryption rests on Euler's theorem; Diffie-Hellman key exchange and the Digital Signature Algorithm rest on the cyclic structure of that Fermat encodes; Miller-Rabin and AKS rest on strengthenings of Fermat's congruence; elliptic-curve cryptography reuses the same group-theoretic framework over . The post-quantum transition motivated by Shor 1994 keeps the cyclic-group structure but replaces the underlying hard problem (factoring, discrete log) with lattice-based or code-based or isogeny-based alternatives — yet even the new schemes inherit the Lagrange-orbit cancellation as their proof-of-correctness identity. Fermat's 1640 letter to Frénicle was the seed of all modern public-key cryptography.
Full proof set Master
Proposition 1 (Fermat's little theorem, polynomial-identity proof in ). For prime, the polynomial identity $$ x^{p - 1} - 1 ;=; \prod_{a = 1}^{p - 1}(x - a) \quad \text{in } \mathbb{F}_p[x] $$ holds, recovering Fermat's little theorem for as the evaluations of the left-hand side at each root.
Proof. The polynomial has degree . By Fermat's little theorem (proved separately above via Lagrange), every element satisfies , so is a root in .
A polynomial of degree over a field has at most roots. The polynomial has distinct roots in — the full set . Hence the factorisation $$ x^{p - 1} - 1 ;=; \prod_{a = 1}^{p - 1}(x - a) $$ holds in . The two sides have equal degree and equal roots; their leading coefficients are both , so they agree.
The polynomial-identity form is equivalent to Fermat but conceptually sharper: it identifies as the set of roots of in , exposing as the splitting field of a separable polynomial of degree . The Frobenius generalisation to replaces by and produces the same factorisation.
Proposition 2 (Euler's theorem, group-theoretic proof). For , .
Proof. The group has order . The residue lies in this group because . By Lagrange's theorem on finite groups, the order of any element divides the order of the group, so . Writing : $$ [a]_n^{\varphi(n)} ;=; \left([a]_n^{\mathrm{ord}([a]_n)}\right)^k ;=; [1]_n^k ;=; [1]_n. \qquad \square $$
Proposition 3 (Lagrange's proof of Wilson via polynomial coefficients). For prime, .
Proof (Lagrange 1771). Consider the polynomial $$ f(x) ;=; (x - 1)(x - 2) \cdots (x - (p - 1)) - (x^{p - 1} - 1) ;\in; \mathbb{F}_p[x]. $$ The first factor expands to a polynomial of degree with leading coefficient and constant term . The second has leading coefficient and constant term . So has degree at most (the leading terms cancel) and constant term .
By Proposition 1, in , so identically in . All coefficients vanish — in particular the constant coefficient: . For odd, , giving . For , the identity reduces to , also valid.
This is the proof Lagrange 1771 Nouv. Mém. Acad. Berlin 2 published. The pairing-and-self-inverses argument from Exercise 5 is the modern textbook proof; both arguments produce the same conclusion via different operational content.
Proposition 4 (Korselt's criterion). A composite integer satisfies for every coprime to if and only if is squarefree and for every prime dividing .
Proof. The condition is equivalent to . By the CRT decomposition and the prime-power formula for odd (with adjusted by the cyclic-versus-non-cyclic distinction), .
If any for odd, then . But , so , contradiction. Hence is squarefree at every odd prime. The case with is similarly ruled out by .
With squarefree, , and is equivalent to for every . The converse is immediate.
The smallest Carmichael number is : squarefree, and is divisible by , , . Alford-Granville-Pomerance 1994 Annals 140, 703 proved infinitely many Carmichael numbers exist, with density .
Connections Master
Congruences and the CRT
21.01.03. Just shipped. The unit-group framework developed in21.01.03is the operative setting of all three Fermat-Euler-Wilson theorems. The CRT decomposition supplies the prime-power reduction used in the Carmichael-function formula, Korselt's criterion, Gauss's generalised Wilson, and the CRT-based RSA decryption speedup. The totient is the cardinality and the exponent of this group; the multiplicativity of both functions descends from CRT. The present unit is operationally the next layer above the unit-group structure of21.01.03.Primes and the fundamental theorem
21.01.02. Shipped. Fermat's little theorem and Wilson's theorem are characterisations of primes: for all coprime to fails generically on composites (Carmichael numbers are the celebrated exceptions); holds if and only if is prime (the converse of Wilson). The fundamental theorem of arithmetic from21.01.02supplies the prime-power factorisation that feeds the structure theorem for , which is the engine of every result in this unit. Wilson's converse is a clean primality decision procedure — exponentially slow, but theoretically perfect.Group
01.02.01. Shipped. The proofs of Fermat and Euler rest on Lagrange's theorem applied to the finite groups and . The order-divides-group-order pattern is the categorical core of every congruence appearing in this unit. The same Lagrange-orbit framework appears again in the necklace / Burnside proof of Fermat (Theorem 1) and in the pairing argument for Wilson (Exercise 5). The cyclic-group structure theorem from01.02.01is the operational core of the classification of when is cyclic and hence when Fermat's congruence is sharp.Primitive roots
21.01.05. Pending. A primitive root modulo is a generator of when this group is cyclic. Gauss 1801 §III proved primitive roots exist modulo every odd prime power and modulo , settling the existence side of the cyclic-classification. The sharper form of Fermat — there exists with and no smaller positive exponent works — promotes "order divides " to "order equals " for a witness. The downstream specialisation in21.01.05(when shipped) develops the index calculus, discrete logarithms, and the constructive existence of primitive roots via the lifting-the-exponent lemma.Finite fields and Frobenius
01.02.18pending. Pending. The base case is , where Fermat's congruence is exactly the statement that the Frobenius endomorphism , , is the identity. The freshman's-dream identity in (used in Euler's induction proof of Fermat, Theorem 2 above) is the additivity of . Generalising to replaces by and identifies as the fixed set of . The non-linear / non-abelian extension of Fermat to elliptic-curve groups appears in04.04.03elliptic curves.
Historical & philosophical context Master
Fermat's little theorem appears in Fermat 1640's letter of 18 October to Bernard Frénicle de Bessy [Fermat 1640]: "tout nombre premier mesure infailliblement une des puissances - 1 de quelque progression que ce soit ..." — every prime divides infinitely many in any arithmetic progression. Fermat states the result, claims a proof, but withholds it for fear of being "trop long" — characteristic Fermat. No proof of Fermat's appears in his extant correspondence; the first published proof is Euler 1736 Comm. Acad. Sci. Petrop. 8, 141 [Euler 1736], by induction on using the binomial-coefficient divisibility . Euler 1763 Novi Comm. Acad. Sci. Petrop. 8, 74 [Euler 1763] introduces the totient function (which Euler writes ) and generalises the theorem to arbitrary moduli: for . The modern name "Fermat's little theorem" emerged in 20th-century textbooks to distinguish the result from Fermat's Last Theorem.
Wilson's theorem was stated without proof by John Wilson and communicated by Edward Waring in Meditationes Algebraicae (1770); the first published proof is Lagrange 1771 Nouv. Mém. Acad. Berlin 2, 125 [Lagrange 1771], via the polynomial-identity argument of Proposition 3 above. Lagrange also proved the converse — if then is prime — making Wilson the first published exact primality criterion. Gauss 1801 Disquisitiones Arithmeticae arts. 50-83 [Gauss 1801] gives the canonical modern development: arts. 50-51 (Fermat-Euler), arts. 75-78 (Wilson with the modern proof via pairing and self-inverses in ), and arts. 79-83 (the generalisation to arbitrary moduli, with the explicit sign determined by the structure of ). Gauss credits Fermat and Euler explicitly but proves the results from scratch; the Disquisitiones is where Fermat-Euler-Wilson enters the textbook canon.
The applied legacy crystallised in the 20th century. The Fermat primality test — declare "probably prime" if for several random — was the standard heuristic until Carmichael 1910 Bull. AMS 16, 232 [Carmichael 1910] showed that composite can systematically fool the test. The Carmichael numbers are exactly the composite false-positives, characterised by Korselt 1899 Math. Ann. 53, 173 [Korselt 1899] via the criterion squarefree and for every . Carmichael 1910 supplied the first example and conjectured infinitely many exist; Alford-Granville-Pomerance 1994 Annals 140, 703 [Alford-Granville-Pomerance 1994] proved this with the explicit lower bound . Miller 1976 J. Comput. Syst. Sci. 13, 300 [Miller 1976] introduced strong pseudoprimes — a refinement of Fermat's congruence that excludes Carmichael numbers — and proved deterministic primality testing under the generalised Riemann hypothesis. Rabin 1980 J. Number Th. 12, 128 [Rabin 1980] randomised Miller's test, producing the de facto standard for RSA key generation.
The deterministic-polynomial-time question opened by Gauss-Carmichael-Miller-Rabin was settled by Agrawal-Kayal-Saxena 2004 Annals 160, 781 [AKS 2004]: PRIMES is in P. The AKS algorithm rests on the polynomial-identity criterion — itself a strengthening of Fermat's congruence to a polynomial-ring identity. The original complexity has been refined to by Lenstra-Pomerance and subsequent authors. In practical software, Miller-Rabin remains faster for RSA key generation, but AKS is the theoretical deterministic certificate.
The cryptographic legacy is dominated by Rivest-Shamir-Adleman 1978 CACM 21, 120 [Rivest-Shamir-Adleman 1978], who introduced RSA based on Euler's theorem applied to the modulus . The decryption identity rests on and Euler's for . Coppersmith 1996 Eurocrypt and Boneh-Durfee 2000 IEEE Trans. Inform. Theory IT-46 showed that knowing (or partial information about when ) reduces to factoring . Shor 1994 Proc. FOCS 35, 124 produced a polynomial-time quantum factoring algorithm, prompting the post-quantum cryptographic transition currently underway at NIST and global standards bodies. Even the post-quantum schemes inherit the Lagrange-orbit / Fermat-Euler-Wilson framework as their correctness identity, just with the underlying hard problem replaced.
Bibliography Master
@misc{Fermat1640,
author = {Fermat, Pierre de},
title = {Letter to Bernard Fr\'enicle de Bessy, 18 October 1640},
year = {1640},
note = {Reproduced in *Œuvres de Fermat*, ed. Tannery and Henry, Vol. II, pp. 209-210 (Paris: Gauthier-Villars, 1894). The first statement of Fermat's little theorem; no proof given.}
}
@article{Euler1736,
author = {Euler, Leonhard},
title = {Theorematum quorundam ad numeros primos spectantium demonstratio},
journal = {Commentarii Academiae Scientiarum Imperialis Petropolitanae},
volume = {8},
pages = {141--146},
year = {1736},
note = {The first published proof of Fermat's little theorem, by induction on $a$ using $(a + 1)^p \equiv a^p + 1 \pmod p$. Reprinted in *Opera Omnia* Ser. I, Vol. 2, paper E54.}
}
@article{Euler1763,
author = {Euler, Leonhard},
title = {Theoremata arithmetica nova methodo demonstrata},
journal = {Novi Commentarii Academiae Scientiarum Imperialis Petropolitanae},
volume = {8},
pages = {74--104},
year = {1763},
note = {Introduces the totient function $\varphi(n)$ and proves Euler's generalisation $a^{\varphi(n)} \equiv 1 \pmod n$. Reprinted in *Opera Omnia* Ser. I, Vol. 2, paper E271.}
}
@article{Lagrange1771,
author = {Lagrange, Joseph-Louis},
title = {D\'emonstration d'un th\'eor\`eme nouveau concernant les nombres premiers},
journal = {Nouveaux M\'emoires de l'Acad\'emie Royale des Sciences et Belles-Lettres de Berlin},
volume = {2},
pages = {125--137},
year = {1771},
note = {The first proof of Wilson's theorem, via the polynomial-identity argument that $(x - 1)(x - 2) \cdots (x - (p - 1)) = x^{p - 1} - 1$ in $\mathbb{F}_p[x]$.}
}
@book{Gauss1801,
author = {Gauss, Carl Friedrich},
title = {Disquisitiones Arithmeticae},
publisher = {Gerhard Fleischer},
address = {Leipzig},
year = {1801},
note = {English translation by Arthur A. Clarke, Yale University Press, 1965. Articles 50-83 contain the canonical modern development of Fermat-Euler-Wilson and their generalisations.}
}
@article{Korselt1899,
author = {Korselt, Alwin Reinhold},
title = {Probl\`eme chinois},
journal = {L'interm\'ediaire des math\'ematiciens},
volume = {6},
pages = {142--143},
year = {1899},
note = {Korselt's criterion for Carmichael numbers.}
}
@article{Carmichael1910,
author = {Carmichael, Robert D.},
title = {Note on a new number theory function},
journal = {Bulletin of the American Mathematical Society},
volume = {16},
pages = {232--238},
year = {1910},
note = {Introduces the Carmichael function $\lambda(n)$ and supplies the first example of a Carmichael number, $n = 561$.}
}
@article{Miller1976,
author = {Miller, Gary L.},
title = {Riemann's hypothesis and tests for primality},
journal = {Journal of Computer and System Sciences},
volume = {13},
pages = {300--317},
year = {1976}
}
@article{Rabin1980,
author = {Rabin, Michael O.},
title = {Probabilistic algorithm for testing primality},
journal = {Journal of Number Theory},
volume = {12},
pages = {128--138},
year = {1980}
}
@article{AGP1994,
author = {Alford, W. R. and Granville, Andrew and Pomerance, Carl},
title = {There are infinitely many Carmichael numbers},
journal = {Annals of Mathematics},
volume = {140},
pages = {703--722},
year = {1994}
}
@article{AKS2004,
author = {Agrawal, Manindra and Kayal, Neeraj and Saxena, Nitin},
title = {{PRIMES} is in {P}},
journal = {Annals of Mathematics},
volume = {160},
pages = {781--793},
year = {2004}
}
@article{RSA1978,
author = {Rivest, Ronald L. and Shamir, Adi and Adleman, Leonard},
title = {A method for obtaining digital signatures and public-key cryptosystems},
journal = {Communications of the ACM},
volume = {21},
pages = {120--126},
year = {1978}
}
@book{HardyWright2008,
author = {Hardy, G. H. and Wright, E. M.},
title = {An Introduction to the Theory of Numbers},
edition = {6},
publisher = {Oxford University Press},
year = {2008},
note = {Revised by D. R. Heath-Brown and J. H. Silverman, foreword by A. Wiles. Chapter VI develops Fermat-Euler-Wilson with multiple proofs.}
}
@book{IrelandRosen1990,
author = {Ireland, Kenneth and Rosen, Michael},
title = {A Classical Introduction to Modern Number Theory},
edition = {2},
series = {Graduate Texts in Mathematics},
volume = {84},
publisher = {Springer},
year = {1990},
note = {§§3.2, 4 develop the group-theoretic framing of Fermat-Euler and Wilson's theorem.}
}
@book{Apostol1976,
author = {Apostol, Tom M.},
title = {Introduction to Analytic Number Theory},
series = {Undergraduate Texts in Mathematics},
publisher = {Springer},
year = {1976},
note = {§5 develops the totient function and Fermat-Euler with arithmetic-function methods.}
}
@book{NivenZuckermanMontgomery1991,
author = {Niven, Ivan and Zuckerman, Herbert S. and Montgomery, Hugh L.},
title = {An Introduction to the Theory of Numbers},
edition = {5},
publisher = {John Wiley},
year = {1991},
note = {Standard undergraduate development of Fermat-Euler-Wilson.}
}