Documentation

Complexitylib.Classes.PPoly.Uniform.Unrolling.Serializer.Transition.Step

Numeric schedules for one packed transition step #

This module exposes the canonical whole-step schedule. It streams one numeric nextFormula block per configuration atom in explicit wire order, then emits one packed-output copy per atom in that same order.

Main results #

@[simp]
theorem Complexity.CircuitUnrolling.Serializer.length_stepFormulaBlock (caseCount stateCount workCount T configBase choiceWire available haltStateIndex : ) (kindAt atomStateIndexAt atomTapeIndexAt atomPositionAt atomSymbolIndexAt : ) (selectedAt : Bool) (choiceAt : Bool) (caseStateIndexAt inputSymbolIndexAt outputSymbolIndexAt : ) (workSymbolIndexAt : ) (atomIndex : ) (hindex : atomIndex < stepAtomCount stateCount workCount T) :
List.length (stepFormulaBlock caseCount stateCount workCount T configBase choiceWire available haltStateIndex kindAt atomStateIndexAt atomTapeIndexAt atomPositionAt atomSymbolIndexAt selectedAt choiceAt caseStateIndexAt inputSymbolIndexAt outputSymbolIndexAt workSymbolIndexAt atomIndex) = stepFormulaSizeAt caseCount stateCount workCount T kindAt selectedAt choiceAt atomIndex

An in-range atom block has exactly its advertised numeric size.

@[simp]
theorem Complexity.CircuitUnrolling.Serializer.length_stepFormulaGates (caseCount stateCount workCount T configBase choiceWire available haltStateIndex : ) (kindAt atomStateIndexAt atomTapeIndexAt atomPositionAt atomSymbolIndexAt : ) (selectedAt : Bool) (choiceAt : Bool) (caseStateIndexAt inputSymbolIndexAt outputSymbolIndexAt : ) (workSymbolIndexAt : ) :
List.length (stepFormulaGates caseCount stateCount workCount T configBase choiceWire available haltStateIndex kindAt atomStateIndexAt atomTapeIndexAt atomPositionAt atomSymbolIndexAt selectedAt choiceAt caseStateIndexAt inputSymbolIndexAt outputSymbolIndexAt workSymbolIndexAt) = prefixSize (stepFormulaSizeAt caseCount stateCount workCount T kindAt selectedAt choiceAt) (stepAtomCount stateCount workCount T)

The complete forward formula phase is the prefix sum of all atom sizes.

@[simp]
theorem Complexity.CircuitUnrolling.Serializer.length_stepPackedCopies (caseCount stateCount workCount T available : ) (kindAt : ) (selectedAt : Bool) (choiceAt : Bool) :
List.length (stepPackedCopies caseCount stateCount workCount T available kindAt selectedAt choiceAt) = stepAtomCount stateCount workCount T

The packed suffix contains exactly one copy gate per atom.

theorem Complexity.CircuitUnrolling.Serializer.getElem_stepPackedCopies (caseCount stateCount workCount T available : ) (kindAt : ) (selectedAt : Bool) (choiceAt : Bool) (atomIndex : Fin (stepAtomCount stateCount workCount T)) :
(stepPackedCopies caseCount stateCount workCount T available kindAt selectedAt choiceAt)[atomIndex] = stepPackedCopyGate caseCount stateCount workCount T available kindAt selectedAt choiceAt atomIndex

Packed-copy index recovers the formula-output reference computed by the numeric prefix oracle.

@[simp]
theorem Complexity.CircuitUnrolling.Serializer.length_stepSchedule (caseCount stateCount workCount T configBase choiceWire available haltStateIndex : ) (kindAt atomStateIndexAt atomTapeIndexAt atomPositionAt atomSymbolIndexAt : ) (selectedAt : Bool) (choiceAt : Bool) (caseStateIndexAt inputSymbolIndexAt outputSymbolIndexAt : ) (workSymbolIndexAt : ) :
List.length (stepSchedule caseCount stateCount workCount T configBase choiceWire available haltStateIndex kindAt atomStateIndexAt atomTapeIndexAt atomPositionAt atomSymbolIndexAt selectedAt choiceAt caseStateIndexAt inputSymbolIndexAt outputSymbolIndexAt workSymbolIndexAt) = stepScheduleSize caseCount stateCount workCount T kindAt selectedAt choiceAt

Exact gate count of the complete numeric packed step.

Literal equality between the existing packed transition fragment and the canonical numeric whole-step schedule.

The existing packed fragment size is exactly the numeric schedule count.

theorem Complexity.CircuitUnrolling.Serializer.stepOutputBase_eq_stepScheduleOutputBase {k : } (tm : NTM k) (T configBase choiceWire available : ) :
stepOutputBase tm T configBase choiceWire available = stepScheduleOutputBase (transitionCases tm).length (Fintype.card tm.Q) k T available (stepAtomKindAt tm T) (stepAtomEffectSelectedAt tm T) (effectCaseChoiceAt tm)

The numeric prefix total is exactly the existing packed successor base.

theorem Complexity.CircuitUnrolling.Serializer.stepScheduleOutputRef_configIndex {k : } (tm : NTM k) (T configBase choiceWire available : ) (atom : ConfigAtom tm T) :
stepScheduleOutputRef (transitionCases tm).length (Fintype.card tm.Q) k T available (stepAtomKindAt tm T) (stepAtomEffectSelectedAt tm T) (effectCaseChoiceAt tm) (configIndex tm T atom) = configWire tm T (stepOutputBase tm T configBase choiceWire available) atom

A numeric packed-output reference at an atom's explicit index is exactly its successor-configuration wire.