Verified fixed-limb differences #
The helpers of Difference.Runtime compare, subtract, normalize, and shift two-word unsigned
values without converting the executable path to Nat. The theorems here give their mathematical
values for format-specific subtraction proofs.
@[simp]
Native three-way comparison agrees with comparison of mathematical values.
@[simp]
Native two-word right shift, defined for every shift, is floor division by a power of two.
theorem
FloatLib.Numerics.FixedWord.UInt128.shiftRight_shiftLeft_beq
(low : UInt128)
(d : ℕ)
(hlowNe : low.toNat ≠ 0)
:
Shifting a nonzero two-word value right and back left returns it exactly when the shift drops only zero bits.