IEEE32Exec and FP32: Arithmetic Operation Refinement #
Op-level refinement theorems (finite/no-overflow) #
These are the results that the rest of TorchLean typically consumes: statements that each arithmetic
operation in IEEE32Exec refines its FP32 real-rounded counterpart.
If you are coming from PyTorch: this is the “float32 math model” that underlies many informal numerical arguments (“the kernel computes the exact real result, then rounds to float32”), but made explicit and proved for our executable kernel.
Subtraction of two finite, nonnegative binary32 values cannot overflow.
Both operands lie between zero and the largest finite binary32 value, so their exact difference lies in the symmetric interval bounded by that value. The executable dyadic rounder therefore returns a finite result.
Executable Sterbenz theorem for finite binary32 values.
If two positive operands are within a factor of two, then bit-level subtraction is finite and denotes the exact real difference. The result combines executable-operation refinement, representability of finite bit patterns, and the rounded-real Sterbenz theorem.
Finite refinement for fused multiply-add: fma x y z rounds x*y + z once at the end.
Finite refinement for division.
At the executable level, division is implemented by forming an exact rational quotient num/den
(after aligning dyadic exponents) and then rounding that rational to float32. This theorem states
that the overall real meaning is FP32 rounding of real division.
Finite refinement for square root.
IEEE32Exec.sqrt computes an executable approximation and then rounds it to float32. This bridge
theorem states that, on the finite path, the real meaning agrees with FP32 rounding of
Real.sqrt.