Verified four-limb rounding #
These theorems connect four-limb shifts, sticky-bit normalization, and nearest-even rounding to
their natural-number meanings. Multiplication and fused-operation backends can reuse this layer
without converting compiled arithmetic to Nat.
The fixed-limb low-bit predicate agrees with the natural-number remainder test at every width.
Widths above the four-limb capacity inspect the complete value, matching reduction modulo any
power of two at least 2^256.
Four-limb shifting by less than one word agrees with >>> when the quotient fits two limbs.
When the top limb is zero, a one-word shift selects the middle two limbs.
A two-word shift selects the upper two limbs.
A four-limb shift is floor division whenever its quotient fits in the returned two-limb carrier.
Clients need only this fit condition, never the native word-boundary cases. Normalization and later fixed-limb kernels use it.
The fixed-limb jam operation refines the representation-independent operation once its quotient and discarded-bit test have been established.
Four-to-two-limb normalization never discards more than 128 bits.
A four-limb value fits below the normalization window selected from its leading bit.
The quotient selected by four-to-two-limb normalization fits in two limbs.
Native four-to-two-limb normalization refines representation-independent shift-with-jam.
The quotient fits in two limbs, and the low bit records the OR of the quotient's low bit and the discarded suffix's sticky bit.
Four-to-two-limb normalization is zero exactly when its input is zero.
Four-limb nearest-even rounding agrees with the generic natural-number rounder.
Four-word subtraction, comparison, and widening #
The four-word complement is 2^256 - 1 - value.
The widening shuffle agrees with <<< for every shift below 128.