IEEE32Exec and FP32: Rational Magnitude Bounds #
Real semantics of exponent tests for rationals #
Some executable rounding code works by inspecting the magnitude of a rational (represented as
num / den with Nats) and branching on exponent ranges. These lemmas justify those branches in
terms of real inequalities, so later refinement proofs can stay “math-first”.
Coarse log₂ bounds for rationals #
The rounding code needs cheap bounds on log₂ (or “bit-length”) to decide normal vs subnormal
cases. We prove coarse but robust bounds that are easy to compute from Nat.log2.
FP32 refinement for executable rounding #
This is the core bridge step: we prove that the executable rounding kernel (which produces an
IEEE32Exec value) agrees with FP32 rounding on reals (fp32Round), provided we stay on the
finite/no-overflow path.
Once we have this, most op-level bridge theorems reduce to: “compute an exact dyadic/rational intermediate, then apply this rounding refinement theorem”.
A coarse magnitude bound for a decoded dyadic.
Informal: |mant * 2^exp| < 2^(log2 mant + exp + 1). This is convenient when reasoning about
normalization by log2 and when relating dyadic magnitudes to exponent ranges.