theoremharmonicProgression_error_of_count_error (M : ℕ) (r : ℤ) {lo hi δ : ℝ}
(hlo : 0 < lo) (hlohi : lo ≤ hi) (hA : 2≤Real.exp lo)
(herror : ∀ x ∈Icc (Real.exp lo) (Real.exp hi),
|((Erdos970.Erdos970Dependency.SiegelWalfisz.intervalPrimes 0 x M r).card : ℝ) -
logarithmicIntegral x / (M.totient : ℝ)| ≤ δ * x) :
|harmonicProgression ⌊Real.exp hi⌋₊ M (r : ZModM) lo hi - harmonicIntegral M lo hi| ≤
(2 + hi - lo) * δ + Real.exp (-lo) :=by
proof · 37
lines
havehAB : Real.exp lo ≤Real.exp hi :=Real.exp_le_exp.mpr hlohi
havehhi : 0 < hi := hlo.trans_le hlohi
havehmain : ∀ t ∈Icc (Real.exp lo) (Real.exp hi),
HasDerivAt (fun x => logarithmicIntegral x / (M.totient : ℝ))
((M.totient : ℝ)⁻¹ / Real.log t) t :=by
intro t ht
exact progression_main_hasDerivAt M (hA.trans ht.1)
havehcont : ContinuousOn (funt : ℝ=> (M.totient : ℝ)⁻¹ / Real.log t)
(Icc (Real.exp lo) (Real.exp hi)) :=by
simpa only [div_eq_mul_inv] using
(continuousOn_log_inv (B:=Real.exp hi) (bylinarith : 1 < Real.exp lo)).const_mul
(M.totient : ℝ)⁻¹havehe : ∀ x ∈Icc (Real.exp lo) (Real.exp hi),
|cumulativeSum (primeCoefficient M (r : ZModM)) x -
logarithmicIntegral x / (M.totient : ℝ)| ≤ δ * x :=by
intro x hx
rw [cumulativeSum_primeCoefficient M r ((Real.exp_pos lo).le.trans hx.1)]
exact herror x hx
have h := reciprocal_count_error_bound (primeCoefficient M (r : ZModM))
(fun x => logarithmicIntegral x / (M.totient : ℝ))
(fun x => (M.totient : ℝ)⁻¹ / Real.log x) (Real.exp_pos lo) hAB hmain hcont he
rw [reciprocal_primeCoefficient_sum, progression_main_integral_eq M hlo hhi] at h
simp only [Real.log_exp] at h
have hleft := closed_left_endpoint_error M (r : ZModM) lo hi
havehid : harmonicProgression ⌊Real.exp hi⌋₊ M (r : ZModM) lo hi - harmonicIntegral M lo hi =
(harmonicProgression ⌊Real.exp hi⌋₊ M (r : ZModM) lo hi -
∑ n ∈ openLogPrimeSupport M (r : ZModM) lo hi, (n : ℝ)⁻¹) +
((∑ n ∈ openLogPrimeSupport M (r : ZModM) lo hi, (n : ℝ)⁻¹) - harmonicIntegral M lo hi) :=by ring
rw [hid]
calc
_ ≤ |harmonicProgression ⌊Real.exp hi⌋₊ M (r : ZModM) lo hi -
∑ n ∈ openLogPrimeSupport M (r : ZModM) lo hi, (n : ℝ)⁻¹| +
|(∑ n ∈ openLogPrimeSupport M (r : ZModM) lo hi, (n : ℝ)⁻¹) - harmonicIntegral M lo hi| :=
abs_add_le _ _
_ ≤Real.exp (-lo) + (2 + hi - lo) * δ :=
add_le_add (by simpa only [abs_of_nonneg hleft.1] using hleft.2) h
_ = _ :=by ring
theoremharmonicProgression_error_short_interval (M : ℕ) (r : ℤ) {lo hi δ : ℝ}
(hlo : 0 < lo) (hlohi : lo ≤ hi) (hlen : hi - lo ≤1) (hA : 2≤Real.exp lo)
(hδ : 0≤ δ)
(herror : ∀ x ∈Icc (Real.exp lo) (Real.exp hi),
|((Erdos970.Erdos970Dependency.SiegelWalfisz.intervalPrimes 0 x M r).card : ℝ) -
logarithmicIntegral x / (M.totient : ℝ)| ≤ δ * x) :
|harmonicProgression ⌊Real.exp hi⌋₊ M (r : ZModM) lo hi - harmonicIntegral M lo hi| ≤3 * δ + Real.exp (-lo) :=by
proof · 3
lines
apply (harmonicProgression_error_of_count_error M r hlo hlohi hA herror).trans
have h := mul_le_mul_of_nonneg_right (show2 + hi - lo ≤3by linarith) hδ
linarith