Relative-perfectness of discrete gradient vector fields and multi-parameter persistent homology

The combination of persistent homology and discrete Morse theory has proven very effective in visualizing and analyzing big and heterogeneous data. Indeed, topology provides computable and coarse summaries of data independently from specific coordinate systems and does so robustly to noise. Moreover, the geometric content of a discrete gradient vector field is very useful for visualization purposes. The specific case of multivariate data still demands for further investigations, on the one hand, for computational reasons, it is important to reduce the necessary amount of data to be processed. On the other hand, for analysis reasons, the multivariate case requires the detection and interpretation of the possible interdepedance among data components. To this end, in this paper we introduce and study a notion of perfectness for discrete gradient vector fields with respect to multi-parameter persistent homology, called relative-perfectness. As a natural generalization of usual perfectness in Morse theory for homology, relative-perfectness entails having the least number of critical cells relevant for multi-parameter persistence. As a first contribution, we support our definition of relative-perfectness by generalizing Morse inequalities to the filtration structure where homology groups involved are relative with respect to subsequent sublevel sets. In order to allow for an interpretation of critical cells in $2$-parameter persistence, our second contribution consists of two inequalities bounding Betti tables of persistence modules from above and below, via the number of critical cells. Our last result is the proof that existing algorithms based on local homotopy expansions allow for efficient computability over simplicial complexes up to dimension $2$.


