An Introduction to Topological Data Analysis: Fundamental and Practical Aspects for Data Scientists

With the recent explosion in the amount, the variety, and the dimensionality of available data, identifying, extracting, and exploiting their underlying structure has become a problem of fundamental importance for data analysis and statistical learning. Topological data analysis (tda) is a recent and fast-growing field providing a set of new topological and geometric tools to infer relevant features for possibly complex data. It proposes new well-founded mathematical theories and computational tools that can be used independently or in combination with other data analysis and statistical learning techniques. This article is a brief introduction, through a few selected topics, to basic fundamental and practical aspects of tda for nonexperts.


Introduction and motivation
Topological Data Analysis (tda) is a recent field that emerged from various works in applied (algebraic) topology and computational geometry during the first decade of the century. Although one can trace back geometric approaches for data analysis quite far in the past, tda really started as a field with the pioneering works of Edelsbrunner et al. (2002) and Zomorodian and Carlsson (2005) in persistent homology and was popularized in a landmark paper in 2009Carlsson (2009. tda is mainly motivated by the idea that topology and geometry provide a powerful approach to infer robust qualitative, and sometimes quantitative, information about the structure of data -see, e.g. Chazal (2017).
tda aims at providing well-founded mathematical, statistical and algorithmic methods to infer, analyze and exploit the complex topological and geometric structures underlying data that are often represented as point clouds in Euclidean or more general metric spaces. During the last few years, a considerable effort has been made to provide robust and efficient data structures and algorithms for tda that are now implemented and available and easy to use through standard libraries such as the Gudhi library (C++ and Python) Maria et al. (2014) and its R software interface Fasy et al. (2014a). Although it is still rapidly evolving, tda now provides a set of mature and efficient tools that can be used in combination or complementary to other data sciences tools.
The tdapipeline. tda has recently known developments in various directions and application fields. There now exist a large variety of methods inspired by topological and geometric approaches. Providing a complete overview of all these existing approaches is beyond the scope of this introductory survey. However, most of them rely on the following basic and standard pipeline that will serve as the backbone of this paper: 1. The input is assumed to be a finite set of points coming with a notion of distance -or similarity -between them. This distance can be induced by the metric in the ambient space (e.g. the Euclidean metric when the data are embedded in R d ) or come as an intrinsic metric defined by a pairwise distance matrix. The definition of the metric on the data is usually given as an input or guided by the application. It is however important to notice that the choice of the metric may be critical to reveal interesting topological and geometric features of the data.

2.
A "continuous" shape is built on top of the data in order to highlight the underlying topology or geometry. This is often a simplicial complex or a nested family of simplicial complexes, called a filtration, that reflects the structure of the data at different scales. Simplicial complexes can be seen as higher dimensional generalizations of neighboring graphs that are classically built on top of data in many standard data analysis or learning algorithms. The challenge here is to define such structures that are proven to reflect relevant information about the structure of data and that can be effectively constructed and manipulated in practice.
3. Topological or geometric information is extracted from the structures built on top of the data. This may either results in a full reconstruction, typically a triangulation, of the shape underlying the data from which topological/geometric features can be easily extracted or, in crude summaries or approximations from which the extraction of relevant information requires specific methods, such as e.g. persistent homology. Beyond the identification of interesting topological/geometric information and its visualization and interpretation, the challenge at this step is to show its relevance, in particular its stability with respect to perturbations or presence of noise in the input data. For that purpose, understanding the statistical behavior of the inferred features is also an important question.
4. The extracted topological and geometric information provides new families of features and descriptors of the data. They can be used to better understand the data -in particular through visualization-or they can be combined with other kinds of features for further analysis and machine learning tasks. Showing the added-value and the complementarity (with respect to other features) of the information provided by tda tools is an important question at this step.
tda and statistics. Until very recently, the theoretical aspects of TDA and topological inference mostly relied on deterministic approaches. These deterministic approaches do not take into account the random nature of data and the intrinsic variability of the topological quantity they infer. Consequently, most of the corresponding methods remain exploratory, without being able to efficiently distinguish between information and what is sometimes called the "topological noise". A statistical approach to TDA means that we consider data as generated from an unknown distribution, but also that the inferred topological features by TDA methods are seen as estimators of topological quantities describing an underlying object. Under this approach, the unknown object usually corresponds to the support of the data distribution (or at least is close to this support). However, this support does not always have a physical existence; for instance, galaxies in the universe are organized along filaments but these filaments do not physically exist.
The main goals of a statistical approach to topological data analysis can be summarized as the following list of problems: Topic 1: proving consistency and studying the convergence rates of TDA methods.
Topic 2: providing confidence regions for topological features and discussing the significance of the estimated topological quantities.
Topic 3: selecting relevant scales at which the topological phenomenon should be considered, as a function of observed data.
Topic 4: dealing with outliers and providing robust methods for TDA.
tda in data science. On the application side, many recent promising and successful results have demonstrated the interest of topological and geometric approaches in an increasing number of fields such has, e.g., material science Kramar et al. (2013); Nakamura et al. (2015) 3D shape analysis Skraba et al. (2010); Turner et al. (2014b), multivariate time series analysis Seversky et al. (2016), biology Yao et al. (2009) , chemistry Lee et al. (2017) or sensor networks De Silva and Ghrist (2007) to name a few. It is beyond the scope to give an exhaustive list of applications of tda. On another hand, most of the successes of tda result from its combination with other analysis or learning techniques -see Section 5.9 for a discussion and references. So, clarifying the position and complementarity of tda with respect to other approaches and tools in data science is also an important question and an active research domain.
The overall objective of this survey paper is two-fold. First, it intends to provide data scientists with a brief and comprehensive introduction to the mathematical and statistical foundations of tda. For that purpose, the focus is put on a few selected, but fundamental, tools and topics: simplicial complexes (Section 2) and their use for exploratory topological data analysis (Section 3), geometric inference Section 4) and persistent homology theory (Section 5) that play a central role in tda. Second, this paper also aims at providing a short practical introduction to the Gudhi library, in particular its Python version that allows to easily implement and use the tda tools presented in this paper (Section 6). Our goal is to quickly provide the data scientist with a few basic keys -and relevant references -to get a clear understanding of the basics of tda to be able to start to use tda methods and software for his own problems and data.

