Native addition and subtraction #
These theorems relate FloatLib's addition and subtraction to the logical floating-point model shipped with Lean. Finite inputs include both signed zeros. The result is unrestricted, so cancellation, subnormal rounding and overflow to infinity are covered, and the equations hold on the complete packed word through the native adapters.
The finite-input hypotheses exclude NaNs and infinities, because FloatLib preserves NaN details that Lean canonicalizes and its subtraction also negates the right operand's NaN sign. These model equalities do not verify the machine instructions used by compiled native code.
For finite operands, including signed zeros, dispatched addition gives the word that Lean's unpacked model gets by adding and packing. The result may overflow to infinity.
For finite operands, including signed zeros, dispatched subtraction agrees with Lean's unpacked subtraction and packing. There is no restriction on the rounded result.
Importing the native sum equals adding the imported binary32 operands with the installed certified software operation. Finite inputs may produce zero, a subnormal, or infinity.