1 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 (Cerri et al. 2013, 2019; Lesnick 2015). One of those is the matching distance, which can be defined in particular for 2-parameter persistence modules. This pseudometric, introduced in Cerri et al. (2013), 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 (Bapat et al. 2022; Bjerkevik and Kerber 2021; Kerber et al. 2019) or approximation (Cerri and Frosini 2020; Biasotti et al. 2011; Kerber and Nigmetov 2020) 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 \(\mathbb {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 (Cerri et al. 2019) (see also Wan 1975). 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 Bapat et al. (2022) 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 Cerri et al. (2019), 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 (fg).

2 Matching distance

Let M be a closed \(C^{\infty }\)-manifold with a Riemannian metric defined on it. Let \(f:M\rightarrow \mathbb {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)\in \mathbb {R}^2\mid x\le y\}\), known as the persistence diagram of f and denoted by \(\textrm{Dgm}(f)\). The subset \(\Delta =\{(x,y)\in \mathbb {R}^2\mid 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 Edelsbrunner and Morozov (2013) for more details about 1-parameter persistent homology for sublevel set filtrations.

Let \(f=(f_1,f_2):M\rightarrow \mathbb {R}^2\) and \(g=(g_1,g_2):M\rightarrow \mathbb {R}^2\) be smooth functions. Consider the set of pairs (ab) in \(]0,1[\times \mathbb {R}\) with the uniform metric \(d_{\infty }((a,b), (a',b'))=\max \{|a-a'|, |b-b'|\}\). It parameterises all the lines of \(\mathbb {R}^2\) with positive slope in the following way: \(r_{(a,b)}\) is the line containing points of the form \(t(a,1-a)+(b,-b)\) with t in \(\mathbb {R}\). Each point (u(t), v(t)) of \(r_{(a,b)}\) can be associated with the set \(M_t^{a,b}=M_{(u(t),v(t))}= \left\{ x\in M \mid f_1(x)\le u(t)\;\text {and}\; f_2(x)\le v(t)\right\} \). This defines a 1-dimensional filtration, depending on the line \(r_{(a,b)}\), which can be associated with a persistence diagram. Letting (ab) vary, one obtains a collection of persistence diagrams described by the 2D persistent Betti numbers function of f. As observed in Cerri et al. (2013), \(M_{t}^{(a,b)}\) is also equal to \(\left\{ x\in M\mid f_{(a,b)}(x)\le t\right\} \), where \(f_{(a,b)}(x)=\max \left\{ \frac{f_1(x)-b}{a}, \frac{f_2(x)+b}{1-a}\right\} \) (see Fig. 1). However, more commonly, \(f_{(a,b)}\) is normalised, without changing the nature of the filtration, and \(f^*_{(a,b)}=\min \{a,1-a\}f_{(a,b)}\) is instead considered.

Fig. 1
figure 1

On the left the space of parameters \(]0,1[\times \mathbb {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{\bar{t}}+b_1, (1-a_1){\bar{t}}-b_1)\) on the line \(r_{(a_1,b_1)}\) is the sublevel set \(M_{{\bar{t}}}^{a_1,b_1}\) associated to such a point (colour figure online)

Given two functions f and g, the matching distance (Cerri et al. 2013) is defined by

$$\begin{aligned} D_{\text {match}}(f,g)=\sup _{(a,b)\in ]0,1[\times \mathbb {R}}d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) , \textrm{Dgm}\left( g^*_{(a,b)}\right) \right) . \end{aligned}$$

Here, \(d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) , \textrm{Dgm}\left( g^*_{(a,b)}\right) \right) \) is the bottleneck distance between the persistence diagrams of \(f^*_{(a,b)}\) and \(g^*_{(a,b)}\), i.e.,

$$\begin{aligned} d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) , \textrm{Dgm}\left( g^*_{(a,b)}\right) \right) =\inf _{\sigma }\text {cost}(\sigma ), \end{aligned}$$

where \(\text {cost}(\sigma )=\max _{X\in \textrm{Dgm}\left( f^*_{(a,b)}\right) } d\left( X,\sigma (X)\right) \), \(\sigma \) runs over all bijections, called matchings, between \(\textrm{Dgm}\left( f^*_{(a,b)}\right) \) and \(\textrm{Dgm}\left( g^*_{(a,b)}\right) \) and, if \(X=(x_1,x_2)\) and \(Y=(y_1,y_2)\), then

