module public import ConditionalGoldbach.Proofs.VariableStripOperators public import ConditionalGoldbach.Proofs.SpectralModelGrowth public import ConditionalGoldbach.Proofs.SpectralDiagonalBound public import ConditionalGoldbach.Proofs.CharacterReferenceEnergy /-! Uniform height decay for the full weighted residual on the standard strip. -/ public section set_option autoImplicit false noncomputable section open MeasureTheory Set Complex open scoped BigOperators ComplexConjugate namespace ConditionalGoldbach private lemma conductor_height_log_sq {n : ℝ} (hn : 0 < n) (hL : 1 ≤ Real.log n) (t : ℝ) : Real.log (n * (|t| + 2)) ^ 2 ≤ 258 * Real.log n ^ 2 * (1 + |t|) ^ (1 / 4 : ℝ) := by let w := (1 + |t|) ^ (1 / 4 : ℝ) have hw : 1 ≤ w := Real.one_le_rpow (by linarith [abs_nonneg t]) (by norm_num) have hL2 : 1 ≤ Real.log n ^ 2 := by nlinarith have hc : (2 : ℝ) ^ (1 / 4 : ℝ) ≤ 2 := by simpa using Real.rpow_le_rpow_of_exponent_le (by norm_num : (1 : ℝ) ≤ 2) (by norm_num : (1 / 4 : ℝ) ≤ 1) have ht := logarithm_square_le_quarter_power (n := 1) le_rfl t simp only [one_mul, mul_one] at ht have htw : Real.log (|t| + 2) ^ 2 ≤ 128 * w := by apply ht.trans change 64 * (2 : ℝ) ^ (1/4 : ℝ) * w ≤ 128 * w exact mul_le_mul_of_nonneg_right (by linarith) (by positivity) have h₁ : Real.log n ^ 2 ≤ Real.log n ^ 2 * w := le_mul_of_one_le_right (sq_nonneg _) hw have h₂ : w ≤ Real.log n ^ 2 * w := le_mul_of_one_le_left (zero_le_one.trans hw) hL2 rw [Real.log_mul hn.ne' (by positivity : |t| + 2 ≠ 0)] change _ ≤ 258 * Real.log n ^ 2 * w nlinarith only [h₁, h₂, htw, sq_nonneg (Real.log n - Real.log (|t| + 2))] private lemma diagonalSeries_norm_bound_at (N : ℕ) {a : ℝ} (ha : 0 < a) (w : ℂ) (hw : 2 * a ≤ w.re) : ‖diagonalSeries N w‖ ≤ (1 + a) * (Real.log 4 + 4) / a ^ 2 := by let f (n : ℕ) : ℂ := if 0 < n ∧ Nat.Coprime n N then (mangoldt n : ℂ)^2 / (n : ℂ)^(1+w) else 0 have hs : Summable (fun n => ‖f n‖) := by simpa only [f, apply_ite norm, norm_zero] using diagonalSeries_summable N (lt_of_lt_of_le (mul_pos two_pos ha) hw) calc ‖diagonalSeries N w‖ ≤ ∑' n, ‖f n‖ := norm_tsum_le_tsum_norm hs _ = ∑' j, ‖f (j + 1)‖ := by rw [hs.tsum_eq_zero_add]; simp [f] _ ≤ ∑' j, diagonalCoefficient N j * (j + 1 : ℕ) ^ (-2 * a) := by apply Summable.tsum_le_tsum _ ((summable_nat_add_iff 1).mpr hs) (diagonalCoefficient_power_summable N a ha) intro j have hn : 0 < ((j + 1 : ℕ) : ℝ) := by positivity simp only [f, Nat.succ_pos, true_and, diagonalCoefficient] split_ifs · simp only [norm_div, norm_pow, Complex.norm_real, Real.norm_eq_abs, sq_abs, Complex.norm_natCast_cpow_of_pos (Nat.succ_pos j), Complex.add_re, Complex.one_re] rw [show -2 * a = -(2*a) by ring, Real.rpow_neg hn.le] calc _ ≤ mangoldt (j+1)^2 / (j+1 : ℕ) ^ (1+2*a) := by apply div_le_div_of_nonneg_left (sq_nonneg _) (Real.rpow_pos_of_pos hn _) exact Real.rpow_le_rpow_of_exponent_le (by exact_mod_cast Nat.succ_pos j) (by linarith) _ = _ := by rw [Real.rpow_add hn, Real.rpow_one]; ring · simp _ ≤ _ := diagonalCoefficient_series_bound N a ha /-- On both vertical boundaries the squared residual kernel has an integrable product envelope, with one constant for all even moduli satisfying the local GRH. -/ theorem weightedKernel_standard_height_bound : ∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, ∀ (_ : NeZero N), Even N → Real.exp 10 < (N : ℝ) → GRH N → ∀ x ∈ Icc (alpha N) beta, ∀ y ∈ Icc (alpha N) beta, ∀ t u : ℝ, ‖weightedKernel N (line x t) (line y u)‖ ^ 2 ≤ C * Real.log N ^ 16 * (1 + |t|) ^ (-(3/2 : ℝ)) * (1 + |u|) ^ (-(3/2 : ℝ)) := by obtain ⟨B, hB, hmodel⟩ := continuedModel_uniform_power_bound let D := 2 * (Real.log 4 + 4) have hD : 0 < D := by dsimp [D]; positivity let A : ℝ := 3000 * 258 let C := A^2 + D + B have hC : 0 < C := by dsimp [C]; positivity refine ⟨16*C^2, by positivity, ?_⟩ intro N _ he hlarge hGRH let L := Real.log (N : ℝ) let a := alpha N obtain ⟨hN4, hLpos, hab⟩ := large_parameters hlarge have hN : 0 < N := by omega have hL : 1 ≤ L := by have ht := Real.log_lt_log (Real.exp_pos 10) hlarge rw [Real.log_exp] at ht dsimp [L]; linarith have ha : 0 < a := by change 0 < 1 / L; positivity have hainv : a⁻¹ = L := by simp [a, alpha, L] have ha1 : a ≤ 1 := hab.le.trans (by norm_num [beta]) have hLpow : L^2 ≤ L^8 := pow_le_pow_right₀ hL (by norm_num) let weight (t : ℝ) := (1 + |t|) ^ (1/4 : ℝ) have hw (t : ℝ) : 1 ≤ weight t := Real.one_le_rpow (by linarith [abs_nonneg t]) (by norm_num) have hlog (χ : Character N) (hχ : χ ∈ oddCharacters N) (s : ℂ) (hs : s.re ∈ Icc a beta) : ‖logDerivative χ s‖ ≤ (A * L ^ 4) * weight s.im := by have hd := logDerivative_disk_strip_bound a beta ha hab.le N inferInstance hN4 hGRH χ (odd_character_ne_one χ (Finset.mem_filter.mp hχ).2) s.re hs s.im rw [show line s.re s.im = s by apply Complex.ext <;> simp [line]] at hd have hc : 8 * (beta+5/2-a/2) / (a/2)^2 * (2*(4*beta+13)+1) ≤ 3000 * L^2 := by rw [← hainv] dsimp only [beta] field_simp [ha.ne'] nlinarith have ht := conductor_height_log_sq (Nat.cast_pos.mpr hN) hL s.im calc _ ≤ (3000 * L^2) * Real.log (N * (|s.im| + 2))^2 := hd.trans (mul_le_mul_of_nonneg_right hc (sq_nonneg _)) _ ≤ (3000 * L^2) * (258 * L^2 * weight s.im) := mul_le_mul_of_nonneg_left ht (by positivity) _ = _ := by dsimp only [A]; ring have hm : ‖(2 : ℂ) / N.totient‖ * (oddCharacters N).card = 1 := by simpa [norm_div] using odd_character_average_mass N he hN4 have char := characterKernel_power_bound_explicit N (A*L^4) (by dsimp [A]; positivity) hlog have hres (s z : ℂ) (hs : s.re ∈ Icc a beta) (hz : z.re ∈ Icc a beta) : ‖residual N s (conj z)‖ ≤ (C * L^8) * weight s.im * weight z.im := by have hp := char s z hs hz rw [hm, one_mul] at hp have hdiag := diagonalSeries_norm_bound_at N ha (s + conj z) (by simp only [Complex.add_re, Complex.conj_re]; linarith [hs.1, hz.1]) have hdiag' : ‖diagonalSeries N (s + conj z)‖ ≤ D * L^8 := by apply hdiag.trans calc _ = ((1+a)*(Real.log 4+4)) * (a⁻¹)^2 := by ring _ ≤ D * L^8 := by rw [hainv]; dsimp only [D]; gcongr; linarith have hq := hmodel a ha hab N hN s z hs hz rw [hainv] at hq have hq' : ‖continuedModel N s (conj z)‖ ≤ B * L^8 * weight s.im * weight z.im := hq.trans (by change B * L^2 * weight s.im * weight z.im ≤ _; gcongr) have hd' : ‖diagonalSeries N (s + conj z)‖ ≤ D * L^8 * weight s.im * weight z.im := by apply hdiag'.trans calc _ = D * L^8 * 1 * 1 := by ring _ ≤ _ := by gcongr <;> apply hw calc _ ≤ ‖characterKernel N s (conj z)‖ + ‖diagonalSeries N (s + conj z)‖ + ‖continuedModel N s (conj z)‖ := (norm_sub_le _ _).trans (add_le_add (norm_sub_le _ _) le_rfl) _ ≤ _ := by convert add_le_add (add_le_add hp hd') hq' using 1 dsimp only [C, weight]; ring intro x hx y hy t u convert weightedKernel_power_bound_of_residual ha.le N (C*L^8) (by positivity) hres x hx y hy t u using 1 dsimp only [L]; ring end ConditionalGoldbach