AlexKontorovich/PrimeNumberTheoremAnd
Source indexedlemma Ā· leanprover/lean4:v4.32.0
S_sub_S
PrimeNumberTheoremAnd.Wiener Ā· PrimeNumberTheoremAnd/Wiener.lean:2363 to 2373
Mathematical statement
Exact Lean statement
lemma S_sub_S {f : ā ā š} {ε : ā} {N : ā} (hε : ε ⤠1) : S f 0 N - S f ε N = cumsum f āε * Nāā / NComplete declaration
Lean source
Full Lean sourceLean 4
lemma S_sub_S {f : ā ā š} {ε : ā} {N : ā} (hε : ε ⤠1) : S f 0 N - S f ε N = cumsum f āε * Nāā / N := by have hceilN : āε * Nāā ⤠N := by simp only [Nat.ceil_le] exact mul_le_of_le_one_left N.cast_nonneg hε have r1 : Finset.range N = Finset.range āε * Nāā āŖ Finset.Ico āε * Nāā N := by ext n simp only [Finset.mem_range, Finset.mem_union, Finset.mem_Ico] omega have r2 : Disjoint (Finset.range āε * Nāā) (Finset.Ico āε * Nāā N) := by rw [Finset.range_eq_Ico] ; apply Finset.Ico_disjoint_Ico_consecutive simp [S, r1, Finset.sum_union r2, cumsum, add_div]