<figure><img src="image_1.png" /></figure>

HAL
open science

# Efficient and Robust Persistent Homology for Measures

Mickaël Buchet, Frédéric Chazal, Steve Oudot, Donald Sheehy

► To cite this version:

Mickaël Buchet, Frédéric Chazal, Steve Oudot, Donald Sheehy. Efficient and Robust Persistent Homology for Measures. Computational Geometry, 2016, 58, 10.1016/j.comgeo.2016.07.001. hal-01342385

HAL Id: hal-01342385

https://inria.hal.science/hal-01342385

Submitted on 5 Jul 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Efficient and Robust Persistent Homology for Measures

Mickaël Buchet, Frédéric Chazal, Steve Yann Oudot, Donald R. Sheehy

► To cite this version:

Mickaël Buchet, Frédéric Chazal, Steve Yann Oudot, Donald R. Sheehy. Efficient and Robust Persistent Homology for Measures. Computational Geometry, Elsevier, 2016, <http://www.journals.elsevier.com/computational-geometry/>.<hal-01074566v2>

HAL Id: hal-01074566

https://hal.inria.fr/hal-01074566v2

Submitted on 1 Jul 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
Efficient and Robust Persistent Homology for Measures

Mickaël Buchet* Frédéric Chazal† Steve Y. Oudot‡ Donald R. Sheehy§

May 31, 2016

A new paradigm for point cloud data analysis has emerged recently, where point clouds are no longer treated as mere compact sets but rather as empirical measures. A notion of distance to such measures has been defined and shown to be stable with respect to perturbations of the measure. This distance can easily be computed pointwise in the case of a point cloud, but its sublevel-sets, which carry the geometric information about the measure, remain hard to compute or approximate. This makes it challenging to adapt many powerful techniques based on the Euclidean distance to a point cloud to the more general setting of the distance to a measure on a metric space.

We propose an efficient and reliable scheme to approximate the topological structure of the family of sublevel-sets of the distance to a measure. We obtain an algorithm for approximating the persistent homology of the distance to an empirical measure that works in arbitrary metric spaces. Precise quality and complexity guarantees are given with a discussion on the behavior of our approach in practice.

# 1 Introduction

Given a sample of points $P$ from a metric space $\mathcal{X}$, the distance function $d_P$ maps each $x \in \mathcal{X}$ to the distance from $x$ to the nearest point of $P$. The related fields of geometric inference and topological data analysis have provided a host of theorems about what information can be extracted from the distance function, with a particular focus on discovering and quantifying intrinsic properties of the shape underlying a data set [4, 19]. The flagship tool in topological data analysis is persistent homology and the most common goal is to apply the persistence algorithm to distance functions, either in Euclidean space or in metric spaces [1, 14, 23]. From the very beginning, this line of research encountered two major challenges. First, distance functions are very sensitive to noise and outliers (Fig. 1 left). Second, the representations of the sublevel sets of a distance function become prohibitively large even for moderately sized data. These two challenges led to two distinct research directions. First, the distance to the data set was replaced with a distance to a measure induced by that data set [5]. The resulting theory is provably more robust to outliers, but the sublevel sets become even more complex to represent (Fig. 1 center). Towards more efficient representations, several advances in *sparse filtrations* have led to linear-size constructions [12, 20, 21], but all of these methods exploit the specific structure of the distance function and do not obviously generalize. In this paper, we bring these two research directions together by showing how to combine the robustness of the distance to a measure, with the efficiency of sparse filtrations.

## Contributions:

1. A Generalization of the Wasserstein stability and persistence stability of the distance to a measure for triangulable metric spaces.

2. A general method for approximating the sublevel sets of the distance to a measure by a union of balls. Our method uses $O(n)$ balls for inputs of $n$ samples. Known methods for representing the exact sublevel sets can require $n^{\Theta(d)}$ balls. Existing approximations using a linear number of balls are only applicable in Euclidean space [15].

<footnote>*mickael.buchet@m4x.org</footnote>

<footnote>†frederic.chazal@inria.fr</footnote>

<footnote>‡steve.oudot@inria.fr</footnote>

<footnote>§don.r.sheehy@gmail.com</footnote>
<figure><img src="image_3.png" /><figcaption>Figure 1: From left to right, two sublevel sets for $d_P$, $d_{\mu_P,m}$, and $d_{\mu_P,m}^P$ with $m = \frac{3}{|P|}$. The first is too sensitive to noise and outliers. The second is smoother, but substantially more difficult to compute. The third is our approximation, which is robust to noise, efficient to compute, and compact to represent.</figcaption></figure>

3. **A linear size approximation to the weighted Rips filtration.** For intrinsically low-dimensional metric spaces, we construct a filtration of size $O(n)$ that achieves a guaranteed quality approximation. Specifically, if the doubling dimension of the metric is $d$ then the size complexity is $2^{O(dk)n}$ if one considers simplices up to dimension $k$ (see Def. 2.1 for the formal definition of doubling dimension). This is a significant improvement over the full weighted Rips filtration, which has size $2^n$ in general or size $n^{k+1}$ if one considers only simplices up to dimension $k$. It also has the advantage that the sparsification is independent of the weights. Thus, the (geo)metric preprocessing phase can be reused for any weighting of the points. If one attempted to use previous methods directly, this preprocessing phase would have to be repeated for each set of weights. This is especially useful if one is interested in several different weight functions such as when approximating the distance to a measure for several different values of the mass parameter.

4. **An effective implementation with experimental results.**

**Overview of the paper** Originally, the distance to a measure was introduced to capture information about both scale and density in a Euclidean point cloud. We extend the distance to a measure to any metric space $\mathcal{X}$. We write $\bar{B}(x, r)$ to denote the closed ball with center $x$ and radius $r$. The distance to a measure is then defined as follows.

**Definition 1.1.** Let $\mu$ be a probability measure on a metric space $\mathcal{X}$ and let $m \in ]0, 1]$ be a mass parameter. We define the distance $d_{\mu,m}$ to the measure $\mu$ as

$$d_{\mu,m} : x \in \mathcal{X} \mapsto \sqrt{\frac{1}{m} \int_{0}^{m} \delta_{\mu,l}(x)^2 dl},$$

where $\delta_{\mu,m}$ is defined as

$$\delta_{\mu,m} : x \in \mathcal{X} \mapsto \inf\{r > 0 \mid \mu(\bar{B}(x, r)) > m\}.$$

The distance to a measure has interesting inference and stability results in the Euclidean setting [5]. That is, the sublevel sets of the function can be used to infer the topology of the support of the underlying distribution (inference), and also, the output for similar inputs will be similar (stability). In Section 3, we extend these stability results to any metric space. The results about the stability of persistence diagrams apply to any triangulable metric space, i.e. metric spaces homeomorphic to a locally finite simplicial complex (the persistence diagram may not exist for non-triangulable metric spaces).

We then give a new way to approximate the distance to a measure. Using a sampling of the support of a measure, we are able to compute accurately the sublevel sets of the distance to a measure in any metric space, using power distances. We show in Section 4.1 that these functions have adequate stability and approximation properties. Then, in Section 4.2, we give the practical implications for computing persistence diagram for finite samples.
The witnessed k-distance is another approach to approximating the distance to a measure proposed in [15]. This approach works only in Euclidean spaces as it relies on the existence of barycenters of points. The analysis links the quality of the approximation to the underlying topological structure. In this paper, we look at bounds independent of intrinsic geometry. When restricted to the Euclidean setting in section 4.3, our method improves the approximation bounds from [15]. The new bounds match the quality of approximation achieved by our method of Section 4.1, which has the added advantage that it is valid in any metric spaces.

In Section 5, we introduce the weighted Rips complex. Given a parameter, the sublevel set of a power distance associated with this parameter is a union of balls. Generalizing the Vietoris-Rips complex, we define the weighted Rips complex as the clique complex whose 1-skeleton is the same as the one of the nerve of this union of balls. The induced filtration has important stability properties and can be used to approximate persistence diagrams.

Unfortunately, the weighted Rips filtration is too large to construct in full for large instances. This problem already exists with the usual Rips filtration. Sparsifying schemes have been recently proposed in [12, 21]. Extending the approach used in [21], we construct a sparse approximation that has linear size in the number of points (Section 6). This can be used to approximate persistence diagrams even for high dimensional inputs if the data is intrinsically low dimensional. As we show in Section 6, there are very simple examples where the input metric is intrinsically low-dimensional and yet the weight function can cause the weighted distance function to be high-dimensional. Our approach has the advantage over previous methods in that the size complexity will only depend on the dimension of the input metric, rather than the dimension of points under the weighted distance.

The combination of these approaches makes it possible to use the distance to a measure to infer topology on real instances. In Section 7, we illustrate the theory with some examples and results from an implementation.

## 2 Background

In this paper, we consider a metric space $\mathcal{X}$ with distance $d_{\mathcal{X}}(\cdot, \cdot)$. In a slight abuse of notation, we also write $d_{\mathcal{X}}$ to denote the distance between a point and a set defined as $d_{\mathcal{X}}(x, P) = \inf_{p \in P} d_{\mathcal{X}}(x, p)$. The Hausdorff distance between two sets $P$ and $Q$ will be denoted $d_H(P, Q)$. We write $B(x, r)$ for the open ball of center $x$ and radius $r$ in $d_{\mathcal{X}}$, and we write $\tilde{B}(x, r)$ for the corresponding closed ball.

**Metric Spaces and doubling dimension** For metric spaces that are not embedded in Euclidean space, the doubling dimension gives a useful way to describe the intrinsic dimension of the metric space by bounding the size of certain covers of subsets. Formally it is defined as follows.

**Definition 2.1.** The doubling constant $\lambda_{\mathcal{X}}$ of a metric space $\mathcal{X}$ is the maximum over all balls $B(x, r)$ with $x \in \mathcal{X}$ of the minimum number of balls of radius $r/2$ required to cover $B(x, r)$. The doubling dimension is defined to be $\log_2(\lambda_{\mathcal{X}})$.

**Wasserstein distance**

To compare measures, we use the Wasserstein distance, also called the earth-mover distance. Intuitively, it is the minimal cost to move all the mass from one measure to another. To state the formal definition we first introduce some notation.

Given a measure $\mu$ on a metric space $\mathcal{X}$, we write $\mathfrak{B}(\mathcal{X})$ to denote the set of all Borel subsets of $\mathcal{X}$. Given $A \in \mathfrak{B}(\mathcal{X})$, we define the mass of $A$ as $\mu(A)$. Similarly $\mu(\mathcal{X})$ is called the total mass of $\mu$. We write $\text{Supp}(\mu)$ for the support of the measure $\mu$.

**Definition 2.2.** Let $\mu$ and $\nu$ be positive measures with the same total mass on a metric space $\mathcal{X}$. A transport plan between $\mu$ and $\nu$ is a measure $\pi$ on $\mathcal{X} \times \mathcal{X}$ such that for all $A, B \in \mathfrak{B}(\mathcal{X})$,

$$ \pi(A \times \mathcal{X}) = \mu(A) \text{ and } \pi(\mathcal{X} \times B) = \nu(B). $$

We denote by $\Pi(\mu, \nu)$ the set of all transport plans between $\mu$ and $\nu$. The $p$th order cost of the transport plan $\pi$ is defined as

$$ C_p(\pi) = \left( \int_{\mathcal{X} \times \mathcal{X}} d_{\mathcal{X}}(x, y)^p d\pi(x, y) \right)^{\frac{1}{p}}. $$
The Wasserstein distance between $\mu$ and $\nu$ is the minimum cost over all transport plans.

**Definition 2.3.** Let $\mu$ and $\nu$ be positive measures with the same total mass on a metric space $\mathcal{X}$. The Wasserstein distance of order $p$ between $\mu$ and $\nu$ is defined as

$$W_p(\mu, \nu) = \min_{\pi \in \Pi(\mu, \nu)} \left( \int_{\mathcal{X} \times \mathcal{X}} d_{\mathcal{X}}(x, y)^p d\pi(x, y) \right)^{\frac{1}{p}}.$$

The Wasserstein distance is finite if both probability measures have finite $p$-moments, which is always the case for measures with compact support.

## Persistence theory

A filtration $F = \{F_\alpha\}_{\alpha \in \mathbb{R}}$ is a sequence of spaces such that $F_\alpha \subseteq F_\beta$ whenever $\alpha \le \beta$. Persistence theory studies the evolution of the homology of the sets $F_\alpha$ for $\alpha$ ranging from $-\infty$ to $+\infty$. More precisely, the filtration induces a family of vector spaces connected by linear maps at the homology level, called a persistence module. More generally, a persistence module is a pair $\mathbb{V} = (\{V_\alpha\}, \{v_\alpha^\beta\})$ where each $V_\alpha$ is a vector space and $v_\alpha^\beta$ is a linear map $V_\alpha \to V_\beta$ such that $v_\beta^\gamma \circ v_\alpha^\beta = v_\alpha^\gamma$ for all $\alpha \le \beta \le \gamma$ and $v_\alpha^\alpha$ is the identity. A persistence module is said to be $q$-tame if $v_\alpha^\beta$ has finite rank for every $\alpha < \beta$. A filtration is said to be $q$-tame if its corresponding persistence module is $q$-tame. The algebraic structure of a $q$-tame persistence module $\mathbb{U}$ can be described and visualized by the persistence diagram Dgm($\mathbb{U}$), a multiset of points in the plane. If $\mathbb{U}$ comes from a filtration $\{F_\alpha\}$, a point $(\alpha, \beta)$ in Dgm($\mathbb{U}$) indicates a nontrivial homology class that exists in the filtration between the parameter values $\alpha$ and $\beta$.

We overload notation and write Dgm($\{F_\alpha\}$) to denote the persistence diagram of the persistence module defined by the filtration $\{F_\alpha\}$. Moreover, for a real-valued function $f$, we write Dgm($f$) to denote Dgm($\{f^{-1}(\cdot - \infty, \alpha]\}$), the persistence diagram of the sublevel sets filtration of $f$. For an introduction to persistent homology, the reader is directed to [6, 13].

## Bottleneck distance

We put a metric on the space of persistence diagrams as follows. First, a partial matching $M$ between diagrams $D$ and $E$ is a subset of $D \times E$ in which each element of $D \cup E$ appears in at most one pair. The bottleneck cost of $M$ is $\max_{(d,e) \in M} \|d - e\|_{\infty}$. We say $M$ is an $\epsilon$-matching if the bottleneck cost is $\epsilon$ and every $(\alpha, \beta)$ in $D$ or $E$ with $|\beta - \alpha| \ge 2\epsilon$ is matched. The bottleneck distance between $D$ and $E$ is defined as

$$d_B(D, E) = \inf\{\epsilon \mid \text{there exists an } \epsilon\text{-matching between } D \text{ and } E\}.$$

It is often useful to look at persistence diagrams on a logarithmic scale, because the distance does no longer depend on the scale at which the object is seen. The log-bottleneck distance, denoted $d_B^{\log}$ is the bottleneck distance between diagrams after the change of coordinates $(\alpha, \beta) \mapsto (\ln \alpha, \ln \beta)$.

## Filtration interleaving

One way to prove that two persistence diagrams are close is to prove that the filtrations inducing them are interleaved. Two filtrations $\{U_\alpha\}_{\alpha \in \mathbb{R}}$ and $\{V_\alpha\}_{\alpha \in \mathbb{R}}$ are said to be $\epsilon$-interleaved if for any $\alpha$,

