Documentation

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

Direct-unrolling read-formula generator #

A stack-free proof-carrying routine that emits the exact numeric gate schedule for reading one symbol from a bounded encoded configuration.

Complete read-formula emission is sound.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitReadConnector_spaceBoundByWidth {initialSpace : } {values : BinaryValues WorkCount} {width : } (havailable : ∀ (inputLength : ), values inputLength Work.available width inputLength) (havailablePositive : ∀ (inputLength : ), 1 values inputLength Work.available) (hreference₀ : ∀ (inputLength : ), values inputLength Work.reference₀ width inputLength) (hreference₁ : ∀ (inputLength : ), values inputLength Work.reference₁ width inputLength) :
emitReadConnector.SpaceBoundByWidthAt initialSpace values width

One reverse-fold connector has a pointwise width certificate when its frontier and both reference registers fit the shared width.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitReadFormula_spaceBoundByWidth (stateCount tapeCount : ) {initialSpace : } {values : BinaryValues WorkCount} {width : } (hclean : ∀ (inputLength : ), ReadFormulaClean (values inputLength)) (hvalues : ∀ (inputLength : ) (index : Fin WorkCount), values inputLength index width inputLength) (hfrontier : ∀ (inputLength : ), values inputLength Work.available + (4 * (values inputLength Work.horizon + 1) + 1) width inputLength) (hheadCap : ∀ (inputLength position : ), position values inputLength Work.horizontransitionHeadRef stateCount (values inputLength Work.horizon) (values inputLength Work.configBase) (values inputLength Work.tapeIndex) position + values inputLength Work.tapeIndex + values inputLength Work.horizon + 1 width inputLength) (hcellCap : ∀ (inputLength position : ), position values inputLength Work.horizontransitionCellRef stateCount tapeCount (values inputLength Work.horizon) (values inputLength Work.configBase) (values inputLength Work.tapeIndex) position (values inputLength Work.symbolIndex) + (values inputLength Work.tapeIndex * (values inputLength Work.horizon + 2) + position) + (values inputLength Work.horizon + 2) + tapeCount + values inputLength Work.tapeIndex + 4 width inputLength) :
(emitReadFormula stateCount tapeCount).SpaceBoundByWidthAt initialSpace values width

Complete read-formula emission has a pointwise width certificate when the wire frontier and every head- and cell-reference intermediate fit the shared width.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitReadFormula_requires (stateCount tapeCount : ) (values : BinaryValues WorkCount) (hclean : ReadFormulaClean values) :
(emitReadFormula stateCount tapeCount).requires values

The clean-entry contract suffices for every arithmetic, loop, reference, and raw-gate leaf in complete read-formula emission.

@[simp]
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitReadFormula_effect (stateCount tapeCount : ) (values : BinaryValues WorkCount) (hclean : ReadFormulaClean values) :
(emitReadFormula stateCount tapeCount).effect values = Function.update values Work.available (values Work.available + (4 * (values Work.horizon + 1) + 1))

Complete read-formula emission restores all owned scratch and only advances the wire frontier, by four gates per possible head position plus the false identity gate.

@[simp]

Complete read-formula emission produces exactly the canonical serialized read-formula schedule at the current horizon and wire frontier.