/- Released under Apache-2.0; see adjacent LICENSE. Finite shifted Euler product and actual Psi bound. No H/P, global summability, weighted product estimate, or parameter budget is assumed. -/ import SmoothRankin namespace ShiftedRankin noncomputable section open scoped BigOperators def delta (U Z : ℝ) : ℝ := Real.log U / (2 * Real.log Z) theorem delta_bounds (U Z : ℝ) (hU : 1 ≤ U) (hZ : 2 ≤ Z) (hlogZ : 1 ≤ Real.log Z) (hUZ : U ≤ Real.sqrt Z) : 0 ≤ delta U Z ∧ delta U Z ≤ 1 / 4 ∧ 0 < 1 - delta U Z := by have hU0 : 0 < U := by linarith have hZ0 : 0 < Z := by linarith have hL : 0 < Real.log Z := by linarith have hlogU : 0 ≤ Real.log U := Real.log_nonneg hU have hb := Real.log_le_log hU0 hUZ rw [Real.log_sqrt hZ0.le] at hb have hd0 : 0 ≤ delta U Z := div_nonneg hlogU (by positivity) have hd : delta U Z ≤ 1 / 4 := by unfold delta apply (div_le_iff₀ (by positivity : 0 < 2 * Real.log Z)).mpr linarith exact ⟨hd0, hd, by linarith⟩ theorem delta_log_identity (U Z : ℝ) (hlogZ : 0 < Real.log Z) : delta U Z * Real.log Z = Real.log U / 2 := by unfold delta field_simp [hlogZ.ne'] theorem prime_power_le_sqrtU (U Z : ℝ) (hU : 1 ≤ U) (hZ : 2 ≤ Z) (hlogZ : 1 ≤ Real.log Z) (hUZ : U ≤ Real.sqrt Z) {p : ℕ} (_hp : p.Prime) (hpZ : (p : ℝ) ≤ Z) : (p : ℝ) ^ (delta U Z) ≤ Real.sqrt U := by have hU0 : 0 < U := by linarith have hZ0 : 0 < Z := by linarith have hd := (delta_bounds U Z hU hZ hlogZ hUZ).1 calc _ ≤ Z ^ (delta U Z) := Real.rpow_le_rpow (Nat.cast_nonneg p) hpZ hd _ = Real.sqrt U := by rw [Real.rpow_def_of_pos hZ0, Real.sqrt_eq_rpow, Real.rpow_def_of_pos hU0] congr 1 have hi := delta_log_identity U Z (by linarith) linarith theorem prime_shift_facts {d : ℝ} (hd0 : 0 ≤ d) (hd : d ≤ 1 / 4) {p : ℕ} (hp : p.Prime) : 1 ≤ (p : ℝ) ^ d ∧ (p : ℝ) ^ d ≤ Real.sqrt p ∧ (p : ℝ) / 4 ≤ p - (p : ℝ) ^ d ∧ 0 < p - (p : ℝ) ^ d ∧ 0 < 1 - (p : ℝ) ^ (d - 1) := by have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp.two_le have hp0 : (0 : ℝ) < p := by linarith have hp1 : (1 : ℝ) < p := by linarith have hpower1 : 1 ≤ (p : ℝ) ^ d := by simpa using Real.rpow_le_rpow_of_exponent_le hp1.le hd0 have hpower : (p : ℝ) ^ d ≤ Real.sqrt p := by rw [Real.sqrt_eq_rpow] exact Real.rpow_le_rpow_of_exponent_le hp1.le (by linarith) have hsqrt : Real.sqrt (p : ℝ) ≤ 3 * p / 4 := by have hs := Real.sq_sqrt hp0.le have hn := Real.sqrt_nonneg (p : ℝ) have hm := mul_nonneg (show 0 ≤ (p : ℝ) - 2 by linarith) hp0.le nlinarith have hden : (p : ℝ) / 4 ≤ p - (p : ℝ) ^ d := by linarith have hlt : (p : ℝ) ^ (d - 1) < 1 := by simpa using Real.rpow_lt_rpow_of_exponent_lt hp1 (show d - 1 < 0 by linarith) exact ⟨hpower1, hpower, hden, by linarith, by linarith⟩ theorem prime_ratio_le {d : ℝ} (hd0 : 0 ≤ d) (hd : d ≤ 1 / 4) {p : ℕ} (hp : p.Prime) : (1 - 1 / (p : ℝ)) / (1 - (p : ℝ) ^ (d - 1)) ≤ Real.exp (4 * ((p : ℝ) ^ d - 1) / p) := by have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp.two_le have hp0 : (0 : ℝ) < p := by linarith have hf := prime_shift_facts hd0 hd hp have heq : (1 - 1 / (p : ℝ)) / (1 - (p : ℝ) ^ (d - 1)) = 1 + ((p : ℝ) ^ d - 1) / (p - (p : ℝ) ^ d) := by rw [Real.rpow_sub hp0, Real.rpow_one] field_simp [hp0.ne', hf.2.2.2.1.ne'] <;> ring rw [heq] calc _ ≤ 1 + 4 * ((p : ℝ) ^ d - 1) / p := by apply add_le_add le_rfl have hh := div_le_div_of_nonneg_left (sub_nonneg.mpr hf.1) (show 0 < (p : ℝ) / 4 by positivity) hf.2.2.1 calc _ ≤ ((p : ℝ) ^ d - 1) / (p / 4) := hh _ = _ := by ring _ ≤ _ := by simpa [add_comm] using Real.add_one_le_exp (4 * ((p : ℝ) ^ d - 1) / p) theorem exp_sub_one_le (x : ℝ) : Real.exp x - 1 ≤ x * Real.exp x := by have hh := mul_le_mul_of_nonneg_right (Real.add_one_le_exp (-x)) (Real.exp_pos x).le rw [← Real.exp_add, neg_add_cancel, Real.exp_zero] at hh nlinarith theorem prime_power_excess_le (U Z : ℝ) (hU : 1 ≤ U) (hZ : 2 ≤ Z) (hlogZ : 1 ≤ Real.log Z) (hUZ : U ≤ Real.sqrt Z) {p : ℕ} (hp : p.Prime) (hpZ : (p : ℝ) ≤ Z) : (p : ℝ) ^ (delta U Z) - 1 ≤ delta U Z * Real.log p * Real.sqrt U := by have hp0 : (0 : ℝ) < p := by exact_mod_cast hp.pos have hd := (delta_bounds U Z hU hZ hlogZ hUZ).1 have hx : 0 ≤ delta U Z * Real.log p := mul_nonneg hd (Real.log_nonneg (by exact_mod_cast hp.one_lt.le)) have he : Real.exp (delta U Z * Real.log p) = (p : ℝ) ^ (delta U Z) := by rw [Real.rpow_def_of_pos hp0]; congr 1; ring have hh := exp_sub_one_le (delta U Z * Real.log p) rw [he] at hh exact hh.trans (mul_le_mul_of_nonneg_left (prime_power_le_sqrtU U Z hU hZ hlogZ hUZ hp hpZ) hx) theorem prime_log_mass_real (Z : ℝ) (hZ : 2 ≤ Z) : (∑ p ∈ ManuscriptResidues.primeCutoff Z, Real.log p / (p : ℝ)) ≤ Real.log 4 * (2 + Real.log Z) := by have hZ0 : 0 ≤ Z := by linarith have hN : 2 ≤ ⌊Z⌋₊ := (Nat.le_floor_iff hZ0).mpr hZ have hN0 : (0 : ℝ) < (⌊Z⌋₊ : ℕ) := by exact_mod_cast (show 0 < ⌊Z⌋₊ by omega) have hl := Real.log_le_log hN0 (Nat.floor_le hZ0) rw [RealBand.primeCutoff_eq_floor] exact (PrimeLog.prime_log_mass_le _ hN).trans (mul_le_mul_of_nonneg_left (by linarith : 2 + Real.log (⌊Z⌋₊ : ℕ) ≤ 2 + Real.log Z) (Real.log_nonneg (by norm_num))) theorem shifted_error_sum_le (U Z : ℝ) (hU : 1 ≤ U) (hZ : 2 ≤ Z) (hlogZ : 1 ≤ Real.log Z) (hUZ : U ≤ Real.sqrt Z) : (∑ p ∈ ManuscriptResidues.primeCutoff Z, 4 * ((p : ℝ) ^ (delta U Z) - 1) / p) ≤ 6 * Real.log 4 * Real.sqrt U * Real.log U := by classical have hd := (delta_bounds U Z hU hZ hlogZ hUZ).1 have hc : 0 ≤ 4 * delta U Z * Real.sqrt U := by positivity calc _ ≤ ∑ p ∈ ManuscriptResidues.primeCutoff Z, 4 * (delta U Z * Real.log p * Real.sqrt U) / p := by apply Finset.sum_le_sum intro p hp have hf := (ManuscriptResidues.mem_primeCutoff Z (by linarith) p).mp hp apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg p) exact mul_le_mul_of_nonneg_left (prime_power_excess_le U Z hU hZ hlogZ hUZ hf.1 hf.2) (by norm_num) _ = (4 * delta U Z * Real.sqrt U) * ∑ p ∈ ManuscriptResidues.primeCutoff Z, Real.log p / (p : ℝ) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro p hp ring _ ≤ (4 * delta U Z * Real.sqrt U) * (Real.log 4 * (2 + Real.log Z)) := mul_le_mul_of_nonneg_left (prime_log_mass_real Z hZ) hc _ ≤ (4 * delta U Z * Real.sqrt U) * (3 * Real.log 4 * Real.log Z) := by apply mul_le_mul_of_nonneg_left _ hc have hl4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num) nlinarith _ = _ := by have hi := delta_log_identity U Z (by linarith) calc _ = 12 * Real.log 4 * Real.sqrt U * (delta U Z * Real.log Z) := by ring _ = _ := by rw [hi]; ring theorem ordinary_cutoff_inverse_le (Z : ℝ) (hZ : 2 ≤ Z) : (∏ p ∈ ManuscriptResidues.primeCutoff Z, (p : ℝ) / (p - 1)) ≤ RealBand.ordinaryConstant * Real.log Z := by have hZ0 : 0 ≤ Z := by linarith have hN : 2 ≤ ⌊Z⌋₊ := (Nat.le_floor_iff hZ0).mpr hZ have hN0 : (0 : ℝ) < (⌊Z⌋₊ : ℕ) := by exact_mod_cast (show 0 < ⌊Z⌋₊ by omega) have hl := Real.log_le_log hN0 (Nat.floor_le hZ0) rw [RealBand.primeCutoff_eq_floor] exact (MertensBand.ordinary_inverse_le _ hN).trans (mul_le_mul_of_nonneg_left hl (by positivity)) theorem shifted_product_identity (Z d : ℝ) (hZ : 2 ≤ Z) (hd0 : 0 ≤ d) (hd : d ≤ 1 / 4) : (∏ p ∈ ManuscriptResidues.primeCutoff Z, (1 - (p : ℝ) ^ (d - 1))⁻¹) = (∏ p ∈ ManuscriptResidues.primeCutoff Z, (p : ℝ) / (p - 1)) * ∏ p ∈ ManuscriptResidues.primeCutoff Z, (1 - 1 / (p : ℝ)) / (1 - (p : ℝ) ^ (d - 1)) := by classical rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro p hp have hprime := ((ManuscriptResidues.mem_primeCutoff Z (by linarith) p).mp hp).1 have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hprime.two_le have hp0 : (0 : ℝ) < p := by linarith have hf := prime_shift_facts hd0 hd hprime field_simp [hp0.ne', (show (p : ℝ) - 1 ≠ 0 by linarith), hf.2.2.2.2.ne'] /-- Fully proved finite shifted Euler product with the exact coefficient 6*log4. -/ theorem shifted_product_le (U Z : ℝ) (hU : 1 ≤ U) (hZ : 2 ≤ Z) (hlogZ : 1 ≤ Real.log Z) (hUZ : U ≤ Real.sqrt Z) : (∏ p ∈ ManuscriptResidues.primeCutoff Z, (1 - (p : ℝ) ^ (delta U Z - 1))⁻¹) ≤ RealBand.ordinaryConstant * Real.log Z * Real.exp (6 * Real.log 4 * Real.sqrt U * Real.log U) := by classical have hd := delta_bounds U Z hU hZ hlogZ hUZ have hratio : (∏ p ∈ ManuscriptResidues.primeCutoff Z, (1 - 1 / (p : ℝ)) / (1 - (p : ℝ) ^ (delta U Z - 1))) ≤ Real.exp (6 * Real.log 4 * Real.sqrt U * Real.log U) := by calc _ ≤ ∏ p ∈ ManuscriptResidues.primeCutoff Z, Real.exp (4 * ((p : ℝ) ^ (delta U Z) - 1) / p) := by apply Finset.prod_le_prod₀ · intro p hp have hp := ((ManuscriptResidues.mem_primeCutoff Z (by linarith) p).mp hp).1 have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp.two_le have hnum : 0 ≤ 1 - 1 / (p : ℝ) := by have hh := (div_le_one (show (0 : ℝ) < p by linarith)).mpr (show (1 : ℝ) ≤ p by linarith) linarith exact div_nonneg hnum (prime_shift_facts hd.1 hd.2.1 hp).2.2.2.2.le · intro p hp exact prime_ratio_le hd.1 hd.2.1 ((ManuscriptResidues.mem_primeCutoff Z (by linarith) p).mp hp).1 _ = Real.exp (∑ p ∈ ManuscriptResidues.primeCutoff Z, 4 * ((p : ℝ) ^ (delta U Z) - 1) / p) := (Real.exp_sum _ _).symm _ ≤ _ := Real.exp_le_exp.mpr (shifted_error_sum_le U Z hU hZ hlogZ hUZ) have hordinary : 0 ≤ ∏ p ∈ ManuscriptResidues.primeCutoff Z, (p : ℝ) / (p - 1) := by apply Finset.prod_nonneg intro p hp have hp := ((ManuscriptResidues.mem_primeCutoff Z (by linarith) p).mp hp).1 have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp.two_le exact div_nonneg (Nat.cast_nonneg p) (by linarith) rw [shifted_product_identity Z _ hZ hd.1 hd.2.1] exact (mul_le_mul_of_nonneg_left hratio hordinary).trans (mul_le_mul_of_nonneg_right (ordinary_cutoff_inverse_le Z hZ) (Real.exp_pos _).le) theorem shifted_X_power (X : ℕ) (hX : 1 ≤ X) (U Z : ℝ) (hlogZ : 0 < Real.log Z) (hUeq : U = Real.log (X : ℝ) / Real.log Z) : (X : ℝ) ^ (1 - delta U Z) = (X : ℝ) * Real.exp (-(U * Real.log U / 2)) := by have hX0 : (0 : ℝ) < X := by exact_mod_cast (show 0 < X by omega) have hlogX : Real.log (X : ℝ) = U * Real.log Z := by rw [hUeq] field_simp [hlogZ.ne'] have hid : delta U Z * Real.log (X : ℝ) = U * Real.log U / 2 := by rw [hlogX] have hi := delta_log_identity U Z hlogZ calc _ = U * (delta U Z * Real.log Z) := by ring _ = _ := by rw [hi]; ring rw [Real.rpow_def_of_pos hX0, show Real.log (X : ℝ) * (1 - delta U Z) = Real.log X + -(delta U Z * Real.log X) by ring, Real.exp_add, Real.exp_log hX0, hid] /-- Actual finite Psi bound with U exactly log(cast X)/log Z. -/ theorem finite_Psi_bound (X : ℕ) (hX : 1 ≤ X) (U Z : ℝ) (hU : 1 ≤ U) (hZ : 2 ≤ Z) (hlogZ : 1 ≤ Real.log Z) (hUZ : U ≤ Real.sqrt Z) (hUeq : U = Real.log (X : ℝ) / Real.log Z) : (EarlyCover.Psi X Z : ℝ) ≤ RealBand.ordinaryConstant * (X : ℝ) * Real.log Z * Real.exp (-(U * Real.log U) / 2 + 6 * Real.log 4 * Real.sqrt U * Real.log U) := by have hd := delta_bounds U Z hU hZ hlogZ hUZ have hr := SmoothRankin.finite_rankin hd.2.2 X hX Z hZ rw [show -(1 - delta U Z) = delta U Z - 1 by ring] at hr have hb := mul_le_mul_of_nonneg_left (shifted_product_le U Z hU hZ hlogZ hUZ) (Real.rpow_nonneg (Nat.cast_nonneg X) (1 - delta U Z)) apply hr.trans apply hb.trans_eq rw [shifted_X_power X hX U Z (by linarith) hUeq] rw [Real.exp_add] ring theorem actual_finite_Psi_bound (y A : ℝ) (hU : 1 ≤ SmoothParameters.u y A) (hZ : 2 ≤ SmoothParameters.Z y A) (hlogZ : 1 ≤ Real.log (SmoothParameters.Z y A)) (hUZ : SmoothParameters.u y A ≤ Real.sqrt (SmoothParameters.Z y A)) : (EarlyCover.Psi (SmoothParameters.X y A) (SmoothParameters.Z y A) : ℝ) ≤ RealBand.ordinaryConstant * (SmoothParameters.X y A : ℝ) * Real.log (SmoothParameters.Z y A) * Real.exp (-(SmoothParameters.u y A * Real.log (SmoothParameters.u y A)) / 2 + 6 * Real.log 4 * Real.sqrt (SmoothParameters.u y A) * Real.log (SmoothParameters.u y A)) := by exact finite_Psi_bound _ (by unfold SmoothParameters.X; omega) _ _ hU hZ hlogZ hUZ rfl end end ShiftedRankin #print axioms ShiftedRankin.delta #print axioms ShiftedRankin.delta_bounds #print axioms ShiftedRankin.delta_log_identity #print axioms ShiftedRankin.prime_power_le_sqrtU #print axioms ShiftedRankin.prime_shift_facts #print axioms ShiftedRankin.prime_ratio_le #print axioms ShiftedRankin.exp_sub_one_le #print axioms ShiftedRankin.prime_power_excess_le #print axioms ShiftedRankin.prime_log_mass_real #print axioms ShiftedRankin.shifted_error_sum_le #print axioms ShiftedRankin.ordinary_cutoff_inverse_le #print axioms ShiftedRankin.shifted_product_identity #print axioms ShiftedRankin.shifted_product_le #print axioms ShiftedRankin.shifted_X_power #print axioms ShiftedRankin.finite_Psi_bound #print axioms ShiftedRankin.actual_finite_Psi_bound