Relocating raw circuit fragments #
Uniformly shifting a raw fragment preserves its gate count and local topology. Evaluation after a memo prefix is exactly the prefix followed by the original local evaluation result.
theorem
Complexity.CircuitCode.RawGate.wellFormedAt_shift_iff
(offset available : ℕ)
(gate : RawGate)
:
A shifted gate is valid at the shifted boundary exactly when the original gate is valid at its local boundary.
@[simp]
Wire relocation preserves the exact gate count.
theorem
Complexity.CircuitCode.RawCircuit.topologicallyWellFormed_shift_iff
(offset available : ℕ)
(circuit : RawCircuit)
:
TopologicallyWellFormed (offset + available) (shift offset circuit) ↔ TopologicallyWellFormed available circuit
Uniform relocation preserves and reflects local topological validity.
theorem
Complexity.CircuitCode.RawCircuit.evalAux?_shift
(offset : ℕ)
(circuit : RawCircuit)
(leading wires : Array Bool)
(hleading : leading.size = offset)
:
Evaluating a relocated fragment after a prefix preserves that prefix and reproduces the original local result behind it.