{
  "id": "2377",
  "ident": "NS.02377",
  "slug": "erdos-521",
  "title": "Erdős Problem 521",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $(\\epsilon_k)_{k\\geq 0}$ be independently uniformly chosen at random from\n$\\{-1,1\\}$. If $R_n$ counts the number of real roots of\n$f_n(z)=\\sum_{0\\leq k\\leq n}\\epsilon_k z^k$ then is it true that, almost surely,\n$$\\lim_{n\\to \\infty}\\frac{R_n}{\\log n}=\\frac{2}{\\pi}?$$\n\nThe answer is no: this almost-sure limit fails. This result was obtained first by others, who\ndeserve the credit for the problem; the link is to an independent machine-checked proof by\nStar Fleet Math.",
  "subjects": [
    "math.NT",
    "math.PR",
    "msc:11",
    "msc:60"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": "https://www.erdosproblems.com/521",
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos521.erdos_521",
  "statement_lean": "theorem erdos_521 : ¬ Claim",
  "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 521\n\n*Reference:* [erdosproblems.com/521](https://www.erdosproblems.com/521)\n-/\n\n@[expose] public section\n\nnamespace Erdos521\n\nopen MeasureTheory Filter Polynomial\nopen scoped Topology\n\n/-- `true` encodes the sign `+1`, `false` the sign `-1`. -/\ndef sign (b : Bool) : ℝ := if b then 1 else -1\n\n/-- One fair coin: the uniform probability measure on `Bool`. -/\nnoncomputable def fairCoin : Measure Bool :=\n  (2 : ENNReal)⁻¹ • (Measure.dirac true + Measure.dirac false)\n\n/-- `fairCoin` gives each of the two signs mass `1/2`. Together with\n`fairCoin_isProbabilityMeasure` this pins the definition down, so a proof stating the\nsame problem with a `Bernoulli(1/2)` measure is stating the same thing. -/\n@[category API, AMS 60]\ntheorem fairCoin_apply (b : Bool) : fairCoin {b} = 2⁻¹ := by\n  cases b <;> simp [fairCoin]\n\n/-- `fairCoin` is a probability measure. -/\n@[category API, AMS 60]\ntheorem fairCoin_isProbabilityMeasure : IsProbabilityMeasure fairCoin := by\n  constructor\n  simp [fairCoin]\n  rw [ENNReal.inv_two_add_inv_two]\n\n/-- The law of an infinite sequence of independent fair coins `(ε_k)_{k ≥ 0}`,\neach uniform on `{-1, +1}`. -/\nnoncomputable def rademacherMeasure : Measure (ℕ → Bool) :=\n  Measure.infinitePi (fun _ : ℕ ↦ fairCoin)\n\n/-- The degree-`n` Littlewood polynomial `f_n(z) = ∑_{0 ≤ k ≤ n} ε_k z^k`. -/\nnoncomputable def littlewoodPolynomial (ω : ℕ → Bool) (n : ℕ) : ℝ[X] :=\n  ∑ k ∈ Finset.range (n + 1), Polynomial.monomial k (sign (ω k))\n\n/-- `R_n`: the number of distinct real roots of `f_n`. -/\nnoncomputable def realRootCount (ω : ℕ → Bool) (n : ℕ) : ℕ :=\n  Set.ncard ((littlewoodPolynomial ω n).rootSet ℝ)\n\n/-- The assertion asked about in Problem 521: almost surely `R_n / log n → 2/π`. -/\ndef Claim : Prop :=\n  ∀ᵐ ω ∂rademacherMeasure,\n    Tendsto (fun n : ℕ ↦ (realRootCount ω n : ℝ) / Real.log (n : ℝ))\n      atTop (𝓝 ((2 : ℝ) / Real.pi))\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $(\\epsilon_k)_{k\\geq 0}$ be independently uniformly chosen at random from\n$\\{-1,1\\}$. If $R_n$ counts the number of real roots of\n$f_n(z)=\\sum_{0\\leq k\\leq n}\\epsilon_k z^k$ then is it true that, almost surely,\n$$\\lim_{n\\to \\infty}\\frac{R_n}{\\log n}=\\frac{2}{\\pi}?$$\n\nThe answer is no: this almost-sure limit fails. This result was obtained first by others, who\ndeserve the credit for the problem; the link is to an independent machine-checked proof by\nStar Fleet Math.\n-/\n@[category research solved, question, AMS 11 60, formal_proof using lean4 at \"https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-521/Research/LateFourthFinal.lean\"]\ntheorem erdos_521 : ¬ Claim := by\n  sorry\n\nend Erdos521\n",
  "statement_hash": "581be0ab8223f1472b89e3fb3b1ada077201c0d5ca897296cdbf78eb012df212",
  "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."
}