1 Introduction

The main goal of this paper is to study stability of persistence modules and the consequences it has for other common objects studied in topological data analysis (TDA). For us, a persistence module is a functor \(M:P\rightarrow \mathbf{vec}\), where P is a poset category, often \(P={\mathbb {R}}^n\), and \(\mathbf{vec}\) is the category of finite dimensional vector spaces over a fixed field k. We might say ‘P-module’ to emphasize the poset, or just ‘module’. Explicitly, this is a set of finite dimensional vector spaces \(M_p\) over a fixed field k and linear transformations \(M_p\rightarrow M_q\) for \(p\le q\in P\).

One can measure the distance between persistence modules by the interleaving distance \(d_\mathrm{I}\). Under certain assumptions, persistence modules can be decomposed into direct sums of interval modulesFootnote 1, which are particularly simple and well behaved. For \(n=1\), all persistence modules decompose into interval modules [19], and interval modules are in bijection with the intervals over \({\mathbb {R}}\), so a decomposition into interval modules gives an appealing presentation of a module M as a multiset \({\mathscr {B}}(M)\) of intervals called a barcode. The bottleneck distance \(d_\mathrm{B}\) is a distance on barcodes which can be defined combinatorially, as opposed to the algebraic definition of the interleaving distance.

The algebraic stability theorem (AST) is a fundamental theorem in TDA stating that \(d_\mathrm{I}(M,N)=d_\mathrm{B}({\mathscr {B}}(M),{\mathscr {B}}(N))\), or \(d_\mathrm{I}=d_\mathrm{B}\) for short, holds for \({\mathbb {R}}\)-modules M and N [3, 15, 16, 18]. In TDA, data often take the form of a function \(f:X\rightarrow {\mathbb {R}}\), where X is a topological space. For instance, a data set might be a finite set of points \(S \subset {\mathbb {R}}^n\), in which case one can define f(x) as the distance from x to the closest point in S. Let \(M_f\) be the \({\mathbb {R}}\)-module given by \(M_f(a)=H_i(f^{-1}((-\infty ,a]))\). It is easy to show that \(d_\mathrm{I}(M_f,M_g)\le \Vert f-g\Vert _\infty \) for \(f,g:X\rightarrow {\mathbb {R}}\). This means that a consequence of the algebraic stability theorem is that small perturbations of a function lead to small changes in the resulting barcode, justifying calling \(d_\mathrm{I}=d_\mathrm{B}\) a stability theorem.

Other commonly studied objects in TDA are zigzag modules, interlevel set persistence modules, and Reeb graphs. Zigzag modules are \(\mathbb {ZZ}\)-modules, where \(\mathbb {ZZ}\) is isomorphic to the infinite poset.

figure a

These modules have been of interest to the TDA community for more than a decade [5, 11, 13], and have been used to study flocking behaviour of animals [23]. Zigzag modules are closely related to interlevel set persistence, which is the study of how the topology of \(f^{-1}([a,b])\) changes with a and b, where \(f:X\rightarrow {\mathbb {R}}\), as above. This connection is explained in Sect. 3.

Given a function \(f\) \(:X\rightarrow {\mathbb {R}}\), the Reeb graph \(\bar{f}:(X/{\sim })\rightarrow {\mathbb {R}}\) is defined by letting \(x\sim y\) for x and y in the same connected component of \(f^{-1}(\{a\})\) for some \(a\in {\mathbb {R}}\). Thus, the Reeb graph keeps track of how the connected components of the level set \(f^{-1}(\{a\})\) merge, split, and are born and die as a changes. Introduced by Georges Reeb [26], it has been applied to visualization and graphics [22, 24, 27, 30], and its approximation Mapper [29] has proven very useful; for instance, it has been used to identify a new subgroup of breast cancers [25] and study biomolecular folding pathways [31].

One can define \(d_\mathrm{I}\) and \(d_\mathrm{B}\) also for zigzag modules and Reeb graphs, and whether an analogue of AST holds here is a highly relevant question which has been explored in previous work. The best known bounds until now were \(d_\mathrm{B}\le {5}d_\mathrm{I}/2\) for zigzag modules and \(d_\mathrm{B}\le 5d_\mathrm{I}\) for Reeb graphs, where the latter is an improvement on the constant 9 from [4]. These bounds were proven by Botnan and Lesnick [11] through the result \(d_\mathrm{B}\le {5}d_\mathrm{I}/2\) for block decomposable modules, which are a class of interval decomposable \({\mathbb {R}}^2\)-modules. In Sect. 3, we explain how stability of zigzag modules, interlevel set persistence, and Reeb graphs follows from stability of block decomposable modules.

\({\mathbb {R}}^n\)-modules with \(n\ge 2\), often called multiparameter modules, are important in their own right. Adding a density parameter is helpful when studying data sets with outliers and tendrils [12], and sometimes data are naturally equipped with several parameters. Unfortunately, \({\mathbb {R}}^n\)-modules do not have a nice invariant like the barcode of an \({\mathbb {R}}\)-module [14].

We introduce a new method for proving stability that is versatile and simple compared to earlier methods, and that in some cases gives stronger results. We first apply the method in Sect. 4, where we prove Theorem 4.3, which implies

Theorem

Let M and N be rectangle decomposable \({\mathbb {R}}^n\)-modules. Then we have \(d_\mathrm{B}({\mathscr {B}}(M),{\mathscr {B}}(N))\le (2n-1)d_\mathrm{I}(M,N)\).

These are modules that decompose into intervals of the form \(I_1\times \cdots \times I_n\), where \(I_i\) is an interval over \({\mathbb {R}}\) for each i. This is a generalization of the algebraic stability theorem for \({\mathbb {R}}\)-modules, which is the case \(n=1\), while for \(n\ge 2\), the result is new. Our proof is more combinatorial in nature than the previous proofs for AST. In Sect. 5, we give an example showing that the bound is optimal for \(n=2\), which also disproves a conjecture made in an earlier version of [11] claiming that \(d_\mathrm{B}(M,N) = d_\mathrm{I}(M,N)\) holds for all n-dimensional interval decomposable modules M and N whose barcodes only contain convex intervals. It is an open question if the bound can be improved for \(n\ge 3\).

An arbitrary \({\mathbb {R}}^n\)-module coming from a data set will usually not be rectangle (or even interval) decomposable, though rectangle decomposable modules do arise from interlevel set persistence in the case \(n=2\) [5, 13]. Still, the interleaving distance is certainly of interest, and our work reveals some phenomena that can help our understanding of that subject. Indeed, the ideas in this paper were important ingredients in the recent proof of the NP-hardness of computing \(d_\mathrm{I}\) [7], which we discuss in Sect. 6. Using the same method, we then prove Theorem 4.12, which gives

Theorem

Let M and N be free modules. Then \(d_\mathrm{B}({\mathscr {B}}(M),{\mathscr {B}}(N))\le (n-1)d_\mathrm{I}(M,N)\).

Free modules are a special case of rectangle decomposable modules. In practice, multiparameter modules are often given as the cokernel of a morphism \(F_1 \rightarrow F_2\) of free modules.

Applying elements from the previous theorems and still using the same method, we show Theorem 4.18, which gives

Theorem

Let M and N be block decomposable modules. Then \(d_\mathrm{B}({\mathscr {B}}(M),{\mathscr {B}}(N))=d_\mathrm{I}(M,N)\).

This improves on the mentioned best known bound of \(d_\mathrm{B}\le {5}d_\mathrm{I}/2\) (\(d_\mathrm{B}\ge d_\mathrm{I}\) is trivial), and our proof is simpler and less technical. It follows that \(d_\mathrm{B}=d_\mathrm{I}\) holds for zigzag modules and \(d_\mathrm{B}\le 2d_\mathrm{I}\) holds for Reeb graphs, which is optimal. These are also improvements on the best known bounds. The precise statements are given in Sect. 3. There we also show how this theorem is used in the proof of Theorem 3.7 by Cochoy and Oudot [17], which is a generalization of a known stability result for interlevel set persistence.

2 Persistence Modules, Interleavings, and Matchings

In this section we introduce notation and definitions that we will use throughout the paper. Let k be a field that stays fixed throughout the text, and let \(\mathbf{vec}\) be the category of finite dimensional vector spaces over k. We identify a poset with its poset category, which has the elements of the poset as objects, a single morphism \(p\rightarrow q\) if \(p\le q\) and no morphism if \(p\nleq q\).

Definition 2.1

Let P be a poset category. A P-persistence module is a functor \(P \rightarrow \mathbf{vec}\).

If the choice of poset is obvious from the context, we usually write ‘persistence module’ or just ‘module’ instead of ‘P-persistence module’.

For a persistence module M, \(p \!\le \! q \!\in \! P\), M(p) is denoted by \(M_p\) and \(M(p \rightarrow q)\) by \(\phi _M(p,q)\). We refer to the morphisms \(\phi _M(p,q)\) as the internal morphisms of M. M being a functor implies \(\phi _M(p,p)=\text {id}_{M_p}\) and \(\phi _M(q,r)\circ \phi _M(p,q)=\phi _M(p,r)\). Because persistence modules are defined as functors, they automatically assemble into a category where the morphisms are natural transformations. This category is denoted by P-mod. Let \(f:M\rightarrow N\) be a morphism between persistence modules. Such an f consists of a morphism associated to each \(p \in P\), and these morphisms are denoted by \(f_p\). Because f is a natural transformation, we have \(\phi _N(p,q) \circ f_p = f_q \circ \phi _M(p,q)\) for all \(p \le q\).

Definition 2.2

An interval is a non-empty subset \(I \subset P\) that satisfies the following:

  • If \(p,q \in I\) and \(p \le r \le q\), then \(r \in I\).

  • If \(p,q \in I\), then there exist \(p_1, p_2, \dots , p_{2m} \in I\) for some \(m \in {\mathbb {N}}\) such that \(p \le p_1 \ge p_2 \le \dots \ge p_{2m} \le q\).

We refer to the last point as the connectivity axiom for intervals.

Definition 2.3

An interval persistence module or interval module is a persistence module M that satisfies the following: for some interval I, \(M_p=k\) for \(p\in I\) and \(M_p=0\) otherwise, and \(\phi _M(p,q)=\text {id}_k\) for points \(p\le q\) in I. We use the notation \({\mathbb {I}}^I\) for the interval module with I as its underlying interval.

The definitions up to this point have been valid for all posets P, but we need some additional structure on P to get a notion of distance between persistence modules, which is essential to prove stability results. Since we will mostly be working with \({\mathbb {R}}^n\)-persistence modules, we restrict ourselves to this case from now on. We define the poset structure on \({\mathbb {R}}^n\) by letting \((a_1, a_2, \dots , a_n) \le (b_1, b_2,\dots , b_n)\) if and only if \(a_i \le b_i\) for \(1 \le i \le n\). For \(\epsilon \in {\mathbb {R}}\), we often abuse notation and write \(\epsilon \) when we mean \((\epsilon ,\epsilon ,\dots ,\epsilon ) \in {\mathbb {R}}^n\). We call an interval \(I\subset {\mathbb {R}}^n\) bounded if it is contained in a ball with finite radius.

Definition 2.4

For \(\epsilon \in [0,\infty )\), we define the shift functor \((\,{\cdot }\,)(\epsilon ):{\mathbb {R}}^n\text {{-}}{\mathbf{mod}}\rightarrow {\mathbb {R}}^n\text {{-}}{\mathbf{mod}}\) by letting \(M(\epsilon )\) be the persistence module with \(M(\epsilon )_p=M_{p+\epsilon }\) and \(\phi _{M(\epsilon )}(p,q) = \phi _M(p+\epsilon ,q+\epsilon )\). For morphisms \(f:M\rightarrow N\), we define \(f(\epsilon ):M(\epsilon ) \rightarrow N(\epsilon )\) by \(f(\epsilon )_p = f_{p+\epsilon }\).

We also define shift on intervals I by letting \(I(\epsilon )\) be the interval for which \({\mathbb {I}}^{I(\epsilon )} = {\mathbb {I}}^I(\epsilon )\). Define the morphism \(\phi _{M,\epsilon }:M \rightarrow M(\epsilon )\) by \((\phi _{M,\epsilon })_p = \phi _M(p,p+\epsilon )\).

Definition 2.5

An \(\epsilon \)-interleaving between \({\mathbb {R}}^n\)-modules M and N is a pair of morphisms \(f:M\rightarrow N(\epsilon )\), \(g:N\rightarrow M(\epsilon )\) such that \(g(\epsilon ) \circ f = \phi _{M,2\epsilon }\) and \(f(\epsilon ) \circ g = \phi _{N,2\epsilon }\).

