Proof of Fermat's Little Theorem Jason Holt BYU Internet Security Research Lab 25 Sept. 2002 This document is in the public domain. Fermat's Little Theorem states that p-1 a mod p = 1 For all 0 y. xa congruent to ya means that: xa = kp + z and ya = lp + z (k != l) Subtracting, xa - ya = kp - lp (x-y)a = (k-l)p Note that x-y and a are each < p. Now consider the factorization of each side, which must be the same if both sides are equal. Either (x-y) or a must be a multiple of p, since p has no factors. But since x-y and a are < p, we have a contradiction. Proof of theorem: Multiply the elements of P and N together, recalling that they have the same elements and therefore must have the same product: 1a * 2a * 3a * ... (p-1)a = 1 * 2 * 3 * ... (p-1) (mod p) p-1 (1*2*3*...(p-1)) * a = (1*2*3*...(p-1)) (mod p) Dividing out (p-1)!, we get that: p-1 a = 1 (mod p).