TorchLean API

FloatLib.Numerics.Enclosure.Comparison.Runtime

Adaptive comparison with rational enclosures #

The search uses only rational arithmetic. Its termination argument is a proposition and is erased from executable code. Callers supply a sequence of increasingly accurate intervals and a proof that some interval excludes the boundary; real containment is used separately to prove the returned ordering correct.

An interval lies strictly on one side of a rational boundary.

Instances For
    @[instance_reducible]
    def FloatLib.Numerics.Enclosure.Comparison.compare (intervals : RationalInterval) (boundary : ) (terminates : ∃ (n : ), Separates (intervals n) boundary) :

    Search for the first separating interval and return whether it lies below or above the boundary.

    Instances For