Num

Numeric and ordering typeclasses (Lean-style, dictionary-passing). These classes give *named, type-directed* access to arithmetic and comparison for the primitive numeric types. Method calls such as ``add x y`` resolve automatically to the instance selected by the argument types — ``Num Int`` for integers, ``Num Float`` for floats. The instance bodies delegate to the built-in operators (``+``, ``-``, ``*``, ``<``, ``<=``). Those builtins remain the primitive, SMT- interpreted operations; ``Num``/``Ord`` only add a typeclass surface on top of them. Because the methods are dictionary projections (opaque to the SMT backend) the classes are best used in ordinary computation rather than inside refinements that must reason about exact arithmetic — for that, keep using ``+``/``-`` directly. ── Classes ──────────────────────────────────────────────────────────── Num: addition, subtraction, multiplication.
Table of Contents

Types

Num

(inductive)
Num: addition, subtraction, multiplication.
inductive Num a

Ord

(inductive)
Ord: ordering comparisons. ``gt``/``geq`` have default bodies derived from ``lt``/``leq``, so instances only need to provide the latter two.
inductive Ord a

Constructors

For each type in this module: inductive types list their declared constructors; opaque types list any local function whose name starts with mk and which returns a value of that type.

Num (inductive)

mk

constructor
Num: addition, subtraction, multiplication.
Num a

Ord (inductive)

mk

constructor
Ord: ordering comparisons. ``gt``/``geq`` have default bodies derived from ``lt``/``leq``, so instances only need to provide the latter two.
Ord a

Functions

add

def add ∀a:Β (_d949: Num a) (x: a) (y: a) : a

sub

def sub ∀a:Β (_d950: Num a) (x: a) (y: a) : a

mul

def mul ∀a:Β (_d951: Num a) (x: a) (y: a) : a

lt

def lt ∀a:Β (_d952: Ord a) (x: a) (y: a) : Bool

leq

def leq ∀a:Β (_d953: Ord a) (x: a) (y: a) : Bool

gt

def gt ∀a:Β (_d954: Ord a) (x: a) (y: a) : Bool

geq

def geq ∀a:Β (_d955: Ord a) (x: a) (y: a) : Bool

__inst_Num_Int

def __inst_Num_Int : Num Int

__inst_Num_Float

def __inst_Num_Float : Num Float

__inst_Ord_Int

def __inst_Ord_Int : Ord Int

__inst_Ord_Float

def __inst_Ord_Float : Ord Float