Download tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0033/solution/Solution.lean from RenaissanceLabsEU/math: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0033/solution/Solution.lean
- Command line
-
hf download hf://datasets/RenaissanceLabsEU/math/tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0033/solution/Solution.lean
-
curl -L -o Solution.lean https://huggingface.co/datasets/RenaissanceLabsEU/math/resolve/main/tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0033/solution/Solution.lean
1.23 kB
| import Mathlib | |
| /-- The prime 2 divides the polynomial value. -/ | |
| theorem dvd_by_2 (n : ℤ) : | |
| (2 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by | |
| have h : ((11 * n ^ 5 - 71 * 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 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by | |
| have h : ((11 * n ^ 5 - 71 * 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 5 divides the polynomial value. -/ | |
| theorem dvd_by_5 (n : ℤ) : | |
| (5 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by | |
| have h : ((11 * n ^ 5 - 71 * n : ℤ) : ZMod 5) = 0 := by | |
| push_cast | |
| generalize (n : ZMod 5) = 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 : ℤ) : | |
| (30 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by | |
| have h2 := dvd_by_2 n | |
| have h3 := dvd_by_3 n | |
| have h5 := dvd_by_5 n | |
| generalize 11 * n ^ 5 - 71 * n = e at h2 h3 h5 ⊢ | |
| omega | |