Skip to the content.
← Search tactics Index Next: simp →

Recall

Formal definition cited in this section, gathered here for quick reference (full citation in the Bibliography):

For goals that are decidable — where “true or false” can be settled by a terminating algorithm instead of a hand-built argument — Lean has tactics that just run that algorithm:

Here is the judgment call: use a decision procedure whenever the goal falls entirely inside its decidable fragment; use explicit rw/have reasoning whenever the goal is about a general, unspecified structure (like an arbitrary Group G or Ring R). No decision procedure applies there, because there is no concrete computation to run, only axioms to combine. Chapters 7 and 9’s group/ring theorems are all of this second kind, which is exactly why they needed hand-built proofs instead of omega.

Mathematical reading. A proposition $P$ is Decidable when there is an algorithm that computes its truth value. In categorical terms, this is a map $P \to {\top, \bot}$ whose two preimages are “proof of $P$” and “proof of $\neg P$.” So decide is the constructive statement “$P \vee \neg P$ holds and we can tell which one,” available exactly on the decidable fragment (closed numeric claims like $7 \mid 21$). omega decides Presburger arithmetic, the first-order theory of $(\mathbb{Z}, +, <)$, which is famously decidable, and norm_num evaluates concrete numerals. These apply only to statements with no free structure left to fill in. A theorem about an arbitrary group has no finite truth table to compute, and thus must be proved from the axioms instead of decided.

Read more: the Lean/Mathlib documentation for decide, omega, and norm_num (searchable in the Mathlib docs or via #help tactic omega inside a Lean file) covers each tactic’s exact decidable fragment and performance in more depth than this book needs.


References

Full citations in the Bibliography. Formal definitions are gathered in Recall, above.


← Search tactics Index Next: simp →
Try Lean
Lean playground · v1.4.18