1 Introduction and Main Results

Shape spaces are intended to provide a single framework for comparing shapes. Different shapes are rendered as different points in shape space and comparisons of shapes can be formalized in terms of distances between these different points; see Fig. 1. One of the first examples of a shape space was pioneered in [46, 47] and takes the perspective that two shapes can be compared by first placing landmarks down on each shape. If these landmarks are related by a similarity transformation—a rotation or dilation—then they are regarded as the same shape. Non-identical shapes are then compared in an appropriately defined quotient space, assuming the number of landmarks are the same. Another popular model of shape space dispenses with the landmark selection process and considers shapes as immersed submanifolds [13] and then tries to compare them via diffeomorphisms of the ambient space, possibly generated by some optimal transport or control problem [26].

Fig. 1
figure 1

Previous constructions of shape space imply a fiber bundle perspective on shape space. The fibers encode similarity transformations or reparameterizations of a shape and the base space records the shape as an equivalence class. The PHT-based shape space introduced here uses a more algebraic construction where the base space is replaced by a base poset and the “fibers” are unique sheaf-theoretic representations of the shape

However, common to both the landmark and diffeomorphism-based approaches to shape space is a quotient operation that naturally lends a fiber bundle structure to these data representations and comparisons. Fiber bundles provide a convenient mathematical language for shape comparison, but previous work [43] also illustrates their insufficiency for general morphological comparison. Indeed, the implicit assumption for both of these models—and many more models for shape space discussed below in Sect. 1.1—is that the shapes under consideration have the same topology.

This assumption severely limits the applicability of these approaches to many datasets of interest. For example, in a dataset of fruit fly wings, some mutant flies have extra lobes of veins [56]; or, in a dataset of brain arteries, many of the arteries cannot be continuously mapped to each other [8]. Indeed, in large databases such as MorphoSource and Phenome10K [10, 33], the CT scans of skulls across many clades are not diffeomorphic or even homeomorphic. Although some methods have been developed to address these issues, a general theory of shape comparison is still lacking.

In this paper we introduce an algebraic construction of shape space that circumvents some of the problems discussed above. Topologically different subsets of \({\mathbb {R}}^d\) can be viewed simultaneously and compared in our framework. We accomplish this by passing from the land of fiber bundles to the world of sheaves, which replaces the local triviality condition of fiber bundles with the local continuity condition of sheaves. This passage requires two preparatory steps of categorical generalization:

  1. (1)

    Instead of a “base manifold” of shapes we work with a “base poset” of constructible sets \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) ordered by inclusion. This poset is equipped with a notion of continuity via a Grothendieck topology.

  2. (2)

    Each shape—that is, each point \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\)—is equivalently regarded via its persistent homology transform \({{\,\textrm{PHT}\,}}(M)\), which is an object in the derived category of sheaves \({\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}}))\).

With these observations in place, our main result can be summarized as follows.

Theorem 1.1

The following assignment is a homotopy sheaf:

$$\begin{aligned} {\mathcal {F}}:{{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)^{op} \rightarrow {\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}})) \qquad M \mapsto {{\,\textrm{PHT}\,}}(M). \end{aligned}$$

This is precisely stated and proved as Theorem 3.9 below. Intuitively, this result allows us to interpolate between shapes in a continuous way via their persistent homology transforms; continuity is mediated via a Grothendieck topology on \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\). More precisely, our main result establishes Čech descent for the persistent homology transform, which is a generalization of the sheaf axiom that holds for higher degrees of homology. In one concrete form, our main result implies the following theorem, which appears as Corollary 3.16 below.

Theorem 1.2

(Nerve Lemma for the PHT) If \( M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) is a polyhedron, i.e. it can be written as a finite union of closed linear simplices \( {\mathcal {M}} = \{\sigma _i\}_{i\in \Lambda }\), then the n-th cohomology sheaf of the PHT, i.e., the \(n^{th}\) PHT sheaf of Definition 2.21, written \({{\,\textrm{PHT}\,}}^n(M)\), is isomorphic to the n-th cohomology of the following complex of sheaves:

$$\begin{aligned} 0\rightarrow \bigoplus _{I\subset \Lambda \,s.t.\, |I|=1}{{\,\textrm{PHT}\,}}^0({\mathcal {M}}_I) \rightarrow \bigoplus _{I\subset \Lambda \,s.t.\, |I|=2}{{\,\textrm{PHT}\,}}^0({\mathcal {M}}_I) \rightarrow \cdots \end{aligned}$$

Here \({\mathcal {M}}_I\) with \(|I|=k\) denotes the disjoint union of depth k intersections of closed simplices appearing in the cover \({\mathcal {M}}\).

The importance of Theorem 1.2 (Corollary 3.16) is that it allows us to calculate the higher homology PHTs using only \({{\,\textrm{PHT}\,}}^0\) of elements in a PL covering. Since finding connected components in a filtration is computationally simpler—\({\mathcal {O}}(n\log n)\)—than calculating higher homology, this result illustrates how the theory of spectral sequences provides potential guarantees on computing the full PHT of a shape in all degrees. However, the ability to cover a shape by PL shapes, and thus approximate a shape using PL ones, is a necessary first step.

As such it is desirable to have an approximation result that is provably stable under the persistent homology transform. We do this by first proving a general stability theorem for the PHT—after introducing several new metrics in Sect. 4.1—under controlled homotopies. The following theorem appears as Theorem 4.11 below.

Theorem 1.3

(Stability of the PHT) Any two constructible sets \(M,N \in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^{d})\) that are homotopy equivalent via homotopies that move no point more than \(\varepsilon \) have \(\varepsilon \)-close PHTs of M and N.

Finally, using the sampling methods of [62], we show how to construct with high confidence a PL approximation of any nice enough submanifold of \({\mathbb {R}}^d\).

Corollary 1.4

(Approximation of the PHT) For any compact submanifold M and \(\varepsilon >0\) sufficiently small we can construct a polyhedron N so that with high probability \({{\,\textrm{PHT}\,}}(M)\) and \({{\,\textrm{PHT}\,}}(N)\) are \(\varepsilon \)-close. \({{\,\textrm{PHT}\,}}(N)\) can then be computed using Theorem 1.2.

1.1 Prior Work on Shape Space

We now outline in more detail prior approaches to shape space, in order to better situate the contributions of this paper. There is a rich history of using differential geometry for modeling shapes, dating back to Riemann [42], and the reader is encouraged to consult the survey articles [6] and [30] for more context there.

However, what follows is a woefully incomplete survey of the literature that tries to balance the theoretical study of shape space as well as the development of algorithms that are used in practice.

As already mentioned, the landmark-based approach to shape space was pioneered in the works of Kendall [46, 47] and was given a textbook-length treatment in Bookstein [9]. In this approach, a pre-shape is defined by a set of k landmark points in \({\mathbb {R}}^d\), where typically \(d = 2,3\). Comparing pre-shapes operates under the assumption that the i-th point in one shape corresponds to the i-th point in every other pre-shape; this introduces the central notion of correspondences in shape space and leads naturally to Procrustean distances, see [47] and more generally [24]. Shapes are then regarded as elements of the quotient space

$$\begin{aligned} \Sigma _d^k:= \{({\mathbb {R}}^d)^{k-1}\setminus 0\}/\text{Sim }, \end{aligned}$$

where Sim is the group of rotations and dilations. Note that in \(\Sigma _d^k\) a shape is deduced from a \(d \times k\) matrix, which is a very convenient representation. However, the downside of this approach is that a user will need to decide on landmarks before analysis can be carried out, and reducing modern databases of 3-dimensional micro-computed tomography (CT) scans [10, 33] to landmarks can result in a great deal of information loss.

The second approach to shape space mentioned above really is a broader umbrella of techniques, but they are all connected by the use of larger, infinite-dimensional groups of deformations to compare and match shapes using an underlying template. Pulling on ideas from analysis, differential geometry, and probability theory, these approaches are sometimes gathered under the heading of “Pattern Theory”, see [35, 36] and [60]. In many of these approaches, the collection of shapes is regarded as a homogeneous space under the group of diffeomorphisms of \({\mathbb {R}}^d\). The difference between two shapes under this paradigm is encoded by the deformation that matches one shape to another. Theses differences can be measured algorithmically by solving a registration problem, with the large deformation diffeomorphic metric mapping (LDDMM) [4, 7, 41] being one such class of methods. These algorithms typically find the optimal one-parameter family of diffeomorphisms, parametrized by time, that smoothly transforms the initial shape to the target; the optimization problem considered is over paths with the least time integrated kinetic energy. The theory of these shape spaces typically involves the geometry (and Riemannian structure) on the infinite-dimensional space of immersions of a fixed template into \({\mathbb {R}}^d\), written \(\textrm{Imm}(M,{\mathbb {R}}^d)\), and the resulting, induced \(\textrm{Diff}(M)\)-invariant metrics [55, 61]. Although this viewpoint bypasses the need for landmarks, the resulting spaces of interest are infinite-dimensional.

There are many more approaches to shape comparison worth mentioning. In similar spirit to the above, there is elastic shape analysis [58, 70, 81] as well as approaches based on conformal geometry [67, 79], currents [74], and varifolds [14].

Although each of these make varying assumptions on the geometric rigidity of the underlying shapes, the approaches of [54] and [12] are notable for working with probabilistic variations on the Gromov-Hausdorff model for shapes, which is the most general and works for arbitrary metric spaces.

Finally, the shape space model that we propose builds on fundamental work of Schapira [65, 66], who implicitly developed the Euler characteristic transform (ECT), which was later developed alongside the persistent homology transform (PHT) in [73] to compare triangulable shapes. The ECT and PHT have two useful properties: standard statistical methods can be applied to the transformed shape and the transforms are injective [20, 31], so no information about the shape is lost via the transform. The utility of the transforms for applied problems in evolutionary anthropology, biomedical applications and plant biology were demonstrated in [3, 17, 72, 78].

1.2 Our Contribution to Shape Space Theory

Although [73] pioneered the use of the ECT and PHT for shape classification and machine learning, the algebraic relation between the transforms of varying shapes was not realized. In this paper we leverage the functoriality properties of homology to show how the PHT admits a finer organizing structure for the space of all triangulable shapes, ordered by inclusion. In this sense, we move beyond the particular mathematical properties proved in [20], to a broader outlook of how to move between shapes using a sheaf structure. Pinning down this structure occupies the bulk of the paper as it requires an unprecedented amount of algebra for shape space theory, including the first known contact with \(\infty \)-categories, currently isolated to Appendix A. Although the current paper is primarily directed towards developing the full algebraic picture of a PHT-based shape space, we have also made several innovations on the metrics and analysis side, with some preliminary comparison with Procrustes-type distances detailed in Sect. 4.2. A future research program for more systematically comparing our approach with the approaches in Sect. 1.1 is outlined in Sect. 5.

2 Background on Constructibility, Persistent Homology and Sheaves

In this section we recall background material from [20]. We proceed by defining the class of shapes that we want to work with—constructible sets (Definition 2.1)—then identify an increasingly refined set of topological transforms for studying these. The Euler characteristic transform (ECT), the simplest of them all, paves the way for the Betti curve transform (BCT) and Persistent Homology Transform (PHT).

2.1 O-Minimality

Although shapes in the real world can exhibit wonderful complexity, we impose a fairly weak tameness hypothesis that prohibits us from considering infinitely constructed shapes such as fractals and Cantor sets. This tameness hypothesis is best expressed using the language of o-minimal structures [75].

Definition 2.1

An o-minimal structure \({\mathcal {O}}= \{{\mathcal {O}}_d\}\), is a specification of a boolean algebra of subsets \({\mathcal {O}}_d\) of \({\mathbb {R}}^d\) for each natural number \(d\ge 0\). In particular, we assume that \({\mathcal {O}}_1\) contains only finite unions of points and intervals. We further require that \({\mathcal {O}}\) be closed under certain product and projection operators, i.e. if \(A \in {\mathcal {O}}_d\), then \(A\times {\mathbb {R}}\) and \({\mathbb {R}}\times A\) are in \({\mathcal {O}}_{d+1}\); and if \(A \in {\mathcal {O}}_{d+1}\), then \(\pi (A)\in {\mathcal {O}}_d\) where \(\pi : {\mathbb {R}}^{d+1}\rightarrow {\mathbb {R}}^d\) is axis aligned projection. It is a fact that \({\mathcal {O}}\) contains all semi-algebraic sets, but may contain certain regular expansions of these sets. Elements of \({\mathcal {O}}\) are called definable sets and compact definable sets are called constructible sets. The subcollection of constructible subsets in \({\mathcal {O}}_d\) is denoted \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\).

Intuitively, any shape that can be faithfully represented via a mesh on a computer is a constructible set. This is because every constructible set is triangulable [75]. This property also implies that certain algebraic topological signatures, such as Euler characteristic and homology, are well-defined for any constructible set.

Fig. 2
figure 2

The letter ‘A’ summarized using three, increasingly coarse, topological transforms. The Persistent Homology Transform (PHT) and the Betti Curve Transform (BCT) are both graded by homological degree, but the Euler Characteristic Transform (ECT) produces a single integer-valued function for each direction v

2.2 Euler Characteristic and the Radon Transform

Any triangulable space M has a well-defined Euler characteristic, which is given by the formula

$$\begin{aligned} \chi (M)=\sum _{i=0}^{\infty } (-1)^i \# i-\text {dimensional simplices}. \end{aligned}$$

The fact that this is a topological invariant—meaning it is independent of the choice of triangulation—is a surprising, if not routine, exercise in homology theory, which stands as the deeper invariant that we will work towards. However, even this simple alternating count of cells can prove to be a powerful invariant for an embedded subset \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) when filtered in a given direction v; see the rightmost part of Fig. 2 for an example. This provides our first definition of a topological transform, which we will refine with other topological invariants in due course.

Definition 2.2

(ECT: Map Version) The Euler Characteristic Transform (ECT) of a constructible set \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) is the map that assigns to each direction \(v\in {\mathbb {S}}^{d-1}\) the piece-wise constant integer-valued function on \({\mathbb {R}}\) that records the Euler characteristic of the sublevel set of M in direction v, i.e.,

$$\begin{aligned} {{\,\textrm{ECT}\,}}(M):{\mathbb {S}}^{d-1} \rightarrow {\mathbb {Fun}}({\mathbb {R}},{\mathbb {Z}}) \qquad {{\,\textrm{ECT}\,}}(M)(v,t) = \chi \big (M_{v,t}\big ), \end{aligned}$$

where \(M_{v,t}:=\{x\in M \mid x\cdot v \le t\}\) is the intersection of M with the half-space \(x\cdot v\le t\).

We note that since M is constructible and the equation defining a sub-level set is semi-algebraic—and hence definable—the intersection \(M_{v,t}\) is constructible as well, and thus has a well-defined Euler characteristic.

As our notation suggests, one can also view \({{\,\textrm{ECT}\,}}(M)\) as a function from \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\) to \({\mathbb {Z}}\) that assigns to each pair \((v,t)\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) the Euler characteristic \(\chi (M_{v,t})\). This perspective is important because it allows us to view the ECT as a type of integral transform, which takes a shape (viewed as an indicator function on \({\mathbb {R}}^d\)) and produces a function on \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\)—a coordinate system built for tomographic comparison. To make this precise, we briefly review the key ingredients of Euler calculus [19], which treats Euler characteristic as a type of measureFootnote 1.

Definition 2.3

(Constructible Functions, Integration, Pushforward and Pullback, cf. [65]) If \(X\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\), then a constructible function is an integer valued function \(f:X \rightarrow {\mathbb {Z}}\) with only finitely many non-empty level sets, each of which are definable, and hence triangulable. We denote the subgroup of constructible functions on X by \(\text {CF}(X)\subset {\mathbb {Fun}}(X,{\mathbb {Z}})\).

