Complete physical unbounded binary increment with exact clock and amortized linear bound
ProvedIntMul.GrowingCounter.increment_counterLet be any finite little-endian binary counter word, including the empty zero word. Let be its number of initial one bits and its total number of one bits. A fixed three-tape machine physically increments the word, extending its tape representation into the actual blank if necessary, seeks its real start marker and returns to its first payload cursor after exactly
actual transitions. It reaches the exact terminal caller frame, globally halts, retains both input and output caller tapes and heads, increases the binary value by one, and grows the counter width by at most one. Its potential identity is
Consequently the sum of the proved physical per-call costs for increments is at most , and the resulting counter value is its initial value plus . In particular increments starting from the empty zero representation have total cost at most . Restart dispatch costs of a surrounding reader remain separate.
import Definitions.Def_IntMul_GrowingCounter import Mathlib.Tactic open IntMul IntMul.GrowingCounter
theorem IntMul.GrowingCounter.increment_counter (base : machine.Cfg) (bits : List Bool) :
machine.step^[counterSteps bits] (counterFrame base .carry bits)=counterFrame base .halt (increment bits) ∧
(machine.step^[counterSteps bits] (counterFrame base .carry bits)).state=machine.qHalt ∧
(machine.step^[counterSteps bits] (counterFrame base .carry bits)).cells 0=base.cells 0 ∧
(machine.step^[counterSteps bits] (counterFrame base .carry bits)).head 0=base.head 0 ∧
(machine.step^[counterSteps bits] (counterFrame base .carry bits)).cells 1=base.cells 1 ∧
(machine.step^[counterSteps bits] (counterFrame base .carry bits)).head 1=base.head 1 ∧
BinaryAdder.littleVal (increment bits)=BinaryAdder.littleVal bits+1 ∧
(increment bits).length ≤ bits.length+1 ∧
counterSteps bits+2*potential (increment bits)=4+2*potential bits ∧
(∀ n, totalCounterSteps n bits ≤ 4*n+2*potential bits ∧
BinaryAdder.littleVal (iterateCounter n bits)=BinaryAdder.littleVal bits+n) := by sorry