Andrica's gap inequality at first-occurrence maximal prime gaps above
OpenAndricaConjecture.andrica_record_gapLet be the th prime in Mathlib's zero-based indexing, so that , , and so on, and let
be the prime at which the 80th first-occurrence maximal prime gap begins.
Call an index a first-occurrence record for the prime gap if every earlier gap is strictly smaller:
This theorem asserts the gap form of Andrica's conjecture at every record index above :
This is the restriction of AndricaConjecture.andrica_asymptotic_gap to first-occurrence maximal gaps. Every prime gap is at most the most recent record gap, and the square-root function is increasing, so this record form implies the unrestricted asymptotic gap form. It is the natural sub-target for the maximal-gap approach: it isolates the only gaps that can possibly be large enough to violate Andrica's inequality.
import Mathlib
namespace AndricaConjecture
theorem andrica_record_gap (n : Nat)
(hn : 18361375334787046697 < Nat.nth Nat.Prime n)
(hrec : ∀ m : Nat, m < n →
Nat.nth Nat.Prime (m + 1) - Nat.nth Nat.Prime m <
Nat.nth Nat.Prime (n + 1) - Nat.nth Nat.Prime n) :
(Nat.nth Nat.Prime (n + 1) - Nat.nth Nat.Prime n : Real) <
2 * Real.sqrt (Nat.nth Nat.Prime n : Real) + 1 := by
sorry
end AndricaConjecture