Geometry of the matching distance for 2D filtering functions

In this paper we exploit the concept of extended Pareto grid to study the geometric properties of the matching distance for R2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {R}^2$$\end{document}-valued regular functions defined on a closed Riemannian manifold. In particular, we prove that in this case the matching distance is realised either at special values or at values corresponding to vertical, horizontal or slope 1 lines.


Introduction
Feature extraction and comparison are the main tasks of data analysis.In topological data analysis this translates into the problem of comparing persistence modules, which encode the homological features extracted from geometric objects.In order to be able to compare persistence modules a distance is needed.There is a wide variety of distances in the space of 1-parameter persistence modules, such as the bottleneck and Wasserstein distances.However, such distances do not directly generalise to the multiparameter setting.Thus, different ones have been proposed over the past years, turning into a substantial catalogue, see for example [4,5,10].One of those is the matching distance, which can be defined in particular for 2-parameter persistence modules.This pseudometric, introduced in [4], is a generalisation of the classical bottleneck distance for 1-parameter persistence modules and measures the difference between the 2-dimensional Betti numbers functions (also known as rank invariants) of persistence modules.The definition of matching distance is based on a foliation method, consisting of "slicing" the 2-parameter persistence module into infinitely many 1-dimensional components by means of lines of positive slope, that we refer to as filtering lines.The matching distance is then obtained by taking the supremum over all such lines of the bottleneck distances between the resulting persistence diagrams after a suitable normalisation.
According to the definition, in order to compute the matching distance between persistence modules, one should take into account infinitely many bottleneck distance computations.Many efforts have been devoted to make this computation efficient, for example, by identifying a finite number of filtering lines contributing to the actual computation [1,3,8] or approximation [6,2,9] of the distance.However, what many of these works have in common is that their starting point is a pair of 2-parameter persistence modules.Our approach is similar in scope, but different in nature.We consider regular filtering functions on a smooth manifold with values in R 2 .Their sublevel-set filtrations still return 2-parameter persistence modules, for which we can compute the 2-dimensional persistent Betti numbers functions and, hence, the matching distance between them.Our approach allows us to observe phenomena and exploit structures that are not visible when directly considering persistence modules.For example, it is possible to exploit the differentiable structure of the filtering functions to identify points in the persistence diagrams associated to each filtering line.This structure made of arcs and half-lines is known as extended Pareto grid [5] (see also [11]).The convenience of such an approach relies on the fact that, by using this approach, the changes in homology that occur when the filtering line changes are easy to follow and control.
In this context of 2-parameter persistence modules derived from regular filtering functions on smooth manifolds, we show that filtering lines of slope 1 play a special role in the computation of the matching distance.Our main result shows that the matching distance between the 2-dimensional persistent Betti numbers functions of two filtering functions is indeed realised either on values corresponding to vertical, horizontal or slope 1 lines, or on special values associated with the two functions.The authors of [1] recently obtained an analogous result in the discrete setting.They show that the matching distance is realised either on values corresponding to diagonal lines or on what they call switch values.One main difference is that the collection of special values that we encounter, called special set, is strongly related with the differentiable structure of our input.In particular, it relies on the structure of the extended Pareto grid associated with a function and on the Position Theorem, proved in [5], which relates points of a persistence diagram to points in the extended Pareto grid.
In this paper, we aim to prove the following: Theorem.The matching distance between f and g is realised either on a value associated with a line of slope 1, a vertical or horizontal line, or on a special value of (f, g).

