∴LeanProofs
Library reading

Read a list theorem application

For any type α and any list xs of elements of α, reversing xs twice returns xs.

Compiled with official native Lean 4.33.1 on 25 November 2026, core library only. The browser checker uses a separately identified experimental fork. Intended-statement comparison, independent axiom audit and mathematical review are pending.

The statement

For any type α and any list xs of elements of α, reversing xs twice returns xs.

theorem list_reverse_reverse {α : Type} (xs : List α) : xs.reverse.reverse = xs := by
  exact List.reverse_reverse xs

Why these steps?

  1. The type parameter α is arbitrary. Nothing in the statement requires adding, comparing or ordering list elements.
  2. xs.reverse is a list operation. The second reverse acts on the result of the first operation, so the target is equality of two whole lists.
  3. List.reverse_reverse is an existing basic library theorem. Supplying xs specializes that result to the current list.
  4. This short example intentionally demonstrates library use. An expanded inductive proof would also need facts about reversing an appended list; that longer development is outside this example.

Try a variation

Specialize the statement to List Nat, then test a separate concrete list equality with rfl. A concrete computation is not the same as the general theorem.

A mistake to understand

theorem list_reverse_reverse {α : Type} (xs : List α) : xs.reverse.reverse = xs := by
  rfl

Expected teaching failure, not recorded compiler output: For a variable list, double reversal is not generally reduced to the same expression by reflexivity alone. Use the general theorem or develop its inductive proof.

Sources & reuse

Native compilation evidence (JSON)

Code and explanation: original LeanProofs teaching content, CC0-1.0. Linked references retain their own licenses. Editorial date: 24 November 2026; independent mathematical review pending.