{
  "id": "2378",
  "ident": "NS.02378",
  "slug": "erdos-522",
  "title": "Erdős Problem 522",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $f(z)=\\sum_{0\\leq k\\leq n} \\epsilon_k z^k$ be a random polynomial, where\n$\\epsilon_k\\in \\{-1,1\\}$ independently uniformly at random for $0\\leq k\\leq n$.\n\nIs it true that, if $R_n$ is the number of roots of $f(z)$ in\n$\\{ z\\in \\mathbb{C} : \\lvert z\\rvert \\leq 1\\}$, then\n$$\n  \\frac{R_n}{n/2}\\to 1\n$$\nalmost surely?\n\nThere is some ambiguity as to whether the intended coefficient set is $\\{-1, 1\\}$ or $\\{0, 1\\}$,\nsee `erdos_522.variants.zero_one` for the alternate version.\n\nThis is true. Proofs were posted on the erdosproblems.com forum in April 2026 [Ch26], [KZ26],\nand Lean proofs were given independently in September 2026 [Ka26], [Ki26].\n\nMore generally, [Ka26] proves an almost-sure radial law: the number of roots in\n$\\{\\lvert z\\rvert \\le 1 + x/n\\}$ is $\\Phi(x)\\,n + o(n)$ for every $x$, where\n$\\Phi(x) = \\tfrac12\\left(1 + \\coth x - \\tfrac1x\\right)$. This problem is the case $x = 0$.",
  "subjects": [
    "math.AC",
    "math.PR",
    "msc:12",
    "msc:60"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos522.erdos_522",
  "statement_lean": "theorem erdos_522 :\n    ∀ {Ω : Type*} [MeasureSpace Ω] [IsProbabilityMeasure (ℙ : Measure Ω)]\n      (c : KacCoefficients ({-1, 1} : Set ℂ) Ω),\n      ℙ {ω | atTop.Tendsto (fun n : ℕ ↦ (2 * c.numRootsInUnitDisk n ω : ℝ) / n) (𝓝 1)} = 1",
  "challenge_source": "/-\nCopyright 2025 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 522\n\n*References:*\n- [erdosproblems.com/522](https://www.erdosproblems.com/522)\n- [Ch26] Chojecki, P., *A strong law for the roots of random Littlewood polynomials* (2026),\n  [ulam.ai/research/erdos522-final.pdf](https://www.ulam.ai/research/erdos522-final.pdf).\n- [Ka26] Kawada, S., *Almost-Sure Radial Laws for Nested Random Polynomials and Erdős\n  Problem #522*, [doi:10.5281/zenodo.22970145](https://zenodo.org/records/22970145) (2026).\n  Lean 4 formalization: [chreia/erdos-522](https://github.com/chreia/erdos-522).\n- [Ki26] Kitamura, K., *A Lean proof of Erdős Problem 522*,\n  [KitaKen1/erdos-522-strong-law](https://github.com/KitaKen1/erdos-522-strong-law) (2026).\n- [KZ26] Kwon, Y. and Zou, J., *A fourth moment estimate for logarithmic integrals of random\n  Littlewood polynomials and Erdős's root-count problem* (2026),\n  [ykwon0407/erdos-521-522](https://github.com/ykwon0407/erdos-521-522).\n-/\n\n@[expose] public section\n\nopen MeasureTheory Filter\nopen scoped ProbabilityTheory Topology Real\n\nnamespace Erdos522\n\n/--\nA sequence of *Kac coefficients* over a subset `S` of a field `k` is a countably infinite sequence\nof independent random variables, each uniformly distributed over `S` with respect to the reference\nmeasure `μ`. The default reference measure is the counting measure, so that for a finite set `S`\neach coefficient takes every value of `S` with probability `1 / |S|`.\n\nSuch a sequence determines a *Kac polynomial* of degree `n` for each `n`, which is the random\npolynomial given by `KacCoefficients.polynomial`.\n-/\n@[ext]\nstructure KacCoefficients\n    {k : Type*} [Field k] [MeasurableSpace k] (S : Set k)\n    (Ω : Type*) [MeasureSpace Ω] (μ : Measure k := Measure.count) where\n  toFun : ℕ → Ω → k\n  h_indep : ProbabilityTheory.iIndepFun toFun ℙ\n  h_unif : ∀ i, MeasureTheory.pdf.IsUniform (toFun i) S ℙ μ\n\nvariable {k : Type*} [Field k] [MeasurableSpace k] (S : Set k)\n    (Ω : Type*) [MeasureSpace Ω] (μ : Measure k := Measure.count)\n\n/--\nWe can always view a Kac polynomial as a random variable on `ℕ`.\n-/\ninstance : FunLike (KacCoefficients S Ω μ) ℕ (Ω → k) where\n  coe P := P.toFun\n  coe_injective P Q h := by aesop\n\nnamespace KacCoefficients\n\nopen scoped Polynomial\n\nvariable {S Ω} {μ : Measure k}\n\n/--\nThe random polynomial associated to a sequence `c : KacCoefficients S Ω μ` of Kac coefficients\ngiven by `∑ i ∈ Finset.range (n + 1), c i z^i`.\n-/\nnoncomputable def polynomial (c : KacCoefficients S Ω μ) (n : ℕ) :\n    Ω → k[X] := fun ω => ∑ i ∈ Finset.range (n + 1), Polynomial.monomial i (c i ω)\n\n/--\nThe random multiset of roots associated to a Kac polynomial\n-/\nnoncomputable def roots (c : KacCoefficients S Ω μ) (n : ℕ) : Ω → Multiset k :=\n    fun ω => (c.polynomial n ω).roots\n\n/-- Counts the number of roots of a Kac polynomial in the unit disk with multiplicity. -/\nnoncomputable def numRootsInUnitDisk [PseudoMetricSpace k] (c : KacCoefficients S Ω μ) (n : ℕ)\n    (ω : Ω) : ℕ :=\n  open scoped Classical in\n  (c.roots n ω).countP (· ∈ Metric.closedBall 0 1)\n\nend KacCoefficients\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $f(z)=\\sum_{0\\leq k\\leq n} \\epsilon_k z^k$ be a random polynomial, where\n$\\epsilon_k\\in \\{-1,1\\}$ independently uniformly at random for $0\\leq k\\leq n$.\n\nIs it true that, if $R_n$ is the number of roots of $f(z)$ in\n$\\{ z\\in \\mathbb{C} : \\lvert z\\rvert \\leq 1\\}$, then\n$$\n  \\frac{R_n}{n/2}\\to 1\n$$\nalmost surely?\n\nThere is some ambiguity as to whether the intended coefficient set is $\\{-1, 1\\}$ or $\\{0, 1\\}$,\nsee `erdos_522.variants.zero_one` for the alternate version.\n\nThis is true. Proofs were posted on the erdosproblems.com forum in April 2026 [Ch26], [KZ26],\nand Lean proofs were given independently in September 2026 [Ka26], [Ki26].\n\nMore generally, [Ka26] proves an almost-sure radial law: the number of roots in\n$\\{\\lvert z\\rvert \\le 1 + x/n\\}$ is $\\Phi(x)\\,n + o(n)$ for every $x$, where\n$\\Phi(x) = \\tfrac12\\left(1 + \\coth x - \\tfrac1x\\right)$. This problem is the case $x = 0$.\n-/\n@[category research solved, question, AMS 12 60,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/erdos-522-strong-law/blob/9374493206d192708ef50f90f2752aa0dc690e16/lean/Erdos522StrongLawFC.lean#L9086-L9089\",\n  formal_proof using lean4 at\n    \"https://github.com/chreia/erdos-522/blob/b3c1d7c089fcada59cc48cf664cd3d02157407ca/lean/Erdos522/Probability/IndependentCoefficientRadialLaws.lean#L39-L47\",\n  formal_proof using lean4 at\n    \"https://github.com/chreia/erdos-522/blob/57af1556d1b40f37d09d1270495acc0f282ff0fc/lean/Erdos522/Bridge/FormalConjectures.lean#L238-L253\"]\ntheorem erdos_522 :\n    ∀ {Ω : Type*} [MeasureSpace Ω] [IsProbabilityMeasure (ℙ : Measure Ω)]\n      (c : KacCoefficients ({-1, 1} : Set ℂ) Ω),\n      ℙ {ω | atTop.Tendsto (fun n : ℕ ↦ (2 * c.numRootsInUnitDisk n ω : ℝ) / n) (𝓝 1)} = 1 := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $f(z)=\\sum_{0\\leq k\\leq n} \\epsilon_k z^k$ be a random polynomial, where\n$\\epsilon_k\\in \\{0,1\\}$ independently uniformly at random for $0\\leq k\\leq n$.\n\nIs it true that, if $R_n$ is the number of roots of $f(z)$ in\n$\\{ z\\in \\mathbb{C} : \\lvert z\\rvert \\leq 1\\}$, then\n$$\n  \\frac{R_n}{n/2}\\to 1\n$$\nalmost surely?\n\nThis is true; a Lean proof is given in [Ki26].\n-/\n@[category research solved, question, AMS 12 60,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/erdos-522-strong-law/blob/9374493206d192708ef50f90f2752aa0dc690e16/lean/Erdos522StrongLawFC.lean#L9101-L9104\"]\ntheorem erdos_522.variants.zero_one :\n    ∀ {Ω : Type*} [MeasureSpace Ω] [IsProbabilityMeasure (ℙ : Measure Ω)]\n      {n : ℕ} (hn : 1 ≤ n) (f : KacCoefficients ({0, 1} : Set ℂ) Ω),\n      ℙ {ω | atTop.Tendsto (fun n : ℕ ↦ (2 * f.numRootsInUnitDisk n ω : ℝ) / n) (𝓝 1)} = 1 := by\n  sorry\n\n/--\nErdős and Offord showed that the number of real roots of a random degree `n` polynomial with `±1`\ncoefficients is `(2/π+o(1))log n`.\n-/\n@[category research solved, AMS 12 60]\ntheorem erdos_522.variants.number_real_roots : ∃ p o : ℕ → ℝ,\n    atTop.Tendsto o (𝓝 0) ∧ atTop.Tendsto p (𝓝 0) ∧\n    ∀ (Ω : Type*) [MeasureSpace Ω] [IsProbabilityMeasure (ℙ : Measure Ω)]\n      (n : ℕ) (hn : 2 ≤ n) (f : KacCoefficients ({-1, 1} : Set ℝ) Ω),\n      (ℙ {ω | |(f.roots n ω).card / (n : ℝ).log - 2 / π| ≥ o n}).toReal ≤ p n := by\n  sorry\n\nopen scoped Classical in\n/--\nYakir proved that almost all Kac polynomials have `n/2+O(n^(9/10))` many roots in `{z∈C:|z|≤1}`.\n-/\n@[category research solved, AMS 12 60]\ntheorem erdos_522.variants.yakir_solution :\n    ∃ p : ℕ → ℝ, atTop.Tendsto p (𝓝 0) ∧\n    ∀ (Ω : Type*) [MeasureSpace Ω] [IsProbabilityMeasure (ℙ : Measure Ω)]\n      (n : ℕ) (hn : 2 ≤ n) (f : KacCoefficients ({-1, 1} : Set ℂ) Ω),\n       (ℙ {ω | |(f.roots n ω).countP\n         (· ∈ Metric.closedBall 0 1) - (n / 2 : ℝ)| ≥ n^(9/10 : ℝ) }).toReal ≤ p n := by\n  sorry\n\nend Erdos522\n",
  "statement_hash": "f1b3c423b6817af693ab2f5a3b99b7d0cd107e98165fd1fb34f4d73dee641864",
  "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."
}