comput. complex. 16 (2007), 211–244 1016-3328/07/030211-34 DOI 10.1007/s00037-007-0229-6 c Birkhäuser Verlag, Basel 2007 computational complexity THE COMPLEXITY OF MEMBERSHIP PROBLEMS FOR CIRCUITS OVER SETS OF NATURAL NUMBERS Pierre McKenzie and Klaus W. Wagner Abstract. The problem of testing membership in the subset of the natural numbers produced at the output gate of a {∪, ∩,− , +, ×} combinational circuit is shown to capture a wide range of complexity classes. Although the general problem remains open, the case {∪, ∩, +, ×} is shown NEXPTIME-complete, the cases {∪, ∩,− , ×}, {∪, ∩, ×}, {∪, ∩, +} are shown PSPACE-complete, the case {∪, +} is shown NP-complete, the case {∩, +} is shown C= L-complete, and several other cases are resolved. Interesting auxiliary problems are used, such as testing nonemptyness for union-intersection-concatenation circuits, and expressing each integer, drawn from a set given as input, as powers of relatively prime integers of one’s choosing. Our results extend in nontrivial ways past work by Stockmeyer and Meyer (1973), Wagner (1984) and Yang (2000). Keywords. Computational complexity, circuit problems. Subject classification. 68Q25, 68Q15, 03D15. 1. Introduction Combinational circuits permeate complexity theory. Countless lower bounds, complexity class characterizations, and completeness results involve circuits over the Boolean semiring (see (29) among many others). Circuits and formulas over more general structures have been studied as well (see for a few examples (1; 4; 8; 9; 11; 13)). In this paper, we study circuits operating on sets of natural numbers. Our universe of natural numbers includes 0 and is simply called the set N of numbers from now on. Next to the Boolean semiring, the semiring of numbers is certainly the most fundamental, and two results involving number arithmetic have appeared recently: integer division and iterated number multiplication Research supported by the NSERC of Canada and the (Québec) FQRNT. 212 McKenzie & Wagner cc 16 (2007) were finally shown to belong to uniform TC0 (3; 15; 19) and (∪, +, ×)-circuit evaluation was shown PSPACE-hard (31). In the Boolean setting, the AND and the OR operations combine to capture alternation (in, say, simulations of alternating Turing machines by circuits). In the setting of numbers, perhaps the closest analogs to the AND and the OR become the ∩ and the ∪ operations. To make sense, this requires an adjustment: since gates will now compute sets of numbers, a +-gate and a ×-gate having input gates computing S1 ⊆ N and S2 ⊆ N then compute {a+b : a ∈ S1 , b ∈ S2 } and {a × b : a ∈ S1 , b ∈ S2 } respectively. Another reason to study {∪, ∩, +, ×}-circuits over N is that they obey some form of monotonicity condition: if the set S ⊂ N carried by an input gate is replaced by a larger set S ⊃ S, then the set computed at the output gate of the circuit can only become larger (never smaller). This is reminescent of monotone Boolean functions (a Boolean function is monotone if flipping an input from 0 to 1 can never change the output from 1 to 0), for which significant complexity bounds are known (such as (25)). Are the circuit and formula evaluation problems over subsets of {∪, ∩, +, ×} related to monotone Boolean function complexity? The problem studied in this paper is the following, which we think of as combining number arithmetic with some form of alternation: given a number b and a {∪, ∩,− , +, ×}-circuit C with number inputs, where “ − ” denotes complementation, does b belong to the set computed by the output gate of C? We call this problem MC(∪, ∩,− , +, ×), and we call MF(∪, ∩,− , +, ×) the same problem restricted to formulas. Note that a complement gate − applied to a finite set S ⊂ N computes the infinite set N \ S. Hence, in the presence of complement gates, the brute force strategy which would exhaustively compute all the sets encountered in the circuit fails. The notation for restricted versions of these problems, for instance MC(∪, +), is self-explanatory (see Section 2). Beyond the results mentioned above, it was known prior to this work that the problem MF(∪, +) is NP-complete (26), that MF(∪, ∩,− , +) and MF(∪,− , +) are PSPACE-complete (26), and that MC(∪, +) is in PSPACE (30). Adding results from the present paper, we obtain Table 10.1. We highlight here some of the interesting results or techniques: ◦ The problem MC(∪, ∩, +, ×) is NEXPTIME-complete. As an intermediate step, we prove that determining whether a union-intersection-concatenation circuit over a finite alphabet produces a nonempty set is also NEXPTIME-complete. cc 16 (2007) Circuits over sets of natural numbers 213 ◦ The problem MC(∪, ∩, ×) is PSPACE-complete. ◦ The problem MC(∪, ∩, ×) reduces in polynomial time to MC(∪, ∩, +), which is thus also PSPACE-complete. This reduction is possible because the following problem is solvable in polynomial time (6): given as input a set S of numbers excluding 0, compute a set T of pairwise relatively prime numbers and express each m ∈ S as a product of powers of the numbers in T . ◦ The problem MC(∪, +) is NP-complete. This is a nontrivial improvement over the former PSPACE upper bound. ◦ The problem MC(∩, +) is C= L-complete, and so is the problem of testing whether two MC(+)-circuits are equivalent. The hardest problem we consider is MC(∪, ∩,− , +, ×). As will be seen, we do not have an upper bound for this problem and it may well be undecidable. In fact, we will see that Goldbach’s conjecture is easily expressible as an instance of MC(∪, ∩,− , +, ×). On the other hand, Table 10.1 shows that its various restrictions hit upon a wealth of complexity classes. 2. Definitions and known results We assume familiarity with basic complexity theory, such as can be found in Papadimitriou’s book on the subject (24). We will encounter the complexity classes NEXPTIME, PSPACE, NP, R, P, C= L, NL, L, NC1 , TC0 , AC0 and #L. Here L and NL stand for deterministic and nondeterministic logarithmic space respectively. The class #L is the class of functions f : Σ∗ → N such that there is an NL machine whose number of accepting paths on any input w is f (w). The class C= L is the set of languages A for which there exist functions f1 , f2 ∈ #L such that for all x, x ∈ A ⇔ f1 (x) = f2 (x); for a survey on these and other counting classes see (2). The circuit classes NC1 , TC0 and AC0 play an incidental role in this paper: these classes correspond, respectively, to the sets of langages accepted by DLOGTIME-uniform logarithmicdepth bounded-fan-in {∧, ∨, ¬}-circuits, DLOGTIME-uniform unbounded-fanin constant-depth polynomial-size {MAJORITY}-circuits, and DLOGTIMEuniform unbounded-fan-in constant-depth polynomial-size {∧, ∨, ¬}-circuits. We adopt the definitions of (11) for constant-depth circuit uniformity (see also (7)). Finally, we will make use of polynomial-space many-one reducibility, of polynomial-time many-one reducibility, of logarithmic-space many-one reducibility and of AC0 -reducibility. 214 McKenzie & Wagner cc 16 (2007) If not otherwise stated, the hardness results in this paper are in terms of many-one logspace reducibility. Indeed, although several of our reductions could be refined into AC0 -reductions, for complexity classes C1 ⊆ C2 where C2 is believed to be strictly larger than L, we feel that the emphasis of our C2 completeness results is in delineating the frontier between C1 and C2 rather than in refining the reductions used. We assume any circuit and formula encoding in which the description of a gate and its immediate predecessors, if any, are readily available (say in AC0 ). Viewed as graphs, circuits and formulas are not necessarily connected; our choice of encoding is motivated by our wish to preserve L-hardness of all our problems (see the remark at the end of Section 9). Numbers are encoded in binary notation. A circuit C = (G, E, gC ) is a finite directed acyclic graph (G, E) with a specified node gC , the output gate. The gates with indegree 0 are called the input gates. We consider different types of arithmetic circuits. Let O ⊆ {∪, ∩,− , +, ×}. An O-circuit C = (G, E, gC , α) is a circuit (G, E, gC ) whose gates have indegree 0, 1, or 2 and are labelled by the function α : G → O ∪ N in the following way: Every input gate g has a label α(g) ∈ N, every gate g with indegree 1 has the label α(g) = − , and every gate g with indegree 2 has a label α(g) ∈ {∪, ∩, +, ×}. For each of its gates g the arithmetic circuit C computes a set I(g) ⊆ N inductively defined as follows: ◦ If g is an input gate with label a, then I(g) =def {a}. ◦ If g is +-gate with predecessors g1 , g2 , then I(g) =def k+m : k ∈ I(g1 ) ∧ m ∈ I(g2 ) . ◦ If g is ×-gate with predecessors g1 , g2 , then I(g) =def k·m : k ∈ I(g1 ) ∧ m ∈ I(g2 ) . ◦ If g is a ∪-gate with predecessors g1 , g2 , then I(g) =def I(g1 ) ∪ I(g2 ). ◦ If g is a ∩-gate with predecessors g1 , g2 , then I(g) =def I(g1 ) ∩ I(g2 ). ◦ If g is a − -gate with predecessor g1 , then I(g) =def N \ I(g1 ). The set computed by C is I(C) =def I(gC ). If I(g) = {a} then we also write I(g) = a. An O-formula is an O-circuit with maximal outdegree 1. For cc 16 (2007) Circuits over sets of natural numbers 215 O ⊆ {∪, ∩,− , +, ×} the membership problems for O-circuits and O-formulae are MC(O) =def (C, b) : C is an O-circuit and b ∈ N such that b ∈ I(C) and MF(O) =def (F, b) : F is an O-formula and b ∈ N such that b ∈ I(F ) . For simplicity we write MC(o1 , . . . or ) instead of MC({o1 , . . . or }), and we write MF(o1 , . . . or ) instead of MF({o1 , . . . or }). Example 2.1 (Prime numbers). A circuit PRIMES such that I(PRIMES) is the set of prime numbers is obtained by defining the subcircuit GE2 as 0 ∪ 1 and defining PRIMES as GE2 ∩ (GE2 × GE2). Hence the problem of primality testing easily reduces to MF(∪, ∩,− , ×). ♦ Example 2.2 (Goldbach’s conjecture). Consider the circuit GOLDBACH defined as (GE2 × 2) ∩ (PRIMES + PRIMES). Then I(GOLDBACH) is empty iff every even number greater than 2 is expressible as a sum of two primes. Hence Goldbach’s conjecture holds iff “0 ∈ 0 × GOLDBACH” is a positive instance of MC(∪, ∩,− , +, ×). ♦ The following results are known from the literature: Theorem 2.3. (i) (26) The problem MF(∪, +) is NP-complete. (ii) (26) The problems MF(∪, ∩,− , +) and MF(∪,− , +) are PSPACE-complete. (iii) (30) The problem MC(∪, +) is in PSPACE. (iv) (31) The problem MC(∪, +, ×) is PSPACE-complete. In (30) it is shown that the problem MC(∪, +) restricted to (∪, +)-circuits for which every +-gate has at least one input gate as predecessor is NPcomplete. By De Morgan’s laws we have 216 McKenzie & Wagner cc 16 (2007) Proposition 2.4. For every O ⊆ {+, ×}, − log − (i) MC({∪, ∩,− } ∪ O) ≡log m MC({∪, } ∪ O) ≡m MC({∩, } ∪ O). − log − (ii) MF({∪, ∩,− } ∪ O) ≡log m MF({∪, } ∪ O) ≡m MF({∩, } ∪ O). Hence we can omit MC({∪,− } ∪ O), MC({∩,− } ∪ O), MF({∪,− } ∪ O), and MF({∩,− } ∪ O) from our exhaustive study. 3. Multiplication versus addition In this section we will establish a relationship between the complexity of the membership problems for (O ∪ {×})-circuits and (O ∪ {+})-circuits, for O ⊆ {∪, ∩,− }. To this end we need the following problem. Let gcd(a, b) be the greatest common divisor of the numbers a, b ≥ 1. Gcd-Free Basis (GFB) Given: Numbers a1 , a2 , . . . , an ≥ 1. Compute: Numbers m ≥ 1, q1 , . . . , qm ≥ 2, and e11 ,eij. . . , enm ≥ 0 such that gcd(qi , qj ) = 1 for i = j and ai = m j=1 qj for i = 1, . . . , n. Despite the fact that factoring may not be possible in polynomial time, the following is known (see (6)): Proposition 3.1. Gcd-Free Basis can be computed in polynomial time. As an auxiliary tool we need the generalized membership problems MC∗ (O) and MF∗ (O) for arithmetic circuit and formulae, resp., with addition. These problems deal with elements of Nm ∪ {∞}, for an m ≥ 1 given as part of the input, where the addition on m-tuples is defined componentwise and a + ∞ = ∞ + a = ∞ + ∞ = ∞ for every a ∈ Nm . Note that polynomial-space many-one reducibility is understood to be performed by polynomial space computable polynomially bounded functions, where the bounds are in terms of the length of the input. Lemma 3.2. (i) For O ⊆ {∪, ∩}, the problem MC(O ∪ {×}) is polynomial time many-one reducible to the problem MC∗ (O ∪ {+}). (ii) For O ⊆ {∪, ∩}, the problem MF(O ∪ {×}) is polynomial time many-one reducible to the problem MF∗ (O ∪ {+}). cc 16 (2007) Circuits over sets of natural numbers 217 (iii) For O ⊆ {∪, ∩,− }, the problem MC(O ∪ {×}) is polynomial space manyone reducible to the problem MC∗ (O ∪ {+}). (iv) For O ⊆ {∪, ∩,− }, the problem MF(O ∪ {×}) is polynomial space manyone reducible to the problem MF∗ (O ∪ {+}). In each of the 4 cases above, if we make the added hypotheses that the prime number decompositions of the inputs and of the “target number” b are known, then the complexity of the reduction drops down to logspace many-one. Proof. 1. Let O ⊆ {∪, ∩}, let C be a (O ∪ {×})-circuit with the input gates u1 , . . . , us , and let b ∈ N. Observe that the absence of + in C entails that any number in I(C) is expressible as a monomial in the inputs. Compute in polynomial time (Proposition 3.1) numbers q1 , . . . , qm ≥ 2 and eij e11 , . . . , esm , e1 , . . . , em ≥ 1 such that gcd(qi , qj ) = 1 for i = j, α(ui ) = m j=1 qj m ej for any i = 1, . . . , s with α(ui) > 0 and b = j=1 qj if b > 0. Let M =def dj m { m j=1 qj : d1 , . . . , dm ≥ 0 } ⊆ N and let σ : M ∪ {0} → N ∪ {∞} be defined m dj by σ( j=1 qj ) =def (d1 , . . . , dm ) and σ(0) = ∞. Obviously, σ is a monoid isomorphism between (M ∪ {0}, ×) and (Nm ∪ {∞}, +). Because M ∪ {0} is closed under ×, the set of numbers computed by any gate in C is included in M ∪ {0}. Furthermore, the following holds for any S1 , S2 ⊆ M ∪ {0}: σ(S1 × S2 ) = σ(S1 ) + σ(S2 ) , σ(S1 ∪ S2 ) = σ(S1 ) ∪ σ(S2 ) , σ(S1 ∩ S2 ) = σ(S1 ) ∩ σ(S2 ) . The reduction therefore consists of converting C into a (O ∪ {+})-circuit C which has the same structure as C where a ×-gate in C becomes a +-gate in C and an input gate ui gets label σ(α(ui)). An induction using the three identities above shows that for all a ∈ M ∪ {0} the following holds: a ∈ I(v) in C ⇔ σ(a) ∈ I(v) in C . This concludes the proof because b ∈ M ∪ {0}. 2. Same as above because the construction preserves the circuit structure. 3. and 4. If we have complementation then it is no longer true that every number computed within C has a decomposition into q1 , . . . , qm . In order to nonetheless make use of the above construction, the isomorphism σ must therefore be extended to convey information about N \ M. A slick way to do this is to begin from the full prime decomposition of the numbers u1 , . . . , us , b and to trade the former isomorphism for a homomorphism. Indeed let q1 , . . . , qm , qm+1 , qm+2 , . . . be the sequence of all primes in natural order, and let q1 , . . . , qm exhaust at least all the distinct prime divisors of 218 McKenzie & Wagner cc 16 (2007) dj α(u1 ), . . . , α(us ), b. For every number ∞ j=1 qj ∈ N \ {0} define ∞ d σ qj j =def d1 , . . . , dm , dj , j=1 j>m and define σ(0) =def ∞. Let M =def m d qj j : d1 , . . . , dm ≥ 0 ⊆N j=1 d and Ki =def { j>m qj j : j>m dj = i} for i ≥ 0. Because the full prime decomposition was used, σ is a well-defined monoid homomorphism from (N, ×) onto (Nm+1 ∪ {∞}, +), where σ(0) = ∞ and σ(M × Ki ) = (Nm ⊗{i}) for i ≥ 0 (⊗ denotes direct product). Notice that M = M × K0 and that σ is one-one on this part, so that the following holds for any S1 , S2 ⊆ M: σ(S1 × S2 ) = σ(S1 ) + σ(S2 ) , σ(S1 ∪ S2 ) = σ(S1 ) ∪ σ(S2 ) , σ(M \ S1 ) = σ(M) \ σ(S1 ) . The reduction then again consists of converting C into a (O ∪ {+})-circuit C having the same structure as C where a ×-gate in C becomes a +-gate in C and an input gate ui gets label σ(α(ui)). Let ei =def (0, . . . , 0, i) ∈ Nm+1 for i ≥ 0. Claim. For every 0 , S1 , S2 , · · · ⊆ M such gate v in C there exist T ⊆ {0} and S that I(v) = T ∪ i≥0 (Si × Ki ) in C and I(v) = σ(T ) ∪ i≥0 (σ(Si ) + ei ) in C . Proof of the claim. The proof is by induction on the structure of C. Without loss of generality assume that C has no ∩-gates. Let v be an input gate. If α(v) = 0 then I(v) = {0} ∪ i≥0 (∅ × Ki ) in C and I(v) = {∞} = σ({0}) ∪ i≥0 (σ(∅) + ei ) in C . For a ×-gate or a ∪-gate v let v1 and v2 be the predecessor gates, and for a − -gate v let v1 be the predecessor gate. By the induction hypothesis thereare T1 , T2 ⊆ {0} and S01 , S11 , S21 , . . . S02 , S12 , S22 , · · · ⊆ M such that I(vr ) = r Tr ∪ i≥0 (Si × Ki ) in C and I(vr ) = σ(Tr ) ∪ i≥0 (σ(Sir ) + ei) in C for r = 1, 2. For a ∪-gate v we obtain in C: I(v) = I(v1 ) ∪ I(v2 ) = T1 ∪ (Si1 × Ki ) ∪ T2 ∪ (Si2 × Ki ) = (T1 ∪ T2 ) ∪ i≥0 i≥0 (Si1 ∪ Si2 ) × Ki i≥0 cc 16 (2007) Circuits over sets of natural numbers and in C : I(v) = I(v1 ) ∪ I(v2 ) σ(Si1 ) + ei σ(Si2 ) + ei = σ(T1 ) ∪ ∪ σ(T2 ) ∪ i≥0 = σ(T1 ∪ T2 ) ∪ σ(Si1 ∪ Si2 ) i≥0 + ei . i≥0 For a − -gate v we obtain in C: I(v) = I(v1 ) = T1 ∪ (M \ Si1 ) × Ki (Si1 × Ki ) = {0} \ T1 ∪ i≥0 i≥0 and in C : I(v) = I(v1 ) = σ(T1 ) ∪ σ(Si1 ) + ei i≥0 m N ⊗ {i} \ σ(Si1 ) + ei = {∞} \ σ(T1 ) ∪ i≥0 m N ⊗ {0} \ σ(Si1 ) + ei = σ {0} \ T1 ∪ i≥0 σ(M \ Si1 ) + ei . = σ {0} \ T1 ∪ i≥0 For a ×-gate v we obtain in C: I(v) = I(v1 ) × I(v2 ) = =T∪ i≥0 where and in C : (Si1 i≥0 i (Sj1 j=0 T = T1 ∪ × (T1 × T2 ) ∪ T1 × (Si2 i≥0 × T2 ∪ 2 Si−j ) × Ki ) (Si2 i≥0 × Ki ) × Ki × Ki ) ∪ T2 × (Si1 i≥0 × Ki ) , 219 220 McKenzie & Wagner cc 16 (2007) I(v) = I(v1 ) + I(v2 ) σ(Si1 ) + ei σ(Si2 ) + ei = σ(T1 ) ∪ + σ(T2 ) ∪ = i≥0 σ(T1 ) + σ(T2 ) ∪ i≥0 σ(T1 ) + σ(Si2 ) i≥0 ∪ σ(Si1 ) + ei σ(T2 ) + ∪ i≥0 = σ(T ) ∪ i = σ(T ) ∪ i≥0 = σ(T ) ∪ 2 σ(Sj1 × Si−j ) + ei i × 2 Si−j ) i≥0 i × 2 Si−j ) σ(Sj1 ) + 2 σ(Si−j ) + ei j=0 + ei (Sj1 j=0 i σ(Sj1 j=0 σ i≥0 i≥0 j=0 + ei + ei . This completes the proof of the claim. Now we prove that a ∈ I(v) in C ⇔ σ(a) ∈ I(v) in C for every gate v and every a ∈ N. Byour claim there exist T ⊆ {0} and S0, S1 , S2 , · · · ⊆ M such that I(v) = T ∪ i≥0 (Si × Ki ) in C and I(v) = σ(T ) ∪ i≥0 (σ(Si ) + ei ) in C . We consider two cases. In the case a = 0 we obtain: 0 ∈ I(v) in C ⇔ T = {0} ⇔ σ(T ) = {∞} ⇔ ∞ ∈ I(v) in C ⇔ σ(0) ∈ I(v) in C . d In the case a = j≥1 qj j we obtain (define d =def j>m dj ): d qj j ∈ I(v) in C j≥1 ⇔ d qj j ∈ j≥1 ⇔ m i≥0 d qj j m j=1 ∈ Sd ⇔ σ j=1 ⇔ σ (Si × Ki ) ⇔ d qj j d qj j ∈ Sd × Kd j≥1 m d qj j ∈ σ(Sd ) j=1 + ed ∈ σ(Sd ) + ed ⇔ σ j≥1 d qj j ∈ σ(Sd ) + ed cc 16 (2007) Circuits over sets of natural numbers ⇔ σ j≥1 d qj j 221 d j σ(Si ) + ei ⇔ σ qj ∈ ∈ I(v) in C . i≥0 j≥1 Applying the equivalence a ∈ I(v) in C ⇔ σ(a) ∈ I(v) in C to the output gate yields the desired reduction. Polynomial space is needed to perform the prime decomposition (a possibly weaker reducibility, like a many-one polynomial time reduction with an NP oracle, would suffice). In some cases the generalized membership problems used above are logspace many-one equivalent to their standard versions: Lemma 3.3. Let {∪} ⊆ O ⊆ {∪, ∩}. (i) MC∗ (O ∪ {+}) ≡log m MC(O ∪ {+}). (ii) MF∗ (O ∪ {+}) ≡log m MF(O ∪ {+}). Proof. 1. Let C be a (O ∪ {+})-circuit processing m-tuples of natural numbers. For every gate v of C and every (a1 , . . . , am ) ∈ I(v) we have N =def 2|C| > ai for i = 1, . . . , m. Here |C| is the length of a simple description of the circuit C where the input numbers are written in binary. We consider an (O ∪ {+})-circuit C which has the as C but an input with same structure i−1 a · N in C , and an input u with label (a1 , . . . , am ) in C gets label m i=1 i label ∞ is fed with an (O ∪ {+})-formula F (C) such that I(u) = {N m , N m + 1, N m + 2, . . . , N m + N m+1 } in C . (For example, define G(0) =def (0 ∪ 1), G(n + 1) =def (0 ∪ 2n ) + G(n), and F (C) =def (N m + G((m + 1) · |C|)).) Now we obtain for every gate v: (a1 , . . . , am ) ∈ I(v) in C ⇔ m ai ·N i−1 ∈ I(v) in C , i=1 m where (a1 , . . . , am ) ∈ I(v) in C implies i=1 ai ·N i−1 < N m . Moreover, if v is a level-i-gate in C (input gates being level-0-gates) then (by induction on i): ∞ ∈ I(v) in C ⇔ 2i · N m , N m +N m+1 ⊆ I(v) in C . Hence, we have for every gate v: ∞ ∈ I(v) in C ⇔ N m +N m+1 ∈ I(v) in C . This yields one of the desired reductions. The other is obvious. 2. Here we can proceed in the same way. 222 McKenzie & Wagner cc 16 (2007) 4. NP-complete membership problems Lemma 4.1. The problem MF(∪, ∩, +, ×) is in NP. Proof. Let F = (G, E, gF , α) be a {∪, ∩, +, ×}-formula, and let b ∈ N. Observe that M =def v input gate of F (α(v) + 1) is an upper bound on every number in g gate of F I(g). The NP-algorithm just works as follows: Guess nondeterministically a number ≤ M to every gate of F . Then check whether these numbers really prove that b is in I(gF ). The following is a nontrivial improvement over the PSPACE upper bound for MC(∪, +) in (30): Lemma 4.2. The problems MC(∪, +) and MC(∪, ×) are in NP. Proof. Let C = (G, E, gC , α) be a {∪, +}-circuit such that gC is the only gate of C with outdegree 0, and let TC be the result of unfolding C into a tree. By analogy with Venkateswaran’s proof trees (28), a subtree T of TC is called computation tree of C iff ◦ the output gate of TC is in T , ◦ both predecessors of a +-gate of T are in T , and ◦ exactly one predecessor of a ∪-gate of T is in T . Hence T describes one of the many ways to compute a number from I(C). A gate g in C corresponds to several copies of it in TC (and hence also in a computation tree T of C). Let βC,T (g) be the number of copies of g in T . In the same way, an edge in C corresponds to several copies of it in TC (and hence also in a computation tree T of C). Let βC,T (e) be the number of copies of the edge e in T . Defining s(C, T ) =def α(g)·βC,T (g) , input gate g of C we obtain immediately I(C) = {s(C, T ) : T is a computation tree of C}. A function β : G ∪E → N is a valuation function of C if the following holds: ◦ β(gC ) = 1, ◦ if g is a +-gate with the incoming edges e1 and e2 then β(g) = β(e1 ) = β(e2 ), cc 16 (2007) Circuits over sets of natural numbers 223 ◦ if g is a ∪-gate with the incoming edges e1 and e2 then β(g) = β(e1 )+β(e2 ), ◦ if g is a gate with the outgoing edges e1 , . . . ek then β(g) = β(e1 )+· · ·+ β(ek ). α(g)·β(g). For a valuation function β of C define s(C, β) =def input gate g of C Claim 1. If T is a computation tree of C then there exists a valuation function β of C such that s(C, β) = s(C, T ). Proof. This is easy because βC,T has the desired properties. Claim 2. If β is a valuation function of C then there exists a computation tree T of C such that s(C, T ) = s(C, β). Proof. For a valuation function β of C there can be many computation trees T of C such that βC,T = β and hence s(C, T ) = s(C, β). We construct one of them by applying the following replacement rules to the gates v of C (starting with the predecessors of the output gate and going upward). The labels at the gates and edges represent the β-values. If v is a +-gate then apply: u1 u1 u2 u2 r r ... v r r copies of v ... ... r r If v is a ∪-gate then apply: u1 u2 u1 u2 ... ... ... ... r s s r v r+s ... r+s If v is an input gate then apply: r+s copies of v 224 McKenzie & Wagner cc 16 (2007) ... v r ... ... r r copies of v r After the application of a rule to a gate v the following holds: ◦ the definition of a computation tree applies to the copies of v, ◦ the number of copies of v is β(v), and ◦ for every incoming edge e to v, the number of copies of e is β(e). In such a way we obtain βC,T = β and hence s(C, T ) = s(C, β). This completes the proof of Claim 2. Now we obtain I(C) = {s(C, β) : β is a valuation function of C}, and hence a ∈ I(C) ⇔ ∃β(β is a valuation function of C and s(C, β) = a). However, the latter property is in NP. This completes the proof of MC(∪, +) ∈ NP. From this, Lemma 3.2, and Lemma 3.3 we obtain MC(∪, ×) ∈ NP. Lemma 4.3. MF(∪, ×) is NP-hard. log Proof. We prove the NP-hardness n of MF(∪, ×) by showing 3-SAT ≤m MF(∪, ×). Let H(x1 , . . . , xm ) = j=1 Hj where every Hj is a clause with three literals. Further, for j ≥ 1, let pj be the j-th prime. For i = 1, . . . , m define ai =def xi in Hj pj and bi =def xi in Hj pj . Obviously, H ∈ 3-SAT ⇔ m n n 3 2 j=1 pj ∈ I( i=1 (ai ∪ bi )· j=1 (1 ∪ pj ∪ pj )). As an immediate consequence of the preceding lemmas and Theorem 2.3.1 we obtain: Theorem 4.4. The problems MF(∪, ∩, +, ×), MF(∪, ∩, +), MF(∪, ∩, ×), MF(∪, +, ×), MF(∪, ×), MC(∪, +), and MC(∪, ×) are NP-complete. cc 16 (2007) Circuits over sets of natural numbers 225 5. PSPACE-complete membership problems Lemma 5.1. The problems MF(∪, ∩,− , ×), MC(∪, ∩, ×), and MC(∪, ∩, +) are PSPACE-hard. Proof. We present a logspace many-one reduction from the PSPACEcomplete quantified Boolean 3-CNF formula problem to MF(∪, ∩,− , ×) and MC(∪, ∩, ×). Since in these constructions we use only numbers whose prime number decompositions are known, the latter reduction can be converted by Lemma 3.2 and Lemma 3.3 into a logspace many-one reduction to MC(∪, ∩, +). Let Q1 x1 . . .Qm xm H(x1 , . . . , xm ) be a quantified Boolean 3-CNF formula such that H = nj=1 Hj , the formulae H1 , . . . Hn are clauses with three literals each, and Q1 . . . Qm ∈ {∃, ∀}. For k = m, m − 1, . . . 1, 0 we construct a (∪, ∩, ×)-circuit (a (∪, ∩,− , ×)formula, resp.) Ck such that for all α1 , . . . , αk ∈ {0, 1} the following holds: Qk+1 xk+1 . . . Qm xm H(α1 , . . . , αk , xk+1 , . . . , xm ) (5.2) n k m i p3j · pαn+i · pn+i ∈ I(Ck ) ⇔ j=1 i=1 i=k+1 where pi is the i-th prime. Then, for k = 0, we obtain Q1 x1 . . . Qm xm H(x1 , . . . , xm ) ⇔ n j=1 p3j · m pn+i ∈ I(C0 ) , i=1 the desired reduction. For k = m we define ai =def pn+i · xi in Hj pj and bi =def xi in Hj pj m n 2 for i = 1, . . . , m, and Cm =def i=1 (ai ∪ bi ) · j=1(1 ∪ pj ∪ pj ). It is easy to see αi that H(α1 , . . . , αm ) ⇔ nj=1 p3j · m i=1 pn+i ∈ I(Cm ). Now, for the step from k to k−1, assume (5.2). In the case Qk = ∃ we have: ∃xk Qk+1 xk+1 . . . Qm xm H(α1 , . . . , αk−1 , xk , xk+1 , . . . , xm ) ⇔ Qk+1 xk+1 . . . Qm xm H(α1 , . . . , αk−1 , 0, xk+1, . . . , xm ) ∨ Qk+1 xk+1 . . . Qm xm H(α1 , . . . , αk−1 , 1, xk+1, . . . , xm ) ⇔ n p3j · k−1 j=1 ∨ n j=1 i=1 p3j · m i pαn+i · k−1 i=1 pn+i ∈ I(Ck ) i=k+1 i pαn+i · m i=k pn+i ∈ I(Ck ) 226 McKenzie & Wagner ⇔ n p3j · j=1 k−1 cc 16 (2007) i pαn+i · m i=1 pn+i ∈ I (Ck × pn+k ) ∪ Ck = I(Ck−1 ) i=k where Ck−1 =def Ck × (pn+k ∪ 1). Since Ck appears only once in the definition of Ck−1 , this works for the circuit case as well as for the formula case. In the case Qk = ∀ the reasoning becomes: ∀xk Qk+1 xk+1 . . . Qm xm H(α1 , . . . , αk−1 , xk , xk+1 , . . . , xm ) ⇔ Qk+1 xk+1 . . . Qm xm H(α1 , . . . , αk−1 , 0, xk+1, . . . , xm ) ∧ Qk+1 xk+1 . . . Qm xm H(α1 , . . . , αk−1 , 1, xk+1, . . . , xm ) ⇔ n p3j · j=1 ∧ k−1 n p3j · n k−1 k−1 pn+i ∈ I(Ck ) i=k+1 i pαn+i · i=1 p3j · j=1 m · i=1 j=1 ⇔ i pαn+i m pn+i ∈ I(Ck ) i=k i pαn+i · m i=1 pn+i ∈ I (Ck × pn+k ) ∩ Ck = I(Ck−1 ) i=k where Ck−1 =def (Ck × pn+k ) ∩ Ck . Since Ck appears twice in the definition of Ck−1 this works only for the circuit case. For the formula case we continue as follows: n k−1 m n k−1 m αi αi 3 3 pj · pn+i · pn+i ∈ I(Ck ) ∨ pj · pn+i · pn+i ∈ I(Ck ) ⇔¬ j=1 i=1 i=k+1 n k−1 m ⇔ ¬ p3j · j=1 ⇔ n j=1 p3j · i pαn+i · i=1 k−1 i=1 i pαn+i · j=1 i=1 pn+i ∈ I Ck × (pn+k ∪ 1) i=k i=k m pn+i ∈ I Ck × (pn+k ∪ 1) = I(Ck−1) , i=k where Ck−1 =def Ck × (pn+k ∪ 1). Recall that a generalized circuit has + as its only arithmetic operation and that it operates on subsets of Nm ∪ {∞}, where ∞ is an absorbing element for + (see definition before Lemma 3.2). cc 16 (2007) Circuits over sets of natural numbers 227 Lemma 5.3. For every gate g of a generalized (∪, ∩,− , +)-circuit, if I(g) = ∅ then I(g) ∩ ({0, 1, . . . , 2|C| + 1}m ∪ {∞}) = ∅. Proof. Let M, M ⊆ Nm and A, A ∈ {{∞}, ∅}. Since (N∪{∞})\(M ∪A) = (N \ M) ∪ ({∞} \ A), (M ∪ A) ∪ (M ∪ A ) = (M ∪ M ) ∪ (A ∪ A ), and (M ∪ A) + (M ∪ A ) = (M + M ) ∪ (A ∪ A ), the presence of ∞ in a circuit does not influence the generation of the other elements. Hence it suffices to consider a generalized (∪, ∩,− , +)-circuit C = (G, E, gC , α) over Nm ∪ {∞} where an input ∞ is replaced with ∅ and to prove that I(g) = ∅ implies I(g) ∩ {0, 1, . . . , 2|C| + 1}m = ∅, for every gate g. By De Morgan’s law we can assume that C has no ∩-gates. For the gates g of C we define inductively σ(g) =def max{ai : i = 1, . . . , m} for an input gate g with α(g) = (a1 , . . . , am ), σ(g) =def 0 for an input gate g with α(g) = ∞, σ(g) =def σ(g1 ) + σ(g2 ) + 1 for ∪-gates and +-gates g with predecessors g1 and g2 , and σ(g) =def σ(g1 ) for − -gates g with predecessor g1 . Obviously we have σ(g) ≤ 2|C| for every gate g. For s ∈ N let [s] =def {0, 1, . . . , s}. A set M ⊆ N is called an s-set if and only if M is a finite union of sets M1 × M2 × · · · × Mm where Mk ⊆ [s] or Mk ⊆ [s] for every k = 1, 2, . . . , m. The following two claims are easy to prove. Claim 1. For every s ≥ 0, the class of all s-sets from 2N union, intersection and complement. m is closed under Claim 2. If s1 ≤ s2 , then every s1 -set is an s2 -set. The following claim implies the lemma because σ(g) ≤ 2|C| for any g. So any nonempty σ(g)-set contains an (i1 , i2 , . . . , im ) such that for every k = 1, 2, . . . , m, either ik ≤ 2|C| or ik = 2|C| + 1. Claim 3. For every gate g of C, the set I(g) is a σ(g)-set. Proof of Claim 3. By induction. 1. If g is an input gate then I(g) ⊆ [σ(g)]m . 2. Let g be a − -gate with predecessor g1 . By the assumption of the induction, I(g1 ) is a σ(g1 )-set. By Claim 1, I(g1 ) is a σ(g1 )-set too, but σ(g1 ) = σ(g). 3. Let g be a ∪-gate with predecessors g1 and g2 . By the assumption of the induction, I(g1 ) is a σ(g1 )-set and I(g2 ) is a σ(g2 )-set. By Claim 2, I(g1 ) and I(g2 ) are σ(g)-sets. By Claim 1, I(g) = I(g1 ) ∪ I(g2 ) is a σ(g)-set. 4. Let g be a +-gate with predecessors g1 and g2 . By the assumption of the induction, I(g1 ) is a σ(g1 )-set and I(g2 ) is a σ(g2 )-set. Let I(g1 ) = 228 McKenzie & Wagner · · × Mim ) i∈I (Mi1 × · and I(g2 ) = j∈J (Mj1 cc 16 (2007) where Mik ⊆ [σ(g1 )] of Mik ⊆ [σ(g1 )] for k = 1, 2, . . . , m × · · · × Mjm ) where Mjk ⊆ [σ(g2 )] of Mjk ⊆ [σ(g2 )] for k = 1, 2, . . . , m. We conclude I(g1 ) + I(g2 ) = (Mi1 × · · · × Mim ) + i∈I = i∈I j∈J = (Mj1 × · · · × Mjm ) j∈J (Mi1 × · · · × Mim ) + (Mj1 × · · · × Mjm ) (Mi1 + Mj1 ) × · · · × (Mim + Mjm ) . i∈I j∈J . If Mik = ∅ or Mjk = ∅ then Mik + Mjk =∅⊆ Now we consider Mik + Mjk [σ(g)]. Otherwise we conclude as follows. Case 1. If Mik ⊆ [σ(g1 )] and Mjk ⊆ [σ(g2 )] then Mik + Mjk ⊆ [σ(g1 ) + σ(g2 )] ⊆ [σ(g)]. Case 2. If Mik ⊆ [σ(g1 )] and Mjk ⊆ [σ(g2 )] then Mik +Mjk ⊇ [σ(g1 )]+[σ(g2 )] = [σ(g1 ) + σ(g2 ) + 1] = [σ(g)] and hence Mik + Mjk ⊆ [σ(g)]. ⊆ [σ(g2 )] then Mik +Mjk ⊇ [minMik + σ(g2 )] ⊇ Case 3. If Mik ⊆ [σ(g1 )] and Mjk [σ(g1 ) + σ(g2 )] ⊇ [σ(g)] and hence Mik + Mjk ⊆ [σ(g)]. Lemma 5.4. The problem MC∗ (∪, ∩,− , +) is in PSPACE. Proof. For a generalized {∪, ∩,− , +}-circuit C = (G, E, gC , α) and b ∈ Nm ∪ {∞}, the following alternating polynomial time algorithm defines on each of its accepting subtrees a proof that b ∈ I(F ). Moreover, in every step on every path the algorithm defines g ∈ G, a ∈ Nm ∪ {∞}, and σ(g) ∈ {0, 1}. Afterwards, i.e., in the computation tree above this configuration, the algorithm checks whether a ∈ I(g) if σ = 1 and a ∈ I(g) if σ = 0. For a gate g of indegree 2 let g1 and g2 be the predecessors of g, for a gate g of indegree 1 let g1 be the predecessor of g. The justification for choosing c1 and c2 below from M =def {0, 1, . . . , 2|C|+1}m ∪ {∞} is provided by Lemma 5.3. 1. g := gC ; a := b; σ = 1 2. while g is not an input gate do: 2.1. if g is a +-gate and σ = 1 then: choose existentially c1 , c2 ∈ M such that a = c1 + c2 ; choose universally i ∈ {1, 2}; g := gi ; a := ci cc 16 (2007) Circuits over sets of natural numbers 229 2.2. if g is a +-gate and σ = 0 then: choose universally c1 , c2 ∈ M such that a = c1 + c2 ; choose existentially i ∈ {1, 2}; g := gi ; a := ci 2.3. if g is a ∪-gate with σ = 1 then: choose existentially i ∈ {1, 2}; g := gi 2.4. if g is a ∪-gate with σ = 0 then: choose universally i ∈ {1, 2}; g := gi 2.5. if g is a ∩-gate with σ = 1 then: choose universally i ∈ {1, 2}; g := gi 2.6. if g is a ∩-gate with σ = 0 then: choose existentially i ∈ {1, 2}; g := gi 2.7. if g is a − -gate then: g := g1 ; σ = 1 − σ 3. if g is an input gate then: if (σ = 1 ⇔ a = α(g)) then accept else reject . Since every proof of b ∈ I(F ) is considered on one accepting subtree of this algorithm, the latter really checks whether b ∈ I(F ). As a direct consequence of Lemma 5.1, Lemma 5.4, and Lemma 3.2 we obtain: Theorem 5.5. The problems MC∗ (∪, ∩,− , +), MC(∪, ∩,− , +), MC(∪, ∩, +), MC(∪, ∩,− , ×), MC(∪, ∩, ×), and MF(∪, ∩,− , ×) are PSPACE-complete. The problem MF(∪, ∩,− , +, ×) is PSPACE-hard. 6. Beyond PSPACE As an auxiliary tool to prove the main results of this section we introduce the following (∪, ∩, ·)-circuits that compute finite sets of words. Such a circuit C only has gates of indegrees 0 and 2. Every input gate (i.e., gate of indegree 0) g is labelled with a word from a given alphabet Σ∗ , and every gate of indegree 2 is labelled with ∪, ∩, or · (concatenation). For each of its gates g, the circuit computes a set I(g) ⊆ Σ∗ inductively defined as follows: If g is an input gate with label v then I(g) =def {v}. If g is an ω-gate (ω ∈ {∪, ∩, ·}) with predecessors gl , gr then I(g) =def I(gl ) ω I(gr ). Finally, I(C) =def I(gC ) where gC is the output gate of C. A (∪, ∩, ·)-circuit C is called special if for every gate g of C there exists a σ(g) ∈ N such that I(g) ⊆ Σσ(g) and the following holds for every gate g with predecessors g1 and g2 : If g is a ∩-gate or a ∪-gate then σ(g) = σ(g1 ) = σ(g2 ), and if g is a ·-gate then σ(g) = σ(g1 ) + σ(g2 ). 230 McKenzie & Wagner cc 16 (2007) Let NE(∪, ∩, ·) be the nonemptyness problem for special (∪, ∩, ·)-circuits, i.e., NE(∪, ∩, ·) =def {C : C is a special (∪, ∩, ·)-circuit such that I(C) = ∅}. Lemma 6.1. The problem NE(∪, ∩, ·) is NEXPTIME-hard. Proof. We describe a logarithmic space many-one master reduction from NEXPTIME to NE(∪, ∩, ·), inspired by (26). More specifically, given a nondeterministic one-tape Turing machine M which runs in exponential time, we construct in logarithmic space for every input x a special (∪, ∩, ·)-circuit Cx such that: M accepts x if and only if I(Cx ) = ∅. Let B be the tape alphabet of M including the blank symbol , let A ⊆ B be the input alphabet, and let S be the set of states including the initial state s0 and the accepting state s1 . Without loss of generality we may assume that M starts with the head in tape cell 1 which carries the leftmost input symbol, that M never moves its head left from tape cell 1, that it accepts with the head on tape cell 1 and with an empty tape, and that it loops from then on in its accepting state without moving its head. Furthermore, let p be a polynomial such that every computation path of M on input x has at most 2p(|x|) steps. Next we see how to describe configurations and computations of M on an input x of length n as words over the alphabet Σ =def B ∪ S ∪ {} where is a new symbol. A situation which occurs during M’s work on input x can be completely described by the configuration b1 . . . bi−1 sbi bi+1 . . . b2p(n) meaning that b1 , . . . b2p(n) are the symbols in the tape cells 1, . . . , 2p(n), resp., and that the head scans tape cell i with the state s. An accepting computation of M on input x can be described by the sequence c0 c1 . . . c2p(n) of such configuratons p(n) p(n) where c0 = s0 x2 −n , c2p(n) = s1 2 , and ci is a successor configup(n) p(n) ration of ci−1 for i = 1, . . . 2p(n) . Let compM (x) ⊆ Σ(2 +1)·(2 +3) be the set of all such descriptions of accepting computations of M on input x. In what follows we will construct in logarithmic space a special (∪, ∩, ·)circuit Cx such that I(Cx ) = compM (x). Then, M accepts x ⇔ compM (x) = ∅ ⇔ I(Cx ) = ∅, and we are done. Obviously, if c is a successor configuration of c then c and c can differ by at most three symbols, i.e., there are u, v ∈ Σ∗ and a, b, d, a , b , d ∈ Σ such that c = uabdv, c = ua b d v, and abda b d ∈ PM where PM ⊆ Σ6 is defined by the program of M. Let RM =def {(uabdv, uab d v) : u, v ∈ Σ∗ ∧ abda b d ∈ PM }. cc 16 (2007) Circuits over sets of natural numbers 231 Now we can write down compM (x) as compM (x) = firstM (x) ∩ nextM (x) ∩ lastM (x), where p(n) p(n) p(n) firstM (x) =def {s0 x2 −n } · Σ2 (2 +3) (all strings of length (2p(n) + 1)(2p(n) + 3) which start with the correct configuration) nextM (x) =def {c0 c1 . . . c2p(n) : |ci| = 2p(n) +3 ∧ (ci−1 , ci ) ∈ RM } (all strings of length (2p(n) + 1)(2p(n) + 3) which have the correct next configuration property) p(n) p(n) p(n) lastM (x) =def Σ2 (2 +3) · {s1 2 } (all strings of length (2p(n) + 1)(2p(n) + 3) which end with the correct configuration) We now define sets E(k) and Ka (k) for a ∈ Σ: E(k) =def Σk , Ka (k) =def {ak } for a ∈ Σ . These sets are easily seen to have logspace-constructible (in the length of the parameter k) special (∪, ∩, ·)-circuits, as the following recursive definitions show. E(0) = {ε} , E(2k) = E(k)·E(k) , and E(2k+1) = E(k)·E(k)·Σ . Ka (0) = {ε} , Ka (2k) = Ka (k)·Ka(k) , and Ka (2k+1) = Ka (k)·Ka (k)·{a}. Now we can write: firstM (x) = {s0 x} · K(2p(n) −n) · {} · E 2p(n) · (2p(n) +3) , lastM (x) = E 2p(n) · (2p(n) +3) · {s1 } · K(2p(n) ) · {} , which shows that special (∪, ∩, ·)-circuits can be constructed in logarithmic space (in the length of x) which compute firstM (x) and lastM (x). To do the same with nextM (x) we define some auxiliary sets with parameter k ∈ N, and in each case we show how to construct in logarithmic space (in the value of the parameter k) special (∪, ∩, ·)-circuits to compute these sets. k m D(k, m) =def wvw : |w| = 2m ∧ |v| = 2k −2m +3 ⊆ Σ2 +2 +3 for m = 0, 1, . . . , k − 1 constructed using D(k, 0) = a∈Σ {a} · E(2k +2) · {a} and D(k, m+1) = D(k, m) · E(2m ) ∩ E(2m ) · D(k, m) . S(k, m) =def wvw : |w| = |w | = 2m +3 ∧ |v| = 2k −2m k m ∧ (w, w ) ∈ RM ⊆ Σ2 +2 +6 232 McKenzie & Wagner cc 16 (2007) for m = 0, 1, . . . , k constructed using (aw · E(2k −1) · aw ) ∪ (wa · E(2k −1) · w a) , S(k, 0) = a∈Σ ww ∈PM D(k, m) · E(2m +3) ∩ E(2m ) · S(k, m) ∪ S(k, m) · E(2m ) ∩ E(2m +3) · D(k, m) . S(k) =def ww : w, w ∈ Σ∗ ∧ |w| = |w | = 2k +3 ∧ (w, w ) ∈ RM S(k, m+1) = k+1 +6 ⊆ Σ2 constructed using S(k) = S(k, k). R(k, m) =def w0 w1 . . . w2m : wi−1 wi ∈ S(k) for i = 1, . . . , 2m m +1)(2k +3) ⊆ Σ(2 constructed using R(k, 0) = S(k), and R(k, m+1) = R(k, m) · E (2k +3)2m ∩ E (2k +3)2m · R(k, m) . Finally we obtain nextM (x) = R(p(n), p(n)). Theorem 6.2. The problem MC(∪, ∩, +, ×) is NEXPTIME-complete. Proof. 1. To prove MC(∪, ∩, +, ×) is NEXPTIME-hard we show NE(∪, ∩, ·) ≤log m MC(∪, ∩, +, ×) . For w ∈ {0, 1}∗ let bin−1 (w) be that natural number whose binary description is w (possibly with leading zeros), and for L ⊆ {0, 1}∗ let bin−1 (L) =def {bin−1 (w) : w ∈ L}. Given a special (∪, ∩, ·)-circuit C we construct in logarithmic space a (∪, ∩, +, ×)-circuit C such that I(C ) = bin−1 (I(C)). The circuit C basically has the same structure as C: An input gate in C with label w becomes an input gate in C with label bin−1 (w), a ∪-gate in C becomes a ∪-gate in C , and a ∩-gate in C becomes a ∩-gate in C . A · -gate g in C with predecessor g1 , g2 such that I(g2 ) ⊆ {0, 1}k is replaced in C by a subcircuit which computes bin−1 (I(g1 ) · I(g2 )) = (2k × bin−1 (I(g1 ))) + bin−1 (I(g2 )). The 2k can be computed by an (∪, ∩, ×)-circuit C which has the same structure as C but instead of an input w it has the input 2|w| , and instead of a ·-gate it cc 16 (2007) Circuits over sets of natural numbers 233 has a ×-gate. Here it is important that C is a special (∪, ∩, ·)-circuit. Now, I(C) = ∅ ⇔ I(C ) = ∅ ⇔ 0 ∈ ({0} × I(C )). 2. To see that MC(∪, ∩, +, ×) is in NEXPTIME, simply unfold a given (∪, ∩, +, ×)-circuit into a (possibly exponentially larger) (∪, ∩, +, ×)-formula and apply the NP-algorithm from Lemma 4.1. Corollary 6.3. The problem NE(∪, ∩, ·) is NEXPTIME-complete. As an immediate consequence of Theorem 6.2 we obtain also: Theorem 6.4. The problem MC(∪, ∩,− , +, ×) is NEXPTIME-hard. − Remark 6.5. Since MC(∪, ∩,− , +, ×) ≡log m MC(∪, ∩, , +, ×) these problems cannot be in NEXPTIME unless NEXPTIME = co-NEXPTIME. In fact, there is evidence suggesting that MF(∪, ∩,− , +, ×) might not be decidable. Indeed, Christian Glaßer in Würzburg was the first to observe that there is a simple {∪, ∩,− , +, ×}-formula G (see the Example 2.2 in Section 2) having the property that (G, 0) ∈ MF(∪, ∩,− , +, ×) if and only if Goldbach’s Conjecture is true. Hence, a decision procedure for MF(∪, ∩,− , +, ×) would provide a terminating algorithm to test Goldbach’s Conjecture; this would be surprising. 7. P-complete membership problems Theorem 7.1. The problem MC(+, ×) is P-complete. Proof. To prove MC(+, ×) ∈ P, let C be a (+, ×)-circuit and b ∈ N. Any gate in C computes a singleton. If I(C) = {b} then I(g) = {a} such that a > b for some gate g can only occur if this a is multiplied with 0 in a subsequent gate. Hence b + 1 does the same job as a in this computation. Therefore a polynomial time algorithm to decide I(C) = {b} consists in just evaluating C but replacing every a > b with b + 1. The hardness proof is by showing that the P-complete monotone Boolean circuit value problem (17) can be reduced to MC(+, ×). To do so we convert a monotone Boolean circuit C into a (+, ×)-circuit C of exactly the same structure where every Boolean input 0 (1, resp.) in C becomes the integer input 0 (1, resp.) in C , every ∨-gate in C becomes a +-gate in C , and every ∧-gate in C becomes a ×-gate in C . It is easy to see that v evaluates to 0 in C if and only if 0 ∈ I(v) in C . Hence, C evaluates to 0 if and only if 0 ∈ I(C ). 234 McKenzie & Wagner cc 16 (2007) Theorem 7.2. The problems MC(∪, ∩) and MC(∪, ∩,− ) are P-complete. Proof. To prove MC(∪, ∩,− ) ∈ P, let C be a (∪, ∩,− )-circuit and b ∈ N. Define S =def v input gate I(v). We prove that the claim that for every gate v there are sets P, N ⊆ S such that I(v) = P ∪ N . Then we can compute in polynomial time all I(v) from the inputs down to the output by storing only the sets P and N. To see the claim, let P1 , P2 , N1 , N2 ⊆ S and observe (P1 ∪ N1 ) ∪ (P2 ∪ N2 ) = (P1 ∪ P2 ) ∪ (N1 ∩ N2 ) , (P1 ∪ N1 ) ∩ (P2 ∪ N2 ) = (P1 ∩ P2 ) ∪ (P1 \ N2 ) ∪ (P2 \ N1 ) ∪ (N1 ∪ N2 ) , P1 ∪ N1 = N1 \ P1 . The hardness proof is by showing that the P-complete monotone Boolean circuit value problem can be reduced to MC(∪, ∩). To do so we convert a monotone Boolean circuit C into a (∪, ∩)-circuit C of almost the same structure where every input gate in C with Boolean value 1 becomes an input gate in C with integer value 1, every input gate in C with Boolean value 0 becomes an ∩-gate in C with two input gates with labels 0 and 1, resp., as predecessors, every ∨-gate in C becomes a ∪-gate in C , and every ∧-gate in C becomes a ∩-gate in C . It is easy to see that v evaluates to 0 in C if and only if I(v) = ∅ in C , and v evaluates to 1 in C if and only if I(v) = {1} in C . Hence, C evaluates to 1 if and only if 1 ∈ I(C ). 8. Circuits with intersection as the only set operation Circuits having intersection as their only set operation are special in the sense that every node computes a singleton or the empty set. Thus these circuits bear some relationship to circuits of the same type without intersection. For O ⊆ {+, ×} define EQ(O) =def (C1 , C2 ) : C1 , C2 are O-circuits such that I(C1 ) = I(C2 ) . Lemma 8.1. (i) MC(∩, +) ≤log m EQ(+), (ii) MC(∩, +, ×) ≡log m EQ(+, ×). cc 16 (2007) Circuits over sets of natural numbers 235 Proof. 1. Let C be a (∩, +)-circuit with output gate gC . Without loss of generality, every predecessor of a ∩-gate is a +-gate having outdegree 1. For a gate g of C, let Cg be that (+)-circuit which arises from C by defining g as the output gate and by removing all ∩-gates h where all gates fed with the output of h are now fed with output of the right predecessor of h. Further, let C be the (+)-circuit which arises from C by replacing every ∩-gate by a +-gate and every input by 0. Finally, let Cg be the (+)-circuit constructed from C and Cg as follows: Cut the vertices going into g in C , and identify gate g of C with gate g of Cg . The output gate of Cg is the output gate gC of C . If n(g) is the number of paths in C from g to gC then we have I(Cg ) = n(g) · I(Cg ). Let A be the set of all ∩-gates from which gC is accessible in C. Observe that encodings of the circuits Cg and Cg can be computed in logarithmic space and that, if I(left predecessor of h) = I(right predecessor of h) for every gate h ∈ A then I(g) = I(Cg ) for every gate g of C from which gC is accessible. For b ∈ N let C(b) be the circuit which consists only of an input gate with label b. We obtain: b ∈ I(C) ⇔ b ∈ I(CgC ) ∧ h∈A with predecessors h1 ,h2 I(Ch1 ) = I(Ch2 ) I(Ch 1 ) = I(Ch 2 ) ⇔ b ∈ I(CgC ) ∧ h is a ∩-gate with predecessors h1 ,h2 ⇔ I(CgC ) = I C(b) ∧ I(Ch 1 ) = I(Ch 2 ) . h is a ∩-gate with predecessors h1 ,h2 Thus it is sufficient to show that there exists a logarithmic space algorithm converting the (+)-circuits C0 , . . . Cr , C0 , . . . Cr into (+)-circuits D, D such that I(D) = I(D ) ⇔ I(Ci ) = I(Ci ) for i = 0, 1, . . . r . r r r i=0 |Ci |+ i=0 |Ci | we get a ≤ N −1 for a ∈ 2 Defining N = def i=0 I(Ci ) ∪ r I(C ). Now it is easy to construct (+)-circuits D, D such that i i=0 i )·N . However, for I(D) = ri=0 I(Ci )·N i and I(D ) = ri=0 I(C ri r a0 , . .i. , ar , i a · N = ⇔ b0 , . . . , br ∈ {0, 1, . . . N − 1} there holds i=0 i i=0 bi · N (ai = bi for i = 0, 1, . . . r). 2. The ≤log m -part is very similar to the proof of Item 1. Here it is sufficient to show that there exists an logarithmic space algorithm converting the (+, ×)circuits C0 , . . . Cr , C0 , . . . Cr into (+, ×)-circuits C, C such that I(C) = I(C ) ⇔ I(Ci ) = I(Ci ) for i = 0, 1, . . . r . 236 McKenzie & Wagner cc 16 (2007) r r r i=0 |Ci |+ i=0 |Ci | we get a ≤ 2N −3 for a ∈ Defining N = 2 def i=0 I(Ci ) ∪ r ). Now it is easy to construct (+, ×)-circuits C, C such that i=0 I(Ci r r Ni Ni and I(C ) = However, for I(C) = i ) + 2) . i=0 (I(Ci ) + 2) i=0 (I(C i r N Ni ⇔ a0 , . . . , ar , b0 , . . . , br ∈ {2, 3, . . . 2 − 1} there holds i=0 ai = ri=0 bN i (ai = bi for i = 0, 1, . . . r). For the ≥log m -part observe I(C) = I(C ) ⇔ 0 ∈ ((I(C) ∩ I(C )) × {0}). Theorem 8.2. MC(∩, +), MC(+), and EQ(+) are ≤log m -complete for C= L. Proof. 1. For the membership in C= L it is sufficient to prove that EQ(+) ∈ C= L (Lemma 8.1). For a (+)-circuit C, let C be that circuit which arises from C by adding a new input gate gI labelled with 1 and replacing every old input gate with label a by a (+)-circuit computing a from the sole input gate gI . Consequently, I(C) = I(C ) = the number of paths in C from the input to the output , and hence I is a #L-function. For given (+)-circuits C1 , C2 define the #Lfunctions f, g by f (C1, C2 ) =def I(C1 ) and g(C1, C2 ) =def I(C2 ). Now, (C1 , C2 ) ∈ EQ(+) ⇔ f (C1 , C2 ) = g(C1 , C2). 2. For the C= L-hardness of MC(+) let A ∈ C= L. By definition there exist a function f ∈ #L and a logarithmic space computable function g such that x ∈ A ⇔ f (x) = g(x). Let M be a nondeterministic logspace Turing machine such that f (x) is the number of accepting paths of M on input x. Let further Cx be the transition graph of M on input x. If we consider Cx to be a (+)-circuit whose accepting and rejecting nodes are inputs with labels 1 and 0 respectively, then we have I(Cx ) = {f (x)}. Consequently x ∈ A ⇔ f (x) = g(x) ⇔ g(x) ∈ I(Cx ) ⇔ Cx , g(x) ∈ MC(+) . Theorem 8.3. (i) The problem MC(∩, +, ×) is in co-R. (ii) The problem MC(∩, +, ×) is P-hard. Proof. 1. By Lemma 8.1 it is sufficient to prove EQ(+, ×) ∈ co-R. We can do this by feeding the two circuits forming the EQ(+, ×) instance into a subtraction gate, and then testing whether the resulting circuit over the integers computes the 0 function. Now Ibarra and Moran show how to perform the latter in co-R (20). 2. This is a direct consequence of Theorem 7.1. cc 16 (2007) Circuits over sets of natural numbers 237 Theorem 8.4. (i) The problem MC(∩, ×) is in P. (ii) The problem MC(∩, ×) is C= L-hard. Proof. 1. By Lemma 3.2 it suffices to prove that MC∗ (∩, +) is in P. Let C be a {∩, +}-circuit processing values from Nm ∪ {∞}. There is at most one m-tuple or ∞ in I(v) for every gate v. The size of these m-tuples is polynomial in the size of the input. So we can evaluate C step by step in polynomial time. 2. For the C= L-hardness of MC(∩, ×) let A ∈ C= L. Hence there exist functions f1 , f2 ∈ #L such that x ∈ A ⇔ f1 (x) = f2 (x). For i = 1, 2, let Mi be a nondeterministic logspace Turing machine such that fi (x) is the number of accepting paths of Mi on input x. Let further Cix be the transition graph of Mi on input x. If we consider Cix to be a (×)-circuit whose rejecting nodes are inputs with label 1 and whose accepting nodes are inputs with label 2 then we have I(Cix ) = {2fi (x) }. Consequently x ∈ A ⇔ f1 (x) = f2 (x) ⇔ I(C1x ) = I(C2x ) ⇔ 0 ∈ I(C1x ) ∩ I(C2x ) × {0} . Theorem 8.5. The problem MC(×) is NL-complete. Proof. 1. To prove the hardness we reduce the NL-complete graph accessibility problem GAP for directed acyclic graphs to the problem MC(×). Let G = (V, E) be a directed acyclic graph and s, t ∈ V be the source and target vertices, respectively. Recall that our circuits are not necessarily connected. Without loss of generality assume that every vertex has indegree 0 or 2 and that s has indegree 0. Now convert G into a (×)-circuit C by labelling every vertex with indegree 2 by ×, the source vertex s by 0 and all other vertices with indegree 0 by 1. Let further gC =def t. We obtain (G, s, t) ∈ GAP ⇔ there is a path in G from s to t ⇔ 0 ∈ I(C) ⇔ (C, 0) ∈ MC(×) . 2. Now we describe a many-one reduction from MC(×) to the iterated multiplication decision problem IMD =def {(a1 , . . . ar , b) : a1 , . . . ar , b ∈ N ∧ r i=1 ai = b} via a function which is logspace computable with an oracle from NL. Since IMD ∈ L ((15), or better yet, uniform TC0 (3; 19)) we obtain MC(×) ∈ LNL . However, LNL = NL. 238 McKenzie & Wagner cc 16 (2007) Let C be a (×)-circuit and b ∈ N. Let g1 , . . . gr be the input gates of C, let gC be the output gate of C, and let n(C, g, g ) be the number of different paths from gate g to gate g . Obviously, n ∈ #L, and we obtain I(C) = r in Cn(C,g i ,gC ) . Defining s(i) =def min{n(C, gi, gC ), |b|+1} for i = 1, . . . , r i=1 I(gi ) we obtain b ∈ I(C) ⇔ b = ri=1 I(gi )n(C,gi ,gC ) ⇔ b = ri=1 I(gi )s(i) ⇔ I(g1 ), . . . , I(g1), . . . , I(gr ), . . . , I(gr ), b ∈ IMD . s(1) s(r) The latter tuple of numbers is generated as follows: for i = 1, . . . r and k = 1, . . . , |b| + 1 ask n(C, gi, gC ) ≥ k, which are queries to a NL-set (5). (This is owing to the fact that only small k, i.e., k whose values are polynomially bounded in the length of the input, are considered.) If such a query n(C, gi, gC ) ≥ k is answered in the affirmative, output I(gi), and finally output b. 9. Further results Theorem 9.1. The problems MC(∪) and MC(∩) are NL-complete. Proof. Upper bounds. For a ∪-circuit C and b ∈ N , it holds that b ∈ I(C) if and only if there exists a path in C from an input gate with label b to the output gate. This can be checked by an NL-algorithm. For a ∩-circuit C and b ∈ N , it holds that b ∈ I(C) if and only if all input gates from which there exists a path to the output gate have label b. This can be checked by an co-NL-algorithm. However, co-NL = NL (21; 27). Lower bounds. We reduce the NL-complete graph accessibility problem GAP for directed acyclic graphs to the problems MC(∪) and MC(∩). Let G = (V, E) be a directed acyclic graph and s, t ∈ V be the source and target vertices, resp. Without loss of generality assume every vertex has indegree 0 or 2 and that s has indegree 0. Now convert G into a (∪)-circuit C by labelling every vertex with indegree 2 by ∪, the source vertex s by 0 and all other vertices with indegree 0 by 1. Let further gC =def t. We obtain (G, s, t) ∈ GAP ⇔ there is a path in G from s to t ⇔ 0 ∈ I(C) ⇔ (C, 0) ∈ MC(∪) . Furthermore, convert G into a (∩)-circuit C by labelling every vertex with indegree 2 by ∩, the source vertex s by 0 and all other vertices with indegree 0 cc 16 (2007) Circuits over sets of natural numbers 239 by 1. Let further gC =def t. We obtain (G, s, t) ∈ GAP ⇔ ⇔ there is no path in G from s to t 1 ∈ I(C) ⇔ (C, 1) ∈ MC(∩) . Consequently, GAP ≤log m MC(∩). However, because of NL = co-NL we have GAP. GAP ≤log m Theorem 9.2. The problems MF(∩, +,×), MF(+,×), MF(∪, ∩,− ), MF(∪, ∩), MF(∪), MF(∩), MF(∩, +), MF(∩, ×), MF(+) and MF(×) are L-complete under AC0 -reducibility. Proof. Hardness. Any one of the associative binary operations ∪, ∩, + and × is able to simulate the Boolean ∨ operation once an appropriate representation for the truth values is chosen. For example, representing σ(true) = ∅ and σ(false) = {0} allows ∩ to simulate ∨ since a ∨ b is true iff σ(a) ∩ σ(b) = ∅, and a∨b is false iff σ(a)∩σ(b) = {0}. Hence, to prove all eight hardness claims, it suffices to prove that evaluating a Boolean formula (in our encoding, as a possibly disconnected outdegree-one circuit) with ∨ as the only operation is L-hard. But this is clear, and is explicitly stated under NC1 -reducibility in (8) (where the formulas involve both ∨ and ∧, but ∧ is used only to enforce the (8) requirement that every formula be connected). To justify the more restrictive AC0 -reducibility, consider a deterministic logspace Turing machine M. An AC0 circuit with input w is capable of computing whether two arbitrary polynomialsize configurations of M running on w follow one another by a transition of M. Hence an AC0 circuit can compute the relevant part of the (outdegree-one) configuration graph of M running on w. It can also ensure acyclicity by adding time stamps to duplicate the graph appropriately. Finally, it can view the graph as a ∨-circuit whose output gate is the initial configuration of M, whose final configuration becomes an input gate carrying the Boolean value 1, whose other outdegree-zero nodes become input gates carrying the Boolean value 0, and all of whose other nodes are assigned a second input wire carrying the value 0. The resulting circuit outputs 1 iff M accepted w, and this circuit was constructed in AC0 . Upper bounds. It suffices to prove that MF(∪, ∩,− ) and MF(∩, +, ×) are in L. One way to solve MF(∪, ∩,− ) is to reduce in logspace the problem to that of evaluating a Boolean (∨, ∧, ¬)-formula, then transforming in logspace (as mentioned in (8, Proposition 3.2, p. 445)) the connected part of this Boolean formula into infix notation, and finally evaluating the infix Boolean formula in 240 McKenzie & Wagner cc 16 (2007) logspace (22) (or in NC1 ⊆ L using Buss’s algorithm (12)). To see the first step, namely reducing a (∪, ∩,− )-formula F with b ∈ N to a Boolean (∨, ∧, ¬)formula F , let F have exactly the same structure as F , with every input in F labelled b (resp. having label = b) giving rise in F to an input labelled 1 (resp. 0), and with every ∪-gate in F (resp. ∩-gate, − -gate) giving rise to a ∨-gate in F (resp. ∧-gate, ¬-gate). Then for every gate g, (b ∈ I(g) in F ) ⇔ (I(g) = 1 in F ). Hence b ∈ I(F ) ⇔ I(F ) = 1. The case MF(∩, +, ×) is reduced in logspace to EQ(+, ×) in Lemma 8.1. The EQ(+, ×) instance now involves two {+, ×}-formulas. We first transform each {+, ×}-formula into infix notation as explained in the above paragraph. Then the formulas are transformed into logarithmic-depth formulas by applying the techniques of (11). Now, following Ben-Or and Cleve (10), we can reduce formula evaluation to the problem of computing a product of 3-by-3 integer matrices. Finally, checking equality of two such matrix products can be done in logspace by carrying out the checks modulo (a polynomial number of) distinct small primes. The L-hardness of the MF problems considered in this section result from our choice of formula encoding. At such low complexity levels, a more appropriate choice is infix notation; then MF(∪, ∩,− ) becomes NC1 -complete by equivalence with the Boolean formula value problem (12), and some of the other restrictions considered in Theorem Theorem 9.2 drop down into yet smaller classes. 10. Conclusion Table 10.1 summarizes the known complexity status of the membership problems for arithmetic circuits over subsets of N. Several open questions are apparent from the table, most notably the intriguing question of finding an upper bound on the complexity of MC(∪, ∩,− , +, ×) or proving the problem undecidable. We observe that the problems MC(×) and MC(+), complete for NL and for C= L respectively, offer an interesting new perspective on these two classes. If one could reduce MC(+) to MC(×), then it would follow that NL = C= L. Finally, some cases of interest were left out of our analysis, namely those in which complementation is the only set operation. Klaus Reinhardt (private communication) has shown that MF(− , +, ×) is already powerful enough to express a weak form of Goldbach’s conjecture. He also extended our techniques to prove that MC(− , ×), MC(− , +), MF(− , ×) and MF(− , +) are PSPACEcomplete, and he observed that MC(− ) is L-complete. cc 16 (2007) Circuits over sets of natural numbers 241 Table 10.1: State of the art. The results on MF(∪, +), MF(∪, ∩,− , +) as well as on MC(∪, +, ×) were already known from the literature, please refer to the relevant sections for the appropriate credit. Lower bounds of course refer to hardness results. MC(O) MC(O) MF(O) MF(O) O lower bound upper bound Th. low. bound upp. bound Th. ∪, ∩,− , +, × NEXPTIME ? 6.4 PSPACE ? 5.5 ∪, ∩, +, × NEXPTIME NEXPTIME 6.2 NP NP 4.4 ∪, +, × PSPACE PSPACE 2.3 NP NP 4.4 ∩, +, × P co-R 8.3 L L 9.2 +, × P P 7.1 L L 9.2 ∪, ∩,− , + PSPACE PSPACE 5.5 PSPACE PSPACE 2.3 ∪, ∩, + PSPACE PSPACE 5.5 NP NP 4.4 ∪, + NP NP 4.4 NP NP 2.3 ∩, + C= L C= L 8.2 L L 9.2 + C= L C= L 8.2 L L 9.2 − ∪, ∩, , × PSPACE PSPACE 5.5 PSPACE PSPACE 5.5 ∪, ∩, × PSPACE PSPACE 5.5 NP NP 4.4 ∪, × NP NP 4.4 NP NP 4.4 ∩, × C= L P 8.4 L L 9.2 × NL NL 8.5 L L 9.2 ∪, ∩,− P P 7.2 L L 9.2 ∪, ∩ P P 7.2 L L 9.2 ∪ NL NL 9.1 L L 9.2 ∩ NL NL 9.1 L L 9.2 Acknowledgements We are grateful to Eric Allender for his help with the upper bound in Theorem 8.5, to Heribert Vollmer, Christian Glaßer, Daniel Meister, Stephen Travers, and Hans-Georg Breunig for very useful discussions, and to anonymous referees for valuable suggestions, including the need to correct our choice of formula encoding and to clarify its ramifications, the need to correct a former proof of Lemma 5.3 and the nice observation that MF(∩, +, ×) belongs to L. Finally, we gratefully acknowledge the role played by the Dagstuhl seminar at which some of the work reported here was performed. 242 McKenzie & Wagner cc 16 (2007) References [1] M. Agrawal, E. Allender, and S. Datta, On TC0 , AC0 , and arithmetic circuits, J. Computer and System Sciences 60 (2000), pp. 395–421. [2] E. Allender, Making computation count: Arithmetic circuits in the Nineties, in the Complexity Theory Column, SIGACT NEWS 28 (4) (1997) pp. 2–15. [3] E. Allender, D. Barrington, and W. Hesse, Uniform constant-depth threshold circuits for division and iterated multiplication, J. Computer and System Sciences 65 4 (2002), pp. 695–716. [4] E. Allender, J. Jiao, M. Mahajan and V. Vinay, Non-commutative arithmetic circuits: depth-reduction and depth lower bounds, Theoretical Computer Science 209 1,2 (1998), pp. 47–86. [5] E. Allender, K. Reinhardt, S. Zhou, Isolation, matching, and counting: Uniform and nonuniform upper bounds, J. Computer and System Sciences 59 (1999), pp. 164–181. [6] E. Bach, J. Shallit, Algorithmic Number Theory, Volume I: Efficient Algorithms, MIT Press, Cambridge, MA, 1996. [7] D. Barrington, N. Immerman and H. Straubing, On uniformity within NC1 , J. Computer and System Sciences 41 3 (1990), pp. 274–306. [8] M. Beaudry and P. McKenzie, Circuits, matrices and nonassociative computation, J. Computer and System Sciences 50 (1995), pp. 441–455. [9] M. Beaudry, P. McKenzie, P. Péladeau, D. Thérien, Finite monoids: from word to circuit evaluation, SIAM J. Computing 26 (1997), pp. 138–152. [10] M. Ben-Or and R. Cleve, Computing algebraic formulas using a constant number of registers, SIAM J. Computing 21 1 (1992), pp. 54–58. [11] S. Buss, S. Cook, A. Gupta, V. Ramachandran, An optimal parallel algorithm for formula evaluation, SIAM J. Computing 21 (1992), pp. 755–780. [12] S. R. Buss, The Boolean formula value problemis in ALOGTIME, Proceedings 19th ACM Symp, on the Theory of Computing, 1987, pp. 123–131. [13] H. Caussinus, P. McKenzie, D. Thérien, H. Vollmer, Nondeterministic NC1 computation, J. Computer and System Sciences, 57 2, 1998, pp. 200–212. [14] A. K. Chandra, L. Stockmeyer, U. Vishkin, Constant depth reducibility, SIAM Journal on Computing 13, 1984, pp. 423–439. cc 16 (2007) Circuits over sets of natural numbers 243 [15] A. Chiu, G. Davida, and B. Litow, Division in logspace-uniform NC1 , RAIRO Theoret. Inform. Appl. 35 (2001), pp. 259–276. [16] J. von zur Gathen, Parallel algorithms for algebraic problems, SIAM J. on Computing 13 4 (1984), pp. 802–824. [17] L. M. Goldschlager, The monotone and planar circuit value problems are logspace complete for P, SIGACT News 9, 1977, pp. 25–29. [18] R. Greenlaw, J. Hoover and L. Ruzzo, Limits to parallel computation, P-completeness theory, Oxford University Press, 1995, 336 pages. [19] W. Hesse, Division is in uniform TC0 , Proceedings of the 28th International Colloquium on Automata, Languages, and Programming 2001, Lecture Notes in Computer Science 2076, pp. 104–114. [20] O. Ibarra and S. Moran, Probabilistic algorithms for deciding equivalence of straight-line programs, Journal of the ACM 30 (1), 1983, pp. 217–228. [21] N. Immerman, Nondeterministic space is closed under complement, SIAM J. on Computing 17 (5) (1988), pp. 935–938. [22] N. Lynch, Logarithmic space recognition and translation of parenthesis languages, Journal of the ACM 24 (1977), pp. 583–590. [23] M. Ogihara, The PL hierarchy collapses, SIAM Journal of Computing 27 (1998), pp. 1430–1437. [24] C. H. Papadimitriou, Computational Complexity, Addison-Wesley (1994). [25] R. Raz and P. McKenzie, Separation of the monotone NC hierarchy, Combinatorica 19 3 (1999), pp. 403–435. [26] L. J. Stockmeyer, A. R. Meyer, Word Problems Requiring Exponential Time, Proceedings 5th ACM Symposium on the Theory of Computing (1973), pp. 1–9. [27] R. Szelepcsényi, The method of forcing for nondeterministic automata, Bull. European Assoc. for Theor. Comp. Sci. (Oct. 1987), pp. 96–100. [28] H. Venkateswaran, Properties that Characterize LOGCFL, J. Computer and System Sciences 43, 2 (1991), pp. 380–404. [29] H. Vollmer, Introduction to Circuit Complexity, Springer, Berlin, 1999. 244 McKenzie & Wagner cc 16 (2007) [30] K. W. Wagner, The complexity of problems concerning graphs with regularities, Proceedings 11th Mathematical Foundations of Computer Science (1984), Lecture Notes in Computer Science 176, pp. 544–552. Full version as TR N/84/52, Friedrich-Schiller-Universität Jena, 1984. [31] K. Yang, Integer circuit evaluation is PSPACE-complete, J. Computer and System Sciences 63 2 (2001), pp. 288–303. Pierre McKenzie Informatique et recherche opérationnelle Université de Montréal C.P. 6128, Succ. Centre-Ville Montréal (Québec), H3C 3J7, Canada kckenzie@iro.umontreal.ca Klaus W. Wagner Theoretische Informatik Julius-Maximilians-Universität Würzburg Am Hubland D-97074 Würzburg, Germany wagner@informatik.uni-wuerzburg. de