Matching distance
Let M be a closed C ∞ -manifold with a Riemannian metric defined on it.Let f : M → R be a smooth function.The filtered homology of the sublevel sets of f is known as persistent homology.This information can be encoded as a multiset of points in {(x, y) ∈ R 2 | x ≤ y}, known as the persistence diagram of f and denoted by Dgm(f ).The subset ∆ = {(x, y) ∈ R 2 | x = y} is always considered to be in the persistence diagram of a function and, by convention, we treat it as a unique point with infinite multiplicity.See [7] for more details about 1-parameter persistent homology for sublevel set filtrations. Let It parameterises all the lines of R 2 with positive slope in the following way: r (a,b) is the line containing points of the form t(a, This defines a 1-dimensional filtration, depending on the line r (a,b) , which can be associated with a persistence diagram.Letting (a, b) vary, one obtains a collection of persistence diagrams described by the 2D persistent Betti numbers function of f .As observed in [4],  Given two functions f and g, the matching distance [4] is defined by . Here, is the bottleneck distance between the persistence diagrams of f * where A matching realising the matching distance, whenever it exists, is called an optimal matching.Note that the matching distance D match (f, g) can be seen both as a pseudo-metric between the persistent Betti numbers functions of f and g, and between the filtering functions f and g.For the sake of simplicity, we keep the notation D match (f, g) for both cases.For more details about this definition and the foliation method we refer to [4].

Extended Pareto grid
In this section we recall the relation between a differential construction associated with a smooth function f : M → R 2 , called the extended Pareto grid, and the points of the persistence diagrams Dgm f * (a,b) .This connection is established in the Position Theorem proved in [5].
Recall that the Jacobi set of f is the collection Assume now that f is not only smooth, but it also satisfies the following properties: (i) No point p exists in M at which both ∇f 1 and ∇f 2 vanish.
(ii) J(f ) is a 1-manifold smoothly embedded in M consisting of finitely many components, each one diffeomorphic to a circle.(iii) J P (f ) is a 1-dimensional closed submanifold of M, with boundary in J(f ).(iv) If we denote by J C (f ) the subset of J(f ) where ∇f 1 and ∇f 2 are orthogonal to J(f ), then the connected components of J P (f ) \ J C (f ) are finite in number, each one being diffeomorphic to an interval.With respect to any parameterisation of each component, one of f 1 and f 2 is strictly increasing and the other is strictly decreasing.Each component can meet critical points for f 1 , f 2 only at its endpoints.Denote by {p 1 , . . ., p h } and {q 1 , . . ., q k }, respectively, the critical points of f 1 and f 2 .Since the function f satisfies (i), then {p 1 , . . ., p h }∩{q 1 , . . ., q k } = ∅.The extended Pareto grid of f is defined as the union We refer to these half-lines as improper contours and to the closure of the image of the connected components of J P (f ) \ J C (f ) as proper contours of Γ(f ). Figure 2 shows an example of extended Pareto grid for the projection of a sphere in R 3 on the plane y = 0.The violet horizontal half-lines originate at critical values of f 2 , while the vertical ones originate at critical values of f 1 .The red arcs are the images of those arcs on the sphere in which the gradients ∇f 1 and ∇f 2 have the same direction but opposite orientation.Observe that, because of property (ii), the number of contours in Γ(f ) is finite.Moreover, property (iv) ensures that every contour can be parameterised as a curve whose two coordinates are respectively strictly decreasing and strictly increasing.For more details about properties (i)-(iv) we refer the interested reader to [5,11].
One may observe that the portions of contours delimited by points of intersection between different contours correspond to births and deaths of homology classes.For example, the red union of contours corresponds to the birth of a homology class in degree 0 and the green portions of contour to the birth of a homology class in degree 2. For a richer example we refer the reader to [5, Figure 8].
In [5] the set of filtering functions considered is the set of normal functions.However, the reader can observe that the proof of this specific theorem is actually independent from this assumption and it is valid also in our current setting.

Extension of persistence diagrams
In this section we show that it is possible to extend each 2D persistent Betti numbers function from the open set ]0, 1[×R, where it is defined, to the closed set [0, 1] × R.Moreover, we prove that the matching distance between f and g can be realised on the compact set , we obtain an analogous result to Proposition 4.1 for a, a ′ ≥ 1 2 .Proposition 4.2.Let C be a positive real number.If is locally Lipschitz.This is the content of the following result: 2 or a, a ′ ≥ 1 2 , the statement follows directly from Propositions 4.1 and 4.2.Without loss of generality, we can assume that a ≤ 1 2 and a ′ ≥ 1 2 .Moreover, consider ), for every b in R. Such a function is continuous, and the stability of persistence diagrams with respect to the uniform norm implies that the limit lim  can be extended to [0, 1] × R, too.Furthermore, it is continuous because of the stability of persistence diagrams and, hence, it admits a maximum in its compact domain.
Next, we show that it is not restrictive to compute the matching distance for parameters in ) is constant with respect to b.Since a ≥ 1 2 was chosen arbitrarily, and there is no dependence on b, we can choose them to be a = Moreover, it is 0 on (0, C) and (1, −C) (see Figure 3).Furthermore, we would like to point out that Proposition 4.4 gives us a new formulation for the definition of the matching distance D match as follows: .

