Normalization and correctness of direct quotient prefixes #
The direct quotient kernel normalizes significands, emits a bounded quotient window, and records
any nonzero discarded suffix with a sticky bit. This module follows those stages: common-leading
normalization, retained-prefix bounds, recovery of the input dyadic ratio, and the final
prefixAtLeading correctness theorems.
Direct.Jamming proves the exact-fraction comparison lemmas shared by these stages. Posit layout
and final rounding refinement remain in Direct.Proof; the results here are uniform in width.
Common-leading normalization #
Shifting a nonzero integer from its leading bit to a larger common position normalizes it.
Proof facts carried by a pair of significands after common-leading normalization.
The executable record deliberately stores only values needed by the quotient kernel. These
facts live in Prop, so proofs can name the common bounds without enlarging runtime data.
The recorded numerator leading position is exact.
The recorded denominator leading position is exact.
- numerator_eq : normalized.numerator = numerator * 2 ^ (max numerator.log2 denominator.log2 - numerator.log2)
The numerator is shifted to the common leading position.
- denominator_eq : normalized.denominator = denominator * 2 ^ (max numerator.log2 denominator.log2 - denominator.log2)
The denominator is shifted to the common leading position.
The normalized numerator reaches the common leading bit.
The normalized numerator has no bit above the common leading bit.
The normalized denominator reaches the common leading bit.
The normalized denominator has no bit above the common leading bit.
Instances For
Common-leading normalization records exact positions, values, and bounds.
Common-leading normalization changes a ratio only by the recorded leading-position offset.
The quotient selected from two equally normalized integers has the requested leading position.
Jamming a normalized quotient preserves its leading position without overflowing it.
Bracketing the retained quotient prefix #
The retained prefix of a normalized jammed quotient is at most the exact normalized quotient.
This is the representation-independent lower-bracket theorem used by Posit candidate proofs.
The exact normalized quotient is below the successor of its retained jammed prefix.
The explicit successor bound is precisely the in-regime condition supplied by Posit layout.
Every normalized quotient tail is strictly below the next regime scale.
Recovering the input dyadic ratio #
Euclidean division exposes a scaled rational as its quotient plus proper remainder.
Moving the normalization and quotient-digit scales into the result exponent recovers the exact dyadic ratio.
Executable prefix correctness #
The quotient and remainder generated by an arbitrary-width prefix form a normalized Euclidean window at exactly the requested leading bit.
The executable arbitrary-width prefix is normalized at exactly the requested leading bit.
Before jamming, the generated quotient and exact Euclidean remainder denote the input dyadic ratio at the exponent stored in the executable prefix.