If \(\varphi :X\rightarrow Y\) is a (tame) mapping between constructible sets, then we have pushforward \(\varphi _*:\text {CF}(X) \rightarrow \text {CF}(Y)\) and pullback \(\varphi ^*:\text {CF}(Y) \rightarrow \text {CF}(X)\) operations via

$$\begin{aligned} \varphi _* f (y){} & {} :=\int _{\varphi ^{-1}(y)} f d\chi \quad \text {and} \quad \varphi ^*g(x):=g(\varphi (x)) \quad \text {where} \quad \int _X f d\chi \\{} & {} := \sum _{n=-\infty }^{\infty } n \cdot \chi (f^{-1}(n)) \end{aligned}$$

compactly-supported Euler characteristic.

Definition 2.4

(Radon Transform and ECT: Version 2) Let \(S\subset X\times Y\) be a closed constructible subset of the product of two constructible sets. Let \(\pi _X\) and \(\pi _Y\) be the projections onto the indicated factors. The Radon Transform with respect to S is a group homomorphism \({\mathcal {R}}_S:\text {CF}(X)\rightarrow \text {CF}(Y)\) defined by

$$\begin{aligned} {\mathcal {R}}_S(\phi ):= (\pi _Y)_* \big [ ((\pi _X)^*\phi ) \mathbb {1}_S \big ] \quad \text {where} \quad {\mathcal {R}}_S(\phi )(y)= \int _{\pi _Y^{-1}(y)} (\phi \circ \pi _X)\mathbb {1}_S d\chi . \end{aligned}$$

Notice that by taking \(\phi = \mathbb {1}_M\) and \(S= \{(x,v,t)\in {\mathbb {R}}^d\times {\mathbb {S}}^{d-1}\times {\mathbb {R}}\mid x\cdot v \le t\}\) the Euler characteristic transform of M coincides with the Radon transform of its indicator function.

A celebrated theorem of Schapira [66] gives a criterion for determining the invertibility of the Radon transform \({\mathcal {R}}_S\) in terms of the Euler characteristic of the fibers of \(S\subset X \times Y\), when projected to each of these two factors:

Theorem 2.5

