BridgeERealTotal #
Extended-real (EReal) semantics for IEEE32Exec.
We use toReal? as the main “finite-only” semantic function in TorchLean. For some statements,
though, we really want to distinguish +∞ from -∞ instead of collapsing both to none.
This file packages a slightly richer view:
toEReal? x = noneexactly for NaN (unordered),toEReal? x = some ⊤/some ⊥for+∞/-∞,toEReal? x = some (↑(toReal x))for finite values.
We then prove “golden theorem”-style lemmas for core ops, where the finite branch refines to the
FP32 rounding-on-ℝ model (fp32Round) and the non-finite branch preserves IEEE-754 special
behavior.
Background:
- IEEE 754-2019: https://doi.org/10.1109/IEEESTD.2019.8766229
- Goldberg (1991): https://doi.org/10.1145/103162.103163
Extended-real interpretation of IEEE32Exec (none exactly for NaN).
Instances For
NaNs stay outside the extended-real interpretation.
A value classified as infinity is not classified as NaN.
In the finite case, executable addition agrees with rounded real addition in EReal.
In the finite case, executable multiplication agrees with rounded real multiplication in EReal.