If there exists an \(\epsilon \)-interleaving between M and N, then M and N are said to be \(\epsilon \)-interleaved. An interleaving can be viewed as an ‘approximate isomorphism’, and a 0-interleaving is in fact a pair of isomorphisms. We call a module M \(\epsilon \)-significant if \(\phi _M(p,p+\epsilon )\ne 0\) for some p, and \(\epsilon \)-trivial otherwise. M is \(2\epsilon \)-trivial if and only if it is \(\epsilon \)-interleaved with the zero module. We call an interval I \(\epsilon \)-significant if \({\mathbb {I}}^I\) is \(\epsilon \)-significant, and \(\epsilon \)-trivial otherwise.

Definition 2.6

We define the interleaving distance \(d_\mathrm{I}\) on persistence modules M and N by

$$\begin{aligned} d_\mathrm{I}(M,N) = \inf {\{\epsilon \!\mid \!M \text { and } N \text { are } \epsilon \text { -interleaved}\}.} \end{aligned}$$

Intuitively, the interleaving distance measures how close the modules are to being isomorphic. The interleaving distance between two modules might be infinite, and the interleaving distance between two different, even non-isomorphic modules, might be zero. Apart from this, \(d_\mathrm{I}\) satisfies the axioms for a metric, so \(d_\mathrm{I}\) is an extended pseudometric.

Definition 2.7

Suppose \(M \simeq \bigoplus _{I \in B}{\mathbb {I}}^I\) for a multiset B of intervals. Then we call B the barcode of M, and write \(B = {\mathscr {B}}(M)\). We say that M is interval decomposable.

When we write \(I\ne I'\) for intervals I and \(I'\) in a barcode, we mean that they are separate elements of the multiset, not that they necessarily represent different subsets of \({\mathbb {R}}^n\).

For \({\mathbb {R}}\)-modules, barcodes and persistence diagrams are equivalent and both commonly used; the only difference is that they refer to two different ways of presenting the intervals: either as multisets of intervals, or as multisets of points in \({\mathbb {R}}^2\). For higher-dimensional intervals, however, persistence diagrams become impossible to draw, while one can still draw pictures analogous to the one-dimensional barcodes. For this reason we will use the term ‘barcode’.

Since the endomorphism ring of any interval module is isomorphic to k, it follows from [2, Thm. 1] that for any poset P, if a P-module M is interval decomposable, the decomposition is unique up to isomorphism. Thus, the barcode is well defined. Any \({\mathbb {R}}\)-module is interval decomposable [19], but this is not true for \({\mathbb {R}}^n\)-modules in general. The following is an example of a P-module for a poset P with four points that is not interval decomposable. A corresponding \({\mathbb {R}}^2\)-module that is not interval decomposable and is at most two-dimensional at each point can be constructed.

figure b

For multisets AB, we define a partial bijection as a bijection \(\sigma :A' \rightarrow B'\) for some subsets \(A' \subset A\) and \(B'\subset B\), and we write \(\sigma :A \nrightarrow B\). We write \({\text {coim}}\sigma = A'\) and \({\text {im}}\sigma =B'\).

Definition 2.8

Let A and B be multisets of intervals. An \(\epsilon \)-matching between A and B is a partial bijection \(\sigma :A \nrightarrow B\) such that

  • all \(I \in A \setminus {\text {coim}} \sigma \) are \(2\epsilon \)-trivial,

  • all \(J \in B \setminus {\text {im}} \sigma \) are \(2\epsilon \)-trivial,

  • for all \(I \in {\text {coim}} \sigma \), \({\mathbb {I}}^I\) and \({\mathbb {I}}^{\sigma (I)}\) are \(\epsilon \)-interleaved.

We can interpret \(\epsilon \)-matchings in the context of graph theory. A matching in a graph is a set of edges in the graph without common vertices, and a matching is said to cover a set S of vertices if all elements in S are adjacent to an edge in the matching. Let \(G_\epsilon \) be the bipartite graph on \(A \sqcup B\) with an edge between \(I \in A\) and \(J \in B\) if \({\mathbb {I}}^I\) and \({\mathbb {I}}^J\) are \(\epsilon \)-interleaved. Then an \(\epsilon \)-matching between A and B is a matching in \(G_\epsilon \) such that the set of \(2\epsilon \)-significant intervals in \(A \sqcup B\) is covered.

Definition 2.9

The bottleneck distance \(d_\mathrm{B}\) is defined by

$$\begin{aligned} d_\mathrm{B}(C,D) = \inf {\{\epsilon \mid {\text {there is an}}\, \epsilon \text {-matching between } C\text { and } D}\} \end{aligned}$$

for multisets C and D of intervals.

We will often abuse notation and write \(d_\mathrm{B}(M,N)\) meaning \(d_\mathrm{B}({\mathscr {B}}(M),{\mathscr {B}}(N))\) for persistence modules M and N. The inequality \(d_\mathrm{I}(M,N)\le d_\mathrm{B}(M,N)\) always holds when M and N are interval decomposable, as one can easily construct an \(\epsilon \)-interleaving between M and N given an \(\epsilon \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\). For this reason, we will treat the statements \(d_\mathrm{B}\le d_\mathrm{I}\) and \(d_\mathrm{B}=d_\mathrm{I}\) as the same.

3 Zigzag Modules, Interlevel Set Persistence, and Reeb Graphs

In this section we define block modules and explain how they relate to the stability of zigzag modules, interlevel set persistence, and Reeb graphs. In particular, we explain the consequences of our stability result for block decomposable modules.

In the following, \({\mathbb {R}}^\text {op}\) is the poset with \({\mathbb {R}}\) as the underlying set and the opposite order of the standard one. Sending \(a\in {\mathbb {R}}\) to \(-a\) gives an isomorphism between \({\mathbb {R}}^\text {op}\) and \({\mathbb {R}}\). \({\mathbb {Z}}^\text {op}\) is defined similarly. Let \({\mathbb {U}}= \{(a,b) \in {\mathbb {R}}^{\text {op}} \times {\mathbb {R}}\mid a \le b \}\). This is a subposet of \({\mathbb {R}}^2\) with a flipped x-axis, but it is also useful to think of it as the poset of closed intervals (over \({\mathbb {R}}\)) with \(I\le J\) if \(I\subset J\). There is an obvious one-to-one correspondence between \({\mathbb {U}}\)-modules and \(({\mathbb {R}}^{op }\times {\mathbb {R}})\)-modules that are zero at all points (ab) with \(b<a\). Since \({\mathbb {R}}^{\text {op}} \times {\mathbb {R}}\simeq {\mathbb {R}}^2\), we can define interleavings on \({\mathbb {U}}\)-modules via the usual definition on \({\mathbb {R}}^2\)-modules. Explicitly, the shift functor on \({\mathbb {U}}\)-modules is given by \(M(\epsilon )_{(a,b)}=M_{(a-\epsilon ,b+\epsilon )}\), from which the definition of \(\epsilon \)-interleaving follows.

We are interested in the following particular subset of \({\mathbb {U}}\)-modules.

Definition 3.1

A block is an interval of one of the following forms, where \(a,b\in {\mathbb {R}}\cup \{\pm \infty \}\):

$$\begin{aligned}{}[a,b]_{\text {BL}}&= \{(c,d) \in {\mathbb {U}} \mid c \le b,\, d \ge a\},&[a,b)_{\text {BL}}&= \{(c,d) \in {\mathbb {U}} \mid a \le d< b\},\\ (a,b]_{\text {BL}}&= \{(c,d) \in {\mathbb {U}} \mid a< c \le b\},&(a,b)_{\text {BL}}&= \{(c,d) \in {\mathbb {U}} \mid c > a,\, d < b\}. \end{aligned}$$

A block module is an interval module over \({\mathbb {U}}\) supported on a block. A \({\mathbb {U}}\)-module is block decomposable if it is isomorphic to a direct sum of block modules.

In all but the first case, \(a\le b\) is necessary for the block to be nonempty. Blocks of the form \([a,b]_{\text {BL}}\) with \(a>b\) arise from interlevel set persistence, but not from zigzag modules or Reeb graphs by the constructions we will describe.

Fig. 1
figure 1

From left to right: the intervals \([0,2]_{\text {BL}}\), \([0,2)_{\text {BL}}\), \((0,2]_{\text {BL}}\), and \((0,2)_{\text {BL}}\) together with the \(\mathbb {ZZ}\)-intervals [0, 2], [0, 2), (0, 2], and (0, 2), respectively

In Sect. 4.3, we prove Theorem 4.18:

Theorem

Let M and N be block decomposable modules. If M and N are \(\delta \)-interleaved, there exists a \(\delta \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\). Thus, \(d_\mathrm{I}(M,N)=d_\mathrm{B}(M,N)\).

The previous best known bound was \(d_\mathrm{I}(M,N)\le {5}d_\mathrm{B}(M,N)/2\), proved in [11].

In this section, we will explain how stability results for zigzag modules, interlevel set persistence, and Reeb graphs follow from this result. In the case of zigzag modules and Reeb graphs, our result strengthens the previously known bounds to where they cannot be improved. For interlevel set persistence, Theorem 4.18 was an ingredient in the proof in [17] of a generalization of a known stability result.

3.1 Zigzag Modules

A zigzag module is a module over the poset \(\mathbb {ZZ}= \{(a,b) \in {\mathbb {Z}}^{\text {op}}\times {\mathbb {Z}}\mid a=b \text { or } a=b+1\}\). Like in ordinary 1-parameter persistence, zigzag modules are interval decomposable and therefore have well-defined barcodes [9]. It is not hard to see that any interval over \(\mathbb {ZZ}\) must be of one of the following forms, where \(a,b\in {\mathbb {Z}}\cup \{\pm \infty \}\).

$$\begin{aligned}{}[a,b]&= \{(c,d) \in \mathbb {ZZ}\mid c \le b,\, d \ge a\},&[a,b)&= \{(c,d) \in \mathbb {ZZ}\mid a \le d< b\},\\ (a,b]&= \{(c,d) \in \mathbb {ZZ}\mid a< c \le b\},&(a,b)&= \{(c,d) \in \mathbb {ZZ}\mid c > a, \,d < b\}. \end{aligned}$$

For \((a,b)\in {\mathbb {U}}\), let \(\mathbb {ZZ}|_{(a,b)}\) be the sub-poset of \(\mathbb {ZZ}\) containing the elements \(\{(c,d) \in \mathbb {ZZ}\mid c \ge a, \,d \le b \}\). A zigzag module M gives rise to a \({\mathbb {U}}\)-module U(M) by letting

$$\begin{aligned}U(M)_{(a,b)} = {\text {colim}}{(\mathbb {ZZ}|_{(a,b)})}, \end{aligned}$$

and defining the internal morphism \(\phi _{U(M)}((a,b), (c,d))\) as the induced morphism we get by the universal property of colimits. For any multiset B of intervals over \(\mathbb {ZZ}\), let U(B) be the multiset of blocks where each interval I in B has been replaced by the block \(I_{\text {BL}}\) with the same multiplicity. That is, [ab] is replaced by \([a,b]_{\text {BL}}\), [ab) by \([a,b)_{\text {BL}}\) and so on. Figure 1 illustrates how intervals over \(\mathbb {ZZ}\) give rise to blocks. One can show the following theorem by observing that \(U(\,{\cdot }\,)\) preserves direct sums and that \(U({\mathbb {I}}^I)={\mathbb {I}}^{I_{\text {BL}}}\) for all \(\mathbb {ZZ}\)-intervals I.

Theorem 3.2

If M is a zigzag module, then U(M) is block decomposable and \({\mathscr {B}}(U(M))=U({\mathscr {B}}(M))\).

Thus, we can define the interleaving and bottleneck distances between zigzag modules by letting \(d_\mathrm{I}(M,N) = d_\mathrm{I}(U(M),U(N))\) and \(d_\mathrm{B}(M,N) = d_\mathrm{B}(U(M),U(N))\). Then Theorem 4.18 immediately implies stability for zigzag modules:

Theorem 3.3

Let M and N be zigzag modules. If U(M) and U(N) are \(\delta \)-interleaved, there is a \(\delta \)-matching between their barcodes. Thus, \(d_\mathrm{I}(M,N)=d_\mathrm{B}(M,N)\).

Like for block decomposable modules, this is an improvement on the previous bound of \(d_\mathrm{B}(M,N)\le {5}d_\mathrm{I}(M,N)/2\) [11].

3.2 Interlevel Set Persistence

