Documentation

LeanCert.Meta.Numeral

Meta-level Numeral Extraction #

Utilities for extracting rational constants from elaborated Lean expressions. The goal is to support multiple equivalent syntactic encodings (literals, casts, scientific notation, arithmetic on constants) in one place.

Peel one explicit cast wrapper when the head is a known cast constant.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Last-resort extraction for closed expressions whose type is definitionally Rat. This is intentionally named so callers and CI audits can distinguish it from structural literal parsing.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Attempt to parse a Lean expression as a rational constant.

      Try to match a numeric expression directly.

      Structural/literal rational extraction without arithmetic folding.

      Rational extraction that may fold closed rational arithmetic.

      Equations
      Instances For

        Attempt to parse a Lean expression as an integer constant.

        Equations
        Instances For

          Attempt to parse a Lean expression as a natural-number constant.

          Equations
          Instances For

            Extract a rational after instantiating metavariables and normalizing reducible wrappers.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For