Documentation

CslibFrontier.Computability.Complexity.Classes.PCP.NP

Logarithmic-randomness PCP is contained in NP #

Enumerating all random words gives polynomially many queries, even when their binary addresses are large. The NP certificate records the bits at those addresses. Looking up an address's first occurrence makes repeated queries consistent. A possibly long PCP proof is reconstructed only in the soundness argument, never by the polynomial-time verifier.

Main definitions #

Main results #

References #

All proof addresses queried on all valid random words, retaining repeated occurrences.

Exhaustively check the random words using the bit at each address's first table occurrence.

Enumerating all V.coins a-bit random words is polynomial-time under a logarithmic coin bound.

The complete address table charges every enumerated word and binary address.

Extracting the compact table answers proof (V.queryTable a) from (a, proof) is polynomial-time under a logarithmic coin bound, using capped binary lookup on proof.

Evaluating V.verdict on a candidate table (a, table) and a random word word using first-occurrence lookup in V.queryTable a is polynomial-time under a logarithmic coin bound.

Exhaustive verification is polynomial time for every table, including short inputs.

theorem Cslib.Complexity.PCPVerifier.mem_queryTable {α : Type} {V : PCPVerifier α} {a : α} {word : List Bool} {address : ℕ} (hword : word.length = V.coins a) (haddress : address ∈ V.queries (a, word)) :
address ∈ V.queryTable a

Every address queried on a random word of the right length occurs in the address table.

theorem Cslib.Complexity.PCPVerifier.verdict_answers_queryTable_append {α : Type} {V : PCPVerifier α} (a : α) (proof padding word : List Bool) (hword : word.length = V.coins a) :
V.verdict ((a, word), List.map (fun (address : ℕ) => (answers proof (V.queryTable a) ++ padding).getD (List.idxOf address (V.queryTable a)) false) (V.queries (a, word))) = V.accepts a proof word

On any random word of length V.coins a, first-occurrence lookup in answers proof (V.queryTable a) ++ padding gives the same verdict as V.accepts a proof word.

theorem Cslib.Complexity.PCPVerifier.tableVerifier_complete {α : Type} {V : PCPVerifier α} (a : α) (proof padding : List Bool) (h : ∀ (word : List Bool), word.length = V.coins a → V.accepts a proof word = true) :
V.tableVerifier (a, answers proof (V.queryTable a) ++ padding) = true

A genuine proof supplies a consistent table; trailing padding is never read.

Expand a bit table indexed by V.queryTable a into a full proof string by looking up each address's first occurrence in V.queryTable a.

theorem Cslib.Complexity.PCPVerifier.accepts_proofOfTable {α : Type} {V : PCPVerifier α} (a : α) (table word : List Bool) (hword : word.length = V.coins a) :
V.accepts a (V.proofOfTable a table) word = V.verdict ((a, word), List.map (fun (address : ℕ) => table.getD (List.idxOf address (V.queryTable a)) false) (V.queries (a, word)))

On any random word of length V.coins a, V.proofOfTable a table gives the exact same verdict as first-occurrence lookup in table.

theorem Cslib.Complexity.PCPVerifier.tableVerifier_sound {α : Type} {V : PCPVerifier α} (a : α) (table : List Bool) (h : V.tableVerifier (a, table) = true) :
∃ (proof : List Bool), ∀ (word : List Bool), word.length = V.coins a → V.accepts a proof word = true

Every table, including malformed or short certificates, is the restriction of a finite proof. The expanded proof is only a mathematical witness; its length need not be polynomial.

theorem Cslib.Complexity.PCPVerifier.mem_NP_of_tableCheck {α : Type} {V : PCPVerifier α} {enc : α ↪ List Bool} {c : ℕ} {A : Set α} {check : α × List Bool → Bool} (hV : PolyTime enc V) (hcoins : ∀ (a : α), V.coins a ≤ c * (Nat.log 2 (enc a).length + 1)) (hcheck : Turing.MultiTapeTM.ComputableInPolyTime check (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hcomplete : ∀ a ∈ A, ∃ (proof : List Bool), ∀ (padding : List Bool), check (a, answers proof (V.queryTable a) ++ padding) = true) (hsound : ∀ (a : α) (table : List Bool), check (a, table) = true → a ∈ A) :
A ∈ NP enc

Any polynomial-time table predicate check : α × List Bool → Bool that accepts padded query tables answers proof (V.queryTable a) ++ padding on members of A and rejects all tables on non-members witnesses A ∈ NP enc under a logarithmic coin bound.

theorem Cslib.Complexity.IsPCPVerifier.mem_iff_exists_tableVerifier {α : Type} {enc : α ↪ List Bool} {r q : ℕ → ℕ} {V : PCPVerifier α} {A : Set α} (h : IsPCPVerifier enc r q V A) (a : α) :
a ∈ A ↔ ∃ (table : List Bool), V.tableVerifier (a, table) = true

For a PCP verifier of A, the instances some table makes the exhaustive table check accept are exactly the members of A.

theorem Cslib.Complexity.PCP_log_subset_NP {α : Type} {enc : α ↪ List Bool} (q : ℕ → ℕ) :
PCP (fun (n : ℕ) => Nat.log 2 n + 1) q enc ⊆ NP enc

Logarithmically many random bits can be checked exhaustively in NP, regardless of the query bound. Binary proof addresses are represented by a polynomial-length table of queried bits.