The PCP Theorem
A satisfying assignment is a proof that a formula is satisfiable, and checking it means reading all of it. The PCP theorem says that every NP statement has a proof in a special, robust format that a verifier can check by reading only a constant number of bits, chosen at random, while being fooled with probability at most . It sounds like a statement about proof checking, and it is; but its main consequence for this course is that MAX-3SAT has a constant-factor gap that is NP-hard, which is the starting point of almost every hardness of approximation result. This lesson states the theorem, proves its equivalence with the gap formulation, and explains the intuition behind it. The proof itself is beyond the scope of the course; its ideas are only sketched.
Probabilistically checkable proofs
A verifier for a language is a polynomial-time randomized algorithm that gets an input , a random string of length , and oracle access to a proof string : it can ask for any position of and read that bit. It reads at most positions and accepts or rejects. if some verifier satisfies
- completeness: if , some proof makes accept with probability 1;
- soundness: if , every proof makes accept with probability at most .
Two easy observations frame the theorem. : no randomness, read the whole certificate. And : with random bits there are only polynomially many random strings, so a nondeterministic machine can guess the (relevant part of the) proof and run the verifier on all of them.
PCP Theorem (Arora and Safra, 1998; Arora, Lund, Motwani, Sudan and Szegedy, 1998). .
The proofs, from the early 1990s, combined algebraic error-correcting codes, low-degree testing and proof composition. Dinur (2007) gave a different, combinatorial proof by gap amplification, described below.
The gap formulation
Theorem. The PCP theorem is equivalent to: there is a constant such that is NP-hard. That is, there is a polynomial reduction from any NP language to 3-CNF formulas such that yes-instances become satisfiable formulas, and no-instances become formulas in which every assignment violates at least an fraction of the clauses.
Proof. () Given the reduction, a verifier for computes the formula , picks one clause at random ( random bits), and reads the 3 bits of the proof (an assignment) that it mentions. If , a satisfying assignment always passes. If , every assignment fails a random clause with probability at least ; repeating the test times, a constant, brings the acceptance probability below .
() Let be a verifier using random bits and queries. Treat each proof bit as a Boolean variable. For each random string , the verifier's decision is a function of the bits it reads, which is a CNF of at most clauses of literals (one clause forbidding each rejecting pattern), and with auxiliary variables a 3-CNF of at most clauses. The conjunction over all random strings is a polynomial-size 3-CNF . If , the good proof satisfies every clause. If , for every assignment (proof) at least half of the random strings reject, and each rejecting contributes at least one violated clause among its at most : so at least a fraction of all clauses is violated. Since is constant, so is .
Corollary. For some constant , there is no -approximation for MAX-3SAT unless P = NP. Hence MAX-3SAT has no PTAS, and neither does any problem it reduces to by a gap-preserving reduction.
Why reading a few bits cannot work for ordinary proofs
Without a special format, local checks are hopeless: an unsatisfiable formula can have an assignment that satisfies all clauses but one, and a verifier that reads a constant number of bits rarely looks at that clause. The program checks the most extreme case. All eight 3-clauses on the same three variables form an unsatisfiable formula, yet every assignment satisfies seven of them, so a verifier that checks one random clause accepts the best false "proof" with probability . For a long formula with a single contradiction hidden in it, the acceptance probability is .
from itertools import product
clauses = [[(v, s[i]) for i, v in enumerate((0, 1, 2))] for s in product([True, False], repeat=3)]
best = max(sum(any(a[v] == s for v, s in c) for c in clauses) for a in product([True, False], repeat=3))
print(f"{len(clauses)} clauses, unsatisfiable; best assignment satisfies {best} -> one-clause verifier accepts with {best}/{len(clauses)}")
# a long chain x0 -> x1 -> ... -> x9 with x0 forced true and x9 forced false: unsatisfiable, but only barely
n = 10
chain = [[(0, True)], [(n - 1, False)]] + [[(i, False), (i + 1, True)] for i in range(n - 1)]
best = max(sum(any(a[v] == s for v, s in c) for c in chain) for a in product([True, False], repeat=n))
print(f"chain formula: {len(chain)} clauses, unsatisfiable; best assignment satisfies {best} -> accepts with {best / len(chain):.3f}")8 clauses, unsatisfiable; best assignment satisfies 7 -> one-clause verifier accepts with 7/8
chain formula: 11 clauses, unsatisfiable; best assignment satisfies 10 -> accepts with 0.909
A PCP turns such "barely unsatisfiable" instances into "far from satisfiable" ones. The price is a longer proof that encodes the assignment redundantly, so that any cheating is spread over a constant fraction of all the local checks.
Local tests and error-correcting codes
The basic gadget is a local test for a code: a few random queries reveal whether a string is close to a codeword. The simplest is the linearity test of Blum, Luby and Rubinfeld (1993). Write a function as its truth table, a string of bits. Linear functions form the Hadamard code of . The test picks at random and checks , three queries.
Theorem (Blum, Luby and Rubinfeld, 1993; tight form by Bellare, Coppersmith, Håstad, Kiwi and Sudan, 1996). If disagrees with every linear function on at least a fraction of inputs, the test rejects with probability at least .
Proof sketch. In notation , the acceptance probability is , where are the Fourier coefficients. Since , the sum is at most , so the acceptance probability is at most .
The program computes the exact rejection probability for functions on 4 bits (all pairs) at various distances from linearity.
import random
from itertools import product
n = 4
points = list(product([0, 1], repeat=n))
add = lambda x, y: tuple((a + b) % 2 for a, b in zip(x, y))
linear = lambda a: {x: sum(ai * xi for ai, xi in zip(a, x)) % 2 for x in points}
def distance_to_linear(f):
return min(sum(f[x] != linear(a)[x] for x in points) for a in points) / len(points)
def rejection(f):
return sum(f[x] ^ f[y] != f[add(x, y)] for x in points for y in points) / len(points) ** 2
rng = random.Random(0)
base = linear((1, 0, 1, 1))
print("flipped bits distance rejection probability")
for flips in [0, 1, 2, 3, 5]:
f = dict(base)
for x in rng.sample(points, flips):
f[x] ^= 1
print(f"{flips:12} {distance_to_linear(f):9.4f} {rejection(f):12.4f}")
f = {x: rng.randint(0, 1) for x in points}
print(f"{'random':>12} {distance_to_linear(f):9.4f} {rejection(f):12.4f}")flipped bits distance rejection probability
0 0.0000 0.0000
1 0.0625 0.1641
2 0.1250 0.3438
3 0.1875 0.4453
5 0.1875 0.3516
random 0.3750 0.6250
Every row satisfies rejection distance. (After five flips the function is closer to a different linear function than the one it started from, so its distance is smaller than .) The Hadamard code is exponentially long ( bits to encode ), so it gives only , the "exponential-size PCP" that is the first step of the original proof. The full theorem needs codes of polynomial length with similar local testability (polynomials over finite fields and low-degree tests) and proof composition, which recursively replaces a verifier's queries by smaller PCPs.
Dinur's gap amplification
Dinur's proof works with constraint graphs: variables on vertices over a constant alphabet, a constraint on each edge. Start from an NP-hard instance where unsatisfiable means only that a fraction of constraints must fail. Repeat times:
- Preprocess to a constant-degree expander (the gap shrinks by a constant factor).
- Power: replace each vertex's value by its opinion about its whole neighbourhood up to distance , and each edge by a test on walks of length . The gap grows by a factor about , but the alphabet becomes huge.
- Reduce the alphabet back to a constant with a small PCP (composition), losing a constant factor of the gap.
With a large enough constant, each round at least doubles the gap while the instance grows by a constant factor, so after rounds the gap is a constant and the size is still polynomial.
Test yourself
What does say?
- Every NP problem is in P
- Every NP statement has a proof that a verifier using random bits checks by reading a constant number of its bits, accepting true statements always and false ones with probability at most
- NP proofs have constant length
- Every proof can be checked deterministically in constant time
Why does the PCP theorem imply that MAX-3SAT has no PTAS unless P = NP?
- Because 3SAT is NP-complete
- It is equivalent to the NP-hardness of distinguishing satisfiable 3-CNF formulas from those where every assignment violates an fraction of clauses
- Because MAX-3SAT has an FPTAS
- Because the verifier is randomized
In the proof that a PCP verifier gives a gap 3-CNF, where does the constant come from?
- From the number of variables
- At least half of the random strings reject, and each contributes at least one violated clause among its at most clauses
- From the Chernoff bound
- From the size of the alphabet
What does the Blum-Luby-Rubinfeld test check with three queries?
- That is constant
- That for random ; functions far from linear fail with probability at least their distance
- That is a polynomial of degree 2
- That is balanced