Binary word arithmetic and comparison #
The carry fold, its value and length laws, and the highest-differing-bit characterization of strict order are pure facts about least-significant-first binary words. They do not import a computability calculus. The multiplication bit fold and its prefix-size laws are shared with the direct and legacy resource proofs, retaining the original shift-and-add data.
The carry of adding three digits.
Instances For
Incrementing a canonical word represents addition of its incoming carry.
Binary multiplication fold #
The existing NatMul word-fold data and laws are moved from Complexity/Arith with Christian Reitwiessner's source and proof bodies unchanged. Only these four previously module-private names are exposed for shared direct and legacy resource proofs.
m < n exactly when some bit position below the length of n holds a zero in m and a one
in n, and every higher position below the total length agrees.