Skip to content

Commit 8449c32

Browse files
committed
Add docstrings for reversed range telescoping lemmas (#39605)
This PR adds docstrings for two existing `Finset` telescoping lemmas and their additive versions generated by `to_additive`: * `Finset.prod_range_div'` / `Finset.sum_range_sub'` * `Finset.eq_prod_range_div` / `Finset.eq_sum_range_sub` It is documentation-only: no declarations or imports are changed. CI has passed. AI assistance: Codex was used to help inspect the public PR/CI status and update this PR description.
1 parent 4755025 commit 8449c32

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • Mathlib/Algebra/BigOperators/Group/Finset

Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,17 @@ additive group reduces to the difference of the last and first terms. -/]
896896
lemma prod_range_div (f : ℕ → G) (n : ℕ) : (∏ i ∈ range n, f (i + 1) / f i) = f n / f 0 := by
897897
apply prod_range_induction <;> simp
898898

899-
@[to_additive]
899+
/-- A reversed telescoping product along `{0, ..., n - 1}` of a commutative-group-valued function
900+
reduces to the ratio of the first and last factors. -/
901+
@[to_additive /-- A reversed telescoping sum along `{0, ..., n - 1}` of a function valued in a
902+
commutative additive group reduces to the difference of the first and last terms. -/]
900903
lemma prod_range_div' (f : ℕ → G) (n : ℕ) : (∏ i ∈ range n, f i / f (i + 1)) = f 0 / f n := by
901904
apply prod_range_induction <;> simp
902905

903-
@[to_additive]
906+
/-- Express `f n` as `f 0` multiplied by the telescoping product of consecutive ratios from
907+
`0` to `n - 1`. -/
908+
@[to_additive /-- Express `f n` as `f 0` plus the telescoping sum of consecutive differences from
909+
`0` to `n - 1`. -/]
904910
lemma eq_prod_range_div (f : ℕ → G) (n : ℕ) : f n = f 0 * ∏ i ∈ range n, f (i + 1) / f i := by
905911
rw [prod_range_div, mul_div_cancel]
906912

0 commit comments

Comments
 (0)