All Exercises
#7 Right Identity of List Append
live.lean-lang.org
Pure Lean 4 · No Mathlib
EasyLists

7. Right Identity of List Append

Prove that appending the empty list `[]` to the right of any list `xs` returns `xs`. Since `List.append` recurses on the first list, prove this by structural induction on `xs`.

Target Theorem
theorem list_append_nil {α : Type} (xs : List α) : xs ++ [] = xs
Hints (0/2)

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).