Given a topological space X and a continuous function \(f:X\rightarrow {\mathbb {R}}\), we define a \({\mathbb {U}}\)-module \(M_n^f\) by \(M^f_n(a,b)=H_n(f^{-1}([a,b]))\), where the internal morphisms are induced by inclusions. When f is sufficiently nice, we can study the stability of the interlevel set persistence of f via \(M_n^f\). Let \({\mathbb {X}}_I = f^{-1}(I)\) for subsets \(I\subset {\mathbb {R}}\).

Definition 3.4

We say that (Xf) is of Morse type if the homology of \({\mathbb {X}}_{\{t\}}\) is finitely generated for every \(t\in {\mathbb {R}}\) and there are real numbers \(a_1<a_2<\ldots <a_m\) such that for all \(I=(a_i,a_{i+1})\), there is a Y and a homeomorphism \(h:Y\times I \rightarrow {\mathbb {X}}_I\) such that \(f\circ h\) is the projection onto I, and h extends to a continuous function \({\bar{h}}:Y\times {\bar{I}} \rightarrow {\mathbb {X}}_{{\bar{I}}}\). Here, \({\bar{I}}\) is the closure of I, i ranges from 0 to m, and we let \(a_0=-\infty \) and \(a_{m+1}=\infty \).

The numbers \(a_i\) are to be understood as the critical values of f. Picking values \(-\infty<s_0<a_1<s_1<\dots<s_{m-1}<a_m<s_m<\infty \) and defining \({\mathbb {X}}_i^j=f^{-1}([s_i,s_j])\), Carlsson et al. [13] consider the sequence

$$\begin{aligned} H_n({\mathbb {X}}):H_n({\mathbb {X}}_0^0)&\rightarrow H_n({\mathbb {X}}_0^1) \leftarrow H_n({\mathbb {X}}_1^1) \rightarrow \cdots \\&\leftarrow H_n({\mathbb {X}}_{m-1}^{m-1}) \rightarrow H_n({\mathbb {X}}_{m-1}^m) \leftarrow H_n({\mathbb {X}}_m^m). \end{aligned}$$

We will view this as a persistence module living over the poset

$$\begin{aligned} S=\{(s_i,s_j) \mid (i=j \text { or } i=j-1) \text { and } 0\le i,j\le m\} \subset {\mathbb {R}}^{\text {op}}\times {\mathbb {R}}. \end{aligned}$$

S is isomorphic to a (finite, connected) subposet P of \(\mathbb {ZZ}\) via an isomorphism \(\iota \). Thus, we can consider a zigzag module Z supported on P such that \(H_n({\mathbb {X}})=Z\circ \iota \), decompose Z into interval modules, and pull the decomposition back along \(\iota \) to get an interval decomposition of \(H_n({\mathbb {X}})\). This means that \(H_n({\mathbb {X}})\) is interval decomposable, so the barcode \({\mathscr {B}}(H_n({\mathbb {X}}))\) is well defined. We borrow the following notation from Carlsson et al., which covers all the intervals that can appear in \({\mathscr {B}}(H_n({\mathbb {X}}))\):

$$\begin{aligned}{}[a_i,a_j]&= \{(s_c,s_d) \mid c< j,\, d \ge i\},&[a_i,a_j)&= \{(s_c,s_d) \mid i \le d< j\},\\ (a_i,a_j]&= \{(s_c,s_d) \mid i\le c< j\},&(a_i,a_j)&= \{(s_c,s_d) \mid c\ge i, \,d < j\}. \end{aligned}$$

By definition, \(H_n({\mathbb {X}})\) is simply the restriction of \(M_n^f\) to the subposet S. Carlsson et al. also consider a larger diagram which consists of the vector spaces \(H_n({\mathbb {X}}_i^j)\) for \(0\le i\le j\le m\) with maps \(H_n({\mathbb {X}}_i^j)\rightarrow H_n({\mathbb {X}}_k^l)\) induced by the inclusions \({\mathbb {X}}_i^j\hookrightarrow {\mathbb {X}}_k^l\) whenever \(k\le i\) and \(j\le l\). This is in fact a discrete version of \(M_n^f\), and carries exactly the same information as long as we remember the \(a_i\): Let M be the \({\mathbb {U}}\)-module given by \(M_{(a,b)}=H_n({\mathbb {X}}_i^j)\) for \(a_i<a\le a_{i+1}\) and \(a_j \le b < a_{j+1}\), and internal morphisms equal to the relevant morphisms \(H_n({\mathbb {X}}_i^j) \rightarrow H_n({\mathbb {X}}_k^l)\). Then \(M\cong M_n^f\).

Using what they call the Mayer–Vietoris Diamond Principle, Carlsson et al. were able to prove part (i) of the following theorem, determining \(M^f_n\) (or rather the discrete version just mentioned) using only \(H_n({\mathbb {X}})\) and \(H_{n-1}({\mathbb {X}})\). The principle is very similar to how a zigzag module M gives rise to a block decomposable module U(M), though here we also get blocks of the form \([a,b]_{\text {BL}}\) with \(a>b\). These blocks are not detected by \(H_n({\mathbb {X}})\), but arise from \(H_{n-1}({\mathbb {X}})\) through a dimension shift. Cochoy and Oudot [17] proved part (ii) with help from a result by Botnan and Crawley-Boevey [10], generalizing (i) by relaxing the assumptions on f. A function \(f\) \(:X\rightarrow {\mathbb {R}}\) is pfd (pointwise finite dimensional) if it is continuous (but not necessarily of Morse type) and \(H_n(f^{-1}((a,b)))\) is finite dimensional for all abn.

Theorem 3.5

[10, 13, 17]

  1. (i)

    If f is of Morse type, then \(M^f_n\) is block decomposable and its barcode consists of the following:

    • a block \([a_i,a_j]_\mathrm{BL}\) for each \([a_i,a_j]\) in \({\mathscr {B}}(H_n({\mathbb {X}}))\),

    • a block \([a_j,a_i]_\mathrm{BL}\) for each \((a_i,a_j)\) in \({\mathscr {B}}(H_{n-1}({\mathbb {X}}))\),

    • a block \([a_i,a_j)_\mathrm{BL}\) for each \([a_i,a_j)\) in \({\mathscr {B}}(H_n({\mathbb {X}}))\),

    • a block \((a_i,a_j]_\mathrm{BL}\) for each \((a_i,a_j]\) in \({\mathscr {B}}(H_n({\mathbb {X}}))\),

    • a block \((a_i,a_j)_\mathrm{BL}\) for each \((a_i,a_j)\) in \({\mathscr {B}}(H_n({\mathbb {X}}))\).

  2. (ii)

    If f is pfd, there is a block decomposable module M such that \(d_\mathrm{I}(M,M^f_n)=0\).

The reason for the indirect phrasing of part (ii) is that Cochoy and Oudot work with inverse images of open intervals instead of closed, which gives a module that is not isomorphic to \(M_n^f\), though the interleaving distance from it is 0. This is not a significant problem, however, as we can define \({\mathscr {B}}(M_n^f)\) as \({\mathscr {B}}(M)\) for M as in (ii).

If M is a block decomposable module, we will find it convenient to use the notation \({\mathscr {B}}_\text {diag}(M)\) for the barcode we get by intersecting the intervals in \({\mathscr {B}}(M)\) with the diagonal and projecting this to \({\mathbb {R}}\). We call \({\mathscr {B}}_\text {diag}(M_n^f)\) the \(n^\text {th}\) level set barcode. This has the following stability property:

Theorem 3.6

[13] Let \(f,g:X\rightarrow {\mathbb {R}}\) be of Morse type. Then

$$\begin{aligned} d_\mathrm{B}({\mathscr {B}}_\mathrm{diag}(M_n^f),{\mathscr {B}}_\mathrm{diag}(M_n^g)) \le \Vert f-g\Vert _\infty , \end{aligned}$$

where \(\Vert f-g\Vert _\infty = \sup _{x\in X}|f(x)-g(x)|\).

Theorem 3.5 allows us to ask if there is an analogue of level set stability for interlevel set persistence by considering block decomposable modules. Botnan and Lesnick give an affirmative answer for f of Morse type. The result was generalized to pfd functions in [17], applying a result of [10] and our Theorem 4.18:

Theorem 3.7

[17] Let \(f,g:X\rightarrow {\mathbb {R}}\) be pfd. Then

$$\begin{aligned} d_\mathrm{B}(M^f_n,M^g_n) \le \Vert f-g\Vert _\infty . \end{aligned}$$

Proof

If \(\epsilon >\Vert f-g\Vert _\infty \), we have inclusions

$$\begin{aligned}f^{-1}([a,b]) \hookrightarrow g^{-1}([a-\epsilon ,b+\epsilon ]) \hookrightarrow f^{-1}([a-2\epsilon ,b+2\epsilon ]) \end{aligned}$$

and vice versa. These induce an \(\epsilon \)-interleaving between \(M^f_n\) and \(M^g_n\), so \(d_\mathrm{I}(M^f_n,M^g_n) \le \Vert f-g\Vert _\infty \). By results from [10, 17], \(M_n^f\) and \(M_n^g\) are block decomposable, and by Theorem 4.18, \(d_\mathrm{B}(M^f_n,M^g_n) = d_\mathrm{I}(M^f_n,M^g_n)\). \(\square \)

3.3 Reeb Graphs

Given a continuous function \(f:X\rightarrow {\mathbb {R}}\) of Morse type with locally path-connected level sets \(f^{-1}(x)\), let \(R_f\) be the quotient space \(X/{\sim }\), where \(x\sim y\) if x and y are in the same connected component of \(f^{-1}(r)\) for some \(r\in {\mathbb {R}}\). We get a function \({\tilde{f}}:R_f\rightarrow {\mathbb {R}}\) induced by f. The Reeb graph of (Xf) is the pair \((R_f,{\tilde{f}})\). Alternatively, one can define a Reeb graph directly as a pair (Rf) such that R is a finite topological graph (a compact triangulable space of dimension at most 1), \(f:R\rightarrow {\mathbb {R}}\) is continuous and of Morse type, and the level sets are discrete. By this definition, the Reeb graph of (Xf) as above is indeed a Reeb graph. We sometimes abuse notation and refer to R as a Reeb graph without explicitly mentioning f.

De Silva et al. [28] show that an equivalent way of viewing a Reeb graph (Rf) is as a functor \(C^R:{\mathbb {U}}\rightarrow \mathbf{Set}\) given by \(C^R(a,b)=\pi _0(f^{-1}([a,b]))\) and morphisms \(C^R(a,b)\rightarrow C^R(c,d)\) induced by inclusions of sets, which in their language is a cosheaf. Strictly speaking, they work with open intervals instead of closed, but this does not matter for the distances we will discuss. We think of \(C^R\) as a set-valued persistence module over \({\mathbb {U}}\). Shift, interleaving, and the interleaving distance are defined in exactly the same way as for persistence modules with values in \(\mathbf{vec}\). Using these cosheaves, de Silva et al. are also able to describe interleavings in a geometrically intuitive way as level-preserving maps between Reeb graphs. We will not need this description, so we skip the details and invite the interested reader to study [28].

Though the interleaving distance is well defined, we cannot talk about decompositions into direct sums of interval modules when we are working over \(\mathbf{Set}\). To avoid this problem, let \(C^R_\mathbf{vec}\) be the \({\mathbb {U}}\)-module (with values in \(\mathbf{vec}\)) such that \(C^R_\mathbf{vec}(a,b)\) has \(C^R(a,b)\) as a basis, and the internal morphisms are determined by the basis maps given by \(C^R\). The level sets are finite since \(H_0(X)\) is finitely generated, so the vector spaces are finite dimensional. \(C^R_\mathbf{vec}\) is simply the zeroth homology interlevel set persistence module of (Rf), so as above, it decomposes into block modules; see Fig. 2. Applying Theorem 4.18 and observing that an \(\epsilon \)-interleaving between \(C^R\) and \(C^{R'}\) representing Reeb graphs (Rf) and \((R',f')\) induces an \(\epsilon \)-interleaving between \(C^R_\mathbf{vec}\) and \(C^{R'}_\mathbf{vec}\), we get