$$U_{\alpha} \subseteq V_{\alpha+\epsilon} \subseteq U_{\alpha+2\epsilon}.$$

The following classic result [2, 6, 10] about stability of persistence diagrams says that interleaved filtrations yield similar persistence diagrams.

**Theorem 2.4.** Let $U$ and $V$ be two $q$-tame and $\epsilon$-interleaved filtrations. Then, the persistence diagrams of these filtrations are $\epsilon$-close in bottleneck distance, i.e.,

$$d_B(\text{Dgm}(U), \text{Dgm}(V)) \le \epsilon.$$

We work with the persistence theory on functions, which means studying the persistence of the sublevel sets filtration defined as $\{f^{-1}(\cdot - \infty, \alpha]\}_{\alpha \in \mathbb{R}}$ for any real-valued function. To simplify notation, we write Dgm($f$) to denote the persistence diagram of the sublevel sets filtration of $f$.
## Persistence module interleaving

The notion of interleaving can be extended to persistence modules as seen in [7]. Given two persistence modules $U = (\{U_\alpha\}, \{u_\alpha^\beta\})$ and $V = (\{V_\alpha\}, \{v_\alpha^\beta\})$ and a real $\epsilon > 0$, an $\epsilon$-homomorphism from $U$ to $V$ is a collection of linear maps $\Phi = \{\phi_\alpha\}$ such that for all $\alpha < \beta$, $v_{\alpha+\epsilon}^{\beta+\epsilon} \circ \phi_\alpha = \phi_\beta \circ u_\alpha^\beta$. Two $\epsilon$-homomorphisms $\Phi$ from $U$ to $V$ and $\Psi$ from $V$ to $W$ can be composed to build a $2\epsilon$-homomorphism $\Psi\Phi$ from $U$ to $W$ whose linear maps are obtained by composing the linear maps of $\Phi$ and $\Psi$. Among $\epsilon$-homomorphisms from $U \to U$, one has a particular role. The $\epsilon$-shift map $1_U^\epsilon$ is the collection of maps $u_\alpha^{\alpha+\epsilon}$ given in the persistence module $U$. We use it to define the interleaving of two persistence modules as follows.

**Definition 2.5.** Let $U$ and $V$ be two $q$-tame persistence modules. $U$ and $V$ are $\epsilon$-interleaved if there exists $\epsilon$-homomorphisms $\Phi: U \to V$ and $\Psi: V \to U$ such that $\Phi\Psi = 1_U^{2\epsilon}$ and $\Psi\Phi = 1_U^{2\epsilon}$.

Note that the definition is equivalent to the commutativity of the following diagrams for any $\alpha < \beta$, where $\Phi = \{\phi_\alpha\}$ and $\Psi = \{\psi_\alpha\}$.

<figure><img src="image_4.png" /></figure>

The following theorem is an algebraic analog of Theorem 2.4. The proof can be found in [6].

**Theorem 2.6.** Let $U$ and $V$ be two $q$-tame and $\epsilon$-interleaved persistence modules. Then,

$$d_B(\mathrm{Dgm}(U), \mathrm{Dgm}(V)) \leq \epsilon.$$

## Contiguous simplicial maps

Let $X$ and $Y$ be simplicial complexes. A simplicial map $f: X \to Y$ is a map between the corresponding vertex sets so that for every simplex $\sigma \in X$, $f(\sigma) = \bigcup_{p \in \sigma} f(p)$ is a simplex in $Y$. Two simplicial maps $f$ and $g$ are contiguous if $\sigma \in X$ implies that $f(\sigma) \cup g(\sigma) \in Y$. If two simplicial maps are contiguous, then they induce the same homomorphism at the homology level [18, Chapter 1].

A clique complex is a simplicial complex whose simplices are the cliques of a graph. Many of the simplicial complexes considered in this paper are clique complexes. We will use the following simple lemma to construct contiguous simplicial maps between clique complexes.

**Lemma 2.7.** Let $X$ and $Y$ be clique complexes and let $f$ and $g$ be two functions from the vertex set of $X$ to the vertex set of $Y$. If for every edge $(p, q) \in X$, the tetrahedron $\{f(p), g(p), f(q), g(q)\}$ is in $Y$, then $f$ and $g$ induce contiguous simplicial maps from $X$ to $Y$.

*Proof.* Let $\sigma$ be a simplex of $X$. Every pair in $f(\sigma) \cup g(\sigma)$ is of the form $(f(p), f(q))$, $(f(p), g(q))$, or $(g(p), g(q))$ for some vertices $p$ and $q$ in $\sigma$. Since $(p, q) \in \sigma$, the tetrahedron hypothesis of the lemma implies that all of these pairs are edges of $Y$. Thus, $f(\sigma) \cup g(\sigma)$ is a simplex in $Y$ because $Y$ is a clique complex. Moreover, $f(\sigma) \in Y$ and $g(\sigma) \in Y$ because simplices are closed under taking subsets. Therefore, $f$ and $g$ are indeed contiguous simplicial maps as desired. $\square$

# 3 Persistence and Stability of the Distance to a Measure in a Metric Space

In this section, we prove that, if we have two close probability measures, then the persistence diagrams of the sublevel sets filtration of their distance to measure functions are close. The result applies to
triangulable metric spaces, i.e., those that are homeomorphic to a locally finite simplicial complex. The persistence diagrams considered in this paper are well defined in this class of spaces. In particular, every compact Riemannian manifold is triangulable.

If the persistence diagram is to be meaningful, one might expect that it is stable with respect to perturbations in the underlying measure. The following theorem shows that this is indeed the case. Two measures that are close in the quadratic Wasserstein distance, $W_2$ yield persistence diagrams that are close in bottleneck distance, $d_B$ (see [22, Sec. 7.1]).

**Theorem 3.1.** Let $\mu$ and $\nu$ be two probability measures on a triangulable metric space $X$ and let $m$ be a mass parameter. Then Dgm($d_{\mu,m}$) and Dgm($d_{\nu,m}$) are well-defined and

$$d_B(\text{Dgm}(d_{\mu,m}), \text{Dgm}(d_{\nu,m})) \le \frac{1}{\sqrt{m}} W_2(\mu, \nu).$$

To prove this theorem, we first show that the distance to measure functions are stable with respect to the Wasserstein distance. Then, we prove that their diagrams are well-defined and are close using Theorem 2.4. This result provides the same bound as the existing Euclidean space result. Technicalities exist for the well-definition of persistence diagrams which required the metric space to be triangulable.

## 3.1 Wasserstein stability

A measure $\nu$ is a submeasure of a measure $\mu$ if for every $B \in \mathfrak{B}(X)$, $\nu(B) \le \mu(B)$. Let $\text{Sub}_m(\mu)$ be the set of all submeasures of $\mu$, which have a total mass $m$.

The distance to a measure $\mu$ at point a $x$ can be expressed as the Wasserstein distance between two measures, the Dirac mass $\delta_x$ on $x$ and a submeasure of $\mu$ of mass $m$. Using this view, we generalize the stability result from [5] as follows.

**Proposition 3.2.** Let $\mu$ be a probability measure on a metric space $X$, and let $m \in [0, 1]$ be a mass parameter. Then,

$$d_{\mu,m}(x) = \min_{\nu \in \text{Sub}_m(\mu)} \frac{1}{\sqrt{m}} W_2(m\delta_x, \nu).$$

Given $x \in X$ and $m > 0$, let $\mathcal{R}_{\mu,m}(x)$ be the set of the submeasures of $\mu$ with total mass $m$ whose support is contained in the closed ball $\tilde{B}(x, \delta_{\mu,m}(x))$ and whose restriction to the open ball $B(x, \delta_{\mu,m}(x))$ coincides with $\mu$. The proof shows that $\mathcal{R}_{\mu,m}(x)$ is exactly the set of minimizers of Proposition 3.2.

In order to prove this theorem we need to introduce a few definitions. The cumulative function $F_{\nu}: \mathbb{R}^{+} \to \mathbb{R}$ of a measure $\nu$ on $\mathbb{R}^{+}$ is the non-decreasing function defined by $F_{\nu}(y) = \nu([0, y))$. Its generalized inverse $F_{\nu}^{-1}: m \mapsto \inf\{t \in \mathbb{R} | F_{\nu}(t) > m\}$ is left-continuous.

*Proof.* If $\nu$ is a measure of total mass $m$ on $X$ then there exists only one transport plan between $\nu$ and the Dirac mass $m\delta_x$. It transports every point of $X$ to $x$. Hence we get

$$W_2(m\delta_x, \nu)^2 = \int_X d_X(h, x)^2 d\nu(h).$$

Let $d_x: X \to \mathbb{R}$ denote the distance function to the point $x$ and let $\nu_x$ be the pushforward of $\nu$ by the distance function to $x$. That is, for any subset $I$ of $\mathbb{R}$, $\nu_x(I) = \nu(d_x^{-1}(I))$. Note that $F_{\nu_x}^{-1}(m) = \delta_{\nu,m}(x)$. Using the change of variable formula and the definition of the cumulative function we get:

$$\int_X d_X(h, x)^2 d\nu(h) = \int_{\mathbb{R}^+} t^2 d\nu_x(t) = \int_0^m F_{\nu_x}^{-1}(l)^2 dl.$$

Suppose further that $\nu$ is a submeasure of $\mu$, then $F_{\nu_x}(t) \le F_{\mu_x}(t)$ for all $t > 0$. So, $F_{\nu_x}^{-1}(l) \ge F_{\mu_x}^{-1}(l)$ for all $l > 0$, and thus,

$$W_2(m\delta_x, \nu)^2 \ge \int_0^m F_{\mu_x}^{-1}(l)^2 dl = \int_0^m \delta_{\mu,l}(x)^2 dl = m d_{\mu,m}(x)^2. \quad (1)$$

This inequality implies that $d_{\mu,m}(x)$ is smaller than $\frac{1}{\sqrt{m}}W_2(m\delta_x, \nu)$ for any $\nu \in \text{Sub}_m(\mu)$.
Consider the case when the inequality in (1) is tight. Such a case happens when for almost every $l \le m$, $F_{\nu_x}^{-1}(l) = F_{\mu_x}^{-1}(l)$. Since these functions are increasing and left-continuous, equality must hold for every such $l$. By the definition of the pushforward, this implies that $\nu(\bar{B}(x, \delta_{\mu,m}(x))) = m$, i.e., all the mass of $\nu$ is contained in the closed ball $\bar{B}(x, \delta_{\mu,m}(x))$, and that $\nu(B(x, \delta_{x,\mu}(m))) = \mu(B(x, \delta_{x,\mu}(m)))$. Because $\nu$ is a submeasure of $\mu$ this is true if and only if $\nu$ is in the set $\mathcal{R}_{\mu,m}(x)$ described before the proof. Thus $\mathcal{R}_{\mu,m}(x)$ is exactly the set of submeasures $\nu \in \text{Sub}_m(\mu)$ such that $d_{\mu,m}(x) = \frac{1}{\sqrt{m}}W_2(m\delta_x, \nu)$.

To conclude the proof we need only show that there exists at least one measure $\mu_{x,m}$ in the set $\mathcal{R}_{\mu,m}(x)$. If $\mu(\bar{B}(x, \delta_{\mu,m}(x))) = m$, then $\mu_{x,m} = \mu|_{\bar{B}(x, \delta_{\mu,m}(x))}$ is an obvious choice. The only difficulty is when the boundary $\partial B(x, \delta_{\mu,m}(x))$ of the ball has too much mass. In this case we uniformly rescale the mass contained in the bounding sphere such that the measure $\mu_{x,m}$ has total mass $m$. More precisely we let:

$$ \mu_{x,m} = \mu|_{B(x, \delta_{\mu,m}(x))} + (m - \mu(B(x, \delta_{\mu,m}(x)))) \frac{\mu|_{\partial B(x, \delta_{\mu,m}(x))}}{\mu(\partial B(x, \delta_{\mu,m}(x)))}. $$

We hence have $\frac{1}{\sqrt{m}}W_2(m\delta_x, \mu_{x,m}) = d_{\mu,m}(x)$. $\square$

From this result, we have the following Wasserstein stability guarantee for the distance to a measure.

**Theorem 3.3.** Let $\mu$ and $\nu$ be two probability measures on a metric space $X$ and let $m \in ]0, 1]$ be a mass parameter. Then:

$$ \|d_{\mu,m} - d_{\nu,m}\|_{\infty} \le \frac{1}{\sqrt{m}} W_2(\mu, \nu). $$

*Proof.* Using Proposition 3.2, we get that $\sqrt{m} d_{\mu,m}(x) = W_2(m\delta_x, \mu_{x,m})$, where $\mu_{x,m} \in \mathcal{R}_{\mu,m}(x)$. Let $\pi$ be an optimal transport plan between $\mu$ and $\nu$, i.e., a transport plan between $\mu$ and $\nu$ such that

$$ \int_{X \times X} d_X(x, y)^2 d\pi(x, y) = W_2(\mu, \nu)^2. $$

Let us consider the submeasure $\mu_{x,m}$ of $\mu$. Then there exists $\tilde{\pi}$ a submeasure of $\pi$ that transports $\mu_{x,m}$ to a submeasure $\tilde{\nu}$ of $\nu$. We get that:

$$ W_2(\mu_{x,m}, \tilde{\nu}) \le W_2(\mu, \nu). $$

Using Proposition 3.2 again, we get that for any $x \in X$, $\sqrt{m} d_{\nu,m}(x) \le W_2(m\delta_x, \tilde{\nu})$. Thus,

$$ \begin{aligned} \sqrt{m} d_{\nu,m}(x) &\le W_2(m\delta_x, \tilde{\nu}) \le W_2(m\delta_x, \mu_{x,m}) + W_2(\tilde{\nu}, \mu_{x,m}) \\ &\le \sqrt{m} d_{\mu,m}(x) + W_2(\mu, \nu). \end{aligned} $$

The roles of $\mu$ and $\nu$ can be reversed to conclude the proof. $\square$

Another consequence of Proposition 3.2 is that $d_{\mu,m}$ is 1-Lipschitz with respect to $x$.

**Proposition 3.4.** Let $\mu$ be a probability measure on a metric space $X$ and let $m \in ]0, 1]$ be a mass parameter. Then $d_{\mu,m}$ is 1-Lipschitz.

*Proof.* Let $x$ and $y$ be two points of $X$. Using Proposition 3.2, there exists a submeasure $\mu_{x,m}$ of $\mu$ such that $d_{\mu,m}(x) = \frac{1}{\sqrt{m}}W_2(m\delta_x, \mu_{x,m})$. The same proposition applied to $y$ gives $d_{\mu,m}(y) \le \frac{1}{\sqrt{m}}W_2(m\delta_y, \mu_{x,m})$. Knowing that $W_2(m\delta_x, m\delta_y) = \sqrt{m} d_X(x, y)$, we can conclude that $d_{\mu,m}(y) \le d_{\mu,m}(x) + d_X(x, y)$. The choice of $x$ and $y$ is arbitrary, so by symmetry, $d_{\mu,m}(x) \le d_{\mu,m}(y) + d_X(x, y)$. Therefore, $d_{\mu,m}$ is 1-Lipschitz. $\square$

## 3.2 Persistence

