Literal saved-template counter reset in 2w+2 transitions
ProvedIntMul.CountedStream.template_reset_correctFor any base configuration and two equal-width binary words of width w, the literal counted-stream machine, started in its resetLeft state with heads on the least significant counter and template cells, is exactly in its halted reset frame after 2w+2 transitions. Both working tapes then contain the original template word between unchanged separators, and both work heads are restored to the original least-significant position. The input and output tapes and their heads are exactly preserved from the arbitrary base configuration. The result includes width zero (adjacent delimiters). This establishes the physical saved-template reset and charges its head returns; full counted-stream setup, payload, and dispatch composition are separate obligations.
import Definitions.Def_IntMul_CountedStream import Mathlib.Data.List.GetD import Mathlib.Tactic
theorem IntMul.CountedStream.template_reset_correct (base : IntMul.CountedStream.machine.Cfg) (bits template : List Bool)
(h : bits.length = template.length) :
IntMul.CountedStream.machine.step^[2 * bits.length + 2]
(IntMul.CountedStream.resetFrame base .resetLeft bits template (bits.length + 1)) =
IntMul.CountedStream.resetFrame base .halt template template (template.length + 1) := by sorry