Skip to main content
Erschienen in: Foundations of Computational Mathematics 1/2019

Open Access 30.01.2018

Tropical Coordinates on the Space of Persistence Barcodes

verfasst von: Sara Kališnik

Erschienen in: Foundations of Computational Mathematics | Ausgabe 1/2019

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

The aim of applied topology is to use and develop topological methods for applied mathematics, science and engineering. One of the main tools is persistent homology, an adaptation of classical homology, which assigns a barcode, i.e., a collection of intervals, to a finite metric space. Because of the nature of the invariant, barcodes are not well adapted for use by practitioners in machine learning tasks. We can circumvent this problem by assigning numerical quantities to barcodes, and these outputs can then be used as input to standard algorithms. It is the purpose of this paper to identify tropical coordinates on the space of barcodes and prove that they are stable with respect to the bottleneck distance and Wasserstein distances.
Hinweise
Communicated by Herbert Edelsbrunner.

1 Introduction

In the past two decades, with the emergence of ‘big data,’ topology started playing a more prominent role in data analysis [5, 6]. Topological ideas have inspired methods for visualizing complex datasets [28] as well as ‘measuring’ the shape of data. Using the most famous example of the latter, persistent homology [8, 17], researchers have solved problems in sensor networks [3, 21], medicine [2, 19], neuroscience [11, 15, 22] and gained insights into texture images [26].
The output of persistent homology is a barcode, i.e., a collection of intervals. The unusual structure of the invariant makes the method hard to combine with standard algorithms within machine learning. For this reason, various attempts have been made to assign numerical quantities to barcodes or to send these objects into a Hilbert space through a feature map, where computations are easier [1, 4, 9, 10, 16, 18, 27]. For example, Di Fabio and Ferri [16, 18] assign complex vectors to barcodes, Bubenik [4] persistence landscapes.
Adcock et al. [1] identified an algebra of polynomials on the barcode space that can be used as coordinates. The problem with these functions is that they are not stable (i.e., Lipschitz) with respect to the Bottleneck and Wasserstein p-distances usually used. This prompted us to search for other types of coordinates. All the aforementioned distances on the barcode space are defined by matching intervals from one barcode to another and computing penalties that involve taking maxima. For this reason, the max and min functions, i.e., tropical functions, seemed like a natural choice, and as it turns out, they are indeed more suitable given the underlying structure of the barcode space.
We represent a barcode with exactly n intervals as a vector \((x_1, d_1, x_2, d_2, \ldots , x_n, d_n)\), where \(x_i\) denotes the left endpoint of the ith interval and \(d_i\) its length. We assume that \(x_i \ge 0\) for all i. This is not unreasonable since when constructing simplicial complexes from point clouds, the parameter is radius, which is nonnegative. This condition is also crucial later on in the construction when taking filtered inverse limits as it ensures a good behavior of certain maps when appropriately restricted. Since the ordering of the intervals does not matter, we take the orbit space, \(B_n\), of the action of the symmetric group on n letters on the product \(([0, \infty ) \times [0, \infty ))^n\) given by permuting the coordinates. The barcode space, B, is the quotient
$$\begin{aligned} \coprod _n B_n /_{\sim }, \end{aligned}$$
where \(\sim \) is generated by equivalences of the form
$$\begin{aligned} \{(x_1, d_1), (x_2, d_2), \ldots , (x_n, d_n) \} \sim \{(x_1, d_1), (x_2, d_2), \ldots , (x_{n-1}, d_{n-1})\}, \end{aligned}$$
whenever \(d_n=0\).
After a short review of tropical algebra and persistent homology in Sects. 2 and 3, Sect. 4 is devoted to establishing the properties of 2-symmetric max-plus polynomials that respect this equivalence relation. In particular, Theorem 4.5 provides a list of generators for this semiring. Unfortunately, this condition is so limiting that the only functions satisfying it involve only lengths of intervals. While we prove that these are individually stable with respect to the bottleneck and Wasserstein distances, there are not enough of them to separate the barcodes. In fact, in contrast to ordinary polynomials, no finite set exists that separates barcodes in \(B_n\) (Theorem 6.1). This forces us to expand the semiring of observed functions to tropical rational functions. We find a countable generating set (Theorem 6.7) that separates the barcodes and prove that each function in this set is stable with respect to the bottleneck and Wasserstein distances (Theorems 7.1 and 7.3). These functions and their sums, minima and maxima can be used by researchers interested in analyzing datasets of shapes. In Sect. 8, we give an example that demonstrates how they can be used to classify digits from the MNIST dataset.
Of course, a natural question that arises is how to select finitely many functions from this infinite family that we identify. In the case when we deal with barcodes whose birth and death times only take finitely many values, it is not hard to find finitely many functions that separate them (this is further discussed in Sect. 8 on a particular example). Even here we might run into trouble because the vectors we obtain might be very high-dimensional. We are currently working on automating this step and using machine learning methods (for example, the Lasso method) on this collection of coordinate functions to select their weights.

2 Tropical Functions

This section reviews the material that first appeared in symmetric and r-symmetric tropical polynomials and rational functions [7].

2.1 Min-plus and Max-plus Polynomials

Tropical algebra is based on the study of the tropical semiring \((\mathbb {R}\cup \{\infty \}, \oplus , \odot )\). In this semiring, addition and multiplication are defined as follows:
$$\begin{aligned} \begin{array}{ccc} a\oplus b := \min {(a, b)}&\, \text {and} \,&a\odot b := a+b. \end{array} \end{aligned}$$
Both are commutative and associative. The times operator \(\odot \) takes precedence when plus \(\oplus \) and times \(\odot \) occur in the same expression. The distributive law holds:
$$\begin{aligned} a \odot (b\oplus c) = a\odot b \oplus a\odot c. \end{aligned}$$
Moreover, the Frobenius identity (Freshman’s Dream) holds for all powers n in tropical arithmetic:
$$\begin{aligned} (a \oplus b)^n = a^n \oplus b^n. \end{aligned}$$
(2.1)
Both arithmetic operations have a neutral element. Infinity is the neutral element for addition, and zero is the neutral element for multiplication:
$$\begin{aligned} x \oplus \infty = x \quad \text { and }\quad x \odot 0 = x. \end{aligned}$$
Related to the tropical semiring is the arctic semiring \((\mathbb {R}\cup \{-\infty \}, \boxplus , \odot )\), where multiplication of two elements is defined as before, but adding means taking their maximum instead of the minimum:
$$\begin{aligned} \begin{array}{ccc} a\boxplus b := \max {(a, b)}&\quad \text {and} \quad&a\odot b := a+b. \end{array} \end{aligned}$$
Its operations are associative, commutative and distributive as in the tropical semiring.
Let \(x_1, x_2, \ldots , x_n\) be variables representing elements in the max-plus semiring. A max-plus monomial expression is any product of these variables, where repetition is allowed. By commutativity, we can sort the product and write monomial expressions with the variables raised to exponents.
A max-plus polynomial expression is a finite linear combination of max-plus monomial expressions:
$$\begin{aligned} p(x_1, x_2, \ldots , x_n)= & {} a_1\odot x_1^{a_1^1} x_2^{a_2^1} \ldots x_n^{a_n^1} \boxplus a_2\odot x_1^{a_1^2} x_2^{a_2^2} \ldots x_n^{a_n^2}\\&\boxplus \ldots \boxplus a_m\odot x_1^{a_1^m} x_2^{a_2^m} \ldots x_n^{a_n^m}, \end{aligned}$$
Here the coefficients \(a_1, a_2, \ldots a_m\) are real numbers and the exponents \(a_j^i\) for \({1\le j \le n}\) and \({1\le i \le m}\) are nonnegative integers.
The total degree of a max-plus expression\(p(x_1, x_2, \ldots , x_n)\) is
$$\begin{aligned} {\text {deg}} p = {\max _{1\le i \le m}(a_1^i+ a_2^i + \ldots + a_n^i)}. \end{aligned}$$
The passage from max-plus polynomial expressions to functions is not one-to-one. For example,
$$\begin{aligned} x_1^2 \boxplus x_2^2 = x_1^2 \boxplus x_2^2 \boxplus x_1x_2 \end{aligned}$$
for all \(x_1, x_2\), and therefore, the functions defined by \(x_1^2 \boxplus x_2^2 \) and \( x_1^2 \boxplus x_2^2 \boxplus x_1x_2\) are the same, though the expressions are formally different.
Considered as a function, \(p:\mathbb {R}^n \rightarrow \mathbb {R}\) has the following three properties:
  • p is continuous,
  • p is piecewise linear, where the number of pieces is finite, and
  • p is convex.
Max-plus monomials are the linear functions with nonnegative integer coefficients.
Let p and q be max-plus polynomial expressions. If
$$\begin{aligned} p(x_1, x_2, \ldots , x_n) = q(x_1, x_2, \ldots , x_n) \end{aligned}$$
for all \((x_1, x_2, \ldots , x_n)\in (\mathbb {R}\cup \infty )^n\), then p and q are functionally equivalent. We write \(p \sim q\).
The minimal representation of a max-plus polynomial p is such a max-plus expression
$$\begin{aligned} a_1\odot x_1^{i_1^1} x_2^{i_2^1} \ldots x_n^{i_n^1} \boxplus a_2\odot x_1^{i_1^2} x_2^{i_2^2} \ldots x_n^{i_n^2}\boxplus \cdots \boxplus a_m\odot x_1^{i_1^m} x_2^{i_2^m} \ldots x_n^{i_n^m} \end{aligned}$$
functionally equivalent to p that for each \(1\le j \le m\) there exists a point \({(x_1, x_2, \ldots , x_n) \in \mathbb {R}^n}\), so that
$$\begin{aligned} a_j+i_1^jx_1 +\ldots +i_n^jx_n > \max _{1\le s\le m, s \ne j} (a_s+i_1^s x_1 +\ldots + i_n^s x_n). \end{aligned}$$
Definition 2.2
Max-plus polynomials are the semiring of equivalence classes of max-plus polynomial expressions with respect to \(\sim \). In the case of n variables, we denote the semiring by \(\mathtt {MaxPlus}[x_1, x_2, \ldots , x_n]\).
We define min-plus polynomials expression as max-plus with \(\boxplus \) replaced by \(\oplus \). We define the degree of a min-plus polynomial expression analogously.
Definition 2.3
Min-plus polynomials are the semiring of equivalence classes of min-plus polynomial expressions with respect to functional equivalence relation \(\sim \). In the case of n variables we denote the semiring by \(\mathtt {MinPlus}[x_1, x_2, \ldots , x_n]\).
It can be shown that degrees of all max-plus (min-plus) expressions in the same equivalence class are the same and that it is therefore possible to define the degree of a max-plus (min-plus) polynomial.

2.2 Rational Tropical Functions

