Quadratic residues satisfy
ProvedAlfutovaUstinov.problem_4_125elementary-number-theoryfermat-little-theoremnumber-theoryquadratic-residues
This is Problem 4.125 of N. B. Alfutova and A. V. Ustinov, Algebra and Number Theory (MCCME, 2002), Chapter 4, §4 “Theorems of Fermat and Euler”.
Theorem. Let be a prime and let be an integer not divisible by . Suppose that is a square modulo , i.e. there is an integer with
Then
This is one half of Euler's criterion for quadratic residues; the book uses it to study which primes divide numbers of the form .
Formalization Note The exponent is natural-number division, which is exact because is odd. Congruences are Int.ModEq on .
Preamble
import Mathlib
Formal statement
namespace AlfutovaUstinov
theorem problem_4_125 (p : ℕ) (hp : p.Prime) (hp2 : 2 < p) (a x : ℤ) (ha : ¬ (p : ℤ) ∣ a)
(hx : x ^ 2 ≡ a [ZMOD p]) : a ^ ((p - 1) / 2) ≡ 1 [ZMOD p] := by sorry
end AlfutovaUstinovSource
N. B. Alfutova, A. V. Ustinov, «Алгебра и теория чисел. Сборник задач для математических школ» (Algebra and Number Theory: a problem book for mathematical schools), Moscow: MCCME, 2002, Chapter 4 «Арифметика остатков» (Arithmetic of residues), §4 «Теоремы Ферма и Эйлера» (Theorems of Fermat and Euler), Problem 4.125. Problem text and answer as catalogued on problems.ru, problem 60751: https://problems.ru/view_problem_details_new.php?id=60751