Documentation

Complexity.Computability.MCSP.NP

MCSP is in NP #

An instance of the Minimum Circuit Size Problem (Cslib.MCSP) is encoded by the 2 ^ n bits of its truth table followed by the threshold in binary (Cslib.MCSP.encInstance); the length of the table determines n. The problem is in NP for this encoding (Cslib.MCSP.mem_NP) Kabanets and Cai: a certificate is a circuit with at most as many gates as the threshold, in the format of Cslib.Circuits.Boolean.readCertificate, and the verifier checks that it is a circuit and evaluates it on all 2 ^ n inputs. The threshold may be exponentially larger than the table; certificates are capped at the truth-table bound 2 ^ n (2 n + 3) + 1, which every function on n inputs meets (Cslib.Circuits.Boolean.complexity_le_two_pow_mul_add_one), so they stay polynomially long in the length of the table.

Main definitions #

Main results #

References #

Instances of MCSP encoded by the bits of the truth table, then the threshold in binary.

Instances For

    The number of gates a certificate for t samples on n inputs may describe: the threshold s, capped at the sample-set bound t * (2 * n + 3) + 1.

    Instances For
      @[simp]

      The number of gates a certificate may describe: the threshold, capped at the truth-table bound that every function meets.

      Instances For

        The value of the function of an instance at the input with bits y.

        Instances For

          The function on m inputs with the truth table T, read as MCSP reads truth tables.

          Instances For

            Whether w, read as a certificate for m inputs and gate budget S, describes a well-formed circuit code with a valid output wire.

            Instances For

              Evaluate the certificate w (for m inputs and gate budget S) on input y.

              Instances For
                def Cslib.MCSP.checkCertificateOn {α : Type} (tests : List α) (input : α → List Bool) (accept : α → Bool → Bool) (m S : ℕ) (w : List Bool) :

                A certificate verifier parameterized by a list of tests, the input bitstring of each test, and the acceptance condition on a test and the circuit output on its input.

                Instances For
                  def Cslib.MCSP.checkCertificate (accept : List Bool → Bool → Bool) (m S : ℕ) (w : List Bool) :

                  A certificate verifier on all 2 ^ m inputs, parameterized by the acceptance condition on an input and the circuit output on that input.

                  Instances For
                    theorem Cslib.MCSP.exists_circuit_of_checkCertificateOn {α : Type} {tests : List α} {input : α → List Bool} {accept : α → Bool → Bool} {m S : ℕ} {w : List Bool} (hw : checkCertificateOn tests input accept m S w = true) :
                    ∃ (C : Circuits.Circuit Circuits.Boolean.signature m 1), C.size ≤ S ∧ ∀ t ∈ tests, ∀ (y : BitString m), input t = List.ofFn y → accept t (C.eval Circuits.Boolean.interpretation y 0) = true

                    An accepted certificate decoded by checkCertificateOn describes a circuit of size at most S meeting the acceptance condition on every test in tests whose input is List.ofFn y.

                    theorem Cslib.MCSP.exists_checkCertificateOn_append {α : Type} {tests : List α} {input : α → List Bool} {accept : α → Bool → Bool} {m S : ℕ} {C : Circuits.Circuit Circuits.Boolean.signature m 1} (hcS : C.size ≤ S) (haccept : ∀ t ∈ tests, ∃ (y : BitString m), input t = List.ofFn y ∧ accept t (C.eval Circuits.Boolean.interpretation y 0) = true) :
                    ∃ (u : List Bool), u.length = Circuits.Boolean.certLength m S ∧ ∀ (extra : List Bool), checkCertificateOn tests input accept m S (u ++ extra) = true

                    A circuit of size at most S meeting the acceptance condition on every test in tests has a certificate of length certLength m S, accepted by checkCertificateOn whatever bits follow it.

                    An accepted certificate decoded by checkCertificate describes a circuit of size at most S meeting the acceptance condition on every input.

                    theorem Cslib.MCSP.exists_checkCertificate_append {accept : List Bool → Bool → Bool} {m S : ℕ} {C : Circuits.Circuit Circuits.Boolean.signature m 1} (hcS : C.size ≤ S) (haccept : ∀ (y : BitString m), accept (List.ofFn y) (C.eval Circuits.Boolean.interpretation y 0) = true) :
                    ∃ (u : List Bool), u.length = Circuits.Boolean.certLength m S ∧ ∀ (extra : List Bool), checkCertificate accept m S (u ++ extra) = true

                    A circuit of size at most S meeting the acceptance condition has a certificate of length certLength m S, accepted whatever bits follow it.

                    Soundness of validCertificate: a well-formed certificate for (n, s) decodes to a circuit of size at most s whose evaluation agrees with evalCertificate.

                    Completeness of validCertificate: every circuit of size at most s on n inputs has a canonical certificate of length certLength n s satisfying validCertificate whose evalCertificate agrees with the circuit on all n-bit inputs.

                    The verifier for MCSP: the certificate must describe a circuit on n inputs with at most budget n s gates (readCertificate) that agrees with the truth table on all 2 ^ n inputs.

                    Instances For

                      Correctness #

                      theorem Cslib.MCSP.getD_boundedBinaryValue_reverse_ofFn {α : Type u_1} {n : ℕ} (T : Fin (2 ^ n) → α) (y : BitString n) (default : α) :

                      Generic truth-table indexing into a function represented as a list via List.ofFn.

                      The verifier reads the function of an instance from its truth table.

                      @[simp]

                      The truth table of a function, as a list, is read back as the function.

                      The polynomial bounding the length of certificates.

                      Instances For

                        When the arity n and sample count t are each at most L, the certificate length at gate budget sampleBudget n t s is bounded by certPolynomial.eval L.

                        Soundness of the verifier. An instance with an accepted certificate, of any length, is in MCSP.

                        Completeness of the verifier. Every instance in MCSP has a certificate of length certLength x.arity (budget x.arity x.threshold) that is accepted whatever bits follow it.

                        Polynomial time #

                        The verifier on the bits of a truth table, a threshold and a certificate, with the number of inputs read from the length of the table: MCSP.verifier on raw data (Cslib.MCSP.verifier_eq_tableVerifier), defined on every list of bits.

                        Instances For

                          An accepted certificate for a truth table of length 2 ^ m bounds the complexity of its function.

                          A truth table of length 2 ^ m whose function has at most s gates has a certificate of length certLength m (budget m s), accepted whatever bits follow it.

                          Checking well-formedness of a certificate is computable in polynomial time when m and S are given in unary.

                          Evaluating a certificate on an input is computable in polynomial time when m and S are given in unary.

                          A generic certificate verifier on a supplied list of tests is computable in polynomial time when its test list, input extraction, and acceptance condition are polynomial-time.

                          A generic certificate verifier is computable in polynomial time when its acceptance condition is polynomial-time and the number of inputs is bounded by the input length.

                          Computing sampleBudget (m a) (t a) (s a) in unary is polynomial-time when m a and t a are polynomial-time in unary and s a is polynomial-time in binary.

                          A certificate verifier on a table list, threshold, and certificate is computable in polynomial time from encPair (encPair encT encNat) encBits when table length is computable in polynomial time into unary, the encoding length bounds the table length, and the acceptance condition is polynomial-time.

                          MCSP is in NP, for instances encoded by their truth table and the threshold in binary.