CSE 200 Computability and Complexity Wednesday, May 1, 2013 Lecture 10: Boolean Circuits (cont.) Instructor: Professor Shachar Lovett Scribe: Dongcai Shen

1 Recap

Definition 1 () A Boolean circuit on n inputs, is a DAG with n source nodes and one target (sink) node, m internal nodes perform simple computation (AND, OR, NOT). 

Definition 2 (P/poly) P/polydef= {languages s.t. ∀n, L ∩ {0, 1}n can be computed by a circuit of size nO(1).}. 

Theorem 3 P ⊆ P/poly. 

2 Turing Machines with

We can give another equivalent definition of P/poly by introducing the TM that takes advice.

advice z}|{ Definition 4 (TIME(T (n))/a(n)) A language L ∈ TIME(T (n))/ a(n) if ∃M ∈ TIME(T (n)) and a sequence a(n) {αn}n∈N with αn ∈ {0, 1} s.t. x ∈ L ⇔ M(x, α|x|) = 1 ∗ for any x ∈ {0, 1} . 

c d Claim 5 P/poly = ∪c,d≥1TIME(n )/(n ).  Proof d (⊆) For any language L ∈ P/poly. ∀n ∈ N, there exists a circuit Cn of size n . We treat Cn as an advice to the corresponding TM M. M evaluates input x on Cn given as an advice (extra input). The advice def def d sequence {αn}n∈N = {Cn}n∈N is bounded by a(n) = n . c d k (⊇) Fix a language L ∈ TIME(n )/(n ). ∀n ∈ N, there exists a circuit Cn of size n for some constant k s.t. x ∈ L ⇔ Cn(x, α|x|) = 1 where |x| = n. The advice αn is hard-wired to the circuit. This is illustrated in Figure 1.

Cn

x α|x|

c d Figure 1: P/poly ⊇ ∪c,d≥1TIME(n )/(n )

10-1 Remark. Claim 5 explains the reason for naming P/poly: “deterministic poly-time taking poly-size advice”. Similarly, we can define P/ log, P/c where c stands for constant-sized advice, etc. A natural question arises:

c Question 6 What can we get from just 1 bit of advice? P/1 = ∪c≥1TIME(n )/1.

Question 7 Is NP ⊆ P/poly?  This is an open question. We believe the answer is no.

3 The Karp-Lipton Theorem

Theorem 8 (Karp-Lipton Theorem [1]) If NP ⊂ P/poly then PH = Σ2. 

Remark. Note that PH collapses to Σ2- instead of NP-complete. The theorem is of the style that “one thing unlikely implies another thing unlikely”. Finally we see that many unlikely things are equivalent. In some sense it’s similar to the NP-complete problems. It has a sister-theorem, the Meyer’s Theorem, also proved in early 1980’s.

Theorem 9 (Meyer’s Theorem [1]) If EXP ⊆ P/poly then EXP = Σ2. 

Proof of Theorem 8: Suppose 3-SAT ∈ P/poly. So ∀n ∈ N, there exists a circuit Cn: ( 1 If φ satisfiable Cn(φ) = 0 Otherwise

where φ is a 3-CNF on n variables. Also, |Cn| = poly(n). : Input 3-CNF φ on n bits, ∃Cn s.t. φ(Cn(φ)) = 1. 1 We want to show Σ2 = PH. It suffices to show Π2 ⊂ Σ2 . Let L be a complete language for Π2. We def choose take L = Π2SAT = {φ is a 3-CNF : ∀y∃zφ(y, z)}. The first step is to transform a circuit which merely checks if a circuit is satisfiable, to a circuit that ”proves” this by supplying a satisfying assignment.

Claim 10 (Self-reducibility) If ∀n ∈ N there exists a circuit Cn s.t. φ ∈ 3-SAT iff Cn(φ) = 1 then there 0 0 0 O(1) exists a circuit Cn s.t. φ ∈ 3-SAT iff φ(Cn(φ)) = 1 and SIZE(Cn) ≤ SIZE(Cn) .  Proof Assume circuit C s.t. C(φ) = 1 iff φ is satisfiable. If φ is satisfiable, discover a satisfying assignment bit-by-bit: ( 0 C(φ(0, x2, ··· , xn)) = 1 a1 = 1 Otherwise ( 0 C(φ(a1, 0, x3, ··· , xn)) = 1 a2 = 1 Otherwise In general, ( 0 C(φ(a1, ··· , ai−1, 0, xi+1, ··· , xn)) = 1 ai = 1 Otherwise

0 At the end, φ(a1, ··· , an) = 1. The construction of the multi-output circuit C from the single-output circuit C is illustrated in Figure 2.

1 Recall that L ∈ Σ2 means x ∈ L ⇔ ∃y∀zM(y, z) = 1 where M ∈ P; L ∈ Π2 means x ∈ L ⇔ ∀y∃zM(y, z) = 1 where M ∈ P. Once we have Π2 ⊂ Σ2, namely ∀∃ · · · = ∃∀ · · · , we can simplify the QBF in the language definition by switching the 0 0 00 0 000 0 0 0000 positions of ∃ and ∀. For example, Π4 3 ∀∃∀∃M(·) = ∃∀∀∃M (·) = ∃∀ ∃M (·) = ∃∃∀ M (·) = ∃ ∀ M (·) ∈ Σ2.

10-2 φ ∈ SAT a1 a2 an

C0

C(φ) C(φ) C(φ) ··· C(φ) a1 a1a2 a1a2 ··· an x1, ··· , xn x2, ··· , xn x3 ··· xn

1 1 1

Figure 2: Self-reducibility: construct C0 using C as a building block

This property is called self-reducibility.

Algorithm: Input 3-CNF φ on n bits, check if ∀y ∃z φ(y, z) = 1. | {z } iff Cn(φ(y, ·)) = 1 ⇐ NP ⊆ P/poly

| 0 {z } iff φ(y, Cn(φ(y, ·))) = 1 Hence, we have 0 0 φ ∈ Π2SAT iff ∃Cn∀yφ(y, Cn(φ(y, ·))) = 1 | {z } in Σ2

Next we prove Theorem 9. The intuitive idea is: “EXP ⊂ P/poly” means any exponential-time computation can be done by a specific poly-size circuit Cn where n is the input size. Then, our goal is to c d prove that this computation also fits in Σ2 = {x : ∃y : |y| ≤ |x| ∀z : |z| ≤ |x| M(x, y, z) = 1} where M ∈ P. Recall Cook-Levin Theorem’s proof. An exponential-size computation is hard to check from the outset. But we can make use of the “for ” quantifier in Σ2. Quantifier ∀ comes in handy to check all local places in the exponential-size computation. Meanwhile, the quantifier ∃ helps us by “guessing” the circuit Cn. Cn is guaranteed to exist when L ∈ EXP ⊂ P/poly.

Proof of Theorem 9: Fix a language L ∈ EXP. We need to show L ∈ Σ2. Suppose L is computable by a c 1-tape TM M ∈ TIME(2n ). W.l.o.g., M’s alphabet Σ = {0, 1}. Let

def LM = {(x, i, j) : running M on input x ∈ L in time step i has a configuration whose j-th bit is 1.}

c c where in the tuple (x, i, j), x ∈ {0, 1}n, i ≤ 2n denotes M’s steps, and j ≤ 2n is the index of M’s i-th configuration. Note that we can describe (x, i, j) using poly(n) bits. Clearly, LM ∈ EXP ⊂ P/poly. So, there is a poly-size circuit C s.t. (x, i, j) ∈ LM iff C(x, i, j) = 1 Lets come back to L. For any x ∈ L, what do we have from M’s computation? We need to show c • M(x) at time N = 2n entered the accepting state. Namely, M(x) = 1. c • x ∈ L iff ∃C s.t. C(x, i, j) = 1 ∀i, j ∈ [2n ]. as shown in Figure 3. Note that x, i, and j can be represented in poly-size. However, how can we ”trust” the circuit C? The answer is that, similar to the Cook-Levin theorem, computation is local and can be verified by a collection of local tests (e.g. a CNF). In our case the CNF size is exponential, however we can specify in a uniform way the various tests. These amount basically to

10-3 2 13 Corollary in on computed functions functions of number the requires Proof 12 Theorem circuit) a of (Size Bounds 11 Definition Lower Circuit 4 way. succinct a in computation the verifying “ is simply computation the of verifier The steps. time two any 2 between of transition correct the verifying Proof VERIFY k · h apLpo hoe’ ro sb usigteasgmn.TeMyrsTermspofi by is proof Theorem’s Meyer’s The assignment. the guessing by is proof Theorem’s Karp-Lipton The ial,w edr “ renders we Finally, n k c . lue fcntn size”. constant of clauses ∈

O c yacutn ruet o aycrut fsize of circuits many How argument. counting a By Let n

( 2 steps P                S VERIFY because n log S otfntoson functions Most isi 2 is bits o #2 Row . . . #2: Row #1: Row SIZE 2 = S is n h aecmue yec ae(hc ae nadditional an takes (which gate each by computed gate the and bits) ) k ( ,      log C n < k S          2 n so oysz.Therefore, poly-size. of is S n x c { C { { Setting . ) : C C C ∈ ( ( otfntoson functions Most . ,i j i, x, ( ( ( L ,i, y, ,i, x, ,i x, SIZE iff − ∀ · ) · M edi location in head : ) tt nstep in state : ) ,j i, x , n Accept ( 1 S S ∈ ( , isrqiesize require bits 1 x . . . x ↓ x · = The · ↓ ∈ tt nstep in state : ) 1 1 0 L SIZE ”where 1” = ) log O iue3 Figure [2 ( n 0 . . . x x S ieo circuit a of size ↓ 2 c iff ( 2 2 n ) n ], S . x ,w e htms ucin eur size require functions most that get we ), sa most at is ) · · · · · · · · · · · · ∃ k C : i ishv size have bits L } M ∀ , 0 . . . x x M 10-4 Ω( ∈ ,j i, n n j scomputation ’s i Σ − ∈ − 2 n ≤ n 2 VERIFY 0 . . . 0 0 EXP 1, 1 hscmltsteproof. the completes This . S ) C 2 } . O n j ( c stenme fegso h circuit the of edges of number the is , S S 0 . . . 0 0 j to el written cells ) nteohrhn,tenme fboolean of number the hand, other the On . hr?w edt specify to need we there? are > otn nlocation in content 1 + ( ,x ,j i, x, C, 2 · · · · · · · · · · · · k k l ucin on functions All . 0 . . . 0 0 ) 0 . . . 0 0 0 . . . 0 0 S > k · · · · · · · · · · · · j } ishv N size CNF have bits O , . ( 0 . . . 0 0 S      S is.Hence bits). ) ie (which wires C . AND    References

[1] Richard M. Karp and Richard J. Lipton. Some connections between nonuniform and uniform complexity classes. In Proceedings of the twelfth annual ACM symposium on Theory of computing, STOC ’80, pages 302–309, New York, NY, USA, 1980. ACM.

10-5