Lean / Reader
Lean reader

PrimeRaceTheta.lean

154 lines26 declarationsno sorryimports Mathlib.NumberTheory.LSeries.HurwitzZetaEven
  1. import Mathlib.NumberTheory.LSeries.HurwitzZetaEven
  2. /-! An explicit weight-one theta candidate for the global continuation.
  3. The Mellin transform is entire and symmetric; agreement with the cubic Euler
  4. product is a separate arithmetic identity. -/
  5. noncomputable section
  6. open Real HurwitzZeta Asymptotics Filter Set MeasureTheory Topology
  7. namespace CubicPrimeRace
  8. namespace Theta
  9. /-- θ(d²x), with θ(x) = ∑_{n∈ℤ} exp(−πn²x). -/
  10. def theta (d x : ℝ) := evenKernel 0 (d^2*x)
  11. private theorem inversion {d x : ℝ} (hd : 0 < d) (hx : 0 < x) :
  12. theta d (1/x) = (Real.sqrt x / d) * theta d⁻¹ x := by
  13. unfold theta
  14. rw [evenKernel_functional_equation 0 (d^2*(1/x)), ← evenKernel_eq_cosKernel_of_zero,
  15. ← Real.sqrt_eq_rpow, Real.sqrt_mul (sq_nonneg d), Real.sqrt_sq hd.le,
  16. one_div x, Real.sqrt_inv]
  17. congr 1 <;> field_simp
  18. private theorem continuous_theta {d : ℝ} (hd : 0 < d) : ContinuousOn (theta d) (Ioi 0) :=
  19. (continuousOn_evenKernel 0).comp (by fun_prop) (fun x hx => mul_pos (sq_pos_of_pos hd) hx)
  20. private theorem rapid_theta {d : ℝ} (hd : 0 < d) (r : ℝ) :
  21. (fun x => theta d x - 1) =O[atTop] (fun x : ℝ => x^r) := by
  22. obtain ⟨c,hc,h⟩ := isBigO_atTop_evenKernel_sub 0
  23. simp only [if_true] at h
  24. have hlim : Tendsto (fun x : ℝ => d^2*x) atTop atTop :=
  25. tendsto_id.const_mul_atTop (sq_pos_of_pos hd)
  26. have h' := h.comp_tendsto hlim
  27. have he := (isLittleO_exp_neg_mul_rpow_atTop (mul_pos hc (sq_pos_of_pos hd)) r).isBigO
  28. apply h'.trans
  29. convert he using 1
  30. funext x; change Real.exp (-c * (d^2*x)) = _
  31. congr 1; ring
  32. private def prodTheta (d e x : ℝ) := theta d x * theta e x
  33. private def block (d e x : ℝ) :=
  34. prodTheta d e x + (d*e)⁻¹ * prodTheta d⁻¹ e⁻¹ x
  35. private def blockLimit (d e : ℝ) := 1+(d*e)⁻¹
  36. private def centered (d e x : ℝ) := block d e x - blockLimit d e
  37. private theorem block_inv {d e x : ℝ} (hd : 0 < d) (he : 0 < e) (hx : 0 < x) :
  38. block d e (1/x) = x * block d e x := by
  39. unfold block prodTheta
  40. rw [inversion hd hx, inversion he hx, inversion (inv_pos.mpr hd) hx, inversion (inv_pos.mpr he) hx]
  41. simp only [inv_inv]
  42. have hsq := Real.sq_sqrt hx.le
  43. field_simp
  44. linear_combination (norm := ring_nf)
  45. (d*e*theta d x*theta e x + theta d⁻¹ x*theta e⁻¹ x)*hsq
  46. private theorem rapid_prod {d e : ℝ} (hd : 0 < d) (he : 0 < e) (r : ℝ) :
  47. (fun x => prodTheta d e x - 1) =O[atTop] (fun x : ℝ => x^r) := by
  48. have h := (rapid_theta hd r).mul (rapid_theta he 0)
  49. simp only [Real.rpow_zero, mul_one] at h
  50. convert (h.add (rapid_theta hd r)).add (rapid_theta he r) using 1
  51. funext x; dsimp [prodTheta]; ring
  52. private theorem rapid_centered {d e : ℝ} (hd : 0 < d) (he : 0 < e) (r : ℝ) :
  53. (fun x => centered d e x) =O[atTop] (fun x : ℝ => x^r) := by
  54. have h := (rapid_prod hd he r).add
  55. ((rapid_prod (inv_pos.mpr hd) (inv_pos.mpr he) r).const_mul_left ((d*e)⁻¹))
  56. convert h using 1
  57. funext x; dsimp [centered, block, blockLimit]; ring
  58. private theorem continuous_centered {d e : ℝ} (hd : 0 < d) (he : 0 < e) :
  59. ContinuousOn (centered d e) (Ioi 0) := by
  60. unfold centered block prodTheta
  61. exact (((continuous_theta hd).mul (continuous_theta he)).add
  62. (continuousOn_const.mul ((continuous_theta (inv_pos.mpr hd)).mul (continuous_theta (inv_pos.mpr he))))).sub continuousOn_const
  63. private def combination (f : ℝ → ℝ → ℝ) (d : ℝ) :=
  64. (f d (2*d⁻¹) + f (2*d) d⁻¹ - 2*f (2*d) (2*d⁻¹) - (1/4)*f d d⁻¹)/2
  65. /-- d² = 1/√27 gives the determinant-27 scaling of the discriminant −108
  66. binary forms. The factor 1/2 normalizes the first Fourier coefficient. -/
  67. def scale : ℝ := (Real.sqrt (Real.sqrt 27))⁻¹
  68. def kernel (x : ℝ) := combination (fun d e => centered d e x) scale
  69. private theorem hscale : 0 < scale := by unfold scale; positivity
  70. private theorem constant_cancels {d : ℝ} (hd : d ≠ 0) : combination blockLimit d = 0 := by
  71. dsimp [combination, blockLimit]
  72. field_simp; ring
  73. private theorem kernel_uncentered (x : ℝ) : kernel x = combination (fun d e => block d e x) scale := by
  74. have h := constant_cancels hscale.ne'
  75. dsimp only [kernel, combination, centered] at *
  76. linarith
  77. theorem kernel_inversion {x : ℝ} (hx : 0 < x) : kernel (1/x) = x * kernel x := by
  78. rw [kernel_uncentered, kernel_uncentered]
  79. dsimp only [combination]
  80. have hd := hscale
  81. rw [block_inv hd (by positivity) hx, block_inv (by positivity) (inv_pos.mpr hd) hx,
  82. block_inv (by positivity) (by positivity) hx, block_inv hd (inv_pos.mpr hd) hx]
  83. ring
  84. private theorem kernel_rapid (r : ℝ) :
  85. kernel =O[atTop] (fun x : ℝ => x^r) := by
  86. have hd := hscale
  87. have h1 := rapid_centered hd (show 0 < 2*scale⁻¹ by positivity) r
  88. have h2 := rapid_centered (show 0 < 2*scale by positivity) (inv_pos.mpr hd) r
  89. have h3 := rapid_centered (show 0 < 2*scale by positivity) (show 0 < 2*scale⁻¹ by positivity) r
  90. have h4 := rapid_centered hd (inv_pos.mpr hd) r
  91. convert (((h1.add h2).sub (h3.const_mul_left 2)).sub (h4.const_mul_left (1/4))).const_mul_left (1/2) using 1
  92. funext x; dsimp [kernel, combination]; ring
  93. private theorem kernel_continuous : ContinuousOn kernel (Ioi 0) := by
  94. have hd := hscale
  95. have h1 := continuous_centered hd (show 0 < 2*scale⁻¹ by positivity)
  96. have h2 := continuous_centered (show 0 < 2*scale by positivity) (inv_pos.mpr hd)
  97. have h3 := continuous_centered (show 0 < 2*scale by positivity) (show 0 < 2*scale⁻¹ by positivity)
  98. have h4 := continuous_centered hd (inv_pos.mpr hd)
  99. exact ((((h1.add h2).sub (continuousOn_const.mul h3)).sub (continuousOn_const.mul h4))).div_const 2
  100. private def fePair : StrongFEPair ℂ where
  101. f := fun x => (kernel x : ℂ)
  102. g := fun x => (kernel x : ℂ)
  103. k := 1
  104. ε := 1
  105. f₀ := 0
  106. g₀ := 0
  107. hk := zero_lt_one
  108. hε := one_ne_zero
  109. hf₀ := rfl
  110. hg₀ := rfl
  111. hf_int := (Complex.continuous_ofReal.comp_continuousOn kernel_continuous).locallyIntegrableOn measurableSet_Ioi
  112. hg_int := (Complex.continuous_ofReal.comp_continuousOn kernel_continuous).locallyIntegrableOn measurableSet_Ioi
  113. h_feq := fun x hx => by rw [kernel_inversion hx]; simp
  114. hf_top := fun r => by simpa using (Complex.isBigO_ofReal_left.mpr (kernel_rapid r))
  115. hg_top := fun r => by simpa using (Complex.isBigO_ofReal_left.mpr (kernel_rapid r))
  116. /-- The Mellin transform of the explicit theta kernel. -/
  117. def completion : ℂ → ℂ := fePair.Λ
  118. theorem completion_eq_mellin : completion = mellin (fun x => (kernel x : ℂ)) := rfl
  119. theorem entire_completion : Differentiable ℂ completion := fePair.differentiable_Λ
  120. theorem reflection (s : ℂ) : completion (1-s) = completion s := by
  121. simpa [completion, StrongFEPair.Λ, StrongFEPair.symm, WeakFEPair.symm, fePair] using fePair.functional_equation s
  122. end Theta
  123. end CubicPrimeRace
  124. #print axioms CubicPrimeRace.Theta.kernel_inversion
  125. #print axioms CubicPrimeRace.Theta.entire_completion
  126. #print axioms CubicPrimeRace.Theta.reflection