For persistence diagrams of sublevel sets filtrations of distance to measure functions to be well-defined, we need to prove that they are q-tame.

**Proposition 3.5.** Let $X$ be a triangulable metric space, let $\mu$ be a probability measure on $X$, and let $m \in ]0, 1]$ be a mass parameter. Then, the sublevel sets filtration of $d_{\mu,m}$ is q-tame.
*Proof.* According to Proposition 3.4 $d_{\mu,m}$ is 1-Lipschitz and thus continuous. Also, $d_{\mu,m}$ is nonnegative by definition. Moreover, $d_{\mu,m}$ is proper, i.e., the preimage of any compact set is compact. As the function is nonnegative and continuous, it suffices to show that any sublevel set $d_{\mu,m}^{-1}([0, \alpha])$ is compact.

Suppose for contradiction that for a fixed $\alpha > 0$, $d_{\mu,m}^{-1}([0, \alpha])$ is not compact. Then there exists a sequence $(x_i)_{i>0}$ of points of $d_{\mu,m}^{-1}([0, \alpha])$ such that $d_X(x_0, x_n) \to \infty$ when $n \to \infty$. Hence we can extract a sub-sequence $(x_{\phi(i)})_{i>0}$ such that for any $i$ and $j$, $\bar{B}(x_{\phi(i)}, \sqrt{2}\alpha) \cap \bar{B}(x_{\phi(j)}, \sqrt{2}\alpha) = \emptyset$. Let us remark that $\mu(\bar{B}(x_{\phi(i)}, \sqrt{2}\alpha)) \ge \frac{m}{2}$. So,

$$d_{\mu,m}(x_{\phi(i)})^2 = \frac{1}{m} \int_{0}^{m} \delta_{\mu,l}(x_{\phi(i)})^2 dl \le \alpha^2.$$

The function $\delta_{\mu,l}(x_{\phi(i)})$ is nonnegative and increasing with $l$ and therefore $\frac{m}{2}\delta_{\mu,\frac{m}{2}}(x_{\phi(i)})^2 \le m\alpha^2$. Using the definition of $\delta_{\mu,m}$, this implies that $\mu(\bar{B}(x_{\phi(i)}, \sqrt{2}\alpha)) \ge \frac{m}{2}$. Measures are countably additive, so

$$\mu(\mathbb{X}) \ge \sum_{i>0} \mu(\bar{B}(x_{\phi(i)}, \sqrt{2}\alpha)) \ge \sum_{i>0} \frac{m}{2} = \infty.$$

However, $\mu$ is a probability measure and therefore $\mu(\mathbb{X}) = 1$. This contradiction implies that $d_{\mu,m}^{-1}([0, \alpha])$ is compact.

As $\mathbb{X}$ is triangulable, there exists a homeomorphism $h$ from $\mathbb{X}$ to a locally finite simplicial complex $C$. Then for any $\alpha > 0$, we can restrict the simplicial complex $C$ to a finite simplicial complex $C_\alpha$ that contains $h(d_{\mu,m}^{-1}([0, \alpha]))$ as $d_{\mu,m}^{-1}([0, \alpha])$ is compact. The function $d_{\mu,m} \circ h^{-1}|_{C_\alpha}$ is continuous on $C_\alpha$. Thus its sublevel sets filtration is $q$-tame by Theorem 2.22 of [6].

The construction extends to any $\alpha$ and therefore the sublevel sets filtration of $d_{\mu,m} \circ h^{-1}$ is $q$-tame. Furthermore, homology is preserved by homeomorphisms and thus we can say that the sublevel sets filtration of $d_{\mu,m}$ is $q$-tame. $\square$

Theorem 3.1 is now obtained by combining Theorem 2.4 and Proposition 3.5.

*Proof of Theorem 3.1.* Theorem 3.3 guarantees that:

$$\|d_{\mu,m} - d_{\nu,m}\|_{\infty} \le \frac{1}{\sqrt{m}} W_2(\mu, \nu).$$

The sublevel sets filtrations are therefore interleaved since for all $\alpha \in \mathbb{R}$,

$$d_{\mu,m}^{-1}([ - \infty, \alpha]) \subseteq d_{\nu,m}^{-1}([ - \infty, \alpha + \frac{1}{\sqrt{m}} W_2(\mu, \nu)]) \subseteq d_{\mu,m}^{-1}([ - \infty, \alpha + \frac{2}{\sqrt{m}} W_2(\mu, \nu)]).$$

Therefore, applying Theorem 2.4 gives

$$d_B(Dgm(d_{\mu,m}), Dgm(d_{\nu,m})) \le \frac{1}{\sqrt{m}} W_2(\mu, \nu). \quad \square$$

# 4 Approximating the Distance to a Measure

Computing the persistence diagram of the sublevel sets filtration of $d_{\mu,m}$ requires knowing the sublevel sets. They are not generally easy to compute. We propose an approximation paradigm for $d_{\mu,m}$ that replaces the sublevel sets by a union of balls. The approach works in any metric space and yields equivalent guarantees as the witnessed $k$-distance approach used in [15] for Euclidean spaces.

## 4.1 Power distances

**Definition 4.1.** Given a metric space $\mathbb{X}$, a set $P$ and a function $w : P \to \mathbb{R}$, we define the power distance $f$ associated with $(P, w)$ as

$$f(x) = \sqrt{\min_{p \in P} d_{\mathbb{X}}(p, x)^2 + w_p^2}, \quad (2)$$

where $w_p$ is the value of $w$ at the point $p$.
The function $w$ can be defined on a superset of $P$. Moreover, the sublevel set $f^{-1}([}-\infty, \alpha])$ is the union of the closed balls centered on the points $p$ of $P$ with radius $r_p(\alpha) = \sqrt{\alpha^2 - w_p^2}$. By convention, we assume the ball is empty when the radius is imaginary.

## Stability

Power distances are stable under small perturbations of the points.

The following lemma states a result about inclusions between balls. It allows another stability result on power distances (Proposition 4.3) and will be useful for studying the stability of the weighted Rips filtration in Section 5.

**Lemma 4.2.** Let $p, q \in \mathbb{X}$ be such points such that $d_{\mathbb{X}}(p, q) \le \epsilon$, and let $w : \mathbb{X} \to \mathbb{R}$ be a $t$-Lipschitz function. For all $\alpha \ge w_p$,

$$r_p(\alpha) + \epsilon \le r_q(\alpha + \sqrt{1 + t^2} \epsilon).$$

*Proof.* First, observe that $r_p(\alpha)$ can be bounded as follows.

$$r_p(\alpha)^2 = \alpha^2 - w_p^2 \le \alpha^2 - w_p^2 + (t\alpha - \sqrt{1+t^2}w_p)^2 \\ = (\sqrt{1+t^2}\alpha - tw_p)^2.$$

Next, we relate $r_p$ and $r_q$ as follows.

$$(r_p(\alpha) + \epsilon)^2 = \alpha^2 - w_p^2 + 2\epsilon\sqrt{\alpha^2 - w_p^2} + \epsilon^2 \\ \le \alpha^2 - w_p^2 + 2\epsilon(\sqrt{1+t^2}\alpha - tw_p) + \epsilon^2 \\ = (\alpha + \sqrt{1+t^2}\epsilon)^2 - (w_p + t\epsilon)^2 \\ \le (\alpha + \sqrt{1+t^2}\epsilon)^2 - w_q^2 \\ = r_q(\alpha + \sqrt{1+t^2}\epsilon)^2.$$

The requirement that $\alpha \ge w_p$ allows us to take the square root of both sides of the inequality since both will be nonnegative. $\square$

As a consequence, we obtain the following.

**Proposition 4.3.** Let $\mathbb{X}$ be a metric space and let $w : \mathbb{X} \to \mathbb{R}$ be a function. Let $P$ and $Q$ be two compact subsets of $\mathbb{X}$. Let $f_P$ and $f_Q$ be the power distances associated with $(P, w)$ and $(Q, w)$. If $w$ is $t$-Lipschitz, then

$$\|f_P - f_Q\|_{\infty} \le \sqrt{1 + t^2} d_H(P, Q).$$

*Proof.* Let $x$ be any point of $\mathbb{X}$. There exists $p \in P$ such that $x \in \bar{B}(p, r_p(f_P(x)))$. There also exists $q \in Q$ such that $d_{\mathbb{X}}(p, q) \le d_H(P, Q)$. By Lemma 4.2 and the triangle inequality, $x \in \bar{B}(q, r_q(f_P(x) + \sqrt{1+t^2}d_H(P, Q)))$. Thus, $f_Q(x) \le f_P(x) + \sqrt{1+t^2}d_H(P, Q)$. $P$ and $Q$ are interchangeable therefore $\|f_Q - f_P\|_{\infty} \le \sqrt{1+t^2}d_H(P, Q)$. $\square$

Remark that this bound is tight. If we replace $t$ by 0, we have $\|f_Q - f_P\|_{\infty} = d_H(P, Q)$.

## Approximation

To approximate the distance to a probability measure $\mu$, we introduce the following function.

**Definition 4.4.** Let $\mu$ be a probability measure on a metric space $\mathbb{X}$ and let $m \in [0, 1]$ be a mass parameter. Given a subset $P$ of $\mathbb{X}$, we define $d_{\mu,m}^P$ as the power distance associated with $(P, d_{\mu,m})$.

$$d_{\mu,m}^P(x) = \sqrt{\min_{p \in P} d_{\mathbb{X}}(p, x)^2 + d_{\mu,m}(p)^2}$$

That is, the weight of each point is its distance to the empirical measure. If $P$ is close to $\text{Supp}(\mu)$, we obtain an approximation of $d_{\mu,m}$.
**Theorem 4.5.** Let $\mu$ be a probability measure on a metric space $\mathcal{X}$ and let $m \in [0, 1]$ be a mass parameter. Let $P$ be a subset of $\mathcal{X}$. If $d_H(P, \text{Supp}(\mu)) \le \epsilon$, then

$$ \frac{1}{\sqrt{2}} d_{\mu,m} \le d_{\mu,m}^P \le \sqrt{5} (d_{\mu,m} + \epsilon). $$

A multiplicative approximation implies a multiplicative interleaving of the sublevel sets filtrations that becomes an additive interleaving on a logarithmic scale. Theorem 2.4 thus guarantees that the persistence diagrams are close in the bottleneck distance on a logarithmic scale.

*Proof.* Let $x$ be a point of $\mathcal{X}$. Using the previous notations we get

$$ d_{\mu,m}(x)^2 = \frac{1}{m} \int_{\mathcal{X}} d_{\mathcal{X}}(y, x)^2 \mu_{x,m}(y) dy. $$

Let us now fix a point $p \in \text{Supp}(\mu)$. Since $\mu_{p,m}$ is a submeasure of $\mu$ of total mass $m$,

$$ \begin{aligned} d_{\mu,m}(x)^2 &= \frac{1}{m} \int_{\mathcal{X}} d_{\mathcal{X}}(y,x)^2 \mu_{x,m}(y) dy \\ &\le \frac{1}{m} \int_{\mathcal{X}} d_{\mathcal{X}}(y,x)^2 \mu_{p,m}(y) dy \\ &\le \frac{1}{m} \int_{\mathcal{X}} ((d_{\mathcal{X}}(y,p) + d_{\mathcal{X}}(p,x))^2) \mu_{p,m}(y) dy \\ &\le d_{\mathcal{X}}(p,x)^2 \frac{2}{m} \int_{\mathcal{X}} \mu_{p,m}(y) dy + \frac{2}{m} \int_{\mathcal{X}} d_{\mathcal{X}}(y,p)^2 \mu_{p,m}(y) dy \\ &= 2(d_{\mathcal{X}}(p,x)^2 + d_{\mu,m}(p)^2). \end{aligned} $$

The third inequality follows from the triangle inequality and the relation $(a+b)^2 \le 2(a^2+b^2)$.

As the above inequality holds for any point $p$ in $P$ we can conclude that

$$ d_{\mu,m}(x) \le \sqrt{2} d_{\mu,m}^P(x). $$

To show the other inequality, let $p$ be a point of $P$. Then by definition we get:

$$ \begin{aligned} d_{\mu,m}^P(x)^2 &\le d_{\mathcal{X}}(x,p)^2 + d_{\mu,m}(p)^2 \\ &\le d_{\mathcal{X}}(x,p)^2 + \frac{1}{m} \int_{\mathcal{X}} d_{\mathcal{X}}(p,y)^2 \mu_{x,m}(y) dy \\ &\le d_{\mathcal{X}}(x,p)^2 + \frac{1}{m} \int_{\mathcal{X}} (d_{\mathcal{X}}(p,x) + d_{\mathcal{X}}(x,y))^2 \mu_{x,m}(y) dy \\ &\le 3 d_{\mathcal{X}}(x,p)^2 + 2 d_{\mu,m}(x)^2. \end{aligned} $$

By the definition of the distance to a measure, $d_{\mathcal{X}}(x, \text{Supp}(\mu)) \le d_{\mu,m}(x)$. Consequently, there exists a point $p \in P$ such that $d_{\mathcal{X}}(x,p) \le d_{\mu,m}(x) + \epsilon$. Hence,

$$ d_{\mu,m}^P(x)^2 \le 5(d_{\mu,m}(x) + \epsilon)^2. \quad \square $$

## 4.2 Measures with finite support

We now assume that the data are given as a finite set of points $P$ in a metric space $\mathcal{X}$. We define the following measure to study the point set $P$.

**Definition 4.6.** Given a finite point set $P$ in a metric space $\mathcal{X}$, the empirical measure $\mu_P$ on $P$ is defined as a normalized sum of Dirac measures:

$$ \mu_P = \frac{1}{|P|} \sum_{p \in P} \delta_p. $$
Let $x$ be a point of $\mathbb{X}$. We introduce the parameter $k = m|P|$. To simplify the exposition we will assume that $k$ is an integer. See Remark 1 for the generalization.

We reorder the points of $P$ such that $P = (p_1(x), \cdots, p_{|P|}(x))$ and

$$d_{\mathbb{X}}(x, p_1(x)) \le \cdots \le d_{\mathbb{X}}(x, p_{|P|}(x)). \qquad (3)$$

If two points are at the same distance of $x$, we order them arbitrarily. We define the set

$$NN_k^P(x) = \{p_1(x), \cdots, p_k(x)\}$$

and call it the set of $k^{th}$ nearest neighbors of $x$. The set $\Lambda_k^P$ consists of all $k$-tuples of points of $P$.

**Lemma 4.7.** Let $P$ be a finite point set in a metric space $\mathbb{X}$ then for any $x \in \mathbb{X}$:

$$d_{\mu_P, m}(x) = \sqrt{\min_{S \in \Lambda_k^P} \frac{1}{k} \sum_{p \in S} d_{\mathbb{X}}(p, x)^2} = \sqrt{\frac{1}{k} \sum_{p \in NN_k^P(x)} d_{\mathbb{X}}(p, x)^2}.$$

*Proof.* Since $\mu_P$ has finite support, all its submeasures also have finite support.

$$\mathrm{Sub}_m(\mu_P) = \left\{ \sum_{p \in P} \lambda_p \delta_p \mid \forall p \in P, 0 \le \lambda_p \le \frac{1}{|P|} \text{ and } \sum_{p \in P} \lambda_p = m \right\}$$