([66] Theorem 3.1) If \(S\subset X\times Y\) and \(S'\subset Y\times X\) have fibers \(S_x\) and \(S'_x\) in Y satisfying

  1. (1)

    \(\chi (S_x\cap S'_x)=\chi _1\) for all \(x\in X\), and

  2. (2)

    \(\chi (S_x\cap S'_{x'})=\chi _2\) for all \(x'\ne x \in X\),

then for all \(\phi \in {{\,\textrm{CF}\,}}(X)\),

$$\begin{aligned} ({\mathcal {R}}_{S'} \circ {\mathcal {R}}_{S})\phi = (\chi _1-\chi _2)\phi +\chi _2 \left( \int _X \phi d\chi \right) 1_X. \end{aligned}$$

In [20] this was used to prove that the Euler Characteristic Transform is injective.

Theorem 2.6

([20] Theorem 3.5) The Euler Characteristic Transform \({{\,\textrm{ECT}\,}}: {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d) \rightarrow {{\,\textrm{CF}\,}}(S^{d-1} \times {\mathbb {R}})\) is injective, i.e. if \({{\,\textrm{ECT}\,}}(M)={{\,\textrm{ECT}\,}}(M')\), then \(M=M'\).

2.3 Homology and the Betti Curve Transform

A useful algebraic summary of a constructible set \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) is homology in degree n with coefficients in a field \(\Bbbk \), written \(H_n(M;\Bbbk )\). Although there are many flavors of homology—simplicial, cellular, and singular, to name a few—for constructible sets they all agree.

As a reminder of the simplest version of homology—simplicial homology—one uses a triangulation of M to define the group of n-chains, written \(C_n(M;\Bbbk )\), which is the \(\Bbbk \)-vector space generated by all the n-simplices in the triangulation of M. Since an n-simplex can be viewed as a formal combination of \(n+1\) vertices \(\sigma =\{v_{i_0},\ldots ,v_{i_n}\}\), one has a natural map from n-chains to \(n-1\)-chains given by deleting one vertex at a time. To make this precise, and to operate over fields \(\Bbbk \ne {\mathbb {F}}_2\), we choose a local orientation of each simplex \(\sigma \). This amounts to specifying an ordering of the vertices so that we can present \(\sigma =[v_{i_0},\ldots ,v_{i_n}]\) as an ordered list rather than a set of vertices. The n-boundary operator \(\partial _n\) takes a basis vector \(\sigma \) to

$$\begin{aligned} \partial _n \sigma = \sum _{j=0}^{n} (-1)^j [v_{i_0},\ldots ,{\hat{v}}_{i_j},\ldots ,v_{i_n}], \end{aligned}$$

where \({\hat{v}}_{i_j}\) indicates the vertex being deleted. Extending this definition linearly, one obtains a linear map \(\partial _n:C_n(M;\Bbbk ) \rightarrow C_{n-1}(M;\Bbbk )\). It is a tedious, but routine, check to verify that \(\partial _{n-1} \circ \partial _n=0\) for every \(n\ge 0\). This then guarantees that \({{\,\textrm{im}\,}}\partial _{n+1} \subseteq \ker \partial _n\), which allows us to define the \(n^{th}\) homology groupFootnote 2 of M as

$$\begin{aligned} H_n(M;\Bbbk ):= \frac{\ker \partial _n}{{{\,\textrm{im}\,}}\partial _{n+1}}. \end{aligned}$$

The rank/dimension of the n th homology group of M is also called the n th Betti number \(\beta _n(M)\), and it serves as another topological invariant of M, which can be used to distinguish shapes such as the torus \({\mathbb {T}}\) and the 2-sphere \({\mathbb {S}}^2\), because \(\beta _1({\mathbb {T}})=2\) and \(\beta _1({\mathbb {S}}^2)=0\). Intuitively, the Betti numbers count the number of “holes” in each dimension. The circle \({\mathbb {S}}^1\), or the letter ‘A’ in Fig. 2, each have one hole in dimension 1 so \(\beta _1({\mathbb {S}}^1)=\beta _1(\text {`A'})=1\). Because the sphere \({\mathbb {S}}^2\) and the torus \({\mathbb {T}}\) have a hollow interior which disconnects the complement when viewed as a subset of \({\mathbb {R}}^3\), they each have a single two-dimensional “hole”, reflected in the calculation \(\beta _2({\mathbb {S}}^2)=\beta _2({\mathbb {T}})=1\). In general, a compact subset of \({\mathbb {R}}^d\) cannot have any “holes” in dimension d or higher, thus guaranteeing that \(\beta _{i}(M)=0\) for \(i\ge d\).

The Betti numbers also provide a “lift” of the Euler characteristic in the sense that it both refines the Euler characteristic via the formula

$$\begin{aligned} \chi (M):=\sum _{i=0}^d (-1)^i\beta _i(M), \end{aligned}$$

but it also distinguishes spaces that the Euler characteristic cannot, e.g. \(\chi ({\mathbb {T}})=\chi ({\mathbb {S}}^1)=0\), but \(\beta _1({\mathbb {T}})\ne \beta _1({\mathbb {S}}^1)\). Filtering in each direction also lifts the Euler characteristic transform.

Definition 2.7

(BCT: Map Version) The Betti Curve Transform (BCT) of a constructible set \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) associates to each direction \(v\in {\mathbb {S}}^{d-1}\) the vector of piece-wise constant integer-valued functions on \({\mathbb {R}}\) that record the Betti numbers of the sublevel set of M in direction v, i.e.,

$$\begin{aligned} \text {BCT}(M):{\mathbb {S}}^{d-1} \rightarrow {{\,\textrm{CF}\,}}({\mathbb {R}})^d \qquad {{\,\textrm{BCT}\,}}(M)(v,t) = \big (\beta _0\big (M_{v,t}\big ),\ldots ,\beta _{d-1}\big (M_{v,t}\big )\big ). \end{aligned}$$

2.4 Functoriality and the Persistent Homology Transform

Implicit in the definition of both the ECT and the BCT is the study of topological invariants of a 1-parameter family of spaces. Studying how these invariants vary as a function of the parameter \(t\in {\mathbb {R}}\) is the central idea of persistent topology. Of all the topological invariants discussed—Euler characteristic, homology, and Betti numbers—homology is far more structured than the other two. This is due to the functoriality of homology, which states that maps on spaces \(f:X\rightarrow Y\) induce maps on homology groups \(f_*:H_*(X)\rightarrow H_*(Y)\) and these maps compose correctly, i.e., if \(g:Y\rightarrow Z\) is another map, then the induced map on homology of the composition \((g\circ f)_*\) is the same as the composition of the induced maps \(g_*\circ f_*\). This is summarized by saying that homology in each degree i defines a functor \(H_i:\textbf{Top}\rightarrow \textbf{Vect}\) from the categoryFootnote 3 of topological spaces and continuous maps to the category of vector spaces and linear maps.

Fig. 3
figure 3

When filtering a shape M in the direction v, one tracks connected components using the functor \(\pi _0\). The merge tree (shown above left) summarizes the 1-parameter family of sets \(\pi _0(M_{v,t})\) and one can read off the maps by tracing components along the merge tree. Zeroth homology \(H_0\) linearizes this family of sets and maps to produce vector spaces and linear maps. The barcode decomposition of \(H_0(M_{v,t})\) is a canonical representation of this family of vector spaces and maps using a multi-set of intervals. The number of bars overlapping a point t indicates the dimension of the vector space \(H_0(M_{v,t})\) and the number of intervals spanning an interval encodes the rank of the map \(H_0(M_{v,s})\rightarrow H_0(M_{v,t})\). The persistence diagram—our preferred representation—encodes these intervals as points above the diagonal. The rank of each map is encoded in this second representation by counting the number of points up and to the left

In traditional (sublevel set) persistent homology, one organizes the filtration of a shape M in direction v as a functor \(F_v:({\mathbb {R}},\le )\rightarrow \textbf{Top}\), where \(F(t):=M_{v,t}\) is the subset of M cut out by \(x\cdot v\le t\) and \(F(s\le t):M_s \subseteq M_t\) is the induced inclusion of these subsets. Post-composing the filtration functor with the homology functor defines the persistent homology of the filtration, written \({{\,\textrm{PH}\,}}_i(M_v):=H_i\circ F_v: ({\mathbb {R}},\le ) \rightarrow \textbf{Vect}\). It is a remarkable fact of representation theory [18] that whenever this functor lands in the sub-category of finite-dimensional vector spaces and maps, written \({{\,\textrm{PH}\,}}_i(M_v): ({\mathbb {R}},\le ) \rightarrow \textbf{vect}\), then persistent homology decomposes into a collection of indecomposable “building block” functors called interval modules, i.e., \(PH_i(M_v)\cong \bigoplus _I I^{n_I}_{\Bbbk }\), where each \(I^{n_I}_{\Bbbk }:({\mathbb {R}},\le )\rightarrow \textbf{vect}\) assigns \(\Bbbk ^{n_I}\) to points in the intervalFootnote 4\(I=[b,d)\), the identity map to \(I^{n_I}_{\Bbbk }(s\le t)\) whenever \(s,t\in [b,d)\), and outside of this interval the vector spaces and maps are 0. This multi-set of intervals \({\mathcal {B}}=\{(I,n_I)\}\) defines the barcode of \({{\,\textrm{PH}\,}}_i(M)\), which is alternatively represented as a persistence diagram; see Fig. 3. It should be noted that historically the first paper to introduce persistent homology and an efficient algorithm for its computation [28] did not utilize the decomposition result of [18], but rather used the barcode/persistence diagram representation as a convenient device for representing the ranks of each map on homology \({{\,\textrm{PH}\,}}_i(s\le t)\) for arbitrary \(s\le t\). This perspective was later formalized and generalized by [63], which observed that the persistence diagram can be defined as the Möbius inversion of the rank function.

Regardless of its theoretical grounding, the persistence diagram allows to metrize functors from \(({\mathbb {R}},\le )\) to \(\textbf{vect}\) using any one of many Wasserstein-type metrics, as explained in the next two definitions below.

Definition 2.8

(Persistence Diagram Space) The set of all possible persistence diagrams, written \({\mathbb {Dgm}}\), is the set of all countable multi-sets (sets with repetition allowed) of

$$\begin{aligned} {\mathbb {R}}^{2+}:=\{I=(b,d) \in (\{ - \infty \} \cup {\mathbb {R}})\times ({\mathbb {R}}\cup \{\infty \}) \mid b \le d\} \end{aligned}$$

where the number of points of the form \((b, \infty )\) and \((-\infty , d)\) are finite and \(\sum _{d-b<\infty } d-b <\infty \). Points of the form \((b,\infty )\) or \((-\infty ,d)\) are called essential classes and points of the form (bd) where neither coordinate is \(\infty \) are called inessential classes. For sublevel set filtrations of a constructible set M, there are only inessential classes and essential classes of the form \([b,\infty )\). We can regard any persistence diagram \({\mathcal {B}}\) as a set rather than a multi-set by using a second coordinate to enumerate copies of each interval I, i.e., \({\mathcal {B}}=\{(I;j) \mid (I;j) \in {\mathbb {R}}^{2+}\times {\mathbb {N}}\}\) where j indicates the j th copy of I.

Definition 2.9

(Matchings and the p-Wasserstein Distances) Suppose \({\mathcal {B}}=\{(I;j)\}\) and \({\mathcal {B}}'=\{(I';j)\}\) are two persistence diagrams. A matching of these is a partial bijection \(\sigma :{\mathcal {B}}\rightarrow \mathcal {B'}\), i.e., a choice of subset \({\mathcal {M}}\subseteq {\mathcal {B}}\), called the domain \({{\,\textrm{dom}\,}}(\sigma )\), and an injection \(\sigma :{\mathcal {M}}\rightarrow {\mathcal {B}}'\). The complement of the domain of \(\sigma \) as \({{\,\textrm{dom}\,}}^c(\sigma ):={\mathcal {B}}{\setminus } {{\,\textrm{dom}\,}}(\sigma )\) and the complement of the image of \(\sigma \) as \({{\,\textrm{im}\,}}^c(\sigma ):={\mathcal {B}}'\setminus {{\,\textrm{im}\,}}(\sigma )\) together define the unmatched points of \(\sigma \). We then promote a partial bijection \(\sigma \) to an actual bijection via the introduction of diagonal images; a point \(I=(b,d)\in {\mathbb {R}}^{2+}\) where neither coordinate is \(\infty \) has a diagonal image \(\Delta (I)=(\frac{b+d}{2},\frac{b+d}{2})\). With this convention, a partial bijection \(\sigma :{\mathcal {B}}\rightarrow {\mathcal {B}}'\) becomes an actual bijection of augmented persistence diagrams \({\tilde{\sigma }}:{\mathcal {B}}(\sigma )\rightarrow {\mathcal {B}}'(\sigma )\) where

$$\begin{aligned} {\mathcal {B}}(\sigma ):={{\,\textrm{dom}\,}}(\sigma ) \, \cup \, {{\,\textrm{dom}\,}}^c(\sigma ) \, \cup \bigcup _{(I',j')\in {{\,\textrm{im}\,}}^c(\sigma )} (\Delta (I');j') \end{aligned}$$

and

$$\begin{aligned} {\mathcal {B}}'(\sigma ):={{\,\textrm{im}\,}}(\sigma )\, \cup \, {{\,\textrm{im}\,}}^c(\sigma )\, \cup \bigcup _{(I,j)\in {{\,\textrm{dom}\,}}^c(\sigma )} (\Delta (I);j). \end{aligned}$$

The map \({\tilde{\sigma }}\) now matches points that were previously unmatched by \(\sigma \) with their corresponding diagonal images. By abuse of notation, we simply write \(\sigma \) for the extended map \({\mathcal {B}}(\sigma )\rightarrow {\mathcal {B}}'(\sigma )\). If \(\sigma _j(I)\) denotes the \({\mathbb {R}}^{2+}\) coordinates of \(\sigma (I;j)\) and \(||I-\sigma _j(I)||_p\) is the \(\ell ^p\) metric on \({\mathbb {R}}^{2+}\), then the p-cost of this extended matching \(\sigma \) is

$$\begin{aligned} {{\,\textrm{cost}\,}}_p(\sigma )=\left( \sum _{(I,j)\in {\mathcal {B}}(\sigma )} ||I-\sigma _j(I)||_p^p\right) ^{1/p}. \end{aligned}$$

For every \(p\in [1,\infty ]\) we define the Wasserstein p -distance between two diagrams \({\mathcal {B}}\) and \({\mathcal {B}}'\) is then the infimum of this matching cost over all matchings, i.e.

$$\begin{aligned} W_{p}({\mathcal {B}},{\mathcal {B}}'):=\inf _{\sigma :{\mathcal {B}}\rightarrow {\mathcal {B}}'} {{\,\textrm{cost}\,}}_p(\sigma ). \end{aligned}$$

We note that the Wasserstein \(\infty \)-distance is also called the bottleneck distance, for which we reserve the special notation

$$\begin{aligned} d_B({\mathcal {B}},{\mathcal {B}}'):=W_{\infty }({\mathcal {B}},{\mathcal {B}}') = \inf _{\sigma :{\mathcal {B}}\rightarrow {\mathcal {B}}'} \max _{(I,j)\in {\mathcal {B}}(\sigma )}||I-\sigma _j(I)||_{\infty }. \end{aligned}$$
Fig. 4
figure 4

For an embedded shape in \({\mathbb {R}}^2\), the PHT (Definition 2.10) assigns to each direction \(v\in {\mathbb {S}}^1\) a persistence diagram. In this example we super-impose the PHT of two different embeddings of the letter ‘V’, one in blue with normal directions \(v_1\) and \(v_2\) to the sides of the letter ‘V’ and one in red with flatter sides with steeper normal directions \(w_1\) and \(w_2\). Around the circle are eight persistence diagrams corresponding to the directions \(\pm e_i\) and \(\pm v_i\) for \(i=1,2\); \(e_1=(1,0)\) points in the positive x direction and \(e_2=(0,1)\) points in the positive y direction. Notice that the blue persistence diagram associated to direction \(-e_2\) has an earlier birth time than the red persistence diagram

We now have enough preliminaries to provide the first, classical definition of the persistent homology transform.

Definition 2.10

(PHT: Map Version) Let \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) be a constructible set. The persistent homology transform of M is defined as the continuous map

$$\begin{aligned} {{\,\textrm{PHT}\,}}(M): {\mathbb {S}}^{d-1} \rightarrow {\mathbb {Dgm}}^d \qquad v \mapsto ({{\,\textrm{PH}\,}}_0(M_v),\dots ,{{\,\textrm{PH}\,}}_{d-1}(M_v)) \end{aligned}$$

where \({\mathbb {Dgm}}\) is equipped with some Wasserstein p-distance. See Figs. 2 and 4 for examples.

The Betti Curve Transform (BCT) in degree i of a shape M is determined by the PHT of M in degree i by associating to each vector v and filtration time t, the number of points up and to the left of (tt) in the persistence diagram \({{\,\textrm{PHT}\,}}_i(M_v)\). The Euler Characteristic Transform (ECT) of M is then determined from the BCT of M via the usual formula:

$$\begin{aligned} {{\,\textrm{ECT}\,}}(M)(v,t)=\sum _{i=0}^{d-1}(-1)^i {{\,\textrm{BCT}\,}}_i(M)(v,t) \end{aligned}$$

Given the injectivity of the ECT (Theorem 2.6) the following is an immediate corollary.

Corollary 2.11

(PHT: Injectivity, cf. [20, 31]) If \({{\,\textrm{PHT}\,}}(M)={{\,\textrm{PHT}\,}}(N)\), then \({{\,\textrm{BCT}\,}}(M)={{\,\textrm{BCT}\,}}(N)\) and \({{\,\textrm{ECT}\,}}(M)={{\,\textrm{ECT}\,}}(N)\) and hence, by Theorem 2.6, \(M=N\).

2.5 Cohomology and Sheaf Theory

Alongside homology is an even more powerful topological invariant known as cohomology, which was formally introduced in 1935 along with its ring structure [2]. We will not go through a systematic development of cohomology, but will outline some of the key ideas and notation, as well as its historical context. This is important because cohomology had a strong influence on the development of sheaf theory [34], which was initiated by Leray as a prisoner of war (POW) in Austria from 1940–1945 [57].

For us, the distinction between homology and cohomology is immaterial because we typically consider finite-dimensional homology over a field \(\Bbbk \) and so homology and cohomology are isomorphic. Under this perspective, the difference between homology and cohomology is purely notational: we will now write \({{\,\textrm{PHT}\,}}^i(M)\) for the persistent homology transform in degree i, instead of \({{\,\textrm{PHT}\,}}_i(M)\), to reflect the switch from homology to cohomology, even though this has no effect on the persistence diagrams assigned to each vector v. As a reminder, the concepts introduced in Sect. 2.3 have vector space duals, where one associates to a triangulation of M the group of n-cochains \(C^n(M;\Bbbk )\), which consists of linear functionals on \(C_n(M;\Bbbk )\). The sequence of boundary operators \(\partial _n:C_n\rightarrow C_{n-1}\) then dualize to define (after re-indexing) a sequence of coboundary operators \(\delta ^n:C^n(M;\Bbbk ) \rightarrow C^{n+1}(M;\Bbbk )\), that together define the cochain complex \((C^{\bullet },\delta ^{\bullet })\). The homology of this cochain complex then defines the cohomology groups of M:

$$\begin{aligned} H^n(M;\Bbbk ):= \frac{\ker \delta ^n}{{{\,\textrm{im}\,}}\delta ^{n-1}} \qquad \text {and} \qquad H^n(M)\cong H_n^*(M) \end{aligned}$$

A subtle consequence of this dualization procedure is that functoriality of cohomology is reversed: a map \(f:X\rightarrow Y\) induces a map \(f^*:H^*(Y) \rightarrow H^*(X)\) in the opposite direction.

Leray was aware of these recent developments in cohomology theory and was particularly interested in developing a version of cohomology that did not depend on a triangulation or simplicial approximation. He was also motivated [57, §2] to develop a version of de Rham cohomology—based on differential forms—that could work for arbitrary topological spaces—and not just manifolds. In his POW papers [49,50,51], Leray developed the idea of assigning to each closed subset V of a topological space X a cochain complex \({\mathcal {F}}^{\bullet }(V)\). By considering \(V=\{x\}\) for each point \(x\in X\), one can then consider how the cohomology groups \(H^i({\mathcal {F}}^{\bullet }(x))\) vary across the space X.

It is now understood [21] that traditional persistent homology can be viewed as a special case of sheaf theory, in the sense that the filtration parameter space \({\mathbb {R}}\) indexes the (co)chain complexes of the spaces \(M_{v,t}\). Moreover, as first outlined in [20], sheaf theory also allows us to view the persistent homology transform (PHT) as a collection of (co)chain complexes parameterized by the entire parameter space \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\). In this section we review this latter construction in more detail using the modern convention of sheaves defined on open sets, before moving onto the more general versions on sheaf theory—developed over the 80 years since Leray—that make our current contributions possible.

Definition 2.12

(Pre-Sheaves and Stalks) Let \({\mathbb {X}}\) be a topological space and let \(Open({\mathbb {X}})\) be the poset of open sets in \({\mathbb {X}}\). A pre-sheaf of vector spaces on \({\mathbb {X}}\) is a functor \({\mathcal {F}}:Open({\mathbb {X}})^{op}\rightarrow \textbf{Vect}\). We sometimes write \(\rho _{U,V}:{\mathcal {F}}(U)\rightarrow {\mathcal {F}}(V)\) for the restriction map associated to the inclusion \(V\subseteq U\). The stalk of a pre-sheaf at a point \(x\in {\mathbb {X}}\) is then defined as the direct limitFootnote 5 of \({\mathcal {F}}\) over all open sets containing x, i.e.,

$$\begin{aligned} {\mathcal {F}}_x:= \varinjlim _{U\ni x} {\mathcal {F}}(U) \end{aligned}$$

One can think of the stalk at x as the “local picture” of \({\mathcal {F}}\) at x. This can be constructed rigorously as the vector space of equivalence classes under restriction, i.e., \(u\in F(U)\) and \(v\in F(V)\) are equivalent if \(\exists W\subseteq U\cap V\) with \(x\in W\) and \(\rho _{U,W}(u)=\rho _{V,W}(v)\).

Definition 2.13

(Čech Cohomology of a Cover) Given a pre-sheaf \({\mathcal {F}}\) and an open cover \({\mathcal {U}}=\{U_i\}_{i\in \Lambda }\) of an open set U, one has the Čech cochain complex associated to \({\mathcal {U}}\) where the n-cochains are given by the product over intersections of \(n+1\) cover elements, i.e.,

$$\begin{aligned} {\check{C}}^n({\mathcal {U}};{\mathcal {F}})=\prod _{i_0,\ldots ,i_n \in \Lambda } {\mathcal {F}}(U_{i_0,\dots ,i_n}) \end{aligned}$$

where we always assume \({\mathcal {F}}(\varnothing )=0\). The n th-coboundary operator is defined by specifying the contribution of a general element \(s\in {\check{C}}^n({\mathcal {U}};{\mathcal {F}})\) to the factor \(i_0,\ldots ,i_{n+1}\) in \({\check{C}}^{n+1}({\mathcal {U}};{\mathcal {F}})\). This is given by the formula

$$\begin{aligned} (\delta ^n s)_{i_0,\ldots ,i_{n+1}} = \sum _{j=0}^{n+1} (-1)^j s_{i_0,\dots ,\hat{i_j},\dots ,i_{n+1}} |_{U_{i_0,\ldots ,i_{n+1}}}, \end{aligned}$$

where \(\hat{i_j}\) denotes removal of that entry and the vertical line is the commonly accepted short hand for the application of the restriction map from \(U_{i_0,\dots ,\hat{i_j},\dots ,i_{n+1}}\) to \(U_{i_0,\ldots ,i_{n+1}}\).

Definition 2.14

(Sheaves) A pre-sheaf of vector spaces \({\mathcal {F}}\) is a sheaf if for every open set U and open cover \({\mathcal {U}}=\{U_i\}_{i\in \Lambda }\) we have that the value of \({\mathcal {F}}\) on U can be computed using the Čech cohomology of the cover:

$$\begin{aligned} {\mathcal {F}}(U) \cong H^0\bigg [ {\check{C}}^0({\mathcal {U}};{\mathcal {F}}) \rightarrow {\check{C}}^1({\mathcal {U}};{\mathcal {F}}) \rightarrow {\check{C}}^2({\mathcal {U}};{\mathcal {F}}) \rightarrow \cdots \bigg ] \end{aligned}$$

This is a local-to-global principle, because it guarantees that a sheaf is always determined locally by a cover. More generally, one can define sheaves valued in categories that are not necessarily abelian, such as \(\textbf{Set}\), but where the categorical notion of an (inverse) limit makes sense. As a reminder, the limitFootnote 6 is a categorical operation that takes an entire diagram of objects—in this case the objects \({\mathcal {F}}(U_i)\)—and produces a single object that maps to each of the objects and commutes with the morphisms connecting the objects—in this case the restriction maps \({\mathcal {F}}(U_i) \rightarrow {\mathcal {F}}(U_{ij})\leftarrow {\mathcal {F}}(U_j)\). One then modifies the sheaf axiom to instead require that

It is well-known that the limit only depends on the objects \(\{{\mathcal {F}}(U_i)\}\) associated to the cover elements along with the objects associated to the pairwise-intersections \(\{{\mathcal {F}}(U_{ij})\}\), in similar spirit to how \(H^0\) only depends on the nodes and edges of a triangulated space. Higher order information, such as intersections of three or more elements, is ignored by the usual sheaf axiom.

Definition 2.15

Let \(\textbf{Dat}\) be a complete “data” category, i.e., all limits in \(\textbf{Dat}\) exist. Denote the category of pre-sheaves and sheaves on \({\mathbb {X}}\) valued in \(\textbf{Dat}\) by \(\textbf{PShv}({\mathbb {X}};\textbf{Dat})\) and \(\textbf{Shv}({\mathbb {X}};\textbf{Dat})\), respectively. Since every sheaf is a pre-sheaf there is a natural inclusion of categories

$$\begin{aligned} {{\,\textrm{ps}\,}}: \textbf{Shv}({\mathbb {X}};\textbf{Dat}) \hookrightarrow \textbf{PShv}({\mathbb {X}};\textbf{Dat}). \end{aligned}$$

Under suitable hypothesesFootnote 7 on \(\textbf{Dat}\), the \({{\,\textrm{ps}\,}}\) has an “inverse”.Footnote 8 called sheafification

$$\begin{aligned} {{\,\textrm{sh}\,}}:\textbf{PShv}({\mathbb {X}};\textbf{Dat}) \rightarrow \textbf{Shv}({\mathbb {X}};\textbf{Dat}). \end{aligned}$$

Typically we set \(\textbf{Dat}=\textbf{Vect}\) and let \(\textbf{Shv}({\mathbb {X}})\) denote the category of sheaves of vector spaces.

Example 2.16

(Constant and Locally Constant Sheaves) The pre-sheaf that assigns the vector space \(\Bbbk \) to every open set is not a sheaf because the value that should be associated to an open set \(U=U_1 \cup U_2\) with two components should be \(\Bbbk ^2\). The sheafification of this constant pre-sheaf is called the constant sheaf and is usually written \(\Bbbk \) as well. One can replace \(\Bbbk \) with any vector space \({\mathbb {V}}\) and obtain an analogous constant sheaf. Moreover, if a sheaf \({\mathcal {F}}\in \textbf{Shv}({\mathbb {X}})\) has the property that for each point \(x\in {\mathbb {X}}\) there is a neighborhood \(U_x\) so that \({\mathcal {F}}\) restricts to a constant sheaf on \(U_x\), then one calls \({\mathcal {F}}\) a locally constant sheaf or local system.

Remark 2.17

(Preservation of Stalks) It is a fact that sheafification preserves stalks, so the “local picture” of a pre-sheaf \({\mathcal {F}}\) is unchanged by this process and only the failure of the local-to-global principle is repaired.

Definition 2.18

(Pushforward and Pullback of Sheaves) Suppose \(f:{\mathbb {X}}\rightarrow {\mathbb {Y}}\) is a continuous map of spaces, \({\mathcal {F}}\) is a sheaf on \({\mathbb {X}}\), and \({\mathcal {G}}\) is a sheaf on \({\mathbb {Y}}\). The pushforward (or direct image) of \({\mathcal {F}}\) along f, written \(f_* {\mathcal {F}}\) is the sheaf that assigns to each open set \(V\in Open({\mathbb {Y}})\) the value \({\mathcal {F}}(f^{-1}V)\). Dually, the pullback (or inverse image) of \({\mathcal {G}}\) along f, written \(f^* {\mathcal {G}}\), is the sheaf associated to the pre-sheaf that assigns to every open set \(U\in Open(X)\) the “stalk at f(U)”:

$$\begin{aligned} {{\,\textrm{sh}\,}}\big [U \mapsto \varinjlim _{V\supseteq f(U)} {\mathcal {G}}(V) \big ] \end{aligned}$$

These define functors

$$\begin{aligned} f_*: \textbf{Shv}({\mathbb {X}})\rightarrow \textbf{Shv}({\mathbb {Y}}) \qquad \text {and} \qquad f^*:\textbf{Shv}({\mathbb {Y}})\rightarrow \textbf{Shv}({\mathbb {X}}). \end{aligned}$$

We now isolate a very important class of pushforward sheaves, which we call Leray sheaves.

Definition 2.19

(Leray Sheaves) Suppose \(f:{\mathbb {Y}}\rightarrow {\mathbb {X}}\) is a proper continuous map of spaces, then the i th Leray sheaf of f , written \(R^if_*\Bbbk \), is the sheaf associated to the pre-sheaf

$$\begin{aligned} {{\,\textrm{sh}\,}}\big [U \mapsto H^i(f^{-1}U;\Bbbk )\big ]. \end{aligned}$$

For \(i=0\) this is just the pushforward of the constant sheaf, but for \(i\ge 1\) this definition arises naturally from the “derived” perspective considered in Sect. 2.6.

Remark 2.20

(Cohomology of the Fiber) As Remark 2.17 indicates, the stalk of the Leray pre-sheaf is preserved under sheafification. Consequently, if \(\varinjlim _{U\ni x} H^{i}(f^{-1}U))\cong H^i(f^{-1}(x))\), then this sheaf records the cohomology of the fiber. This last consequence follows from properness of f, which plays a key role in the proper base change theorem [40].

We now have enough language to describe the PHT sheaf-theoretically.

Definition 2.21

(PHT: Sheaf Version, cf. [20]) Let \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) be a constructible set. Associated to M is the auxiliary total space

$$\begin{aligned} Z_M:= \{(x,v,t) \in M\times {\mathbb {S}}^{d-1}\times {\mathbb {R}}\mid x\cdot v \le t\}. \end{aligned}$$

The i th persistent homology transform sheaf of M, written \({{\,\textrm{PHT}\,}}^i(M)\), is the i th Leray sheaf of the map \(f_M:Z_M \rightarrow {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) that projects onto the last two factors. Since M is compact and \(f_M\) is a projection, we see that \(f_M\) is proper. By Remark 2.20, the stalk of the i th Leray sheaf at \((v,t)\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) is isomorphic to the i th cohomology of the fiber i.e., \(H^i({f_M}^{-1}(v,t))\). See Fig. 5 for a stalk-wise picture of \({{\,\textrm{PHT}\,}}^0\) of the shape ‘V’, which was considered from the map perspective in Fig. 4.

Fig. 5
figure 5

Figure (B) is a visualization of the PHT sheaf in degree 0 of \(M=\) ‘V’ on the cylinder \({\mathbb {S}}^1\times {\mathbb {R}}\). The dark pink region represents where there are two connected components and the light pink region represents one connected components. The green arrow represents the direction \(e_2=(0,1)\) and the the red axis corresponds looking to the right \(e_1=(1,0)\). To visualize the sheaf on the plane, as in Figure (C), we map the cylinder \({\mathbb {S}}^1\times {\mathbb {R}}\) to the plane \({\mathbb {R}}^2\) by sending the circle at \(t=-\infty \) to (0, 0) and the circle at \(t=+\infty \) goes to infinity in each direction

Remark 2.22

If we restrict the sheaf \({{\,\textrm{PHT}\,}}^i(M)\) to the subspace \(\{v\}\times {\mathbb {R}}\), then one obtains a constructible sheaf that is equivalent to the persistent (co)homology of the filtration of M viewed in the direction of v. The persistence diagram in degree i is simply the expression of this restricted sheaf in terms of a direct sum of indecomposable sheaves.

Remark 2.23

(Iterated Pushforwards and the Equivariance Property) An advantage of the sheaf-theoretic definition of the PHT is that there are further operations that can be performed on it. For example, one can iterate the Leray sheaf construction for any change of coordinates of \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\). For example, a rigid motion \(g\in \textrm{SO}(d)\), induces an action on the corresponding PHT sheaves \({{\,\textrm{PHT}\,}}^i(M)\) via pushforward along g. In particular, we have the following equivariance formula:

$$\begin{aligned} {{\,\textrm{PHT}\,}}^i(g \cdot M) = g_* {{\,\textrm{PHT}\,}}^i(M) \end{aligned}$$

To prove the above formula, it suffices to show for any test open \(U\subseteq {\mathbb {S}}^{d-1}\times {\mathbb {R}}\),

$$\begin{aligned} f^{-1}_{gM}(U) = f_M^{-1}\left( g^{-1}(U)\right) . \end{aligned}$$

The equality of the sets follows from the definition of the projection map \(f_M\) (Definition 2.21) and the fact that \(gx\cdot v = x\cdot g^{-1}v \) for any \(x\in M\) and \(v\in S^{d-1}\). In other words, filtering a shape rotated by g in direction v is equivalent to filtering the original shape in direction \(g\cdot v\). A similar expression can be shown for translations. In particular, if g represents translation by \(T\in {\mathbb {R}}^{d}\). Then it induces a map \(g:{\mathbb {S}}^{d-1}\times {\mathbb {R}}\rightarrow {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) by \((v,t) \mapsto (v,t+T\cdot v)\).

2.6 Derived Sheaf Theory

There is a third way of describing the persistent homology transform that requires the language of derived categories. In many ways this third perspective follows naturally the history of cohomology and sheaf theory. Cochain complexes of vector spaces generalize naturally to cochain complexes of sheaves, which motivated [80] the development of a unified theory that could handle cohomology and the related algebra of all these different situations. This led to the development of homological algebra, which was systematically laid out by Cartan and Eilenberg [29]. This was quickly followed by Grothendieck’s famous Tohoku paper [37], which introduced the general notion of an abelian category, where the concepts of (co)homology make sense. Grothendieck and his student, Verdier, then laid the groundwork for derived category theory, which permit certain dualities and where quasi-isomorphisms (isomorphisms on cohomology) are genuine isomorphisms. Verdier’s 1967 thesis, published later in two installments [76] and [77], crystallized the algebraic aspects of sheaf theory for nearly 50 years as it became the standard treatment used by textbooks, e.g., [44], to this day. However, our efforts to “glue” PHTs—carried out in Sect. 3—also illustrate the deficiencies of the derived category, cf. [38, p. 1261], and motivate [39] the \(\infty \)-category perspective outlined in our Appendix A.

We now recall one definition of the derived category, as there are many.

Definition 2.24

Let \({\textbf{A}}\) be an abelian category, in particular every morphism has a kernel and cokernel. Consider the category of bounded chain complexes of objects in \({\textbf{A}}\), written \({\mathcal {C}}^b({\textbf{A}})\). Associated to this category is the homotopy category \({\mathcal {K}}^b({\textbf{A}})\) of chain complexes, which has the same objects as \({\mathcal {C}}^b({\textbf{A}})\), but where morphisms are homotopy classes of chain maps. Recall that a chain map \(\varphi :(A^{\bullet },d_A) \rightarrow (B^{\bullet },d_B)\) is a quasi-isomorphism if it induces isomorphisms on all cohomology groups

$$\begin{aligned} H^i(\varphi ):H^i(A^{\bullet }) \rightarrow H^i(B^{\bullet }). \end{aligned}$$

Let \({\mathcal {Q}}\) denote the class of quasi-isomorphisms. The bounded derived category of \({\textbf{A}}\) is the localization of \({\mathcal {K}}^b({\textbf{A}})\) at the collection of morphisms \({\mathcal {Q}}\), i.e.

$$\begin{aligned} {\mathcal {D}}^b({\textbf{A}}):={\mathcal {K}}^b({\textbf{A}})[{\mathcal {Q}}^{-1}]. \end{aligned}$$

Remark 2.25

An alternative definition of the derived category makes use of the assumption that \({\textbf{A}}\) has enough injectives, i.e. every object in \({\textbf{A}}\) has an injective resolution or, said differently, every object in \({\textbf{A}}\) is quasi-isomorphic to a complex of injective objects. Under this assumption, the derived category of \({\textbf{A}}\) is equivalently defined as the homotopy category of injective objects in \({\textbf{A}}\), i.e.

$$\begin{aligned} {\mathcal {D}}^b({\textbf{A}}) \simeq {\mathcal {K}}^b(\text {Inj}-{\textbf{A}}). \end{aligned}$$

Remark 2.25 provides an easier to understand prescription for working with the derived category. One simply takes an object, e.g. a sheaf, replaces it with it’s injective resolution and works with the resolution instead.

Definition 2.26

Suppose \(F:{\textbf{A}}\rightarrow {\textbf{B}}\) is an additive and left-exact functor, i.e. it commutes with direct sums and preserves kernels, then the total right derived functor of F, written \(RF:{\mathcal {D}}^b({\textbf{A}}) \rightarrow {\mathcal {D}}^b({\textbf{B}})\) is defined by

$$\begin{aligned} RF(A^{\bullet }):=F(I^{\bullet }) \end{aligned}$$

for \(I^{\bullet }\) an injective resolution of \(A^{\bullet }\). In general, one can substitute \(I^{\bullet }\) with any F-acyclic resolution of \(A^{\bullet }\). Such resolutions are said to be adapted to F.

We can now define the persistent homology transform as a derived sheaf.

Definition 2.27

(PHT: Derived Version, cf. [20]) Let \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) be a constructible set. Let \(Z_M\) be the auxiliary space construction from Definition 2.21. Let \(f_{M*}:\textbf{Shv}(Z_M) \rightarrow \textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}})\) be the pushforward (or direct image) functor along the projection map \(f_M:Z_M \rightarrow {\mathbb {S}}^{d-1}\times {\mathbb {R}}\). The derived PHT sheaf is

$$\begin{aligned} {{\,\textrm{PHT}\,}}(M):= Rf_{M*}\Bbbk _{Z_M} \in {\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}})). \end{aligned}$$

More explicitly we can describe this right-derived pushforward as follows: For a topological space \({\mathbb {X}}\) we let \({\mathcal {S}}^p(U;\mathbb {k})\) denote the group of singular p-cochains of \(U\subset {\mathbb {X}}\) with coefficients in \( \mathbb {k}\). Define \({\mathscr {S}}^p(X,\mathbb {k})= {{\,\textrm{sh}\,}}(U\mapsto {\mathcal {S}}^p(U;\mathbb {k}))\) where \({{\,\textrm{sh}\,}}\) stands for sheafification. The constant sheaf \(\mathbb {k}_{Z_{M}}\) admits a flabby resolution by singular cochains:

$$\begin{aligned} 0\rightarrow \mathbb {k}_{Z_{M}}\rightarrow {\mathscr {S}}^0(Z_{M};\mathbb {k})\rightarrow {\mathscr {S}}^1(Z_{M};\mathbb {k}) \rightarrow {\mathscr {S}}^2(Z_{M};\mathbb {k})\rightarrow \cdots \end{aligned}$$

Because flabby resolutions form an adapted class for the pushforward functor [11] we can describe \({{\,\textrm{PHT}\,}}(M)\) as the pushforward of the complex of sheaves of singular cochains:

$$\begin{aligned} Rf_{M*}\mathbb {k}_{Z_{M}}:= f_{M*}{\mathscr {S}}^0(Z_{M_i};\mathbb {k})\rightarrow f_{M*}{\mathscr {S}}^1(Z_{M_i};\mathbb {k}) \rightarrow \cdots \end{aligned}$$

Taking i th cohomology of this complex—written \({\mathcal {H}}^i\) in the category of sheaves—produces the i th PHT sheaf of Definition 2.21.

2.7 Constructible Sheaves and their Functions

We finish our review of preliminary material by showing how our first two topological transforms—the Euler characteristic and Betti curve transforms—are recovered by the derived perspective. This is accomplished via the sheaf-to-function correspondence, which is best studied for constructible sheaves.

Definition 2.28

(Constructible and Cellular Sheaves) A sheaf \({\mathcal {F}}\in \textbf{Shv}({\mathbb {X}})\) is said to be constructible if there is a decomposition of \({\mathbb {X}}\) into definable subsets \(\{{\mathbb {X}}_{\alpha }\}\) so that for each \(\alpha \) the pullback of \({\mathcal {F}}\) along the inclusion \(i_{\alpha }:{\mathbb {X}}_{\alpha }\hookrightarrow {\mathbb {X}}\) produces a locally constant sheaf \(i^*_{\alpha } {\mathcal {F}}\in \textbf{Shv}({\mathbb {X}}_{\alpha })\), cf. Example 2.16. When the subsets \(\{{\mathbb {X}}_{\alpha }\}\) are cells in a triangulation of \({\mathbb {X}}\), we can equivalently express \({\mathcal {F}}\) as a cellular sheaf, which simply assigns a vector space to each cell \({\mathbb {X}}_{\alpha }\) and a linear map to each pair \({\mathbb {X}}_{\alpha }\subseteq \overline{{\mathbb {X}}_{\beta }}\); see [68] for the first description of cellular sheaves and [21] for a modern treatment.

In similar spirit, if \({\mathcal {F}}^\bullet \) is a complex of sheaves, e.g., a derived sheaf, then it is said to be cohomologically constructible if the cohomology sheaves \({\mathcal {H}}^i{\mathcal {F}}^\bullet \) are constructible for every i. A derived cellular sheaf then associates to each cell in a cellulation a complex of vector spaces and a chain map for every face-relation pair \({\mathbb {X}}_{\alpha }\subseteq \overline{{\mathbb {X}}_{\beta }}\).

We now show how to associate to a constructible function to a constructible sheaf.

Definition 2.29

(Euler-Poincaré and Hilbert Functions) Let \({\mathcal {F}}^\bullet \) be a complex of cohomologically constructible sheaves on \({\mathbb {X}}\). The local Euler-Poincaré index is the piecewise constant integer-valued function defined by

$$\begin{aligned} h(x):= \chi ({\mathcal {F}}^\bullet )(x) = \sum _i (-1)^{i} \dim {\mathcal {H}}^i({\mathcal {F}}^{\bullet })_x = \sum _i (-1)^{i} \dim (H^i{\mathcal {F}}^{\bullet }_x) \end{aligned}$$

The first equality considers the stalks of the cohomology sheaves of \({\mathcal {F}}^{\bullet }\) and the second equality considers the cohomology of the stalk complex. By Remark 2.17 these are isomorphic and thus have the same dimension and Euler characteristic. In the simplest setting—constructible sheaves that are concentrated in a single cohomological degree—the local Euler-Poincaré index is just the Hilbert function—it records the dimension of the stalks of a sheaf.

For a constructible set M, the derived PHT sheaf \({{\,\textrm{PHT}\,}}(M)= R(f_M)_*\Bbbk _{Z_M}\) is constructible [20] and so by the above correspondence there is a constructible function associated to it.

Definition 2.30

(ECT and BCT: Sheaf-to-Function Version) The ECT of a constructible set M is the local Euler-Poincaré index of the derived PHT sheaf of Definition 2.27:

$$\begin{aligned} \text {ECT}(M)(v,t) = \chi \big (R^{\bullet } f_{M*} \Bbbk _{Z_M}\big )(v,t) \end{aligned}$$

Similarly, the BCT in each degree i is just the Hilbert function of the i th PHT sheaf of Definition 2.21.

3 A Homotopy Sheaf on Shape Space

As mentioned in the introduction, we want to build a shape space using a sheaf-theoretic construction on the poset of constructible sets \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\). Naively one would like to prove that the association

$$\begin{aligned} {\mathcal {F}}:{{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)^{op} \rightarrow {\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}})) \qquad M \mapsto {{\,\textrm{PHT}\,}}(M) \end{aligned}$$

is a sheaf, but there are two main obstacles.

The first obstacle is that a topology on \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) needs to be specified. Although sheaves on posets are well-defined via the Alexandrov topology—see [21] for a modern treatment—the poset under consideration is infinite and using the Alexandrov topology here would imply that a shape can be determined via a cover by its points; this is clearly impossible as there is not enough of an interface between points to determine homology. This first obstacle is neatly handled by restricting the types of covers we’re willing to consider—finite closed covers, to be precise—and is formalized using Grothendieck topologies and sites (Definition 3.3). However, the second obstacle is far more subtle and requires a departure from the usual sheaf axiom of Definition 2.14. To see why, we show that a candidate “local-to-global” principle for the Euler characteristic transform is simply the inclusion–exclusion principle (Theorem 3.1). This in turn motivates the need for a sheaf axiom that considers higher-order intersections, which we call the homotopy sheaf axiom or Čech descent (Definition 3.6). This then implies our main gluing result for the PHT (Theorem 3.9).

3.1 Inclusion–Exclusion for the ECT

As a reminder, Definition 2.4 presented the Euler characteristic transform as the Radon transform \({\mathcal {R}}_S\) associated to a particular relation \(S\subseteq X\times Y\), where \(X={\mathbb {R}}^d\) and \(Y={\mathbb {S}}^{d-1}\times {\mathbb {R}}\). One of the stated properties of the Radon transform is that it defines a group homomorphism

$$\begin{aligned} {\mathcal {R}}_S: {{\,\textrm{CF}\,}}(X) \rightarrow {{\,\textrm{CF}\,}}(Y) \qquad \text {i.e.} \qquad {\mathcal {R}}_S(\phi +\psi )={\mathcal {R}}_S(\phi )+{\mathcal {R}}_S(\psi ). \end{aligned}$$

This allows us to prove an immediate inclusion–exclusion principle for the ECT.

Theorem 3.1

For a finite cover \({\mathcal {M}}=\{M_i\}_{i\in \Lambda }\) of \(M \subset {\mathbb {R}}^d\) by constructible subsets

$$\begin{aligned} {{\,\textrm{ECT}\,}}(M) = \sum _{I\subset \Lambda }(-1)^{|I|+1}{{\,\textrm{ECT}\,}}(M_I) \end{aligned}$$

where each \(M_I\) denotes the intersection \(M_{i_1}\cap M_{i_2} \cap \cdots \cap M_{i_k}\) for \(I=(i_1,\ldots ,i_k)\).

Proof

The inclusion–exclusion principle allows us to write the indicator function as

Linearity of the Radon transform then implies that

$$\begin{aligned} {\mathcal {R}}_{S}\mathbb {1}_M = \sum _{I\subset \Lambda }(-1)^{|I|+1}{\mathcal {R}}_{S}\mathbb {1}_{M_I}, \end{aligned}$$

which is the expression using ECTs written above. \(\square \)

Remark 3.2

If we take the sheaf-to-function correspondence of Sect. 2.7 seriously, then Theorem 3.1 should be viewed as a decategorification of a deeper sheaf-theoretic result:

$$\begin{aligned} {{\,\textrm{PHT}\,}}(M) \cong \text {``summary of'' } \bigg [ \prod {{\,\textrm{PHT}\,}}(M_i) \rightarrow \prod {{\,\textrm{PHT}\,}}(M_{ij}) \rightarrow \prod {{\,\textrm{PHT}\,}}(M_{ijk}) \rightarrow \cdots \bigg ] \end{aligned}$$

However, unlike the sheaf axiom of Definition 2.14, this summary operation cannot only use the \(M_i\) and their pairwise intersections \(M_{ij}\). Indeed the inclusion–exclusion result of Theorem 3.1 says that all higher order terms must be considered. This summary operation is accomplished by the homotopy limits of Definition 3.5 or via limits in the derived \(\infty \)-category (Appendix A).

3.2 Sites and Homotopy Sheaves

Grothendieck topologies provide a way of generalizing sheaves to contravariant functors on a general category \({\mathcal {C}}\), like the poset \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\). Covers of an open set are replaced with collections of morphisms that have certain “cover-like” properties.

Definition 3.3

(Grothendieck Pre-topology, cf. [5]) Let \({\mathcal {C}}\) be a category with pullbacks. A basis for a Grothendieck topology (or a pre-topology) on \({\mathcal {C}}\) requires specifying for each object \(U\in {\mathcal {C}}\) a collections of admissible covers of U. This collection of covers must be closed under the following operations:

  1. (1)

    (Isomorphism) If \(f:U'\rightarrow U\) is an isomorphism then \(\{f:U' \rightarrow U\}\) is a cover.

  2. (2)

    (Composition) If \(\{f_i: U_i\rightarrow U\}\) is a cover of U and if for each i we have a cover \(\{g_{i,j}:U_{i,j} \rightarrow U_{i}\}\) then the composition \(\{f_i\circ g_{i,j}: U_{i,j}\rightarrow U\}\) is also a cover.

  3. (3)

    (Base Change) If \(\{f_i:U_i \rightarrow U\}\) is a cover and \(V\rightarrow U\) is any morphism then the pullback \(\{\pi _i: V\times _U U_i \rightarrow V \} \) is a cover as well

As the name suggests, the above data specifies a genuine Grothendieck topology on \({\mathcal {C}}\). A category equipped with a Grothendieck topology is known as a site.

Remark 3.4

(Sheaves on Sites) The classical definition of a pre-sheaf and sheaf can now be generalized to a site. A functor \({\mathcal {F}}:{\mathcal {C}}^{op}\rightarrow \textbf{Dat}\) is a pre-sheaf. If \(\textbf{Dat}\) has all limits, we say a pre-sheaf is a sheaf if for every object \(U\in {\mathcal {C}}\) and cover \({\mathcal {U}}=\{f_i: U_{i} \rightarrow U\}\)

$$\begin{aligned} {\mathcal {F}}(U) = \varprojlim \bigg [ \prod _{i}{\mathcal {F}}(U_i) \rightrightarrows \prod _{i,j}{\mathcal {F}}(U_{ij})\bigg ]. \end{aligned}$$

Here equality means isomorphic up to a unique isomorphism and \(U_{ij}\) is the pullback of \(f_j: U_j\rightarrow U\) along \(f_i:U_i \rightarrow U\) for any pair of morphisms \(f_i\) and \(f_j\) that participate in the cover \({\mathcal {U}}\).

Unfortunately the functor \({\mathcal {F}}\) specified in Theorem 1.1 is valued in the derived category of sheaves on \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\). It is well-known among experts that the derived category \({\mathcal {D}}^b({\textbf{A}})\) of an abelian category \({\textbf{A}}\) is not abelian. Candidate kernels and co-kernels do not have canonical inclusion and projection maps, but one can work with so-called distinguished triangles instead. More generally, we can describe a sheaf axiom whenever the notion of a homotopy limit makes sense in the target category \(\textbf{Dat}\). We recall a special case of this construction for \(\textbf{Dat}={\mathcal {D}}^b({\textbf{A}})\).

Definition 3.5

(Homotopy Limits) Given an inverse system of objects \((K_n,f_n)\) in \({\mathcal {D}}^b({\textbf{A}})\)

$$\begin{aligned} \cdots \xrightarrow {f_{n-1}} K_{n-1} \xrightarrow {f_n} K_{n} \xrightarrow {f_{n+1}} \cdots \end{aligned}$$

an object K is a homotopy limit if there is a distingushed triangle in the derived category

$$\begin{aligned} K \rightarrow \prod _{n}K_n \xrightarrow {\text {shift}} \prod _n K_n \rightarrow K[1]. \end{aligned}$$

The shift map being given by \((k_n) \mapsto (k_n - f_{n-1}(k_{n-1}))\). We note that the homotopy limit is not necessarily unique and so we say that S is a homotopy limit rather than it is the homotopy limit.

We can now define sheaves valued in the derived category.

Definition 3.6

(Homotopy Sheaf) A pre-sheaf \({\mathcal {F}}:{\mathcal {C}}^{op}\rightarrow {\mathcal {D}}^b({\textbf{A}})\) is a homotopy sheaf (or satisfies Čech descent [25]) if for every object \(U\in {\mathcal {C}}\) and cover \({\mathcal {U}}=\{U_i \rightarrow U\}\) the following map is a quasi-isomorphism:

3.3 Gluing Results for the PHT

We can now prove our main results.

Lemma 3.7

The poset \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) admits the structure of a site.

Proof

For every object \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) we say that \(\{M_i \hookrightarrow M\}\) is a covering if it is a finite closed cover of M in the usual sense, i.e. \(\cup M_i = M\). Pullbacks exist by virtue of the fact that o-minimal sets are closed under intersection. \(\square \)

Lemma 3.8

The following assignment is a pre-sheaf

$$\begin{aligned} {\mathcal {F}}:{{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)^{op} \rightarrow {\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}})) \qquad M \mapsto {{\,\textrm{PHT}\,}}(M) \end{aligned}$$

where \({{\,\textrm{PHT}\,}}(M)\) is the derived sheaf version of the PHT; see Definition 2.27.

Proof

We want to show that \({\mathcal {F}}\) is a contravariant functor. Let be an inclusion of constructible sets of \({\mathbb {R}}^d\). Note that \( M_1 \) is a closed subspace of \( M_2 \). This induces an inclusion of the auxiliary total spaces of Definition 2.21. This in turn determines a morphism of pre-sheaves \(f_{M_2 *}{\mathcal {S}}^j(Z_{M_2};\mathbb {k})\rightarrow f_{M_1 *}{\mathcal {S}}^j(Z_{M_1};\mathbb {k})\) for all j. To see this, take an open \(U\subset {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) and observe that \(f_{M_1}^{-1}(U)\) is open in \( f_{M_2}^{-1}(U)\). More generally, for \(U\subset V\) in \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\) we have a commutative diagram of cochain groups:

figure a

Since sheafification is a functor, we get a morphism \(f_{M_2 *} {\mathscr {S}}^j(Z_{M_2};\mathbb {k})\rightarrow f_{M_1 *}\) \({\mathscr {S}}^j(Z_{M_1};\mathbb {k})\) for all j. These fit together into a morphism between complexes of sheaves:

figure b

The canonical functor from \({\mathcal {C}}^b({\textbf {Shv}}({\mathbb {S}}^{d-1}\times {\mathbb {R}}))\rightarrow {\mathcal {D}}^b({\textbf {Shv}}({\mathbb {S}}^{d-1}\times {\mathbb {R}}))\) then induces the desired restriction morphism between derived PHT sheaves:

$$\begin{aligned} {\mathcal {F}}(M_2):= Rf_{M_2 *}\mathbb {k}_{Z_{M_2}} \rightarrow Rf_{M_1 *}\mathbb {k}_{Z_{M_1}} =:{\mathcal {F}}(M_1) \end{aligned}$$

\(\square \)

The following is the main result of the paper, which was stated as Theorem 1.1 in the introduction. We give a direct proof below, but Remark 3.13 gives a more intuitive and computationally flavored proof using spectral sequences.

Theorem 3.9

The pre-sheaf \({\mathcal {F}}\) of Lemma 3.8 is a homotopy sheaf; see Definition 3.6.

Proof

We have already specified a Grothendieck topology on \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) in Lemma 3.7. Let \({\mathcal {M}}=\{M_i\}_{i\in \Lambda }\) be a finite closed cover of M. Since \({\mathcal {F}}\) is a pre-sheaf we have an inverse system of derived sheaves:

We wish to show that \(Rf_{M *}\mathbb {k}_{Z_M}\) is the homotopy limit of the above inverse system of derived sheaves, i.e. we want to show that

By replacing each \(Rf_{M_I *}\mathbb {k}_{Z_{M_I}}\) with its flabby resolution by singular cochains it suffices to prove that the following is a distinguished triangle:

figure c

To show this we consider the following maps of complexes of sheaves:

$$\begin{aligned} f_{M*}{\mathscr {S}}^{\varvec{\cdot }}(Z_M) \rightarrow \prod _{n}\bigoplus _{|I|=n}f_{M_{I} *} {\mathscr {S}}^{\varvec{\cdot }}(Z_{M_I}) \xrightarrow {\text {shift}} \prod _{n}\bigoplus _{|I|=n}f_{M_{I} *}{\mathscr {S}}^{\varvec{\cdot }}(Z_{M_I}) \end{aligned}$$

Where we drop the coefficient \(\mathbb {k}\) for convenience. For every \((v,t)\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\), these morphisms induce a sequence on stalks, which give rise to a sequence of cochain complexes

$$\begin{aligned} S^{\varvec{\cdot }}(M_{v,t}) \rightarrow \prod _{n}\bigoplus _{|I|=n}S^{\varvec{\cdot }}((M_I)_{v,t})\xrightarrow {\text {shift}}\prod _{n}\bigoplus _{|I|=n}S^{\varvec{\cdot }}((M_I)_{v,t}) \end{aligned}$$
(3.10)

where \((M_I)_{v,t}\) is the intersection of \(M_I\) with the half-space \(\{x\mid x\cdot v \le t\}\). The kernel of the shift map at each stalk is clearly the cochain complex of small co-chains \(S^{{\varvec{\cdot }}}_{{\mathcal {M}}_{v,t}}(M_{v,t})\); these are cochains supported on singular simplices that are individually contained in some cover element \( (M_i)_{v,t} \) of the fiber \(M_{v,t}\). Consequently, we have the following distinguished triangle

figure d

where \({\mathscr {S}}_{\mathcal {M}}^{\varvec{\cdot }} (Z_M)\) is the sheaf of cochains supported in the cover.

We now show we can replace \( f_{M*}{\mathscr {S}}_{{\mathcal {M}}}^{\varvec{\cdot }}(Z_M)\) with \( f_{M*}{\mathscr {S}}^{\varvec{\cdot }}(Z_M)\) above. For any \((v,t) \in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\), we show the inclusion of cochain complexes

$$\begin{aligned} S^{{\varvec{\cdot }}}_{{\mathcal {M}}_{v,t}}(M_{v,t}) \hookrightarrow S^{\varvec{\cdot }}(M_{v,t}) \end{aligned}$$
(3.11)

is a quasi-isomorphism. Since a map of (derived) sheaves is an isomorphism if and only if it induces an isomorphism on stalks [44, Prop. 2.2.2], we can conclude \( f_{M*}{\mathscr {S}}_{{\mathcal {M}}}^{\varvec{\cdot }}(Z_M)\) and \( f_{M*}{\mathscr {S}}^{\varvec{\cdot }}(Z_M)\) are isomorphic.

To prove inclusion (3.11) is a quasi-isomorphism, we appeal to simplicial cohomology. By the Triangulation Theorem (Theorem 2.9 in [75]) we can triangulate \(M_{v,t}\) in a way that is subordinate to the closed cover \(\{(M_I)_{v,t}\}\) for arbitrary (yet finite) intersections \(M_I\). Simplicial cochains for this triangulation form a sub-cochain complex of \(S^{{\varvec{\cdot }}}_{{\mathcal {M}}_{v,t}}(M_{v,t})\), but the triangulation can be used to compute cohomology of \(M_{v,t}\). This completes the proof. \(\square \)

Remark 3.12

(Proof via infinity categories.) There is yet another perspective to the homotopy sheaf axiom. This can be seen by promoting the derived category of sheaves on \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\) to the derived infinity category. In Appendix A we show that our desired sheaf axiom for finite covers is automatically satisfied.

We now show how Theorem 3.9 can be inferred from a simple spectral sequence argument.

Remark 3.13

(Proof via Spectral Sequences) By Theorem 4.4.1 of Godemont [32] there is a resolution of \(\mathbb {k}_{Z_M}\) using the cover of \(Z_M\) by \(\{Z_{M_I}\}\). As such there is a weak equivalence (quasi-isomorphism)

$$\begin{aligned} \mathbb {k}_{Z_M} \rightarrow \big [\oplus _{|I|=1}\mathbb {k}_{Z_{M_I}} \rightarrow \oplus _{|J|=2}\mathbb {k}_{Z_{M_{J}}} \rightarrow \cdots \big ] \end{aligned}$$
(3.14)

Applying the right derived pushforward functor preserves this weak-equivalence. This already proves, in essence, Čech descent for the PHT. More specifically, the homotopy sheaf axiom is witnessed via a first quadrant spectral sequence. To see this, observe that the sequence of chain complexes in (3.10) can be unpacked to be the double complex given by complex of stalks of the pushforward of singular cochain resolution to sequence (3.14).

figure e

In practice, the spectral sequence gives a method of computing the PHT of M at a point (vt). Passing to stalks the first quadrant of the \(E_1\) page reads

figure f

Call this complex \( C^n({\mathcal {M}}_{v,t};H^q(\mathbb {k}_{\mathcal {M}})) \) where \( H^q(\mathbb {k}_{\mathcal {M}}):I\rightarrow H^q(M_{I,v,t}) \) is a system of coefficients, i.e. a cellular sheaf on the nerve of \({\mathcal {M}}\). Taking cohomology of this complex horizontally gives us the \( E_2 \) page of the spectral sequence. Theorem 5.2.4 of [32] guarantees that we converge to the cohomology of \(M_{v,t}\).

We now reconsider Theorem 3.1 from this spectral sequence perspective.

Remark 3.15

(Redux of the Inclusion–Exclusion Principle for the ECT) The inclusion–exclusion principle expression for the indicator function

is exactly the local Euler-Poincaré index of Godemont’s resolution from Eq. 3.14. The Radon transform expression

$$\begin{aligned} {\mathcal {R}}_{S}\mathbb {1}_M = \sum _{I\subset \Lambda }(-1)^{|I|+1}{\mathcal {R}}_{S}\mathbb {1}_{M_I}, \end{aligned}$$

is exactly the local Euler-Poincaré index of the pushforward of the resolution in Eq. 3.14. Checking on stalks reveals that for any \((v,t)\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\)

$$\begin{aligned} \chi \big (f^{-1}_M(v,t)\big ) = \sum _{I\subset \Lambda }(-1)^{|I|+1}\chi \big (f^{-1}_{M_I}(v,t)\big ). \end{aligned}$$

We now illustrate the power of the spectral sequence approach in the following corollary, which was previously stated as Theorem 1.2 in the introduction.

Corollary 3.16

Suppose \( M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) is a polyhedron and suppose \( {\mathcal {M}} = \{M_i\}_{i\in I}\) is a cover of M by PL subspaces, then \({{\,\textrm{PHT}\,}}^n(M) \) is the n-th cohomology of the complex,

$$\begin{aligned} 0\rightarrow \oplus _{|I|=1}{{\,\textrm{PHT}\,}}^0(M_I) \rightarrow \oplus _{|I|=2}{{\,\textrm{PHT}\,}}^0(M_I) \rightarrow \cdots \end{aligned}$$
(3.17)

where the \(\cdots \) represents \({{\,\textrm{PHT}\,}}^0\) of higher intersection terms.

Proof

By examining the \(E_1\) page of the spectral sequence in Remark 3.13 one can see that for a PL cover, the higher homologies, i.e. the higher PHTs, all vanish. Consequently the spectral sequence collapses after the \(E_1\) page. \(\square \)

Remark 3.18

It should be noted that positive scalar curvature of a constructible set M (when defined) obstructs Theorem 3.16 from being directly applied. The cover elements may necessarily have higher homology when viewed in a direction along the normal vector to the point with positive scalar curvature. See Fig. 6 for an example.

Fig. 6
figure 6

For a cover of \(M={\mathbb {S}}^{2}\) using the intersection with each orthant in \({\mathbb {R}}^3\), a cover element \(M_i\) can have non-trivial \({{\,\textrm{PHT}\,}}^1(M_i)\) even though \({{\,\textrm{PHT}\,}}^1(M)\) is trivial

We conclude this section with a detailed example that leverages the spectral sequence argument of Remark 3.13.

Fig. 7
figure 7

\(M=S^1\) with cover elements A and B

Let \( M={\mathbb {S}}^1 \) be the unit circle in \( {\mathbb {R}}^2 \). Define a covering \( {\mathcal {M}} =\{A,B\} \) by two closed half-circles, as indicated in Fig. 7. First, we compute the PHT of each of the cover elements and their intersection. Because our PHT sheaves are on \({\mathbb {S}}^1\times {\mathbb {R}}\) we can project this cylinder onto the plane \({\mathbb {R}}^2\) by following the instructions in the caption of Fig. 8.

Fig. 8
figure 8

To visualise the sheaf we have mapped the cylinder \({\mathbb {S}}^1\times {\mathbb {R}}\) to the plane \({\mathbb {R}}^2\) by squashing down a tapering cylinder onto a plane in the following way: fix direction \(v \in {\mathbb {S}}^1\) and then map \(\{v\}\times {\mathbb {R}}\) onto \((0,\infty )\). So every direction v has a ray attached to it. For example, consider direction \(w=\uparrow = (0,1)\) and \(t=0\) then in figure (A) we see \(H^0(A_{w,t},\Bbbk )= \Bbbk \) (see the red square) since \(A_{w,t}= \{ x\in A | x\cdot w \le t \}\) has one connected component

Now for every point \( (v,t)\in {\mathbb {S}}^1\times {\mathbb {R}}\) we write out the spectral sequence in Remark 3.13. For example, let \( (v,t)= (\uparrow ,0) \), then the \( E_1 \) page of the spectral sequence works out to be:

figure g

This spectral sequence collapses after the \(E_2\) page and converges to \( H^*(M_{v,t};\mathbb {k}) \). And so for this example taking cohomology horizontally gives us that \( H^0(M_{v,t};\mathbb {k})=\mathbb {k}\) and \( H^1(M_{v,t};\mathbb {k})=0 \). Since the PHT is a sheaf we can can do this at all (vt) to find \( PHT^{*}(M) \). Figure 9 shows the PHT of M.

Fig. 9
figure 9

\({{\,\textrm{PHT}\,}}^0(M)\)

3.4 Relative PHT and ECT

We showed how to construct the PHT of a shape by gluing PHTs that from a cover. Intuitively this corresponds to “adding” several PHTs together in a precise way. A natural question to consider is if there is a process for “subtracting” one PHT from another. This is accomplished by using relative cohomology.

Definition 3.19

(Relative PHT) Let \( M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) be a constructible set and suppose \(N\subset M\) is a closed constructible subset of M The relative PHT is defined to be the sheaf over \({\mathbb {S}}^{d-1}\times {\mathbb {R}}\) defined by

$$\begin{aligned} {{\,\textrm{PHT}\,}}^i(M,N) = {{\,\textrm{sh}\,}}\Big [ U \rightarrow H^i\big (f^{-1}_M(U), f^{-1}_N(U); \Bbbk _{Z_M}\big ) \Big ]. \end{aligned}$$

The stalk at \((v,t)\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) is the relative cohomology of the pair \((M_{v,t},N_{v,t})\).

To prove that this definition suitably “subtracts” one PHT from another, consider the long exact sequence of pairs:

$$\begin{aligned} \cdots \rightarrow {{\,\textrm{PHT}\,}}^i(M,N)_{v,t} \rightarrow {{\,\textrm{PHT}\,}}^i(M)_{v,t} \rightarrow {{\,\textrm{PHT}\,}}^i(N)_{v,t} \rightarrow {{\,\textrm{PHT}\,}}^{i+1}(M,N)_{v,t} \rightarrow \cdots \nonumber \\ \end{aligned}$$
(3.20)

Exactness at stalks implies exactness of sheaves and so we have the following long exact sequence of PHT sheaves:

$$\begin{aligned} \cdots \rightarrow {{\,\textrm{PHT}\,}}^i(M,N) \rightarrow {{\,\textrm{PHT}\,}}^i(M) \rightarrow {{\,\textrm{PHT}\,}}^i(N) \rightarrow {{\,\textrm{PHT}\,}}^{i+1}(M,N) \rightarrow \cdots \end{aligned}$$

Similarly, we can also interpret the long exact sequence of pairs given in Eq. 3.20 from the point of view of Euler characteristic.

Definition 3.21

(Relative ECT) The relative ECT of a pair (MN) where N is a constructible subset of M is the function associated to the relative PHT sheaf under the function-to-sheaf correspondence. That is for all \((v,t)\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\),

$$\begin{aligned} {{\,\textrm{ECT}\,}}(M,N)(v,t) = \chi ({{\,\textrm{PHT}\,}}(M,N))(v,t) = \sum _i (-1)^i \dim H^i\big (f_M^{-1}(v,t),f_N^{-1}(v,t)\big ) \end{aligned}$$

Subtraction of ECTs characterizes the relative Euler Characteristic Transform.

Lemma 3.22

For closed and constructible \(N\subset M\)

$$\begin{aligned} {{\,\textrm{ECT}\,}}(M,N) = {{\,\textrm{ECT}\,}}(M)-{{\,\textrm{ECT}\,}}(N). \end{aligned}$$

Proof

Recall the LES of a pair from Eq. 3.20,

$$\begin{aligned} \cdots \rightarrow {{\,\textrm{PHT}\,}}^i(M,N)_{v,t} \rightarrow {{\,\textrm{PHT}\,}}^i(M)_{v,t} \rightarrow {{\,\textrm{PHT}\,}}^i(N)_{v,t} \rightarrow {{\,\textrm{PHT}\,}}^{i+1}(M,N)_{v,t} \rightarrow \cdots \end{aligned}$$

The long exact sequence implies that

$$\begin{aligned} \chi \big ({{\,\textrm{PHT}\,}}(M)\big )(v,t) = \chi \big ({{\,\textrm{PHT}\,}}(M,N)\big )(v,t) + \chi \big ({{\,\textrm{PHT}\,}}(N)\big )(v,t), \end{aligned}$$

which can be rewritten as

$$\begin{aligned} {{\,\textrm{ECT}\,}}(M)(v,t) = {{\,\textrm{ECT}\,}}(M,N)(v,t) + {{\,\textrm{ECT}\,}}(N)(v,t). \end{aligned}$$

\(\square \)

4 Metrics, Stability and Approximation Theory for the PHT

Aside from the intrinsic theoretical interest in a gluing result for the PHT, a practical motivation is to parallelize PHT computations over a cover. This parallelization inevitably becomes more complex if our cover elements have higher homology when viewed in certain directions and at certain filtration values. See Fig. 6 for an example. This motivates our need to replace our shapes with piecewise-linear (PL) approximations. The main result of this section proves that, up to some tolerance, we can always approximate a submanifold \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) via a PL shape K so that the PHT’s of M and K are arbitrarily close. This requires several preparatory steps. Firstly, we introduce several novel distancesFootnote 9 on the PHT and prove that the PHT is stable under small perturbations of the underlying shape. This stability property reaffirms our belief that the PHT is a good summary statistic for shapes. We also carry out some calculations for especially simple shapes (finite point clouds in \({\mathbb {R}}^d\)) and compare these calculations with the Procrustes distance. Secondly, we use the sampling procedure from Niyogi-Smale-Weinberger [62] to approximate a submanifold of \({\mathbb {R}}^{d}\) by a (PL) polyhedron. Finally, we conclude from the stability theorem that the PHT of the polyhedron is close to the PHT of the submanifold.

4.1 Distances on PHTs

In this section, we define distances on PHTs using both the sheaf perspective (Definition 2.27) and the map to persistence diagram space (Definition 2.10) perspective. We start with the sheaf perspective as the interleaving distance we introduce is more involved algebraically, but it is also simplest for proving our main stability result. Bounds on the interleaving distance then imply bounds on certain Wasserstein-type distances, but not others.

4.1.1 Interleaving-Type Distances on the PHT

As first introduced in [15], the interleaving distance provides a powerful generalization of the Hausdorff distance to functors from \(({\mathbb {R}},\le )\) to an arbitrary data category \(\textbf{Dat}\). When \(\textbf{Dat}=\textbf{vect}\), the celebrated isometry theorem of [52] proves that this distance is equivalent to the bottleneck distance (cf. Definition 2.9), which due to its combinatorial structure as a matching problem can be computed in polynomial time. However, the interleaving distance is far more general and permits the construction of distances in more general categorical settings, where no easy distance is to be found. Following a suggestion of Patel, the interleaving distance for sheaves first appeared in [21, §15], then for cosheaves of sets over \({\mathbb {R}}\) (equivalent to Reeb graphs) in [22], and finally for derived sheaves over vector spaces in [45] as the convolution distance.

In parallel to these developments was the thesis work of Stefanou [71], which generalized the interleaving distance to any category equipped with an action of \([0,\infty )\) on it—also called a category with a flow [23]. This action is used to send any object F to its forward evolution \(F^{\epsilon }\). With this in hand, one defines an \(\epsilon \)-interleaving (or \(\epsilon \)-isomorphism [45, Def. 2.2]) between two objects F and G to be any commutative diagram of the form

figure h

although [23, 71] consider more general diagrams then this one. Regardless of the particulars, one defines the interleaving distance \(d_I(F,G)\) to be the infimum over all \(\epsilon \in [0,\infty )\) where such diagrams exist. If there is no such diagram relating two objects, then \(d_I(F,G)=\infty \).

Returning to interleavings of pre-sheaves, the suggestion of Patel was to define the \(\varepsilon \)-thickening/smoothing of a presheaf on a metric space X to be \(F^\varepsilon (U)=F(U^\varepsilon )\), where \(U^\varepsilon \) is the thickening of an open set by \(\epsilon \ge 0\). This has a very similar effect as Kashiwara and Schapira’s [45] convolution with the constant sheaf supported on the closed ball of radius \(\varepsilon \). However, for our applications we leverage the more general perspective of [23] to work with a specialized shift operation in order to define our interleavings, which differs from both [22] and [45].

Definition 4.1

(\(\varepsilon \)-Shift of the Derived PHT) The \(\varepsilon \) -shift of the derived PHT sheaf of a shape \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) is

$$\begin{aligned} {{\,\textrm{PHT}\,}}(M)^{\varepsilon }: =R({f_{M^\varepsilon }})_*\Bbbk _{Z_{M^{\varepsilon }}} \end{aligned}$$

where \(Z_{M^{\varepsilon }}\) is an \(\varepsilon \)-shift of the set \(Z_M\) in the filtration parameter, i.e.,

$$\begin{aligned} Z_{M^{\varepsilon }} = \{ (x,v,t)\in M\times {\mathbb {S}}^{d-1}\times {\mathbb {R}}\mid x\cdot v\le t+\varepsilon \}. \end{aligned}$$

The map \(f_{M^\varepsilon }\) is the usual projection of \(Z_{M^{\varepsilon }}\) onto its last two factors. Notice that if \((x,v,t)\in Z_M\), then it certainly is contained in \(Z_{M^{\varepsilon }}\), which implies that \(Z_M \subseteq Z_{M^{\varepsilon }}\). By functoriality of cohomology, there is a restriction map of constant sheaves \(\Bbbk _{Z_{M^{\varepsilon }}} \rightarrow \Bbbk _{Z_{M}}\) and thus a map of sheaves \({{\,\textrm{PHT}\,}}(M)^{\varepsilon }\rightarrow {{\,\textrm{PHT}\,}}(M)\). Further details that this defines an \(\epsilon \)-shift functor, starting on the image of \({{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)^{op} \rightarrow {\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}}))\), which further satisfies the axioms of [23] is left to the reader. Note that an \(\varepsilon \)-shift of the derived PHT sheaf is still a derived sheaf although it might not correspond to the PHT of any particular shape.

Since our sheaves are defined used cohomology, our interleaving diagram goes in the opposite direction of the one stated above, thus closer in spirit to the interleaving diagrams of [21, §15] and [45].

Definition 4.2

(Interleaving Distance between PHTs) Let \(M, N \in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^{d})\). An \(\varepsilon \)-interleaving of \({{\,\textrm{PHT}\,}}(M)\) and \({{\,\textrm{PHT}\,}}(N)\) is a pair of morphisms \(\varphi : {{\,\textrm{PHT}\,}}(M)^\varepsilon \rightarrow {{\,\textrm{PHT}\,}}(N)\) and \(\psi : {{\,\textrm{PHT}\,}}(N)^\varepsilon \rightarrow {{\,\textrm{PHT}\,}}(M) \) such that the following diagram is commutative:

(4.3)

The arrows \({{\,\textrm{PHT}\,}}(M)^{2\varepsilon } \rightarrow {{\,\textrm{PHT}\,}}(N)^{\varepsilon }\) and \({{\,\textrm{PHT}\,}}(N)^{2\varepsilon }\rightarrow {{\,\textrm{PHT}\,}}(M)^{\varepsilon }\) being given by the image of \(\varphi \) and \(\psi \) under the \(\epsilon \)-shift functor. The interleaving distance between PHT sheaves is then

$$\begin{aligned} d_I({{\,\textrm{PHT}\,}}(M),{{\,\textrm{PHT}\,}}(N)):=\inf \{\varepsilon \ge 0 \mid \exists \, \varepsilon \text {-interleaving}\}. \end{aligned}$$

If no such interleaving exists, then \(d_I({{\,\textrm{PHT}\,}}(M),{{\,\textrm{PHT}\,}}(N))=\infty \).

4.1.2 Wasserstein-Type Distances on the PHT

We can also define a metric on the \({{\,\textrm{PHT}\,}}\)s viewed as map (Definition 2.10). This is a generalisation of the p-PHT distance in [69, Definition 5.4]. Let \({{\,\textrm{PH}\,}}^i(M,v)\) be the persistence diagram in degree i associated to shape M with sub-level set filtration given by the height function in direction \(v\in {\mathbb {S}}^{d-1}\), i.e. \(h_v(x)=x\cdot v\).

Definition 4.4

((pq)-PHT distance) The (pq)-PHT distance between \(M,N\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^{d})\) for \(p,q\ge 1\) in degree i for \(i>0\) and is defined as:

$$\begin{aligned} d^{{{\,\textrm{PHT}\,}}^i}_{p,q}(M,N) = \left( \int _{v\in {\mathbb {S}}^{d-1}} {\mathcal {W}}_p^q\left( {{\,\textrm{PH}\,}}^i(M,v),{{\,\textrm{PH}\,}}^i(N,v)\right) d\mu \right) ^{\frac{1}{q}}\end{aligned}$$

where \(\mu \) is the Lebesgue measure on \({\mathbb {S}}^{d-1}\). When \(q=\infty \),

$$\begin{aligned} d^{{{\,\textrm{PHT}\,}}^i}_{p,\infty }(M,N) = \max _{v\in {\mathbb {S}}^{d-1}} {\mathcal {W}}_p\left( {{\,\textrm{PH}\,}}^i(M,v),{{\,\textrm{PH}\,}}^i(N,v)\right) . \end{aligned}$$

Note that when \(p=\infty \), we have the bottleneck distance between persistence diagrams.

Below, we consider the cases where \(p=2\) or \(p=\infty \), i.e., the Wasserstein 2-distance or the bottleneck distance on diagrams. Additionally, we will restrict ourselves to \(q=2\), which computes the squared average diagram distance over all directions, or \(q=\infty \), which takes the biggest diagram distance over all directions. We refer to \(d^{{{\,\textrm{PHT}\,}}^i}_{\infty ,\infty }\) as the PHT bottleneck distance in degree i. The next lemma explains the relationship between the PHT sheaf interleaving distance and the PHT bottleneck distance.

Lemma 4.5

$$\begin{aligned}d_I({{\,\textrm{PHT}\,}}(M),{{\,\textrm{PHT}\,}}(N)) \ge \max _{i\ge 0} d^{{{\,\textrm{PHT}\,}}^i}_{\infty ,\infty }(M,N). \end{aligned}$$

Proof

Evaluating diagram 4.3 on stalks \((v,t)\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) gives

figure i

This can be interpreted as an \(\varepsilon \)-interleaving of persistence modules in degree i obtained by filtering MN in direction v. The isometry theorem [16, 52] guarantees that the interleaving distance between persistence modules is equal to the the bottleneck distance between their corresponding persistence diagrams. In other words,

$$\begin{aligned} d_I({{\,\textrm{PHT}\,}}(M),{{\,\textrm{PHT}\,}}(N)) =\varepsilon \implies \forall i \ \forall v \in {\mathbb {S}}^{d-1} \quad {\mathcal {W}}_{\infty }^i\left( {{\,\textrm{PH}\,}}(M,v),{{\,\textrm{PH}\,}}(N,v)\right) \le \varepsilon , \end{aligned}$$

where \({\mathcal {W}}_{\infty }^i\) is the bottleneck distance in degree i. \(\square \)

4.2 Comparison with Other Distances on PHTs and Shape Spaces

We now proceeed to compute the above mentioned distances on some simple examples and attempt a comparison with other shape space metrics, primarily the Procrustes distance. A more detailed computation of the PHT of the two embeddings of the letter ‘V’ from Fig. 4 is carried out in Example 4.14 in Sect. 4.3 after our main stability result is proved.

4.2.1 Distances Between Point Clouds

We begin with the simplest possible shapes: a finite collection of points in \({\mathbb {R}}^d\). It should be noted that one quirk of the persistent homology transform is that it is very sensitive to the global homology of a shape. Consequently, if two point clouds have differing numbers of points and no further construction is performed on them, then their PHTs are infinitely far apart. To this end, let \(A=\{a_1,\cdots , a_n\}\) and \(B=\{b_1,\cdots , b_n\}\) be two point clouds in \({\mathbb {R}}^d\).

Proposition 4.6

If \(A= [a_1,\cdots a_n]\) and \(B=[b_1,\cdots , b_n]\) are point clouds regarded as matrices where the vectors that coordinatize each point are stored as columns, then

$$\begin{aligned}{} & {} d_I({{\,\textrm{PHT}\,}}(A),{{\,\textrm{PHT}\,}}(B))= d^{{{\,\textrm{PHT}\,}}^0}_{\infty ,\infty }(A,B) =\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \max _{a_i\in A} \Vert a_i-\phi (a_i) \Vert _{{\mathbb {R}}^d} \end{aligned}$$
(4.7)
$$\begin{aligned}{} & {} \begin{aligned} d^{{{\,\textrm{PHT}\,}}^0}_{2,2}(A,B)&= \left( \int _{\Vert v\Vert =1} \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \sum _{i=1}^n|a_i\cdot v-\phi (a_i)\cdot v |^2 d\mu \right) ^{1/2} \\ {}&\le \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \frac{\sqrt{\text {Area}({\mathbb {S}}^{d-1})}\times \Vert A-\phi (A)\Vert _F}{\sqrt{n}}. \end{aligned} \end{aligned}$$
(4.8)
$$\begin{aligned}{} & {} d^{{{\,\textrm{PHT}\,}}^0}_{2,\infty }(A,B) =\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \Vert A-\phi (A)\Vert _\infty . \end{aligned}$$
(4.9)

where \(\Vert \cdot \Vert _F\) and \(\Vert \cdot \Vert _\infty \) stands for the Frobenius norm and Schatten \(\infty \)-norm of a matrix respectively.

Proof

To prove Eq. 4.7, we prove that the sheaf interleaving distance is equal to the max bottleneck distance over all directions. By Lemma 4.5, we have that an \(\varepsilon \)-interleaving of PHT sheaves implies that the \((\infty ,\infty )\)-PHT distance is less than \(\varepsilon \). Suppose the latter distance is \(\varepsilon \) in degree 0, since the sublevel sets are finite point sets, for any \(v\in {\mathbb {S}}^{d-1}\) and \(t\in {\mathbb {R}}\) the following diagram commutes,

figure j

Since the sets in the above diagram are finite, it extends to a commutative diagram for every open \(U\in {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) and so, by the functoriality of the right derived functor there is an \(\varepsilon \)-interleaving of \({{\,\textrm{PHT}\,}}(A)\) and \({{\,\textrm{PHT}\,}}(B)\). So, \(d_I({{\,\textrm{PHT}\,}}(A),{{\,\textrm{PHT}\,}}(B)) = d^{{{\,\textrm{PHT}\,}}^0}_{\infty ,\infty }(A,B) \). For the case of points sets, the PHT Bottleneck distance turns out to be:

$$\begin{aligned} d^{{{\,\textrm{PHT}\,}}^0}_{\infty ,\infty }(A,B) = \max _{v\in {\mathbb {S}}^{d-1}} \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \max _{a_i\in A} |a_i\cdot v-\phi (a_i)\cdot v|=\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \max _{a_i\in A} \Vert a_i-\phi (a_i) \Vert _{{\mathbb {R}}^d} \end{aligned}$$

To prove Eq. 4.8, we need to calculate,

$$\begin{aligned} d^{{{\,\textrm{PHT}\,}}^0}_{2,2}(A,B) = \left( \int _{v\in {\mathbb {S}}^{d-1}} \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \sum _{i=1}^n|a_i\cdot v-\phi (a_i)\cdot v |^2 d\mu \right) ^{1/2} \end{aligned}$$

where \(\mu \) is the Lebesgue measure on \({\mathbb {S}}^{d-1}\). Let \(X_i=a_i-\phi (a_i)\), and so rewriting the above expression in terms of matrices gives,

$$\begin{aligned} \left( d^{{{\,\textrm{PHT}\,}}^0}_{2,2}(A,B)\right) ^2 \le&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \int _{v\in {\mathbb {S}}^{d-1}} v^T \left( \sum _{i=1}^nX_iX_i^T\right) v\ d\mu \\ =&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \int _{v\in {\mathbb {S}}^{d-1}} v^T Yv\ d\mu \\ =&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \int _{v\in {\mathbb {S}}^{d-1}} \textrm{tr} (v^T Yv) \ d\mu \\=&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \int _{v\in {\mathbb {S}}^{d-1}} \textrm{tr} ( Yvv^T) \ d\mu \\=&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}}\textrm{tr}\left( Y \int _{v\in {\mathbb {S}}^{d-1}} vv^T \ d\mu \right) \end{aligned}$$

where Y is \(\sum _{i=1}^nX_iX_i^T\). The integral \(A:=\int _{v\in {\mathbb {S}}^{d-1}} vv^T \ d\mu \) is invariant under conjugation by orthogonal matrices, since the sphere is rotationally invariant. So, in particular for orthogonal matrix U we have,

$$\begin{aligned} A= \int _{v\in {\mathbb {S}}^{d-1}} vv^T \ d\mu = \int _{v\in {\mathbb {S}}^{d-1}} Uvv^TU^T \ d\mu = UAU^T. \end{aligned}$$

The matrix A commutes with orthogonal matrices and so by Schur’s Lemma, A must be a scalar times the identity matrix.

$$\begin{aligned} A = \int _{v\in {\mathbb {S}}^{d-1}} vv^T = \lambda I \end{aligned}$$

where \(\lambda \) can be found my taking trace on both sides i.e.,

$$\begin{aligned} \int _{v\in {\mathbb {S}}^{d-1}} d\mu = \lambda n. \end{aligned}$$

So, we have,

$$\begin{aligned} \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}}\textrm{tr}\left( Y \int _{v\in {\mathbb {S}}^{d-1}} vv^T \ d\mu \right)&= \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}}\frac{1}{n} \textrm{tr}(Y) \textrm{Area}({\mathbb {S}}^{d-1}) \\&= \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}}\frac{1}{n} \Vert A-\phi (A)\Vert _F^2 \textrm{Area}({\mathbb {S}}^{d-1}) . \end{aligned}$$

Finally, to prove Eq. 4.9, we note that

$$\begin{aligned} \left( d^{{{\,\textrm{PHT}\,}}^0}_{2,\infty }(A,B)\right) ^2 =&\max _{v\in {\mathbb {S}}^{d-1}} \inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \sum _{i=1}^n|a_i\cdot v-\phi (a_i)\cdot v |^2 \\ =&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \max _{v\in {\mathbb {S}}^{d-1}} v^TYv \\ =&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \lambda _{\max }(Y) \\=&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \lambda _{\max }\left( (A-\phi (A)(A-\phi (A))^T\right) \\=&\inf _{\begin{array}{c} \phi :A\rightarrow B \\ \text { matching} \end{array}} \Vert A-\phi (A)\Vert _\infty , \end{aligned}$$

where \(\Vert \cdot \Vert _\infty \) stands for the \(\infty \)-Schatten norm of the matrix. \(\square \)

The appearance of matrix norm expressions for our PHT distances is a welcome development, as it permits a qualitative comparison with a certain class of Procrustes distances.

Remark 4.10

(Comparison with Procrustes Distances) The general Procrustes distance [24] between two ordered point clouds in \({\mathbb {R}}^d\), scaled by their centroid sizes,Footnote 10\(A=[a_1,\cdots ,a_n]\) and \(B=[b_1,\cdots ,b_n]\) is

$$\begin{aligned} d_P(A,B) = \inf _{R\in {\mathcal {R}}} \left( \sum _{i=1}^n \Vert Ra_i-b_i\Vert ^2 \right) ^{1/2} = \inf _{R\in {\mathcal {R}}} \Vert RA-B\Vert _F \end{aligned}$$

where \({\mathcal {R}}\) is the group of rigid motions on \({\mathbb {R}}^d\). One advantage of the PHT distances considered here is that apriori no ordering needs to be put on the points in the point clouds. On the other hand, the PHT distances are sensitive to the embedding and consequently point clouds are not compared via their optimal alignments.

However, there is a closer connection between the ECT/PHT and the orthogonal Procrustes distance, which is given by

$$\begin{aligned} d_{OP}(A,B) = \min _{R \text { s.t. } R^TR=I} \Vert RA-B \Vert _F, \end{aligned}$$

and whose solution \(R=UV^T\) is determined by the singular value decomposition (SVD) of \(B^TA=U\Sigma V^T\). By comparison, [20, Thm. 6.7] states that if two generic simplicial complexes M and N in \({\mathbb {R}}^d\) have identical pushforward measures on the space of Euler curves (or persistence diagrams), i.e., if \({{\,\textrm{ECT}\,}}(M)_*\mu = {{\,\textrm{ECT}\,}}(N)_*\mu \), then M and N are related by an O(d) action. This, along with Remark 2.23, suggests that one could modify the PHT distances here to also consider a minimization procedure along orthogonal transformations or rigid motions.

4.3 The Stability Theorem

In general the PHT distances are hard to compute, so often times we need to use other notions to bound the PHT distance. In this section we prove that if two shapes are homotopic through an \(\varepsilon \)-controlled homotopy, then their derived PHTs (Definition 2.27) are also \(\varepsilon \)-close in the interleaving distance.

Theorem 4.11

[Stability of the PHT under Controlled Homotopies] Let \(M,N \subseteq {\mathbb {R}}^d\) be constructible sets and let \(\varphi : M \rightarrow N\) and \(\psi : N\rightarrow M\) be a homotopy equivalence of M and N; that is, there are homotopies \(H_M:M\times I\rightarrow M\) and \(H_N:N\times I\rightarrow N\) connecting \(Id_M\) to \(\psi \circ \varphi \) and \(Id_N\) to \(\varphi \circ \psi \). If there is some \(\varepsilon >0 \) such that \(\Vert x-\varphi (x)\Vert _{{\mathbb {R}}^d}^2\le \varepsilon \) for all \(x\in M\) and \(\Vert y-\psi (y)\Vert _{{\mathbb {R}}^d}^2 \le \varepsilon \) for all \(y\in N\), where further \(\Vert x-H_M(x,s)\Vert _{{\mathbb {R}}^{d}}^2 \le 2\varepsilon \) for all \(x\in M\) and \(\Vert y-H_N(y,s)\Vert _{{\mathbb {R}}^{d}}^2 \le 2\varepsilon \) for all \(y\in N\) and \(s\in I\), then the PHT of M and N are \(\varepsilon \)-interleaved.

Proof

We show the following diagram is commutative.

figure k

We prove this for the left triangle as the commutativity of the right triangle follows from a similar argument. Let \(U\subset {\mathbb {S}}^{d-1}\times {\mathbb {R}}\) be a test open set and so \(Rf_*\Bbbk _{Z_{M^{\varepsilon }}}(U) = \big [{\mathscr {S}}^\bullet (f_{M^\varepsilon }^{-1}(U);\Bbbk )\big ] \) where \(\big [{\mathscr {S}}^\bullet (f_{M^\varepsilon }^{-1}(U);\Bbbk )\big ]\) represents the class of complexes quasi-isomorphic to the singular cochain complex on \(f_{M^\varepsilon }^{-1}(U)\). We first prove that we have the following non-commutative diagram of topological spaces

figure l

that commutes up to homotopy; that is \(h\circ g\) is homotopic to . If we apply the singular cochain functor to this diagram and then take quotients by quasi-isomorphisms, we will get the desired commutative trianglea in Eq. 4.3.

We now explicitly describe the maps g and h. For \((x,v,t) \in f_M^{-1}(U)\) define g such that \(g(x,v,t) = (\varphi (x),v,t+\varepsilon ) \). It remains to verify that \((\varphi (x),v,t)\) is in \( f_{N^\varepsilon }^{-1}(U)\). Note that

$$\begin{aligned} \varphi (x)\cdot v - x\cdot v = (\varphi (x)-x)\cdot v \le \Vert \varphi (x)-x\Vert ^2 \le \varepsilon . \end{aligned}$$

Since \(x\cdot v \le t \), we have that \(\varphi (x)\cdot v - t \le \varphi (x)\cdot v - x\cdot v \le \varepsilon \) and so \(\varphi (x)\cdot v \le t+\varepsilon \). Similarly for \((y,v,t)\in f_{N^\varepsilon }^{-1}(U)\), let \(h(y,v,t)=(\psi (y),v,t+\varepsilon )\). After composing we get that \(h\circ g (x,v,t) = (\psi \circ \varphi (x),v,t+2\varepsilon )\). To see that \(h\circ g\) is homotopic to the inclusion , define a map \(K:f_M^{-1}(U) \times I \rightarrow f_{M^{2\varepsilon }}^{-1}(U) \) by

$$\begin{aligned} K((x,v,t),s) = (H_M(x,s),v,t+2\varepsilon ). \end{aligned}$$

By Cauchy-Schwarz,

$$\begin{aligned} H_M(x,s)\cdot v - x\cdot v = (H_M(x,s)-x)\cdot v \le \Vert H_M(x,s)-x\Vert ^2\le 2\varepsilon \end{aligned}$$

for all \(s\in I\). Since \(x\cdot v\le t\), we have \(H_M(x,s)\cdot v\le t+2\varepsilon \). This means that \(K((x,v,t),s)=(H_M(x,s),v,t+2\varepsilon ) \in f_{M^{2\varepsilon }}^{-1}(U)\) for \((x,v,t)\in f_M^{-1}(U)\). Further, \(K((x,v,t),0)= (x,v,t+2\varepsilon )\) and \(K((x,v,t),1)= (\psi \circ \varphi (x),v,t+2\varepsilon )= h\circ g(x,v,t)\). Continuity follows from continuity of \(H_M\) and so K is a homotopy between the inclusion map and \(h\circ g\). \(\square \)

Application of Lemma 4.5 implies the following,

Corollary 4.12

(Stability of the PHT Bottleneck distance) Under the assumptions of Theorem 4.11 for all \(i\ge 0\),

$$\begin{aligned} d^{{{\,\textrm{PHT}\,}}^i}_{\infty ,\infty }(M,N) \le \varepsilon \end{aligned}$$

Remark 4.13

One can also bound the \((\infty ,q)\)-PHT distance when \(q\ne \infty \). To see this, the \((\infty ,q)\)-PHT distance is the q-th integral norm of the bottleneck distance, integrated over all directions. Consequently, the \((\infty ,q)\)-PHT distance is bounded by \(\varepsilon \cdot {\text {Area}({\mathbb {S}}^{d-1})}^{\frac{1}{q}}\), thereby establishing stability.

Example 4.14

We now calculate and bound some PHT distances between the shapes A (in blue) and B (in red) in Fig. 10. The normals \(v_1, v_2\) are \((\frac{2}{\sqrt{5}},\frac{1}{\sqrt{5}})\) and \((-\frac{2}{\sqrt{5}},\frac{1}{\sqrt{5}})\). Since all the sublevel sets of the shapes are contractible, it suffices to only consider \({{\,\textrm{PHT}\,}}^0\) of the two shapes. In particular, the PHT bottleneck distance in degree 0 is

$$\begin{aligned} d^{{{\,\textrm{PHT}\,}}^0}_{\infty ,\infty }(A,B)=&\max _{\theta \in {\mathbb {S}}^1} {\mathcal {W}}_\infty \left( {{\,\textrm{PH}\,}}^0(A,\theta ),{{\,\textrm{PH}\,}}^0(B,\theta )\right) \\=&\left| (-4,2)\cdot \left( \dfrac{2}{\sqrt{5}},\dfrac{1}{\sqrt{5}}\right) \right| \\=&\frac{6}{\sqrt{5}}. \end{aligned}$$

The direction at which the maximum occurs is \(v_1\) and \(v_2\).

Fig. 10
figure 10

Distances between the PHTs of A (in blue) and B (in red)

The PHT sheaf interleaving distance is hard to compute in practice. However, the application of Theorem 4.11 gives an upper bound on the PHT sheaf interleaving distance. In this example, we have that A and B are homeomorphic to each other. Explicitly, the linear map sending \((-4,2)\) to \((-2,4)\) can be extended to a homeomorphism \(\varphi : B\rightarrow A \) where \((x,\frac{1}{2}|x|)\mapsto (\frac{1}{2}x,|x|)\). Further, the maximum movement of points under map \(\varphi \) is, \(\Vert (x,\frac{1}{2}|x|) - \varphi (x,\frac{1}{2}|x|)\Vert _{{\mathbb {R}}^2} \le 2\sqrt{2}\). So, by Theorem 4.11 and Lemma 4.5

$$\begin{aligned} 2\sqrt{2}\ge d_I\left( {{\,\textrm{PHT}\,}}(A)),{{\,\textrm{PHT}\,}}(B)\right) \ge \frac{6}{\sqrt{5}}. \end{aligned}$$

4.4 Point Samples for Approximating the PHT

After having established various distances on the PHT, we are now in a position to describe how to approximate a shape with point samples so that the resulting PHTs are close. We note that this is the only section where we require a manifold hypothesis on our shapes M. This is because the problem of approximating a general constructible set (or stratified space) is not well understood. Instead we rely on the following sampling and inference result, which makes implicit use of the injectivity radius of an embedded submanifold. This is encoded via the condition number \(\tau \), but we refer to [62, §2] for a more detailed description of this.

Theorem 4.15

(Theorem 3.1 in [62]) Let M be a compact submanifold of \( {\mathbb {R}}^d \) with condition number \( \tau \). Let \( {\bar{x}}=\{x_1,..,x_n\} \) be a set of n points drawn independently and identically from a uniform probability measure on M. Let \( 0<\varepsilon <\tau /2 \). Let \( U=\cup _{x\in {\bar{x}}}B_\varepsilon (x) \) be the union of the open balls of radius \( \varepsilon \) around the sample points. Then for all

$$\begin{aligned} n>\beta _1\bigg (\log \beta _2 + \log \frac{1}{\delta } \bigg ) \end{aligned}$$

the homology of U equals the homology of M with probability \(>1-\delta \). Here \(\beta _1\) and \(\beta _2\) are constants that depend on the condition number \(\tau \), \(\varepsilon \) and the volume of M. The bound on n ensures that with high probability the sample is \( \frac{\varepsilon }{2} \)-dense in M.

We let \({\mathcal {U}}:=\{B_{\varepsilon }(x)\}\) be the balls produced by Theorem 4.15. As the set of sampled points \(X=\{x\}\) is embedded in \({\mathbb {R}}^d\), we can consider the Voronoi cell decomposition \({\mathcal {V}}=\{V_x\}\) of \({\mathbb {R}}^d\) generated by X—this is the decomposition of \({\mathbb {R}}^d\) into convex regions where every point \(y\in \textrm{int} V_x\) is closest to x and no other point \(x'\in X\). The alpha complex [27] is defined to be the (geometric) nerve of the cover \(\{B_{\varepsilon }(x)\cap V_x\}\) of U; see Fig. 11. By the nerve lemma, the alpha complex is homotopy equivalent to union of the balls U and so with high probability Theorem 4.15 says that the homology of K is equal to homology of M. We now promote this to an observation about the PHT.

Corollary 4.16

(Approximation) Let M be a compact submanifold of \( {\mathbb {R}}^d \) with condition number \( \tau \). Let \( {\bar{x}}=\{x_1,..,x_n\} \) be a set of n points drawn independently and identically from a uniform probability measure on M. Let \( 0<\varepsilon <\frac{\tau }{2} \). Let \( U=\cup _{x\in {\bar{x}}}B_\varepsilon (x) \) be the union of the open balls of radius \( \varepsilon \) around the sample points. Let K be the alpha complex of U. Then for all

$$\begin{aligned} n>\beta _1\bigg (\log \beta _2 + \log \frac{1}{\delta } \bigg ) \end{aligned}$$

we have that, \( d_I({{\,\textrm{PHT}\,}}(M),{{\,\textrm{PHT}\,}}(K)) \le \varepsilon ^2\) with high confidence i.e. probability > 1- \(\delta \).

Proof

We show that the assumptions of Theorem 4.11 are satisfied with \( 0<\varepsilon < \tau /2\) and then apply Theorem 4.11 to conclude the result. We need to find a homotopy equivalence \(\varphi :K\rightarrow M\) and \(\psi :M\rightarrow K\) that satisfies the assumptions of Theorem 4.11. We do this by passing through the union of balls U as an intermediary.

Homotopy equivalence of M and U: Since the sample is \(\varepsilon /2\)-dense in M with high probability, there is an inclusion of M into U with high probability. Let \(\iota \) be this inclusion and let f be the projection that sends \( x\mapsto \arg \min _{p\in M} \Vert p-x\Vert \). By the definition of condition number, the distance between any \(q\in M\) to the medial axis is greater than \(\tau > 2\varepsilon \). The well-definedness of f is equivalent to \(x\in U\) not contained in the medial axis. Suppose \(x\in U\) is in the medial axis, so \(\Vert p-x\Vert > 2\varepsilon \) for every \(p\in M\). Since \({\bar{x}}\) is \(\varepsilon /2\)-dense in M w.h.p and \(U=\cup _{y\in {\bar{x}}}B_\varepsilon (y)\), it must be that for any \(p\in M\), \(\Vert p-x\Vert \le \Vert p-y\Vert + \Vert y-x\Vert< \frac{\varepsilon }{2} + \varepsilon < \frac{3}{2}\varepsilon \). This is a contradiction to x in the medial axis. This proves that f is well-defined. The map f is a deformation retraction and can be seen by taking the homotopy \( H_U(x,t) = tx+ (1-t)f(x)\) for all \( x\in U \) and \( t\in [0,1] \). Further, \(\Vert H_U(t,x)- x\Vert = \Vert tx+(1-t)f(x) -x \Vert = (1-t)\Vert x-f(x) \Vert < (1-t)\varepsilon /2 \le \varepsilon \).

Homotopy equivalence of U and K: We have the inclusion map \(j: K\rightarrow U\). There is a retract \(g: U \rightarrow K \) which follows the lines in U connected to the nearest point in K; see Fig. 11. We call the homotopy that follows these lines \(G_U\). Since U is a union of balls of radius \(\varepsilon \), the homotopy \(G_U\) does not move the points of U more than \(\varepsilon \).

Fig. 11
figure 11

A collection of disks in the plane has a simpler summary given by its alpha complex, which is the geometric simplicial complex shown with shaded simplices above. The radial lines in each disk shows how points in the union of the disks deformation retract onto its alpha complex. Figure inspired by Fig. 3.1 of [27]

Let \(\varphi := f\circ j\) and \(\psi := g\circ \iota \). On composing, \(\varphi \circ \psi = f\circ j \circ g \circ \iota \sim f \circ \text {Id}_U \circ \iota = f \circ \iota \sim \text {Id}_M \) and similarly \(\psi \circ \varphi \sim \text {Id}_K.\) The radius of balls are less than \(\varepsilon \) and so for \(x\in K\), \(\Vert x-f\circ j(x)\Vert \le \varepsilon \) and so \(\Vert x - \varphi (x) \Vert ^2 < \varepsilon ^2\). Since the sample points are \(\varepsilon /2\)-dense, for \(y\in M\), \(\Vert y-g\circ \iota (y)\Vert \le \varepsilon /2 < \varepsilon \) and so \(\Vert y-\psi (y)\Vert ^2\le \varepsilon ^2. \) Since the homotopy maps \(H_U\) and \(G_U\) satisfy the conditions \(\Vert H_U(x,t)-x\Vert \le \varepsilon \) and \(\Vert G_U(x,t)-x\Vert \le \varepsilon \) for all \(x\in U\), the homotopy map \(K_1\) connecting \(\varphi \circ \psi \) and \(\text {Id}_M\) satisfy \(\Vert K(x,t)-x\Vert \le \varepsilon \) for all \(x\in M\). The case for \(K_2\) connecting \(\psi \circ \varphi \) and \(\text {Id}_K\) is similar. Applying Theorem 4.11 gives \(\varepsilon ^2\)-interleaving of the PHTs of M and K. \(\square \)

5 Discussion and Future Work

In this paper we have outlined an algebraic construction of shape space that uses cohomology, sheaves, and “higher” derived variations on these. We do this while also maintaining close contact with the simpler, tomographic integral transform that is based on Euler characteristic [66]. Our shape space works with shapes more general than manifolds, such as semialgebraic sets, and the ability to triangulate our shapes is more a feature of convenience than an absolute necessity. By leveraging connections to persistent homology, we are able to also metrize our algebraic shape space in various ways and prove stability and approximation results for these.

We note that the use of sheaves to provide a rich mathematical theory for summarizing shapes is in many ways a natural evolution of previous attempts to construct shape space. Approaches that use landmarks or diffeomorphisms each naturally lead to shape spaces modeled via fiber bundles. Since sheaves provide a formalism for generalizing fiber bundles, where the rank can drop from point to point, we hope that our framework leads to a generalization of the landmark and diffeomorphism-based approaches as well. However, there are important differences between these approaches—namely the use of similarity transformations and group actions—that need to be incorporated more fully into our framework as well. We conclude with three directions for future research:

  1. (1)

    Can we characterize the image of our shape space sheaf?

    $$\begin{aligned} {\mathcal {F}}: {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)^{op} \hookrightarrow {\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}})) \end{aligned}$$

    In more detail, if someone gives us a derived sheaf \({\mathcal {G}}\in {\mathcal {D}}^b(\textbf{Shv}({\mathbb {S}}^{d-1}\times {\mathbb {R}}))\) can we certify if there is a shape \(M\in {{\mathcal {C}}}{{\mathcal {S}}}({\mathbb {R}}^d)\) such that \({{\,\textrm{PHT}\,}}(M)\cong {\mathcal {G}}\)? Even more fundamentally, if an oracle claims that a collection of barcodes is the result of sampling \({{\,\textrm{PHT}\,}}(M)\) at directions \(v_1,\ldots ,v_n\), is there any way of knowing if the oracle is telling the truth? If they are, can we provide an approximate reconstruction of the shape M just from this information? All of these problems are open and the last question bears some resemblance to Minkowski’s theorem [48] for reconstructing polyhedra from normal and facet data.

  2. (2)

    Can we leverage the topological simplification procedures of persistent homology [28] to perform automated simplification of shape space? As pointed out in [59, §3.5], there must be obstructions for dimensions 3 and higher because of the existence of the Poincaré homology sphere. Nevertheless, understanding obstructions to these simplifications would shed algorithmic light on some of the deepest questions in algebraic topology, such as the Poincaré conjecture, which was established by Perelman using PDE methods.

  3. (3)

    Finally, can we embed traditional models of shape space into our current model? Does an optimal transport problem between shapes establish a corresponding optimal transport problem on sheaves? By the continuity property of the PHT, this must certainly be true at the set-theoretic level, but can we promote this correspondence to something with more algebraic structure? Preliminary work in this direction indicates that isotopies of shapes should lift to zigzags of sheaf morphisms, where sheaf cohomology can be used as an obstruction to comparing two shapes.