For a prime , the numbers solve
ProvedAlfutovaUstinov.problem_4_128elementary-number-theorynumber-theoryquadratic-residueswilson-theorem
This is Problem 4.128 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 of the form with . Then both numbers and are solutions of the congruence
This gives an explicit square root of modulo every prime , complementing Problem 4.126, which shows that no such square root exists for primes . It is a consequence of Wilson's theorem.
Formalization Note The factorial is Nat.factorial, cast to ; the two claims (for and ) are stated separately as congruences in (Int.ModEq).
Preamble
import Mathlib
Formal statement
namespace AlfutovaUstinov
theorem problem_4_128 (p k : ℕ) (hp : p.Prime) (hpk : p = 4 * k + 1) :
(Nat.factorial (2 * k) : ℤ) ^ 2 + 1 ≡ 0 [ZMOD p] ∧
(-(Nat.factorial (2 * k) : ℤ)) ^ 2 + 1 ≡ 0 [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.128. Problem text and answer as catalogued on problems.ru, problem 60754: https://problems.ru/view_problem_details_new.php?id=60754