Signed directed-rounding soundness.
The lemmas in this file handle sign-sensitive arithmetic cases for lower and upper IEEE32 rounding, connecting executable operations to real-valued enclosure statements.
toEReal respects negation on the finite/dyadic branch.
We phrase this lemma using the dyadic decode witness toDyadic? x = some d, which guarantees:
xis finite (hencetoERealagrees withtoReal), andtoReal (neg x) = -toReal x(viatoReal_neg_eq_neg).
Negation / sign-bit flip helpers #
Negation preserves “not NaN” #
If x is not a NaN then neg x is not a NaN.
We only state the direction we actually need in the directed-rounding development: negative
directed rounding is implemented as neg of a positive kernel, so we need to know this cannot
introduce a NaN when starting from a non-NaN value.
toEReal commutes with neg as long as we are not in the NaN case.
This is a small but important glue lemma: it lets us lift the positive rounding kernels to the
signed directed-rounding functions (roundDyadicDown / roundDyadicUp) without introducing new
floating-point corner cases.
Soundness of roundDyadicDown:
$\operatorname{toEReal}(\operatorname{roundDyadicDown}(d)) \leq\operatorname{dyadicToReal}(d)$.
This is the key lemma needed to justify addDown/mulDown as interval lower endpoints.
roundDyadicPosDown (directed rounding toward -∞ for positive dyadics) never produces a
NaN/Inf value.
We package this as an existence statement: the output always has a dyadic decode.
This is the bridge we use later to turn toEReal into toReal (as an EReal) without unfolding
all bit-level definitions at call sites.
Soundness of roundDyadicDown: it produces an EReal lower bound for the exact dyadic value.
Informal: rounding down is monotone towards -∞, so the rounded result is always ≤ the exact
real meaning.
Soundness of roundDyadicUp:
$\operatorname{dyadicToReal}(d) \leq\operatorname{toEReal}(\operatorname{roundDyadicUp}(d))$.
This is the key lemma needed to justify addUp/mulUp as interval upper endpoints.
Lower-endpoint soundness for addDown on finite inputs:
$\operatorname{toEReal}(\operatorname{addDown}(x,y)) \leq\operatorname{toReal}(x)+\operatorname{toReal}(y)$, even when the result overflows to
$-\infty$.
Upper-endpoint soundness for addUp on finite inputs:
$\operatorname{toReal}(x)+\operatorname{toReal}(y) \leq\operatorname{toEReal}(\operatorname{addUp}(x,y))$, with overflow rounding to $+\infty$.
Fused multiply-add #
Square root #
The dyadic endpoints computed by sqrtDyadicBracket enclose the exact square root.