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.instanceReducible: Unfolded atTransparencyMode.instancesor above. Auto-applied by theinstancecommand and to subobject projections of class parents. The attribute[instance_reducible]marks a definition with this status; users typically do not need to apply it manually.implicitReducible: Unfolded atTransparencyMode.implicitor above (strictly above.instances). Used for definitions that should unfold when checking implicit and instance-implicit arguments for definitional equality, including for resolving instance diamonds, but must stay opaque to type class search. The attribute[implicit_reducible]marks a definition with this status. (Note: core arithmetic such asNat.addandArray.sizeis deliberatelyinstanceReducible, notimplicitReducible, because type class synthesis depends on it unfolding.)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
- instanceReducible : ReducibilityStatus
Instances For
@[instance_reducible]
Instances For
Instances For
def
Lean.setReducibilityStatus
{m : Type → Type}
[MonadEnv m]
(declName : Name)
(s : ReducibilityStatus)
:
m Unit
Set the reducibility attribute for the given declaration.