Metric spaces, covers and simplicial complexes
As topological and geometric features are usually associated to continuous spaces, data represented as finite sets of observations, do not directly reveal any topological information per se. A natural way to highlight some topological structure out of data is to "connect" data points that are close to each other in order to exhibit a global continuous shape underlying the data. Quantifying the notion of closeness between data points is usually done using a distance (or a dissimilarity measure), and it often turns out to be convenient in tda to consider data sets as discrete metric spaces or as samples of metric spaces.
Metric spaces. Recall that a metric space (M, ρ) is a set M with a function ρ : M ×M → R + , called a distance, such that for any x, y, z ∈ M : i) ρ(x, y) ≥ 0 and ρ(x, y) = 0 if and only if x = y, ii) ρ(x, y) = ρ(y, x) and, iii) ρ(x, z) ≤ ρ(x, y) + ρ(y, z). Given a a metric space (M, ρ), the set K(M ) of its compact subsets can be endowed with the socalled Hausdorff distance: given two compact subsets A, B ⊆ M the Hausdorff distance d H (A, B) between A and B is defined as the smallest non negative number δ such that for any a ∈ A there exists b ∈ B such that ρ(a, b) ≤ δ and for any b ∈ B, there exists a ∈ A such that ρ(a, b) ≤ δ -see Figure 1. In other words, if for any compact subset C ⊆ M , we denote by d(., C) : M → R + the distance function to C defined by d(x, C) := inf c∈C ρ(x, c) for any x ∈ M , then one can prove that the Hausdorff distance between A and B is defined by any of the two following equalities: It is a basic and classical result that the Hausdorff distance is indeed a distance on the set of compact subsets of a metric space. From a tda perspective it provides a convenient way to quantify the proximity between different data sets issued from the same ambient metric space. However, it sometimes occurs in that one has to compare data set that are not sampled from the same ambient space. Fortunately, the notion of Hausdorff distance can be generalized to the Left: The Gromov-Hausdorff distance between A and B. A can been rotated -this is an isometric embedding of A in the plane -to reduce its Hausdorff distance to B. As a consequence, comparison of any pair of compact metric spaces, giving rise to the notion of Gromov-Hausdorff distance.
Definition 1. The Gromov-Haudorff distance d GH (M 1 , M 2 ) between two compact metric spaces is the infimum of the real numbers r ≥ 0 such that there exists a metric space (M, ρ) and two compact subspaces C 1 , C 2 ⊂ M that are isometric to M 1 and M 2 and such that d H (C 1 , C 2 ) ≤ r.
The Gromov-Hausdorff distance will be used later, in Section 5, for the study of stability properties persistence diagrams.
Connecting pairs of nearby data points by edges leads to the standard notion of neighboring graph from which the connectivity of the data can be analyzed, e.g. using some clustering algorithms. To go beyond connectivity, a central idea in TDA is to build higher dimensional equivalent of neighboring graphs by not only connecting pairs but also (k + 1)-uple of nearby data points. The resulting objects, called simplicial complexes, allow to identify new topological features such as cycles, voids and their higher dimensional counterpart.
Geometric and abstract simplicial complexes. Simplicial complexes can be seen as higher dimensional generalization of graphs. They are mathematical objects that are both topological and combinatorial, a property making them particularly useful for tda.
Given a set X = {x 0 , · · · , x k } ⊂ R d of k + 1 affinely independent points, the k-dimensional simplex σ = [x 0 , · · · x k ] spanned by X is the convex hull of X. The points of X are called the vertices of σ and the simplices spanned by the subsets of X are called the faces of σ. A geometric simplicial complex K in R d is a collection of simplices such that: i) any face of a simplex of K is a simplex of K, ii) the intersection of any two simplices of K is either empty or a common face of both.
The union of the simplices of K is a subset of R d called the underlying space of K that inherits from the topology of R d . So, K can also be seen as a topological space through its underlying space. Notice that once its vertices are known, K is fully characterized by the combinatorial description of a collection of simplices satisfying some incidence rules.
Given a set V , an abstract simplicial complex with vertex set V is a setK of finite subsets of V such that the elements of V belongs toK and for any σ ∈K any subset of σ belongs tõ K. The elements ofK are called the faces or the simplices ofK. The dimension of an abstract simplex is just its cardinality minus 1 and the dimension ofK is the largest dimension of its simplices. Notice that simplicial complexes of dimension 1 are graphs.
The combinatorial description of any geometric simplicial K obviously gives rise to an abstract simplicial complexK. The converse is also true: one can always associate to an abstract simplicial complexK, a topological space |K| such that if K is a geometric complex whose combinatorial description is the same asK, then the underlying space of K is homeomorphic to |K|. Such a K is called a geometric realization ofK. As a consequence, abstract simplicial complexes can be seen as topological spaces and geometric complexes can be seen as geometric realizations of their underlying combinatorial structure. So, one can consider simplicial complexes at the same time as combinatorial objects that are well-suited for effective computations and as topological spaces from which topological properties can be inferred.
Building simplicial complexes from data. Given a data set, or more generally a topological or metric space, there exist many ways to build simplicial complexes. We present here a few classical examples that are widely used in practice.
A first example, is an immediate extension of the notion of α-neighboring graph. Assume that we are given a set of points X in a metric space (M, ρ) and a real number . It follows immediately from the definition that this is an abstract simplicial complex. However, in general, even when X is a finite subset of R d , Rips α (X) does not admit a geometric realization in R d ; in particular, it can be of dimension higher than d.
α Figure 2: The Čech complex Cech α (X) (left) and the and Vietoris-Rips Rips 2α (X) (right) of a finite point cloud in the plane R 2 . The bottom part of Cech α (X) is the union of two adjacent triangles, while the bottom part of Rips 2α (X) is the tetrahedron spanned by the four vertices and all its faces. The dimension of the Čech complex is 2. The dimension of the Vietoris-Rips complex is 3. Notice that this later is thus not embedded in R 2 .
Closely related to the Vietoris-Rips complex is the Čech complex Cech α (X) that is defined as the set of simplices [x 0 , . . . , x k ] such that the k + 1 closed balls B(x i , α) have a non-empty intersection. Notice that these two complexes are related by and that, if X ⊂ R d then Cech α (X) and Rips 2α (X) have the same 1-dimensional skeleton, i.e. the same set of vertices and edges.
The nerve theorem. The Čech complex is a particular case of a family of complexes associated to covers. Given a cover U = (U i ) i∈I of M, i.e. a family of sets U i such that M = ∪ i∈I U i , the nerve of U is the abstract simplicial complex C(U) whose vertices are the U i 's and such that Given a cover of a data set, where each set of the cover can be, for example, a local cluster or a grouping of data points sharing some common properties, its nerve provides a compact and global combinatorial description of the relationship between these sets through their intersection patterns -see Figure 3. Figure 3: The nerve of a cover of a set of sampled points in the plane.
A fundamental theorem in algebraic topology, relates, under some assumptions, the topology of the nerve of a cover to the topology of the union of the sets of the cover. To be formally stated, this result, known as the Nerve Theorem, requires to introduce a few notions.
Two topological spaces X and Y are usually considered as being the same from a topological point of view if they are homeomorphic, i.e. if there exist two continuous bijective maps f : X → Y and g : Y → X such that f •g and g •f are the identity map of Y and X respectively. In many cases, asking X and Y to be homeomorphic turns out to be a too strong requirement to ensure that X and Y share the same topological features of interest for tda. Two continuous maps f 0 , f 1 : X → Y are said to be homotopic is there exists a continuous map H : X × [0, 1] → Y such that for any x ∈ X, H(x, 0) = f 0 (x) and H(x, 1) = g(x). The spaces X and Y are then said to be homotopy equivalent if there exist two maps f : X → Y and g : Y → X such that f • g and g • f are homotopic to the identity map of Y and X respectively. The maps f and g are then called homotopy equivalent. The notion of homotopy equivalence is weaker than the notion of homeomorphism: if X and Y are homeomorphic then they are obviously homotopy equivalent, the converse being not true. However, spaces that are homotopy equivalent still share many topological invariant, in particular they have the same homology -see Section 4. A space is said to be contractible if it is homotopy equivalent to a point. Basic examples of contractible spaces are the balls and, more generally, the convex sets in R d . Open covers whose all elements and their intersections are contractible have the remarkable following property.
Theorem 1 (Nerve theorem). Let U = (U i ) i∈I be a cover of a topological space X by open sets such that the intersection of any subcollection of the U i 's is either empty or contractible. Then, X and the nerve C(U) are homotopy equivalent.
It is easy to verify that convex subsets of Euclidean spaces are contractible. As a consequence, if U = (U i ) i∈I is a collection of convex subsets of R d then C(U) and ∪ i∈I U i are homotopy equivalent. In particular, if X is a set of points in R d , then the Čech complex Cech α (X) is homotopy equivalent to the union of balls ∪ x∈X B(x, α).
The Nerve Theorem plays a fundamental role in tda: it provide a way to encode the topology of continuous spaces into abstract combinatorial structures that are well-suited for the design of effective data structures and algorithms.
3 Using covers and nerves for exploratory data analysis and visualization: the Mapper algorithm Using the nerve of covers as a way to summarize, visualize and explore data is a natural idea that was first proposed for tda in Singh et al. (2007), giving rise to the so-called Mapper algorithm. The idea of the Mapper algorithm is, given a data set X and well-chosen real valued function f : X → R d , to summarize X through the nerve of the refined pull back of a cover U of f (X) . For well-chosen covers U (see below), this nerve is a graph providing an easy and convenient way to visualize the summary of the data. It is described in Algorithm 1 and illustrated on a simple example in Figure 5.
The Mapper algorithm is very simple but it raises several questions about the various choices that are left to the user and that we briefly discuss in the following.
The choice of f . The choice of the function f , sometimes called the filter or lens function, strongly depends on the features of the data that one expect to highlight. The following ones are among the ones more or less classically encountered in the literature:

