EncounterActivity 1 of 6
Encounter
When you type theorem t : 2 + 2 = 4 := by decide, Lean works in stages:
- Parsing turns the text into a syntax tree.
- Macro expansion rewrites syntax into other syntax (
2 + 2becomesHAdd.hAdd 2 2). - Elaboration fills in types and implicit arguments and runs tactics, producing a term.
- The kernel, a small trusted checker, type-checks the term.
Steps 1–3 can be extended by users. Only step 4 decides whether a proof is valid.