A SHEAF-THEORETIC CONSTRUCTION OF SHAPE SPACE

. We present a sheaf-theoretic construction of shape space—the space of all shapes. We do this by describing a homotopy sheaf on the poset category of constructible sets, where each set is mapped to its Persistent Homology Transforms (PHT). Recent results that build on fundamental work of Schapira have shown that this transform is injective, thus making the PHT a good summary object for each shape. Our homotopy sheaf result allows us to “glue” PHTs of diﬀerent shapes together to build up the PHT of a larger shape. In the case where our shape is a polyhedron we prove a generalized nerve lemma for the PHT. Finally, by re-examining the sampling result of Smale-Niyogi-Weinberger, we show that we can reliably approximate the PHT of a manifold by a polyhedron up to arbitrary precision.


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 points. Often one wants to decorate shape space with extra structure, such as a set of landmarks (as in the Kendall approach [31,32]) or with a choice of parameterization (as in the Grenander approach [17]), but this extra structure is regarded as lying orthogonal to the base manifold of shapes; see Figure 1. Fiber bundles provide a language for formalizing this orthogonality [29] and can be used to unify Kendall's and Grenander's constructions, as reviewed below, but they are limiting as well.
Implicit in both the Kendall and Grenander approach to shape space is the assumption that each pair of shapes can be related to one another via one-to-one correspondences; for Kendall these are correspondences of landmarks, and for Grenander these are smooth diffeomorphisms. These assumptions severely limit 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 [34]; or, in a dataset of brain arteries, many of the arteries cannot be continuously mapped to each other [4]. Indeed, in large databases such as MorphoSource and Phenome10K [9,19], the CT scans of skulls across many clades are not diffeomorphic. Consequently, there is a real need for a shape space that does not require correspondences and diffeomorphisms.
In this paper we introduce a truly general construction of shape space. Topologically different subsets of 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) Instead of a "base manifold" of shapes we work with a "base poset" of constructible sets CS(R d ) ordered by inclusion. This poset is equipped with a notion of continuity via a Grothendieck topology.  Figure 1. Previous constructions of shape space by Kendall and Grenander implicitly introduce a fiber bundle perspective on shape space. The fibers encode all possible landmarks or parameterizations of a shape and the base space records the shape as an equivalence relation. The PHT-based shape space introduced here uses a slightly more complex construction where the base space is replaced by a base poset and the fibers are unique sheaf-theoretic representations of the shape.
(2) Each shape-that is, each point M ∈ CS(R d )-is equivalently regarded via its persistent homology transform PHT(M ), which is an object in the derived category of sheaves D b (Shv(S d−1 × R)). With these observations in place, our main result can be summarized as follows.
Theorem 1.1. The following assignment is a homotopy sheaf: Intuitively, this result allows us to interpolate between shapes in a continuous way via their persistent homology transforms; continuity is mediated via the Grothendieck topology on CS(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 1.2 (Nerve Lemma for the PHT). If M ∈ CS(R d ) is a polyhedron, i.e. it can be written as a finite union of closed linear simplices M = {σ i } i∈Λ , then the persistent homology transform in degree n, written PHT n (M ), is isomorphic to the n-th cohomology of the following complex of sheaves: Here M I with |I| = k denotes the disjoint union of depth k intersections of closed simplices appearing in the cover M.
In Theorem 3.19 we interpret the homotopy sheaf axiom for the PHT in terms of a generalized inclusion-exclusion principle for the Euler Characteristic Transform (ECT), which is the decategorification of the PHT.
It should be noted that positive scalar curvature of a constructible set M (when defined) obstructs Theorem 1.2 from being directly applied, as cover elements may necessarily have higher homology when viewed in a direction normal to that point. See Figure 2 for an example.
As such it is desirable to have an approximation result that is provably stable under the persistent homology transform and allows us to work degree-0 homology along. We do this by proving a general stability theorem for the PHT across shapes i.e. small perturbations of shapes result in at most small changes in the corresponding persistent homology transforms. The result reads:  1.1. Prior Work on Shape Space. We briefly outline the main approaches to shape space to better situate the contributions of this paper. Some of these approaches are quite old and date back to Riemann [28] and the interested reader is encouraged to consult the survey articles [3] and [22] for more information. However, at a high-level, there are three main approaches to shape space that have been worked out in some detail: the landmark approach; the diffeomorphism and optimal control approach; and the persistent homology transform and Euler characteristic transform approach endorsed here.
The first commonly accepted shape space was pioneered in the works of Kendall [31,32] and Bookstein [6] where a shape is defined by a set of k landmark points in R d , where typically d = 2, 3. Each shape is defined by k points and the i-th point in one shape corresponds to the i-th point in every other shape in the space; this introduces the central notion of correspondences in shape space. The shape space defined by these landmark points is called Kendall's shape space and is denoted Sim is the group of rotations and dilations. Note that in Σ k d a shape is reduced to a d × 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 [19,9] to landmarks can result in a great deal of information loss.
The second commonly accepted shape space was pioneered by Grenander [17], although some aspects were anticipated by [10]. In these works, a shape space is specified for each manifold M and dimension d. Variation in shape is then modeled by the action of the Lie group of diffeomorphisms on R d . The advantage of Grenander's approach is that it bypasses the need for landmarks, but the resulting spaces of interest are infinite-dimensional and shapes with different topology cannot be compared. However, many tools have been developed that efficiently compare the similarity between shapes in large databases via algorithms that continuously deform one shape into another [7,36,8,18].
Finally, building on fundamental work of Schapira [38,39], two topological transforms-the Euler characteristic transform (ECT) and the persistent homology transform (PHT)-were introduced in [41] to allow for comparison of non-diffeomorphic shapes. The ECT and PHT have two useful properties: standard statistical methods can be applied to the transformed shape and the transforms are injective [25,13], 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 [11,43,40,2]. The shape space we construct in this paper is a dramatic generalization of the sheaf-theoretic formulation of the PHT found in [13].

Background on Constructibility, Persistent Homology and Sheaves
In this section we briefly recall background material from [13].

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 [42]. 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. This property also implies that certain algebraic topological signatures, such as homology, are well-defined for any constructible set.

Persistent Homology.
A useful algebraic summary of a constructible set M ∈ CS(R d ) is homology in degree n with coefficients in a field k, written H n (M ; k). Typically, we assume that k is of characteristic 0 so that homology and cohomology are isomorphic, i.e. H n (M ; k) ∼ = H n (M ; k). For constructible sets all usual theories of (co)homology-singular, simplicial and sheaf-agree. The dimension of the n th homology group of M is also called the n th Betti number β n (M ), which can be used to easily distinguish shapes such as a torus T and a sphere S 2 , e.g. β 1 (T) = 2 and β 1 (S 2 ) = 0.
Persistent homology is a powerful refinement of homology as it encodes how homology of M changes under an R-indexed filtration, i.e. a collection of subsets {M t } t∈R . This encoding is more subtle than simply a graph of the Betti numbers as the filtration parameter changes. Specifically, the persistent homology barcode (or diagram) in degree n, written PH n (M ), is a multi-set of intervals in R that represents lifetimes of homology classes in degree n. The space of all barcodes is written Dgm and can be equipped with a Wasserstein p-norm for any p ∈ [1, ∞]. Typically p = ∞, and the distance between barcodes is called the bottleneck distance. The persistent homology transform studies the persistent homology of a constructible subset M ∈ CS(R d ) by considering the filtration Although homology is usually a lossy summary of a shape, knowing persistent homology of a shape in every direction completely determines the shape. 2.3. Sheaf Theory. Persistent homology can be viewed as a parameterized homology theory, where the base space for the parameter is R. In similar spirit, the persistent homology transform can be viewed as a parameterized homology theory where the base space is S d−1 × R. Understanding how (co)homology of a space varies with reference to a map to a base space was Leray's motivation behind the development of sheaf theory, but it quickly became adapted for more general purposes over the intervening 80 years.
where U ij = U i ∩ U j and so on. In other words, for a sheaf, the value of F on a large open set U can be computed in terms ofČech cohomology of the nerve of a cover U with coefficients in F. More generally, one can define sheaves valued in categories that are not necessarily abelian, such as Set, but where the categorical notion of limit 1 makes sense. One then modifies the sheaf axiom to instead require that Definition 2.5. Let Dat be a complete "data" category, i.e. all limits in Dat exist. Denote the category of pre-sheaves and sheaves on X valued in Dat by PShv(X; Dat) and Shv(X; Dat), respectively. Since every sheaf is a pre-sheaf there is a natural inclusion of categories ps : Shv(X; Dat) → PShv(X; Dat).
Typically we set Dat = Vect and let Shv(X) denote the category of sheaves of vector spaces.
Definition 2.6 (Leray Sheaves). Suppose f : Y → X is a proper continuous map of spaces, then the i th Leray sheaf of f , written R i f * k is the sheaf associated to the pre-sheaf We now have enough language to describe the PHT sheaf-theoretically.
Definition 2.7 (PHT: Sheaf Version, cf. [13]). Let M ∈ CS(R d ) be a constructible set. Associated to M is the auxiliary total space Since M is compact and f M is a projection, we see that f M is proper. By the proper base change theorem [27]

Derived Sheaf Theory.
There is a third way of describing the persistent homology transform that requires the language of derived categories. We briefly recall a definition of the derived category of an abelian category.
Definition 2.8. Let A be an abelian category, in particular every morphism has a kernel and cokernel. Consider the category of bounded chain complexes of objects in A, written C b (A). Associated to this category is the homotopy category K b (A) of chain complexes, which has the same objects as C b (A), but where morphisms are homotopy classes of chain maps. Recall that a chain map ϕ : induces isomorphisms on all cohomology groups Let Q denote the class of quasi-isomorphisms. The bounded derived category of A is the localization of K b (A) at the collection of morphisms Q, i.e.
Remark 2.9. An alternative definition of the derived category makes use of the assumption that A has enough injectives, i.e. every object in A has an injective resolution or, said differently, every object in A is quasi-isomorphic to a complex of injective objects. Under this assumption, the derived category of A is equivalently defined as the homotopy category of injective objects in A, i.e.
Remark 2.9 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.10. Suppose F : A → 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 : for I • an injective resolution of A • . In general, one can substitute I • with any F -acyclic resolution of A • . Such resolutions are said to be adapted to F .
We can now define the persistent homology transform as a derived sheaf.
More explicitly we can describe this right-derived pushforward as follows: For a topological space X we let S p (U ; k) denote the group of singular p-cochains of U ⊂ X with coefficients in k. Define S p (X, k) = sh(U → S p (U ; k)) where sh stands for sheafification. The constant sheaf k Z M admits a flabby resolution by singular cochains: Because flabby resolutions form an adapted class for the pushforward functor [5] we can describe PHT(M ) as the pushforward of the complex of sheaves of singular cochains:

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 CS(R d ). Naively one would like to prove that the association is a sheaf, but there are two main obstacles. The first obstacle is that a topology on CS(R d ) needs to be specified. Although sheaves on posets are well-defined via the Alexandrov topology-see [14] 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. The second obstacle is fatal for a naive sheaf-theoretic approach: the pre-sheaf U → H i (U ) is not a sheaf for i ≥ 1. Indeed, the connecting homomorphism in the Mayer-Vietoris long-exact sequence quantifies precisely the failure of the sheaf axiom. Both of these obstacles are addressed via tools from "higher" sheaf theory: Grothendieck topologies and homotopy sheaves. We recall this machinery now.
3.1. Sites and Homotopy Sheaves. Grothendieck topologies provide a way of generalizing sheaves to contravariant functors on a general category C. Covers of an open set are replaced with collections of morphisms that have certain "cover-like" properties. Definition 3.1 (Grothendieck Pre-topology, cf. [1]). Let C be a category with pullbacks. A basis for a Grothendieck topology (or a pre-topology) on C requires specifying for each object U ∈ C a collections of admissible covers of U . This collection of covers must be closed under the following operations: As the name suggests, the above data specifies a genuine Grothendieck topology on C. A category equipped with a Grothendieck topology is known as a site.
Remark 3.2 (Sheaves on Sites). The classical definition of a pre-sheaf and sheaf can now be generalized to a site. A functor F : C op → Dat is a pre-sheaf. If Dat has all limits, we say a pre-sheaf is a sheaf if for every object U ∈ C and cover U = {f i : Here equality means isomorphic up to a unique isomorphism and U ij is the pullback of f j : U j → U along f i : U i → U for any pair of morphisms f i and f j that participate in the cover U.
Unfortunately the functor F specified in Theorem 1.1 is valued in the derived category of sheaves on S d−1 × R. It is well-known among experts that the derived category D b (A) of an abelian category 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 Dat. We recall a special case of this construction for Dat = D b (A).

Definition 3.3 (Homotopy Limits). Given an inverse system of objects
an object K is a homotopy limit if there is a distingushed triangle in the derived category The shift map being given by (k n ) → (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.4 (Homotopy Sheaf). A pre-sheaf F : C op → D b (A) is a homotopy sheaf (or satisfiesČech descent [16]) if for every object U ∈ C and cover U = {U i → U } the following map is a quasi-isomorphism: Gluing Results for the PHT. We can now prove our main results. Lemma 3.6. The following assignment is a pre-sheaf where PHT(M ) is the derived sheaf version of the PHT; see Definition 2.11.
Proof. We want to show that F is a contravariant functor. Let ι : M 1 − → M 2 be an inclusion of constructible sets of R d . Note that M 1 is a closed subspace of M 2 . This induces an inclusion of the auxiliary total spaces ι : Since sheafification is a functor, we get a morphism f M 2 * S j (Z M 2 ; k) → f M 1 * S j (Z M 1 ; k) for all j. These fit together into a morphism between complexes of sheaves: The canonical functor from C b (Shv(S d−1 ×R)) → D b (Shv(S d−1 ×R)) then induces the desired restriction morphism between derived PHT sheaves: 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.9 gives a more intuitive and computationally flavored proof using spectral sequences. Proof. We have already specified a Grothendieck topology on CS(R d ) in Lemma 3.5. Let M = {M i } i∈Λ be a finite closed cover of M . Since F is a pre-sheaf we have an inverse system of derived sheaves: We wish to show that Rf M * 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 * k Z M I with its flabby resolution by singular cochains it suffices to prove that the following is a distinguished triangle: To show this we consider the following maps of complexes of sheaves: Where we drop the coefficient k for convenience. For every (v, t) ∈ S d−1 ×R, these morphisms induce a sequence on stalks, which give rise to a sequence of cochain complexes where (M I ) v,t is the intersection of M I with the half-space {x | x · v ≤ t}. The kernel of the shift map at each stalk is clearly the cochain complex of small co-chains S · Mv,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, on the level of stalks we have distinguished triangles We now show that we can replace S · Mv,t (M v,t ) with S · (M v,t ) above because the inclusion S · Mv,t (M v,t ) → S · (M v,t ) is a quasi-isomorphism, and hence an isomorphism in the derived category.
To prove this, we appeal to simplicial cohomology. By the Triangulation Theorem (Theorem 2.9 in [42]) 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 · Mv,t (M v,t ), but the triangulation can be used to compute cohomology of M v,t . This completes the proof. [24] there is a resolution of k Z M using the cover of Z M by {Z M I }. As such there is a weak equivalence (quasi-isomorphism)

Remark 3.9 (Proof via Spectral Sequences). By Theorem 4.4.1 of Godemont
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.
In practice, the spectral sequence gives a method of computing the PHT of M at a point (v, t). Passing to stalks the first quadrant of the E 1 page reads 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.
where the · · · represents PHT 0 of higher intersection terms.
Proof. By examining the E 1 page of the spectral sequence in Remark 3.9 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.

Example Calculation.
So far we have showed that we can construct a homotopy sheaf on shape space where each shape is assigned its persistent homology transform. In this section, we leverage the spectral sequence argument of Remark 3.9 to illustrate an explicit calculation of the gluing process. Let M = S 1 be the circle in R 2 . Define a covering M = {A, B} by two closed half-circles, as indicated in Figure 3. First, we compute the PHT of each of the cover elements and their intersection. Because our PHT sheaves are on S 1 × R we can project this cylinder onto the plane R 2 by following the instructions in the caption of Figure 4. Now for every point (v, t) ∈ S 1 × R we write out the spectral sequence in Remark 3.9. For example, let (v, t) = (↑, 0), then the E 1 page of the spectral sequence works out to be:   This spectral sequence collapses after the E 2 page and converges to H * (M v,t ; k). And so for this example taking cohomology horizontally gives us that H 0 (M v,t ; k) = k and H 1 (M v,t ; k) = 0. Since the PHT is a sheaf we can can do this at all (v, t) to find P HT * (M ). Figure 5 shows the PHT of M .

Relative PHT.
In the previous section 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.
To prove that this definition suitably "subtracts" one PHT from another, consider the long exact sequence of pairs: Exactness at stalks implies exactness of sheaves and so we have the following long exact sequence of PHT sheaves: 3.5. Euler Calculus Interpretation. In this section we show how the "addition" and "subtraction" operations on PHT sheaves described above corresponds to actual addition and subtraction once cohomology is replaced with Euler characteristic. Although the results in this section appear to be much simpler-e.g. the homotopy sheaf axiom reduces to a generalized inclusion-exclusion principle-the passage from sheaves to functions is actually part of a rich mathematical theory known as Euler Calculus; see [15] for an accessible introduction. We start by reviewing how to go from a (derived) sheaf to an integer-valued function.
Definition 3.15 (Sheaf-to-Function Correspondence). Let F • be a complex of (cohomologically) constructible sheaves on a constructible set X ∈ CS(R d ). The local Euler-Poincaré index is the piecewise constant integer-valued function defined by In the simplest setting, for 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 complexes of sheaves, the dimension function is replaced by the point-wise Euler characteristic of the complex. This index was used by Kashiwara to prove that the Grothendieck group of constructible sheaves is isomorphic to the group of constructible functions on X [30, Thm 9.7.1].
For a constructible set M , the derived PHT sheaf PHT(M ) = R(f M ) * k Z M is constructible and so by the above correspondence there is a constructible function associated to it [13].
Equivalently, it is the Euler-Poincaré index of the derived PHT sheaf PHT( Alternatively, one can view the Euler Characteristic Transform of M as the Radon transform of its indicator function on R d [13,25]. This perspective requires using the operations of Euler Calculus to their full effect [38].
is integration with respect to compactly-supported Euler characteristic.
Definition 3.18 (Radon Transform). Let S ⊂ X × Y be a closed constructible subset of the product of two constructible sets. Let π X and π Y be the projections onto the indicated factors. The Radon Transform with respect to S is a group homomorphism R S : CF(X) → CF(Y ) defined by Notice that by taking φ = 1 M and S = Z M ⊂ M ×S d−1 ×R the Euler characteristic transform of M coincides with the Radon transform of its indicator function.
The statement that the Radon transform is a group homomorphism is simply the statement that it is linear, i.e. R S (φ + ψ) = R S (φ) + R S (ψ). When M ∈ CS(R d ) is covered by M = {M i } i∈Λ , we can express its indicator function using a linear combination of indicator functions defined using this cover. This allows us to build up the ECT of a shape using the ECTs of its cover and provides a simplified expression of the homotopy sheaf axiom for the PHT sheaves. Proof. The generalized-inclusion exclusion principle allows us to write which is exactly akin to the local Euler-Poincaré index of Godemont's resolution from Equation 3.10. Linearity of the Radon transform allows us to write which is the expression using ECTs written above. This is exactly the local Euler-Poincaré index of the pushforward of the resolution in Equation 3.10. Checking on stalks reveals that for any (v, t) ∈ S d−1 × R Similarly, we can also interpret the long exact sequence of pairs given in Equation 3.14 from the point of view of Euler characteristic.
Subtraction of ECTs results in the relative Euler Characteristic Transform. Proof. Recall the LES of a pair from Equation 3.14, The long exact sequence implies that which can be rewritten as

Stability and Approximations of 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 Figure 2 for an example.
In this section we prove that up to some tolerance, we can always approximate a submanifold M ∈ CS(R d ) via a polyhedron K so that the PHT's of M and K are arbitrarily close.
We do this in three steps. First, we prove that the persistent homology transform 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. Second, we use the sampling procedure based on Niyogi-Smale-Weinberger [35] to approximate a submanifold of R d by a polyhedron. Third, 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. To define distances between the persistent homology transform of shapes we make use of the interleaving distance of sheaves in [14].
Definition 4.1 (Interleaving of pre-sheaves). Define the thickening of a pre-sheaf F via the formula F ε (U ) := F (U ε ). Let F, G : Open(X) op → D be two pre-sheaves on a metric space X. We define an ε-interleaving of F and G to be a pair of natural transformations ϕ ε : F ε → G and ψ ε : G ε → F such that the following diagram is commutative.
We can define the interleaving distance on pre-sheaves by If no such interleaving exists, we define d I (F, G) = ∞.
We use this distance to define a distance between the PHT sheaves. We note that that this definition does not use homology in any way.

4.2.
The Stability Theorem. We prove that if two shapes are of the same homotopy type and are ε-close then the PHT of the shapes are also ε-close. We show that we have the following diagram of topological spaces.
The diagram is not commutative, in fact the map h•g is homotopic to Id f −1 M (U ) . So if we apply the singular cochain sheaf to this diagram and then take quotients by quasi-isomorphisms, we will get the desired commutative triangle in figure (*). Now we explicitly describe the maps g and h.

4.3.
Background on Sampling. In [35] the authors considered the problem of how to determine homology of a submanifold of R d using a point sample. Their result reads as follows: We let K be the alpha complex of the balls U := {B (x)} produced by Theorem 4.3. By the nerve lemma, the alpha complex is homotopy equivalent to union of the balls U and so with high probability the homology of K is equal to homology of M .

The Main Approximation
Result. Now we are ready to bound the PHT distance between a submanifold M ∈ CS(R d ) and the sampled alpha complex K described in Section 4.3 using the Niyogi-Smale-Weinberger process. n > β 1 log β 2 + log 1 δ we have that, d I (PHT(M ), PHT(K)) ≤ 2 with high confidence i.e. probability ¿ 1-δ.
Proof. We show that the assumptions of Theorem 4.2 are satisfied and then apply Theorem 4.2 to conclude the result.
Choose according to 0 < ε < τ /2. We need to find a homotopy equivalence ϕ : K → M and ψ : M → K such that x − ϕ(x) ≤ ε for all x ∈ K and y − ψ(y) ≤ ε for all y ∈ M .
We pass to the union of balls U to construct the desired homotopy equivalence. Homotopy equivalence of M and U . Since the sample is ε/2-dense in M , there is an inclusion of M into U . Let ι be this inclusion and let f be the projection that sends x → arg min p∈M p − x . This map is a deformation retraction and can be seen by taking the homotopy H U (x, t) = tx + (1 − t)f (x) for all x ∈ U and t ∈ [0, 1].
Homotopy equivalence of U and K. We have the inclusion map j : K → U . There is a deformation retraction map g : U → K which can be seen in [20]. (Figure 6 gives a visual description of the homotopy map). Let ϕ := f • j and ψ := g • ι. On composing, The radius of balls are less than and so for x ∈ K, x−f •j(x) ≤ and so x−ϕ(x) 2 < 2 . Since the sample points are /2-dense, for y ∈ M , y − g • ι(y) ≤ /2 < and so y − ψ(y) 2 ≤ 2 . Apply Theorem 4.2 to get an ε 2 -interleaving of the PHTs of M and K.

Discussion
In this paper we have to our knowledge introduced the most general construction of a shape space. This shape space does not rely on diffeomorphisms or correspondences between shapes. We require very minimal measurability conditions, o-minimality. The two classic shape space constructions of Kendall (based on landmarks) and Grenander (based on diffeomorphisms) can be formalized as consisting of a base manifold where each shape is a point on the base manifold and the shape is represented as a fiber bundle. We can also place our shape space in this framework consisting of a base representation, in our case a base poset, and instead of representing the shape as a fiber bundle we represent the shape as a sheaf.
The use of sheaves in modeling shapes and other data science applications has not been well developed and we consider this paper a preliminary example of how sheaves can be used to construct richer data representations that currently exist. There is also the very natural idea of unifying Kendall's, Grenander's, and our shape space, for example if the shapes in our setting are all diffeomorphic then our construction should reduce to the fiber bundle framework of shape space. We leave this for future work.