Documentation

CslibFrontier.Computability.Complexity.ProofSystem

Proof systems #

A proof system for a set L in the sense of Cook and Reckhow is a function, computable in polynomial time, from words onto L (Cslib.Complexity.ProofSystem). A word π is a proof of P π: every word proves a member of L, and every member of L has a proof. A proof system is polynomially bounded when every member has a proof of length polynomial in its own length (Cslib.Complexity.ProofSystem.PolynomiallyBounded).

Proof systems are compared by simulation: Q simulates P when every proof for P can be replaced by a proof for Q of the same member that is at most polynomially longer, and Q p-simulates P when the replacement is computed in polynomial time. Simulation transfers polynomial bounds (Cslib.Complexity.ProofSystem.PolynomiallyBounded.of_simulates).

A set with a polynomially bounded proof system is in NP, since a short proof is a certificate checked by computing the member it proves. Conversely, a nonempty set in NP whose encoding has a decoder has a polynomially bounded proof system: a proof is an encoded instance followed by a certificate the verifier accepts, and a proof the verifier rejects proves a fixed member (Cslib.Complexity.ProofSystem.exists_polynomiallyBounded_iff_mem_NP). Applied to a coNP-complete set, this is the theorem of Cook and Reckhow: coNP ⊆ NP exactly when that set has a polynomially bounded proof system. For the unsatisfiable formulas in conjunctive normal form, which are coNP-complete by the Cook–Levin theorem, this reads: NP = coNP exactly when some propositional refutation system is polynomially bounded (Cslib.Complexity.ProofSystem.NP_eq_coNP_iff_exists_polynomiallyBounded).

Proofs are words over Bool, as in [CR79b]. The verifier construction uses a total decoder: even a malformed word can decode to an instance with an accepted certificate. It proves that instance when the verifier and certificate-length checks pass, and a fixed member otherwise.

Main definitions #

Main results #

References #

structure Cslib.Complexity.ProofSystem {α : Type} (enc : α ↪ List Bool) (L : Set α) :

A proof system for L [CR79b]: a function, computable in polynomial time, from words onto L. A word π is a proof of P π; every word proves a member of L, and every member of L has a proof.

