Lines of composed circuits #
Continuing a program p by a program q keeps the lines of p, with their wires widened to the
larger namespace (Program.lines_append_castAdd), and places after them the lines of q, with
their input wires read from the feeding wires of p and their gate wires shifted past the gates of
p (Program.lines_append_natAdd). Consequently every line of the side-by-side circuit
Circuit.pi cs is a line of some cs j whose wires are renamed by a map that fixes original inputs
and sends gates to gates (Circuit.exists_lines_pi), and its outputs are gates when those of every
cs j are (Circuit.outputs_pi_eq_gate).
Main results #
Cslib.Circuits.Program.lines_append_castAdd,Cslib.Circuits.Program.lines_append_natAdd: the lines of a continued program.Cslib.Circuits.Circuit.exists_lines_pi: every line ofpi csis a renamed line of somecs j.Cslib.Circuits.Circuit.outputs_pi_eq_gate: the outputs ofpi csare gates when the outputs of the circuitscs jare.
@[simp]
theorem Cslib.Circuits.Program.appendedWire_castSucc {n k g₁ g₂ : ℕ} (feed : Fin k → Wire n g₁) (w : Wire k g₂) :
Reading a wire of the continuation commutes with widening it by one gate.