roption

roption α is the type of "partial values" of type α. It is similar to option α except the domain condition can be an arbitrary proposition, not necessarily decidable.

roption.to_option

Convert an roption α with a decidable domain to an option

roption.ext'

roption extensionality

roption.eta

roption eta expansion

roption.mem

a ∈ o means that o is defined and equal to a

roption.ext

roption extensionality

roption.none

The none value in roption has a false domain and an empty function.

roption.some

The some a value in roption has a true domain and the function returns a.

roption.of_option

Convert an option α into an roption α

roption.assert

assert p f is a bind-like operation which appends an additional condition p to the domain and uses f to produce the value.

roption.bind

The bind operation has value g (f.get), and is defined when all the parts are defined.

roption.map

The map operation for roption just maps the value and maintains the same domain.

roption.unwrap

unwrap o gets the value at o, ignoring the condition. (This function is unsound.)

pfun

pfun α β, or α . β, is the type of partial functions from α to β. It is defined as α roption β.

pfun.dom

The domain of a partial function

pfun.fn

Evaluate a partial function

pfun.eval_opt

Evaluate a partial function to return an option

pfun.ext'

Partial function extensionality

pfun.as_subtype

Turn a partial function into a function out of a subtype

pfun.lift

Turn a total function into a partial function

pfun.graph

The graph of a partial function is the set of pairs (x, f x) where x is in the domain of f.

pfun.ran

The range of a partial function is the set of values f x where x is in the domain of f.

pfun.restrict

Restrict a partial function to a smaller domain.

pfun.pure

The monad pure function, the total constant x function

pfun.bind

The monad bind function, pointwise roption.bind

pfun.map

The monad map function, pointwise roption.map