Andrica's inequality is equivalent to its gap form
ProvedAndricaConjecture.andrica_iff_gap_formandricaequivalenceprime-gapssqrt
Let denote the th prime in Mathlib's zero-based indexing. Then for every , if and only if . This is a pure identity of real square roots: writing and , both sides are equivalent to , since and , . It does not prove Andrica's conjecture itself, which remains open; it records the exact equivalence between the conjecture and its gap form, so that either form may be used in place of the other.\n\nFormalization Note The statement uses the same casts and indexing as the mission's gap-form milestone.
Preamble
import Mathlib
Formal statement
namespace AndricaConjecture
/-- Andrica's inequality is equivalent to its gap form: for consecutive primes,
`√pₙ₊₁ - √pₙ < 1` if and only if `pₙ₊₁ - pₙ < 2√pₙ + 1`. -/
theorem andrica_iff_gap_form (n : Nat) :
Real.sqrt (Nat.nth Nat.Prime (n + 1) : Real) -
Real.sqrt (Nat.nth Nat.Prime n : Real) < 1 ↔
(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
Source
Andrica, D., Note on a conjecture in prime number theory, Studia Sci. Math. Hungar. 21 (1986) 1-2; mission Andrica's conjecture on sqrt(p_{n+1})-sqrt(p_n), milestone Equivalent gap form of Andrica's inequality.