goldbach-spectral-bridge
Li and Liu's GRH + S ⇒ Goldbach in Lean, checked against the paper by Comparator: clean it up together, and settle S
| 1 | module |
| 2 | |
| 3 | public import Mathlib.Analysis.MellinInversion |
| 4 | public import ConditionalGoldbach.Proofs.MellinCompactPositive |
| 5 | |
| 6 | public section |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | noncomputable section |
| 10 | open scoped BigOperators ComplexConjugate Topology ContDiff |
| 11 | open MeasureTheory Filter Set Complex |
| 12 | namespace ConditionalGoldbach |
| 13 | |
| 14 | lemma mellinD_contDiff_finite (n : ℕ) {f : ℝ → ℝ} (hf : ContDiff ℝ (n+1) f) : |
| 15 | ContDiff ℝ n (mellinD f) := by |
| 16 | have hg : ContDiff ℝ n (deriv f) := hf.deriv' |
| 17 | exact (hf.of_le (by exact_mod_cast (Nat.le_succ n))).sub (contDiff_id.mul hg) |
| 18 | |
| 19 | lemma mellinD_iterate_regular_finite (n k : ℕ) (f : ℝ → ℝ) (hf : ContDiff ℝ (n+k) f) |
| 20 | (A B : ℝ) (hsupp : Function.support f ⊆ Icc A B) : |
| 21 | ContDiff ℝ n (mellinD^[k] f) ∧ Function.support (mellinD^[k] f) ⊆ Icc A B := by |
| 22 | induction k generalizing f with |
| 23 | | zero => simpa using And.intro hf hsupp |
| 24 | | succ k ih => |
| 25 | rw [Function.iterate_succ_apply] |
| 26 | apply ih |
| 27 | · apply mellinD_contDiff_finite (n+k) |
| 28 | simpa only [Nat.cast_add,Nat.cast_one,add_assoc] using hf |
| 29 | · exact mellinD_support_Icc hsupp |
| 30 | |
| 31 | lemma mellinD_transform_finite (f : ℝ → ℝ) (hf : ContDiff ℝ 1 f) (A B : ℝ) |
| 32 | (hsupp : Function.support f ⊆ Icc A B) (s : ℂ) (hs : 0 < s.re) : |
| 33 | mellin (fun u => (mellinD f u : ℂ)) s = (1 + s) * mellin (fun u => (f u : ℂ)) s := by |
| 34 | let F : ℝ → ℂ := fun u => (u : ℂ) ^ (s - 1) * (f u : ℂ) |
| 35 | let G : ℝ → ℂ := fun u => (u : ℂ) ^ s * ((deriv f u : ℝ) : ℂ) |
| 36 | have hdf : ContDiff ℝ 0 (deriv f) := hf.deriv' |
| 37 | have hdfs : Function.support (deriv f) ⊆ Icc A B := |
| 38 | support_deriv_subset.trans (closure_minimal hsupp isClosed_Icc) |
| 39 | have hF : IntegrableOn F (Ioi 0) := (compact_mellin_regular f hf.continuous A B hsupp s hs).1 |
| 40 | have hG : IntegrableOn G (Ioi 0) := by |
| 41 | have h := (compact_mellin_regular (deriv f) hdf.continuous A B hdfs (s + 1) (by simpa using hs.trans (lt_add_one s.re))).1 |
| 42 | simpa only [MellinConvergent, add_sub_cancel_right, smul_eq_mul, G] using h |
| 43 | have hs0 : s ≠ 0 := by intro h; simp [h] at hs |
| 44 | have hFTC : (∫ u in Ioi (0 : ℝ), s * F u + G u) = 0 := by |
| 45 | have hd (u : ℝ) (hu : u ∈ Ioi (0 : ℝ)) : |
| 46 | HasDerivAt (fun u : ℝ => (u : ℂ) ^ s * (f u : ℂ)) (s * F u + G u) u := by |
| 47 | have hcp := hasDerivAt_ofReal_cpow_const (ne_of_gt hu) hs0 |
| 48 | convert hcp.mul ((hf.differentiable (by norm_num) u).hasDerivAt.ofReal_comp) using 1 |
| 49 | dsimp [F, G] |
| 50 | ring |
| 51 | have hc : ContinuousWithinAt (fun u : ℝ => (u : ℂ) ^ s * (f u : ℂ)) (Ici 0) 0 := |
| 52 | ((Complex.continuousAt_ofReal_cpow_const 0 s (Or.inl hs)).mul |
| 53 | (Complex.continuous_ofReal.continuousAt.comp hf.continuous.continuousAt)).continuousWithinAt |
| 54 | have htop : Tendsto (fun u : ℝ => (u : ℂ) ^ s * (f u : ℂ)) atTop (𝓝 0) := by |
| 55 | apply tendsto_const_nhds.congr' |
| 56 | filter_upwards [eventually_gt_atTop B] with u hu |
| 57 | have hz : f u = 0 := by |
| 58 | by_contra hn |
| 59 | exact (not_lt_of_ge (hsupp hn).2) hu |
| 60 | simp [hz] |
| 61 | have heq := integral_Ioi_of_hasDerivAt_of_tendsto hc hd ((hF.const_mul s).add hG) htop |
| 62 | simpa only [ofReal_zero, zero_cpow hs0, zero_mul, sub_self] using heq |
| 63 | rw [integral_add (hF.const_mul s) hG, integral_const_mul] at hFTC |
| 64 | have heq : (∫ u in Ioi (0 : ℝ), (u : ℂ) ^ (s - 1) * (mellinD f u : ℂ)) = |
| 65 | ∫ u in Ioi (0 : ℝ), F u - G u := by |
| 66 | apply setIntegral_congr_fun measurableSet_Ioi |
| 67 | intro u hu |
| 68 | have hu0 : (u : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hu.ne' |
| 69 | have hp : (u : ℂ) ^ (s - 1) * u = (u : ℂ) ^ s := by |
| 70 | calc |
| 71 | _ = (u : ℂ) ^ (s - 1) * (u : ℂ) ^ (1 : ℂ) := by rw [cpow_one] |
| 72 | _ = (u : ℂ) ^ ((s - 1) + 1) := (cpow_add _ _ hu0).symm |
| 73 | _ = _ := by rw [sub_add_cancel] |
| 74 | dsimp [F, G, mellinD] |
| 75 | push_cast |
| 76 | rw [mul_sub, ← mul_assoc, hp] |
| 77 | unfold mellin |
| 78 | simp only [smul_eq_mul] |
| 79 | rw [heq, integral_sub hF hG] |
| 80 | change (∫ u in Ioi (0 : ℝ), F u) - (∫ u in Ioi (0 : ℝ), G u) = |
| 81 | (1 + s) * ∫ u in Ioi (0 : ℝ), F u |
| 82 | linear_combination -hFTC |
| 83 | |
| 84 | lemma mellinD_iterate_transform_finite (k : ℕ) (f : ℝ → ℝ) (hf : ContDiff ℝ k f) |
| 85 | (A B : ℝ) (hsupp : Function.support f ⊆ Icc A B) (s : ℂ) (hs : 0<s.re) : |
| 86 | mellin (fun u => (mellinD^[k] f u : ℂ)) s = (1+s)^k*mellin (fun u => (f u : ℂ)) s := by |
| 87 | induction k with |
| 88 | | zero => simp |
| 89 | | succ k ih => |
| 90 | have hk := mellinD_iterate_regular_finite 1 k f (by simpa only [Nat.cast_add,Nat.cast_one,add_comm] using hf) A B hsupp |
| 91 | rw [Function.iterate_succ_apply',mellinD_transform_finite _ hk.1 A B hk.2 s hs, |
| 92 | ih (hf.of_le (by exact_mod_cast Nat.le_succ k)),pow_succ] |
| 93 | ring |
| 94 | |
| 95 | lemma compact_mellin_finite_decay (k : ℕ) (f : ℝ → ℝ) (hf : ContDiff ℝ k f) |
| 96 | (A B : ℝ) (hsupp : Function.support f ⊆ Icc A B) |
| 97 | (lo hi : ℝ) (hlo : 0 < lo) (hlohi : lo ≤ hi) : |
| 98 | ∃ C : ℝ, 0 < C ∧ ∀ s : ℂ, s.re ∈ Icc lo hi → |
| 99 | ‖mellin (fun u => (f u : ℂ)) s‖ ≤ C * (1 + |s.im|)⁻¹ ^ k := by |
| 100 | obtain ⟨C₀, hC₀, hzero⟩ := compact_mellin_uniform_bound f hf.continuous A B hsupp lo hi hlo hlohi |
| 101 | obtain ⟨Ck, hCk, hk⟩ := compact_mellin_uniform_bound (mellinD^[k] f) |
| 102 | (mellinD_iterate_regular_finite 0 k f (by simpa using hf) A B hsupp).1.continuous A B |
| 103 | (mellinD_iterate_regular_finite 0 k f (by simpa using hf) A B hsupp).2 lo hi hlo hlohi |
| 104 | refine ⟨2 ^ k * (C₀ + Ck), by positivity, fun s hsl => ?_⟩ |
| 105 | have hnorm := hk s hsl |
| 106 | rw [mellinD_iterate_transform_finite k f hf A B hsupp s (hlo.trans_le hsl.1), norm_mul, norm_pow] at hnorm |
| 107 | have him : |s.im| ≤ ‖1 + s‖ := by simpa only [add_im, one_im, zero_add] using Complex.abs_im_le_norm (1 + s) |
| 108 | have hpower : |s.im| ^ k * ‖mellin (fun u => (f u : ℂ)) s‖ ≤ Ck := |
| 109 | (mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (abs_nonneg _) him k) (norm_nonneg _)).trans hnorm |
| 110 | have hden : 0 < (1 + |s.im|) ^ k := by positivity |
| 111 | rw [inv_pow, ← div_eq_mul_inv, le_div_iff₀ hden] |
| 112 | by_cases hsmall : |s.im| ≤ 1 |
| 113 | · have hpow : (1 + |s.im|) ^ k ≤ (2 : ℝ) ^ k := |
| 114 | pow_le_pow_left₀ (by positivity) (by linarith) k |
| 115 | calc |
| 116 | _ ≤ C₀ * (2 : ℝ) ^ k := mul_le_mul (hzero s hsl) hpow (by positivity) hC₀.le |
| 117 | _ ≤ _ := by nlinarith [mul_nonneg (show 0 ≤ (2 : ℝ) ^ k by positivity) hCk.le] |
| 118 | · have hlarge : 1 < |s.im| := lt_of_not_ge hsmall |
| 119 | have hpow : (1 + |s.im|) ^ k ≤ (2 * |s.im|) ^ k := |
| 120 | pow_le_pow_left₀ (by positivity) (by linarith) k |
| 121 | calc |
| 122 | _ ≤ ‖mellin (fun u => (f u : ℂ)) s‖ * (2 * |s.im|) ^ k := |
| 123 | mul_le_mul_of_nonneg_left hpow (norm_nonneg _) |
| 124 | _ = (2 : ℝ) ^ k * (|s.im| ^ k * ‖mellin (fun u => (f u : ℂ)) s‖) := by rw [mul_pow]; ring |
| 125 | _ ≤ (2 : ℝ) ^ k * Ck := mul_le_mul_of_nonneg_left hpower (by positivity) |
| 126 | _ ≤ _ := mul_le_mul_of_nonneg_left (by linarith) (by positivity) |
| 127 | |
| 128 | lemma compact_mellin_finite_verticalIntegrable (f : ℝ → ℝ) (hf : ContDiff ℝ 2 f) (A B : ℝ) |
| 129 | (hsupp : Function.support f ⊆ Icc A B) (σ : ℝ) (hσ : 0 < σ) : |
| 130 | VerticalIntegrable (mellin (fun u => (f u : ℂ))) σ := by |
| 131 | obtain ⟨C, _, hC⟩ := compact_mellin_finite_decay 2 f hf A B hsupp σ σ hσ le_rfl |
| 132 | apply integrable_of_uniform_vertical_decay _ σ C |
| 133 | · apply continuous_iff_continuousAt.mpr |
| 134 | intro t |
| 135 | apply (compact_mellin_regular f hf.continuous A B hsupp (line σ t) |
| 136 | (by simpa [line] using hσ)).2.continuousAt.comp |
| 137 | unfold line |
| 138 | fun_prop |
| 139 | · intro t |
| 140 | simpa [line] using hC (line σ t) (by simp [line]) |
| 141 | |
| 142 | lemma compact_mellin_finite_inversion (f : ℝ → ℝ) (hf : ContDiff ℝ 2 f) (A B : ℝ) |
| 143 | (hsupp : Function.support f ⊆ Icc A B) (σ : ℝ) (hσ : 0 < σ) (u : ℝ) (hu : 0 < u) : |
| 144 | (f u : ℂ) = verticalMellin σ (fun s => mellin (fun y => (f y : ℂ)) s * (u : ℂ) ^ (-s)) := by |
| 145 | have h := mellinInv_mellin_eq σ (fun u => (f u : ℂ)) hu |
| 146 | (compact_mellin_regular f hf.continuous A B hsupp σ hσ).1 |
| 147 | (compact_mellin_finite_verticalIntegrable f hf A B hsupp σ hσ) |
| 148 | (Complex.continuous_ofReal.continuousAt.comp hf.continuous.continuousAt) |
| 149 | rw [← h] |
| 150 | unfold mellinInv verticalMellin |
| 151 | simp only [Complex.real_smul, Complex.ofReal_mul, Complex.ofReal_ofNat, one_div, Complex.ofReal_inv] |
| 152 | congr 1 |
| 153 | apply integral_congr_ae |
| 154 | exact Eventually.of_forall (fun t => mul_comm _ _) |
| 155 | |
| 156 | lemma compact_mellin_finite_inversion_integrable (f : ℝ → ℝ) (hf : ContDiff ℝ 2 f) (A B : ℝ) |
| 157 | (hsupp : Function.support f ⊆ Icc A B) (σ : ℝ) (hσ : 0 < σ) (u : ℝ) (hu : 0 < u) : |
| 158 | Integrable (fun t : ℝ => mellin (fun y => (f y : ℂ)) (line σ t) * (u : ℂ) ^ (-line σ t)) := by |
| 159 | have hpow : Continuous (fun t : ℝ => (u : ℂ) ^ (-line σ t)) := by |
| 160 | apply Continuous.const_cpow |
| 161 | · unfold line |
| 162 | fun_prop |
| 163 | · exact Or.inl (Complex.ofReal_ne_zero.mpr hu.ne') |
| 164 | have hb : ∀ᵐ t : ℝ, ‖(u : ℂ) ^ (-line σ t)‖ ≤ Real.rpow u (-σ) := by |
| 165 | filter_upwards [] with t |
| 166 | rw [Complex.norm_cpow_eq_rpow_re_of_pos hu] |
| 167 | simp [line] |
| 168 | simpa only [line, mul_comm] using |
| 169 | (compact_mellin_finite_verticalIntegrable f hf A B hsupp σ hσ).bdd_mul hpow.aestronglyMeasurable hb |
| 170 | |
| 171 | |
| 172 | end ConditionalGoldbach |
