Verified fixed-limb significand products #
mul128_toNat proves the full 128 × 128 → 256 product correct using the mul64_toNat theorem
from Core.Proof.UInt128. The addition theorems reconstruct the sum from its low limbs and
outgoing carry. The UInt256 lemmas describe widening, projection, and leading-bit selection.
A four-word value is determined by its natural-number interpretation.
theorem
FloatLib.Numerics.FixedWord.addCarry64_carry_le_one
(x y carry : UInt64)
(hcarry : carry.toNat ≤ 1)
:
If the incoming carry of addCarry64 is a bit, so is the outgoing carry.
theorem
FloatLib.Numerics.FixedWord.add128_value_toNat_of_lt
(x y : UInt128)
(hfit : x.toNat + y.toNat < 2 ^ 128)
:
The low two limbs of add128 contain the ordinary sum whenever that sum fits in 128 bits.
Fixed-limb midpoint, significand, and remainder kernels all need this fact, so it lives next to
add128 instead of in backend-local copies of the same carry argument.