TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.IntervalSemantics.Order

Order of interval endpoints #

Boolean endpoint comparisons agree with real order for finite values and with extended-real order for non-NaN values, including infinities. The non-NaN hypotheses are needed because NaNs are unordered.

The proposition-valued and Boolean executable non-strict orders agree.

On non-NaN values, executable comparison agrees exactly with extended-real .

Boolean endpoint comparison agrees with extended-real order on non-NaN values.

On finite values, executable boolean comparison agrees exactly with real .

On finite values, the proposition-valued executable order agrees exactly with real .

Ordered, non-NaN extended-real endpoints define a valid interval.

A valid interval's decoded lower endpoint does not exceed its decoded upper endpoint.

An extended-valid interval has ordered extended-real endpoints.

A finite executable value defines a valid degenerate interval.

Every non-NaN value defines an extended-valid degenerate interval.

The full IEEE range, including infinities, is extended-valid.

Every extended-real value belongs to the full IEEE range.

Checking candidate endpoints can only lower the lower bound of an IEEE enclosure.

Checking candidate endpoints can only raise the upper bound of an IEEE enclosure.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.Interval.ofBounds_eq_of_isFinite {fmt : FloatFormat} (lo hi : Model fmt) (hlo : lo.isFinite = true) (hhi : hi.isFinite = true) (hordered : lo.toReal hi.toReal) :
ofBounds lo hi = { lo := lo, hi := hi }

Ordered finite bounds survive the enclosure check exactly.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.Interval.realMem_ofBounds {fmt : FloatFormat} {lo hi : Model fmt} {x : } (hlo : lo.isFinite = true) (hhi : hi.isFinite = true) (hx : { lo := lo, hi := hi }.RealMem x) :
(ofBounds lo hi).RealMem x

A real enclosure with finite candidate endpoints survives the bounds check.

Checked IEEE bounds always define an ordered interval without NaN endpoints.