Special set and matching distance
In this section we introduce the special set associated with a pair of functions (f, g).We prove that the matching distance between two functions is realised either on values associated with vertical, horizontal or slope 1 lines, or on this special set.Definition 5.1.Let Ctr(f, g) be the set of all curves that are contours of f or g.The special set of (f, g), denoted by Sp(f, g), is the collection of all (a, b) in ]0, 1[×[−C, C] for which two distinct pairs {α p , α q }, {α s , α t } of contours in Ctr(f, g) intersecting r (a,b) exist, such that {α p , α q } ̸ = {α s , α t } and Figure 4.The light blue line corresponds to the pair (0.6, 0) and the green approximately to (0.491, 0.451).They are both special, since |x

Special values are values of ]0, 1[×[−C, C
] in which the optimal matching may abruptly change because of the presence of more than one pair of points with the same distance between abscissas (for a ≤ 1  2 ) or same distance between ordinates (for a ≥ 1 2 ).This discontinuity behaviour gives an obstruction to proving that the matching distance is realised only on vertical, horizontal and slope 1 lines.Indeed, the key for proving Theorem 5.4 is being able to continuously move in the space of parameters and not losing track of the points realising the optimal matching.When encountering a special value this continuity may be missing.
Figure 4 shows two examples of lines associated with special values of (f, g), with f, g : S 2 → R 2 , f (x, y, z) = (x, z) and g(x, y, z) = (2.1x+ 2, 0.6z + 1.8).The green and light blue lines correspond respectively to the parameter values (0.6, 0) and (0.491, 0.451).The intersection points A 1 , A 2 and B 1 , B 2 , between the green line and the extended Pareto grid have equal difference between abscissas, thus (0.6, 0) is a special value.On the other hand, the intersection points C 1 , C 2 and D 1 , D 2 , between the light blue line and the extended Pareto grid have equal difference between ordinates.In particular, (0.491, 0.451) approximates a special value up to a 5 × 10 −7 error.
Since such a sequence consists of special values of (f, g), there exist two distinct sets {α n p , α n q } and {α n s , α n t } in Ctr(f, g) such that c n Q n = r (an,bn) ∩ α n q , S n = r (an,bn) ∩ α n s and T n = r (an,bn) ∩ α n t and c n 1 , c n 2 ∈ {1, 2}, for every n.Since Ctr(f, g) has finitely many contours, we can assume, up to subsequences, that the sequences {P n }, {Q n }, {S n } and {T n } lie respectively in the contours α n p = α p , α n q = α q , α n s = α s and α n t = α t , for every n.For the same reason, we can assume that Observe that a matching can be both of type (1) and type (2).We use this terminology in the proof of the following theorem.Theorem 5.4.
Proof.Assume by contradiction that every (a, b) in S is not in Sp(f, g) and that a ̸ = 0, 1 2 , 1. Since S is compact, it is possible to take (a, b) in S minimising the distance from the line a = (1) P ∈ Γ(f ), Q ∈ Γ(g), and (2) P , Q ∈ Γ(f ) or P , Q ∈ Γ(g), and Observe that the former matching is of type (1) and the latter of type (2).Note also that x P ̸ = x Q , and hence P ̸ = Q.If not, then D match (f, g) = 0, implying that any (a, b) belongs to S, including we have that cost(σ n ) → cost( σ) and (â, b) does not belong to this set, we can assume that the sequence {(a n , b n )} also has no points in this set.Hence, for any n in N there exists a pair {P n , Q n } in r (an,bn) ∩ (Γ(f ) ∪ Γ(g)) for which at least one of the following properties holds: Up to subsequences, we can assume that the matchings σ n are either all of type (1) or all of type (2).We now show that {P n } and P belong to the same contour in Ctr(f, g), and {Q n } and Q also belong to the same contour in Ctr(f, g).Analogously to the proof of Proposition 5.2 we may observe that the set n r (an,bn) ∩ (Γ(f ) ∪ Γ(g)) is a bounded subset of Γ(f ) ∪ Γ(g).Thus, {P n } and {Q n } are convergent up to subsequences in the closed set Γ(f ) ∪ Γ(g), respectively, to P and Q.By assumption, there are only a finite number of contours, thus there exists at least a contour in Ctr(f, g) for each sequence, {P n } and {Q n }, containing infinitely many points of the sequence.Hence, we can assume that each sequence, up to subsequences, lies entirely on a single contour in Ctr(f, g), i.e., we can suppose that for every n in N, P n is in α and Q n is in β, with α and β in Ctr(f, g).Since contours are closed, P belongs to α and Q belongs to β.We observe that {P , Q} ⊆ r (â, b) .Furthermore, we have that ) is a special value, contradicting the initial assumption.Thus, { α, β} = {α, β}.Without loss of generality, by possibly exchanging the roles of the contours α and β, and of the points P and Q, we can assume that α = α, β = β, P = P and Q = Q.Consequently, by the fact that {P n } and P are contained in the same line r (an,bn) and the same contour α, P n = P for every n, since a contour and a positive slope line can meet in at most one point.
Case 1. Assume that σ and σ n are both of the same type for every n.Since Q n belongs to β in Ctr(f, g) for any n, one can easily check that |x P −x Qn | ≥ |x P −x Q | (see Figure 5), and hence cost(σ n ) ≥ cost( σ).If the equality holds there is a contradiction with the Inverting the role of abscissas and ordinates as described by the Position Theorem 3.1 and rotating the lines counterclockwise, one can see that an analogous procedure holds for 1 2 < â < 1. □

