A directed persistent homology theory for dissimilarity functions

We develop a theory of persistent homology for directed simplicial complexes which detects persistent directed cycles in odd dimensions. We relate directed persistent homology to classical persistent homology, prove some stability results, and discuss the computational challenges of our approach. Our directed persistent homology theory is motivated by homology with semiring coefficients: by explicitly removing additive inverses, we are able to detect directed cycles algebraically.


Introduction
Persistent homology is one of the most successful tools in Topological Data Analysis [3], with recent applications in numerous scientific domains such as biology, medicine, neuroscience, robotics, and many others [18].In its most common implementation, persistent homology is used to infer topological properties of the metric space underlying a finite point cloud using two steps [10]: (1) Build a filtration of simplicial complexes from distances, or similarities, between data points.
(2) Compute the singular homology of each of the simplicial complexes in the filtration, along with the linear maps induced in homology by their inclusions.The resulting persistence module can normally be represented using a persistence diagram or a persistence barcode.A fundamental limitation of persistent homology, and in fact homology, is its inability to incorporate directionality, which can be important in some real-world applications (see examples below).For instance, homology cannot in principle distinguish between directed and undirected cycles (Figure 1).Although the definition of homology, namely the differential or boundary operator, requires a choice of orientation for the simplices, the resulting homology is independent of this choice.Previous attempts have had some partial success at this issue (see 'Related work' below), however, as far as we know, there is no homology theory able to exactly detect directed cycles up to boundary equivalence.
The main difficulty occurs at the algebraic level: opposite orientations on a simplex correspond to additive inverse elements in the coefficient ring or field.Our key insight is to retain the submodule of homology generated by those classes that only have non-negative coefficients on elementary chains.In this way, we can define a directed homology module (Def.3.6) of directed simplicial complexes (Def.3.1) that detects homology classes of directed 1-cycles, as desired (Fig. 1, Prop.3.24).
This insight arises from the use of homology with semiring coefficients, where additive inverses may not exist.Indeed, the main results in this paper can be understood and reformulated in full generality using homology theory with semiring coefficients, see Appendix A.
Our directed homology theory can be extended to the persistent setting.More concretely, we define two persistence modules associated to filtrations of directed simplicial complexes: an undirected one using the whole homology module (Def.4.2) and a directed one using the submodule of directed homology (Def.4.3).We show that the bars in the directed barcodes can be matched one-to-one with bars in the undirected barcodes, with the directed bars possibly having a later birth (Prop.4.7, Figs.2,5,6).
Our motivation to develop directed persistent homology is the applications to real-world data sets where asymmetry or directionality, in particular the presence of directed cycles, plays a fundamental role.Examples include biological neural networks (directed synaptic connections), time series data (directed temporal connections) or biological molecular networks such as protein-protein interaction networks (inhibitory and excitatory connections).Mathematically, we can model these situations using a finite set V of data points, and an arbitrary function d V : V × V → R, which we call dissimilarity function (Section 2.2) and which, crucially, may not be symmetric.Our main example of a directed simplicial complex is the directed Rips complex (Definition 4.12) of (V, d V ), which becomes the input of our suggested directed persistent homology pipeline.
In the context of dissimilarity functions, we prove a stability result with respect to the bottleneck distance between (directed) persistent diagrams and the correspondence distortion distance (a generalisation of the Gromov-Hausdorff distance) between dissimilarity functions over finite sets (Thm. 4.19).We finish this article by discussing the computational challenges of our approach.Related work.A first approach to incorporating directionality would be to encode the asymmetry of a data set in the simplicial complex built from it.In [25], the author uses ordered tuple complexes or OT-complexes, which are generalisations of simplicial complexes where simplices are ordered tuples of vertices.Similar ideas have been successfully used in the field of neuroscience to show the importance of directed cliques of neurons [21], showing that directionality in neuron connectivity plays a crucial role in the structure and function of the brain.In [7], the authors use so-called Dowker filtrations to develop persistent homology for asymmetric networks, and note [7,Remark 35] that a non-trivial 1-dimensional persistence diagram associated to Dowker filtrations suggests the presence of directed cycles.However, they also note that such persistence diagram may be non-trivial even if directed cycles are not present.Further progress can be achieved by combining the ideas above with homology theories that are themselves sensitive to asymmetry.In [8], the authors develop persistent homology for directed networks using the theory of path homology of graphs [14].This persistent homology theory shows stability with respect to the distance between asymmetric networks [4], and is indeed able to tell apart digraphs with isomorphic underlying graphs but different orientations on the edges.Nonetheless, cycles in path homology do not correspond to directed cycles, see [8,Example 10].Another significant contribution can be found in [25], where four new approaches to persistent homology are developed for asymmetric data, all of which are shown to be stable.Each approach is sensitive to asymmetry in a different way.For example, one of them uses a generalisation of poset homology to preorders to detect strongly connected components in digraphs, a feature our implementation does not have (see Proposition 3.18).More interestingly for our purposes, in [25,Section 5] the author introduces a persistent homology approach that builds a directed Rips filtration of ordered tuple complexes associated to dissimilarity functions d V : V × V → R.This is indeed sensitive to asymmetry and yields a persistent homology pipeline that is stable with respect to the correspondence distortion distance, a generalisation of the Gromov-Hausdorff distance to dissimilarity functions (see [25, Section 2] and Section 2.2).However, undirected cycles are also detected by this homology theory.In contrast, in this article we produce a theory of persistent homology associated to ordered tuple complexes that only detects directed cycles and which is also stable with respect to the correspondence distortion distance.
Overview of results.We introduce modules of undirected and directed homology associated to directed simplicial complexes (Definition 3.4) and show that they satisfy some desirable properties.Furthermore, we prove that for certain coefficient rings, closed paths will only have non-trivial directed homology in dimension 1 when their edges form a directed cycle, as we set up to do (Proposition 3.24).Our modules of directed homology can be defined in dimensions greater than one, although they are zero in all even dimensions (Proposition 3.26) except in dimension 0 where they detect weakly connected components (Proposition 3.18).
A filtration of a directed simplicial complex (top, left to right) and corresponding undirected (bottom, left) and directed (bottom, right) persistence barcodes.Every bar in the directed barcode corresponds to a unique bar in the undirected barcode (shown here by matching colours).
Next, we extend our homology theory to the persistence setting.In particular, we introduce, for each dimension, two persistence modules associated to the same filtration: an undirected persistence module (Definition 4.2), which is analogous to the one introduced in [25, Section 5], and the submodule generated by directed classes, which we call the directed persistence module (Definition 4.3).The directed persistence module gives rise to bars associated to homology classes that can be represented by directed cycles, as illustrated in Fig. 2 and Examples 4.8 to 4.11.We also establish a relation between the undirected and directed persistence barcodes of the same filtration.Indeed, in Proposition 4.7 we show that every bar in the directed barcode corresponds to a unique bar in the undirected barcode that dies at the same time.The bar in the directed barcode may, however, be born later, and some bars in the undirected barcode may be left unmatched (see Figs. 2, 5 and 6).
Having all the necessary ingredients, we can provide a complete workflow for directed persistent homology: given a dissimilarity function d V on a finite set V , we construct its directed Rips filtration (Definition 4.12), and take the corresponding undirected and directed n-dimensional persistence modules, respectively denoted H n (V, d V ) and H Dir n (V, d V ) (Definition 4.13).Both of these persistence modules have persistence diagrams and barcodes (Definition 4.15) and the associated persistence modules are stable with respect to the correspondence distortion distance (Section 2.2 and Theorem 4. 19).
We finish the article with a discussion of the computational challenges of calculating the directed persistent homology of a dissimilarity function.The Standard Algorithm can easily be adapted to compute the barcodes of the undirected persistent homology of the dissimilarity function, but the computation of the directed persistence barcodes is more challenging.A direct approach results in an extreme ray enumeration problem (Section 5), a well-known problem in computational geometry.Developing an algorithm that computes the directed homology classes, rather than all directed cycles, remains an open problem.
We include an Appendix on homology with semiring coefficients and on how it gives rise to the ideas introduced in this article.This provides additional motivation and context for our results, and presents them in full generality.
Outline of the article.In Section 2, we introduce the necessary background in persistence modules (2.1) and dissimilarity functions (2.2).In Section 3 we introduce undirected and directed homology modules of directed simplicial complexes.We then use these homology modules to introduce directed and undirected persistent homology in Section 4, where we also show our stability results with respect to dissimilarity functions.In Section 5, we discuss the computational implementation of directed persistent homology and lay out some future research directions.Finally, Appendix A introduces homology with semiring coefficients and shows how it relates to directed homology.

