Actual counted prefix read from an ordinary binary tape with restored templates
ProvedIntMul.PrefixRead.read_prefixalgorithmsfixed-tape-routinginteger-multiplicationturing-machines
Let be finite binary words and let . From an explicit live caller frame at the beginning of on the plain input tape , with accumulated output and physically prepared counter/templates for , the fixed four-tape counted machine reads and appends exactly the first bits of . It halts in its exact terminal frame after at most
actual transitions. The input tape is retained, both input and output cursors advance by , both counter/template words are restored, and their heads return to the retained positions. No descriptor is appended to the input and no length oracle is supplied to the transition table. This is the physical finite-prefix operation needed for exact output-width conversion.
Preamble
import Definitions.Def_IntMul_BinaryAdder import Definitions.Def_IntMul_MultitapeModel import Mathlib.Tactic import Mathlib.Data.Nat.Bits import Definitions.Def_IntMul_CountedStream import Mathlib.Data.List.GetD import Definitions.Def_IntMul_PrefixRead open IntMul IntMul.PrefixRead
Formal statement
theorem IntMul.PrefixRead.read_prefix (pre x tail a y : List Bool)
(hx : IntMul.val y+1 ≤ x.length) :
∃ t : ℕ, t ≤ 6 * (IntMul.val y + 1) + 4 * y.length + 2 ∧
machine.step^[t] (ready pre x tail a y 0 .emit) =
ready pre x tail a y (IntMul.val y+1) .halt := by sorrySource
Complete physical counted prefix read on an ordinary binary tape. Owns payload emission, real binary counter, amortized countdown clock, template restoration and exact full frame proof. Written by Codex.