1.2.4. Wilson’s Theorem
This section is based on part of [BUR11, Sec. 5.3].
Lemma 1.2.4.1.
Let be a prime and . The following statements are equivalent:
-
(1)
.
-
(2)
or .
In particular, if , then the above equivalent conditions hold if and only if or .
Proof.
(1)(2) Since and is prime, using Euclid’s Lemma (Theorem 1.1.4.2), we conclude that if and only if or , as required.
(2)(1) Immediate from Proposition 1.2.1.6(5).
The final claim is clear: for , the congruence implies and, since , the congruence implies . ∎
Theorem 1.2.4.2 (Wilson’s Theorem).
Let be a prime. Then
Proof.
If , then and holds. If , then and holds. Let be prime. Consider the set
which has elements. Corollary 1.2.2.7 and Lemma 1.2.4.1 imply that the above set is partitioned into pairs such that and . Indeed, Corollary 1.2.2.7 implies that for each there exists a unique such that ; Lemma 1.2.4.1 then shows that if and only if or . Using Proposition 1.2.1.6(5), we multiply these congruences to obtain
By Proposition 1.2.1.6(4), we may multiply this congruence by to obtain
Since , Proposition 1.2.1.6(3) yields the congruence
Remark 1.2.4.3.
The converse statement in Wilson’s Theorem (Theorem 1.2.4.2) also holds: if is an integer such that , then is a prime. Let be a divisor of . Then the congruence
also holds. Moreover, divides since . Therefore,
which is possible if and only if . This shows that is prime.