Conclusions
In this article we took advantage of the differential structure associated with smooth functions from a Riemannian manifold M to R 2 to characterise some geometric properties of the matching distance.We proved that the filtering lines that actually contribute to the computation of the matching distance are horizontal, vertical, of slope 1, or they are associated with parameter values in the special set.This new approach to the computation of the matching distance could lead to new effective algorithms.In this direction, we would like to highlight an open question that arose during our work.We have not yet provided a characterisation of the special set.However, we conjecture that the special set consists of a collection of curves, up to a small perturbation of the filtering functions.

Figure 1 .
Figure 1.On the left the space of parameters ]0, 1[×R is represented.On the right we show the filtering lines corresponding to the two parameters selected and the projection of a torus on the plane.Each of the lines gives a sublevel set filtration of the torus in the direction of the line.The area down and left of the red point (a 1 t + b 1 , (1 − a 1 ) t − b 1 ) on the line r (a 1 ,b 1 ) is the sublevel set M a 1 ,b 1t (a,b) and g * (a,b) , i.e., d B Dgm f * (a,b) , Dgm g * σ) = max X∈Dgm f * (a,b) d (X, σ(X)), σ runs over all bijections, called matchings, between Dgm f * (a,b) and Dgm g * (a,b) and, if X = (x 1 , x 2 ) and Y = (y 1 , y 2 ), then

Figure 2 .
Figure 2. The extended Pareto grid of the function f (x, y, z) = (x, z) on S 2 = {(x, y, z) ∈ R 3 | x 2 + y 2 + z 2 = 1}.On the left, the red arcs are the proper contours and the violet half-lines are the improper contours.Any point in this extended Pareto grid corresponds to a birth or death of a homological class.For example, on the right side of this figure, the red points correspond to the birth of homology classes in degree 0, while the green points correspond to the birth of homology classes in degree 2.

□
In Theorem 4.3 we showed that the function f * (•,•) is locally Lipschitz.As such, it can be extended to the parameter values (0, b) (resp.(1, b)) as the limit f * (0,b) exists and is equal to Dgm f * (0,b) (resp.Dgm f * (1,b) ).In other words, f * (•,•) can be uniquely extended to [0, 1] × R and this extension is also a locally Lipschitz function.Therefore, in the rest of this paper, we will be allowed to consider the functions f * (a,b) for any (a, b) in [0, 1] × R. The limit functions f * (0,b) and f * (1,b) can be computed explicitly for any b in R:

