February 26, 2008 * Circuit Value Problem is P-complete * Circuit complexity and time complexity * Circuit-SAT is NP-complete (alternative proof of Cook-Levin) CIRCUIT VALUE IS P-COMPLETE A Boolean circuit consists of a collection of 2-input AND, 2-input OR, 1-input NOT gates, and inputs, connected together by wires in an acyclic manner. A Boolean circuit computes an output value from a setting of inputs. Note that a Boolean circuit can be written out as a SAT formula and vice versa. The Circuit Value Problem (CVP) is to calculate the value of a given Boolean circuit on a given input setting. Theorem: CVP is P-complete. Proof: We first note that CVP is in P. Now, we reduce every language in P to CVP. The proof is similar to Cook-Levin's theorem. Let M be a deterministic Turing machine running in t(n) = O(n^k) time. We construct a tableau that lists the configurations of M on given input, one in each row. The tableau is t(n) x t(n). We assume that M accepts only when its head is on the leftmost cell and the tape is blank. Also, once M halts the remaining configurations are the same. P_{i,j,a} = Symbol occupying tape cell j at time i is a Q_{i,j,q} = The machine is in state q scanning cell j at time t P_{i,j,b} = [OR_{d(p,a) = (q,b,d)} (Q_{i-1,j,p} AND P_{i-1,j,a})] OR [P_{i-1,j,b} AND (AND_{p in Q} NOT(Q_{i-1,j,p}) That is, the symbol occupying tape cell j at time i is a if either the machine is in state p scanning cell j at time t and the machine writes a after appropriate transition or the cell j had at time i-1 and the machine was not scanning the cell j at time t-1. Q_{i,j,q} = [OR_{d(p,a) = (q,b,R)} (Q_{i-1,j-1,p} AND P_{i-1,j-1,a})] OR [OR_{d(p,a) = (q,b,L)} (Q_{i-1,j+1,p} AND P_{i-1,j+1,a})] Special case for j = 0 and j = t(n). All that remains to take care are the input and the output. The input is simply the specification of the start configuration. P_{0,0,#} = 1 P_{0,0,b} = 0 for all b in Gamma P_{0,j,w_j} = 1 P_{0,j,x} = 0 if x not= w_j P_{0,j,u} = 1 for j >= n+1 P_{0,j,x} = 0 if x not= u for j >= n+1 Q_{0,0,q_0} = 1 where q_0 is start state Q_{0,0,q} = 0 where q not= q_0 The output is Q_{t(n),0,q_f} where q_f is accept state of M. Note that each variable is a gate. The total number of variables is O(t(n)^2). End Proof The above theorem can be easily generalized to establishing the following between time complexity and circuit complexity. A language L over {0,1} is said to have circuit complexity C(n) if for every n, there exists a circuit of size C(n) that evaluates to true for precisely the set of n-length strings that are in L. CIRCUIT COMPLEXITY AND TIME COMPLEXITY Theorem: Every language in TIME(t(n)) has a circuit of size O(t(n)^2) if t(n) >= n. Proof: The proof is identical to that of the above theorem except for the fact that we do not specify the inputs. The inputs simply correspond to the string w that is being considered for membership in L. P_{0,0,#} = 1 P_{0,0,b} = 0 for all b in Gamma P_{0,j} = w_j P_{0,j,u} = 1 for j >= n+1 P_{0,j,x} = 0 if x not= u for j >= n+1 Q_{0,0,q_0} = 1 where q_0 is start state Q_{0,0,q} = 0 where q not= q_0 Thus, the only inputs are the P_{0,j}s. End Proof Circuits offer an alternative way of looking at languages. Define Circuit-SAT as follows. Circuit-SAT = { : C is a satisfiable Boolean circuit} ALTERNATIVE PROOF OF COOK-LEVIN THEOREM Theorem: Circuit-SAT is NP complete. Proof: Clearly Circuit-SAT is in NP. For the reduction, given any language L in NP, we need a poly-time computable f such that w is in L iff f(w) is a satisfiable Boolean circuit. L is in NP so for every w, there is a poly-size certificate c and a deterministic TM M (the verifier) that accepts . Use the proof of the theorem connecting circuit complexity and time complexity to construct the circuit. Call this circuit C; we specify the input bits corresponding to w, and c is unspecified. Clearly C is satisfiable iff there is an assignment to c that satisfies C. The size of the circuit is poly in the size of w and c, which is poly in the size of w. End Proof