Correctness of native-word dyadic comparison #
The runtime comparator avoids materializing shifted arbitrary-precision integers when two
nonnegative dyadics fit the fixed-word preconditions. This module proves its word comparisons,
exponent alignment, and swapped-operand cases equal to the reference Dyadic ordering.
The comparison is format-independent, so binary and posit kernels can share these shift-and-compare theorems.
Reversing the operands of the exact nonnegative dyadic comparator swaps its ordering.
Wide fixed-limb kernels naturally compare their target against a decoded one-word candidate, whereas the generic posit rounder phrases the same question as candidate against target. Keeping the direction bridge beside the shared comparator prevents each format backend from reproving the same order-theoretic fact.
A recognized word shift preserves the corresponding exact natural-number alignment.
Arithmetic backends reuse this theorem after sharing shiftFits with the comparison kernel.
A recognized two-limb shift preserves the corresponding exact natural-number alignment.
Native-word comparison returns exactly the same ordering as arbitrary-precision dyadic field comparison.
Two-limb-versus-word dyadic comparison is exactly the arbitrary-precision field comparison.
The proof covers all runtime exits: a zero high limb delegates to the established word comparator; a fitting right alignment is represented exactly in two limbs; and each capacity rejection has a strict ordering proof. Consequently the executable wide path introduces no approximation and no additional trust boundary.
The leading-exponent power-of-two test is exactly the reference arbitrary-precision dyadic comparison.
Native strict comparison is the reference exact nonnegative comparison.
Native non-strict comparison is the reference exact nonnegative comparison.