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
Show hints
- The target mentions the same list xs on both sides.
- List.reverse_reverse expects the list to specialize its theorem.
- Reference idea: exact List.reverse_reverse xs.
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