Lean / Reader
Lean reader

DeskNormalizationAudit.lean

44 lines3 declarationsno sorryimports Erdos522.Basic.PolynomialPrefixes Mathlib.Topology.Algebra.GroupWithZero Mathlib.Tactic.NormNum

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.

  1. import Erdos522.Basic.PolynomialPrefixes
  2. import Mathlib.Topology.Algebra.GroupWithZero
  3. import Mathlib.Tactic.NormNum
  4. open Filter
  5. open scoped Topology BigOperators
  6. namespace DeskErdos522
  7. /-- Use the coefficients as written in the problem and the root multiset. -/
  8. noncomputable def literalCount (signs : ℕ → ℂ) (n : ℕ) : ℕ := by
  9. classical
  10. let p : Polynomial ℂ :=
  11. ∑ k ∈ Finset.range (n + 1), Polynomial.C (signs k) * Polynomial.X ^ k
  12. exact (p.roots.filter (fun z => ‖z‖ ≤ (1 : ℝ))).card
  13. theorem count_agrees (signs : ℕ → ℂ) (n : ℕ) :
  14. Erdos522.closedZeroCount (Erdos522.polynomialPrefix signs (fun _ => 1) n) 1 =
  15. literalCount signs n := by
  16. classical
  17. simp [Erdos522.closedZeroCount, Erdos522.zeroCountIn, Erdos522.polynomialPrefix, literalCount]
  18. theorem normalization_agrees (R : ℕ → ℕ) :
  19. Tendsto (fun n : ℕ => (R n : ℝ) / n) atTop (𝓝 (1 / 2 : ℝ)) ↔
  20. Tendsto (fun n : ℕ => (R n : ℝ) / ((n : ℝ) / 2)) atTop (𝓝 (1 : ℝ)) := by
  21. have hscale (n : ℕ) :
  22. (R n : ℝ) / ((n : ℝ) / 2) = 2 * ((R n : ℝ) / n) := by
  23. rw [div_div_eq_mul_div, mul_comm (R n : ℝ) (2 : ℝ), mul_div_assoc]
  24. constructor
  25. · intro h
  26. have h2 := (tendsto_const_nhds (x := (2 : ℝ))).mul h
  27. simpa only [hscale, show (2 : ℝ) * (1 / 2) = 1 by norm_num] using h2
  28. · intro h
  29. have h2 := (tendsto_const_nhds (x := (1 / 2 : ℝ))).mul h
  30. have hpoint (n : ℕ) :
  31. (1 / 2 : ℝ) * ((R n : ℝ) / ((n : ℝ) / 2)) = (R n : ℝ) / n := by
  32. rw [hscale, ← mul_assoc, show (1 / 2 : ℝ) * 2 = 1 by norm_num, one_mul]
  33. simpa only [hpoint, mul_one] using h2
  34. #print axioms count_agrees
  35. #print axioms normalization_agrees
  36. end DeskErdos522