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 456

Source:Erdős Problems
Open problem Nobody knows the answer yet — neither on paper nor in Lean. First verified proof: +100 points.
Statement:reviewed
Statement:

Is it true that mn<pnm_n<p_n for almost all nn?

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

Formal statement

theorem erdos_456.parts.i :
    Tendsto (fun N ↦ (count (fun n ↦ m n < p n) N : ℝ) / (N : ℝ)) atTop (𝓝 1)
Show the full Challenge.lean (167 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 456

*References:*
- [erdosproblems.com/456](https://www.erdosproblems.com/456)
- [Er79e] Erdős, Paul, Some unconventional problems in number theory. Astérisque (1979), 73--82.
-/

@[expose] public section

open Nat Filter
open scoped Topology Asymptotics

namespace Erdos456

/--
Let $p_n$ be the smallest prime $\equiv 1\pmod{n}$.
-/
noncomputable def p (n : ℕ) : ℕ :=
  sInf { k | k.Prime ∧ k ≡ 1 [MOD n] }

/--
Let $m_n$ be the smallest integer such that $n\mid \phi(m_n)$.
-/
noncomputable def m (n : ℕ) : ℕ :=
  sInf { k | 0 < k ∧ n ∣ totient k }

open scoped Classical in
/--
Is it true that $m_n<p_n$ for almost all $n$?
-/
@[category research open, question, AMS 11]
theorem erdos_456.parts.i :
    Tendsto (fun N ↦ (count (fun n ↦ m n < p n) N : ℝ) / (N : ℝ)) atTop (𝓝 1) := by
  sorry

open scoped Classical in
/--
Does $p_n/m_n \to \infty$ for almost all $n$?
-/
@[category research open, question, AMS 11]
theorem erdos_456.parts.ii :
    ∃ A : Set ℕ, Tendsto (fun N ↦ (count (· ∈ A) N : ℝ) / (N : ℝ)) atTop (𝓝 1) ∧
      Tendsto (fun n ↦ (p n : ℝ) / (m n : ℝ)) (atTop ⊓ 𝓟 A) atTop := by
  sorry

/--
Are there infinitely many primes $p$ such that $p-1$ is the only $n$ for which $m_n=p$?
-/
@[category research open, question, AMS 11]
theorem erdos_456.parts.iii :
    { q | q.Prime ∧ ∀ n, m n = q ↔ n = q - 1 }.Infinite := by
  sorry

/--
Linnik's theorem implies that $p_n\leq n^{O(1)}$.
-/
@[category research solved, AMS 11]
theorem erdos_456.variants.linniks_theorem :
    ∃ L : ℝ, (fun n ↦ (p n : ℝ)) =O[atTop] (fun n ↦ (n : ℝ) ^ L) := by
  sorry

/--
It is trivial that $m_n \leq p_n$ always.
-/
@[category textbook, AMS 11]
theorem erdos_456.variants.mn_leq_pn (n : ℕ) :
    m n ≤ p n := by
  unfold m p
  rcases eq_or_ne n 0 with hn | hn
  · subst hn
    have hempty : {k | 0 < k ∧ (0 : ℕ) ∣ totient k} = (∅ : Set ℕ) := by
      ext k
      simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false, not_and]
      intro hk
      rw [zero_dvd_iff]
      have := Nat.totient_pos.mpr hk
      omega
    rw [hempty, Nat.sInf_empty]
    exact Nat.zero_le _
  · have hne : {k | k.Prime ∧ k ≡ 1 [MOD n]}.Nonempty := by
      obtain ⟨q, _, hq, hmod⟩ :=
        Nat.forall_exists_prime_gt_and_modEq 0 hn (Nat.coprime_one_left n)
      exact ⟨q, hq, hmod⟩
    obtain ⟨hp, hmod⟩ := Nat.sInf_mem hne
    apply Nat.sInf_le
    refine ⟨hp.pos, ?_⟩
    rw [Nat.totient_prime hp]
    exact (Nat.modEq_iff_dvd' hp.pos).mp hmod.symm

/--
Erdős [Er79e] writes it is 'easy to show' that for infinitely many $n$ we have $m_n < p_n$.
-/
@[category research solved, AMS 11]
theorem erdos_456.variants.infinitely_many_n :
    { n | m n < p n }.Infinite := by
  apply Set.infinite_of_injective_forall_mem (f := fun j : ℕ ↦ 2 ^ (2 * j + 3))
  · intro a b hab
    apply Nat.pow_right_injective (by decide) at hab
    omega
  · intro j
    let k := 2 * j + 3
    -- Witness n = 2^k for odd k ≥ 3; then m(n) ≤ 2n, while 3 ∣ n + 1 forces p(n) > 2n.
    change m (2 ^ k) < p (2 ^ k)
    have hm : m (2 ^ k) ≤ 2 ^ (k + 1) := by
      unfold m
      refine Nat.sInf_le ⟨by positivity, ?_⟩
      rw [Nat.totient_prime_pow Nat.prime_two (by omega)]
      norm_num
    have hp : 2 ^ (k + 1) + 1 ≤ p (2 ^ k) := by
      unfold p
      let q := sInf {x | x.Prime ∧ x ≡ 1 [MOD 2 ^ k]}
      change 2 ^ (k + 1) + 1 ≤ q
      have hne : {x | x.Prime ∧ x ≡ 1 [MOD 2 ^ k]}.Nonempty := by
        obtain ⟨r, _, hr, hmod⟩ := Nat.forall_exists_prime_gt_and_modEq 0
          (pow_ne_zero k (by decide)) (Nat.coprime_one_left (2 ^ k))
        exact ⟨r, hr, hmod⟩
      obtain ⟨hprime, hmod⟩ : q.Prime ∧ q ≡ 1 [MOD 2 ^ k] := Nat.sInf_mem hne
      rw [Nat.pow_succ]
      by_contra hbound
      have hxle : q ≤ 2 ^ k * 2 := by omega
      have hlower : 2 ^ k + 1 ≤ q := by
        simpa [add_comm] using hmod.symm.add_le_of_lt hprime.one_lt
      have hupper : q ≤ 2 ^ k + 1 :=
        (hmod.trans Nat.add_modEq_left.symm).le_of_lt_add (by omega)
      have hxeq : q = 2 ^ k + 1 := by omega
      have hkodd : Odd k := ⟨j + 1, by dsimp [k]; omega⟩
      have hxeqthree : q = 3 := (hprime.dvd_iff_eq (by decide)).mp (by
        rw [hxeq]
        simpa using hkodd.nat_add_dvd_pow_add_pow 2 1)
      have heighteen : 8 ≤ 2 ^ k := by
        change 2 ^ 3 ≤ 2 ^ k
        exact Nat.pow_le_pow_right (by decide) (by dsimp [k]; omega)
      omega
    omega

open scoped Classical in
/--
Erdős [Er79e] writes it is 'easy to show' that $m_n/n \to \infty$ for almost all $n$.
-/
@[category research solved, AMS 11]
theorem erdos_456.variants.m_div_n :
    ∃ A : Set ℕ, Tendsto (fun N ↦ (count (· ∈ A) N : ℝ) / N) atTop (𝓝 1) ∧
      Tendsto (fun n ↦ (m n : ℝ) / (n : ℝ)) (atTop ⊓ 𝓟 A) atTop := by
  sorry

end Erdos456

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

nosorry fetch erdos-456
nosorry submit erdos-456 nosorry/erdos-456/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.