Circuits as certificates #
A verifier that guesses a circuit reads it from a certificate of a fixed length. This file fixes
such a format for De Morgan circuits with n inputs, one output and at most s gates, of length
certLength n s, monotone in the number of inputs (certLength_mono_left) and at most
3 (n + s + 1) ^ 2 (certLength_le_three_mul_sq). Wire numbers are below w = n + s and are
written in unary in fields of w bits (unaryField); an operation takes three bits (Op.bits).
A certificate lists the number of gates in a field of s bits, the output wire, and then s rows
of 3 + 2 w bits, the first of which hold the gates (certificate).
Every bit string reads as a list of gates and an output wire (readCertificate): a field is read
as its number of ones, any three bits as an operation, and the arguments of a gate are cut to the
arity of its operation. Reading is polynomial-time
(Cslib.Circuits.Boolean.computableInPolyTime_readCertificate), and the certificate of a
circuit, followed by any bits, reads as its code (readCertificate_certificate_append). A string
that is not the certificate of a circuit may read as gates that read wires not yet computed; the
checker Cslib.Circuits.codeCheck from CslibFrontier.Computability.Circuit.Encoding.Check tells
the
codes of circuits apart (Cslib.Circuits.codeCheck_eq_true_iff), and this module registers its
De Morgan polynomial-time certificate (Cslib.Circuits.Boolean.computableInPolyTime_codeCheck).
Main definitions #
Cslib.Circuits.Boolean.Op.ofBits,Cslib.Circuits.Boolean.gateRow,Cslib.Circuits.Boolean.readRow: 3-bit operation decoding and gate row encoding/decoding.Cslib.Circuits.Boolean.certLength: the length of certificates.Cslib.Circuits.Boolean.certificate: the certificate of a circuit code.Cslib.Circuits.Boolean.readCertificate: the gates and the output wire read from a certificate.
Main results #
Cslib.Circuits.Boolean.certLength_mono_left: certificate length is monotone in the input count.Cslib.Circuits.Boolean.certLength_le_three_mul_sq: certificate length is at most3 (n + s + 1) ^ 2.Cslib.Circuits.Boolean.length_certificate: certificates have lengthcertLength n s.Cslib.Circuits.Boolean.readCertificate_certificate_append: a certificate reads as the code of its circuit.Cslib.Circuits.Boolean.computableInPolyTime_readCertificate,Cslib.Circuits.Boolean.computableInPolyTime_codeCheck: reading certificates and checking codes are polynomial-time.
References #
Fields and rows #
The number a in a field of width bits: a ones, then zeros.
A unary field of width width for a ≤ width has length width.
A unary field of width width for a contains a ones.
Certificates #
The length of the certificates of circuits with n inputs and at most s gates.
Certificate length is monotone in the number of inputs.
The certificate length is at most 3 (n + s + 1) ^ 2.
The certificate of a circuit with n inputs and at most s gates, given by its gate list and
its output wire: the number of gates and the output wire in fields of s and n + s bits, the
rows of the gates, and rows of zeros up to s rows.
A certificate reads as at most s gates.
A certificate reads as the code of its circuit, whatever bits follow it.
The certificate of a circuit with at most s gates has length certLength n s.
Reading certificates in polynomial time #
Checking that a list of gates is a code is polynomial-time, with the number of inputs in unary.
Reading certificates is polynomial-time, for the number of inputs and the number of gates in unary.