Linear-time canonical binary subtraction #
This module exposes a concrete three-tape ripple-borrow subtractor. It preserves two canonical little-endian operands, writes their truncated natural-number difference to a fresh zero result tape, restores every owned head to cell one, and preserves the complete external tape frame. Its running time is linear in the operand bit widths.
The complete subtractor has a linear bit-width envelope.
Framed time contract for truncated subtraction. Both operands are restored, the initially-zero result becomes their natural-number difference, and every unrelated tape is preserved exactly.
Reachability form of the framed subtraction theorem.
All-prefix auxiliary-space contract obtained from the concrete linear time bound.
Canonical subtraction never moves the public output head left.