Download tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0009/solution/Solution.lean from RenaissanceLabsEU/math: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0009/solution/Solution.lean
- Command line
-
hf download hf://datasets/RenaissanceLabsEU/math/tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0009/solution/Solution.lean
-
curl -L -o Solution.lean https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0009/solution/Solution.lean
1.22 kB
| import Mathlib | |
| /-- The prime 2 divides the polynomial value. -/ | |
| theorem dvd_by_2 (n : ℤ) : | |
| (2 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by | |
| have h : ((5 * n ^ 7 - 89 * n : ℤ) : ZMod 2) = 0 := by | |
| push_cast | |
| generalize (n : ZMod 2) = x | |
| revert x | |
| decide +kernel | |
| exact (ZMod.intCast_zmod_eq_zero_iff_dvd _ _).1 h | |
| /-- The prime 3 divides the polynomial value. -/ | |
| theorem dvd_by_3 (n : ℤ) : | |
| (3 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by | |
| have h : ((5 * n ^ 7 - 89 * n : ℤ) : ZMod 3) = 0 := by | |
| push_cast | |
| generalize (n : ZMod 3) = x | |
| revert x | |
| decide +kernel | |
| exact (ZMod.intCast_zmod_eq_zero_iff_dvd _ _).1 h | |
| /-- The prime 7 divides the polynomial value. -/ | |
| theorem dvd_by_7 (n : ℤ) : | |
| (7 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by | |
| have h : ((5 * n ^ 7 - 89 * n : ℤ) : ZMod 7) = 0 := by | |
| push_cast | |
| generalize (n : ZMod 7) = x | |
| revert x | |
| decide +kernel | |
| exact (ZMod.intCast_zmod_eq_zero_iff_dvd _ _).1 h | |
| /-- The product of the primes divides the polynomial value. -/ | |
| theorem dvd_poly (n : ℤ) : | |
| (42 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by | |
| have h2 := dvd_by_2 n | |
| have h3 := dvd_by_3 n | |
| have h7 := dvd_by_7 n | |
| generalize 5 * n ^ 7 - 89 * n = e at h2 h3 h7 ⊢ | |
| omega | |