A tropical rational expressionr is a quotient
$$\begin{aligned} r(x_1, \ldots , x_n) = p(x_1, \ldots , x_n) \odot q(x_1, \ldots , x_n)^{-1} = p(x_1, \ldots , x_n)-q(x_1, \ldots , x_n), \end{aligned}$$
where p and q are min-plus polynomial expressions.
Definition 2.4
The semiring of equivalence classes of tropical rational expressions with respect to the functional equivalence relation is \(\mathtt {RTrop}[x_1, x_2, \ldots , x_n]\) and is called the semiring of rational tropical functions.
We will need the following statement later on.
Lemma 2.5
A tropical rational function r in n variables gives a decomposition of \(\mathbb {R}^n\) into a family of closures of open sets on which the function is affine, and the boundaries of these domains are piecewise linear.
Proof
A min-plus polynomial p is a piecewise linear concave function, and its domains of linearity consist of the cells in a polyhedral subdivision \(\Sigma _p\) as in [24, Definition 2.5.5]. A tropical rational function r has the form \(p-q\) where p and q are both min-plus polynomials. Let \(\Sigma = \Sigma _p \wedge \Sigma _q\) be the common refinement of the corresponding polyhedral decompositions of \(\mathbb {R}^n\), as defined prior to [24, equation (2.3.1)]. Then, \(p-q\) is linear on each cell of \(\Sigma \), and the boundaries of these cells are polyhedral balls or spheres. \(\square \)
Since
$$\begin{aligned} -{\text {min}}(a, b) = {\text {max}}(-a, -b), \end{aligned}$$
tropical rational expressions are composed by taking finitely many maxima and minima of linear functions, i.e., the set of tropical rational expressions is the smallest subset of functions \(\mathbb {R}^n\rightarrow \mathbb {R}\) containing all constant maps and projections that is closed under taking finitely many \(+\), \(\min \) and \(\max \).
Conversely, any function from the latter set can be represented by an expression of the form \(p \odot q^{-1}\), where p and q are tropical polynomial expressions. The algorithm to produce p and q is the usual one of adding fractions by finding a common denominator, but performed in tropical arithmetic [7].
Example 2.6
Let \(r(x_1, x_2) = x_2x_1^{-1} \oplus (x_2)^{-1} \oplus (x_2 x_1 \oplus x_1)^{-1}\). We can write
$$\begin{aligned} r(x_1, x_2)= & {} x_2 x_1^{-1} \oplus (x_2)^{-1} \oplus (x_2 x_1 \oplus x_1)^{-1}\\= & {} x_2^2 (x_2 \oplus 0) (x_1x_2 (x_2 \oplus 0))^{-1} \oplus (x_1 (x_2 \oplus 0))(x_1x_2 (x_2 \oplus 0))^{-1}\\&\quad \oplus (x_2(x_2 x_1 \oplus x_1))^{-1}\\= & {} (x_2^3 \oplus x_2^2 \oplus x_1x_2 \oplus x_1 \oplus x_2) (x_1x_2^2\oplus x_1x_2)^{-1} \\= & {} (x_2^3 \oplus x_1 \oplus x_2) \odot (x_1x_2^2 \oplus x_1x_2)^{-1}. \end{aligned}$$
As a consequence, any tropical rational expression (or equivalently, any map composed by taking finitely many maxima and minima of linear functions) in \(x_1, \ldots , x_n\) can be written in ordinary arithmetic as
$$\begin{aligned} \max _{i=1, \ldots , l_1} (\sum _{k=1}^n a_{k, i} x_k + c_i) - \max _{j=1, \ldots , l_2} (\sum _{k=1}^n s_{k, j} x_k + u_j) \end{aligned}$$
for some \(a_{k, i}\), \(c_i\), \(s_{k, j}\) and \(u_j\) where \(k\in \{1, \ldots , n\}, i\in \{1, \ldots , l_1\}\) and \(j \in \{1, \ldots , l_2\}\).
The functions contained in either \(\mathtt {MinPlus}[x_1, x_2, \ldots , x_n]\), \(\mathtt {MaxPlus}[x_1, x_2, \ldots , x_n]\) or \(\mathtt {RTrop}[x_1, x_2, \ldots , x_n]\) are called tropical functions.

2.3 Symmetric and 2-Symmetric Tropical Functions

Definition 2.7
A tropical function f is symmetric if
$$\begin{aligned} f(x_1,\ldots , x_n) = f(x_{\pi (1)},\ldots ,x_{\pi (n)}) \end{aligned}$$
for every permutation \(\pi \in S_n\).
Given variables \(x_1, \ldots , x_n\), we define the elementary symmetric max-plus polynomials\(\sigma _1,\ldots , \sigma _n \in \mathtt {MaxPlus}[x_1, x_2, \ldots , x_n]\) by the formulas
$$\begin{aligned} \begin{array}{lcl} \sigma _1 &{}=&{} x_1 \boxplus \ldots \boxplus x_n, \\ &{}\vdots &{} \\ \sigma _k &{}=&{} \boxplus _{\pi \in S_n} x_{\pi (1)} \odot \ldots \odot x_{\pi (k)},\\ &{}\vdots &{} \\ \sigma _n &{}=&{} x_1\odot x_2 \odot \ldots \odot x_n. \end{array} \end{aligned}$$
The following version of the Fundamental Theorem of Symmetric Polynomials holds.
Theorem 2.8
(Fundamental Theorem of Symmetric Max-Plus Polynomials)  [7] Every symmetric max-plus polynomial in \(\mathtt {MaxPlus}[x_1, x_2, \ldots , x_n]\) can be written as a max-plus polynomial in the elementary symmetric max-plus polynomials \(\sigma _1, \ldots , \sigma _n\).
A tropical function in n variables is symmetric if it is invariant under the action of \(S_n\) that permutes the variables. We can generalize this definition as follows: a tropical function in nr variables, divided into n blocks of r variables each, is r-symmetric if it is invariant under the action of \(S_n\) that permutes the blocks while preserving the order of the variables within each block. We state the results for \(r=2\) because persistence barcodes are collections of intervals.
Definition 2.9
A tropical function p is 2-symmetric if
$$\begin{aligned} p(x_{1, 1}, x_{1, 2}, \ldots , x_{n, 1}, x_{n, 2}) = p(x_{\pi (1), 1}, x_{\pi (1), 2}, \ldots , x_{\pi (n), 1}, x_{\pi (n), 2}) \end{aligned}$$
   for every permutation \(\pi \in S_n\).
Fix n. Let the symmetric group \(S_n\) act on the matrix of indeterminates
https://static-content.springer.com/image/art%3A10.1007%2Fs10208-018-9379-y/MediaObjects/10208_2018_9379_Equ118_HTML.gif
by left multiplication. Let
https://static-content.springer.com/image/art%3A10.1007%2Fs10208-018-9379-y/MediaObjects/10208_2018_9379_Equ119_HTML.gif
A matrix \(\begin{pmatrix} e_{1, 1} &{} e_{1, 2} \\ e_{2, 1} &{} e_{2, 2} \\ \vdots &{} \vdots \\ e_{n, 1} &{} e_{n, 2} \\ \end{pmatrix}\in \mathscr {E}_n\) determines a max-plus monomial \(P(E) = x_{1, 1}^{e_{1,1}} x_{1, 2}^{e_{1,2}} \ldots x_{n, 1}^{e_{n,1}} x_{n, 2}^{e_{n, 2}}\). We denote the set of orbits under the row permutation action on \(\mathscr {E}_n\) by \(\mathscr {E}_n/{S_n}\). Each orbit \(\{E_1, E_2, \ldots E_m\}\) determines a 2-symmetric max-plus polynomial
$$\begin{aligned} P(E_1)\boxplus P(E_2)\boxplus \ldots \boxplus P(E_m). \end{aligned}$$
Including the \([0]_n^2\) matrix in the definition of monomials would have been redundant as the 0 function can be expressed in terms of other 2-symmetric max-plus polynomials (by simply raising them to 0).
Definition 2.10
We call the 2-symmetric max-plus polynomials that arise from orbits \(\mathscr {E}_n/{S_n}\)elementary. We let \(\sigma _{(e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }\) denote the tropical polynomial that arises from the orbit
$$\begin{aligned} \left[ \begin{pmatrix} e_{1, 1} &{}\quad e_{1, 2} \\ e_{2, 1} &{}\quad e_{2, 2} \\ \vdots &{}\quad \vdots \\ e_{n, 1} &{}\quad e_{n, 2} \\ \end{pmatrix}\right] . \end{aligned}$$
Example 2.11
Let \(n=2\). The 2-symmetric max-plus polynomials include
$$\begin{aligned} \begin{array}{l} \sigma _{(1, 0), (0, 0)} (x_1, d_1, x_2, d_2) = x_1 \boxplus x_2 = \max \{x_1, x_2 \}\\ \sigma _{(0, 1), (0, 0)} (x_1, d_1, x_2, d_2) = d_1 \boxplus d_2 = \max \{d_1, d_2 \}\\ \sigma _{(0, 1), (0, 1)} (x_1, d_1, x_2, d_2) = d_1\odot d_2 = d_1+d_2 \\ \sigma _{(1, 0), (1, 0)} (x_1, d_1, x_2, d_2) = x_1\odot x_2 = x_1+x_2 \\ \sigma _{(1, 1), (1, 1)} (x_1, d_1, x_2, d_2) = x_1 \odot d_1 \odot x_2 \odot d_2 = x_1+d_1+x_2 +d_2. \\ \end{array} \end{aligned}$$
More generally, for n and \(k\le n\), \(\sigma _{(0, 1)^k}\) is the total length of the k longest bars and \(\sigma _{(1, 0)^k}\) is the sum of the k latest birth times.
There are enough 2-symmetric max-plus polynomials to separate the orbits. We will need this piece of information to show that the functions we define in Sect. 6 separate barcodes.
Proposition 2.12
 [7] Let \(\{ (x_{1}, y_{1}), \ldots , (x_{n}, y_{n})\}\) and \(\{(x_{1}', y_{1}'), \ldots , (x_{n}', y_{n}')\}\) be two orbits under the row permutation action of \(S_n\) on \(\mathbb {R}^{2n}\). If
$$\begin{aligned} \sigma (\{(x_{1}, y_{1}), \ldots , (x_{n}, y_{n})\}) = \sigma (\{x_{1}', y_{1}'), \ldots , (x_{n}', y_{n}')\}) \end{aligned}$$
for all elementary 2-symmetric max-plus polynomials \(\sigma \), then
$$\begin{aligned} \{(x_{1}, y_{1}), \ldots , (x_{n}, y_{n})\} = \{(x_{1}', y_{1}'), \ldots , (x_{n}', y_{n}')\}. \end{aligned}$$
We identified a finite set that generates symmetric max-plus polynomials. No such statement holds in the case of 2-symmetric max-plus polynomials [7].
Proposition 2.13
The semiring of 2-symmetric max-plus polynomials in variables \(x_{1, 1}, x_{1, 2}\), \(x_{2, 1}, x_{2, 2}\) is not finitely generated.

3 Persistent Homology

Classical topologists developed homology in order to ‘measure’ shape. In simplest terms, homology counts the occurrences of patterns, such as the number of connected components, loops and voids. The adaptation of homology to the study of point cloud data and more generally filtrations of simplicial complexes is persistent homology [8, 17, 20].
The motivating idea is that the union of disks with radius r centered around points from the dataset approximates the underlying shape of the point cloud. We do not know a priori how to choose the radius. Persistent homology computes and keeps track of the changes in the homology these unions of disks over a range of radii parameters r. The output is a barcode, i.e., a collection of intervals. Each interval corresponds to a topological feature which appears at the value of a parameter given by the left endpoint of the interval and disappears at the value given by the right endpoint. These barcodes play an analogous role as a histogram would in summarizing the shape of the data—long intervals correspond to strong topological signals, and short ones may correspond to noise.

3.1 Barcode Space, Bottleneck Distance, Wasserstein Distances

