Complexity Results for First-Order Two-Variable Logic with Counting Leszek Pacholski Institute of Computer Science Wroclaw University
[email protected]
C2
Wieslaw Szwast Lidia Tendera Institute of Mathematics Opole University
[szwast,tendera]@math.uni.opole.pl
Abstract
Let p denote the class of rst order sentences with two variables and with additional quanti ers \there exists exactly (at most, at least) i", for i p, and let C 2 be the union of Cp2 taken over all integers p. We prove that the satis ability problem for C12 sentences is NEXPTIME-complete. This strengthens the results by E. Gradel, Ph. Kolaitis and M. Vardi [15] who showed that the satis ability problem for the rst order two-variable logic L2 is NEXPTIME-complete and by E. Gradel, M. Otto and E. Rosen [16] who proved the decidability of C 2. Our result easily implies that the satis ability problem for C 2 is in non-deterministic, doubly exponential time. It is interesting that C12 is in NEXPTIME in spite of the fact, that there are sentences whose minimal (and only) models are of doubly exponential size. It is worth noticing, that by a recent result of E. Gradel, M. Otto and E. Rosen [17], extensions of two-variables logic L2 by a week access to cardinalities through the Hartig (or equicardinality) quanti er is undecidable. The same is true for extensions of L2 by very week forms of recursion. The satis ability problem for logics with a bounded number of variables has applications in arti cial intelligence, notably in modal logics (see e.g. [22]), where counting comes in the context of graded modalities and in description logics, where counting can be used to express so-called number restrictions (see e.g. [8]).
1 Introduction Let L2 denote the class of rst order sentences with two variables over a relational vocabulary, and let Cp2 denote L2 extended with additional quanti ers \there exists exactly (at most, at least) i", for i p. Finally, let C 2 be the union of Cp2 taken over all integers p. We prove that the problem of satis ability of sentences of C12 is NEXPTIME-complete. Problems concerning decidability of restricted classes of quanti cational formulas have been studied since the second decade of this century by many logicians including W. Ackermann, P. Bernays, K. Godel, L. Kalmar, M. Schon nkel, T. Skolem, H. Wang [1, 2, 5, 11, 12, 24, 33, 34, 35, 37] and many others. In the late twenties and in the thirties (see [7] and [19] for more informations) the study of classi cation of solvable classes of prenex formulas was one of the most active areas of logic. Now, after the works of Y. Gurevich [18], M. Rabin [30], S. Shelah [32] and W. Goldfarb [14] the classi cation of prenex classes has been completed. Accounts of the classical results in this area can be found in several books [3, 7, 9, 25]. More
The results included in section 4 have been published as a part of [29].
1
recent results have been obtained by H.R. Lewis and W. Goldfarb [13, 14, 26]. A short survey of the research in this area can be found in [19] (see also the introduction to [15]). In 1962, in a short note, D. Scott [31] proved that the satis ability problem for L2 was decidable. His proof was based on a reduction of this problem to the problem of satis ability of sentences in the Godel class with equality. Later, in 1975, M. Mortimer gave another proof of decidability by proving that L2 has a nite model property. When in 1984 G.D. Goldfarb [14] found a counterexample to the claim, that the Godel class with equality had a decidable satis ability problem, the very short and elegant proof by D. Scott lost its validity. In 1980 H. Lewis [27] proved that the satis ability problem for L2 was NEXPTIME-hard. The complexity of an algorithm which could be extracted from the Mortimer's work was doubly exponential. Recently, E. Gradel, Ph. Kolaitis and M. Vardi [15] have closed the gap by providing a very elegant proof that the satis ability problem for L2 was in NEXPTIME. Later we found another proof [36] of the same result. Our proof was not as nice as the one in [15], but we hoped it could be extended to get the complexity bounds for C 2 . In [16] E. Gradel, M. Otto and E. Rosen established decidability of the satis ability problem for C 2. They proved that the set of sentences which have in nite models was recursive, which implied the above mentioned result. No complexity estimates could be obtained from their proof. In this paper we prove that the satis ability problem for C12 is in NEXPTIME, so by the result H. Lewis [27] it is NEXPTIME-complete. By the reduction of C 2 to C12 given in [16] this implies that C 2 is in 2-NEXPTIME. Although our strict upper bound applies only to C12 we believe that we have developed techniques that can be used to close the gap for the entire class C 2. Our approach is in a very remote way based on the ideas of Mortimer. A very simple cardinality argument shows that Mortimer's notion of a star could not be used to give a NEXPTIME decision procedure. This led to a weakening of this notion to the notion of a constellation. As the rst application of this notion we gave in [36] another proof of the result of Gradel, Kolaitis and Vardi [15]. There we have also used a stronger notion of a normal form - going further than Gradel, Otto and Rosen in [16] - a constellation form, in which additionally, constant symbols do not appear. The proof in [36] is \syntactic", however, in the case of L2 , the \syntactic" structure coding a model is almost equivalent to a model. This changes dramatically when we move to C 2 , and allows for a concise description of models that can be even in nite. In contrast to [16] our basic notions are almost entirely syntactic. We like the feudal terminology of [16] and we treat kings of [16] with proper care and respect. However, kings in our sense have other virtues besides belonging to a nite set. Population of our kings is always at most doubly exponential in the size of the language. On the other hand, it is easy to give examples of models whose sets of kings in the sense of [16] have, for a language of bounded size, arbitrary large cardinality. This seems to suggest that the method of [16] could not easily be adapted to give complexity bounds. To get our result we analyze the structure of the feudal court. We have a few kings and kings are characterized by the fact, that they are connected between themselves using only counting types. Instead of a more or less uniform court we have a hierarchy Vi, for i < 2n of vassals, each of which may be a sovereign of perhaps several vassals in Vi+1 . The union V of all Vi, for i < 2n is included in the set of kings in the sense of [16] and provides information sucient to reconstruct a model and thus gives rise a 2-NEXPTIME algorithm for C12, and a 3-NEXPTIME algorithm for C 2. Of course, we can not easily improve the above bounds, 2
2
2
since we can provide a sentence (see Proposition 4.21) of C12 of size n whose unique model n 2 coincides with V and has cardinality O(2 ). To push the lower bound down we had to provide a ner analysis. We have noticed that although the number of vassals in a model can be large (doubly exponential), the number of vassals that are dierent from the point of view of relations between themselves is smaller (exponential). In more technical terms a potential model is described by a set of indexed constellations and numbers of elements that realize these constellations. Roughly speaking, an indexed constellation in addition to information on two-types realized by pairs containing a given element carries, for certain two-types requests for partner constellations - constellations that should realize, together with the given constellation, these two-types. Moreover, we show that the model is composed of some number of parts (only one of them can be in nite), which can be treated separately and independently during construction of the model. To check if the parts can be constructed we use several graph-theoretical results concerning the existence of Hamiltonian cycles, matchings and bipartition. It is worth noticing, that by a recent result of E. Gradel, M. Otto and E. Rosen [17], extensions of two-variables logic L2 by a weak access to cardinalities through the Hartig (or equicardinality) quanti er is undecidable. The same is true for extensions of L2 by very weak forms of recursion. The satis ability problem for logics with a bounded number of variables has applications in arti cial intelligence, notably in modal logics (see e.g. [22]) where counting comes in the context of graded modalities and in description logics, where counting can be used to express so-called number restrictions (see e.g. [8]). More information on applications and relation of two-variables logics to modal logics is given in [15].
2 Preliminaries Throughout the paper we are concerned mainly with signatures that consist of unary and binary predicate letters without Boolean predicates, function symbols and constants. This restriction allows to simplify de nitions and technical proofs. We would, however, like to emphasize that it is easy to adapt all notions used in this paper and to modify the proofs in order to obtain the same results also for the full rst-order two-variable logic with counting, including predicate letters of higher arity and constants (see e.g. [15] for a proof that predicate letters of higher arity can be eliminated). We assume that the reader is familiar with standard notions of logic and with basic concepts of computational complexity theory. In this paper, L-structures are denoted by Gothic capital letters and their universes by corresponding Latin capitals. Furthermore, if a structure A is xed, then its substructure with the universe denoted by a Latin capital is denoted by the corresponding Gothic capital. By L2 we denote the class of rst order sentences with two variables over a relational vocabulary, and by Cp2 we denote L2 extended by additional quanti ers of the form 9=i , 9i or 9i (there exists exactly, at most, at least i), for i p. Finally, C 2 is the union of Cp2 taken over all integers p. Let L be a relational vocabulary with unary and binary predicate letters only. A 1-type t(x) is a maximal consistent set of atomic and negated atomic formulas of the language L in the variable x. A 2-type t(x; y ) is a maximal consistent set of atomic and negated atomic formulas of the language L in the variables x; y , such that (x 6= y ) 2 t(x; y ). A type t is often 3
identi ed with the conjunction of formulas in t. For a 2-type t(x; y ) we denote by t(x; y )fxg the unique 1-type t(x) included in t(x; y ) and we denote by t the type dual to t, that is the type obtained from t by replacing each occurrence of the variable x by y and each occurrence of y by x. If A is an L-structure with the universe A, and if a; b 2 A, then we denote by tpA (a; b) the unique type realized by the pair ha; bi in A. Recall that for any integer function t(n), NTIME(t(n)) is the class of all decision problems that can be solved by a non-deterministic Turing machine in time t(n), where n is the length of the input. We put S NEXPTIME = p NTIME(2p(n)); S 2-NEXPTIME = p NTIME(22p n ); where p is a polynomial. ( )
3 On L2 case In this section we consider the satis ability problem for L2 , the rst-order logic with twovariables and without counting quanti ers. We give an algorithm solving this problem which runs in non-deterministic exponential time. As we have mentioned in the Introduction, it follows from the paper of M. Mortimer [28] that the satis ability problem for L2 can be solved by a non-deterministic algorithm in doubly exponential time. An algorithm whose complexity matches the NEXPTIME lower bound given by H. Lewis [27] was presented in a very nice paper by E. Gradel, Ph. Kolaitis and M. Vardi [15]. This algorithm and the bound that follow from the Mortimer's work depend on the bounds on the cardinality of a minimal model of an L2 sentence. Our algorithm in contrast to the above, does not exploit the bounded model property of L2 . This section is a modi cation of [36] and it is included here following a suggestion of one of the referees in order to introduce and explain the techniques used later for logic with counting. Our approach in a remote way is based on Mortimer's notion of a star [28], a star being an arbitrary set of two-types with a consistent center. The notion of a star was a very convenient technical tool to describe a nite structure and to check, with the help of Ehrenfeucht games of depth two [10], that this structure is a model of an L2 sentence. Unfortunately, the Mortimer's notion of a star cannot be directly used to give a NEXPTIME decision procedure since the cardinality of a star is exponential and the number of possible stars is doubly exponential in the number of predicate letters in the signature. We weaken the notion of a star to a notion of a small constellation that we introduce after a close analysis of L2 sentences from the point of view of their satis ability. As in other related papers [31, 15] we use a variant of a notion of a normal form of rst-order sentences. Our notion is called a constellation form and it allows to introduce the notion of a small constellation in a very natural way. Unlike a star, a small constellation is of linear size and it contains only these two-types that describe a relation of a given point to a witness that must exist in a model of an L2 sentence. We also introduce a notion of a small galaxy as a set of small constellations that can be modeled in a rst order structure and we prove that an L2 -sentence is satis able if and only if there exists a small galaxy (Theorem 3.5). A small galaxy has only exponential size. As the next step we give necessary and sucient conditions for a set of small constellations to form a small galaxy (De nition 3.12, Theorem 3.13). In the proof of Theorem 3.13 we use 4
notions of special and replicable constellations which are analogous to Mortimer's notions of asymmetric and symmetric stars. These notions are crucial for our analysis of models for L2 sentences. As a result we get a nondeterministic exponential upper bound for the satis ability problem for L2 -sentences (Corollary 3.14).
3.1 Small constellations, small galaxies and satis ability Let R L be a set of binary predicate letters, R = fR1; : : :; Rmg.
De nition 3.1 An L-sentence is in constellation form if ^ 8x9yR (x; y); = 8x8y(x; y ) ^ i 1im
where is quanti er-free.
This de nition may seem too strong. The second part of the formula seems to suggest that all elements are similar from the point of view of R. Note however, that we do not require that x 6= y , therefore for an element x, by Ri(x; x) we can code those relations Ri, for which the existential quanti er of the second part of does not apply. Let A be a set of 2-types closed under operation and let A+ = ft 2 A : Ri(x; y ) 2 t; for some i mg.
De nition 3.2 Let S = fs0; s1; : : :; skg, where 0 k m, s0 is a 1-type and, if k > 0 then s1; : : :; sk 2 A+ . VDe ne center(S ) = 0ik sifxg. The set S is a small A-R-constellation if the following conditions hold: 1) center(S ) = s0 , 2) for every Ri 2 R; if Ri(x; x) 62 center(S ) then there exists j , 1 j k, such that Ri (x; y) 2 sj , Notice that the notion of a small A-R-constellation depends on a set A of 2-types and a set R of binary predicate symbols.
De nition 3.3 Let A be an L-structure. An element a 2 A realizes a small A-R-constellation S = fs0; : : :; skg if tpA (a; a) = s0, for each b 2 A, tpA (a; b) 2 A, and there exists a sequence b1 ; : : :; bk of elements of A such that tpA (a; bi) = si , 0 < i k. A small A-R-constellation S is realized in A if there exists a 2 A which realizes S . V Note that if an element a 2 A realizes a small A-R-constellation then A j= 1im 9yRi(a; y ). De nition 3.4 Let S be a set of small A-R-constellations. A structure A realizes S if every element a 2 A realizes a small A-R-constellation S 2 S , and every small A-R-constellation S 2 S is realized by an element a 2 A. The set S is a small galaxy if there is a structure A such that card(A) > 1, and A realizes S . The following theorem gives a necessary and sucient condition for satis ability of sentences in constellation form. 5
Theorem 3.5 Let R = fR1; : : :; Rmg L and let be an L-sentence in constellation form, ^ 8x9yR (x; y): = 8x8y(x; y ) ^ i 1im
Put A = ft : t(x; y ) is a 2-type over L and t(x; y ) ! (x; y )g. Then has a model with at least two-element universe if and only if there exists a set S of small A-R-constellations which is a small galaxy.
Proof. ()) Let A j= and cardV(A) > 1. Since A j= 8x8y(x; y), the set A is closed under the operation . Moreover, A j= 1im 8x9yRi (x; y ) implies that every element of A realizes at least one small A-R-constellation. Let S = fS : S is a small A-R-constellation and S is realized in Ag. By De nitions 3.4, A realizes S . (() Let S be a small galaxy and assume A j= S . Let a 2 A. By De nition 3.4, a realizes a small A-R-constellation S 2 S , S = fs0 ; : : :; sk g. This implies that tpA (a; a) = s0 , and there exists a sequence b1; : : :; bk of distinct elements of A such that bi = 6 a, for i = 1; : : :; k, and 1. tpA (a; bi) = si , for i = 1; : : :; k, 2. tpA (a; b) 2 A, for b 2 A. V So, by De nition 3.2, the elements b1 ; : : :; bk witness that the part 1im 9yRi(x; y ) of holds for a. Moreover, for every b 2 A; b 6= a, tpA (a; b) 2 A, and so A j= (a; b). Therefore A j= .
2
3.2 The reduction
The following reduction theorem is essentially due to Scott [31]. It has been also used in [28] and [15]. We present a slightly modi ed version of the theorem given in [15].
Theorem 3.6 There exists a polynomial time algorithm which, given an L2 sentence over an arbitrary relational vocabulary, constructs a sentence in constellation form with the following properties: 1. is satis able if and only if is satis able.
2. Every predicate letter occuring in has arity at most 2. 3. If n is the length of , then contains O(n) dierent predicate letters and has length O(n log n).
3.3 The small galaxy theorem
In this section we x R = fR1; : : :; Rm g L, and a set A of 2-types closed under the operation
.
To simplify terminology in this subsection we write `constellation' instead of `small A-Rconstellation' and `galaxy' instead of `small galaxy'. By Theorem 3.6 and Theorem 3.5 the satis ability problem for L2 sentences can be reduced to the problem of nding an appropriate galaxy. In this subsection we shall give syntactic conditions that are necessary and sucient for a set of constellations to be a galaxy. 6
De nition 3.7 Let S; T be constellations and let t(x; y) 2 A. S is connectable to T by t(x; y) if center(S ) t(x; y ) and center(T ) t (x; y ). We say that S is connectable to T if there is a type t(x; y ) 2 A such that S is connectable to T by t(x; y ).
Proposition 3.8 Let S be a galaxy and S 2 S . Then the following conditions are equivalent. 1. There is a structure A which realizes S , and S is realized in A by at least two element. 2. S is connectable to S .
Proof. Let S be a galaxy, S 2 S and let B be a structure such that B j= S . To prove the implication (1) ) (2), assume that S is realized in A by two elements a and b. Let t(x; y) = tpA (a; b). Since A j= S , we have t(x; y) 2 A. Of course, center(S ) t(x; y) and center(S ) t (x; y). Now, we shall prove that (2) ) (1). Let t 2 A be such that center(S ) t(x; y ) and center(S ) t (x; y). Let b 2 B realize S in B. We claim that there exists an extension A of B such that A = B [ fag, where a 62 B and a realizes S . Indeed, A can be obtained from B by putting A = B [ fag, tpA (a; b) = t(x; y ), and tpA (a; c) = tpA (b; c), for every c 2 B . 2 The proposition above motivates the following de nition.
De nition 3.9 A constellation S is replicable if S is connectable to S . Otherwise, the constellation S is special.
Let S be a galaxy, and let A satisfy S . In the universe A of A we can distinguish the set K A consisting of all elements which realize special constellations. Elements of the S set K are called kings. A noble is an element of the set N = a2K fb1; : : :; bk 2 A : k m and ftpA(a); tpA(a; b1); : : :; tpA(a; bk)g 2 Sg. Nobles are those elements of the universe that are necessary for the existence of kings. De ne the court C = K [ N . Note that card(C ) (m + 1)card(K ). There may also be plebeians { elements outside the court; they are not necessary for the kings but perhaps some nobles may need them. Plebeians may also depend on kings to survive. Remark. The notion of a king in a structure has been used in many places. For example, Yu. Gurevich and S. Shelah have used this notion in [20] to show that their proof of the solvability of the Godel class without equality could not be generalized to the case with equality. E. Gradel, Ph. Kolaitis and M. Vardi have also used this notion in [15]. We would like to point out that although in this paper the kings are de ned in terms of constellations, they have the same meaning as in [15].
De nition 3.10 Denote by Sp(S ) the subset of S consisting of all special constellations, and by Rp(S ) the set S n Sp(S ). The following simple observation establishes relations between the notions de ned above.
Proposition 3.11 Let S be a galaxy, and let A realizes S . Then there exist sets K and C such that the following conditions hold. 1. K C A, card(K ) card(Sp(S )) and, card(C ) (m + 1)card(K ). 2. Every element a 2 K realizes a constellation S 2 Sp(S ) in AC . 7
3. Every constellation S 2 Sp(S ) is realized by an element a 2 K in A C . 4. For every S , T 2 Rp(S ), S is connectable to T .
Proof. Immediate.
2
One can easily check that the converse to the above proposition does not hold. For example, let
L = R = fR1; R2g; A = ft1; t1; t2; t2; t3g; s0(x) = R1(x; x) ^ R2(x; x); t0(x) = :R1(x; x) ^ :R2(x; x); t1 = t0(x) ^ R1(x; y) ^ :R2(x; y) ^ R1(y; x) ^ R2(y; x) ^ s0(y); t2 = t0(x) ^ :R1(x; y) ^ R2(x; y) ^ R1(y; x) ^ R2(y; x) ^ s0(y); t3 = t0(x) ^ :R1(x; y) ^ :R2(x; y) ^ :R1 (y; x) ^ :R2(y; x) ^ t0 (y); S = fS; T g; where S = fs0g and T = ft0; t1; t2g: It is easy to see that the constellation S is special and T is replicable. One can check that if we de ne K = fag, C = K , tpA (a) = s0, then conditions (1){(3) of Proposition 3.11 hold and, since T is connectable to T by t3 , condition (4) holds too. Unfortunately, the constellation T can not be realized in any structure, since to realize T we need two elements b1 and b2 such that tpA (b1) = s0 , tpA (b2) = s0 , and tpA (b1; b2) 2 A, which is not possible. Therefore, S is not a galaxy. Now, we shall extend the set of conditions given in Proposition 3.11 to a set of conditions that will imply that a set S of constellations is a galaxy.
De nition 3.12 Let S be a set of constellations. A small representation of S is a system hK; C; I; F; Gi; where K and C are sets, I; F; G are functions such that I : C ! S , F : C C ! A, G : Rp(S ) K ! A, and the following conditions hold. (s1) K C , card(K ) card(Sp(S )), and card(C ) (m + 1)card(K ). (s2) I (K ) = Sp(S), I (C n K ) Rp(S ), F (a; a) = F (a; b)fxg, and for every a = 6 b F (a; b) = F (b; a): (s3) For every a 2 K , and every t 2 I (a) there is an element c 2 C such that t = F (a; c). (s4) For every b 2 C n K , and every t 2 I (b) if there is no c 2 C such that t = F (b; c), then there is a constellation T 2 Rp(S ) such that I (b) is connectable to T by t. (s5) For every S , T 2 Rp(S ), S is connectable to T . (s6) For every S 2 Rp(S ), and every a 2 K , S is connectable to I (a) by G(S; a). (s7) For every S 2 Rp(S ), and every type t(x; y ) 2 S if there is no a 2 K such that G(S; a) = t(x; y), then there is a constellation T 2 Rp(S ) such that S is connectable to T by t.
8
Conditions (s1), (s2) and (s3) say that the set C is a universe of a structure in which all special constellations are realized. In other words, kings are provided with all they need to survive. Condition (s4) ensures that every noble can nd enough plebeians around him. Condition (s5) says that plebeians can live together in one society and, by condition (s6), the society is ruled by kings. Condition (s7) states that plebeians can get what they need { if not from kings, then from somewhere else.
Theorem 3.13 (Small Galaxy Theorem) A set of constellations S is a galaxy if and only if there exists a small representation of S . Proof. ()) Assume that S is a galaxy and A realizes S . Let K be the set of kings in A, and let C be the court in A. For every a 2 C choose a constellation S 2 S which is realized by a, and put I (a) = S . For every a; b 2 C , put F (a; b) = tpA (a; b). For every constellation S 2 Rp(S ) nd an element b 2 A which realizes S , and for every a 2 K put G(S; a) = tpA (b; a). It is easy to check that the system hK; C; I; F; Gi is a small representation of S . (() Let S be a set of constellations, and let hK; C; I; F; Gi be a small representation of S. We shall construct a structure A realizing S such that the universe A of A contains C , every a 2 K realizes I (a) in AC , and tpA (a; b) = F (a; b), for each pair ha; bi of elements of C.
The construction proceeds in steps. The number of step can be in nite. In each step new elements are added to the universe. A new element is added when there is a request to satisfy a constellation, say S . Whenever an element a is added to satisfy S , I is extended by putting I (a) = S . An element a such that I (a) = S is inactivated after adding enough elements to witness that a realizes S . An unordered pair of elements will be reserved, when a type to be realized by this pair has been designated. In every step of the construction the universe of the part of the structure A de ned so far is nite. We also assume that there is a xed linear ordering < of the universe, and each new element added to the universe is greater then all old elements. Let S = fS1; : : :; Sk g.
Stage 1.
1. 2. 3. 4. 5.
Let A = C . For every a; b 2 C , put tpA (a; b) = F (a; b) (cf. (s2)). For every a 2 K , inactivate a. For every a; b 2 C , reserve fa; bg. For every S 2 Rp(S ) such that I (b) 6= S , for each b 2 C , add a new element d to A and put I (d) = S .
Stage 2.
6. Let b be the rst active (i.e yet not inactivated) element of A. Note that I (b) 2 Rp(S ). Indeed, b 62 K , so either b 2 C n K , and so I (b) 2 Rp(S ), by (s2), or b has been added to A in steps 5, 7(a)ii or 9(b), and whenever we add a new element b to the universe we always put I (b) 2 Rp(S ). 7. If b 2 C n K then (a) for every t 2 I (b) if there is no element c 2 C such that t = F (b; c) do i. using (s4) nd T 2 Rp(S ) such that I (b) is connectable to T by t, 9
ii. add a new element d to A; iii. put I (d) = T , and tpA (b; d) = t, reserve fb; dg ; (b) inactivate b and go to 6. 8. Using (s6), for every a 2 K , put tpA (b; a) = G(I (b); a). Note that, b 62 C , so no pair fa; bg, with a 2 K , has been reserved earlier. 9. For every t 2 I (b), if there is no c 2 A such that fc; bg is reserved and tpA (c; b) = t , do (a) by (s7) nd T 2 Rp(S ) such that I (b) is connectable to T by t. Note that, by step 8, there is no element a 2 K such that t = G(I (b); a). (b) add a new element d to A; (c) put I (d) = T , tpA (b; d) = t, and reserve fb; dg; (d) for every a < b, if fa; bg is not reserved then using (s5) nd t 2 A such that I (b) is connectable to I (a) by t, put tpA (b; a) = t and reserve fb; ag. 10. Inactivate b and go to 6. We shall now show that A realizes S . First, let us note that every pair of distinct elements of A realizes in A a two-type of A (see steps 2, 7(a)iii, 8, 9(c), 9(d)). New elements are added at the end of the xed ordering, and in step 6 we always consider the rst active element, therefore every element a 2 A will eventually be inactivated. We claim, that when an element a is inactivated then a realizes a constellation of S in A. In fact an element inactivated in step 3, by (s2) and (s3) of De nition 3.12, realizes a special constellation of S . Before an element b is inactivated in step 7(b), in step 7(a) every type of I (b) has been realized by a pair hb; ai for some a 2 A. Similarly, step 9 ensures that the element inactivated in step 10 realizes its constellation. Finally, by step 5 every constellation of S is realized in A. 2 Now, let us consider the cardinality of the structure constructed by the algorithm described above. If Rp(S ) = ; then only the rst stage of the algorithm is performed and we get a structure with the universe K . We also get a nite structure if no new elements are added in step 7(a)i. In this case I (C ) = S , and the function F is de ned in such a way that no noble element needs a plebeian. In other cases we get an in nite structure. The construction could be modi ed in such a way that it will stop after a bounded number of steps. However, we omit this modi cation, since the construction described above is better suited for generalization to logic with counting.
3.4 Complexity
Corollary 3.14 There is a nondeterministic algorithm with time complexity O(2cn ), for 2
some constant c, which, given an L2 -sentence , decides if is satis able.
Remark. In [36], using more complicated techniques, we gave a similar algorithm with time
complexity O(2cn). Here we provide a simpli ed version only, since it is easier to understand and better explains the methods used in the main part of this paper. Proof. Let be an L2 sentence of length n. In the rst step we use the polynomial time algorithm of Theorem 3.6 to get a sentence in constellation form = 8x8y(x; y ) ^
^ 8x9yR (x; y) i
1im
10
which is satis able if and only if is satis able. Moreover, has at most p = O(n) predicate letters, and has length O(n log n). Then we use Theorem 3.5. We build a set A in time O(2O(p)), and, in time O((24p)m ) = O(2O(n ) ), we guess a set S of small A-R-constellations. Next, we use Theorem 3.12 and we guess sets K and C and functions I , F and G. Since card(K ) 2O(n ), and card(C ) (m + 1)card(K ) we can do this in time O(2O(n ) ). Finally, we accept after checking whether hK; C; I; F; Gi is a small representation of S . This can also be done in time O(2O(n ) ). 2 2
2
2
2
4 Double exponential algorithm
4.1 Constellations, galaxies and satis ability
Let R = fR1; : : :; Rmg L be the set of binary predicate letters.
De nition 4.1 An L-sentence is in constellation form if ^ 8x9=mi yR (x; y); = 8x8y(x; y ) ^ i 1im
where is quanti er-free. is in 9=1 -constellation form if mi = 1 for each i m.
As De nition 3.1, the de nition above may seem too strong, since the second part of the formula seems to suggest that all elements are similar from the point of view of R. However, as before, the fact whether Ri (x; x) holds is used to code those relations Ri for which the counting quanti er does not apply. Let A be a set of 2-types closed under operation . _ ? , where _ ! [A _ [A De nition 4.2 A = A$[A A$ = ft 2 A : there are i; j m such that Ri(x; y) 2 t and Rj (y; x) 2 tg, A = ft 2 A : t 62 A$ and there exists i m such that Ri(y; x) 2 tg, A! = ft 2 A : t 62 A$ and there exists i m such that Ri(x; y) 2 tg, A? = ft 2 A : for every i m; :Ri(x; y) 2 t and :Ri(y; x) 2 tg: In the de nition above A$ , A and A! represent counting types. Since Ri appears in the second part of the formula in constellation form, it follows that Ri(x; y ) 2 t implies that for (a; b) and (a; b0) realizing t we always have b = b0.
De nition 4.3 Let S = fs0; s1; : : :; skg, where k 0, s0 is a 1-type and, if k > 0 then s1; : : :; sk 2 A$ [VA!. De ne center(S ) = 0ik sifxg. The set S is an A-R-constellation if the following conditions hold: 1) center(S ) = s0 , 2) for every Ri 2 R, if Ri(x; x) 62 center(S ) then there is exactly one j , 1 j k, such that Ri (x; y ) 2 sj , 3) for every Ri 2 R, if Ri(x; x) 2 center(S ) then for every j , 1 j k, Ri(x; y ) 62 sj .
11
Notice that the notion of an A-R-constellation depends on xed sets A of 2-types and R of binary predicate symbols. Moreover, the number of two-types in a constellation does not exceed card(R). It does not follow from De nition 4.3 that each constellation contains a counting type. There may be constellations S such that center(S ) = fRi(x; x) : Ri 2 Rg. In fact center(S ) codes the relations in R which are not used in S in the context of counting.
De nition 4.4 Let A be an L-structure. An element a 2 A realizes an A-R-constellation S = fs0; : : :; sk g if tpA(a; a) = s0 , and there exists a unique sequence b1; : : :; bk 2 A that tpA (a; bi) = si , 1 i k, and for every b 2 A, b = 6 a; b =6 bi, 1 i k, we have A ? tp (a; b) 2 A [ A . An A-R-constellation S is realized in A if there exists an element a 2 A which realizes S . For a 2 A, we write CaA to denote the unique A-R-constellation realized by a. De nition 4.5 Let S be a set of A-R-constellations. A structure A realizes S , if every element in A realizes an A-R-constellation and every constellation in S is realized in A. A set S of A-R-constellations is a galaxy if there is a structure A such that card(A) > 1, and A realizes S . The following theorem gives a necessary and sucient condition for satis ability of sentences in 9=1 -constellation form.
Theorem 4.6 Let R = fR1; : : :; Rmg L, and let be an L-sentence in 9=1-constellation form,
= 8x8y(x; y ) ^
^ 8x9=1yR (x; y): i
1im
Put A = ft : t(x; y ) is a 2-type over L and t(x; y ) ! (x; y )g. Then has a model with at least two-elements if and only if there exists a set of A-Rconstellations which is a galaxy.
Proof. ()) Assume that AVj= and card(A) > 1. Since A j= 8x8y(x; y), the set A is closed under . Since A j= 1im 8x9=1 yRi (x; y ), every element of A realizes some A-Rconstellation. Therefore S = fCaA : a 2 Ag is a galaxy. (() Let S be a galaxy and assume that A realizes S . Let a 2 A. By De nition 4.5, a realizes an A-R-constellation S 2 S , S = fs0; : : :; sk g. This implies that tpA (a; a) = s0, and that there exists a sequence b1; : : :; bk of distinct elements of A such that bi = 6 a, for
i = 1; : : :; k, and 1. tpA (a; bi) = si , for i = 1; : : :; k, 2. tpA (a; b) 2 A [ A? A, for each b 2 A; such that b 6= a and b 6= bi, i = 1; : : :; k,. V Therefore by De nition 4.3, the elements b1; : : :; bk witness that the part 1im 9=1 yRi (x; y ) of holds for x = a. Moreover, for every b 2 A; b 6= a, tpA (a; b) 2 A, and so A j= (a; b). Hence, A j= . 2
12
4.2 The Reduction
The following theorem has been shown in [16].
Theorem 4.7 There is a recursive reduction NF from C 2-sentences to C 2-sentences in nor-
mal form over an extended vocabulary, which is sound for satis ability: is satis able if and only if NF() is satis able.
In the above theorem the normal form is slightly weaker than our 9=1 -constellation form. The dierence is that in the 9=1 -constellation form the quanti er free part of the sentences with pre x 89=1 is atomic, whereas in the normal form in then sense of [16] it could be any quanti er free two-variable formula. This additional condition can be easily met by introducing new relation symbols for quanti er free formulas, and adding 88-sentences de ning the newly introduced symbols. From the proof of Theorem 4.7 given in [16] the following corollaries can be derived.
Corollary 4.8 There exists a polynomial time algorithm which, given a C12 sentence over a relational vocabulary, constructs a sentence in 9=1 -constellation form with the following
properties: 1. is satis able if and only if is satis able. 2. Every predicate letter occuring in has arity at most 2. 3. If n is the length of , then contains O(n) dierent predicate letters and has length O(n log n).
The reduction for the full logic C 2 is more expensive.
Corollary 4.9 There exists an exponential time algorithm which, given a C 2 sentence over a relational vocabulary, constructs a sentence in 9=1 -constellation form with the following
properties: 1. is satis able if and only if is satis able. 2. Every predicate letter occuring in has arity at most 2. 3. If n is the length of , then contains O(2n) dierent predicate letters and has length O(2O(n)).
The exponential increase of the length of the sentence given by the algorithm in Corollary 4.9 is caused by the necessity to introduce as many new predicate letters as the maximal integer which appear as an index of a counting quanti er. If integers are represented in binary we have to introduce O(2n) new predicate letters for a sentence of length n. We do not know any better reduction and this is the main reason, why we can not improve the upper complexity bound for the satis ability problem for the full C 2 from double to single exponential.
4.3 The Galaxy Theorem
In this subsection we x R = fR1; : : :; Rmg L, and a set A of 2-types closed under . Henceforth, whenever the sets A and R are xed, we write `a constellation' instead of `an A-R-constellation'. 13
So far we have shown that the satis ability problem for C12 sentences can be transformed to the problem of nding an appropriate galaxy. In this section we shall formulate syntactic conditions which are necessary and sucient for a set of constellations to form a galaxy, but before doing that, in order to acquaint the reader with our basic technic and to provide a better background for the proof of the main result of this section, we shall state and prove some basic properties of constellations. At the beginning we introduce a syntactic notion of connectability of two constellations. This de nition says that two constellations are connectable by a 2-type t if t is a connective type for them, that is t contains the centers of both constellations and either t is non-counting, or t and t are distributed between these two constellations. In other words, this notion provides a necessary condition for two constellations to be realizable in the same structure. The notion of connectability, together with the notions of constellation and galaxy, plays a crucial role in this section and is basic in the whole paper. An easy observation (Proposition 4.14) shows that in a speci c situation this notion suces to formulate very simple conditions that allows to solve the satis ability problem. This "speci c" situation can be described in both semantic and syntactic terms: there is a structure in which every constellation is realized in nitely many times, or every two constellations are connectable by a non-counting type. Intuitively it means that there are no privileged elements in the structure. Next, we consider the case when there are some privileged elements in a model. We prove that if a constellation S is realized in a structure suciently often then we can build a structure in which S appears in nitely many times (Lemma 4.15). Constellations that can be realized in nitely often are easy to deal with, in contrast with those that always appear only nitely many times. Lemma 4.16 plays a crucial role in the proof of the main result of this section | the Galaxy Theorem. It says that every galaxy can be partitioned into two sets: constellations which can be realized by at most r elements and constellations which can be realized by in nitely many elements. The integer r is bounded by an exponential function of the number of constellations in a given galaxy. To prove this lemma, for a structure A realizing the given galaxy, we de ne a sequence of sets V1 V2 : : : Vp?1 of subsets of A. The set V1 consists of lords, that is of elements of A which realize constellations appearing in A very rarely { less than 2m+1 times. Every set Vi+1, for i > 1, besides members of Vi , contains elements that are vassals of elements of Vi. They realize constellations appearing in A not very often with respect to the cardinality of the set Vi of sovereigns of the elements of Vi+1. In this way we obtain a nite hierarchy of elements of A and so, a hierarchy of elements of the galaxy | constellations realized by elements of appropriate Vi . This hierarchy does not necessarily include all constellations. All the results mentioned above give several necessary conditions for a set of constellations to be a galaxy. As the next step we introduce the notion of a nite representation of a set of constellations (De nition 4.17), and we prove the Galaxy Theorem (Theorem 4.18) which says that the problem whether a set of constellations S is a galaxy can be reduced to the problem whether there exists a nite representation of S . Since the components of a nite representation are either nite sets of bounded cardinality or functions from such sets into some xed nite sets, and since the conditions on the components are easily1 computable, the Galaxy Theorem forms a basis for a decision procedure for the satis ability problem for C12 (Corollary 4.20 in 4.4). 1
In this section "easily" means in double exponential time.
14
We begin the technical part of this section with some additional de nitions.
De nition 4.10 Let S; T be constellations, and let t(x; y) 2 A. S is connectable to T by t(x; y) if center(S ) t(x; y), center(T ) t (x; y) and, 1. t 2 S and t 2 T if t 2 A$ , 2. t 2 S if t 2 A! , 3. t 2 T if t 2 A . De nition 4.11 Let S be a galaxy, and assume that A realizes S . De ne a function rankA : S ! N [ f1g putting rankA(S ) = card(fa 2 A : CaA = S g). We write rank(S ) = 1 if there is a structure B realizing S such that minS 2S (rankB (S )) > 2m + 1.
Lemma 4.12 Assume that A is a structure which realizes S . Let S; T 2 S . If rankA(S ) > 2m + 1, and rankA (T ) > 2m + 1, then there exist a; b 2 A such that CaA = S , CbA = T , and tpA (a; b) 2 A? . Proof. Let X = fa 2 A : CaA = S g, Y = fa 2 A : CaA = T g, and assume that card(X ) card(Y ) > 2m + 1.
By De nition 4.4, for every a 2 X (a 2 Y ) there is at most m distinct elements b such that tpA (a; b) 2 S (tpA (a; b) 2 T , respectively). So, the number of pairs ha; bi such that a 2 X , b 2 Y and tpA (a; b) 2 S or tpA (b; a) 2 T does not exceed m card(X )+ m card(Y ) 2m card(X ). On the other hand, the number of pairs ha; bi such that a 2 X and b 2 Y is card(X ) card(Y ) > (2m + 1)card(X ). 2
Corollary 4.13 Let S be a galaxy with rank(S ) = 1. Then there exists a structure B realizing S such that rankB (S ) = 1, for each S 2 S . Proof. Assume that A realizes S , S 2 S , and rankA(S ) = n. We claim that there is an extension B of A, such that B realizes S , and rankB (S ) > n. By Lemma 4.12, for all constellations S; T 2 S , there exists a type t(x; y ) 2 A? such that S is connectable to T by t(x; y). Let A0 be a structure isomorphic to A such that A \ A0 = ;. De ne B = A [ A0 , and let B A = A, B A0 = A0. Now, for every a 2 A, and every a0 2 A0 nd t(x; y ) 2 A? such 0 A A 2 that Ca is connectable to Ca0 by t(x; y ), and put tpB (a; a0) = t(x; y ). Proposition 4.14 The following conditions are equivalent: 1. rank(S ) = 1 2. (a) for every S 2 S , and every s(x; y ) 2 S , there exists T 2 S such that S is connectable to T by s(x; y ), (b) for every S; T 2 S , S is connectable to T by some t(x; y ) 2 A? :
Proof. (1) ) (2). Condition (a) follows from De nition 4.5 and condition (b) { from Lemma 4.12. (2) ) (1). We shall give an algorithm which constructs a structure A realizing S . In the process of construction new elements will be added to the universe, some elements of the universe will be inactivated and some unordered pairs of elements will be reserved. An 15
element a will be inactivated when the constellation S that had been earlier assigned to a has been built, i.e. when elements which witness that a realizes S have been added. An unordered pair fa; bg will be reserved, when the type realized by fa; bg has been de ned. Moreover, a function I : A 7! S will be de ned in such a way that I (a) = CaA, for every a 2 A. In every step of the construction the part of the model de ned so far A will be nite. We assume that a linear ordering < of the universe is given such that a new element added to the universe is always greater then the old elements. Let S = fS1; : : :; Sk g. 1. Let A = fa1; : : :; akg. Put I (ai) = Si , i = 1; : : :; k. 2. Let a 2 A be the rst active (not yet inactivated) element. 3. For every ti 2 I (a), if there is no element b 2 A such that fa; bg is reserved, and tpA (a; b) = ti , then (a) add a new element bi to A, (b) put tpA (a; bi) = ti , (c) nd a constellation T 2 S such that S is connectable to T by ti , (d) put I (bi) = T , and reserve fa; big. 4. For every c < a put tpA (a; c) = t 2 A? such that I (a) is connectable to I (c) by t. 5. Inactivate a. 6. Go to 2. If minS 2S (rankA(S )) 2m + 1, perform the operations from the proof of Corollary 4.13. 2
Lemma 4.15 Assume that A realizes S . Let V be a nite subset of A and let S 0 = fCaA : a 2 A n V g. If S 0 \ fCaA : a 2 V g = ;, and for every a 2 A n V , rankA (CaA) > max(card(V ) m; 2m +1), then there is a structure B realizing S , such that for every S 2 S 0 rankB (S ) = 1, and rankB (S ) = rankA(S ), for every S 2 S n S 0. Proof. Let A realize S . An iterative application of the following algorithm applied to every S 2 S 0 yields a structure B such that rankB (S ) = 1, for every S 2 S 0, and rankB (S ) = rankA (S ), for every S 2 S n S 0 (inactivation, reserving elements and the function I play the same role as in the proof of Proposition 4.14). At the beginning, put A'=A. 1. Let A00 = A0 [ fxg. 2. For every a 2 A0 put I (a) = CaA' , and inactivate a. 3. Put I (x) = S . 4. Let x be the rst active element of A00. 5. Find a 2 A n V such that CaA = I (x), and tpA (a; b) 2 A? [ A! , for every b 2 V . Such an element a exists, since there are at most m card(V ) elements c 2 A n V such that tpA (c; b) 2 A$ [ A . 6. For every ti 2 S (a) if there is b 2 V such that tpA (a; b) = ti then put tpA (x; b) = ti , and reserve fx; bg else 16
(b) if there is no element d 2 A00 such that fx; dg is reserved and tpA'' (x; d) = ti , then add a new element bi to A00, put tpA (x; bi) = ti , reserve fx; big, nd ai 2 A n V such that tpA (a; ai) = ti , and put I (bi) = I (ai). An element ai can be found since CaA = S and therefore there is an element ci 2 A such that tpA (a; ci) = ti . Since ci 2 A n V , and A realizes S we have I (ci) = CcAi 2 S 0.) 7. For every c < x, if fc; xg is not reserved, put tpA'' (x; c) = t 2 A? such that I (x) is connectable to I (c) in A by t, and reserve fx; cg. (By Lemma 4.12, for every S; T 2 S 0, S is connectable to T in A by some t 2 A? .) 8. Inactivate x. 9. Go to 4. One application of the above algorithm to the constellation S 2 S 0 and the structure A0 expands the structure A0 to a structure A00 such that rankA00 (S ) > rankA0 (S ). 00 A (x; b) are de ned, where b 2 V , the constellation realized In step 6, when the types tp 00 A by b does not change, since tp (x; b) 2 A! . Also in step 7, the constellations realized by the elements c < x are not changed since only types in A? are used. Every x 2 A00 is eventually inactivated since new elements bi are added at the end of the ordering. When00 an element x is inactivated it is ensured that for every c < x, tpA00 (c; x) is de ned, and CxA 2 S . 2
Lemma 4.16 Let S be a galaxy. There is a constant r, r = O(m card(S ))card(S), and there exists a structure B realizing S such that rankB (S ) < r or rankB (S ) = 1, for every S 2 S . Proof. Let A realize S . It suces to de ne V A of appropriate cardinality which satis es
the conditions of Lemma 4.15. The set V will be constructed in stages. Stage 1. Let V1 = fa 2 A : rankA(CaA) 2m + 1g. Note that if V1 = ; then by Corollary 4.13, there is a structure B such that for every S 2 S , rankB (S ) = 1. In this case only stages 1 and 2 are performed. Stage i. (i > 1) 1. If rankA (CaA) > card(Vi?1) m, for every a 2 A n Vi?1, then put Vi = Vi?1 and stop. 2. Put Vi = Vi?1 [ fa 2 A n Vi?1 : rankA (CaA) card(Vi?1) mg: 3. Go to Stage i + 1. Note that there is a stage i such that Vi = Vi?1. Indeed, for every stage i, let C (Vi) = fS 2 S : there is a 2 Vi such that CaA = S g. Hence, for every i > 1, if Vi 6= Vi?1 then C (Vi) C (Vi?1). So, since S is nite, the number p of stages performed is less or equal card(S ). Put V = Vp . Now, we estimate card(V ). We have card(V1) (2m + 1) card(S ); and, for i > 1, card(Vi) card(Vi?1) + m card(Vi?1) (1 + m card(S )): If we put q = 1 + m card(S ), then we have card(V1) 3q p : Moreover, for every a 2 V , rankA (CaA) card(V ), and for every a 2 A n V; rankA(CaA) > card(V ) m. Put r = 3 (1 + m card(S ))card(S). This by Lemma 4.15, nishes the proof. 2 Now, we are ready to introduce the main de nition of this section. 17
De nition 4.17 Let S be a set of constellations. A nite representation of S is a system hS1; V; C; I; F; Gi; where S1 is a set of constellations , V and C are sets, I; F; G are functions such that I : C 7! S ; F : C C ! A; G : (S n S1) V ! A;
and the following conditions hold (f1) S1 S , V C , and card(C ) m (2m card(S ))card(S ), (f2) I (V ) = S1, I (C n V ) S n S1, F (a; a) = F (a; b)fxg, and for every a 6= b, F (a; b) = F (b; a), G : (S n S1) V ! A! [ A? , (f3) For every b 2 C de ne D(b) = fF (b; c) : c 2 C; c 6= b; F (b; c) 2 A! [ A$ g. Then (a) for every b 2 C , and every t 2 D(b) there is exactly one c 2 C; c 6= b such that F (b; c) = t, (b) D(a) = I (a), for every a 2 V , (c) for every b 2 C n V we have D(b) I (b), and for every t 2 I (b) n D(b) there is T 2 S n S1 such that I (b) is connectable to T by t, (f4) for every S; T 2 S n S1, S is connectable to T by some t 2 A? , (f5) for every S 2 S n S1 we have fG(S; a) 2 A! : a 2 V g S , and for every a 2 V , S is connectable to I (a) by G(S; a) (f6) for every S 2 S n S1, and every t 2 S , if t 2 A! and there is no T 2 S n S1 such that S is connectable to T by t then there is a unique a 2 V such that G(S; a) = t, (f7) for every S 2 S n S1, and every t 2 S , if there is no a 2 V such that G(S; a) = t then there is T 2 S n S1 such that S is connectable to T by t. We say that S is nitely representable, if there is a nite representation of S .
Let us note that the notion of a nite representation is almost identical with the notion of small representation (De nition 3.12). The role of replicable small constellations is taken here by constellations in S n S1 .
Theorem 4.18 (Galaxy Theorem) A set of constellations S is a galaxy if and only if S is nitely representable.
Proof. ()) Let S be a galaxy. Use Lemma 4.16 to get a structure A and a constant r such that A realizes S , and for every S 2 S , rankA (S ) < r or rankA (S ) = 1. Put S1 = fS 2 S : rankA(S ) < rg, V = fa 2 A : rankA(CaA) < rg, C = V [ fa 2 A : there is b 2 V such that tpA (b; a) 2 A! [ A$g: Note that if S 2 S n S1 then rankA(S ) = 1. For every a 2 V , put I (a) = CaA. For every a; b 2 C; a = 6 b, put F (a; b) = tpA(a; b). For every S 2 S nS1 nd a 2 A n C such that CaA = S , and for every c 2 V put G(S; c) = tpA (a; c). It is easy to check that conditions (f1)-(f7) of De nition 4.17 hold. (() Let hS1; V; C; I; F; Gi be a nite representation of S . 18
Case 1. S1 = ;. By condition (f2), V = ;. Consequently conditions (f7) and (f4) are
equivalent to conditions (a) and (b) of Proposition 4.14. Case 2. S1 = S . By condition (f2), V = C . Therefore, by conditions (f1)-(f3), we can de ne V realizing S with universe V in which tpV (a; b) = F (a; b), for every a; b 2 V . Case 3. S1 6= ; and S1 6= S . We shall construct a structure A realizing S with the universe A (A C ). In our in nite construction, inactivation and reservation have the same role as in the previous algorithms. Additionally, function I will be extended to all elements of A in such a way that for every b 2 A, I (b) = CbA. In each step of construction the universe of partially de ned model A will be nite, and we assume that there is a xed linear ordering on the universe such that any new element added to the universe is greater then the old ones.
Stage 1. 1. 2. 3. 4. 5.
Let A = C . For every a; b 2 C , put tpA (a; b) = F (a; b) (cf. (f2)). For every a 2 V , inactivate a. For every a; b 2 C , reserve fa; bg. For every S 2 SnS1, if there is no b 2 C such that I (b) = S , then add a new element d to A and put I (d) = S .
Stage 2.
6. Let b be the rst active element of A (note that I (b) 2 S n S1). 7. If b 2 C then (a) for every t 2 I (b) n D(b) do i. nd T 2 S n S1 such that I (b) is connectable to T by t (use (f3-c)), ii. add a new element d to A and put I (d) = T , iii. put tpA (b; d) = t and reserve fb; dg, (b) inactivate b and go to 6. 8. For every a 2 V , put tpA (b; a) = G(I (b); a) (use (f5) and (f6)). 9. For every t 2 I (b), if there is no c 2 A such that fc; bg is reserved, and tpA (c; b) = t then (a) nd T 2 S n S1 which is connectable to I (b) by t (use (f7)), (b) add a new element d to A, and put I (d) = T , (c) put tpA (b; d) = t, and reserve fb; dg. 10. For every a < b, if fa; bg is not reserved then using (f4)) nd t 2 A? such that I (b) is connectable to I (a) by t, put tpA (b; a) = t and reserve fb; ag. 11. Inactivate b and go to 6. After performing stage 1, every a 2 V realizes the constellation I (a) 2 S in the partially de ned structure A, by f(2) every constellation S 2 S1 is realized by some a 2 V , and only elements of V have been inactivated. Moreover, for every S 2 S , there is b 2 A such that I (b) = S . The role of stage 2 is to realize all constellations of S n S1 by elements of A. Step 7 is executed if, at stage 1, some types between the chosen b and the other elements of A were de ned using function F . For every type of I (b) that has not been de ned, a new element d is added to A, and some T 2 S n S1 is put as I (d). So, only constellations of S n S1 have to 19
be realized in the next steps. In step 10, when the types between an element b and smaller, already inactivated, elements are de ned, the constellation realized by the earlier elements are not changed because only types in A? are used. Every b 2 A is eventually inactivated since new elements are added at the end of the ordering. When an element b is inactivated it is ensured that CbA 2 S . 2
Corollary 4.19 If hS1; V; C; I; F; Gi is a nite representation of S then there exists a structure A realizing S , such that A = C [ B , for every a 2 B , rankA(CbA ) = 1, and conditions (f1)-(f7) hold. Proof. (Sketch) Take A given by part (() of the proof of Theorem 4.18.
2
4.4 Complexity
In this subsection, using the Galaxy Theorem proved in the previous subsection, we provide an algorithm solving the satis ability problem for C12 . This algorithm works in nondeterministic, double exponential time. In the next section, using more sophisticated techniques, we will show that this bound can be improved.
Corollary 4.20 SAT(C12) 2 2-NEXPTIME. Proof. We describe a nondeterministic algorithm which for every sentence 2 C12 decides if
is satis able, and works in time doubly exponential with respect to the length of . Let be a C12-sentence of length n. In the rst step we use the polynomial time algorithm from Corollary 4.8 to obtain a sentence in 9=1 -constellation form = 8x8y(x; y ) ^
^ 8x9=1 yR (x; y) i
1im
which is satis able if and only if is satis able. Moreover has at most p = O(n) predicate letters, and has length O(n log n). Then we use Theorem 4.6. We build the set A in time O(24p), and we guess a set S of A-R-constellations. Note that card(A) 24p, and card(S ) (24p)m, where m = card(R) is the number of existential quanti ers in . Therefore S can be guessed in time (24p)m m 4p = O(2O(n ) ). Next, we apply Theorem 4.18 and guess sets S1, V , and C , as well as functions I , F , and G as in De nition 4.17. Since S1 S , and card(V ) card(C ) m (2m card(S ))card(S) we can guess the components in time: S1 | O(card(S )) = O(2O(n )), V and C | O(m(2m card(S ))card(S)) = O(22O n ), I; F | O((card(C )2) = O(22O n ), G | O(card(S n S1) card(V )) = O(22O n ). So, the time required for this step is bounded by O(22cn ), for some constant c. Finally, we check whether the system hS ; S1; V; C; I; F; Gi is a nite representation of S . 2 It is easy to see that this can also be done in time O(22cn ). 2
2
( 2)
( 2)
( 2) 2
2
20
4.5 An example
It is well-known that the class C12 admits axioms of in nity, i.e. there are satis able sentences of C12 that have only in nite models. Using the notion of a nite representation, in the proof of Corollary 4.20 we have described an algorithm solving the satis ability problem for sentences in constellation form, which did not depend on constructing a complete model. The size of the nite representation hS1; V; C; I; F; Gi of a set of constellations S depends mainly on the cardinality of the set C . It is bounded in De nition 4.17 by a number that is exponential with respect to the number of constellations in S and double exponential with respect to the number of predicate letters in the signature. Below we give an example of a sentence in C12 which has nite models, and is such that for every nite representation hS1; V; C; I; F; Gi of the set of constellations realized in a model of , the cardinality of C is doubly exponential. In this example, following the idea of H. Lewis's proof [27] that NEXPTIME is reducible to the monadic Godel class, we use a consize representation of the successor relation between encodings of natural numbers that is reminiscent to that used by N. Jones and A. Selman in [23]. Let n be a positive integer. Let L = fB1 ; : : :; Bn; C0; C1; : : :; Cn, Root, Leaf , Left, Right, In, Rg, where Bi , Ci , Root, Leaf are monadic predicate letters and Left, Right, In , R are binary predicate letters. The sentence will describe the unique model (up to isomorphism) that is a full binary tree of height 2n ? 1. The sentence is a conjunction of the following sentences. 8x9=1y R(x; y); 8x9=1y Left (x; y); 8x9=1y Right(x; y); 8x9=1y In (x; y); 8x8y Root(x) ^ Root(y) ! x = y; 8x8y R(x; y) ! Root(y); 8x8y :[Left (x; y) ^ Right(x; y)] _ Leaf (x); 8x Leaf (x) ! [Left (x; x) ^ Right(x; x)]; 8x8y In(x; y) ! [:Leaf (y) ^ (Left (y; x) _ Right(y; x)) _Root(x)V^ Root(y)]; 8x Root(x) $ V 0i 0g, where v < card(Si) and fs1 ; : : :; sp g = Sii14m. Let lab0 be the rnkii0 -labeling of C 0 given by (iii) andP De nition 5.17. Let Cii be a set of cardinality Sif 2Xii rnk(Sif ), and let lab be a rnkii-labeling of Cii. We shall build a structure Cii with the universe Cii such that, for every a 2 Cii, a realizes lab(a)fSig in Cii . The structure Cii will be built in several steps. First we de ne an embedding h of C0 into Cii as follows. 1?1 0 0 Let h : C 0 ?! into C0 ii, be such that for every a 2 C , lab (a) = lab(h(a0)). For every a; b 2 h(C 0 ), such that tpC (h?1(a); h?1(b)) 2 A$ [ A! , de ne tpCii (a; b) = tpC (h?1 (a); h?1(b)). Now, it remains to de ne, for each type sl 2 fsp+1 ; : : :sv g, the set of pairs of elements of Cii which realize sl . To do this we shall use the graph-theoretical Lemmas 6.2 and 6.3 given in Appendix. We proceed by induction. Assume that, for some l p, the sets of pairs satisfying types s1 ; : : :; sl?1 have been de ned. We shall now de ne set of pairs satisfying sl . Case 1. sl 2 A$ . Let X; Y Cii be de ned as follows X = fa 2 Cii : sl 2 lab(a)fSigg, Y = fa 2 Cii : sl 2 lab(a)fSigg. Observe that sl can be realized only by pairs ha; bi such that a 2 X , and b 2 Y . Also, if sl = sj , for some j < l, then the type sl has been considered. By condition (i), card(X ) = card(Y ), and if sl = sl then card(X ) is even. Moreover, since card(X ) = uii(sl ), we have card(X ) > 14m. Let G = (X [ Y; E ), be the graph such that E = ffa; bg : either ha; bi or hb; ai realizes a type sj , j < lg. Then, d(G) < l m. Let G = (X [ Y; E ) be the graph complement of G, and let n = card(X [ Y ). We have d(G) > n ? l + 1 n ? m. Note that if E (a; b) then the type of ha; bi has not been speci ed so far. Case 1a. sl = sl . By the de nition of X and Y , we have X = Y . By Lemma 6.2, there exists a Hamiltonian cycle = [a1; : : :; an] in G, and by (i) n is even. For each odd j such that 1 j n, put tpCii (aj ; aj+1) = sl . 31
Case 1b. sl 2 A$ , and sl 6= sl . Let X 0 = X n Y , Y 0 = Y n X , Z = X \ Y , n0 = card(X 0) = card(Y 0 ), and nZ = card(Z ). We consider 2 subcases. Subcase 1ba. card(Z ) 2m.
Let GX = (Z; X 0; EX ), where EX = ffa; bg 2 E : a 2 Z; b 2 X 0g. Then GX is a bipartite graph such that for every A Z , card(?GX (A)) > n0 ? l + 1 > 3m > card(A). So, by Lemma 6.1, there is a matching EX0 of Z onto XZ X 0. For every a 2 XZ , b 2 Z such that fa; bg 2 EX0 , put tpCii (a; b) = sl . Similarly, there exists a matching EY0 from Z onto YZ Y 0 in the graph GY de ned in the same way as GX . For every a 2 Z , b 2 YZ such that fa; bg 2 EY0 , put tpCii (a; b) = sl .
X
XZ
EX0
Z
EY0
YZ
Y
Y0
X0 E1
Figure 2: Case 1b, card(Z ) 2m. Finally, let G0 = (X 0 n XZ ; Y 0 n YZ ; E 0) be the bipartite graph such that E 0 = ffa; bg 2 E : a 2 X 0 n XZ ; b 2 Y 0 n YZ g. Put n00 = card(X 0 n XZ ) = card(Y 0 n YZ ). Then, n00 > 2m and d(G0) > n00 ? l + 1 > n00 ? m. By Lemma 6.3, there exists a matching E1 from X 0 n XZ onto Y 0 n YZ . For every a 2 X 0 n XZ , b 2 Y 0 n YZ such that fa; bg 2 E1, put tpCii (a; b) = sl . Subcase 1bb. card(X 0) 2m. We have X [ Y = X 0[_ Z [_ Y 0 and d(G) n ? l + 1 > n ? m. By Lemma 6.4, there exists a set Z 0 Z such that X 0 and Y 0 can be matched onto Z 0. Let EX 0 be the matching of X 0 onto Z 0 , and let EY 0 be the matching of Y 0 onto Z 0 . For every a 2 X 0, b 2 Z 0 such that fa; bg 2 EX 0 , put tpCii (a; b) = sl . For every b 2 Z 0 , c 2 Y 0 such that fb; cg 2 EY 0 , put tpCii (b; c) = sl .
32
X X0
Y
Z0 EX0
EY0
Y0
Figure 2: Case 1b, card(X 0) 2m. Finally, let G0 = (Z n Z 0 ; E 0), where E 0 = ffa; bg Z n Z 0 : fa; bg 2 E g. Put n00 = card(Z n Z 0 ). Then, n00 > 2m, and d(G0) n00 ? l + 1 > n ? m. By Lemma 6.2, there exists a Hamiltonian cycle = [a1; : : :; an00 ] in G0. For every j such that 1 j < n00, put tpCii (aj ; aj+1) = sl , and put tpCii (an00 ; a1) = sl . Case 2. sl 2 A! . Let X = fa 2 Cii : sl 2 Sif fSig; where f is a function such that lab(a) = Sif g. Let G = (Cii; E ), where E = ffa; bg : either ha; bi or hb; ai realizes sj , for some j < lg. Then, d(G) < l m. Let G = (Cii; E ) be the graph complement of G , and let n = card(Cii). We have d(G) > n ? l + 1 > n ? m, so by Lemma 6.2, there exists a Hamiltonian cycle = [a1; : : :; an] in G. For every j such that 1 j < n and aj 2 X , put tpCii (aj ; aj+1) = sl , and put tpCii (an; a1) = sl . Notice that by condition (ii), there exists a type t 2 A? such that Si is connectable to Si by t. So to nish the proof, it suces to de ne tpCii (a; b) = t, for any a; b 2 Cii, such that tpCii (a; b) has not been de ned yet. 2
Lemma 5.19 Let Si; Sj 2 T , i 6= j , and assume that ci; cj > 3m. ij There is a structure Cij such that Cij j=rnk Xij fSi; Sj g if and only if rnkjj ii (i) there are structures Cii , Cjj such that Cii j=rnk Xii fSi g, and Cjj j=Xjj fSj g, (ii) uij (s) = uji (s ), for each s 2 Si \A$ , and uqji(s) = uij (s ), for each s 2 Sj \A$ , (iii) there exists a structure C0 such that C0 j=Srnk q ij q fSi; Sj g, where q = 2m, ij ;Xij (iv) Si is connectable to Sj by some t 2 A? . Proof. ()) This part of the proof is obvious. (() Assume that (i)-(iv) hold. Let fs1 ; : : :; sv g = fs 2 Si \ A$ : uij > 0g [ fs 2 (Si [ Sj ) \ A! : uij (s) > 0g, where v < card(Si [ Sj ). Assume that Sij2m = fs1 ; : : :; sp g, and fsr+1 ; : : :; svg = fs 2 (Si [ Sj ) \ A! : uij (s) > 2mg. Let Cii and Cjj be such that (i) holds, and assume that Cii and Cjj are disjoint. Let
Cij = Cii [ Cjj . For every a; b 2 Cii, put tpCij (a; b) = tpCii (a; b), and for every a; b 2 Cjj , put tpCij (a; b) = tpCjj (a; b). Let labii be the rnkii-labeling of Cii, and labjj be the rnkjj -labeling of Cjj as in De nition 5.9. To de ne the rnkij -labeling labij of Cij , we put labij = labii [ labjj. Now, for a 2 Cii and b 2 Cjj , we shall assign a type to ha; bi, in such a way that for every a 2 Cii, a realizes in Cij Cjj [ fag the sub-constellation labij(a)fSj g, and for every b 2 Cjj , b realizes in Cij Cii [ fbg the sub-constellation lab(b)ijfSig. 33
As in the proof of Lemma 5.18, the construction proceeds in steps. First, we embed the structure C0 given by (iii) into Cij , and then we consider types sl 2 fsp+1 ; : : :; sv g. De ne X = fa 2 Cii : sl 2 lab(a)fSj gg, Y = fa 2 Cjj : sl 2 lab(a)fSi gg. Now, we deal with types in A$ . Let sl 2 A$ . By (ii) card(X ) = card(Y ). Moreover, by the de nition of uij , for every s 2 A$ , s 2 Si if and only if s 2 Sj . Since card(X ) = uij (sl ) > 2m, we can proceed as in Case 1b of the proof of Lemma 5.18 with Z = ;. Finally assume that we have already dealt with the types s1 ; : : :; sr , and we want to realize types in sr+1 ; : : :; sv . Let E = ffa; bg : a 2 Cii; b 2 Cjj and ha; bi realizes sj , j rg, and G = (Cii; Cjj ; E ) be a bipartite graph. For every a 2 Cii, let d0(a) = card(lab(a)fSj g). Now, by Lemma 6.5 G can be expanded to a bipartite graph G0 = (Cii; Cjj; E 0) such that E E 0, (a) for every a 2 Cii, dG0 (a) = d0(a) and (b) for every b 2 Cjj , dG0 (b) ci ? m: By (a), for every a 2 Cii, we can nd card(lab(a)fSj g \ A! ) elements b 2 Cjj such that ha; bi 2 E 0 n E , and assign types in lab(a)fSj g\A! to pairs ha; bi. On the other hand, by (b), for every b 2 Cjj , we can nd card(lab(b)fSig \ A! ) elements a 2 Cii such that ha; bi 62 E 0 to realize the types of lab(b)fSig \ A! . 2 Let X u (s) + X u (s): u= ij ji s2A$ [A
s2A!
The integer u is the number of pairs of elements of Cij which realize counting types
Lemma 5.20 Let Si; Sj 2 T , i 6= j , and assume that ci > 3m and cj 3m. ij There is a structure Cij such that Cij j=rnk Xij fSi; Sj g if and only if rnkjj ii (i) there are structures Cii , Cjj such that Cii j=rnk Xii fSi g, and Cjj j=Xjj fSj g, (ii) for every s 2 Si \A$ , uij (s) = uji (s ), and for every s 2 Sj \A$ , uji(s) = uij (s ) (iii) there exists a structure D with the domain D = D1[_ D2, and there exists a rnk0 -indexing hX 0 ; rnk0i of fSi; Sj g such that card(D1) 3m2, card(D1) ci , card(D2) = cj , X 0 Xij , for every Sjf 2 Xij , Sjf 2 X 0, for every Sjf 2 X 0 , rnk0 (Sjf ) = rnkij (Sjf ), for every Sif 2 X 0, rnk0 (Sif ) rnkij (Sif ) and 0 D j=rnk X 0 fSi ; Sj g; (iv) for every Sif 2 Xij , card((Sif fSj g) n fcenter(Si )g) cj , (v) if u < ci cj then Si is connectable to Sj by some t 2 A? .
Proof. ()) This direction is obvious. (() Assume that (i)-(v) hold. Assume the structures Cii and Cjj given by (i) have disjoint universes. Put Cij = Cii [ Cjj , for every a; b 2 Cii, put tpCij (a; b) = tpCii (a; b), and for every a; b 2 Cjj , put tpCij (a; b) = tpCjj (a; b). Let labii be the rnkii-labeling of Cii, and labjj be the
rnkjj -labeling of Cjj as in the de nition 5.9. De ne the rnkij -labeling labij of the set Cij by putting labij = labii [ labjj . Now, by (iii), de ne an embedding h of D into Cij as follows. 34
1?1 0 Let h : D ?! into Cij , be a mapping such that for every a 2 D, lab (a) = lab(h(a)). For D ? C every a; b 2 h(D) such that a 2 Cii and b 2 Cjj put tp ij (a; b) = tp (h 1 (a); h?1(b)). Observe that by De nition 5.17, for every a 2 Cjj [ h(D1), CaCij h(D) = lab(a)fSi; Sj g. Moreover, by (ii) and (iii), for every indexed constellation Sif 2 Xij , if there is a type s 2 Si \ A$ such that f (s) = Sj , then rnk0 (Sif ) = rnk(Sif ). It follows that if a 2 Cii n h(D) then s 62 A$ , for each s 2 lab(a)fSj g. By (iv), for every a 2 Cii n h(D), for every s 2 lab(a)fSj g), nd b 2 Cjj such that tpCij (a; b) has not been de ned, and put tpCij (a; b) = s. To nish the proof of Lemma 5.20, for every a 2 Cii, for every b 2 Cjj , if tpCij (a; b) has not been de ned then put tpCij (a; b) = t, where t 2 A? and Si is connectable to Sj by t (cf. (v)). 2
Corollary 5.21 (c5) can be checked in exponential time. Proof. By Decomposition Theorem (Lemma 5.15), it suces to check whether, for every Si ; Sj 2 S1 [ S2, ij (*) there exists Cij such that Cij j=rnk Xij fSi ; Sj g. In the case i = j , if ci 2m , (*) can be checked by guessing the structure Cii of cardinality m n ii ci , and then verifying if Cii j=rnk Xii fSi; Sig. This will take no more than O(2 ) = O(2 ) 2
2
steps. If card(Cii) > 2m , then by Lemma 5.18, it suces to verify conditions (i)-(iii). This can be done in time O(2dn ), for some constant d. In the case i = j , if ci ; cj 3m, it suces to guess a structure Cij of cardinality ci + cj ij and verify if Cij j=rnk Xij fSi ; Sj g. This can be done in time polynomial with respect to m. To check whether (*) holds for ci > 3m, it suces to verify conditions (i)-(iv) of Lemma 5.19 or conditions (i)-(v) of Lemma 5.20. This also can be done in time O(2dn ), for some constant d. In each of the cases above, checking whether (*) holds can be done in time O(2dn ), so it takes at most O((2dn )2) = O(2cn ) steps to verify that (*) holds for every i; j . This nished the proof and completes the proof of Theorem 5.1. 2 3
6
3
3
3
3
6 Appendix We assume that the reader is familiar with the basic notions of graph theory. We use standard notation of graph theory (see e.g. [4]). In this paper a graph G = (X; E ) is a nite set X of nodes and a set E of edges, which are unordered pairs of nodes. For x 2 X we denote by ?GS(x) the set of neighbors of x, i.e. the set fy : fx; y g 2 E g, and, for A X , we put ?G (A) = a2A ?G (a). The degree of a node x, denoted by dG (x), is the number of neighbors of x. By d(G) we denote the minimal value of dG (x). Given a graph G = (X; E ), a matching is de ned as a set E0 E such that, for each pair fu; v g; fu0; v 0g 2 E0 of edges, we have fu; v g \ fu0; v 0g = ;. A graph is bipartite if its nodes can be partitioned into two sets X1 ; X2 such that no two nodes in the same set are adjacent, such a bipartite graph is often denoted as G = (X1; X2; E ). Given a bipartite graph G = (X; Y; E ) and we say that X is matched into Y if there is a matching E0 E such that for every x 2 X there exists y 2 Y such that fx; y g 2 E0. Let m be a xed nonnegative integer. The proof of the main result of this paper (Theorem 5.1) heavily depends on the following lemmas. 35
Lemma 6.1 (Konig-Hall Theorem [21], cf. [4], p. 134) In a bipartite graph G = (X; Y; E ), X can be matched into Y if and only if card(?G(A)) card(A); for every A X: Lemma 6.2 Let G be a graph with n nodes and with d(G) n ? m. If n > 2m then G has a Hamiltonian cycle.
Proof. This is an easy consequence of the theorem by J.A. Bondy [6] (cf. [4], p. 212) which says that a graph G with n 3 nodes, and with degrees d1 ; : : :; dn has a Hamiltonian cycle if for every i; j such that i 6= j , di i and dj j , we have di + dj n. In fact, we have d(G) n ? m, so di + dj n always holds for n > 2m. 2 Lemma 6.3 If G = (X; Y; E ) is a bipartite graph such that card(X ) = card(Y ) = n, d(G) n ? m and n > 2m then X can be matched into Y . Proof. We use Lemma 6.1. Towards a contradiction, assume that there exists A X such that card(?G(A)) < card(A). Then card(?G(A)) < n and, since d(G) n ? m, card(?G(A)) n ? m and card(A) > n ? m. Let y 2 Y n ?G(A). For every x 2 X , if x 2 ?G(y) then x 62 A. Moreover, card(?G(y)) n ? m and so, card(A) < m. This gives a 2
contradiction if n > 2m.
Lemma 6.4 Let G = (V; E ) be a graph with n nodes such that d(G) n ? m, and assume that V = X 0[_ Z [_ Y 0 , where card(X 0) = card(Y 0 ) 2m. If n > 14m then there exists Z 0 Z such that both X 0 and Y 0 can be matched onto Z 0.
Proof. Let X 0 = fa1; : : :; akg, Y 0 = fb1; : : :; bkg, where k 2m. Since d(G) n ? m, we have card(?G(a1 )) n ? m. We claim, that there is an element c1 2 ?G (a1 ) \ Z such that c1 2 ?G (b1) \ Z . Indeed, card(?G(a1 ) \ Y ) n ? m ? 4m = n ? 5m, and card(?G(b1) \ Z ) n ? 5m. So, ?G(a1) \ ?G (b1) \ Z = 6 ;, provided n > 10m. Similarly, ?G(ai) \ ?G(bi) \ (Z n fc1; : : :; ci?1g) =6 ;, provided n > 10m + 2(i ? 1). 2 Lemma 6.5 Let G = (X; Y; E ) be a bipartite graph such that for every b 2 Y , dG(b) card(X )?m. Let d0 : X 7! f0; : : :; mg and for every a 2 X , dG(a) d0 (a). If card(X ); card(Y ) > 3m then there exists a bipartite graph G0 = (X; Y; E 0) such that E E 0, for every a 2 X , dG0 (a) = d0 (a), and for every b 2 Y , dG0 (b) card(X ) ? m. Proof. Let G = (X; Y; E ) be a bipartite graph such that for every b 2 Y , dG(b) card(X ) ? m, and let d0 : X 7! f0; : : :; mg be a function such that for every a 2 X , dG(a) d0(a). To build the graph G0 we will add new edges to the graph G repeating the following operation until we get a graph as needed. (*) Let a be an element of X such that dG(a) < d0(a). Find an element b 2 Y such that fa; bg 62 E and for every c 2 Y with fa; cg 62 E , dG(b) dG(c). Put E = E [ fa; bg. We will now show that an element b as above exists, and that the operation (*) preserves assumptions of the lemma. Since dG(a) < m < card(Y ), there exist at least card(Y ) ? m elements c in Y such that fa; cg 62 E . We claim that among these elements there is an element b such that 36
dG(b) < card(X ) ? m. In fact, towards a contradiction, assume that dG(b) = card(X ) ? m, for each c 2 Y such that fa; cg 62 E . Then, X d (c) = X d (c) + X d (c) (card(Y ) ? m)(card(X ) ? m): G G G c2Y
c2?G (a)
c2Y n?G (a)
On the other hand, dG m, for every e 2 X , which gives
Xd
c2Y
G(c) =
Xd
e2X
G (e) < m card(X ):
By the above inequalities,
m card(X ) > (card(Y ) ? m)(card(X ) ? m) and hence,
card(X )card(Y ) ? m(card(X ) + card(Y )) ? m(card(X ) ? m) < 0: Assume card(X ) card(Y ). Then, card(X )card(Y ) ? m(card(X ) + card(Y )) ? m(card(X ) ? m) card(X )card(Y ) ? 3m card(X ) + m2 > card(X )(card(Y ) ? 3m) > 0; provided card(Y ) > 3m:
(1)
The last inequality contradicts (1).
References
2
[1] W. Ackermann. U ber die erfullbarkeit gewisser zahlausdrucke. Mathematische Annalen, 100:638{649, 1928. [2] W. Ackermann. Beitrage zum entscheidungsproblem der mathematischen logik. Mathematische Annalen, 112:419{432, 1936. [3] W. Ackermann. Solvable Cases of the Decision Problem. North-Holland, Amsterdam, 1954. [4] C. Berge. Graphs and Hypergraphs. North Holland, 1971. [5] P. Bernays and M. Schon nkel. Zum entscheidungsproblem der mathematischen logik. Mathematische Annalen, 99:342{372, 1928. [6] J. A. Bondy. Properties of graphs with constraints and on degrees. Studia Sc. Math. Hung., 4:473{475, 1969. [7] E. Borger, E. Gradel, and Y. Gurevich. The classical decission problem. Perspectives in Mathematical Logic. Springer-Verlag, 1997. [8] A. Borgida. On the relative expressive power of description logics and predicate calculus. Arti cial Intelligence, 82:353{367, 1996. [9] B. Dreben and W. Goldfarb. The Decision Problem: Solvable Classes of Quanti cational formulas,. Addison-Wesley, Reading, 1979. [10] A. Ehrenfeucht. An application of games to the completeness problem for formalised theories. Fund. Math., 49:129{141, 1961. 37
[11] K. Godel. Ein spezialfall des entscheidungsproblem des theoretischen logik. Ergebnisse eines mathematischen Kolloquiums, 2:27{28, 1932. [12] K. Godel. Zum entscheidungsproblem des logischen funktionenkalkuls. Monatshefte fur Mathematik und Physik, 40:433{443, 1933. [13] W. Goldfarb. On Decision Problems for Quanti cation Theory. PhD thesis, Harvard University, 1974. abstract in Notices Amer. Math. Soc. 21 (4), p.280. [14] W. Goldfarb. The unsolvability of the Godel class with identity,. Journal of Symbolic Logic, 49:1237{1252, 1984. [15] E. Gradel, P. Kolaitis, and M. Vardi. On the decision problem for two-variable rst-order logic. Bull. of Symb. Logic, 3(1):53{69, 1997. [16] E. Gradel, M. Otto, and E. Rosen. Two-variable logic with counting is decidable. In Twelth Annual IEEE Symposium on Logic in Computer Science, pages 306{317, 1997. [17] E. Gradel, M. Otto, and E. Rosen. Undecidability results on two-variables logics. In Proc. of 14th Annual Symposium on Theoretical Aspects of Computer Science, volume 1200, pages 249{260. Springer-Verlag Lecture Notes in Computer Science, 1997. [18] Y. Gurevich. The decision problem for standard classes. Journal of Symbolic Logic, 41:460{464, 1976. [19] Y. Gurevich. On the classical decision problem. In G. Rosenberd and A. Salomaa, editors, Current Trends in Theoretical Computer Science, pages 254{265. World Scienti c, 1993. [20] Y. Gurevich and S. Shelah. Random models and the godel case of the decision problem. Journal of Symbolic Logic, 48:1120{1124, 1983. [21] P. Hall. On representations of subsets. J. London Math. Soc., 10:26{30, 1934. [22] W. Van Der. Hoek and M. De Rijke. Counting objects. Journal of Logic and Computation, 5(3):325{345, 1995. [23] N. D. Jones and A. L. Selman. Turing machines and the spectra of rst-order formulas. J. Symb. Logic, 39:139{150, 1974. [24] L. Kalmar. U ber die erfullbarkeit derjenigen zahlausdrucke, welche in der normalform zwei benachbarte allzeichen enthalten. Mathematische Annalen, 108:466{484, 1933. [25] H. Lewis. Unsolvable Classes of Quanti cational Formulas. Addison-Wesley, Reading, 1979. [26] H. Lewis and W. Goldfarb. The decision problem for formulas with a small number of atomic subformulas. Journal of Symbolic Logic, 38:471{480, 1973. [27] H. R. Lewis. Complexity results for classes of quanti cational formulas. J. Comp. and System Sci., 21:317{353, 1980. [28] M. Mortimer. On languages with two variables. Zeitschr. f. Logik und Grundlagen d. Math., 21:135{140, 1975. [29] L. Pacholski, W. Szwast, and L. Tendera. Complexity of two-variable logic with counting. In Twelth Annual IEEE Symposium on Logic in Computer Science, pages 318{327, 1997. [30] M. Rabin. Decidability of second-order theories and automata on in nite trees. Trans. Amer. Math. Soc., 141:1{35, 1969. [31] D. Scott. A decision method for validity of sentences in two variables. J. Symb. Logic, 27:477, 1962. 38
[32] S. Shelah. Decidability of a portion of the predicate calculus. Israel Journal of Mathematics, 28:32{44, 1977. [33] T. Skolem. Untersuchungen uber die axiome des klassenkalkuls und uber produktationsund summationsprobleme, welche gewisse klassen von aussagen betreen. Skrifter utgit au Vidensk. i Kristiania I, Math.-nat.Klasse, 3:37, 1919. [34] T. Skolem. Logisch-kombinatorische untersuchungen uber die erfullbarkeit oder beweisbarkeit mathematischer satze nebst einem theorem uber dichte mengen. Norsk Vid-Akad. Oslo Mat.-Natur Kl. Skr., 4, 1920. [35] T. Skolem. U ber die mathematische logik. Norsk MAt. Tidsskrift, 106:125{142, 1928. [36] W. Szwast and L. Tendera. First-order two-variable logic is in NEXPTIME. unpublished manuscript. [37] H. Wang. Dominoes and the 898-case of the decision problem. In Preceedings Symposium on Mathematical Theory of Automata, pages 23{55, New York, 1962. Brooklyn Polytechnic Institute.
39