Introduction
In recent years, the impressive growth of data and their heterogeneity has increased the demand for new ways of visualizing and analyzing data. To this purpose, many techniques rooted in shape analysis have turned out to be successful, in particular those based on topology [16].
Topology-based techniques. Most of topology-based techniques find their theoretical roots in the interplay between homology and critical points of functions as provided by Morse Theory [24]. Homology is an algebraic theory to detect topological features of a domain such as connected components, loops, cavities and higher-dimensional holes, each counted by its corresponding Betti number. Morse Theory establishes a link between critical points and Betti numbers.
In particular, weak Morse inequalities state that the number of critical points of functions, called Morse functions, bound from above the Betti numbers of the domain. In case of equality, the Morse function is called a perfect function as the critical points of such function provide an optimal bound for the Betti numbers of that domain. Not all domains admit a perfect function. Only in a few cases, such as for PL triangulated -spheres [11], the existence of a perfect function is guaranteed. This explains why tighter properties or low dimensions are usually assumed on the domain in order to ensure perfectness.
In the context of visual analytics and data analysis, the above mentioned interplay has produced successful strategies. In the former case, Morse Theory is exploited in topological consistent segmentation techniques of scalar field domains: the key notion of a Morse complex associated to a discrete gradient vector field, where integral lines connect critical points, provides a simplified representations [9]. In the latter case, the demand for meaningful concise representations of heterogeneous data motivates Topological Data Analysis -TDA [4]. In the pipeline of TDA, one starts from a point cloud representing data with unknown structure. Some combinatorial shape is associated to the point cloud, e.g., a simplicial complex. Such simplicial complex is filtered by a nested sequence of complexes, called a filtration, e.g., by taking sublevel sets with respect to some measurements on data. Persistent homology [10] gives a representation of homological changes along the filtration. The signature thus obtained as data summary is called a persistence diagram.
Interplay between persistent homology and Morse theory. In order to relate persistent homology to Morse theory, it is usual to resort to the Forman's discrete counterpart to Morse theory [14]. The crucial observation is that birth-death values in a persistence diagram correspond to pairings of critical cells with respect to a discrete gradient vector field which is somehow "consistent" with persistence in the sense that persistent homology is preserved in the associated Morse complex. On the one hand, this property is used as a data-driven way of removing noise, for instance in 3Dscalar field visualization [13] to remove low persistence critical pairs via cancellations [14]. On the other hand, discrete Morse theory provides a preprocessing tool to reduce the amount of data on which to compute persistent homology by retaining the meaningful information in terms of critical cells [25]. In this sense, by considering only those critical cells corresponding to births and deaths of persistence, one can consider the associated Morse complex being optimal. For instance, the advantage of the algorithm in [26] over the one in [19] is that it retrieves all and only the critical cells that correspond to births and deaths in persistence, at least for complexes of up to dimension 2 if simplicial, and embedded in the 3D-Euclidean space if cubical. Here, the dimensional bound for simplicial complexes or the Euclidean embedding for cubical complexes exclude some shapes known not to admit perfect functions (such as the "dunce hat" shown in Fig. 5). Making this notion of optimality explicit in a way generalizable to the case of multivariate data is one of the aims of this paper.
Interpreting and analyzing multivariate data. Nowadays, one of the greatest challenges in visual analytics and data analysis consists in representing and interpreting multivariate data, that is data measured by multiple filtering functions or directly given in the form of vector fields, such as simulations based on models with partial differential equations, e.g., computational fluid dynamics, electromagnetic fields, or weather forecasts. However, multivariate data are often too large to be processed and their entire information is typically not derivable from methods independently acting on single components.
In this work, we address the problem of detecting the most significant piece of hidden information in multivariate data, and we try to give theoretical insights to the problem of capturing the interdependence among component values stated in [18]. An example of Morse-based techniques applied to visual analytics over multivariate data is provided in [17]. Therein, a discrete gradient vector field simultaneously consistent with two scalar fields (temperature and pressure) is applied to segment the Hurricane Isabel dataset: the hurricane's eye is detected as the largest cluster of critical cells of the gradient vector field. In general, not all discrete gradient vector fields need to have the same amount of critical cells. This motivates us in investigating minimality in terms of number of cells. To address that, our strategy consists in generalizing to the multi-parameter case the perfectness-optimality properties derived from the interplay between (persistent) homology computation and discrete Morse Theory. All along the paper, the case of vectorial data or multiple measures will be called multi-parameter case as opposed to the one-parameter case of scalar field data and single measures.
Multi-parameter Persistent Homology -MPH [5] is a natural generalization of the usual one-parameter persistent homology where the application of homology to a multi-parameter filtration provides a multi-parameter persistence module. The multi-parameter case is much more complex than the one-parameter one in terms of both encoding of information and computability [3]. Unfortunately, a multi-parameter counterpart to (discrete) Morse theory is only partially developed in [2]. However, some analogies still hold. these analogies to the one-parameter case are related to the possibility of computing discrete gradient vector fields being consistent with a multifiltration, meaning by that, that the associated Morse complex preserves the MPH information. Motivated by this fact, the algorithms [1,2,17] retrieve a discrete gradient vector field consistent with a multi-filtration. The Morse-based reduction preprocessing for computing MPH invariants is shown to be effective in [27].
The construction of such gradient vector field is efficiently achieved, actually in linear time in [17] and [2] whenever the worst-case size of a cell star is negligible with respect to the whole complex size. The algorithm in [17] improves that in [2] in terms of speed but it is equivalent to it in terms of retrieved critical cells [27]. However, even for these algorithms, the question about whether they retrieve the minimum, also known as optimal, number of critical cells necessary to get the same persistence modules was left as an open problem. In contrast, as mentioned above, it was answered positively, at least in low dimensions, for one-parameter filtrations in [26].
Having the guarantee from the above mentioned papers that discrete gradient vector fields consistent with given multi-filtrations can be easily constructed, it is now of key interest to understand whether it is possible to achieve the minimum number of critical cells while preserving persistent homology. In order to answer to this question, it is convenient to develop an analogue for multi-parameter persistent homology of the well-known standard Morse inequalities that relate the number of critical cells of a discrete gradient vector field to the Betti numbers of the underlying cell complex.
Contributions. As a first contribution of this paper, we show that an analogue for multi-parameter persistent homology of the well-known standard Morse inequalities can be obtained by replacing Betti numbers by a sort of relative Betti numbers defined using the dimension of the relative homology of subsequent sublevel sets. Therefore, by analogy with usual perfectness in Morse theory [23], we define relative-perfectness as the property of attaining an equality between its critical cells and such relative Betti numbers. This provides a new optimality criterion for any algorithm retrieving a discrete gradient vector field compatible with a multi-filtration.
We observe that for one-parameter filtrations, relative-perfectness simply means that each critical cell corresponds to a positive (i.e., giving birth) or negative (i.e., giving death) cell of exactly one persistence pair. This is the same property yielding optimality in [26]. To go a little bit further, it is crucial to ask what kind of information the critical cells can carry about the corresponding persistence modules. In the context of multi-parameter persistent homology, births and deaths are not paired in a single invariant like the persistence diagram, but separately detected by invariants known as Betti tables [12]. The zeroth Betti table 0 detects births and the first Betti table 1 detects deaths. For a bi-filtration there is also a second Betti table 2 . As observed in [20], births and deaths in multi-parameter persistent homology do not necessarily happen due to the entrance of "real" critical cells in the multi-filtration, but can also be ascribed to the appearance of "virtual" critical cells. The latter are detected by the second Betti table 2 . For a general multifiltration with -parameters there might be non-trivial 0 , . . . , Betti tables.
Our second contribution of this paper consists of inequalities showing that, for general discrete gradients consistent with a bi-filtration, the number of critical cells bounds from above a linear combination of values from Betti tables thus providing an estimation of the latter ones. In addition, in the case when the gradient vector field is relative-perfect, we can even deduce double inequalities with the number of critical cells bounding from below the number of births and deaths captured by 0 and 1 , up to those due to "virtual" cells captured by 2 .
Since one of our inequalities holds under the relative-perfectness assumption, as a last contribution, we prove that relative-perfectness for multi-filtrations can be actually achieved by algorithms [2] [17], at least in the case of simplicial complex domains of dimension 2. Analogously to the one-parameter case, in [26] this can be seen as an optimality property among all consistent discrete gradients.
Organization of the paper. In Section 2, we review the technical tools for this paper: combinatorial cell complexes and their homology, filtrations and persistent homology, Betti tables of persistence modules, combinatorial Morse theory. We conclude the section illustrating some known connections between persistent homology and discrete Morse theory. In Section 3, we introduce the notions of multi-parameter Morse numbers and relative-perfectness for a discrete gradient vector field consistent with a multi-filtration and show, through their mutual relations, the link to the optimality notion. We also show the consistency of the new definitions with known results, in the case of one-parameter persistent homology, precisely connecting Morse numbers and births and deaths instants. In Section 4, we extend such connection to the case of bi-filtrations showing the relation between Morse numbers and Betti tables for relative-perfect gradient vector fields. In Section 5, we prove that for simplicial complexes of dimension 2 any generic assignment on the vertices permits the algorithmic construction of such relative-perfect gradient vector fields. Section 6 contains a brief discussion on potentialities of these results and open questions.

