Reducibility status for a definition. Controls when isDefEq and whnf are allowed to unfold it.
See TransparencyMode for the full design rationale.
reducible: Unfolded atTransparencyMode.reducibleor above. Reducible definitions still appear in user-facing terms, but are eagerly unfolded when indexing terms into discrimination trees (simp, type class resolution) and ingrind. Think of it as[inline]for indexing. Suitable for abbreviations and definitions that should be transparent to proof automation.implicitReducible: Unfolded atTransparencyMode.instancesor above. Used for type class instances and definitions that appear in types matched during implicit argument resolution (e.g.,Nat.add,Array.size). These definitions cannot be eagerly reduced (instances expand into large terms, recursive definitions are problematic), but must be unfoldable when checking implicit arguments and resolving instance diamonds (e.g.,Add Natvia direct instance vs viaSemiring). The attribute[implicit_reducible](or its alias[instance_reducible]) marks a definition with this status.semireducible: The default. Unfolded atTransparencyMode.defaultor above. Used for ordinary definitions. Suitable for user-written code whereisDefEqshould try hard during type checking, but not during speculative proof automation.irreducible: Only unfolded atTransparencyMode.all. The definition body is effectively hidden fromisDefEqin normal usage.
- reducible : ReducibilityStatus
- semireducible : ReducibilityStatus
- irreducible : ReducibilityStatus
- implicitReducible : ReducibilityStatus
Instances For
@[implicit_reducible]
Instances For
@[export lean_get_reducibility_status]
Instances For
def
Lean.setReducibilityStatus
{m : Type → Type}
[MonadEnv m]
(declName : Name)
(s : ReducibilityStatus)
:
m Unit
Set the reducibility attribute for the given declaration.
Instances For
@[reducible, inline, deprecated Lean.isImplicitReducibleCore (since := "2026-02-18")]