Comparisons for executable IEEE32 values.
The definitions here implement the ordering and classification behavior used by the executable binary32 arithmetic layer.
IEEE754 numerical comparison.
Returns none (unordered) if either operand is NaN; otherwise returns an Ordering.
Instances For
Order lemmas #
IEEE-754 comparisons treat NaNs as unordered, so in particular le x x is not true for NaNs.
For the interval layer, we mainly need the basic fact that le is reflexive on finite values.
IEEE32Exec.le is reflexive on finite values.
Informally: if x is a finite float32, then x ≤ x. (NaNs are excluded by the isFinite premise:
for NaN, isFinite x = false and x ≤ x is false because compare returns none.)
This lemma is used by the executable interval layer to show that the "point interval" [x, x] is
valid whenever x is finite.
Curried form of le_self_of_isFinite_eq_true (useful for simp).
isFinite x = true → x ≤ x is always true.
This looks a bit odd, but it's exactly the side-goal produced by simp [Valid, point] in the
executable interval module (NN/Floats/Interval/IEEEExec32.lean). Registering this as a simp lemma
lets that file stay a one-liner.
IEEE754 minimum: NaNs propagate; minimum(-0,+0) = -0.
Instances For
IEEE754 maximum: NaNs propagate; maximum(-0,+0) = +0.
Instances For
IEEE754 minNum: if exactly one operand is a quiet NaN, return the other operand.
Signaling NaNs still propagate (quieted).
Instances For
IEEE754 maxNum: if exactly one operand is a quiet NaN, return the other operand.
Signaling NaNs still propagate (quieted).
Instances For
Convert to an exact Float (binary64); finite float32 values embed exactly in binary64.
Instances For
Convert/round an IEEE binary64 Float to float32 (ties-to-even).