1 Introduction

Setting aside technicalities for the moment, an n-dimensional stratification of a given topological space \(\mathrm {X}\) is a nested sequence of closed subspaces

$$\begin{aligned} \varnothing = \mathrm {X}_{-1} \subset \mathrm {X}_0 \subset \cdots \subset \mathrm {X}_n = \mathrm {X}\end{aligned}$$

where each successive difference \(\mathrm {X}_d - \mathrm {X}_{d-1}\) resembles a (possibly empty) d-dimensional manifold whose connected components are the d-dimensional strata. The details which have been suppressed are designed to guarantee the uniformity of small neighborhoods around points in a given stratum. Stratified spaces are of fundamental importance in any branch of mathematics which seriously confronts singularities. Every topological manifold admits a straightforward stratification into its connected components; less trivially, the following spaces all admit, and are often analyzed using, stratifications: finite CW complexes, quotients of properly discontinuous Lie group actions on smooth manifolds, (semi)algebraic varieties and (sub)analytic sets.

The two-dimensional singular space below—let us call it \(\mathrm {Y}\)—is built by pinching a torus along a meridian and attaching a disk across an equator:

figure a

Any regular CW structure, such as the illustrated decomposition into little squares, constitutes a stratification of \(\mathrm {Y}\) where d-dimensional strata are precisely the d-cells; passing to a subdivision further refines this stratification in the sense that every new cell is entirely contained in the interior of an old cell. On the other hand, one can discover a much coarser stratification by examining the topology of small neighborhoods around points of \(\mathrm {Y}\). Up to homeomorphism, these fall into three different classes depending on whether the central point is at the pinch, on the singular equator, or on one of the manifold-like two-dimensional regions:

figure b

The neighborhoods above deformation retract onto their central vertices and are therefore contractible; however, their one-point compactifications (obtained by collapsing their boundaries to points) are new stratified spaces with potentially interesting topology. The compactified neighborhood around the pinch point is homeomorphic to two 2-spheres joined at their north and south poles with a spanning disk across the middle. The compactified neighborhood of any point in the singular equator resembles a 2-sphere whose interior has been partitioned into two by a disk. And finally, the compactified neighborhood around any point in either of the two-dimensional regions is homeomorphic to an ordinary 2-sphere:

figure c

Our main result here involves algorithmically recovering the coarsest stratification of a finite regular CW complex where all strata are unions of cells. This is called the canonical stratification of the complex; its existence and uniqueness for a special class of spaces (called pseudomanifolds) plays a central role in Goresky and MacPherson’s proof of the topological invariance of intersection homology [14, Sec 4]. Our argument, much like theirs, has an intuitive geometric core but invokes algebraic and categorical machinery. For the purposes of this introductory section, we focus on geometry and ask: Given a finite cellulation of \(\mathrm {Y}\), how might one identify the canonical strata and determine which cells lie in each canonical stratum, as shown below?

figure d

(Since the pinch point has a different compactified neighborhood than a generic point on the singular equator, it must constitute a separate stratum.)

In light of the discussion above, one hopes to recover canonical strata by clustering together cells whenever they exhibit similar compactified neighborhoods. But already in this example, we encounter two significant difficulties: First, the compactified neighborhoods do not distinguish cells in the two 2-strata from each other. The second difficulty is somewhat subtler—although the compactified neighborhoods of cells in the 0-stratum and 1-stratum are not homeomorphic, both are homotopy-equivalent to a wedge of two 2-spheres. Therefore, they cannot be distinguished by weaker, more computable topological invariants such as cohomology. We tackle the first problem by constructing a complex of cosheaves which encodes how local topology varies across cells, and we bypass the second problem by working exclusively in the category of cohomologically stratified spaces.

Consider the task of determining the canonical stratification of a finite-dimensional regular CW complex \(\mathrm {X}\) into R-cohomology manifolds, where R is a fixed non-trivial commutative ring with unity. In this case, our complex of cosheaves assumes a particularly appealing form: It is a functor

$$\begin{aligned} \varvec{L}^\bullet :{{\mathbf{Fc}}}(\mathrm {X}) \rightarrow {{\mathbf{Ch}}}(R) \end{aligned}$$

from the poset of cells in \(\mathrm {X}\) (where \(x > y\) denotes that y is a face of x, or equivalently, that x is a co-face of y) to the category of lower-bounded R-module cochain complexes. To each cell x of \(\mathrm {X}\), it assigns a cochain complex \(\varvec{L}^\bullet (x)\):

where \(\varvec{L}^d(x)\) is the free R-module generated by all d-dimensional co-faces of x—in particular, the module \(\varvec{L}^d(x)\) is trivial for \(d < \dim x\) and \(d > \dim \mathrm {X}\). The co-differentials \(\beta ^\bullet _x\) are inherited verbatim from incidence degrees among cells of \(\mathrm {X}\) taking values in R. Thus, \(\varvec{L}^\bullet (x)\) computes the (reduced) cohomology of a compactified small open neighborhood around x in \(\mathrm {X}\). Given another cell y satisfying \(x \ge y\), there is an inclusion map

$$\begin{aligned} \varvec{L}^\bullet (x \ge y):\varvec{L}^\bullet (x) \hookrightarrow \varvec{L}^\bullet (y) \end{aligned}$$

arising from the fact that co-faces of x are also co-faces of y. Here is a simple version of our main result. (The full statement has been recorded in Theorem 5.10.)

Theorem 1.1

There is a category \(\varvec{S}\) obtained from \({{\mathbf{Fc}}}(\mathrm {X})\) by formally inverting a particular subset of those face relations \(x \ge y\) for which \(\varvec{L}^\bullet (x \ge y)\) induces isomorphisms on cohomology; two cells lie in the same canonical stratum of \(\mathrm {X}\) if and only if they are isomorphic in \(\varvec{S}\).

Before proceeding to the \(\varvec{L}^\bullet \)-induced definition of \(\varvec{S}\) and a proof of this theorem, we highlight three salient features. First, the construction of \(\varvec{S}\) is algorithmic and isomorphism classes of its objects are explicitly (and efficiently) computable. Second, the non-isomorphisms in \(\varvec{S}\) reveal when a canonical stratum contains another in its boundary. And third, our construction actually yields a nested sequence of intermediate categories

$$\begin{aligned} \varvec{S}_0 \hookrightarrow \varvec{S}_1 \hookrightarrow \cdots \hookrightarrow \varvec{S}_{\dim \mathrm {X}} = \varvec{S}, \end{aligned}$$

each of which receives a functor from \({{\mathbf{Fc}}}(\mathrm {X})\) compatible with the previous ones, and all the canonical strata of dimension exceeding \((\dim \mathrm {X}- d)\) may be recovered from certain isomorphism classes in \(\varvec{S}_d\).

