<<

Computational Complexity Theory, Fall 2010 September 29 Lecture 11: Valiant-Vazirani and Toda’s Theorem

Lecturer: Kristoffer Arnsfelt Hansen Scribe: Andreas Hummelshøj

] P class of functions

Definition 1. P ]P ]P P = class of languages computed in polynomial time with oracle access to ]SAT = {hφ, ki|]SAT (φ) = k}. Clearly being able to count the number of satisfying assignment to a Boolean formula, allows one to decide if such an assignment exists.

Lemma 2. NP ⊆ P ]P , also P ]P ⊆ P SP ACE.

Our goal will be to prove the following theorem, that shows that counting is in fact much more powerful than it immediately seems.

Theorem 3. Toda’s Theorem PH ⊆ P ]P

n Definition 4 (Pair-wise independent hash functions). Let Hn,k be a finite set of functions {0, 1} → k 0 {0, 1} . We say that Hn,k is a family of pair-wise independent hash functions if for x, x ∈ {0, 1}n , x 6= x0 and for y, y0 ∈ {0, 1}k:

1 P h(x) = y ∧ h(x0) = y0 = . 22k

Example

Hn,k: Let A be a k × n matrix over GF(2) (=G[eneral]F[ield] (2)). Let b be a dim-k vector over n k GF(2). Let Hn,k : {0, 1} → {0, 1} be given by:

Hn,k(x) = Ax + b.

Proposition 5. Hn,k above is a pair-wise independent family of hash functions. Proof. Pick x 6= x0, y 6= y0.

P r h(x) = y ∧ h(x0) = y0 =P r Ax + b = y ∧ Ax0 + b = y0  0 0  0 0 =P r Ax + b = y Ax + b = y P r Ax + b = y =2−k · 2−k

1 Lemma 6. (Valiant-Vazirani) Let Hn,k be a pair-wise independent family of hash functions and let S ⊆ {0, 1}n be such that: 2k 2k ≤ |S| ≤ . 4 2  k 1 Pick h ∈ Hn,k uniformly at random. Then P r There is a unique x ∈ S : h(x) = 0 ≥ 8 . Proof. h i P r There is a unique x ∈ S : h(x) = 0k h  i =P r ∃x ∈ S : h(x) = 0k ∧ ∀x0 ∈ S\{x} : h(x0) 6= 0k X h i = P r h(x) = 0k ∧ ∀x0 ∈ S\{x} : h(x0) 6= 0k (= since the events for different x are disjoint) x∈S X  h i h i = P r h(x) = 0k − P r h(x) = 0k ∧ ∃x0 ∈ S\{x} : h(x0) = 0k x∈S   X h ki X h k 0 ki ≥ P r h(x) = 0 − P r h(x) = 0 ∧ h(x ) = 0  (only ≥ since events are not disjoint) x∈S x0∈S\{x}   X −k X −2k = 2 − 2  x∈S x06=x   =|S| 2−k − (|S| − 1) 2−2k |S|  |S| ≥ 1 − 2k 2k 2k/4  2k/2 1 ≥ 1 − = 2k 2k 8

Theorem 7. Valian-Vazirani There is a probabilistic polynomial time algorithm that, given a boolean formula φ produces another boolean formula τ sucht that:

1 If φ ∈ SAT then P r[φ ∧ τ has a unique satisfying assignment] ≥ 8n , If φ 3 SAT then P r[φ ∧ τ ∈ SAT ] = 0.

Proof. We shall use the hash family given in the example above. Let S ⊆ {0, 1}n be the set of assingments satisfying φ. Pick k ∈ {2, 3, . . . , n + 1} uniformly at random. Pick A, b uniformly at random. k Output φ ∧ ”hA,b(x) = 0 ”. 1 k k With probability n , we have 2 /4 ≤ |S| ≤ 2 /2. The result follows from the lemma.

2 k ”hA,b(x) = 0 ” has a polynomial size formula: Ax + b = 0

k  n  ^ X ≡  aijxj + bj = 0 i=1 j=1

k  n  ^ M ≡  aij ∧ xj ⊕ bj = 0 i=1 j=1

L V is done by a binary tree of depth log n, by one of depth log k.(aij ∧ xj ⊕ bj = 0) is a simple formula. Summing , we get a formula of depth O(log n), giving a total size of nO(1), as promised. Definition 8. Notation: For a boolean formula φ, let ]φ denote the number of satisfying assign- ments. L L Definition 9 ( quantifier). Let φ(x) be a boolean formula. We say x∈{0,1}n φ(x) is true if ]φ is odd. Definition 10 (L P ). L P = class of languages L where there is a polynomial p and R ∈ P such that: n o p(|x|) x ∈ L ⇐⇒ y ∈ {0, 1} hx, yi ∈ R is odd. ( )

