May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

1

Definable sets in the weak Presburger arithmetic ∗

CHRISTIAN CHOFFRUT LIAFA, Universit´eParis 7 & CNRS, 2, pl. Jussieu – 75251 Paris Cedex – 05, France E-mail: [email protected] www. liafa. jussieu. fr/ ~cc

ACHILLE FRIGERI Dipartimento di Matematica, Politecnico di Milano & LIAFA, Universit´eParis 7 via Bonardi, 9 – 20133 Milano, Italia E-mail: [email protected]

We show the following: given a relation defined by a first order formula on the structure hZ; +,

Introduction Presburger arithmetic is the fragment of arithmetic concerning the with addition and order. Presburger’s supervisor considered the decidabil- ity of this fragment too modest a result to deserve a Ph.D. degree and he accepted it only as a Master’s Thesis in 1928. Looking at the number of citations, we may say that history revised this depreciative judgment long ago. There still remains, at least as far as we can see, some confusion concerning the domain of the structure: Z or N? with or without the or- der relation? (the main popular mathematical web sites disagree on that respect). The original paper deals with the additive group of positive and negative integers with no binary relation, but in a final remark of the origi- nal communication the author asserts that the same result, to wit quantifier elimination, holds on the structure of the “whole” integers, i.e., the natural

∗Partially supported by ...... May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

2

numbers with the binary relation <. In ?, which is the main reference on the subject, Presburger arithmetic is defined as the elementary theory of integers with equality, addition, having 0 and 1 as constant symbols and < as binary predicate, see also ?. On the other hand, the majority of the “modern” papers referring to Presburger arithmetic is concerned with the natural numbers where order relation is unnecessary as it is first order ex- pressible. The origin of the present work is the simple remark that concerning the of integers Z, the binary relation matters. Here we study the decidability of the definability in the structure hZ; +i for a given relation defined in hZ; +,

1. Preliminaries 1.1. Variants of Presburger arithmetic As observed above, a source of confusion is the lack of agreement in the definition of Presburger arithmetic itself. We make the convention of calling weak Presburger arithmetic the structure ZW = hZ; +; 0, 1i origi- nally studied in ?, while with Z we mean the (standard) Presburger arith- May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

3

metic hZ; =, <; +; 0, 1i. The positive Presburger arithmetic is the structure N = hN; =; +; 0, 1i and we observe that in this case the < predicate (as restriction of the order on Z to N) is already definable in N . All these three structures are decidable in the sense that given a closed formula, it is re- cursively decidable whether or not it holds. In particular ZW and Z admit quantifier elimination in the augmented languages with the additional unary functional symbol − and the (recursive) set of binary functional symbols