Let $\nu = \sum_{p \in P} \lambda_p \delta_p$ be an element of $\mathrm{Sub}_m(\mu_P)$.

$$W_2(m\delta_x, \nu)^2 = \sum_{p \in P} \lambda_p d_{\mathbb{X}}(x, p)^2$$

Combined with the relation (3), we get

$$S_x = \sum_{p \in NN_k^P(x)} \delta_p \in \mathrm{argmin}_{\nu \in \mathrm{Sub}_m(\mu_P)} W_2(m\delta_x, \nu).$$

As $S_x \in \Lambda_k^P$, we are done.

<figure><img src="image_5.png" /></figure>

The distance to the empirical measure, $d_{\mu_P, m}$, is thus defined as a lower envelope of quadratic functions. It is generally costly if not impossible to compute its sublevel sets.

However, we can directly use the approximation presented in Section 4.1. Using $P$ in Definition 4.4 and Theorem 4.5, we get the following.

**Corollary 4.8.** Let $P$ be a finite point set of a metric space $\mathbb{X}$ and $m \in ]0, 1]$ be a mass parameter. Then,

$$\frac{1}{\sqrt{2}} d_{\mu_P, m} \le d_{\mu_P, m}^P \le \sqrt{5} d_{\mu_P, m}.$$

The multiplicative approximation gives a closeness result between persistence diagrams on a logarithmic scale.

**Corollary 4.9.** Let $P$ be a finite point set of a triangulable metric space $\mathbb{X}$ and $m \in ]0, 1]$ be a mass parameter. Then,

$$d_B^{\log}(\mathrm{Dgm}(d_{\mu_P, m}), \mathrm{Dgm}(d_{\mu_P, m}^P)) \le \ln(\sqrt{5}).$$

*Proof.* Corollary 4.8 implies that

$$\ln(d_{\mu_P, m}) - \ln(\sqrt{2}) \le \ln(d_{\mu_P, m}^P) \le \ln(\sqrt{5}) + \ln(d_{\mu_P, m}).$$

The sublevel sets of $\ln(d_{\mu_P, m})$ and $\ln(d_{\mu_P, m}^P)$ are thus $\ln(\sqrt{5})$-interleaved and Theorem 2.4 applies. □

Moreover, these bounds cannot be improved.

**Proposition 4.10.** The bounds of Corollary 4.8 are tight.
Proof. We are looking for a worst case scenario where inequalities become equalities for at least one point. We consider the space $\mathbb{R}^d$ with the $L_1$-norm, denoted $|\cdot|$. For any fixed dimension $d$, we build the set of $2d$ points whose coordinates have the form $(0, \dots, 0, \pm 1, 0, \dots, 0)$. These points are marked by triangles in the following drawing in dimension 2.

<figure><img src="image_6.png" /></figure>

We fix $k = 2d$ and we study $d_{\mu_P,m}$ and $d_{\mu_P,m}^P$ at points $q(-3, 0, \dots, 0)$ and $o$. First we compute the value of $d_{\mu_P,m}(p_i)$ for any $i$:

$$d_{\mu_P,m}(p_i)^2 = \frac{1}{2d} \sum_{j=1}^{2d} |p_j - p_i|^2 = 4 \frac{2d-1}{2d} = 4 - \frac{2}{d}$$

Now we compute the value of $d_{\mu_P,m}$ at $q$ and $o$:

$$d_{\mu_P,m}(o)^2 = \frac{1}{2d} \sum_{i=1}^{2d} |p_i - o|^2 = 1$$

$$d_{\mu_P,m}(q)^2 = \frac{1}{2d} \sum_{i=1}^{2d} |p_i - q|^2 = \frac{1}{2d} (|p_1 - q|^2 + (2d-1)16) = 16 - \frac{6}{d}$$

All the points $p_i$ have the same value for $d_{\mu_P,m}$. It is easy to compute $d_{\mu_P,m}^P$ at $q$ and $o$

$$d_{\mu_P,m}^P(o)^2 = d_{\mu_P,m}(p_1)^2 + |p_1 - o|^2 = 5 - \frac{2}{d}$$

$$d_{\mu_P,m}^P(q)^2 = d_{\mu_P,m}(p_1)^2 + |p_1 - q|^2 = 8 - \frac{2}{d}$$

When $d$ increases, the ratio $\frac{d_{\mu_P,m}^P(o)}{d_{\mu_P,m}^P(o)}$ tends to $\sqrt{5}$, while $\frac{d_{\mu_P,m}^P(q)}{d_{\mu_P,m}^P(q)}$ tends to $\frac{1}{\sqrt{2}}$. Thus, the bounds of Corollary 4.8 are reached at the limit for a same data set, although at two different points. $\square$

**Remark 1.** If $k$ is not an integer, it suffices to do the same construction with a careful weighting of the point $p_{\lceil k \rceil}$. The results stay exactly the same after replacing $k$ by $\lceil k \rceil$.

## 4.3 Euclidean case

We consider the standard Euclidean space $\mathbb{R}^d$ with the $L_2$-norm. Considering the finite point set $P$ and its empirical measure in $\mathbb{R}$, we are able to express the distance to the empirical measure $d_{\mu_P,m}$ as a power distance. This restricted settings allows us to improve the bounds of Corollary 4.8 as follows.

**Theorem 4.11.** Let $P$ be a finite point set in $\mathbb{R}^d$ and let $m \in [0, 1]$ be a mass parameter. Then the following relation is tight.

$$\frac{1}{\sqrt{2}} d_{\mu_P,m} \le d_{\mu_P,m}^P \le \sqrt{3} d_{\mu_P,m}.$$

Moreover, it implies a relation between persistence diagrams:

$$d_B^{\log}(\text{Dgm}(d_{\mu_P,m}), \text{Dgm}(d_{\mu_P,m}^P)) \le \ln(\sqrt{3}).$$

We first present a way to express the distance to a measure as a power distance to the set of all barycenters of $k$-tuples of $P$. Then we prove Theorem 4.11 before comparing it with the previous approximation, called the witnessed $k$-distance proposed in [15]. We improve the bounds on the witnessed $k$-distance and show that the quality of the approximation is the same for both functions.
### 4.3.1 Power distance expression of $d_{\mu_P, m}$

For a fixed integer $k$, the barycenter associated with a point $x$ is the barycenter of its $k$-nearest neighbors. It is also the center of the cell of the $k^{th}$-order Voronoi diagram that contains $x$.

**Definition 4.12.** For a point set $P$ in $\mathbb{R}^d$ and an integer $k \le |P|$, the barycenter associated with $x$ is

$$ \mathrm{bar}(x) = \frac{1}{k} \sum_{p \in NN_k^P(x)} p. $$

Any subset of $k$ elements from $P$ is uniquely associated with a barycenter. We identify the two objects and define a cell energy that describes how clustered the points are.

**Definition 4.13.** Let $P$ be a point set of $\mathbb{R}^d$ and let $k \le |P|$. Given $S \in \Lambda_k^P$, we fix $q = \frac{1}{k} \sum_{p \in S} p$ and define the cell energy as

$$ E^C(q) = \frac{1}{k} \sum_{p \in S} \|p - q\|^2. $$

Notice that the set $S$ is not necessarily the set $NN_k^P(q)$ and that $E^C(q) \ge d_{\mu_P, m}(q)^2$. We can now write $d_{\mu_P, m}$ in the following form.

**Lemma 4.14.** Let $P$ be a finite point set of $\mathbb{R}^d$ let $m \in [0, 1]$ be a mass parameter. For any $x \in \mathbb{R}^d$,

$$ d_{\mu_P, m}(x) = \sqrt{\min_{y \in \mathbb{R}^d} E^C(\mathrm{bar}(y)) + \|\mathrm{bar}(y) - x\|^2} = \sqrt{E^C(\mathrm{bar}(x)) + \|\mathrm{bar}(x) - x\|^2}. $$

*Proof.* Fix $S \in \Lambda_k^P$ and write $q = \frac{1}{k} \sum_{p \in S} p$. We adapt Lemma 4.7 to the Euclidean setting to get

$$ \frac{1}{k} \sum_{p \in S} \|p - x\|^2 = E^C(q) + \|q - x\|^2. $$

This requires the inner product as follows.

$$ \begin{aligned} A &= \frac{1}{k} \sum_{p \in S} \|p - x\|^2 = \frac{1}{k} \sum_{p \in S} (\|p - q\|^2 + \|q - x\|^2 + 2\langle p - q | q - x \rangle) \\ &= E^C(q) + \|q - x\|^2 + 2\langle q - q | q - x \rangle. \end{aligned} $$

Lemma 4.7 guarantees that

$$ d_{\mu_P, m}(x) = \sqrt{\min_{S \in \Lambda_k^P} \frac{1}{k} \sum_{p \in S} \|p - x\|^2} = \sqrt{\frac{1}{k} \sum_{p \in NN_k^P(x)} \|p - x\|^2}, $$

and thus,

$$ d_{\mu_P, m}(x) = \sqrt{\min_{S \in \Lambda_k^P} E^C(q) + \|q - x\|} = \sqrt{E^C(\mathrm{bar}(x)) + \|x - \mathrm{bar}(x)\|^2}. $$

□

In Euclidean space, it is possible to compute the sublevel sets of $d_{\mu_P, m}$ exactly. The function is a power distance and its sublevel sets are unions of balls. However, the complexity problem pointed out in section 4.2 is still valid. The number of balls required to describe a sublevel set is $\Omega(k^{\lceil \frac{d+1}{2} \rceil} n^{\lfloor \frac{d+1}{2} \rfloor})$ [9].
### 4.3.2 Proof of Theorem 4.11

*Proof.* The first inequality is exactly the same as the one from Theorem 4.5. For the second inequality, let $x$ be a point in $\mathbb{R}^d$, and let $p$ be a point of $P$. Thus,

$$d_{\mu_P, m}^P(x)^2 \leq d_{\mu_P, m}(p)^2 + \|p - x\|^2.$$

Using Lemma 4.14, we get,

$$d_{\mu_P, m}^P(x)^2 \leq E^C(\bar{\text{bar}}(x)) + \|p - \bar{\text{bar}}(x)\|^2 + \|p - x\|^2,$$

and with the inner product, this becomes

$$d_{\mu_P, m}^P(x)^2 \leq E^C(\bar{\text{bar}}(x)) + \|x - \bar{\text{bar}}(x)\|^2 + 2\|p - x\|^2 + 2 \langle x - \bar{\text{bar}}(x) | p - x \rangle \\ = d_{\mu_P, m}(x)^2 + 2\|p - x\|^2 + 2 \langle x - \bar{\text{bar}}(x) | p - x \rangle.$$

Note that

$$2 \langle \bar{\text{bar}}(x) - x | x - p \rangle = \|\bar{\text{bar}}(x) - p\|^2 - \|\bar{\text{bar}}(x) - x\|^2 - \|x - p\|^2.$$

Then we can write the following relation.

$$d_{\mu_P, m}^P(x)^2 \leq d_{\mu_P, m}(x)^2 + \|p - x\|^2 + \|\bar{\text{bar}}(x) - p\|^2 - \|x - \bar{\text{bar}}(x)\|^2.$$

This relation holds for any point of $P$. In particular it holds for any of the $k$ nearest neighbors of $x$. If we take the average over the $k$ nearest neighbors of $x$ and eliminate the negative term $-\|x - \bar{\text{bar}}(x)\|^2$, we obtain

$$d_{\mu_P, m}^P(x)^2 \leq d_{\mu_P, m}(x)^2 + \frac{1}{k} \sum_{p \in NN_k^P(x)} \|p - x\|^2 + \frac{1}{k} \sum_{p \in NN_k^P(x)} \|\bar{\text{bar}}(x) - p\|^2.$$

Using the definitions of the cell energy and of the distance to the measure, we can write:

$$d_{\mu_P, m}^P(x)^2 \leq d_{\mu_P, m}(x)^2 + d_{\mu_P, m}(x)^2 + E^C(\bar{\text{bar}}(x))$$

where $E^C(\bar{\text{bar}}(x)) \leq d_{\mu_P, m}(x)^2$. We conclude that

$$d_{\mu_P, m}^P(x) \leq \sqrt{3} d_{\mu_P, m}(x).$$

The relation between persistence diagrams is exactly as in the proof of Corollary 4.9.

#### Tightness

The tight example is the point set $P$ of two points $a$ and $b$ on the real line with coordinates $1$ and $-1$.

<figure><img src="image_7.png" /></figure>

Fix the mass parameter $m$ equal to $1$ so that $k = 2$. It follows that

$$d_{\mu_P, m}(a) = d_{\mu_P, m}(b) = \sqrt{\frac{1}{2} \|b - a\|^2} = \sqrt{2},$$

and

$$d_{\mu_P, m}(o) = \sqrt{\frac{1}{2} \|o - b\|^2 + \|o - a\|^2} = 1.$$

We now compute the last interesting value:

$$d_{\mu_P, m}^P(o)^2 = d_{\mu_P, m}(a)^2 + \|a - o\|^2 = 3.$$

We can thus conclude that $d_{\mu_P, m}^P(o) = \sqrt{3} d_{\mu_P, m}(o)$. $\square$

<figure><img src="image_8.png" /></figure>
### 4.3.3 Comparison with witnessed k-distance

Another way of approximating $d_{\mu_P,m}$ was proposed in [15]. Taking advantage of the power distance expression of $d_{\mu_P,m}$, it reduced the set of barycenters to consider. Selecting only the barycenter which are associated with the $k$ nearest neighbors of a point of $P$ gives a set of size at most $|P|$.

**Definition 4.15.** Let $P$ be a finite point set of $\mathbb{R}^d$ and let $m \in ]0, 1]$ be a mass parameter. The witnessed $k$-distance is defined as

$$d_{\mu_P,m}^W(x) = \sqrt{\min_{p \in P} E^C(\mathrm{bar}(p)) + \|\mathrm{bar}(p) - x\|^2}.$$

A bound on the quality of the approximation was given in Lemma 3.3 of [15]. We improve this bound and prove it to be at least as good as our approximation. We are not able to prove the tightness of this bound. However, we can give a lower bound on the precision. Using $d_{\mu_P,m}^P$ will not improve the results compared to the witnessed $k$-distance but will not downgrade the quality either. Moreover it can be used in a more general setting as we do not need the existence of the barycenters.

**Theorem 4.16.** Let $P$ be a finite point set of $\mathbb{R}^d$ and let $m \in ]0, 1]$ be a mass parameter. Then,

$$d_{\mu_P,m} \le d_{\mu_P,m}^W \le \sqrt{6} d_{\mu_P,m}.$$

The previous version of this theorem used a 3 instead of the $\sqrt{6}$.

*Proof.* The first inequality is obtained by noticing that $d_{\mu_P,m}^W$ is a minimum over a smaller set than $d_{\mu_P,m}$. We thus get $d_{\mu_P,m} \le d_{\mu_P,m}^W$.

Let $x$ be a point in $\mathbb{R}^d$. Thus for any $p \in P$,

$$ \begin{aligned} d_{\mu,m}^W(x)^2 &\le E^C(\mathrm{bar}(p)) + \|\mathrm{bar}(p) - x\|^2 \\ &\le E^C(\mathrm{bar}(p)) + \|\mathrm{bar}(p) - p\|^2 + \|p - x\|^2 + 2\langle\mathrm{bar}(p) - p|p - x\rangle \\ &\le d_{\mu,m}(p)^2 + 2\|p - x\|^2 + \|\mathrm{bar}(p) - p\|^2 \\ &\le 2(d_{\mu,m}(p)^2 + \|p - x\|^2). \end{aligned} $$