Cell complexes and their homology
Intuitively, cell complexes are objects that can be decomposed into elementary pieces with simple topology, known as cells, and glued together along their boundaries, themselves decomposed into faces. In this paper we describe cell complexes following the combinatorial framework of Lefschetz [21]. Such abstraction turns out useful to describe the discrete Morse complex and its homology.
By a cell complex we mean a finite set , whose elements are called cells, with a gradation , ∈ Z, and an incidence function : × → F over a field F, such that: ( ) = ∅ for < 0, ( ) for every cell ∈ there exists a unique number , called the dimension of and denoted dim , such that ∈ , ( ) ( , ) ≠ 0 implies dim = dim + 1, ( ) for each and in , ∈ ( , ) · ( , ) = 0. The dimension of a cell complex is the maximal dimension of its cells. The nine shapes in Fig. 1 are examples of cell complexes whose dimensions range from 0 to 2.
A facet of in is a cell such that ( , ) ≠ 0. Reciprocally, is a cofacet of . Moreover, is a face of and is a coface of if there is a sequence of cells ordered by the facet relation starting with and ending with . A subcomplex of is a subset of such that the restriction of the incidence function to × turns into a cell complex.
Simplicial complexes are an important class of cell complexes whose cells and face relations admit a fully combinatorial treatment. The cells of dimension ≥ 0 in a simplicial complex are called -simplices. Points, edges, triangles and tetrahedra correspond to -simplices with equal to 0, 1, 2, and 3, respectively. Assume a total ordering of 0 is given and every simplex in is coded as describes the incidence relations among simplices. For a cell complex and for all ∈ Z, we let ( ) be the vector space generated by over F. We define a linear map called the boundary operator : ( ) −→ −1 ( ) by setting The pair ( * ( ), * ) is by definition the chain complex of . We define the homology of as the homology of its chain complex: ( ) = ker( )/im( +1 ), where, as usual, for any linear map ℎ, the notations ker(ℎ), im(ℎ) and coker(ℎ) denote the kernel, the image, and the cokernel of ℎ respectively, and we will make use of it all along the paper.
In the case of a simplicial complex one obtains the usual simplicial homology. The dimension of the vector space ( ) is often denoted by ( ), and called the th Betti number of . Betti numbers reveal topological features such as the number of holes of the cell complex. In particular, 0 , 1 , 2 are the number of connected components, tunnels, and voids, respectively.
In what follows we will be interested in applying homology to increasing families of subcomplexes in order to turn homology into a tool for analyzing cell complexes at multiple scales.

Multi-filtrations and multi-parameter persistent homology
In its original setting, the persistent homology of a cell complex is defined as the homology of a nested family of subcomplexes parameterized by a single index. Nevertheless, generalizations have been proposed which originate from different choices of the set of parameters. In this paper we will be interested in considering families of nested subcomplexes depending on ≥ 1 integer parameters. For every = ( ), = ( ) ∈ Z , we write if and only if ≤ for 1 ≤ ≤ . To specify that and < for some index , we also write .
An -filtration (generally speaking, a multi-filtration) of a cell complex is a family K = { } ∈Z such that is a subcomplex of whenever , = ∅ for 0, and = whenever is sufficiently large. The value of the parameter will be called the filtration grade.
A multi-filtration of a cell complex is said to be one-critical if, for every ∈ , there exists one and only one filtration grade ∈ Z such that ∈ − =1 − , with 1 , 2 , . . . , denoting the standard basis of Z , where indicates the element of Z with all entries equal 0 except for the th entry equal 1. Throughout this paper we will always assume multi-filtrations to be one-critical, thus dropping the term one-critical for brevity. Moreover, we often refer to a multi-filtration as a multi-filtered complex.
Applying homology to a multi-filtered cell complex now yields multi-parameter persistent homology. Denoting by (·) the th homology functor, for any -filtration K = { } ∈Z of a cell complex, we obtain theparameter (generally speaking, multi-parameter) persistence module