M M SAT = φ φ ≡ φ(x) and φ is true . x Proposition 11. L SAT is complete for ]P . Proof. Cook’s theorem preserves the number of witnesses, hence also parity. Remark: L P is the least significant bit of a ]P function. Lemma 12. (First part of Toda’s Theorem) For all k, there is a probabilistic algorithm A that, on input hΨ, mi, where ψ is a quantified formula with k blocks of quantifiers, runs in polynomial time and outputs a formula φ = A(ψ, 1m) such that:

h M i −m ψ ∈ ΣkSAT ⇒P r φ ∈ SAT ≥ 1 − 2

h M i −m ψ∈ / ΣkSAT ⇒P r φ ∈ SAT ≤ 2

Lemma 13. There are polynomial time algorithms that, given formulas φ in n variables and ψ in m variables, outputs formulas φ · ψ in m + n variables and φ + ψ in max(m, n) + 1 variables, such that: ](φ · ψ) =(]φ) · (]ψ) ](φ + ψ) =(]φ) + (]ψ)

3 Proof. Define (φ · ψ)(x, y):≡ (φ(x)) ∧ (ψ(y)).

(Assume wlog m ≤ n): (φ + ψ)(x, z):≡ (z ∧ φ(x1, . . . , xn)) ∨ (z ∧ ψ(x1, . . . , xm) ∧ xm+1 ∧ · · · ∧ xn).

Boolean expressions of L-quantified formulas:

" # " # M M M φ(x) ∧ ψ(y) ⇐⇒ (φ · ψ)(x, y) x y x,y " # M M ¬ φ(x) ⇐⇒ (φ + 1)(x, z1) x x " # " # " # " #! M M M M φ(x) ∨ ψ(y) ⇐⇒ ¬ ¬ φ(x) ∧ ¬ ψ(y) x y x y

Note this extends to taking Boolean AND and OR of polynomially many L-quantified formulas (in fact, we can just form a binary tree), and these can be computed efficiently.

Proof of Lemma 12. Proof by induction.

k = 1 ψ ≡ ∃x ∈ {0, 1}nψ0(x). (Remark: one-sided error makes success-amplification very easy.) Run the algorithm from Valian-Vazirani’s Theorem for K trials to get τ1, . . . , τK . Set

K _ M 0 φ := (ψ (x) ∧ τi(x)). i=1 x (Here we can use W by the previous remarks, and get a L-quantified formulas equivalent to φ, which is in fact the formula we output.)

Analysis: Suppose ψ is false. Then P r [φ ∈ L SAT ] = 0. Suppose ψ is true. Then 0 L 1 L 1 K P r [ψ (x) ∧ τi(x) ∈ SAT ] ≥ 8n . Thus P r [φ ∈ SAT ] ≥ 1− 1 − 8n . Pick K = O(n·m) 1 K −m such that (1 − 8n ) ≤ 2 . Observation: The above also works even if ψ has free variables. Suppose we have l free variables y. The above will immediately give that for any choice of y, with probability at least 1 − 2−m we have ψ(y) ∈ SAT ⇔ φ(y) ∈ L SAT . We shall in fact want to have the stronger statement that P r[∀y : ψ(y) ∈ SAT ⇔ φ(y) ∈ L SAT ] > 1 − 2−m. But this statement follows by a union bound over all y from the even stronger statement, ∀y : P r[ψ(y) ∈ SAT ⇔ φ(y) ∈ L SAT ] > 1−2−ml, we can just do as above with K = O(lmn).

n 0 0 k − 1 ⇒ k Let ψ :≡ ∃x1 ∈ {0, 1} ψ (x1), where ψ is a Πk−1SAT formula. By induction hypothesis (note: here we use that L P is closed under complements) there is a probabilistic

4 0 L algorithm that on input ψ (x1) produces a ⊕SAT formula, β(x1) ≡ z ρ(x1, z), with free variables x1, such that

 0  −(m+1) P r ∀x1 : ψ (x1) ∈ Πk−1SAT ⇔ β(x1) ∈ ⊕SAT ≥ 1 − 2

Run again the Valiant-Vazirani algorithm for K independent trials, and define

K _ M φ := (β(x1) ∧ τi(x1)). i=1 x1 K 0 _ M 0  φ := ψ (x1) ∧ τi(x1) . i=1 x1

Here φ is the L SAT formula that we output. We use φ0 for the analysis below. Since φ and φ0 are equivalent with probability at least 1 − 2−(m+1), we can just work with φ0 and then at the end add 2−(m+1) to the error probability. The calculation is now as in the base case. Suppose ψ is false. Then P r []φ0 is odd] = 0. 0 1 Suppose ψ is true. Then P r [](ψ (x1) ∧ τi(x1)) is odd] ≥ 8n . Thus P r []φ is odd] ≥ 1 − 1 K 1 K −(m+1) 1 − 8n . Pick K = O(m · n) such that (1 − 8n ) ≤ 2 . (We don’t use ⊕SAT here, 0 since ψ is a quantified formula. One could of course have defined ⊕Πk−1SAT). Now, the total error is ≤ 2−(m+1) + 2−(m+1) = 2−m.

Again, similarly to the base case, the argument also works if φ has free variables.

5