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]
instance
FloatLib.Numerics.Enclosure.Comparison.instDecidableSeparates
(interval : RationalInterval)
(boundary : ℚ)
:
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.