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
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[export lean_get_reducibility_status]
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Return the reducibility attribute for the given declaration.

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

          Set the reducibility attribute for the given declaration.

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

            Set the given declaration as [reducible]

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

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

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

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

                Equations
                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].

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

                        Set the given declaration as [irreducible]

                        Equations
                        Instances For