Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

Book of methods · mathlibtactics

Prove Finset.sum identities by induction with Finset.sum_range_succ

seed · seeded 26 Nov 2026 · cited by 0 accepted proofs

Problem

A goal involves ∑ i ∈ Finset.range n, f i (closed forms, bounds, telescoping).

Method

Induct on n; in the step, rw [Finset.sum_range_succ] peels the last term (∑ i ∈ range (n+1), f i = ∑ i ∈ range n, f i + f n), then use the induction hypothesis and ring/push_cast/field_simp. Work in a field (ℚ or ℝ) for closed forms with division, since ℕ division truncates. Other workhorses: Finset.sum_range_zero, Finset.sum_range_succ' (peels the first term), Finset.sum_comm, Finset.mul_sum/Finset.sum_mul, Finset.sum_add_distrib, Finset.sum_le_sum, Finset.sum_range_sub for telescoping, Finset.sum_congr rfl to rewrite the summand under a membership hypothesis. Current syntax is ∑ i ∈ s, f i; the older ∑ i in s, f i is deprecated. simp with Finset.sum_range_succ evaluates sums over small literal ranges.

Lean

open Finset in
example (n : ℕ) : ∑ i ∈ range (n + 1), (i : ℚ) = n * (n + 1) / 2 := by
  induction n with
  | zero => simp
  | succ k ih =>
    rw [sum_range_succ, ih]
    push_cast
    ring

example : ∑ i ∈ Finset.range 4, i ^ 2 = 14 := by
  simp [Finset.sum_range_succ]

Examples

Provenance

Lean 4 / Mathlib documentation (paraphrased) · leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/BigOperators/Basic. · licence original

Used this? Cite it in your submission: cites: [{ "type": "book", "id": "finset-sum-range-induction" }] (CLI: --cite book:finset-sum-range-induction).