cfahlgren1/math / lean /OAI /NumberTheory /PrimeGaps /TaylorBounds.lean
cfahlgren1's picture
download
raw
29.1 kB
import OAI.NumberTheory.PrimeGaps.DirichletGrowth
namespace OAI
namespace LargePrimeGaps
open Filter
open Set Filter MeasureTheory
open scoped Topology ContDiff
open Asymptotics
open Asymptotics
open Asymptotics
open scoped Classical
open scoped ContDiff
open Topology
open scoped Convolution ContDiff Pointwise
open scoped ComplexConjugate
open Filter Topology
open Complex Filter Topology
open Complex Filter Topology Set MeasureTheory Asymptotics
open Finset
open Complex Filter Topology Finset
lemma power_series_tail_bound {a : ℕ → ℝ} {M r z : ℝ} (_hM : 0 ≤ M)
(hr : 0 < r) (hz : 0 ≤ z) (hzr : z < r)
(hb : ∀ n, |a n| ≤ M/r^n) (N : ℕ) :
|∑' n : ℕ, a (n+N)*z^(n+N)| ≤ M*(z/r)^N/(1-z/r) := by
have hρ : 0 ≤ z/r := div_nonneg hz hr.le
have hρ1 : z/r < 1 := (div_lt_one hr).mpr hzr
have hg := (summable_geometric_of_lt_one hρ hρ1).mul_left (M*(z/r)^N)
have hbound (n : ℕ) : ‖a (n+N)*z^(n+N)‖ ≤ (M*(z/r)^N)*(z/r)^n := by
rw [Real.norm_eq_abs,abs_mul,abs_of_nonneg (pow_nonneg hz _)]
calc
_ ≤ (M/r^(n+N))*z^(n+N) := mul_le_mul_of_nonneg_right (hb _) (pow_nonneg hz _)
_ = M*(z/r)^(n+N) := by rw [div_pow]; ring
_ = _ := by rw [pow_add]; ring
have hn := hg.of_nonneg_of_le (fun n => norm_nonneg _) hbound
calc
_ = ‖∑' n : ℕ, a (n+N)*z^(n+N)‖ := (Real.norm_eq_abs _).symm
_ ≤ ∑' n : ℕ, ‖a (n+N)*z^(n+N)‖ := norm_tsum_le_tsum_norm hn
_ ≤ ∑' n : ℕ, (M*(z/r)^N)*(z/r)^n := hn.tsum_le_tsum hbound hg
_ = _ := by rw [tsum_mul_left,tsum_geometric_of_lt_one hρ hρ1]; rfl
lemma residue_lower_bound_of_taylor {a : ℕ → ℝ} {R M r z : ℝ} {N : ℕ}
(hM : 0 ≤ M) (hr : 0 < r) (hz : 1 < z) (hzr : z < r)
(hb : ∀ n, |a n| ≤ M/r^n) (ha0 : 1-R ≤ a 0)
(ha : ∀ n, -R ≤ a n) (hN : 1 ≤ N)
(hvalue : (∑' n : ℕ, a n*z^n) ≤ R/(z-1))
(htail : M*(z/r)^N/(1-z/r) ≤ 1/2) :
(z-1)/2 ≤ R*z^N := by
have heach : ∀ n, (if n=0 then 1 else (0:ℝ)) - R*z^n ≤ a n*z^n := by
intro n
by_cases hn : n=0
· simpa [hn] using ha0
· simp only [hn,↓reduceIte,zero_sub]
nlinarith [mul_le_mul_of_nonneg_right (ha n) (pow_nonneg (zero_lt_one.trans hz).le n)]
have hsum := Finset.sum_le_sum (s := range N) (fun n _ => heach n)
have hzero : (∑ n ∈ range N, if n=0 then 1 else (0:ℝ)) = 1 := by
simp [show 0 < N by omega]
rw [sum_sub_distrib,hzero,←mul_sum] at hsum
have htail' := power_series_tail_bound hM hr (zero_lt_one.trans hz).le hzr hb N
have ht : -(1/2:ℝ) ≤ ∑' n : ℕ, a (n+N)*z^(n+N) := by
have := (abs_le.mp (htail'.trans htail)).1
linarith
have hs : Summable (fun n : ℕ => a n*z^n) := by
have hρ : 0 ≤ z/r := by positivity
have hρ1 : z/r < 1 := (div_lt_one hr).mpr hzr
apply ((summable_geometric_of_lt_one hρ hρ1).mul_left M).of_norm_bounded
intro n
rw [Real.norm_eq_abs,abs_mul,abs_of_nonneg (pow_nonneg (zero_lt_one.trans hz).le _)]
calc
_ ≤ (M/r^n)*z^n := mul_le_mul_of_nonneg_right (hb _) (pow_nonneg (zero_lt_one.trans hz).le _)
_ = M*(z/r)^n := by rw [div_mul_eq_mul_div,div_pow]; ring
have hdecomp := hs.sum_add_tsum_nat_add N
have hm : 1/2 ≤ R/(z-1)+R*(∑ n ∈ range N, z^n) := by linarith
have hgeom := geom_sum_mul z N
have hv := (le_div_iff₀ (sub_pos.mpr hz)).mp
(show (1/2:ℝ) ≤ (R+R*(∑ n ∈ range N, z^n)*(z-1))/(z-1) from by
rw [add_div,mul_div_cancel_right₀ _ (sub_pos.mpr hz).ne']
exact hm)
have hid : R+R*(∑ n ∈ range N, z^n)*(z-1) = R*z^N := by
rw [mul_assoc R, hgeom]
ring
rw [hid] at hv
linarith
noncomputable def signedTaylorCoeff (H : ℂ → ℂ) (n : ℕ) : ℝ :=
(((-1:ℂ)^n)*(n.factorial:ℂ)⁻¹*iteratedDeriv n H 2).re
lemma signedTaylorCoeff_hasSum {H : ℂ → ℂ} {r z : ℝ}
(hf : DifferentiableOn ℂ H (Metric.ball 2 r)) (hz : |z| < r) :
HasSum (fun n => signedTaylorCoeff H n*z^n) (H ((2-z:ℝ):ℂ)).re := by
have hmem : ((2-z:ℝ):ℂ) ∈ Metric.ball (2:ℂ) r := by
rw [Metric.mem_ball,dist_eq_norm]
have he : ((2-z:ℝ):ℂ)-(2:ℂ) = -(z:ℂ) := by push_cast; ring
simpa [he,Complex.norm_real,Real.norm_eq_abs] using hz
have hs := (Complex.hasSum_taylorSeries_on_ball hf hmem).map Complex.reCLM Complex.continuous_re
change HasSum (fun n => ((n.factorial:ℂ)⁻¹ *
((((2-z:ℝ):ℂ)-2)^n * iteratedDeriv n H 2)).re) (H ((2-z:ℝ):ℂ)).re at hs
convert hs using 1
funext n
dsimp [signedTaylorCoeff]
have he : ((2-z:ℝ):ℂ)-(2:ℂ) = -(z:ℂ) := by push_cast; ring
rw [he, show (-(z:ℂ))^n = (-1:ℂ)^n * (z:ℂ)^n by rw [←mul_pow]; congr 1; ring]
have hmul : (n.factorial:ℂ)⁻¹*((-1:ℂ)^n*(z:ℂ)^n*iteratedDeriv n H 2) =
((-1:ℂ)^n*(n.factorial:ℂ)⁻¹*iteratedDeriv n H 2)*(z:ℂ)^n := by ring
rw [hmul]
simp only [←Complex.ofReal_pow,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,
mul_zero,sub_zero]
lemma signedTaylorCoeff_norm_bound {H : ℂ → ℂ} {r M : ℝ} (hr : 0 < r)
(hf : DiffContOnCl ℂ H (Metric.ball 2 r))
(hb : ∀ s ∈ Metric.sphere 2 r, ‖H s‖ ≤ M) (n : ℕ) :
|signedTaylorCoeff H n| ≤ M/r^n := by
have hder := Complex.norm_iteratedDeriv_le_of_forall_mem_sphere_norm_le n hr hf hb
have hfact : (n.factorial:ℝ) ≠ 0 := by positivity
calc
_ ≤ ‖(-1:ℂ)^n*(n.factorial:ℂ)⁻¹*iteratedDeriv n H 2‖ := Complex.abs_re_le_norm _
_ = (n.factorial:ℝ)⁻¹*‖iteratedDeriv n H 2‖ := by simp [norm_pow]
_ ≤ (n.factorial:ℝ)⁻¹*((n.factorial:ℝ)*M/r^n) := by gcongr
_ = _ := by field_simp
lemma signedTaylorCoeff_residue {H : ℂ → ℂ} {R M r z : ℝ} {N : ℕ}
(hM : 0 ≤ M) (hr : 0 < r) (hz : 1 < z) (hzr : z < r)
(hf : DiffContOnCl ℂ H (Metric.ball 2 r))
(hb : ∀ s ∈ Metric.sphere 2 r, ‖H s‖ ≤ M)
(ha0 : 1-R ≤ (H 2).re) (ha : ∀ n, -R ≤ signedTaylorCoeff H n)
(hN : 1 ≤ N) (hvalue : (H ((2-z:ℝ):ℂ)).re ≤ R/(z-1))
(htail : M*(z/r)^N/(1-z/r) ≤ 1/2) :
(z-1)/2 ≤ R*z^N := by
apply residue_lower_bound_of_taylor hM hr hz hzr (signedTaylorCoeff_norm_bound hr hf hb)
(by simpa [signedTaylorCoeff] using ha0) ha hN ?_ htail
rw [(signedTaylorCoeff_hasSum hf.differentiableOn (by rwa [abs_of_pos (zero_lt_one.trans hz)])).tsum_eq]
exact hvalue
lemma signedTaylorCoeff_pole (R : ℝ) (n : ℕ) :
signedTaylorCoeff (fun s : ℂ => (R:ℂ)/(s-1)) n = R := by
unfold signedTaylorCoeff
simp only [div_eq_mul_inv,iteratedDeriv_const_mul_field]
have hi : iteratedDeriv n (fun s : ℂ => (s-1)⁻¹) 2 = (-1:ℂ)^n*n.factorial := by
rw [iteratedDeriv_eq_iterate]
simpa only [one_mul,one_pow, show (2:ℂ)-1=1 by norm_num, one_zpow,mul_one] using
congrFun (iter_deriv_inv_linear_sub n (1:ℂ) 1) 2
rw [hi]
have hf : (n.factorial:ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n
have hp : (-1:ℂ)^n*(-1:ℂ)^n = 1 := by rw [←mul_pow]; simp
have he : (-1:ℂ)^n*(n.factorial:ℂ)⁻¹*((R:ℂ)*((-1:ℂ)^n*n.factorial)) = R := by
calc
_ = ((-1:ℂ)^n*(-1:ℂ)^n)*(R:ℂ)*((n.factorial:ℂ)⁻¹*n.factorial) := by ring
_ = _ := by rw [hp,inv_mul_cancel₀ hf]; ring
rw [he,Complex.ofReal_re]
lemma signedTaylorCoeff_sub {F G : ℂ → ℂ} (hF : AnalyticAt ℂ F 2)
(hG : AnalyticAt ℂ G 2) (n : ℕ) :
signedTaylorCoeff (fun s => F s-G s) n = signedTaylorCoeff F n-signedTaylorCoeff G n := by
unfold signedTaylorCoeff
have hd := iteratedDeriv_sub (n:=n) hF.contDiffAt hG.contDiffAt
change iteratedDeriv n (fun s => F s-G s) 2 = _ at hd
rw [hd,mul_sub,Complex.sub_re]
open scoped ComplexOrder in
lemma signedTaylorCoeff_LSeries_nonneg {a : ℕ → ℂ} (ha : ∀ n, 0 ≤ a n)
(hc : LSeries.abscissaOfAbsConv a < (2:ℝ)) (n : ℕ) :
0 ≤ signedTaylorCoeff (LSeries a) n := by
have h := LSeries.iteratedDeriv_alternating ha hc n
have hf : (0:ℝ) ≤ (n.factorial:ℝ)⁻¹ := by positivity
have hr := (Complex.nonneg_iff.mp h).1
unfold signedTaylorCoeff
have he : (-1:ℂ)^n*(n.factorial:ℂ)⁻¹*iteratedDeriv n (LSeries a) 2 =
(n.factorial:ℂ)⁻¹*((-1:ℂ)^n*iteratedDeriv n (LSeries a) 2) := by ring
rw [he]
simpa using mul_nonneg hf hr
open scoped ComplexOrder in
lemma LSeries_two_re_ge_one {a : ℕ → ℂ} (ha : ∀ n, 0 ≤ a n)
(ha1 : 1 ≤ a 1) (hc : LSeries.abscissaOfAbsConv a < (2:ℝ)) :
1 ≤ (LSeries a 2).re := by
have hs : LSeriesSummable a 2 := LSeriesSummable_of_abscissaOfAbsConv_lt_re (by simpa using hc)
have hl := hs.le_tsum 1 (fun n _ => LSeries.term_nonneg (ha n) 2)
have hterm : LSeries.term a 2 1 = a 1 := by simp
rw [hterm] at hl
exact (Complex.le_def.mp (ha1.trans hl)).1
open scoped ComplexOrder in
lemma signedTaylorCoeff_regular_nonneg {H : ℂ → ℂ} {a : ℕ → ℂ} {R : ℝ}
(ha : ∀ n, 0 ≤ a n) (ha1 : 1 ≤ a 1)
(hc : LSeries.abscissaOfAbsConv a < (2:ℝ))
(he : H =ᶠ[𝓝 (2:ℂ)] fun s => LSeries a s-(R:ℂ)/(s-1)) :
1-R ≤ (H 2).re ∧ ∀ n, -R ≤ signedTaylorCoeff H n := by
have hL : AnalyticAt ℂ (LSeries a) 2 := LSeries_analyticOnNhd a 2 (by simpa using hc)
have hP : AnalyticAt ℂ (fun s : ℂ => (R:ℂ)/(s-1)) 2 :=
analyticAt_const.div (analyticAt_id.sub analyticAt_const) (by norm_num)
constructor
· rw [he.self_of_nhds]
have h := LSeries_two_re_ge_one ha ha1 hc
simp only [show (2:ℂ)-1=1 by norm_num,div_one,Complex.sub_re,Complex.ofReal_re]
linarith
· intro n
unfold signedTaylorCoeff
rw [he.iteratedDeriv_eq]
change -R ≤ signedTaylorCoeff (fun s => LSeries a s-(R:ℂ)/(s-1)) n
rw [signedTaylorCoeff_sub hL hP,signedTaylorCoeff_pole]
linarith [signedTaylorCoeff_LSeries_nonneg ha hc n]
lemma residue_polynomial_lower {a : ℕ → ℝ} {R A Q z ε : ℝ}
(hA : 0 ≤ A) (hQ : 2 ≤ Q) (hQA : 12*A ≤ Q)
(hz : 1 < z) (hz1 : z ≤ 5/4) (hzε : 60*(z-1) ≤ ε)
(hb : ∀ n, |a n| ≤ (A*Q^4)/(3/2)^n)
(ha0 : 1-R ≤ a 0) (ha : ∀ n, -R ≤ a n)
(hv : (∑' n : ℕ, a n*z^n) ≤ R/(z-1)) :
((z-1)/(2*z))*Q^(-ε) ≤ R := by
have hQ0 : 0 < Q := by linarith
have hQ1 : 1 ≤ Q := by linarith
have hlogQ : 0 < Real.log Q := Real.log_pos (by linarith)
have hz0 : 0 < z := by linarith
have hlogz : 0 < Real.log z := Real.log_pos hz
let N : ℕ := ⌈60*Real.log Q⌉₊
have hNlo : 60*Real.log Q ≤ (N:ℝ) := Nat.le_ceil _
have hNhi : (N:ℝ) < 60*Real.log Q+1 := Nat.ceil_lt_add_one (by positivity)
have hN : 1 ≤ N := by
have : 0 < (N:ℝ) := lt_of_lt_of_le (by positivity) hNlo
exact_mod_cast (show 1 ≤ N from Nat.one_le_iff_ne_zero.mpr (by exact_mod_cast this.ne'))
have hρ : 0 ≤ z/(3/2) := by positivity
have hρ1 : z/(3/2) ≤ 5/6 := by linarith
have hlogρ : Real.log (5/6:ℝ) ≤ -(1/6:ℝ) := by
have := Real.log_le_sub_one_of_pos (by norm_num : (0:ℝ) < 5/6)
linarith
have hdecay : (z/(3/2))^N ≤ Q^(-10:ℝ) := by
calc
_ ≤ (5/6:ℝ)^N := pow_le_pow_left₀ hρ hρ1 N
_ = Real.exp (Real.log (5/6:ℝ)*(N:ℝ)) := by
rw [←Real.rpow_natCast,Real.rpow_def_of_pos (by norm_num : (0:ℝ) < 5/6)]
_ ≤ Real.exp (Real.log Q*(-10)) := by
apply Real.exp_le_exp.mpr
have hN0 : (0:ℝ) ≤ N := Nat.cast_nonneg N
nlinarith [mul_le_mul_of_nonneg_right hlogρ hN0]
_ = _ := (Real.rpow_def_of_pos hQ0 _).symm
have htail : (A*Q^4)*(z/(3/2))^N/(1-z/(3/2)) ≤ 1/2 := by
have hden : 0 < 1-z/(3/2) := by linarith
have hpow : Q^4*Q^(-10:ℝ) ≤ Q⁻¹ := by
calc
_ = Q^(-6:ℝ) := by
rw [←Real.rpow_natCast,←Real.rpow_add hQ0]
norm_num
_ ≤ Q^(-1:ℝ) := Real.rpow_le_rpow_of_exponent_le hQ1 (by norm_num)
_ = Q⁻¹ := Real.rpow_neg_one Q
have hp : (A*Q^4)*(z/(3/2))^N ≤ A/Q := by
calc
_ ≤ (A*Q^4)*Q^(-10:ℝ) := mul_le_mul_of_nonneg_left hdecay (by positivity)
_ ≤ A*Q⁻¹ := by rw [mul_assoc]; exact mul_le_mul_of_nonneg_left hpow hA
_ = _ := by rw [div_eq_mul_inv]
have hAQ : A/Q ≤ 1/12 := (div_le_iff₀ hQ0).mpr (by linarith)
apply (div_le_iff₀ hden).mpr
nlinarith
have hres := residue_lower_bound_of_taylor (by positivity : (0:ℝ) ≤ A*Q^4)
(by norm_num : (0:ℝ) < 3/2) hz (by linarith : z < 3/2) hb ha0 ha hN hv htail
have hzpow : z^N ≤ z*Q^ε := by
have hlogz' : 60*Real.log z ≤ ε := by
have := Real.log_le_sub_one_of_pos hz0
linarith
calc
_ = Real.exp (Real.log z*(N:ℝ)) := by rw [←Real.rpow_natCast,Real.rpow_def_of_pos hz0]
_ ≤ Real.exp (Real.log z+(Real.log Q)*ε) := by
apply Real.exp_le_exp.mpr
have h1 := mul_le_mul_of_nonneg_left hNhi.le hlogz.le
have h2 := mul_le_mul_of_nonneg_left hlogz' hlogQ.le
nlinarith
_ = _ := by rw [Real.exp_add,Real.exp_log hz0,Real.rpow_def_of_pos hQ0]
have hR : 0 ≤ R := by
by_contra! h
have := mul_neg_of_neg_of_pos h (pow_pos hz0 N)
linarith
have hres' : (z-1)/2 ≤ R*(z*Q^ε) := hres.trans (mul_le_mul_of_nonneg_left hzpow hR)
rw [Real.rpow_neg hQ0.le,←div_eq_mul_inv]
apply (div_le_iff₀ (Real.rpow_pos_of_pos hQ0 ε)).mpr
apply (div_le_iff₀ (by positivity : (0:ℝ) < 2*z)).mpr
nlinarith
open Complex Filter Topology Finset Set MeasureTheory
noncomputable def zetaRegular : ℂ → ℂ :=
regularSeries (positiveCoefficients (fun _ => 1)) 1
lemma zetaRegular_differentiableAt {s : ℂ} (hs : 0 < s.re) :
DifferentiableAt ℂ zetaRegular s :=
regularSeries_differentiableAt zero_le_one (fun _ ht => discrepancy_constant_bound ht.le) hs
lemma zetaRegular_eq_of_one_lt_re {s : ℂ} (hs : 1 < s.re) :
zetaRegular s = riemannZeta s-1/(s-1) := by
rw [zetaRegular,regularSeries_eq_LSeries_sub (positiveCoefficients_norm_le (by simp))
zero_le_one (fun _ ht => discrepancy_constant_bound ht.le) hs,LSeries_positiveCoefficients]
rw [show (fun _ : ℕ => (1:ℂ)) = 1 from rfl,LSeries_one_eq_riemannZeta hs]
lemma poleRemovedZeta_eq {s : ℂ} (hs : 0 < s.re) :
DirichletCharacter.LFunctionTrivChar₁ 1 s = (s-1)*zetaRegular s+1 := by
have hF : AnalyticOnNhd ℂ (DirichletCharacter.LFunctionTrivChar₁ 1) {s : ℂ | 0 < s.re} :=
fun z _ => (DirichletCharacter.differentiable_LFunctionTrivChar₁ 1).analyticAt z
have hG : AnalyticOnNhd ℂ (fun s : ℂ => (s-1)*zetaRegular s+1) {s : ℂ | 0 < s.re} := by
apply DifferentiableOn.analyticOnNhd ?_ (continuous_re.isOpen_preimage _ isOpen_Ioi)
intro z hz
exact (((differentiableAt_id.sub_const 1).mul (zetaRegular_differentiableAt hz)).add_const 1).differentiableWithinAt
have he : DirichletCharacter.LFunctionTrivChar₁ 1 =ᶠ[𝓝 (2:ℂ)]
fun s : ℂ => (s-1)*zetaRegular s+1 := by
filter_upwards [(continuous_re.tendsto (2:ℂ)).eventually
(lt_mem_nhds (by norm_num : (1:ℝ) < (2:ℂ).re))] with z hz
have hz1 : z ≠ 1 := by intro h; simp [h] at hz
rw [DirichletCharacter.LFunctionTrivChar₁,Function.update_of_ne hz1,
DirichletCharacter.LFunctionTrivChar,DirichletCharacter.LFunction_modOne_eq,
zetaRegular_eq_of_one_lt_re hz]
field_simp
ring
exact hF.eqOn_of_preconnected_of_eventuallyEq hG (convex_halfSpace_re_gt 0).isPreconnected
(show (2:ℂ) ∈ {s : ℂ | 0 < s.re} by norm_num) he hs
lemma zetaRegular_eq {s : ℂ} (hs : 0 < s.re) (hs1 : s ≠ 1) :
zetaRegular s = riemannZeta s-1/(s-1) := by
have h := poleRemovedZeta_eq hs
rw [DirichletCharacter.LFunctionTrivChar₁,Function.update_of_ne hs1,
DirichletCharacter.LFunctionTrivChar,DirichletCharacter.LFunction_modOne_eq] at h
have hn : s-1 ≠ 0 := sub_ne_zero.mpr hs1
apply (mul_left_cancel₀ hn)
rw [mul_sub,mul_div_cancel₀ _ hn]
linear_combination -h
lemma regularSeries_norm_simple {f : ℕ → ℂ} {c : ℂ} {D : ℝ} (hD : 0 ≤ D)
(hb : ∀ t, 1 < t → ‖seriesDiscrepancy f c t‖ ≤ D) {s : ℂ} (hs : 0 < s.re) :
‖regularSeries f c s‖ ≤ ‖c‖+‖s‖*D/s.re := by
have h := discrepancyTail_norm_le zero_lt_one hD (measurable_seriesDiscrepancy f c) hb hs
simp only [Real.one_rpow,mul_one] at h
calc
_ ≤ ‖c‖+‖s*discrepancyTail (seriesDiscrepancy f c) 1 s‖ := norm_add_le _ _
_ ≤ ‖c‖+‖s‖*(D/s.re) := by rw [norm_mul]; gcongr
_ = _ := by ring
lemma closedBall_two_re_norm {s : ℂ} (hs : s ∈ Metric.closedBall 2 (7/4:ℝ)) :
(1/4:ℝ) ≤ s.re ∧ ‖s‖ ≤ 4 := by
have hd := Metric.mem_closedBall.mp hs
have hr := Complex.re_le_norm ((2:ℂ)-s)
rw [Complex.sub_re,←dist_eq_norm,dist_comm] at hr
have hn : ‖s‖ ≤ dist s 2+‖(2:ℂ)‖ := by simpa [dist_eq_norm] using norm_add_le (s-2) (2:ℂ)
norm_num at hr hn
constructor <;> linarith
lemma zetaRegular_norm_le_seventeen {s : ℂ} (hs : s ∈ Metric.closedBall 2 (7/4:ℝ)) :
‖zetaRegular s‖ ≤ 17 := by
obtain ⟨hre,hnorm⟩ := closedBall_two_re_norm hs
have hp : 0 < s.re := by linarith
have h := regularSeries_norm_simple zero_le_one (fun _ ht => discrepancy_constant_bound ht.le) hp
change ‖zetaRegular s‖ ≤ _ at h
norm_num at h
have hq : ‖s‖/s.re ≤ 16 := (div_le_iff₀ hp).mpr (by linarith)
linarith
lemma LFunction_norm_polynomial {q : ℕ} [NeZero q] {χ : DirichletCharacter ℂ q}
(hχ : χ ≠ 1) {s : ℂ} (hs : s ∈ Metric.closedBall 2 (7/4:ℝ)) :
‖χ.LFunction s‖ ≤ 16*((q:ℝ)+1) := by
obtain ⟨hre,hnorm⟩ := closedBall_two_re_norm hs
have hp : 0 < s.re := by linarith
have hb := regularSeries_norm_simple (by positivity : (0:ℝ) ≤ q+1)
(fun t _ => discrepancy_character_bound hχ t) hp
rw [regularSeries_character_eq hχ hp] at hb
simp only [norm_zero,zero_add] at hb
apply hb.trans
apply (div_le_iff₀ hp).mpr
nlinarith [Nat.cast_nonneg (α:=ℝ) q]
noncomputable def regularizedZetaProduct (P : ℂ → ℂ) (s : ℂ) : ℂ :=
zetaRegular s*P s+dslope P 1 s
lemma regularizedZetaProduct_differentiableOn {P : ℂ → ℂ}
(hP : DifferentiableOn ℂ P {s : ℂ | 0 < s.re}) :
DifferentiableOn ℂ (regularizedZetaProduct P) {s : ℂ | 0 < s.re} := by
have hs : {s : ℂ | 0 < s.re} ∈ 𝓝 (1:ℂ) :=
(continuous_re.isOpen_preimage _ isOpen_Ioi).mem_nhds (by norm_num)
have hd := (Complex.differentiableOn_dslope hs).mpr hP
have hz : DifferentiableOn ℂ zetaRegular {s : ℂ | 0 < s.re} :=
fun s hs => (zetaRegular_differentiableAt hs).differentiableWithinAt
exact (hz.mul hP).add hd
lemma regularizedZetaProduct_eq {P : ℂ → ℂ} {s : ℂ} (hs : 0 < s.re) (hs1 : s ≠ 1) :
regularizedZetaProduct P s = riemannZeta s*P s-P 1/(s-1) := by
rw [regularizedZetaProduct,zetaRegular_eq hs hs1,dslope_of_ne P hs1,slope_def_field]
ring
lemma regularizedZetaProduct_bound {P : ℂ → ℂ} {B : ℝ}
(hP : DifferentiableOn ℂ P {s : ℂ | 0 < s.re}) (_hB : 0 ≤ B)
(hb : ∀ s ∈ Metric.closedBall (2:ℂ) (7/4:ℝ), ‖P s‖ ≤ B) :
DiffContOnCl ℂ (regularizedZetaProduct P) (Metric.ball 2 (3/2:ℝ)) ∧
∀ s ∈ Metric.closedBall (2:ℂ) (3/2:ℝ), ‖regularizedZetaProduct P s‖ ≤ 21*B := by
have hsRe (s : ℂ) (hs : s ∈ Metric.closedBall 2 (7/4:ℝ)) : 0 < s.re := by
have := (closedBall_two_re_norm hs).1
linarith
have hder (s : ℂ) (hs : s ∈ Metric.closedBall 2 (3/2:ℝ)) : ‖deriv P s‖ ≤ 4*B := by
have hsub : Metric.closedBall s (1/4:ℝ) ⊆ Metric.closedBall (2:ℂ) (7/4:ℝ) := by
intro z hz
have hdist := dist_triangle z s (2:ℂ)
have hz' := Metric.mem_closedBall.mp hz
have hs' := Metric.mem_closedBall.mp hs
apply Metric.mem_closedBall.mpr
linarith
have hdiff : DiffContOnCl ℂ P (Metric.ball s (1/4:ℝ)) := by
apply DifferentiableOn.diffContOnCl
rw [closure_ball _ (by norm_num : (1/4:ℝ) ≠ 0)]
exact hP.mono (fun z hz => hsRe z (hsub hz))
have h := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le (by norm_num : (0:ℝ) < 1/4)
hdiff (fun z hz => hb z (hsub (Metric.sphere_subset_closedBall hz)))
convert h using 1; ring
have hone : (1:ℂ) ∈ Metric.closedBall (2:ℂ) (3/2:ℝ) := by
norm_num [Metric.mem_closedBall,dist_eq_norm]
have hdslope (s : ℂ) (hs : s ∈ Metric.closedBall 2 (3/2:ℝ)) : ‖dslope P 1 s‖ ≤ 4*B := by
by_cases hs1 : s = 1
· subst s
simpa only [dslope_same] using hder 1 hone
· rw [dslope_of_ne P hs1,slope_def_field,norm_div]
have hd := (convex_closedBall (2:ℂ) (3/2:ℝ)).norm_image_sub_le_of_norm_deriv_le
(fun z hz => (hP z (hsRe z (Metric.closedBall_subset_closedBall (by norm_num) hz))).differentiableAt
((continuous_re.isOpen_preimage _ isOpen_Ioi).mem_nhds
(hsRe z (Metric.closedBall_subset_closedBall (by norm_num) hz)))) hder hone hs
exact (div_le_iff₀ (norm_pos_iff.mpr (sub_ne_zero.mpr hs1))).mpr hd
constructor
· apply DifferentiableOn.diffContOnCl
rw [closure_ball _ (by norm_num : (3/2:ℝ) ≠ 0)]
exact (regularizedZetaProduct_differentiableOn hP).mono
(fun z hz => hsRe z (Metric.closedBall_subset_closedBall (by norm_num) hz))
· intro s hs
have hs' := Metric.closedBall_subset_closedBall (by norm_num : (3/2:ℝ) ≤ 7/4) hs
calc
_ ≤ ‖zetaRegular s*P s‖+‖dslope P 1 s‖ := norm_add_le _ _
_ ≤ 17*B+4*B := by rw [norm_mul]; gcongr; exact zetaRegular_norm_le_seventeen hs'; exact hb s hs'; exact hdslope s hs
_ = _ := by ring
open Complex Finset ArithmeticFunction
open scoped ComplexOrder
def PrimePowerEq (p : ℕ) (f g : ArithmeticFunction ℂ) : Prop :=
∀ k : ℕ, f (p^k) = g (p^k)
lemma PrimePowerEq.refl (p : ℕ) (f : ArithmeticFunction ℂ) : PrimePowerEq p f f := fun _ => rfl
lemma PrimePowerEq.mul {p : ℕ} (hp : p.Prime) {f f' g g' : ArithmeticFunction ℂ}
(hf : PrimePowerEq p f f') (hg : PrimePowerEq p g g') : PrimePowerEq p (f*g) (f'*g') := by
intro k
simp only [ArithmeticFunction.mul_apply]
apply Finset.sum_congr rfl
intro x hx
obtain ⟨i,hi,hxi⟩ := (Nat.dvd_prime_pow hp).mp (Nat.mem_divisors.mp
(Nat.fst_mem_divisors_of_mem_antidiagonal hx)).1
obtain ⟨j,hj,hxj⟩ := (Nat.dvd_prime_pow hp).mp (Nat.mem_divisors.mp
(Nat.snd_mem_divisors_of_mem_antidiagonal hx)).1
rw [hxi,hxj,hf,hg]
lemma primePower_zeta {p : ℕ} (hp : p.Prime) (k : ℕ) :
(ArithmeticFunction.zeta : ArithmeticFunction ℂ) (p^k) = 1 := by
simp [hp.ne_zero]
lemma primePower_one {p : ℕ} (hp : p.Prime) (k : ℕ) :
(1 : ArithmeticFunction ℂ) (p^k) = (0:ℂ)^k := by
cases k with
| zero => simp
| succ k =>
have hn : p^(k+1) ≠ 1 := by
have h : 1 < p^(k+1) := one_lt_pow₀ hp.one_lt (by omega)
omega
simp [hp.ne_one]
lemma primePower_character {q p : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) (k : ℕ) :
toArithmeticFunction (χ ·) (p^k) = χ (p : ZMod q)^k := by
simp [toArithmeticFunction,hp.ne_zero]
lemma arithmetic_convolution_nonneg {f g : ArithmeticFunction ℂ}
(hf : ∀ n, 0 ≤ f n) (hg : ∀ n, 0 ≤ g n) (n : ℕ) : 0 ≤ (f*g) n := by
rw [ArithmeticFunction.mul_apply]
exact Finset.sum_nonneg (fun x _ => mul_nonneg (hf x.1) (hg x.2))
noncomputable def biquadraticCoefficients {q r : ℕ}
(χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) : ArithmeticFunction ℂ :=
ArithmeticFunction.zeta * toArithmeticFunction (χ ·) * toArithmeticFunction (ψ ·) *
(toArithmeticFunction (χ ·)).pmul (toArithmeticFunction (ψ ·))
lemma biquadraticCoefficients_multiplicative {q r : ℕ}
(χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) :
(biquadraticCoefficients χ ψ).IsMultiplicative := by
exact ((isMultiplicative_zeta.natCast.mul (DirichletCharacter.isMultiplicative_toArithmeticFunction χ)).mul
(DirichletCharacter.isMultiplicative_toArithmeticFunction ψ)).mul
((DirichletCharacter.isMultiplicative_toArithmeticFunction χ).pmul (DirichletCharacter.isMultiplicative_toArithmeticFunction ψ))
lemma biquadraticCoefficients_comm {q r : ℕ}
(χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) :
biquadraticCoefficients χ ψ = biquadraticCoefficients ψ χ := by
unfold biquadraticCoefficients
rw [ArithmeticFunction.pmul_comm]
ring
lemma biquadratic_prime_zero {q r p : ℕ}
(χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hp : p.Prime)
(hχ : χ (p : ZMod q) = 0) :
PrimePowerEq p (biquadraticCoefficients χ ψ) ψ.zetaMul := by
have hf : PrimePowerEq p (toArithmeticFunction (χ ·)) 1 := by
intro k
rw [primePower_character χ hp, hχ,primePower_one hp]
have hh : PrimePowerEq p ((toArithmeticFunction (χ ·)).pmul (toArithmeticFunction (ψ ·))) 1 := by
intro k
rw [ArithmeticFunction.pmul_apply,primePower_character χ hp,primePower_character ψ hp,
hχ,←mul_pow,zero_mul,primePower_one hp]
have h := ((PrimePowerEq.refl p (ArithmeticFunction.zeta : ArithmeticFunction ℂ)).mul hp hf).mul hp
(PrimePowerEq.refl p (toArithmeticFunction (ψ ·))) |>.mul hp hh
simpa only [mul_one,biquadraticCoefficients,DirichletCharacter.zetaMul] using h
lemma biquadratic_prime_one {q r p : ℕ}
(χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hp : p.Prime)
(hχ : χ (p : ZMod q) = 1) :
PrimePowerEq p (biquadraticCoefficients χ ψ) (ψ.zetaMul*ψ.zetaMul) := by
have hf : PrimePowerEq p (toArithmeticFunction (χ ·)) ArithmeticFunction.zeta := by
intro k
rw [primePower_character χ hp,hχ,one_pow,primePower_zeta hp]
have hh : PrimePowerEq p ((toArithmeticFunction (χ ·)).pmul (toArithmeticFunction (ψ ·)))
(toArithmeticFunction (ψ ·)) := by
intro k
rw [ArithmeticFunction.pmul_apply,primePower_character χ hp,hχ,one_pow,one_mul]
have h := ((PrimePowerEq.refl p (ArithmeticFunction.zeta : ArithmeticFunction ℂ)).mul hp hf).mul hp
(PrimePowerEq.refl p (toArithmeticFunction (ψ ·))) |>.mul hp hh
have he : (ArithmeticFunction.zeta : ArithmeticFunction ℂ)*ArithmeticFunction.zeta*
toArithmeticFunction (ψ ·)*toArithmeticFunction (ψ ·) = ψ.zetaMul*ψ.zetaMul := by
unfold DirichletCharacter.zetaMul
ring
simpa only [he,biquadraticCoefficients] using h
lemma biquadratic_prime_neg_one {q r p : ℕ}
(χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hp : p.Prime)
(hχ : χ (p : ZMod q) = -1) (hψ : ψ (p : ZMod r) = -1) :
PrimePowerEq p (biquadraticCoefficients χ ψ) (χ.zetaMul*χ.zetaMul) := by
have hg : PrimePowerEq p (toArithmeticFunction (ψ ·)) (toArithmeticFunction (χ ·)) := by
intro k
rw [primePower_character ψ hp,primePower_character χ hp,hχ,hψ]
have hh : PrimePowerEq p ((toArithmeticFunction (χ ·)).pmul (toArithmeticFunction (ψ ·)))
ArithmeticFunction.zeta := by
intro k
rw [ArithmeticFunction.pmul_apply,primePower_character χ hp,primePower_character ψ hp,
hχ,hψ,←mul_pow,neg_mul_neg,one_mul,one_pow,primePower_zeta hp]
have h := ((PrimePowerEq.refl p (ArithmeticFunction.zeta : ArithmeticFunction ℂ)).mul hp
(PrimePowerEq.refl p (toArithmeticFunction (χ ·)))).mul hp hg |>.mul hp hh
have he : (ArithmeticFunction.zeta : ArithmeticFunction ℂ)*toArithmeticFunction (χ ·)*
toArithmeticFunction (χ ·)*ArithmeticFunction.zeta = χ.zetaMul*χ.zetaMul := by
unfold DirichletCharacter.zetaMul
ring
simpa only [he,biquadraticCoefficients] using h
lemma biquadraticCoefficients_nonneg {q r : ℕ} {χ : DirichletCharacter ℂ q}
{ψ : DirichletCharacter ℂ r} (hχ : χ^2=1) (hψ : ψ^2=1) (n : ℕ) :
0 ≤ biquadraticCoefficients χ ψ n := by
have hp (p : ℕ) (hp : p.Prime) (k : ℕ) : 0 ≤ biquadraticCoefficients χ ψ (p^k) := by
rcases MulChar.isQuadratic_iff_sq_eq_one.mpr hχ (p:ZMod q) with h0|h1|hm
· rw [biquadratic_prime_zero χ ψ hp h0 k]
exact DirichletCharacter.zetaMul_nonneg hψ _
· rw [biquadratic_prime_one χ ψ hp h1 k]
exact arithmetic_convolution_nonneg (DirichletCharacter.zetaMul_nonneg hψ)
(DirichletCharacter.zetaMul_nonneg hψ) _
· rcases MulChar.isQuadratic_iff_sq_eq_one.mpr hψ (p:ZMod r) with h0|h1|hm'
· rw [biquadraticCoefficients_comm χ ψ,biquadratic_prime_zero ψ χ hp h0 k]
exact DirichletCharacter.zetaMul_nonneg hχ _
· rw [biquadraticCoefficients_comm χ ψ,biquadratic_prime_one ψ χ hp h1 k]
exact arithmetic_convolution_nonneg (DirichletCharacter.zetaMul_nonneg hχ)
(DirichletCharacter.zetaMul_nonneg hχ) _
· rw [biquadratic_prime_neg_one χ ψ hp hm hm' k]
exact arithmetic_convolution_nonneg (DirichletCharacter.zetaMul_nonneg hχ)
(DirichletCharacter.zetaMul_nonneg hχ) _
rcases eq_or_ne n 0 with rfl|hn
· simp
· simpa only [(biquadraticCoefficients_multiplicative χ ψ).multiplicative_factorization _ hn,
Finsupp.prod, Nat.support_factorization] using
Finset.prod_nonneg (fun p hp' => hp p (Nat.prime_of_mem_primeFactors hp') _)
end LargePrimeGaps
end OAI

Xet Storage Details

Size:
29.1 kB
·
Xet hash:
457f14412d5e904ee61cedba643dc0b0e94d996be27d2780ac3b217b3759eba7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.