Thus, $d_{\mu,m}^W(x) \le \sqrt{2}d_{\mu,m}^P(x)$ and using Theorem 4.11 we can conclude that:

$$d_{\mu,m}^W(x) \le \sqrt{2} d_{\mu,m}^P(x) \le \sqrt{6} d_{\mu,m}(x).$$

□

**Tightness** The tightness of the lower bound is obvious as it suffices to take $k = 1$ to get an equality between $d_{\mu_P,m}$ and $d_{\mu_P,m}^W$.

However, we do not know if the upper bound is tight. The bound $\sqrt{6}$ can not be improved more than to $1 + \sqrt{2}$, whose value is greater than $\sqrt{5.82}$.

Let us introduce the following example in $\mathbb{R}^d$. We fix $k = 2d$ and $0 < \epsilon < \sqrt{2}$. The point cloud $P$ consists of $4d^2$ points located at the coordinates $(0, \dots, 0, \alpha, 0, \dots, 0)$ with multiplicity 1 when $\alpha = 1$ or $\alpha = -1$ and multiplicity $2d - 1$ when $\alpha = 1 + \sqrt{2} - \epsilon$ or $\alpha = \epsilon - 1 - \sqrt{2}$.

The following figure is its representation in dimension 2 where the triangles have multiplicity 1 and the circles have multiplicity 3.
<figure><img src="image_9.png" /></figure>

The points are placed such that the k nearest neighbors of any triangle are itself and the k − 1 points located at the nearest circle. These k nearest neighbors are also the ones from the circles.

Let us now take a look to the value of the functions at the origin o. Each of the k nearest neighbors of o are distance exactly 1 from o. This allows us to conclude that:

$d_{\mu_P,m}(o) = 1.$

The construction induced that the structure is perfectly symmetric and the set of barycenters W we consider in the witnessed k-distance contains exactly 2d points. These points are located at the coordinates (0 , · · · , 0 , α, 0 , · · · , 0) where α = 1 + 2 d − 1 2 d ( √$_{2}$ − ϵ ) or the opposite.

Let b be a member of W . Thus we can compute its cell energy:

$$
\begin{align*}
E^C(b) &= \frac{1}{2d} \left[ \left( \frac{2d-1}{2d} (\sqrt{2}-\epsilon) \right)^2 + (2d-1) \left( \frac{1}{2d} (\sqrt{2}-\epsilon) \right)^2 \right] \\
&= \frac{2d-1}{(2d)^3} \left[ (2d-1)(\sqrt{2}-\epsilon)^2 + (\sqrt{2}-\epsilon)^2 \right] \\
&= \frac{2d-1}{(2d)^2} (\sqrt{2}-\epsilon)^2.
\end{align*}
$$

All of the points of W are located at the same distance to o. Thus, the witnessed k-distance at the point o is

$$
\begin{align*}
d_{\mu_P, m}^W(o)^2 &= E^C(b) + \left(1 + \frac{2d-1}{2d}(\sqrt{2}-\epsilon)\right)^2 \\
&= \frac{2d-1}{(2d)^2}(\sqrt{2}-\epsilon)^2 + 1 + \frac{2d-1}{d}(\sqrt{2}-\epsilon) + \frac{(2d-1)^2}{(2d)^2}(\sqrt{2}-\epsilon)^2 \\
&= \frac{1}{2d} + \frac{2d-1}{2d}\left(1 + 2(\sqrt{2}-\epsilon) + (\sqrt{2}-\epsilon)^2\right) \\
&= \frac{1}{2d} + \frac{2d-1}{2d}(1 + \sqrt{2}-\epsilon)^2.
\end{align*}
$$

Since we can take ϵ as small as we want and make the dimension grow, this relation assures us that we cannot find a better constant than 1 + √$_{2 in Theorem 4.16.}$

5 The Weighted Rips Filtration

Given a weighted set ( P , w ) and the associated power distance f (as in (2)), one can introduce a gen-
eralization of the Rips filtration that is adapted to the weighted setting as has been done in [15]. This
construction allows us to approximate the persistence diagram of d$_{µ,m}$ in some cases. Moreover, we
show that it is stable with respect to perturbation of the underlying sample (Theorem 5.6) and that it
gives a guaranteed approximation to the persistence diagram of the distance to an empirical measure (Theorem 5.7). Furthermore, it has an interest of its own as it is stable for close weighted sets and can therefore be used as a shape signature.

Let us consider the sublevel set $f^{-1}([ - \infty, \alpha])$. It is the union of the balls centered on the points $p$ of $P$ with radius $r_p(\alpha) = \sqrt{\alpha^2 - w_p^2}$. By convention, we consider that the ball is empty when the radius is imaginary. We can define the nerve of this union:

**Definition 5.1.** Let $(P, w)$ be a weighted set in a metric space $\mathcal{X}$, then the weighted Čech complex $C_\alpha(P, w)$ for parameter $\alpha$ is defined as the union of simplices $\sigma$ such that $\bigcap_{p \in \sigma} B(p, r_p(\alpha)) \neq 0$.

However, the Čech complex can be difficult to compute due to the problem of testing if a collection of metric balls has a common intersection. Instead, we define a weighted version of the Rips complex, which only requires distance computations.

**Definition 5.2.** For a weighted set $(P, w)$ in a metric space $\mathcal{X}$, the weighted Rips complex $R_\alpha(P, w)$ for a parameter $\alpha$ is the maximal simplicial complex whose 1-skeleton has an edge for each pair $(p, q)$ such that $d_{\mathcal{X}}(p, q) < r_p(\alpha) + r_q(\alpha)$. The weighted Rips filtration is the sequence $\{R_\alpha(P, w)\}$ for all $\alpha \ge 0$.

Remark that if all weights are equal to 0, we are in the classical case of balls with equal radii. We use the weighted Rips filtration to approximate the weighted Čech filtration thanks to the following interleaving. For simplicity, the notation $(P, w)$ indicating the point set $P$ with weights $w$ is omitted in the notation.

**Proposition 5.3.** If $(P, w)$ is a weighted set on a metric space $\mathcal{X}$, then for all $\alpha \in \mathbb{R}$:

$$C_{\alpha} \subseteq R_{\alpha} \subseteq C_{2\alpha}.$$

*Proof.* Let $\alpha$ be a real number. The first inclusion is obtained by the definition of the weighted Rips complex that gives $C_\alpha \subseteq R_\alpha$.

For the other inclusion, let $\sigma$ be a simplex of $R_\alpha$. We fix $p_0$ to be the point of $\sigma$ with the greatest weight. This implies especially that for any $p \in P$, $r_p(\alpha) \ge r_{p_0}(\alpha)$.

Since $\sigma \in R_\alpha$, we get that, for all $p$ and $q$ in $P$, we have $d_{\mathcal{X}}(p, q) \le r_p(\alpha) + r_q(\alpha)$ with both radius real. To prove that $\sigma \in C_{2\alpha}$ we need to prove that:

$$\bigcap_{p \in \sigma} B(p, r_p(2\alpha)) \neq 0.$$

It will suffice to prove that $p_0$ belongs to this intersection. For each $p \in \sigma$:

$$d_{\mathcal{X}}(p, p_0) \le r_p(\alpha) + r_{p_0}(\alpha) \le 2 r_p(\alpha) = \sqrt{(2\alpha)^2 - 4w_p^2} \le r_p(2\alpha).$$

□

## Stability

The persistence diagram of a weighted Rips filtration $\{R_\alpha(P, w)\}$ is stable under small perturbations of the set $P$. It can thus be used in applications like signatures in the spirit of [3].

Speaking of the persistence diagram of a weighted Rips filtration requires that the filtration is q-tame. This is always the case when the set $P$ is compact as shown in the following proposition.

**Proposition 5.4.** Let $P$ be a subset of a metric space $\mathcal{X}$ and let $w : \mathcal{X} \to \mathbb{R}$ be a function. If $P$ is compact, then $\{R_\alpha(P, w)\}_{\alpha \in \mathbb{R}}$ is q-tame.

This will be deduced from the following technical lemma.

**Lemma 5.5.** Let $P, Q$ be two subsets of a metric space $\mathcal{X}$ and let $w : \mathcal{X} \to \mathbb{R}$ be a $t$-Lipschitz function. Then $H_*(\{R_\alpha(P, w)\})$ and $H_*(\{R_\alpha(Q, w)\})$ are $\epsilon$-interleaved for $\epsilon = (1 + t)d_H(P, Q)$.
Proof. We need to show that there exists $\epsilon$-homomorphisms $\pi_{P_*}$ and $\pi_{Q_*}$ such that $\pi_{P_*}\pi_{Q_*} = 1_{H_*}^{2\epsilon}(R_\alpha(P,w))$ and $\pi_{Q_*}\pi_{P_*} = 1_{H_*}^{2\epsilon}(R_\alpha(Q,w))$.

To do so, we need three steps. First, we build simplicial maps $R_\alpha(P, w) \to R_{\alpha+\epsilon}(Q, w)$ and $R_\alpha(Q, w) \to R_{\alpha+\epsilon}(P, w)$ for every $\alpha$. Then, we show that these simplicial maps induce $\epsilon$-homomorphisms. Finally, we show that the simplicial maps are contiguous and thus the two persistence modules are $\epsilon$-interleaved.

The simplicial maps $i_\alpha^\beta : R_\alpha(P, w) \to R_\beta(P, w)$ and $j_\alpha^\beta : R_\alpha(Q, w) \to R_\alpha(Q, w)$ for $\alpha < \beta$ are induced by the canonical inclusion. We consider two maps $\pi_P : Q \to P$ and $\pi_Q : P \to Q$ such that $d_X(p, \pi_Q(p)) \le d_H(P, Q)$ and $d_X(q, \pi_P(q)) \le d_H(P, Q)$ for any $p \in P$ and $q \in Q$. By definition of the Hausdorff distances, such maps always exist. Let us show that these maps induce simplicial maps.

Let us consider the function $\pi_P$ and let us fix $\alpha > 0$. Let $(q', q'')$ be an edge of $R_\alpha(Q, w)$. It means that $B(q', r_{q'}(\alpha)) \cap B(q'', r_{q''}(\alpha)) \ne \emptyset$. Lemma 4.2 implies that $B(q, r_q(\alpha)) \subset B(\pi_P(q), r_{\pi_P(q)}(\alpha + (1+t)d_H(P, Q)))$ for any $q \in Q$. Thus, $(\pi_P(q'), \pi(q''))$ is an edge of $R_{\alpha+\epsilon}(P, w)$ because:

$$B(\pi_P(q'), r_{q'}(\alpha + \epsilon)) \cap B(\pi_P(q''), r_{q''}(\alpha + \epsilon)) \supset B(q', r_{q'}(\alpha)) \cap B(q'', r_{q''}(\alpha)) \ne \emptyset.$$

As $R_\alpha(P, w)$ is a clique complex for any $\alpha$, this is sufficient to prove that $\pi_P$ induces a family of simplicial maps $\{\pi_P^{\alpha+\epsilon}\}$. The roles of $P$ and $Q$ are symmetric. Therefore, the result holds for $\pi_Q$ as well.

Furthermore $\pi_P$ induces an $\epsilon$-homomorphism $\pi_{P_*}$ at the homology level. For any $\alpha < \beta$, $i_{\alpha+\epsilon}^{\beta+\epsilon} \circ \pi_P^{\alpha+\epsilon} = \pi_P^{\beta+\epsilon} \circ j_\alpha^\beta$ because the maps $i_{\alpha+\epsilon}^{\beta+\epsilon}$ and $j_\alpha^\epsilon$ are induced by the the canonical inclusion while the two others simplicial maps are induced by the same map $\pi_P : Q \to P$. Hence the two compositions are the same map and thus guarantees that $\pi_{P_*}$ is an $\epsilon$-homomorphism. Again, this results can be applied to $\pi_Q$ to get an $\epsilon$-homomorphism $\pi_{Q_*}$.

To prove that $\pi_{P_*}\pi_{Q_*} = 1_{H_*}^{2\epsilon}(R_\alpha(P,w))$, we prove that $\pi_P^{\alpha+\epsilon} \circ \pi_Q^{\alpha-\epsilon}$ and $i_{\alpha-\epsilon}^{\alpha+\epsilon}$ are contiguous for any $\alpha$.

Let us fix $\alpha$ and let $(p, p')$ be an edge of $R_{\alpha-\epsilon}(P, w)$. By definition, $B(p, r_p(\alpha-\epsilon)) \cap B(p', r_{p'}(\alpha-\epsilon)) \ne \emptyset$. Moreover, using Lemma 4.2 we get:

$$B(p, r_p(\alpha - \epsilon)) \subset B(\pi_Q(p), r_{\pi_Q(p)}(\alpha)) \subset B(\pi_P \circ \pi_Q(p), r_{\pi_P \circ \pi_Q(p)}(\alpha + \epsilon)).$$

The same holds for $p'$ and thus:

$$B(p, r_p(\alpha + \epsilon)) \cap B(\pi_P \circ \pi_Q(p), r_{\pi_P \circ \pi_Q(p)}(\alpha + \epsilon)) \cap B(p', r_{p'}(\alpha + \epsilon)) \cap B(\pi_P \circ \pi_Q(p'), r_{\pi_P \circ \pi_Q(p')}(\alpha + \epsilon)) \neq \emptyset.$$

Thus the tetrahedron $\{i_{\alpha-\epsilon}^{\alpha+\epsilon}(p), i_{\alpha-\epsilon}^{\alpha+\epsilon}(p'), \pi_P^{\alpha+\epsilon} \circ \pi_Q^{\alpha-\epsilon}(p), \pi_P^{\alpha+\epsilon} \circ \pi_Q^{\alpha-\epsilon}(p')\}$ is in $C_{\alpha+\epsilon}(P, w) \subset R_{\alpha+\epsilon}(P, w)$. Lemma 2.7 guarantees that $\pi_P^{\alpha+\epsilon} \circ \pi_Q^{\alpha-\epsilon}$ and $i_{\alpha-\epsilon}^{\alpha+\epsilon}$ are contiguous.

From before, $\{\pi_P^{\alpha+\epsilon} \circ \pi_Q^{\alpha-\epsilon}\}$ induces the $2\epsilon$-homomorphism $\pi_{P_*}\pi_{Q_*}$. By definition, $\{i_{\alpha-\epsilon}^{\alpha+\epsilon}\}$ induces $1_{H_*}^{2\epsilon}(R_\alpha(P,w))$. By contiguity of the simplicial maps, we have equality of the $2\epsilon$-homomorphisms and therefore $\pi_{P_*}\pi_{Q_*} = 1_{H_*}^{2\epsilon}(R_\alpha(P,w))$.

By symmetry of the roles of $P$ and $Q$, $\{R_\alpha(P, w)\}$ and $\{R_\alpha(Q, w)\}$ are $\epsilon$-interleaved. $\square$

Proof of Proposition 5.4. We will show that, for any $\epsilon > 0$, one can build a finite persistence module which is $\epsilon$-interleaved with the persistence module of $\{R_\alpha(P, w)\}$. A finite persistence module is a fortiori locally finite and Theorem 4.19 of [6] induces the q-tameness of $\{R_\alpha(P, w)\}$.

