IEEE32Exec and FP32: Real Semantics Core #
Reals view of IEEE32Exec #
Real semantics (toReal?/toReal) live in NN.Floats.IEEEExec.RealSemantics. This bridge file
uses them pervasively, but does not define them.
FP32 rounding viewed as a real function.
Instances For
Rounding 0 to float32 yields 0.
Helper lemmas (magnitude/rounding) #
Most of the file consists of bridge lemmas: once we decide on the refinement statement, we need many small facts that connect:
- executable bitfield manipulations (extracting sign/exponent/fraction, flipping the sign bit),
- exact dyadic arithmetic (what the decoded value means as a real),
- and the
FP32rounding model (which is expressed usingneural_magnitude/ nearest-even).
These lemmas are local: they exist to keep the later op-level theorems readable.
Absolute value of a decoded dyadic.
Informal: dyadicToReal d = ± (mant * 2^exp) and since mant ≥ 0, the absolute value is always
mant * 2^exp regardless of the sign bit.
Exact multiplication of dyadics commutes with decoding to reals.
Informal: decoding the dyadic that multiplies mantissas and adds exponents gives the product of the decoded real values.
Negating a dyadic (flipping its sign bit) negates its decoded real value.
If x decodes to the dyadic d, then neg x decodes to the same magnitude with a flipped sign.
This lemma is one of the bitfield bridge steps that lets us transport algebraic facts from the
dyadic semantics to IEEE32Exec.
On finite values, toReal respects IEEE32Exec.neg.
We phrase this as an equality on toReal for convenience, but the proof fundamentally uses the
finiteness witness toDyadic? x = some d.