Algorithm 1 The Mapper algorithm
Input: A data set X with a metric or a dissimilarity measure between data points, a function f : X → R (or R d ), and a cover U of f (X). for each U ∈ U, decompose f −1 (U ) into clusters C U,1 , · · · , C U,k U . Compute the nerve of the cover of X defined by the C U,1 , · · · , C U,k U , U ∈ U Output: a simplicial complex, the nerve (often a graph for well-chosen covers → easy to visualize): -a vertex v U,i for each cluster C U,i , -an edge between v U,i and v U ,j iff C U,i ∩ C U ,j = ∅ f Figure 5: The mapper algorithm on a point cloud sampled around a circle.
-density estimates: the mapper complex may help to understand the structure and connectivity of high density areas (clusters).
-PCA coordinates or coordinates functions obtained from a non linear dimensionality reduction (NLDR) technique, eigenfunctions of graph laplacians,... may help to reveal and understand some ambiguity in the use of non linear dimensionality reductions.
-The centrality function f (x) = y∈X d(x, y) and the eccentricity function f (x) = max y∈X d(x, y), appears sometimes to be good choices that do not require any specific knowledge about the data.
-For data that are sampled around 1-dimensional filamentary structures, the distance function to a given point allows to recover the underlying topology of the filamentary structures Chazal et al. (2015c).
The choice of the cover U. When f is a real valued function, a standard choice is to take U to be a set of regularly spaced intervals of equal length r > 0 covering the set f (X). The real r is sometimes called the resolution of the cover and the percentage g of overlap between two consecutive intervals is called the the gain of the cover -see Figure 6. Note that if the gain g is chosen below 50%, then every point of the real line is covered by at most 2 open sets of U and the output nerve is a graph. It is important to notice that the output of the Mapper is very sensitive to the choice of U and small changes in the resolution and gain parameters may results in very large changes in the output, making the method very instable. A classical strategy consists in exploring some range of parameters and select the ones that turn out to provide the most informative output from the user perspective. r g = 0.25 Figure 6: An example of a cover of the real line with resolution r and the gain g = 25%.
The choice of the clusters. The Mapper algorithm requires to cluster the preimage of the open sets U ∈ U. There are two strategies to compute the clusters. A first strategy consists in applying, for each U ∈ U, a cluster algorithm, chosen by the user, to the premimage f −1 (U ). A second, more global, strategy consists in building a neighboring graph on top of the data set X, e.g. k-NN graph or ε-graph, and, for each U ∈ U, taking the connected components of the subgraph with vertex set f −1 (U ).
Theoretical and statistical aspects of Mapper. Based on the results on stability and the structure of Mapper proposed in Carrière and Oudot (2015), advances towards a statistically wellfounded version of Mapper have been obtained recently in Carrière et al. (2017). Unsurprisingly, the convergence of Mapper depends on both the sampling of the data and the regularity of the filter function. Moreover, subsampling strategies can be proposed to select a complex in a Rips filtration at a convenient scale, as well as the resolution and the gain for defining the Mapper graph. Other approaches have been proposed to study and deal with the instabilities of the Mapper algorithm in Dey et al. (2016Dey et al. ( , 2017. Data Analysis with Mapper. As an exploratory data analysis tool, Mapper has been successfully used for clustering and feature selection. The idea is to identify specific structures in the Mapper graph (or complex), in particular loops and flares. These structures are then used to identify interesting clusters or to select features or variable that best discriminate the data in these structures. Applications on real data, illustrating these techniques, may be found, for example, in Lum et al. (2013); Yao et al. (2009).

Geometric reconstruction and homology inference
Another way to build covers and use their nerves to exhibit the topological structure of data is to consider union of balls centered on the data points. In this section, we assume that X n = {x 0 , · · · , x n } is a subset of R d sampled i.i.d. according to a probability measure µ with compact support M ⊂ R d . The general strategy to infer topological information about M from µ proceeds in two steps that are discussed in the following of this section: 1. X n is covered by a union of balls of fixed radius centered on the x i 's. Under some regularity assumptions on M , one can relate the topology of this union of balls to the one of M ; 2. From a practical and algorithmic perspective, topological features of M are inferred from the nerve of the union of balls, using the Nerve Theorem.
In this framework, it is indeed possible to compare spaces through isotopy equivalence, a stronger notion than homeomorphism: X ⊆ R d and Y ⊆ R d are said to be (ambient) isotopic if there exists a continuous family of homeomorphisms H : Obviously, if X and Y are isotopic, then they are homeomorphic. The converse is not true: a knotted and an unknotted circles in R 3 are not homeomorphic (notice that although this claim seems rather intuitive, its formal proof requires the use of some non obvious algebraic topology tools).
Union of balls and distance functions. Given a compact subset K of R d , and a non negative real number r, the union of balls of radius r centered on K, K r = ∪ x∈K B(x, r), called the r-offset of K, is the r-sublevel set of the distance function d K : . This remark allows to use differential properties of distance functions and to compare the topology of the offsets of compact sets that are close to each other with respect to the Hausdorff distance.
Definition 3 (Hausdorff distance). The Hausdorff distance between two compact subsets K, K of R d is defined by In our setting, the considered compact sets are the data set X n and of the support M of the measure µ. When M is a smooth compact submanifold, under mild conditions on d H (X n , M ), for some well-chosen r, the offsets of X n are homotopy equivalent to M , Chazal and Lieutier (2008a); Niyogi et al. (2008) -see Figure 7 for an illustration. These results extend to larger classes of compact sets and leads to stronger results on the inference of the isotopy type of the offsets of M , Chazal et al. (2009c,d). They also lead to results on the estimation of other geometric and differential quantities such as normals Chazal et al. (2009c), curvatures  or boundary measures Chazal et al. (2010) under assumptions on the Haussdorff distance between the underlying shape and the data sample.
X n X r 1 n X r 2 n X r 3 n Figure 7: The example of a point cloud X n sampled on the surface of a torus in R 3 (top left) and its offsets for different values of radii r 1 < r 2 < r 3 . For well chosen values of the radius (e.g. r 1 and r 2 ), the offsets are clearly homotopy equivalent to a torus.
These results rely on the 1-semiconcavity of the squared distance function d 2 K , i.e. the convexity of the function x → x 2 − d 2 K (x), and can be naturally stated in the following general framework.
Thanks to its semiconcavity, a distance-like function φ have a well-defined, but not continuous, gradient ∇φ : R d → R d that can be integrated into a continuous flow Petrunin (2007) that allows to track the evolution of the topology of its sublevel sets and to compare it to the one of the sublevel sets of close distance-like functions.
is also said to be α-critical.
• The weak feature size of φ at r is the minimum r > 0 such that φ does not have any critical value between r and r + r . We denote it by wfs φ (r). For any 0 < α < 1, the α-reach of φ is the maximum r such that φ −1 ((0, r]) does not contain any α-critical point.
An important property of a distance-like function φ is the topology of their sublevel sets φ r can only change when r crosses a 0-critical value.
As an immediate consequence of the Isotopy Lemma, all the sublevel sets of φ between r and r + wfs φ (r) have the same topology. Now the following reconstruction theorem from Chazal et al. (2011b) provides a connection between the topology of the sublevel sets of close distance-like functions.
Theorem 2 (Reconstruction Theorem). Let φ, ψ be two distance-like functions such that φ − ψ ∞ < ε, with reach α (φ) ≥ R for some positive ε and α. Then, for every r ∈ [4ε/α 2 , R − 3ε] and every η ∈ (0, R), the sublevel sets ψ r and φ η are homotopy equivalent when Under similar but slightly more technical conditions the Reconstruction Theorem can be extended to prove that the sublevel sets are indeed homeomorphic and even isotopic Chazal et al. (2009c. Coming back to our setting, and taking for φ = d M and ψ = d Xn the distance functions to the support M of the measure µ and to the data set X n , the condition reach α (d M ) ≥ R can be interpreted as regularity condition on M 1 . The Reconstruction Theorem combined with the Nerve Theorem tell that, for well-chosen values of r, η, the η-offsets of M are homotopy equivalent to the nerve of the union of balls of radius r centered on X n , i.e the Cech complex Cech r (X n ).
From a statistical perspective, the main advantage of these results involving Hausdorff distance is that the estimation of the considered topological quantities boil down to support estimation questions that have been widely studied -see Section 4.1.
The above results provide a mathematically well-founded framework to infer the topology of shapes from a simplicial complex built on top of an approximating finite sample. However, from a more practical perspective it raises raise two issues. First, the Reconstruction Theorem requires a regularity assumption through the α-reach condition that may not always be satisfied and, the choice of a radius r for the ball used to build the Čech complex Cech r (X n ). Second, Cech r (X n ) provides a topologically faithfull summary of the data, through a simplicial complex that is usually not well-suited for further data processing. One often needs easier to handle topological descriptors, in particular numerical ones, that can be easily computed from the complex. This second issue is addressed by considering the homology of the considered simplicial complexes in the next paragraph, while the first issue will be addressed in the next section with the introduction of persistent homology.
Homology in a nutshell. Homology is a classical concept in algebraic topology providing a powerful tool to formalize and handle the notion of topological features of a topological space or of a simplicial complex in an algebraic way. For any dimension k, the k-dimensional "holes" are represented by a vector space H k whose dimension is intuitively the number of such independent features. For example the 0-dimensional homology group H 0 represents the connected components of the complex, the 1-dimensional homology group H 1 represents the 1-dimensional loops, the 2-dimensional homology group H 2 represents the 2-dimensional cavities,...
To avoid technical subtleties and difficulties, we restrict the introduction of homology to the minimum that is necessary to understand its usage in the following of the paper. In particular we restrict to homology with coefficients in Z 2 , i.e. the field with two elements 0 and 1 such that 1 + 1 = 0, that turns out to be geometrically a little bit more intuitive. However, all the notions and results presented in the sequel naturally extend to homology with coefficient in any field. We refer the reader to Hatcher (2001) for a complete and comprehensible introduction to homology and to Ghrist (2017) for a recent concise and very good introduction to applied algebraic topology and its connections to data analysis.
Let K be a (finite) simplicial complex and let k be a non negative integer. The space of k-chains on K, C k (K) is the set whose elements are the formal (finite) sums of k-simplices of K. More precisely, if {σ 1 , · · · σ p } is the set of k-simplices of K, then any k-chain can be written as Since we are considering coefficient in Z 2 , geometrically a k-chain can be seen as a finite collection of k-simplices and the sum of two k-chains as the symmetric difference of the two corresponding collections 2 .
The boundary of a k-simplex The boundary operators satisfy the fundamental following property: . These notions are illustrated on Figure 8.
Definition 6 (Simplicial homology group and Betti numbers). The k th (simplicial) homology group of K is the quotient vector space The k th Betti number of K is the dimension β k (K) = dim H k (K) of the vector space H k (K). Two cycles c, c ∈ Z k (K) are said to be homologous if they differ by a boundary, i.e. is there exists a (k + 1)-chain d such that c = c + ∂ k+1 (d). Two such cycles give rise to the same element of H k . In other words, the elements of H k (K) are the equivalence classes of homologous cycles.
Simplicial homology groups and Betti numbers are topological invariants: if K, K are two simplicial complexes whose geometric realizations are homotopy equivalent, then their homology groups are isomorphic and their Betti numbers are the same.
Singular homology is another notion of homology that allows to consider larger classes of topological spaces. It is defined for any topological space X similarly to simplicial homology except that the notion of simplex is replaced by the notion of singular simplex which is just any continuous map σ : ∆ k → X where ∆ k is the standard k-dimensional simplex. The space of kchains is the vector space spanned by the k-dimensional singular simplices and the boundary of a simplex σ is defined as the (alternated) sum of the restriction of σ to the (k −1)-dimensional faces of ∆ k . A remarkable fact about singular homology it that it coincides with simplicial homology whenever X is homeomorphic to the geometric realization of a simplicial complex. This allows us, in the sequel of this paper, to indifferently talk about simplicial or singular homology for topological spaces and simplicial complexes.
Observing, that if f : X → Y is a continuous map, then for any singular simplex σ : ∆ k → X in X, f • σ : ∆ k → Y is a singular simplex in Y , one easily deduces that continuous maps between topological spaces canonically induce homomorphisms between their homology groups. In particular, if f is an homeomorphism or an homotopy equivalence, then it induces an isomorphism between H k (X) and H k (Y ) for any non negative integer k. As an example, it follows from the Nerve Theorem that for any set of points X ⊂ R d and any r > 0 the r-offset X r and the Čech complex Cech r (X) have isomorphic homology groups and the same Betti numbers.
As a consequence, the Reconstruction Theorem 2 leads to the following result on the estimation of Betti numbers. . The blue curves on the torus represent two independent cycles whose homology class is a basis of its 1-dimensional homology group.
Then, for every r ∈ [4ε/α 2 , R − 3ε] and every η ∈ (0, R), the Betti numbers of Cech r (X) are the same as the ones of M η . In particular, if M is a smooth m-dimensional submanifold of R d , then β k (Cech r (X)) = β k (M ) for any k = 0, · · · , m.
From a practical perspective, this result raises three difficulties: first, the regularity assumption involving the α-reach of M may be too restrictive; second, the computation of the nerve of an union of balls requires they use of a tricky predicate testing the emptiness of a finite union of balls; third the estimation of the Betti numbers relies on the scale parameter r whose choice may be a problem.
To overcome these issues, Chazal and Oudot (2008) establishes the following result that offers a solution to the two first problems.
Although this result leaves the question of the choice of the scale parameter r open, it is proven in Chazal and Oudot (2008) that a multiscale strategy whose description is beyond the scope of this paper provides some help to identify the relevant scales at which Theorem 4 can be applied.

Statistical aspects of Homology inference
According to the stability results presented in the previous section, a statistical approach to topological inference is strongly related to the problem of distribution support estimation and level sets estimation under the Hausdorff metric. A large number of methods and results are available for estimating the support of a distribution in statistics. For instance, the Devroye and Wise estimator (Devroye and Wise, 1980) defined on a sample X n is also a particular offset of X n . The convergence rates of both X n and the Devroye and Wise estimator to the support of the distribution for the Hausdorff distance is studied in  in R d . More recently, the minimax rates of convergence of manifold estimation for the Hausdorff metric, which is particularly relevant for topological inference, has been studied in Genovese et al. (2012). There is also a large literature about level sets estimation in various metrics (see for instance Cadre, 2006;Polonik, 1995;Tsybakov et al., 1997) and more particularly for the Hausdorff metric in Chen et al. (2015). All these works about support and level sets estimation shine light on the statistical analysis of topological inference procedures.
In the paper Niyogi et al. (2008), it is shown that the homotopy type of Riemannian manifolds with reach larger than a given constant can be recovered with high probability from offsets of a sample on (or close to) the manifold. This paper was probably the first attempt to consider the topological inference problem in terms of probability. The result of Niyogi et al. (2008) is derived from a retract contraction argument and on tight bounds over the packing number of the manifold in order to control the Hausdorff distance between the manifold and the observed point cloud. The homology inference in the noisy case, in the sense the distribution of the observation is concentrated around the manifold, is also studied in Niyogi et al. (2008Niyogi et al. ( , 2011. The assumption that the geometric object is a smooth Riemannian manifold is only used in the paper to control in probability the Hausdorff distance between the sample and the manifold, and is not actually necessary for the "topological part" of the result. Regarding the topological results, these are similar to those of Chazal et al. (2009d); Chazal and Lieutier (2008b) in the particular framework of Riemannian manifolds. Starting from the result of Niyogi et al. (2008), the minimax rates of convergence of the homology type have been studied by Balakrishna et al. (2012) under various models, for Riemannian manifolds with reach larger than a constant. In contrast, a statistical version of Chazal et al. (2009d) has not yet been proposed.
More recently, following the ideas of Niyogi et al. (2008), Bobrowski et al. (2014) have proposed a robust homology estimator for the level sets of both density and regression functions, by considering the inclusion map between nested pairs of estimated level sets (in the spirit of Theorem 4 above) obtained with a plug-in approach from a kernel estimators. Figure 10: The effect of outliers on the sublevel sets of distance functions. Adding just a few outliers to a point cloud may dramatically change its distance function and the topology of its offsets.

Going beyond Hausdorff distance : distance to measure
It is well known that distance-based methods in tda may fail completely in the presence of outliers. Indeed, adding even a single outlier to the point cloud can change the distance function dramatically, see Figure 10 for an illustration. To answer this drawback, Chazal et al. (2011b) have introduced an alternative distance function which is robust to noise, the distance-to-ameasure.
Given a probability distribution P in R d and a real parameter 0 ≤ u ≤ 1, the notion of distance to the support of P may be generalized as the function where B(x, t) is the closed Euclidean ball of center x and radius t. To avoid issues due to discontinuities of the map P → δ P,u , the distance-to-measure function (DTM) with parameter m ∈ [0, 1] and power r ≥ 1 is defined by A nice property of the DTM proved in Chazal et al. (2011b) is its stability with respect to perturbations of P in the Wasserstein metric. More precisely, the map P → d P,m,r is m − 1 r -Lipschitz, i.e. if P andP are two probability distributions on R d , then where W r is the Wasserstein distance for the Euclidean metric on R d , with exponent r 4 . This property implies that the DTM associated to close distributions in the Wasserstein metric have close sublevel sets. Moreover, when r = 2, the function d 2 P,m,2 is semiconcave ensuring strong regularity properties on the geometry of its sublevel sets. Using these properties, Chazal et al. (2011b) show that, under general assumptions, ifP is a probability distribution approximating P , then the sublevel sets of dP ,m,2 provide a topologically correct approximation of the support of P .
In practice, the measure P is usually only known through a finite set of observations X n = {X 1 , . . . , X n } sampled from P , raising the question of the approximation of the DTM. A natural idea to estimate the DTM from X n is to plug the empirical measure P n instead of P in the definition of the DTM. This "plug-in strategy" corresponds to computing the distance to the empirical measure (DTEM). For m = k n , the DTEM satisfies where x − X n (j) denotes the distance between x and its j-th neighbor in {X 1 , . . . , X n }. This quantity can be easily computed in practice since it only requires the distances between x and the sample points. The convergence of the DTEM to the DTM has been studied in Chazal et al. (2014a) and Chazal et al. (2016b). The introduction of DTM has motivated further works and applications in various directions such as topological data analysis (Buchet et al., 2015a), GPS traces analysis (Chazal et al., 2011a), density estimation (Biau et al., 2011), hypothesis testing Brécheteau (2017), clustering (Chazal et al., 2013) just to name a few. Approximations, generalizations and variants of the DTM have also been considered in (Buchet et al., 2015b;Guibas et al., 2013;Phillips et al., 2014).

Persistent homology
Persistent homology is a powerful tool to compute, study and encode efficiently multiscale topological features of nested families of simplicial complexes and topological spaces. It does not only provide efficient algorithms to compute the Betti numbers of each complex in the considered families, as required for homology inference in the previous section, but also encodes the evolution of the homology groups of the nested complexes across the scales.

Filtrations
A filtration of a simplicial complex K is a nested family of subcomplexes (K r ) r∈T , where T ⊆ R, such that for any r, r ∈ T , if r ≤ r then K r ⊆ K r , and K = ∪ r∈T K r . The subset T may be either finite or infinite. More generally, a filtration of a topological space M is a nested family of subspaces (M r ) r∈T , where T ⊆ R, such that for any r, r ∈ T , if r ≤ r then M r ⊆ M r and, M = ∪ r∈T M r . For example, if f : M → R is a function, then the family M r = f −1 ((−∞, r]), r ∈ R defines a filtration called the sublevel set filtration of f .
In practical situations, the parameter r ∈ T can often be interpreted as a scale parameter and filtrations classically used in TDA often belong to one of the two following families.
Filtrations built on top of data. Given a subset X of a compact metric space (M, ρ), the families of Rips-Vietoris complexes (Rips r (X)) r∈R and and Čech complexes (Cech r (X)) r∈R are filtrations 5 . Here, the parameter r can be interpreted as a resolution at which one considers the data set X. For example, if X is a point cloud in R d , thanks to the Nerve theorem, the filtration (Cech r (X)) r∈R encodes the topology of the whole family of unions of balls X r = ∪ x∈X B(x, r), as r goes from 0 to +∞. As the notion of filtration is quite flexible, many other filtrations have been considered in the literature and can be constructed on top of data, such as e.g. the so called witness complex popularized in tda by De Silva and Carlsson (2004).

Sublevel sets filtrations.
Functions defined on the vertices of a simplicial complex give rise to another important example of filtration: let K be a simplicial complex with vertex set V and f : V → R. Then f can be extended to all simplices of K by f ([v 0 , · · · , v k ]) = max{f (v i ) : i = 1, · · · , k} for any simplex σ = [v 0 , · · · , v k ] ∈ K and the family of subcomplexes K r = {σ ∈ K : f (σ) ≤ r} defines a filtration call the sublevel set filtration of f . Similarly, one can define the upperlevel set filtration of f .
In practice, even if the index set is infinite, all the considered filtrations are built on finite sets and are indeed finite. For example, when X is finite, the Vietoris-Rips complex Rips r (X) changes only at a finite number of indices r. This allows to easily handle them from an algorithmic perspective.

Starting with a few examples
Given a filtration Filt = (F r ) r∈T of a simplicial complex or a topological space, the homology of F r changes as r increases: new connected components can appear, existing component can merge, loops and cavities can appear or be filled, etc... Persistent homology tracks these changes, identifies the appearing features and associates a life time to them. The resulting information is encoded as a set of intervals called a barcode or, equivalently, as a multiset of points in R 2 where the coordinate of each point is the starting and end point of the corresponding interval.
Before giving formal definitions, we introduce and illustrate persistent homology on a few simple examples.
Example 1. Let f : [0, 1] → R be the function of Figure 11 and let (F r = f −1 ((−∞, r])) r∈R be the sublevel set filtration of f . All the sublevel sets of f are either empty or a union of interval, so the only non trivial topological information they carry is their 0-dimensional homology, i.e. their number of connected components. For r < a 1 , F r is empty, but at r = a 1 a first connected component appears in F a 1 . Persistent homology thus registers a 1 as the birth time of a connected component and start to keep track of it by creating an interval starting at a 1 . Then, F r remains connected until r reaches the value a 2 where a second connected component appears. Persistent homology starts to keep track of this new connected component by creating a second interval starting at a 2 . Similarly, when r reaches a 3 , a new connected component appears and persistent homology creates a new interval starting at a 3 . When r reaches a 4 , the two connected components created at a 1 and a 3 merges together to give a single larger component. At this step, persistent homology follows the rule that this is the most recently appeared component in the filtration that dies: the interval started at a 3 is thus ended at a 4 and a first persistence interval encoding the lifespan of the component born at a 3 is created. When r reaches a 5 , as in the previous case, the component born at a 2 dies and the persistent interval (a 2 , a 5 ) is created. The interval created at a 1 remains until the end of the filtration giving rise to the persistent interval (a 1 , a 6 ) if the filtration is stopped at a 6 , or (a 1 , +∞) if r goes to +∞ (notice that in this later case, the filtration remains constant for r > a 6 ). The obtained set of intervals encoding the span life of the different homological features encountered along the filtration is called the persistence barcode of f . Each interval (a, a ) can be represented by the point of coordinates (a, a ) in R 2 plane. The resulting set of points is called the persistence diagram of f . Notice that a function may have several copies of the same interval in its persistence barcode. As a consequence, the persistence diagram of f is indeed a multi-set where each point has an integer valued multiplicity. Last, for technical reasons that will become clear in the next section, one adds to the persistence all the points of the diagonal ∆ = {(b, d) : b = d} with an infinite multiplicity. Example 2. Let now f : M → R be the function of Figure 12 where M is a 2-dimensional surface homeomorphic to a torus, and let (F r = f −1 ((−∞, r])) r∈R be the sublevel set filtration of f . The 0-dimensional persistent homology is computed as in the previous example, giving rise to the red bars in the barcode. Now, the sublevel sets also carry 1-dimensional homological features. When r goes through the height a 1 , the sublevel sets F r that were homeomorphic to two discs become homeomorphic to the disjoint union of a disc and an annulus, creating a first cycle homologous to σ 1 on Figure 12. A interval (in blue) representing the birth of this new 1-cycle is thus started at a 1 . Similarly, when r goes through the height a 2 a second cycle, homologous to σ 2 is created, giving rise to the start of a new persistent interval. These two created cycles are never filled (indeed they span H 1 (M )) and the corresponding intervals remains until the end of the filtration. When r reaches a 3 , a new cycle is created that is filled and thus dies at a 4 , giving rise to the persistence interval (a 3 , a 4 ). So, now, the sublevel set filtration of f gives rise to two barcodes, one for 0-dimensional homology (in red) and one for 1-dimensional homology (in blue). As previously, these two barcodes can equivalently be represented as diagrams in the plane. Example 3. In this last example we consider the filtration given by a union of growing balls centered on the finite set of points C in Figure 13. Notice that this is the sublevel set filtration of the distance function to C, and thanks to the Nerve Theorem, this filtration is homotopy equivalent to the Čech filtration built on top of C. Figure 13 shows several level sets of the filtration: a) For the radius r = 0, the union of balls is reduced to the initial finite set of point, each of them corresponding to a 0-dimensional feature, i.e. a connected component; an interval is created for the birth for each of these features at r = 0. b) Some of the balls started to overlap resulting in the death of some connected components that get merged together; the persistence diagram keeps track of these deaths, putting an end point to the corresponding intervals as they disappear. c) New components have merged giving rise to a single connected component and, so, all the intervals associated to a 0-dimensional feature have been ended, except the one corresponding to the remaining components; two new 1-dimensional features, have appeared resulting in two new intervals (in blue) starting at their birth scale. d) One of the two 1-dimensional cycles has been filled, resulting in its death in the filtration and the end of the corresponding blue interval. e) all the 1-dimensional features have died, it only remains the long (and never dying) red interval. As in the previous examples, the final barcode can also be equivalently represented as a persistence diagram where every interval (a, b) is represented by the the point of coordinate (a, b) in R 2 . Intuitively the longer is an interval in the barcode or, equivalently the farther from the diagonal is the corresponding point in the diagram, the more persistent, and thus relevant, is the corresponding homological feature across the filtration. Notice also that for a given radius r, the k-th Betti number of the corresponding union of balls is equal of the number of persistence intervals corresponding to k-dimensional homological features and containing r. So, the persistence diagram can be seen as a multiscale topological signature encoding the homology of the union of balls for all radii as well as its evolution across the values of r. Figure 13: The sublevel set filtration of the distance function to a point cloud and the "construction" of its persistence barcode as the radius of balls increases.