This paper is organized as follows: Sect. 2 tersely collects relevant background material involving stratifications and cosheaves, while Sect. 3 describes the local cohomology complex of cosheaves \(\varvec{L}^\bullet \) associated with a regular CW complex \(\mathrm {X}\). In Sect. 4 we use \(\varvec{L}^\bullet \) to define an initial functor \({{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{S}_0\) via categorical localization and prove that the top-dimensional canonical strata of \(\mathrm {X}\) correspond bijectively with isomorphism classes of (images of) top-cells in \(\varvec{S}_0\). Section 5 contains the heart of our argument: It concludes the proof of Theorem 1.1 by describing the inductive construction of \({{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{S}_{d}\) from the previous \({{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{S}_{d-1}\). The final Sect. 6 may be read independently of the preceding ones—it is devoted to computational matters and includes an efficient distributed algorithm for recovering canonical strata in practice.

1.1 Context

Our goal is to provide a principled topological pre-processor for various manifold learning algorithms. The fundamental aim of manifold learning is to automatically infer the intrinsic dimension of a compact submanifold M (often with boundary) of Euclidean space from a finite point sample \(P \subset \mathbb {R}^n\) lying on, or at least near, M. An enormous amount of work has been done in this field, and we will make no attempt to even summarize it here—the curious reader is referred to [19] and its myriad citations. In most cases, one constructs a graph around the points in P by inserting all edges of Euclidean length bounded above by a parameter threshold \(\epsilon > 0\). Shortest paths along this graph then serve as proxies for intrinsic geodesics of M and are used to find distance-preserving projections to lower-dimensional subspaces of \(\mathbb {R}^n\) via spectral methods.

When M is not a single manifold, but rather a union of different manifolds across several dimensions, our standard manifold learning methods necessarily result in over-fitting along regions where M has low intrinsic dimension. Theorem 1.1 provides a remedy by conferring the ability to partition the Delaunay triangulation [23, Ch 5] around P at radius \(\epsilon \) into distinct clusters, each of which is guaranteed to lie on a cohomology manifold of known dimension.Footnote 1 These clusters may then be independently subjected to standard manifold learning techniques. Perhaps more important from a practical perspective is the fact that the computations involved in partitioning P are easily distributed across several processors. And as a straightforward by-product, one also gains the capacity to identify (those points of P which lie in) every anomalous, singular region of M.

There now exists a substantial body of work where filtered (co)homology groups of cell complexes built around data points play a central role [3, 8, 12]. With the knowledge of canonical strata of such cell complexes comes the prospect of efficiently computing far more refined topological invariants such as intersection cohomology [13] groups. Also accessible, thanks to suitable flavors of Morse theory [21, 22], is the ability to cluster canonical d-strata by \((d+1)\)-dimensional cobordisms internal to the ambient dataset.

2 Preliminaries

Our primary references for stratification theory are [15, 18], and [30]; for categorical localization see [7] and [10]; and for cellular (co)sheaves see [4] and [25]. The interplay between cell structures and general stratifications on the same underlying space has been explored thoroughly in [26]. Here we will be concerned entirely with cohomologically stratified spaces, which the reader may have encountered before in [14, Sec 4.1], [11, Sec 3.3] or [24, Sec 5].

2.1 Cohomological Stratifications

Fix a non-trivial commutative ring R with identity, and recall that an R-cohomology manifold of dimension \(d \ge 0\) is a locally compact Hausdorff topological space \(\mathrm {Z}\) where each point z has an open neighborhood \(\mathrm {U}_z \subset Z\) whose compactly supported R-valued cohomology agrees with that of d-dimensional Euclidean space \(\mathbb {R}^d\), i.e.,

$$\begin{aligned} {H}_{\mathrm{c}}^\bullet \left( \mathrm {U}_z; R\right) \simeq {\left\{ \begin{array}{ll} R &{} \text { if } \bullet = d, \\ 0 &{} \text { otherwise. } \end{array}\right. } \end{aligned}$$
(1)

It is essential to use compactly supported (rather than ordinary singular) cohomology to detect d-dimensionality, since the usual cohomology of a d-dimensional open ball agrees with that of a point regardless of d. Readers unfamiliar with this notion may safely replace the compactly supported cohomology of any open set encountered henceforth by the standard cohomology of its one-point compactification relative to the additional point:

$$\begin{aligned} {H}_{\mathrm{c}}^\bullet \left( \mathrm {U}_z; R\right) \simeq H^\bullet \left( \mathrm {U}_z\cup \{\infty \},\{\infty \};R\right) . \end{aligned}$$

Definition 2.1

An n-dimensional (cohomological) stratification of a locally compact Hausdorff topological space \(\mathrm {X}\) is an ascending sequence of closed subspaces

$$\begin{aligned} \varnothing = \mathrm {X}_{-1} \subset \mathrm {X}_{0} \subset \cdots \subset \mathrm {X}_{n-1} \subset \mathrm {X}_n = \mathrm {X}, \end{aligned}$$

where the connected components of each difference \((\mathrm {X}_d - \mathrm {X}_{d-1})\), called d-dimensional strata, are required to obey the following axioms.

  • Frontier if a stratum \(\sigma \) intersects the closure of another stratum \(\tau \), then in fact \(\sigma \) is completely contained in the closure of \(\tau \) and \(\dim \tau \ge \dim \sigma \) (with equality occurring if and only if \(\tau = \sigma \)). This relation, denoted by \(\tau \succeq \sigma \) henceforth, forms a partial order on the set of all strata.

  • Link for each d-stratum \(\sigma \), there exists an \((n-d-1)\)-dimensional stratified space \(\mathrm {L}= \mathrm {L}(\sigma )\), called the link of \(\sigma \):

    $$\begin{aligned} \varnothing = \mathrm {L}_{-1} \subset \mathrm {L}_0 \subset \cdots \subset \mathrm {L}_{n-d-1} = \mathrm {L}, \end{aligned}$$

    so that every open neighborhood around a point p in \(\sigma \) admits a basic open sub-neighborhood \(\mathrm {U}_p \subset \mathrm {X}\) with the following structure. The intersections \(\mathrm {U}_p \cap \mathrm {X}_i\) are empty for \(i < d\), while for \(d \le i \le n\) there are stratified quasi-isomorphisms of compactly supported singular cochain complexes (of R-modules):

    (2)

    where \(\mathscr {C}\mathrm {L}_\bullet \) denotes the open coneFootnote 2 on \(\mathrm {L}_\bullet \).

By quasi-isomorphism here (and elsewhere) we mean a cochain map which induces isomorphisms on all cohomology groups. The additional requirement that the maps from (2) be stratified means precisely that they behave naturally in three separate ways: They should be filtered, stratum-preserving and refinable as explained below.

  1. (1)

    They should respect (contravariant maps induced by) the inclusions \(\mathrm {L}_\bullet \subset \mathrm {L}_{\bullet +1}\) in their domains and \(\mathrm {X}_\bullet \subset \mathrm {X}_{\bullet +1}\) their codomains so that the following squares commute:

  2. (2)

    They should preserve strata in the sense that there exist surjective set-maps

    $$\begin{aligned} \Phi _i: \left\{ (i-d-1)-\text {strata of } \mathrm {L}\right\} \twoheadrightarrow \left\{ i-\text {strata } \tau \succeq \sigma \text { of } \mathrm {X}\right\} \end{aligned}$$

    so that for each i-stratum \(\tau \succeq \sigma \), the cochain maps from (2) restrict to quasi-isomorphisms

    $$\begin{aligned} {C}_{\mathrm{c}}^\bullet (\mathscr {C}\Phi ^{-1}_i(\tau ) \times \mathbb {R}^d) {\mathop {\longrightarrow }\limits ^{\simeq }} {C}_{\mathrm{c}}^\bullet (\mathrm {U}_p \cap \tau ). \end{aligned}$$
  3. (3)

    They should refine to smaller basic neighborhoods \(\mathrm {V}_p\) so that the following triangle of cochain maps commutes:

    Here the vertical map is induced by the inclusion \(\mathrm {V}_p \subset \mathrm {U}_p\), and since the triangle commutes, this map is forced to also be a quasi-isomorphism.

The best way to acquire intuition for these constraints is to examine (pictures of) links associated with singular strata in low-dimensional spaces.

Example 2.2

The decomposition of the space \(\mathrm {Y}\) from the Introduction into the pinch point, the equatorial circle, a disk 2-stratum and a toral 2-stratum is a cohomological stratification. The pinch point lies at the frontier of the equatorial circle, which in turn lies at the frontier of both 2-strata. The link \(\mathrm {L}\) of the singular equator (which we will call \(\sigma \) here) is a three-point space. An open cone on \(\mathrm {L}\) is therefore the union of three half-open intervals along a common boundary point. The product of this cone with the real line is homeomorphic to small neighborhoods around points in \(\sigma \):

figure e

From such a homeomorphism, one obtains the desired cohomological equivalence (2). This equivalence is

  • filtered, provided we stratify the open cone \(\mathscr {C}\mathrm {L}\) with one 0-stratum and three 1-strata (and the real line by a single 1-stratum),

  • stratum-preserving, provided that the map \(\Phi _2\) sends two of the points in \(\mathrm {L}\) to the toral 2-stratum and the third point to the disk 2-stratum, and

  • refinable, because one can shrink the neighborhood around \(\sigma \) by a small amount while still preserving the homeomorphism.

Remark 2.3

To see a non-example of a cohomological stratification, try combining the pinch point p of \(\mathrm {Y}\) with the singular equator \(\sigma \) into a single 1-stratum. The refinability constraint will not be satisfied in this case. In particular, given any point \(q \in \sigma \) near p with two basic neighborhoods \(V_q \subset U_q\) satisfying \(p \in U_q - V_q\), the inclusion of \(V_q\) into \(U_q\) fails to induce an isomorphism on two-dimensional compactly supported cohomology. Instead, one obtains a rank one map \(R^2 \rightarrow R^2\).

The following observations concern technical aspects of Definition 2.1.

  1. (1)

    By a theorem of Eilenberg and Zilber [9], links are well defined (only) up to filtered quasi-isomorphism type: We may replace \(\mathrm {L}\) by a filtered cochain complex by substituting a tensor product for the left side of (2).

  2. (2)

    The link axiom (when \(i = d\)) guarantees that each d-stratum is indeed a d-dimensional R-cohomology manifold.

  3. (3)

    This definition, unlike similar notions which typically appear in the intersection homology literature, does not require \(\mathrm {X}\) to be a pseudomanifold (see [14, Sec 1.1] for instance). In other words, \(\mathrm {X}_{n-1}\) need not equal \(\mathrm {X}_{n-2}\).

Every finite-dimensional regularFootnote 3 CW complex admits a cohomological stratification whose strata are the cells.

Definition 2.4

The skeletal stratification of a finite-dimensional regular CW complex \(\mathrm {X}\) is defined as follows: Writing the face partial order among cells as \(\ge \), we recall that each cell y of \(\mathrm {X}\) has

  • an open star \({\mathbf{st}}(y)\) containing all cells x which satisfy \(x \ge y\), and

  • a link \({\mathbf{lk}}(y)\), containing all cells x that share a co-face but no face with y.

The d-dimensional skeletal strata are the d-cells of \(\mathrm {X}\), and the frontier partial order coincides with \(\ge \). Since \({\mathbf{st}}(y)\) of a d-cell y is simultaneously homeomorphic to all sufficiently small neighborhoods around points in y and to \(\mathscr {C}{\mathbf{lk}}(y) \times \mathbb {R}^d\), the link \(\mathrm {L}(y)\) in the sense of Definition 2.1 is precisely \({\mathbf{lk}}(y)\).

We call one stratification a coarsening of another whenever each stratum of the former is a union of strata of the latter. All stratifications encountered henceforth will be coarsenings of the skeletal stratification for a fixed finite-dimensional regular CW complex \(\mathrm {X}\).

Definition 2.5

The canonical stratification of a finite-dimensional regular CW complex \(\mathrm {X}\) is the coarsest stratification of \(\mathrm {X}\) whose strata are all unions of cells.

It may not be immediately clear why canonical stratifications should exist at all. We will establish both their existence and uniqueness for regular CW complexes in the sequel via an explicit construction, which can be made efficiently algorithmic whenever the number of cells in \(\mathrm {X}\) is finite. The core of our construction is heavily inspired by Goresky and MacPherson’s proof that canonical\(\bar{p}\)-filtrations of stratified pseudomanifolds exist and are unique [14, Sec 4.2].

Remark 2.6

For readers familiar with the Goresky–MacPherson construction, there are two differences between their canonical \(\bar{p}\)-filtration proof and the argument that we will present in the sequel here. Namely,

  1. (1)

    since our starting point is a regular CW complex rather than a stratified pseudomanifold, we have direct recourse to the combinatorics of cell incidences which determine the topology of the underlying space, and

  2. (2)

    here we use the sheaf of compactly supported cellular cochains on the underlying space rather than the sheaf of intersection chains with respect to a perversity function \(\bar{p}:\mathbb {Z}_{\ge 2} \rightarrow \mathbb {Z}\).

Aside from these modifications, our arguments below will follow theirs quite closely.

The following result is a direct consequence of the frontier axiom from Definition 2.1 for cells lying in top strata.

Proposition 2.7

Let \(\mathrm {X}\) be a regular CW complex of dimension n equipped with any stratification coarser than its skeletal stratification. If a cell y of \(\mathrm {X}\) lies in an n-dimensional stratum \(\sigma \), then so must every cell x which satisfies \(x \ge y\).

Proof

Let \(\tau \) be the unique coarse stratum containing x. Since y lies in the boundary of x by assumption, the closure of \(\tau \) intersects \(\sigma \) non-trivially at y. The desired conclusion now follows from the axiom of the frontier in Definition 2.1 and the fact that there are no strata of dimension exceeding n, since \(\dim \tau \ge \dim \sigma = n\) forces \(\tau = \sigma \). \(\square \)

Thus, membership of cells in top-dimensional canonical strata is upward-closed with respect to the face partial order.

2.2 Localizations of Posets

The localization of a poset \(\varvec{P}\) about a subcollection \(\Sigma \) of its order relations is the minimal category containing \(\varvec{P}\) in which the relations of \(\Sigma \) have been rendered invertible [10, Ch I.1].

Definition 2.8

Let \((\varvec{P},\ge )\) be a poset and \(\Sigma = \{(x_\bullet \ge y_\bullet )\}\) a subset of its relations which is closedFootnote 4 under composition. The localization of \(\varvec{P}\) about \(\Sigma \) is a category \(\varvec{P}[\Sigma ^{-1}]\) whose objects are precisely the elements of \(\varvec{P}\), while morphisms from p to q are given by equivalence classes of finite (but arbitrarily long) \(\Sigma \)-zigzags of order relations in P

$$\begin{aligned} p \ge y_0 \le x_0 \ge \cdots \ge y_k \le x_k \ge q, \end{aligned}$$

where

  1. (1)

    only relations in \(\Sigma \) and equalities can point backward (i.e., \(\le \)),

  2. (2)

    composition is given by concatenation, and

  3. (3)

    the trivial zigzag \(p = p\) represents the identity of each element p.

The equivalence between \(\Sigma \)-zigzags is generated by the transitive closure of the following basic relations. Two such zigzags are related

  • horizontally if one is obtained from the other by removal of intermediate equalities:

    $$\begin{aligned} \left( \cdots \le x \ge y = y \ge x' \le \cdots \right)&\sim \left( \cdots \le x \ge x' \le \cdots \right) , \\ \left( \cdots \ge y \le x = x \le y' \ge \cdots \right)&\sim \left( \cdots \ge y \le y' \ge \cdots \right) , \end{aligned}$$
  • or vertically, if they form the rows in a grid:

    figure f

    where all vertical face relations (also) lie in \(\Sigma \).

The category \(\varvec{P}[\Sigma ^{-1}]\) enjoys the following universal property [10, Lem I.1.3]—there is a canonical localization functor\(\varvec{P}\rightarrow \varvec{P}[\Sigma ^{-1}]\) which acts by inclusion. In particular, it sends each element of \(\varvec{P}\) to itself and each relation \(x \ge y\) to its own equivalence class of \(\Sigma \)-zigzags. Moreover, any functor \(\varvec{P}\rightarrow \varvec{C}\) which maps order relations in \(\Sigma \) to isomorphisms in the target category \(\varvec{C}\) factorizes uniquely across the localization functor.

2.3 Cellular Cosheaves

Sheaves (and their dual cosheaves) assign algebraic objects to open sets of topological spaces [2]. Our interest here is in a particularly tame and computable subclass of cosheaves, where the base space is always a finite-dimensional regular CW complex \(\mathrm {X}\) and the assigned algebraic objects are cell-wise constant. We write \({{\mathbf{Fc}}}(\mathrm {X})\) to indicate the poset of cells with order relation \(x > y\) denoting that y is a face of x.

Definition 2.9

A cellular cosheaf over \(\mathrm {X}\) taking values in an Abelian category \(\varvec{A}\) is a functor \(\varvec{F}: {{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{A}\). Thus, it assigns to each cell x an \(\varvec{A}\)-object \(\varvec{F}(x)\) and to each face relation \(x \ge y\) an \(\varvec{A}\)-morphism \(\varvec{F}(x \ge y): \varvec{F}(x) \rightarrow \varvec{F}(y)\) so that

  • \(\varvec{F}(x = x)\) is the identity on \(\varvec{F}(x)\) for each cell x, and

  • \(\varvec{F}(y \ge z) \circ \varvec{F}(x \ge y)\) equals \(\varvec{F}(x \ge z)\) across any triple of cells \(x \ge y \ge z\).

We call \(\varvec{F}(x)\) the stalk of \(\varvec{F}\) at x, and call \(\varvec{F}(x \ge y)\) the extension map of \(\varvec{F}\) at \(x \ge y\).

A morphism of cellular cosheaves \(\eta :\varvec{F}\rightarrow \varvec{G}\) over \(\mathrm {X}\) is a natural transformation; it assigns to each cell x an \(\varvec{A}\)-morphism \(\eta _x: \varvec{F}(x) \rightarrow \varvec{G}(x)\) so that for each \(x \ge y\) the relevant square in \(\varvec{A}\) commutes:

Cosheaf morphisms may be composed stalkwise, and there is always a zero morphism \(0: \varvec{F}\rightarrow \varvec{G}\) which (as one might expect) assigns the zero map \(0_x:\varvec{F}(x) \rightarrow \varvec{G}(x)\) in \(\varvec{A}\) to each cell x of \(\mathrm {X}\).

Definition 2.10

A (lower-bounded) complex of cellular cosheaves \(\varvec{F}^\bullet \) (over \(\mathrm {X}\), taking values in \(\varvec{A}\)) is a sequence of \(\varvec{A}\)-valued cellular cosheaves over \(\mathrm {X}\) connected by cosheaf morphisms:

so that every successive composition \(\eta ^{\bullet +1}\circ \eta ^\bullet \) yields the zero morphism.

Every complex of cosheaves \(\varvec{F}^\bullet \) on \(\mathrm {X}\) may be reinterpreted as a single cosheaf which takes values in the category \({{\mathbf{Ch}}}(\varvec{A})\) of lower-bounded cochain complexes in \(\varvec{A}\)—consider the collection of commuting squares in \(\varvec{A}\) that are assigned to face relations \(x \ge y \ge z \ge \cdots \) of \(\mathrm {X}\):

The horizontal slices of this diagram confirm that a cochain complex in \(\varvec{A}\) is allocated to each cell, while vertical arrows between these slices prescribe the desired extension maps. Taking cohomology horizontally, one therefore obtains an ordinary cellular cosheaf of (graded) \(\varvec{A}\)-objects over \(\mathrm {X}\). We call this the cohomology of \(\varvec{F}^\bullet \) and denote it by \(H^\bullet \varvec{F}\).

3 Local Cohomology of CW Complexes

Let \(\mathrm {X}\) be a finite-dimensional regular CW complex with face poset \({{\mathbf{Fc}}}(\mathrm {X})\) and R a fixed non-trivial commutative ring with identity \(1_R\). We write \({\mathbf{Mod}}(R)\) to denote the category of R-modules, and \({{\mathbf{Ch}}}(R)\)—rather than the cumbersome \({{\mathbf{Ch}}}({\mathbf{Mod}}(R))\)—to indicate the category of cochain complexes of R-modules indexed by the nonnegative natural numbers.

Definition 3.1

[5, Def 7.1] The local cohomology\(\varvec{L}^\bullet \) of \(\mathrm {X}\) is a complex of cosheaves

over \(\mathrm {X}\) taking values in \({\mathbf{Mod}}(R)\), prescribed by the following data.

  1. (1)

    For each dimension \(d \ge 0\) and cell x of \(\mathrm {X}\), the cosheaf \(\varvec{L}^d\) has as its stalk \(\varvec{L}^d(x)\) the free R-module with basis

    $$\begin{aligned} \left\{ z \in {{\mathbf{Fc}}}(\mathrm {X}) \mid z \ge x \text { and } \dim z = d\right\} . \end{aligned}$$

    When \(x \ge y\), the extension \(\varvec{L}^d(x \ge y):\varvec{L}^d(x) \hookrightarrow \varvec{L}^d(y)\) is determined by the obvious inclusion of basis cells.

  2. (2)

    The cosheaf morphism \(\beta ^d\) assigns to each cell x the map \(\beta ^d_x:\varvec{L}^d(x) \rightarrow \varvec{L}^{d+1}(x)\) defined by (linearly extending) the following action on basis cells. For each d-cell \(z \ge x\), we have

    $$\begin{aligned} \beta ^d_x(z) = \sum _{w} \langle {w,z}\rangle _R \cdot w, \end{aligned}$$

    where the sum is taken over all \((d+1)\)-cells \(w \ge x\), and \(\langle {w,z}\rangle _R\) is the R-valued degree of the attaching map in \(\mathrm {X}\) from the boundary of w onto z. (Since we have assumed that \(\mathrm {X}\) is regular, this number \(\langle {w,z}\rangle _R\) takes values in \(\{0,\pm 1_R\}\) for all cells w and z.)

Routine calculations confirm that \(\beta ^{d+1} \circ \beta ^d\) is always zero and that the \(\beta ^\bullet _x\)’s commute with all relevant extension maps. In light of the discussion following Definition 2.10, we will shift perspective and regard \(\varvec{L}^\bullet \) as a single cosheaf valued in \({{\mathbf{Ch}}}(R)\). In this setting, the stalk \(\varvec{L}^\bullet (x)\) lying over each cell x is the entire cochain complex

and \(H^\bullet \varvec{L}(x)\) is the compactly supported cohomology of x’s open star in \(\mathrm {X}\). By excision, one may describe \(H^\bullet \varvec{L}(x)\) as the ordinary relative cohomology of the pair \(\left( \overline{{\mathbf{st}}}(x),\partial \overline{{\mathbf{st}}}(x)\right) \) where \(\overline{{\mathbf{st}}}(x)\) is the closure of x’s open star in \(\mathrm {X}\) and \(\partial \) denotes the topological boundary:

$$\begin{aligned} \partial \overline{{\mathbf{st}}}(x) = \overline{{\mathbf{st}}}(x)-{\mathbf{st}}(x). \end{aligned}$$

When y is a zero-dimensional cell, we have \(\partial \overline{{\mathbf{st}}}(y) = {\mathbf{lk}}(y)\).

Definition 3.2

For each \(d \ge 0\), we write \(R[d]^\bullet \) to indicate the special cochain complex in \({{\mathbf{Ch}}}(R)\) which is trivial except for a single copy of R in the dth position:

$$\begin{aligned} 0 \rightarrow \cdots \rightarrow 0 \rightarrow R \rightarrow 0 \rightarrow \cdots \end{aligned}$$

Thus, \(H^\bullet R[d]\) is the cohomology of small neighborhoods in d-dimensional R-cohomology manifolds, as in (1).

By Definition 2.1, if a cell x lies in some top-dimensional stratum of \(\mathrm {X}\), then we must have an isomorphism \(H^\bullet \varvec{L}(x) \simeq H^\bullet R[\dim \mathrm {X}]\). For cells of high dimension, this requirement has strong consequences.

Proposition 3.3

If \(n = \dim \mathrm {X}\), then every n-cell x has \(\varvec{L}^\bullet (x) = R[n]^\bullet \). And moreover, every \((n-1)\)-cell y with \(H^\bullet \varvec{L}(y) \simeq H^\bullet R[n]\) lies in the boundary of exactly two n-cells.

Proof

The first assertion follows from Definition 3.1 and the fact that there are no cells of dimension \(\ge (n+1)\) in \(\mathrm {X}\). Turning to the second assumption, note that the local cohomology of an \((n-1)\)-cell y is only supported in dimensions \((n-1)\) and n:

$$\begin{aligned} \varvec{L}^\bullet (y) = 0 \rightarrow \cdots \rightarrow 0 \rightarrow R {\mathop {\longrightarrow }\limits ^{\beta ^{n-1}_y}} R^k \rightarrow 0 \rightarrow \cdots \end{aligned}$$

where k counts the number of n-cells x satisfying \(x > y\). If \(\varvec{L}^\bullet (y)\) is quasi-isomorphic to \(R[n]^\bullet \), then \(\beta ^{n-1}_y\) must be injective (since \(H^{n-1}\varvec{L}(y)\) is trivial), so \(k > 0\). By definition, \(\beta ^{n-1}_y\) acts by sending a basis element of R to a linear combination of basis elements in \(R^k\), and by the regularity of \(\mathrm {X}\), all coefficients in this linear combination lie in \(\{\pm 1_R\}\). The nth cohomology of \(\varvec{L}^\bullet (y)\) is the quotient

$$\begin{aligned} H^n\varvec{L}(y) = \frac{R^k}{\text {im}(\beta ^{n-1}_y)}, \end{aligned}$$

and it must be isomorphic to \(R = H^n R[n]\) by assumption. Since R is a commutative ring, it satisfies the invariant basis property—that is to say, \(R^k\) and \(R^\ell \) are isomorphic as R-modules if and only if \(k = \ell \) [29, Def 1.1]. Thus, we have \(k = 2\) as desired. \(\square \)

In light of the preceding result and (1), one might hope to identify top-dimensional canonical strata by simply clustering together adjacent cells \(x \ge y\) in \(\mathrm {X}\) whenever there exists a top-dimensional cell w satisfying \(w \ge x\) so that all extension maps below are quasi-isomorphisms:

$$\begin{aligned} R[\dim \mathrm {X}]^\bullet = \varvec{L}^\bullet (w) {\mathop {\hookrightarrow }\limits ^{\simeq }} \varvec{L}^\bullet (x) {\mathop {\hookrightarrow }\limits ^{\simeq }} \varvec{L}^\bullet (y). \end{aligned}$$

Our next example shows that this (necessary) condition for x and y to belong to the same top stratum is not sufficient when \(\dim w - \dim y > 1\).

Example 3.4

Consider the two-dimensional simplicial complex depicted below: It is obtained by subdividing a parallelogram into four 2-simplices along diagonals and attaching an extra 2-simplex along one of the four resulting half-diagonals.

figure g

Let wx and y, respectively, denote the extra 2-simplex, the shared half-diagonal and the central vertex. It is easy to confirm that \(\varvec{L}^\bullet (y)\) is quasi-isomorphic to \(R[2]^\bullet \) since its link has the cohomology of a circle. And moreover, given any sequence \(w'> x' > y\) of cells where \(w'\) and \(x'\) differ from w and x, respectively, the inclusion maps

$$\begin{aligned} R[2]^\bullet = \varvec{L}^\bullet (w') \hookrightarrow \varvec{L}^\bullet (x') \hookrightarrow \varvec{L}^\bullet (y) \end{aligned}$$

are all quasi-isomorphisms. Note, however, that \(\varvec{L}^\bullet (x)\) is not quasi-isomorphic to \(R[2]^\bullet \) by Proposition 3.3 since there are three 2-simplices containing x as a face. Thus, x does not belong to any canonical 2-stratum, and hence (by Proposition 2.7), neither does y.

4 Extracting Top Strata

Throughout this section, \(\mathrm {X}\) denotes an n-dimensional regular CW complex, R is a fixed non-trivial commutative ring with identity, and \(\varvec{L}^\bullet :{{\mathbf{Fc}}}(\mathrm {X}) \rightarrow {{\mathbf{Ch}}}(R)\) is the local cohomology complex of \(\mathrm {X}\) from Definition 3.1. Consider the collection of face relations \((x \ge y)\) in \({{\mathbf{Fc}}}(\mathrm {X})\) sent by \(\varvec{L}^\bullet \) to quasi-isomorphisms, i.e.,

$$\begin{aligned} E_0 = \left\{ (x \ge y) \text { in } {{\mathbf{Fc}}}(\mathrm {X}) \mid H^\bullet \varvec{L}(x \ge y) \text { is an isomorphism,}\right\} \end{aligned}$$
(3)

and define the subcollection

$$\begin{aligned} W_0&= \big \{(x \ge y) \text { in } E_0 \mid ~ H^\bullet \varvec{L}(y) \simeq H^\bullet R[n], \text { and } \nonumber \\&\quad (x' \ge y) \in E_0 \text { for all } x' \ge y \text { in }{{\mathbf{Fc}}}(\mathrm {X}) \big \}. \end{aligned}$$
(4)

In other words, \(W_0\) is what remains of \(E_0\) when we impose

  • dimensionality retain only those face relations in which both cells have the local cohomology (isomorphic to that) of a top-dimensional cell, and

  • upward-closure remove \((x \ge y)\) if there exists some \(x' \ge y\) for which \(\varvec{L}^\bullet (x' \ge y)\) is not a quasi-isomorphism. (Recall that cells lying in top strata are upward-closed by Proposition 2.7.)

It is clear that if \(W_0\) contains both \((x \ge y)\) and \((y \ge z)\), then it also contains \((x \ge z)\).

Definition 4.1

The category \(\varvec{S}_0\) is the localization of the face poset \({{\mathbf{Fc}}}(\mathrm {X})\) about \(W_0\).

Recall that \(\varvec{S}_0\) has the cells of \(\mathrm {X}\) as objects, while its morphisms are equivalence classes of \(W_0\)-zigzags (as described in Definition 2.8). And, there is a canonical functor \({{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{S}_0\) which is universal with respect to rendering all the face relations from \(W_0\) invertible.

Proposition 4.2

Two cells \(w \ne z\) are isomorphic in \(\varvec{S}_0\) if and only if there is a \(W_0\)-zigzag

$$\begin{aligned} w \ge y_0 \le x_0 \ge \cdots \ge y_k \le x_k \ge z \end{aligned}$$

whose last relation \((x_k \ge z)\) lies in \(W_0\).

Proof

Given any \(W_0\)-zigzag from w to z such as the one depicted above, recall that every \((x_\bullet \ge y_\bullet )\) is in \(W_0\). And by the upward-closure requirement, each preceding \((x_{\bullet -1} \ge y_\bullet )\) is automatically in \(W_0\) (with the understanding that \(x_{-1} = w\)). Since the last relation \((x_k \ge z)\) is assumed to lie in \(W_0\) as well, one can directly construct an inverse zigzag in \(\varvec{S}_0\):

$$\begin{aligned} z = z \le x_k \ge y_k \le \cdots \le x_0 \ge y_0 \le w = w. \end{aligned}$$

Conversely, if w and z are isomorphic in \(\varvec{S}_0\), then there exist \(W_0\)-zigzags from w to z and vice versa whose composites are (equivalent to) identity morphisms. We label some relevant cells in these zigzags:

$$\begin{aligned} w \ge \cdots \le x \ge z \quad \text { and } \quad z \ge y \le \cdots \ge w. \end{aligned}$$

A brief examination of the horizontal and vertical relations from Definition 2.8 confirms that any zigzag in the equivalence class of the identity must have all its forward-pointing \(\ge \)’s lying in \(W_0\). As a consequence, when we compose the zigzags labeled above, we obtain \((x \ge y) \in W_0\). An appeal to the upward-closure requirement now forces \((x \ge z) \in W_0\), as desired. \(\square \)

Here is the main result of this section.

Proposition 4.3

Two n-dimensional cells lie in the same canonical n-stratum of \(\mathrm {X}\) if and only if they are isomorphic in \(\varvec{S}_0\).

Proof

To show that the first assertion implies the second, let \(\sigma \) be the n-stratum containing two distinct cells w and z. Since \(\sigma \) is connected by Definition 2.1, there exists a zigzag of cells lying entirely in \(\sigma \) from w to z, say

$$\begin{aligned} w \ge v_0 \le v_1 \ge \cdots \ge v_k \le z. \end{aligned}$$

By the same definition and Proposition 2.7, it follows that every face relation appearing above lies in \(W_0\). By adding an identity to the end of this zigzag, we may therefore construct a morphism in \(\varvec{S}_0\) from w to z,

$$\begin{aligned} w \ge v_0 \le v_1 \ge \cdots \ge v_k \le z = z. \end{aligned}$$

It is now evident from Proposition 4.2 that w and z are isomorphic in \(\varvec{S}_0\). In order to show the reverse implication, assume the existence of an isomorphism from w to z in \(\varvec{S}_0\), say

$$\begin{aligned} w \ge y_0 \le x_0 \ge \cdots \ge y_k \le x_k = z, \end{aligned}$$

where the last equality follows from the fact that \(\mathrm {X}\) contains no cells of dimension \(> n\). Define the union

$$\begin{aligned} \mathrm {Z}= \bigcup _{i=0}^k \mathbf st (y_i) \end{aligned}$$

of open stars, and note that \(\mathrm {Z}\) is connected—every constituent \(\mathbf st (y_i)\) is connected and intersects the subsequent \(\mathbf st (y_{i+1})\) non-trivially (since both stars must contain \(x_i\)). By the dimensionality requirement on \(W_0\), every point in \(\mathrm {Z}\) has an open neighborhood with compactly supported cohomology isomorphic to \(H^\bullet R[n] = {H}_{\mathrm{c}}^\bullet (\mathbb {R}^n)\), and by the upward-closure requirement no cell lying in \(\mathrm {Z}\) may lie in the boundary of a cell lying outside \(\mathrm {Z}\). Thus, the frontier and link requirements on strata imposed by Definition 2.1 are satisfied by the connected set \(\mathrm {Z}\subset \mathrm {X}\), whence all cells lying in \(\mathrm {Z}\) must belong to the same canonical n-stratum \(\sigma \) of \(\mathrm {X}\). Thus, \(\sigma \) contains both w and z as desired. \(\square \)

Finally, note that if an arbitrary cell y lies in a (not necessarily canonical) n-stratum \(\sigma \) of \(\mathrm {X}\), then there must exist an n-cell \(w \ge y\) also lying in \(\sigma \) by Proposition 2.7; otherwise, we arrive at the contradiction \(H^n\varvec{L}(y) = 0\). Thus, we have the following consequence of Proposition 4.3.

Corollary 4.4

The canonical n-strata of \(\mathrm {X}\) correspond bijectively with isomorphism classes of its n-cells in \(\varvec{S}_0\).

5 Uncovering Lower Strata

As before, let \(\mathrm {X}\) be the n-dimensional regular CW complex whose canonical strata we wish to discover. In this section, we will inductively construct the desired stratification

$$\begin{aligned} \mathrm {X}= \mathrm {Y}_0 \supset \mathrm {Y}_1 \supset \cdots \supset \mathrm {Y}_n \supset \mathrm {Y}_{n+1} = \varnothing , \end{aligned}$$
(5)

where each \(\mathrm {Y}_\bullet \subset \mathrm {X}\) is a regular CW subcomplex, so that the connected components of each difference \(\mathrm {Y}_d - \mathrm {Y}_{d+1}\) are precisely the canonical \((n-d)\)-strata of \(\mathrm {X}\). We have numbered the \(\mathrm {Y}_\bullet \) in reverse (compare Definition 2.1) merely to indicate the order in which they are constructed. In addition to the initial complex \(\mathrm {Y}_0 = \mathrm {X}\), the first step of our construction also requires using the sets \(E_0\) and \(W_0\) which were defined in (3) and (4), respectively.

Definition 5.1

Given the triple \((\mathrm {Y}_{d-1}, E_{d-1}, W_{d-1})\), the \((n-d)\)-dimensional regular CW subcomplex \(\mathrm {Y}_{d}\) consists of all cells y in \(\mathrm {Y}_{d-1}\) for which there exists some cell \(x \ge y\) in \(\mathrm {Y}_{d-1}\) so that \((x \ge y)\) is not in the set \(W_{d-1}\). (By upward-closure, we may as well choose x to be y.) Letting \(\varvec{L}^\bullet _{d}:{{\mathbf{Fc}}}(\mathrm {Y}_{d}) \rightarrow {{\mathbf{Ch}}}(R)\) be the local cohomology of \(\mathrm {Y}_{d}\), define the set of face relations

$$\begin{aligned} E_{d} = E_{d-1} \cap \left\{ (x \ge y) \text { in } {{\mathbf{Fc}}}(\mathrm {Y}_{d}) \mid H^\bullet \varvec{L}_{d}(x \ge y) \text { is an isomorphism}\right\} , \end{aligned}$$
(6)

and also

$$\begin{aligned} W_{d}&= W_{d-1} \cup \big \{(x \ge y) \text { in } E_d \mid ~ H^\bullet \varvec{L}_{d}(y) \simeq H^\bullet R[n-d], \text { and } \nonumber \\&\quad (x' \ge y) \in E_{d} \text { for all } x' \ge y \text { in } {{\mathbf{Fc}}}(\mathrm {Y}_{d})\big \}. \end{aligned}$$
(7)

This produces the subsequent triple \((\mathrm {Y}_{d}, E_{d}, W_{d})\).

Note that \(W_\bullet \) is an increasing sequence of sets while both \(\mathrm {Y}_\bullet \) and \(E_\bullet \) are decreasing.

Example 5.2

To motivate the sets which appear in Definition 5.1, consider the two-dimensional space \(\mathrm {Y}_0\) pictured below: It is the closed cone over a wedge of two circles.

figure h

We have equipped \(\mathrm {Y}_0\) with a regular CW decomposition consisting of four vertices (\(p,q,z_*\)), seven edges (\(w_*, y_*, e\)) and four 2-cells (all \(x_*\)). For convenience, let us assume that the coefficient ring R is a field, so that cohomology computations reduce to knowledge of ranks of coboundary matrices. The stalk of the local cohomology cosheaf \(\varvec{L}^\bullet _0\) over each of the four 2-cells is just \(\varvec{L}_0^\bullet (x_*) = R[2]^\bullet \), and since each \(y_*\) has two 2-cells in its open star, we obtain the following stalks:

$$\begin{aligned} \varvec{L}_0^\bullet (y_*) = (0 \rightarrow R \rightarrow R^2 \rightarrow 0 \rightarrow \cdots ), \end{aligned}$$

where the only non-trivial map has rank one. It is straightforward to confirm that the based inclusions \(\varvec{L}_0^\bullet (x_* \ge y_*)\) are all quasi-isomorphisms. Thus, the four face relations in \(\mathrm {Y}_0\) of the form \(x_* \ge y_*\) will be elements of \(W_0\). All the other cells have the wrong local cohomology and will therefore not participate in \(W_0\)-relations: For instance,

$$\begin{aligned} \varvec{L}_0^\bullet (w_*) = (0 \rightarrow R \rightarrow R \rightarrow 0 \rightarrow \cdots ), \end{aligned}$$

where again the nonzero map has rank 1, so the local cohomology is trivial and does not coincide with that of \(R[2]^\bullet \). By upward-closure, this also shows that neither the \(z_*\) nor p can participate in face relations of \(W_0\). Similarly, the local cohomology of e does not agree with that of \(R[2]^\bullet \); the stalk is

$$\begin{aligned} \varvec{L}_0^\bullet (e) = \left( 0 \rightarrow R \rightarrow R^4 \rightarrow 0 \rightarrow \cdots \right) , \end{aligned}$$

again with a rank one map. This disqualifies q from participating in a face relation that lies in \(W_0\). On the other hand, all four \((w_* \ge p)\) lie in \(E_0\), so the cosheaf \(\varvec{L}^\bullet _0\) is unable to distinguish generic cells lying on the two circles to the left from the singular point p. But once we remove all those \(x_*\) and \(y_*\) cells which are involved in face relations of \(W_0\), we obtain a one-dimensional CW subcomplex \(\mathrm {Y}_1 \subset \mathrm {Y}_0\) whose local cohomology correctly distinguishes p from the \(w_*\) and \(z_*\):

figure i

In particular, the local cohomology cosheaf \(\varvec{L}^\bullet _1\) of \(\mathrm {Y}_1\) has the following stalk over p:

$$\begin{aligned} \varvec{L}_1^\bullet (p) = \left( 0 \rightarrow R \rightarrow R^5 \rightarrow 0 \rightarrow \cdots \right) , \end{aligned}$$

with the non-trivial map having rank 1; thus, \(\varvec{L}_1^\bullet (p)\) manifestly has different cohomology than \(R[1]^\bullet = \varvec{L}_1^\bullet (w_*) \simeq \varvec{L}_1^\bullet (z_*)\). Similar top-down constructions (which measure the failure of d-dimensionality for decreasing d) have been employed since the very inception of stratification theory, dating back to the original work of Whitney [31].

Remark 5.3

Two properties of the sequence \(\mathrm {Y}_\bullet \) mentioned in Definition 5.1 may be inductively justified as follows, using the fact that \(\mathrm {Y}_0\) is an n-dimensional regular CW complex as a base case.

  1. (1)

    To see that \(\mathrm {Y}_d \subset \mathrm {Y}_{d-1}\) is a regular CW subcomplex, note that if a cell y lies in the difference \(\mathrm {Y}_{d-1} - \mathrm {Y}_{d}\), then we have \((y = y) \in W_{d-1}\). And given any cell \(x \ge y\) in \(\mathrm {Y}_{d-1}\), we have \((x \ge y) \in W_{d-1}\) by upward-closure, whence \((x = x) \in W_{d-1}\). Thus, x also lies in the difference \(\mathrm {Y}_{d-1} - \mathrm {Y}_{d}\). Since the collection of cells removed from \(\mathrm {Y}_{d-1}\) to obtain \(\mathrm {Y}_d\) is upward-closed with respect to the face partial order, \(\mathrm {Y}_d\) is a regular CW subcomplex of \(\mathrm {Y}_{d-1}\).

  2. (2)

    To see that \(\dim \mathrm {Y}_d \le (n-d)\), assume \(\dim \mathrm {Y}_{d-1} \le (n-d+1)\). But now, for each cell w in \(\mathrm {Y}_{d-1}\) of dimension \((n-d+1)\), we have \((w = w) \in W_{d-1}\) by Proposition 3.3, so w is not in \(\mathrm {Y}_d\). Since \(\mathrm {Y}_d\) contains no cells of dimension \((n-d+1)\), its dimension cannot exceed \((n-d)\).

Definition 5.4

For each \(d > 0\) in [n], the category \(\varvec{S}_d\) is the localization of \({{\mathbf{Fc}}}(\mathrm {X})\) about the set \(W_d\) from (7).

Recall from Sect. 2.2 that there is a universal functor \({{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{S}_d\) for each d, and since \(W_{d-1} \subset W_{d}\) holds by (7), the universal property of localization guarantees a unique functor \(\varvec{S}_{d-1} \rightarrow \varvec{S}_{d}\) which makes the following diagram commute:

In fact, \(\varvec{S}_{d-1} \rightarrow \varvec{S}_d\) admits a convenient explicit description: Note that every \(W_{d-1}\)-zigzag is automatically a \(W_d\)-zigzag, so \(\varvec{S}_{d-1}\) is a subcategory of \(\varvec{S}_d\) and the inclusion \(\varvec{S}_{d-1} \hookrightarrow \varvec{S}_d\) satisfies this universal property. Our next result establishes a certain \(W_\bullet \)-induced monotonicity for morphisms across the entire nested sequence \(\varvec{S}_\bullet \); in its statement and beyond, [p] denotes the set \(\left\{ 0,\ldots ,p\right\} \) for each integer \(p \ge 0\).

Lemma 5.5

Fix d in [n] along with cells w and z in \(\mathrm {X}\). For each \(W_d\)-zigzag \(\zeta \) from w to z, say

$$\begin{aligned} \zeta = (w \ge y_0 \le x_0 \ge \cdots \ge y_k \le x_k \ge z), \end{aligned}$$

define the function \(\varphi _\zeta :[k] \rightarrow [d]\) by setting

$$\begin{aligned} \varphi _\zeta (p) = \min \left\{ q \ge 0 \mid (x_p \ge y_p) \in W_q\right\} . \end{aligned}$$
(8)

Then, \(\varphi _\zeta \) is monotone increasing in the sense that \(\varphi _\zeta (p-1) \le \varphi _\zeta (p)\) for all \(p \ge 1\) in [k].

Proof

Set \(\varphi _\zeta (p) = q\) for a fixed p, so that \((x_{p} \ge y_{p}) \in W_q - W_{q-1}\), whence both \(x_p\) and \(y_p\) are cells in \(\mathrm {Y}_q - \mathrm {Y}_{q+1}\). Since \(x_{p-1} \ge y_p\) holds in \(\mathrm {X}\), the cell \(x_{p-1}\) must lie in \(\mathrm {Y}_r - \mathrm {Y}_{r+1}\) for some \(r \le q\) because \(\mathrm {Y}_\bullet \) is a decreasing sequence of CW subcomplexes of \(\mathrm {X}\). Thus, \((x_{p-1} \ge y_{p-1}) \in W_r\), so we have

$$\begin{aligned} \varphi _\zeta (p-1) \le r \le q = \varphi _\zeta (p), \end{aligned}$$

as desired. \(\square \)

The cells of \(\mathrm {X}\) are ordered by dimension in the sense that the poset \({{\mathbf{Fc}}}(\mathrm {X})\) is only allowed to have morphisms from higher-dimensional to lower-dimensional cells. Since morphisms in \(\varvec{S}_\bullet \) are zigzags, one cannot expect such a dimensional monotonicity to hold verbatim. But the \(W_\bullet \)-induced monotonicity from the previous lemma precludes the existence of certain morphisms in \(\varvec{S}_\bullet \).

Corollary 5.6

Given \(i \le j\) in [n] along with cells w in \(\mathrm {Y}_j\) and z in \(\mathrm {Y}_i - \mathrm {Y}_j\), there are no morphisms in \(\varvec{S}_d\) from w to z for any d in [n].

Proof

Note that a direct face relation \(w \ge z\) cannot hold in \(\mathrm {X}\) since \(\mathrm {Y}_j\) is a CW subcomplex of \(\mathrm {Y}_i\). Thus, any morphism in \(\varvec{S}_d\) from w to z admits a genuine zigzag representative. Proceeding by contradiction, assume the existence of such a zigzag \(\zeta \):

$$\begin{aligned} w \ge y_0 \le x_0 \ge \cdots \ge y_k \le x_k \ge z. \end{aligned}$$

The face relations \(w \ge y_0\) and \(x_k \ge z\) in \(\mathrm {X}\) guarantee \(j \le \varphi _\zeta (0)\) and \(\varphi _\zeta (k) \le i\), where \(\varphi _\zeta \) is the function from (8). The monotonicity of \(\varphi _\zeta \) from Lemma 5.5 now forces \(j \le i\), and hence, \(i = j\). The cell z is thus constrained to lie in \(\mathrm {Y}_i - \mathrm {Y}_j = \varnothing \), which yields the desired contradiction. \(\square \)

As a direct consequence of the preceding result, isomorphism classes in \(\varvec{S}_i\) of \((n-i)\)-dimensional cells from \(\mathrm {Y}_i\) remain unchanged across all the inclusions \(\varvec{S}_i \hookrightarrow \varvec{S}_j\) for \(i \le j\). The next result gives convenient alternate descriptions of such isomorphism classes across the entire sequence \(\varvec{S}_\bullet \).

Proposition 5.7

For each \(d \in [n]\), the following are equivalent. Two cells w and z in \(\mathrm {X}\)

  1. (1)

    lie in the same connected component of \(\mathrm {Y}_d - \mathrm {Y}_{d+1}\),

  2. (2)

    are connected by a \(W_d\)-zigzag, whose relations (\(\le \) and \(\ge \)) all lie in \(W_d - W_{d-1}\),

  3. (3)

    are isomorphic in \(\varvec{S}_d\) to a common \((n-d)\)-dimensional cell from \(\mathrm {Y}_d\).

Proof

We will show (1) \(\Rightarrow \) (2) \(\Rightarrow \) (3) \(\Rightarrow \) (1). If w and z lie in the same connected component of \(\mathrm {Y}_d - \mathrm {Y}_{d+1}\), then there is a zigzag of cells

$$\begin{aligned} w \ge v_0 \le v_1 \ge \cdots \ge v_k \le z, \end{aligned}$$

lying entirely in \(\mathrm {Y}_d - \mathrm {Y}_{d+1}\). By Definition 5.1, each face relation (\(\ge \) or \(\le \)) appearing in this zigzag lies in \(W_{d}\), and by Lemma 5.5, no such relation can lie in \(W_{d-1}\). So by (7), the cell w (and indeed, each cell in this zigzag) has its local cohomology \(H^\bullet \varvec{L}_{d}(v)\) isomorphic to \(H^\bullet R[n-d]\). By the argument used while proving Corollary 4.4, and recalling that \(\dim \mathrm {Y}_d \le (n-d)\), there exists an \((n-d)\)-cell \(v \ge w\) in \(\mathrm {Y}_d\) which is isomorphic in \(\varvec{S}_d\) to w, and hence to every other cell in our zigzag (including z). Finally, if there is an \((n-d)\)-cell v from \(\mathrm {Y}_d\) isomorphic to both w and z in \(\varvec{S}_d\), then there is a \(W_d\)-zigzag from w to z obtained by composing zigzags \(w \rightarrow v \rightarrow z\). By Lemma 5.5, all cells in this composite lie in \(W_d - W_{d-1}\), so w and z lie in the same connected component of \(\mathrm {Y}_d - \mathrm {Y}_{d+1}\). \(\square \)

Our next result describes the canonical strata of \(\mathrm {X}\) as isomorphism classes in \(\varvec{S}_\bullet \).

Proposition 5.8

For each \(d \in [n]\) and canonical \((n-d)\)-stratum \(\sigma \) of \(\mathrm {X}\), every cell lying in \(\sigma \) is isomorphic in \(\varvec{S}_d\) to some \((n-d)\)-cell from \(\mathrm {Y}_d\).

Proof

Let \(\varnothing = \mathrm {L}_{-1} \subset \cdots \subset \mathrm {L}_{d-1} = \mathrm {L}\) be the link of \(\sigma \) in the sense of Definition 2.1. Assume, proceeding via induction, that for each \(j < d\) the canonical \((n-j)\)-strata of \(\mathrm {X}\) correspond to isomorphism classes in \(\varvec{S}_j\) of \((n-j)\)-cells from \(\mathrm {Y}_j\). By Proposition 5.7, these strata are precisely the connected components of \(\mathrm {Y}_j - \mathrm {Y}_{j+1}\). Thus, for each cell x lying in \(\sigma \) and \(j < d\), we have quasi-isomorphisms

$$\begin{aligned} {C}_{\mathrm{c}}^\bullet (\mathscr {C}\mathrm {L}_{d-j-1} \times \mathbb {R}^{n-d}) {\mathop {\longrightarrow }\limits ^{\simeq }} {C}_{\mathrm{c}}^\bullet ({\mathbf{st}}(x) \cap \mathrm {Y}_{j}), \end{aligned}$$

where \({\mathbf{st}}(x)\) is the open star of x in \(\mathrm {X}= \mathrm {Y}_0\). Assuming that \(x \ge y\) holds in \(\mathrm {X}\) for another cell y lying in \(\sigma \), we would like to prove that \(\varvec{L}_j^\bullet (x \ge y)\) is a quasi-isomorphism. To this end, consider the following diagram in \({{\mathbf{Ch}}}(R)\):

The triangle to the left commutes by the refinability constraint of Definition 2.1 (note that here the downward pointing arrow is the map induced by inclusion), whereas square to the right commutes by the natural contravariant equivalence between singular and cellular compactly supported cohomology. Being sandwiched in this commuting diagram forces \(\varvec{L}_j^\bullet (x \ge y)\) to also be a quasi-isomorphism for all \(j < d\), so we have \((x \ge y) \in E_{d-1}\). Being an \((n-d)\)-stratum, \(\sigma \) is an R-cohomology manifold, so there are quasi-isomorphisms

$$\begin{aligned} R[n-d]^\bullet {\mathop {\hookrightarrow }\limits ^{\simeq }} \varvec{L}_d^\bullet (x) {\mathop {\hookrightarrow }\limits ^{\simeq }} \varvec{L}_d^\bullet (y). \end{aligned}$$

Since \(\sigma \) is a top-dimensional stratum of the subcomplex \(\mathrm {Y}_d\), we have \((x' \ge y) \in E_d\) whenever \(x' \ge y\) in \(\mathrm {Y}_d\) by Proposition 2.7. Thus, \((x \ge y) \in W_d - W_{d-1}\) by (7). Since \(\sigma \) is connected, any two cells of \(\mathrm {X}\) that it contains may be connected by a zigzag of cells lying in \(\sigma \), and by the preceding argument, each face relation appearing in such a zigzag lies in \(W_d - W_{d-1}\). The desired conclusion now follows from Proposition 5.7. \(\square \)

The following result establishes the converse of Proposition 5.8.

Proposition 5.9

For each d in [n], the isomorphism class in \(\varvec{S}_d\) of any \((n-d)\)-dimensional cell from \(\mathrm {Y}_d\) is a canonical \((n-d)\)-stratum of \(\mathrm {X}\).

Proof

Proceeding once again by induction, we assume that the statement holds for all j in \([d-1]\). Fix an \((n-d)\)-dimensional cell w in \(\mathrm {Y}_d \subset \mathrm {X}\), and let \(\sigma \) be the collection of all cells which are isomorphic to w in \(\varvec{S}_d\). We first show that \(\sigma \) satisfies the link axiom from Definition 2.1. Writing \({\mathbf{st}}(w)\) and \({\mathbf{lk}}(w)\) for w’s star and link in \(\mathrm {X}\), for each \(i \le d\) we have the intersections

$$\begin{aligned} {\mathbf{st}}_i(w) = {\mathbf{st}}(w) \cap \mathrm {Y}_{i} \quad \text { and } \quad {\mathbf{lk}}_i(w) \cap \mathrm {Y}_{i}, \end{aligned}$$

which form the star and link of w in \(\mathrm {Y}_{i} \subset \mathrm {X}\). Since \({\mathbf{st}}_\bullet (w)\) admits a stratified homeomorphism to the corresponding \(\mathscr {C}{\mathbf{lk}}_\bullet (w) \times \mathbb {R}^{n-d}\), we get stratified quasi-isomorphisms of singular cochain complexes

$$\begin{aligned} {C}_{\mathrm{c}}^\bullet (\mathscr {C}{\mathbf{lk}}_i(w) \times \mathbb {R}^{n-d}) {\mathop {\longrightarrow }\limits ^{\simeq }} {C}_{\mathrm{c}}^\bullet ({\mathbf{st}}_i(w)), \end{aligned}$$

whose codomains are, in turn, quasi-isomorphic to the local cohomology stalks \(\varvec{L}_i^\bullet (w)\). If z is any other cell which becomes isomorphic to w in \(\varvec{S}_d\), then by Proposition 5.7 there is a zigzag from w to z whose face relations all lie in \(W_d - W_{d-1}\):

$$\begin{aligned} w \ge v_0 \le v_1 \ge \cdots \ge v_{k-1} \le v_k \ge z, \end{aligned}$$

and hence zigzags of quasi-isomorphisms in \({{\mathbf{Ch}}}(R)\) for all \(i \in [d]\)

$$\begin{aligned} \varvec{L}_i^\bullet (w) {\rightarrow } \varvec{L}_i^\bullet (v_0) {\leftarrow } \cdots \leftarrow \varvec{L}_i^\bullet (v_k) {\rightarrow } \varvec{L}_i^\bullet (z). \end{aligned}$$

Each complex in sight is bounded and free (hence projective), so the backward-pointing maps admit quasi-inverses (see [28, Cor 10.4.7]). Thus, one may turn them around to obtain maps \(\varvec{L}_i^\bullet (w) \rightarrow \varvec{L}_i^\bullet (z)\) which fit into a string of quasi-isomorphisms

$$\begin{aligned} {C}_{\mathrm{c}}^\bullet (\mathscr {C}{\mathbf{lk}}_i(w) \times \mathbb {R}^{n-d}) \rightarrow {C}_{\mathrm{c}}^\bullet ({\mathbf{st}}_i(w)) \rightarrow \varvec{L}^\bullet _i(w) \rightarrow \varvec{L}^\bullet _i(z) \rightarrow {C}_{\mathrm{c}}^\bullet ({\mathbf{st}}_i(z)). \end{aligned}$$

Setting \(\mathrm {L}_j = {\mathbf{lk}}_{d-j-1}(w)\) for all \(j \in [d-1]\), one obtains a candidate \((d-1)\)-dimensional stratified space \(\mathrm {L}\) to serve as the link of \(\sigma \).

Turning now to the frontier axiom, for each \(i < d\) let \(\varvec{K}_i^\bullet \) be the quotient complex \(\varvec{L}^\bullet _i/\varvec{L}^\bullet _{i+1}\), suitably restricted so that it assigns zero stalks to all cells lying outside \(\sigma \). Over each cell z in \(\sigma \), the cohomology \(H^\bullet \varvec{K}_i(z)\) coincides with the compactly supported cohomology of the difference \({\mathbf{st}}_i(z) - {\mathbf{st}}_{i+1}(z)\). By construction, the closure of a canonical \((n-i)\)-stratum \(\tau \) in \(\mathrm {X}\) intersects \(\sigma \) at the cell z if and only if the cohomology \(H^{n-i}\varvec{K}_i(z)\) is non-trivial. By definition, \(\varvec{K}_i^\bullet \) fits into a short exact sequence (of complexes of cosheaves over \(\sigma \)):

$$\begin{aligned} 0 \rightarrow \varvec{L}^\bullet _{i+1} \hookrightarrow \varvec{L}^\bullet _i \twoheadrightarrow \varvec{K}_i^\bullet \rightarrow 0. \end{aligned}$$

Applying the five lemma [28, Ex 1.3.3] to the resulting long exact sequence, we note that all the extension maps of \(\varvec{K}_i^\bullet \) induce isomorphisms on cohomology. Thus, if \(H^{n-i}\varvec{K}_i\) is nonzero at z, then it is also nonzero at every other cell in \(\sigma \), whence every cell in \(\sigma \) admits a co-face from \(\tau \). Thus, \(\sigma \subset \overline{\tau }\), as desired.

Finally, to see that \(\sigma \) is canonical, we use Proposition 5.8 to pick an \((n-d)\)-cell w from \(\mathrm {Y}_d\) so that all cells in \(\sigma \) are isomorphic in \(\varvec{S}_d\) to w. Proposition 5.7 now guarantees that no additional cells may be added to \(\sigma \) while preserving its connectedness. \(\square \)

The three preceding propositions establish that the sequence \(\mathrm {Y}_\bullet \subset \mathrm {X}\) from Definition 5.1 constitutes the canonical stratification of \(\mathrm {X}\). The localization functors \({{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{S}_\bullet \) and the universal functors \(\varvec{S}_\bullet \rightarrow \varvec{S}_{\bullet +1}\) arising from the inclusions \(W_\bullet \subset W_{\bullet +1}\) fit into a commutative diagram

which one may view as analogous to an injective resolution of the functor \({{\mathbf{Fc}}}(\mathrm {X}) \rightarrow \varvec{S}_0\) from Sect. 4. Proceeding from left to right in the sequence above, we obtain canonical strata of decreasing dimension by examining isomorphism classes in \(\varvec{S}_\bullet \). We collect these results into the following expanded version of Theorem 1.1.

Theorem 5.10

Given a finite regular n-dimensional CW complex \(\mathrm {X}\), let \(\mathrm {Y}_\bullet \) and \(W_\bullet \) be as in Definition 5.1, and let \(\varvec{S}_\bullet \) denote the localization of the face poset \({{\mathbf{Fc}}}(\mathrm {X})\) about \(W_\bullet \). For each \(d \in [n]\), the canonical \((n-d)\)-strata of \(\mathrm {X}\) correspond bijectively with isomorphism classes of \((n-d)\)-dimensional cells from \(\mathrm {Y}_d\) in \(\varvec{S}_k\) for any \(k \ge d\).

The morphisms in the last category \(\varvec{S}= \varvec{S}_n\) also recover the frontier partial order among canonical strata.

Proposition 5.11

The frontier relation \(\tau \succeq \sigma \) holds among two canonical strata of \(\mathrm {X}\) if and only if there is a morphism in \(\varvec{S}\) from a cell lying in \(\tau \) to a cell lying in \(\sigma \).

Proof

If \(\tau \succeq \sigma \) holds, then there are cells w and z in \(\tau \) and \(\sigma \), respectively, so that \(w \ge z\) in \({{\mathbf{Fc}}}(\mathrm {X})\). This face relation includes into \(\varvec{S}\) as a morphism from w to z. Conversely, given cells w and z in \(\tau \) and \(\sigma \), respectively, assume the existence of a W-zigzag

$$\begin{aligned} \zeta = (w \ge y_0 \le x_0 \ge \cdots \ge y_k \le x_k \ge z), \end{aligned}$$

and let \(\varphi _\zeta :[k] \rightarrow [n]\) be the associated monotone function from Lemma 5.5. By construction, this zigzag contains cells in canonical strata \(\tau _i\) of dimension \(n-\varphi _\zeta (i)\) for all i in [k]. If \(\varphi _\zeta (i) = \varphi _\zeta (i+1)\) then \(\tau _i = \tau _{i+1}\); otherwise, \(\tau _i \succ \tau _{i+1}\) (because \(x_i\) is a co-face of \(y_{i+1}\)). Thus, there is a descending sequence of canonical strata

$$\begin{aligned} \tau \succeq \tau _0 \succeq \tau _1 \succeq \cdots \succeq \tau _k \succeq \sigma , \end{aligned}$$

so we obtain \(\tau \succeq \sigma \) as desired. \(\square \)

The argument above shows that the zigzag paths which form morphisms in \(\varvec{S}\) may remain indefinitely in a single stratum or descend to lower-dimensional adjacent strata, but they can never ascend to higher strata. In other words, \(\varvec{S}\) is a (cellular, 1-categorical) version of the entrance path category associated with the canonical stratification of \(\mathrm {X}\)—see [21, Def 3.1], [27, Sec 7] or [32, Sec 2].

6 Algorithms

From a computational perspective, the local cohomology \(\varvec{L}^\bullet \) of a finite regular CW complex enjoys the obvious, but enormous, advantage of being local. One only ever needs to construct cochain complexes corresponding to open stars of cells (rather than holding the entire complex in system memory). Since each such star-complex may be processed independently of the others, the construction of \(\varvec{L}^\bullet \) and the computation of \(H^\bullet \varvec{L}\) are inherently distributable operations.

6.1 Subroutines

There are several avenues for efficiently storing a CW complex for the purpose of computing its cohomology: One may employ a Hasse graph, whose vertices are cells and whose edges, usually adorned with an orientation, connect neighboring cells across codimension one. Alternately, one may directly store (sparse avatars of) coboundary matrices over R, whose nonzero entries encode adjacencies between cells of codimension one. In the presence of extra structure—for instance, if the complex involved is simplicial or cubical—the additional rigidity affords access to highly optimized data structures such as simplex trees or bitmaps. Rather than tethering the prospective implementer to a fixed and possibly inconvenient representation, we will present all our algorithms at a high level and work directly with the poset of cells.

figure j

Our first subroutine UpSet employs a minor modification of breadth-first search on a finite poset P to extract the subposet of all elements which lie above a fixed element v but not above a fixed element u. In all instances of interest here, our input P will be the face poset \({{\mathbf{Fc}}}(\mathrm {X})\) of a finite regular CW complex \(\mathrm {X}\), while u and v will be adjacent cells across codimension one:

$$\begin{aligned} u>_1 v \text { if } u > v \text { and } \dim u - \dim v = 1. \end{aligned}$$

By definition, the output \(P_v^u\) in such cases is precisely the subposet of \({{\mathbf{Fc}}}(\mathrm {X})\) containing cells which lie in the difference of open stars \({\mathbf{st}}(v) - {\mathbf{st}}(u)\). We also reserve the right to set \(u = \varnothing \), so that line 07 does not check x against u and the output is just the poset of cells in \({\mathbf{st}}(v)\).

The next required subroutine is Cohom, which accepts a poset of cells as input and returns the sequence of R-modules corresponding to the cohomology of the associated cochain complex. When R is a field, the cohomology modules are all vector spaces and in this case the output can just be a sequence of integers storing their dimensions. If R is the ring of integers, then one has to encode the torsion subgroups (if any) in addition to the ranks of the free parts in every dimension. In either case, since the efficient computation of (co)homology has been extensively discussed elsewhere [6, 16, 17, 20], we will treat this subroutine as a black box and not explicitly write it down here.

6.2 Description

Our main algorithm StratCast accepts as input the poset of cells in a finite n-dimensional regular CW complex \(\mathrm {X}\) and uses the constructions of Definition 5.1 to assign each cell x a number \(\textit{codim}(x)\) in \([n] = \{0,1,\cdots ,n\}\) so that x lies in a canonical stratum of dimension \(n-\textit{codim}(x)\). Once codimensions have been determined for all cells, finding the actual canonical strata reduces to the simple task of locating connected components of a fixed codimension.

figure k

The main loop (in line 01) increments the current codimension d from 0 up to n; as it executes each iteration, the cells lying on \((n-d)\)-dimensional canonical strata are identified and removed from \(\mathrm {X}\), so that in the dth iteration we pass from \(\mathrm {Y}_d\) to \(\mathrm {Y}_{d+1}\) in the language of Definition 5.1. There are three secondary loops (at lines 02, 04 and 09); all three are trivially distributable across several processors, as indicated by the dist comments in those lines. The first loop in line 04 is easiest to explain: It uses our subroutines UpSet and Cohom to compute the compactly supported cohomology of each open star \({\mathbf{st}}(w) \cap \mathrm {Y}_d\) where w is a cell in \(\mathrm {Y}_d \subset \mathrm {X}\).

The second loop from line 04 computes whether or not inclusions of open stars \({\mathbf{st}}(x) \subset {\mathbf{st}}(y)\) for \(x >_1 y\) induce isomorphisms on compactly supported cohomology by examining their cokernels. In other words, we use the fact that the map induced by \(\varvec{L}_d^\bullet (x >_1 y)\) (namely, the inclusion \({\mathbf{st}}(x) \cap \mathrm {Y}_d \hookrightarrow {\mathbf{st}}(y) \cap \mathrm {Y}_d\)) on compactly supported cohomology is an isomorphism if and only if the difference \(({\mathbf{st}}(y) - {\mathbf{st}}(x)) \cap \mathrm {Y}_d\) has trivial compactly supported cohomology. We begin by assigning to each face relation \((x >_1 y)\) the number \(\ell (x >_1 y) = -1\). As the algorithm executes, \(\ell (x >_1 y)\) gets incremented to the largest integer k so that \((x >_1 y)\) lies in \(E_k\), where \(E_\bullet \) denotes the sets from (6). Since this loop is completely independent of the loop in line 02, it may be executed simultaneously with that loop.

The third loop, which spans lines 09 through 12, must be executed after the first two intermediate loops have terminated. It uses the cohomology groups \(h^\bullet \) computed by the loop in line 02 and the \(\ell \)-values computed by the loop in line 04 to select cells lying on canonical strata of dimension \((n-d)\) via (7). Note that line 10 ensures the correct dimensionality and line 11 enforces upward-closure. Line 13 removes all cells lying on canonical \((n-d)\)-strata from \(\mathrm {Y}_d\), so we are left with \(\mathrm {Y}_{d+1}\) and the outer loop of line 01 enters its next iteration.

6.3 Complexity

The intermediate loops in line 02 and line 04 of StratCast require breadth-first search (for constructing open stars via UpSet) and matrix diagonalization through row and column operations (for computing cohomology with Cohom). Let m be the number of cells in \(\mathrm {X}\), and define the additional star size complexity parameter

$$\begin{aligned} p = \max \left\{ \text {number of cells in } {\mathbf{st}}(x) \mid x \text { is a cell in } \mathrm {X}\right\} . \end{aligned}$$
(9)

(It suffices to take the maximum over zero-dimensional cells, since those have the largest stars.) The worst-case complexity of computing cohomology of any open star, or a difference of open stars, via row and column operations is thus \(O(p^3)\) provided we incur a constant cost performing ring operations in R. The cost of running Cohom clearly dominates the \(O(p^2)\) cost of executing breadth-first search in UpSet. Since the loops of line 02 and 04 may be executed in a completely distributed fashion, their combined cost within a single iteration of the outer loop of line 01 is \(O(p^3)\).

The third intermediate loop (on line 09) may be reinterpreted as two nested loops: an outer i-loop which decrements dimension from \((n-d-1)\) to 0, and an inner u-loop which examines all remaining cells of dimension i. Since we require knowledge of codim values of all cells \(v >_1 u\) while processing each u, only the u-loop is actually distributable. During each iteration of the u-loop, one incurs an O(p) cost while checking all remaining cells \(v >_1 u\) in line 11, and an R-dependent cost of testing R-module isomorphisms in line 10. At least when R is a finite field, the rationals or the integers, checking whether a given module has rank one or zero incurs O(1) cost. Thus, in typical cases we expect line 11 to dominate the burden of executing the u-loop. Noting that the i-loop runs at most n times regardless of d, each iteration of the loop on line 09 incurs a computational cost of O(np).

Since all cells with codim\( = d\) are identified on lines 08 and 12 in a given iteration of the outer d-loop of StratCast, we assume that removing them from \(\mathrm {X}\) incurs no additional cost. Putting all our estimates together, each iteration of the d-loop incurs a worst-case cost of \(O(p^3 + np)\). Noting that this loop executes exactly \((n+1)\) times, the total complexity of running StratCast—assuming that the number of available processors exceeds the number of cells m plus the maximum number mp of codimension-one face relations in \(\mathrm {X}\)—is \(O\left( (n+1)(p^3+np)\right) \). And once StratCast has terminated, one may find all desired canonical strata of \(\mathrm {X}\) by computing connected components of cells with the same codim value. This is linear in the number of cells in \(\mathrm {X}\), so we obtain the following result.

Proposition 6.1

Let \(\mathrm {X}\) be an n-dimensional regular CW complex with m cells and star size p as in (9). The time complexity of computing its canonical stratification with coefficients in a (commutative, unital) ring R via StratCast is

$$\begin{aligned} O\left( (n+1)(p^3+np) + m\right) , \end{aligned}$$

provided that

  1. (1)

    ring operations in R incur O(1) cost,

  2. (2)

    isomorphism-testing against 0 and R in \({\mathbf{Mod}}(R)\) is O(1), and

  3. (3)

    the number of available processors exceeds \(m(p+1)\).

The first two conditions above are satisfied by typical choices of R (such as the integers or finite fields). In practice, one expects to have \(m \gg (n+1)(p^3+np)\), so the observed cost of computing canonical strata is essentially linear in the size of \(\mathrm {X}\).