Documentation

Lean.Meta.Sym.Offset

Offset representation for natural number expressions #

This module provides utilities for representing Nat expressions in the form e + k, where e is an arbitrary expression and k is a constant. This normalization is used during pattern matching and unification.

Represents a natural number expression as a base plus a constant offset.

  • .num k represents the literal k
  • .add e k represents e + k

Used for pattern matching and unification.

Instances For

    Increments the constant part of the offset by k'.

    Equations
      Instances For

        Returns some offset if e is an offset term. That is, it is of the form

        • Nat.succ a, OR
        • a + k where k is a numeral.

        Assumption: standard instances are used for OfNat Nat n and HAdd Nat Nat Nat

        Variant of isOffset? that first checks if declName is Nat.succ or HAdd.hAdd.

        Equations
          Instances For

            Returns true if e is an offset term.

            Equations
              Instances For
                def Lean.Meta.Sym.isOffset' (declName : Name) (p : Expr) :

                Variant of isOffset? that first checks if declName is Nat.succ or HAdd.hAdd.

                Equations
                  Instances For

                    Converts the given expression into an offset. Assumptions: