{'fraction_non_alphanumeric': 0.06586495397457644, 'fraction_numerical': 0.012444969602256484, 'mean_word_length': 3.742588575560376, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On the geometrical properties of the coherent matching distance in 2D persistent homology

In this paper we study a new metric for comparing Betti numbers functions in bidimensional persistent homology, based on coherent matchings, i.e. families of matchings that vary in a continuous way. We prove some new results about this metric, including its stability. In particular, we show that the computation of this distance is strongly related to suitable filtering functions associated with lines of slope 1, so underlining the key role of these lines in the study of bidimensional persistence. In order to prove these results, we introduce and study the concepts of extended Pareto grid for a normal filtering function as well as of transport of a matching. As a by-product, we obtain a theoretical framework for managing the phenomenon of monodromy in 2D persistent homology.


Introduction
The classical approach to persistent homology is based on the study of the homological changes of the sublevel sets X f w of a topological space X filtered by means of a continuous function f : X → R m , when w varies in R m . This theory is interesting both from the theoretical and applicative point of view, since the function f can be used to describe both topological properties of X and data defined on this space. A description of persistent homology and its use can be found in [16].
The case m = 2 is intrinsically more difficult to study than the case m = 1 and calls for the development of new mathematical ideas and methods. One of these methods consists in a reduction from the 2-dimensional to the 1-dimensional case by means of a family of functions f (a,b) : X → R, with a ∈ ]0, 1[ and b ∈ R (cf. [6]), defined by setting f . The function f (a,b) allows one to represent the set {x ∈ X : f (x) (u, v)} as the set {x ∈ X : f (a,b) (x) ≤ t}, which describes a 1dimensional filtration of X for t varying in R. For technical reasons, we normalize the function f (a,b) by setting f * (a,b) (x) := min{a, 1−a}·f (a,b) (x). In plain words, the previous 1D filtration associated with the function f * (a,b) is obtained by projecting X to the plane R 2 by means of f and considering for each p ∈ r (a,b) the subset X p ⊆ X given by the points staying on the bottom left of p (see Figure 1). It is well-known that the collection of the 1D Betti numbers functions associated with the 1D filtrations defined by the filtering functions f * (a,b) is equivalent to the 2D Betti numbers functions of f [6].
• p X p X Figure 1. The 1D filtration {X p } p∈r (a,b) defined by the function f * (a,b) . The light blue set X p is the sublevel set associated with the value p.
After fixing k ∈ N, each 1-dimensional filtration associated with the function f * (a,b) defines a persistence diagram Dgm f * (a,b) , which is the set of pairs (b i , d i ) describing the time of birth b i and the time of death d i of the ith homological class in degree k along the filtration associated with f * (a,b) . If two filtering functions f, g : X → R 2 are given, a common way to compare the two collections Dgm f * the supremum of the classical bottleneck distance between the persistence diagrams Dgm f * (a,b) and Dgm g * (a,b) over (a, b). This idea leads to a metric D match between the aforementioned families of persistence diagrams (cf. [1,6]). We observe that, in principle, a small change of the pair (a, b) can cause a large change in the "optimal" matching, that is, the matching realizing the bottleneck distance between Dgm f * (a,b) and Dgm g * (a,b) . In other words, the definition of D match is based on a family of optimal matchings that is not required to change continuously with respect to the pair (a, b).
Experiments concerning the computation of this distance D match reveal an interesting phenomenon, consisting of the fact that many examples exist where the supremum defining D match (f, g) is taken for lines r (a,b) with a ≈ 1/2. Figure 2 illustrates two of these examples.
A natural question arises: Does the property illustrated in those examples always hold for the distance D match ? Unfortunately, we are not able to directly answer this question, because of the lack of geometrical properties in the definition of D match . Furthermore, we observe that while the metric D match is rather simple to define and compute by considering a suitable family of filtering functions associated with lines having positive slope, it has two main drawbacks. First, it forgets the natural link between the homological properties of filtrations associated with lines that are close to each other. As a Figure 2. The bottleneck distance between the persistence diagrams Dgm f * (a,b) and Dgm g * (a,b) for two different pairs (f, g) of functions from S 2 to R 2 , represented as a function of (a, b). The colors correspond to the value of the bottleneck distance at each point (a, b), with red meaning higher values and blue, lower values. We can observe that the maximum value is taken at a point (ā,b) withā ≈ 1/2. More details about the considered functions can be found in [1]. consequence, part of the interesting homological information is lost. Second, its intrinsically discontinuous definition makes studying its properties difficult.
For these reasons, in the previous paper [8] we have introduced a new matching distance between 2D persistence diagrams (i.e. families of persistence diagrams associated with the lines r (a,b) as (a, b) changes), called coherent matching distance and based on matchings that change "coherently" with the filtrations we take into account. In other words, the basic idea consists of considering only matchings between the persistence diagrams Dgm f * (a,b) and Dgm g * (a,b) that change continuously with respect to the pair (a, b). This requirement is both natural and useful, and this paper is devoted to the exploration of its main consequences.
First of all, the idea of "coherent matching" leads to the discovery of an interesting phenomenon of monodromy. We observe that when we require that the matchings change continuously, we have to avoid the pairs (a, b) at which the persistence diagram contains double points, called singular pairs. This is done by choosing a connected open set U of regular (non-singular) pairs in the parameter space, and assuming that (a, b) ∈ U . In doing this, we can preserve the "identity" of points in the persistence diagram and follow them when we move in the parameter space. From this easily arises the concept of a family of matchings that is continuously changing. Interestingly, turning around a singular pair can produce a permutation in the considered persistence diagram, so that the considered filtering function is associated with a monodromy group. A basic example of this monodromy phenomenon can be find by taking the filtering function f = (f 1 , f 2 ) : X = R 2 → R 2 with  , f 2 (x, y) then being extended linearly for every x on the segments respectively joining (x, 0) with (x, 1), (x, 1) with (x, 2), and (x, 2) to (x, 3). On the half-lines {(x, y) ∈ R 2 : y < 0} and {(x, y) ∈ R 2 : y > 3}, f 2 is then being taken with constant slope −1 in the variable y. The graph of f 2 is shown in Figure 3.
The persistence diagram of the function f * (1/4,0) contains a double point, so that (1/4, 0) is a singular pair for f . If we move around the point (1/4, 0) in the parameter space, we can see that two points of the persistence diagram Dgm f * (a,b) exchange their position. For more details about this example we refer the interested reader to the paper [7]. We can easily adapt this example and get a smooth filtering function defined on a smooth closed manifold, revealing a similar phenomenon of monodromy.
As a consequence, our definition of "coherent matching" must take a monodromy group into account. This is done in our paper by defining a transport operator T (f,g) π , which continuously transports each matching σ (a,b) between the persistence diagrams Dgm f * (a,b) , Dgm g * (a,b) to a matching σ (a ,b ) between the persistence diagrams Dgm f * (a ,b ) , Dgm g * (a ,b ) along a path π from (a, b) to (a , b ) in the set U . The existence of monodromy implies that the transport of σ (a,b) does not depend only on the pairs (a, b), (a , b ) but also on the path π we consider. By introducing the transport operator T (f,g) π , we can define the coherent cost cohcost σ (a,b) as the supremum of the classical cost of the matchings that we can obtain from σ (a,b) by means of every possible transport operator T (f,g) π over π. This done, the definition of the coherent matching distance CD U is straightforward: If two filtering functions f, g : X → R 2 are given and U does not contain their singular pairs, CD U (f, g) is the infimum of the coherent costs of the matchings between the sets Dgm f * (a,b) and Dgm g * (a,b) , for a pair (a, b) arbitrarily fixed. We also prove that this definition does not depend on the choice of (a, b).
A key point in our paper consists in proving that the function cost T (f,g) π σ (a,b) takes its global maximum over π when the endpoint of π belongs to the vertical line a = 1/2 or to the boundary of U (Theorem 5.2). We call this property the maximum principle for the coherent transport. The proof of this property casts new light on the existence of examples where the supremum defining the classical distance D match is taken for lines r (a,b) with a ≈ 1/2. In our opinion, the previous result can be seen as a strong signal that the coherent matching distance CD U should be preferred to the classical matching distance D match both in theory and applications, since its use allows one to replace the parameter space ]0, 1[×R with the line {1/2} × R. We observe that the valueā = 1/2 identifies the planar lines with slope 1. We think that the filtering functions associated with these lines are worth further study in 2D persistent homology, since they appear to encapsulate most relevant information. It is interesting to point out that these lines also take an important place in the paper [11], although in a different context, and that the direction of the vector (1, 1, . . . , 1) has a key role in the definition of interleaving distance between multidimensional persistence modules [19]. The fact that lines of slope 1 appear in various different approaches suggests to us that they would deserve further study. We observe that for a = 1/2 the function f * (a,b) coincides with the function f b := max {f 1 − b, f 2 + b}, so our research suggests that this collection of filtering functions could play an important role in 2D persistent homology. Incidentally, this is also supported by the fact that, fixing a = 1/2, it is possible to replace the classical upper bound for the distance between the 2-dimensional persistent Betti numbers, that is, This paper is devoted to illustrating the previous theoretical steps. This will require the introduction of several new concepts and the proof of many properties related to these concepts, so that a by-product of our research is the development of a new theoretical framework to manage 2D persistent homology, based on the concept of extended Pareto grid.
The outline of the paper is as follows. In Section 1 we recall the necessary mathematical background. In Section 2 we illustrate the 2D setting for persistent Betti numbers functions. In Section 3 we introduce the concept of extended Pareto grid as the main mathematical tool in our approach, and prove several results paving the way to the mathematical framework illustrated in the following sections. In Section 4 we introduce the concept of transport of a matching together with its main properties, and present the definition of the coherent 2-dimensional matching distance, also proving its stability. In Section 5 we prove the maximum principle for the coherent transport. In Section 6 we conclude the paper by illustrating the relation between the coherent matching distance and the classical matching distance.
Related literature. Studying the persistence properties of vector-valued functions is usually referred to as multidimensional persistence. These concepts were first investigated in [18] with respect to homotopy groups; multidimensional persistence modules were then considered in [5], and subsequently studied in other papers including [4] and the recent [19,20]. Another approach to the multidimensional setting is the one proposed in [2]. Focusing on 0th homology, the authors introduce a procedure allowing for a reduction of the multidimensional case to the 1-dimensional setting by using a suitable family of derived real-valued filtering functions. Such a result has been partially extended in [3], i.e. for any homology degree but restricted to the case of max-tame filtering functions, and then further refined in [6] for continuous filtering functions. This approach leads to the definition of a multidimensional matching distance between persistent Betti numbers functions and to algorithms for its computation (cf. [1,9]). More recently, the interleaving distance between multidimensional persistence modules has been formally introduced and discussed in [19]. However, according to the author of [19], the question of if and how this last distance can be computed or approximated remains open, thus justifying the study of other metrics such as the one we propose in this paper. The phenomenon of monodromy in 2D persistent homology has been described and studied in [7].

Mathematical setting
In what follows we will assume that f = (f 1 , f 2 ) is a continuous map from a finitely triangulable topological space M to the real plane R 2 .
1.1. Persistent Betti numbers. As a reference for multidimensional persistent Betti numbers we use [6]. According to the main topic of this paper, we will also stick to the notations and working assumptions adopted in [7]. In particular, we build on the strategy adopted in the latter paper to study certain instances of monodromy for multidimensional persistent Betti numbers. Roughly, the idea is to reduce the problem to the analysis of a collection of persistent Betti numbers associated with real-valued functions, and to their compact representation in terms of persistence diagrams.
We use the following notations: (M, ϕ) contains all and only the homology classes of k-cycles born before or at u and still alive at v. By assuming that coefficients are chosen in a field K, we get that homology groups are vector spaces. Therefore, they can be completely described by their dimension, leading to the following definition [15].
Under the above requirements for M , it is possible to show that β ϕ is finite for all (u, v) ∈ ∆ + [6]. Obviously, for each k ∈ Z, we have different PBNs of ϕ (which might be denoted by β ϕ,k , say), but for the sake of notational simplicity we omit adding any reference to k.
Following [6], we assume the use ofČech homology, and refer the reader to that paper for a detailed explanation about preferring this homology theory to others. For the present work, it is sufficient to recall that, with the use ofČech homology, the PBNs of a real-valued function can be completely described by the corresponding persistence diagrams. Formally, a persistence diagram can be defined via the notion of multiplicity [12,17]. Following the convention used for PBNs, any reference to k will be dropped in the sequel. Definition 1.2 (Multiplicity). The multiplicity µ ϕ (u, v) of (u, v) ∈ ∆ + is the finite, non-negative number given by The multiplicity µ ϕ (u, ∞) of (u, ∞) is the finite, non-negative number given by min ε>0, u+ε<v Each point (u, v) ∈ Dgm(ϕ)∩∆ + will be called proper, while each point (u, ∞) ∈ Dgm(ϕ) will be called a point at infinity or an improper point. Remark 1.4. In literature, persistence diagrams are usually defined to contain each single point of the diagonal ∆ instead of one point representing the whole diagonal, with infinite multiplicity. The two definitions are equivalent, but we prefer the latter because it will allow us to make easier our exposition and in particular the definition of the set F U,c in Section 3.
We endow ∆ * ∪ {∆} with the following extended metric d. We define Persistence diagrams are stable under the bottleneck distance (a.k.a. matching distance). Roughly, small changes in the considered function ϕ induce small changes in the position of the points of Dgm(ϕ) which are far from the diagonal, and possibly produce variations close to the diagonal [12,13]. A visual intuition of this fact is given in Figure 4. Formally, we have the following definition: Definition 1.5 (Bottleneck distance). Let Dgm(ϕ), Dgm(ψ) be two persistence diagrams. For each bijection σ between Dgm(ϕ) and Dgm(ψ) we set cost(σ) := max X∈Dgm(ϕ) d(X, σ(X)). The bottleneck distance d B (Dgm(ϕ), Dgm(ψ)) is defined as where σ varies among all the bijections between Dgm(ϕ) and Dgm(ψ).
In practice, the distance d defined in (1.1) compares the cost of moving a point X to a point Y with that of annihilating them by moving both X and Y onto ∆, and takes the most convenient. Therefore, d(X, Y ) can be considered a measure of the minimum cost of moving X to Y along two different paths.
Sometimes in literature the definition of cost(σ) is given by means of a supremum instead of a maximum, and the bottleneck distance d B (Dgm(ϕ), Dgm(ψ)) is introduced as an infimum instead of a minimum. We underline that both these presentations are correct, as pointed out in [6]. In other words, a matchingσ : Dgm(ϕ) → Dgm(ψ) and a pointX ∈ Dgm(ϕ) always exist, such that d B (Dgm(ϕ), Dgm(ψ)) = cost(σ) = d(X,σ(X)). The matchingσ is called an optimal matching between Dgm(ϕ) and Dgm(ψ).
The stability of persistence diagrams can then be formalized as follows [12,13]:  . Changing the function ϕ to ψ induces a change in the persistence diagram. In this example, the graphs on the left represent the real-valued functions ϕ and ψ, defined on a space M (a segment). The corresponding persistence diagrams (restricted to 0th homology) are displayed on the right.

2-dimensional setting
The definition of persistent Betti numbers can be easily extended to functions taking values in R 2 [6].
induces a homomorphism from the kth homology group of M (u1,u2) into the kth homology group of M (v1,v2) . The image of this homomorphism is called the kth persistent homology group of (M, f ) at ((u 1 , u 2 ), (v 1 , v 2 )), and is denoted by H We discuss this for the specific case of the above function f : M → R 2 , referring the reader to Figure 5 for a pictorial representation. Let us consider the set Λ + of all lines of R 2 that have positive slope. This set can be parameterized by the set P(Λ + ) = ]0, 1[ ×R, by taking each line r ∈ Λ + to the unique pair (a, b) with 0 < a < 1 and b ∈ R such that (a, 1 − a) is a direction vector of r and (b, −b) ∈ r. The line r will be denoted by r (a,b) . Λ + is referred to as the set of admissible lines.
, that is the set of the points of M "whose image by f is under and on the left of (u(t), v(t))" while (u(t), v(t)) moves along the line r (a,b) . As a consequence, each admissible line r (a,b) defines a filtration {M a,b t } of M and a persistence diagram associated with this filtration. The family of the persistence diagrams associated with the lines r (a,b) is called the 2D persistence diagram of f .
It is interesting to observe that the filtration {M a,b t } can be also defined as the sublevel sets filtration induced by a suitable real-valued function. In fact, we have that M a,b The Reduction Theorem proved in [6] states that the persistent Betti numbers function β f can be completely recovered by considering all and only the persistent Betti numbers functions β f (a,b) associated with the admissible lines r (a,b) , which are in turn encoded in the corresponding persistence diagrams Dgm f (a,b) .
In some sense, the study of persistent homology for R 2 -valued functions can be seen as the study of the persistent homology groups associated with the filtrations defined by the lines r (a,b) , varying (a, b) in P(Λ + ). It is natural to wonder which pairs (a, b) are more relevant for the topological comparison of two functions f, g : M → R 2 . This paper is mainly devoted to underline the particular importance of the pairs (a, b) ∈ P(Λ + ) with a = 1/2, starting from the following results providing an alternative, yet equivalent, formulation of the L ∞ -distance between f and g: Proof. For every (a, b) ∈ P(Λ + ) and every x ∈ M , we have Assume now that we have two continuous functions f, g : M → R 2 . We consider the persistence diagrams Dgm f (a,b) , Dgm g (a,b) associated with the admissible line r (a,b) , and normalize them by multiplying their points by min{a, 1 − a}. This is equivalent to consider the normalized denoting the bottleneck distance between the normalized persistence diagrams Dgm f * (a,b) and Dgm g * (a,b) .
Remark 2.4. It is common in the literature (cf. [6]) to refer to the 2-dimensional matching distance D match as giving a distance between two 2-dimensional persistent Betti numbers functions. In this paper, in order to simplify the exposition, it will be said to give a pseudo-distance between the functions f and g themselves, denoted D match (f, g). The same will be the case for the coherent matching distance CD U which will be defined in Section 4.3.
By Lemma 2.2 and the Stability Theorem 1.6 the next result immediately follows.
Remark 2.6. The introduction of normalized persistence diagrams in the definition of D match is crucial to obtain a stable pseudo-metric (cf. [6,Thm. 4.4]). Indeed, is less than f − g ∞ , while we underline that this is not true for the distance depends continuously on the parameters a and b with respect to the sup-norm, it follows that the set of points in Dgm f * (a,b) depends continuously on the parameters a and b. Analogously, the set of points in Dgm g * (a,b) depends continuously on the parameters a and b. Suppose that σ (a,b) : Dgm f * (a,b) → Dgm g * (a,b) is an optimal matching, i.e. one of the matchings achieving the bottleneck distance . Given the above arguments, a natural question arises, whether σ (a,b) changes continuously under variations of a and b. In other words, we wonder if it is possible to straightforwardly introduce a notion of coherence for optimal matchings with respect to the elements of P(Λ + ).
Perhaps surprisingly, the answer is no. A first obstruction is given by the fact that, trying to continuously extend a matching σ (a,b) , the identity of points in the (normalized) persistence diagrams is not preserved when considering an admissible pair (ā,b) for which either Dgm f * (ā,b) or Dgm g * (ā,b) has points with multiplicity greater than 1. In other words, we cannot follow the path of a point of a persistence diagram when it collides with another point of the same persistence diagram. On the one hand, this problem can be solved by replacing P(Λ + ) with its subset Reg(f ) ∩ Reg(g), where Reg(f ) := (a, b) ∈ P(Λ + ) Dgm f * (a,b) \ {∆} does not contain multiple points . Throughout the rest of the paper, we will talk about singular pairs for f to denote the pairs (a, b) ∈ Sing(f ) := P(Λ + ) \ Reg(f ), and about regular pairs for f to denote the pairs (a, b) ∈ Reg(f ). An analogous convention holds referring to the singular and regular pairs for g.
On the other hand, however, continuously extending a matching σ (a,b) presents some problems even in this setting. Roughly, the process of extending σ (a,b) along a path π : [0, 1] → Reg(f ) ∩ Reg(g) depends on the homotopy class of π relative to its endpoints. This phenomenon is referred to as monodromy in 2-dimensional persistent homology, and has been studied for the first time in [7]. In the following we will show how to overcome this issue in order to define a coherent modification of the standard 2-dimensional matching distance D match .
There are two different ways we can alleviate the difficulty caused by the monodromy phenomenon in order to construct a coherent 2-dimensional matching distance. We can choose to transport matchings by moving along paths in a covering of the parameter space, or we can rather define the transport of matchings along paths in the parameter space itself. In this paper we will choose this last approach.

The extended Pareto grid and its main properties
In order to proceed we will assume that M is a closed smooth manifold and our filtering function f : M → R 2 is pretty regular, in the sense described in this section.
Let f = (f 1 , f 2 ) be a smooth map from a closed C ∞ -manifold M of dimension r ≥ 2 to the real plane R 2 . Choose a Riemannian metric on M so that we can define gradients for f 1 and f 2 . The Jacobi set J(f ) is the set of all points p ∈ M at which the gradients of f 1 and f 2 are linearly dependent, namely ∇f 1 (p) = λ∇f 2 (p) or ∇f 2 (p) = λ∇f 1 (p) for some λ ∈ R. In particular, if λ ≤ 0 the point p ∈ M is said to be a critical Pareto point for f . The set of all critical Pareto points of f is denoted by J P (f ) and is a subset of the Jacobi set J(f ). Obviously, J P (f ) contains both the critical points of f 1 and the critical points of f 2 .
We assume that (i) No point p ∈ M exists such that both ∇f 1 (p) and ∇f 2 (p) vanish; (ii) J(f ) is a smoothly embedded 1-manifold 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 ). We consider the set J C (f ) of cusp points of f , that is, points of J(f ) at which the restriction of f to J(f ) fails to be an immersion. In other words J C (f ) is the subset of J(f ) at which both ∇f 1 and ∇f 2 are orthogonal to J(f ).
We also assume that (iv) 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 parameterization 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.
In [21] (see also [14]) it is proved that the previous properties (i), (ii), (iii), (iv) are generic in the set of smooth maps from M to R 2 .
Property (iv) implies that the connected components of J P (f ) \ J C (f ) are open, or closed, or semi-open arcs in M . Following the notation used in [21], they will be referred to as critical intervals of f . If an endpoint p of a critical interval actually belongs to that critical interval and hence is not a cusp point, then it is a critical point for either f 1 or f 2 . We denote the critical intervals of f by α 1 , . . . , α r , and parameterize these arcs arbitrarily, that is, α i : I i → M , with I i equal to ]0, 1[, or ]0, 1], or [0, 1[, or [0, 1]. Our assumptions also imply that both the set of critical points of f 1 and the set of critical points of f 2 are finite.
3.1. The extended Pareto grid. Our purpose is to establish a formal link between the position of points of Dgm f * (a,b) for a function f and the intersections between the admissible line r (a,b) with a particular subset of the plane R 2 , called the extended Pareto grid of f , which we will define here.
Let us list the critical points p 1 , . . . , p h of f 1 and the critical points q 1 , . . . , q k of f 2 (our assumption (i) guarantees that {p 1 , . . . , p h } ∩ {q 1 , . . . , q k } = ∅). Consider the following closed half-lines: for each critical point The extended Pareto grid Γ(f ) is defined to be the union of f (J P (f )) with these closed half-lines. The closures of the images of critical intervals of f will be called proper contours of f , while the closed half-lines will be known as improper contours of f . We observe that every contour is a closed set and the number of contours of f is finite because of property (iv).
Let S(f ) be the set of all points of Γ(f ) that belong to more than one (proper or improper) contour. We say that the multiplicity of p ∈ Γ(f ) is the maximum k such that for every ε > 0 there exist two pairs (a, b), In other words, the multiplicity of p ∈ Γ(f ) is the maximum k for which there exists an admissible line r (a ,b ) arbitrarily close to r (a,b) p such that r (a ,b ) ∩ Γ(f ) contains k points arbitrarily close to p and no point belonging to more than one contour. (This definition should not be confused with the definition of multiplicity for points in persistence diagrams.) Let D(f ) be the set of all points p ∈ Γ(f ) that have multiplicity strictly greater than 1. We observe that D(f ) ⊆ S(f ). Each connected component of Γ(f ) \ D(f ) will be called a contour-arc of f . Therefore, the contour-arcs do not contain their endpoints.
A visual intuition is given by Figure 7, showing the extended Pareto grid of the function f taking each point p of the torus in Figure 6 to the pair f (p) = (x(p), z(p)). In Figure 8, the contour-arcs of the same function f are shown, together with the points of the set D(f ) (in white).

3.2.
Assumptions about the extended Pareto grid. We recall that, by definition, a pair (a, b) ∈ ]0, 1[×R is singular for f if and only if the set Dgm f * (a,b) \{∆} contains at least one point having multiplicity strictly greater than 1. A pair (a, b) that is not singular is called regular.   ) for any fixed a ∈ ]0, 1[ without changing the concept of normal function. In plain words, Property (4) guarantees that the passage across a contour-arc γ along any direction (a, 1 − a) just creates (s(γ) = 1) or destroys (s(γ) = −1) exactly one homological class in degree d(γ), without producing any homological change in the other degrees. According to [11], this implies that the multiplicity of the points of each contour-arc is 1 in degree d(γ). In the rest of this paper we will assume that the function f : M → R 2 is normal.

The Position Theorem.
We recall that With the concept of extended Pareto grid at hand, we can state and prove the following result, which gives a necessary condition for P to be a point of Dgm f * (a,b) . are obtained by multiplying the ones of Dgm f (a,b) by the factor min{a, 1 − a}, we obtain that a point p ∈ M exists such that one of the following statements holds: (1) ∇f 1 (p) = 0, and c = min{a,1−a} (2) ∇f 2 (p) = 0, and c = min{a,1−a} Assume that (1) holds, and recall that the admissible line r (a,b) is parameterized by t and has equation (u(t), v(t)) = t · (a, 1 − a) + (b, −b). Looking for the point of r (a,b) whose abscissa is f 1 (p), we find , we have that the ordinate (1−a)c min{a,1−a} − b is strictly greater than f 2 (p). This means that the line r (a,b) meets the vertical half-line r : x = f 1 (p), y > f 2 (p), which is part of the extended Pareto grid (recall that, by We skip the case in which (2) holds, because it is completely analogous to the above treatment.
To conclude the proof, assume now that (3) holds. We know that the point (f 1 (p), f 2 (p)) belongs to Γ(f ), because p ∈ J P (f ). Given that the admissible line r (a,b) is parameterized by t and has equation ( This yields the claim. Note that when b < 0 and |b| is sufficiently large, the admissible line r (a,b) may intersect Γ(f ) only at the vertical half-lines (see line r (a,b ) in Figure 9). In this case, f *

3.4.
Pairing of contour-arcs. Two contour-arcs γ 1 , γ 2 for f are called paired to each other with respect to r (a,b) if r (a,b) meets both γ 1 and γ 2 at two respective points (x 1 , y 1 ), (x 2 , y 2 ), and min{a,1−a} ) . In plain words, two contour-arcs are paired to each other with respect to r (a,b) if one of them is associated with the birth of a homological class in the filtration given by f * and the other is associated with the death of the same homological class in the same filtration. By applying the Position Theorem 3.4 and the Stability Theorem 1.6, it is easy to check that if the contour-arcs γ 1 , γ 2 are paired to each other with respect to r (a,b) and r (a ,b ) is an admissible line meeting both γ 1 and γ 2 at two respective points (x 1 , y 1 ), (x 2 , y 2 ), then γ 1 , γ 2 are paired to each other with respect to r (a ,b ) Figure 9. When b < 0 and |b| is large enough, the line r (a,b) intersects only the vertical half-lines in the extended Pareto grid. When b > 0 and |b| is large enough, the line r (a,b) intersects only the horizontal half-lines in the extended Pareto grid.
as well. We underline that each contour-arc can be paired to different contour-arcs with respect to different admissible lines.

Localization of singular pairs by the Position Theorem. The Position
Theorem allows us to deduce where singular pairs can be in P(Λ + ). Proof. Let us first assume that Dgm f * (ā,b) contains a proper multiple point (ū,v). We can find a line r (a ,b ) that is arbitrarily close to r (ā,b) and does not meet S(f ).
Because of the Stability Theorem 1.6, Dgm f * (a ,b ) must contain two proper points arbitrarily close to each other. Therefore, the Position Theorem 3.4 and the definition of the set D(f ) imply that r (ā,b) contains two double points of Γ(f ).  . We conclude this subsection by giving some results that will be of use in the paper.
Proof. The statement immediately follows from the Position Theorem, the properties in Definition 3.1 and the Stability Theorem 1.6.
Corollary 3.7. The following statements hold: (1) The set of all pairs (a, b) ∈ P(Λ + ) such that Dgm f * (a,b) contains a proper multiple point is finite; (2) The set of all pairs (a, b) ∈ P(Λ + ) such that Dgm f *   has multiplicity greater than 1. If such a point exists, its multiplicity is 2.
Proof. The Position Theorem 3.4 and the properties in Definition 3.1 guarantee that if r (a ,b ) is an admissible line that is quite close to r (a,b) and does not touch multiple points of Γ(f ), then it is not possible to find more than one pair ((u 1 , v 1 ), (u 2 , v 2 )) of proper points in Dgm f * (a ,b ) such that (u 1 , v 1 ) is arbitrarily close to (u 2 , v 2 ). Our statement follows from the Stability Theorem 1.6. have multiplicity greater than 1. If such points exist, their multiplicities are 2.
Proof. The Position Theorem 3.4 and the properties in Definition 3.1 guarantee that if r (a ,b ) is an admissible line that is quite close to r (a,b) and does not touch multiple points of Γ(f ), then it is not possible to find more than two pairs ((u 1 , ∞), (u 2 , ∞)) , ((u 1 , ∞), (u 2 , ∞)) of improper points in Dgm f * (a ,b ) such that u 1 is arbitrarily close to u 2 and u 1 is arbitrarily close to u 2 . Our statement follows from the Stability Theorem 1.6. a, b). From the Position Theorem 3.4 the next Proposition 3.12 follows, allowing us to deduce where in ∆ a point of Dgm f * (a,b) can be created or destroyed. We start by giving two definitions. Definition 3.10. Let γ 1 , γ 2 be two contour-arcs paired to each other (with respect to any line r (a,b) that meets both of them). If γ 1 and γ 2 have a common endpoint (x,ȳ), it is known as an annihilation crossing for f , associated with the contour-arcs γ 1 , γ 2 .

Creation and destruction of points in
By definition, each annihilation crossing for f belongs to the set D(f ). The set of all annihilation crossings for f will be denoted by the symbol A(f ). can appear and disappear. Proof. This is a direct consequence of the Position Theorem 3.4 and the Stability Theorem 1.6.

3.7.
Choice of the functional set F U,c . Now, in order to proceed we fix a connected open subset U of P(Λ + ), choose a c > 0 and define F U,c as the set of all normal functions f : M → R 2 such that Reg(f ) ⊇ U and the distance d(P, Q) between any two distinct points P, Q of Dgm f * (a,b) is strictly greater than 2c > 0 for every (a, b) ∈ U . Incidentally, we observe that for any (a, b) ∈ U and any f ∈ F U,c , the sup-norm distance between the points in Dgm f * (a,b) \ {∆} and the diagonal ∆ is strictly larger than 2c. It follows from the previous Subsection 3.6 that if (a, b) ∈ U then r (a,b) cannot contain annihilation crossings for f . We also observe that the distance between the sets U and Sing(f ) is positive, because of the Stability Theorem 1.6. The definition of our coherent matching distance will depend on the choice of this set U .
In the following we will assume that the functions f, g belong to the set F U,c . This assumption guarantees that the points in the persistence diagrams Dgm f * (a,b) are far enough from each other, and that the same holds for Dgm g * (a,b) .

The coherent 2-dimensional matching distance
In Sections 2 and 3 we have introduced some machinery in order to define and manage the coherent 2-dimensional matching distance between 2D persistent Betti numbers. Our next step is the definition of the coherent 2-dimensional matching distance [8].
The existence of monodromy implies that each loop in Reg(f ) induces a permutation on Dgm f * (a,b) . In other words, it is not possible to establish which point in Dgm f * for (a, b) = (a , b ), since the answer depends on the path that is considered from (a, b) to (a , b ) in the parameter space Reg(f ). As a consequence, different paths going from (a, b) to (a , b ) might produce different results while "transporting" a matching to another point (a , b ) ∈ P(Λ + ). Nevertheless, we will see that it is still possible to define a notion of coherent 2-dimensional matching distance. These ideas will be formalized in the upcoming sections.

4.1.
Transporting a matching along a path. Using the Stability Theorem 1.6, we will clarify the notion of transport of cornerpoints, that is, we will follow the movement of each point P ∈ Dgm f * (a,b) when (a, b) varies in P(Λ + ). First, we need to specify the concept of transporting a point X ∈ Dgm f * (a(0),b(0)) along a path (a(t), b(t)) in U , for t ∈ [0, 1]. We recall that ∆ :  Proof. If X = ∆ our statement trivially holds, since we can set P (τ ) := ∆ for every τ ∈ [0, 1]. Therefore, let us assume that X = ∆.
Let us take a maximal continuous path P : I → ∆ * such that P (0) = X and Here, maximality refers to the domain I, assuming it is an interval containing 0.
We will prove by contradiction that ω = 1. Therefore, suppose that ω < 1, choose a small η > 0 and consider τ ∈ [ω, ω + η] ⊆ [ω, 1]. The Stability Theorem 1.6 and the assumptions that π(ω) ∈ U and f ∈ F U,c imply the existence of an ε > 0 such that if η is small enough, then Dgm f * π(τ ) ∩ ∆ * contains exactly one point Figure 12. The definition of T (f,g) π σ π(0) . Q(τ ) at a distance less than ε from P (ω). We can then extend the domain of P by setting P (τ ) := Q(τ ) for τ ∈]ω, ω + η]. Once again, by the Stability Theorem 1.6, it is easy to prove that the path P (τ ) is continuous. This extension contradicts the maximality of I. Finally, we show that the path P : [0, 1] → ∆ * that is induced by π and starts at X is unique. Assume that another path P : [0, 1] → ∆ * induced by π exists, with X = P (0) = P (0). Denote by θ the greatest of the values τ such that P (τ ) = P (τ ). Since P differs from P , θ < 1. Because of the 1-dimensional Stability Theorem and the definition of induced path, then π(θ) is a singular pair belonging to U against the assumption f ∈ F U,c . Therefore, the path P must be unique. 4.1.1. The definition of transported matching. With reference to the previous Proposition 4.2, we say that π transports X to X = P (1) with respect to f and write T f π (X) = X . We observe that T f π is a bijection from Dgm f * π(0) to Dgm f * π(1) , whose inverse is the map T f π −1 , where π −1 is the inverse path of π. Moreover, T f π Dgm f * π(0) \ {∆} = Dgm f * π(1) \ {∆} and T f π (∆) = ∆. In other words, the transport takes points different from ∆ to points different from ∆, and ∆ to ∆. We now need to define the concept of transporting a matching along a path π : [0, 1] → U with π(0) = (a, b). Let σ (a,b) be a matching between Dgm f * (a,b) and Dgm g * (a,b) , with (a, b) an element of U , assuming f, g ∈ F U,c . We can naturally associate to σ (a,b) a matching σ π(1) : Dgm f * π(1) → Dgm g * π(1) . Suppose that σ (a,b) (X) = Y . We set σ π(1) (X ) = Y if and only if T f π (X) = X and T g π (Y ) = Y . We also say that π transports σ (a,b) to σ π(1) along π with respect to the pair (f, g). The transported matching will be denoted by the symbol T More formally, we define T by setting Figure 12). We observe that T to Dgm g * (a,b) , with (a, b) ∈ U .
4.1.2. Some properties of the transport. The next property trivially follows from the definition of transport.
In order to proceed, we need to recall the following result (Theorem 4.5 in [6]). , 1 − a). −ε),(1−a)·(1−a−ε)) . Proposition 4.4 allows to prove the following result, implying that the transport along a path in U is continuous with respect to changes in the path. .
If θ < 1, then on the one hand we can find a θ + ∈]θ, 1] arbitrarily close to θ On the other hand, for every t ∈ [0, 1] the inequalities hold. For every positive δ ≤ η, let us define .
If we apply Proposition 4.4 for ε := π − π ∞ , we obtain the inequalities so that Y θ+ = T f π θ + (X). Since θ + is arbitrarily close to θ, the 1D Stability Theorem 1.6 implies that a point Z ∈ Dgm f * π θ (1) exists such that the inequal- , then Dgm f * π θ (1) contains at least two points (Z and T f π θ (X)) that have a distance less than π − π ∞ · C η from T f π θ (X), and hence these two points have a distance less than 2 · π − π ∞ · C η ≤ 2c from each other. If Z = T f π θ (X), then this point is double in Dgm f * π θ (1) , because of the construction of Z and the inequality Y θ+ = T f π θ + (X). Both cases contradict the assumption that f ∈ F U,c . Therefore, if π − π ∞ ≤ min(η, c/C η ) then θ = 1, and hence we have that (a,b) . From the fact that the transport along a path in U is continuous with respect to changes in the path (consequence of Proposition 4.5) and the fact that Dgm f * (a,b) \ {∆} is a discrete set, the next result immediately follows.

Each loop in U induces a permutation on Dgm f *
Proposition 4.6. If two paths π, π in U are homotopic to each other relatively to their common extrema, then T f π ≡ T f π . Corollary 4.7. The map T f taking each equivalence class [π] to the permutation T f π is a well-defined homomorphism from the fundamental group of U at (a, b) ∈ U to the group of permutations of Dgm f * (a,b) . Proof. This follows from Propositions 4.3 and 4.6.
Definition 4.8. The image of the group homomorphism T f will be called the persistent monodromy group of the filtering function f with respect to U . Remark 4.9. In the introduction of this paper we recalled a basic example of filtering function f : X = R 2 → R 2 associated with a nontrivial persistent monodromy group. We observe that it is easy to adapt that example and obtain a normal filtering functionf : M → R 2 still associated with a nontrivial persistent monodromy group with respect to a suitable open set U , where M is a smooth closed manifold.  at (a, b), then the persistent monodromy group of f with respect to U is generated by the permutations T f πj . Proof. This follows from Corollary 4.7.
The following interesting property holds.  (2) in Corollary 3.7 guarantees that the boundary of V in P(Λ + ) is a (possibly empty) finite union of segments, whose points are singular pairs for f . For every r > 0, let us set U r := V \ P ∈Sing(f ) B(P, r). Let us consider two values r , r with 0 < r < r , and the sets U r /2 , U r , U r . By definition of the set F U,c , we have that ∂U does not contain any point of Sing(f ). Therefore, we can choose r , r so small that U ⊆ U r ⊆ U r ⊆ U r /2 and the open sets U r /2 , U r , U r are connected. Let us choose a c > 0 such that f ∈ F U r /2 ,c . With reference to Proposition 4.5, let us choose a positive η < min t∈[0,1] min(a(t), 1 − a(t)) for every path π = (a, b) : [0, 1] → B((ā,b), r ) ∩ U r /2 . This value does not depend on r . Now, let us take a continuous path α : [0, 1] → U r /2 such that α(0) =π(0) and α(1) ∈ B((ā,b), r ). We also take a loop β : [0, 1] → B((ā,b), r ) ∩ U r /2 such that β(0) = β(1) = α(1) and the loop γ := α * β * α −1 is homotopic toπ in U r /2 (see Figure 13) X ∈ Dgm f * (ā,b) \ {∆}. We observe that k does not depend on r and Proposition 4.5 does not require that the loops β and β be homotopic in U r /2 . If we take β equal to the constant path having β(0) as its image, it follows that can be made arbitrarily small for every that are close to each other, the fact that T f β (X) must be close to X guarantees that T f β : Dgm f * β(0) → Dgm f * β(0) is either the identity or the transposition exchanging P 1 β(0) with P 2 β(0) . Therefore, given that T f α :   1 , b 1 ), . . . , (a q , b q )} of singular pairs for f . Let us take r so small that the closed balls B((a j , b j ), 2r) are disjoint from each other and do not meet the boundary of V in P(Λ + ). We also require that r is so small that (ā,b) ∈ U := V \ P ∈Sing(f ) B(P, r). Then in U for every singular pair (a j , b j ) we can find a loop π j based at (ā,b) that turns once around exactly (a j , b j ) and no other singular pair (a i , b i ). The set of homotopy classes {[π 1 ], . . . , [π q ]} is a set of generators for the fundamental group of U at (ā,b), so that Propositions 4.10 and 4.11 implicitly give a method to compute the persistent monodromy group of f with respect to U . Furthermore, we know that if G is a subgroup of the symmetric group S n and G is generated by m transpositions, then |G| ≤ (m + 1)!. It follows that the cardinality of the image of T f is bounded by (q + 1)!. Before proceeding we recall that the sets U and F U,c have been chosen, as described at the end of Section 3.
The next result implies that the transport along a path in U is continuous with respect to changes in the filtering function.
Proposition 4.13. Let f, g ∈ F U,c with f − g ∞ < c. If π : [0, 1] → U is a continuous path, and X ∈ Dgm f * π(0) , Y ∈ Dgm g * π(0) are two points whose . For every t ∈ [0, 1], the Stability Theorem 1.6 implies that for each point X ∈ Dgm f * π(t) there is a unique point Y (X) ∈ Dgm g * π(t) having distance from X less than f − g ∞ < c. We observe that if this point were not unique, two points of Dgm g * π(t) would exist, with a distance from each other less than 2c, against the definition of the set F U,c . Obviously, the function Y depends on t but, for the sake of simplicity, we omit the reference to t in our notation.
. This is against our assumption that g ∈ F U,c . Therefore θ = 1, so that We conclude this section by observing that the transport operator T f π cannot exchange the positions of improper points, under the assumptions f ∈ F U,c and π : [0, 1] → U . This is due to the fact that T f π moves the points at infinity along a line, so that in order to exchange their positions those points should collide. As a consequence, the path π should meet the set Sing(f ), against our assumptions. In plain words, we could say that the phenomenon of monodromy concerns only the proper points of persistence diagrams.

4.3.
The definition of the coherent matching distance. Definition 4.14. Let Π (a,b) (U ) be the set of all continuous paths π : The following proposition states that the function cohcost U is invariant under transport. Proof. By recalling Proposition 4.3 we have The set Σ (f,g) (a,b) is finite because of Corollary 3.6. Therefore, we can give the following definition.  ) be the identity matching. The property CD U (f, f ) = 0 follows from the fact that T (f,f ) π id π(0) = id π(1) for every continuous path π : [0, 1] → U , implying the equality cohcost U id (a,b) = 0. To show symmetry, we observe that T for every continuous path π : [0, 1] → U . It follows that . By recalling that cost σ −1 (a,b) = cost σ (a,b) for every (a, b) ∈ U and every σ (a,b) ∈ Σ (f,g) (a,b) , we have that cohcost U σ −1 (a,b) = cohcost U σ (a,b) , and so CD U (f, g) = CD U (g, f ). As for the triangle inequality,  Proof. This immediately follows from Proposition 4.15.
The next result shows that the coherent 2-dimensional matching distance is stable, in a suitable sense.
Remark 4.20. The definition of our coherent matching distance could be easily expressed by means of the concept of universal covering C of U . In fact, each homotopy class of paths based at (ā,b) ∈ U that is relative to their endpoints corresponds to a point in C. If U is replaced by C in our construction, we have that any matching defined at a point of C can be transported in a unique way to any other point of C. The replacement of the parameter set U with its universal covering would naturally lead to an equivalent definition of coherent matching distance. In the present exposition, we preferred to maintain the set U for the sake of simplicity.  1 , b 1 ), . . . , (a q , b q )} of singular pairs for f defined in Remark 4.12, with reference to a basepoint (ā,b) ∈ U . Let us choose another point (a, b) ∈ U and fix a continuous path π (a,b) : [0, 1] → U with π (a,b) (0) = (ā,b) and π (a,b) (1) = (a, b). Let Π (ā,b)→(a,b) (U ) and L (ā,b) (U ) be the sets of all continuous paths in U from (ā,b) to (a, b) and of loops π : [0, 1] → U with π(0) = (ā,b), respectively. We observe that each π ∈ Π (ā,b)→(a,b) (U ) is homotopic relatively to its extrema (ā,b), (a, b) to the path π * π (a,b) , where π := π * π −1 (a,b) ∈ L (ā,b) (U ). From with π ∈ L (ā,b) (U ), i.e. as T g πj r • · · · • T g πj 1 • σ (ā,b) • T f

A maximum principle for the coherent transport
We are now ready to prove the most important property of the coherent transport. In this section we show that the value cost T (f,g) π σ (a,b) involved in the definitions of cohcost U and CD U satisfies a sort of maximum principle as a function in the variable π. Indeed, we are going to prove that if a path π is a point of strict maximum (up to homotopies of π relative to its endpoints) for the function cost T (f,g) π σ (a,b) varying π, then a = 1 2 . Before proceeding, we recall that in this paper the symbol Σ  for every path π ∈ Π (ā,b)→(a,b) (V ) with a >ā, thenā ≥ 1 2 .
only if both (x B , y B ) and (x B , y B ) belong to the same vertical, improper contour of g. Analogously, if x A > x B it follows that x B ≥ x B . Therefore we have A similar reasoning holds for the relation between x A = x A , ξ A and ξ A . Precisely, because x A < ξ A it necessarily follows that ξ A ≤ ξ A . Thus ξ A − x A ≤ ξ A − x A , and we can write As a direct consequence of Theorem 5.1, we have the following result. for all π ∈ Π (ā,b)→(a,b) (V ) with a =ā, thenā = 1 2 . Now we can answer the main question presented at the beginning of this paper, provided that D match is replaced with CD U . Theorem 5.3. Assume that U is bounded and that its closureŪ in R 2 is contained in a connected open subset U of P(Λ + ). Then the coherent matching distance CD U (f, g) equals the cost of a matching from Dgm f * to Dgm g * (ã,b) with (ã,b) ∈Ū , such that either (ã,b) ∈ ∂U orã = 1 2 , or both.
The following statement holds. Proof. Let us assume by contradiction that D match, U (f, g) > CD U (f, g). By definition of D match, U (f, g) we can find a real number > 0, an index j and a point (a, b) ∈ U j such that cost(σ) ≥ CD Uj (f, g) + for any matching σ between Dgm f * (a,b) and Dgm g * (a,b) . On the other hand, by Definition 4.14 we have that cohcost Uj (σ) ≥ cost(σ) for any such σ, implying that CD Uj (f, g) ≥ CD Uj (f, g)+ , thus getting a contradiction.

Conclusions
In this paper we have presented a new theoretical framework for metric comparison in 2D persistent homology. In particular, we have illustrated the concept of coherent matching distance and studied some of its properties. In order to do that, we have also introduced the concepts of extended Pareto grid and transport of a matching, and we have shown their use to manage the phenomenon of monodromy. Finally, we have proved some theorems that make clear the importance of filtrations associated with lines of slope 1 in 2D persistent homology.
In our opinion, many problems should deserve further research. First of all, it would be interesting to extend the presented concepts to filtering functions taking values in R m with m > 2. Secondly, the genericity of our assumptions concerning the extended Pareto grid should possibly be proved. Thirdly, the relation between the classical multidimensional matching distance D match and the coherent matching distance CD U could be investigated further. Finally, methods for the efficient computation of the coherent matching distance should be developed.
We plan to devote further papers to these topics.