All Exercises
#47 Tail-Recursive List Sum Equivalence
live.lean-lang.org
Pure Lean 4 · No Mathlib
MediumVerified Algorithms

47. Tail-Recursive List Sum Equivalence

Prove that the tail-recursive accumulator implementation `fastSum` computes the exact same result as the straightforward recursive `listSum` for every list of natural numbers. Keep `listSum`, `sumAcc`, and `fastSum` unchanged.

Target Theorem
theorem fast_sum_eq (xs : List Nat) : fastSum xs = listSum xs
Hints (0/3)

Stuck? Reveal hints one step at a time without spoiling the full proof.

Symbols:
Initializing Lean 4 editor…
Infoview & Diagnosticsline 1idle
Write your proof above and click Submit Proof (or open in live.lean-lang.org).