The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V34. The tactics of Mathlib

Mathlib.Tactic.Linter.DeprecatedSyntaxLinter

6 declarations and 1 deprecated aliases. Mathlib docs · Source

Linter against deprecated syntax

refine', cases' and induction' provide backward-compatible implementations of their unprimed equivalents in Lean 3 –refine, cases and induction respectively. They have been superseded by Lean 4 tactics:

  • refine and apply replace refine'. While they are similar, they handle metavariables slightly differently; this means that they are not completely interchangeable, nor can one completely replace another. However, refine and apply are more readable and (heuristically) tend to be more efficient on average.
  • obtain, rcases and cases replace cases'. Unlike the replacement tactics, cases' does not require the variables it introduces to be separated by case, which hinders readability.
  • induction replaces induction' for similar reasons to cases and cases'.

The admit tactic is a synonym for the much more common sorry, so the latter should be preferred.

The native_decide tactic is not allowed in mathlib, as it trusts the entire Lean compiler (and not just the Lean kernel). Because the latter is large and complicated, at present it is probably possible to prove False using native_decide.

This linter is an incentive to discourage uses of such deprecated syntax, without being a ban. It is not inherently limited to tactics.

opaque Mathlib.Linter.Style.linter.style.refine E1 #

Lean.Option Bool

The option linter.style.refine of the deprecated syntax linter flags usages of the refine' tactic.

The tactics refine, apply and refine' are similar, but they handle metavariables slightly differently. This means that they are not completely interchangeable, nor can one completely replace another. However, refine and apply are more readable and (heuristically) tend to be more efficient on average.

opaque Mathlib.Linter.Style.linter.style.cases E1 #

Lean.Option Bool

The option linter.style.cases of the deprecated syntax linter flags usages of the cases' tactic, which is a backward-compatible version of Lean 3's cases tactic. Unlike obtain, rcases and Lean 4's cases, variables introduced by cases' are not required to be separated by case, which hinders readability.

opaque Mathlib.Linter.Style.linter.style.induction E1 #

Lean.Option Bool

The option linter.style.induction of the deprecated syntax linter flags usages of the induction' tactic, which is a backward-compatible version of Lean 3's induction tactic. Unlike Lean 4's induction, variables introduced by induction' are not required to be separated by case, which hinders readability.

opaque Mathlib.Linter.Style.linter.style.admit E1 #

Lean.Option Bool

The option linter.style.admit of the deprecated syntax linter flags usages of the admit tactic, which is a synonym for the much more common sorry.

opaque Mathlib.Linter.Style.linter.style.native E1 #

Lean.Option Bool

The option linter.style.native of the deprecated syntax linter flags usages of tactics which use nativeEqTrue such as native_decide and decide +native, which are disallowed in mathlib.

opaque Mathlib.Linter.Style.linter.style.maxHeartbeats E1 #

Lean.Option Bool

The option linter.style.maxHeartbeats of the deprecated syntax linter flags usages of set_option <name-containing-maxHeartbeats> n in cmd that do not add a comment explaining the reason for the modification of the maxHeartbeats.

This includes set_option maxHeartbeats n in and set_option synthInstance.maxHeartbeats n in.

Deprecated aliases

NameNew nameSince
Mathlib.Linter.Style.linter.style.nativeDecideMathlib.Linter.Style.linter.style.native2026-08-28