math / tasks /modular-arithmetic /modular-arithmetic-congruence_chain-d3-e0020 /solution /Solution.lean
Download tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-e0020/solution/Solution.lean from RenaissanceLabsEU/math: direct link, hf CLI and curl.
- Browser
- Download file 588 Bytes
-
https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-e0020/solution/Solution.lean
- Command line
-
hf download hf://datasets/RenaissanceLabsEU/math/tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-e0020/solution/Solution.lean
-
curl -L -o Solution.lean https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-e0020/solution/Solution.lean
588 Bytes
| import Mathlib | |
| /-- A large power of x has the stated residue. -/ | |
| theorem congr_pow (x : ℤ) (h : x ≡ 5 [ZMOD 12]) : | |
| x ^ 36 ≡ 1 [ZMOD 12] := by | |
| refine (h.pow 36).trans ?_ | |
| norm_num [Int.ModEq] | |
| /-- The combined expression has the stated residue. -/ | |
| theorem congr_product (x y : ℤ) (hx : x ≡ 5 [ZMOD 12]) (hy : y ≡ 11 [ZMOD 12]) : | |
| x ^ 36 * y ^ 39 + 6 ≡ 5 [ZMOD 12] := by | |
| have h1 := congr_pow x hx | |
| have h2 : y ^ 39 ≡ 11 [ZMOD 12] := by | |
| refine (hy.pow 39).trans ?_ | |
| norm_num [Int.ModEq] | |
| refine ((h1.mul h2).add_right 6).trans ?_ | |
| norm_num [Int.ModEq] | |