Lean / Reader
Lean readerDeskNormalizationAudit.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Erdos522.Basic.PolynomialPrefixes, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import Erdos522.Basic.PolynomialPrefixesimport Mathlib.Topology.Algebra.GroupWithZeroimport Mathlib.Tactic.NormNumopen Filteropen scoped Topology BigOperatorsnamespace DeskErdos522/-- Use the coefficients as written in the problem and the root multiset. -/noncomputable def literalCount (signs : ℕ → ℂ) (n : ℕ) : ℕ := byclassicallet p : Polynomial ℂ :=∑ k ∈ Finset.range (n + 1), Polynomial.C (signs k) * Polynomial.X ^ kexact (p.roots.filter (fun z => ‖z‖ ≤ (1 : ℝ))).cardtheorem count_agrees (signs : ℕ → ℂ) (n : ℕ) :Erdos522.closedZeroCount (Erdos522.polynomialPrefix signs (fun _ => 1) n) 1 =literalCount signs n := byclassicalsimp [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 : ℝ)) := byhave hscale (n : ℕ) :(R n : ℝ) / ((n : ℝ) / 2) = 2 * ((R n : ℝ) / n) := byrw [div_div_eq_mul_div, mul_comm (R n : ℝ) (2 : ℝ), mul_div_assoc]constructor· intro hhave h2 := (tendsto_const_nhds (x := (2 : ℝ))).mul hsimpa only [hscale, show (2 : ℝ) * (1 / 2) = 1 by norm_num] using h2· intro hhave h2 := (tendsto_const_nhds (x := (1 / 2 : ℝ))).mul hhave hpoint (n : ℕ) :(1 / 2 : ℝ) * ((R n : ℝ) / ((n : ℝ) / 2)) = (R n : ℝ) / n := byrw [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_agreesend DeskErdos522