Instances For
    @[instance_reducible]
    instance Cslib.Complexity.ProofSystem.instCoeFunForallListBool {α : Type} {enc : α ↪ List Bool} {L : Set α} :
    CoeFun (ProofSystem enc L) fun (x : ProofSystem enc L) => List Bool → α
    theorem Cslib.Complexity.ProofSystem.mem {α : Type} {enc : α ↪ List Bool} {L : Set α} (P : ProofSystem enc L) (π : List Bool) :
    P.toFun π ∈ L

    Soundness: every word proves a member of L.

    theorem Cslib.Complexity.ProofSystem.exists_eq {α : Type} {enc : α ↪ List Bool} {L : Set α} (P : ProofSystem enc L) {a : α} (ha : a ∈ L) :
    ∃ (π : List Bool), P.toFun π = a

    Completeness: every member of L has a proof.

    theorem Cslib.Complexity.ProofSystem.nonempty {α : Type} {enc : α ↪ List Bool} {L : Set α} (P : ProofSystem enc L) :

    A set with a proof system is nonempty.

    Polynomial bounds and simulations #

    P is polynomially bounded [CR79b]: for a polynomial p, every member a of L has a proof of length at most p (enc a).length.

    def Cslib.Complexity.ProofSystem.Simulates {α : Type} {enc : α ↪ List Bool} {L : Set α} (Q P : ProofSystem enc L) :

    Q simulates P: for a polynomial p, every proof π for P can be replaced by a proof for Q of the same member, of length at most p π.length.

    def Cslib.Complexity.ProofSystem.PSimulates {α : Type} {enc : α ↪ List Bool} {L : Set α} (Q P : ProofSystem enc L) :

    Q p-simulates P [CR79b]: a function computable in polynomial time translates every proof for P into a proof for Q of the same member.

    theorem Cslib.Complexity.ProofSystem.Simulates.refl {α : Type} {enc : α ↪ List Bool} {L : Set α} {P : ProofSystem enc L} :

    Every proof system simulates itself.

    theorem Cslib.Complexity.ProofSystem.Simulates.trans {α : Type} {enc : α ↪ List Bool} {L : Set α} {P Q R : ProofSystem enc L} (hRQ : R.Simulates Q) (hQP : Q.Simulates P) :

    Simulation is transitive.

    theorem Cslib.Complexity.ProofSystem.PSimulates.refl {α : Type} {enc : α ↪ List Bool} {L : Set α} {P : ProofSystem enc L} :

    Every proof system p-simulates itself.

    theorem Cslib.Complexity.ProofSystem.PSimulates.trans {α : Type} {enc : α ↪ List Bool} {L : Set α} {P Q R : ProofSystem enc L} (hRQ : R.PSimulates Q) (hQP : Q.PSimulates P) :

    p-simulation is transitive.

    theorem Cslib.Complexity.ProofSystem.PSimulates.simulates {α : Type} {enc : α ↪ List Bool} {L : Set α} {P Q : ProofSystem enc L} (h : Q.PSimulates P) :

    p-simulation implies simulation: a translation computed in polynomial time produces proofs of polynomial length.

    Simulation transfers polynomial bounds: a proof system simulating a polynomially bounded proof system is polynomially bounded.

    Polynomially bounded proof systems and NP #

    theorem Cslib.Complexity.ProofSystem.PolynomiallyBounded.mem_NP {α : Type} {enc : α ↪ List Bool} {L : Set α} {P : ProofSystem enc L} (hP : P.PolynomiallyBounded) :
    L ∈ NP enc

    A set with a polynomially bounded proof system is in NP: a short proof is a certificate, checked by computing the member it proves.

    The instance a word presents to a verifier: the decoding of its first frame.

    Whether the verifier V accepts a word as an instance followed by a certificate of the prescribed length p.

    The proof system of a verifier V for L, with a default member a₀. Each word is decoded into an instance and a certificate using the total decoder D, unframe and dropFrame. It proves the decoded instance if V accepts and the certificate has the prescribed length; otherwise it proves a₀. A malformed frame can pass these checks.

    theorem Cslib.Complexity.ProofSystem.ofVerifier_frame_append {α : Type} {enc : α ↪ List Bool} {L : Set α} {p : Polynomial ℕ} {V : α × List Bool → Bool} (D : Turing.MultiTapeTM.Decoder enc) (hV : Turing.MultiTapeTM.ComputableInPolyTime V (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hVL : IsVerifier enc p V L) {a₀ : α} (ha₀ : a₀ ∈ L) {a : α} {w : List Bool} (hw : w.length = Polynomial.eval (enc a).length p) (hVw : V (a, w) = true) :
    (ofVerifier D hV hVL ha₀).toFun (Turing.MultiTapeTM.frame (enc a) ++ w) = a

    A framed encoded instance followed by an accepted certificate of the prescribed length proves that instance.

    The proof system of a verifier is polynomially bounded: an instance a has a proof of length 2 * (enc a).length + 1 + p (enc a).length.

    A set is in NP exactly when it has a polynomially bounded proof system [CR79b], for nonempty sets whose encoding has a decoder.

    The theorem of Cook and Reckhow #

    theorem Cslib.Complexity.ProofSystem.coNP_subset_NP_iff_exists_polynomiallyBounded {β : Type} {encB : β ↪ List Bool} {B : Set β} (hB : coNPComplete encB B) (D : Turing.MultiTapeTM.Decoder encB) (hne : B.Nonempty) :
    (∀ {γ : Type} (encC : γ ↪ List Bool), coNP encC ⊆ NP encC) ↔ ∃ (P : ProofSystem encB B), P.PolynomiallyBounded

    Cook and Reckhow, for coNP-complete sets [CR79b]: coNP ⊆ NP, for problems with every encoding of their instances, exactly when a nonempty coNP-complete set with a decodable encoding has a polynomially bounded proof system.

    The theorem of Cook and Reckhow ([CR79b]; Goldreich, Appendix B.4, Theorem B.13 with Definition B.12, printed p. 527 / PDF p. 19), for refutations: NP = coNP, for problems with every encoding of their instances, exactly when some proof system for the unsatisfiable formulas in conjunctive normal form is polynomially bounded.

    Compared with [Gol07e], which states Theorem B.13 for propositional tautologies and verifier-style proof systems (Definition B.12): proofs here refute unsatisfiable CNF formulas (the refutation view adopted later in Appendix B.4), proof systems are Cook–Reckhow polynomial-time surjections onto the set (ProofSystem), and PolynomiallyBounded bounds a shortest proof of each member by a polynomial in its encoded length.