{
  "id": "3859",
  "ident": "NS.03859",
  "slug": "erdos-981",
  "title": "Erdős Problem 981",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $\\epsilon > 0$ and $f_\\epsilon(p)$ be the smallest integer $m$\nsuch that $\\sum_{n\\leq N} \\left(\\frac{n}{p}\\right)<\\epsilon N$ for all $N\\geq m$. Prove that\n$$\\sum_{p<x}f_\\epsilon(p)\\sim c_\\epsilon \\frac{x}{\\log x}$$\nfor some $c_\\epsilon > 0$.\n\nProved by Elliott [El69].",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos981.erdos_981",
  "statement_lean": "theorem erdos_981 (ε : ℝ) (hε : 0 < ε) :\n    ∃ c > (0 : ℝ), Tendsto (fun x ↦ (∑ p : Nat.primesBelow ⌈x⌉₊, f ε p) * log x / x) atTop (𝓝 c)",
  "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 981\n\n*References:*\n- [erdosproblems.com/981](https://www.erdosproblems.com/981)\n- [El69] Elliott, P. D. T. A., *A conjecture of Erdős concerning character sums*.\n  Indag. Math. 31 (1969), 164–171.\n- [TaZh25] [arxiv/2512.24631](https://arxiv.org/abs/2512.24631)\n  **Average first-passage times for character sums** by *Quanyu Tang and Hao Zhang*\n-/\n\n@[expose] public section\n\nopen Filter Real\nopen scoped Topology\n\nnamespace Erdos981\n\n/--\nProperty of a natural $N$ to satisfy $\\sum_{n\\leq N} \\left(\\frac{n}{p}\\right)<\\epsilon N$,\nwhere $\\left(\\frac{n}{p}\\right)$ is the Jacobi symbol. The theorem statement mentions Legendre symbol,\nhowever in formalization we use Jacobi symbol to avoid problem with passing the fact that $p$ is prime.\nFor prime $p$ `jacobiSym n p = legendreSym p n`.\n-/\ndef Erdos981Property (ε : ℝ) (p : ℕ) (N : ℕ) : Prop :=\n   (∑ n ≤ N, jacobiSym n p) < ε * N\n\n/--\nThe smallest integer $m$ such that\n$\\sum_{n\\leq N} \\left(\\frac{n}{p}\\right)<\\epsilon N$ for all $N\\geq m$.\n-/\nnoncomputable def f (ε : ℝ) (p : ℕ) : ℕ :=\n  sInf { m | ∀ N ≥ m, Erdos981Property ε p N }\n\n/--\nThe smallest integer $m$ such that $\\sum_{n\\leq m} \\left(\\frac{n}{p}\\right)<\\epsilon m$\n-/\nnoncomputable def f' (ε : ℝ) (p : ℕ) : ℕ :=\n  sInf { m | Erdos981Property ε p m }\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $\\epsilon > 0$ and $f_\\epsilon(p)$ be the smallest integer $m$\nsuch that $\\sum_{n\\leq N} \\left(\\frac{n}{p}\\right)<\\epsilon N$ for all $N\\geq m$. Prove that\n$$\\sum_{p<x}f_\\epsilon(p)\\sim c_\\epsilon \\frac{x}{\\log x}$$\nfor some $c_\\epsilon > 0$.\n\nProved by Elliott [El69].\n-/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos981.lean#L42\"]\ntheorem erdos_981 (ε : ℝ) (hε : 0 < ε) :\n    ∃ c > (0 : ℝ), Tendsto (fun x ↦ (∑ p : Nat.primesBelow ⌈x⌉₊, f ε p) * log x / x) atTop (𝓝 c) := by\n  sorry\n\n/--\nLet $\\epsilon > 0$ and $f_\\epsilon(p)$ be the smallest integer $m$ such that $\\sum_{n\\leq m} \\left(\\frac{n}{p}\\right)<\\epsilon m$. Prove that\n$$\\sum_{p<x}f_\\epsilon(p)\\sim c_\\epsilon \\frac{x}{\\log x}$$\nfor some $c_\\epsilon > 0$.\n\nProved by Tang and Zhang [TaZh25].\n-/\n@[category research solved, AMS 11]\ntheorem erdos_981.variants.first_time (ε : ℝ) (hε : 0 < ε) :\n    ∃ c > (0 : ℝ), Tendsto (fun x ↦ (∑ p : Nat.primesBelow ⌈x⌉₊, f' ε p) * log x / x) atTop (𝓝 c) := by\n  sorry\n\nend Erdos981\n",
  "statement_hash": "ef9b583d9ef7c23370d8d32b8e40dfd983f3d22f767b26112cd62ff7adce1f31",
  "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."
}