Persistence modules and dissimilarity functions
Our goal is to extend persistent homology to directed simplicial complexes such as those constructed from a dissimilarity function.In this section, we introduce the necessary background regarding persistent homology (Section 2.1) and dissimilarity functions (Section 2.2).
2.1.Persistence modules, diagrams and barcodes.In this section, we introduce persistence modules and their associated persistence diagrams and barcodes.We follow the exposition in [8], as it is simple and focused on persistence modules arising in the context we are interested in: that of persistent homology of finite simplicial complexes.Many of the results below hold in more generality [6] but we chose to keep the exposition simple.
Let R be a ring with unity and let T ⊆ R be a subset.
Let us assume that R is a field, thus V = {V δ }, {ν δ ′ δ } δ≤δ ′ ∈T is a persistence vector space, and that V δ is finite-dimensional, for every δ ∈ R. Furthermore, we suppose that there exists a finite subset {δ 0 , δ 1 , . . ., δ n } ⊆ T for which When R is a field, either of these restrictions alone (namely, each V δ being finitedimensional or the existence of a finite subset {δ 0 , δ 1 , . . ., δ n } as above) is enough to associate a persistence barcode and a persistence diagram to V [6, Theorem 2.8].We nevertheless assume both restrictions since they hold for persistence diagrams associated to finite simplicial complexes, which are precisely the sort of objects that arise from data, and such assumption makes the exposition simpler.
Let us now introduce persistence barcodes and diagrams.First, for simplicity, we consider V indexed by the natural numbers: δ k is the identity whenever k, l ≥ n. (This clearly contains all of the information in V.) By [11, Basis Lemma], we can find bases B i of the vector spaces Such bases are called compatible bases.Elements in B i that are mapped to an element in B i+1 correspond to linearly independent elements of V δ i that 'survive' until the next step in the persistence vector space.Similarly, elements in a basis B i which are not in B i−1 are considered to be 'born' at index i.Formally, we define Given (b, i) ∈ L, we call i the birth index of the basis element b.This element 'survives' on subsequent bases until it is eventually mapped to zero.When this happens, the number of steps taken until the class dies is its death index of b.Formally, the death index of (b, i) is We allow ℓ(b, i) = ∞, if b is in every basis B j for all j ≥ i, so that the death index takes values in N = N ∪ {+∞}.Using this information, we can introduce the persistence barcode of V. We call a pair (X, m) a multiset if X is a set and m : X → N = N ∪ {+∞} is a function.We call m(x) the multiplicity of x ∈ X. Definition 2.3.Consider a persistence vector space V = {V δ i }, {ν δ i+1 δ i } i∈N as above.The persistence barcode of V is defined as the multiset of intervals with the multiplicity of [δ i , δ j+1 ) (respectively [δ i , +∞)) being the number of elements (b, i) ∈ L such that ℓ(b, i) = j (respectively ℓ(b, i) = +∞).Thus, persistence barcodes encode the birth and death of elements in a family of compatible bases.Crucially, and even though compatible bases are not unique, the number of birth and death events at each step is determined by the rank of the linear maps ν δ i+1 δ i and their compositions, and it is thus independent of the choice of compatible bases.Furthermore, the persistence barcode of a persistence vector space completely determines both the dimension of the vector spaces V δ i and the ranks of the linear maps between them, hence it determines the persistence vector space up to isomorphism [6,Theorem 2.8].
Each interval in Pers(V) is called a persistence interval.Persistence barcodes can be represented by stacking horizontal lines, each of which represents a persistence interval or bar.The endpoints of the line in the horizontal axis correspond to the endpoints of the interval it represents, whereas the vertical axis has no significance other than being able to represent every persistence interval at once.Persistence bars can be stacked in any order, although they are usually ordered by their birth.This representation is what gives persistence barcodes their name.
An alternative characterisation of a persistence vector space is its persistence diagram.Let us write R = R ∪ {−∞, +∞} for the extended real line.
Definition 2.4.The persistence diagram of the persistence vector space V is the multiset The multiplicity of a point in Dgm(V) is the multiplicity of the corresponding interval in Pers(V).
A crucial property for applications of persistent homology to real data is that a small perturbation of the input (a data set, encoded as filtration of simplicial complexes) results in a small perturbation of the output (its persistence module).Algebraically, this amounts to proving that a small perturbation of the persistence diagram results in a small perturbation of the associated persistence module.In order to state this stability result, we therefore need to introduce distances between persistence diagrams, and persistence modules, respectively.
To measure how far apart two persistence diagrams are, we can use the bottleneck distance between multisets of R 2 .Let ∆ ∞ denote the multiset of R 2 consisting of every point in the diagonal counted with infinite multiplicity.A bijection of multisets ϕ : y, that is, a bijection between the sets obtained when counting each element in both X and Y with its multiplicity.Definition 2.5.Let A and B be two multisets in R 2 .The bottleneck distance between A and B is defined as where the infimum is taken over all bijections of multisets ϕ : Note that the bottleneck distance between two persistence diagrams defined from persistence barcodes can only be finite if the diagrams have the same amount of bars of form [a, ∞) for a ∈ R.
We also need a distance between persistence vector spaces.To that purpose, we use the interleaving distance, introduced in [5].
2.2.Dissimilarity functions and the correspondence distortion distance.Our objective is to define a theory of persistent homology able to detect directed cycles modulo boundaries.Therefore, instead of building filtrations (of simplicial complexes) from finite metric spaces, we are interested in filtrations (of directed simplicial complexes) built from arbitrary dissimilarity functions.We will follow [25], where they receive the name of set-function pairs, and [4,7,8], where they are referred to as dissimilarity networks or asymmetric networks.
In this section, we introduce the necessary background on dissimilarity functions, and the correspondence distortion distance between them, which is a generalisation of the Gromov-Hausdorff distance to the asymmetric setting.We finish with a reformulation of this distance, established in [4], which we will need to prove our persistent homology stability result.
Note that no restrictions are imposed on d V , thus it may not be symmetric, the triangle inequality may not hold, and the distance from a point to itself may not be zero.These functions are also referred to as asymmetric networks [4,7,8] since they may be represented as a network with vertex set V and an edge from v 1 to v 2 with weight d V (v 1 , v 2 ) for every (v 1 , v 2 ) ∈ V × V .Thus, dissimilarity functions are very flexible and allow for the modelling of widely different problems, including any problem that can be modelled using a network.
We would like to build (directed) simplicial complexes and, ultimately, persistence diagrams from dissimilarity functions.In order to check the stability of our constructions, we need a way to measure how close two such objects are.When comparing networks with the same vertex sets, a natural choice is the ℓ ∞ norm.However, we are interested in comparing dissimilarity functions on different vertex sets.To that end, we consider the ℓ ∞ norm over all possible pairings (quantified by a binary relation) between vertex sets, following ideas similar to those behind the definition of the Gromov-Hausdorff distance.
Definition 2.9.Let (V, d V ) and (W, d W ) be two dissimilarity functions and let θ be a non-empty binary relation between V and W , that is, an arbitrary subset θ ⊆ V × W .The distortion of the relation θ is defined as dis(θ) := max A correspondence between V and W is a relation θ between these sets such that π V (θ) = V and π W (θ) = W , where π V : V × W → V is the projection onto V , and similarly for π W .That is, θ is a correspondence if every element of V is related to at least an element of W , and vice-versa.The set of all correspondences between V and W is denoted R(V, W ).
The correspondence distortion distance [25] between (V, d V ) and (W, d W ) is defined as This notion agrees with that of the Gromov-Hausdorff distance when (V, d V ) and (W, d W ) are metric spaces, [2, Section 7. .
We will use a reformulation of the correspondence distortion that can be found in [7].In order to introduce it, we need to define the distortion and co-distortion of maps between sets endowed with dissimilarity functions.Definition 2.10.Let (V, d V ) and (W, d W ) be any two dissimilarity functions and let ϕ : V → W and ψ : W → V be maps of sets.The distortion of ϕ (with respect to d V and d W ) is defined as The co-distortion of ϕ and ψ (with respect to d V and d W ) is defined as codis(ϕ, ψ) := max Note that codistortion is not necessarily symmetrical, namely, codis(ϕ, ψ) and codis(ψ, ϕ) may be different if either of the dissimilarity functions are asymmetric.
Finally, we have the following reformulation of the correspondence distortion distance.

Directed homology of directed simplicial complexes
In this section, we introduce and study a family of subrings of the homology rings of simplicial complexes which encode directionality information and in particular detect directed cycles (Fig. 1).We cannot introduce such a family using (undirected) simplicial complexes, as they cannot encode directionality information of the simplices.One approach is to use the so-called ordered-set complexes, where simplices are sets with a total order on the vertices.They generalise simplicial complexes, which can be encoded as fully symmetric ordered-set complexes, that is, ordered-set complexes where if a set of vertices forms a simplex, it must do so with every possible order.However, persistent homology of ordered-set complexes is not stable (Remark 4.20).
To achieve stability, we use one further generalisation, called ordered tuple complexes or OTcomplexes in [25], and called directed simplicial complexes in this article (Definition 3.1).The only difference is that arbitrary repetitions of vertices are allowed in the ordered tuples representing simplices.Clearly, any ordered-set complex is a directed simplicial complex.Furthermore, a (undirected) simplicial complex can be encoded as a fully symmetric (as above) directed simplicial complex where every possible repetition of vertices is also included.When doing so, the (undirected) simplicial complex and its associated directed simplicial complex have isomorphic homologies over rings (Remark 3.5), and morphisms of simplicial complexes can be lifted to morphisms between their associated directed simplicial complexes (Remark 3.9).Finally, and crucially for us, we will be able to use the above mentioned subrings encoding information on directed cycles to introduce a theory of persistent homology for dissimilarity functions which is stable with respect to the correspondence-distortion distance (Section 4).Note that, as ordered-set complexes are directed simplicial complexes, the results stated here apply to homology computations on ordered-set complexes as well.
3.1.Chain complexes of directed simplicial complexes.In this section, we introduce directed simplicial complexes and their associated chain complexes and homology modules, including modules of directed homology.Definition 3.1.A directed simplicial complex, or ordered tuple complex, is a pair (V, X) where V is a finite set of vertices, and X is a family of tuples (x 0 , x 1 , . . ., x n ) of elements of V such that if (x 0 , x 1 , . . ., x n ) ∈ X, then (x 0 , x 1 , . . ., x i , . . ., x n ) ∈ X for every i = 0, 1, . . ., n. (Here and throughout the rest of the paper, x i indicates that x i is omitted from the list.) We will denote the directed simplicial complex (V, X) just by X, and assume that every vertex belongs to at least one directed simplex (so that V is uniquely determined from X). Elements of X of length n + 1 are called n-simplices, and the subset of the n-simplices of X is denoted by X n .Note that arbitrary repetitions of vertices in a tuple are allowed.
Note that directed simplicial complexes are more general objects than simplicial complexes, in a way that allows directed simplicial complexes to encode asymmetric information.Note further that it is possible to define a geometric realisation for these objects in which simplices with vertex repetitions are collapsed to a simplex with no repetitions, thus simplices with repeated vertices play a role similar to that of the degenerate simplices in simplicial sets.
We make use of the following terminology when dealing with directed simplicial complexes.Elements of X of length n + 1 are called n-simplices, and the subset of the n-simplices of X is denoted by X n .An n-simplex obtained by removing vertices from an m-simplex, n ≤ m, is said to be a face of the m-simplex.Such face is called proper if n < m, or equivalently, if at least vertex of the m-simplex is removed.A directed simplicial complex is said to be n-dimensional, denoted dim(X) = n, if X n+1 is trivial (empty) but X n is not.A collection Y of simplices of X that is itself a directed simplicial complex is said to be a directed simplicial subcomplex (or, simply, subcomplex ) of X, denoted Y ⊆ X.Note that the vertex set of Y may be strictly smaller than that of X.
We now introduce chain complexes associated to a directed simplicial complex.These definitions are straight generalisations of those for (undirected) simplicial complexes.Definition 3.2.Let R be a commutative ring.The n-dimensional chains of X are defined as the elements of the free R-module generated by the n-simplices, We call the elements [x 0 , x 1 , . . ., x n ] ∈ C n (X, R), (x 0 , x 1 , . . ., x n ) ∈ X, elementary n-chains.Definition 3.3.Let X be a directed simplicial complex.For each n > 0, we define a morphism of For n = 0, let ∂ 0 : C 0 (X, R) → {0} be the trivial map.
A straightforward computation analogous to the one for chain complexes in simplicial homology shows that {C n (X, R), ∂ n } is a chain complex of R-modules.In particular, we can define homology groups.
Definition 3.4.Let X be a directed simplicial complex, R a commutative ring, and n ≥ 0. The n-dimensional cycles, boundaries, and homology of X are Remark 3.5.If X is an (undirected) simplicial complex, we can define an ordered-set simplicial complex X OT where (x 0 , x 1 , . . ., x n ) ∈ X OT whenever {x 0 , x 1 , . . ., x n }, after removing any repetition of vertices, is a simplex in X.The chain complex C * (X OT , R) is called the ordered chain complex of X in [17], and its homology is isomorphic to the singular homology of X over R.
We now discuss how to only retain the information associated to directed cycles.Note that when introducing the differential for the chain complexes of simplicial complexes, an orientation is chosen for each of the simplices.However, undirected cycles can still be produced because the chosen orientation for a simplex can be reverted by changing the sign of the corresponding elementary chain.As such, homology of (undirected) simplicial complexes is independent of these choices of orientations.
In the case of directed simplicial complexes, orientations are not chosen, and we can ensure that we are only retaining information regarding directed cycles by making sure that all of the chains have positive coefficients, when the coefficient ring is chosen appropriately.However, we also require the introduced object to be a submodule of the entire module of homology.Thus, we arrive at the following definition.Definition 3.6.Let X be a directed simplicial complex and let The nth dimensional module of directed homology, H Dir n (X, R), is the submodule of H n (X, R) generated by the directed cycles, Remark 3.7.The rings Z, Q and R are used to simplify the exposition: the definition of Z Dir n (X, R), and thus of H Dir n (X, R), can be made in an analogous way for any ring R that is the Grothendieck completion of a cancellative, zerosumfree semiring Λ (see Appendix A).
In view of Definition 3.6 it is clear that, in dimension 1, directed circuits in the directed graph underlying a directed simplicial complex will give rise to directed cycles.In Section 3.3 we will show how these directed submodules of homology behave in a desirable way.
3.2.Functoriality of directed homology.In this section, we prove that homology and directed homology are functors from the category of directed simplicial complexes to the category of graded R-modules.We also show that two morphisms allowing for the construction of the prism operator must induce the same map on homology, a result we will need to prove our persistent homology stability result.We begin by introducing morphisms of directed simplicial complexes.
Remark 3.9.This definition is stricter than the classical notion of morphism of simplicial complexes, where morphisms are allowed to take simplices to simplices of lower dimension, as directed simplicial complexes can intrinsically account for vertex repetitions.However, note that if X and Y are (undirected) simplicial complexes, a map f : X → Y is a morphism of simplicial complexes if and only if f : X OT → Y OT (see Remark 3.5) is a morphism of directed simplicial complexes.Definition 3.10.Let f : X → Y be a morphism of directed simplicial complexes.Then f induces morphisms of R-modules C(f ) = {C n (f )}, defined as We will often abbreviate Remark 3.12.Let X and Y be (undirected) simplicial complexes and let R be a ring.If f : X → Y is a morphism of (undirected) simplicial complexes, the map induced on homology by f : X → Y is the same as the map induced on homology by f : X OT → Y OT (see Remarks 3.5 and 3.9).Corollary 3.13.(Directed) Homology is a functor from the category of directed simplicial complexes to the category of graded R-modules.In particular, isomorphic directed simplicial complexes have isomorphic (directed) homologies.
We finish this section by showing a sufficient condition for two morphisms to induce the same map on homology.We will need this result to prove that our definition of persistent homology is stable.Lemma 3.14.Let R be a commutative ring.Let X and Y be two directed simplicial complexes and let f, g : X → Y be morphisms of directed simplicial complexes such that if (x 0 , x 1 , . . ., x n ) ∈ X, then f (x 0 ), f (x 1 ), . . ., f (x i ), g(x i ), . . ., g(x n ) ∈ Y for every i = 0, 1, . . ., n.Then, H n (f ) = H n (g) for every n ≥ 0. Consequently, H Dir n (f ) = H Dir n (g), for every n ≥ 0.
We show that this family of maps provides a chain homotopy between f and g.Namely, we prove that C n (g) On the one hand, On the other hand, By exchanging the roles of the indices in this last equation, we obtain that (−1) i+1 (−1) j f (x 0 ), f (x 1 ), . . ., f (x j ), g(x j ), . . ., g(x i ), . . ., g(x n ) Now, adding Equations (3.1) and (3.2), It is now straightforward to check that this sum amounts to and we are done.

Basic computations and examples.
In this section, we explore some basic properties of this homology theory.We begin by studying the relation between homology and connectivity.
Definition 3.15.Let (V, X) be a directed simplicial complex and v, w ∈ V be two vertices.A path from v to w in X a sequence of vertices v = x 0 , x 1 , . . ., x n = w such that either (x i , x i+1 ) or (x i+1 , x i ) is a simplex, for all 1 ≤ i ≤ n − 1.The (weakly) connected components of X are the equivalence classes of the equivalence relation v ∼ w if there is a path in X from v to w.We call X (weakly) connected if it has only one connected component, that is, every pair of vertices can be connected by a path.
Note that this notion of connectedness ignores the direction of the edges (1-simplices).The next result shows that we can compute the homology of each connected component independently.The proof follows by observing that the chain complex C n (X, R) is clearly the direct sum of the chain complexes associated to each of the (weakly) connected components of X.In particular, it is immediate that any directed cycle can be decomposed as a sum of directed cycles in each of the directed components.
Proposition 3.16.The (directed) homology of a directed simplicial complex X is isomorphic to the direct sum of the (directed) homology modules of its (weakly) connected components.
We next show that the 0th (directed) homology counts the number of (weakly) connected components of a directed simplicial complex X.We start with a lemma.Lemma 3.17.Let R be a commutative ring and X be a directed simplicial complex.For any vertex v and any λ ∈ R, λ[v] is homologous to the trivial class if and only if λ = 0.
Proof.It is clear that λ[v] is a cycle as ∂ 0 is trivial.On the other hand, it is clear that it must be the trivial class if λ = 0. Now assume that λ[v] is the trivial class.We shall prove that λ = 0.
Assume that X has n + 1 vertices, namely , where we are assuming that λ ij = 0 whenever [x i , x j ] is not a 1-chain.By computing the differentials, is a basis of C 0 (X, R), the coefficients of each element in the basis must be equal in both sides of the equality.Namely, for each j = 0, 0 = n i=0 (λ ij − λ ji ), and λ = n i=0 (λ i0 − λ 0i ).Adding these equations, we deduce that λ = 0. Proposition 3.18.Let X be a directed simplicial complex and let R be a commutative ring.Then H 0 (X, R) ∼ = R k , where k is the number of (weakly) connected components of X.Furthermore, if R ∈ {Z, Q, R}, then H 0 (X, R) = H Dir 0 (X, R) ∼ = R k .Proof.By Proposition 3.16 we only need to show that if X is connected, then H 0 (X, R) ∼ = R.Let v, w be any two vertices and let us show that [v] and [w] are homologous 0-cycles.Indeed, since X is connected, we can find vertices 19.The fact that 0th directed homology ignores edge directions seems counter-intuitive, as we set up this framework to detect directed features, namely directed cycles.However, this is a natural consequence of homology being an equivalence relation.In particular, as mentioned in the proof, if either [u, v] or [v, u] are 1-chains, [u] and [v] are homologous, thus directionality of the 1-chains does not affect 0th directed homology.However, this only occurs in dimension 0, as a consequence of 0-chains always being cycles.Thus, when working with 1-simplices, the symmetry in the homology relation does not affect the detection of asymmetry in the data, as such asymmetry is encoded in the cycles themselves.It is also worth mentioning that a persistent homology able to detect strongly connected components in directed graphs has been introduced in [25].
We now show that the homology of a point is trivial for positive indices.
Example 3.20.Let R be a commutative ring and let X be the directed simplicial complex with vertex set V = {x 0 } and simplices X = {(x 0 )}.Then, Indeed, X is connected, thus H 0 (X, R) = R by Proposition 3.18.For n ≥ 1, there are no nchains, hence H n (X, R) = 0.In this case, it is also immediate to check that if R ∈ {Z, Q, R}, H Dir n (X, R) = H n (X, R), for every n.Directed simplicial complexes whose homology is isomorphic to that of the point are called acyclic.
Note that acyclic implies directionally acyclic, as directed homology is a submodule of the module of homology, for every n.
Next, we show that a directed simplicial complex consisting of one m-dimensional simplex along with all of its faces (note that this is an ordered-set complex) is acyclic.Proposition 3.22.Let X be the directed simplicial complex consisting of the simplex (x 0 , x 1 , . . ., x m ) and all of its faces.Then X is acyclic.
]).To be a directed 1-cycle, the directions of the involved 1-simplices must form circuit.This does not hold for (undirected) homology.
Proof.As a consequence of how X is defined, if x ∈ C n (X, R) is a chain so that x 0 does not participate in any of its elementary n-chains (as there are no repetitions in the simplices of X), then x 0 can be added as the first element of every elementary n-chain in x, giving us an (n + 1)-chain which we denote x 0 x ∈ C n+1 (X, R).Simple computations show that Now take x ∈ Z n (X, R) any cycle and decompose it as x = x 0 y + z, where x 0 does not participate in any of the chains in either y or z.Using the formula above, In particular, the chains in which x 0 does not participate must add up to zero, namely y + ∂(z) = 0. Finally, consider the chain x 0 z.We have that Thus, x ∈ Z n (X, R) is homologous to zero, and the result follows.
We now illustrate the ability of this homology theory to detect directed cycles.We do so through some simple examples.
Example 3.23.Let R ∈ {Z, Q, R}.Let X, Y and Z be the directed simplicial complexes represented in Figure 3.These three complexes are connected, so their 0th homologies are R, both directed and undirected.Furthermore, neither X nor Y have k-simplices for k ≥ 2, so H k (X, R) and H k (Y, R) are trivial (zero) for every k ≥ 2. This in particular implies that H Dir k (X, R) and H Dir k (Y, R) are trivial as well.Although Z has one 2-simplex, it is not a 2-cycle, thus H 2 (Z, R) is also trivial.To compute the first homology, we need to consider the 1-simplices and their differentials.We list them below.
Since there are no 2-cycles in X, different 1-cycles cannot be homologous.We deduce that H 1 (X, R) ∼ = R.However, no 1-cycle can have non-negative coefficients for the three elementary 1-cycles, thus Since there are no 2-simplices in Y , we deduce that H 1 (Y, R) = R. Furthermore, the coefficients can be simultaneously positive.Namely, [w 1 , w 2 ] + [w 2 , w 3 ] + [w 3 , w 1 ] is a directed cycle, which generates the entirety of H 1 (X, R).We deduce that H Dir 1 (X, R) ∼ = R.Note that X and Y have isomorphic homology rings, but their directed homology rings are different.
Finally, for Z, similar computations show that Z 1 (Z, R) is the free R-module generated by cycles.In particular, Z Dir 1 (Z, R) consists of linear combinations of those two cycles, with positive coefficients.Note, however, that generating sets of Z 1 (X, R) containing fewer than two directed cycles exist.This shows that computing a generating set for the cycles may not be enough to compute the full set of directed cycles.
Continuing with the homology computations, note that in this case we have a 2-simplex, y = [u 2 , u 3 , u 4 ], for which In particular, both the directed and undirected homologies of Y and Z are isomorphic and we can see how 2-simplices can make directed cycles equivalent, as expected.
More generally, if R ∈ {Z, Q, R}, a polygon will give rise to a non-trivial directed homology class in dimension 1 if, and only if, the cycle can be traversed following the direction of the edges.Proposition 3.24.Let X be a 1-dimensional directed simplicial complex with vertices v 0 , v 1 , . . ., v n , n ≥ 1, and with 1-simplices e 0 , e 1 , . . ., e n where either e i = (v i , v i+1 ) or e i = (v i+1 , v i ), i = 0, 1, . . ., n, and we write x is non-trivial, we can assume without loss of generality that λ 0 = 0. We can further assume that e 0 = (v 0 , v 1 ).Thus, . The only other edge in which e 1 participates is e 1 .We deduce that . By proceeding iteratively, we deduce that λ i = λ 0 , if e i = (v i , v i+1 ), or that λ i = −λ 0 , if e i = (v i+1 , v i ).It is now straightforward to check that, with λ i defined in terms of λ 0 in such way, i = 1, . . ., n, x = n i=0 λ i [e i ] is a non-trivial cycle.Since there are no 2-chains, H 1 (X, R) ∼ = R.
Regarding the directed homology, note that if e 0 = (v 0 , v 1 ), the coefficients of the cycle x can only be all positive if and only if e i = (v i , v i+1 ).In such case, H Dir 1 (X, R) = H 1 (X, R) ∼ = R, and otherwise H Dir 1 (X, R) = 0.The case in which e 0 = (v 1 , v 0 ) is analogous.Remark 3.25.Note that Proposition 3.24 applies to polygons with only two vertices v 1 and v 2 (see Figure 4), which are allowed in a directed simplicial complex.Indeed, an immediate computation shows that [v 1 , v 2 ] + [v 2 , v 1 ] is a directed 1-cycle.This result shows that directed homology is not a homotopy invariant for the geometric realisation of directed simplicial complexes, as all of the polygons considered in Proposition 3.24 give rise to homotopic geometric realisations.
We end this section by noting that, although our initial aim was a directed homology group able to detect directed 1-cycles, we have a directed homology theory defined in all dimensions.However, we can show that the directed homology is trivial in even dimensions other than 0.
Proof.We will show that no non-trivial directed cycles may exist in such dimensions.In order to do so, consider the morphism of R-modules Thus, if x = k i=0 λ i x i where x i is an elementary n-chain, ϕ n (x) = k i=0 λ i .Now assume that x i is an elementary 2n-chain, for some n ≥ 1.In this case, ∂(λ i x i ) = λ i ∂(x i ), where ∂(x i ) consists of the sum of ⌊ 2n 2 ⌋ = n elementary n-chains with positive sign and ⌊ 2n−1 2 ⌋ = n−1 elementary n-chains with negative sign.Thus, To prove our claim, let x = k i=0 λ i x i ∈ Z 2n (X, R) be a cycle where each x i is an elementary 2n-cycle.Then, given that ∂(x) = 0, ϕ 2n−1 ∂(x) = k i=0 λ i = 0.If x is directed, then λ i ≥ 0, for all i, thus we deduce that λ i = 0, for all i.Namely, the trivial cycle is the only directed cycle, and H Dir 2n (X, R) = {0}.Remark 3.27.The proof of this result is based on the fact that the number of positive coefficients in the boundary of an elementary n-chain is larger than the number of negative coefficients, if n is even.This may also be related to the fact that there is no obvious way to define directed n-cycles for n > 1.For the purposes of this article, it suffices to consider 1-cycles and H 1 (X, R).However, note that non-trivial (homological) cycles do exist in all odd dimensions.For instance, the elementary (2n − 1)-chain obtained by repeating a vertex 2n times is always a cycle.