Since Theorem 4 .
3 enables us to extend the functions f * (•,•) and g * (•,•) to [0, 1] × R, the function (4.1) (a, b) → d B Dgm f * (a,b) , Dgm g * (a,b) b) , Dgm g * (ā, b) .Proof.Our strategy is to check what happens when |b| ≥ C.There are four possible cases given by the combinations of a ≤ 1 2 or a ≥ 1 2 and b ≤ −C or b ≥ C. Consider the case a ≤ 1 2 and b

Figure 3 . 1 2
Figure 3.The bottleneck distance is constant on the coloured regions and half-lines, whereas it is non-increasing with respect to a on b = −C, if a ≥ 1 2 , and non-decreasing with respect to a on b = C, if a ≤ 1 2 .

1 2
and b = −C and conclude.The other two cases follow the same strategy.□ The above proof also shows that the continuous function d B Dgm f * (a,b) , Dgm g * (a,b) (a,b) ∩ α s and T = T (a,b) = r (a,b) ∩ α t , and x * , y * denote abscissas and ordinates of these points.An element of the special set Sp(f, g) is called a special value of the pair (f, g).

Definition 5 . 3 .
bounded below by the line r ( 1 2 ,C) and above by the line r (D,−C) .Thus, {P n }, {Q n }, {S n } and {T n } converge, respectively, to P , Q, S and T , up to restriction to subsequences.Since c 1 |x Pn − x Qn | = c 2 |x Sn − x Tn |, their limits are also equal, so we have c1 |x P − x Q | = c 2 |x S − x T |.Since P , Q, S and T all lie in r (a,b) , (a, b) is also a special value of (f, g), concluding that Sp(f, g) ∩ ]0, 1 2 ] × [−C, C] is closed.Analogously, one can see that Sp(f, g) ∩ [ 1 2 , 1[×[−C, C] is closed.The set Sp(f, g) is then a union of two closed sets, hence it is closed itself.□ Let S be the set of all pairs (ā, b) in [0, 1] × [−C, C]realising the matching distance between f and g, i.e., such thatD match (f, g) = d B Dgm f * (ā, b) , Dgm g * (ā, b).As observed about (4.1),d B Dgm f * (a,b) , Dgm g * (a,b) is a continuous function on [0, 1] × [−C, C],thus it admits a maximum in its domain and S is not empty.Moreover, S is compact because it is the preimage of a point in R via a continuous function defined on a compact set.Note that for any (a, b) in [0, 1] × [−C, C], we have (5.1)d B Dgm f * (a,b) , Dgm g * (a,b) = cost(σ (a,b) ), where σ (a,b) is an optimal matching.By applying a straightforward generalisation of Theorem 28 in [?] for arbitrary n th persistence diagrams, one can see that such a matching always exists.Theorem 4.3 and the stability of the bottleneck distance with respect to the uniform norm imply that cost(σ (a,b) ) can be seen as a continuous function in the variable (a, b) in [0, 1] × [−C, C].Let σ : Dgm 1 → Dgm 2 be a matching between two persistence diagrams and let X in Dgm 1 be such that cost(σ) = d(X, σ(X)).The matching σ is of type (1) if ∆ / ∈ {X, σ(X)}, and of type (2) if ∆ ∈ {X, σ(X)}.

1 2 ,
b , which is a contradiction.Consider a sequence {(a n , b n )} in ]0, 1[×[−C, C] such that these (a n , b n ) are chosen to identify lines obtained by rotating r (a,b) around P clockwise in such a way that (a n , b n ) → (â, b), where {a n } is a decreasing sequence.Furthermore, given a sequence {σ n } of optimal matchings between Dgm f * (an,bn) and Dgm g * (an,bn)

Figure 5 .
Figure 5.The clockwise rotation around P increases the distance between the abscissas of the intersection points.This fact is used in the proof of Theorem 5.4 (case 1).

Figure 6 .
Figure 6.Approximation of a special set.