TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.TotalOrder.Proof

Total-order laws and IEEE decimal tie rules #

Key injectivity establishes antisymmetry for full datums. The finite and NaN theorems identify the numerical, cohort, sign and payload ordering rules; the order laws alone would not establish agreement with those rules.

The ordering key loses no datum information, including NaN payloads or zero quanta.

Both directions hold precisely when the complete datums are identical.

On positive finite datums, numerical value precedes increasing quantum.

On negative finite datums, increasing numerical value precedes decreasing quantum.

@[simp]

Negative finite datums precede positive ones, including the two zero signs.

The quantum tie rule applies to signed zero as well as nonzero cohorts.

@[simp]

Positive signaling NaNs precede quiet NaNs regardless of payload.

@[simp]

Negative quiet NaNs precede signaling NaNs regardless of payload.

This implementation's equal-kind NaN payload order reverses with the sign. IEEE 754-2019 §5.10(d)(5)(iii) permits this choice.

@[simp]

Every negative NaN precedes every positive NaN, irrespective of kind or payload.

Magnitude ordering identifies precisely datums differing at most in sign.