Let us fix $\epsilon > 0$. $P$ is compact. As a consequence, there exists a finite point set $Q$ of $P$ such that $d_H(P, Q) \le \frac{\epsilon}{1+t}$. The persistence module of $\{R_\alpha(Q, w)\}$ is finite and therefore locally finite. Moreover, using Lemma 5.5, $\{R_\alpha(Q, w)\}$ and $\{R_\alpha(P, w)\}$ are $\epsilon$-interleaved. Hence Theorem 4.19 of [6] induces the q-tameness of $\{R_\alpha(P, w)\}$. $\square$

Notice that the simplicial maps $\pi_P$ and $\pi_Q$ are not necessarily uniquely defined. However, if $\pi_P$ and $\pi'_P$ are two maps verifying the construction property, then the induced simplicial maps are contiguous and therefore the induced homomorphisms are identical.

The persistence diagrams of weighted Rips filtrations are related by the following:
**Theorem 5.6.** Let P and Q be two compact subsets of a metric space X. Let w : X → R be a t-Lipschitz function. Then,

$$d_B(\text{Dgm}(\{R_\alpha(P, w)\}), \text{Dgm}(\{R_\alpha(Q, w)\})) \le (1+t)d_H(P, Q).$$

*Proof.* P and Q are two compact sets and thus the diagrams are well-defined thanks to Proposition 5.4 that guarantees the q-tameness of the filtrations. Lemma 5.5 implies that $H_*\{R_\alpha(P, w)\})$ and $H_*\{R_\alpha(Q, w)\})$ are $(1+t)d_H(P, Q)$-interleaved. The relation between the persistence diagrams is then obtained by applying Theorem 2.6. □

**Remark 2.** When P and Q are two compact metric spaces, Theorem 5.6 can be extended using the notion of correspondence as in [7]. Notice that the correspondence has to induce bounded distortion on the weights as well as on the distances.

## Approximation

To use the weighted Rips filtration to approximate the persistence diagram of the distance to a measure, we need to restrict the class of spaces considered. If the intersection of any finite number of balls in X is either contractible or empty, X is said to have the good cover property. Then the Čech complex has the same homology as the union of balls, of which it is the nerve, by the Nerve Theorem [16]. We can also compute the persistence diagram thanks to the Persistent Nerve Lemma [8]. We obtain an approximation of Dgm($d_{\mu_P,m}$) using the weighted Rips filtration.

**Theorem 5.7.** Let X be a triangulable metric space with the good cover property and let P be a finite point set of X, then on a logarithmic scale:

$$d_B^{\log}(\text{Dgm}(d_{\mu_P,m}), \text{Dgm}(\{R_\alpha(P, d_{\mu_P,m})\})) \le \ln(2\sqrt{5}).$$

*Proof.* Given that X is triangulable, we know that the sublevel sets filtration of $d_{\mu_P,m}$ is q-tame by Proposition 3.5. The persistence diagram Dgm($d_{\mu_P,m}$) is thus well-defined. Recall that $d_{\mu_P,m}$ is a 1-Lipschitz function (see Proposition 3.4). P is a compact subset of X and therefore Dgm($R_\alpha(P, d_{\mu_P,m})$) is well-defined according to Proposition 5.4.

We approximate $d_{\mu_P,m}$ with $d_{\mu_P,m}^P$. The result of Theorem 4.5 gives us a $\sqrt{5}$ multiplicative interleaving. For any $\alpha \in \mathbb{R}$,

$$d_{\mu_P,m}(|-\infty, \alpha|) \subset d_{\mu_P,m}^P(|-\infty, \sqrt{2\alpha}|) \subset d_{\mu_P,m}(|-\infty, \sqrt{10} d_{\mu_P,m}^P|).$$

So, Theorem 2.4 implies

$$d_B^{\log}(\text{Dgm}(d_{\mu_P,m}), \text{Dgm}(d_{\mu_P,m}^P)) \le \ln(\sqrt{5}).$$

By the Persistent Nerve Lemma, the sublevel sets filtration of $d_{\mu_P,m}^P$ (a union of balls of increasing radii) has the same persistent homology as nerve filtration. Thus, we can use weighted Rips filtration to approximate the persistence diagram:

$$d_B^{\log}(\text{Dgm}(d_{\mu_P,m}^P), \text{Dgm}(\{R_\alpha(P, d_{\mu_P,m})\})) \le \ln(2).$$

The triangle inequality for the bottleneck distance gives the desired inequality. □

# 6 The Sparse Weighted Rips filtration

The weighted Rips filtration presented in the previous section has the desired approximation guarantees, but like the Rips filtration for unweighted points, it usually grows too large to be computed in full. In [21], it was shown how to construct a filtration $\{S_\alpha\}$ called the sparse Rips filtration that gives a provably good approximation to the Rips filtration and has size linear in the number of points for metrics with constant doubling dimension (see Section 6.1 for the construction). Specifically, for a user-defined parameter $\varepsilon$, the log-bottleneck distance between the persistence diagrams of the Sparse Rips filtration and the Rips filtration is at most $\varepsilon$. The goal of this section is to extend that result to weighted Rips filtrations.

The sparse Rips filtration cannot be used directly here, since the power distance does not induce a metric. Indeed, even the case of setting all weights to some large constant yields a persistence diagram that is far from the persistence diagram of the Rips filtration of any metric space. This follows because
individual points in a Rips filtration appear at time zero, but this is not the case in the weighted Rips filtration.

Even if one were to construct a metric whose Rips filtration exactly matched that of the weighted Rips filtration, there are simple examples where that metric would necessarily have very high doubling dimension, making previous methods unsuitable. For example, consider a set of points in the unit interval $[0, 1]$, with a constant weight function that assigns a weight of 1 to every point. Although the points lie in a 1-dimensional space, the weighted distance function has doubling dimension $\log n$ because all of the points are within a weighted distance of 2, whereas every pair has weighted distance at least 1. So the doubling constant would be $n$ and the doubling dimension would be $\log n$ despite that the input was 1-dimensional. Thus, any construction that depends on low doubling dimension will blowup when confronted with such weighted examples.

For the rest of this section, we fix a weighted point set $P$ in a metric space $\mathcal{X}$, where the weight function $w: \mathcal{X} \to \mathbb{R}$ is t-Lipschitz, for some constant $t$. To simplify notation, we let $R_\alpha$ denote the weighted Rips complex $R_\alpha(P, w)$.

The sparse weighted Rips filtration, $\{T_\alpha\}$, is defined as

$$T_{\alpha} = S_{\alpha} \cap R_{\alpha}.$$

The (unweighted) sparse Rips filtration $\{S_\alpha\}$ captures the underlying metric space and the weighted Rips filtration $\{R_\alpha\}$ captures the structure of the sublevel sets of the power distance function. Computing $\{T_\alpha\}$ can be done efficiently by first computing $\{S_\alpha\}$ and then reordering the simplices according to the birth time in $\{R_\alpha\}$. This is equivalent to filtering the complex $S_\infty$. Note that the sparsification depends only on the metric, and not on the weights. Thus, the same sparse Rips complex can be used as the underlying complex for different weight functions. We also simplify the construction of $\{S_\alpha\}$ by using a furthest point sampling instead of the more complex structure of net tree.

The technical challenge is to relate the persistence diagram of this new filtration to the persistence diagram of the weighted Rips filtration as in the following theorem.

**Theorem 6.1.** Let $(P, w)$, be a finite, weighted subset of a metric space $\mathcal{X}$ with t-Lipschitz weights. Let $\varepsilon < 1$ be a fixed constant used in the construction of the sparse weighted Rips filtration $\{T_\alpha\}$. Then,

$$d_B^{\log}(\mathrm{Dgm}(\{T_\alpha\}), \mathrm{Dgm}(\{R_\alpha\})) \le \ln \left( \frac{1 + \sqrt{1 + t^2 \varepsilon}}{1 - \varepsilon} \right).$$

Since these filtrations are not interleaved, the only hope is to find an interleaving of the persistence modules, which requires finding suitable homomorphisms between the homology groups of the different filtrations. After detailing the construction of the sparse Rips filtration with the furthest point sampling, the rest of this section proves Theorem 6.1.

## 6.1 Sparse Rips complexes

Let $(p_1, \dots, p_n)$ be a greedy permutation of the points $P$ in a finite metric space $\mathcal{X}$. That is, $p_i = \underset{P_i \in P}{\operatorname{argmax}} d_{\mathcal{X}}(p, P_{i-1})$, where $P_{i-1} = \{p_1, \dots, p_{i-1}\}$ is the $(i-1)$st prefix. We define the *insertion radius* $\lambda_{p_i}$ of point $p_i$ to be

$$\lambda_{p_i} = d_{\mathcal{X}}(p_i, P_{i-1}).$$

To avoid excessive superscripts, we write $\lambda_i$ in place of $\lambda_{p_i}$ when we know the index of $p_i$. We adopt the convention that $\lambda_1 = \infty$ and $\lambda_{n+1} = 0$. The greedy permutation has the nice property that each prefix $P_i$ is a $\lambda_i$-net in the sense that

$$1. d_{\mathcal{X}}(p, P_i) \le \lambda_i \text{ for all } p \in P.$$

$$2. d_{\mathcal{X}}(p, q) \ge \lambda_i \text{ for all } p, q \in P_i.$$

We extend these nets to an arbitrary parameter $\gamma$ as

$$N_{\gamma} = \{p \in P \mid \lambda_{p} > \gamma\}.$$

$$\bar{N}_{\gamma} = \{p \in P \mid \lambda_{p} \ge \gamma\}.$$
Note that for all $p \in P$, $d_X(p, N_\gamma) \le \gamma$ and $d_X(p, \overline{N}_\gamma) < \gamma$.

One way to get a sparse Rips-like filtration is to take a union of Rips complexes on the nets $N_\gamma$. However, this can add significant noise to the persistence diagram compared to the Rips filtrations. This noise can be diminished by a careful perturbation of the distance. For a point $p$, the perturbation varies with the scale and is defined as follows:

$$s_p(\alpha) = \begin{cases} 0 & \text{if } \alpha \le \frac{\lambda_p}{\varepsilon} \\ \alpha - \frac{\lambda_p}{\varepsilon} & \text{if } \frac{\lambda_p}{\varepsilon} < \alpha < \frac{\lambda_p}{\varepsilon(1-\varepsilon)} \\ \varepsilon\alpha & \text{if } \frac{\lambda_p}{\varepsilon(1-\varepsilon)} \le \alpha \end{cases}$$

<figure><img src="image_10.png" /></figure>

Note that $s_p$ is 1-Lipschitz. The resulting perturbed distance is defined as

$$f_{\alpha}(p, q) = d_{X}(p, q) + s_{p}(\alpha) + s_{q}(\alpha).$$

**Definition 6.2.** Given the nets $N_\gamma$ and the distance function $f_\alpha$, we define the sparse Rips complex at scale $\alpha$ as

$$Q_{\alpha} = \{\sigma \subset \overline{N}_{\varepsilon(1-\varepsilon)\alpha} \mid \forall p, q \in \sigma, f_{\alpha}(p, q) \le 2\alpha\}.$$

On its own, the sequence of complexes $\{Q_\alpha\}$ does not form a filtration. However, we can build a natural filtration by defining

**Definition 6.3.** The sparse Rips filtration is defined as:

$$S_{\beta} = \bigcup_{\alpha \le \beta} Q_{\alpha}.$$

## 6.2 Projection onto Nets

To relate sparse Rips complexes with Rips complexes, we build a collection of projections of the points onto the nets.

$$\pi_{\alpha}(p) = \begin{cases} p & \text{if } p \in N_{\varepsilon(1-\varepsilon)\alpha} \\ \underset{q \in N_{\varepsilon\alpha}}{\operatorname{argmin}} & \text{otherwise} \end{cases}$$

For any scale $\alpha$, the projection $\pi_\alpha$ maps the points of $P$ to the net $N_{\varepsilon(1-\varepsilon)\alpha}$. Note that $\pi_\alpha$ is a retraction onto $N_{\varepsilon(1-\varepsilon)\alpha}$.

The following are the four main lemmas we will use with respect to the perturbed distance functions and projections. The projections will be used extensively to induce maps between simplicial complexes. First, we prove that edges do not disappear as the filtration grows.

**Lemma 6.4.** If $f_\alpha(p, q) \le 2\alpha \le 2\beta$ then $f_\beta(p, q) \le 2\beta$.

*Proof.* The proof follows from the definitions $f_\alpha$ and $f_\beta$, the Lipschitz property of the perturbations $s_p$ and $s_q$, and the hypothesis as follows.

$$\begin{align*} f_{\beta}(p, q) &= d_{X}(p, q) + s_{p}(\beta) + s_{q}(\beta) \\ &\le d_{X}(p, q) + s_{p}(\alpha) + (\beta - \alpha) + s_{q}(\alpha) + (\beta - \alpha) \\ &= f_{\alpha}(p, q) + 2(\beta - \alpha) \\ &\le 2\alpha + 2(\beta - \alpha) \\ &= 2\beta. \end{align*} \square$$
Next, we show that the distance between a point and its projection is at most the change in the perturbed distance.

**Lemma 6.5.** For all $q \in P$, $d_X(q, \pi_\alpha(q)) \le s_q(\alpha) - s_{\pi_\alpha(q)}(\alpha)$, and in particular, $d_X(q, \pi_\alpha(q)) \le \varepsilon\alpha$.

*Proof.* Both statements are trivial if $q \in N_{\varepsilon(1-\varepsilon)\alpha}$, because that would imply that $\pi_\alpha(q) = q$. So, we may assume that $\pi_\alpha(q)$ is the nearest point to $q$ in $N_{\varepsilon\alpha}$. It follows that

$$d_X(q, \pi_\alpha(q)) \le \varepsilon\alpha.$$

Moreover, $\lambda_q \le \varepsilon(1 - \varepsilon)\alpha$, and thus $s_q(\alpha) = \varepsilon\alpha$. Also, since $\pi_\alpha(q) \in N_{\varepsilon\alpha}$, it must be that $\lambda_{\pi_\alpha(q)} > \varepsilon\alpha$ and so $s_{\pi_\alpha(q)} = 0$. Combining these statements, we get

$$d_X(q, \pi_\alpha) \le \varepsilon\alpha = s_q(\alpha) - s_{\pi_\alpha(q)}(\alpha).$$

□

Now, we prove that replacing a point with its projection does not increase the perturbed distance.

**Lemma 6.6.** For all $p, q \in P$ and all $\alpha \ge 0$, $f_\alpha(p, \pi_\alpha(q)) \le f_\alpha(p, q)$.

*Proof.* The statement follows from the definition of $f_\alpha$, the triangle inequality, and Lemma 6.5 as follows.

$$ \begin{aligned} f_\alpha(p, \pi_\alpha(q)) &= d_X(p, \pi_\alpha(q)) + s_p(\alpha) + s_{\pi_\alpha(q)}(\alpha) \\ &\le d_X(p, q) + d_X(q, \pi_\alpha(q)) + s_p(\alpha) + s_{\pi_\alpha(q)}(\alpha) \\ &\le d_X(p, q) + s_p(\alpha) + s_q(\alpha) \\ &= f_\alpha(p, q). \end{aligned} $$

