Tactic Cheat Sheet

Quick reference for every Lean 4 tactic. Search, filter by category, and click to learn more.

Showing 35 of 35 tactics

TacticDescription
rflProve equalities by computation (reflexivity)
rwRewrite the goal or hypothesis using an equality
simpSimplify using a database of @[simp] lemmas
exactClose a goal with an exact proof term
applyApply a function or lemma to reduce a goal
introIntroduce hypotheses from implications or ∀
haveState and prove an intermediate lemma
letIntroduce a local definition in the proof
casesSplit into cases for inductive types
inductionProve by induction on a variable
omegaSolve linear arithmetic over ℕ and ℤ
decideEvaluate decidable propositions
native_decideLike decide but uses compiled native code
aesopAutomated proof search combining multiple strategies
simp onlySimplify using only specified lemmas
simp_allSimplify goal and all hypotheses
termination_bySpecify termination measure for recursive defs
calcStep-by-step equational/relational reasoning
convNavigate into subexpressions for targeted rewrites
by_contraProve by contradiction
by_casesSplit on a decidable proposition
<;>Apply a tactic to all remaining goals
firstTry tactics in order, use the first that works
repeatRepeat a tactic until it fails
ringProve polynomial identities over rings
field_simpClear denominators in field expressions
linarithProve linear arithmetic inequalities
nlinarithProve nonlinear arithmetic goals
polyrithFind polynomial proofs via Gröbner bases
rcasesRecursive case split / pattern match on hypotheses
obtainDestructure and introduce existential witnesses
push_negPush negations inward using De Morgan rules
contraposeTransform goal to its contrapositive
extProve equality by extensionality
congrBreak equality into congruence subgoals