Correctness of the scalar-circuit translation #
The source's initial zero becomes gate zero. All later values retain their order, and the translation preserves every wire value and output exactly.
Old source values still denote the same wires after extending a program.
The last source value is the most recently added gate.
Initial source input coordinates become input wires.
The source's initial zero is the first gate.
theorem
Complexity.ExactFourier.Gate.eval_toCslib
{n k : ℕ}
(g : Gate (n + 1 + k))
(x : Fin n → ℂ)
(v : Fin (k + 1) → ℂ)
:
g.toCslib.eval scalarInterpretation x v = eval (fun (i : Fin (n + 1 + k)) => Cslib.Circuits.Wire.elim x v (sourceWire i)) g
Each translated operation uses exactly its original operands.
theorem
Complexity.ExactFourier.Program.toCslib_fanInAtMost
{n k : ℕ}
(p : Program n k)
:
p.toCslib.FanInAtMost 2
All translated gates have at most two arguments.