Documentation

Formalizations.NumberTheory.Residues.ConsecutiveQuadratic

Consecutive quadratic residues: Λ(2, 2) = 9 (Erdős Problem 436, Lehmer–Lehmer 1962) #

For a prime p, let r(p) be the least n ≥ 1 such that n and n + 1 are both quadratic residues modulo p. Lehmer and Lehmer (1962) showed that limsup r(p) = 9: for p > 10 one of the pairs (1, 2), (4, 5), (9, 10) works, and when 2, 3, 5, 7 are all non-residues no smaller pair does, which happens for infinitely many primes by Dirichlet's theorem and quadratic reciprocity. This closes the sorry of erdos_436.variants.two_two in google-deepmind/formal-conjectures (definitions copied literally, Apache-2.0).

Main results #

References #

IsPowerResidue k p a: p ∤ a and a ≡ x^k (mod p) for some x.

Equations
Instances For
    noncomputable def Erdos436.r (k m p : ℕ) :

    r k m p: the least r ≥ 1 with r, …, r + m − 1 all k-th power residues mod p, or ⊤.

    Equations
    Instances For
      noncomputable def Erdos436.runLimsup (k m : ℕ) :

      Λ(k, m) = limsup_{p → ∞} r(k, m, p) over the primes.

      Equations
      Instances For
        theorem Erdos436.natCast_ne_zero {p : ℕ} (hlt : 10 < p) {a : ℕ} (h1 : 1 ≤ a) (h10 : a ≤ 10) :
        ↑a ≠ 0
        theorem Erdos436.isPR_iff {p : ℕ} [Fact (Nat.Prime p)] {a : ℕ} (ha : ↑a ≠ 0) :
        theorem Erdos436.L_mul {p : ℕ} [Fact (Nat.Prime p)] (a b : ℕ) :
        legendreSym p ↑(a * b) = legendreSym p ↑a * legendreSym p ↑b
        theorem Erdos436.L_sq {p : ℕ} [Fact (Nat.Prime p)] (a : ℕ) (ha : ↑a ≠ 0) :
        legendreSym p ↑a * legendreSym p ↑a = 1
        theorem Erdos436.r_le {p : ℕ} (n : ℕ) (hn : 1 ≤ n) (h : ∀ i < 2, IsPowerResidue 2 p (n + i)) :
        r 2 2 p ≤ ↑n
        theorem Erdos436.r_le_nine {p : ℕ} (hp : Nat.Prime p) (hlt : 10 < p) :
        r 2 2 p ≤ 9
        theorem Erdos436.r_ge_nine {p : ℕ} (hp : Nat.Prime p) (hlt : 10 < p) (h2 : ¬IsSquare 2) (h3 : ¬IsSquare 3) (h5 : ¬IsSquare 5) (h7 : ¬IsSquare 7) :
        9 ≤ r 2 2 p
        theorem Erdos436.r_eq_nine {p : ℕ} (hp : Nat.Prime p) (hm : p % 840 = 43) :
        r 2 2 p = 9

        Lehmer–Lehmer (1962): Λ(2, 2) = 9 (the statement erdos_436.variants.two_two of formal-conjectures).