by the inclusion maps
↩→ . An example of -filtration with = 2 together with its persistence module for the homology degree = 0 is shown in Fig. 1. Fig. 1 On the left, a 2-filtered simplicial complex K. By applying homology in degree 0 to K, the persistence module V is shown in the middle. For each filtration grade, the corresponding F-vector space is represented by the span of its generators, one for each connected component. The inclusion maps between subsequent cell complexes in the 2-filtered complex correspond to linear maps between vector spaces in the persistence module, which can be represented as matrices with respect to the chosen generators. On the right, we show the Betti tables with = 0, 1, 2 are depicted. From top to bottom respectively, the non-null values capture the multigrades in the filtration with new born homology classes ( 0 ), deaths of homology classes ( 1 ), and relations among previously independent deaths of homology classes ( 2 ).
The rank of linear maps , provides a continuously parameterized family of Betti numbers ( , ), called persistent Betti numbers [7] or rank invariant [5], giving the number of -holes in that persist at least from to along the filtration. When = 1, we obtain persistence intervals with endpoints < . A maximal interval with endpoints < signals that at grade a -cell , therefore called a positive cell, enters into the filtration creating a new class in ( ) that did not exist in ( −1 ), while at grade a ( + 1)-cell , therefore called a negative cell, enters into the filtration killing the class created by .
From a different perspective, as observed in [5], the instants when a homology class is created or destroyed along a multi-parameter filtration are captured by Betti tables of the persistence modules seen as graded modules over a polynomial ring. More precisely, for V a finitely presented -parameter persistence module, the th multi-graded Betti table of V, with ≥ 0, is a function V : Z → N defined by with the polynomial ring F[ 1 , 2 , . . . , ]. By the Hilbert's Syzygy Theorem, V is identically 0 for > , and so we obtain a finite family of discrete invariants V 0 , V 1 , . . . , V : Z → N.
In order to go through computations of Betti tables, we can consider the Koszul complex [30] whose homologies, in any degree, are the same that define the Betti tables of V. The relation with the Koszul complex is a convenient one for computing Betti tables. At the same time, the link between the two notions when V is a persistence module provides a useful way of visualizing algebraic invariants. Indeed, Betti tables capture relations among homological features: we have non-zero values at multigrades where, either new connected components are born ( V 0 ), or connected components die ( V 1 ), or previously independent deaths get related ( V 2 ), and so on (See Fig. 1). In particular: in the case = 1, for each grade , the Koszul complex is given by the chain complex whose homology gives the following formulas for the Betti tables of V: -In the case = 2, setting = − 1 , = − 2 , and = − 1 − 2 for each multigrade , the Koszul complex is given by the chain complex with the linear maps spl V and mrg V defined to combine the persistence module linear maps , . Intuitively, as by one-criticality = ∩ , the map spl V ) comes from mapping elements of the intersection ∩ separately into and (hence, the word split), whereas the map mrg V ) comes from mapping a pair of elements that live separately in and into that contains both (hence the word merge). The homology of the Koszul complex gives the following formulas for the Betti tables of V: In the rest of the paper, when V = { ( ), , }, we will write in place of V .