Each barcode with n intervals can be encoded as \((x_1, d_1, x_2, d_2,\ldots , x_n, d_n)\) where \(x_i\) is the left endpoint of the ith interval and \(d_i\) its length. Since the ordering of the intervals does not matter, we consider the orbit space of the action of the symmetric group on n letters on the product \(([0, \infty ) \times [0, \infty ))^n\) given by permuting the coordinates. We denote it by \(B_n\).
The barcode space B is the quotient
$$\begin{aligned} \coprod _n B_n /_{\sim }, \end{aligned}$$
where \(\sim \) is generated by equivalences of the form
$$\begin{aligned} \{(x_1, d_1), (x_2, d_2), \ldots , (x_n, d_n) \} \sim \{(x_1, d_1), (x_2, d_2), \ldots , (x_{n-1}, d_{n-1})\}, \end{aligned}$$
whenever \(d_n=0\).
Before specifying the distance between two barcodes, we specify the distance between any pair of intervals, as well as the distance between any interval and the set of zero length intervals \(\Delta = \{(x, x)\,|\, 0 \le x < \infty \}\). Set
$$\begin{aligned} d_\infty ((x_1, d_1), (x_2, d_2)) = \max (|x_1-x_2|, |d_1-d_2 +x_1- x_2|). \end{aligned}$$
The distance between an interval and the set \(\Delta \) is
$$\begin{aligned} d_\infty ((x, d), \Delta ) = \frac{d}{2}. \end{aligned}$$
Let \(\mathscr {B}_1 = \{I_\alpha \}_{\alpha \in A}\) and \(\mathscr {B}_2 = \{J_\beta \}_{\beta \in B}\) be barcodes. For finite sets A and B, and any bijection \(\theta \) from a subset \(A' \subseteq A\) to \(B' \subseteq B\), the penalty of \(\theta \), \(P_\infty (\theta )\), is
$$\begin{aligned} P_\infty (\theta ) = \max (\max _{a\in A'}(d_\infty (I_a, J_{\theta (a)})), \max _{a\in A \setminus A'} d_\infty (I_a, \Delta ), \max _{b\in B\setminus B'} d_\infty (I_b, \Delta )). \end{aligned}$$
The bottleneck distance [12] is
$$\begin{aligned} d_\infty (\mathscr {B}_1, \mathscr {B}_2) = \min _\theta P_\infty (\theta ), \end{aligned}$$
where the minimum is over all possible bijections from subsets of A to subsets of B.
There are other metrics also commonly used for barcode spaces. Setting the penalty for \(\theta \) for \(p\ge 1\) to
$$\begin{aligned} P_p(\theta ) = \sum _{a\in A'}d_\infty (I_a, J_{\theta (a)})^p +\sum _{a\in A \setminus A'} d_\infty (I_a, \Delta )^p +\sum _{b\in B\setminus B'} d_\infty (I_b, \Delta )^p \end{aligned}$$
yields the pth Wasserstein distance between \(\mathscr {B}_1\), \(\mathscr {B}_2\):
$$\begin{aligned} d_p(\mathscr {B}_1, \mathscr {B}_2) = (\min _\theta P_p(\theta ))^{\frac{1}{p}} . \end{aligned}$$

4 Max-plus Polynomials on the Barcode Space

In this section, we find all max-plus polynomials that we can use as coordinates on the barcode space and prove that they are stable with respect to the bottleneck and Wasserstein distances.
The first step is to identify 2-symmetric max-plus polynomials on the image of \(B_n \rightarrow B\). By abuse of notation, we denote it simply by \(B_n\). It is the quotient of the following equivalence relation: two multisets of n intervals each,
$$\begin{aligned} I= \{(x_1,d_1), (x_2, d_2), \ldots , (x_n, d_n)\} \text { and }J = \{(x_1, d_1), (x_2, d_2), \ldots , (x_n, d_n)\}, \end{aligned}$$
are equivalent if subsets \(A, B \subseteq \{1,\ldots ,n\}\) exist such that there is an equality of multisets \(I\setminus \{(x_\alpha ,0)\,:\,\alpha \in A\} = J\setminus \{(x_\beta ,0)\,:\,\beta \in B\}\).
If \(\mathcal {W}_j \subseteq ([0, \infty ) \times [0, \infty ))^n\) is the subset of n-tuples of pairs \((x_1, d_1, x_2, d_2, \ldots , x_n, d_n)\), with 0 persistence, i.e., \(d_j = 0\), then these functions are precisely the 2-symmetric max-plus polynomials whose restriction to \(\mathcal {W}_j\) is independent of \(x_j\) for all j.
Lemma 4.1
Let the minimal representation of a max-plus polynomial \(p(x_1, d_1, \ldots , x_n, d_n)\) be
$$\begin{aligned} \displaystyle {\boxplus _{i = 1 \ldots , m} }a_0^i \odot x_1^{a_1^i} \odot d_1^{b_1^i}\odot \cdots \odot x_n^{a_n^i} \odot d_n^{b_n^i}. \end{aligned}$$
Then, p restricted to \(\mathcal {W}_j\) is independent of \(x_j\) if and only if \(a_j^i=0\) for all \(i =1, \ldots , m\).
Proof
The direction \((\Leftarrow )\) follows immediately. We must show \((\Rightarrow )\). Choose j and assume that p restricted to \(\mathcal {W}_{j}\) is independent of \(x_{j}\). Suppose not all \(a_{j}^i\) are 0. Let \(i_0\) be such that
$$\begin{aligned} a_{j}^{i_0}= \displaystyle { \max _{i=1, \ldots , m}} a_{j}^i . \end{aligned}$$
If this maximum is attained in more than one value, we choose the \(i_0\) for which \(a_0^i\) is the biggest. Observe that \(p(0, \ldots , 0, x_{j}, 0, \ldots , 0) = \displaystyle {\boxplus _{i = 1 \ldots , m} }a_0^i \odot x_j^{a_j^i}\). If \(a^{i_0}_{j}>0\), then \(p(0, \ldots , 0, x_{j}, 0, \ldots , 0) = a_0^{i_0}\odot x_{j}^{a_{j}^{i_0}}\) for all \(x_{j} >\displaystyle { \max _{\{ i\,|\, a_0^{i_0} \ne a_0^{i} \}} }\frac{ a_0^i - a_0^{i_0}}{ a_0^{i_0} - a_0^{i} }\). Here we take the maximum over i for which \(a_0^{i_0} \ne a_0^{i}\). For indices i when \(a_0^{i_0} = a_0^{i}\), \(a_0^{i_0} + a_j^{i_0}x_j \ge a_0^{i} + a_j^{i} x_j\) for our choice of \(i_0\). This shows that for \(a^{i_0}_{j}>0\) the max-plus polynomial \(p(x_1, d_1, \ldots , x_n, d_n)\) depends on \(x_{j}\). By assumption \(a^{i_0}_{j} \ge 0\). The only way the expression does not depend on \(x_{j}\) is if \(a^{i_0}_{j} =0\). \(\square \)
Corollary 4.2
The subsemiring of max-plus polynomials whose restriction to \(\mathcal {W}_i\) is independent of \(x_i\) for all i contains precisely the max-plus polynomials of the form
$$\begin{aligned} \boxplus _{i = 1 \ldots , m} a_0^i \odot d_1^{b_1^i}\odot \ldots \odot d_n^{b_n^i}. \end{aligned}$$
We denote this semiring by \(D_n\).
Proposition 4.3
Let \(D_n^{S_n}\) denote the subring of elements of \(D_n\) which are invariant under the action of \(S_n\). Then, \(\sigma _{(0,1)}, \sigma _{(0,1)^2}, \ldots , \sigma _{(0,1)^n}\) generate \(D_n^{S_n}\), in the sense that any element of \(D_n^{S_n}\) is of the form
$$\begin{aligned} \boxplus _{i = 1 \ldots , m} a_0^i \odot \sigma _{(0,1)}^{b_1^i}\odot \cdots \odot \sigma _{(0,1)^n}^{b_n^i}, \end{aligned}$$
where \(a_0^i\in \mathbb {R}\) and all \(b_j^i\) nonnegative integers.
Proof
According to Lemma 4.1 the 2-symmetric max-plus polynomials on \(B_n\) are precisely symmetric max-plus polynomials in variables \(d_1, \ldots , d_n\). We can therefore apply Theorem 2.8 with \(\sigma _{(0,1)^k}\) playing the same role of \(\sigma _k\). \(\square \)
Now that we have identified functions for each \(B_n\) separately, and we must assemble them to get functions on the barcode space. When \(n \ge m\), the natural inclusion
$$\begin{aligned} \begin{array}{rcl} B_m &{}\rightarrow &{} B_n \\ \{(x_1, d_1), \ldots , (x_m, d_m)\} &{}\mapsto &{} \{(x_1, d_1), \ldots , (x_m, d_m), (0, 0), \ldots , (0,0)\} \end{array} \end{aligned}$$
induces \(j_{n,m} :D_n \rightarrow D_m\), defined by
$$\begin{aligned} j_{n,m}(f)((x_1, d_1), \ldots , (x_m, d_m)) = f ((x_1, d_1), \ldots , (x_m, d_m), (0, 0), \ldots , (0,0)), \end{aligned}$$
The map \(j_{n, m}\) is \(S_m\)-equivariant (\(S_m\) acts by permuting the first m pairs of variables). It follows that we may construct composites
$$\begin{aligned} i_n^{m} :D_n^{S_n} \hookrightarrow D_n^{S_m} \xrightarrow {i_{n, m}^{S_m}} D_m^{S_m} \end{aligned}$$
and an inverse system
$$\begin{aligned} \ldots \xrightarrow {i_{n}^{n+1}} D_n^{S_n} \xrightarrow {i_{n-1}^{n}} D_{n-1}^{S_{n-1}} \xrightarrow {i_{n-2}^{n-1}} \ldots \xrightarrow {\, \,i_{1}^{2}\,\,} D_{1}^{S_{1}}. \end{aligned}$$
Observe that
$$\begin{aligned}&i_{n-1}^n (\sigma _{(0,1)^k}) = i_{n-1}^n (\sigma _{{\underbrace{(0,1),...,(0,1)}_\text {k}}}) \\&\quad = \sigma _{(0,1)^k}\, \,\text { for }\, k\ne n \quad \text {and} \quad i_{n-1}^{n} (\sigma _{(0,1)^{n}}) = \sigma _{(0,1)^{n-1}}. \end{aligned}$$
Therefore, \(i_{n-1}^{n}\) are surjections for all positive integers n. We do not wish to include functions with infinitely many variables, such as \(\max _{i\in \mathbb {N}} x_i\), and for this reason, we take a filtered inverse limit of these objects instead of the inverse limit. The total degree is the filter we use. Recall that \({\text {Deg}} p\) of a max-plus polynomial
$$\begin{aligned} p(x_1, x_2, \ldots , x_n)= & {} a_1\odot x_1^{i_1^1} x_2^{i_2^1} \ldots x_n^{i_n^1} \boxplus a_2\odot x_1^{i_1^2} x_2^{i_2^2} \ldots x_n^{i_n^2}\\&\boxplus \ldots \boxplus a_m\odot x_1^{i_1^m} x_2^{i_2^m} \ldots x_n^{i_n^m} \end{aligned}$$
is \({\text {max}}_{1\le j \le m}(i_1^j+ i_2^j + \ldots + i_n^j)\). Let
$$\begin{aligned} {}_kD_n = \{ p\in D_n\,|\, \text {Deg}\,p \le k \} \end{aligned}$$
Map \(i_{n-1}^{n}\) induces \({}_ki_{n-1}^{n}:{}_kD_n^{S_n} \xrightarrow {{}_ki_{n-1}^{n}} {}_kD_{n-1}^{S_{n-1}}\). We denote the inverse limit of this system by \(\mathscr {D}^k\). The space of max-plus polynomials on the barcode space, \(\mathscr {D}\), is precisely \( \displaystyle {\bigcup _{k=1}^\infty \mathscr {D}^k}\).
Definition 4.4
A semiring \((\mathscr {R}, +, \cdot )\) is called filtered if there exists such a family of subsemirings \(\{\mathscr {R}_d \}_{d\in \mathbb {N}}\) of \((\mathscr {R}, +, \cdot )\) for operation \(+\) that
  • \(\mathscr {R}_d \subset \mathscr {R}_{d'}\) for \(d\le d'\),
  • \(\mathscr {R} = \bigcup _d \mathscr {R}_d\),
  • \(\mathscr {R}_d \cdot \mathscr {R}_{d'} \subset \mathscr {R}_{d+d'}\) for all \(d, d' \in \mathbb {N}\).
Theorem 4.5
Max-plus polynomials on the barcode space, \(\mathscr {D}\), have the structure of a filtered semiring. They are generated by elements of the form \(\sigma _{(0,1)^n}\), where n is a positive integer.

5 Stability of Max-plus Polynomials

Stability is the key property that coordinate functions should satisfy. In this section, we prove that the functions from \(\mathscr {D}\) are stable with respect to the bottleneck and Wasserstein distances.
Theorem 5.1
(Bottleneck stability of max-plus polynomials) Let \(\mathscr {D}\) be the filtered semiring of max-plus polynomials (see Theorem 4.5). If \(F \in \mathscr {D}\), then a constant C exists such that
$$\begin{aligned} |F(\mathscr {B}_1) - F(\mathscr {B}_2)| \le C d_\infty (\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
for any pair of barcodes \(\mathscr {B}_1\) and \(\mathscr {B}_2\).
Lemma 5.2
For any pair of barcodes \(\mathscr {B}_1\) and \(\mathscr {B}_2\) and any \(n\in \mathbb {N}\), the difference between the total length of the longest n bars in \(\mathscr {B}_1\) and \(\mathscr {B}_2\) can be bounded from above by \(2n d_\infty (\mathscr {B}_1, \mathscr {B}_2)\):
$$\begin{aligned} |\sigma _{(0,1)^n}(\mathscr {B}_1) - \sigma _{(0,1)^n}(\mathscr {B}_2)| \le 2n d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
Proof
Let \(\mathscr {B}_1 = \{ (x_1, d_1), \ldots , (x_{l_1}, d_{l_1}) \}\) and \(\mathscr {B}_2 = \{(x_1', d_1'), \ldots , (x_{l_2}', d_{l_2}')\}\) be such that \({\mathscr {B}_1 \ne \mathscr {B}_2}\) and \(d_1 \ge d_2 \ge \ldots \ge d_{l_1} \ge 0\).
Without loss of generality, assume that \(\sigma _{(0,1)^n} (\mathscr {B}_1) \ge \sigma _{(0,1)^n} (\mathscr {B}_2)\). If \(n > l_1\) or \(n > l_2\), we add 0 length intervals to \(\mathscr {B}_1\), \(\mathscr {B}_2\) to achieve that their length is n.
Let \(\theta \) be a bijection where the penalty is minimal, i.e., where \({P_\infty (\theta ) = d_\infty (\mathscr {B}_1, \mathscr {B}_2)}\). Assume that \(\theta \) matches \((x_1, d_1)\) with \((x_1', d_1')\), \((x_2, d_2)\) with \((x_2', d_2')\), ..., \((x_n, d_n)\) with \((x_n', d_n')\) (some of these intervals might be 0 length intervals). Of course, we might have to relabel bars in \(\mathscr {B}_2\) for this to hold. Note that for those i, for which either \(d_i\) or \(d_{i}'\) equals 0, we automatically have
$$\begin{aligned} |\frac{d_i-d_i'}{2}| \le d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
For all other \(1 \le i \le n\) in this matching,
$$\begin{aligned} |\frac{d_i-d_i'}{2}| \le \max (|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|) \le d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
(5.3)
By the definition of a minimal matching \(\displaystyle \max _{i=1, \ldots , m}(|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|) \le d_\infty (\mathscr {B}_1, \mathscr {B}_2)\). So we must only prove the first inequality. Notice that if \(|\frac{d_i-d_i'}{2}| \le |x_i-x_i'|\), this follows automatically. If \(|\frac{d_i-d_i'}{2}| >|x_i-x_i'|\), then
$$\begin{aligned} |\frac{d_i-d_i'}{2}| \le |d_i-d_i'+x_i-x_i'|, \end{aligned}$$
proving Inequality 5.3.
Then,
$$\begin{aligned} nd_\infty (\mathscr {B}_1, \mathscr {B}_2)\ge & {} \sum \limits _{i=1}^n\frac{(d_i - d_i')}{2} \\= & {} \frac{1}{2} (\sum \limits _{i=1}^n d_i - \sum \limits _{i=1}^n d_i') \\= & {} \frac{1}{2} (\sigma _{(0,1)^n} (\mathscr {B}_1) -\sum \limits _{i=1}^n d_i')\\\ge & {} \frac{1}{2} (\sigma _{(0,1)^n} (\mathscr {B}_1) -\sigma _{(0,1)^n} (\mathscr {B}_2)).\\ \end{aligned}$$
The last inequality holds since \(\sum _{i=1}^n d_i' \le \sigma _{(0,1)^n} (\mathscr {B}_2)\). Also note that we chose \(d_1, \ldots , d_n\) in a way that \(\sigma _{(0,1)^n} (\mathscr {B}_1)= \sum _{i=1}^n d_i\).
We deduce that
$$\begin{aligned} |\sigma _{(0,1)^n} (\mathscr {B}_1)-\sigma _{(0,1)^n} (\mathscr {B}_2)| \le 2n d_\infty (\mathscr {B}_1, \mathscr {B}_2), \end{aligned}$$
proving that \(\sigma _{(0,1)^n}\) is Lipschitz with constant 2n. \(\square \)
Proof of Theorem 5.1
Suppose \(F_1\) and \(F_2\) are such that \(C_1\) and \(C_2\) exist such that
$$\begin{aligned} |F_1(\mathscr {B}_1) - F_1(\mathscr {B}_2)| \le C_1 d_\infty (\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
and
$$\begin{aligned} |F_2(\mathscr {B}_1) - F_2(\mathscr {B}_2)| \le C_2 d_\infty (\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
for any pair of barcodes \(\mathscr {B}_1\) and \(\mathscr {B}_2\).
Let \(H = F_1 + F_2\). Then,
$$\begin{aligned} |H(\mathscr {B}_1) - H(\mathscr {B}_2)|= & {} |F_1(\mathscr {B}_1) + F_2(\mathscr {B}_1) - F_1(\mathscr {B}_2) - F_2(\mathscr {B}_2)| \\\le & {} |F_1(\mathscr {B}_1) - F_1(\mathscr {B}_2)| + |F_2(\mathscr {B}_1) - F_2(\mathscr {B}_2)| \\\le & {} C_1 d_\infty (\mathscr {B}_1, \mathscr {B}_2) + C_2 d_\infty (\mathscr {B}_1, \mathscr {B}_2) \\\le & {} (C_1 + C_2) d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
Let \(H = \max (F_1, F_2)\). Then,
$$\begin{aligned} F_1(\mathscr {B}_2) \le F_1(\mathscr {B}_1)+ |F_1(\mathscr {B}_2)-F_1(\mathscr {B}_1)| \le H(\mathscr {B}_1)+ |F_1(\mathscr {B}_2)-F_1(\mathscr {B}_1)|, \end{aligned}$$
and similarly \(F_2(\mathscr {B}_2) \le H(\mathscr {B}_1) + |F_2(\mathscr {B}_2)-F_2(\mathscr {B}_1)|\). It follows that
$$\begin{aligned} H(\mathscr {B}_2) \le H(\mathscr {B}_1) +\max (|F_1(\mathscr {B}_2)-F_1(\mathscr {B}_1)|, |F_2(\mathscr {B}_2)-F_2(\mathscr {B}_1)|), \end{aligned}$$
and by symmetry we conclude that
$$\begin{aligned} |H(\mathscr {B}_1) - H(\mathscr {B}_2)| \le \max (C_1, C_2) d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
Any function F from the filtered semiring of max-plus polynomials \(\mathscr {D}\) is generated by taking maxima and sums of \(\sigma _{(0,1)^n}\) and constants. Since stability is preserved under these two operations and since \(\sigma _{(0,1)^n}\) are stable according to Lemma 5.2, F is also stable. \(\square \)
Theorem 5.4
(Wasserstein stability of max-plus polynomials) Let \(\mathscr {D}\) be the filtered semiring of max-plus polynomials. For \(F \in \mathscr {D}\) and \(p \ge 1\), a constant C exists such that
$$\begin{aligned} |F(\mathscr {B}_1) - F(\mathscr {B}_2)| \le C\, d_p(\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
for any pair of barcodes \(\mathscr {B}_1\) and \(\mathscr {B}_2\).
Proof
Let \(\mathscr {B}_1 = \{ (x_1, d_1), \ldots , (x_{l_1}, d_{l_1}) \}\) and \(\mathscr {B}_2 = \{(x_1', d_1'), \ldots , (x_{l_2}', d_{l_2}')\}\) be such that \({\mathscr {B}_1 \ne \mathscr {B}_2}\) and \(d_1 \ge d_2 \ge \ldots \ge d_{l_1} \ge 0\).
Without loss of generality, assume that \(\sigma _{(0,1)^n} (\mathscr {B}_1) \ge \sigma _{(0,1)^n} (\mathscr {B}_2)\). If \(n > l_1\) or \(n > l_2\), we add 0 length intervals to \(\mathscr {B}_1\), \(\mathscr {B}_2\) to achieve that their length is n.
Let \(\theta \) be a bijection where the penalty is minimal, i.e., where \({P_p(\theta ) = d_p(\mathscr {B}_1, \mathscr {B}_2)}\). Assume that \(\theta \) matches \((x_1, d_1)\) with \((x_1', d_1')\), \((x_2, d_2)\) with \((x_2', d_2')\), ..., \((x_n, d_n)\) with \((x_n', d_n')\) (some of these intervals might be 0 length intervals).
Note that for those i, for which either \(d_i\) or \(d_{i}'\) equals 0, we automatically have
$$\begin{aligned} |\frac{d_i-d_i'}{2}| \le d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
For all other i in this matching,
$$\begin{aligned} |\frac{d_i-d_i'}{2}|^p \le (\max |x_i-x_i'|, |d_i-d_i'+x_i-x_i'|)^p \end{aligned}$$
since \(x \mapsto x^p\) is increasing for \(x >0\) (note that \(p \ge 1\)). Then,
$$\begin{aligned} (\sigma _{(0,1)^n} (\mathscr {B}_1)-\sigma _{(0,1)^n} (\mathscr {B}_2))^p\le & {} (\sigma _{(0,1)^n} (\mathscr {B}_1)-\sum \limits _{i=1}^n d_i')^p \\= & {} (\sum \limits _{i=1}^n d_i - \sum \limits _{i=1}^n d_i')^p\\\le & {} 2^p (\sum \limits _{i=1}^n |\frac{d_i-d_i'}{2}|)^p \\\le & {} 2^p (n)^{p-1} (\sum \limits _{i=1}^n |\frac{d_i-d_i'}{2}|^p) \\\le & {} 2^p (n)^{p-1} P_p(\theta )^p\\= & {} 2^p n^{p-1}d_p(\mathscr {B}_1, \mathscr {B}_2)^p.\\ \end{aligned}$$
The first inequality holds since \(\sum _{i=1}^n d_i' \le \sigma _{(0,1)^n} (\mathscr {B}_2)\). Also note that we chose \(d_1, \ldots , d_n\) in a way that \(\sigma _{(0,1)^n} (\mathscr {B}_1)= \sum _{i=1}^n d_i\). To bound \(\sum _{i=1}^n |\frac{d_i-d_i'}{2}|^p\), we use Hőlder’s inequality.
It follows from here that
$$\begin{aligned} |\sigma _{(0,1)^n} (\mathscr {B}_1)-\sigma _{(0,1)^n} (\mathscr {B}_2)| \le 2 n^{\frac{p-1}{p}}d_p(\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
The statement of the theorem now follows from the same argument as in the proof of Theorem 4.5.\(\square \)

6 Tropical Rational Functions on the Barcode Space

While the functions belonging to \(\mathscr {D}\) are stable and can be used to assign vectors to barcodes, they do not separate points in the barcode space, because they are composed by taking sums and maxima of lengths of intervals and constants. One example is \(\{ (1, 2), (2, 2)\}\) and \(\{ (2, 2), (3, 2) \}\). We can easily convince ourselves of this by evaluating \(\sigma _{(0,1)^n}\) on these barcodes.
Because there simply are not enough functions among max-plus polynomials to separate points, we expand the set of functions we observe to all tropical rational functions. Let
$$\begin{aligned} ((x_1, d_1), \ldots , (x_n, d_n)), ((x_1', d_1'), \ldots , (x_n', d_n'))\in [0, \infty )^{2n}. \end{aligned}$$
Without loss of generality, we assume that they are lexicographically ordered.
The tropical rational functions that respect the equivalence classes of \(B_n\) must respect the following equivalence relation \(\sim \) on \([0, \infty )^{2n}\):
$$\begin{aligned}&((x_1, d_1), \ldots , (x_n, d_n)) \sim ((x_1', d_1'), \ldots , (x_n', d_n')) \\&\quad \Leftrightarrow (\forall i:\, (d_i = d_i' \wedge (x_i = x_i' \vee d_i =0))). \end{aligned}$$
We denote the semiring of such functions by \(R_n\).
Theorem 6.1
No finite subset of \(R_n\) exists which separates nonequivalent points in \(B_n\).
Proof
Assume \(\{f_1, \ldots , f_m\}\in R_n\) separates nonequivalent points in \(B_n\). Let \(\vec {x} = (x_1, d_1, \ldots , x_n, d_n)\) and \(\vec {x}' = (x_1', d_1', \ldots , x_n', d_n')\). We define
$$\begin{aligned} g(\vec {x}, \vec {x}') = \max \{ | f_1(\vec {x}) - f_1(\vec {x}')|, \ldots , | f_m(\vec {x}) - f_m(\vec {x}')| \}. \end{aligned}$$
The function g is the \(L^{\infty }\)-distance between vectors \((f_1(\vec {x}), \ldots , f_m(\vec {x}))\) and \((f_1(\vec {x}'), \ldots , f_m(\vec {x}'))\). Thus, \(g(\vec {x}, \vec {x}') = 0\) if and only if \(\vec {x}\) and \(\vec {x}'\) are equivalent points.
Since \(|x| = \max (x, -x)\), g is a tropical rational function and as demonstrated in Sect. 2.2, we can write \(g(\vec {x},\vec {x}')\) as
$$\begin{aligned}&\max _{i=1, \ldots , l_1} (\sum _{k=1}^n (a_{k,i} x_k + b_{k,i} d_k) + \sum _{k=1}^n (a_{k,i}' x_k' + b_{k,i}' d_k') + c_{i}) \,\\&\qquad -\max _{j=1, \ldots , l_2} (\sum _{k=1}^n (s_{k,j} x_k + t_{k,j} d_k) + \sum _{k=1}^n (s_{k,j}' x_k' + t_{k,j}' d_k') + u_{j}). \end{aligned}$$
For any \(x\ge 0\), define \(\vec {p}_x = (x, 0, \ldots , x, 0)\). Since \(\vec {p}_x \) and \(\vec {p}_y\) are equivalent for any \(x, y \ge 0\) with respect to the relation defined before the statement of Theorem 6.1, \(g(\vec {p}_x, \vec {p}_y) = 0\) and consequently
$$\begin{aligned} \max _{i=1, \ldots , l_1} (x \sum _{k=1}^n a_{k,i} + y \sum _{k=1}^n a_{k,i}' + c_{i}) = \max _{j=1, \ldots , l_2} (x \sum _{k=1}^n s_{k,j} + y \sum _{k=1}^n s_{k,j}' + u_{j}). \end{aligned}$$
Both \(\displaystyle {\max _{i=1, \ldots , l_1} (x \sum _{k=1}^n a_{k,i} + y \sum _{k=1}^n a_{k,i}' + c_{i})}\) and \(\displaystyle {\max _{j=1, \ldots , l_2} (x \sum _{k=1}^n s_{k,j} + y \sum _{k=1}^n s_{k,j}' + u_{j})}\) are piecewise linear functions defined on \(\mathbb {R}^2\). Each function defines a decomposition of \(\mathbb {R}^2\) into maximal closed domains over which this function is linear on every domain (Lemma 2.5). Let
$$\begin{aligned} D_i= & {} \{(x, y) \in [0, \infty )^2\,|\, x \sum _{k=1}^n a_{k,i} + y \sum _{k=1}^n a_{k,i}' + c_{i}> x \sum _{k=1}^n a_{k, j} + y \sum _{k=1}^n a_{k, j}' \\&\quad + \,c_{j} \quad \text { for all } j\ne i \},\\ E_i= & {} \{(x, y) \in [0, \infty )^2\,|\, x \sum _{k=1}^n s_{k,i} + y \sum _{k=1}^n s_{k,i}' + u_{i} > x \sum _{k=1}^n s_{k,j} + y \sum _{k=1}^n s_{k,j}' \\&\quad +\, u_{j} \quad \text { for all } j\ne i \}. \end{aligned}$$
These sets are open. Two linear functions on an non-empty open set are the same if and only if their coefficients are the same. This implies that \(\sum _{k=1}^n a_{k,i} = \sum _{k=1}^n s_{k,j}\), \(\sum _{k=1}^n a_{k,i}' = \sum _{k=1}^n s_{k,j}' \) and \(c_i = u_j\) for all i and j for which \({D_i \cap E_j \ne \emptyset }\).
We also define
$$\begin{aligned} S_i= & {} \{(\vec {x}, \vec {x'}) \in [0, \infty )^{2n}\times [0, \infty )^{2n}\,|\, \sum _{k=1}^n (a_{k,i} x_k + b_{k,i} d_k) \\&\quad +\, \sum _{k=1}^n (a_{k,i}' x_k' + b_{k,i}' d_k') + c_{i}\\> & {} \sum _{k=1}^n (a_{k, j} x_k + b_{k, j} d_k) + \sum _{k=1}^n (a_{k,j}' x_k' + b_{k, j}' d_k') + c_{j}\quad \text { for all } j\ne i \} \end{aligned}$$
and
$$\begin{aligned} T_i= & {} \{(\vec {x}, \vec {x'}) \in [0, \infty )^{2n} \times [0, \infty )^{2n}\,|\, \sum _{k=1}^n (s_{k,i} x_k + t_{k,i} d_k) + \sum _{k=1}^n (s_{k,i}' x_k' \\&+\, t_{k,i}' d_k') + u_{i}\\> & {} \sum _{k=1}^n (s_{k,j} x_k + t_{k,j} d_k) + \sum _{k=1}^n (s_{k,j}' x_k' + t_{k,j}' d_k') + u_{j}\text { for all } j\ne i \}. \end{aligned}$$
\(\bigcup S_i\) and \(\bigcup T_i\) are open and dense in \([0, \infty )^{2n} \times [0, \infty )^{2n}\). In particular
$$\begin{aligned}{}[0, \infty )^{2n}\times [0, \infty )^{2n} = \bigcup _{i, j} \overline{S_i \cap T_j}. \end{aligned}$$
The closures \(\overline{S_i \cap T_j}\) have piecewise linear boundaries by Lemma 2.5 since g is a tropical rational function. We claim that there exist indices i and j and \(\epsilon , a >0\) such that the points
$$\begin{aligned} \begin{array}{lcl} A &{}:=&{} ((0, 0, \ldots , 0, 0),(0, 0, \ldots , 0, 0)),\\ B &{}:=&{}((0, \epsilon , 0, \epsilon , \ldots , 0, \epsilon ),(0, \epsilon , 0, \epsilon , \ldots , 0, \epsilon )),\\ C &{}:=&{} ((0, \epsilon , 0, \epsilon , \ldots , 0, \epsilon ),(a, \epsilon , a, \epsilon , \ldots , a, \epsilon )) \end{array} \end{aligned}$$
belong to \(\overline{S_i \cap T_j}\). We will show that \(g(C) = 0\) although \((0, \epsilon , 0, \epsilon , \ldots , 0, \epsilon )\) and \((a, \epsilon , a, \epsilon , \ldots , a, \epsilon )\) are not equivalent points. This will lead to a contradiction.
The point A, together with vectors
$$\begin{aligned} ((0, 1, 0, 1, \ldots , 0, 1),(0, 1, 0, 1, \ldots , 0, 1)) \text { and }((0, 0, \ldots , 0, 0),(1, 0, \ldots , 1, 0)), \end{aligned}$$
determines a plane; denote its intersection with \([0, \infty )^{2n} \times [0, \infty )^{2n}\) by P. The decomposition of \([0, \infty )^{2n} \times [0, \infty )^{2n}\) on \(\overline{S_i \cap T_j}\) determines a decomposition of P on sets \(\overline{S_i \cap T_j} \cap P\) – their boundaries (considered within P) are then also piecewise linear.
We set
$$\begin{aligned} \vec {v} := ((0, 1, 0, 1, \ldots , 0, 1),(0, 1, 0, 1, \ldots , 0, 1)) \end{aligned}$$
and
$$\begin{aligned} \vec w=((0, 0, \ldots , 0, 0),(1, 0, \ldots , 1, 0)). \end{aligned}$$
If A is in the interior (relative to P) of some \(\overline{S_i \cap T_j} \cap P\), then we can clearly find the required \(\epsilon \) and a. If A is in a boundary, consider what lies in the direction \(\vec {v}\). If it is the interior of some \(\overline{S_i \cap T_j} \cap P\), then A is in \(\overline{S_i \cap T_j} \cap P\), and we can again find suitable \(\epsilon \) and a. Suppose now that A lies in a boundary \(\ell \) which continues in the direction of \(\vec {v}\). Let \(\epsilon \) be small enough that \(\ell \) does not yet end at \(\epsilon \vec {v}\) and such that the line segment open at A joining A and \(A+\epsilon \vec {v}\) does not intersect any boundaries other than \(\ell \); we then let \(B=A+\epsilon \vec {v}\). Since this boundary did not yet end at B, the vector \(\vec w\) with the origin point in B must point into the interior of some \(\overline{S_i \cap T_j} \cap P\); choose a small enough a so that \(C=B+a\vec {w}\), and indeed the line segment joining B and C lies within \(\overline{S_i\cap T_j}\cap P\).
Now we calculate
$$\begin{aligned} 0= & {} g((0, \epsilon , \ldots , 0, \epsilon ), (0, \epsilon , \ldots , 0, \epsilon )) \\= & {} \epsilon \sum \limits _{k=1}^n (b_{k,i} + b_{k,i}') + c_{i} - (\epsilon \sum \limits _{k=1}^n (t_{k,j} + t_{k,j}') + u_{j})\\= & {} a \sum \limits _{k=1}^n a_{k,i}' + \epsilon \sum \limits _{k=1}^n (b_{k,i} + b_{k,i}')\\&+\,c_{i}-( a \sum \limits _{k=1}^n s_{k,j}' + \epsilon \sum \limits _{k=1}^n (t_{k,j} + t_{k,j}') + u_{j})\\= & {} g((0 , \epsilon , \ldots , 0, \epsilon ), (a, \epsilon , \ldots , a, \epsilon )) \\\ne & {} 0, \end{aligned}$$
which is a contradiction. \(\square \)
Theorem 6.1 states that no finite subset of symmetric min-plus, max-plus or tropical rational functions exists that separates barcodes. In this section, we identify a countable set of tropical rational functions on the barcode space that does.
Theorem 6.3
Let \(\{ \sigma _{(e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }\}\) be the set of elementary 2-symmetric max-plus polynomials from Definition 2.10. Functions, defined by
$$\begin{aligned} E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }(x_1, d_1, \ldots , x_n, d_n):= & {} \sigma _{(e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) } \\&\quad (x_1 \oplus d_1^m, d_1, \ldots , x_n \oplus d_n^m, d_n), \end{aligned}$$
for \(m\in \mathbb {N}\) are contained in \(R_n\). Furthermore, they separate nonequivalent points in \(B_n\).
Proof
Restricted to \(d_i=0\) for \(i \in \mathbb {N}_{\le n}\), expressions \(x_i \oplus d_i^m\) are 0 and therefore independent of \(x_i\) and consequently so are their post-compositions with \(e_{(e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }\). This implies that \(E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }(x_1, d_1, \ldots , x_n, d_n)\) is contained in \(R_n\).
We must show that if \((x_1, d_1, \ldots , x_n, d_n)\) and \((x_1', d_1', \ldots , x_n', d_n')\) are not equivalent in \(B_n\), we can find such \(E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }\) that
$$\begin{aligned}&E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }(x_1, d_1, \ldots , x_n, d_n)\\&\quad \ne E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }(x_1', d_1', \ldots , x_n', d_n'). \end{aligned}$$
Let \((x_1, d_1, \ldots , x_n, d_n)\) and \((x_1', d_1', \ldots , x_n', d_n')\) be nonequivalent. Without loss of generality, assume that \(d_1 \le \cdots \le d_n\) and \(d_1' \le \cdots \le d_n'\).
Some of the d’s, say \(d_1, \ldots , d_{k-1} = 0\) can be 0 (if \(k=1\) none of d’s is 0). The point \((x_1, 0, \ldots , x_{k-1}, 0, x_{k}, d_k, \ldots x_n, d_n)\) is equivalent to \((0, 0, \ldots , 0, 0, x_{k}, d_k, \ldots x_n, d_n)\) and consequently
$$\begin{aligned}&E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) } (x_1, 0, \ldots , x_{k-1}, 0, x_{k}, d_k, \ldots x_n, d_n) \nonumber \\&\quad =E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) } (0, 0, \ldots , 0, 0, x_{k}, d_k, \ldots x_n, d_n) \end{aligned}$$
(6.4)
for all m and \((e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2})\). Similarly, if \(d_1', \ldots , d_{l-1}' = 0\), then
$$\begin{aligned} (x_1', 0, \ldots , x_{l-1}', 0, x_{l}', d_l', \ldots x_n', d_n') \sim (0, 0, \ldots , 0, 0, x_{l}', d_l', \ldots x_n', d_n') \end{aligned}$$
and consequently
$$\begin{aligned}&E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }(x_1', 0, \ldots , x_{l-1}', 0, x_{l}', d_l', \ldots x_n', d_n')\nonumber \\&\quad =E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }(0, 0, \ldots , 0, 0, x_{l}', d_l', \ldots x_n', d_n') \end{aligned}$$
(6.5)
for all m and \((e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2})\).
Choose \(m \in \mathbb {N}\) such that
$$\begin{aligned} m > \max (\max _{k \le i \le n} \frac{x_i}{d_i}, \max _{l \le i \le n} \frac{x_i'}{d_i'}). \end{aligned}$$
For this m,
$$\begin{aligned} (x_1 \oplus d_1^m, d_1, \ldots , x_n \oplus d_n^m, d_n) = (0, 0, \ldots , 0, 0, x_{k}, d_k, \ldots x_n, d_n) \end{aligned}$$
and
$$\begin{aligned} (x_1' \oplus d_1^{'m}, d_1', \ldots , x_n' \oplus d_n^{'m}, d_n) = (0, 0, \ldots , 0, 0, x_{l}', d_l', \ldots x_n', d_n') \end{aligned}$$
Proposition 2.12 guarantees existence of \(e \in \{ \sigma _{(e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2}) }\}\) such that
$$\begin{aligned} e(0, 0, \ldots , 0, 0, x_{k}, d_k, \ldots x_n, d_n) \ne e(0, 0, \ldots , 0, 0, x_{l}', d_l', \ldots x_n', d_n'). \end{aligned}$$
Therefore, we see that for this choice of m and this e,
$$\begin{aligned} E_{m, e}(x_1, d_1, \ldots x_n, d_n) \ne E_{m, e}(x_1', d_1', \ldots , x_n', d_n') \end{aligned}$$
and we are done. \(\square \)
It is hard to characterize all tropical rational functions on \(B_n\), so we work with a subsemiring of functions obtained by taking maxima, adding and subtracting functions from \(\{E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2})}\}\). We denote this subsemiring by \(G_n\) or \(G_n^{S_n}\) when we wish to stress that all the functions contained in it are symmetric. We have restriction maps \(i_{n,m} :G_n \rightarrow G_m\), when \(n \ge m\), induced by
$$\begin{aligned} i_{n,m}(f)(x_1, d_1, \ldots , x_m, d_m, \ldots , x_n, d_n) = f(x_1, d_1, \ldots , x_m, d_m, 0,0, \ldots , 0, 0), \end{aligned}$$
The map \(i_{n, m}\) is \(S_m\)-equivariant, where \(S_m\) acts by permuting the first m pairs of variables.
Maps \(i_{n, n-1}\) transform the generators of \(G_n\) as follows:
$$\begin{aligned}&E_{m, (0, 0)^j (1,0)^k (0, 1)^l (1, 1)^{p}} \\&\quad \mapsto \left\{ \begin{array}{ll} E_{m, (0, 0)^{j-1} (1,0)^k (0, 1)^l (1, 1)^{p}} &{}\quad \text {if }j \ne 0 \\ E_{m, (1, 1)^{n-1}} &{}\quad \text {if }j= 0, k=0, l=0 \\ E_{m, (0, 1)^{l-1} (1, 1)^{p}} &{}\quad \text {if }j= 0, k=0, l\ge 1 \\ E_{m, (1,0)^{k-1} (1, 1)^{p}} &{}\quad \text {if }j= 0, k\ge , l=0 \\ E_{m, (1,0)^{k-1} (0, 1)^l (1, 1)^{p}} \boxplus E_{m, (1,0)^{k} (0, 1)^{l-1} (1, 1)^{p}} &{}\quad \text {if }j= 0, k\ge , l\ge 1 \\ \end{array}\right. \end{aligned}$$
Here \(p = n-l-k-j\). Therefore, we \(i_{n, n-1}\) is a surjection from \(G_n\) to \(G_{n-1}\) and we may construct composites
$$\begin{aligned} i_n^{n-1} :G_n^{S_n} \hookrightarrow G_n^{S_{n-1}}\xrightarrow {i_{n, n-1}^{S_{n-1}}} G_{n-1}^{S_{n-1}}. \end{aligned}$$
We cannot proceed as we did in the case of max-plus polynomials, since we cannot define a degree of a tropical rational expression. However, recall that according to Sect. 2.1 we can write any \(r\in G_n\) as
$$\begin{aligned}&\max _{i=1, \ldots , l_1} (\sum _{k=1}^n (a_{k,i} x_k + b_{k,i} d_k) + \sum _{k=1}^n (a_{k,i}' x_k' + b_{k,i}' d_k') + c_{i}) \,\nonumber \\&\quad -\max _{j=1, \ldots , l_2} (\sum _{k=1}^n (s_{k,j} x_k + t_{k,j} d_k) + \sum _{k=1}^n (s_{k,j}' x_k' + t_{k,j}' d_k') + u_{j}). \end{aligned}$$
(6.6)
Now set
$$\begin{aligned} {}_kG_n^{S_n} = \{ r\in G_n \,|\, r \sim p \oplus q^{-1}, p, q\text { are max-plus polynomials with } \text {deg}\, p, \text {deg}\,q \le k \} \end{aligned}$$
Map \(i_{n}^{n-1}\) induces \({}_ki_{n}^{n-1}:{}_kG_n^{S_n} \xrightarrow {{}_ki_{n}^{n-1}} {}_kG_{n-1}^{S_{n-1}}\). We denote the inverse limit of this system by \(\mathscr {G}^k\). Let \(\mathscr {G} = \cup _{k=1}^\infty \mathscr {G}^k\).
Theorem 6.7
Tropical rational functions in \(\mathscr {G}\) form a filtered semiring, and they separate points in the barcode space. As a semiring \(\mathscr {G}\) is generated by elements of the form \(E_{m, (1,0)^k (0, 1)^l (1, 1)^{p}}\) where klp are nonnegative integers and m is a positive integer.

7 Stability of Tropical Rational Functions in \(\mathscr {G}\)

In this subsection, we prove that the rational functions that we identified are stable with respect to the bottleneck and Wasserstein distances.
Theorem 7.1
(Bottleneck stability of functions in \(\mathscr {G}\)) If \(F \in \mathscr {G}\), then a constant C exists such that
$$\begin{aligned} |F(\mathscr {B}_1) - F(\mathscr {B}_2)| \le C d_\infty (\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
for any pair of barcodes \(\mathscr {B}_1\) and \(\mathscr {B}_2\).
Lemma 7.2
Let \(m\in \mathbb {N}\), \(m_i= \min \{ x_i, md_i\}\) and \(m_i'= \min \{ x_i', md_i'\}\). Then,
$$\begin{aligned} |m_i - m_i'| \le 2m \max (|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|). \end{aligned}$$
Proof
If \(x_i \le m d_i\) and \(x_i' \le m d_i'\), then
$$\begin{aligned} |m_i - m_i'| = |x_i-x_i'|. \end{aligned}$$
If \(x_i \ge m d_i\) and \(x_i' \ge m d_i'\), then
$$\begin{aligned} |m_i - m_i'| = |m d_i-md_i'| = m|d_i-d_i'|. \end{aligned}$$
Let \(x_i \le m d_i\) and \(x_i' > m d_i'\) (the case when \(x_i > m d_i\) and \(x_i' \le m d_i'\) is analogous). Since \(0 \le x_i \le m d_i\),
$$\begin{aligned} -md_i' \le x_i-md_i' \le m(d_i-d_i'). \end{aligned}$$
On the other hand \(-x_i' < -m d_i' \le 0\) and consequently
$$\begin{aligned} x_i-x_i' < x_i-m d_i' \le x_i. \end{aligned}$$
It follows that
$$\begin{aligned} |x_i - m d_i'| \le \max \{|x_i-x_i'|, m |d_i-d_i'|\} \end{aligned}$$
and consequently
$$\begin{aligned} |m_i - m_i'| \le \max \{|x_i-x_i'|, m |d_i-d_i'| \} \le m\max \{|x_i-x_i'|, |d_i-d_i'| \}. \end{aligned}$$
By triangle inequality
$$\begin{aligned} |d_i-d_i'| \le |d_i-d_i'+x_i-x_i'| + |x_i-x_i'| \le 2 \max (|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|). \end{aligned}$$
Finally, these two inequalities imply
$$\begin{aligned} \max (|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|) \le 2m \max (|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|) \end{aligned}$$
\(\square \)
Proof of Theorem 7.1
Take \(E = E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}\). Let \(\mathscr {B}_1 = \{ (x_1, d_1), \ldots , (x_{l_1}, d_{l_1}) \}\) and \(\mathscr {B}_2 = \{(x_1', d_1'), \ldots , (x_{l_2}', d_{l_2}')\}\) be such that \({\mathscr {B}_1 \ne \mathscr {B}_2}\). Define \(m_i, m_i'\) as in Lemma 7.2.
Without loss of generality, assume that
$$\begin{aligned} E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}(\mathscr {B}_1) \ge E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}(\mathscr {B}_2) \end{aligned}$$
and
$$\begin{aligned} E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}(\mathscr {B}_1) = \sum _{i=1}^p(m_i+d_i) + \sum _{i=p+1}^{p+k} m_i + \sum _{i=p+k+1}^{p+k+l} d_i. \end{aligned}$$
If \(l_1, l_2 < p+k+l\), we add 0 length intervals to both barcodes.
Let \(\theta \) be a bijection where the penalty is minimal, i.e., where \({P_\infty (\theta ) = d_\infty (\mathscr {B}_1, \mathscr {B}_2)}\). Assume that \(\theta \) matches \((x_1, d_1)\) with \((x_1', d_1')\), \((x_2, d_2)\) with \((x_2', d_2')\), ..., \((x_{p+k+l}, d_{p+k+l})\) with \((x_{p+k+l}', d_{p+k+l}')\). Recall that for all i in this matching,
$$\begin{aligned} |\frac{d_i-d_i'}{2}| \le \max _{i=1, \ldots , m}(|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|). \end{aligned}$$
Let’s also check what happens if \(d_i'=0\). In this case, \((x_i, d_i)\) is matched to a 0 length barcode and
$$\begin{aligned} d_i \le 2d_\infty (\mathscr {B}_1, \mathscr {B}_2),\quad m_i \le md_i \le 2m d_\infty (\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
and
$$\begin{aligned} d_i + m_i \le (2+2m)d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
Let \(M=\max \{1, m\}\). Using Lemma 7.2 and the above inequalities
$$\begin{aligned}&E(\mathscr {B}_1)-E(\mathscr {B}_2) \\&\quad = \sum \limits _{i=1}^p(m_i+d_i) + \sum \limits _{i=p+1}^{p+k} m_i + \sum \limits _{i=p+k+1}^{p+k+l} d_i-E(\mathscr {B}_2) \\&\quad \le \sum \limits _{i=1}^p(m_i-m_i'+d_i-d_i') + \sum \limits _{i=p+1}^{p+k} (m_i-m_i') + \sum \limits _{i=p+k+1}^{p+k+l} (d_i-d_i')\\&\quad = 2| \sum \limits _{i=1}^p\frac{m_i-m_i'}{2}+ \sum \limits _{i=1}^p\frac{d_i-d_i'}{2} + \sum \limits _{i=p+1}^{p+k} \frac{m_i-m_i'}{2} + \sum \limits _{i=p+k+1}^{p+k+l} \frac{d_i-d_i'}{2}|\\&\quad \le 2( \sum \limits _{i=1}^p|\frac{m_i-m_i'}{2}|+ \sum \limits _{i=1}^p|\frac{d_i-d_i'}{2}| + \sum \limits _{i=p+1}^{p+k} |\frac{m_i-m_i'}{2}| + \sum \limits _{i=p+k+1}^{p+k+l} |\frac{d_i-d_i'}{2}|)\\&\quad \le 2 (2pMP_\infty (\theta ) + 2pP_\infty (\theta ) +2kMP_\infty (\theta ) + 2lP_\infty (\theta ))\\&\quad \le 2 (2pM+2p+2kM+2l) d_\infty (\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
This proves that E is Lipschitz. In proof of Theorem 5.1, we showed that stable functions on the barcode space are preserved under taking sums, maxima and minima since \(E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2})}\) are stable as any \(F\in \mathscr {G}\) is composed of taking sums, maxima and minima of \(E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2})}\). \(\square \)
Theorem 7.3
(Wasserstein stability of functions in \(\mathscr {G}\)) If \(F \in \mathscr {G}\), then a constant C exists such that
$$\begin{aligned} |F(\mathscr {B}_1) - F(\mathscr {B}_2)| \le C d_q(\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
for any pair of barcodes \(\mathscr {B}_1\) and \(\mathscr {B}_2\).
Proof
We denote the function \(E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}\) by E. Let \(\mathscr {B}_1 = \{ (x_1, d_1), \ldots , (x_{l_1}, d_{l_1}) \}\) and \({\mathscr {B}_2 = \{(x_1', d_1'), \ldots , (x_{l_2}', d_{l_2}')\}}\) be such that \({\mathscr {B}_1 \ne \mathscr {B}_2}\). Without loss of generality, assume that
$$\begin{aligned} E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}(\mathscr {B}_1) \ge E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}(\mathscr {B}_2) \end{aligned}$$
and
$$\begin{aligned} E_{m, (0, 1)^{l}(1,0)^k (1, 1)^p}(\mathscr {B}_1) = \sum _{i=1}^p(m_i+d_i) + \sum _{i=p+1}^{p+k} m_i + \sum _{i=p+k+1}^{p+k+l} d_i. \end{aligned}$$
If \(l_1, l_2 < p+k+l\), we add 0 length intervals to both barcodes.
Let \(\theta \) be a bijection where the penalty is minimal, i.e., where \({P_\infty (\theta ) = d_q(\mathscr {B}_1, \mathscr {B}_2)}\). Assume that \(\theta \) matches \((x_1, d_1)\) with \((x_1', d_1')\), \((x_2, d_2)\) with \((x_2', d_2')\), ..., \((x_{p+k+l}, d_{p+k+l})\) with \((x_{p+k+l}', d_{p+k+l}')\). Recall that for all i in this matching,
$$\begin{aligned} |\frac{d_i-d_i'}{2}|^q \le \max _{i=1, \ldots , m}(|x_i-x_i'|, |d_i-d_i'+x_i-x_i'|)^q \end{aligned}$$
since \(x \mapsto x^q\) is increasing for \(x >0\). As before, if \(d_i'=0\), \((x_i, d_i)\) is matched to a 0 length barcode and
$$\begin{aligned} d_i \le 2d_q(\mathscr {B}_1, \mathscr {B}_2),\quad m_i \le md_i \le 2m d_q(\mathscr {B}_1, \mathscr {B}_2) \end{aligned}$$
and
$$\begin{aligned} d_i + m_i \le (2+2m)d_q(\mathscr {B}_1, \mathscr {B}_2). \end{aligned}$$
Let \(M=\max \{1, m\}\). Using Lemma 7.2 and the above inequalities, we get:
$$\begin{aligned}&|E(\mathscr {B}_1)-E(\mathscr {B}_2)|^q \\&\quad = (\sum \limits _{i=1}^p(m_i+d_i) + \sum \limits _{i=p+1}^{p+k} m_i + \sum \limits _{i=p+k+1}^{p+k+l} d_i-E(\mathscr {B}_2))^q \\&\quad \le (\sum \limits _{i=1}^p(m_i-m_i'+d_i-d_i') + \sum \limits _{i=p+1}^{p+k} (m_i-m_i') + \sum \limits _{i=p+k+1}^{p+k+l} (d_i-d_i'))^q\\&\quad = 2^q| \sum \limits _{i=1}^p\frac{m_i-m_i'}{2}+ \sum \limits _{i=1}^p\frac{d_i-d_i'}{2} + \sum \limits _{i=p+1}^{p+k} \frac{m_i-m_i'}{2} + \sum \limits _{i=p+k+1}^{p+k+l} \frac{d_i-d_i'}{2}|^q\\&\quad \le 2^q( \sum \limits _{i=1}^p|\frac{m_i-m_i'}{2}|+ \sum \limits _{i=1}^p|\frac{d_i-d_i'}{2}| + \sum \limits _{i=p+1}^{p+k} |\frac{m_i-m_i'}{2}| + \sum \limits _{i=p+k+1}^{p+k+l} |\frac{d_i-d_i'}{2}|)^q\\&\quad \le 2^q (2p+k+l)^{q-1}(2pM+2p+2kM+2l)^q P_q(\theta )^q\\&\quad \le 2^q (2pM+2p+2kM+2l)^{2q} d_q(\mathscr {B}_1, \mathscr {B}_2)^q. \end{aligned}$$
The first inequality holds since \(\sum _{i=1}^p(m_i'+d_i') + \sum _{i=p+1}^{p+k} m_i' + \sum _{i=p+k+1}^{p+k+l} d_i' \le E (\mathscr {B}_2)\). The last inequality uses Hőlder’s inequality. Taking the qth root finishes the proof.
We conclude that E is Lipschitz. In proof of Theorem 5.1, we showed that stable functions on the barcode space are preserved under taking sums, maxima and minima. Since \(E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2})}\) are stable, \(F\in \mathscr {G}\) is also stable as it is composed of taking sums, maxima and minima of \(E_{m, (e_{1, 1}, e_{1, 2}), \ldots , (e_{n, 1}, e_{n, 2})}\). \(\square \)

8 Classifying Digits with Tropical Coordinates

Adcock et al. [1] used polynomial coordinates to classify digits from the MNIST database [23] of handwritten digits. In this section, we compare classification results they obtained with mine, which were classified using tropical coordinates. Aaron Adcock provided the MATLAB code needed to convert digital images into filtrations.
While homology itself cannot distinguish between the digits—1, 5 and 7 never have loops, 0, 6, 9 always have loops, 8 has two loops, while 2, 3, 4 might or might not have loops, depending on style—we can use persistent homology as a measurement of shape. Figure 1 shows the first 100 digits of the database. The original black and white images were first normalized, scaled into a \(20\times 20\) pixel bounding box and anti-aliased, which introduced grayscale levels. Pixel values are 0–255, where 0 means background (white), 255 means foreground (black).
Following Collins et al. [13], we first threshold (setting pixel values greater than 100–1 and the rest to 0) to produce a binary image. We construct four filtrations as follows. For each pixel, we add a vertex, for any pair of adjacent pixels (diagonals included) an edge and for any triple of adjacent pixels a 2-simplex. We sweep across the rows from the left and the right and across the columns from top to bottom and vice versa. This adds spatial information into what would otherwise be a purely topological measurement. We take both Betti 0 and Betti 1.
This extra spatial information reveals the location of various topological features. For example, though a ‘9’ and ‘6’ both have one connected component and one loop, the loop will appear at different locations in the 1-dimensional homology top-down sweep for the ‘9’ and ‘6’ (see Fig. 2). In digits with no loops, 0-dimensional homology right to left sweep distinguishes ‘3’ from other digits (see Fig. 3).
We can use different methods for turning barcodes into vectors. Adcock et al. selected four features,
$$\begin{aligned} \begin{array}{l} \sum \limits _i x_i(y_i-x_i) \\ \sum \limits _i(y_{\max } - y_i)(y_i- x_i)\\ \sum \limits _ix_i^2 (y_i-x_i)^4\\ \sum \limits _i(y_{\max } - y_i)^2(y_i-x_i)^4 \end{array} \end{aligned}$$
which when applied to the four sweeps, each with a 0-dimensional and 1-dimensional barcode, give a feature vector of total size 32. We used command fitcecoc in MATLAB to get an error-correcting output codes (ECOC) multiclass model [25]. This model was trained using support vector machine (SVM) [14]. We obtained the best results using the Gaussian kernel. As is typical when using a SVM, we scaled each coordinate such that the values were between 0 and 1. To measure the classification accuracy, we used 100-fold cross-validation. See Table 1 for results.
Table 1
Classification accuracy using ordinary polynomial coordinates
1000 digits
5000 digits
10,000 digits
87.5%
90.04%
91.04%
Using the following max-plus type coordinates
$$\begin{aligned} \begin{array}{ll} \max \limits _{i} d_i &{} \max \limits _{i<j} (d_i + d_j) \\ \max \limits _{i<j<k} (d_i + d_j+d_k) &{} \max \limits _{i<j<k<l} (d_i + d_j+d_k+d_l) \\ \sum \limits _i d_i &{} \sum \limits _i \min (28d_i, x_i) \\ \sum \limits _i (\max \limits _i(\min (28d_i, x_i) +d_i) -(\min (28d_i, x_i) +d_i) ) &{} \\ \end{array} \end{aligned}$$
yields slightly better results (see Table 2). Note that we used many functions involving sums of lengths of intervals. These yielded the best results, which is perhaps not surprising since when using persistent homology and interpreting the barcode, we assign importance to features depending on over what range of parameters they persist.
Table 2
Classification accuracy using max-plus type coordinates
1000 digits
5000 digits
10,000 digits
87.70%
91.36%
92.41%
This method just demonstrates how one can use persistent homology with other machine learning algorithms and does not outperform existing classification algorithms. Figure 4 shows examples of digits that were not correctly classified. The most common confusion is between a ‘5’ and a ‘2’ written with no loop. Other common confusions occur when topological changes occurred to the digit, for example when ‘8’ is written with no loops.
These examples also show the power of combining topology with geometry and in particular demonstrate how coordinates can serve as a method for organizing the collection of all barcodes and therefore any database whose members produce barcodes. They are also stable with respect to the bottleneck and Wasserstein distances.

Acknowledgements

Open access funding provided by Max Planck Society. The author thanks Gunnar Carlsson, Gregory Brumfiel, Davorin Lešnik and the referees for helpful discussions.
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://​creativecommons.​org/​licenses/​by/​4.​0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Literatur
1.
Zurück zum Zitat A. Aadcock, E. Carlsson, and G. Carlsson. “The Ring of Algebraic Functions on Persistence Bar Codes”. In: Homology, Homotopy and Applications 18 (2016), pp. 381–402.MathSciNetCrossRefMATH A. Aadcock, E. Carlsson, and G. Carlsson. “The Ring of Algebraic Functions on Persistence Bar Codes”. In: Homology, Homotopy and Applications 18 (2016), pp. 381–402.MathSciNetCrossRefMATH
2.
Zurück zum Zitat A. Aadcock, D. Rubin, and G. Carlsson. “Classification of Hepatic Lesions using the Matching Metric”. In: Computer Vision and Image Understanding 121 (2014), pp. 36–42.CrossRef A. Aadcock, D. Rubin, and G. Carlsson. “Classification of Hepatic Lesions using the Matching Metric”. In: Computer Vision and Image Understanding 121 (2014), pp. 36–42.CrossRef
3.
Zurück zum Zitat H. Adams and G. Carlsson. “Evasion paths in mobile sensor networks”. In: The International Journal of Robotics Research 34 (2014), pp. 90–104.CrossRef H. Adams and G. Carlsson. “Evasion paths in mobile sensor networks”. In: The International Journal of Robotics Research 34 (2014), pp. 90–104.CrossRef
4.
Zurück zum Zitat P. Bubenik. “Statistical Topological Data Analysis Using Persistence Landscapes”. In: Journal of Machine Learning Research 16.1 (2015), pp. 77–102.MathSciNetMATH P. Bubenik. “Statistical Topological Data Analysis Using Persistence Landscapes”. In: Journal of Machine Learning Research 16.1 (2015), pp. 77–102.MathSciNetMATH
5.
Zurück zum Zitat G. Carlsson. “Topological pattern recognition for point cloud data”. In: Acta Numerica 23 (2013), pp. 289–368. G. Carlsson. “Topological pattern recognition for point cloud data”. In: Acta Numerica 23 (2013), pp. 289–368.
7.
Zurück zum Zitat G. Carlsson and S. Kališnik Verovšek. “Symmetric and r-symmetric tropical poly- nomials and rational functions”. In: Journal of Pure and Applied Algebra 220.11 (2016), pp. 3610–3627.MathSciNetCrossRefMATH G. Carlsson and S. Kališnik Verovšek. “Symmetric and r-symmetric tropical poly- nomials and rational functions”. In: Journal of Pure and Applied Algebra 220.11 (2016), pp. 3610–3627.MathSciNetCrossRefMATH
8.
Zurück zum Zitat G. Carlsson and A. J. Zomorodian. “Computing persistent homology”. In: Discrete and Computational Geometry 33 (2005), pp. 249–274.MathSciNetCrossRefMATH G. Carlsson and A. J. Zomorodian. “Computing persistent homology”. In: Discrete and Computational Geometry 33 (2005), pp. 249–274.MathSciNetCrossRefMATH
9.
Zurück zum Zitat M. Carrière, S. Y. Oudot, and M. Ovsjanikov. “Stable Topological Signatures for Points on 3D Shapes”. In: Proceedings of the Eurographics Symposium on Geometry Processing. SGP ’15. 2015, pp. 1–12. M. Carrière, S. Y. Oudot, and M. Ovsjanikov. “Stable Topological Signatures for Points on 3D Shapes”. In: Proceedings of the Eurographics Symposium on Geometry Processing. SGP ’15. 2015, pp. 1–12.
10.
Zurück zum Zitat S. Chepushtanova et al. “Persistence Images: An Alternative Persistent Homology Representation”. 2015. S. Chepushtanova et al. “Persistence Images: An Alternative Persistent Homology Representation”. 2015.
11.
Zurück zum Zitat M. K. Chung, P. Bubenik, and P. T. Kim. “Persistence Diagrams of Cortical Surface Data”. In: 2009. Chap. Information Processing in Medical Imaging: 21st International Conference, IPMI 2009, Williamsburg, VA, USA, July 5–10, 2009. Proceedings, pp. 386–397. M. K. Chung, P. Bubenik, and P. T. Kim. “Persistence Diagrams of Cortical Surface Data”. In: 2009. Chap. Information Processing in Medical Imaging: 21st International Conference, IPMI 2009, Williamsburg, VA, USA, July 5–10, 2009. Proceedings, pp. 386–397.
12.
Zurück zum Zitat D. Cohen-Steiner, H. Edelsbrunner, and J. Harer. “Stability of Persistence Dia- grams”. In: Discrete Comput. Geom. 37.1 (2007), pp. 103–120.MathSciNetCrossRefMATH D. Cohen-Steiner, H. Edelsbrunner, and J. Harer. “Stability of Persistence Dia- grams”. In: Discrete Comput. Geom. 37.1 (2007), pp. 103–120.MathSciNetCrossRefMATH
13.
Zurück zum Zitat A. Collins et al. “A Barcode Shape Descriptor for Curve Point Cloud Data”. In: Proceedings of the First Eurographics Conference on Point-Based Graphics. SPBG’04. 2004, pp. 181–191. A. Collins et al. “A Barcode Shape Descriptor for Curve Point Cloud Data”. In: Proceedings of the First Eurographics Conference on Point-Based Graphics. SPBG’04. 2004, pp. 181–191.
14.
Zurück zum Zitat C. Cortes and V. Vapnik. “Support-Vector Networks”. In: Machine Learning 20.3 (1995), pp. 273–297.MATH C. Cortes and V. Vapnik. “Support-Vector Networks”. In: Machine Learning 20.3 (1995), pp. 273–297.MATH
15.
Zurück zum Zitat C. Curto et al. “The Neural Ring: An Algebraic Tool for Analyzing the Intrin- sic Structure of Neural Codes”. In: Bulletin of Mathematical Biology 75.9 (2013), pp. 1571–1611.MathSciNetCrossRefMATH C. Curto et al. “The Neural Ring: An Algebraic Tool for Analyzing the Intrin- sic Structure of Neural Codes”. In: Bulletin of Mathematical Biology 75.9 (2013), pp. 1571–1611.MathSciNetCrossRefMATH
16.
Zurück zum Zitat B. Di Fabio and M. Ferri. “Comparing Persistence Diagrams Through Complex Vectors”. In: Image Analysis and Processing | ICIAP 2015: 18th International Conference, Genoa, Italy, September 7–11, 2015, Proceedings, Part I. Springer International Publishing, 2015, pp. 294–305. B. Di Fabio and M. Ferri. “Comparing Persistence Diagrams Through Complex Vectors”. In: Image Analysis and Processing | ICIAP 2015: 18th International Conference, Genoa, Italy, September 7–11, 2015, Proceedings, Part I. Springer International Publishing, 2015, pp. 294–305.
17.
Zurück zum Zitat H. Edelsbrunner, D. Letscher, and A. J. Zomorodian. “Topological persistence and simplification”. In: Discrete and Computational Geometry 28 (2002), pp. 511–533.MathSciNetCrossRefMATH H. Edelsbrunner, D. Letscher, and A. J. Zomorodian. “Topological persistence and simplification”. In: Discrete and Computational Geometry 28 (2002), pp. 511–533.MathSciNetCrossRefMATH
18.
Zurück zum Zitat M. Ferri and C. Landi. “Representing size functions by complex polynomials”. In: Proc. Math. Met. in Pattern Recognition 9 (1999), pp. 16–19. M. Ferri and C. Landi. “Representing size functions by complex polynomials”. In: Proc. Math. Met. in Pattern Recognition 9 (1999), pp. 16–19.
19.
Zurück zum Zitat M. Ferri and I. Stanganelli. “Size Functions for the Morphological Analysis of Melanocytic Lesions”. In: International Journal of Biomedical Imaging 2010 (2010). M. Ferri and I. Stanganelli. “Size Functions for the Morphological Analysis of Melanocytic Lesions”. In: International Journal of Biomedical Imaging 2010 (2010).
20.
Zurück zum Zitat P. Frosini and C. Landi. Size Theory as a Topological Tool for Computer Vision. Tech. rep. P. Frosini and C. Landi. Size Theory as a Topological Tool for Computer Vision. Tech. rep.
21.
Zurück zum Zitat R. Ghrist and V. de Silva. “Coordinate-free Coverage in Sensor Networks with Con- trolled Boundaries via Homology”. In: International Journal of Robotics Research 25 (2006), pp. 1205–1222.CrossRefMATH R. Ghrist and V. de Silva. “Coordinate-free Coverage in Sensor Networks with Con- trolled Boundaries via Homology”. In: International Journal of Robotics Research 25 (2006), pp. 1205–1222.CrossRefMATH
22.
Zurück zum Zitat C. Giusti et al. “Clique topology reveals intrinsic geometric structure in neural correlations”. In: Proceedings of the National Academy of Sciences 112.44 (2015). C. Giusti et al. “Clique topology reveals intrinsic geometric structure in neural correlations”. In: Proceedings of the National Academy of Sciences 112.44 (2015).
24.
Zurück zum Zitat D. Maclagan and B. Sturmfels. Introduction to tropical geometry. Vol. 161. American Mathematical Soc., 2015. D. Maclagan and B. Sturmfels. Introduction to tropical geometry. Vol. 161. American Mathematical Soc., 2015.
25.
Zurück zum Zitat MATLAB. version R2017b. Natick, Massachusetts: The MathWorks Inc., 2017. MATLAB. version R2017b. Natick, Massachusetts: The MathWorks Inc., 2017.
26.
Zurück zum Zitat J.A. Perea and G. Carlsson. “A Klein-Bottle-Based Dictionary for Texture Repre- sentation”. In: International Journal of Computer Vision 1 (2014), pp. 75–97.CrossRefMATH J.A. Perea and G. Carlsson. “A Klein-Bottle-Based Dictionary for Texture Repre- sentation”. In: International Journal of Computer Vision 1 (2014), pp. 75–97.CrossRefMATH
27.
Zurück zum Zitat J. Reininghaus et al. “A Stable Multi-Scale Kernel for Topological Machine Learn- ing”. In: The IEEE Conference on Computer Vision and Pattern Recognition (CVPR). June 2015. J. Reininghaus et al. “A Stable Multi-Scale Kernel for Topological Machine Learn- ing”. In: The IEEE Conference on Computer Vision and Pattern Recognition (CVPR). June 2015.
28.
Zurück zum Zitat G. Singh, F. Méemoli, and G. Carlsson. “Topological Methods for the Analysis of High Dimensional Data Sets and 3D Object Recognition”. In: Eurographics Symposium on Point Based Graphics, European Association for Computer Graphics (2007). G. Singh, F. Méemoli, and G. Carlsson. “Topological Methods for the Analysis of High Dimensional Data Sets and 3D Object Recognition”. In: Eurographics Symposium on Point Based Graphics, European Association for Computer Graphics (2007).
Metadaten
Titel
Tropical Coordinates on the Space of Persistence Barcodes
verfasst von
Sara Kališnik
Publikationsdatum
30.01.2018
Verlag
Springer US
Erschienen in
Foundations of Computational Mathematics / Ausgabe 1/2019
Print ISSN: 1615-3375
Elektronische ISSN: 1615-3383
DOI
https://doi.org/10.1007/s10208-018-9379-y

Weitere Artikel der Ausgabe 1/2019

Foundations of Computational Mathematics 1/2019 Zur Ausgabe

Premium Partner