Exercise · Volume 1 · 1.2.4-19
Exercise 1.2.4-19
proved in Lean solution written
| Rating | M10 |
|---|---|
| Markers | M (mathematical), recommended |
| Kind | K1, prove: show that a stated fact is true from the written solution |
| Section | Section 1.2.4 of Volume 1. Companion chapter: Integer functions and elementary number theory |
The task
Show that if , then some integer has , using the extended Euclidean algorithm.
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
The extended algorithm finds integers and with .
Hint 2
Reduce this equation modulo .
Solution
Show the solution
Run Euclid's algorithm on and carry two coefficients along. Keep a list of triples with . Start with and . When and are the last two triples, put and form . This new triple again has , because the relation is linear. The remainders decrease, so the process stops with , and the last nonzero is (the usual proof of Euclid's algorithm). So at the end .
Reduce modulo : . So works.
Example with and . The triples are , , then with , then with , then with , then with . So and , which is modulo .
Check
, so . A computer run finds an inverse for each of the residues that are relatively prime to .
Remarks
Exercise 1.2.4-28 gives a second formula, , which is slower than Euclid's algorithm. The inverse is unique modulo , by Law B.
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_4.Ex19.statementaxioms: none - Solution:
TAOCP.S1_2_4.Ex19.solvedaxioms: Classical.choice, Quot.sound, propext
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.