/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/modulepublicimportMathlib.Algebra.BigOperators.IntervalspublicimportMathlib.NumberTheory.Harmonic.DefsimportMathlib.Tactic.PushimportMathlib.Tactic.Ring@[expose]publicsection
Block harmonic sums
Mathlib's harmonic n is the initial harmonic sum ∑_{1 ≤ k ≤ n} 1 / k. Several problems
instead need the block sum ∑_{n ≤ k ≤ m} 1 / k, which is what harmonicBlock gives.
Like harmonic it is valued in ℚ; cast at the use site when a real value is wanted.
Main definitions
harmonicBlock: the block harmonic sum ∑_{n ≤ k ≤ m} 1 / k.
Main results
harmonicBlock_eq_zero_of_lt: the block sum is empty when m < n.
harmonicBlock_one: harmonicBlock 1 n is Mathlib's harmonic n.
The block harmonic sum $\sum_{n\leq k\leq m}\frac{1}{k}$.
For n = 1 this is Mathlib's harmonic, see harmonicBlock_one.