$$\begin{aligned} d(X,Y) = {\left\{ \begin{array}{ll} \kappa &{} if \;X=(x_1,x_2),\; Y=(y_1,y_2) \in \Delta ^+, \\ \vert x_1 - y_1 \vert &{} if \; X = (x_1,\infty ),\; Y = (y_1,\infty ), \\ \frac{x_2-x_1}{2} &{} if \; X = (x_1,x_2) \in \Delta ^+, \; Y = \Delta , \\ \frac{y_2-y_1}{2} &{} if \; Y = (y_1,y_2) \in \Delta ^+, \; X = \Delta , \\ 0 &{} if \; X = Y = \Delta , \\ \infty &{} otherwise. \end{array}\right. } \end{aligned}$$

where \(\kappa =\min \{ \max \{ \vert x_1 - y_1 \vert , \vert x_2 - y_2 \vert \},\max \{ \frac{x_2-x_1}{2}, \frac{y_2-y_1}{2} \}\}\). A matching realising the matching distance, whenever it exists, is called an optimal matching. Note that the matching distance \(D_{\text {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_{\text {match}}(f,g)\) for both cases. For more details about this definition and the foliation method we refer to Cerri et al. (2013).

3 Extended Pareto grid

In this section we recall the relation between a differential construction associated with a smooth function \(f:M\rightarrow \mathbb {R}^2\), called the extended Pareto grid, and the points of the persistence diagrams \(\textrm{Dgm}\left( f^*_{(a,b)}\right) \). This connection is established in the Position Theorem proved in Cerri et al. (2019).

Recall that the Jacobi set of f is the collection

$$\begin{aligned} \mathbb {J}(f)=\{p\in M\mid \nabla f_1=\lambda \nabla f_2\;\text {or}\;\nabla f_2=\lambda \nabla f_1,\;\text {for some}\;\lambda \in \mathbb {R}\}. \end{aligned}$$

The Pareto critical set of f is the subset of \(\mathbb {J}(f)\) given by

$$\begin{aligned} \mathbb {J}_P(f)=\left\{ p\in \mathbb {J}(f)\mid \nabla f_1=\lambda \nabla f_2\;\text {or}\;\nabla f_2=\lambda \nabla f_1,\;\text {for some}\;\lambda \le 0\right\} . \end{aligned}$$

Assume now that f is not only smooth, but it also satisfies the following properties:

  1. (i)

    No point p exists in M at which both \(\nabla f_1\) and \(\nabla f_2\) vanish.

  2. (ii)

    \(\mathbb {J}(f)\) is a 1-manifold smoothly embedded in M consisting of finitely many components, each one diffeomorphic to a circle.

  3. (iii)

    \(\mathbb {J}_P(f)\) is a 1-dimensional closed submanifold of M, with boundary in \(\mathbb {J}(f)\).

  4. (iv)

    If we denote by \(\mathbb {J}_C(f)\) the subset of \(\mathbb {J}(f)\) where \(\nabla f_1\) and \(\nabla f_2\) are orthogonal to \(\mathbb {J}(f)\), then the connected components of \(\mathbb {J}_P(f)\setminus \mathbb {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,\dots , p_h\}\) and \(\{q_1,\dots , q_k\}\), respectively, the critical points of \(f_1\) and \(f_2\). Since the function f satisfies (i), then \(\{p_1,\dots , p_h\}\cap \{q_1,\dots , q_k\}=\emptyset \). The extended Pareto grid of f is defined as the union

$$\begin{aligned} \Gamma (f)=f\left( \mathbb {J}_P(f)\right) \cup \left( \bigcup _i v_i\right) \cup \left( \bigcup _j h_j\right) \end{aligned}$$

where \(v_i\) is the vertical half-line \(\{(x,y)\in \mathbb {R}^2\mid x=f_1(p_i), y\ge f_2(p_i)\}\) and \(h_j\) is the horizontal half-line \(\{(x,y)\in \mathbb {R}^2\mid x\ge f_1(q_j), y= f_2(q_j)\}\). We refer to these half-lines as improper contours and to the closure of the image of the connected components of \(\mathbb {J}_P(f)\setminus \mathbb {J}_C(f)\) as proper contours of \(\Gamma (f)\). Figure 2 shows an example of extended Pareto grid for the projection of a sphere in \(\mathbb {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 \(\nabla f_1\) and \(\nabla f_2\) have the same direction but opposite orientation. Observe that, because of property (ii), the number of contours in \(\Gamma (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 Cerri et al. (2019) and Wan (1975).

Fig. 2
figure 2

The extended Pareto grid of the function \(f(x,y,z)=(x,z)\) on \(S^2=\{(x,y,z)\in \mathbb {R}^3\mid 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 (colour figure online)

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 Cerri et al. (2019, Figure 8).

The Position Theorem (Theorem 2 in Cerri et al. 2019) allows us to obtain the coordinates of the points in the persistence diagram of \(f^*_{(a,b)}\) just by looking at the extended Pareto grid of the function and the filtering line \(r_{(a,b)}\). It reads as follows:

Theorem 3.1

Let (ab) be in \(]0,1[\times \mathbb {R}\) and X in \(\textrm{Dgm}(f^*_{(a,b)}){\setminus } \{\Delta \}\). Then, for each finite coordinate w of X, a point \((p_1,p_2)\) in \(r_{(a,b)}\cap \Gamma (f)\) exists such that \(w=\frac{\min \{a, 1-a\}}{a}(p_1-b)=\frac{\min \{a, 1-a\}}{1-a}(p_2+b)\).

In Cerri et al. (2019) 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.

4 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[\times \mathbb {R}\), where it is defined, to the closed set \([0,1]\times \mathbb {R}\). Moreover, we prove that the matching distance between f and g can be realised on the compact set \([0,1]\times [-\overline{C}, \overline{C}]\), with \(\overline{C}=\max \{\Vert f\Vert _{\infty }, \Vert g\Vert _{\infty }\}\).

Proposition 4.1

Let C be a positive real number. If \(0<a,a'\le \frac{1}{2}\) and \(|b|\le C\), then, for every \(b'\),

$$\begin{aligned} \left\Vert f^*_{(a,b)}-f^*_{(a',b')}\right\Vert _\infty \le 4|a-a'|\left( \Vert f_2\Vert _\infty +C\right) + 3|b-b'|. \end{aligned}$$

Proof

Since \(a,a'\le \frac{1}{2}\), then \(\min \left\{ a,1-a\right\} =a\) and \(\min \left\{ a',1-a'\right\} =a'\). Therefore, recalling that \(|\max \left\{ \alpha ,\beta \right\} -\max \{\gamma ,\delta \}|\le \max \{|\alpha -\gamma |,|\beta -\delta |\}\) and observing that \((1-a)(1-a')\ge \frac{1}{4}\),

$$\begin{aligned}&\Bigg \Vert f^*_{(a,b)}-f^*_{(a',b')}\Bigg \Vert _\infty = \Bigg \Vert a\max \left\{ \frac{f_1-b}{a}, \frac{f_2+b}{1-a}\right\} - a' \max \left\{ \frac{f_1-b'}{a'},\frac{f_2+b'}{1-a'}\right\} \Bigg \Vert _\infty \\&\quad = \sup _{x\in M} \Bigg \vert \max \left\{ f_1(x)-b, \frac{a}{1-a}(f_2(x)+b)\right\} \\&\qquad - \max \left\{ f_1(x)-b', \frac{a'}{1-a'}(f_2(x)+b')\right\} \Bigg \vert \\&\quad \le \sup _{x\in M} \max \left\{ |b-b'|, \Bigg \vert \frac{a}{1-a}(f_2(x)+b)-\frac{a'}{1-a'}(f_2(x)+b')\Bigg \vert \right\} \\&\quad =\sup _{x\in M} \max \left\{ |b-b'|, \frac{\Bigg \vert af_2(x)+ab -aa'b-a'f_2(x)-a'b'+aa'b'\Bigg \vert }{(1-a)(1-a')}\right\} \\&\quad \le \max \left\{ |b-b'|, \frac{|a-a'|\Vert f_2\Vert _\infty +|ab-a'b'|+ |b-b'|aa'}{(1-a)(1-a')}\right\} \\&\quad \le \max \left\{ |b-b'|, 4|a-a'|\Vert f_2\Vert _\infty +4|ab-a'b'|+ 4|b-b'|aa'\right\} \\&\quad \le \max \{|b-b'|, 4|a-a'|\Vert f_2\Vert _\infty +4|ab-a'b'|+ |b-b'|\} \\&\quad = 4|a-a'|\Vert f_2\Vert _\infty +4|ab-a'b'|+ |b-b'|\\&\quad \le 4|a-a'|\Vert f_2\Vert _\infty +4|a-a'||b|+4|b-b'|a'+ |b-b'|\\&\quad \le 4|a-a'|\Vert f_2\Vert _\infty +4|a-a'||b|+ 3|b-b'|\\&\quad \le 4|a-a'|(\Vert f_2\Vert _\infty +C)+ 3|b-b'|. \end{aligned}$$

\(\square \)

By observing that, if \(f=(f_1,f_2)\) and \(h=(f_2,f_1)\), then \(f^*_{(a,b)}=h^*_{(1-a,-b)}\), we obtain an analogous result to Proposition 4.1 for \(a,a'\ge \frac{1}{2}\).

Proposition 4.2

Let C be a positive real number. If \(\frac{1}{2}\le a,a'< 1\) and \(|b|\le C\), then, for every \(b'\),

$$\begin{aligned} \left\Vert f^*_{(a,b)}-f^*_{(a',b')}\right\Vert _\infty \le 4|a-a'|(\Vert f_1\Vert _\infty +C)+ 3|b-b'|. \end{aligned}$$

As a consequence, the function

$$\begin{aligned} f^*_{(\cdot ,\cdot )}:]0,1[\times \mathbb {R} \rightarrow C(M,\mathbb {R}), \quad (a,b) \mapsto f^*_{(a,b)} \end{aligned}$$

is locally Lipschitz. This is the content of the following result:

Theorem 4.3

If \(|b|\le C\), then for every \(0<a,a'<1\) and every \(b'\),

$$\begin{aligned} \left\Vert f^*_{(a,b)}-f^*_{(a',b')}\right\Vert _{\infty }\le 4|a-a'|(\Vert f\Vert _\infty +C)+ 3|b-b'|. \end{aligned}$$

Proof

If \(a,a'\le \frac{1}{2}\) or \(a,a'\ge \frac{1}{2}\), the statement follows directly from Propositions 4.1 and 4.2. Without loss of generality, we can assume that \(a \le \frac{1}{2}\) and \(a' \ge \frac{1}{2}\). Moreover, consider \(\left( \frac{1}{2},b\right) , \left( \frac{1}{2},b'\right) \). We have that

$$\begin{aligned} \left\Vert f^*_{(a,b)} - f^*_{(a',b')} \right\Vert _\infty&\le \left\Vert f^*_{(a,b)} - f^*_{\left( \frac{1}{2},b\right) } \right\Vert _\infty + \left\Vert f^*_{(\frac{1}{2},b)} - f^*_{\left( \frac{1}{2},b'\right) }\right\Vert _\infty \\&\quad + \left\Vert f^*_{(\frac{1}{2},b')} - f^*_{(a',b')} \right\Vert _\infty \\&\le 4\left|a-\frac{1}{2} \right|\left( \Vert f\Vert _\infty +C\right) + 3|b-b|+ 4\left|\frac{1}{2}- \frac{1}{2}\right|(\Vert f\Vert _\infty +C)\\&\quad + 3|b-b'|+ 4\left|\frac{1}{2}-a'\right|(\Vert f\Vert _\infty +C)+ 3|b'-b'|\\&= 4 \left( \left|a-\frac{1}{2}\right|+ \left|\frac{1}{2}-a'\right|\right) (\Vert f\Vert _\infty +C) + 3|b-b'|\\&= 4|a-a'|(\Vert f\Vert _\infty +C)+ 3|b-b'|. \end{aligned}$$

\(\square \)

In Theorem 4.3 we showed that the function \(f^*_{(\cdot ,\cdot )}\) is locally Lipschitz. As such, it can be extended to the parameter values (0, b) (resp. (1, b)) as the limit \(f^*_{(0,b)}:=\lim _{(a',b')\rightarrow (0,b)}f^*_{(a',b')}\) (resp., \(f^*_{(1,b)}:=\lim _{(a',b')\rightarrow (1,b)}f^*_{(a',b')}\)), for every b in \(\mathbb {R}\). Such a function is continuous, and the stability of persistence diagrams with respect to the uniform norm implies that the limit \(\lim _{(a',b')\rightarrow (0,b)}\textrm{Dgm}\left( f^*_{(a',b')}\right) \) (resp. \(\lim _{(a',b')\rightarrow (1,b)}\textrm{Dgm}\left( f^*_{(a',b')}\right) \)) also exists and is equal to \(\textrm{Dgm}\left( f^*_{(0,b)}\right) \) (resp. \(\textrm{Dgm}\left( f^*_{(1,b)}\right) \)). In other words, \(f^*_{(\cdot ,\cdot )}\) can be uniquely extended to \([0,1] \times \mathbb {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 (ab) in \([0,1]\times \mathbb {R}\). The limit functions \(f_{(0,b)}^*\) and \(f^*_{(1,b)}\) can be computed explicitly for any b in \(\mathbb {R}\):

$$\begin{aligned} f^*_{(0,b)}(x)&=\lim _{(a',b')\rightarrow (0,b)}f^*_{(a',b')}(x) \\&=\lim _{a'\rightarrow 0} a'\max \left\{ \frac{f_1(x)-b}{a'}, \frac{f_2(x)+b}{1-a'}\right\} \\&=\max \left\{ f_1(x)-b,0\right\} ,\\ f^*_{(1,b)}(x)&=\lim _{(a',b')\rightarrow (1,b)}f^*_{(a',b')}(x)\\&= \lim _{a'\rightarrow 1} (1-a')\max \left\{ \frac{f_1(x)-b}{a'}, \frac{f_2(x)+b}{1-a'}\right\} \\&=\max \left\{ 0, f_2(x)+b\right\} . \end{aligned}$$

Since Theorem 4.3 enables us to extend the functions \(f^*_{(\cdot , \cdot )}\) and \(g^*_{(\cdot ,\cdot )}\) to \([0,1]\times \mathbb {R}\), the function

$$\begin{aligned} (a,b)\mapsto d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) , \textrm{Dgm}\left( g^*_{(a,b)}\right) \right) \end{aligned}$$
(4.1)

can be extended to \([0,1]\times \mathbb {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 \([0,1]\times [-\overline{C},\overline{C}]\), where \(\overline{C}=\max \{\Vert f\Vert _{\infty },\Vert g\Vert _{\infty }\}\).

Proposition 4.4

There exists \(({\bar{a}},{\bar{b}})\) in \([0,1]\times [-\overline{C},\overline{C}]\), with \(\overline{C}=\max \{\Vert f\Vert _{\infty },\Vert g\Vert _{\infty }\}\), such that

$$\begin{aligned} D_{\textrm{match}}(f,g)&=\max _{(a,b)\in [0,1]\times [-\overline{C}, \overline{C}]} d_B\left( \textrm{Dgm}\left( f_{( a,b)}^*\right) ,\textrm{Dgm}\left( g_{(a, b)}^*\right) \right) \\&=d_B\left( \textrm{Dgm}\left( f_{({\bar{a}},{\bar{b}})}^*\right) ,\textrm{Dgm}\left( g_{({\bar{a}},{\bar{b}})}^*\right) \right) . \end{aligned}$$

Proof

Our strategy is to check what happens when \(|b|\ge \overline{C}\). There are four possible cases given by the combinations of \(a\le \frac{1}{2}\) or \(a\ge \frac{1}{2}\) and \(b\le -\overline{C}\) or \(b\ge \overline{C}\). Consider the case \(a\le \frac{1}{2}\) and \(b\le -\overline{C}\). We have \(f^*_{(a,b)}=a\max \left\{ \frac{1}{a}(f_1-b), \frac{1}{1-a}(f_2+b)\right\} \). However, \(\frac{1}{a}(f_1-b)\ge \frac{1}{a}(f_1+\overline{C})\ge 0\) and \(\frac{1}{1-a}(f_2+b)\le \frac{1}{1-a}(f_2-\overline{C})\le 0\). Thus, \(f^*_{(a,b)}=f_1-b\) and, similarly, \(g^*_{(a,b)}=g_1-b\). The bottleneck distance between their persistence diagrams will thus be \(d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) ,\textrm{Dgm}\left( g^*_{(a,b)}\right) \right) =d_B\left( \textrm{Dgm}\left( f_1-b\right) ,\textrm{Dgm}\left( g_1-b\right) \right) =d_B\left( \textrm{Dgm}\left( f_1\right) ,\textrm{Dgm}\left( g_1\right) \right) \). Therefore, \(d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) ,\textrm{Dgm}\left( g^*_{(a,b)}\right) \right) \) is constant for \(a\le \frac{1}{2}\) and \(b\le -\overline{C}\). Hence we can limit ourselves to computing its value for \(a= \frac{1}{2}\) and \(b=-\overline{C}\).

Consider now \(a\ge \frac{1}{2}\) and \(b\le -\overline{C}\). We have \(f^*_{(a,b)}=\frac{1-a}{a}(f_1-b)\) and, similarly, \(g^*_{(a,b)}=\frac{1-a}{a}(g_1-b)\). Fixing a, we observe that in this case \(d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) ,\textrm{Dgm}\left( g^*_{(a,b)}\right) \right) =\frac{1-a}{a}d_B\left( \textrm{Dgm}(f_1-b),\textrm{Dgm}(g_1-b)\right) =\frac{1-a}{a}d_B(\textrm{Dgm}(f_1),\textrm{Dgm}(g_1))\) is constant with respect to b. Since \(a\ge \frac{1}{2}\) was chosen arbitrarily, and there is no dependence on b, we can choose them to be \(a= \frac{1}{2}\) and \(b=-\overline{C}\) and conclude.

The other two cases follow the same strategy. \(\square \)

Fig. 3
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=-\overline{C}\), if \(a\ge \frac{1}{2}\), and non-decreasing with respect to a on \(b=\overline{C}\), if \(a\le \frac{1}{2}\)

The above proof also shows that the continuous function \(d_B\left( \textrm{Dgm}\left( f^*_{(a,b)}\right) , \textrm{Dgm}\left( g^*_{(a,b)}\right) \right) \) is constant on the segments \(\{(a,b)\mid 0\le a\le \frac{1}{2}, b=-\overline{C}\}\) and \(\{(a,b)\mid \frac{1}{2} \le a \le 1, b=\overline{C}\}\), non-increasing on the segment \(\{(a,b)\mid 1\ge a\ge \frac{1}{2}, b=-\overline{C}\}\) and non-decreasing on the segment \(\{(a,b)\mid 0\le a\le \frac{1}{2}, b=\overline{C}\}\). Moreover, it is 0 on \((0, \overline{C})\) and \((1,-\overline{C})\) (see Fig. 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_{{\textrm{match}}}\) as follows:

$$\begin{aligned} D_{{\textrm{match}}}(f,g) =\max _{(a,b)\in [0,1]\times \mathbb {R}} d_B\left( \textrm{Dgm}\left( f_{( a,b)}^*\right) ,\textrm{Dgm}\left( g_{(a, b)}^*\right) \right) . \end{aligned}$$

5 Special set and matching distance

In this section we introduce the special set associated with a pair of functions (fg). 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 \(\text {Ctr}(f,g)\) be the set of all curves that are contours of f or g. The special set of (fg), denoted by \(\text {Sp}(f,g)\), is the collection of all (ab) in \(]0,1[\times [- \overline{C}, \overline{C}]\) for which two distinct pairs \(\{\alpha _p, \alpha _q\}\), \(\{\alpha _s, \alpha _t\}\) of contours in \(\text {Ctr}(f,g)\) intersecting \(r_{(a,b)}\) exist, such that \(\{\alpha _p, \alpha _q\} \ne \{\alpha _s, \alpha _t\}\) and

  • \(c_1|x_P-x_Q|=c_2|x_{S}-x_{T}|\), with \(c_1,c_2\in \{1,2\}\), if \(a\le \frac{1}{2}\),

  • \(c_1|y_P-y_Q|=c_2|y_{S}-y_{T}|\), with \(c_1,c_2\in \{1,2\}\), if \(a\ge \frac{1}{2}\),

where \(P=P_{(a,b)}=r_{(a,b)}\cap \alpha _p\), \(Q=Q_{(a,b)}=r_{(a,b)}\cap \alpha _q\), \(S=S_{(a,b)}=r_{(a,b)}\cap \alpha _s\) and \(T=T_{(a,b)}=r_{(a,b)}\cap \alpha _t\), and \(x_{*}\), \(y_{*}\) denote abscissas and ordinates of these points. An element of the special set \(\text {Sp}(f,g)\) is called a special value of the pair (fg).

Special values are values of \(]0,1[\times [-\overline{C}, \overline{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 (\(a\le \frac{1}{2}\)) or the same distance between ordinates (\(a\ge \frac{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 (fg), with \(f,g:S^2\rightarrow \mathbb {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\times 10^{-7}\) error.

Fig. 4
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_{A_1}-x_{A_2}|=|x_{B_1}-x_{B_2}|\) and \(|y_{C_1}-y_{C_2}|=|y_{D_1}-y_{D_2}|\) (colour figure online)

Proposition 5.2

\(\textrm{Sp}(f,g)\) is closed in \(]0,1[\times [-\overline{C}, \overline{C}]\).

Proof

First, we show that \(\text {Sp}(f,g)\cap \left( ]0,\frac{1}{2}]\times [-\overline{C}, \overline{C}]\right) \) is closed. Consider a sequence \(\{(a_n, b_n)\}\) in \(\text {Sp}(f,g)\cap \left( ]0,\frac{1}{2}]\times [-\overline{C}, \overline{C}]\right) \) that converges to \((\overline{a}, \overline{b})\) in \(]0,\frac{1}{2}]\times [-\overline{C}, \overline{C}]\). Since such a sequence consists of special values of (fg), there exist two distinct sets \(\{\alpha _p^n, \alpha _q^n\}\) and \(\{\alpha _s^n, \alpha _t^n\}\) in \(\text {Ctr}(f,g)\) such that \(c_1^n|x_{P_n}-x_{Q_n}|=c_2^n|x_{S_n}-x_{T_n}|\), where \(P_n=r_{(a_n,b_n)}\cap \alpha _p^n\), \(Q_n=r_{(a_n,b_n)}\cap \alpha _q^n\), \(S_n=r_{(a_n,b_n)}\cap \alpha _s^n\) and \(T_n=r_{(a_n,b_n)}\cap \alpha _t^n\) and \(c_1^n, c_2^n\in \{1,2\}\), for every n. Since \(\text {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 \(\alpha _p^n=\alpha _p\), \(\alpha _q^n=\alpha _q\), \(\alpha _s^n=\alpha _s\) and \(\alpha _t^n=\alpha _t\), for every n. For the same reason, we can assume that \(c_1^n=c_1\) and \(c_2^n=c_2\), for every n. Since \(\{(a_n,b_n)\}\) is convergent, it is also bounded. In particular, besides \(-\overline{C}\le b_n\le \overline{C}\), there is \(\overline{D}\) such that \(0<\overline{D}\le a_n\le \frac{1}{2}\). Then \(\left( \bigcup _nr_{(a_n,b_n)}\right) \cap \left( \Gamma (f)\cup \Gamma (g)\right) \) is bounded below by the line \(r_{(\frac{1}{2},\overline{C})}\) and above by the line \(r_{(\overline{D},-\overline{C})}\). Thus, \(\{P_n\}\), \(\{Q_n\}\), \(\{S_n\}\) and \(\{T_n\}\) converge, respectively, to \(\overline{P}\), \(\overline{Q}\), \(\overline{S}\) and \(\overline{T}\), up to restriction to subsequences. Since \(c_1|x_{P_n}-x_{Q_n}|=c_2|x_{S_n}-x_{T_n}|\), their limits are also equal, so we have \(c_1|x_{\overline{P}}-x_{\overline{Q}}|=c_2|x_{\overline{S}}-x_{\overline{T}}|\). Since \(\overline{P}\), \(\overline{Q}\), \(\overline{S}\) and \(\overline{T}\) all lie in \(r_{(\overline{a}, \overline{b})}\), \((\overline{a}, \overline{b})\) is also a special value of (fg), concluding that \(\text {Sp}(f,g)\cap \left( ]0,\frac{1}{2}]\times [-\overline{C}, \overline{C}]\right) \) is closed.

Analogously, one can see that \(\text {Sp}(f,g)\cap \left( [\frac{1}{2},1[\times [-\overline{C}, \overline{C}]\right) \) is closed. The set \(\text {Sp}(f,g)\) is then a union of two closed sets, hence it is closed itself. \(\square \)

Let \(\mathcal {S}\) be the set of all pairs \(({\bar{a}},{\bar{b}})\) in \([0,1] \times [-\overline{C},\overline{C}]\) realising the matching distance between f and g, i.e., such that

$$\begin{aligned} D_{{\textrm{match}}}(f,g)=d_B\left( \textrm{Dgm}\left( f_{({\bar{a}},{\bar{b}})}^*\right) ,\textrm{Dgm}\left( g_{({\bar{a}},{\bar{b}})}^*\right) \right) . \end{aligned}$$

As observed about (4.1), \(d_B\left( \textrm{Dgm}\left( f_{(a,b)}^*\right) ,\textrm{Dgm}\left( g_{(a,b)}^*\right) \right) \) is a continuous function on \([0,1]\times [-\overline{C}, \overline{C}]\), thus it admits a maximum in its domain and \(\mathcal {S}\) is not empty. Moreover, \(\mathcal {S}\) is compact because it is the preimage of a point in \(\mathbb {R}\) via a continuous function defined on a compact set.

Note that for any (ab) in \( [0,1] \times [-\overline{C}, \overline{C}]\), we have

$$\begin{aligned} d_B\left( \textrm{Dgm}\left( f_{( a, b)}^*\right) ,\textrm{Dgm}\left( g_{( a,b)}^*\right) \right) = \text {cost}(\sigma _{(a,b)}), \end{aligned}$$
(5.1)

where \(\sigma _{(a,b)}\) is an optimal matching. By applying a straightforward generalisation of Theorem 28 in d’Amico et al. (2010) 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 \(\text {cost}(\sigma _{(a,b)})\) can be seen as a continuous function in the variable (ab) in \([0,1] \times [-\overline{C}, \overline{C}]\).

Definition 5.3

Let \(\sigma : \textrm{Dgm}_1\rightarrow \textrm{Dgm}_2\) be a matching between two persistence diagrams and let X in \(\textrm{Dgm}_1\) be such that \(\textrm{cost}(\sigma )=d(X,\sigma (X))\). The matching \(\sigma \) is of type (1) if \(\Delta \notin \{X,\sigma (X)\}\), and of type (2) if \(\Delta \in \{X,\sigma (X)\}\).

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

$$\begin{aligned} \mathcal {S}\cap \left( \textrm{Sp}(f,g) \cup \left( \left\{ 0,\frac{1}{2},1\right\} \times [-\overline{C},\overline{C}]\right) \right) \ne \emptyset . \end{aligned}$$

Proof

Assume by contradiction that every (ab) in \(\mathcal {S}\) is not in \(\text {Sp}(f,g)\) and that \(a \ne 0,\frac{1}{2},1\). Since \(\mathcal {S}\) is compact, it is possible to take (ab) in \(\mathcal {S}\) minimising the distance from the line \(a=\frac{1}{2}\). Among these, consider \((\hat{a},\hat{b})\) and a corresponding matching \({\widehat{\sigma }} \) of minimum cost between \(\textrm{Dgm}\left( f^*_{(\hat{a}, \hat{b})}\right) \) and \(\textrm{Dgm}\left( g^*_{(\hat{a}, \hat{b})}\right) \). If \(0<\hat{a}< \frac{1}{2}\), the Position Theorem 3.1 implies that there exist \(\widehat{\alpha }\) and \(\widehat{\beta }\) in \(\text {Ctr}(f,g)\) intersecting \(r_{(\hat{a},\hat{b})}\), such that \({\widehat{P}}=r_{({\hat{a}},{\hat{b}})}\cap \widehat{\alpha }\) and \({\widehat{Q}}= r_{({\hat{a}},{\hat{b}})}\cap \widehat{\beta }\) realise at least one of these properties:

  1. 1.

    \({\widehat{P}}\in \Gamma (f)\), \({\widehat{Q}}\in \Gamma (g)\), and \(D_{{\textrm{match}}}(f,g)={\textrm{cost}} (\widehat{\sigma })=|x_{{\widehat{P}}}-x_{{\widehat{Q}}}|\);

  2. 2.

    \({\widehat{P}},{\widehat{Q}}\in \Gamma (f)\) or \({\widehat{P}},{\widehat{Q}}\in \Gamma (g)\), and \(D_{{\textrm{match}}}(f,g)={\textrm{cost}} (\widehat{\sigma })=\frac{1}{2}|x_{{\widehat{P}}}-x_{{\widehat{Q}}}|\).

Observe that the former matching is of type (1) and the latter of type (2). Note also that \(x_{\widehat{P}}\ne x_{\widehat{Q}}\), and hence \(\widehat{P}\ne \widehat{Q}\). If not, then \(D_{\text {match}}(f,g)=0\), implying that any (ab) belongs to \(\mathcal {S}\), including \(\left( \frac{1}{2}, b\right) \), which is a contradiction.

Consider a sequence \(\{(a_n, b_n)\}\) in \(]0,1[ \times [-\overline{C}, \overline{C}]\) such that these \((a_n, b_n)\) are chosen to identify lines obtained by rotating \(r_{(a,b)}\) around \(\widehat{P}\) clockwise in such a way that \((a_n, b_n) \rightarrow (\hat{a},\hat{b})\), where \(\{a_n\}\) is a decreasing sequence. Furthermore, given a sequence \(\{\sigma _n\}\) of optimal matchings between \(\textrm{Dgm}\left( f^*_{(a_n,b_n)}\right) \) and \(\textrm{Dgm}\left( g ^*_{(a_n, b_n)}\right) \) we have that \(\text {cost}(\sigma _n)\rightarrow \text {cost}({\widehat{\sigma }})\) (see (5.1)). Since \(\text {Sp}(f,g) \cup \left( \left\{ 0,\frac{1}{2},1\right\} \times [-\overline{C},\overline{C}]\right) \) is closed, by Proposition 5.2, and \(({\hat{a}},{\hat{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 \(\mathbb {N}\) there exists a pair \(\{P_n, Q_n\}\) in \(r_{(a_n, b_n)}\cap (\Gamma (f)\cup \Gamma (g))\) for which at least one of the following properties holds:

  1. (A)

    \(P_n\in \Gamma (f)\), \( Q_n\in \Gamma (g)\) and \(\textrm{cost} (\sigma _n)=|x_{ P_n}-x_{ Q_n}|\);

  2. (B)

    \(P_n,Q_n\in \Gamma (f)\) or \(P_n,Q_n\in \Gamma (g)\), and \(\textrm{cost} (\sigma _n)=\frac{1}{2}|x_{P_n}-x_{Q_n}|\).

Up to subsequences, we can assume that the matchings \(\sigma _n\) are either all of type (1) or all of type (2). We now show that \(\{P_n\}\) and \(\widehat{P}\) belong to the same contour in \(\text {Ctr}(f,g)\), and \(\{Q_n\}\) and \(\widehat{Q}\) also belong to the same contour in \(\text {Ctr}(f,g)\). Analogously to the proof of Proposition 5.2 we may observe that the set \(\left( \bigcup _n r_{(a_n,b_n)}\right) \cap (\Gamma (f)\cup \Gamma (g))\) is a bounded subset of \(\Gamma (f)\cup \Gamma (g)\). Thus, \(\{P_n\}\) and \( \{Q_n\}\) are convergent up to subsequences in the closed set \(\Gamma (f)\cup \Gamma (g)\), respectively, to \(\overline{P}\) and \(\overline{Q}\). By assumption, there are only a finite number of contours, thus there exists at least a contour in \(\text {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 \(\text {Ctr}(f,g)\), i.e., we can suppose that for every n in \(\mathbb {N}\), \(P_n\) is in \(\overline{\alpha }\) and \(Q_n\) is in \(\overline{\beta }\), with \(\overline{\alpha }\) and \(\overline{\beta }\) in \(\text {Ctr}(f,g)\). Since contours are closed, \(\overline{P}\) belongs to \(\overline{\alpha }\) and \(\overline{Q}\) belongs to \(\overline{\beta }\). We observe that \(\{\overline{P}, \overline{Q}\} \subseteq r_{(\hat{a},\hat{b})}\). Furthermore, we have that

$$\begin{aligned} c'|x_{\widehat{P}}-x_{\widehat{Q}}|= \text {cost}({\widehat{\sigma }}) = \lim _{n \rightarrow \infty } \text {cost}(\sigma _n)= \lim _{ n \rightarrow \infty } c''|x_{P_n}-x_{Q_n}|=c''|x_{\overline{P}}-x_{\overline{Q}}|\end{aligned}$$

where \(c',c''\) in \(\{\frac{1}{2},1\}\). If \(\{{\widehat{\alpha }}, {\widehat{\beta }}\}\ne \{\overline{\alpha }, \overline{\beta }\}\), then \((\hat{a}, \hat{b})\) is a special value, contradicting the initial assumption. Thus, \(\{{\widehat{\alpha }}, {\widehat{\beta }}\}= \{\overline{\alpha }, \overline{\beta }\}\). Without loss of generality, by possibly exchanging the roles of the contours \(\widehat{\alpha }\) and \(\widehat{\beta }\), and of the points \({\widehat{P}}\) and \({\widehat{Q}}\), we can assume that \({\widehat{\alpha }}=\overline{\alpha }\), \({\widehat{\beta }}=\overline{\beta }\), \(\widehat{P}=\overline{P}\) and \(\widehat{Q}=\overline{Q}\). Consequently, by the fact that \(\{P_n\}\) and \(\widehat{P}\) are contained in the same line \(r_{(a_n,b_n)}\) and the same contour \(\widehat{\alpha }\), \(P_n=\widehat{P}\) for every n, since a contour and a positive slope line can meet in at most one point.

Case 1 Assume that \(\widehat{\sigma }\) and \(\sigma _n\) are both of the same type for every n. Since \(Q_n\) belongs to \(\overline{\beta }\) in \(\text {Ctr}(f,g)\) for any n, one can easily check that \(|x_{\widehat{P}}-x_{Q_n}|\ge |x_{\widehat{P}}-x_{\widehat{Q}}|\) (see Fig. 5), and hence \(\text {cost}(\sigma _n)\ge \text {cost}({\widehat{\sigma }})\). If the equality holds there is a contradiction with the assumption of \((\hat{a}, \hat{b})\) minimising the distance from the line \(a=\frac{1}{2}\), since \(\left|a_n- \frac{1}{2}\right|<\left|{\hat{a}}- \frac{1}{2}\right|\). If the strict inequality holds, there is a contradiction with the assumption of \({\widehat{\sigma }}\) being in \(\mathcal {S}\).

Case 2 Assume that all \(\sigma _n\) and \(\widehat{\sigma }\) are of different types. This means that \(\text {cost}(\sigma _n)=c'|x_{\widehat{P}}-x_{Q_n}|\), \(\text {cost}({\widehat{\sigma }})=c''|x_{\widehat{P}}-x_{\widehat{Q}}|\), with \(c'\ne c''\) and \(c',c''\) in \(\{\frac{1}{2},1\}\), and \( c' |x_{\widehat{P}}-x_{Q_n}|\rightarrow c''|x_{\widehat{P}}-x_{\widehat{Q}}|\). However, since \(Q_n\rightarrow \widehat{Q}\), \(c'|x_{\widehat{P}}-x_{Q_n}|\rightarrow c'|x_{\widehat{P}}-x_{\widehat{Q}}|\). Thus, \(c''|x_{\widehat{P}}-x_{\widehat{Q}}|=c'|x_{\widehat{P}}-x_{\widehat{Q}}|\), which is a contradiction since \(D_{\text {match}}(f,g)\ne 0\) and, hence, \(x_{\widehat{P}}\ne x_{\widehat{Q}}\).

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 \(\frac{1}{2}<{\hat{a}}<1\). \(\square \)

Fig. 5
figure 5

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

6 Conclusions

In this article we took advantage of the differential structure associated with smooth functions from a Riemannian manifold M to \(\mathbb {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 6 shows a selections of points in the special set for the functions \(f,g:S^2\rightarrow \mathbb {R}^2\), where \(S^2=\{(x,y,z)\mid x^2+y^2+z^2=1\}\), \(f(x,y,z)=(x+1, z-1)\) and \(g(x,y,z)=(0.75x-2,0.75z+2)\). One may notice clear segments, two of which, on the left, correspond to values identifying lines through intersections of contours. Such lines are in fact always associated with special values.

Fig. 6
figure 6

Approximation of a special set