Documentation

Complexitylib.Circuits.Encoding.FixedWidth.Evaluation.Sequence

Sequential fixed-width gate evaluation #

This module exposes the exact length and topological correctness of the raw fragment that computes every fixed-width gate slot in sequence.

@[simp]
theorem Complexity.CircuitCode.FixedWidth.Description.EvaluationSequence.length_stepCircuit {inputWidth gateBound : } (slot : Fin gateBound) :
List.length (stepCircuit inputWidth gateBound slot) = GateFormula.gateSize inputWidth gateBound slot

A compiled gate step emits exactly its advertised formula size.

@[simp]
theorem Complexity.CircuitCode.FixedWidth.Description.EvaluationSequence.length_stepCircuitAt (inputWidth gateBound index : ) :
List.length (stepCircuitAt inputWidth gateBound index) = EvaluationLayout.sizeAt inputWidth gateBound index

The total natural-index step builder agrees with the numeric size oracle.

@[simp]
theorem Complexity.CircuitCode.FixedWidth.Description.EvaluationSequence.length_prefixCircuit (inputWidth gateBound count : ) :
List.length (prefixCircuit inputWidth gateBound count) = EvaluationLayout.prefixSize inputWidth gateBound count

A prefix circuit emits exactly its corresponding formula-size prefix.

@[simp]
theorem Complexity.CircuitCode.FixedWidth.Description.EvaluationSequence.length_circuit (inputWidth gateBound : ) :
List.length (circuit inputWidth gateBound) = EvaluationLayout.prefixSize inputWidth gateBound gateBound

The complete gate sequence has the full bounded formula-size prefix.

Every compiled gate step references only its entry prefix or gates emitted earlier in that formula fragment.

theorem Complexity.CircuitCode.FixedWidth.Description.EvaluationSequence.topologicallyWellFormed_prefixCircuit (inputWidth gateBound count : ) (hcount : count gateBound) :
RawCircuit.TopologicallyWellFormed (EvaluationLayout.baseWireCount inputWidth gateBound) (prefixCircuit inputWidth gateBound count)

Every in-range sequential prefix is topologically well formed from the description-and-sample input block.

The complete bounded gate sequence is topologically well formed.