Bounding the complete binary encoding of a circuit #
A circuit's typed wires bound every binary reference by its input and gate counts. This gives a polynomial bound on its complete serialized code, including gate tags, outputs and framing. It is useful for certifying circuit-construction loops whose intermediate circuits have bounded size, without making a claim about the complexity of the functions those circuits compute.
Main results #
Cslib.Circuits.Boolean.length_encList_encNat_wires_le: a list ofkwires, each of whose encoded references has length at mostL, encodes in length at mostk * (2 * L + 1); shared by every basis whose code lists wires.Cslib.Circuits.Boolean.length_encList_encGate_le: a gate-list length bound parameterized by a uniform bound on encoded wire references.Cslib.Circuits.Boolean.length_encCode_le: a bound in the input, output and gate counts.
A list of wires encodes in length linear in its count. If every wire reference of w has
encoded length at most L, the encoded list List.ofFn fun i => (w i).toNat (the arguments of a
line or the outputs of a circuit, over any basis) has length at most k * (2 * L + 1).
Every De Morgan gate list has encoded length at most c.size * (23 + 8 * L) whenever every
encoded wire reference in c has length at most L.