□

## 6.3 Sometimes the projections induce contiguous simplicial maps

In this section, we look at the maps between simplicial complexes that are induced by the projection functions $\pi_\alpha$. We are most interested in the case when a pair of projections $\pi_\alpha$ and $\pi_\beta$ induce contiguous simplicial maps between sparse Rips complexes (Lemma 6.9) or weighted Rips complexes (Lemma 6.10). First, we need a couple lemmas that describe the effect of different projections on the endpoints of an edge in sparse or weighted Rips complexes.

**Lemma 6.7.** Let $\alpha, \beta, \gamma$, and $i$ be such that $\frac{\lambda_{i+1}}{\varepsilon(1-\varepsilon)} \le \alpha \le \beta \le \gamma \le \frac{\lambda_i}{\varepsilon(1-\varepsilon)}$. If an edge $(p, q)$ is in $Q_\rho$ for some $\rho \le \gamma$ then the edge $(\pi_\alpha(p), \pi_\beta(q)) \in Q_\gamma$.

*Proof.* First, it is easy to check that the conditions on $\alpha, \beta, \gamma$, and $i$ imply that $\pi_\alpha(p)$ and $\pi_\beta(q)$ are in $\overline{N}_{\varepsilon(1-\varepsilon)\gamma}$, which is the vertex set of $Q_\gamma$. So, it will suffice to prove that $f_\gamma(\pi_\alpha(p), \pi_\beta(q)) \le 2\gamma$. Next we consider three cases depending on the value of $\rho$ in relation to $\alpha$ and $\beta$.

**Case 1:** If $\alpha, \beta \le \rho$ then $\pi_\alpha(p) = p$ and $\pi_\beta(q) = q$. So, using Lemma 6.4 and the assumption $\rho \le \gamma$, we see that $f_\gamma(\pi_\alpha(p), \pi_\beta(q)) = f_\gamma(p, q) \le 2\gamma$.

**Case 2:** If $\alpha \le \rho < \beta$ then $\pi_\alpha(p) = p$ and Lemma 6.4 implies that $f_\beta(p, q) \le 2\beta$.

$$ \begin{aligned} f_\gamma(\pi_\alpha(p), \pi_\beta(q)) &= f_\gamma(p, \pi_\beta(q)) \\ &\le f_\beta(p, \pi_\beta(q)) + 2(\gamma - \beta) \\ &\le f_\beta(p, q) + 2(\gamma - \beta) \\ &\le 2\gamma. \end{aligned} $$

**Case 3:** If $\rho < \alpha, \beta$ then Lemma 6.4 implies that $f_\alpha(p, q) \le 2\alpha$.

$$ \begin{aligned} f_\gamma(\pi_\alpha(p), \pi_\beta(q)) &\le f_\beta(\pi_\alpha(p), \pi_\beta(q)) + 2(\gamma - \beta) \\ &\le f_\beta(\pi_\alpha(p), q) + 2(\gamma - \beta) \\ &\le f_\alpha(\pi_\alpha(p), q) + 2(\gamma - \beta) + 2(\beta - \alpha) \\ &\le f_\alpha(p, q) + 2(\gamma - \beta) + 2(\beta - \alpha) \\ &\le 2\gamma. \end{aligned} $$

□
**Lemma 6.8.** Let $(p, q)$ be an edge of $R_\delta$ with $\alpha, \beta \le \frac{\delta}{1+\varepsilon}$, then $(\pi_\alpha(p), \pi_\beta(q)) \in R_{\kappa\delta}$, where $\kappa = \frac{1+\sqrt{1+t^2}\varepsilon}{1-\varepsilon}$.

*Proof.* First, note that the projection functions satisfy the following inequalities.

$$d_X(p, \pi_\alpha(p)) \le \varepsilon\alpha \le \frac{\varepsilon\delta}{1-\varepsilon}$$

$$d_X(q, \pi_\beta(q)) \le \varepsilon\beta \le \frac{\varepsilon\delta}{1-\varepsilon}$$

So, by applying the triangle inequality, the definition of an edge in $R_\delta$, and Lemma 4.2, we get the following.

$$\begin{aligned} d_X(\pi_\alpha(p), \pi_\beta(q)) &\le d_X(p, q) + \frac{2\varepsilon\delta}{1-\varepsilon} \\ &\le \left(r_p(\delta) + \frac{\varepsilon\delta}{1-\varepsilon}\right) + \left(r_q(\delta) + \frac{\varepsilon\delta}{1-\varepsilon}\right) \\ &\le \left(r_p\left(\frac{\delta}{1-\varepsilon}\right) + \frac{\varepsilon\delta}{1-\varepsilon}\right) + \left(r_q\left(\frac{\delta}{1-\varepsilon}\right) + \frac{\varepsilon\delta}{1-\varepsilon}\right) \\ &\le r_{\pi_\alpha(p)}(\kappa\delta) + r_{\pi_\beta(q)}(\kappa\delta). \end{aligned}$$

This is precisely the condition necessary to guarantee that $(\pi_\alpha(p), \pi_\alpha(q)) \in R_{\kappa\delta}$ as desired. $\square$

The following two lemmas follow easily from repeated application of the preceding lemmas.

**Lemma 6.9.** Two projections $\pi_\alpha$ and $\pi_\beta$ induce contiguous simplicial maps from $Q_\rho \to Q_\beta$ whenever $\rho \le \beta$ and there exists $i$ so that $\frac{\lambda_{i+1}}{\varepsilon(1-\varepsilon)} \le \alpha \le \beta \le \frac{\lambda_i}{\varepsilon(1-\varepsilon)}$.

*Proof.* Let us fix $\rho \le \beta$ and take $(p, q)$ an edge from $Q_\rho$. Given that $Q_\rho$ and $Q_\beta$ are cliques complexes, we can get the result from Lemma 2.7 if we show that the tetrahedron $\{\pi_\alpha(p), \pi_\alpha(q), \pi_\beta(p), \pi_\beta(q)\}$ is in $Q_\beta$. We only need to prove that all edges of the tetrahedron belongs to $Q_\beta$.

We apply Lemma 6.7, while replacing $\gamma$ by $\beta$ and $\beta$ by $\alpha$. Thus we obtain $(\pi_\alpha(p), \pi_\alpha(q)) \in Q_\beta$. Let us repeat this operation with $\alpha = \beta = \gamma$ thus we get $(\pi_\beta(p), \pi_\beta(q)) \in Q_\beta$. The last two edges are given by replacing $\gamma$ by $\beta$ and choosing correctly the role of $p$ and $q$. $\square$

**Lemma 6.10.** Two projections $\pi_\alpha$ and $\pi_\beta$ induce contiguous simplicial maps from $R_\delta \to R_{\kappa\delta}$, where $\kappa = \frac{1+\sqrt{1+t^2}\varepsilon}{1-\varepsilon}$ whenever $\alpha, \beta \le \frac{\delta}{1-\varepsilon}$.

*Proof.* The previous proof can be applied to get the result, while replacing Lemma 6.7 by Lemma 6.8. $\square$

## 6.4 Sparse filtrations and power distance functions

We define a sparse filtration that gives a good approximation to the weighted Rips filtration $\{R_\alpha\}$ in terms of persistent homology. It is simply the intersection of the weighted Rips complex and the union of sparse Rips complexes at different scales.

$$T_\alpha = R_\alpha \cap S_\alpha.$$

Our main goal is to show that the filtration $\{T_\alpha\}$ has a persistence diagram that is similar to that of $\{R_\alpha\}$. To do this we will demonstrate a multiplicative interleaving between these filtrations, where the interleaving constant is

$$\kappa = \frac{1 + \sqrt{1 + t^2} \varepsilon}{1 - \varepsilon}.$$

Specifically, we show that for all $\alpha \ge 0$, the following diagram commutes at the homology level.

<figure><img src="image_11.png" /></figure>

We first need to check that the projection $\pi_{\frac{\alpha}{1-\varepsilon}}$ indeed induces a simplicial map from $R_\delta$ to $T_{\kappa\delta}$.
**Lemma 6.11.** For all $\alpha > 0$, the projection $\pi_{\frac{\alpha}{1-\varepsilon}}$ induces a simplicial map from $R_{\alpha} \to T_{\kappa\alpha}$, where
$$ \kappa = \frac{1+\sqrt{1+t^2}}{1-\varepsilon}. $$

*Proof.* We show that for each edge $(p, q) \in R_{\alpha}$, there is a corresponding edge $(\pi_{\frac{\alpha}{1-\varepsilon}}(p), \pi_{\frac{\alpha}{1-\varepsilon}}(q)) \in R_{\kappa\alpha} \cap Q_{\frac{\alpha}{1-\varepsilon}}$. Since the latter complex is a clique complex, this will imply that for all $\sigma \in R_{\alpha}$, we have $\pi_{\frac{\alpha}{1-\varepsilon}}(\sigma) \in R_{\kappa\alpha} \cap Q_{\frac{\alpha}{1-\varepsilon}} \subseteq T_{\kappa\alpha}$ as desired. First, $(\pi_{\frac{\alpha}{1-\varepsilon}}(p), \pi_{\frac{\alpha}{1-\varepsilon}}(q)) \in R_{\kappa\alpha}$ as a direct consequence of Lemma 6.10.

Next, we need to show that $(\pi_{\frac{\alpha}{1-\varepsilon}}(p), \pi_{\frac{\alpha}{1-\varepsilon}}(q)) \in Q_{\frac{\alpha}{1-\varepsilon}}$. It suffices to show that $f_{\frac{\alpha}{1-\varepsilon}}(\pi_{\frac{\alpha}{1-\varepsilon}}(p), \pi_{\frac{\alpha}{1-\varepsilon}}(q)) \le \frac{2\alpha}{1-\varepsilon}$. $\square$

$$ \begin{align*} f_{\frac{\alpha}{1-\varepsilon}}(\pi_{\frac{\alpha}{1-\varepsilon}}(p), \pi_{\frac{\alpha}{1-\varepsilon}}(q)) &\le f_{\frac{\alpha}{1-\varepsilon}}(p, q) \\ &= d_X(p, q) + s_p(\frac{\alpha}{1-\varepsilon}) + s_q(\frac{\alpha}{1-\varepsilon}) \\ &\le d_X(p, q) + \frac{2\varepsilon\alpha}{1-\varepsilon} \\ &\le 2\alpha + \frac{2\varepsilon\alpha}{1-\varepsilon} \\ &= \frac{2\alpha}{1-\varepsilon} \end{align*} \square $$

Now, we give conditions for when two projections induce contiguous simplicial maps between the sparse weighted Rips complexes $T_{\delta}$ and $T_{\kappa\delta}$.

**Lemma 6.12.** Two projections $\pi_{\alpha}$ and $\pi_{\beta}$ induce contiguous simplicial maps from $T_{\delta} \to T_{\kappa\delta}$, where
$$ \kappa = \frac{1+\sqrt{1+t^2}}{1-\varepsilon} \text{ whenever } \alpha, \beta \le \frac{\delta}{1-\varepsilon} \text{ and there exists } i \text{ so that } \frac{\lambda_{i+1}}{\varepsilon(1-\varepsilon)} \le \alpha \le \beta \le \frac{\lambda_i}{\varepsilon(1-\varepsilon)}. $$

*Proof.* We simply observe that for any $\sigma \in T_{\delta}$, $\sigma \in Q_{\rho}$ for some $\rho \le \delta$. If $\rho \le \beta$ then Lemma 6.9 implies $\pi_{\alpha}(\sigma) \cup \pi_{\beta}(\sigma) \in Q_{\beta}$. Otherwise $\pi_{\alpha}(\sigma) \cup \pi_{\beta}(\sigma) = \sigma \in Q_{\rho}$. So in either case, we have $\pi_{\alpha}(\sigma) \cup \pi_{\beta}(\sigma) \in S_{\delta\gamma}$. Now, by Lemma 6.10, we have that $\pi_{\alpha}(\sigma) \cup \pi_{\beta}(\sigma) \in R_{\kappa\delta}$. So, we have that $\pi_{\alpha}(\sigma) \cup \pi_{\beta}(\sigma) \in R_{\kappa\delta} \cap S_{\kappa\delta} = T_{\kappa\delta}$ as desired. $\square$

We can now give the proof of the interleaving which will imply the desired approximation of the persistent homology.

**Lemma 6.13.** For all $\alpha > 0$, the following diagram commutes the homology level.

<figure><img src="image_12.png" /></figure>

*Proof.* By Lemma 6.10, the projection $\pi_{\frac{\alpha}{1-\varepsilon}}$ and the inclusion $\pi_0$ are contiguous and thus produce identical homomorphisms at the homology level. For the lower triangle it will suffice to show that homomorphism induced by $\pi_{\frac{\alpha}{1-\varepsilon}}$ commutes with that produced by the inclusion $\pi_0$. Let $\phi_i = \pi_{\frac{\lambda_i}{1-\varepsilon}}$ for $i = 1, \dots, n+1$. Now, Lemma 6.12 implies that $\phi_i$ and $\phi_{i+1}$ are contiguous. So, choosing $k$ such that $\lambda_k \le \varepsilon\alpha < \lambda_{k-1}$, we can apply Lemma 6.12 repeatedly to conclude that

$$ \pi_{0\star} = \phi_{n+1\star} = \phi_{n\star} = \dots = \phi_{k\star} = \pi_{\frac{\alpha}{1-\varepsilon}\star}. \square $$

# 7 Numerical illustration

In this section, we illustrate our results from three different perspectives: the quality of the approximation, the stability of the diagrams with respect to noise, and the size of the filtration after sparsification.

We used the ANN library [17] for the k-nearest neighbors search and code from Zomorodian following [23] for the persistence. The topology of the union of balls is acquired through the α-shapes implementation from the CGAL library [11].
Datasets

For the first two parts, we consider the set of points in $R^3$ obtained by sampling regularly the skeleton of the unit cube with 116 points. Then we add four noise points in the center of four of its faces such that two opposite faces are empty.

<figure><img src="image_13.png" /><figcaption>Figure 2: Skeleton of a cube with outliers</figcaption></figure>

We would like to compute the persistence diagram of the skeleton of the cube. We write this diagram Dgm(Skel). It contains five homology classes in dimension 1 and one in dimension 2, and it has the barcode representation given in Figure 3.

<figure><img src="image_14.png" /><figcaption>Figure 3: Persistence diagram of a cube skeleton without noise</figcaption></figure>

For sparsification, we use a slightly bigger dataset composed of 10000 points regularly distributed on a curve rolled around a torus. The point set is shown on Figure 4.

<figure><img src="image_15.png" /><figcaption>Figure 4: Spiral on a torus</figcaption></figure>

**Approximation** We work from now on with a mass parameter *m* such that *k* = *mn* = 5. The persistence diagram of *d*<sub>μ<sub>P</sub>,m</sub> is given in Figure 5:

The diagrams obtained with our various approximations have very similar looks. We only show the
one obtained with the sparse Rips filtration with a parameter $\epsilon = 0.5$ in Figure 6.

