{
  "id": "2897",
  "ident": "NS.02897",
  "slug": "erdos-696",
  "title": "Erdős Problem 696",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Is it true that $H(n)/h(n)\\to \\infty$ for almost all $n$?\n\nFormalised as: for every threshold $M$, the set of $n$ with $h(n) > 0$ and $H(n)/h(n) > M$\nhas natural density $1$. This is false: in fact, $H(n)/h(n) = 2 + o(1)$ for almost all $n$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos696.erdos_696",
  "statement_lean": "theorem erdos_696 :\n    ¬ ∀ M : ℝ,\n      {n : ℕ | (h n : ℝ) > 0 ∧ (H n : ℝ) / (h n : ℝ) > M}.HasDensity 1",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 696\n\n*References:*\n* [erdosproblems.com/696](https://www.erdosproblems.com/696)\n* [Lean proof](https://github.com/davidturturean/erdos-696/blob/4fa1bf2c6ff6f2e0c7024f814614c7455404fdd3/Erdos696/Main.lean#L35), assuming\n  the Siegel-Walfisz theorem, the Brun-Titchmarsh inequality, and Mertens' theorem as custom axioms.\n-/\n\n@[expose] public section\n\nnamespace Erdos696\n\n/--\nA strictly-increasing chain of natural numbers $d_1 < d_2 < \\dots$ such that consecutive\nelements satisfy $d_{i+1} \\equiv 1 \\pmod{d_i}$, and every element divides $n$ and satisfies\nthe auxiliary predicate $P$.\n-/\ndef ValidChain (n : ℕ) (P : ℕ → Prop) (s : List ℕ) : Prop :=\n  s.IsChain (fun a b => a < b ∧ b ≡ 1 [MOD a]) ∧ ∀ d ∈ s, d ∣ n ∧ P d\n\nopen Classical in\n/--\n$h(n)$ is the largest $\\ell$ such that there is a sequence of primes $p_1<\\cdots < p_\\ell$\nall dividing $n$ with $p_{i+1}\\equiv 1\\pmod{p_i}$.\n-/\nnoncomputable def h (n : ℕ) : ℕ :=\n  Nat.findGreatest (fun k => ∃ s : List ℕ, s.length = k ∧ ValidChain n Nat.Prime s) n\n\nopen Classical in\n/--\n$H(n)$ is the largest $u$ such that there is a sequence of integers $d_1<\\cdots < d_u$\nall dividing $n$ with $d_{i+1}\\equiv 1\\pmod{d_i}$.\n-/\nnoncomputable def H (n : ℕ) : ℕ :=\n  Nat.findGreatest\n    (fun k => ∃ s : List ℕ, s.length = k ∧ ValidChain n (fun _ => True) s) n\n\n/-- The prime-chain definition has the expected value at $n = 1$. -/\n@[category test, AMS 11]\ntheorem h_one : h 1 = 0 := by\n  classical\n  rw [h, Nat.findGreatest_eq_zero_iff]\n  intro k hk hk_le\n  have hk_eq : k = 1 := by omega\n  subst k\n  rintro ⟨s, hslen, hvalid⟩\n  obtain ⟨p, rfl⟩ := List.length_eq_one_iff.mp hslen\n  suffices p = 1 by grind [Nat.not_prime_one, ValidChain]\n  exact Nat.dvd_one.mp (hvalid.2 p (by simp)).1\n\n/--\nIs it true that $H(n)/h(n)\\to \\infty$ for almost all $n$?\n\nFormalised as: for every threshold $M$, the set of $n$ with $h(n) > 0$ and $H(n)/h(n) > M$\nhas natural density $1$. This is false: in fact, $H(n)/h(n) = 2 + o(1)$ for almost all $n$.\n-/\n@[category research solved, question, AMS 11]\ntheorem erdos_696 :\n    ¬ ∀ M : ℝ,\n      {n : ℕ | (h n : ℝ) > 0 ∧ (H n : ℝ) / (h n : ℝ) > M}.HasDensity 1 := by\n  sorry\n\nend Erdos696\n",
  "statement_hash": "711ea4a66ea5a7f539ea1ee7340c23a1d899a154dd8ba424e871a4ebdb4b9e20",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}