Documentation

Lean.Meta.Sym.DSimp.DSimpM

Definitional Simplifier for SymM #

DSimp mirrors Sym.Simp but does not produce proof terms. Every rewrite must hold by definitional equality, so the kernel checks e ≡ e' at the use site and we only need to return the simplified expression.

Configuration options for the definitional simplifier.

  • maxSteps : Nat

    Maximum number of steps that can be performed by the simplifier.

Instances For

    The result of definitionally simplifying an expression e.

    The done flag controls whether simplification should continue after this result:

    • done = false (default): Continue with subsequent simplification steps. If a pre/post method returns .step e' false, dsimp recurses on e'.
    • done = true: Stop processing, return this result as final.

    Unlike Sym.Simp.Result, this carries no proof term and no contextDependent flag.

    • rfl (done : Bool := false) : Result

      No change. If done = true, skip remaining simplification steps for this term.

    • step (e' : Expr) (done : Bool := false) : Result

      Simplified to e'. If done = true, skip recursive simplification of e'.

    Instances For

      Read-only context for the definitional simplifier.

      • config : Config

        Simplifier configuration options.

      Instances For
        @[reducible, inline]

        Cache mapping expressions (by pointer equality) to their simplified results.

        Instances For

          Mutable state for the definitional simplifier.

          • numSteps : Nat

            Number of steps performed so far.

          • cache : Cache

            Cache for simplification results. Survives across binder entry.

          Instances For
            @[reducible, inline]

            Monad for the definitional simplifier, layered on top of SymM.

            Instances For
              @[implicit_reducible]
              @[reducible, inline]
              Instances For
                Instances For
                  @[implemented_by Lean.Meta.Sym.DSimp.Methods.toMethodsRefImpl]
                  @[reducible, inline]
                  Instances For
                    @[implemented_by Lean.Meta.Sym.DSimp.MethodsRef.toMethodsImpl]
                    def Lean.Meta.Sym.DSimp.DSimpM.run {α : Type} (x : DSimpM α) (methods : Methods := { }) (config : Config := { }) (s : State := { }) :

                    Runs a DSimpM computation with the given methods, configuration, and state. The cache and numSteps from s are preserved (cache entries persist across invocations because results are not context-dependent).

                    Instances For
                      def Lean.Meta.Sym.DSimp.DSimpM.run' {α : Type} (x : DSimpM α) (methods : Methods := { }) (config : Config := { }) :
                      SymM α

                      Runs a DSimpM computation with the given methods and configuration.

                      Instances For
                        @[extern lean_sym_dsimp]
                        @[reducible, inline]
                        Instances For
                          @[reducible, inline]
                          Instances For
                            @[reducible, inline]
                            abbrev Lean.Meta.Sym.dsimp (e : Expr) (methods : DSimp.Methods := { }) (config : DSimp.Config := { }) :
                            Instances For