Documentation

Complexitylib.Classes.PPoly.Uniform.Unrolling.Generator.Transition.WrittenCell

Verified direct written-cell formula generation #

This module exposes the complete positive-cell formula generator together with its clean entry domain, restored work-vector effect, and exact encoded numeric schedule.

Complete written-cell formula generation is sound.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitWrittenCellFormula_spaceBoundByWidth {k : } (tm : NTM k) (tape : WritableSlot k) (symbol : Γ) {initialSpace : } {values : BinaryValues WorkCount} {width : } (hclean : ∀ (inputLength : ), WrittenCellFormulaClean (values inputLength)) (hvalues : ∀ (inputLength : ) (index : Fin WorkCount), values inputLength index width inputLength) (hposition : ∀ (inputLength : ), values inputLength Work.position values inputLength Work.horizon + 1) (hcap : ∀ (inputLength stateIndex tapeIndex symbolIndex position : ), stateIndex < Fintype.card tm.QtapeIndex k + 1symbolIndex < 4position values inputLength Work.horizon + 1values inputLength Work.available + writtenCellScheduleSize (transitionCases tm).length k (values inputLength Work.horizon) (writtenCellEffectSelectedAt tm tape symbol) (effectCaseChoiceAt tm) + transitionStateRef (values inputLength Work.configBase) stateIndex + (transitionHeadRef (Fintype.card tm.Q) (values inputLength Work.horizon) (values inputLength Work.configBase) tapeIndex position + tapeIndex + values inputLength Work.horizon + 1) + (transitionCellRef (Fintype.card tm.Q) (k + 2) (values inputLength Work.horizon) (values inputLength Work.configBase) tapeIndex position symbolIndex + (tapeIndex * (values inputLength Work.horizon + 2) + position) + (values inputLength Work.horizon + 2) + (k + 2) + tapeIndex + 4) + caseReadSize (values inputLength Work.horizon) + values inputLength Work.horizon width inputLength) :
(emitWrittenCellFormula tm tape symbol).SpaceBoundByWidthAt initialSpace values width

Complete written-cell emission has an all-prefix width certificate under one global bounded-selector envelope. The cap covers the complete wire frontier together with every state, head, cell, and read-size intermediate used by the nested effect and fixed wrapper phases.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitWrittenCellFormula_requires {k : } (tm : NTM k) (tape : WritableSlot k) (symbol : Γ) (values : BinaryValues WorkCount) (hclean : WrittenCellFormulaClean values) (hposition : values Work.position values Work.horizon + 1) :
(emitWrittenCellFormula tm tape symbol).requires values

Clean owned scratch and an in-range positive-cell position suffice for complete written-cell formula generation.

@[simp]

Written-cell generation restores every owned register and advances only the wire frontier by the exact numeric schedule size.

@[simp]

The emitted word is literally the canonical numeric written-cell schedule, including both head tests, the selected-write effect, and the preservation branch.