(≡m)m∈N\{0,1}, having the usual meaning of opposite and modulo, while for N it suffices to add the binary functional symbols (

1.2. Logical definability Here we are concerned with the definability issue. We recall that given a logical structure D with domain D and a first order formula on this structure, say φ(x1, . . . , xn) where x1, . . . , xn is the set of free variables, the n-ary relation R defined by φ is the set of n-tuples (a1, . . . , an) such that φ holds true when the variable xi is assigned the value ai, i.e., R = n {(a1, . . . , an) ∈ D | D |= φ(a1, . . . , an)}.

Example 1.1. E.g., the formula (x1 + x2 = 0) ∨ (x1 = x2 + 1) defines, in the structure Z, the union of a point and of a line in the discrete plane. 

2. N-linear and Z-linear sets 2.1. Some notations The free abelian monoid and the free abelian group on k generators are respectively identified with Nk and Zk with the usual additive structure. The addition is extended from elements to subsets: if X,Y ⊆ Nk (resp. X,Y ⊆ Zk), X + Y ⊆ Nk (resp. X + Y ⊆ Zk) is the set of all sums x + y where x ∈ X and y ∈ Y . It might be convenient to consider the elements of Nk and Zk as vectors of the Q-vector space Qk. Given v in Nk or in Zk, the expression Nv represents the of all vectors nv where n range over N. This expression can be extended to Zv in a natural way whenever v is in Zk. Thus Zu + Zv represents the subgroup generated by the vectors u and v.

2.2. Linear sets The following discussion requires (the adaptation of) few definitions. The symbol K stands either for N or for Z when concerning the free abelian May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

4

group Zk or for N when concerning the free abelian monoid Nk.

Definition 2.1. A subset of Zk (resp. Nk) is K-linear if it is of the form n X k k a + Kbi, a, bi ∈ Z (resp. N ), i = 1, . . . , n. (1) i=1

k It is K-simple if the bi’s are linearly independent as vectors of Q . It is K-semilinear if it is a finite union of K-linear sets and K-semisimple if it is a finite disjoint union of K-simple sets. A subset of Zk is Z-quasisimple Pn if it is of the form A + i=1 Zbi, where A is a finite set such that for all a, a0 ∈ A the vector (a − a0) belongs to the Q-vector space spanned by the bi’s. 

Example 2.1. The subset Z(1, 0) ∪ Z(0, 1) is Z-semilinear. It is also N- semilinear and N-semisimple (it is equal to the union of N(1, 0), (−1, 0) + N(−1, 0), N(0, 1) and (0, −1) + N(0, −1)). The subset {(0, 1), (1, 0)} + Z(2, 0)+Z(0, 2) is Z-quasilinear. The subset {(0, 1, 0), (1, 1, 1)}+Z(2, 0, 0)+ Z(0, 2, 0) is Z-semilinear but not Z-quasilinear. 

Ginsburg and Spanier proved? the following result for Nk, but it can readily be seen to hold for Zk.

Theorem 2.1. Given a subset X of Nk (resp. Zk) the following assertions are equivalent:

(i) X is first order definable in N (resp. Z); (ii) X is N-semilinear; (iii) X is N-semisimple.

Example 2.2. The binary relation of Example 1.1 is the union of the two Z-linear subsets:

{(1, 1)} ∪ Z(1, −1).



Clearly, a finite union of Z-linear subsets is also a finite union of N-linear subsets but the converse does not hold, e.g., a moment’s reflection will convince the reader that the subset N is not expressible as a finite union of Z-linear subsets. Still every Z-linear set is ZW -definable. Indeed, given Pn X = a + i=1 Zbi, then x = (x1, . . . , xk) ∈ X if, and only if, the following May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

5

(i) formula holds (where bj means the i-th component of the vector bj):

k n  ^ (i) X (i)  P(x) = ∃z1 ... ∃zn (xi = a + zjbj ) . (2) i=1 j=1 Would the family of finite unions of Z-linear subsets by chance capture the notion of subsets which are definable in the structure ZW ? This is not the case, since this family is not closed under taking the complement. Actually we will see that the Boolean closure of the family of Z-linear subsets is precisely the class of ZW definable sets, see Theorem 4.1.

3. Properties of Z-linear sets Our decidability result is based on the equivalence between definable sub- sets in the structure ZW and the Boolean closure of the Z-linear subsets. This characterization is obtained, in particular, by proving that the class of Z-linear sets enjoys many properties such as closure under finite sum, projection, direct product, and, more interestingly, intersection.

3.1. Closure properties We start with an elementary technical result.

Lemma 3.1. Let S be a Z-simple set in Zk. Then, for every v ∈ Zk, S+Zv is Z-simple.

Pn Proof. We argue by induction and assume that S = i=1 Zbi, for some k bi ∈ Z such that {b1, . . . , bn} is a linearly independent set of vectors in k Z . We may further assume that {b1, . . . , bn, v} is linearly dependent since Pn otherwise we are done. We have hv ∈ i=1 Zbi for some h ∈ N which k implies v ∈ R = hb1/h, . . . , bn/hi as a lattice in (Z/h) . In particular R is a free abelian group on n generators and S + Zv is a free subgroup of R. k Pn There exist c1, . . . , cn ∈ (Z/h) such that S + Zv = hc1, . . . , cni = i=1 Zci k k (see [?, Theorem 4, (I,§10)]). But S + Zv ⊆ Z , so that ci ∈ Z , for every k k 1 ≤ i ≤ k. Finally, if the vectors ci ∈ Z are independent in (Z/h) , they are certainly free in Zk and so S + Zv is a Z-simple set.

As a consequence we have the following two Corollaries which show a first important departure from the N-linear and Z-linear sets.

Corollary 3.1. Every Z-linear set is Z-simple. May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

6

Corollary 3.2. The family of Z-simple set is closed under projection, direct product and finite sum. Pn The dimension of a simple set a + i=1 Zbi is the integer n and the dimen- sion of a union of simple sets is the maximum dimension of these sets. E.g., the dimensions of the example in 2.2 is equal to 1 and those of example 2.1 are equal to 2.

In order to prove the closure under intersection, we recall a classical and useful theorem of linear algebra (for each integer n, GLn(Z) represents the group of all n × n invertible matrices with entries in Z). Theorem 3.1 (Smith normal form, [?, p. 74]). Let A ∈ Zm×n be a matrix of rank s. Then there exist two matrices U ∈ GLm(Z) and V ∈ GLn(Z), such that  D 0  A0 = UAV = 0 0 s×s where D = (dij) ∈ Z is an integer diagonal matrix such that dii divides djj for 1 ≤ i ≤ j ≤ s.

Proposition 3.1. Let A ∈ Zm×n and b ∈ Zm. The set S of solutions in Zn of the linear system Ax = b is an effective Z-simple set of dimension equal to n − s where s is the rank of A.

Proof. If A0 = UAV is the Smith normal form of A, then the given system is equivalent to UAV V −1x = Ub. Put V −1x = y and Ub = b0. The set 0 0 0 Pm of solutions of A y = b is the Z-simple set S = c + i=s+1 Zei, where 0 cj = bj/ajj for 1 ≤ j ≤ s and cj = 0 for s < j ≤ n and the ei are the vectors of the canonical basis. Observe that the matrix V −1 has integer entries, thus y is a vector with integer entries and therefore the system admits solutions n 0 in Z if and only if ajj divides bj for 1 ≤ j ≤ s. The vectorsc ˆ = V c ande ˆi = V ei have integer entries and the V ei’s are linearly independent because V is unimodular (i.e. |V | = ±1). Since equality S = VS0 holds, we Pm have S =c ˆ + i=s+1 Zeˆi. The effectiveness should be clear, knowing that obtaining the Smith normal form is effective?.

This leads us to the main property of this section. Theorem 3.2. The intersection of two simple subsets of dimension n and m is a simple subset of dimension less than or equal to min{n, m}. In particular the family of Z-simple sets is closed under finite intersection. May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

7

Pn Pm Proof. Let P = a + i=1 Zbi and Q = c + j=1 Zdj be two Z-simple sets in Zk and assume without loss of generality that n ≤ m. Consider Pn Pn+m the linear system i=1 bixi − i=n+1 di−mxi = c − a and let S be the set of solutions in Zm+n obtained by applying Theorem 3.1, with A = [b1, . . . , bn, −d1,..., −dm]. Observe that its rank is greater than or equal to m so that S is Z-simple with dimension is ` ≤ n. Its projection on the first n 0 0 P` n coordinates S = πn(S) is Z-linear: S = u+ i=1 Zvi, for some u ∈ Z and n vi ∈ Z , i = 1, . . . , `. Now, considering for example the first n components Pn 0 of S, P ∩ Q can be written as {a + i=1 xibi | (x1, . . . xn) ∈ S }. Define B as the k × n matrix whose columns vectors are b1, . . . , bn and V as the n × ` matrix whose columns vectors are v1, . . . , v`. Then the intersection can be obtained as a composition of two affine transformations φ : Zn → Zk defined by α 7→ a + αB and ψ : Z` → Zn defined by β 7→ u + βV (the matrices operate to the left on row vectors) ` ` ` P ∩ Q = φ(ψ(Z )) = a + (u + Z V )B = (a + uB) + Z (VB). This prove that P ∩ Q is Z-linear, and via Corollary 3.1, that it is actually Z-simple.

3.2. Quasisimple sets The following two results deal with quasisimple sets which are slight gen- eralizations of simple sets, see Definition 2.1. They will be used in the next section.

Proposition 3.2. Let S, T be Z-simple sets in Zk. Suppose dim S = dim T and T ⊂ S. Then X = S \ T is a Z-quasisimple set of basis T .

Pn Pn k Proof. Let S = a + i=1 Zbi and T = c + i=1 Zdi, with a, c, bi, di ∈ Z . Pn By T ⊆ S, we have c = a + i=1 γibi, for some γi ∈ Z, so S = c + Pn Pn Pn Pn i=1(−γi)bi+ i=1 Zbi = c+ i=1(Z−γi)bi = c+ i=1 Zbi. After possibly translating both subsets, we may suppose without loss of generality that Pn Pn c = 0, so that S = i=1 Zbi and T = i=1 Zdi. Consider the isomorphism n φ which maps the subgroup generated by the bi’s onto the free group Z . Then φ maps T onto a subgroup of Zn of finite index and Zn \ φ(T ) is a (finite) union of cosets, so T = φ−1(Zn \ φ(T )) is a finite union of linear Pn Pn sets of the form g + i=1 Zdi where g ∈ i=1 Zbi. In the same spirit we have the following:

Proposition 3.3. Let S a finite union of Z-simple sets of dimension k in Zk. Then S is Z-quasisimple. May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

8

Sm (i) Pk (i) Proof. Let us suppose S = i=1 Xi, where Xi = a + j=1 Zbj is a Z- (i) simple set. Since all vectors bj ’s, 1 ≤ j ≤ k, are linearly independent, they k generate a subgroup of Z of finite index, in particular for every Xi there k exists a morphism φi of Z into a finite group Gi and a subset Fi ⊆ Gi such −1 k that Xi = φ (Fi). Let φ be the morphism of Z into the direct product G = G1 × · · · × Gm defined by φ(x) = (φ1(x), . . . , φm(x)) and let H be the set of m-tuples (g1, . . . , gm) ∈ G for which gi belongs to Fi for some 1 ≤ i ≤ m. Then S = φ−1(H) which shows that S is a union of cosets of the kernel of φ. As such, it is Z-quasisimple set of dimension k.

The last result of this paragraph concerns a weak condition of equality of two quasisimple sets of maximum dimension. Intuitively, it means that it suffices for two quasisimple sets to be equal almost everywhere (in some precise sense) in order to be equal. Proposition 3.4. Two quasilinear subsets of maximum dimension k are equal if, and only if, for all integers n there exists an hypercube [α1, α1 + k n] × · · · × [αk, αk + n] ⊆ Z on which they agree.

Proof. The condition is clearly necessary. In order to prove that it is suffi- cient, consider a morphism φ : Zk → G onto some finite group recognizing two Z-semilinear subsets X and Y , i.e., φ−1φ(X) = X and φ−1φ(Y ) = Y . Let n be a common multiple of degrees of the k elements φ(1, 0,..., 0), φ(0, 1,..., 0), . . . , φ(0,..., 0, 1). Then a vector (v1, . . . , vk) belongs to X if, and only if, so does the vector ([v1], ··· , [vk]) where [vi] is the remainder of the division of vi by n.

Corollary 3.3. Let X and Y be two quasilinear subsets of maximum di- mension k and let Z be a finite union of linear subsets of dimension less than k. Then X = Y if, and only if, X \ Z = Y \ Z.

4. Definable sets in weak Presburger arithmetic 4.1. An algebraic characterization of definable subsets The Boolean closure of the linear sets enjoys some properties which we will take advantage of when characterizing the definable sets in ZW . In particular, condition (iii) of the following Lemma is useful when designing a decision procedure. ¿From now on, “linear” and “simple” means Z-linear and Z-simple. Lemma 4.1. The following families of subsets of Zk are equal: May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

9

(i) the Boolean closure of linear sets; TJ (ii) the family of all finite unions of the form S ∩ j=1 T j where S, Tj are Z-simple; SJ  (iii) the family of all finite unions of the form S \ j=1 Tj where S, Tj are Z-simple with Tj ⊂ S, and dim Tj < dim S.

Proof. Clearly the families (ii) and (iii) are included in the Boolean clo- sure of the linear sets. The family (ii) contains all linear sets (take J = 0) and all complements of linear sets (take S = Zk for S and J = 1). Fur- TJ thermore the complement of a subset of the form S ∩ j=1 T j is a finite union of linear sets and complements of linear set, thus the complement of a finite union of such subsets is a finite union of intersections of linear sets and complements of linear sets. Since the intersection of linear sets is again linear, this shows that the family (ii) is closed under complement, and thus coincides with the Boolean closure. We now show that each subset of the form (ii) is equivalent to a union S of subsets of the form (iii). Indeed, because of equality S \ ( i Ti) = S S \ ( 1≤i≤r(S ∩ Ti)), without loss of generality we may assume that all Ti’s are Z-simple subsets of S. Assume further that the p ≤ r first subsets Ti’s have the same dimension as S, with p = 0 if no Ti has the same dimension as S. Then by repeatedly applying Lemma 3.2 to S S S S\( i Ti) = (... ((S\T1)\T2) ...Tp)( i>p Ti) we may transform S\( i Ti) into a finite union of subsets of the form required.

Theorem 4.1. The family of ZW -definable sets is the Boolean closure of the family of Z-linear sets.

Proof. Clearly, all linear sets are ZW -definable, see expression (2). Let us verify the converse. Using the quantifier elimination result, all ZW - definable subsets belong to the Boolean closure of the relations which are solutions of a system of linear equations or of modular equations of the type Pn i=1 aixi ≡m b. In the former case, this is a consequence of Proposition 3.1. As for the latter case, let us proceed by induction on n. Let n = 1, then we must solve the equation ax ≡m b. If b is not a multiple of the greatest common divisor d of a and m then there is no solution. Other- wise a/d has an inverse modulo m/d and the set of solutions is defined by −1 Pn−1 (a/d) (b/d) + Z(m/d). Now if n > 1, then set t = i=1 aixi. The con- Pn Wm−1  gruence i=1 aixi ≡m b is equivalent to j=0 t ≡m j ∧ anxn ≡m (b − j) , and so by the induction hypothesis, we may conclude. May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

10

4.2. A special case The case studied here can be considered as the top level case in the recursive procedure of the next paragraph. The following notation is useful. Given m P Z a N-simple set S = a + i=1 Nbi, we denote by S the Z-simple set a + Pm i=1 Zbi.

Theorem 4.2. Let X ⊆ Zk be a Z-definable set of the form m [ X = T ∪ Yi, i=1

(i) Pk (i) (i) where Yi = a + j=1 Nbj for some linearly independent vectors bj (i.e. it is a N-simple set of dimension k) and T is a finite union of N-simple sets of dimension less than k. Then X is ZW -definable if, and only if, it can be decomposed as S ∪ (P \ R), where:

k (j) S (i) P S Z (1) P = 1≤i≤m(a + j=1 Zbj ) = 1≤i≤m Yi ; (2) R and S are ZW -definable sets which are included in a finite union of Z-simple sets of dimension less than k; (3) R ⊆ P and S ∩ P = ∅.

Proof. Clearly the condition is sufficient. Suppose X is ZW -definable and express it as in (ii) of Lemma 4.1. Isolate all the simple sets of dimension k. By the set-theoretic equality ! [   [  [  [  Ei \ Fi = Ei \ Fi \ (Ej \ Fj) , i i i j6=i

if the Ei’s are simple sets of maximal dimension, by Proposition 3.3 their union is a quasisimple set and we may write

k  X   X = S ∪ A + Zdj \ R , j=1

k where A ⊆ Z is finite, the vectors dj are linearly independent, S and R are ZW -definable sets included in a finite union of Z-simple sets of dimension less than k. Now we prove the following, which means that the symmetric difference of the two subsets is included in a finite union of linear subsets of dimension less than k: m k k [ (i) X (i) X  a + Zbj ∼ A + Zdj . i=1 j=1 j=1 May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

11

Pk Clearly, if we take a vector in A + j=1 Zdj not belonging to R ∪ T (which is contained in R ∪ T Z, that is, in a finite union of Z-simple sets of dimension less than k), it must belong to one of the Yi, and thus to Sm (i) Pk (i) i=1 a + j=1 Zbj . Conversely, consider one of the sets Yi, namely Pk Y = a + j=1 Nbj (we drop the upper indices to simplify the notation), k Z P then we show Y ⊆ A + j=1 Zdj except for a union of Z-simple sets of dimension less than k. We observe that S is in particular Z-definable, S so S = 1≤i≤m Si, where every Si is a N-simple set of dimension less than k. For each Si, let Ji ⊆ I = {1, . . . , k} be the maximal ordered set of indices 1 ≤ j1 < ··· < jp ≤ k, such that Si is not parallel to the k |Ji| vectors bj, j ∈ Ji, and let πi : Z → Z be the projection defined by −1 πi((xj)j∈I ) = ((xj)j∈Ji ). So, we can define Sbi = πi (Si), if Ji 6= I, and Sbi = ∅ otherwise. E.g., if S consists of the unique simple subset

(1, 0, 1) + N(0, 2, 2) + N(3, 0, 0) = {(1 + 3p, 2n, 2n + 1) | n, p ∈ N},

then it is parallel to the vector (1, 0, 0) and we have Sb = {(p, 2n, 2n + 1) | p ∈ Z, n ∈ N}. We want to show by induction on i that the subset ! [ Wi = (Zb1 + ··· + Zbi−1 + Nbi + ··· + Nbk) \ Scj 1≤j≤m P is included in A+ 1≤j≤k Zdj. This is clear for i = 1. Now assume 1 < i ≤ k and consider a vector v ∈ Wi. Since it does not belong to any subset Sj parallel to bi, the subset v + Nbi is included in A + Zd1 + ··· + Zdk except maybe for finitely elements which are the possible intersections of this linear set with the subsets Sj parallel to none of the vectors b1, . . . , bk. This implies (1) (k) for sufficiently large n, v + nbi = an + λn d1 + ··· + λn dk. Since the set A is finite, the elements an ∈ A start to repeat and for some integer r the following holds for all integers m and 0 ≤ r0 < r:

0 (1) (k) v + (mr + r )bi = ar0 + mλ d1 + ··· + mλ dk.

For all integers `r + j ∈ Z where 0 ≤ j < r we have v + (`r + j)bi = (1) (k) aj + `λ d1 + ··· + `λ dk which shows that v + Zbi ⊆ A + Zd1 + ··· + Zdk. Because of Corollary 3.3, X can be written as S ∪ (P \ R), where S and R are ZW -definable sets which are included is simple sets of dimension less than k and which are computable from T and form the Yi’s. To end the proof we must verify the last item; indeed, we have:

S ∪ P \ (R \ S) = S ∪ (P ∩ (R ∪ S)) = S ∪ (P ∩ S) ∪ (P \ R) = S ∪ P \ R, May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

12

and observe that since R is included in P so is R \ S which shows that we may assume S ∩ R = ∅. Furthermore, we have S ∪ P \ R = (S ∩ P ) ∪ (S \ P ) ∪ (P ∩ R) = S \ P ∪ (P ∩ (S ∪ R)).

Since S ∩ R = ∅ holds we have S ∪ R = R which shows that without loss of generality we may suppose that S ∩ P = ∅ holds. This implies X \ P = S, P \ X = R.

4.3. The procedure

We recall our problem. Given a subset X ⊆ Zk which is Z-definable, i.e., specified as a finite union of N-simple sets, decide whether or not it is actually ZW -definable and, in the affirmative case, give a representation as Boolean combination of Z-simple sets. We cannot directly use Theorem 4.2, because it requires that one of the simple sets in the specification have dimension k. So we proceed as follow:

(1) Let X ⊆ Zk be the union of the sets

Ji (i) X (i) Xi = a + Nbj , 1 ≤ i ≤ m. j=1

k (i) PJ  k Consider all the affine subspaces of Q , Hi = ha + j=1 Qbj ∩ Z , and suppose (after possibly changing some indices) H1,..., Hr, r ≤ m, are the maximal (for the inclusion) elements of the collection H = {Hi | 1 ≤ i ≤ m}. 0 k W (2) Compute all the sets Hi = Hi ∩ Z and observe that they are Z - PJ  definable. Indeed for a subset of the form H = a + j=1 Qbj ∩ k k Z , where a, bj ∈ Z , there exist k − J linear equations F1(y) = 0,...,Fk−J (y) = 0 whose set of solutions is exactly the subspace gen- erated by the vectors bj. Then H is defined by the Presburger formula  ∃y (x = y + a) ∧ (F1(y) = 0) ∧ ... ∧ (Fk−J (y) = 0) .

W Clearly, X is Z -definable if, and only if, all the intersections Yi = 0 W X ∩ Hi are Z -definable. Ji (3) For all 1 ≤ i ≤ r, consider an isomorphism τi : Hi → Q such that 0 Ji τi(Hi ) = Z . Such isomorphism clearly exists and moreover it can be 0 W expressed, relatively to Hi , in the structure Z , so that τi(Yi) is again W W a Z -definable set if, and only if, Yi is Z -definable. May 31, 2007 19:47 WSPC - Proceedings Trim Size: 9in x 6in ictcs

13

(4) Finally we can apply Theorem 4.2 to τi(Yi), since it has at least one component of maximal dimension J, obtaining the sets Pi,Si, and −1 −1 Ri that satisfy all conditions of 4.2. Now Yi = τi (Si) ∪ τi (Pi) ∩ −1  τi (Ri) , and observe that the inverse images of Pi,Si, and Ri by τ −1 again satisfy the three conditions, in particular τi (Pi) is Z-simple. −1 −1 (5) Now apply the procedure recursively to the sets τi (Si) and τi (Ri). (6) It only remains to observe that if we fail to apply Theorem 4.2, this means that the set X actually was not ZW -definable.