import Erdos522.Basic.PolynomialPrefixes import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Tactic.NormNum open Filter open scoped Topology BigOperators namespace DeskErdos522 /-- Use the coefficients as written in the problem and the root multiset. -/ noncomputable def literalCount (signs : ℕ → ℂ) (n : ℕ) : ℕ := by classical let p : Polynomial ℂ := ∑ k ∈ Finset.range (n + 1), Polynomial.C (signs k) * Polynomial.X ^ k exact (p.roots.filter (fun z => ‖z‖ ≤ (1 : ℝ))).card theorem count_agrees (signs : ℕ → ℂ) (n : ℕ) : Erdos522.closedZeroCount (Erdos522.polynomialPrefix signs (fun _ => 1) n) 1 = literalCount signs n := by classical simp [Erdos522.closedZeroCount, Erdos522.zeroCountIn, Erdos522.polynomialPrefix, literalCount] theorem normalization_agrees (R : ℕ → ℕ) : Tendsto (fun n : ℕ => (R n : ℝ) / n) atTop (𝓝 (1 / 2 : ℝ)) ↔ Tendsto (fun n : ℕ => (R n : ℝ) / ((n : ℝ) / 2)) atTop (𝓝 (1 : ℝ)) := by have hscale (n : ℕ) : (R n : ℝ) / ((n : ℝ) / 2) = 2 * ((R n : ℝ) / n) := by rw [div_div_eq_mul_div, mul_comm (R n : ℝ) (2 : ℝ), mul_div_assoc] constructor · intro h have h2 := (tendsto_const_nhds (x := (2 : ℝ))).mul h simpa only [hscale, show (2 : ℝ) * (1 / 2) = 1 by norm_num] using h2 · intro h have h2 := (tendsto_const_nhds (x := (1 / 2 : ℝ))).mul h have hpoint (n : ℕ) : (1 / 2 : ℝ) * ((R n : ℝ) / ((n : ℝ) / 2)) = (R n : ℝ) / n := by rw [hscale, ← mul_assoc, show (1 / 2 : ℝ) * 2 = 1 by norm_num, one_mul] simpa only [hpoint, mul_one] using h2 #print axioms count_agrees #print axioms normalization_agrees end DeskErdos522