Exercise · Volume 1 · 1.2.5-13
Exercise 1.2.5-13
proved in Lean solution written
| Rating | M23 |
|---|---|
| Markers | M (mathematical) |
| Kind | K1, prove: show that a stated fact is true from the written solution |
| Section | Section 1.2.5 of Volume 1. Companion chapter: Permutations and factorials |
The task
Prove Wilson's theorem: for a prime , . Pair each number of with its inverse modulo .
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
Show that each with has exactly one in the same range with .
Hint 2
Find the with . Then the product of the other numbers splits into pairs with product .
Solution
Show the solution
For , . Let .
Inverses. Let . Since is prime, , so there are integers with . Then , and the residue of modulo is not . Let be this residue, . It is unique: if then , so since and is prime. Also , so the map is an involution of .
Fixed points. means , that is . Since is prime, or , so or . These are two different numbers, because .
The remaining numbers split into pairs with and . The product of the whole set is therefore
Since , the remainder of modulo is .
Check
For the pairs are and , since and . Then , and the remainder is . Python checks . For a composite number the rule fails: , and .
Remarks
The converse holds: if then is prime, so the congruence is a test for primes, but it is too slow to use. Exercise 1.2.5-14 gives a generalization to for every .
This solution is checked, and a person has not reviewed it yet. The source.
In Lean
proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.
- Problem:
TAOCP.S1_2_5.Ex13.statementaxioms: propext - Solution:
TAOCP.S1_2_5.Ex13.solvedaxioms: Classical.choice, Quot.sound, propext
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.