Lean tactic frameworks and automation (simp, aesop, omega, grind)
The proof-search and decision-procedure layer of Lean: rewriting with simp, white-box search with aesop, linear integer arithmetic with omega and SMT-style reasoning with grind.
On this page14 sections
Human formalizers and AI provers both spend most of their steps in these tactics; their power and speed set how much mathematics a given proof effort can cover.
Small programs inside Lean that do routine proof steps for you.
- 1Goal is too tedious by hand
- 2Tactic searches or rewrites
- 3It builds a proof term
- 4Kernel re-checks the result
Goals and tactics. When you prove something in Lean you see a goal: the hypotheses you have and the statement still to prove. A tactic is a command that changes the goal, for example by rewriting an expression or by splitting "A and B" into two goals. A proof is a list of tactics that ends with no goals left. Each tactic also writes part of the proof term that the kernel checks at the end, so a tactic may use any trick it likes: if the trick is wrong, the kernel rejects the result.
A small example. To prove and for natural numbers you might type simp for the first and omega for the second, and never write the low-level steps.
The main tools.
simprewrites the goal with a large list of simplification lemmas, such as , always from the complicated side to the simpler side, until nothing changes. It is the everyday clean-up tool, and its power comes from Mathlib's thousands of tagged lemmas.omegadecides linear arithmetic over integers and natural numbers: statements built from , , comparisons and multiplication by constants. It either proves the goal or reports that it cannot.ring,linarithandnorm_numprove polynomial identities, linear inequalities and numerical facts.aesopis a search: it tries registered rules (lemmas and tactics) in best-first order over a tree of goals, like a search algorithm from a programming course, and the tree can be inspected afterwards.grindworks like an SMT solver, the kind of tool used to verify software and chips: it collects known equalities, merges terms that must be equal, instantiates general lemmas that match the goal and combines this with arithmetic reasoning.
Why it matters. Most lines of a formal proof are routine steps, so better automation makes projects shorter and cheaper. AI provers also emit tactics, so a tool that closes a whole class of goals in one call shrinks the search they must do.
Trade-offs. Heavy automation can be slow, and a proof that relies on simp can break when someone adds a new simp lemma to the library. Tool designers balance power against speed and stability, and that balance is still an active engineering question.
Go deeper
The full technical text.
What a tactic is
A Lean proof is a term, but people write it as a script of tactics: programs that inspect the current goal and build part of the term. Tactics are untrusted. They can be arbitrarily clever because the kernel re-checks whatever they produce. That makes Lean an unusually good platform for automation: a wrong heuristic costs time, never soundness.
The workhorses
simp: a rewriting engine that applies a set of lemmas tagged@[simp](and any you pass) left to right until nothing applies. It is the default way to clean up a goal. Its strength comes from the very large library of simp lemmas in Mathlib, so the quality of that tagging is part of the tool.omega: a decision procedure for linear arithmetic overℤandℕ(with the usual operations on literals such as division and remainder by numerals). It ships in Lean core and produces a checkable proof term.aesop: a configurable best-first proof search for Lean. Rule sets are registered per project, and the search tree is inspectable, which is why the authors call it white-box. The paper is Limperg and From, Aesop: White-Box Best-First Proof Search for Lean (CPP 2023), and the code is at leanprover-community/aesop.grind: an SMT-style procedure in Lean core that combines congruence closure, E-matching and theory solvers; see the reference manual section.- Mathlib tactics:
ring,linarith,positivity,norm_num,field_simpand others live in Mathlib.Tactic and prove most routine algebra and inequalities. Bridges to external solvers, for example lean-auto, hand goals to SMT solvers and reconstruct the proof inside Lean.
Why it is load-bearing
- Cost of formalization. Most of the line count in a formalization project is routine steps. Better automation shrinks projects directly, and the record of large projects shows it.
- AI proof search. Neural provers emit tactic sequences, so their effective branching factor and success rate depend on which tactics close goals in one call. A system that calls
grindoraesopat a leaf can prove in one step what used to take dozens. - Proof by reflection. Decision procedures such as
omegaanddecidelean on the kernel's evaluation (see the kernel entry), so kernel speed and tactic design are coupled.
Open design questions
Automation is judged on speed, robustness to library changes (a new simp lemma can break old proofs) and the readability of what it produces. Producing short, maintainable proofs from heavy automation, and doing so without slowing Mathlib's build, is an active engineering concern rather than a solved one.
Words on this page (7)
- tactic
- A small program that works on a goal and builds part of a Lean proof.
- goal
- What is still left to prove at some point in a proof.
- rewriting
- Replacing part of an expression with an equal one using a known rule.
- decision procedure
- An algorithm that always answers yes or no for a whole class of questions.
- congruence closure
- A method that keeps track of which terms must be equal because their parts are equal.
- SMT solver
- A program that checks logical formulas combined with theories such as arithmetic.
- Lean and Mathlib
- The proof assistant and its large library of formalized mathematics.
New to this? Read first (3)
- Aesop (paper)The design of a white-box proof search for Lean.
- Lean reference: the grind tacticWhat grind does and how to use it.
- Lean reference: tactic referenceA catalogue of the built-in tactics.
Understanding map
map of the whole wiki →What to read before Lean tactic frameworks and automation (simp, aesop, omega, grind) (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.
- Start with
- Then
Open problems & questions
No open problems or questions on this entry.
Progress timeline
- Jan 1, 2023Aesop published at CPPsource
The white-box best-first proof search framework for Lean 4 is presented at CPP 2023 (month approximate).