Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 682

Source:Erdős Problems
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Is it true that for almost all nn there exists some m∈(pn,pn+1)m\in (p_n,p_{n+1}) such that p(m)≥pn+1−pn,p(m) \geq p_{n+1}-p_n, where p(m)p(m) denotes the least prime factor of mm?

This was solved in the affirmative by Gafni and Tao [GaTa25].

This was formalized in Lean by Codex and GPT-5.6 Sol.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:question, formal_proof
Cite as:NS.02842 [math.NT] · NS.02842v1 for this version
Declaration:Erdos682.erdos_682
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:785e3894cf055940a986cd6d9cbe7287688aaf75c0a5c3a2a98feb1a27d8e71d
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/682.lean

Formal statement

theorem erdos_682 :
    {n | ∃ m ∈ Set.Ioo (p n) (p (n + 1)), p (n + 1) - p n ≤ m.minFac}.HasDensity 1
Show the full Challenge.lean (83 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 682

*References:*
- [erdosproblems.com/682](https://www.erdosproblems.com/682)
- [Er79d] Erdős, P., Some unconventional problems in number theory. Acta Math. Acad. Sci. Hungar.
  (1979), 71-80.
- [GaTa25] A. Gafni and T. Tao, Rough numbers between consecutive primes. arXiv:2508.06463 (2025).
-/

@[expose] public section

open Filter Asymptotics

namespace Erdos682

/-- The `n`th prime, indexed from zero: `p 0 = 2`, `p 1 = 3`, ... -/
noncomputable abbrev p (n : ℕ) : ℕ := Nat.nth Nat.Prime n

set_option linter.style.formal_proof_palomar false in
/--
Is it true that for almost all $n$ there exists some $m\in (p_n,p_{n+1})$ such that
$$p(m) \geq p_{n+1}-p_n,$$
where $p(m)$ denotes the least prime factor of $m$?

This was solved in the affirmative by Gafni and Tao [GaTa25].

This was formalized in Lean by Codex and GPT-5.6 Sol.
-/
@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos682.lean#L5018"]
theorem erdos_682 :
    {n | ∃ m ∈ Set.Ioo (p n) (p (n + 1)), p (n + 1) - p n ≤ m.minFac}.HasDensity 1 := by
  sorry

/--
Gafni and Tao [GaTa25, Theorem 1.1] proved that the number of exceptional gaps
$(p_n,p_{n+1})$ with $p_n\in [X,2X]$ is
$$\ll \frac{X}{(\log X)^2}.$$
-/
@[category research solved, AMS 11]
theorem erdos_682.variants.exceptional_count :
    (fun X : ℕ ↦ ({n | p n ∈ Set.Icc X (2 * X) ∧
        ∀ m ∈ Set.Ioo (p n) (p (n + 1)), m.minFac < p (n + 1) - p n}.ncard : ℝ)) =O[atTop]
      fun X : ℕ ↦ (X : ℝ) / Real.log X ^ 2 := by
  sorry

/--
Erdős first thought this should be true for all large $n$, but found a (conditional)
counterexample: Dickson's conjecture says there are infinitely many $d$ such that
$$2183+30030d\textrm{ and }2201+30030d$$
are both prime, and then they must necessarily be consecutive primes. These give a counterexample
since $30030=2\cdot 3 \cdot 5\cdot 7\cdot 11\cdot 13$ and every integer in $[2184,2200]$ is
divisible by at least one of these primes.

This was formalized in Lean by Codex and GPT-5.6 Sol.
-/
@[category textbook, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos682.lean#L5222"]
theorem erdos_682.variants.dickson_counterexample (d : ℕ) (h₁ : (2183 + 30030 * d).Prime)
    (h₂ : (2201 + 30030 * d).Prime) : ∃ n, p n = 2183 + 30030 * d ∧ p (n + 1) = 2201 + 30030 * d ∧
      ∀ m ∈ Set.Ioo (p n) (p (n + 1)), m.minFac < p (n + 1) - p n := by
  sorry

end Erdos682

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos682.erdos_682 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_erdos_682 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-682
nosorry submit erdos-682 nosorry/erdos-682/Solution.lean --wait

Formal variants

Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.