Persistent modules and persistence diagrams
Persistent diagrams can be formally and rigorously defined in a purely algebraic way. This requires some care and we only give here the basic necessary notions, leaving aside technical subtelties and difficulties. We refer the readers interested in a detailed exposition to Chazal et al. (2016a). Let Filt = (F r ) r∈T be a filtration of a simplicial complex or a topological space. Given a non negative integer k and considering the homology groups H k (F r ) we obtain a sequence of vector spaces where the inclusions F r ⊂ F r , r ≤ r induce linear maps between H k (F r ) and H k (F r ). Such a sequence of vector spaces together with the linear maps connecting them is called a persistence module.
Definition 7. A persistence module V over a subset T of the real numbers R is an indexed family of vector spaces (V r | r ∈ T ) and a doubly-indexed family of linear maps (v r s : V r → V s | r ≤ s) which satisfy the composition law v s t • v r s = v r t whenever r ≤ s ≤ t, and where v r r is the identity map on V r .
In many cases, a persistence module can be decomposed into a direct sum of intervals modules I (b,d) of the form · · · → 0 → · · · → 0 → Z 2 → · · · → Z 2 → 0 → · · · where the maps Z 2 → Z 2 are identity maps while all the other maps are 0. Denoting b (resp. d) the infimum (resp. supremum) of the interval of indices corresponding to non zero vector spaces, such a module can be interpreted as a feature that appears in the filtration at index b and disappear at index d. When a persistence module V can be decomposed as a direct sum of interval modules, one can show that this decomposition is unique up to reordering the intervals (see (Chazal et al., 2016a, Theorem 2.7)). As a consequence, the set of resulting intervals is independent of the decomposition of V and is called the persistence barcode of V. As in the examples of the previous section, each interval (b, d) in the barcode can be represented as the point of coordinates (b, d) in the plane R 2 . The disjoint union of these points, together with the diagonale ∆ = {x = y} is a multi-set called the the persistence diagram of V.
The following result, from (Chazal et al., 2016a, Theorem 2.8), give some necessary conditions for a persistence module to be decomposable as a direct sum of interval modules.
Theorem 5. Let V be a persistence module indexed by T ⊂ R. If T is a finite set or if all the vector spaces V r are finite-dimensional, then V is decomposable as a direct sum of interval modules.
As both conditions above are satisfied for the persistent homology of filtrations of finite simplicial complexes, an immediate consequence of this result is that the persistence diagrams of such filtrations are always well-defined.
Indeed, it is possible to show that persistence diagrams can be defined as soon as the following simple condition is satisfied.
Definition 8. A persistence module V indexed by T ⊂ R is q-tame if for any r < s in T , the rank of the linear map v r s : V r → V s is finite.
Theorem 6 (Chazal et al. (2009a(Chazal et al. ( , 2016a). If V is a q-tame persistence module, then it has a well-defined persistence diagram. Such a persistence diagram dgm(V) is the union of the points of the diagonal ∆ of R 2 , counted with infinite multiplicity, and a multi-set above the diagonal in R 2 that is locally finite. Here, by locally finite we mean that for any rectangle R with sides parallel to the coordinate axes that does not intersect ∆, the number of points of dgm(V), counted with multiplicity, contained in R is finite.
The construction of persistence diagrams of q-tame modules is beyond the scope of this paper but it gives rise to the same notion as in the case of decomposable modules. It can be done either by following the algebraic approach based upon the decomposability properties of modules, or by adopting a measure theoretic approach that allows to define diagrams as integer valued measures on a space of rectangles in the plane. We refer the reader to Chazal et al. (2016a) for more informations. Although persistence modules encountered in practice are decomposable, the general framework of q-tame persistence module plays a fundamental role in the mathematical and statistical analysis of persistent homology. In particular, it is needed to ensure the existence of limit diagrams when convergence properties are studied -see Section 5.7.
A filtration Filt = (F r ) r∈T of a simplicial complex or of a topological space is said to be tame if for any integer k, the persistence module (H k (F r ) | r ∈ T ) is q-tame. Notice that the filtrations of finite simplicial complexes are always tame. As a consequence, for any integer k a persistence diagram denoted dgm k (Filt) is associated to the filtration Filt. When k is not explicitly specified and when there is no ambiguity, it is usual to drop the index k in the notation and to talk about "the" persistence diagram dgm(Filt) of the filtration Filt. This notation has to be understood as "dgm k (Filt) for some k".

Persistence landscapes
The persistence landscape has been introduced in Bubenik (2015) as an alternative representation of persistence diagrams. This approach aims at representing the topological information encoded in persistence diagrams as elements of an Hilbert space, for which statistical learning methods can be directly applied.
The persistence landscape is a collection of continuous, piecewise linear functions λ : N × R → R that summarizes a persistence diagram dgm -see Figure 14. The landscape is defined by considering the set of functions created by tenting each point p = (x, y) = α birth +α death 2 , α death −α birth 2 representing a birth-death pair (α birth , α death ) ∈ dgm as follows: otherwise.
The persistence landscape of dgm is a summary of the arrangement of piecewise linear curves obtained by overlaying the graphs of the functions {Λ p } p . Formally, the persistence landscape of dgm is the collection of functions where kmax is the kth largest value in the set; in particular, 1max is the usual maximum function. Given k ∈ N, the function λ dgm (k, .) : R → R is called the k-th landscape of dgm. It is not difficult to see that the map that associate to each persistence diagram its corresponding landscape is injective. In other words, formally no information is lost when a persistence diagram is represented through its persistence landscape. The advantage of the persistence landscape representation is two-fold. First, persistence diagrams are mapped as elements of a functional space, opening the door to the use of a broad variety of statistical and data analysis tools for further processing of topological features -see, e.g. Bubenik (2015); Chazal et al. (2015b) and Section 5.8. Second, and fundamental from a theoretical perspective, the persistence landscapes share the same stability properties as persistence diagrams -see Section 5.6. Following the same ideas, other alternatives to persistence diagrams have been proposed, such as, for instance, the persistence images Adams et al.  Figure 14: An example of persistence landscape (right) associated to a persistence diagram (left). The first landscape is in blue, the second one in red and the last one in orange. All the other landscapes are zero.

Metrics on the space of persistence diagrams
To exploit the topological information and topological features inferred from persistent homology, one needs to be able to compare persistence diagrams, i.e. to endow the space of persistence diagrams with a metric structure. Although several metrics can be considered, the most fundamental one is known as the bottleneck distance.
Recall that a persistence diagram is the union of a discrete multi-set in the half-plane above the diagonal ∆ and, for technical reasons that will become clear below, of ∆ where the point of ∆ are counted with infinite multiplicity. A matching -see Figure 15 -between two diagrams dgm 1 and dgm 2 is a subset m ⊆ dgm 1 × dgm 2 such that every points in dgm 1 \∆ and dgm 2 \∆ appears exactly once in m. In other words, for any p ∈ dgm 1 \∆, and for any q ∈ dgm 2 \∆, ({p} × dgm 2 ) ∩ m and (dgm 1 ×{q}) ∩ m each contains a single pair. The Bottleneck distance between dgm 1 and dgm 2 is then defined by Figure 15: A perfect matching and the Bottleneck distance between a blue and a red diagram. Notice that some points of both diagrams are matched to points of the diagonal.
The practical computation of the bottleneck distance boils down to the computation of a perfect matching in a bipartite graph for which classical algorithms can be used.
The bottleneck metric is a L ∞ -like metric. It turns out to be the natural one to express stability properties of persistence diagrams presented in Section 5.6, but it suffers from the same drawbacks as the usual L ∞ norms, i.e. it is completely determined by the largest distance among the pairs and do not take into account the closeness of the remaining pairs of points. A variant, to overcome this issue, the so-called Wasserstein distance between diagrams is sometimes considered. Given p ≥ 1, it is defined by Useful stability results for persistence in the W p metric exist among the literature, in particular Cohen-Steiner et al. (2010), but they rely on assumptions that make them consequences of the stability results in the bottleneck metric.

Stability properties of persistence diagrams
A fundamental property of persistence homology is that persistence diagrams of filtrations built on top of data sets turn out to be very stable with respect to some perturbations of the data. To formalize and quantify such stability properties, we first need to precise the notion of perturbation that are allowed. Rather than working directly with filtrations built on top of data sets, it turns out to be more convenient to define a notion of proximity between persistence module from which we will derive a general stability result for persistent homology. Then, most of the stability results for specific filtrations will appear as a consequence of this general theorem. To avoid technical discussions, from now on we assume, without loss of generality, that the considered persistence modules are indexed by R.
Definition 9. Let V, W be two persistence modules indexed by R. Given δ ∈ R, a homomorphism of degree δ between V and W is a collection Φ of linear maps φ r : V r → W r+δ , for all r ∈ R such that for any r ≤ s, φ s • v r s = w r+δ s+δ • φ r .
An important example of homomorphism of degree δ is the shift endomorphism 1 δ V which consists of the families of linear maps (v r r+δ . Notice also that homomorphisms of modules can naturally be composed: the composition of a homomorphism Ψ of degree δ between U and V and a homomorphism Φ of degree δ between V and W naturally gives rise to a homomorphism ΦΨ of degree δ + δ between U and W.
Definition 10. Let δ ≥ 0. Two persistence modules V, W are δ-interleaved if there exists two homomorphism of degree δ, Φ, from V to W and Ψ, from W to V such that ΨΦ = 1 2δ V and ΦΨ = 1 2δ W .
Although it does not define a metric on the space of persistence modules, the notion of closeness between two persistence module may be defined as the smallest non negative δ such that they are δ-interleaved. Moreover, it allows to formalize the following fundamental theorem Chazal et al. (2009aChazal et al. ( , 2016a. Theorem 7 (Stability of persistence). Let V and W be two q-tame persistence modules. If V and W are δ-interleaved for some δ ≥ 0, then Although purely algebraic and rather abstract, this result is a efficient tool to easily establish concrete stability results in TDA. For example we can easily recover the first persistence stability result that appeared in the literature (Cohen-Steiner et al., 2005).
Theorem 8. Let f, g : M → R be two real-valued functions defined on a topological space M that are q-tame, i.e. such that the sublevel sets filtrations of f and g induce q-tame modules at the homology level. Then for any integer k, where dgm k (f ) (resp. dgm k (g)) is the persistence diagram of the persistence module (H k (f −1 (−∞, r]))|r ∈ R) (resp. (H k (g −1 (−∞, r]))|r ∈ R)) where the linear maps are the one induced by the canonical inclusion maps between sublevel sets.
Theorem 7 also implies a stability result for the persistence diagrams of filtrations built on top of data.
Theorem 9. Let X and Y be two compact metric spaces and let Filt(X) and Filt(Y) be the Vietoris-Rips of Čech filtrations built on top X and Y. Then where dgm(Filt(X)) and dgm(Filt(Y)) denote the persistence diagram of the filtrations Filt(X) and Filt(X).
As we already noticed in the Example 3 of Section 5.2, the persistence diagrams can be interpreted as multiscale topological features of X and Y. In addition, Theorem 9 tells us that these features are robust with respect to perturbations of the data in the Gromov-Hausdorff metric. They can be used as discriminative features for classification or other tasks -see, for example, Chazal et al. (2009b) for an application to non rigid 3D shapes classification.
From the definition of persistence landscape, we immediately observe that λ(k, ·) is one-Lipschitz and thus similar stability properties are satisfied for the landscapes as for persistence diagrams.

Statistical aspects of persistent homology
Persistence homolog by itself does not take into account the random nature of data and the intrinsic variability of the topological quantity they infer. We now present a statistical approach to persistent homology, which means that we consider data as generated from an unknown distribution. We start with several consistency results on persistent homology inference.

Estimation of the persistent homology of a metric space
Assume that we observe n points (X 1 , . . . , X n ) in a metric space (M, ρ) drawn i.i.d. from an unknown probability measure µ whose support is a compact set denoted X µ . The Gromov-Hausdorff distance allows us to compare X µ with compact metric spaces not necessarily embedded in M . In the following, an estimator X of X µ is a function of X 1 . . . , X n that takes values in the set of compact metric spaces and which is measurable for the Borel algebra induced by d GH .
Let Filt(X µ ) and Filt( X) be two filtrations defined on X µ and X. Starting from Theorem 9; an natural strategy for estimating the persistent homology of Filt(X µ ) consists in estimating the support X µ . Note that in some cases the space M can be unknown and the observations X 1 . . . , X n are then only known through their pairwise distances ρ(X i , X j ), i, j = 1, · · · , n. The use of the Gromov-Hausdorff distance allows us to consider this set of observations as an abstract metric space of cardinality n, independently of the way it is embedded in M . This general framework includes the more standard approach consisting in estimating the support with respect to the Hausdorff distance by restraining the values of X to the compact sets included in M .
The finite set X n := {X 1 , . . . , X n } is a natural estimator of the support X µ . In several contexts discussed in the following, X n shows optimal rates of convergence to X µ with respect to the Hausdorff distance. For some constants a, b > 0, we say that µ satisfies the (a, b)-standard assumption if for any x ∈ X µ and any r > 0, µ(B(x, r)) ≥ min(ar b , 1).
This assumption has been widely used in the literature of set estimation under Hausdorff distance Singh et al., 2009).
Let P = P(a, b, M ) be the set of all the probability measures on the metric space (M, ρ) satisfying the (a, b)-standard assumption on M : P := µ on M | X µ is compact and ∀x ∈ X µ , ∀r > 0, µ (B(x, r)) ≥ min 1, ar b .
The next theorem gives upper and lower bounds for the rate of convergence of persistence diagrams. The upper bound is a consequence of Theorem 10, while the lower bound is established using Le Cam's lemma.
Theorem 11. [Chazal et al. (2014b)] For some positive constants a and b, where the constant C only depends on a and b (not on M ). Assume moreover that there exists a non isolated point x in M and consider any sequence (x n ) ∈ (M \ {x}) N such that ρ(x, x n ) ≤ (an) −1/b . Then for any estimator dgm n of dgm(Filt(X µ )): where C is an absolute constant.
Consequently, the estimator dgm(Filt(X n )) is minimax optimal on the space P(a, b, M ) up to a logarithmic term as soon as we can find a non-isolated point in M and a sequence (x n ) in M such that ρ(x n , x) ∼ (an) −1/b . This is obviously the case for the Euclidean space R d .
Additive noise. Consider the convolution model where the observations satisfy Y i = X i + ε i where X 1 , . . . X n are sampled according to a measure µ as in the previous paragraph and where ε 1 , . . . , ε n are i.i.d. standard Gaussian random variables. It can be deduced from the results of Genovese et al. (2012) that the minimax convergence rates for the persistence diagram estimation in this context is upper bounded by some rate of the order of (log n) −1/2 . However, giving a tight lower bound for this problem appears to be more difficult than for the support estimation problem.

Estimation of the persistent homology of functions
Theorem 7 opens the door to the estimation of the persistent homology of functions defined on R d , on a submanifold of R d or more generally on a metric space. One important direction of research on this topic concerns various versions of robust TDA. One option is to study the persistent homology of the upper level sets of density estimators Fasy et al. (2014b). A different approach, more closely related to the distance function, but robust to noise, consists in studying the persistent homology of the sub level sets of the distance to measure defined in Section 4.2 Chazal et al. (2014a). The persistent homology of regression functions has also been studied in Bubenik et al. (2010). The alternative approach of Bobrowski et al. (2014) which is based on the inclusion map between nested pairs of estimated level sets can be applied with kernel density and regression kernel estimators to estimate persistence homology of density functions and regression functions.

Statistics for other signatures
Convergence and confidence regions (see next paragraph) can be proposed for persistence landscapes using similar stability results. However, a complete minimax description of the problem would also require to prove the corresponding lower bounds. Functional convergence for persistence landscapes and silhouettes have been studied in Chazal et al. (2015b).

Confidence regions for persistent homology
For many applications, in particular when the point cloud does not come from a geometric shape, persistence diagrams can be quite complex to analyze. In particular, many topological features are closed to the diagonal. Since they correspond to topological structures that die very soon after they appear in the filtration, these points are generally considered as noise, see Figure 16. Confidence regions of persistence diagram are rigorous answers to the problem of distinguishing between signal and noise in these representations.
The stability results given in Section 5.6 motivate the use of the bottleneck distance to define confidence regions. However alternative distances in the spirit of Wasserstein distances can proposed too. When estimating a persistence diagram dgm with an estimatordgm, we typically look for some value η α such that for α ∈ (0, 1). Let B α be the closed ball of radius α for the bottleneck distance and centered at dgm in the space of persistence diagrams. Following Fasy et al. (2014b), we can visualize the signatures of the points belonging to this ball in various ways. One first option is to center a box of side length 2α at each point of the persistence diagramdgm. An alternative solution is to visualize the confidence set by adding a band at (vertical) distance η α /2 from the diagonal (the bottleneck distance being defined for the ∞ norm), see Figure 18 for an illustration. The points outside the band are then considered as significant topological features, see Fasy et al. (2014b) for more details.
Several methods have been proposed in Fasy et al. (2014b) to estimate η α in the definition of the confidence region for the persistent homology of the measure support and for the sub-level sets of a density function. Except for the bottleneck bootstrap (see further), all the methods proposed in these papers rely on the stability results for persistence diagrams: confidence sets for diagrams can be derived from confidence sets in the sample space.
Subsampling approach. This method is based on a confidence region for the support K of the distribution of the sample in Hausdorff distance. LetX b be a subsample of size b drawn from the sampleX n , where b = o(n/logn). Let q b (1 − α) be the quantile of of the distribution of Haus X b , X n . Takeη α := 2q b (1 − α) whereq b is an estimation q b (1 − α) using a standard Monte Carlo procedure. Under an (a, b) standard assumption, and for n large enough, Fasy et al. (2014b) show that . Bottleneck Bootstrap. The stability results often leads to conservative confidence sets. An alternative strategy is the bottleneck bootstrap introduced in Chazal et al. (2016b). We consider the general setting where a persistence diagramdgm is defined from the observation (X 1 , . . . , X n ) in a metric space . This persistence diagram corresponds to the estimation of an underlying persistence diagram dgm, which can be related for instance to the support of the measure, or to the sublevel sets of a function related to this distribution (for instance a density function when the X i 's are in R d ). Let (X * 1 , . . . , X * n ) be a sample from the empirical measure defined from the observations (X 1 , . . . , X n ). Let alsodgm * be the persistence diagram derived from this sample.
We then can take for η α the quantityη α defined by Note thatη α can be easily estimated with Monte Carlo procedures. It has been shown in Chazal et al. (2016b) that the bottleneck bootstrap is valid when computing the sublevel sets of a density estimator.
Confidence bands for landscapes. A bootstrap algorithm can be used to construct confidence bands for landscapes . However the setting of this paper is slightly different than before since it is now assumed that we observe several landscapes λ 1 , . . . , λ N drawn i.i.d. from a random distribution in the space of landscapes. In this context the multiplier bootstrap strategy can be applied to construct a confidence band for E(λ 1 ).

Central tendency for persistent homology
The space of persistence diagrams being not an Hilbert space, the definition of a mean persistence diagram is not obvious and unique. One first approach to define a central tendency in this context is to define a Fréchet mean in this context. Indeed it has been proved in Mileyko et al. (2011) that the space of persistence diagrams is a Polish space. Fréchet means have also been characterized in Turner et al. (2014a). However they are may not be unique and there are very difficult to compute in practice. To overcome the problem of computational costs, sampling strategies can be proposed to compute topological signatures based on persistence landscapes. Given a large point cloud, the idea is to extract many subsamples, to compute the landscape for each subsample and then to combine the information. We assume that the diameter of M is finite and upper bounded by T 2 , where T is the same constant as in the definition of persistence landscapes in Section 5.4. For ease of exposition, we focus on the case k = 1, and set λ(t) = λ(1, t). However, the results we present in this section hold for k > 1.
For any positive integer m, let X = {x 1 , · · · , x m } ⊂ X µ be a sample of m points from µ. The corresponding persistence landscape is λ X and we denote by Ψ m µ the measure induced by µ ⊗m on the space of persistence landscapes. Note that the persistence landscape λ X can be seen as a single draw from the measure Ψ m µ . The point-wise expectations of the (random) persistence landscape under this measure is defined by E Ψ m µ [λ X (t)], t ∈ [0, T ]. The average landscape E Ψ m µ [λ X ] has a natural empirical counterpart, which can be used as its unbiased estimator. Let S m 1 , . . . , S m be independent samples of size m from µ ⊗m . We define the empirical average landscape as and propose to use λ m to estimate λ Xµ . Note that computing the persistent homology of X n is O(exp(n)), whereas computing the average landscape is O(b exp(m)).
Another motivation for this subsampling approach is that it can be also applied when µ is a discrete measure with support X N = {x 1 , . . . , x N } ⊂ M . This framework can be very common in practice, when a continuous (but unknown measure) is approximated by a discrete uniform measure µ N on X N .
The average landscape E Ψ m µ [λ X ] is an interesting quantity on its own, since it carries some stable topological information about the underlying measure µ, from which the data are generated. In particular, Theorem 12. ] Let X ∼ µ ⊗m and Y ∼ ν ⊗m , where µ and ν are two probability measures on M . For any p ≥ 1 we have where W p is the pth Wasserstein distance on M .
The result of Theorem 12 is useful for two reasons. First, it tells us that for a fixed m, the expected "topological behavior" of a set of m points carries some stable information about the underlying measure from which the data are generated. Second, it provides a lower bound for the Wasserstein distance between two measures, based on the topological signature of samples of m points.

Persistent homology and machine learning
In some domains persistence diagrams obtained from data can be directly interpreted and exploited for better understanding of the phenomena from which the data have been generated. This, for example, the case in the study of force fields in granular media Kramar et al. (2013) or of atomic structures in glass Nakamura et al. (2015) in material science, in the study of the evolution of convection patterns in fluid dynamics Kramár et al. (2016) or in the analysis of nanoporous structures in chemistry Lee et al. (2017) where topological features can be rather clearly related to specific geometric structures and patterns in the considered data.
There are many other cases where persistence features cannot be easily or directly interpreted but present valuable information for further processing. However, the highly non linear nature of diagrams prevents them to be immediately used as standard features in machine learning algorithms. Persistence landscapes and their variants, introduced in Section 5.4 offer a first option to convert persistence diagrams into elements of a vector space and have been used, for example, for protein binding Kovacev-Nikolic et al. (2016) or object recognition Li et al. (2014). In the same vein, the construction of kernels for persistence diagrams that preserve their stability properties has recently attracted some attention. Most of them have been obtained by considering diagrams as discrete measures in R 2 . Convolving a symmetrized (with respect to the diagonal) version of persistence diagrams with a 2D Gaussian distribution, Reininghaus et al. (2015) introduce a multi-scale kernel and apply it to shape classification and texture recognition problems. Considering Wasserstein distance between projections of persistence diagrams on lines, Carriere and Oudot (2017) build another kernel and test its performance on several benchmarks. Other kernels, still obtain by considering persistence diagrams as measures, have also been proposed in Kusano et al. (2017).
Various other vector summaries of persistence diagrams have been proposed and then used as features for different problems. For example, basic summaries are considered in Bonis et al. (2016) and combined with quantization and pooling methods to address non rigid shape analysis problems; Betti curves extracted from persistence diagrams are used with 1-dimensional Convolutional Neural Networks (CNN) to analyze time dependent data and recognize human activities from inertial sensors in Umeda (2017); persistence images are introduced in Adams et al. (2017) and are considered to address some inverse problems using linear machine learnig models in Obayashi and Hiraoka (2017).
Connections between persistence homology and deep learning have also very recently started to be explored. For example, as already mentioned above, Umeda (2017) combine persistent homology with CNNs to analyze multivariate time-dependent data. Approaches combining persistence and deep learning have also been proposed in molecular biology -see, e.g., Cang and Wei (2017).
The above mentioned kernels and vector summaries of persistence diagrams are built independently of the considered data analysis or learning task. Moreover, it appears that in many cases the relevant topological information is not carried by the whole persistence diagrams but is concentrated in some localized regions that may not be obvious to identify. This usually makes the choice of a relevant kernel or vector summary very difficult for the user. To overcome this issue, Hofer et al. (2017) proposes a deep learning approach that allows to learn the relevant topological features for a given task.
As illustrated in this section, combining tda and more specifically persistent homology, with machine learning has recently became an active research direction with already promising results but still many theoretical and practical open questions and problems.

Bootstrap and comparison of protein binding configurations
This example is borrowed from Kovacev-Nikolic et al. (2016). In this paper, persistent homology is used to analyze protein binding and more precisely it compares closed and open forms of the maltose-binding protein (MBP), a large biomolecule consisting of 370 amino acid residues. The analysis is not based on geometric distances in R 3 but on a metric of dynamical distances defined by where C is the correlation matrices between residues. The data can be download at this link 7 .
1 import numpy a s np 2 import gudhi a s gd 3 import pandas a s pd 4 import s e a b o r n a s s n s 5 6 c o r r _ p r o t e i n = pd . read_csv ( "mypath /1 a n f . corr_1 . t x t " , 7 h e a d e r=None , 8 d e l i m _ w h i t e s p a c e=True ) 9 d i s t _ p r o t e i n _ 1 = 1− np . abs ( c o r r _ p r o t e i n _ 1 . v a l u e s ) 10 rips_complex_1= gd . RipsComplex ( d i s t a n c e _ m a t r i x=d i s t _ p r o t e i n _ 1 , 11 max_edge_length =1.1) 12 simplex_tree_1 = rips_complex_1 . c r e a t e _ s i m p l e x _ t r e e ( max_dimension=2) 13 diag_1 = simplex_tree_1 . p e r s i s t e n c e ( ) 14 gd . p l o t _ p e r s i s t e n c e _ d i a g r a m ( diag_1 ) Figure 16: Persistence diagrams for two configurations of MBP.
For comparing persistence diagrams, we use the bottleneck distance. The block of statements given below computes persistence intervals and computes the bottleneck distance for 0-homology and 1-homology: 1 i n t e r v 0 _ 1 = simplex_tree_1 . p e r s i s t e n c e _ i n t e r v a l s _ i n _ d i m e n s i o n ( 0 ) 2 i n t e r v 0 _ 2 = simplex_tree_2 . p e r s i s t e n c e _ i n t e r v a l s _ i n _ d i m e n s i o n ( 0 ) 3 bot0 = gd . b o t t l e n e c k _ d i s t a n c e ( interv0_1 , i n t e r v 0 _ 2 ) 4 5 i n t e r v 1 _ 1 = simplex_tree_1 . p e r s i s t e n c e _ i n t e r v a l s _ i n _ d i m e n s i o n ( 1 ) 6 i n t e r v 1 _ 2 = simplex_tree_2 . p e r s i s t e n c e _ i n t e r v a l s _ i n _ d i m e n s i o n ( 1 ) 7 bot1 = gd . b o t t l e n e c k _ d i s t a n c e ( interv1_1 , i n t e r v 1 _ 2 ) In this way, we can compute the matrix of bottleneck distances between the fourteen MPB. Finally, we apply a multidimensional scaling method to find a configuration in R 2 which almost match with the bottleneck distances, see Figure 17. We use the scikit-learn library for the MDS: 1 import m a t p l o t l i b . p y p l o t a s p l t 2 from s k l e a r n import m a n i f o l d We now define a band of confiance for a diagram using the bottleneck bootstrap approach. We resample over the lines (and columns) of the matrix of distances and we compute the bottleneck distance between the original persistence diagram and the bootstrapped persistence diagram. We repeat the procedure many times and finally we estimate the quantile 95% of this collection of bottleneck distances. We take the value of the quantile to define a confidence band on the original diagram (see Figure 18). However, such a procedure should be considered with caution because as far as we know the validity of the bottleneck bootstrap has not been proved in this framework. Figure 18: Persistence diagram and confidence region for the persistence diagram of a MBP.

Classification for sensor data
In this experiment, the 3d acceleration of 3 walkers (A, B and C) have been recorded from the sensor of a smart phone 8 . Persistence homology is not sensitive to the choice of axes and so no preprocessing is necessary to align the 3 times series according to the same axis. From these three times series, we have picked at random sequences of 8 seconds in the complete time series, that is 200 consecutive points of acceleration in R 3 . For each walker, we extract 100 time series in this way. The next block of statements computes the persistence for the alpha complex filtration for data_A_sample, one of the 100 times series of acceleration of Walker A.
From diag_Alpha we can then easily compute and plot the persistence landscapes, see Figure 19. For all the 300 times series, we compute the persistence landscapes for dimension 0 and 1 and we compute the three first landscapes for the 2 dimensions, see Figure 19. Moreover, each persistence landscape is discretized on 1000 points. Each time series is thus described by 6000 topological variables. To predict the walker from these features, we use a random forest (Breiman, 2001), which is known to be an efficient in such an high dimensional setting. We split the data into train and test tests at random several times. We finally obtain a averaged classification error around 0.95. We can also visualize les most important variables in the Random Forest, see Figure 20.  The 3 000 first coefficients correspond to the three landscapes of dimension 0 and the 3 000 last coefficients to the three landscapes of dimension 1. There are 1000 coefficients per landscape. Note that the first landscape of dimension 0 is always the same using the Rips complex (a trivial landscape) and consequently the corresponding coefficients have a zero importance value.