Physical framed-word width counting with exact logarithmic counter storage
ProvedIntMul.WordWidthCounter.count_word_widthalgorithmsfixed-tape-routinginteger-multiplicationturing-machines
Let be a finite binary source word of length , including the empty word. From the explicit configuration with on the marked source tape, empty output and counter tapes, and every head at its start marker, the fixed physical counter machine halts in its exact terminal frame within
actual transitions. It retains the source and empty output, and writes a little-endian counter satisfying
No numerical length is supplied to the machine. Every scan, ripple carry, marker rewind and caller return is charged. This framed-word routine permits an already computed input descriptor to be physically counted, providing a logarithmic block width without a caller-supplied parameter.
Preamble
import Definitions.Def_IntMul_InputWidthCounter import Mathlib.Tactic import Definitions.Def_IntMul_WordWidthCounter open IntMul IntMul.WordWidthCounter
Formal statement
theorem IntMul.WordWidthCounter.count_word_width (w : List Bool) :
∃ t : ℕ, t≤ 6*w.length+4 ∧
machine.step^[t] (initialFrame w)=finalFrame w ∧
(machine.step^[t] (initialFrame w)).state=machine.qHalt ∧
(machine.step^[t] (initialFrame w)).cells machine.inTape=(initialFrame w).cells machine.inTape ∧
(machine.step^[t] (initialFrame w)).cells machine.outTape=machine.tapeOf [] ∧
BinaryAdder.littleVal (counterWord w)+1=max w.length 1 ∧
(counterWord w).length=Nat.clog 2 (max w.length 1) := by sorrySource
Original complete physical framed-word counting with empty-word behavior, full retained frame and exact logarithmic counter storage. Written by Codex.