∴LeanProofs
Learn Lean 4

Read and apply a library theorem

Identify what a named theorem gives you and what it does not.

Library reuse is essential in formal mathematics. Begin by matching the theorem type to your target: the element type is arbitrary and the input is one list. A direct application of List.reverse_reverse is an honest proof by reference to an existing checked result when run in a trusted environment. It is not a new derivation of the list theorem. This core-library lesson does not import Mathlib. The originally planned first Mathlib lesson is deferred until a fixed dependency and actual compilation are available; the title and route deliberately avoid suggesting that integration is complete.

Your task

Replace sorry with an application of List.reverse_reverse to xs. Then compare this general statement with a concrete list calculation.

theorem list_reverse_reverse {α : Type} (xs : List α) : xs.reverse.reverse = xs := by
  sorry
Exercise not verified. The target is a teaching task; changing it cannot earn a pass. A trusted fixed-challenge verifier is required before passes can be issued.
Show hints
  1. The target mentions the same list xs on both sides.
  2. List.reverse_reverse expects the list to specialize its theorem.
  3. Reference idea: exact List.reverse_reverse xs.

The repository’s six reference answers have a separate native type-and-axiom audit. This does not check or certify your edited answer. Read the reference audit (JSON)

When you get stuck

Read the expected type, compare it with your term, and change one line. The experimental browser checker provides actual diagnostics. Goal information is available at the checked cursor when the runtime supports it; it is a source snapshot, not a live language server. Independent exercise verification is not available.

Use the error repair guide