Prime divisors of M admitting a square root of -1
ProvedZMod.prime_dvd_eq_two_or_mod_four_eq_one_of_sq_add_one_eq_zeroLet be a natural number and let be an element of with . Let be a prime number dividing . Then or , i.e. as natural numbers. Equivalently: if the congruence is solvable, then no prime divisor of is congruent to modulo . Note that the case is permitted by the statement, where is and every prime divides ; in that case the hypothesis is vacuously unsatisfiable, so the assertion holds. The conclusion is a disjunction of natural-number statements about alone; nothing is asserted about the residue of itself (indeed is excluded only indirectly, via the absence of a prime being insufficient, so the statement as given genuinely allows ).
This is the first supplement to quadratic reciprocity in the form used for the solvability of : is a square modulo an odd prime exactly when that prime is modulo . It feeds the derivation that no square root of exists modulo an odd having a prime divisor congruent to modulo , recorded in ZMod.not_exists_sq_add_one_eq_zero_of_not_two_dvd_of_exists_prime_dvd_mod_four_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_two_or_mod_four_eq_one_of_sq_add_one_eq_zero
{M : ℕ} (x : ZMod M) (hx : x ^ 2 + 1 = 0)
{ℓ : ℕ} (hℓ : ℓ.Prime) (hℓM : ℓ ∣ M) :
ℓ = 2 ∨ ℓ % 4 = 1 := by sorry