Daniel Perez
email: daniel.perez@ens.fr

On C 0 -persistent homology and trees

In this paper we give a metric construction of a tree which correctly identifies connected components of superlevel sets of continuous functions f : X → R and show that it is possible to retrieve the H 0 -persistence diagram from this tree. We revisit the notion of homological dimension previously introduced by Schweinhart and give some bounds for the latter in terms of the upper-box dimension of X, thereby partially answering a question of the same author. We prove a quantitative version of the Wasserstein stability theorem valid for regular enough X and α-Hölder functions and discuss some applications of this theory to random fields and the topology of their superlevel sets.

1 Introduction

State of the art

The topology of superlevel sets of a function has been a widespread subject of study in different mathematical communities. In the probability theory community, the introduction of trees has key in the understanding of connected components of superlevel sets of random functions on [0, 1] [ [START_REF] Curien | The Brownian cactus I. Scaling limits of discrete cactuses[END_REF][START_REF] Duquesne | Random trees, Lévy processes and spatial branching processes[END_REF][START_REF] Duquesne | Probabilistic and fractal aspects of Lévy trees[END_REF][START_REF] Picard | A tree approach to p-variation and to integration[END_REF]. This approach allows us to define trees associated to (arbitrarily irregular, but continuous) functions.

More recently, so-called merge trees have made their apparition amongst the topological data analysis (TDA) commmunity (cf. the books by Chazal et al. [START_REF] Chazal | The Structure and Stability of Persistence Modules[END_REF] and Oudot's book [START_REF] Oudot | Persistence Theory -From Quiver Representations to Data Analysis[END_REF] for an introduction to TDA). As in the probabilistic case, these merge trees carry important information about the connected components of superlevel sets and moreover about the persistence diagram of a function f defined on a compact space X [START_REF] Curry | The fiber of the persistence map for functions on the interval[END_REF][START_REF] Curry | Decorated merge trees for persistent topology[END_REF][START_REF] Mémoli | Reeb posets and tree approximations[END_REF][START_REF] Munch | The ∞-cophenetic metric for phylogenetic trees as an interleaving distance[END_REF][START_REF] Wang | The JS-graphs of join and split trees[END_REF], which is now required to be a Morse function (an explicit construction and correspondence between trees and barcodes can be found in [START_REF] Curry | The fiber of the persistence map for functions on the interval[END_REF]).

The construction of these trees are different between both communities: the approach of the probabilists is analytic [START_REF] Curien | The Brownian cactus I. Scaling limits of discrete cactuses[END_REF][START_REF] Duquesne | Random trees, Lévy processes and spatial branching processes[END_REF], whereas the merge trees can be seen as an algebraic construction [START_REF] Curry | The fiber of the persistence map for functions on the interval[END_REF][START_REF] Curry | Decorated merge trees for persistent topology[END_REF][START_REF] Munch | The ∞-cophenetic metric for phylogenetic trees as an interleaving distance[END_REF]. Since these trees capture essentially the same information about the connected components of superlevel sets, one can ask whether both constructions coincide where their regimes of validity intersect. We will show in this paper that they do and that it is possible to retrieve the H 0 -persistence diagram of f from the constructed tree (constructed from through the probabilistic approach).

Parallel to this development, Wasserstein p distances on the space of diagrams (denoted d p ) [START_REF] Edelsbrunner | Computational Topology: An Introduction[END_REF]Chapter VIII.2] have been widely used and studied by the TDA community in different contexts [START_REF] Carriere | Sliced Wasserstein Kernel for Persistence Diagrams[END_REF][START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF][START_REF] Divol | Understanding the topology and the geometry of the persistence diagram space via optimal partial transport[END_REF][START_REF] Mileyko | Probability measures on the space of persistence diagrams[END_REF][START_REF] Turner | Fréchet means for distributions of persistence diagrams[END_REF]. Recently, Wasserstein distances have been formalized through the use of optimal partial transport by Divol and Lacombe [START_REF] Divol | Understanding the topology and the geometry of the persistence diagram space via optimal partial transport[END_REF]. In this approach, we look at persistence diagrams as measures, a point of view which had been previously been introduced [START_REF] Chazal | The Structure and Stability of Persistence Modules[END_REF][START_REF] Oudot | Persistence Theory -From Quiver Representations to Data Analysis[END_REF] and has proved fruitful independently from these considerations. The framework introduced by Divol and Lacombe extends the notion of Wasserstein p distance previously defined on persistence diagrams to arbitrary Radon measures on the upper-half plane X where persistence diagrams are defined.

The extension to all Radon measures comes with certain advantages, such as having an easily definable and computable notion of "average diagram", defined by duality. This notion was originally introduced by Chazal and Divol in [START_REF] Chazal | The density of expected persistence diagrams and its kernel based estimation[END_REF] as follows. If f is a random function, seeing Dgm(f ) as a measure, it is possible to define the average diagram of the process by duality in the following way. For every measurable set B ⊂ X ,

E[Dgm(f )] (B) := E[Dgm(f )(B)] .
(1.1)

From the definition, E[Dgm(f )] encodes every linear functional of the diagram and is easily computed, motivating its introduction. Note this definition contrasts the Fréchet means approach of other authors (e.g. Turner et al. [START_REF] Turner | Fréchet means for distributions of persistence diagrams[END_REF]), which is non-linear, depends on p and requires a proof of existence and unicity, but does not require the extension of the space of persistence diagrams to the space of arbitrary measures on X . This dual approach of Chazal and Divol inscribes itself in a more general interest in the persistence diagrams of stochastic processes, which have been studied by a wide variety of authors, for instance [START_REF] Adams | A fractal dimension for measures via persistent homology[END_REF][START_REF] Adler | Persistent homology for random fields and complexes[END_REF][START_REF] Adler | Random Fields and Geometry[END_REF][START_REF] Baryshnikov | Time series, persistent homology and chirality[END_REF][START_REF] Chazal | The density of expected persistence diagrams and its kernel based estimation[END_REF][START_REF] Chazal | Subsampling methods for persistent homology[END_REF][START_REF] Chazal | Convergence rates for persistence diagram estimation in topological data analysis[END_REF][START_REF] Perez | On the persistent homology of almost surely C 0 stochastic processes[END_REF][START_REF] Turner | Fréchet means for distributions of persistence diagrams[END_REF]. Some of the previously cited results discuss different aspects of random field persistence theory, which include, but are not limited to computations for canonical processes [START_REF] Baryshnikov | Time series, persistent homology and chirality[END_REF][START_REF] Perez | On the persistent homology of almost surely C 0 stochastic processes[END_REF], stability of certain linear functionals with respect to the bottleneck distance [START_REF] Chazal | Subsampling methods for persistent homology[END_REF], the Euler characteristic [START_REF] Adler | Persistent homology for random fields and complexes[END_REF], random complexes [START_REF] Adler | Persistent homology for random fields and complexes[END_REF] and notions of central tendency [START_REF] Chazal | The density of expected persistence diagrams and its kernel based estimation[END_REF][START_REF] Turner | Fréchet means for distributions of persistence diagrams[END_REF].

Given the widespread use of Wasserstein p distances, it is important to understand whether this notion is continuous (and the nature of this continuity) with respect to perturbations at the level of the filtrating functions on the space X. This so-called "Wasserstein stability" of persistence diagrams of functions f : X → R has been widely discussed by the TDA community, in the context where the space X is triangulable. There are many results in this direction [START_REF] Chen | Diffusion runs low on persistence fast[END_REF][START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF][START_REF] Skraba | Wasserstein stability for persistence diagrams[END_REF], valid with different degrees of generality, covering both X compact [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF][START_REF] Skraba | Wasserstein stability for persistence diagrams[END_REF] and X non-compact [START_REF] Chen | Diffusion runs low on persistence fast[END_REF], but mainly focusing mainly on Lipschitz functions (note, however, that the work of Chen and Edelsbrunner [START_REF] Chen | Diffusion runs low on persistence fast[END_REF] does not require the Lipschitz condition). The first result in this direction was obtained by Cohen-Steiner et al. [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF] and depends on the following restriction on X. Definition 1.1. [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF] A (triangulable) metric space X implies bounded q-total persistence if, for all k ∈ N, there exists a constant C X that depends only on X such that Pers q q (Dgm k (f )) < C X (1.2)

for every tame function f with Lipschitz constant Lip(f ) ≤ 1.

The Pers p -functional of the definition above is the usual p-persistence used in TDA (a nonexhaustive list of uses of this functional includes [START_REF] Adams | Persistence images: A stable vector representation of persistent homology[END_REF][START_REF] Carriere | Sliced Wasserstein Kernel for Persistence Diagrams[END_REF][START_REF] Divol | Understanding the topology and the geometry of the persistence diagram space via optimal partial transport[END_REF][START_REF] Mileyko | Probability measures on the space of persistence diagrams[END_REF][START_REF] Turner | Fréchet means for distributions of persistence diagrams[END_REF]), defined as the p -norm of the length of the bars of the barcode of f . The results obtained thereafter rely heavily on this condition, which is not rendered quantitative (in particular, given X, no upper bound for C X or lower bound for q were known in general). Nonetheless, this condition allowed the authors to show Wasserstein stability.

Theorem 1.2 (Cohen-Steiner, Edelsbrunner, Harer, [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF]). Let X be a triangulable space implying bounded q-total persistence and let f and g be two R-valued Lipschitz functions on X. Then, for all p > q, we have d p (Dgm(f ), Dgm(g)) ≤ C X (Lip(f ) q ∨ Lip(g) q ) f -g

1-q p ∞ , (1.3)
where Lip(f ) denotes the Lipschitz constant of f .

Further results in this direction, such as [START_REF] Skraba | Wasserstein stability for persistence diagrams[END_REF], also rely on the bounded q-total persistence condition, but give bounds lower bounds on admissible q, finding that q ≥ d, where d is the maximal dimension of simplices in the triangulation of X. It is also known that, for distance functions to point clouds in R d , q = d.

We will later see that the lower bound for the validity of Wasserstein stability is closely related to a different question regarding the link between the so-called homological dimensions of X and the upper-box dimension of X, which we will denote dim(X) (analogously, we will denote dim(X) the lower-box dimension). To the best knowledge of the author, although Yuliy Baryshnikov and Shmuel Weinberger had previously obtained results in this direction (but never published them), this question was first opened and studied by Schweinhart and MacPherson [START_REF] Macpherson | Measuring shape with topology[END_REF] and later studied in more detail by Schweinhart in [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF], but has also been addressed by other authors (cf. [START_REF] Adams | A fractal dimension for measures via persistent homology[END_REF] and the references therein).

Definition 1.3 (Schweinhart's definition of dim k

PH , [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF]). Let X be a bounded subset of a metric space. The PH k -dimension of X is dim k PH (X) := sup

x inf p {Pers p (Dgm k (d(-, x))) < ∞} , (1.4)
where the supremum is taken over all finite sets of points x of X.

There are open problems stated in Schweinhart's paper regarding the relation between these notions of dimension and dim(X), some of which we will give a partial answer to in this paper. As we will later see, it is suitable to tweak this definition slightly.

Our contribution

• Following the work of Le Gall and Curien [START_REF] Curien | The Brownian cactus I. Scaling limits of discrete cactuses[END_REF][START_REF] Duquesne | Random trees, Lévy processes and spatial branching processes[END_REF], we define a tree constructed from a compact, connected and locally path connected space X and a continuous function f : X → R using a pseudo-distance on X defined in terms of f (section 2.1). We use this constructed tree to extend the work of Curry [START_REF] Curry | The fiber of the persistence map for functions on the interval[END_REF] previously valid under a Morse assumption to every continuous function. More precisely, we prove that it is possible to retrieve the barcode of the function from the constructed tree via an explicit algorithm (theorem 2.16).

• We show that the map assigning a function f : [0, 1] → R to its constructed tree T f is a surjection onto the space of trees of finite upper-box dimension and provide an explicit construction of an inverse image (section 2.3).

• Following previous work by Picard [START_REF] Picard | A tree approach to p-variation and to integration[END_REF] and Schweinhart [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF], we introduce the so-called persistence index of degree k, L k (f ), of a function f : X → R (definition 3.3). For a regular enough metric spaces X, if f is Hölder continuous (or Hölder continuous up to precomposition by a homeomorphism), we show an upper bound for L 0 (f ) in terms of dim(X) (lemma 3.13) and show that L 0 (f ) = dim(T f ), where T f denotes the tree constructed from f (theorem 3.9).

• We modify Schweinhart's definition for the kth degree homological dimension of X (definition 3.31) as dim k PH (X) := sup

f ∈Lip 1 (X) L k (f ) (1.5)
and show that for X regular enough, we retrieve a well-known result by Kozma et al. that dim 0 PH (X) = dim(X) [START_REF] Kozma | The minimal spanning tree and the upper box dimension[END_REF] and that the supremum in this definition is attained generically (theorem 3.19). Moreover, dim k PH (X) can be bounded above by dim(X), up to a factor which may depend on k and the regularity of X (theorem 3.23).

• We show that the supremum in the definition of dim k PH could have been taken over any regularity class C α (X, R), up to a factor of α (theorems 3.19 and 3.23) and show a genericity result for the set of functions in C α (X, R) satisfying dim(X) = L 0 (f ). Under more stringent conditions on X, we show the same genericity result holds in fact for dim(X) ≤ L k (f ) for integer 0 ≤ k < dim(X) and show the equality case with some supplementary conditions on X and in particular for compact Riemannian manifolds (theorem 3.29). In so doing, we answer a question by Schweinhart [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF] regarding bounds on homological dimensions and regularity conditions on X for this bound to be sharp (section 3.3).

• Using the results relating to the bounds on the homological dimensions, we give a Wasserstein stability result valid for all degrees of Čech homology on regular enough metric spaces (which in particular include all compact smooth manifolds of convexity radius bounded below) (theorem 4.13), for which explicit bounds on the constant C X are given and sharp bounds on the regime of validity of the theorem (corollary 4.16). We show an annex result of stability for the trees constructed from the functions f in terms of the Gromov-Hausdorff distance between the trees (theorem 4.21).

• Finally, we discuss some easy consequences of these results applied to the stochastic setting (section 5) and prove Chazal et al.-like results [START_REF] Chazal | Convergence rates for persistence diagram estimation in topological data analysis[END_REF] for the d p -stability of average diagrams of stochastic processes with an a priori hypothesis of regularity (theorem 5.8).

2 Barcodes, diagrams and trees

Trees stemming from a continuous function

Unless otherwise specified, throughout this section, let X denote a connected, locally pathconnected, compact topological space and let f : X → R be a continuous function. Let us denote (X r ) r∈R the filtration of X by the superlevels of f , that is

X r := {x ∈ X | f (x) ≥ r} .
(2.6) Notation 2.1. We will denote the open superlevel sets by X >r whenever necessary and note X z r the connected component of X r containing z.

There exists a pseudo-distance on X, denoted d f , given by: Definition 2.2. Let X and f be defined as above. The H 0 -distance, d f , is the pseudo-distance

d f (x, y) := f (x) + f (y) -2 sup γ:x →y inf t∈[0,1] f (γ(t)) , (2.7)
where the supremum runs over every path γ linking x to y.

Remark 2.3. Notice there are different ways of writing this distance. In particular, the sup above is also characterized by

sup γ:x →y inf t∈[0,1] f (γ(t)) = sup{r | [x] H 0 (Xr) = [y] H 0 (Xr) } (2.8) = sup{r | ∃γ ∈ C 1 (X r ) such that ∂γ = x -y} .
(2.9)

These equalities hold, since we take the coefficients of homology with respect to Z/2Z, so we can interpret 1-cycles as sums of paths on X. This pseudo-distance is a generalization of the distance introduced by Curien, Le Gall and Miermont in [START_REF] Curien | The Brownian cactus I. Scaling limits of discrete cactuses[END_REF]. Note that d f has the following properties:

1. Identification of the connected components of superlevel sets: d f (x, y) = 0 if and only if there exists t ∈ R such that x, y ∈ {f = t} and for every ε > 0, x and y lie in the same connected component of X >t-ε ;

2. Compatibility with the filtration induced by f : Let x, y ∈ X and suppose that

f (x) < f (y), then if [x] H 0 (X f (x) ) = [y] H 0 (X f (x) ) , d f (x, y) := |f (x) -f (y)| .
(2.10)

The compatibility with the filtration induced by f is immediate from the definition of d f . It remains to show the two following propositions.

Proposition 2.4. The function

d f : X 2 → R + of definition 2.2 is indeed a pseudo-distance.
Proof. Checking symmetry and positivity is easy. The only non-obvious point is that the triangle inequality is satisfied by this expression. Let x, y, z ∈ X and denote

[x → y] := sup γ:x →y inf t∈[0,1] f • γ(t) . (2.11)
It suffices to show the following inequality

[x → z] + [z → y] ≤ [x → y] + f (z) . (2.12)
Let γ be a path from x to z and η be a path from z to y and let γ * η be the concatenation of these two paths. By definition, inf

t∈[0,1] f • (γ * η)(t) ≤ [x → y] , (2.13)
from which it follows that

[x → z] ∧ [z → y] ≤ [x → y] . (2.14)
Without loss of generality, suppose that [x → z] achieves the above minimum and note that

[z → y] ≤ f (z) (2.15)
by definition of [z → y]. Adding the two last inequalities together,

[x → z] + [z → y] ≤ [x → y] + f (z) , (2.16)
as desired.

Proposition 2.5. Let f be a continuous function as above, then d f identifies the connected components of the superlevel sets.

Proof. The (⇐) direction is immediate, so let us show (⇒). Suppose that d f (x, y) = 0 and that f (x) = f (y), then,

sup γ:x →y inf t∈[0,1] f (γ(t)) = f (x) + f (y) 2 > f (x) ∧ f (y) .
(2.17)

However, sup

γ:x →y inf t∈[0,1] f (γ(t)) ≤ f (x) ∧ f (y) , (2.18)
which leads to a contradiction, so f (x) = f (y). The condition d f (x, y) = 0 becomes:

f (x) = sup γ:x →y inf t∈[0,1] f (γ(t)) . (2.19)
This is only possible if for every ε > 0 there is a path γ lying entirely in

X x >f (x)-ε , so x, y ∈ ε>0 X x >f (x)-ε (2.20)
finishing the proof.

With these technicalities out of the way, let us consider the metric space

(T f , d f ) := (X/{d f = 0}, d f ) , (2.21)
where X/{d f = 0} denotes the quotient of X where we identify all points x and y on X satisfying d f (x, y) = 0. Slightly abusing the notation, let d f denote the distance induced on T f by the pseudo-distance d f on X.

The metric structure of T f turns out to be simple, as T f is an R-tree. Let us briefly recall the definition of an R-tree. Definition 2.6 (Chiswell, [START_REF] Chiswell | Introduction to Λ-Trees[END_REF]). An R-tree (T, d) is a connected metric space such that any of the following equivalent conditions hold:

• T is a geodesic connected metric space and there is no subset of T which is homeomorphic to the circle, S 1 ;

• T is a geodesic connected metric space and the Gromov 4-point condition holds, i.e. :

∀x, y, z, t ∈ T d(x, y) + d(z, t) ≤ max [d(x, z) + d(y, t), d(x, t) + d(y, z)] ;
• T is a geodesic connected 0-hyperbolic space.

A rooted R-tree (T, O, d) is an R-tree along with a marked point O ∈ T .

A first important remark is that since X is connected, so is T f . To show T f is an R-tree, we will use the first characterization of the definition above and show both conditions, i.e. that there are no subspaces of T f which are homeomorphic to S 1 and that T f is in fact a geodesic metric space, to be satisfied separately.

Before showing this, it is helpful to introduce some notation.

Notation 2.7. Let π f : X → T f denote the canonical projection onto T f and let O denote the root of T f (i.e. f (O) = min f ), let us define the following quantity

(τ ) := inf X f + d f (O, τ ) , (2.22)
where X τ f (τ ) denotes the connected component of the superlevel set X f (τ ) containing a preimage of τ .

Remark 2.8. These objects are well-defined by definition of d f . Definition 2.9. The pseudo-distance topology on X or the topology of d f is the topology on X generated by the open balls:

B(x, r) := {z ∈ X | d f (x, z) < r} (2.23)
Despite the fact that the pseudo-distance topology is not in general Hausdorff, it is nonetheless fine enough to be useful, as shown by the two following technical lemmas. Lemma 2.10. Let X >r denote the open superlevel set {f > r} on X, then X >r has same connected components for the topology of d f on X and the usual topology of X.

Proof. Let us start by noticing that X >r is open in X for both topologies. For the usual topology, it is trivial. For the topology of d f it is the complement in X of the closed ball B(p, r -inf f ), where p is a point on X achieving the infimum of f , which exists by compactness of X.

Let Y now denote a connected component of X >r for the usual topology. The set Y is connected for the topology of d f . Otherwise, we could write Y = U V for some open sets U and V , but since open sets of the topology of d f are also open for the usual topology, this leads to a contradiction, as we assumed Y was connected for the usual topology. We will now show that Y is both open and closed in X >r for the topology of d f . Y is open, since it can be written as the union of open balls

Y = y∈Y B(y, f (y) -r) . (2.24)
Additionally, Y is closed since its complement is open, as it can be similarly written as the union of open balls. It follows that Y is also a connected component of X >r for the topology of d f . Now, suppose that Y is a connected component of X >r for the topology of d f . Any ball of the covering above is path connected, but since Y is connected, this implies that Y is path connected (and the paths are completely included within Y ), it is thus a path connected component of X >r . Since X is connected and locally path connected for the usual topology, Y is a path connected component of the usual topology, rendering it a connected component for the usual topology.

Lemma 2.11. Denote T >r the open superlevel set on T f . For the topology of d f , π f induces a bijective correspondence between the connected components of X >r and those of T >r .

Proof. Since π f is surjective and is both open and closed for the topology of d f , lemma 2.10 implies that the map π f surjectively sends the connected components of X >r onto connected components of T >r , since the connected components of X >r for the topology of d f and the usual topology of X are the same.

It remains to show the injectivity. Note that π f is open and closed for the topology of d f on X. The connected components of X >r are either disjoint or equal and, in fact, so are the images by π f of these connected components. Otherwise, there exists some τ ∈ T >r such that there is a preimage of τ lying in two different connected components of X >r , which is impossible, as every preimage of τ must lie in the same connected component of X >r in accordance to proposition 2.5. This is equivalent to stating that if Y and Z are two connected components of X >r and

Y = Z, then π f (Y ) ∩ π f (Z) = ∅, in particular π f (Y ) = π f (Z). Symbolically, Y = Z ⇒ π f (Y ) = π f (Z) , (2.25)
which is the contrapositive of the statement of injectivity.

From the above lemmata, we get the following proposition.

Proposition 2.12. The metric space T f := X/{d f = 0} equipped with distance d f possesses no subspace homeomorphic to S 1 .

Proof. We will reason by contradiction. Suppose that T f contains U ⊂ T f such that U is homeomorphic to the circle, S 1 . Note that f descends to a function on T f which is not locally constant anywhere by definition of d f and in particular not locally constant anywhere on U , as the level-sets of f in T are totally discontinuous. It follows that there exists an element x ∈ U such that the maximum of f on U is attained at x. For ε > 0 small enough, there are two distinct points x ε -and

x ε + such that f (x ε + ) = f (x) -ε = f (x ε -)
. Without loss of generality, we pick these points to be the closest ones to x along an arbitrary parametrization of U where this equality occurs. Since U is homeomorphic to S 1 , there is a path γ linking x + and x -lying entirely above f (x) -ε and passing through x. The image of γ in T >f (x)-ε is contained within one and only one connected component of T >f (x)-ε , which we will denote S. By lemma 2.11, S corresponds to a unique connected component of X >f (x)-ε with respect to the topology of d f , which we will denote X S . By lemma 2.10, X S is a connected component of X >f (x)-ε for the usual topology.

For every 0 < ε < ε, we can pick points x ε ± on U . The connected component S contains x ε ± for every such ε and since inverse images of these two points are connected in X >f (x)-ε ,

d f (x ε + , x ε -) < 2(f (x) -ε ) -2 inf γ: x ε + →x ε - f < 2(ε -ε ) (2.26) Letting x ε ± → x ε ± in U as ε → ε, we have that d f (x ε -, x ε + ) = 0
, leading to a contradiction, since we supposed that x ε + and x ε -were disjoint in T f (and therefore not a distance zero away from one-another).

From trees to barcodes

Given a tree stemming from a continuous function f : X → R, it is possible to reconstruct the H 0 -barcode of f from T f . If T f is finite, the relation between the barcode of H 0 (X, f ) with respect to the superlevel filtration and the tree T f is given by algorithm 1.

If T f is infinite, we can still give a correspondence between the barcode and the tree proceeding by approximation. This approximation procedure requires the introduction of so-called ε-trimmings of T f , of which we briefly recall the definition. Since the results of this section can be easily extended to any compact tree, we formulate the rest of this section in full generality.

For any rooted R-tree (T, d, O), we can define a filtering function : T → R by setting

(τ ) := d(O, τ ) . (2.27)
This allows us to define the height above a point τ as follows.

Definition 2.13. The function of the height above τ on a rooted R-tree T is a function h : T → R, defined as h(τ ) := sup

η∈T τ (τ ) d(O, η) -(τ ) , (2.28)
Algorithm 1: A functorial relation between persistence modules and R-trees Result: V F ← T ; V ← 0 ; i ← 0 ; while F = ∅ do Find γ the longest path in F starting from a root α and ending in a leaf β ;

if i = 0 then V ← V ⊕ k[ (α), ∞[ ; else V ← V ⊕ k[ (α), (β)[ ; end F ← F \ Im(γ); i ← i + 1 ; end return V Figure 1:
The first four iterations of algorithm 1. For every step, in red is the longest branch of the tree, which we use to progressively construct the persistent module V by associating an interval module whose ends correspond exactly to the values of the endpoints of the branches.

The height above τ allows us to define so-called ε-trimmings or ε-simplifications of T .

Definition 2.14. The ε-simplified tree of T , T ε or the ε-trimmed tree of T , is the subtree of T defined as

T ε := {τ ∈ T | h(τ ) ≥ ε} (2.29)
An ε-trimmed tree is always finite by virtue of the compactness of T . For a monotone decreasing sequence (ε n ) n∈N such that ε n → 0, we have the following chain of inclusions

T ε 1 - → T ε 2 - → T ε 3 - → • • • . (2.30)
Applying algorithm 1, we get a set of maps on the persistence modules induced by these inclusions. More precisely, denoting Alg(T εn ) the output of the algorithm In categoric terms, the algorithm above in fact is a functor

Alg(T ε 1 ) → Alg(T ε 2 ) → Alg(T ε 3 ) → • • • . ( 2
Alg : Tree → PersMod k , (2.33)
where Tree is the category of rooted R-trees seen as metric spaces, whose morphisms are isometric embeddings (which are not required to be surjective) preserving the roots, and where PersMod k is the category of q-tame persistence modules over a field k (cf. Oudot's book for details on the category of persistence modules [START_REF] Oudot | Persistence Theory -From Quiver Representations to Data Analysis[END_REF]). The action of Alg on morphisms between two trees ζ : T → T is defined as follows. If both T and T are finite, since ζ is an isometric embedding and it preserves the root, we can define Alg(ζ) to be

Alg(ζ) := i id k[ζ(α i ),ζ(β i )[ , (2.34)
where k[α i , β i [ denotes the modules in the interval module decomposition of Alg(T ) (which is finite, since T is as well). If T is infinite, we extend the above definition by taking successive ε n -simplifications of T and taking the direct limit of the construction above. Note that this procedure is well-defined since ε n -simplifications only depend on the function h, which in turn can be taken to only depend on the distance to the root.

Trees stemming from a function

Let us now consider a tree T f stemming from a function f and show that Alg(T f ) = H 0 (X, f ).

Proposition 2.15. Let τ and η be elements of T f such that f (τ ) < f (η) and let x ∈ π -1 (τ ) and y ∈ π -1 (η), then

∃ path γ : x → y s.t. ∀t, f (γ(t)) ≥ f (τ ) ⇐⇒ h(τ ) ≥ f (η) -f (τ ) and x, y ∈ X τ f (τ ) . (2.35)
Proof. Since there exists γ connecting x and y and since γ always stays above f (τ ), we conclude naturally that Im(γ) ⊂ X τ f (τ ) , which implies that h(τ

) ≥ f (η) -f (τ ) by definition of h(τ ). The implication (⇐) is clear since if x, y ∈ X τ f (τ ) and X τ f (τ )
is connected, by path connectedness of X there exists a path between x and y which stays above f (τ ). This proposition suffices to prove the following theorem on the validity of algorithm 1.

Theorem 2.16. Let X be a compact, connected, locally path connected topological space and let f :

X → R be continuous. Then Alg(T f ) = H 0 (X, f ).
Remark 2.17. This theorem is a slight improvement on the result of Curry in [START_REF] Curry | The fiber of the persistence map for functions on the interval[END_REF]Theorem §2.13]. In the language of [START_REF] Curry | The fiber of the persistence map for functions on the interval[END_REF], this constitutes a proof of the "Elder rule" with less assumptions of regularity. Indeed, in [START_REF] Curry | The fiber of the persistence map for functions on the interval[END_REF], the assumption of a Morse set (or that f is a Morse function) is necessary for the proof, whereas the functions hereby considered are merely required to be continuous.

Remark 2.18. By setting X = T and = f , theorem 2.16 states that Alg(T ) = H 0 (T, ).

Proof. Suppose that T f is finite, then Alg(T f ) is a decomposable persistence module Alg(T f ) := V. The fact that V is pointwise isomorphic to H 0 (X, f ) holds since d f correctly identifies the connected components of the superlevel sets. This guarantees the existence of a pointwise isomorphism since both spaces have the same (finite) dimension.

Let us now check that rank(V(r → s)) = rank(H 0 (X r → X s )). The inclusion X r -→ X s induces the following long exact sequence in homology

• • • H 1 (X s ) H 1 (X s , X r ) H 0 (X r ) H 0 (X s ) H 0 (X s , X r ) 0 Since this sequence is exact rank(H 0 (X r → X s )) = dim ker(H 0 (X s ) → H 0 (X s , X r )) . (2.36)
For notational simplicity, let us denote φ :

H 0 (X s ) → H 0 (X s , X r ). Note that φ[c] = [0] if
([c] T f ) ≥ r -s. It follows that dim ker φ = #{τ ∈ T f | h(τ ) ≥ r -s and f (τ ) = s} , (2.37)
which concludes the proof for the finite case.

If T f is infinite, we consider a sequence of ε n -trimmings of T f such that ε n ---→ n→∞ 0.
For any r > s, there exists n such that r -s > ε n . But T εn f is finite, so we are reduced to the previous case.

The inverse problem

An interesting question is whether every (compact) tree stems from a function f : X → R. If the tree is a so-called merge tree (in particular, we require that it be locally finite and 1dimensional), a solution has been provided by Curry in [22, §6]. We will now positively answer this question under the assumptions that dim T < ∞ and that X = [0, 1] by constructing a function f : [0, 1] → R, which constitute a wider class of trees than merge trees. The rest of this section will focus on proving the following theorem: Theorem 2.19. Let T be a compact R-tree such that dim T < ∞. Then, for any δ > 0 it is possible to construct a continuous function f : [0, 1] → R of finite (dim T + δ)-variation such that T = T f . In particular, up to a reparametrization, f can be taken to be

1 dim T +δ -Hölder continuous.
The idea is to once again use ε-simplifications T ε for which we can construct a function by taking the contour of the tree. Such a construction is referred to as the Dyck path in the terminology of [START_REF] Stanley | Enumerative Combinatorics[END_REF].

Finite trees

We can regard a rooted discrete tree as being an operator with N inputs, where N is the number of leaves of the tree. There is a natural operation on the space of discrete trees which composes these operations by: These objects are called operads and originated in the study of iterated loop spaces [START_REF] Boardman | Homotopy-everything h-spaces[END_REF][START_REF] Boardman | Homotopy Invariant Algebraic Structures on Topological Spaces[END_REF][START_REF] May | The Geometry of Iterated Loop Spaces[END_REF]. Since then, these objects have been studied in different fields for a variety of purposes [START_REF] Ginzburg | Koszul duality for operads[END_REF][START_REF] Loday | La renaissance des opérades[END_REF]. We will not give the explicit definition of an operad here, as a rigorous introduction is unnecessary for our purposes. However, we introduce this notion of composition of trees for notational simplicity.

Given a discrete R-tree T , if we have an embedding of T in R 2 , or equivalently, a partial order on its vertices, we can assign to T an interval I of a certain length with N marked points as well as a function f T : I → R, where N is the number of leaves of T . Using the terminology of [START_REF] Stanley | Enumerative Combinatorics[END_REF], a way to do this is by considering the so-called Dyck path or contour path where the path around T parametrized by arclength in T . The construction of the Dyck path has been carefully detailed in [START_REF] Duquesne | Random trees, Lévy processes and spatial branching processes[END_REF][START_REF] Stanley | Enumerative Combinatorics[END_REF], but it is better understood by looking at figure 2. By construction the equality: T f T = T holds for any discrete R-tree T . Here, equality is taken up to isometry.

As per the description of figure 2, the construction of the Dyck path yields a map φ which to T assigns an interval φ(T ) with N marked points. An example of the action of φ is illustrated in figure 3.

Figure 3: The action of φ on trees with two and three leaves respectively. The length of the intervals assigned is exactly the length of the contour around the trees and the marked points are the points at which f T achieves its maxima. This operation φ is in fact a "morphism" with respect to a composition operation on the intervals, defined as follows. If we have an interval I with N marked points and N intervals J k each with M j marked points, the result of the operation

I • (J 1 , • • • , J N ) is the insertion of the marked interval J k at the kth marked point of I. The length of I • (J 1 , • • • , J N ) is |I • (J 1 , • • • , J N )| = |I| + n k=1 |J k | , (2.38)
where |•| denotes the lengths of the intervals. The fact that φ is a "morphism" results from the definitions of compositions for trees and intervals. We can also define a variant of this morphism φ, which we will call φ λ , which for any tree T simply scales the (marked) interval φ(T ) by a factor λ.

Given a tree T the Dyck path f T : φ(T ) → R can be transformed into a function f λ T :

φ λ (T ) → R by setting f λ T (x) := f T (x/λ) . (2.39)
This is a rescaling of the x-axis which means that T f λ T = T f T = T still holds. Once again, these equalities are taken up to isometry.

Remark 2.20. The definition of f λ T is readily generalizable to forests. If F denotes a forest, then we define f λ F = T ∈F f λ T . For discrete trees, there is an upper bound of the number of vertices of the tree given its number of leaves.

Lemma 2.21. Let T be a rooted discrete tree, N ≥ 2 be its number of leaves and V be its number of vertices, then

V ≤ 2N -1 . (2.40)
In particular, if the edges of T all have length 1, the contour of the tree can be done over an interval of length at most 4N -2

Proof. For binary trees, it is known that [27, 56]

V = 2N -1 . (2.41)
Given a tree with N leaves, we can obtain a binary tree with N leaves by blowing up the vertices which are non-binary. The inequality of the lemma follows. On a binary tree, the Dyck path passes through almost every point in T twice, so the length of the interval is exactly 4N -2. Since binary trees are the extremal case, a bound for all trees with N leaves follows.

The results above show the result of theorem 2.19 for finite trees, since their upper-box dimension is equal to 1.

Infinite trees

The concatenation of trees can be defined for R-trees too in the obvious way. Given an infinite number of compositions, we can define a limit tree by defining it to be the limit of the partial compositions in the Gromov-Hausdorff sense. Ideally, we would like to have an equality of the following type

T = T a • (T \ T a ) , (2.42)
where T \ T a now denotes the rooted forest corresponding to the set T \ T a . This equality is desirable because by taking infinitely many compositions, we can eventually recover the original tree T , by composing successive ε n -simplifications with each other. However, this equality does not hold since T a might not have the right amount of leaves for this operation to be well-defined. Nonetheless, we can decide to count the vertices T a ∩ (T \ T a ) as leaves with multiplicity, so that the equality above holds.

For an infinite compact tree with dim T < ∞, the idea is to take some appropriate rapidly decreasing (monotonous) sequence (ε n ) n∈N * such that the interval

I = φ ε 1 (T ε 1 ) • φ ε 2 (T ε 2 \ T ε 1 ) • φ ε 3 (T ε 3 \ T ε 2 ) • • • • (2.43) has finite length. On each φ ε k (T ε k \T ε k-1
) we can consider the Dyck path on the forest

T ε k \T ε k-1 .
Defining a correct superposition of these Dyck paths, we would be done (cf. figure 6). For an infinite tree, it suffices to show that the sequence generated by the procedure of figure 6 converges in the Gromov-Hausdorff sense to an interval of finite length I and that (f i ) i converge in L ∞ (I) to some function f . Figure 4: Starting from a tree T a/2 k (black) we construct the Dyck path around it in the first step. Then, we look at T a/2 k+1 which leads to the addition of intervals (dotted), and a correction of the function at the kth step f k (which is the function depicted in black, extended linearly over the new intervals). We can further define a function by pasting the Dyck paths of the forest over the corresponding leaves, which leads to the function depicted in the second step (red and black).

Detailed construction of the approximants Definition 2.22. Let I ⊂ R + be a marked interval with n marked points, which we will denote (i k ) {1≤k≤n} . Furthermore, let (J k ) {1≤k≤n} be a set of n marked intervals of R + , each with j k marked points. Define σ I :

I → I • (J 1 , • • • J n ) by σ I (x; J 1 , • • • , J n ) :=   x + arg max k {i k <x} i=1 |J i |   ∈ I • (J 1 , • • • , J n ) . (2.44)
Remark 2.23. Fixing J 1 , • • • , J n , σ I is a bijective map onto its image, meaning every point y ∈ σ I (I; J 1 , • • • , J n ) admits a preimage in I, which we will denote by σ -1

I (y; J 1 , • • • , J n ).
Definition 2.24. Let f : I → R be a continuous function from an interval I with n marked points and let (J 1 , • • • , J n ) be intervals with each with j i marked points as before. Abusing the notation, we define another function σ(-; J 1 , • • • , J n ) which assigns a function on I to a function on σ I (I;

J 1 , • • • , J n ) via the following formula σ I (f ; J 1 , • • • , J n )(x) := f (σ -1 I (x; J 1 , • • • , J n )) x ∈ σ I (I; J 1 , • • • , J n ) Linearly extend elsewhere (2.45) Remark 2.25. By continuity of f : I → R, this linear extension on I • (J 1 , • • • , J n ) is in fact constant everywhere outside σ I (I; J 1 , • • • , J n ) (
this is the dotted region in figure 6). Note also that σ

I (f ; J 1 , • • • , J n ) is continuous.
Definition 2.26. Given a tree T f associated to a continuous function f , we define:

• The projection onto the tree as the mapping

π : X → T f = X/{d f = 0} ; (2.46) x → [x]
(2.47)

• Let τ ∈ T f , define the left preimage of τ , ←τ and the right preimage of τ by π, -→ τ as

← -τ := inf π -1 (τ ) (2.48) - → τ := sup π -1 (τ ) .
(2.49) Definition 2.27. Let T be a discrete rooted tree and T ⊂ T be a subtree sharing roots with T and suppose that we have chosen some embedding of T . Suppose there is a function f : I → R on a certain interval I such that T f = T . Then, the marking of I induced by T is the marking induced by marking the preimage π -1 f (T ∩ (T \ T )) chosen in the following way:

• If τ ∈ T ∩ (T \ T ) admits a single preimage, choose this preimage;

• Else, if the connected component of τ in T \ T is smaller (with respect to the partial order on the tree induced by the embedding of T ) than every vertex strictly greater than τ ∈ T , choose ←τ . Otherwise, choose -→ τ . In simpler terms, we choose -→ τ or ←τ depending on whether the subtree of T \ T containing τ branches to the right or to the left respectively of T , with the convention that we say that it branches to the left if lies at the top of a leaf of T (cf. figure 5).

We will denote this marking operation by µ(I; T , T, f ).

Figure 5: A tree T embedded in R 2 with a subtree T in black, the subtrees highlighted in red branch to the right and those in blue to the left.

We can also define analogous maps to σ I , but this time on the intervals J k as follows.

Definition 2.28. Let I ⊂ R + be a marked interval with n marked points, which we will denote (i k ) {1≤k≤n} . Furthermore, let (J k ) {1≤k≤n} be a set of n marked intervals of R + , each with j k marked points. Define η J k I :

J k → I • (J 1 , • • • , J n ) by η J k I (x; J 1 , • • • , J n ) := x + i k + k-1 j=1 |J j | . (2.50)
These maps define a map η I = k η J k I on k J k and η I also induces a map on the functions f : k J k → R, defined analogously to σ I , which we shall also denote η I .

With this notation, the construction is made in accordance to algorithm 2. A depiction of the mechanism of algorithm 2 can be found in figure 6. For an infinite tree, it suffices to show that the sequence generated by this algorithm converges in the Gromov-Hausdorff sense to an interval of finite length I and that (f i ) i converge in L ∞ (I) to some function f .

Algorithm 2: Construction of approximants

Output: A set of unions of intervals (I i ) i∈{1,••• ,n} and a set of functions on I n , (f i :

I n → R) i∈{1,••• ,n}
Input: An infinite tree T and a > 0.

I 1 ← φ(T a ) ; f 1 ← f T a ; I ← I 1 ; i ← 1 ; while i ≤ n do I i+1 := I i • φ λ i (T a/2 i+1 \ T a/2 i ) ; f ← η I i+1 (f λ i+1 T a/2 i+1 \T a/2 i ; I 1 , • • • I i ) ; I i ← µ(I i ; T a/2 i-1 , T a/2 i , f i ) ; for j=1; j ≤ i do I j ← σ(I j ; φ λ i (T a/2 i+1 \ T a/2 i )) ; f j ← σ(f j ; φ λ i (T a/2 i+1 \ T a/2 i )) ; j ← j + 1 ; end f i+1 := f i + f ; i ← i + 1 ; end return (I i ) i∈{1,••• ,n} , (f i ) i∈{1,••• ,n} .
Figure 6: Starting from a tree T a/2 k (black) we construct the Dyck path around it in the first step. Then, we look at T a/2 k+1 which leads to the addition of intervals (dotted), and a correction of the function at the kth step f k (which is the function depicted in black, extended linearly over the new intervals). We can further define a function by pasting the Dyck paths of the forest over the corresponding leaves, which leads to the function depicted in the second step (red and black).

End of the proof

To get the desired convergence we must show the two following lemmata. Lemma 2.29. If T is a compact R-tree of finite upper-box dimension, there exist a and λ such that I defined by the construction above has finite length.

We need to show the convergence of the corresponding functions (f n ) n . This can be done by proving that the sequence is Cauchy. Lemma 2.30. Given the definition of functions f n above, then the sequence (f n ) n∈N * is Cauchy in C 0 (I), we have

f n -f m C 0 ≤ a2 -(n∧m) (2.51)
for any n and m ∈ N * .

By completeness of C 0 , the sequence (f n ) n∈N * uniformly converges to a continuous function f . By virtue of stability theorem for trees (theorem 4.21) it follows that T is isometric to T f . Using Picard's theorem (theorem 3.6)

V(f ) = dim T f = dim T (2.52)
which concludes the proof of theorem 2.19.

Proof of lemma 2.29. Recall that, according to the proof of theorem 3.9, the following equality holds for any tree T lim sup

ε→0 log N ε log(1/ε) ∨ 1 ≤ dim T := α . (2.53)
Unpacking the definition of the lim sup, for any δ > 0 there is a a > 0 such that for all ε < a, we have that

N ε < ε -α-δ . (2.54)
Let us fix such a δ and pick a small enough so that the condition above holds. For any n ∈ N * , the partial composition of intervals has length

|I n | = |φ(T a )| + n k=1 φ λ k (T a/2 k \ T a/2 k-1 ) . (2.55)
However, we can bound φ λ k (T a/2 k \ T a/2 k-1 ) by

φ λ k (T a/2 k \ T a/2 k-1 ) = λ k φ(T a/2 k \ T a/2 k-1 ) ≤ λ k a 2 k (4N a/2 k ) , (2.56)
since on T a/2 k \ T a/2 k-1 the distances between the vertices of each tree are at most a/2 k and there are at most 4N a/2 k such edges by virtue of lemma 2.21. Thus,

φ λ k (T a/2 k \ T a/2 k-1 ) < 4λ k a 2 k 1-α-δ = 4a 1-α-δ 2 α+δ-1 λ k . (2.57)
Setting λ < 2 1-α-δ I n converges to some interval of finite length I, since the partial sums |I n | converge.

Proof of lemma 2.30. Suppose that n < m. It is sufficient to show that on I m the equality holds, since in all further iterations of the algorithm, the functions f n and f m are locally constant over the intervals introduced. By definition of f n , f n and f m agree on I n . Outside of this set, f n is constant and the difference in the L ∞ -norm depends only on what happens above T a/2 n , thus we can write

f n -f m L ∞ ≤ f T a/2 m \T a/2 n L ∞ (2.58)
by definition of f n . However, the Dyck path on T a/2 m \ T a/2 n can at most reach a height of a(2 -n -2 -m ) < a2 -n , which finishes the proof.

3 Regularity, persistence index and metric properties of trees Throughout this section X will be a compact, connected and locally path-connected metric space. On general topological spaces, it is important to specify which homological theory we are using to compute the homology of X. For nice enough spaces, this choice has little to no importance, as most homological theories coincide. However, for abstract metric spaces this is no longer necessarily the case. For our purposes, we will always consider the homology of the space X to be its Čech homology. A priori, this might pose some problems, as Čech homology does not always satisfy the axioms of a proper homological theory in the sense of Eilenberg-Steenrod. For this to be the case, a sufficient condition is to consider X to be compact and the homology to be taken over a field. These are not the only conditions for which Čech homology gives rise to a proper homological theory, as in general the exactness axiom might fail, but suffices for our purposes. For more on these technical details, we encourage the reader to consult Eilenberg's book [START_REF] Eilenberg | Foundations of Algebraic Topology[END_REF]Chapter 7].

Remark 3.1. If we wish to consider higher degrees of homology over even more general topological spaces where the exactness axiom does indeed fail for the Čech homology, there are multiple options. We could either consider more elaborate homology theories such as singular homology or strong homology (which fixes the issue with the exactness axiom of Čech homology), or we could rewrite this paper in cohomological terms and use Čech cohomology, for which this problem doesn't present itself.

With this technicality out of the way, let us now define the main objects which will concern us for the rest of this paper. Definition 3.2. Let X be a compact, connected, locally path connected topological space and consider f : X → R be a continuous function. The kth Pers p -functional of f is

Pers p (H k (X, f )) :=   b∈H k (X,f ) (b ∩ [inf(f ), sup(f )]) p   1/p , (3.59)
where (b) denotes the length of the bar b and H k (X, f ) denotes the H k -barcode (or diagram) stemming from the superlevel filtration. Abusing the notation, we will denote Pers p (f ) := Pers p (H 0 (X, f )). If we further assume that there exists n such that for all m > n, H m (X) = 0, we define the total Pers p functional of f as

TPers p (f ) := n k=0 Pers p (H k (X, f )) . (3.60) Definition 3.3. Let f : X → R be a continuous function. The kth-persistence index of f is defined as L k (f ) := inf{p ≥ 1 | Pers p (H k (X, f )) < ∞} . (3.61)
We will sometimes write L(f ) := L 0 (f ). Provided that higher degrees of homology identically vanish, we may also talk about the total persistence index of f , defined as

L T ot (f ) := inf{p ≥ 1 | k Pers p (H k (X, f )) < ∞} . ( 3
f p-var :=   sup D t k ∈D |f (t k ) -f (t k-1 )| p   1/p , (3.63)
where the supremum is taken over all finite partitions D of the interval [0, 1].

Remark 3.5. We talk about true p-variation to make the distinction with the notion of variation typically considered in probabilistic contexts (more precisely, stochastic calculus), where instead of the supremum over all partitions, we have a probable limit as the mesh of the partition considered tends to zero.

Proposition 3.6 (Picard, §3 [START_REF] Picard | A tree approach to p-variation and to integration[END_REF]). Let f : [0, 1] → R be a continuous function, then f p-var is finite as soon as Pers p (f ) is finite. In fact, for any p

f p p-var ≤ 2 Pers p p (f ) p . (3.64)
Furthermore, if f (p-δ)-var is finite for some δ > 0, Pers p (f ) is also finite.

In fact, Picard showed that on the interval [0, 1], the persistence index of f is linked to the regularity of f . Theorem 3.7 (Picard, §3 [START_REF] Picard | A tree approach to p-variation and to integration[END_REF]). Let f : [0, 1] → R be a continuous function and denote

V(f ) := inf{p | f p-var < ∞} . (3.65)
Then,

V(f ) = L(f ) = lim sup ε→0 log(λ(T ε f )/ε) log(1/ε) + 1 = lim sup ε→0 log N ε log(1/ε) ∨ 1 = dim T f (3.66)
where a ∨ b := max{a, b}, N ε is the number of leaves of the ε-trimmed tree T ε f , λ(T ε f ) denotes the length of T ε f and dim denotes the upper-box dimension.

Remark 3.8. More generally, we can define λ as the unique atomless Borel measure on T f characterized by the fact that the measure of a geodesic is given by the length of the geodesic [START_REF] Picard | A tree approach to p-variation and to integration[END_REF].

3.2 More general spaces 3.2.1 Connected, locally path-connected, compact topological spaces Theorem 3.9. Let X be a connected, locally path-connected, compact topological space and let f : X → R be a continuous function. With the same notation as above and supposing that dim T f is finite, the following chain of equalities holds

L(f ) = lim sup ε→0 log N ε log(1/ε) ∨ 1 = lim sup ε→0 log(λ(T ε f )/ε) log(1/ε) + 1 = dim T f . (3.67) Furthermore, lim inf ε→0 log N ε log(1/ε) ∨ 1 ≤ dim T f ≤ lim inf ε→0 log(λ(T ε f )/ε) log(1/ε) + 1 , (3.68)
where dim is the lower-box dimension. For dim T f > 1, these inequalities turn into equalities if either:

lim sup ε→0 N 2ε N ε < 1 or lim sup ε→0 λ(T 2ε f ) λ(T ε f ) < 1 . (3.69)
Remark 3.10. The study of N ε is in fact completely equivalent to the study of Pers p p (f ). Indeed,

Pers p p (f ) = p ∞ 0 ε p-1 N ε dε , (3.70)
which is finite as soon as p > L(f ). This is nothing other than the Mellin transform of N ε . By the Mellin inversion theorem, for any c > L(f ), we have

N ε = 1 2πi c+i∞ c-i∞ Pers p p (f ) ε -p dp p . ( 3

.71)

Proof of theorem 3.9. By the procedure detailed in section 2.3, since dim T f is finite we can construct a function f : [0, 1] → R such that T f and T f are isometric. Applying Picard's theorem to T f and noting that L(f ) depends only on the T f , we have that

L(f ) = lim sup ε→0 log(λ(T ε f )/ε) log(1/ε) + 1 = lim sup ε→0 log N ε log(1/ε) ∨ 1 = dim T f . (3.72)
Let us now show the inequalities for the lim inf. Since

λ(T ε f ) = ∞ ε N a da , (3.73)
the following inequality holds lim inf

ε→0 log N ε log(1/ε) ∨ 1 ≤ lim inf ε→0 log(λ(T ε f )/ε) log(1/ε) + 1 . (3.74) Additionally, N ε ≤ N (ε/2) (3.75)
where N (ε) denotes the minimal number of balls of radius ε necessary to cover T f . This inequality holds as above each leaf of T ε f , at least one ball of radius ε 2 is necessary to cover this section of the tree. It follows that lim inf

ε→0 log N ε log(1/ε) ∨ 1 ≤ dim T f . (3.76)
We can bound this minimal number of balls N (ε) by the following

N (ε) ≤ N ε/2 + λ(T ε/2 f ) ε/2 ≤ 2 N ε/2 ∨     λ(T ε/2 f ) ε/2     , (3.77)
which holds since, at most N ε balls are needed to cover T f \ T ε f . To cover T ε f , at most: λ(T ε/2 f )/(ε/2) balls are needed, so the inequality above follows by further majorizing the terms. This implies that

dim T f ≤ lim inf ε→0 log N ε log(1/ε) ∨ 1 ∨ lim inf ε→0 log(λ(T ε f )/ε) log(1/ε) + 1 , (3.78)
but by inequality 3.76 this means that

dim T f ≤ lim inf ε→0 log(λ(T ε f )/ε) log(1/ε) + 1 . (3.79) Finally, λ(T ε f ) -λ(T 2ε f ) ε = 1 ε ∞ ε N a da - ∞ 2ε N a da = 1 ε 2ε ε N a da ≤ N ε , (3.80)
since N ε is monotone decreasing. This reasoning also gives a lower bound

N 2ε ≤ λ(T ε f ) -λ(T 2ε f ) ε ≤ N ε , (3.81)
which entails that lim inf

ε→0 log N ε log(1/ε) = lim inf ε→0 log λ(T ε f )-λ(T 2ε f ) ε log(1/ε) . (3.82)
Suppose that this limit is larger than 1. Rearranging, we get

εN 2ε λ(T ε f ) ≤ 1 - λ(T 2ε f ) λ(T ε f ) ≤ εN ε λ(T ε f ) , (3.83)
from which it follows that if any of these quantities admits a lim inf which is stricly greater than zero, we have lim inf

ε→0 log N ε log(1/ε) = lim inf ε→0 log λ(T ε f ) log(1/ε) + 1 . (3.84)
Noticing another equivalent condition for the validity of this equality is whether

lim sup ε→0 N 2ε N ε < 1 , (3.85)
finishes the proof.

Remark 3.11. If dim = dim, all the limits of the above theorem are well-defined, yielding exact asymptotics for λ(T ε f ) and N ε . This is in particular the case if dim = dim H , where dim H denotes the Hausdorff dimension.

The functional λ(T ε f

) is what some authors [START_REF] Polterovich | Persistence barcodes and Laplace eigenfunctions on surfaces[END_REF][START_REF] Polterovich | Topological Persistence in Geometry and Analysis[END_REF] refer to as the Banach indicatrix and its asymptotics have a topological interpretation as described in the statement of the theorem. It is interesting to note that the study of the upper-box dimension is natural in the tree approach. Additionally, dim has also been used in the context of persistent homology by Schweinhart [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF], Schweinhart and MacPherson [START_REF] Macpherson | Measuring shape with topology[END_REF] and by Adams et al. [START_REF] Adams | A fractal dimension for measures via persistent homology[END_REF] in a probabilistic setting.

LLC metric spaces

It is possible to further extend Picard's theorem by some rudimentary considerations and by imposing the so-called locally linearly connected condition on X. Let us briefly recall the definition of this condition. Definition 3.12. A locally linearly connected (LLC) metric space (X, d), is a connected metric space such that for all r > 0 and for all z ∈ X, for all x, y ∈ B(z, r), there exists an arc connecting x and y such that the diameter of this arc is linear in d(x, y).

With this extra assumption, we can prove the following lemmata. Lemma 3.13 (Regularity-dimension). Let X be a compact LLC metric space. Keeping the same notations as in theorem 3.9, the following inequality holds

L(f ) = dim T f ≤ H(f ) dim X , (3.86)
where:

H(f ) := inf 1 α ∃λ ∈ Homeo(X) , f • λ C α < ∞ (3.87)
The proof of this lemma relies itself on two lemmata, which are interesting in and of themselves.

Lemma 3.14. Let X and Y be two metric spaces such that there is a surjective map π :

X → Y such that π ∈ C α (X, Y ), then dim Y ≤ 1 α dim X and dim Y ≤ 1 α dim X .
(3.88) Lemma 3.15. Let X be a compact locally linearly connected (LLC) metric space (cf. definition 3.12) and let f : X → R be a continuous function, then

f ∈ C α (X, R) =⇒ π f ∈ C α (X, T f ) . (3.89)
Let us show that lemmata 3.14 and 3.15 imply lemma 3.13.

Proof of lemma 3.13. If, up to precomposition, f / ∈ C α (X, R) for any α, there is nothing to show, since the statement is vacuous. Otherwise, since T f is preserved by precomposition by a homeomorphism, we may suppose without loss of generality that f ∈ C α (X, R). The projection onto the tree of f , π f : X → T f is in C α (X, T f ) according to lemma 3.15. It follows from lemma 3.14 that dim

T f ≤ 1 α dim X . (3.90)
The statement of the theorem follows by taking the infimum over 1 α .

All that remains to show is the two remaining lemmata.

Proof of lemma 3.14. Since π : X → Y is surjective and

C α (X, Y ), for any x ∈ X π B X x, ε K 1/α ⊂ B Y (π(x), ε) (3.91)
for some constant K. It follows that the minimal number of balls needed to cover X, N X dominates the minimal number of balls needed to cover Y , N Y . More precisely

N Y (ε) ≤ N X ε K 1/α ⇐⇒ α N Y (ε) log(1/ε) + log(K) ≤ N X ε K 1/α log K ε 1/α .
The statement of the lemma follows.

Proof of lemma 3.15. Suppose that f : X → R is in C α (X, R) with Hölder constant Λ and let x, y ∈ X. Without loss of generality, suppose that f (x) < f (y). Since T f is a geodesic space, the distance d f (π f (x), π f (y)) is the length of the geodesic arc in T f linking π f (x) and π f (y). By compactness of this geodesic path, there is a point τ ∈ T f where f achieves its minimum, thus

d f (π f (x), π f (y)) = f (x) -f (τ ) + f (y) -f (τ ) . (3.92)
This minimum f (τ ) has the particularity that

f (τ ) = sup γ:x →y inf t∈[0,1] f • γ , (3.93)
where the supremum is taken over all paths on X linking x and y. From the LLC condition, we know that there is a path η : x → y whose diameter is controlled by d X (x, y) and z ∈ X achieving the minimum of f over η. In particular,

f (τ ) ≥ inf t∈[0,1] f • η =: f (z) . (3.94) Since f is α-Hölder on X, f (x) -f (τ ) ≤ f (x) -f (z) ≤ Λ d(x, z) α ≤ Λ diam(η) α ≤ CΛ d(x, y) α (3.95)
for some constant C determined by the LLC condition and we have an analogous inequality for f (y) -f (τ ). Putting everything together we have that:

d f (π f (x), π f (y)) ≤ 2CΛ d X (x, y) α , (3.96)
which finishes the proof.

Lemma 3.13 is sharp, since Brownian sample paths almost surely saturate this inequality. However, there is no hope to prove equality for every f . Indeed, for any f ∈ C 1 (T 2 , R) having a finite amount of bars, T f is a finite tree and has upper-box dimension 1, but

dim T f = 1 < 2 = H(f ) dim T 2 .
(3.97) Nonetheless, it is possible to show that lemma 3.13 holds generically. This is a consequence of a generalization of work never published by Weinberger and Baryshnikov. We extend their result to homogenous enough spaces in the following sense.

Definition 3.16. A metric space (X, d) is said to admit a homogeneous set (for a certain property) if there exists an open set U ⊂ X where for every ball B(x, r) ⊂ U , the property of the ball is the same as the property of the space X.

Remark 3.17. In the previous definition, one can for instance take any notion of dimension, entropy, etc.

The following proposition will be useful in simplifying the assumptions of the theorem.

Proposition 3.18. Let (X, d) be a compact metric space and N P (ε) denote the cardinality of the maximal packing of X by balls of radius ε. Then,

N X (2ε) ≤ N P (ε) ≤ N X (ε) (3.98)
and in particular,

dim(X) = lim inf ε→0 log(N P (ε)) log(1/ε) and dim(X) = lim sup ε→0 log(N P (ε)) log(1/ε) . (3.99)
Proof. Let M ε be a maximal packing of X by balls of radius ε. For every x ∈ X \ (∪ V ∈Mε V ) there exists U ∈ M ε such that d(x, U ) ≤ ε, otherwise, B(x, ε) ∪ M ε would also be a packing of X with cardinality strictly greater than |M ε |. It follows that the balls of radius 2ε of centers that of the maximal packing of radius ε is a covering of X, proving the first inequality.

For the second inequality, we reason by contradiction. Suppose there is a maximal packing P ε and a minimal covering C ε such that |P ε | ≥ |C ε | + 1. Then, since C ε covers X, by the pigeonhole principle there are at least two centers of balls of P ε inside a ball of C ε . But the triangle inequality implies that the balls around these two centers of radius ε have non-empty intersection (as the center of the ball of C ε in which they are contained is in the intersection), thereby contradicting that P ε is a packing, showing the result. Theorem 3.19. Let X be a compact LLC space admitting a set of homogeneous upper-box dimension, then for any 0

< α ≤ 1 sup f ∈C α (X,R) αL(f ) = dim(X) . (3.100)
Moreover, the supremum is attained generically in the sense of Baire, i.e. the set over which αL(f

) < dim(X) is meagre in C α (X, R).
Once again, we split the proof along key lemmata.

Lemma 3.20. Let X be a compact LLC space, then the functional Pers p p,ε :

C α Λ (X, R) → R + defined by f → b∈B(f ) (b)≥ε (b) p (3.101) is continuous.
Proof. We start by noting that the total number of bars of length ≥ ε that a function f ∈ C α Λ (X, R) can have is uniformly bounded above by virtue of the proof of lemma 3.14 by a constant C X,α,ε . By lemma 3.15, we know π f : X → T f is α-Hölder, with Hölder constant K depending only on Λ and X. This fact, combined with the inequality N ε f ≤ N T f (ε/2) entails that for any f ,

N ε f ≤ N T f (ε/2) ≤ N X ε 2K 1/α =: C X,α,ε . (3.102)
It follows that for any f, g ∈ C α Λ (X, R), by choosing to sum along the d ∞ -matching, we have

Pers p p,ε (f ) -Pers p p,ε (g) ≤ b f ∈B(f ) , bg∈B(g) (b f ), (bg)≥ε | (b f ) p -(b g ) p | ≤ p | (b f ) -(b g )| ≤ f -g ∞ by stability max{ (b f ) p-1 , (b g ) p-1 } ≤ p f -g ∞ max{ (b f ) p-1 , (b g ) p-1 } ≤C X,α,ε Λ p-1 diam(X) α(p-1) by global α-Hölderness ≤ C X,α,ε Λ p-1 diam(X) α(p-1) p f -g ∞ .
Lemma 3.21. Let X be a compact, LLC, admitting a set of homogeneous lower-box dimension.

Then, for all p < dim(X) and M ≥ 0, the set of functions

{f ∈ C α (X, R) | Pers p p (f ) > M } (3.103) is dense in C α (X, R).
Proof. Without loss of generality, suppose that the uniform set is a ball of radius 1 inside X, denoted B ⊂ X and construct a function h of persistence > M on this ball. Noting d = dim(X), by proposition 3.18 and the definition of the upper-box dimension, for some subsequence of (ε n ) n decreasing to 0, we have Cε

-(d-δ) n ≤ N P (ε) ≤ Cε -(d+δ) n (3.104)
for some constants C and C. Note E ε the centers of the balls of a maximal packing of radius ε and define

h n : B → R as h n (x) := d α (x, E εn ) (3.105)
The Pers p -functional of these functions can be bounded below by

Pers p p (h n ) ≥ N P (ε n )ε p n ≥ Cε pα-d+δ n (3.106)
for all δ > 0. Since αp < d, this quantity can be made as large as we want and in particular > M by picking a large enough n. By the assumptions of the theorem, it is possible to choose the original ball of the construction to have as small a radius as we wish. Note we may perturb any function f ∈ C α (X, R) by a function close to it which is locally constant on a small enough ball and on this ball, add h n for n large enough. Since the ball of the construction can be chosen as small as we want, any neighborhood of f contains a function satisfying the condition of the lemma.

Proof of theorem 3.19. We are interested in showing that for p < dim(X), the set

S(p) := {f ∈ C α (X, R) | Pers p p (f ) < ∞} (3.107)
is meager in C α (X, R). Let us start by noticing that

S(p) = Λ≥0 M ≥0 S(p, Λ, M ) , (3.108)
where the union is taken over an increasing diverging sequences of Λ and M and

S(p, Λ, M ) := {f ∈ C α Λ (X, R) | Pers p p (f ) ≤ M } . (3.109) Furthermore, S(p, Λ, M ) = k≥1 {f ∈ C α Λ (X, R) | Pers p p, 1 k (f ) ≤ M } . (3.110)
By lemma 3.20, Pers p, 1 k is continuous, thereby guaranteeing that these sets are closed in C α (X, R), and therefore so is their intersection. It remains to show that the S(p, Λ, M ) are nowhere dense, but this amounts to finding a dense set of functions for which

Pers p p, 1 k (f ) ≤ M (3.111)
is violated for infinitely many k. It suffices to find a dense set of functions for which the total Pers p p (f ) > M (for p < dim(X)), but the existence of such a dense family is given by lemma 3.21, showing the result.

Remark 3.22. The space defined by

E p = {f ∈ C 0 (X, R) | L(f ) ≤ p} (3.112)
is not a linear space.

Doubling spaces with small convex balls

One could ask whether the results of genericity of theorem 3.19 hold in every degree of homology for f within some class of regularity. This question has been considered in [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF] and more recently in [START_REF] Skraba | Wasserstein stability for persistence diagrams[END_REF] with different degrees of generality. The following theorem is a slight generalization of the two cited results. Theorem 3.23. Let X be a compact, connected geodesic doubling space whose small enough balls are geodesically convex. Denote d = dim(X), k ∈ N and let f ∈ C α (X, R), then L k (f ) ≤ d α .

Remark 3.24. The doubling assumption is satisfied for Riemannian manifolds whose Ricci curvature is bounded below, by the Bishop-Gromov inequality. By considering Gromov-Hausdorff limits of Riemannian manifolds with Ricci curvature bounded below, we obtain spaces satisfying the doubling property. Spaces included in this class include, but are not limited to, Riemannian manifolds with conic singularities. In general, it is also possible to obtain less well-behaved spaces. For more on poorly behaved examples, we refer the reader to the works of Xavier Menguy [START_REF] Menguy | Examples of strictly weakly regular points[END_REF][START_REF] Menguy | Examples of manifolds and spaces with positive Ricci curvature[END_REF] and to even more recent and poorly behaved examples, such as those described in [START_REF] Jiang | Manifolds of positive ricci curvature with quadratically asymptotically nonnegative curvature and infinite topological type[END_REF].

The proof relies on the two following well-known lemmata.

Lemma 3.25 (Nerve lemma, Lemma 4.11 [START_REF] Oudot | Persistence Theory -From Quiver Representations to Data Analysis[END_REF]). Let X be a paracompact space, and let U be an open cover of X such that the (k + 1)-fold intersections of elements of U are either empty or contractible for all k ∈ N. Then, there is a homotopy equivalence between the nerve of U and X.

Lemma 3.26. Let (X, d) be a geodesic metric space whose balls of radius ≤ ε are geodesically convex. Then, minimal coverings of X by balls of radius ≤ ε are such that the (k + 1)-fold intersections of elements of U are either empty or contractible for all k ∈ N.

Proof of theorem 3.23. The proof is an immediate consequence of the proof of theorem 3.19, where we only need to modify the proof of lemma 3.20. For this, it is sufficient to bound the number of bars in the persistence diagram of the kth degree in homology of length ≥ ε, N ε k . On a given a minimal covering U of X by balls of radius

ε 4 f C α 1/α
, f varies by at most ε 2 inside each ball. Given any r ∈ R, construct the set U r consisting in the union of all balls of U which intersect X r . From this, we get a chain of inclusions

X r - → U r - → X r-ε , (3.113)
which induces a chain of maps at the homology level. In particular, by functoriality of

H * , rank(H * (X r → X r-ε )) ≤ rank(H * (X r → U r )) ∨ rank(H * (U r → X r-ε )) ≤ dim(H * (U r )) ,
but for small enough ε, the covering's homology is the homology of its nerve by lemmas 3.25 and 3.26 so this dimension is bounded above by the cardinality of the nerve. It follows that N ε k is bounded above by the cardinality of the k-skeleton of the nerve of such a minimal covering. Since the space is doubling, this yields the upper bound

N ε k ≤ (M k+1 -M k ) N X ε 4 f C α 1/α , (3.114)
where M is the doubling constant of X. The rest of the proof follows from previous arguments without extra difficulty.

Remark 3.27. If the space is not supposed to be doubling, the only bound we have on N ε k is given by N k+1 X , which yields an analogous statement for L k (f ) ≤ d(k+1) α . Under a supplementary assumption, we can show that the inequality obtained in theorem 3.23 is in fact generically an equality. As before, the genericity result relies on the existence of functions whose Pers p functional for p < d α is arbitrarily large. For this we rely on the following theorem of Divol and Polonik.

Theorem 3.28 (Divol and Polonik, [START_REF] Divol | On the choice of weight functions for linear representations of persistence diagrams[END_REF]). Let µ be a bounded probability measure on [0, 1] d and let X n := (X 1 , • • • , X n ) be a vector of i.i.d. samples of µ, then for 0 < p < d and 0 ≤ k < d then almost surely,

lim n→∞ n -1+ p d Pers p p (H k ([0, 1] d , d(-, X n )) → Pers p p (ν µ p ) , (3.115)
for some non-degenerate Radon measure depending on p and the probability measure µ, ν µ p on X .

With this result we are now ready to prove the following theorem. Theorem 3.29. Let X be a compact Riemannian manifold of dimension d. Then, generically in the sense of Baire in C α (X, R), for any 0

≤ k < d, L k (f ) = d α .
Proof. The proof of genericity is essentially the same as that of theorem 3.19, with the exception that we now need to modify lemma 3.21. The existence of a function h with arbitrarily large Pers p -functional for p < d α on any small ball is given by Divol and Polonik's construction by tweaking the filtration in their proofs from being the distance d to d α . As before, this entails the genericity result for the set of functions of C α satisfying L k (f ) ≥ d α . Compact Riemannian manifolds have strictly positive convexity radii and Ricci curvature bounded below, and so satisfy the hypotheses of theorem 3.23, applying the theorem yields the desired equality.

A partial answer to a question by Schweinhart

In [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF], Schweinhart introduces a notion of persistent homology dimension of a metric space X, defined as follows.

Definition 3.30 (Schweinhart's definition of dim k PH , [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF]). Let X be a bounded subset of a metric space. The kth homological dimension of X is

dim k PH (X) := sup x inf p {Pers p (H k (X, d(-, x))) < ∞} , (3.116)
where the supremum is taken over all finite sets of points x of X.

Given our previous results, we suggest the following modification to this definition, for reasons which will become apparent later. Definition 3.31 (kth homological dimension of X). Let X be a bounded subset of a metric space. The kth homological dimension of X is defined as

dim k PH (X) := sup f ∈Lip 1 (X) L k (f ) , (3.117)
where Lip 1 (X) denotes the set of Lipschitz functions with Lipschitz constant ≤ 1.

Theorem 3.23 already allows us to partially answer Schweinhart's Question 5 [START_REF] Schweinhart | Persistent homology and the upper box dimension[END_REF]. However, this is not a complete answer, because one should make sure that there are Lipschitz functions on X on the class of metric spaces as those of those of theorem 3.23 such that the inequality L k (f ) ≤ d is saturated, or saturated to within δ for all δ > 0. Without the assumption that X is doubling, an interesting question is whether the bound found is optimal: the proof of the theorem suggests that if such metric spaces exist, they cannot be of "bounded geometry" and are relatively pathological.

As we saw in theorem 3.29, this bound is saturated for any integer 0 ≤ k < dim(X) under the assumption that X is a compact manifold. Thereby entailing

dim k PH (X) = dim(X) (3.118)
for such X. Here, the notions of homological dimension of Schweinhart and our own coincide exactly, as the genericity result is proven via distance functions to point clouds. This thus establishes sufficient conditions for this equality to hold, albeit not necessary ones.

4 Distance notions and stability properties of trees and diagrams 4.1 Some elements of optimal transport

Defining optimal partial transport

Let us follow the exposition by Divol and Lacombe [START_REF] Divol | Understanding the topology and the geometry of the persistence diagram space via optimal partial transport[END_REF], and quickly introduce optimal partial transport, which extends optimal transport to measures of a priori different masses (which may be potentially infinite), for a detailed account of the theory, we refer the reader to the cited article, but also to the works of different authors [START_REF] Chizat | Unbalanced optimal transport: Dynamic and kantorovich formulation[END_REF][START_REF] Figalli | The optimal partial transport problem[END_REF][START_REF] Kondratyev | A new optimal transport distance on the space of finite Radon measures[END_REF]. Divol and Lacombe build on the work of Figalli [START_REF] Figalli | A new transportation distance between non-negative measures, with applications to gradients flows with dirichlet boundary conditions[END_REF] and extend Wasserstein distances to Radon measures supported on open proper subsets X of R n , whose boundary is denoted by ∂X (and X := X ∂X ). The general idea is that we should look at ∂X as a reservoir of infinite mass, capable of accomodating for any disparity in the mass of the measures considered. In this way, if two Radon measures µ and ν have different mass, we can form still define a transport map from one measure to the other by sending the mass surplus to the boundary ∂X . Symbolically,

Definition 4.1. [33, Problem 1.1] Let p ∈ [1, +∞). Let µ, ν be two Radon measures supported on X satisfying X d(x, ∂X ) p dµ(x) < +∞, X d(x, ∂X ) p dν(x) < +∞.
The set of admissible transport plans Γ(µ, ν) is defined as the set of Radon measures π on X × X satisfying π(A × X ) = µ(A) and π(X × B) = ν(B).

for all Borel sets A, B ⊂ X . Furthermore, the cost of π ∈ Γ(µ, ν) is defined as

C p (π) := X ×X d(x, y) p dπ(x, y). (4.119)
The optimal transport distance d p (µ, ν) is defined as

d p (µ, ν) := inf π∈Γ(µ,ν) C p (π) 1/p . (4.120)
Plans π ∈ Γ(µ, ν) realizing the infimum in equation 4.120 are called optimal.

Definition 4.2. The space of Radon measures on X will be denoted D(X ) (or simply D if X is clear from context). We also introduce the following spaces

D p := µ ∈ D X d p (x, ∂X ) dµ(x) < ∞ . (4.121)
We further define D ∞ as the space of Radon measures with compact support.

Remark 4.3. A proof by Théo Lacombe shows that for optimal partial transport distances d p also satisfy

d p p→∞ ---→ d ∞ . Indeed, for any π ∈ Γ(µ, ν) C p (π) p→∞ ---→ C ∞ (π) (4.122)
The space Γ(µ, ν) is sequentially compact [24, Proposition 3.2], so up to extraction of a subsequence, (π p ) p admits a limit π ∞ . Finally, if π * is an optimal transport for the cost function

C ∞ , then C ∞ (π * ) = lim p→∞ C p (π * ) ≥ lim p→∞ C p (π p ) = C ∞ (π ∞ ) , (4.123)
so π ∞ also achieves inf π C ∞ (π), showing the desired result.

When considering optimal partial transport, there may be complications with respect to the conventional theory of optimal transport, because the measures may have infinite mass. This poses some problems, among others because of the unavalaibility of Jensen's inequality, which may render certain results of the classical theory false, or require alternative proofs. Luckily, most classical results we will need can be adapted to this more general setting.

Some results on optimal transport distances

To distinguish the theory of optimal transport from that of optimal partial transport, let us introduce the following notation. Notation 4.4. Let (X, δ) be a Polish metric space. Denote P(X) (or simply P is X is clear from context) the set of probability measures on X and define

P p (X) := µ ∈ P X δ p (x, x 0 ) dµ(x) < ∞ (4.124)
for some x 0 ∈ X (note that this definition does not depend on x 0 ). Once again, we may omit X if it is clear from context. For any two measures µ, ν ∈ P(X), slightly abusing then notation, we may define the space of transport maps Γ(µ, ν) to be the space of probability measures on X 2 having marginals µ and ν. We equip the space P p (X) with a Wasserstein distance, defined as

W p,δ (µ, ν) := inf π∈Γ(µ,ν) δ L p (π) . (4.125)
For the rest of this paper, the distance indicated by W will always reserved to classical Wasserstein distances between probability measures, whereas the distance denoted d p will always refer to the notion of Wasserstein distances between general Radon measures, previously described in the context of optimal partial transport. Many statements are valid whether we are in the optimal transport or the optimal partial transport setting. For this reason, we introduce the following generic notation along with the following dictionary to transpose statements to one setting or another.

Generic notation Optimal transport

Optimal partial transport (Y, d) (X, δ) (X , d) ∂Y x 0 ∈ X ∂X OT p W p,δ d p M(Y ) P(X) D(X ) M p (Y ) P p (X) D p (X )
Table 1: Dictionary between optimal and optimal partial transport.

Proposition 4.5. For any 1 ≤ p < ∞, OT p p is convex, in the sense that for every µ 1 , µ 2 , ν ∈ M p and t ∈ [0, 1],

OT p p (tµ 1 + (1 -t)µ 2 , ν) ≤ t OT p p (µ 1 , ν) + (1 -t) OT p p (µ 2 , ν) . (4.126) Moreover, if ν 1 , ν 2 ∈ M p , OT p p (tµ 1 + (1 -t)µ 2 , tν 1 + (1 -t)ν 2 ) ≤ t OT p p (µ 1 , ν 1 ) + (1 -t) OT p p (µ 2 , ν 2 ) . (4.127)
Proof. For every

π i ∈ Γ(µ i , ν), tπ 1 + (1 -t)π 2 ∈ Γ(tµ 1 + (1 -t)µ 2 , ν), so OT p p (tµ 1 + (1 -t)µ 2 , ν) ≤ t Y 2 d(x, y) p dπ 1 (x, y) + (1 -t) Y 2 d(x, y) p dπ 2 (x, y) , (4.128)
which yields the result by taking the infimum over π 1 and π 2 on the right-hand side. The second convexity result is obtained by an analogous proof.

Remark 4.6. Convexity does not hold for p = ∞. By taking the 1 p -th power of both sides and letting p → ∞ in the inequality above, all that we may conclude is that

OT ∞ (tµ 1 + (1 -t)µ 2 , ν) ≤ max{OT ∞ (µ 1 , ν), OT ∞ (µ 2 , ν)} . (4.129)
Theorem 4.7 (OT p for p = ∞, [START_REF] Givens | A class of Wasserstein metrics for probability distributions[END_REF]). The distance obtained on M ∞ (Y ) from OT p by taking p → ∞ is well-defined and coincides with the distance defined by

OT ∞ (µ, ν) = inf π∈Γ(µ,ν) d L ∞ (π) . (4.130) Furthermore, we have the following characterization of OT ∞ OT ∞ (µ, ν) = inf {r > 0 | ∀U ⊂ Y open, µ(U ) ≤ ν(U r ) and ν(U ) ≤ µ(U r )} , (4.131)
where U r denotes an open tubular neighborhood of radius r around U .

Remark 4.8. The topology of OT ∞ is finer than that of weak convergence.

Proposition 4.9. Let f : (Y, δ) → (Y , δ ) be an α-Hölder map with Hölder constant Λ and let µ, ν ∈ P(Y ) then

W p,δ (f µ, f ν) ≤ Λ W α pα,δ (µ, ν) . (4.132)
Proof. The inequality is an immediate consequence of the Hölder continuity of f .

Persistence measures

Coming back to persistence theory, recall that it is possible to see persistence diagrams as measures on

X := {(x, y) ∈ R 2 | y > x} . (4.133)
Henceforth, X will always refer to this half space. Seen as measures, persistence diagrams are nothing other than a sum of Dirac measures. Closing this space with respect to the topology of vague convergence, we retrieve the set of Radon measures on X .

Definition 4.10. The set of persistence measures D is the set of Radon measures (of potentially infinite mass) on

X := {(x, y) ∈ R 2 | y > x}.
Equipping X with the ∞ -distance on R 2 defined by

d((p, q), (r, s)) = max{|p -r| , |q -s|} , (4.134)
optimal partial transport distances d p between persistence measures become definable. The repercussions of this have been explored by Divol and Lacombe in [START_REF] Divol | Understanding the topology and the geometry of the persistence diagram space via optimal partial transport[END_REF].

The extension from the space of persistence diagrams to the space of persistence measures has three main advantages. First, that, as shown in [START_REF] Divol | Understanding the topology and the geometry of the persistence diagram space via optimal partial transport[END_REF], it is possible to use the machinery of optimal transport to address problems in persistence theory. Second, that D is a linear space, which renders taking means and combinations of diagrams possible and easy. Finally, that it is well-adapted to the stochastic setting, because of the linearity property and Tonelli's theorem: two key properties which we will exploit repeatedly.

Remark 4.11. The notion of average as defined in the linear space of persistence measures in general exits the space of persistence diagrams. This can for instance be seen by considering a sequence of measures which vaguely tend to a measure which is absolutely continuous with respect to the Lebesgue measure on X . In this case, it is impossible to reconstruct a function whose diagram agrees with the desired measure. This is obvious in the 1D case where it is impossible to construct any tree from such a persistence measure, and so by extension, to construct any function. Nonetheless, this notion of average has the advantage of encoding the averages of all linear functionals of the diagrams (one can in fact see this as a definition of this notion of average by adopting a dual point of view). Some authors have considered alternative notions of central tendencies adapted to metric spaces (and in particular the space of diagrams), such as Fréchet means defined on the spaces of diagrams (cf. for instance the work of Turner et al. [START_REF] Turner | Fréchet means for distributions of persistence diagrams[END_REF]). While this notion stays in the space where persistence diagrams are defined, it depends on the distance chosen on D and moreover also on the exponent chosen for the cost function in the definition of Fréchet means.

Stability of Wasserstein p-distances on diagrams

With respect to optimal transport distances, we have some "stability theorems" the most classical of which is Theorem 4.12 (Bottleneck stability with respect to L ∞ , Corollary 3.6 [START_REF] Oudot | Persistence Theory -From Quiver Representations to Data Analysis[END_REF]). Let f, g : X → R be two continuous functions, then

d ∞ (Dgm(f ), Dgm(g)) ≤ f -g ∞ (4.135)
where Dgm(f ) and Dgm(g) denote the diagrams of f and g respectively.

Theorem 4.13 (Wasserstein p stability). Let X be a compact LLC metric space of dim(X) = d and consider f, g ∈ C α Λ (X, R). Then, for all p > q > d α ,

d p p (H 0 (X, f ), H 0 (X, g)) ≤ C X,Λ,α f -g p-q ∞ . (4.136)
If X is further assumed to be geodesic and is such that small enough balls of X are geodesically convex, then for every k ∈ N * , and all p > q > d(k+1)

α d p p (H k (X, f ), H k (X, g)) ≤ C X,Λ,α,k f -g p-q ∞ . (4.137)
Finally, if X is further supposed to be doubling, then the inequality above holds for all p > q > d α .

Proof. The first part of the proof is essentially as in [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF]. Start by picking the bottleneck matching between the diagrams of f and g and denote it by γ : Dgm(f ) → Dgm(g). Then for any p > q > d α ,

d p p (Dgm(f ), Dgm(g)) ≤ b∈Dgm(f ) d X ,∞ (b, γ(b)) p ≤ f -g p-q ∞ b∈Dgm(f ) d X ,∞ (b, γ(b)) q ≤ 2 q f -g p-q ∞ b∈Dgm(f ) d X ,∞ (b, ∆) q + d X ,∞ (γ(b), ∆) q
= 2 q f -g p-q ∞ (Pers q q (f ) + Pers q q (g))

But both Pers q q (f ) and Pers q q (g) are bounded above by a global constant for the class C α Λ (X, R), since by the proof of lemma 3.20

N ε f ≤ N X ε 2CΛ 1/α , (4.138)
where C is a constant stemming from the quantitative LLC condition on X. This inequality entails that

Pers q q (f ) = q ∞ 0 ε q-1 N ε f dε ≤ q Λ diam(X) α 0 ε q-1 N X ε 2CΛ 1/α dε = (2CΛ) q αq diam(X) (2C) 1/α 0 ε qα-1 N X (ε) dε ,
which is finite as soon as q > d α since N X (ε) = O(ε -d-δ ) as ε → 0 for all δ > 0, by definition of the upper-box dimension. The constant in the statement of the theorem is bounded above by the above estimate. The statements for with the supplementary assumptions of the theorem, the proof follows from the same reasononing by using the proof of theorem 3.23 and remark 3.27 Remark 4.14. More generally, the proof of the theorem adapts with ease to accomodate any compact set of C 0 (X, R) admitting a global modulus of continuity dominated by a Hölder modulus of continuity. It is worth mentioning that such a theorem is impossible to prove for any regularity strictly worse than Hölder, as in such a class of regularity, there are functions f of infinite persistence index, so the theorem is vacuous.

Wasserstein stability results are common in the literature and are typically stated by making the following assumption on the underlying metric space X. Definition 4.15. [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF] A metric space X implies bounded q-total persistence if, for all k ∈ N, there exists a constant C X that depends only on X such that Pers q q (H k (X, f )) < C X (4.139)

for every tame function f with Lipschitz constant Lip(f ) ≤ 1.

The regime of validity of Wasserstein stability thus depends solely on this condition on X. We can thus see theorem 4.13 as a theorem giving explicit bounds on the q such that X implies bounded q-total persistence (in fact, it does so for every degree in homology independently). Following [START_REF] Cohen-Steiner | Lipschitz functions have L pstable persistence[END_REF], it follows clearly from the proof of Wasserstein stability that this definition implies bounded persistence stability for Lipschitz functions. Corollary 4.16. Let X be a compact LLC metric space of dim(X) = d. Then, for all f ∈ Lip 1 (X) and p > q > d α ,

Pers q q (H 0 (X, f )) ≤ (2CΛ) q q diam(X) 2C 0 ε q-1 N X (ε) dε . (4.140)
If X is further assumed to be geodesic and is such that small enough balls of X are geodesically convex, then for every k ∈ N * , and all p > q > d(k+1

) α Pers q q (H k (X, f )) ≤ (2CΛ) q q diam(X) 2C 0 ε q-1 (N X (ε) ∨ K X ) k dε , (4.141)
where K X = N X (ε * ) and ε * is the value after which balls of X are no longer geodesically convex. Finally, if X is further supposed to be M -doubling, then for all p > q > d α ,

Pers q q (H k (X, f )) ≤ (2CΛ) q q(M k+1 -M k ) diam(X) 2C 0 ε q-1 (N X (ε) ∨ K X ) dε . (4.142)
Some other Wasserstein p stability results have been reported in the literature: Chen and Edelsbrunner [START_REF] Chen | Diffusion runs low on persistence fast[END_REF] studied functions on non-compact domains of R d , obtaining a stability result which holds for p > d. The condition p > d also appears in stability results for Čech filtrations for point clouds in R d and the case of Vietoris-Rips filtrations was recently addressed in [START_REF] Skraba | Wasserstein stability for persistence diagrams[END_REF] by Skraba and Turner. where the infimum is taken over all metric spaces Z and all isometric embeddings f : X → Z and g : Y → Z.

Distance notion and stability for trees

The Gromov-Hausdorff distance quantifies how far away two metric spaces X and Y are from being isometric to each other. However, it is practically impossible to compute this distance with the above definition. To somewhat alleviate this, we will use the following characterization of the Gromov-Hausdorff distance: Proposition 4.18 (Burago et al.,§7 [11]). The Gromov-Hausdorf distance is characterized by

d GH (X, Y ) = 1 2 inf R sup (x,y)∈R (x ,y )∈R d X (x, x ) -d Y (y, y ) , (4.144)
where the infimum is taken over all correspondences, i.e. subsets R ⊂ X × Y such that for every x ∈ X there is at least one y ∈ Y such that (x, y) ∈ R and a symmetric condition for every y ∈ Y .

Remark 4.19. Given two surjective maps π X : Z → X and π Y : Z → Y , it is possible to build a correspondence between X and Y by considering the set {(π

X (z), π Y (z)) ∈ X × Y | z ∈ Z}.
A natural question is to ask whether we have an equivalent statement about the stability of d GH with respect to • L ∞ and whether the two notions of distances are in some sense "compatible". We will positively answer this first question. In general d ∞ and d GH are not compatible, in the sense that no inequality between the two holds in all generality (cf. remark 4.22). Le Gall and Duquesne [START_REF] Duquesne | Random trees, Lévy processes and spatial branching processes[END_REF] gave a first stability result of d GH with respect to the L ∞ -norm on continuous functions on [0, 1]: Theorem 4.20 (L ∞ -stability of trees, [START_REF] Duquesne | Random trees, Lévy processes and spatial branching processes[END_REF]). Let f, g : [0, 1] → R be two continuous functions. Then

d GH (T f , T g ) ≤ 2 f -g L ∞ . (4.145)
This result for functions on [0, 1] generalizes to more general topological spaces.

Theorem 4.21 (Stability theorem for trees). Let X be a compact, connected and locally path connected topological space and let f and g : X → R be two continuous functions, then

d GH (T f , T g ) ≤ 2 f -g L ∞ . (4.146)
Proof. We will use the distortion characterization of the Gromov-Hausdorff distance, which yields the following inequality

d GH (T f , T g ) ≤ 1 2 sup x,y∈X |d f (x, y) -d g (x, y)| . (4.147)
Following the logic of the proof of lemma 3.15, the distance between π f (x) and π f (y) is of the form

d f (π f (x), τ ) + d f (τ, π f (y)) = f (x) -f (τ ) + f (y) -f (τ ) (4.148)
where τ is the lowest point of the geodesic path in T f between π f (x) and π f (y). This geodesic path on T f admits preimages by π f which are paths connecting x to y. These paths achieve the following supremum sup

γ:x →y inf t∈[0,1] f • γ = f (τ ) ≤ f (x) ∧ f (y) (4.149)
where a ∧ b := min{a, b} since by construction γ must always stay above f (τ ) and since for r > f (τ ), x and y lie in different connected components of X r . If ν is the analogous vertex to τ on T g ,

d GH (T f , T g ) ≤ 1 2 sup x,y∈X |d f (x, y) -d g (x, y)| = 1 2 sup x,y∈X |f (x) -g(x) + f (y) -g(y) -2f (τ ) + 2g(ν)| ≤ f -g L ∞ + sup x,y∈X sup γ:x →y inf t∈[0,1] f • γ -sup η:x →y inf t∈[0,1] g • η ≤ 2 f -g L ∞ , (4.150)
as desired.

Remark 4.22. One can be tempted to establish a general inequality between d GH and d ∞ since both of these distances are bounded by the L ∞ -norm. However, this is not possible. Indeed, there is a simple counter-example to d GH ≥ d ∞ . To illustrate this consider two barcodes over a field k, k[s, -∞[ and k[s + ε, -∞[. The bottleneck distance between these two is clearly ≥ ε. But supposing that the functions f and g generating these barcodes are such that f = g + ε the trees T g and T f are isometric, so

d GH (T f , T g ) = 0 < ε ≤ d ∞ (B(f ), B(g)).
Conversely, there are also counter-examples to d ∞ ≥ d GH , as this inequality would imply that two trees which have the same barcode are isometric. This is clearly false, as one can "glue" the bars of a given barcode is many different ways to give a tree, which generically will not be isometric.

Remarks about stochastic processes

As we have previously seen, the study of diagrams of continuous functions involves understanding their regularity. Many stochastic processes are almost Hölder continuous in the following sense.

Definition 5.1. The class of almost α-Hölder continuous functions from X to R, denoted E α (X, R) is the class of functions defined by

E α (X, R) := 0≤β<α C β (X, R) (5.151)
For example, Brownian motion and fractional Brownian motion are in a certain E α for some value of α and moreover, as shown by Kahane [START_REF] Kahane | Some random series of functions[END_REF]Chapter 7], random subgaussian Fourier series on torii of any dimension also tend to have E α regularities. The ubiquity of E α -regularities in the context of stochastic processes partially motivate this definition. Notation 5.2. In what will follow, we will denote f P the pushforward measure of P by f .

A change in perspective

Remark 5.3. Slightly abusing the notation, throughout this section, when we talk about a (continuous) stochastic process, we will talk about a measurable function f : Ω → C 0 (X, R) (where (Ω, F, P) is some probability space).

Random diagrams, or more precisely, probability measures on the space of diagrams (or on the space of persistence measures) have been studied under many different contexts in the persistence theory literature [START_REF] Chazal | The density of expected persistence diagrams and its kernel based estimation[END_REF][START_REF] Chazal | Convergence rates for persistence diagram estimation in topological data analysis[END_REF][START_REF] Divol | Estimation and quantization of expected persistence diagrams[END_REF][START_REF] Fasy | Confidence sets for persistence diagrams[END_REF][START_REF] Turner | Fréchet means for distributions of persistence diagrams[END_REF]. Since ultimately we are interested in studying random processes on some base space X, the space of probability measures on the space of diagrams is far too large, as not all diagrams stem from (continuous) functions. In all practical applications, we are never given an abstract persistence diagram. Rather, we compute the persistence diagram from a certain continuous function (on which we may postulate further regularity assumptions, typically that the function is inside some E α (X, R)). This motivates studying subspaces of the full space of persistence diagrams of the form ∪ k Dgm k (E α (X, R)) ⊂ D. This perspective turns out to have notable advantages. For instance, it is known that (D, d ∞ ) is not a separable space [10, Theorem 5], but adopting this point of view we can show the opposite.

Proposition 5.4. Let K ⊂ (C 0 (X, R), • L ∞ ), be a closed subset, then (Dgm(K), d ∞ ) is a Polish metric space.
Proof. We start by noticing that the map Dgm is continuous and that the continuous image of a separable metric space is separable [START_REF] Willard | General topology[END_REF]Theorem 16.4a]. Moreover, Dgm(K) remains separable, since the countable dense subset of Dgm(K) remains dense in the completion.

Remark 5.5. If the subset K is compact, then Dgm(K) = Dgm(K). Notice also that the compact subsets of C 0 (X, R) are sets having a uniform modulus of continuity, by virtue of Ascoli's theorem. In particular, spaces such as C α Λ (X, R) are compact. Consider now continuous R-valued stochastic processes on X, f , defined on some probability space (Ω, F, P). Then, the space of probability measures on diagrams is also too large, as the probability measures we are concerned with must be of the form (Dgm k •f ) P. For convenience, we could take the closure of this space induced by measures of this form with respect to the topology of vague convergence, or with respect to some Wasserstein distance W p,δ (on the space of probability measures on diagrams). This is a technical point, but allows us to avoid making hypotheses on the probability measures on the space of diagrams, which are in practice almost never verifiable, and instead give hypotheses on the stochastic processes from which the diagrams stem from.

This point of view is particularly well-suited to look at stochastic processes supported on compact subsets of C 0 (X, R) (in fact, E α (X, R), for reasons which will become apparent later). An easy first result in this direction is that Proposition 5.6. Let K be a compact subset of C 0 (X, R), then Dgm k (K) ⊂ D ∞ . This restriction to compact sets can be seen as a considerable limitation. For example, Brownian motion on the interval [0, 1] does not satisfy this hypothesis of compactness. However, by virtue of the tightness of probability measures on C 0 (X, R), we may restrict ourselves to a compact K ε of C 0 (X, R) in which the process lies with probability 1 -ε and make probable statements there, or, alternatively, make conditional statements.

Furthermore, Proposition 5.7. Let (Ω, F, P) be a probability space and f be a R-valued, a.s. E α stochastic process on a d-dimensional compact manifold X. Then, for all ε > 0, (Dgm k •f ) P ∈ P(D d α +ε ∩ D ∞ ) and a fortiori in P(D r ) for every d α < r < ∞. Furthermore, if d α < q < ∞ and for all

β < α, E f q C β (X,R) < ∞, then, E[Dgm k (f )] ∈ d α <p≤q D p . Proof. Since f ∈ E α (X, R) a.s.
, it is a.s. C β (X, R) for every β < α, and so a.s. bounded by compactness of X. By theorem 3.23 and the previous remark, it follows that for every k ∈ N,

Dgm k (f ) ∈ D d β ∩ D ∞ , proving the first result. Next, we remark that if E f q C β (X,R
) is finite so is the pth moment of the norm for every 1 ≤ p ≤ q by a simple application of Jensen's inequality. To show the result, it suffices to show that for such p, E Pers p p (f ) < ∞ .

(5.152)

But using the same trick as in the proof of theorem 4.13, applying Tonelli's theorem, for some constant C (which is bounded above by the LLC constant of X), we have

Pers p p (f ) = p ∞ 0 ε p-1 E N ε f dε ≤ (2C f C β ) p βp diam(X) (2C) 1/β 0 ε pβ-1 N X (ε) dε .
The integral on [0, 1] is finite as soon as p > d α since the dimension of X is d. Taking the expectation of both sides,

E Pers p p (f ) ≤ CX,p,β E f p C β , (5.153)
which is finite as soon as the moments of the C β -norm of f are finite, exactly as supposed in the proposition. Finally, the a fortiori inclusion in D r is a consequence of the Wasserstein interpolation theorem [START_REF] Perez | ζ-functions and the topology of superlevel sets of stochastic processes[END_REF].

Consequences of stability

Equipped with some of the elementary facts from optimal transport theory, we may come back to persistence measures and diagrams. The main goal of this section will be to prove the following theorem.

Theorem 5.8 (Stability of random fields under Wasserstein perturbations). Let f and g be two R-valued a.s. E α stochastic processes on a d dimensional compact Riemannian manifold X on a probability space (Ω, F, P). Then, for any k ∈ N and any 1 ≤ p ≤ ∞, W p,d∞ ((Dgm k •f ) P, (Dgm k •g) P) ≤ W p,L ∞ (f P, g P) .

(5.154)

Moreover, if the supports of f P and g P are compact in E α (X, R), then

d ∞ (E[Dgm k (f )] , E[Dgm k (g)]) ≤ W ∞,d∞ ((Dgm k •f ) P, (Dgm k •g) P) , (5.155)
and for every d α < p ≤ q ≤ ∞, there exists a constant C X,p,η depending on the supports of f P and g P such that

d p (E[Dgm k (f )] , E[Dgm k (g)]) ≤ W q,dp ((Dgm k •f ) P, (Dgm k •g) P) ≤ C X,p,η W η qη,L ∞ (f P, g P) .
(5.156) where η < 1 -d αp .

Remark 5.9. The proof of this theorem uses some of the techniques from [START_REF] Chazal | Convergence rates for persistence diagram estimation in topological data analysis[END_REF]Lemma 15]. It differs from this result, as it concerns the d p -stability as opposed to simply d ∞ -stability, but also because the statement of theorem 5.8 gives a bound on the distance between expected diagrams, as opposed to a linear functional of the latter. However, necessary and sufficient conditions for the continuity of linear functionals of E[Dgm(f )] ∈ (D p , d p ) has been studied by Divol and Lacombe in [START_REF] Divol | Understanding the topology and the geometry of the persistence diagram space via optimal partial transport[END_REF].

Proof Taking the infimum over every π of this inequality and taking the pth root, The result for p = ∞ is obtained by taking the limit p → ∞, justified by remark 4.3 and the fact that the stochastic processes and their distributions in E α are uniformly bounded. Keeping the same notation, if π is an optimal transport for d p , π must necessarily be itself of compact support within (E α ) 2 . In particular, for any β < α, if K f and K g denote the supports of f P and g P, there exists a finite constant Λ := sup

ϕ∈K f ϕ C β ∨ sup ψ∈Kg ψ C β , (5.158)
such that, applying the Wasserstein p stability theorem for all p > k > d β ,

(E α ) 2 d p p (Dgm(h), Dgm( h)) dπ(h, h) ≤ C X,Λ,β

(E α ) 2 h -h p-k ∞ dπ(h, h) , (5.159)
yielding the result of the theorem for the values of η prescribed. That the same inequalities hold for all p ≤ q ≤ ∞ is a consequence of Jensen's inequality.

Proposition 5.10 (Control of W p,L ∞ ). Let f and g be two R-valued a.s. E α stochastic processes on a d dimensional compact Riemannian manifold X on a probability space (Ω, F, P). Then, the following inequality holds W p,L ∞ (f P, g P) ≤ f -g L p (Ω,L ∞ (X,R))

(5.160)

Proof. The map F : Ω → E α (X, R) 2 which sends ω → (f (ω), g(ω)) induces a transport map F P ∈ Γ(f P, g P) and

W p p,L ∞ (f P, g P) ≤ E α (X,R) 2 h -k p dF P(h, k) = Ω f (ω) -g(ω) p ∞ dP(ω)
= f -g p L p (Ω,L ∞ (X,R)) , which finishes the proof.

Remark 5.11. Proposition 5.10 yields an easy way to estimate the value of Wasserstein distances between stochastic processes. Using the results of [START_REF] Perez | On the persistent homology of almost surely C 0 stochastic processes[END_REF] and other results on rates of convergence of random processes (which could be obtained by using results such as those of Kahane [START_REF] Kahane | Some random series of functions[END_REF]), this instantly gives estimates for Wasserstein distances between distributions for a panoply of processes.

Corollary 5.12 (A remark on discretization). Keeping the same notation, fix a triangulation P of X whose 0-skeleton has n points and such that the 0-skeleton of P is an ε-net of X (this constrains n ≥ N X (ε)) and define a new process f which is equal to f on the 0-skeleton of P and linearly interpolate in between. Then, W p,L ∞ (f P, f P) ≤ E f p C β ε βp .

(5.161)

If p = ∞ and that f C β is uniformly bounded by L, then W ∞,L ∞ (f P, f P) ≤ Lε α (5.162) and theorem 5.8 applies.

Proof. Clearly, f : Ω → Lip Λε (X, R) of law f P. By proposition 5.10, for any β < α,

W p p,L ∞ (f P, f P) ≤ E f -f p ∞ ≤ E f p C β ε βp .
Taking p → ∞, provided that the distribution of f C β has bounded support, we can bound the support of this distribution by L, we get W ∞,L ∞ (f P, f P) ≤ Lε α . In particular, the expected diagrams differ from less than Lε α in d ∞ .

Remark 5.13. The topology on the measures on C 0 (X, R) defined by Wasserstein distances may be too weak. Indeed, note that W p,L ∞ -balls around any measure µ supported on some E α (X, R) include probability measures whose support intersects sets of C 0 (X, R) whose number of small bars grows faster than any polynomial (or indeed any computable function!). To see why, it suffices to exhibit an example of such a function (let us denote it h), and notice that if a stochastic process f has law µ, if ξ denotes a standard gaussian random variable, then f + εξh is (up to rendering f locally constant on some small ball) an arbitrarily small L ∞ -perturbation of f whose number of small bars grows arbitrarily fast. In particular, this perturbation is not in any D p for any p, but the law of this perturbed process is included within a W p,L ∞ -ball of arbitrarily small radius. However, by changing topology to that of a Sobolev space which injects itself onto some C α (X, R), we can avoid this problem. With this change in topology, it might be superfluous to require that the processes lie in E α (X, R), as it might follow from an argument ressembling that of the proof of the Kolmogorov-Chentsov theorem (theorem 5.14).

Establishing classes of regularity

A sufficient and easily verifiable condition for a stochastic process to be almost surely E α is given by the Kolmogorov-Chentsov theorem.

Theorem 5.14 (Kolmogorov-Chentsov Theorem for compact manifolds, [START_REF] Andreev | Kolmogorov-Chentsov theorem and differentiability of random fields on manifolds[END_REF][START_REF] Aubin | Some Nonlinear Problems in Riemannian Geometry[END_REF]). Let (Ω, F, P) be a probability space, B be a Banach space, X be a d-dimensional compact Riemannian manifold (without boundary) with distance d X and f : Ω × X → B be a B-valued separable stochastic process. Suppose there exists constants C > 0, ε > 0 and δ > 1 such that for all x, y ∈ X, E f (x) -f (y) δ B ≤ Cd X (x, y) d+ε , (5.163) then there exists a modification of f such that for all α ∈ [0, ε δ [, f is almost surely α-Hölder continuous.

The proof uses the same idea of [START_REF] Andreev | Kolmogorov-Chentsov theorem and differentiability of random fields on manifolds[END_REF] to use the Sobolev embedding theorem. For compact Riemannian manifolds, the required Sobolev embedding theorem is given by [START_REF] Aubin | Some Nonlinear Problems in Riemannian Geometry[END_REF]Theorem 2.20] (in fact, within [START_REF] Aubin | Some Nonlinear Problems in Riemannian Geometry[END_REF], one can actually find Sobolev embedding theorems valid for wider classes of manifolds). Let us give a sketch of the proof.

Sketch of proof of theorem 5.14. First, by virtue of Markov's inequality, the estimation on the moments above entails that the process is continuous in probability. We may therefore assume that, up to taking a modification of f , the process f is measurable on Ω × X. Fix γ a real number, then Tonelli's theorem and the estimation of the moments above implies that which is finite as soon as γ < d+ε δ . Notice that the bounded quantity is nothing other than the norm of f in L δ (Ω, W γ,δ (X, B)), so that almost surely, f ω ∈ W γ,δ (X, B). There is a Sobolev injection of W γ,δ (X, B) -→ C α (X, B) for all α < γ -d δ , so for every α < ε δ , there is a measurable set Ω 0 ⊂ Ω of probability measure 1 on which for every ω ∈ Ω 0 , f ω is α-Hölder almost everywhere on X. The corresponding modification can be obtained by making the trajectories continuous everywhere. Since the process f is measurable on Ω × X, we can set Finally, it is easy to check this function is indeed α-Hölder everywhere on Ω 0 and to check that P(g(x) = f (x)) = 1 almost everywhere on X.

Remark 5.15. If B = R, the same idea works (as shown in [START_REF] Andreev | Kolmogorov-Chentsov theorem and differentiability of random fields on manifolds[END_REF]) to prove results on the existence of modifications of processes such that the modification is almost surely of class C k .

Provided that we have control over all moments of f (x) -f (y) , the Kolmogorov-Chentsov theorem constrains the regularity of the process to live within some family

Acknowledgements

The author would like to thank Pierre Pansu and Claude Viterbo for helping with the redaction of the manuscript as well as their guidance. Many thanks are also owed to Shmuel Weinberger, Yuliy Baryshnikov and Jean-François Le Gall and Nicolas Curien for the fruitful discussions without which some of this work would not have been possible.

Figure 2 :

 2 Figure 2: The Dyck path is the function f which assigns the height (the distance from the root) of each vertex of the tree as we wrap around the tree following a clockwise contour around it. There is a map φ : T → [0, ζ] where [0, ζ] is now marked at the points at which f achieves its local maxima. The figure is taken from [27].

.62) 3 . 1 Definition 3 . 4 .

 3134 1D case: a connection with the p-variation Let f : [0, 1] → R be a continuous function. The true p-variation of f is defined as

Definition 4 . 17 .

 417 Let X and Y be two compact metric spaces, the Gromov-Hausdorff distance, d GH (X, Y ) between X and Y , is defined asd GH (X, Y ) := inf f :X→Z g:Y →Z max sup x∈X inf y∈Y d Z (f (x), g(y)), sup y∈Y inf x∈X d Z (f (x), g(y)) .(4.143)

d

  p (E[Dgm(f )] , E[Dgm(g)]) ≤ W p,dp ((Dgm •f ) P, (Dgm •g) P) .

f

  (x) -f (y) δ B d X (x, y) d+γδ dx dy = X X E f (x) -f (y) δ B d X (x, y) d+γδ dx dy ≤ C X X d X (x, y) ε-γδ dx dy

  g ω (h, x) := 1 Vol(B(x, h)) B(x,h) f ω (y) dy ,(5.164)and consider the setB = {(ω, x) ∈ Ω × X | (g ω (h, x)) h converges as h → 0} (5.165)and set the continuous modification of f to be g ω (x) := lim h→0 g ω (h, x) (ω, x)

Corollary 5 . 16 .

 516 α * . As an immediate corollary, With the same hypotheses and notation of theorem 5.14 where now B = R, denoting α * := sup ε,

  .31) where the morphisms are the maps induced at the level of the interval modules generating Alg(T εn ). Indeed, the interval modules k[α, β n [ of Alg(T εn ) satisfy that there is exactly one interval module of Alg(T εm ) (m > n) such that [α, β n [ ⊂ [α, β m [.

			A natural definition for
	infinite T is thus
	Alg(T ) := lim -→	Alg(T εn ) .	(2.32)

  and only if there is a path γ between the representative c ∈ X s and an element b ∈ X r such that γ stays within X s . Without loss of generality, let us take c such that c ∈ {f = s}. Finding such a path γ is only possible if c and b lie in the same connected component of X r . By proposition 2.15, this can happen if and only if h

  of theorem 5.8. The first inequality is a simple consequence of a change of variables and an application of the bottleneck stability theorem. Next, notice that if f P and g P have compact support in E α , then f and g are almost surely uniformly bounded functions, so E[Dgm(f )] and E[Dgm(g)] are both in D ∞ . ∈ Γ(f P, g P) and an analogous equality holds for E[Dgm(g)]. Since d p p is convex, applying Jensen's inequality

	Notice that,
	E[Dgm(f )] =	Dgm(h) df P(h) =	Dgm(h) dπ(h, h) ,	(5.157)
	E α				(E α ) 2
	for any π d p p (E[Dgm(f )] , E[Dgm(g)]) = d p p	(E α ) 2	Dgm(h) dπ(h, h),	(E α ) 2	Dgm( h) dπ(h, h)
	≤	(E α ) 2	d p p (Dgm(h), Dgm( h)) dπ(h, h)
	=				d p
		(Dgm(E α )) 2

p (x, y) dDgm ⊗2 π(x, y) .