Documentation

Lean.ReducibilityAttrs

Reducibility status for a definition. Controls when isDefEq and whnf are allowed to unfold it. See TransparencyMode for the full design rationale.

  • reducible: Unfolded at TransparencyMode.reducible or above. Reducible definitions still appear in user-facing terms, but are eagerly unfolded when indexing terms into discrimination trees (simp, type class resolution) and in grind. Think of it as [inline] for indexing. Suitable for abbreviations and definitions that should be transparent to proof automation.
  • implicitReducible: Unfolded at TransparencyMode.instances or 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 Nat via direct instance vs via Semiring). The attribute [implicit_reducible] (or its alias [instance_reducible]) marks a definition with this status.
  • semireducible: The default. Unfolded at TransparencyMode.default or above. Used for ordinary definitions. Suitable for user-written code where isDefEq should try hard during type checking, but not during speculative proof automation.
  • irreducible: Only unfolded at TransparencyMode.all. The definition body is effectively hidden from isDefEq in normal usage.
Instances For
    @[export lean_get_reducibility_status]
    Instances For

      Return the reducibility attribute for the given declaration.

      Instances For
        def Lean.setReducibilityStatus {m : TypeType} [MonadEnv m] (declName : Name) (s : ReducibilityStatus) :

        Set the reducibility attribute for the given declaration.

        Instances For
          def Lean.setReducibleAttribute {m : TypeType} [MonadEnv m] (declName : Name) :

          Set the given declaration as [reducible]

          Instances For
            def Lean.isReducible {m : TypeType} [Monad m] [MonadEnv m] (declName : Name) :

            Return true if the given declaration has been marked as [reducible].

            Instances For
              def Lean.isIrreducible {m : TypeType} [Monad m] [MonadEnv m] (declName : Name) :

              Return true if the given declaration has been marked as [irreducible]

              Instances For
                Instances For
                  def Lean.isImplicitReducible {m : TypeType} [Monad m] [MonadEnv m] (declName : Name) :

                  Return true if the given declaration has been marked as [implicit_reducible].

                  Instances For
                    @[reducible, inline, deprecated Lean.isImplicitReducibleCore (since := "2026-02-18")]
                    abbrev Lean.isInstanceReducibleCore (env : Environment) (declName : Name) :
                    Instances For
                      @[reducible, inline, deprecated Lean.isImplicitReducible (since := "2026-02-18")]
                      abbrev Lean.isInstanceReducible {m : TypeType} [Monad m] [MonadEnv m] (declName : Name) :
                      Instances For
                        def Lean.setIrreducibleAttribute {m : TypeType} [MonadEnv m] (declName : Name) :

                        Set the given declaration as [irreducible]

                        Instances For