ARTICLE IN PRESS
Journal of Computer and System Sciences 67 (2003) 244–262 http://www.elsevier.com/locate/jcss
Computing the Betti numbers of arrangements via spectral sequences Saugata Basu School of Mathematics and College of Computing, Georgia Institute of Technology, Atlanta, GA 30332-0160, USA Received 11 July 2002; revised 11 November 2002
Abstract In this paper, we consider the problem of computing the Betti numbers of an arrangement of n compact semi-algebraic sets, S1 ; y; Sn CRk ; where each Si is described using a constant number of polynomials with degrees bounded by a constant. Such arrangements are ubiquitous in computational geometry. We give an S algorithm for computing cth Betti number, bc ð ni¼1 Si Þ; 0pcpk 1; using Oðncþ2 Þ algebraic operations. Additionally, one has to perform linear algebra on integer matrices of size bounded by Oðncþ2 Þ: All previous algorithms for computing the Betti numbers of arrangements, triangulated the whole arrangement k giving rise to a complex of size Oðn2 Þ in the worst case. Thus, the complexity of computing the Betti 2k numbers (other than the zeroth Sn one) for these algorithms was Oðn Þ: To our knowledge this is the first algorithm for computing bc ð i¼1 Si Þ that does not rely on such a global triangulation, and has a graded complexity which depends on c: r 2003 Elsevier Science (USA). All rights reserved. Keywords: Semi-algebraic sets; Betti numbers; Spectral sequence
1. Introduction The combinatorial, algebraic and topological analysis of arrangements of real algebraic hypersurfaces in higher dimensions are active areas of research in computational geometry (see [1,11,12,23]). Arrangements of lines and hyper-planes have been studied quite extensively earlier. It was later realized that arrangements of curved surfaces are a significant generalization and have a wider range of applications. There has been substantial progress in analyzing the combinatorial
E-mail address:
[email protected]. URL: http://www.math.gatech.edu/~saugata. 0022-0000/03/$ - see front matter r 2003 Elsevier Science (USA). All rights reserved. doi:10.1016/S0022-0000(03)00009-6
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
245
complexity—that is the number of cells (appropriately defined) of various dimensions occurring in the boundary—of sub-structures in arrangements [23]. However, there is another source of geometric complexity in arrangements of hyper-surfaces— namely topological complexity. Arrangements of hyper-surfaces are distinguished from arrangements of hyper-planes by the fact that arrangements of hyper-surfaces are topologically more complicated than arrangements of hyper-planes. For instance, a single hyper-surface or intersections of two or more hyper-surfaces, can have non-vanishing higher homology groups and thus sets defined in terms of such hyper-surfaces can be topologically more complicated in various non-intuitive ways. It is often necessary to estimate the topological complexity of arrangements [9] and sometimes these estimates even play a role in bounding the combinatorial complexity (see [2]). An important measure of the topological complexity of a set S are the Betti numbers bi ðSÞ: Here and elsewhere in the paper the set S will always be semi-algebraic, (that is defined in terms of a finite number of real polynomial equalities and inequalities) and closed and bi ðSÞ will denote the rank of the H i ðSÞ (the ith singular co-homology group with real coefficients). Intuitively, bi ðSÞ measures the number of i-dimensional holes in S: The zeroth Betti number b0 ðSÞ is the number of connected components. For example, if T is topologically a hollow torus, then b0 ðTÞ ¼ 1; b1 ðTÞ ¼ 2; b2 ðTÞ ¼ 1; bi ðTÞ ¼ 0; i42; confirming our intuition that the torus has two 1-dimensional holes and one 2-dimensional hole. Analogously, for the two dimensional sphere, S; b0 ðSÞ ¼ 1; b1 ðSÞ ¼ 0; b2 ðSÞ ¼ 1; bi ðSÞ ¼ 0; i42: 1.1. Brief history The basic result in bounding the Betti numbers of semi-algebraic sets defined by polynomial inequalities was proved independently by Oleinik and Petrovskii [19], Thom [24] and Milnor [17]. They proved: Theorem 1 (Oleinik and Petrovskii [19], Thom [24], Milnor [17]). Let SCRk be the set defined by the conjunction of n inequalities P1 X0; y; Pn X0; Pi AR ½X1 ; y; Xk ; degðPi Þpd; Then,
X
1pipn:
bi ðSÞ ¼ OðndÞk :
i
However, the proof techniques used to prove Theorem 1 does not allow us to prove bounds on the individual Betti numbers separately. Nor do they suggest an efficient algorithm for actually computing the Betti numbers. The first bounds on the individual Betti numbers of semi-algebraic sets were proved in [3]. The following two theorems were proved bounding the Betti numbers of semi-algebraic sets obtained as intersections or as unions of sets, each defined by a single polynomial inequality.
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
246
Theorem 2. Let SCRk be the set defined by the conjunction of n inequalities, P1 X0; y; Pn X0; degðPi Þpd;
Pi AR ½X1 ; y; Xk ;
1pipn
contained in a variety ZðQÞ of real dimension k0 ; and degðQÞpd: Then, bi ðSÞp
!
n
OðdÞk :
k0 i
Theorem 3. Let SCRk be the set defined by the disjunction of n inequalities, P1 X0; y; Pn X0; degðPi Þpd; Then, bi ðSÞp
n iþ1
Pi AR ½X1 ; y; Xk ;
1pipn: ! OðdÞk :
Note that, a special case of the above theorem is the situation when S is the union of n sets each defined by a polynomial equation Pi ¼ 0: We just replace the equalities by the inequalities, P2i X0: A crucial new ingredient in the proofs of these bounds is the use of a spectral sequence argument. In this paper, we extend this argument so as to be able to actually compute the Betti numbers of a union of semi-algebraic sets efficiently. We note that similar techniques would also work in the case of intersections. In many applications in computational geometry one is often interested in understanding the topological complexity of the whole arrangement. For instance, unions of balls in R3 has been studied by Edelsbrunner [9] from both combinatorial and topological view-point motivated by applications in molecular biology, and efficient algorithms for computing the various Betti numbers of such unions are currently being studied [10]. There is also a whole body of mathematical literature studying the topology of arrangements of hyper-planes in complex as well as real spaces (see [20]). 1.2. Computing topology via global triangulations The standard technique of computing the Betti numbers of an arrangement is to associate a simplicial complex to the arrangement, and compute the simplicial homology groups of this complex (see [22]). Since compact semi-algebraic sets are triangulable [6], there always exists such a simplicial complex (corresponding to that of the triangulation). Thus, in order to compute the
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
247
Betti numbers of an arrangement of n real algebraic hyper-surfaces in Rk it suffices to first triangulate the arrangement and then compute the Betti numbers of the corresponding simplicial complex. However, currently the most efficient way known to obtain such a triangulation is via k the technique of cylindrical algebraic decomposition [8], and this produces Oðn2 Þ simplices in the worst case. Moreover, if the sets Si are defined by polynomials of degrees at most d; the size of the k
triangulation is bounded by ðOðndÞÞ2 : However, since the Betti numbers of such an arrangement are bounded by Oðnk Þ; it is reasonable to ask for algorithms whose complexity is bounded by Oðnk Þ: More efficient ways of decomposing arrangements into topological balls have been proposed. In [7], the authors provide a decomposition into O ðn2k3 Þ cells (see [13] for a recent improvement of this result). However, this decomposition does not produce a cell complex and is therefore not directly useful in computing the Betti numbers of the arrangement. Also, note that the problem of computing b0 of an arrangement is easier and efficient algorithms whose complexity is Oðnkþ1 Þ is known for this problem. Moreover, the dependence on the degree is also single exponential in this case (see [4]) for the best results in this direction). 1.3. Local method In certain simple situations, it is possible to compute the Betti numbers of an arrangement, without having to compute a triangulation. For instance, when the sets are compact and convex, a classical result of topology, the nerve lemma [21], gives us an efficient way of computing the Betti numbers of the union. The nerve lemma states that the homology groups of such a union are isomorphic to the homology groups of a combinatorially defined simplicial complex, the nerve complex. The nerve complex has n vertices, one vertex for each set in the union, and a simplex for each non-empty intersection among the sets (see Fig. 1). Thus, the ðc þ 1Þ-skeleton of the nerve
Fig. 1. The nerve complex of a union of disks.
ARTICLE IN PRESS 248
S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
complex can be computed by testing for non-emptiness of each of the possible
P
1pjpcþ2
ðnjÞ ¼
Oðncþ2 Þ at most ðc þ 2Þ-ary intersections among the n given sets. The cth Betti number of the union can then be computed from the ðc þ 1Þ-skeleton using linear algebra. (Actually, the nerve lemma requires only that all finite intersections of the sets be topologically trivial and convex sets clearly satisfy this condition.) This technique would work, for instance, if one is interested in computing the Betti numbers of a union of balls in Rk (see [9]). 1.4. The Leray spectral sequence When the given sets are not necessarily convex, which would be the case in very many applications, the nerve lemma does not apply. However, even though one cannot directly associate a simplicial complex in general, it is possible to associate a more complicated combinatorial object—namely a spectral sequence of vector spaces—which converges to the cohomology groups of the union in finitely many steps. In fact, the nerve lemma is a particular case of this spectral sequence which degenerates in one step to yield the co-homology groups. Using the spectral sequence we will give an algorithm for computing the cth Betti number of an arrangement of n compact semi-algebraic sets, which needs to triangulate only Oðncþ2 Þ sub-arrangements each of small (constant) size. Spectral sequences were first introduced by Leray [14,15] and are familiar objects in algebraic topology, and we refer the reader to [16] for a comprehensive survey. The spectral sequence method was used to prove the first graded bound on the individual Betti numbers of an arrangement of algebraic hyper-surfaces [3]. In this paper, we show that using a spectral sequence, it is possible to compute the Betti numbers of an arrangement without having to compute a global triangulation of the whole arrangement. In order to compute the cth Betti number of the arrangement, it suffices to compute Oðncþ2 Þ triangulations of all sub-arrangements consisting of at most c þ 2 of the given sets. Each such triangulation will be of constant size and description complexity and the cost of computing such a triangulation is Oð1Þ: Thus, in order to compute all the non-zero Betti numbers, b0 ; y; bk1 ; we will need to produce Oðnkþ1 Þ different constant-sized triangulations. By complexity of our algorithm we will mean the number of arithmetic operations including comparisons on elements of the ring generated by the coefficients of the input polynomials (those describing the input sets). Thus, we are only counting the cost of computing the different triangulations, and not the cost of performing the linear algebra over Q in order to determine the Betti numbers. This is because the cost of the algebraic operations usually far outweigh the cost of integer arithmetic. However, we also provide bounds on the cost of doing the linear algebra separately. We prove the following theorem. Theorem 4. S Let S1 ; y; Sn CRk be compact semi-algebraic sets of constant description complexity and let S ¼ 1pipn Si ; and 0pcpk 1: Then, there is an algorithm to compute b0 ðSÞ; y; bc ðSÞ; whose complexity is Oðncþ2 Þ:
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
249
The idea of using filtrations for computing Betti numbers has been used in [10] for incremental algorithms for computing the homology groups of certain complexes in low dimensions. However, our techniques in this paper are quite different. Also note that, efficient decomposition of an arrangement of n algebraic surfaces of constant degree in Rk ; into simple cells remains one of the outstanding open problems in computational geometry. Here by simple we mean that the individual cells should be describable in terms of a fixed number of polynomials of fixed degree (independent of n). The dependence on the degrees of the input polynomials is allowed to be doubly exponential in k or even worse. The main conjecture in this area is that there exists such a decomposition of size Oðnk Þ; which is also a bound on the Betti numbers of such an arrangement. Such a decomposition would lead to more efficient algorithms for a host of different problems in computational geometry. Even though in this paper, we do not produce a decomposition of the whole arrangement of size Oðnk Þ; we prove that Oðnkþ1 Þ independent decompositions are enough to compute important topological information about the arrangement (namely the Betti numbers). Finally, computing the Betti numbers of semi-algebraic sets in single exponential time is a major open question in algorithmic semi-algebraic geometry. The algorithm described in this paper does not answer this question, as we use triangulations whose sizes are doubly OðkÞ exponential in the dimension; their sizes are bounded by d 2 ; where d is a bound on the degrees of the defining polynomials. However, as is usual in computational geometry we will assume that the degree d of the defining polynomials, as well as the dimension k are fixed constants and hence these triangulations are of sizes Oð1Þ for the purposes of this paper. We assume that the reader is familiar with the notions of simplicial complexes, triangulations of semi-algebraic sets and simplicial co-homology theory. We refer the reader to [5,18] for a more detailed exposition of these topics. The rest of the paper is organized as follows. In Section 2, we state a result on triangulations of semi-algebraic sets which we will use heavily in the rest of the paper. We also describe an algebraic subroutine used to compute homomorphisms between the co-chain complexes of two triangulations, one of which is a refinement of the other. In Section 3, we define double complexes of vector spaces and associated filtrations giving rise to two spectral sequences associated with any double complex. We state without proving some basic facts about spectral sequences, using [16] as our reference. In Section 4, we describe the generalized Mayer–Vietoris exact sequence and the double complex associated to it. Finally, in Section 5 we describe our algorithm for computing the Betti numbers of a union of semi-algebraic sets, each of constant description complexity.
2. Semi-algebraic triangulations Given a simplicial complex K; we will denote by C i ðKÞ the Q-vector space of i co-chains of K (that is the dual vector space to the vector space of formal Q-linear combinations of the i-simplices in K), and denote by C ðKÞ the direct sum "i C i ðKÞ:
ARTICLE IN PRESS 250
S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
2.1. Triangulation of semi-algebraic sets A triangulation of a compact semi-algebraic set S is a simplicial complex D together with a semi-algebraic homeomorphism from jDj to S: Given such a triangulation we will often identify the simplices in D with their images in S under the given homeomorphism, and will refer to the triangulation by D: Given a triangulation D; the co-homology groups H i ðSÞ are isomorphic to the simplicial cohomology groups H i ðDÞ of the simplicial complex D and are in fact independent of the triangulation D: We call a triangulation h1 : jD1 j-S of a semi-algebraic set S; to be a refinement of a triangulation h2 : jD2 j-S if for every simplex s1 AD1 ; there exists a simplex s2 AD2 such that h1 ðs1 ÞCh2 ðs2 Þ: If D1 ; D2 are two triangulations of a compact semi-algebraic set S; and D1 is a refinement of D2 ; then there exists a homomorphism l : C ðD2 Þ-C ðD1 Þ; such that the induced map l : H ðD2 Þ-H ðD1 Þ is an isomorphism [18]. Identifying the simplices of Di with their images under the homeomorphisms hi ; the homomorphism l is obtained as follows. We first choose a simplicial map, l# : C ðD1 Þ-C ðD2 Þ which is a simplicial approximation to the # # identity [18]. For any vertex vAD1 we define lðvÞ ¼ v if v is also a vertex of D2 ; else lðvÞ is chosen to be any vertex of the simplex of D2 containing v in its interior. Finally, for a simplex # 0 ; y; vp Þ ¼ ½lðv # 0 Þ; y; lðv # p Þ; and l# is extended to C ðD1 Þ by s ¼ ½v0 ; y; vp of D1 ; lð½v linearity. Clearly, l# is a simplicial approximation to the identity map and hence induces an isomorphism between the homology groups H ðD1 Þ and H ðD2 Þ: Finally, l is the homomorphism # dual to l: For future reference, we record the algorithm described above as a subroutine. Refinement Subroutine Input: Two semi-algebraic triangulations, D1 ; D2 ; of a compact semi-algebraic set SCRk ; such that D1 is a refinement of D2 : Output: For each q; 0pqpk; the matrix for homomorphisms, lq : C q ðD2 Þ-C q ðD1 Þ; such that the induced map l q : H q ðD2 Þ-H q ðD1 Þ is an isomorphism. # # Procedure: ¼ v; if v is also a vertex of D2 : Else, let lðvÞ be any For each vertex vAD1 ; let lðvÞ vertex of the simplex of D2 containing v in its interior. For each simplex # 0 ; y; vq Þ ¼ ½lðv # 0 Þ; y; lðv # q Þ: For each q; 0pqpk; s ¼ ½v0 ; y; vq of D1 ; let lð½v compute the matrix Mq of the linear transformation l# q : Output the matrices, Mqt ; corresponding to the dual homomorphisms. Let S1 CS2 be two compact semi-algebraic subsets of Rk : We say that a semi-algebraic triangulation h : jDj-S2 of S2 ; respects S1 if for every simplex sAD; hðsÞ-S1 ¼ hðsÞ or |: In this case, h1 ðS1 Þ is naturally identified with a sub-complex of D and hjh1 ðS1 Þ : h1 ðS1 Þ-S1 is a semialgebraic triangulation of S1 : We will refer to this sub-complex by DjS1 :
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
251
We will need the following theorem which can be deduced from Section 9.2 in [6] (see also [5]) and the Refinement Subroutine described above. Theorem 5. Let S1 CS2 CRk be closed and bounded semi-algebraic sets, and let hi : Di -Si ; i ¼ 1; 2 be semi-algebraic triangulations of S1 ; S2 : Then, there exists a semi-algebraic triangulation h : D-S2 of S2 ; such that D respects S1 ; D is a refinement of D2 ; and DjS1 is a refinement of D1 : Moreover, there exists an algorithm which computes such a triangulation and if the sets S1 ; S2 ; as well as the triangulations D1 ; D2 are of constant description complexity, then the triangulation D produced by the algorithm is also of constant description complexity. Also, all the homomorphisms in the following diagram:
are all computable in constant time. (Here the vertical homomorphisms l2 ; l1 are as described above and r is induced by restriction.) Note that, if S1 and S2 are each defined by at most s1 polynomials of degrees at most d1 ; and the given triangulations h1 ; h2 are defined in terms of s2 polynomials of degrees at most d2 ; then the complexity of the algorithm in Theorem 5, the size of the triangulation D; as well as the number of OðkÞ
polynomials defining D are all bounded by ðs1 d1 þ s2 d2 Þ2
: Moreover, the degrees of the OðkÞ
polynomials appearing in the definition of D are bounded by ðd1 þ d2 Þ2
:
3. Double complexes In this section, we introduce the basic notions of a double complex of vector spaces and associated spectral sequences:
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
252
A double complex is a bi-graded vector space, C ¼ "C p;q ; with co-boundary operators d : C p;q -C p;qþ1 and d : C p;q -C pþ1;q and such that dd þ dd ¼ 0: In our case, the double complex would be a single quadrant double complex, which means that we can assume that C p;q ¼ 0 if either po0 or qo0: Out of a double complex, we can form an ordinary complex of vector spaces, namely the associated total complex, which is a graded vector space, defined by C n ¼ "pþq¼n C p;q ; with coboundary operator D ¼ d þ d : C n -C nþ1 :
There is a natural decreasing filtration that we can define on the associated total complex, by restricting p to be greater or equal k: We denote by Ckn the nth graded piece of this complex. In other words, Ckn ¼ "pþq¼n;pXk C p;q : We denote Zkn ¼ fzACkn j Dz ¼ 0g; Bn ¼ DCn1 ; and Hkn ¼ Zkn =Zkn -Bn :
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
253
n n We thus have a decreasing filtration, ?*Hk1 *Hkn *Hkþ1 ? of the co-homology group HDn ðCÞ: n by H k;nk : We denote the successive quotients Hkn =Hkþ1
The Leray spectral sequence is a sequence of complexes ðEr ; dr Þ such that Erþ1 ¼ Hdr ðEr Þ: Any element in C n ¼ "iþj¼n C i;j will have a leading term at a position ðp; qÞ; where p denotes the smallest i such that the component at position ði; n iÞ does not vanish. Let Z p;q denote the set of the ðp; qÞ components of co-cycles whose leading term is at position 0 0 ðp ; q Þ; with p0 Xp and p0 þ q0 ¼ p þ q: In other words, Z p;q denotes the set of all aAC p;q such that the following system of equations has a solution: da ¼ 0; da ¼ dað1Þ ; dað1Þ ¼ dað2Þ ; dað2Þ ¼ dað3Þ ; ^
ð1Þ
Here, aðiÞ AC pþi;qi : Hence, the element a"að1Þ "að2Þ ? lies in Zppþq with aAZ p;q : Similarly, let Bp;q CC p;q consist of all b with the property that the following system of equations admits a solution: dbð0Þ þ dbð1Þ ¼ b; dbð1Þ þ dbð2Þ ¼ 0; dbð2Þ þ dbð3Þ ¼ 0; ^
ð2Þ
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
254
Here, bðiÞ AC pi;qþi1 : It is easy to see that, H p;q DZp;q =Bp;q : Now, let Zrp;q ¼ faAC p;q j(ðað1Þ ; y; aðr1Þ jða; að1Þ ; y; aðr1Þ Þ satisfies Eqs: ð1Þg: Also, let p;q ð0Þ ð1Þ Bp;q ; yÞjðb; bð0Þ ; bð1Þ ; yÞ r ¼ fbAC j(ðb ; b
satisfies Eqs: ð2Þ with br ¼ brþ1 ¼ ? ¼ 0g: We thus have a sequence of vector subspaces of C p;q ; satisfying p;q p;q p;q p;q p;q Bp;q 1 CB2 C?CB CZ CZ1 C?CC :
The ðp; qÞth graded piece, Erp;q ; of the rth element, Er ; of the spectral sequence is defined by p;q Erp;q ¼ Zrp;q =Bp;q ¼ Z p;q =Bp;q : r : It should be seen as an approximation to H p;q We will now define the differentials dr : Let ½aAEr for some aAZrp;q : Then, there exists að1Þ ; y; aðr1Þ satisfying Eqs. (1). It is a fact (see [16]) that the homomorphism, dr : Erp;q -Erpþr;qrþ1 (see Fig. 2), defined by dr ½a ¼ ½daðr1Þ AErpþr;qrþ1 ;
ð3Þ
is well-defined (that is independent of the choice of the representative a). The sequence of graded complexes, ðEr ; dr Þ; where the complex Erþ1 is obtained from Er by taking its homology with respect to dr (that is Erþ1 ¼ Hdr ðEr ÞÞ is called the spectral sequence associated to the double complex C p;q : Observe that the homomorphism dr takes Erp;q to Erpþr;qrþ1 ; and hence if the double complex p;q p;q p;q ¼ EN for such C is non-zero in only the first quadrant, then dr ¼ 0 for all r4q þ 1: Thus, Eqþ2 complexes. q
d1 d2 d3 d4
p + q = l
p p + q = l + 1
Fig. 2. dr : Erp;q -Erpþr;qrþ1 :
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
255
4. The Mayer–Vietoris double complex In this section, we describe the double complex of interest to us—namely, the one arising from the Mayer–Vietoris exact sequence. Let A1 ; y; An be sub-complexes of a finite simplicial complex A such that A ¼ A1 ,?,An : Note that the intersections of any number of the sub-complexes, Ai ; is again a sub-complex of A: We will denote by Aa0 ;y;ap the sub-complex Aa0 -?-Aap : Let C i ðAÞ denote the Q-vector space of i co-chains of A; and C ðAÞ ¼ "i C i ðAÞ: We will denote by d : C q ðAÞ-C qþ1 ðAÞ the usual co-boundary homomorphism. More precisely, given oAC q ðAÞ; and a q þ 1 simplex ½a0 ; y; aqþ1 AA; X ð1Þi oð½a0 ; y; aˆ i ; y; aqþ1 Þ ð4Þ doð½a0 ; y; aqþ1 Þ ¼ 0pipqþ1
(here and everywhere else in the paper 4 denotes omission). Now extend do to a linear form on all of Cqþ1 ðAÞ by linearity, to obtain an element of C qþ1 ðAÞ: Recall that a sequence of vector space homomorphisms di1
diþ1
di
? ! Vi ! Viþ1 ! ? is said to be exact if kerðdi Þ ¼ Imðdi1 Þ for each i: The Mayer–Vietoris exact sequence is an exact sequence of vector spaces, each of the form "a0 o?oap C ðAa0 ;y;ap Þ: (Here and everywhere else in the paper ‘‘"’’ denotes the direct sum of vector spaces.) The connecting homomorphisms are ‘‘generalized’’ restrictions and will be defined below. Consider the following sequence of homomorphisms. r
d
d
0-C ðAÞ ! "a0 C ðAa0 Þ ! "a0 oa1 C ðAa0 ;a1 Þ? !; d
d
"a0 o?oap C ðAa0 ;y;ap Þ ! "a0 o?oapþ1 C ðAa0 ;y;apþ1 Þ ! ?; where r is induced by restriction and the connecting homomorphisms d are defined below. Given an oA"a0 o?oap C q ðAa0 ;y;ap Þ we define dðoÞ as follows: First note that dðoÞA"a0 o?oapþ1 C q ðAa0 ;y;apþ1 Þ; and it suffices to define dðoÞa0 ;y;apþ1 for each p þ 2-tuple 0pa0 o?oapþ1 pn: Note that, dðoÞa0 ;y;apþ1 is a linear form on the vector space, Cq ðAa0 ;y;apþ1 Þ; and hence is determined by its values on the q-simplices in the complex Aa0 ;y;apþ1 : Furthermore, each q-simplex, sAAa0 ;y;apþ1 is automatically a simplex in each of the complexes Aa0 ;y;#ai ;y;apþ1 ; 0pipp þ 1: We define X ðdoÞa0 ;y;apþ1 ðsÞ ¼ ð1Þi oa0 ;y;#ai ;y;apþ1 ðsÞ: 0pippþ1
It was shown in [3] that Lemma 1. The sequence defined above is exact.
ARTICLE IN PRESS 256
S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
We now consider the following bi-graded double complex Mp;q ; with a total differential D ¼ d þ ð1Þp d; where Mp;q ¼ "1pa0 o?oap pn C q ðAa0 ;y;ap Þ;
Interchanging the roles of the horizontal and the vertical differentials, we obtain two spectral sequences, ðEr0 ; dr0 Þ; ðEr ; dr Þ; associated with Mp;q both converging to HD ðMÞ: The first terms of these are E10 ¼ Hd M; E20 ¼ Hd Hd M; and E1 ¼ Hd M; E2 ¼ Hd Hd M: Because of the exactness of the generalized Mayer–Vietoris sequence, we have that, E10 is
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
and E20 is
The degeneration of this sequence at E20 shows that HD ðMÞDH ðAÞ: The initial term E1 of the second spectral sequence is given by
257
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
258
5. Computing the Betti numbers Let S1 ; y; Sn CRk be compact semi-algebraic sets of constant description complexity. We now describe our algorithm for computing bc ðSÞ: Our approach is to calculate the ranks of the various Erp;q ; noting that in order to compute p;cp ; 0pppc: The rank of cth co-homology group of bc ðSÞ it suffices to compute the ranks of Ecpþ2 S is equal to X p;q rankðEqþ2 Þ: pþq¼c
We first describe the computation of E1 in details and then describe the general algorithm. S T For JCf1; y; ng; we denote by TJ (respectively, SJ ) the set jAJ Sj (respectively, jAJ Sj ). For each j; 0pjpc þ 1; and for each ð j þ 1Þ-tuple ði0 ; y; ij Þ with 1pi0 oi1 o?oij pn; we compute a semi-algebraic triangulation Dji0 ;y;ij of the set Tfi0 ;y;ij g ¼ Si0 ,?,Sij ; such that for each JCfi0 ; y; ij g; Ja|; Dji0 ;y;ij respects TJ and Dji0 ;y;ij jTJ is a refinement of the triangulation jJj1
DJ : Using the Refinement Subroutine we compute the matrix of the homomorphisms jJj1
l : C ðDJ
jSJ Þ-C ðDji0 ;y;ij jSJ Þ:
Let D be a semi-algebraic triangulation (which we do not compute) of S ¼ respects the sets Tfi0 ;y;ij g and such that DjTfi ;y;i g is a refinement of Dji0 ;y;ij : 0
S
1pipn
Si ; which
j
Let A be the simplicial complex corresponding to the triangulation D; and A1 ; y; An the subcomplexes corresponding to the sets S1 ; y; Sn : Since the triangulation D respects the sets Si ; it is clear that each set Si gives rise to a sub-complex of A: Now consider the Mayer–Vietoris double complex M corresponding to A1 ; y; An and the spectral sequence E associated with it. The first term of the spectral sequence is E1 ¼ Hd ðMÞ after taking the vertical co-homology. We will compute the successive terms of this spectral sequence starting from E1 : The term E1p;q in the spectral sequence is the vector space "0pi0 o?oip pn H q ðAi0 ;y;ip Þ: Now, the sub-complex Ai0 -?-Aip corresponds to the set Si0 ;y;ip and we have a basis for H q ðSi0 ;y;ip Þ in terms of p-co-chains in the co-chain complex C q ðDpi0 ;y;ip jSi ;y;ip Þ: 0 Note that, even though we do not have in hand the triangulation D of the whole arrangement, we are still able to compute the ranks of E1p;q using the triangulations Dpi0 ;y;ip and computing bases for the different H q ðDpi0 ;y;ip jSi ;y;ip Þ; in terms of the q-co-chains in C q ðDpi0 ;y;ip jSi ;y;ip Þ: 0
0
We next show how to compute the ranks of the different E2p;q : We compute a basis for the vector subspaces Z2p;q ; Bp;q 2 of "1pi0 o?oip pn C q ðDpi0 ;y;ip jSi ;y;ip Þ 0
as follows.
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
259
The vector space Z2p;q is the set of all aA"1pi0 o?oip pn C q ðDpi0 ;y;ip jSi ;y;ip Þ such that the 0 following system of equations has a solution: da ¼ 0; d 3 lðaÞ ¼ dað1Þ : Here, d is the co-boundary homomorphism in the various "1pi0 o?oip pn C q ðDpi0 ;y;ip jSi ;y;ip Þ 0
and l the homomorphisms l : "1pi0 o?oip pn C q ðDpi0 ;y;ip jSi ;y;ip Þ-"i0 ;y;ip C q ðDpþ1 i0 ;y;ipþ1 jSi ;y;ip Þ: 0
0
Note that the two sides of each of the above equations indeed lie in the same vector space. p q Similarly, Bp;q 2 is the set of all aA"i0 ;y;ip C ðDi0 ;y;ip jSi0 ;y;ip Þ such that the following system of equations has a solution dbð0Þ þ d 3 lðbð1Þ Þ ¼ b; bðiÞ ¼ 0;
iX2:
The homomorphisms d in the above equations are the ordinary co-boundary homomorphisms. Thus, d ¼ "1pi0 o?oip pn di0 ;y;ip ; where each di0 ;y;ip : C q ðDpi0 ;y;ip jSi ;y;ip Þ-C qþ1 ðDpi0 ;y;ip jSi ;y;ip Þ 0
0
is as defined in Eq. (4). We next consider the homomorphisms d3l: First note that we can compute the matrix corresponding to the homomorphism j Þ-"1pi0 o?oipþ1 pn C q ðDpþ1 d : "1pi0 o?oip pn C q ðDipþ1 i0 ;y;ipþ1 jSi ;y;i 0 ;y;ip Si ;y;ip 0
0
pþ1 q in the basis of C q ðDpþ1 i0 ;y;ip jSi ;y;ip Þ; C ðDi0 ;y;ipþ1 jSi ;y;i 0
pþ1
0
pþ1
Þ
Þ:
For aA"1pi0 o?oip pn C q ðDpi0 ;y;ip jSi ;y;ip Þ; 0
let
ai0 ;y;ip
be
the
component
of
a
in
C q ðDpi0 ;y;ip jSi ;y;ip Þ 0
and
let
a0i0 ;y;ip ;ipþ1 ¼
lðai0 ;y;ip ÞAC q ðDpþ1 i0 ;y;ip ;ipþ1 jSi ;y;ip Þ; computed using the Refinement Subroutine, with input the 0
p triangulations Dpþ1 i0 ;y;ip ;ipþ1 jSi0 ;y;ip and Di0 ;y;ip jSi0 ;y;ip : Let
j rða0i0 ;y;ip ;ipþ1 ÞAC q ðDipþ1 0 ;y;ipþ1 Si ;y;i 0
pþ1
Þ
be the image of a0i0 ;y;ip ;ipþ1 under the restriction homomorphism. Let Zi0 ;y;ip ;ipþ1 : C q ðDpi0 ;y;ip jSi ;y;ip Þ-C q ðDpþ1 i0 ;y;ipþ1 jSi ;y;i 0
0
pþ1
Þ
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
260
denote the homomorphism which takes ai0 ;y;ip /rða0i0 ;y;ip ;ipþ1 Þ: Then, d3lðaÞi0 ;y;ipþ1 ¼
X
ð1Þj Zi0 ;y;iˆj ;y;ipþ1 ;ij ðai0 ;y;iˆj ;y;ipþ1 Þ:
0pjppþ1
We have the following commutative diagram:
The vertical homomorphisms, l; are as in Theorem 5 and induce isomorphisms in the co-homology groups. The horizontal homomorphisms, r; are induced by restriction. We compute the ranks of the vector spaces Z2p;q and Bp;q 2 using Gaussian elimination on the matrices corresponding to the above systems of equations, and rankðE2p;q Þ ¼ rankðZ2p;q Þ rankðBp;q 2 Þ: Similarly, we can compute Er for 1prpc þ 2; by computing the sequence a; að1Þ ; að2Þ ; y; aðr1Þ as well as the sequence b; bð0Þ ; bð1Þ ; y; bðrþ1Þ : The crucial observation here is that Erp;q can be computed just from the data of the various local triangulations, Dpþr1 i0 ;y;ipþr1 : The rank of the cth co-homology group of S is equal to X p;q rankðEqþ2 Þ: pþq¼c p;cp Thus, in order to compute bc ðSÞ it suffices to compute the ranks of Ecpþ2 ; 0pppc; and hence we do not have to consider intersections of more than c þ 2 sets at a time. We now give a formal description of the algorithm.
Algorithm Betti Input: A number c; 0pcpk 1; and the various triangulations, Dpi0 ;y;ip ; 0pppc þ 1: Output: bc ðSÞ: Procedure: For each p; 0pppc; let q ¼ c p and r ¼ c p þ 2: Compute bases for vector p q subspaces Zrp;q ; Bp;q r of "i0 ;y;ip C ðDi0 ;y;ip jSi ;y;ip Þ as follows. 0
The vector space Zrp;q is the set of all aA"i0 ;y;ip C q ðDpi0 ;y;ip jSi ;y;ip Þ such that the 0 following system of equations has a solution: da ¼ 0;
ARTICLE IN PRESS S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
d 3 lðaÞ ¼ dað1Þ ; ^ d 3 lðaðrÞ Þ ¼ daðr1Þ : Here, d is the co-boundary homomorphism "i0 ;y;ip C q ðDpi0 ;y;ip jSi ;y;ip Þ and l the homomorphisms
261
in
the
various
0
l : "i0 ;y;ip C q ðDpi0 ;y;ip jSi ;y;ip Þ-"i0 ;y;ip C q ðDpþ1 i0 ;y;ipþ1 jSi ;y;ip Þ: 0
0
Similarly, Bp;q is the set of all aA"i0 ;y;ip C q ðDpi0 ;y;ip jSi ;y;ip Þ such that the r 0 following system of equations has a solution: dbð0Þ þ d3lðbð1Þ Þ ¼ b; ^ dbðrþ2Þ þ d3lðbðrþ1Þ Þ ¼ 0; bðiÞ ¼ 0; iXr: using Gaussian Compute the ranks of the vector spaces Zrp;q and Bp;q r elimination and output P p;cp p;cp 0pppc ðrankðZcpþ2 Þ rankðBcpþ2 ÞÞ:
5.1. Complexity We only count the number of arithmetic operations in the ring of the co-efficients. Since each triangulation takes Oð1Þ time, it suffices to count the number of distinct triangulations we need to p;cp : compute the ranks of Ecpþ2 P The triangulations needed are computed at the beginning, and there are 1pjpcþ2 ðnjÞ ¼ Oðncþ2 Þ of these. Thus, the total number of triangulations needed is Oðncþ2 Þ: p;cp are The dimensions of the matrices whose ranks are computed in the computation of Ecpþ2 pþ1 pþ2 pþ1þcpþ1 þn þ?þn Þ: Thus, the Gaussian elimination is applied to bounded by Oðn cþ2 matrices of size at most Oðn Þ: Also, note that if each of the sets Si are defined by at most s polynomials of degree at most d; then the complexity of computing each of the different triangulations Dji0 ;y;ij is Oðk2 Þ
bounded by ðsdÞ2 : This is a consequence of the complexity estimate following Theorem 5. Thus, the constant hidden in the big-Oh notation has a dependence on s; d of the form ðsdÞ2
Oðk2 Þ
:
Acknowledgments This research was partially supported by NSF Grant CCR-0049070 and by NSF Career Award CCR-0133597.
ARTICLE IN PRESS 262
S. Basu / Journal of Computer and System Sciences 67 (2003) 244–262
References [1] P.K. Agarwal, M. Sharir, Arrangements of surfaces in higher dimensions, in: J.R. Sack (Ed.), Handbook of Computational Geometry, North-Holland, Amsterdam. [2] S. Basu, On the combinatorial and topological complexity of a single cell, Discrete Comput. Geom. 29 (2003) 41–59 (Preliminary version in Proceedings of the Symposium on the Foundations of Computer Science (FOCS), 1998, pp. 606–616). [3] S. Basu, On different bounds on different Betti numbers, Discrete Comput. Geom. 30 (2003) 65–85 (Preliminary version in Proceedings of the ACM Symposium on Computational Geometry, 2001, pp. 288–292). Available at www.math.gatech.edu/~saugata/journalsocg01.ps. [4] S. Basu, R. Pollack, M.-F. Roy, Computing roadmaps of semi-algebraic sets on a variety, J. Amer. Math. Soc. 13 (2000) 55–82. [5] S. Basu, R. Pollack, M.-F. Roy, Algorithms in real algebraic geometry, in: Algorithms and Computations in Mathematics, Vol. 10, Springer-Verlag, Berlin, 2003. [6] J. Bochnak, M. Coste, M.-F. ROY, Ge´ome´trie alge´brique re´elle, Springer, Berlin, 1987; Real Algebraic Geometry, Springer, Berlin, 1998. [7] B. Chazelle, H. Edelsbrunner, L.J. Guibas, M. Sharir, A single-exponential stratification scheme for real semialgebraic varieties and its applications, Theoret. Comput. Sci. 84 (1991) 77–105. [8] G. Collins, Quantifier elimination for real closed fields by cylindric algebraic decomposition, in: Second GI Conference on Automata Theory and Formal Languages, Lecture Notes in Computer Science, Vol. 33, Springer, Berlin, 1975, pp. 134–183. [9] H. Edelsbrunner, The union of balls and its dual shape, Discrete Computational Geom. 13 (1995) 415–440. [10] H. Edelsbrunner, D. Letscher, A. Zomorodian, Topological persistence and simplification, Proceedings of the Symposium on Foundations of Computer Science, Redondo Beach, CA, 2000, pp. 454–463. [11] D. Halperin, Arrangements, in: J. O’Rourke, J.E. Goodman (Eds.), Handbook of Discrete and Computational Geometry, CRC Press, Boca Raton, FL, 1997. [12] D. Halperin, M. Sharir, Almost tight upper bounds for the single cell and zone problems in three dimensions, Discrete Comput. Geom. 14 (1995) 385–410. [13] V. Koltun, Almost tight upper bounds for vertical decompositions in four dimensions, Proceedings of the Symposium on the Foundations of Computer Science, Las Vegas, NV, 2001. [14] J. Leray, L’anneau d’homologie d’une representation, C. R. Acad. Sci. Paris 222 (1946) 1366–1368. [15] J. Leray, Structure de l’anneau d’homologie d’une representation, C. R. Acad. Sci. Paris 222 (1946) 1419–1422. [16] J. McCleary, A User’s Guide to Spectral Sequences, 2nd Edition, Cambridge Studies in Advanced Mathematics, 2001. [17] J. Milnor, On the Betti numbers of real varieties, Proc. Amer. Math. Soc. 15 (1964) 275–280. [18] J.R. Munkres, Elements of Algebraic Topology, Addison–Wesley, Reading, MA, 1984. [19] O.A. Oleinik, I.B. Petrovskii, On the topology of real algebraic surfaces, Izv. Akad. Nauk SSSR 13 (1949) 389–402. [20] P. Orlik, H. Terao, Arrangements of Hyperplanes, Springer, Berlin, 1992. [21] J. Rotman, An Introduction to Algebraic Topology, Springer, Berlin, 1988. [22] J. Schwartz, M. Sharir, On the ‘Piano Mover’s Problem’II. General techniques for computing topological properties of real algebraic manifolds, Adv. Appl. Math. 12 (1983) 298–351. [23] M. Sharir, Arrangements of surfaces in higher dimensions, in: B. Chazelle, J.E. Goodman, R. Pollack (Eds.), Advances in Discrete and Computational Geometry, Contemporary Mathematics, Vol. 223, Amer. Math. Soc., Providence, RI, 1999, pp. 335–354. [24] R. Thom, Sur l’homologie des varieties algebriques reelles, in: S.S. Cairns (Ed.), Differential and Combinatorial Topology, Princeton University Press, Princeton, NJ, 1965, pp. 255–265.