Perfectness of discrete gradient vector fields
Many of the familiar results from smooth Morse theory [24] apply also in the combinatorial setting. In this section, we restrict ourselves to consider only chain complexes of over F = Z/2Z. Following [14], a discrete vector is a pair of cells ( , ) of × with a facet of . A discrete vector field is a set of discrete vectors of inducing a partition on the cells of into three disjoint sets , , such that is the set of unpaired cells, called critical cells, is the set of cells paired to a cofacet, is the set of cells paired to a facet, and there is a bĳection between and .
A -path connecting two cells and is a sequence is a discrete vector of , and +1 is a facet of . If = 0 , the -path is said to be closed, and if = 1, the -path is said to be trivial. A discrete vector field not containing any non-trivial closed -path is called a discrete gradient vector field. An example of discrete gradient vector field is shown in Fig. 2 (left).
For any pair ( , ) ∈ × of critical cells of a discrete gradient vector field , there is a separatrix from to if is a cofacet of or has a facet connected to through a -path. The parity of the number of such separatrices defines the value of an incidence function : × → Z/2Z. The critical set together with the incidence function form a cell complex called the discrete Morse complex of . As in smooth Morse theory, the discrete Morse complex and the original cell complex have isomorphic homology. Moreover, the number of -dimensional critical cells Middle: a discrete gradient vector field on . Each arrow is from a -simplex, say , to a ( + 1)-simplex, say , that contains as a face, and is used to visualize the discrete vector ( , ) in . A critical cell is a simplex from which no arrow starts and no arrow ends. Here, is consistent with since all discrete vectors involve simplices having the same function value under but not relative-perfect. Right: a discrete gradient vector field on consistent with that is also relative-perfect. The two critical vertexes correspond to new born connected component and the critical edge correspond to the death of one connected component.
of , called the th Morse number and denoted by ( ), bounds the th Betti number of , i.e. the following Morse inequalities hold: for any ≥ 0, Ideally, we would like the Morse inequalities to be equalities, but it usually is not so. If that is the case we speak of a perfect gradient vector field. Some cell complexes (e.g., the dunce hat and the Bing's house) do not admit a perfect discrete Morse gradient. Some complexes admit a perfect discrete Morse gradient depending on the choice of coefficients. As reviewed in [29], every sphere of dimension > 4 has a triangulation which does not admit a perfect discrete Morse function. On the other hand, it is easy to see that every 1-dimensional cell complex (i.e. graph) has a perfect discrete Morse function, and every 2-dimensional subcomplex of a 2-manifold has a Z 2 -perfect discrete Morse function.
The rest of the paper will be devoted to study the analogue of perfectness for a discrete gradient vector field consistent with a multi-filtration.

Consistency of discrete gradient vector fields with multi-filtrations
We are interested in discrete gradient vector fields consistent with multi-filtrations as studied in [1].

Definition 1 A discrete gradient vector field on a cell complex is consistent with a multi-filtration
if and only if ∈ .
As an example, the discrete gradient vector field on the left of Fig. 2 is consistent with the sublevel set filtration induced by the function illustrated on the right.
Consistency of with a multi-filtration is interesting because it ensures that persistence modules are preserved. Indeed, if is a discrete gradient vector field on a cell complex consistent with the multi-filtration K = { } ∈Z , and is the discrete Morse complex of , letting M = { } ∈Z be the multi-filtration inherited from K, the restriction of the incidence function of to × yields a cell complex for every filtration grade ∈ Z . Moreover, for every ≥ 0 and every ∈ Z , there is an isomorphism : commutes for every ∈ Z .  [2,5] is found critical at line 24; (d) edge [3,5] is paired to triangle [2,3,5] at line 17; (e) edge [4,5] is paired to triangle [3,4,5] at line 17; (f) the discrete gradient vector field retrieved by HomotopyExpansion.

Retrieval of consistent discrete gradient fields
The retrieval of discrete gradient vector fields consistent with suitable -filtrations is guaranteed by algorithms such as ProcessLowerStars [26] when = 1 , and Matching [2], or equivalently ComputeDiscreteGradient [17], when ≥ 1.
In order to apply such algorithms, the multi-filtration needs to be constructed as follows. Assuming to be a simplicial complex, first a function 0 : 0 → Z is given on the vertices of with the property of being componentwise injective. Next, 0 is extended to the whole by setting = ( ) : → Z , ( ) = max{ ( ) : is a facet of }. Finally, the multi-filtration K = { } ∈Z is defined by sublevel sets = { ∈ : ( ) }.
The requirement for 0 to have injective components is not very restrictive as it can be achieved by arbitrarily small perturbations. The extension of the values of the function to other simplices using the max is quite natural in view of the results of [6] showing that this reflects multi-parameter interpolation from the vertices in the discrete case. Moreover, multi-filtration is one-critical.
All the above-mentioned algorithms are based on a common subroutine acting locally on lower stars. We call this subroutine HomotopyExpansion and we report its pseudocode in Appendix A. For every cell in , its lower star is defined as the set of all the cofaces of in on which the function takes a value smaller or equal than that on itself: ( ) = { ∈ : is a face of s.t. ( ) ( )}.
While for = 1 it is sufficient to run HomotopyExpansion on lower stars of each vertex, for > 1, it needs to be run on lower stars of minimal simplices of any dimension contained in level sets of , with minimality taken with respect to the facet relation.
In the following sections, after extending the concept of perfectness to discrete gradient fields consistent with multi-filtration, we will prove that the discrete gradient fields retrieved by such algorithms are relative-perfect, at least when dim ≤ 2.

Relative-perfect discrete gradient vector fields
In this section, we introduce a notion of perfectness of gradient vector fields for (multi-parameter) persistent homology (Definition 3) as a generalization of the notion for the case of standard homology. In order to support our approach, Proposition 1 relates relative homology with the number of critical cells. Moreover, in Proposition 2 and Proposition 3 we show the meaning of relative-perfectness in the case of 1-parameter persistent homology, and the differences between the 1-and the multi-parameter cases.
We start with an analogue for the usual Morse inequalities (3) in the persistence setting. We assume to be a discrete gradient vector field consistent with a multi-filtration K = { } ∈ of a cell complex , and the discrete Morse complex of . Recall that we always assume multi-filtrations to be one-critical. We first introduce the discrete Morse numbers for . Recall that we introduced in Section 2.2 the notation to indicate the -th element of the standard basis of Z . Because =1 − is a subcomplex of , we can consider the homology of the relative pair ( , =1 − ), and analogously for . They are related as follows.

Lemma 1 Let ⊆
be non-empty subsets of = {0, 1} . For each filtration grade ∈ Z , and each homology degree ∈ Z, there are isomorphisms :

whose horizontal maps are induced by inclusions, commute.
Proof With each non-empty subset of we associate the subcomplex ∈ − of . With = ∅, we associate − =1 . For ⊆ ⊆ , we have ∈ − ⊆ ∈ − . The inclusion of subsets of is a well-founded partial order relation.
For each ⊆ , we take the map to be the restrictions of the map of diagram (4) to ∈ − , so the considered diagrams commute. We now prove that the maps are isomorphisms. We prove the claim by well-founded induction on the relation ≤. If is the empty subset, the diagram in the claim coincides with that of (4) and so the claim is true. Let be a subset of and let us assume the claim is true for every ⊆ . By the inductive step the maps We now take the triples ( ∈ − , ∈ − , − ) and ( ∈ − , ∈ − , − ) with ⊆ ⊆ . As we have seen, their Mayer-Vietoris exact sequences are connected by maps that make the following diagram commute with and −1 isomorphisms. By the Five Lemma, we deduce that also is an isomorphism, proving the claim.

Lemma 2
For each filtration grade ∈ Z , and each homology degree ∈ Z, Proof Lemma 1 implies that the map : ( ∈ − ) → ( − ∈ ), with = { 1 , 2 , . . . , }, is an isomorphisms for any ∈ Z. Thus, we are in the position of applying the Five Lemma to the following long exact sequence of pairs: , proving the claim.

Proposition 1
For any homology degree ∈ Z, and any filtration grade ∈ Z , it holds that

Moreover, in order to have
, it is sufficient that the relative boundary map : ( Proof By definition, ( ) is equal to the number of -dimensional critical cells of in − =1 − . Therefore, is trivial for all ∈ Z, then ker( ) = ( , =1 − ) and im ( +1 ) = 0.
Thus, the claim follows by applying Lemma 2.
The inequality of Proposition 1 can be seen as a generalization of standard Morse equalities (3) for persistence modules, where homology needs to be replaced by relative homology. This motivates the following definition of relative-perfectness.

Definition 3
We say that is a relative-perfect discrete gradient vector field if for every ∈ Z.
An example of a relative-perfect discrete gradient compared to one that is only consistent with is shown in Fig. 2: for = (1, 2) and = 1, in the middle, we have a critical 1-simplex, thus 1 (1, 2) = 1. However, (1,2) is composed of the two vertexes with values (0, 1) and (1, 2) along with the critical 1-simplex whereas the union of all previous steps reduces to (0,1) . Hence, dim 1 ( , =1 − ) = 0 which is strictly less than 1 (1, 2) = 1; on the right, we see a relative-perfect discrete gradient with each of its critical simplices appearing at a multigrade where the relative homology is non-trivial.
A standard application of the rank-nullity formula to the long exact homology sequence of the pair ( , =1 − ) gives the following result. Proof Let us consider the long exact homological sequence of the pair ( , =1 − ): Because the sequence is exact, applying the rank-nullity dimension formula, we deduce that In other words, a discrete gradient vector field consistent with a multi-filtration is relative-perfect provided that each of its critical cells contributes either to the birth or to the death of a homology class: 1. dim coker( ) is the number of linearly independent -cycles in ( ) not coming from ( =1 − ); 2. dim ker( −1 ) is the number of linearly independent ( − 1)-cycles in −1 ( =1 − ) that become trivial in −1 ( ). For the case = 1, we have = −1, , that is the map induced by the inclusion of −1 into . Hence, also recalling Eq. (1), for = 1 our definition of relative-perfectness can be equivalently reformulated as follows.

Proposition 3 A discrete gradient vector field consistent with a 1-filtration K = { } ∈Z of a cell complex is relative-perfect if and only if each critical -cell of is either a positive or a negative cell. Equivalently, is relative-perfect if and only if
( ) = 0 ( ) + −1 1 ( ). The latter is precisely the property proved in [26] for the discrete gradient vector field retrieved by algorithm ProcessLowerStars when applied to 3D cubical grids endowed with 1-filtrations.
In the multi-parameter case, relative-perfectness still ensures that all critical cells correspond to births or deaths of homology classes. However, in this case new homology classes can be created even without adding new cells, as shown in Fig. 4. Thus, the idea of positive and negative cells is ineffective in the multi-parameter case, unless one introduces the idea of virtual cells as highlighted in [20]. Moreover in Fig. 4, one can also notice the dual situation where critical cells can be necessary to kill virtual homology classes that is classes simply coming from the union of previous steps and never appearing in the multi-filtration. Next section will make this idea precise in the case of two parameters.
We conclude the section noting that, contrary to usual perfectness, it is possible to have relative-perfect discrete gradient vector fields on the dunce hat, as shown in Fig. 5. In Section 2.5 we will show that this is always the case for simplicial complexes of dimension 2 endowed with filtrations induced by component-wise injective functions on the vertices.

Estimation of Betti tables via critical cells
In this section, we focus our attention on bi-filtrations, i.e. the case = 2. Our goal is to show that, for a discrete gradient vector field consistent with a bi-filtration, the number of critical cells gives bounds on the Betti tables values of the corresponding persistence module. Such bounds can be seen as a sort of Morse inequalities for persistent homology, generalizing the standard Morse inequalities (3) for homology. Such inequalities will shed new light on relative-perfectness.
In this section, we consider the persistence module V = {V , , } ∈Z with V = ( ) and , : ( ) → ( ) induced by the inclusion maps ↩→ , and assume that is equipped with a discrete gradient vector field consistent with the multi-filtration of . Moreover, in accordance with Eq. (2), for any ∈ Z 2 , we set = − 1 , = − 2 , and = − 1 − 2 . Our first step is to relate the dimensions of the kernel and cokernel of the linear maps : ( ∪ ) → ( ) induced by inclusions to the values in the Betti tables of the persistence module V.
As an immediate consequence of Proposition 1, we deduce the following result showing that the number of critical cells of a discrete gradient vector field may be used to estimate Betti tables of persistence modules at least for bi-filtrations.

Corollary 2
For any ∈ Z 2 and ∈ Z,

Moreover, if the gradient is relative-perfect, then it also holds
We may interpret Corollary 2 as a generalization of Proposition 2 to the bi-filtration case, taking care of the possible presence of virtual cells as discussed after Proposition 3. This is achieved by adding the term relative to the second Betti table 2 .
Inequalities in Corollary 2 are sharp. To see that the first inequality can be an equality, we take = 1, the simplicial complex of dimension 1 with four vertices , , , and four edges

Retrieval of relative-perfect discrete gradient vector fields
Throughout this section we assume to be a simplicial complex of dimension at most 2, filtered by the sublevel sets of the extension of a component-wise injective function defined on the vertices of as described in Section 2.5.
Our goal is to prove that, under such assumptions, there always exists a discrete gradient vector field compatible with such filtration that is relative-perfect. The proof will be constructive and based on repeatedly using the routine HomotopyExpansion (see Appendix A for details) on the sets of a suitable partition of to build the desired discrete vector field. To this aim, we start proving further properties of the considered multi-filtration. We start observing that lower stars of simplices are contained in level sets.
Next we see that there are simplices, which we call primary, whose lower stars coincide with level sets and therefore form a partition of .
Proof In order to prove uniqueness, suppose there are two cells , ∈ such that ( ) = −1 ( ) = ( ). Because any cell belongs to its own lower star, we get ∈ ( ) and ∈ ( ), implying that is a face of and is a face of . Hence, = . Let us prove existence. By component-wise injectiveness of on the vertices of , if ∈ ( ), then for each 1 ≤ ≤ there exists a unique vertex such ( ) = . By the definition of , is a face of for every ∈ −1 ( ). Thus, is a face of for every ∈ −1 ( ). The simplex generated by all such vertices , 1 ≤ ≤ , is also a face of for every ∈ −1 ( ). Moreover, ( ) = = ( ). Hence, for every ∈ −1 ( ), we have ∈ ( ), implying −1 ( ) ⊆ ( ). On the other hand, from ( ) = , by Lemma 4, we also deduce that ( ) ⊆ −1 ( ), concluding the proof.
The next result shows that the number of -paths exiting from a simplex is equal to the codimension of that simplex with respect to the primary simplex whose lower star it belongs to.

Lemma 6
Let ∈ be a primary simplex. Each simplex ∈ ( ) with dim − dim = has exactly facets contained in ( ).
Proof By Lemma 5, ( ) ⊆ −1 ( ( )). Hence, all the facets of that admit as a face belong to ( ). The total number of such facets of is equal to . Indeed, letting = dim and = dim , so that = + , a facet of that admits as a face is generated by vertices, chosen among the + 1 vertices of , + 1 of which are already fixed as generators of . Therefore, the number of such facets is ( +1)−( +1) The following lemma shows that branching of -paths is not possible in the lower star of a primary simplex, provided that is of dimension at most 2.

Lemma 8 Let be a primary simplex. Let be a critical cell of belonging to
( ) with dim − dim = 2. Let and be the two distinct facets of also belonging to ( ). There exists one and only one simplex¯such that and are connected to¯via -paths entirely contained in ( ).
Proof Because dim = dim + 2, by Lemma 6 and are the only two facets of contained in ( ). Without loss of generality, we can assume is classified by HomotopyExpansion earlier than . When it happens, either is classified as critical or paired to another cell. If is paired to another cell, it cannot be otherwise enters Ord0, enters Ord1, and and are eventually paired at line 17, contradicting the assumption that is critical. An analogous argument shows that cannot be classified as critical. Thus, needs to be paired to a cofacet different from . As a consequence of such pairing, enters Ord0, and enters Ord1. Again, cannot be classified as critical, nor paired to because we are assuming that will eventually be classified as critical. Thus, will rather be paired to some other cofacet that entered into Ord1 before .
Let us now consider two maximal -paths ( 0 , 0 , . . . , −1 , ) and ( 0 , 0 , . . . , −1 , ) starting from and , respectively, i.e. = 0 and = 0 . By Lemma 7, there are only two such paths. Moreover, because such -paths are maximal, and must be either critical or paired with . Let us consider all the possible cases. If both and are paired to , then the claim is proved with¯= = the unique simplex paired to . If one of them is paired to and the other is critical, we get a contradiction. Indeed, the one paired to is classified earlier because the instruction is at line 8. After that, Ord1 is never empty, so that the other one cannot be classified as critical. Analogously, if ≠ and both are classified critical, then we get a contradiction because after the first one is classified as critical Ord1 is never empty. The only remaining case is when = is classified as critical, which again proves the claim. Proof By Proposition 1, it suffices to show that, for any filtration grade ∈ Z and any homology degree ∈ Z, each -simplex of in − =1 − satisfies = 0. Let be a -simplex belonging to − =1 − . In other words, is a critical -simplex of belonging to − =1 − . Because − =1 − = −1 ( ), and because by Lemma 5 there is a unique primary simplex in such that ( ) = −1 ( ), we have ∈ ( ). Let = dim − dim . Since the sub-routine HomotopyExpansion works independently over each ( ) with a primary simplex, we can confine ourselves to showing that for each of the cases = 0, 1, 2 the boundary of in ( ) relative to =1 − is trivial. If = 0, that is is a critical simplex of the same dimension as , then = and line 8 in the sub-routine HomotopyExpansion ensures that ( ) = { }. Thus, for = 0, we have = 0. If = 1, then is the only facet of in ( ). Line 8 in the sub-routine HomotopyExpansion ensures that is non-critical, implying that = 0 also in this case. If = 2, we prove that = 0 by analyzing all the maximal -paths contained in ( ) starting from the facets of the critical cell . Because = 2, has exactly two facets in ( ) by Lemma 6. By Lemma 8, the two faces of in ( ) admit each a -path to the same simplex . If is not critical, then = 0, trivially. Assume on the contrary that is critical. By Lemma 7, -paths cannot branch inside ( ). This means that precisely two -paths connect to . Hence, = 0 in this case as well because we are taking coefficients in Z/2Z.
As mentioned above, a consequence of Theorem 1 is that, even if some simplicial complexes of dimension 2 such as the dunce hat do not admit perfect discrete gradient vector fields with respect to standard homology, they always admits relative-perfect gradients. However, the lack of perfectness with respect to standard homology implies a lack of relative-perfectness in dimension 3. For example, the simplicial complex obtained taking the cone over the dunce hat from a ninth vertex, endowed with the filtration induced by the vertex indexing, does not admit a relative-perfect discrete gradient vector field.

Conclusions
Inspired by Morse inequalities, we have introduced in Definition 3 the notion of relative-perfectness of a discrete gradient vector field consistent with a one-critical multi-parameter filtration. Relative-perfectness boils down to the Morse complex of the gradient vector field having the minimal number of critical cells necessary to preserve multiparameter persistence. Strictly speaking, such a definition had no previous one-parameter counterpart. However, we have shown that relative-perfectness generalizes to the multi-parameter case the optimality property satisfied by the output discrete gradient field obtained through algorithm [26].
Specifically for the multi-parameter case, we have highlighted the phenomenon of "virtual" critical cells, already treated in [20], concerning homological changes not depending on any particular critical cells added. In the same way, we have noticed the dual phenomenon of "virtual" homological changes where critical cells are added to preserve, rather than to change, homology. Both phenomena were known to be algebraically captured by Betti tables of the persistence-module associated to the multi-filtration.
For the case of two-parameter filtrations, we have proven in Corollary 2 sharp inequalities relating a relativeperfect discrete gradient and the Betti tables of the associated persistence module. These results show a link between multi-parameter persistent homology and discrete Morse theory that can be leveraged for a better understanding of the former. For instance, our results could turn out useful in situations where one first needs to compute Betti tables as a preprocessing step ahead of persistence computations as in RIVET [22], because the computations of critical cells can be exploited in both steps. The results of this paper suggest that analogous inequalities could hold for a larger number of parameters. However, deriving such inequalities would almost surely require more sophisticated techniques of homological algebra such as the spectral sequence of Mayer-Vietoris.
Concerning computability, we have proven that algorithms [2][17] under their assumptions, i.e., for one-critical filtrations, ensure the relative-perfectness of the output discrete gradient field whenever in the case of simplicial complexes of dimension up to 2 with no restriction on the number of parameters in the filtration. A limitation of such algorithmic construction is that the gradient vector field is computed from a function which is extended from the vertices to other simplices by taking the maximum. While this may be natural for spatial data, it is not so for a Vietoris-Rips complex built from finite metric spaces. From another perspective, it would be interesting to ascertain whether the algorithms considered in those papers permit the construction of relative-perfect gradient vector fields also for simplicial complexes of dimension higher than two. A counterexample to this is easily built by coning on the dunce hat in Fig. 5. However, this does not exclude the possibility of such result provided that lower links of simplices are good enough. In general, defining suitable classes of simplicial complexes admitting relative-perfect discrete gradients seems not to be more difficult than it is in the one-parameter or the classical Morse theory case.
Our contribution in defining relative-perfectness can be applied to computing multi-parameter persistent homology through a preprocessing performing a reduction before actual computations. Other approaches exist. As discussed in [15], it is important to remark that in the multi-parameter case, by reducing to the Morse complex by means of a relative-perfect discrete gradient field, does not ensure to obtain the "smallest" filtered complex preserving the persistence module. Rather, the obtained filtered object is the most convenient among the Morse complexes preserving the multi-filtration. Indeed, this gap can be filled as proposed in [15] reducing directly on the boundary matrix of the multi-filtered chain complex. In terms of chain complex size, authors prove their reduction to be optimal within the class of all filtered chain complexes whose homology is isomorphic to the input one. In that work, authors highlight that a consistent Morse complex belong to that class but not all the elements in the class are Morse complexes. Our result in Proposition 2 ensures that, their notion of optimality is satisfied by a relative-perfect reduction. Thus, relativeperfectness, whenever applicable, captures the same idea but places it into the framework of discrete Morse theory. In terms of computation performance, this implies that, for simplicial complexes of dimension up to 2, the algorithms [2], [17] satisfy the same optimality property as in [15]. For higher dimensions, the last two mentioned algorithms do not ensure the optimality achieved by the algorithm [15]. Moreover, timings have been compared showing that [15] is generally an order of magnitude faster than [17]. However, we remark that a discrete gradient stores additional information with respect to the only boundary matrix. For instance, the gradient provides an implicit remapping of the Morse complex onto the original complex. As already stated, the interplay between discrete Morse theory and multi-parameter persistence might shed some light on the understanding of the latter's invariants. This last observation motivates another possible direction for future works towards the analysis and visualization of multivariate data. Indeed, via a discrete gradient field, one can get a topologically meaningful subdivision of the domain according to a multi-filtration. A pair in a discrete gradient is consistent with a multi-filtration whenever such pairing is possible for all filtration components. This can be exploited to give a meaning and to detect interdependence among components. More practically, our future interest consists in comparing relative-perfectness to the analysis and visualization techniques based on classical Pareto points [28], that is points of the domain where it is impossible to increase a component value along a component without decreasing some other component. Some theoretical results already exist that relate discontinuity points in the persistence space to Pareto points [8].