Prime divisors of M when x²+x+1≡ 0 (mod M)
ProvedZMod.prime_dvd_eq_three_or_mod_three_eq_one_of_sq_add_self_add_one_eq_zeroLet be a natural number and let be an element of satisfying . Let be a prime number dividing . Then either or , in the sense that the natural-number remainder equals . Note that is an arbitrary natural number, so the degenerate cases and are included; the divisibility hypothesis is what supplies the reduction map , and the conclusion is a statement about the residue of modulo only.
This is the elementary determination of the primes modulo which the cyclotomic polynomial has a root: the splitting primes are exactly and those congruent to modulo . It is used to rule out roots of modulo when has a prime divisor that is neither nor mod , as recorded by ZMod.not_exists_sq_add_self_add_one_eq_zero_of_not_three_dvd_of_exists_prime_dvd_mod_three_ne_one.
import Mathlib set_option maxHeartbeats 4000000 set_option synthInstance.maxHeartbeats 400000 set_option backward.isDefEq.respectTransparency.types false set_option autoImplicit false
theorem ZMod.prime_dvd_eq_three_or_mod_three_eq_one_of_sq_add_self_add_one_eq_zero
{M : ℕ} (x : ZMod M) (hx : x ^ 2 + x + 1 = 0)
{ℓ : ℕ} (hℓ : ℓ.Prime) (hℓM : ℓ ∣ M) :
ℓ = 3 ∨ ℓ % 3 = 1 := by sorry