TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Operations.TotalOrder.Semantics

Numerical and exceptional-value rules for binary total order #

The order laws follow from the order on complete exact data. The numerical theorems connect the predicate to dyadic, real, and extended-real comparisons. The exceptional-value rules state the IEEE sign and signaling-class priorities and FloatLib's implementation-defined payload direction explicitly.

The model predicate is precisely the shared order on complete decoded data.

@[simp]

All binary words precede themselves, including signaling NaNs.

Totality is independent of field width, bias, and exceptional-value policy.

Binary total ordering is transitive for every descriptor.

Mutual ordering identifies the complete decoded data for every descriptor.

Complete decoded data determine their binary word, so total order is antisymmetric.

Mutual comparison holds exactly for bitwise-identical operands.

Successful finite decoding transports the complete signed numerical ordering rule.

Strict numerical increase of finite binary values implies total ordering.

Strict numerical decrease of finite binary values fails total ordering.

The existing numerical comparator's strict order is respected, including infinities.

The existing numerical comparator's reversed strict order fails total ordering.

Total order extends extended-real strict order on non-NaNs.

Extended-real strict decrease fails total order on non-NaNs.

Zeros are ordered by their stored signs.

@[simp]

In a signed-zero format, negative zero precedes positive zero.

@[simp]

In a signed-zero format, positive zero does not precede negative zero.

A NaN precedes a number exactly when its sign bit is negative.

A number precedes a NaN exactly when that NaN has positive sign.

Positive NaNs in the same NaN class are ordered by increasing fraction payload.

Negative NaNs in the same NaN class are ordered by decreasing fraction payload.