To compare diagrams, we use the bottleneck distances between the diagrams. Figure 7 shows the
distance matrix between the various diagrams, while Figure 8 shows some bottleneck distances between
persistence diagrams of different dimensions. Note that Dgm(d<sub>P</sub>) corresponds to the diagram obtained
by using the distance function to the point cloud.
<figure><img src="image_16.png" /><figcaption>Figure 5: Dgm($d_{\mu_P,m}$) for the cube skeleton with outliers with $k = 5$</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>Figure 6: Dgm($\{T_\alpha\}$) for the cube skeleton with outliers with $k = 5$ and $\epsilon = .5$</figcaption></figure>

<table><caption>Figure 7: Matrix of distances for the bottleneck distance</caption><thead><tr><th></th><th>Dgm(Skel)</th><th>Dgm(d<sub>μ<sub>P</sub>,m</sub>)</th><th>Dgm(d<sup>P</sup><sub>μ<sub>P</sub>,m</sub>)</th><th>Dgm(R<sub>α</sub>)</th><th>Dgm(T<sub>α</sub>)</th><th>Dgm(d<sub>P</sub>)</th></tr></thead><tbody><tr><th>Dgm(Skel)</th><td>0</td><td>.1528</td><td>.1473</td><td>.1473</td><td>.1817</td><td>.25</td></tr><tr><th>Dgm(d<sub>μ<sub>P</sub>,m</sub>)</th><td>.1528</td><td>0</td><td>.09872</td><td>.0865</td><td>.1183</td><td>.2543</td></tr><tr><th>Dgm(d<sup>P</sup><sub>μ<sub>P</sub>,m</sub>)</th><td>.1473</td><td>.09872</td><td>0</td><td>.0459</td><td>.1084</td><td>.2642</td></tr><tr><th>Dgm(R<sub>α</sub>)</th><td>.1473</td><td>.0865</td><td>.0459</td><td>0</td><td>.1128</td><td>.2598</td></tr><tr><th>Dgm(T<sub>α</sub>)</th><td>.1817</td><td>.1183</td><td>.1084</td><td>.1128</td><td>0</td><td>.2484</td></tr><tr><th>Dgm(d<sub>P</sub>)</th><td>.25</td><td>.2543</td><td>.2642</td><td>.2598</td><td>.2484</td><td>0</td></tr></tbody></table>

<table><caption>Figure 8: Bottleneck distances between diagrams</caption><thead><tr><th>Dgm(A)</th><th>Dgm(B)</th><th>dim 0</th><th>dim 1</th><th>dim 2</th></tr></thead><tbody><tr><th>Dgm(Skel)</th><td>Dgm(d<sub>μ<sub>P</sub>,m</sub>)</td><td>.05202</td><td>.1528</td><td>.1495</td></tr><tr><th>Dgm(d<sub>μ<sub>P</sub>,m</sub>)</th><td>Dgm(d<sup>P</sup><sub>μ<sub>P</sub>,m</sub>)</td><td>.09872</td><td>.0195</td><td>.0972</td></tr><tr><th>Dgm(d<sup>P</sup><sub>μ<sub>P</sub>,m</sub>)</th><td>Dgm(R<sub>α</sub>(P, d<sub>μ<sub>P</sub>,m</sub>))</td><td>.0007</td><td>.0044</td><td>.0459</td></tr><tr><th>Dgm(R<sub>α</sub>(P, d<sub>μ<sub>P</sub>,m</sub>))</th><td>Dgm(T<sub>α</sub>(P, d<sub>μ<sub>P</sub>,m</sub>))</td><td>.0872</td><td>.1128</td><td>.0026</td></tr><tr><th>Dgm(Skel)</th><td>Dgm(d<sup>P</sup><sub>μ<sub>P</sub>,m</sub>)</td><td>.0405</td><td>.1473</td><td>.0982</td></tr><tr><th>Dgm(Skel)</th><td>Dgm(T<sub>α</sub>(P, d<sub>μ<sub>P</sub>,m</sub>))</td><td>.1026</td><td>.1817</td><td>.098</td></tr><tr><th>Dgm(Skel)</th><td>Dgm(d<sub>P</sub>)</td><td>.25</td><td>.2071</td><td>.1481</td></tr></tbody></table>

The largest difference is between Dgm(Skel) and Dgm($d_{\mu_P,m}$). This is partly due to an effect of shifting while using the distance to a measure. After this initial shift, the distance are small compared to the theoretical bounds. Notice that the different steps of the approximation do not have the same effect on all dimensions.

All diagrams obtained by the different approximations are closer to Dgm(Skel) than the persistence diagram of the distance to the point cloud, Dgm($d_P$) given in Figure 9. For inference purposes, one crucial parameter is the signal-to-noise ratio. We define it as the ratio between the smallest lifespan of topological feature we aim to infer and the longest lifespan of noise features. A ratio of 1 corresponds to a signal that is not differentiable from the noise and $\infty$ corresponds to a noiseless diagram. In our example, only the dimensions 1 and 2 are relevant as the dimension 0 diagram corresponding to connected components has only one relevant feature and its lifespan is infinite. Results are listed in Figure 10.
<figure><img src="image_18.png" /><figcaption>Figure 9: Dgm($d_P$) for the cube skeleton with outliers</figcaption></figure>

<table><caption>Figure 10: Signal to noise ratios</caption><thead><tr><th>Diagram</th><th>dim 1</th><th>dim 2</th></tr></thead><tbody><tr><td>Dgm(Skel)</td><td>∞</td><td>∞</td></tr><tr><td>Dgm(d<sub>μP,m</sub>)</td><td>247</td><td>2.74</td></tr><tr><td>Dgm(d<sup>P</sup><sub>μP,m</sub>)</td><td>69.8</td><td>43</td></tr><tr><td>Dgm(R<sub>α</sub>(P, d<sub>μP,m</sub>))</td><td>∞</td><td>∞</td></tr><tr><td>Dgm(T<sub>α</sub>(P, d<sub>μP,m</sub>))</td><td>132</td><td>∞</td></tr><tr><td>Dgm(d<sub>P</sub>)</td><td>5.66</td><td>1</td></tr></tbody></table>

Signal-to-noise ratios are clearly better than the one of Dgm($d_P$). Some of the approximation steps improve the ratio. This is due to two phenomena.

When one goes from $d_{μP,m}$ to $d_{μP,m}^P$, the filtration eliminates the cells of the $k^{th}$ order Voronoi diagram that are far from the point cloud. These cells induce local minima that produce noise features in the diagrams. Removing them cleans parts of the diagram. The same phenomenon happens with the witnessed $k$-distance previously mentioned.

Using the Rips filtration instead of the Čech also reduces some noise. It eliminates artifacts from simplices that are introduced and almost immediately killed in the Čech complex due to balls that intersect pairwise but have no common intersection.

## Stability

The weighted Rips filtration is stable with respect to noise. We illustrate this by studying the effect of an isotropic noise on our skeleton of a cube. We consider three different standard deviations for our noise. Figure 11 shows the bottleneck distances between the persistence diagram of the sparse weighted Rips structure with the Gaussian noise and the one without Gaussian noise.

<table><caption>Figure 11: $d_B$ between Dgm($\{T_α\}$) with and without Gaussian noise</caption><tr><td>Standard deviation</td><td>.05</td><td>.1</td><td>.5</td></tr><tr><td>d<sub>B</sub> in dimension 1</td><td>.1469</td><td>.2261</td><td>.2722</td></tr><tr><td>d<sub>B</sub> in dimension 2</td><td>.047</td><td>.0914</td><td>.1046</td></tr></table>

Unsurprisingly, the bottleneck distance is increasing with standard deviation of the noise. The signal-to-noise ratio shown in Figure 12 is more interesting.

<table><caption>Figure 12: Signal to noise ratio of Dgm($\{T_α\}$) depending on noise intensity</caption><tr><td>Standard deviation</td><td>0</td><td>.05</td><td>.1</td><td>.5</td></tr><tr><td>Ratio in dimension 1</td><td>132</td><td>8.27</td><td>3.17</td><td>1.04</td></tr><tr><td>Ratio in dimension 2</td><td>∞</td><td>∞</td><td>100.2</td><td>∞</td></tr></table>

Inferring correctly the homology of the cube skeleton is possible with standard deviation 0.05 and 0.1. Figure 13 shows the persistence diagram obtained with a standard deviation of 0.1. The $\infty$ in the 0.5 case in dimension 2 is not relevant as there is no noise but the feature is too small compared to the
rest of the diagram as shown in Figure 14. Note that 0.5 corresponds to half of the side of the cube, and thus, it is logical to be unable to retrieve any useful information.

<figure><img src="image_19.png" /><figcaption>Figure 13: Persistence diagram of {$T_\alpha$} with $k = 5$, $\epsilon = 0.5$ and a Gaussian noise with standard deviation 0.1</figcaption></figure>

<figure><img src="image_20.png" /><figcaption>Figure 14: Persistence diagram of {$T_\alpha$} with $k = 5$, $\epsilon = .5$ and a Gaussian noise with standard deviation .5</figcaption></figure>

Some structure appears even with standard deviation as large as 0.5. The three bigger features in dimension 1 are relevant. However, we miss two elements and it is difficult to decide where to draw the frontier between relevant and irrelevant features.

## Sparsification efficiency

We introduced sparsification in Section 6.4 to reduce the size of the Rips filtration. The method introduced a new parameter $\epsilon$, and the size of the filtration depends heavily on $\epsilon$. The evolution of the size of the filtration depending on the parameter $\epsilon$ is given in Figure 15.

<figure><img src="image_21.png" /><figcaption>Figure 15: Size of the filtration depending on $\epsilon$ for the spiral with a Gaussian noise of standard deviation .05</figcaption></figure>

The minimum size is reached around $\epsilon = .86$. This minimum depends on the structure of the dataset. For example, considering a set of points uniformly sampled in a square, we obtain filtrations with monotonously decreasing size. While theoretical results depend on the doubling dimension of the ambient apces, experimental results strongly suggests that it depends on the intrinsic doubling dimension, which can be vary at different scales.
The filtration size is nearly constant after a rapid decrease. In this example, the size is of order $10^7$ simplices for an input of $10^5$ vertices. Computing persistent homology is tractable for any value in this range. Structure in the data helps reduce the complexity of the sparse filtration.

# 8 Conclusion

In this paper, we generalize several aspects of the existing theory on the persistent homology of distances to measures from Euclidean space to general metric spaces. Then, we showed how to efficiently approximate the sublevels these distance functions with a linear number of metric balls. We gave a detailed analysis of the tightness of this approximation.

We then showed how to give a sparse filtration that gives a guaranteed close approximation to the persistent homology of the distance to the measure. This last construction was given in the more general context of power distances. Thus, we have given a way to efficiently compute the persistent homology of the sublevel set filtration of any power distance function built on points in metric space of low doubling dimension. Since power distances can be used to approximate many different kinds of functions, we expect this technique will find many more uses in the future.

A different perspective on our approach is that we use the sparse Rips filtration analogously to how one might use a grid in Euclidean space. It provides a structure over which one can go on to study many different functions.

Lastly, we showed that this approach can be made practical, by providing some experimental results and analysis.

# Acknowledgements

The authors acknowledge the support of the ANR TopData (ANR-13-BS01-0008) and the ERC Grant GUDHI. The authors also wish to thank the anonymous referees for their helpful comments that contributed to the improvement of the paper.

# References

[1] Gunnar Carlsson. Topology and data. *Bull. Amer. Math. Soc.*, 46:255–308, 2009.

[2] Frédéric Chazal, David Cohen-Steiner, Marc Glisse, Leonidas J. Guibas, and Steve Y. Oudot. Proximity of persistence modules and their diagrams. In *Proceedings of the 25th Annual Symposium on Computational Geometry*, pages 237–246. ACM, 2009.

[3] Frédéric Chazal, David Cohen-Steiner, Leonidas J. Guibas, Facundo Mémoli, and Steve Y. Oudot. Gromov-hausdorff stable signatures for shapes using persistence. In *Computer Graphics Forum*, volume 28, pages 1393–1403. Wiley Online Library, 2009.

[4] Frédéric Chazal, David Cohen-Steiner, and André Lieutier. A sampling theory for compact sets in Euclidean space. *Discrete & Computational Geometry*, 41(3):461–479, 2009.

[5] Frédéric Chazal, David Cohen-Steiner, and Quentin Mérigot. Geometric inference for probability measures. *Foundations of Computational Mathematics*, 11(6):733–751, 2011.

[6] Frédéric Chazal, Vin de Silva, Marc Glisse, and Steve Oudot. The structure and stability of persistence modules. *arXiv preprint arXiv:1207.3674*, 2012.

[7] Frédéric Chazal, Vin de Silva, and Steve Oudot. Persistence stability for geometric complexes. *arXiv preprint arXiv:1207.3885*, 2012.

[8] Frédéric Chazal and Steve Y. Oudot. Towards persistence-based reconstruction in Euclidean spaces. In *Proceedings of the twenty-fourth Annual Symposium on Computational Geometry*, pages 232–241. ACM, 2008.

[9] Kenneth L. Clarkson and Peter W. Shor. Applications of random sampling in computational geometry, II. *Discrete & Computational Geometry*, 4(1):387–421, 1989.
[10] David Cohen-Steiner, Herbert Edelsbrunner, and John Harer. Stability of persistence diagrams. *Discrete & Computational Geometry*, 37(1):103–120, 2007.

[11] Tran Kai Frank Da, Sébastien Loriot, and Mariette Yvinec. 3D alpha shapes. In *CGAL User and Reference Manual*. CGAL Editorial Board, 4.2 edition, 2013. http://www.cgal.org/Manual/4.2/doc_html/cgal_manual/packages.html#Pkg:AlphaShapes3.

[12] Tamal K. Dey, Fengtao Fan, and Yusu Wang. Computing topological persistence for simplicial maps. *arXiv preprint arXiv:1208.5018*, 2012.

[13] Herbert Edelsbrunner and John L. Harer. *Computational topology: an introduction*. American Mathematical Soc., 2010.

[14] Herbert Edelsbrunner, David Letscher, and Afra Zomorodian. Topological persistence and simplification. In *Foundations of Computer Science, 2000. Proceedings. 41st Annual Symposium on*, pages 454–463. IEEE, 2000.

[15] Leonidas Guibas, Dmitriy Morozov, and Quentin Mérigot. Witnessed k-distance. *Discrete & Computational Geometry*, 49(1):22–45, 2013.

[16] Allen Hatcher. *Algebraic Topology*. Cambridge University Press, 2002.

[17] David M. Mount and Sunil Arya. ANN: Library for approximate nearest neighbour searching. 1998.

[18] James R. Munkres. *Elements of Algebraic Topology*. Addison-Wesley, 1984.

[19] Partha Niyogi, Stephen Smale, and Shmuel Weinberger. Finding the homology of submanifolds with high confidence from random samples. *Discrete & Computational Geometry*, 39(1-3):419–441, 2008.

[20] Steve Y. Oudot and Donald R. Sheehy. Zigzag zoology: Rips zigzags for homology inference. In *Proceedings of the 29th annual Symposium on Computational Geometry*, pages 387–396, 2013.

[21] Donald R. Sheehy. Linear-size approximations to the Vietoris-Rips filtration. *Discrete & Computational Geometry*, 49(4):778–796, 2013.

[22] C. Villani. *Topics in Optimal Transportation*. American Mathematical Society, 2003.

[23] Afra Zomorodian and Gunnar Carlsson. Computing persistent homology. *Discrete & Computational Geometry*, 33(2):249–274, 2005.