Skip to main content
AlexKontorovich/PrimeNumberTheoremAnd
Source indexedlemma · leanprover/lean4:v4.32.0

sum_mobius_div_approx

PrimeNumberTheoremAnd.Consequences · PrimeNumberTheoremAnd/Consequences.lean:2352 to 2367

Mathematical statement

Exact Lean statement

lemma sum_mobius_div_approx (x : ℝ) (K : ℕ) (hK : 0 < K) (hx : 1 ≤ x) :
  |x * (∑ n ∈ Icc 1 ⌊x/K⌋₊, (μ n : ℝ) / n) - 1| ≤ x/K + |∑ n ∈ Ioc ⌊x/K⌋₊ ⌊x⌋₊, (μ n : ℝ) * (⌊x / (n : ℝ)⌋ : ℝ)|

Complete declaration

Lean source

Canonical source
Full Lean sourceLean 4
lemma sum_mobius_div_approx (x : ) (K : ) (hK : 0 < K) (hx : 1  x) :  |x * (∑ n  Icc 1 ⌊x/K⌋₊, (μ n : ) / n) - 1|  x/K + |∑ n  Ioc ⌊x/K⌋₊ ⌊x⌋₊, (μ n : ) * (⌊x / (n : )⌋ : )| := by    have h_split : ∑ n  Finset.Icc 1 ⌊x⌋₊, (μ n : ) * ⌊x / (n : )⌋ = (∑ n  Finset.Icc 1 ⌊x / (K : )⌋₊, (μ n : ) * ⌊x / (n : )⌋) + (∑ n  Finset.Ioc ⌊x / (K : )⌋₊ ⌊x⌋₊, (μ n : ) * ⌊x / (n : )⌋) := by      erw [Finset.sum_Ioc_consecutive] <;> norm_num      · rfl      · exact Nat.floor_mono <| div_le_self (by positivity) <| mod_cast hK    have h_floor : ∑ n  Finset.Icc 1 ⌊x / (K : )⌋₊, (μ n : ) * ⌊x / (n : )⌋ = x * ∑ n  Finset.Icc 1 ⌊x / (K : )⌋₊, (μ n : ) / (n : ) - ∑ n  Finset.Icc 1 ⌊x / (K : )⌋₊, (μ n : ) * (x / (n : ) - ⌊x / (n : )⌋) := by      rw [Finset.mul_sum _ _ _] ; rw [ Finset.sum_sub_distrib] ; exact Finset.sum_congr rfl fun _ _ => by ring    have h_bound : |∑ n  Finset.Icc 1 ⌊x / (K : )⌋₊, (μ n : ) * (x / (n : ) - ⌊x / (n : )⌋)|  ⌊x / (K : )⌋₊ := by      have h_bound :  n  Finset.Icc 1 ⌊x / (K : )⌋₊, |(μ n : ) * (x / (n : ) - ⌊x / (n : )⌋)|  1 := by        norm_num [abs_mul]        exact fun n hn₁ hn₂ => mul_le_one₀ (mod_cast by exact abs_moebius_le_one) (abs_nonneg _) (abs_le.mpr by linarith [Int.fract_nonneg (x / n)], by linarith [Int.fract_lt_one (x / n)])      exact le_trans (Finset.abs_sum_le_sum_abs _ _) (le_trans (Finset.sum_le_sum h_bound) (by norm_num))    have h_sum_floor : ∑ n  Finset.Icc 1 ⌊x⌋₊, (μ n : ) * ⌊x / (n : )⌋ = 1 := by      convert sum_mobius_floor x hx using 1    cases abs_cases (x * ∑ n  Finset.Icc 1 ⌊x / (K : ) ⌋₊, (μ n : ) / n - 1) <;> cases abs_cases (∑ n  Finset.Ioc ⌊x / (K : ) ⌋₊ ⌊x⌋₊, (μ n : ) * ⌊x / (n : ) ⌋) <;> linarith [abs_le.mp h_bound, Nat.floor_le (show 0  x / (K : ) by positivity), Nat.lt_floor_add_one (x / (K : ))]