$$\begin{aligned} d_\mathrm{B}(C^R_\mathbf{vec},C^{R'}_\mathbf{vec})= d_\mathrm{I}(C^R_\mathbf{vec},C^{R'}_\mathbf{vec})\le d_\mathrm{I}(C^R,C^{R'}). \end{aligned}$$
Fig. 2
figure 2

A Reeb graph (Rf) with f illustrated as a height function on the right, \(C^R\) on the left, darker shades of grey meaning larger cardinality. The intersection of R and the red strip is \(f^{-1}([5,6])\), which has two connected components. Thus, \(|C^R_{(5,6)}|=2\), shown by the dot. We can easily read off \({\mathscr {B}}(C^R_\mathbf{vec}) = \{[0,11]_\mathrm{BL},[1,2)_\mathrm{BL},(4,7)_\mathrm{BL},(8,10]_\mathrm{BL}\}\) from the figure, which also gives us the level set barcode \({\mathscr {B}}_\text {diag}(C^R_\mathbf{vec}) = \{[0,11],[1,2),(4,7),(8,10]\}\)

We would like to have a similar statement for level set barcodes, though we have to be a little careful, as for \(2\epsilon<b-a<4\epsilon \), \({\mathbb {I}}^{(a,b)_\mathrm{BL}}\) is \(\epsilon \)-interleaved with the zero module, while the \({\mathbb {R}}\)-module \({\mathbb {I}}^{(a,b)}\) is not. This causes \(d_\mathrm{B}({\mathscr {B}}(C^R_\mathbf{vec}),{\mathscr {B}}(C^{R'}_\mathbf{vec}))\) and \(d_\mathrm{B}({\mathscr {B}}_\text {diag}(C^R_\mathbf{vec}),{\mathscr {B}}_\text {diag}(C^{R'}_\mathbf{vec}))\) to disagree by a factor of up to two. Still, it is straightforward to check that an \(\epsilon \)-matching between \({\mathscr {B}}(C^R_\mathbf{vec})\) and \({\mathscr {B}}(C^{R'}_\mathbf{vec})\) induces a \(2\epsilon \)-matching between \({\mathscr {B}}_\text {diag}(C^R_\mathbf{vec})\) and \({\mathscr {B}}_\text {diag}(C^{R'}_\mathbf{vec})\). Thus,

$$\begin{aligned} d_\mathrm{B}({\mathscr {B}}_\text {diag}(C^R_\mathbf{vec}),{\mathscr {B}}_\text {diag}(C^{R'}_\mathbf{vec}))\le 2d_\mathrm{B}(C^R_\mathbf{vec},C^{R'}_\mathbf{vec}). \end{aligned}$$

Summing up the preceding paragraphs, we get

Theorem 3.8

Let (Rf) and \((R',f')\) be Reeb graphs. Then the following inequalities hold:

$$\begin{aligned} d_\mathrm{B}(C^R_\mathbf{vec},C^{R'}_\mathbf{vec})&\le d_\mathrm{I}(C^R,C^{R'}),\\ d_\mathrm{B}({\mathscr {B}}_\mathrm{diag}(C^R_\mathbf{vec}),{\mathscr {B}}_\mathrm{diag}(C^{R'}_\mathbf{vec}))&\le 2 d_\mathrm{I}(C^R,C^{R'}). \end{aligned}$$

The previous best known bounds were 5/2 for the first inequality and 5 for the second [11]. De Silva et al. observe that if \(f,f':X\rightarrow {\mathbb {R}}\) give rise to Reeb graphs R and \(R'\), then \(d_\mathrm{I}(C^{R},C^{R'})\le \Vert f-f'\Vert _\infty \) follows almost immediately from the definitions. This justifies calling Theorem 3.8 a stability result in the same way as for the classic algebraic stability theorem.

The following simple example shows that neither inequality in the theorem can be improved:

Example 3.9

Let R be the line segment from \((0,-2)\) to (0, 2) in \({\mathbb {R}}^2\), \(R'\) the circle of radius 2 centered at the origin, and f and \(f'\) the projections to the second coordinate. Then

$$\begin{aligned} d_\mathrm{I}(C^R,C^{R'}) = 1,\quad d_\mathrm{B}(C^R_\mathbf{vec},C^{R'}_\mathbf{vec})= 1,\quad d_\mathrm{B}({\mathscr {B}}_\text {diag}(C^R_\mathbf{vec}),{\mathscr {B}}_\text {diag}(C^{R'}_\mathbf{vec})) = 2. \end{aligned}$$

We leave the verification of the equalities to the reader.

4 Higher-Dimensional Stability

The algebraic stability theorem states that an \(\epsilon \)-interleaving between \({\mathbb {R}}\)-modules M and N induces an \(\epsilon \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\), implying \(d_\mathrm{I}(M,N) = d_\mathrm{B}(M,N)\). The purpose of this section is to prove similar results for \({\mathbb {R}}^n\)-modules. Our first result, Theorem 4.3, is a generalization of AST. There already exist several proofs of AST [3, 15, 16, 18], but our approach has ideas that are applicable to more than just \({\mathbb {R}}\)-modules.

Theorem 4.3 is the most technically challenging application of our proof method, and the proof demonstrates very well exactly when our method works and when it fails. The lesson to take home is that the method gives a bound \(d_\mathrm{B}\le cd_\mathrm{I}\) with some c that increases with the freedom we have in defining the intervals we consider. One needs 2n coordinates to define an n-dimensional (hyper)rectangle, which gives the constant \(2n-1\) in the theorem.

4.1 Rectangle Decomposable Modules

For any interval \(I \subset {\mathbb {R}}^n\), let \(I_i\) denote its projection onto the \(i^\text {th}\) coordinate.

Definition 4.1

A rectangle is an interval of the form \(R = R_1 \times R_2 \times \dots \times R_n\).

Two rectangles R and S are of the same type if \(R_i\setminus S_i\) and \(S_i\setminus R_i\) are bounded for every i. For \(n=1\), we have four types of rectangles:

  • intervals of finite length,

  • intervals of the form \((a,\infty )\) or \([a,\infty )\),

  • intervals of the form \((-\infty ,a)\) or \((-\infty ,a]\),

  • \((-\infty ,\infty )\),

for some \(a \in {\mathbb {R}}\). We see that for \(n \ge 1\), rectangles R and S are of the same type if \(R_i\) and \(S_i\) are of the same type for all \(1 \le i \le n\). Examples of 2-dimensional rectangles are given in Fig. 3.

Fig. 3
figure 3

Three rectangles, where the left and middle rectangles are of the same type (unbounded downwards), while the last is of a different type (unbounded upwards and to the right). Assuming that it contains its boundary, the rightmost rectangle is also an example of a free interval, which we will define in Sect. 4.2

In [16], decorated numbers were introduced. These are endpoints of intervals ‘decorated’ with a plus or minus sign depending on whether the endpoints are included in the interval or not. Let \(\overline{{\mathbb {R}}}={\mathbb {R}}\cup \{{-}\infty ,\infty \}\). A decorated number is of the form \(a^+\) or \(a^-\), where \(a\in \overline{{\mathbb {R}}}\). (The decorated numbers \(-\infty ^-\) and \(\infty ^+\) are never used, as no interval contains points at infinity, but it does not matter whether we include these two points in the definition.) The notation is as follows for \(a,b \in \overline{{\mathbb {R}}}\):

  • \(I = (a^+, b^+)\) if \(I = (a, b]\),

  • \(I = (a^+, b^-)\) if \(I = (a, b)\),

  • \(I = (a^-, b^+)\) if \(I = [a, b]\),

  • \(I = (a^-, b^-)\) if \(I = [a, b)\).

We define decorated points in n dimensions for \(n \ge 1\) as tuples \(a = (a_1, a_2, \dots , a_n)\), where all the \(a_i\)’s are decorated numbers. For an n-dimensional rectangle R and decorated points \((a_1, a_2, \dots , a_n)\) and \((b_1, b_2, \dots , b_n)\), we write \(R = ((a_1, a_2, \dots , a_n),\) \((b_1, b_2,\dots ,b_n))\) if \(R_i = (a_i, b_i)\) for all i. We define \(\mathrm{min}_R\) and \(\mathrm{max}_R\) as the decorated points for which \(R = (\mathrm{min}_R, \mathrm{max}_R)\). We write \(a^*\) for decorated numbers with unspecified ‘decoration’, so \(a^*\) is either \(a^+\) or \(a^-\).

There is a total order on the decorated numbers given by \(a^* < b^*\) for \(a < b\), and \(a^- < a^+\) for all \(a,b \in \overline{{\mathbb {R}}}\). This induces a poset structure on decorated n-dimensional points given by \((a_1, a_2, \dots , a_n) \le (b_1, b_2, \dots , b_n)\) if \(a_i \le b_i\) for all i. We can also add decorated numbers and real numbers by letting \(a^+ + x = (a + x)^+\) and \(a^- + x = (a + x)^-\) for \(a \in \overline{{\mathbb {R}}}\), \(x \in {\mathbb {R}}\). We add n-dimensional decorated points and n-tuples of real numbers coordinatewise.

Definition 4.2

Let M be an \({\mathbb {R}}^n\)-module. If R is a rectangle and \(M\simeq {\mathbb {I}}^R\), M is a rectangle module. If M is interval decomposable and all \(I\in {\mathscr {B}}(M)\) are rectangles, M is rectangle decomposable.

Our goal is to prove the following theorem:

Theorem 4.3

Let \(M = \bigoplus _{I \in {\mathscr {B}}(M)} {\mathbb {I}}^I\) and \(N = \bigoplus _{J \in {\mathscr {B}}(N)} {\mathbb {I}}^J\) be rectangle decomposable \({\mathbb {R}}^n\)-modules. If M and N are \(\delta \)-interleaved, there exists a \((2n-1)\delta \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\). Thus, \(d_\mathrm{B}(M,N) \le (2n-1)d_\mathrm{I}(M,N)\).

We prove the theorem by a mix of combinatorial, geometric, and algebraic arguments. First we show that it is enough to prove the theorem under the assumption that all the rectangles in \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) are of the same type. Then we define a real-valued function \(\alpha \) on the set of rectangles which in a sense measures, in the case \(n=2\), how far ‘up and to the right’ a rectangle is. There is a preorder \(\le _\alpha \) associated to \(\alpha \). The idea behind \(\le _\alpha \) is that if there is a nonzero morphism \(\chi :{\mathbb {I}}^I\rightarrow {\mathbb {I}}^J(\epsilon )\) and \(I\le _\alpha J\), then I and J have to be close to each other. Finding pairs of intervals in \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) that are close is exactly what we need to construct a \((2n-1)\delta \)-matching. Lemmas 4.7 and 4.8 say that such morphisms behave nicely in a precise sense that we will exploit when we prove Lemma 4.9. If we remove the conditions mentioning \(\le _\alpha \), Lemmas 4.7 and 4.8 are not even close to being true, so one of the main points in the proof of Lemma 4.9 is that we must exclude the cases that are not covered by Lemmas 4.7 and 4.8. We do this by proving that a certain matrix is upper triangular, where the ‘bad cases’ correspond to the elements above the diagonal and the ‘good cases’ correspond to elements on and below the diagonal.

Lemma 4.9 is what ties together the geometric and combinatorial parts of the proof of Theorem 4.3. While we prove Lemma 4.9 by geometric arguments, by Hall’s marriage theorem the lemma is equivalent to a statement about matchings between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\). We have to do some combinatorics to get exactly the statement we need, namely that there is a \((2n-1)\delta \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\), and we do this after stating Lemma 4.9.

Fix \(0 \le \delta \in {\mathbb {R}}\). Assume that M and N are \(\delta \)-interleaved, with interleaving morphisms \(f:M \rightarrow N(\delta )\) and \(g:N\rightarrow M(\delta )\). Recall that this means that \(g(\delta )\circ f=\phi _{M, 2 \delta }\) and \(f(\delta )\circ g=\phi _{N,2\delta }\). For any \(I \in {\mathscr {B}}(M)\), we have a canonical injection \({\mathbb {I}}^I\xrightarrow {\iota _I} M\) and projection \(M \xrightarrow {\pi _I} {\mathbb {I}}^I\), and likewise, we have canonical morphisms \({\mathbb {I}}^J \xrightarrow {\iota _J} N\) and \(N \xrightarrow {\pi _J} {\mathbb {I}}^J\) for \(J \in {\mathscr {B}}(N)\). We define

$$\begin{aligned} f_{I,J}&= \pi _J(\delta ) \circ f \circ \iota _I:\, {\mathbb {I}}^I \rightarrow {\mathbb {I}}^J(\delta ), \\ g_{J,I}&= \pi _I(\delta ) \circ g \circ \iota _J:\, {\mathbb {I}}^J \rightarrow {\mathbb {I}}^I(\delta ). \end{aligned}$$

Lemma 4.4

Let \(\chi :{\mathbb {I}}^I \rightarrow {\mathbb {I}}^J\) be a morphism between interval modules. Suppose \(A = I \cap J\) is an interval. Then, for all \(a,b \in A\), \(\chi _a = \chi _b\) as k-endomorphisms.

Proof

Suppose \(a \le b\) and \(a,b \in A\). Then \(\chi _b \circ \phi _{{\mathbb {I}}^I}(a,b)=\phi _{{\mathbb {I}}^J}(a,b) \circ \chi _a\). Since the \(\phi \)-morphisms are identities, we get \(\chi _a = \chi _b\) as k-endomorphisms. By the connectivity axiom for intervals, the equality extends to all elements in A. \(\square \)

Since the intersection of two rectangles is either empty or a rectangle, we can describe a morphism between two rectangle modules uniquely as a k-endomorphism if their underlying rectangles intersect. A k-endomorphism, in turn, is simply multiplication by a constant.

Lemma 4.5

Let R and S be rectangles. Then there exists a nonzero morphism \(\chi :{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S\) if and only if \( \mathrm{min}_S \le \mathrm{min}_R\), \(\mathrm{max}_S \le \mathrm{max}_R\), and \(R\cap S \ne \emptyset \).

Proof

Suppose \(\chi _a\ne 0\), which immediately gives \(a\in R\cap S\), and let \(a\ge x \in R\) and \(a\le y\in S\). We have the following commutative diagram.

figure c

\({\mathbb {I}}^S_x\) is not zero, as there is a nonzero morphism factoring through it. Thus, \(\mathrm{min}_S \le x\) and \(\mathrm{min}_S \le \mathrm{min}_R\). An analogous argument using the square on the right-hand side gives \(\mathrm{max}_R \ge \mathrm{max}_S\).

To prove the converse, define \(\chi \) by \(\chi _a= \text {id}\) for \(a\in R\cap S\) and \(\chi _a= 0\) otherwise. This is well defined unless there are \(a\le b\) such that \(a\in R\setminus S\) and \(b\in R\cap S\), or \(a\in R\cap S\) and \(b\in S\setminus R\), which are impossible by the assumptions \(\mathrm{min}_S \le \mathrm{min}_R\) and \(\mathrm{max}_S \le \mathrm{max}_R\), respectively. \(\square \)

This will come in handy when we prove Lemmas 4.64.7, and 4.8.

We define a function \(w:({\mathscr {B}}(M) \times {\mathscr {B}}(N)) \sqcup ({\mathscr {B}}(N) \times {\mathscr {B}}(M)) \rightarrow k\) by letting \(w(I,J) = x\) if \(f_{I,J}\) is given by multiplication by x, and \(w(I,J)=0\) if \(f_{I,J}\) is the zero morphism. w(JI) is given by \(g_{J,I}\) in the same way. With the definition of w, it is starting to become clear how combinatorics comes into the picture. We can now construct a bipartite weighted directed graph on \({\mathscr {B}}(M)\sqcup {\mathscr {B}}(N)\) by letting w(IJ) be the weight of the edge from I to J. The reader is encouraged to keep this picture in mind, as a lot of what we do in the rest of the proof can be interpreted as statements about the structure of this graph.

The following lemma allows us to break up the problem and focus on the components of M and N with the same types separately.

Lemma 4.6

Let R and T be rectangles of the same type, and S be a rectangle of a different type. Then \(\psi \chi = 0\) for any pair \(\chi :{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S\), \(\psi :{\mathbb {I}}^S \rightarrow {\mathbb {I}}^T\) of morphisms.

Proof

Suppose \(\psi , \chi \ne 0\). By Lemma 4.5, \(\mathrm{min}_R\ge \mathrm{min}_S\ge \mathrm{min}_T\) and \(\mathrm{max}_R\ge \mathrm{max}_S\ge \mathrm{max}_T\). We get \(\mathrm{min}_{R_i}\ge \mathrm{min}_{S_i} \ge \mathrm{min}_{T_i}\) and \(\mathrm{max}_{R_i}\ge \mathrm{max}_{S_i} \ge \mathrm{max}_{T_i}\) for all i, and it follows that if R and T are of the same type, then S is of the same type as R and T. \(\square \)

Let \(f'\) \(: M \rightarrow N(\delta )\) be defined by \(f'_{I,J} = f_{I,J}\) for \(I \in {\mathscr {B}}(M)\) and \(J \in {\mathscr {B}}(N)\) if I and J are of the same type, and \(f'_{I,J} = 0\) if they are not, and let \(g'\) \(: N \rightarrow M(\delta )\) be defined analogously. Here \(f'\) and \(g'\) are assembled from \(f'_{I,J}\) and \(g'_{J,I}\) the same way f and g are from \(f_{I,J}\) and \(g_{J,I}\). Suppose \(I, I' \in {\mathscr {B}}(M)\). Then we have

$$\begin{aligned} \sum _{J \in {\mathscr {B}}(N)} g_{J,I'}(\delta )f_{I,J}\,=\! \sum _{J \in {\mathscr {B}}(N)} {g'_{J,I'}}(\delta )f'_{I,J}. \end{aligned}$$

Since (fg) is an interleaving, the left-hand side is equal to the composition \({\mathbb {I}}^I \xrightarrow {\iota _I} M \xrightarrow {\phi _{M,2 \delta }} M \xrightarrow {\pi _{I'}} {\mathbb {I}}^{I'}\), which is zero if \(I\ne I'\). Thus, if I and \(I'\) are of different types, the left-hand side is zero, while all the summands on the right-hand side are zero by definition of \(f'\) and \(g'\). If I and \(I'\) are of the same type, the equality follows from Lemma 4.6. This means that \(g'(\delta )f' = g(\delta )f\). We also have \(f'(\delta )g' = f(\delta )g\), so \(f'\) and \(g'\) are \(\delta \)-interleaving morphisms. In particular, \(f'\) and \(g'\) are \(\delta \)-interleaving morphisms when restricted to the components of M and N of a fixed type. If we can show that \(f'\) and \(g'\) induce a \((2n-1)\delta \)-matching on each of the mentioned components, we will have proved Theorem 4.3. In other words, we have reduced the problem to the case where all the intervals in \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) are of the same type.

For a decorated number \(a^*\), let \(u(a^*) = a\) if \(a \ne \pm \infty \) and \(u(a^*) = 0\) otherwise. Let \(a=(a_1,a_2,\dots , a_n)\) be a decorated point. We define P(a) to be the number of the decorated numbers \(a_i\) decorated with \(+\), and we also define \(\alpha (a)=\sum _{1\le i\le n}u(a_i)\). What we really want to look at are rectangles and not decorated points by themselves, so we define \(P(R)=P(\mathrm{min}_R)+P(\mathrm{max}_R)\) and \(\alpha (R)= \alpha (\mathrm{min}_R) + \alpha (\mathrm{max}_R)\) for any rectangle R. Let the order \(\le _\alpha \) on rectangles be given by \(R \le _\alpha S\) if either

  • \(\alpha (R) < \alpha (S)\), or

  • \(\alpha (R) = \alpha (S)\) and \(P(R) \le P(S)\).

This defines a preorder. In other words, it is transitive (\(R \le _\alpha S \le _\alpha T\) implies \(R \le _\alpha T\)) and reflexive (\(R \le _\alpha R\) for all R). We write \(R <_\alpha S\) if \(R \le _\alpha S\) and not \(R \ge _\alpha S\).

The order \(\le _\alpha \) is one of the most important ingredients in the proof. The point is that if there is a nonzero morphism from \({\mathbb {I}}^R\) to \({\mathbb {I}}^S(\epsilon )\) and \(R\le _\alpha S\), then R and S have to be close to each other. If \(\epsilon =0\), R and S actually have to be equal. This ‘closeness property’ is expressed in Lemma 4.7, and is also exploited in Lemma 4.8. Finally, in the proof of Lemma 4.9, we make sure that we only have to deal with morphisms \(g_{J,I'}(\delta )\circ f_{I,J}\) for \(I\le _\alpha I'\) and not \(I>_\alpha I'\), so that our lemmas can be applied.

In Fig. 4 we see two rectangles \(R=(0,4)\times (0,4)\) and \(S=(2,5)\times (2,5)\). There is no nonzero morphism from \({\mathbb {I}}^R\) to \({\mathbb {I}}^S\) or \({\mathbb {I}}^{S(1)}\), because \(\mathrm{min}_R<\mathrm{min}_{S(\epsilon )}\) for all \(\epsilon < 2\). This is connected to the fact that \(\alpha (R)=8<14=\alpha (S)\), which can be interpreted to mean that R is ‘further down and to the left’ than S. The point of including P(R) in the definition of \(\alpha \) is that e.g. (ab] is a tiny bit ‘further to the right’ than [ab), and this is a subtlety that P recognizes, and that matters in the proofs of Lemmas 4.7 and 4.8.

Fig. 4
figure 4

Rectangles \(R = (0,4) \times (0,4)\) (purple), \(S = (2,5) \times (2,5)\) (pink), \(S(1) = (1,4) \times (1,4)\) (dotted border), and \(S(2) = (0,3) \times (0,3)\) (dotted border)

Lemma 4.7

Let RS, and T be rectangles of the same type with \(R \le _\alpha T\). Suppose there are nonzero morphisms \(\chi :{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S(\epsilon )\) and \(\psi :{\mathbb {I}}^S\rightarrow {\mathbb {I}}^T(\epsilon )\). Then \({\mathbb {I}}^S\) is \((2n-1)\epsilon \)-interleaved with either \({\mathbb {I}}^R\) or \({\mathbb {I}}^T\).

Proof

We must have either \(R \le _\alpha S\) or \(S \le _\alpha T\). Let us assume the former; the latter is the same. Since \(\chi \ne 0\), it follows from Lemma 4.5 that

  1. (i)

    \(\mathrm{min}_S \le \mathrm{min}_R + \epsilon \),

  2. (ii)

    \(\mathrm{max}_S \le \mathrm{max}_R + \epsilon \).

We can assume that at least one of R and S is \((4n-2)\epsilon \)-significant, since if not, they would be \((2n-1)\epsilon \)-interleaved by zero morphisms. Suppose also

  1. (iii)

    \(\mathrm{min}_R \le \mathrm{min}_S + (2n-1)\epsilon \),

  2. (iv)

    \(\mathrm{max}_R \le \mathrm{max}_S + (2n-1)\epsilon \)

hold. Assume R is \((4n-2)\epsilon \)-significant (replacing R by S changes nothing), so there exists an a such that \(a,a+(4n-2)\epsilon \in R\). Then \(a+(2n-1)\epsilon \in S\), so by Lemma 4.5 and (i)–(iv), there are nonzero morphisms \({\mathbb {I}}^R \rightarrow {\mathbb {I}}^S((2n-1)\epsilon )\) and \({\mathbb {I}}^S \rightarrow {\mathbb {I}}^R((2n-1)\epsilon )\). These can be chosen to be the identity where they are nonzero, and then they are interleaving morphisms.

Therefore, we only need to show (iii) and (iv). It suffices to show \(\mathrm{min}_{R_m} \le \mathrm{min}_{S_m} + (2n-1)\epsilon \) for an arbitrary m; the max case follows from the same arguments. Suppose \(u(\mathrm{min}_{R_m})\ge u(\mathrm{min}_{S_m})+(2n-1)\) \(\epsilon \). This, (i), and (ii) give

$$\begin{aligned} \alpha (S)&=\sum _{i=1}^n u(\mathrm{min}_{S_i}) + \sum _{i=1}^n u(\mathrm{max}_{S_i})\\&\le u(\mathrm{min}_{R_m})-(2n-1)\epsilon + \sum _{i\ne m} (u(\mathrm{min}_{R_i})+\epsilon ) + \sum _{i=1}^n (u(\mathrm{max}_{R_i})+\epsilon )\\&= \sum _{i=1}^n u(\mathrm{min}_{R_i}) + \sum _{i=1}^n u(\mathrm{max}_{R_i})=\alpha (R). \end{aligned}$$

Since \(R \le _\alpha S\), we have equality, which means that

  • \(u(\mathrm{min}_{S_m}) = u(\mathrm{min}_{R_m}) - (2n-1)\epsilon \),

  • \(u(\mathrm{min}_{S_i}) = u(\mathrm{min}_{R_i}) + \epsilon \) for \(i \ne m\),

  • \(u(\mathrm{max}_{S_i}) = u(\mathrm{max}_{R_i}) + \epsilon \) for all i.

But then \(P(\mathrm{min}_{S_i}) \le P(\mathrm{min}_{R_i})\) for \(i \ne m\) and \(P(\mathrm{max}_{S_i}) \le P(\mathrm{max}_{R_i})\) for all i by (i) and (ii), so \(P(\mathrm{min}_{R_m}) \le P(\mathrm{min}_{S_m})\) follows from \(R \le _\alpha S\). Thus, \(\mathrm{min}_{R_m} \le \mathrm{min}_{S_m} + (2n-1)\epsilon \). \(\square \)

Let \(C\ge 4n-2\),

$$\begin{aligned} R= & {} [0,C]^n,\qquad S=[\epsilon ,C+\epsilon ]^{n-1}\times [-(2n-1)\epsilon ,C+\epsilon ],\\ T= & {} [2\epsilon ,C+2\epsilon ]^{n-1}\times [-(4n-2)\epsilon ,C+2\epsilon ]. \end{aligned}$$

These satisfy the hypotheses of Lemma 4.7 and \(d_\mathrm{I}({\mathbb {I}}^R,{\mathbb {I}}^S)=d_\mathrm{I}({\mathbb {I}}^S,{\mathbb {I}}^T) = (2n-1)\epsilon \). This example shows that the constant \(2n-1\) cannot be improved in Lemma 4.7, and this is the source of the same constant in Theorem 4.3.

Lemma 4.8

Let RS, and T be rectangles of the same type with R and T \(2n\epsilon \)-significant and \(\alpha (R) \le \alpha (T)\). Suppose there are nonzero morphisms \(\chi :{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S(\epsilon )\) and \(\psi :{\mathbb {I}}^S \rightarrow {\mathbb {I}}^T(\epsilon )\). Then \(\psi (\epsilon ) \circ \chi \ne 0\).

Proof

It suffices to show that for any m, \(\mathrm{max}_{T_m}>\mathrm{min}_{R_m}+2\epsilon \). If this holds, then R and \(T(2\epsilon )\) intersect, and \(\psi (\epsilon ) \circ \chi \) is nonzero in this intersection.

Assume that \(\chi \) and \(\psi \) are nonzero and that R and T are \(2n\epsilon \)-significant. For all i, we have

  1. (i)

    \(\mathrm{min}_{R_i} + 2\epsilon \ge \mathrm{min}_{T_i}\),

  2. (ii)

    \(\mathrm{max}_{R_i} + 2\epsilon \ge \mathrm{max}_{T_i}\),

  3. (iii)

    \(\mathrm{max}_{R_i} > \mathrm{min}_{R_i} + 2n\epsilon \),

  4. (iv)

    \(\mathrm{max}_{T_i} > \mathrm{min}_{T_i} + 2n\epsilon \).

(i) and (ii) follow from \(\chi , \psi \ne 0\), and Lemma 4.5. (iii) and (iv) are consequences of R and T being \(2n\epsilon \)-significant. Pick \(1\le m\le n\). We get

$$\begin{aligned} 2u(\mathrm{max}_{T_m})&\ge 2n\epsilon + u(\mathrm{min}_{T_m}) + u(\mathrm{max}_{T_m})\\&= 2n\epsilon +\alpha (T)-\sum _{i\ne m} (u(\mathrm{min}_{T_i})+u(\mathrm{max}_{T_i}))\\&\ge 2n\epsilon +\alpha (R)-\sum _{i\ne m} (u(\mathrm{min}_{R_i})+u(\mathrm{max}_{R_i})+4\epsilon )\\&\ge 2n\epsilon -(4n-4)\epsilon + u(\mathrm{min}_{R_m}) + u(\mathrm{max}_{R_m})\\&\ge 2n\epsilon -(4n-4)\epsilon + 2u(\mathrm{min}_{R_m}) + 2n\epsilon = 2u(\mathrm{min}_{R_m}) + 4\epsilon . \end{aligned}$$

Either the inequality \(u(\mathrm{max}_{T_m})\ge u(\mathrm{min}_{R_m}) + 2\epsilon \) is strict, or we get \(R_m = T_m = [u(\mathrm{min}_{R_m}), u(\mathrm{min}_{R_m}) + 2\epsilon ]\). In both cases we have proven what we wanted. \(\square \)

For \(I\in {\mathscr {B}}(M)\), let

$$\begin{aligned} \mu (I) = \{J \in {\mathscr {B}}(N) \mid ~{\mathbb {I}}^I\text { and } {\mathbb {I}}^J\text { are } (2n-1)\delta \text {-interleaved}\}. \end{aligned}$$

In other words, \(\mu (I)\) contains all the intervals that can be matched with I in a \((2n-1)\delta \)-matching. Let \(I \in {\mathscr {B}}(M)\) be \((4n-2)\delta \)-significant, and pick \(p \in {\mathbb {R}}^n\) such that \(p, p+(4n-2)\delta \in I\). Then, \(p + (2n-1)\delta \in J\) for every \(J\in \mu (I)\). Since M and N are pointwise finite dimensional, this means that \(\mu (I)\) is a finite set. For \(A \subset {\mathscr {B}}(M)\), we write \(\mu (A)=\bigcup _{I \in A} \mu (I)\).

Lemma 4.9

Let A be a subset of \({\mathscr {B}}(M)\) containing no \((4n-2)\delta \)-trivial elements. Then \(|A| \le |\mu (A)|\).

Before we prove Lemma 4.9, we show that it implies that there is a \((2n-1)\delta \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\), and thus completes the proof of Theorem 4.3.

Let \(G_\mu \) be the undirected bipartite graph on \({\mathscr {B}}(M) \sqcup {\mathscr {B}}(N)\) with an edge between I and J if \(J \in \mu (I)\). Observe that \(G_\mu \) is the same as the graph \(G_{(2n-1)\delta }\) we defined when we gave the graph theoretical definition of an \(\epsilon \)-matching (in this case, \((2n-1)\delta \)-matching) in Sect. 2. Following that definition, a \((2n-1)\delta \)-matching is a matching in \(G_\mu \) that covers the set of all \((4n-2)\delta \)-significant elements in \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\).

For a subset S of a graph G, let \(A_G(S)\) be the neighborhood of S in G, that is, the set of vertices in G that are adjacent to at least one vertex in S. We now apply Hall’s marriage theorem [21] to bridge the gap between Lemma 4.9 and the statement we want to prove about matchings.

Theorem 4.10

(Hall’s marriage theorem) Let G be a bipartite graph on \(X\sqcup Y\) such that \(A_G(\{x\})\) is finite for all \(x \in X\). Then the following are equivalent:

  • for all \(X' \subset X\), \(|X'| \le |A_G(X')|\),

  • there exists a matching in G covering X.

One of the two implications is easy, since if \(|X'|>|A_G(X')|\) for some \(X' \subset X\), then there is no matching in G covering \(X'\). It is the other implication we will use, namely that the first statement implies the existence of a matching in G covering X.

Letting X be the set of \((4n-2)\delta \)-significant intervals in \({\mathscr {B}}(M)\) and Y be \({\mathscr {B}}(N)\), Hall’s theorem and Lemma 4.9 give us a matching \(\sigma \) in the graph \(G_\mu \) covering all the \((4n-2)\delta \)-significant elements in \({\mathscr {B}}(M)\). By symmetry, we also have a matching \(\tau \) in \(G_\mu \) covering all the \((4n-2)\delta \)-significant elements in \({\mathscr {B}}(N)\). Neither of these is necessarily a \((2n-1)\delta \)-matching, however, as each of them only guarantees that all the \((4n-2)\)-significant intervals in one of the barcodes are matched. We will use \(\sigma \) and \(\tau \) to construct a \((2n-1)\delta \)-matching. This construction is similar to one used to prove the Cantor–Bernstein theorem [1, pp. 110–111].

Let H be the undirected bipartite graph on \({\mathscr {B}}(M) \sqcup {\mathscr {B}}(N)\) for which the set of edges is the union of the edges in the matchings \(\sigma \) and \(\tau \). Let C be a connected component of H. Suppose the submatching of \(\sigma \) in C does not cover all the \((4n-2)\delta \)-significant elements of C. Then there is a \((4n-2)\delta \)-significant \(J\in C \cap {\mathscr {B}}(N)\) that is not matched by \(\sigma \). If we view \(\sigma \) and \(\tau \) as partial bijections \(\sigma :{\mathscr {B}}(M)\nrightarrow {\mathscr {B}}(N)\) and \(\tau :{\mathscr {B}}(N)\nrightarrow {\mathscr {B}}(M)\), we can write C as \(\{J, \tau (J), \sigma (\tau (J)),\tau (\sigma (\tau (J))), \dots \}\). Either this sequence is infinite, or it is finite, in which case the last element is \((4n-2)\delta \)-trivial. In either case, we get that the submatching of \(\tau \) in C covers all \((4n-2)\delta \)-significant elements in C.

By this argument, there is a \((2n-1)\delta \)-matching in each connected component of H. We can piece these together to get a \((2n-1)\delta \)-matching in \({\mathscr {B}}(M)\sqcup {\mathscr {B}}(N)\), so Lemma 4.9 completes the proof of Theorem 4.3.

Proof of Lemma 4.9

Suppose A is infinite. Each interval in A contains a rational point, so since M is pointwise finite dimensional, the cardinality of A is at most finite times countably infinite, which is countable. If \(|A'|\le |\mu (A')|\) for all finite \(A'\subset A\), \(|\mu (A)|\) has no finite upper bound, so it is infinite, which implies \(|A|\le |\mu (A)|\). Thus, it is enough to prove the lemma for finite A, and we will assume this for the rest of the proof.

Because \(\le _\alpha \) is a preorder such that all elements are comparable, we can order \(A = \{I_1, I_2, \dots , I_r\}\) so that \(I_i \le _\alpha I_{i'}\) for all \(i \le i'\). Write \(\mu (A) = \{J_1, J_2, \dots , J_s\}\). For \(I \in {\mathscr {B}}(M)\), we have

$$\begin{aligned} \phi _{{\mathbb {I}}^{I},2\delta }&= \pi _I(2\delta )g(\delta )f \iota _I= \pi _I(2\delta ) \left( \sum _{J \in {\mathscr {B}}(N)}\! g \iota _J \pi _J\right) \!(\delta )f \iota _I \\&= \sum _{J \in {\mathscr {B}}(N)} \!\pi _I(2\delta )g(\delta )\iota _J(\delta )\pi _J(\delta )f \iota _I \,=\! \sum _{J \in {\mathscr {B}}(N)} \!g_{J,I}(\delta )f_{I,J}. \end{aligned}$$

Also, \(\sum _{J \in {\mathscr {B}}(N)} g_{J,I'}(\delta )f_{I,J} = 0\) for \(I \ne I' \in {\mathscr {B}}(M)\), since \(\phi _{M,2\delta }\) is zero between different components of M. Lemma 4.7 says that if \(g_{J,I'}(\delta )f_{I,J} \ne 0\) and \(I \le _\alpha I'\), then J is \((2n-1)\delta \)-interleaved with either I or \(I'\). This means that if \(i < i'\), then

$$\begin{aligned} 0\,=\! \sum _{J \in {\mathscr {B}}(N)} \!g_{J,I_{i'}}(\delta )f_{I_i,J}\,=\! \sum _{J \in \mu (A)}\! g_{J,I_{i'}}(\delta )f_{I_i,J}, \end{aligned}$$
(1)

as \(g_{J,I_{i'}}(\delta ) f_{I_i,J} = 0\) for all J that are not \((2n-1)\delta \)-interleaved with either \(I_i\) or \(I_{i'}\). Similarly,

$$\begin{aligned} \phi _{{\mathbb {I}}^{I_i},2\delta } \,=\! \sum _{J \in {\mathscr {B}}(N)} \!g_{J,I_i}(\delta ) f_{I_i,J}\,=\! \sum _{J \in \mu (A)}\! g_{J,I_i}(\delta ) f_{I_i,J}. \end{aligned}$$
(2)

Writing this in matrix form, we get

$$\begin{aligned} \begin{bmatrix} g_{J_1,I_1}(\delta ) &{} \dots &{} g_{J_s,I_1}(\delta ) \\ \vdots &{} \ddots &{} \vdots \\ g_{J_1,I_r}(\delta ) &{} \dots &{} g_{J_s,I_r}(\delta ) \end{bmatrix} \begin{bmatrix} f_{I_1,J_1} &{} \dots &{} f_{I_r,J_1} \\ \vdots &{} \ddots &{} \vdots \\ f_{I_1,J_s} &{} \dots &{} f_{I_r,J_s} \end{bmatrix}= \begin{bmatrix} \phi _{{\mathbb {I}}^{I_1},2\delta } &{} ? &{} \dots &{} ? \\ 0 &{} \phi _{{\mathbb {I}}^{I_2},2\delta } &{} \dots &{} ? \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 0 &{} 0 &{} \dots &{} \phi _{{\mathbb {I}}^{I_r},2\delta } \end{bmatrix}. \end{aligned}$$

That is, on the right-hand side we have the internal morphisms of the \(I_i\) on the diagonal, and 0 below the diagonal.

Recall that a morphism between rectangle modules can be identified with a k-endomorphism, and that in our notation, \(f_{I,J}\) and \(g_{J,I}\) are given by multiplication by w(IJ) and w(JI), respectively. For an arbitrary morphism \(\psi \) between rectangle modules, we introduce the notation \(w(\psi ) = c\) if \(\psi \) is given by multiplication by c, and 0 otherwise. A consequence of Lemma 4.8 is that \(w(g_{J,I_{i'}}(\delta )f_{I_i,J}) = w(g_{J,I_{i'}})w(f_{I_i,J}) = w(J,I_i)w(I_{i'},J)\) whenever \(I_i \le _\alpha I_{i'}\), in particular if \(i \le i'\). Using (2), we get

$$\begin{aligned} 1= & {} w\bigl (\phi _{{\mathbb {I}}^{I},2\delta }\bigr )=w\left( \sum _{J \in \mu (A)}\!\! g_{J,I_i}(\delta )f_{I_i,J}\right) \,= \!\sum _{J \in \mu (A)}\!\!w(g_{J,I_i}(\delta )f_{I_i,J})\, \\= & {} \! \sum _{J \in \mu (A)}\!\! w(J,I_i) w(I_i,J), \end{aligned}$$

and similarly \(0 = \sum _{J \in \mu (A)} w(J,I_{i'})w(I_i,J)\) for \(i \le i'\) by (1). Again we can interpret this as a matrix equation:

$$\begin{aligned} \begin{bmatrix} w(J_1,I_1) &{} \dots &{} w(J_s,I_1) \\ \vdots &{} \ddots &{} \vdots \\ w(J_1,I_r) &{} \dots &{} w(J_s,I_r) \end{bmatrix}\begin{bmatrix} w(I_1,J_1) &{} \dots &{} w(I_r,J_1) \\ \vdots &{} \ddots &{} \vdots \\ w(I_1,J_s) &{} \dots &{} w(I_r,J_s) \end{bmatrix}=\begin{bmatrix} 1 &{} ? &{} \dots &{} ? \\ 0 &{} 1 &{} \dots &{} ? \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 0 &{} 0 &{} \dots &{} 1 \end{bmatrix}. \end{aligned}$$

That is, the right-hand side is an \(r \times r\) upper triangular matrix with 1’s on the diagonal. The right-hand side has rank |A| and the left-hand side has rank at most \(|\mu (A)|\), so the lemma follows immediately from this equation. \(\square \)

4.2 Free Modules

Definition 4.11

A free interval is an interval of the form \(\langle p \rangle := \{q \mid q \ge p\} \subset {\mathbb {R}}^n\).

For a free interval R, we define \(\mathrm{min}_R\) by \(R = \langle \mathrm{min}_R \rangle \). This makes \(\mathrm{min}_R\) an undecorated point, while we have previously defined \(\mathrm{min}_I\) as decorated points, but this does not matter, as we will not need decorated points in this subsection. We define a free \({\mathbb {R}}^n\)-module as an interval decomposable module whose barcode only contains free intervals. It is easy to see that free intervals are rectangles, so it follows from Theorem 4.3 that \(d_\mathrm{B}(M,N) \le (2n-1)d_\mathrm{I}(M,N)\) for free modules MN. But because of the geometry of free modules, this result can be strengthened.

Theorem 4.12

Let M and N be free \(\delta \)-interleaved \({\mathbb {R}}^n\)-modules with \(n \ge 2\). Then there is a \((n-1)\delta \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\). Thus, \(d_\mathrm{B}(M,N) \le (n-1)\ d_\mathrm{I}(M,N)\).

Using a different method, Botnan and Lesnick [11] proved this for \(n=2\). For \(n\ge 3\), the result is new.

We already did most of the work while proving Theorem 4.3, and there are some obvious simplifications. Firstly, free intervals are \(\epsilon \)-significant for all \(\epsilon \ge 0\). Secondly, for all nonzero \(f:{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S\) and \(g:{\mathbb {I}}^S \rightarrow {\mathbb {I}}^T\) with RST free, gf is nonzero. For \(I \in {\mathscr {B}}(M)\), define \(\nu (I) = \{J \in {\mathscr {B}}(N) \mid ~I \text { and } J \text { are } (n-1)\delta \text { -interleaved}\}\). By the arguments in the proof of Theorem 4.3, we only need to prove Lemma 4.9 with \(\mu \) replaced by \(\nu \). Lemmas 4.7 and 4.8 still hold for free modules, but we need to sharpen Lemma 4.7.

Lemma 4.13

Let RS, and T be free intervals with \(R \le _\alpha T\). Suppose there are morphisms \(0 \ne f:{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S(\epsilon )\) and \(0 \ne g:{\mathbb {I}}^S \rightarrow {\mathbb {I}}^T(\epsilon )\). Then \({\mathbb {I}}^S\) is \((n-1)\epsilon \)-interleaved with either \({\mathbb {I}}^R\) or \({\mathbb {I}}^T\).

Proof

We have \(\mathrm{min}_S \le \mathrm{min}_R + \epsilon \). Suppose \({\mathbb {I}}^R\) and \({\mathbb {I}}^S\) are not \((n-1)\epsilon \)-interleaved. Then \(\mathrm{min}_S + (n-1)\epsilon \ngeq \mathrm{min}_R\) so, for some m, we must have \(\mathrm{min}_{S_m} < \mathrm{min}_{R_m} - (n-1)\epsilon \). We get

$$\begin{aligned} \alpha (S) = \sum _{i=1}^n \mathrm{min}_{S_i} < \mathrm{min}_{R_m} - (n-1)\epsilon + \sum _{i \ne m} ( \mathrm{min}_{R_i} + \epsilon ) = \sum _{i=1}^n \mathrm{min}_{R_i} = \alpha (R). \end{aligned}$$

We can also prove that \(\alpha (T) < \alpha (S)\) if \({\mathbb {I}}^S\) and \({\mathbb {I}}^T\) are not \((n-1)\epsilon \)-interleaved, so we have \(\alpha (T) < \alpha (R)\), a contradiction. \(\square \)

4.3 Block Decomposable Modules

Next, we consider block decomposable modules, which we are interested in because of their relation to zigzag modules, interlevel set stability, and Reeb graphs, explained in Sect. 3. Let \({\mathbb {R}}_+^2 = \{(x,y) \in {\mathbb {R}}^2 \mid x + y \ge 0\}\).

Definition 4.14

A triangle is a nonempty set of the form \(\{(x,y) \!\in \! {\mathbb {R}}_+^2 \mid x< a, \,y < b\}\) for some \((a,b) \in ({\mathbb {R}} \cup \{\infty \})^2\) with \(a + b > 0\).

Thus, a triangle by this definition is a right triangle with a vertical and a horizontal edge and the hypothenus on the diagonal \(x=-y\) as its boundary. For a triangle T as above, we write \(\mathrm{max}_T = (a,b)\). Note that we treat \(\mathrm{max}_T\) as an undecorated point, like \(\mathrm{min}_R\) in the previous subsection. If T is bounded, \(\mathrm{max}_T\) is the maximal element in the closure of T, as illustrated in Fig. 5. A triangle decomposable module is an interval decomposable \({\mathbb {R}}^2\)-module whose barcode only contains triangles.

We will focus on proving stability for open blocks, i.e., blocks of the form \((a,b)_\mathrm{BL}\), as this is the only case where an optimal constant has not been obtained in previous work. If we consider blocks to be subsets of \({\mathbb {R}}^{\text {op}}\times {\mathbb {R}}\) instead of \({\mathbb {U}}\), open blocks correspond to triangles under the isomorphism of posets \({\mathbb {R}}^{\text {op}}\times {\mathbb {R}}\rightarrow {\mathbb {R}}^2\) flipping the x-axis. We prefer to consider triangles, as \({\mathbb {R}}^2\) fits better into the framework we have built than \({\mathbb {R}}^{\text {op}}\times {\mathbb {R}}\).

Fig. 5
figure 5

A bounded triangle T

Theorem 4.15

Let M and N be triangle decomposable modules. If M and N are \(\delta \)-interleaved, there exists a \(\delta \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\). Thus, \(d_\mathrm{I}(M,N)=d_\mathrm{B}(M,N)\).

As we did with the rectangles, we can split the triangles into sets of various ‘types’. We get four different types of triangles T, depending on whether \(\mathrm{max}_T\) is of the form (ab), \((\infty ,b)\), \((a,\infty )\), or \((\infty ,\infty )\) for \(a,b\in {\mathbb {R}}\). Now a result analogous to Lemma 4.6 holds, implying that it is enough to show Theorem 4.15 under the assumption that the barcodes only contain intervals of a single type. The case in which the triangles are bounded is the hardest one, and the only one we will prove. So from now on, we assume all triangles to be bounded.

Again, we reuse parts of the proof of Theorem 4.3. For \(I \in {\mathscr {B}}(M)\), we define

$$\begin{aligned} \nu (I) = \{J \in {\mathscr {B}}(N) \mid ~{\mathbb {I}}^I \text { and } {\mathbb {I}}^J \text { are } \delta \text { -interleaved}\}. \end{aligned}$$

The discussion about Hall’s theorem is still valid, so we only need to prove the analogue of Lemma 4.9 for \(\nu \). For \(\mathrm{max}_T=(a,b)\), define \(\alpha (T) = a+b\). The only things we need to complete for the proof of the analogue of Lemma 4.9 for triangle decomposable modules, are the following analogues of Lemmas 4.7 and 4.8:

Lemma 4.16

Let RS, and T be triangles with \(\alpha (R)\le \alpha (T)\). Suppose there are morphisms \(f:{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S(\epsilon )\) and \(g:{\mathbb {I}}^S\rightarrow {\mathbb {I}}^T(\epsilon )\) such that \(g(\epsilon ) \circ f \ne 0\). Then \({\mathbb {I}}^S\) is \(\epsilon \)-interleaved with either \({\mathbb {I}}^R\) or \({\mathbb {I}}^T\).

Lemma 4.17

Let RS, and T be triangles with T \(2\epsilon \)-significant and \(\alpha (R) \le \alpha (T)\). Suppose there are nonzero morphisms \(f:{\mathbb {I}}^R \rightarrow {\mathbb {I}}^S(\epsilon )\) and \(g:{\mathbb {I}}^S \rightarrow {\mathbb {I}}^T(\epsilon )\). Then \(g(\epsilon )\circ f\ne 0\).

Proof of Lemma 4.16

Suppose \({\mathbb {I}}^R\) and \({\mathbb {I}}^S\) are not \(\epsilon \)-interleaved, and write \(\mathrm{max}_R=(r_1,r_2)\) and \(\mathrm{max}_S=(s_1,s_2)\). Then \(\mathrm{max}_S \ngeq \mathrm{max}_R - \epsilon \), so \(s_1<r_1-\epsilon \) or \(s_2<r_2-\epsilon \). At the same time, \(\mathrm{max}_R \ge \mathrm{max}_S - \epsilon \) since f is nonzero, which gives \(s_i\le r_i+\epsilon \) for each i. Thus,

$$\begin{aligned} \alpha (S)=s_1+s_2<r_1+r_2-\epsilon +\epsilon = \alpha (R). \end{aligned}$$

Assuming that \({\mathbb {I}}^S\) and \({\mathbb {I}}^T\) are not \(\epsilon \)-interleaved, either, we also get \(\alpha (S) > \alpha (T)\). Thus \(\alpha (R) > \alpha (T)\), a contradiction. \(\square \)

Proof of Lemma 4.17

We have \(\mathrm{max}_T - \epsilon \le \mathrm{max}_S\) and \(\mathrm{max}_S - \epsilon \le \mathrm{max}_R\), so \(\mathrm{max}_T - 2\epsilon \le \mathrm{max}_R\). Because T is \(2\epsilon \)-significant, \(\mathrm{max}_T - 2\epsilon - \epsilon ' \in {\mathbb {R}}_+^2\) for some \(\epsilon ' > 0\). Combining these facts, we get \(\mathrm{max}_T - 2\epsilon - \epsilon ' \in R\), so \((g(\epsilon ) \circ f)_{\mathrm{max}_T - 2\epsilon - \epsilon '} \ne 0\). \(\square \)

Theorem 4.15 implies \(d_\mathrm{B}(M,N) = d_\mathrm{I}(M,N)\) for block decomposable M and N such that \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) only have blocks of the form \((a,b)_\mathrm{BL}\) (so no closed or half-closed blocks). Our proof technique extends easily to prove the same equality for all block decomposable M and N. In fact, \(d_\mathrm{B}(M,N) \le d_\mathrm{I}(M,N)\) in the case where all the intervals in the barcodes are of the form \([a,b]_\mathrm{BL}\) follows from Theorem 4.12 with \(n=2\) by the correspondence \([a,b]_\mathrm{BL}\leftrightarrow \langle (-a,b)\rangle \), while the two cases with half-open blocks are both essentially the algebraic stability theorem. A variant of Lemma 4.6 and the discussion following it would allow us to handle all the cases simultaneously. We omit the details, and anyway the closed and half-open cases are taken care of in [11]. Thus, either by appealing to previous work for the other cases or using our own methods, we get

Theorem 4.18

Let M and N be block decomposable modules. If M and N are \(\delta \)-interleaved, there exists a \(\delta \)-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\). Thus, \(d_\mathrm{I}(M,N)=d_\mathrm{B}(M,N)\).

5 Counterexamples to a General Algebraic Stability Theorem

Theorem 4.3 gives an upper bound of \(2n-1\) on \(d_\mathrm{B}/d_\mathrm{I}\) for rectangle decomposable modules, which increases with the dimension. An obvious question is whether it is possible to improve this, or if the constant \(2n-1\) in Theorem 4.3 is optimal. We know that \(d_\mathrm{B}(M,N) \ge d_\mathrm{I}(M,N)\) for any M and N whenever the bottleneck distance is defined, so for \(n = 1\), the constant is optimal. For \(n > 1\), however, it turns out that the equality \(d_\mathrm{B}(M,N) = d_\mathrm{I}(M,N)\) does not always hold, and the geometry becomes more complicated when n increases. In Example 5.2, we construct rectangle decomposable \({\mathbb {R}}^2\)-modules M and N with \(d_\mathrm{B}(M,N) = 3d_\mathrm{I}(M,N)\), showing that the bound is optimal for \(n=2\), as well. This is a counterexample to a conjecture made in a previous version of [11] (Conjecture 8.4 in Paper II of [8]) which claims that interval decomposable \({\mathbb {R}}^n\)-modules M and N such that \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) only contain convex intervals are \(\epsilon \)-matched if they are \(\epsilon \)-interleaved. As a consequence of this counterexample, they weakened the conjecture to saying that there are constants \(c_n\) depending on n such that \(d_\mathrm{B}\le c_nd_\mathrm{I}\) for such modules. This problem is still open, and there are no known counterexamples even if we put all the \(c_n\) equal to 3.

Before the example with \(d_\mathrm{B}(M,N) = 3d_\mathrm{I}(M,N)\), we give a simpler example with \(d_\mathrm{B}(M,N) = 2d_\mathrm{I}(M,N)\). These easily generalize to examples with \(d_\mathrm{B}(M,N) = 2d_\mathrm{I}(M,N)\) and \(d_\mathrm{B}(M,N) = 3d_\mathrm{I}(M,N)\) in n dimensions for any \(n \ge 2\). For instance, one can replace M and N with \(M \times I^{n-2}\) and \(N \times I^{n-2}\) for a sufficiently large interval I to get such examples in n dimensions.

Example 5.1

Let \({\mathscr {B}}(M) = \{I_1, I_2, I_3 \}\)Footnote 2 and \({\mathscr {B}}(N) = \{J \}\), where

$$\begin{aligned} I_1&= (-3,1) \times (-1,3),&I_2&= (-1,3) \times (-3,1),\\ I_3&= (-1,1) \times (-1,1),&J&= (-2,2) \times (-2,2). \end{aligned}$$

See Fig. 6. We can define 1-interleaving morphisms \(f:M \rightarrow N(1)\) and \(g:N \rightarrow M(1)\) by letting \(w(I_1,J) = w(I_2,J) = w(I_3,J) = w(J,I_1) = w(J,I_2) = 1\) and \(w(J,I_3) = -1\), where w is defined as in the proof of Theorem 4.3. On the other hand, in any matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) we have to leave either \(I_1\) or \(I_2\) unmatched, and they are \(\epsilon \)-significant for all \(\epsilon <4\). In fact, any possible matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) is a 2-matching. Thus \(d_\mathrm{I}(M,N)=1\) and \(d_\mathrm{B}(M,N) = 2\).

Fig. 6
figure 6

M and N\(I_1\) and \(I_2\) are the light purple squares, \(I_3\) is deep purple, and J is pink

A crucial point is that even though \(w(I_1,J)\), \(w(J,I_2)\), \(w(I_2,J)\), and \(w(J,I_1)\) are all nonzero, both \(g_{J,I_2} \circ f_{I_1, J}\) and \(g_{J,I_1} \circ f_{I_2, J}\) are zero. To do the same with one-dimensional intervals, we would have to shrink \(I_1\) and \(I_2\) so much that they were no longer 2-significant (see Lemma 4.8), and then they would not need to be matched in a 1-matching. This shows how the geometry of higher dimensions can allow us to construct examples that would not work in lower dimensions.

Next, we give an example of rectangle decomposable \({\mathbb {R}}^2\)-modules M and N such that \(d_\mathrm{B}(M,N) = 3d_\mathrm{I}(M,N)\), proving that our upper bound of \(2n-1\) is the best possible for \(n=2\).

Fig. 7
figure 7

\(I_1\), \(I_2\), and \(I_3\) are the filled pink rectangles, and \(J_1\), \(J_2\), and \(J_3\) are the black rectangles without fill

Example 5.2

Let \({\mathscr {B}}(M) = \{I_1, I_2, I_3 \}\) and \({\mathscr {B}}(N) = \{J_1, J_2, J_3 \}\), where

$$\begin{aligned} I_1&= (0,10) \times (1,11),&I_2&= (0,12) \times (-1,11),&I_3&= (2,10) \times (1,9),\\ J_1&= (1,11) \times (0,10),&J_2&= (1,9) \times (0,12),&J_3&= (-1,11) \times (2,10). \end{aligned}$$

The rectangles in \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) are shown in Fig. 7. We give an example of 1-interleaving morphisms f and g that we write in matrix form. In the first matrix, \(w(I_i,J_j)\) is in row i, column j. In the second, \(w(J_j, I_i)\) is in row j, column i.

$$\begin{aligned} f:\begin{bmatrix} 1&{}1&{}1 \\ 1&{}1&{}0 \\ 1&{}0&{}1\end{bmatrix},\qquad g:\begin{bmatrix} -1&{}1&{}1 \\ 1&{}0&{}-1 \\ 1&{}-1&{}0\end{bmatrix}. \end{aligned}$$

This means that M and N are 1-interleaved, but they are not \(\epsilon \)-interleaved for any \(\epsilon < 1\), so \(d_\mathrm{I}(M,N) = 1\). The following matrix shows \(d_\mathrm{I}({\mathbb {I}}^{I_i},{\mathbb {I}}^{J_j})\) in position (ij):

$$\begin{aligned} \begin{bmatrix} 1&{}1&{}1 \\ 1&{}3&{}3 \\ 1&{}3&{}3\end{bmatrix} \end{aligned}$$

This is straightforward to check. For instance, the difference between \(\mathrm{max}_{I_2} = (12,11)\) and \(\mathrm{max}_{J_2} = (9,12)\) is 3 in the first coordinate, so \(I_2\) and \(J_2\) are not \(\epsilon \)-interleaved for any \(\epsilon <3\), and thus, \(d_\mathrm{I}({\mathbb {I}}^{I_2},{\mathbb {I}}^{J_2})\ge 3\). We see from the table that any \(\epsilon \)-matching with \(\epsilon <3\) between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) has to match both \(I_2\) and \(I_3\) with \(J_1\), which is not possible. Therefore, \(d_\mathrm{B}(M,N)\ge 3\). On the other hand, any bijection between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\) is a 3-matching, so \(d_\mathrm{B}(M,N) = 3\).

There is a strong connection between n-dimensional rectangle decomposable modules and 2n-dimensional free modules. This is related to the fact that we need 2n coordinates to determine an n-dimensional rectangle, and also 2n coordinates to determine a 2n-dimensional free interval. The following example illustrates this connection, as we simply rearrange the coordinates of \(\mathrm{min}_{R},\mathrm{max}_{R}\) for all rectangles R involved in Example 5.2 to get 4-dimensional free modules with similar properties as in Example 5.2.

Example 5.3

Let \({\mathscr {B}}(M) = \{I_1, I_2, I_3 \}\) and \({\mathscr {B}}(N) = \{J_1, J_2, J_3 \}\), where

$$\begin{aligned} I_1&= \langle (0,1,10,11) \rangle ,&I_2&= \langle (0,-1,12,11) \rangle ,&I_3&= \langle (2,1,10,9) \rangle ,\\ J_1&= \langle (1,0,11,10) \rangle ,&J_2&= \langle (1,0,9,12) \rangle ,&J_3&= \langle (-1,2,11,10) \rangle . \end{aligned}$$

Compare with the intervals \(I_i\) and \(J_j\) in Example 5.2. We have 1-interleaving morphisms defined the same way as in Example 5.2. Just as in that example, we can deduce that there is nothing better than a 3-matching between \({\mathscr {B}}(M)\) and \({\mathscr {B}}(N)\), so \(d_\mathrm{B}(M,N) = 3\) and \(d_\mathrm{I}(M,N) = 1\).

As a consequence of this example, we get that our upper bound of \(d_\mathrm{B}/d_\mathrm{I} \le n-1\) for free n-dimensional modules cannot be improved for \(n=4\).

6 Relation to the Complexity of Calculating Interleaving Distance

The interleaving distance between arbitrary persistence modules is on the surface not easy to compute, as naively trying to construct interleaving morphisms can quickly lead to a complicated set of equations for which it is not clear that one can decide if there is a solution in polynomial time. For \({\mathbb {R}}\)-modules, however, the interval decomposition theorem plus the algebraic stability theorem gives us a polynomial time algorithm to compute \(d_\mathrm{I}\): decompose the modules into interval modules and find the bottleneck distance. Since \(d_\mathrm{I} = d_\mathrm{B}\), this gives us the interleaving distance. When the barcodes exist, one can compute the bottleneck distance in polynomial time also in two dimensions [20], but the approach fails for general \({\mathbb {R}}^n\)-modules already at the first step, as we do not have a nice decomposition theorem. But in the recent proof that calculating interleaving distance is NP-hard [7], it is the failure of the second step that is exploited. Specifically, a set of modules that decompose nicely into interval modules (staircase modules, to be precise) is constructed, but for these, \(d_\mathrm{I}\) and \(d_\mathrm{B}\) are different. It turns out that calculating \(d_\mathrm{I}\) for these corresponds to deciding whether certain matrix invertibility problems called constrained invertibility problems (CI problems) defined in [6] are solvable, which is shown to be NP-hard.

Though rectangle modules are not considered in the NP-hardness proof, they have similar properties to staircase modules. The only significant difference in this setting is that in a fixed dimension, rectangle modules are defined by a limited number of coordinates, or “degrees of freedom”, while there is no such restriction on staircase modules even in dimension 2. Example 5.2 is essentially a CI problem with a corresponding pair of modules. Importantly, it shows that \(d_\mathrm{I}= d_\mathrm{B}\) does not hold in general for modules corresponding to CI problems. This crucial observation, which appeared first in a preprint of this paper, opened the door to proving NP-hardness of calculating \(d_\mathrm{I}\) by the approach used in [7].

In [7], it is also shown that c-approximating \(d_\mathrm{I}\) is NP-hard for \(c<3\), where an algorithm is said to c-approximate \(d_\mathrm{I}\) if it returns a number in the interval \([d_\mathrm{I}(M,N), cd_\mathrm{I}(M,N)]\) for any input pair MN of modules. Whether the approach by CI problems can be used to prove hardness of c-approximation for \(c\ge 3\) is closely related to the question of whether Theorem 4.3 can be strengthened: It can be shown that if \(d_\mathrm{B}(M,N)\le cd_\mathrm{I}(M,N)\) holds for all pairs MN of rectangle decomposable modules, the same holds for staircase modules, and therefore there is a polynomial time algorithm c-approximating \(d_\mathrm{I}\) for these, meaning that the strategy of going through CI problems will not give a proof that c-approximation of \(d_\mathrm{I}\) is NP-hard. On the other hand, if one can find an example of rectangle decomposable modules M and N such that \(d_\mathrm{B}(M,N) = cd_\mathrm{I}(M,N)\) for \(c>3\), one might be able to use that to increase the constant 3 in the approximation hardness result. Thus, there is a strong link between stability of rectangle decomposable modules and the only successful method so far known to the author of determining the complexity of computing or approximating multiparameter interleaving distance.