Persistent directed homology
In this section, we introduce a theory of persistent homology for directed simplicial complexes which comes in two flavours: one takes into account the directionality of the complex, whereas the other one is analogous to persistent homology in the classical setting.We thus have, associated to the same filtration of directed simplicial complexes, two persistence modules which produce two different barcodes.Both persistent homology theories show stability (see Theorem 4.19) and they are closely related.Indeed, directed cycles are undirected cycles as well, thus every bar in a directed persistence barcode can be uniquely matched with a bar in the corresponding undirected one, although the undirected bar may be born sooner, see Proposition 4.7.

4.1.
Persistence modules associated to a directed simplicial complex.Let us begin by introducing filtrations of directed simplicial complexes.
We now introduce undirected persistence modules.Definition 4.2.Let (X δ ) δ∈T be a filtration of a directed simplicial complex X and let R be a commutative ring.The n-dimensional undirected persistence R-module of X is the persistence Rmodule ({H n (X δ , R)}, {H n (i δ ′ δ )} δ≤δ ′ ∈T .The functoriality of H n makes this a persistence module.Now, in order to retain the information on directionality, we take the submodule of directed classes.Definition 4.3.Let (X δ ) δ∈T be a filtration of a directed simplicial complex X and let R ∈ {Z, Q, R}.The n-dimensional directed persistence R-module of X is the persistence R-module , where H Dir n (X δ , R) are defined as in Definition 3.6, i δ ′ δ : X δ → X δ ′ are the inclusion maps, and H Dir n (i δ ′ δ ) are the restrictions of the maps H n (i δ ′ δ ) to directed homology, as introduced in Proposition 3.11.Remark 4.4.Let (X δ ) δ∈T be a filtration of a directed simplicial complex X and let δ ≤ δ ′ ∈ T .If R ∈ {Z, Q, R}, by applying Proposition 3.11 to the map i δ ′ δ : X δ → X δ ′ , we have a commutative diagram In particular, the injections H Dir n (X δ , R) ֒→ H n (X δ , R) δ∈T give rise to a monomorphism of persistence modules.
We can now introduce persistence diagrams and barcodes associated to filtrations of directed simplicial complexes.As these were only introduced for fields in Section 2.1, from this point on, we will assume that R is a field.In particular, when taking directed homology, we will assume that R ∈ {Q, R}.Definition 4.5.Let (X δ ) δ∈T be a filtration of a directed simplicial complex X where T ⊆ R is finite.The persistence diagrams associated to the n-dimensional undirected and directed persistence R-modules of X are respectively denoted Dgm n (X, R) and Dgm Dir n (X, R).Similarly, the respective barcodes are denoted Pers n (X, R) and Pers Dir n (X, R).
Remark 4.6.Note that H Dir 0 (X δ , R) ∼ = H 0 (X δ , R) for every δ ∈ T , as shown in Proposition 3.18.As a consequence, the 0-dimensional directed and undirected persistence R-modules of a directed simplicial complex X are isomorphic.In particular, they have the same persistence barcodes and diagrams, and they measure the connectivity of the simplicial complex at each stage of the filtration.
The next result establishes the relation between the undirected and directed persistence barcodes and diagrams of a persistence module, and it is thus key to understanding the directed persistence barcodes.
Proposition 4.7.Let (X δ ) δ∈T be a filtration of directed simplicial complexes.Then, there is an injective matching sending each bar in Pers Dir n (X, R) to a bar in Pers n (X, R) which contains it.Furthermore, matched bars must die at the same time.
Proof.This result is an immediate consequence of Remark 4.4 and [1, Proposition 6.1].
Note that a bar in the directed persistence barcode of a filtration may be born after the one it is matched with in the undirected one, and some bars in the undirected barcode may remain unmatched (see Examples below and Figures 5 and 6).
We now introduce some examples to illustrate Proposition 4.7 and the general behaviour of the directed persistence barcodes.
Example 4.8.Let us illustrate how undirected and directed persistence modules and their barcodes can be different.First, consider the directed simplicial complexes X and Y in Figure 3 (see Example 3.23).Regardless of the filtration chosen for X, the lack of directed cycles means that the 1-dimensional directed persistence module is trivial.However, at the end of the filtration, there is a cycle in homology, thus there is a bar in the undirected persistence barcode.In the case of Y , the only 1-cycle is directed, so the undirected and directed persistence modules associated to any filtration of Y are isomorphic, and different from those of X.
Example 4.9.Consider now the directed simplicial complex Z in Figure 3 (see Example 3.23).Let T = {0, 1, 2, . . .} and consider the filtration of Z given by (Z δ ) δ∈T , as illustrated in Figure 5, where Z δ = Z for every δ ≥ 3. The undirected and directed 1-dimensional persistence modules of this filtration are not isomorphic.Indeed, in Z 1 there is clearly an undirected cycle, whereas . These two classes become equivalent in Z 3 .The undirected and directed 1-dimensional persistence barcodes of this filtration, shown in Figure 5, illustrate how undirected classes may become directed.
The last example also shows an important difference between classical and directed persistence modules and barcodes.Namely, in the undirected setting, the addition of one simplex to the filtration can either cause the birth of a class in the dimension of the added simplex, or kill a class in the preceding dimension.This simple idea is in fact the basis of the Standard Algorithm for computing persistent homology.However, the addition of only one simplex to a directed simplicial complex can cause the birth of several classes in directed homology, as shown in the previous example at δ = 2, and also in the following example.
Figure 5.A filtration of the directed simplicial complex Z in Example 3.23 (Figure 3) and its associated undirected (bottom, left) and directed (bottom, right) 1-dimensional persistence barcodes.The shorter undirected bar (blue) is also directed, while the longer undirected bar (red) becomes directed at δ = 2.
A filtration of directed simplicial complexes and its associated undirected (bottom, left) and directed (bottom, right) 1-dimensional persistence barcodes.The shorter undirected bar (blue) is also directed, while the longer undirected bar (red) never becomes directed.
Example 4.10.Let T = {0, 1, 2, . . .} and consider the filtration of simplicial complexes (X δ ) δ∈T illustrated in Figure 2 in the Introduction, where X δ = X 3 for every δ ≥ 3. It is clear that Z Dir 1 (X j , R) is trivial for j = 0, 1, 2, whereas undirected cycles appear as early as X 1 .However, by adding the edge from v 5 to v 1 , several directed cycles are born at once.Namely, Straightforward computations show that H 1 (X 3 , R) = R 4 , and four of the cycles above are linearly independent, thus . Consequently, at δ = 3 every class (including the birthing one) becomes directed.
Our last example shows an undirected homology class that never becomes directed.
Example 4.11.Let T = {0, 1, 2, . . .} and consider the filtration of simplicial complexes (X δ ) δ∈T illustrated in Figure 6, where X δ = X 2 for δ ≥ 2. Clearly, Z Dir 1 (X j , R) = {0} for j = 0, 1, whereas The undirected class represented by this element is thus directed, but there is a linearly independent class in undirected homology, , which never becomes directed.Its bar in the barcode is thus unmatched.4.2.Directed persistent homology of dissimilarity functions.In this section, we introduce the undirected and directed persistence diagrams and barcodes associated to dissimilarity functions (Definition 4.13) and prove their stability with respect to the bottleneck distance (Theorem 4. 19).
Let us begin by introducing the directed Rips filtration of directed simplicial complexes associated to a dissimilarity function, [25,Definition 16].Definition 4.12.Let (V, d V ) be a dissimilarity function.The directed Rips filtration of (V, Let us now introduce the persistent homology modules associated to such a filtration.Assume that R ∈ {Q, R}.Definition 4.13.Let (V, d V ) be a dissimilarity function and consider its associated directed Rips filtration R Dir (V, d V ) δ∈R .For each n ≥ 0, the n-dimensional undirected persistence R-module of (V, d V ) is Remark 4.14.The persistence module H n (V, d V ) associated to the directed Rips filtration of (V, d V ) is precisely the persistence module studied in [25, Section 5], hence the remarks made there hold for the undirected persistence module.In particular, if is the (classical) Vietoris-Rips filtration of (V, d V ).Furthermore, in this case, it can easily be seen that . Thus, these persistence modules generalise the persistence modules associated to the Vietoris-Rips filtration of a metric space.Also note that R Dir (V, d V ) is closed under adjacent repeats, [25,Definition 18].Namely, given (v 0 , v 1 , . . ., v n ) ∈ R Dir (V, d V ) δ , (v 0 , v 1 , . . ., v i , v i , . . ., v n ) ∈ R Dir (V, d V ) δ , for any i = 0, 1, . . ., n.Using this, it can be proven that the homology of this object must be trivial in dimensions larger than |V | + 1.
As R is a field and since V is finite, both of these persistence modules fulfil the assumptions in Section 2.1.Namely, their indexing sets can be chosen to be finite, corresponding to the threshold values where new simplices are added to the simplicial complex.Furthermore, no simplex is added to the filtration until the threshold value reaches the minimum of the images of the dissimilarity function.Finally, and even though the directed simplicial complex R Dir (V, d V ) δ may have infinite simplices due to arbitrary repetitions of vertices being allowed, it always has a finite number of simplices in a given dimension n, thus its n-dimensional homology is always finite-dimensional.As a consequence, we can introduce the following.Of course, Proposition 4.7 holds for these barcodes, namely, every bar in Pers Dir n (V, d V ) can be uniquely matched with one in Pers n (V, d V ) which dies at the same time, although the directed bar may be born later.
We now use results from Section 2.2 to show that both these persistent homology constructions are stable.The proof is split in several lemmas.Let (V, d V ) and (W, d W ) be two dissimilarity functions on respective sets V and W and define η = 2d CD (V, d V ), (W, d W ) , where d CD is the correspondence distortion distance (Definition 2.9).By Proposition 2.11, we can find maps ϕ : V → W and ψ : W → V such that dis(ϕ), dis(ψ), codis(ϕ, ψ), codis(ψ, ϕ) ≤ η.To simplify notation in the proofs below, denote R Dir (V, d V ) δ = X δ V and R Dir (W, d W ) δ = X δ W , for all δ ∈ R.
The following are commutative diagrams of morphisms of directed simplicial complexes: Proof.We prove that the first diagram is commutative (the proof for the second diagram is analogous).18.With the same notation as in Lemmas 4.16 and 4.17, for every δ ∈ R, the following diagrams of morphisms of directed simplicial complexes induce commutative diagrams on homology.
Proof.Again, we only prove the result for the first diagram, as the proof for the second diagram is analogous.We show that it is commutative up to homotopy by showing that the maps i δ+2η δ and ψ δ+η • ϕ δ satisfy the hypothesis of Lemma 3.14.
We now have everything we need to prove the stability results.Theorem 4.19.Let R ∈ {Q, R}.Let (V, d V ) and (W, d W ) be two dissimilarity functions on finite sets V and W .Then, for all n ≥ 0, . By Theorem 2.7, it suffices to show that the persistence modules H n (V, d V ) and H n (W, d W ) (respectively H Dir n (V, d V ) and H Dir n (W, d W )) are η-interleaved.Comparing Definition 2.5 (for ε = η) and Lemmas 4.16, 4.17 and 4.18, the result follows by using the functoriality of homology and, in the directed case, Proposition 3.11.
Remark 4.20.Recall from Remark 4.14 that the persistence module H n (V, d V ) associated to the directed Rips filtration of (V, d V ) is the persistence module studied in [25, Section 5].Thus, the remarks made in [25, Section 5.2] hold for these persistence modules, meaning that a result analogous to Theorem 4.19 would not hold if we were using ordered-set complexes instead of directed simplicial complexes, as mentioned at the beginning of Section 3.This justifies our definition of directed simplicial complex (Definition 3.1).

Computational challenges
Let (V, d V ) be a dissimilarity function in a finite set V .In this section, we study the algorithmic aspects of computing both H n (V, d V ) and H Dir n (V, d V ).For simplicity, we assume that R = R.The computation of the persistence barcodes for the undirected persistent homology H n (V, d V ) can be made using the Standard Algorithm [9,26], which also applies to ordered simplicial complexes.Write R Dir (V, d V ) δ = X δ V , δ ∈ R for the directed Rips filtration (Definition 4.12).As V is finite, the number of simplices in X δ V up to dimension n + 1 is finite, say N .We can list them {σ 1 , σ 2 , . . ., σ N } in such a way that i < j if σ i is a (proper) face of σ j , or if σ j appears 'later' in the filtration, thus having a compatible ordering.Then, we can represent the differential using a sparse N × N matrix M over R, where the (i, j)-entry M ij is the coefficient of σ j in the differential of σ i .Such matrix M is an upper-triangular matrix.At this stage, the Standard Algorithm can be used to compute Dgm k (V, d V ) by reducing M at once using column operations.
We cannot directly adapt the Standard Algorithm to compute Dgm Dir k (V, d V ): we can try to find reduction operations that generate directed cycles using operations with positive coefficients only, but this is not enough to guarantee that we find all the possible directed cycles.For instance, once one column has been eliminated, we may be preventing the participation of the simplex it represents in directed cycles not involving the columns we are using in the elimination.To avoid such a problem, we would need to keep track of every possible way in which column eliminations can be produced using only positive coefficients.This is very similar to the double description algorithm for the computation of extreme rays of a polyhedral cone [12,16].Indeed, the directed cycles Z Dir n (X, R) are the non-negative solutions to the linear equation M x = 0, that is, (5.1) where a vector x = (x 1 , x 2 , . . ., x N ) ∈ R N represents the cycle N i=1 x i σ i , M is the matrix corresponding to the differential, and x ≥ 0 means that every entry in x is non-negative, that is, x i ≥ 0 for all i.Equivalently, directed cycles are the extreme rays of the unbounded polyhedral cone consisting of the intersection of the solution space to the linear system M x = 0 with the first quadrant of R N .The enumeration of the extreme rays (generators of the solution set) of a polyhedral cone such as Eq.(5.1) is a well-known albeit hard problem in computational geometry.Several algorithms, including the double description algorithm, and modifications thereof, exist [24].
Note, however, that we do not require the computation of all the directed cycles.Indeed, it would be enough to calculate them up to homology, which suggests that efficient computations may be possible.
In summary, although important challenges remain on the computation of the persistence diagrams associated to directed persistence modules, our objective was to provide the necessary groundwork for the study of directed persistent homology of asymmetric data sets, and we are hopeful that we are opening up an exciting new approach for future research into the topological properties of asymmetric data sets.
If B is a subsemimodule of a Λ-semimodule A, then it determines a Λ-congruence ∼ B by setting a ∼ B a ′ if there exist b, b ′ ∈ B such that a + b = a ′ + b ′ .Classes in this quotient are denoted a/B, and the factor semimodule is denoted A/B.If Λ is a ring, this is just the usual quotient module of A by B.
Example A.5.The following are examples of factor semimodules.
• If Λ is a ring and B ≤ A are Λ-modules, the factor semimodule A/B is the usual module quotient of A by B.
It is immediate to show that ρ is a N-congruence, and the factor semimodule (N × N)/ρ is isomorphic to Z. Indeed, consider the map y shows that it is well-defined and injective, and it is clearly surjective.
Clearly, if Λ is a semiring then it is a Λ-semimodule over itself.The idea of free Λ-semimodules comes about naturally just as in the case of rings, and we will make extensive use of these objects.
Definition A.6.Let Λ be a semiring, A a left Λ-semimodule and V = {v 1 , v 2 , . . ., v n } a finite subset of A. The set V is a generating set for A if every element in A is a linear combination of elements of V .The rank of a Λ-semimodule A, denoted rank(A), is the least n for which there is a set of generators of A with cardinality n, or infinity, if not such n exists.
The set V is linearly independent if for any λ 1 , λ 2 , . . ., λ n ∈ Λ and µ 1 , µ 2 , . . ., µ n ∈ Λ such that n i=1 λ i v i = n i=1 µ i v i , then λ i = µ i , for i = 1, 2, . . ., n, and it is called linearly dependent otherwise.We call V is a basis of A if it is a linearly independent generating set of A.
Remark A.7.It is easy to check that free Λ-semimodules over a cancellative semiring Λ are themselves cancellative, as are subsemimodules of cancellative Λ-semimodules.The quotient of a cancellative Λ-semimodule over any of its subsemimodules is also cancellative, see [13,Proposition 15.24].
Note that if Λ is a ring, free Λ-semimodules are just free Λ-modules.Thus, as not every module over a ring is free, clearly not every Λ-semimodule is free.On the other hand, Λ n (the direct sum, or product, of n copies of Λ) is clearly a free Λ-semimodule, for every n ≥ 1.Another key property is that if A is a free Λ-semimodule with basis V and B is another Λ-semimodule, each map V → B uniquely extends to a Λ-homomorphism A → B, see [13,Proposition 17.12].
Remark A.8.If Λ is a commutative semiring and A is a Λ-semimodule admitting a finite basis, every basis has the same cardinality, which coincides with the rank of A, [23,Theorem 3.4].In fact, for every integer n > 0, every finitely generated subsemimodule of N n has a unique basis, whereas basis for semimodules of (R + ) n are unique up to non-zero multiples, see e.g.[15,Theorem 2.1].
We finish this section by extending the Grothendieck construction from abelian monoids to semirings and semimodules.Definition A.9. Let M be an abelian monoid.Consider the congruence relation ρ in M × M defined as (u, v) ∼ ρ (x, y) ⇔ there exists z ∈ M such that u + y + z = v + x + z.
Let [u, v] denote the equivalence class of (u, v).Then M × M/ρ becomes a group with the componentwise addition.This group is called the Grothendieck group or group completion of M .There is a canonical homomorphism of monoids k M : M → K(M ) defined as k M (x) = [x, 0].If M is a cancellative monoid, then k M is injective.Given an element [u, v] ∈ K(M ) we can interpret u as its positive part and v as its negative part, and the relation ∼ becomes the obvious one.The identity element is then 0 = [x, x] for any element x ∈ M , and the inverse of [x, y] is [y, x] for any x, y ∈ M .
If f : M → N is a morphism of monoids, there is a morphism of groups K(f ) : K(M ) → K(N ) that takes [u, v] to [f (u), f (v)].In fact, K is a functor from the category of abelian monoids to the category of abelian groups.Furthermore, K(f As shown in Example A.5, K(N) ∼ = Z.Similarly, one can show that K(R + ) ∼ = R. Crucially for us, this construction can be extended to semirings and semimodules.
Definition A.10.Let Λ be a semiring.The group completion K(Λ) becomes a ring with the operation [x 1 , x 2 ] • [y 1 , y 2 ] = [x 1 y 1 + x 2 y 2 , x 2 y 1 + x 1 y 2 ], and k Λ : Λ → K(Λ) is in fact a morphism of semirings, which is injective if Λ is cancellative.We call K(Λ) the ring completion of Λ.If f : Λ → Λ ′ is a morphism of semirings, the map K(f ) : K(Λ) → K(Λ ′ ) as introduced in Definition A.9 is a morphism of rings, and K is a functor from the category of semirings to the category of rings.
A.2. Chain complexes of semimodules.Now that we have introduced the necessary algebraic structures, we move on to chain complexes of semimodules over semirings, following [20].This theory is a natural generalisation of the classical theory of chain complexes of modules and, in fact, they give rise to the same cycles, boundaries and homologies when the semimodules are modules over a ring.
In order to introduce chain complexes in the context of semimodules an immediate problem arises: alternating sums cannot be defined as elements in a semimodule may not have inverses.The solution is to use two maps, a positive and negative part, for the differentials.
The following result will become useful later on, so we recorded it here.
Proof.Take n ≥ 0 an integer.By definition, C n X, K(Λ) is the free K(Λ)-module over the elementary n-chains [x 0 , x 1 , . . ., x n ].Similarly, K C n (X, Λ) is a free K(Λ)-module with a basis given by the elements [x 0 , x 1 , . . ., x n ], 0 where [x 0 , x 1 , . . ., x n ] is an elementary n-chain.Consider the K(Λ)-morphisms A.4. Functoriality of semiring homology.In this section, we prove that homology is a functor from the category of directed simplicial complexes to the category of graded Λ-semimodules.We also show that two morphisms allowing for the construction of the prism operator must induce the same map on homology, a result we will need to prove our persistent homology stability result.Recall the definition of morphism of directed simplicial complexes, Definition 3.8.Corollary A.30. Homology is a functor from the category of directed simplicial complexes to the category of graded Λ-semimodules.In particular, isomorphic directed simplicial complexes have isomorphic homologies.Note further that when Λ is a ring, the homology functor is precisely the functor introduced in Section 3.2.
We finish this section by showing a sufficient condition for two morphisms to induce the same map on homology.We will need this result to prove that our definition of persistent homology is stable.

Figure 4 .
Figure 4.A directed simplicial complex with just two vertices can have a non-trivial 1-cycle.

Definition 4 . 15 .
Let (V, d V ) be a dissimilarity function.For each n ≥ 0, the n-dimensional persistence diagrams associated to the persistence R-modules H n (V, d V ) and H Dir n (V, d V ) are respectively denoted by Dgm n (V, d V ) and Dgm Dir n (V, d V ).Similarly, their associated persistence barcodes are denoted by Pers n (V, d V ) and Pers Dir n (V, d V ).