In a gap- representation every large prime is flanked by denominators
ProvedErdos287.prime_neighboursLet with and suppose every consecutive gap is at most . Let be a prime with , and , i.e. a prime strictly inside the range and past its midpoint. Then both and occur as denominators.
By Erdos287.no_large_prime the prime itself is not a denominator. If one of its neighbours were missing too, the two consecutive missing values would force a gap of at least (Erdos287.consecutive_omissions), contrary to hypothesis.
Structurally this says a great deal. A gap- sequence is a concatenation of maximal runs of step exactly , each of constant parity. Since and are denominators two apart, they lie in the same run, and that run is even. So in a counterexample to Erdős' problem every prime past the midpoint of the range sits strictly inside a run of even denominators, and the odd runs must be entirely prime-free above .
import Mathlib
namespace Erdos287
theorem prime_neighbours (k : ℕ) (hk : 2 ≤ k) (f : ℕ → ℕ)
(hf1 : ∀ i, i < k → 1 < f i)
(hmono : ∀ i j, i < j → j < k → f i < f j)
(hsum : ∑ i ∈ Finset.range k, (1 : ℚ) / f i = 1)
(hgap : ∀ i, i + 1 < k → f (i + 1) - f i ≤ 2)
(p : ℕ) (hp : Nat.Prime p) (hlo : f 0 < p) (hhi : p + 1 ≤ f (k - 1))
(h2 : f (k - 1) < 2 * p) :
(∃ i, i < k ∧ f i = p - 1) ∧ (∃ j, j < k ∧ f j = p + 1) := by sorry
end Erdos287