Actual input-derived width-minus-one counter from the global initial configuration with linear clock
ProvedIntMul.InputWidthCounter.input_width_counterLet be finite binary operand words with . A fixed three-tape machine starts from the ordinary global initial configuration on , with empty output and work tapes and all heads on their start markers. It physically constructs a little-endian binary counter of value on work tape 2 and halts in its exact complete terminal configuration after at most
actual transitions. The original input tape is retained read-only and global output is retained empty. No width word, length, local bank data or counter bits are supplied in advance. Every scanned operand bit, skipped separator, ripple write, blank extension, marker rewind and finite-caller return is charged. The resulting word provides an input-derived descriptor for exact multiplication output width after a separately charged physical order conversion. The theorem covers an empty first operand whenever the second is nonempty.
import Definitions.Def_IntMul_InputWidthCounter import Mathlib.Tactic open IntMul IntMul.InputWidthCounter
theorem IntMul.InputWidthCounter.input_width_counter (x y : List Bool) (hp : 0 < x.length+y.length) :
∃ t : ℕ, t ≤ 6*(x.length+y.length)+4 ∧
machine.step^[t] (initialFrame x y)=finalFrame x y ∧
(machine.step^[t] (initialFrame x y)).state=machine.qHalt ∧
(machine.step^[t] (initialFrame x y)).cells machine.inTape=(initialFrame x y).cells machine.inTape ∧
(machine.step^[t] (initialFrame x y)).cells machine.outTape=machine.tapeOf [] ∧
BinaryAdder.littleVal (GrowingCounter.iterateCounter (x.length+y.length-1) [])+1=x.length+y.length := by sorry