Topological Data Analysis
CSC_51056_EP · Year 1 · Period 1
Contents
- Introduction and overview
- 0. Refresher: topology, distances, algebra
- 1. Simplices and simplicial complexes
- 2. From point cloud to complex: Rips and Čech
- 3. Simplicial homology
- 4. Persistent homology: the algorithm
- 5. Diagrams, barcodes and landscapes
- 6. The Mapper algorithm
- 7. Stability and statistics
- 8. TDA × machine learning
- 9. Hands-on: GUDHI, scikit-tda, ripser
- 10. Course research notes — Inria Datashapes (Oudot)
- Exercises
- Projects and assessment
- References
Introduction and overview
| Module | Topological Data Analysis |
| Code | CSC_51056_EP |
| Team and workload | Head (“Responsables” and occurrence coordinator on the 2026-2027 sheet): Steve Oudot (École Polytechnique · Inria, Datashapes team) · 36 h in person in 9 blocks (slots) — the lecture / small-class split is not displayed; teaching methods: lectures, tutorials and computer labs · enrollment 1 to 50 · 4.5 ECTS · making the shape of data speak: simplicial complexes, persistent homology, persistence diagrams and Mapper — the algebraic backbone that GNNs cannot see, and the favorite tool of the Inria Datashapes team. |
| Period | Autumn 2026 · period 1 (X-3A-P1, from 17/09/2026 to 18/12/2026) · materials in English; course taught in French or English depending on the students’ preference (occurrence language: English) |
| Assessment | Written final exam, with the possibility of adding a graded lab course (description of the sheet; the LLGA assessment section of the sheet is empty, and the same rule is repeated for the other degrees, with resit allowed and the course unit acquired at a final grade ≥ 10) |
| Status in the program | P1 electiveGraph × LLM route one of the “Choose 3” electives of Year 1 · Period 1 (official LLGA 1 – S1 2026–2027 list), preselected by the Graph × LLM route of the home page |
Audience: an ML engineer who feels that means and variances are not enough to describe data made of clusters, loops or cavities. Empirical first: each topic starts from an observation — two datasets with the same statistics but opposite topologies, a hole that vanishes as soon as the scale ε is poorly chosen — and only then names the tools: simplices, Rips complexes, persistence diagrams.
The module teaches how to read the shape of data, a complement to the linear methods and to the GNNs of the program.
What you will be able to do
- Build simplicial complexes (Rips, Čech) from a point cloud and understand what they encode.
- Compute simplicial homology groups by hand on small complexes.
- Run the persistent homology algorithm and read diagrams, barcodes and landscapes.
- State the stability theorems and leverage them to do statistics on diagrams.
- Vectorize persistence in order to plug it into a machine learning pipeline.
- Apply the Mapper algorithm to visually explore a complex dataset.
- Carry out TDA in practice with the GUDHI, scikit-tda and ripser libraries.
Official objectives and syllabus (2026-2027 catalog)
The official course description presents topological data analysis as “a recent branch of machine learning and data mining”, whose idea is to leverage tools from algebraic topology to analyze complex datasets whose observations lie on or near non-trivial geometric structures, which can fool classical methods.
The goal is to familiarize students with this topic “at the crossing of pure mathematics, applied mathematics and computer science”, with an emphasis on the methods, their theoretical guarantees and hands-on work on complex data (notably multimedia: images, 3D shapes). The official course alternates lectures with exercise or machine sessions, and suggests the readings of Edelsbrunner & Harer, Oudot and Munkres (repeated in our references).
| Official syllabus topic | Course section |
|---|---|
| Introduction to topological persistence through a data clustering application | Chapter 2, section A first look at persistence (0-dimensional persistence = single linkage / minimum spanning tree, chaining, density persistence and ToMATo, Examples 2.8 and 2.10); generalized in chapter 4; ToMATo’s guarantee in 10.3 |
| Simplicial and singular homology | Chapter 3 (simplicial homology, def. 3.6 for singular homology) |
| Persistence theory | Chapters 4 (decomposition, algorithm), 5 (bottleneck distance) and 7 (bottleneck and algebraic stability, Theorems 7.1–7.2) |
| Topological inference | Chapter 7 (prop. 7.4: reach, union of balls and sampling guarantees), supported by the nerve theorem of chapter 2 |
| Topological descriptors | Chapter 5 (diagrams, barcodes, landscapes) and chapter 2 (Euler–Poincaré characteristic) |
| Topological statistics and machine learning | Chapters 7 (bootstrap, confidence bands) and 8 (TDA × machine learning) |
| Teaching methods: lectures, tutorials, computer labs; practice on multimedia data (images, 3D shapes) | Exercises of each chapter and the labs of chapter 9 (GUDHI, ripser, scikit-tda) |
All the topics of the official syllabus are covered: singular homology (def. 3.6) and topological inference (prop. 7.4) were added earlier to calibrate these materials to the course description, and the clustering introduction to persistence (chapter 2, Definitions 2.7 and 2.9) was added against the 2026-2027 sheet, which lists it first.
Our extensions, beyond the official syllabus: the refresher chapter 0, chapter 6 (the Mapper algorithm), chapter 9 (hands-on with GUDHI, scikit-tda, ripser) and chapter 10 (the work of the Inria Datashapes team).
Official prerequisites: “solid foundations in linear and bilinear algebra”, notions of general topology, a background in statistics useful but not indispensable on the mathematics side; a background in algorithms and programming on the computer science side (the École Polytechnique engineering students must moreover have validated the FMA_51057_EP course unit).
Where this course fits in the program
Module of period 1 of M1 (36 h, 4.5 ECTS), one of the “Choose 3” electives of Period 1, preselected by the Graph × LLM route of the home page: it reads the shape that graphs and embeddings inherit. It also suits research-oriented profiles and demanding data science.
- Prerequisites — official: solid foundations in linear and bilinear algebra, notions of general topology, a background in algorithms and programming. Internally: the probabilistic background of the Refresher in Statistics and linear algebra (vector spaces, eigenvalues). The refresher chapter 0 covers topology, distances, algebra and the graph vocabulary used here (components, cliques, cycles), so no graph course is assumed.
- Downstream modules — Digital Representation and Analysis of Shapes, a sibling Period 1 option, recalls chapters 3–4 in its chapter 9 and adds its own alpha-complex filtration. In Period 2, Graph ML classifies graphs with kernels and GNNs, the setting of the graph lab of ch. 9; in M2, Advanced GNN studies the 1-WL limit that topological descriptors can bypass.
- A bridge, not a topic — Analysis and Deep Learning on Geometric Data (M2) teaches no persistence, but its heat kernel signature is the filtration function of the graph lab of ch. 9; combining the two is a project subject below. TDA is also a strong marker for a research orientation, Steve Oudot’s Inria Datashapes team supervising work along this line.
Canonical statements. Other LLGA pages link here instead of re-deriving: simplicial homology, the standard persistence algorithm and the bottleneck stability theorem.
Course outline
- Refresher: topology, distances, algebra — the topological and algebraic veneer indispensable for the rest of the course.
- Simplices and simplicial complexes — the bricks that approximate a continuous space from points.
- From point cloud to complex: Rips and Čech — building a shape at several scales from raw data, and a first look at persistence through clustering (single linkage, density persistence).
- Simplicial homology — counting the components, loops and cavities of a complex.
- Persistent homology: the algorithm — tracking the appearance and disappearance of holes as the scale grows.
- Diagrams, barcodes and landscapes — the canonical representations of persistence, and their uses.
- The Mapper algorithm — an exploratory map of a dataset from a function of interest.
- Stability and statistics — why persistence resists noise, and how to do statistics with it.
- TDA × machine learning — plugging persistence into standard ML pipelines.
- Hands-on: GUDHI, scikit-tda, ripser — going from theory to code on real data.
- Course research notes — Inria Datashapes (Oudot) — a tour of the research work of the Inria Datashapes team.
- Exercises, Projects and assessment and References — systematic training, project subjects with a sample exam, and sources to go further.
Session plan
36 h in class = 9 blocks of 4 h. The volume is the one of the SynapseS 2026–2027 sheet: “36 hours in person (9 blocks or slots)”, without a lecture / small-class split; the sheet lists its topics but publishes no session-by-session programme, so the split below is our proposal for covering these notes in nine blocks, in the order of the official topic list (clustering introduction to persistence first, in block 2).
Level 1 = foundations (refreshers, definitions, first complete computations), 2 = core theory and algorithms, 3 = advanced material (stability theorems, learning with persistence); the level never goes down from one session to the next.
| Session | Hours | Level | Content | Practice |
|---|---|---|---|---|
| 1 | 4 h | 1 | ch. 0 Refresher: homotopy, arithmetic in \mathbb{F}_2; ch. 1 Simplices, boundary, simplicial complexes | Ex. 1 |
| 2 | 4 h | 1 | ch. 2 From point cloud to complex: Čech, Rips, nerve theorem, Jung bracket, Euler characteristic; a first look at persistence through clustering (single linkage, ToMATo idea, Examples 2.8 and 2.10) | Ex. 7, Ex. 8 |
| 3 | 4 h | 2 | ch. 3 Simplicial homology: chains, cycles, boundaries, the complete computations, homology of graphs, Euler–Poincaré, torsion, singular homology | Ex. 2, Ex. 6 |
| 4 | 4 h | 2 | ch. 4 Filtrations, interval decomposition, the standard reduction algorithm, the algorithm step by step (Def. 4.1–Example 4.5) | lab: implement the reduction in NumPy; Ex. 3 |
| 5 | 4 h | 2 | ch. 4 (end) Betti curves, zigzag and multi-parameter variants; ch. 5 Persistence diagrams, bottleneck and Wasserstein distances, landscapes | Ex. 4, Ex. 5 |
| 6 | 4 h | 2 | ch. 6 The Mapper algorithm | Ex. 10 (lab); Lab 5 of ch. 9 (Mapper with GUDHI) |
| 7 | 4 h | 3 | ch. 7 Stability and statistics: bottleneck and algebraic stability, interleavings, distance-to-measure, Hausdorff and Gromov–Hausdorff, topological inference | Ex. 9; lab: stability under resampling (Lab 2 of ch. 9) |
| 8 | 4 h | 3 | ch. 8 TDA × machine learning: sliced Wasserstein kernel, PersLay and Deep Sets, topological losses | Lab 4 of ch. 9 (graph classification on MUTAG); Ex. 12 (start) |
| 9 | 4 h | 3 | ch. 8 (end) Flagship applications; ch. 9 Hands-on with GUDHI, ripser, scikit-tda (Labs 1–5, Labs 2, 4 and 5 started in sessions 6–8) | Ex. 11 (paper presentations) |
Self-study, outside the 36 h (about 2 h in total): ch. 10 Course research notes — Inria Datashapes (Oudot), which supplies the papers of Ex. 11 (≈ 2 h, plus the reading of the chosen paper).
How to study this module
- Do the refresher section without skipping it: the topological vocabulary (open sets, connectedness, distances) is used as-is everywhere afterwards.
- Compute by hand the homology of small complexes (a few triangles) before running ripser: the algorithm becomes crystal clear once the trivial cases are mastered.
- Draw the barcodes: a long feature is a true signal, a collection of short features is noise — the eye gets trained.
- Simulate: add noise to a circle, a union of two circles, and observe the stability of the diagrams promised by theory.
- Redo the exercises of each section before moving on to the next; the final software implementation reuses all of them.
- For a project or an internship, confront TDA early with a dataset familiar to you: it is the best test of understanding.
Independent note TDA gives the master’s program its “beyond averages” analysis tool: the word and document embeddings produced by the Introduction to Text Mining and NLP and Large Language Models modules are so many point clouds whose persistence reveals the structure, and the graph analysis of the Graph ML module benefits from being crossed with topological descriptors. Finally, it is an excellent springboard toward academic research, at École Polytechnique as at Inria.
0. Refresher: topology, distances, algebra
Classical machine learning treats a point cloud \mathcal{X} \subseteq \mathbb{R}^d as a collection of individuals; topological data analysis (TDA) treats it as a space whose shape we want to understand: how many pieces, loops, cavities? Three toolboxes are needed: distances (they build the complexes of ch. 2), a bit of topology (it defines shape equivalence), and linear algebra over \mathbb{F}_2 (it makes homology computable).
L3 prerequisites — what we reuse in this module
Metric spaces: a distance d(x, y) \geq 0 is symmetric, zero only at x = y, and satisfies the triangle inequality.
Norms and balls: \ell_2 and \ell_\infty norms on \mathbb{R}^d, open balls B(x, r), closed balls \overline{B}(x, r); usual distances between clouds (nearest neighbor, Hausdorff: reminder in ch. 7).
Topology: open sets, closed sets, compact sets, continuity; a compact subset of \mathbb{R}^d is closed and bounded (Borel–Lebesgue theorem); the continuous image of a compact set is compact. We will use these notions only as guardrails, not as a technical chapter.
Linear algebra (cf. Refresher CS module, ch. 2): image and kernel of a linear map, rank theorem; eigenvalues, and the spectral radius \rho(M), the largest modulus of an eigenvalue of M; and above all the field \mathbb{F}_2 = \{0, 1\} where 1 + 1 = 0: addition = exclusive OR.
Graphs: a graph G = (V, E) has n vertices and m edges. Its connected components are the classes of the relation “joined by a path”; we write c for their number.
A clique is a set of vertices pairwise joined by an edge, and a cycle is a closed path without repeated vertex. The cyclomatic number m - n + c counts the independent cycles; Proposition 3.4 proves it.
Minimum spanning trees, Kruskal’s algorithm and union–find are in the Refresher CS module, section 7.5. Learning on graphs comes later, in the Graph ML module of Period 2: its pointers below are previews, never prerequisites.
Complexity (cf. Refresher CS module, ch. 4): we will count operations as a function of the number n of points and the number of simplices.
Definition 0.1 — Homotopy equivalence Two continuous maps f, g : X \to Y are homotopic if there exists a continuous H : X \times [0, 1] \to Y with H(\cdot, 0) = f and H(\cdot, 1) = g: f deforms continuously into g.
Two spaces X, Y have the same homotopy type (written X \simeq Y) if there exist f : X \to Y and g : Y \to X with g \circ f and f \circ g homotopic to the identities.
This is the right notion of “same shape” for this course: a disk retracts onto a point (D^2 \simeq \{\ast\}), an annulus cannot — it keeps its hole.
Why homotopy rather than isometry? Real data is never known up to isometry: resampling, noise, anisotropic dilations deform it. Algebraic topology extracts the invariants that survive any continuous deformation: connected components, loops, cavities — qualitative and robust information, complementary to the distances and angles exploited by PCA or k-means (Machine Learning module, ch. 7), and to everything that message passing sees (Graph ML module, ch. 5 — preview).
Definition 0.2 — Arithmetic in \mathbb{F}_2 In \mathbb{F}_2 = \{0, 1\}, 0 + 0 = 0, \qquad 1 + 0 = 1, \qquad 1 + 1 = 0, and multiplication is logical AND. Every element is its own opposite (x + x = 0): subtracting is adding.
A finite-dimensional \mathbb{F}_2-vector space is identified with its set of vectors; an m \times n matrix with coefficients in \mathbb{F}_2 is a linear map \mathbb{F}_2^n \to \mathbb{F}_2^m, and the rank is computed by Gaussian elimination exactly as over \mathbb{R}.
| Object | Over \mathbb{R} | Over \mathbb{F}_2 |
|---|---|---|
| coefficients | any real value | 0 or 1 — presence/absence |
| addition | sum | exclusive OR: x + x = 0 |
| opposite | -x | x itself |
| boundary signs (-1)^i | necessary | useless — every sign equals 1 |
| rank computation | Gaussian pivot | bit-by-bit Gaussian pivot (even faster) |
Module outline. Chapters 1 to 3 build the theory: simplices, complexes, homology — with each time the complete computation on human-sized examples. Chapter 4 is the algorithmic heart (persistence, boundary matrix, reduction demonstrated step by step).
Chapter 5 gives the statistical objects (diagrams, barcodes, landscapes) and chapter 6 the Mapper algorithm, which needs only complexes and clustering; chapter 7 proves the guarantees (stability theorems) on which the bridges toward learning of chapter 8 rest. Chapter 9 puts everything into code, and chapter 10 presents the research of the teaching team.
Independent note This module completes the master’s “structure” triptych: Graph ML (M1 P2) reads graphs through linear algebra and random walks; Analysis and Deep Learning on Geometric Data (M2) reads them through symmetries; TDA reads them through commutative algebra.
The three meet again in M2 around position and structure encodings (Advanced GNN module, ch. 4 — preview): counting Rips-style loops is a structure encoding that GNNs only imperfectly approximate. The topological kernels of ch. 8 join the kernel SVMs of the Machine Learning module (ch. 3 and 5), and the bottleneck distance of ch. 5 the Wasserstein family of the Optimal Transport module (Period 2 — preview).
1. Simplices and simplicial complexes
Concrete scene: a clustering with a “perfect” score that still misses a loop in the data — say, a cyclic process that the clusters cut into pieces. To see such a loop, a dataset must be turned into a space made of points, edges, triangles and their higher analogues; this chapter defines these building blocks, the simplices, and the complexes they form.
What breaks Three classic mistakes, met in the following chapters: building the complex at a single, badly chosen scale; interpreting a hole that does not persist across scales; and forgetting that the identity \partial\circ\partial=0 of this chapter is what makes everything that follows work.
A graph can only represent binary relations. To encode ternary relations (three points close to one another), quaternary ones… at the end of which live loops and cavities, we generalize edges and triangles: these are the simplices. The whole rest of the course rests on this single generalization.
Definition 1.1 — Geometric simplex Let k + 1 points v_0, \dots, v_k of \mathbb{R}^d be affinely independent (no plane of dimension k - 1 contains them all). The geometric k-simplex they span is their convex hull: \sigma = [v_0, \dots, v_k] = \Big\{ \textstyle\sum_i \lambda_i v_i \;:\; \lambda_i \geq 0, \; \sum_i \lambda_i = 1 \Big\}. The integer k is the dimension of \sigma; the \lambda_i are the barycentric coordinates; the point \sum_i \frac{1}{k+1} v_i is the barycenter.
Vocabulary: 0-simplex = point, 1-simplex = segment, 2-simplex = filled triangle, 3-simplex = filled tetrahedron.
Definition 1.2 — Faces and oriented boundary Any subfamily \{v_{i_0}, \dots, v_{i_{\ell}}\} \subseteq \{v_0, \dots, v_k\} spans a face of \sigma, of dimension \ell — a proper face if \ell < k. The oriented boundary of the k-simplex is the alternating formal sum of its codimension-1 faces: \partial [v_0, \dots, v_k] \;=\; \sum_{i=0}^{k} (-1)^i\, [v_0, \dots, \widehat{v_i}, \dots, v_k], where the hat marks omission.
Example: \partial[a, b] = b - a and \partial[a, b, c] = [b, c] - [a, c] + [a, b]. Over \mathbb{F}_2, all signs equal +1: the boundary is the unoriented sum of the faces.
Proposition 1.3 — The boundary of a boundary is zero: \partial \circ \partial = 0 For every k-simplex, \partial(\partial \sigma) = 0, over \mathbb{Z} as well as over \mathbb{F}_2.
Proof. Over \mathbb{F}_2 (counting argument). Each (k-2)-face \tau = [v_0, \dots, \widehat{v_i}, \dots, \widehat{v_j}, \dots, v_k] of \sigma (with i < j) appears exactly twice in \partial(\partial \sigma).
It appears once as a face of face i (with v_j subsequently omitted) and once as a face of face j (with v_i subsequently omitted). Since 1 + 1 = 0 in \mathbb{F}_2, all contributions cancel in pairs.
Over \mathbb{Z} (sign argument). Let us copy the two occurrences.
In \partial[v_0, \dots, \widehat{v_i}, \dots, v_k], the face \tau receives the sign (-1)^{j-1} (the index of v_j has been shifted by one after the omission of v_i, since i < j).
In \partial[v_0, \dots, \widehat{v_j}, \dots, v_k], it receives (-1)^{i}. The total contribution is (-1)^i (-1)^{j-1} + (-1)^j (-1)^i = (-1)^i\big((-1)^{j-1} + (-1)^j\big) = 0 . ∎
The physical intuition of \partial^2 = 0 The boundary of a segment is the difference of its endpoints; the boundary of a triangle walks around its oriented contour — each edge of the contour, taken in both directions, ends up canceled: the boundary of a boundary bounds nothing. This seemingly innocuous identity manufactures all of homology: it makes possible the question “which cycles are not boundaries?” — that is, “which loops genuinely enclose a hole?”.
Definition 1.4 — Simplicial complex (geometric and abstract) A geometric simplicial complex K is a finite set of simplices of \mathbb{R}^d such that (i) every face of a simplex of K is in K, and (ii) the intersection of two simplices of K is a common face (possibly empty). Its realization |K| is the union of its simplices, endowed with the induced topology.
An abstract complex is a finite set K of finite subsets of a vertex set, stable under taking subsets: \sigma \in K and \tau \subseteq \sigma imply \tau \in K.
The k-skeleton of K gathers its simplices of dimension at most k: the 1-skeleton is a graph (vocabulary in the refresher of ch. 0).
Example 1.5 — Three complexes to know by heart
- The hollow triangle S: 3 vertices a, b, c, 3 edges, no face — it is a circle: |S| \simeq \mathbb{S}^1.
- The filled triangle D: we add the face [a, b, c]: |D| is a disk, contractible (|D| \simeq \{\ast\}). Same 1-skeleton, different shapes: the difference resides in dimension 2.
- The hollow sphere K_{\mathbb{S}^2}: the boundary of the tetrahedron — 4 vertices, 6 edges, 4 triangular faces, nothing above. It is the most economical complex representing the sphere \mathbb{S}^2; it possesses a cavity. We compute it entirely in ch. 3.
Proposition 1.6 — Every abstract complex admits a realization Every abstract complex K of dimension k admits a geometric realization in \mathbb{R}^{2k+1}, unique up to homeomorphism.
Proof. (Sketch.) Embed the vertices of K on the moment curve t \mapsto (t, t^2, \dots, t^{2k+1}) \in \mathbb{R}^{2k+1}. Any family of at most 2k + 2 points of this curve is affinely independent (a hyperplane of \mathbb{R}^{2k+1} meets the curve at the roots of a non-zero polynomial of degree at most 2k + 1, hence in at most 2k + 1 points).
Two simplices of K, which together have at most 2(k+1) distinct vertices, are thus automatically in general position: their intersection is exactly the simplex spanned by the common vertices — a face of both.
Uniqueness up to homeomorphism is more delicate (simplicial approximation theorem) and out of scope. ∎
Combinatorial control A complex with n vertices and dimension k has at most \binom{n}{k+1} simplices of dimension k. This is the first practical difficulty of TDA: the number of simplices explodes with the dimension and density of the cloud; ch. 9 (software) is a battle against this explosion, which ripser and GUDHI win on the 1-skeleton (flag complexes, sparse boundary matrix).
2. From point cloud to complex: Rips and Čech
Given a cloud \mathcal{X} = \{x_1, \dots, x_n\} \subseteq \mathbb{R}^d sampled “on” an unknown shape M, how do we build a complex whose realization has the same shape as M? The idea: grow balls around the points and connect the balls that intersect. Two families stand out, with an accuracy/cost trade-off that Proposition 2.4 quantifies.
Definition 2.1 — Čech complex For r \geq 0, the Čech complex \check{C}_r(\mathcal{X}) contains the subsets \sigma \subseteq \mathcal{X} such that the intersection of the open balls is non-empty: \sigma = \{x_{i_0}, \dots, x_{i_k}\} \in \check{C}_r(\mathcal{X}) \iff \bigcap_{j=0}^{k} B(x_{i_j}, r) \neq \emptyset. A simplex is in the complex as soon as its vertices share a common point; the parameter r is the radius.
Definition 2.2 — Vietoris–Rips complex For \varepsilon \geq 0, the Vietoris–Rips complex \mathrm{Rips}_\varepsilon(\mathcal{X}) contains the subsets \sigma of diameter at most \varepsilon: \sigma \in \mathrm{Rips}_\varepsilon(\mathcal{X}) \iff \max_{x, y \in \sigma} \|x - y\| \leq \varepsilon. It is the flag complex (or clique complex) of the scale-\varepsilon neighborhood graph: its simplices are exactly the cliques of this graph, the sets of points pairwise within the threshold (ch. 0). The parameter \varepsilon is a distance threshold.
Theorem 2.3 (nerve theorem) — Čech ≃ union of balls Let \mathcal{U} = \{U_i\}_{i \in I} be a finite family of convex open sets of \mathbb{R}^d (or more generally with contractible intersections). Then the nerve of the family — the abstract complex \mathrm{Nerve}(\mathcal{U}) = \{\sigma \subseteq I : \bigcap_{i \in \sigma} U_i \neq \emptyset\} — has the same homotopy type as the union: \big| \mathrm{Nerve}(\mathcal{U}) \big| \;\simeq\; \bigcup_{i \in I} U_i. In particular \check{C}_r(\mathcal{X}) \simeq \bigcup_i B(x_i, r): the Čech complex is the inflated shape, in the homotopy sense.
Proof. (Idea, out of scope.) One constructs a partition-of-unity map \phi : \bigcup_i U_i \to |\mathrm{Nerve}(\mathcal{U})| which, to each point, associates the barycenter of the U_i containing it, weighted by continuous functions \psi_i vanishing outside U_i.
When the U_i and their intersections are contractible, Borsuk’s theorem (or Weil’s nerve lemma) ensures that \phi is a homotopy equivalence. Exercise 7 proves the one-dimensional case (intervals of \mathbb{R}). ∎
Proposition 2.4 — Rips and Čech bracket each other (Jung inequalities) In \mathbb{R}^d with the Euclidean norm, for every \varepsilon \geq 0 and with the above conventions:
Key result — the Rips–Čech bracket \check{C}_{\varepsilon/2}(\mathcal{X}) \;\subseteq\; \mathrm{Rips}_\varepsilon(\mathcal{X}) \;\subseteq\; \check{C}_{\varepsilon/\sqrt{2}}(\mathcal{X}).
Proof. First inclusion. If \sigma \in \check{C}_{\varepsilon/2}, the balls B(x, \varepsilon/2), x \in \sigma, have a common point p. By the triangle inequality, for all x, y \in \sigma, \|x - y\| \leq \|x - p\| + \|p - y\| < \varepsilon , so \mathrm{diam}(\sigma) < \varepsilon and \sigma \in \mathrm{Rips}_\varepsilon.
Second inclusion. Jung’s theorem (1901) states that every set of diameter \delta of \mathbb{R}^d is included in a ball of radius \delta \sqrt{\frac{d}{2(d+1)}} \leq \frac{\delta}{\sqrt 2} . If \mathrm{diam}(\sigma) \leq \varepsilon, it therefore provides a point p at distance at most \varepsilon/\sqrt{2} from all vertices: \sigma \in \check{C}_{\varepsilon/\sqrt{2}}.
The constant \sqrt{d/(2(d+1))} is attained by the regular simplex of dimension d and tends toward 1/\sqrt{2}: the bracket therefore holds in every dimension with \sqrt{2}, and is asymptotically optimal. ∎
Practical consequences
Čech is exact, Rips is computable. Čech benefits from the nerve theorem (2.3); but testing whether k+1 balls intersect is an optimization problem of dimension d. Rips is content with the graph of \varepsilon-neighborhoods and then enumerates its cliques: the whole computation is combinatorial, independent of d.
Bracket 2.4 says that the price to pay for going from one to the other is a factor of at most \sqrt{2} on the parameter.
\ell_\infty norm: de Silva and Ghrist (2007) show that under \ell_\infty the bracket collapses exactly, \mathrm{Rips}_\varepsilon = \check{C}_{\varepsilon/2} , so cubes lend themselves better than balls to the flag construction.
Filtration, not complex: the right object is not a complex at one fixed \varepsilon but the increasing family \{\mathrm{Rips}_\varepsilon\}_{\varepsilon \geq 0} — the object of chapter 4. The reader will verify that \varepsilon \leq \varepsilon' implies the inclusion of the complexes: this is a filtration in the sense of Definition 4.1.
Example 2.5 — Three equidistant points Let \mathcal{X} consist of the three vertices of an equilateral triangle of side s, whose circumradius is s/\sqrt{3} \approx 0.577\,s.
Čech (open balls):
- for r \leq s/2, three isolated vertices;
- for s/2 < r \leq s/\sqrt{3}, the balls meet two by two but have no common point — the hollow triangle, a loop \mathbb{S}^1;
- for r > s/\sqrt{3}, the circumcenter lies in all three balls and the triangle is filled, contractible.
Rips: for \varepsilon < s, three isolated vertices; at \varepsilon = s, the three edges and the triangle enter together, since Rips is a flag complex — the loop never appears.
The two complexes therefore disagree for s/2 < r \leq s/\sqrt{3}: Čech sees a hole that Rips fills immediately.
Bracket 2.4 is respected — at \varepsilon = s, \check{C}_{s/2} (three points) \subseteq \mathrm{Rips}_s (filled triangle) \subseteq \check{C}_{s/\sqrt 2} (filled triangle, since s/\sqrt{2} > s/\sqrt{3}) — and the example shows the price of computability: Rips can fill small holes too early.
Definition 2.6 — Euler–Poincaré characteristic The Euler characteristic of a finite complex K is the alternating sum \chi(K) \;=\; \sum_{k \geq 0} (-1)^k\, f_k(K), where f_k counts the simplices of dimension k (the f-vector).
It is the most rustic topological invariant: \chi(\text{point}) = 1, \qquad \chi(\mathbb{S}^1) = 0, \qquad \chi(\mathbb{S}^2) = 2, \qquad \chi(\text{torus}) = 0 . Theorem 3.5 will show that \chi depends only on the homotopy type of |K|, and will relate it to the Betti numbers.
A first look at persistence: clustering across scales
The official course introduces persistence through a clustering application, before any homology: dimension 0 only needs connected components.
Watch the Rips filtration of Definition 2.2, \{\mathrm{Rips}_\varepsilon(\mathcal{X})\}_{\varepsilon \geq 0}, and keep only its graph: as \varepsilon grows, the components of the \varepsilon-neighbourhood graph merge, and each merge is an event that can be recorded.
Definition 2.7 — Zero-dimensional persistence of the Rips filtration At \varepsilon = 0 every point is its own component (it is born at 0). When \varepsilon reaches the length of an edge joining two different components, they merge and one of them dies at that value.
The multiset of intervals [0, \varepsilon_{\text{merge}}), plus one interval [0, \infty) for the component that never dies, is the 0-dimensional barcode: exactly n - 1 finite bars for n points.
Its death times are the edge lengths of a minimum spanning tree of \mathcal{X}, because Kruskal’s algorithm (Refresher CS module, section 7.5) scans the edges by increasing length and keeps exactly those that join two different components; they are also the merge heights of the single-linkage dendrogram.
The number of clusters at scale \varepsilon equals the number of bars still alive at \varepsilon, so a wide gap between consecutive death times marks a range of scales where the clustering does not change — the persistence answer to “how many clusters?”.
Example 2.8 — Six points on a line, then a bridge Take \mathcal{X} = \{0, 1, 3, 10, 11, 13\} \subset \mathbb{R}. On a line the minimum spanning tree joins consecutive points, so the death times are the gaps 1, 2, 7, 1, 2. The barcode is [0,1)^2, \quad [0,2)^2, \quad [0,7), \quad [0,\infty). For every \varepsilon \in [2, 7) exactly two bars are alive — the clusters \{0, 1, 3\} and \{10, 11, 13\} — and the gap from 2 to 7 is wide: two clusters is the robust answer.
Now add a single outlier at 6.5. The gaps become 1, 2, 3.5, 3.5, 1, 2: for \varepsilon \in [2, 3.5) three bars are alive (the two groups and the outlier alone), and at \varepsilon = 3.5 the two groups merge through the outlier into a single component.
No scale gives two clusters any more: one noisy point is enough to destroy the answer — the chaining effect of single linkage.
Definition 2.9 — Persistence of a density: the idea of ToMATo To resist chaining, filter by a density estimate \hat f instead of by distance. Fix a neighbourhood graph G on \mathcal{X} and process the points by decreasing \hat f.
A point with no already-processed neighbour starts a new cluster, born at the height \hat f of its peak; a point adjacent to several clusters merges them, and the cluster with the lower peak dies at the current height (the elder rule; ties broken by index).
Each finite pair (\text{peak}, \text{merge height}) is a point of a persistence diagram; its prominence is the difference between the two.
ToMATo (Chazal, Guibas, Oudot, Škraba, 2013 — see 10.3) keeps separate the clusters whose prominence exceeds a threshold \tau, which is read off the diagram as the gap between the few points far from the diagonal and the many near it.
Example 2.10 — The bridge disappears Same seven points, with \hat f(x) = number of other points within distance 2, and G joining points at distance at most 3.5.
Then \hat f = 1, 2, 1 on 0, 1, 3; \hat f = 1, 2, 1 on 10, 11, 13; and \hat f(6.5) = 0.
Processing by decreasing \hat f: 1 and 11 start two clusters at height 2; the points of height 1 join their own group.
The outlier, processed last at height 0, touches both clusters (it is at distance 3.5 from 3 and from 10), so they merge at height 0 and one of them dies with prominence 2 - 0 = 2.
With \tau = 1.5, both clusters are kept and the outlier is attached to one of them: the low-density bridge no longer decides the clustering. Chapter 4 extends this bookkeeping — births, deaths, the elder rule — to holes of every dimension.
3. Simplicial homology
This chapter turns geometry into algebra, so that holes can be counted by computing ranks of matrices. At each dimension k, we build a vector space of k-chains (formal combinations of k-simplices); the boundary operator \partial_k satisfies \partial_{k-1} \circ \partial_k = 0 (Proposition 1.3). Homology measures the failure of exactness: cycles that are not boundaries.
This chapter and the next are the master’s reference for simplicial homology and persistence. The Shapes module, ch. 9 recalls them and adds its own alpha-complex filtration.
Definition 3.1 — Chains, cycles, boundaries, homology Let K be a finite complex and \mathbb{F} a field (\mathbb{F}_2 unless otherwise stated).
For k \geq 0, the group of k-chains is C_k(K) = \mathbb{F}^{f_k(K)}, generated by the simplices of that dimension. The boundary map \partial_k : C_k \to C_{k-1} is the linear map that sends a simplex to the sum of its faces (signed over \mathbb{Z}, raw over \mathbb{F}_2). We set:
Key result — homology Z_k = \ker \partial_k \;(\text{cycles}), \qquad B_k = \mathrm{im}\, \partial_{k+1} \;(\text{boundaries}), \qquad H_k(K) = Z_k / B_k.
The inclusion B_k \subseteq Z_k follows from \partial_k \circ \partial_{k+1} = 0. The dimension \beta_k = \dim H_k is the k-th Betti number. Two cycles are homologous if their difference is a boundary.
Reading the Betti numbers \beta_0 = number of connected components (how many pieces); \beta_1 = number of independent loops (how many “one-dimensional” holes: annulus, torus handle, hierarchy of cyclic communities); \beta_2 = number of cavities (the interior of a hollow sphere, of a bubble); beyond that, \beta_k counts the k-holes. Over \mathbb{F}_2, “cycle” means: every vertex (resp. edge…) is covered an even number of times — a union of closed polygons, without orientation.
Example 3.2 — Complete computation no. 1: the hollow then filled triangle Hollow triangle S (vertices a, b, c, edges ab, bc, ca, no face). Here C_0 = \mathbb{F}_2^3, C_1 = \mathbb{F}_2^3, C_2 = 0.
In the vertex basis: \partial_1(ab) = a + b, \partial_1(bc) = b + c, \partial_1(ca) = c + a. The matrix of \partial_1 (columns = edges, rows = vertices) is \partial_1 = \begin{pmatrix} 1 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix}, \qquad \mathrm{rank}(\partial_1) = 2. Indeed each vertex appears twice, so the columns sum to zero, \mathrm{col}_1 + \mathrm{col}_2 + \mathrm{col}_3 = (0, 0, 0)^\top , and any two columns are independent. Hence: \dim Z_1 = 3 - 2 = 1, \quad B_1 = 0 \Rightarrow H_1 \cong \mathbb{F}_2, \qquad \dim H_0 = 3 - 2 = 1. Reading: one component, one loop — the circle. The generator cycle is \gamma = ab + bc + ca.
Filled triangle D (we add the face abc). C_2 = \mathbb{F}_2 and \partial_2(abc) = ab + bc + ca = \gamma: the rank of \partial_2 is 1, so B_1 = \langle \gamma \rangle and H_1(D) = Z_1 / B_1 = \langle \gamma \rangle / \langle \gamma \rangle = 0, \qquad H_0(D) \cong \mathbb{F}_2. Reading: the disk has no hole — the loop that bounds it has become a… boundary. The whole topology of the “hollow → filled” passage lies in the rank of a 3 \times 1 matrix.
Example 3.3 — Complete computation no. 2: the hollow sphere (boundary of the tetrahedron) K_{\mathbb{S}^2}: 4 vertices, 6 edges, 4 faces, no 3-simplex. Step by step over \mathbb{F}_2:
\partial_1 : C_1 = \mathbb{F}_2^6 \to C_0 = \mathbb{F}_2^4. The complete graph K_4 is connected: \mathrm{rank}\, \partial_1 = 3, so \dim Z_1 = 6 - 3 = 3 and H_0 \cong \mathbb{F}_2 (a single component).
\partial_2 : C_2 = \mathbb{F}_2^4 \to C_1 = \mathbb{F}_2^6. Dimension-2 cycles. Let us look for families of faces in which every edge is covered an even number of times. Each edge of the tetrahedron belongs to exactly 2 faces.
- An isolated face leaves its 3 edges odd: forbidden.
- Two faces share one edge (even) but their 4 other edges remain odd: forbidden.
- Three faces: the three edges of the missing fourth face are each covered exactly once — odd: forbidden.
- All 4 faces together: every edge covered twice — allowed.
So Z_2 = \{\emptyset, \Sigma\} where \Sigma is the sum of the 4 faces: \dim Z_2 = 1.
B_2 = \mathrm{im}\, \partial_3 = 0 (no 3-simplex), so H_2 \cong \mathbb{F}_2 — the cavity.
\mathrm{rank}\, \partial_2 = \dim C_2 - \dim Z_2 = 4 - 1 = 3, so B_1 has dimension 3 and H_1 = Z_1/B_1 has dimension 3 - 3 = 0: no loop — on a sphere, every loop tightens to a point.
Balance sheet: \beta_0 = 1, \qquad \beta_1 = 0, \qquad \beta_2 = 1 . Check by the characteristic: \chi = 4 - 6 + 4 = 2 = \beta_0 - \beta_1 + \beta_2. The same computation on Császár’s “minimal” torus (7 vertices, 21 edges, 14 faces) would give (1, 2, 1).
Proposition 3.4 — Hole formula for graphs For a graph G with n vertices, m edges and c connected components, viewed as a 1-complex, the Betti numbers are given by the nullity or cyclomatic rank formula (the cyclomatic number of ch. 0): \beta_0 = c, \qquad \beta_1 = m - n + c .
Proof. \beta_0 = c: two vertices are homologous (a + b = \partial(ab)) within the same component, and never across components.
For \beta_1: Z_1 = \ker \partial_1 and \mathrm{rank}\, \partial_1 = n - c.
Indeed, on a connected component with n_i vertices, the image of \partial_1 is the space of 0-chains of that component with an even number of vertices (every such chain is the boundary of a union of paths), of dimension n_i - 1; summing over the components gives n - c. Hence, since B_1 = 0 for a 1-complex, \beta_1 = \dim Z_1 - \dim B_1 = m - (n - c) - 0 . ∎
Theorem 3.5 (Euler–Poincaré) — The characteristic is topological For every finite complex K: \chi(K) \;=\; \sum_{k} (-1)^k \beta_k. In particular \chi depends only on the homotopy type of |K| — Euler had \chi(\text{polyhedron}) = V - E + F = 2 for the sphere, Poincaré showed that the alternating sum of the Betti numbers always suffices.
Proof. For each k, the rank theorem applied to \partial_k : C_k \to C_{k-1} gives f_k = \dim C_k = \mathrm{rank}\, \partial_k + \dim \ker \partial_k = \mathrm{rank}\, \partial_k + \dim Z_k . Now \dim Z_k = \dim B_k + \beta_k and \mathrm{rank}\, \partial_k = \dim B_{k-1}; hence f_k = \dim B_{k-1} + \dim B_k + \beta_k . Summing with the signs (-1)^k, the terms \dim B_k appear twice, with opposite signs, and cancel (telescoping); what remains is \sum_k (-1)^k \beta_k. ∎
| Complex | f-vector | (\beta_0, \beta_1, \beta_2) | \chi |
|---|---|---|---|
| segment (2 vertices, 1 edge) | (2, 1, 0) | (1, 0, 0) | 1 |
| hollow triangle \simeq \mathbb{S}^1 | (3, 3, 0) | (1, 1, 0) | 0 |
| filled triangle (disk) | (3, 3, 1) | (1, 0, 0) | 1 |
| hollow square with a diagonal (4 v., 5 e.) | (4, 5, 0) | (1, 2, 0) | −1 |
| hollow sphere (boundary of the tetrahedron) | (4, 6, 4) | (1, 0, 1) | 2 |
| figure eight (two circles attached) | — | (1, 2, 0) | −1 |
Integer coefficients and torsion Computing over \mathbb{Z} (signs active) restores information that a field hides: torsion. For the projective plane, H_1(\mathbb{RP}^2; \mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z} ; over \mathbb{Q} the first Betti number is 0, while over \mathbb{F}_2 it is 1 (and \beta_2 = 1 as well).
The price of integer coefficients: replacing Gaussian elimination with the Smith normal form. In practice, applied TDA almost always works over a field; we will remember that, in the presence of torsion, the Betti numbers depend on the field, and that no field alone captures the integral homology.
Definition 3.6 — Singular homology: the general theory Simplicial homology assumes a finite complex. For an arbitrary topological space X, one defines singular homology.
A k-singular simplex is any continuous map \sigma : \Delta^k \to X from the standard simplex into the space; singular k-chains are the finite formal combinations of such simplexes, the boundary operator is computed by restricting \sigma to the faces of \Delta^k, and H_k(X) follows as in 3.1.
The price of generality is an infinite chain space — no direct computation possible; the gain is twofold.
On the one hand H_k(X) depends only on the homotopy type of X: it is singular homology that makes the Betti numbers true topological invariants, independent of the choice of triangulation.
On the other hand, the simplicial approximation theorem guarantees that for X = |K|, singular homology and simplicial homology coincide: TDA therefore always computes the finite (simplicial) version, by virtue of the general theory — and the official syllabus of the course cites both.
4. Persistent homology: the algorithm
Let us come back to the data. At which scale \varepsilon should we build the Rips complex? Too small: dust of points. Too large: one contractible ball. The answer of persistence: all scales at once, with a ledger that records, for each topological feature, its birth and its death. Features that live long are the “true hole” candidates; ephemeral ones are noise.
Definition 4.1 — Filtration and persistence module A filtration of a complex K is an increasing family of subcomplexes (each K_i is a subcomplex of K_{i+1}): \emptyset = K_{-1} \subseteq K_0 \subseteq K_1 \subseteq \dots \subseteq K_m = K . In practice: we order the simplices \sigma_1 < \sigma_2 < \dots < \sigma_m by increasing value of a function \varphi (appearance distance in the Rips complex, gray level of an image, elevation of a terrain), faces before cofaces, and K_i = K_{i-1} \cup \{\sigma_i\}.
The persistence module is the family of spaces and linear maps H_k(K_0) \to H_k(K_1) \to \dots \to H_k(K_m) induced by the inclusions. It is tame if these spaces are finite-dimensional — which the finiteness of K guarantees.
Theorem 4.2 (interval decomposition) Every tame persistence module over a field decomposes in a unique way (up to isomorphism and to the order of the factors) into a direct sum of interval modules \mathbb{I}[b, d): copies of the field placed at indices b \leq i < d, connected by identities, zero elsewhere. The barcode is the multiset of these intervals [b, d); each bar is a homology class born at b and dying at d (with d = \infty for essential classes).
Proof. (Structure, out of scope: this is Gabriel’s theorem for quivers of type \mathbb{A} — the module is a representation of the linear quiver 0 \to 1 \to \dots \to m, all its indecomposable representations are the \mathbb{I}[b, d), and the decomposition is unique because the quiver is of finite type. Oudot’s book Persistence Theory (2015) gives a self-contained proof — cf. ch. 10 of this module. ∎
Definition 4.3 — Boundary matrix of a filtration and low index Number the simplices \sigma_1, \dots, \sigma_m in the order of the filtration. The boundary matrix M \in \mathbb{F}_2^{m \times m} is defined by M[i, j] = 1 if \sigma_i is a codimension-1 face (a facet) of \sigma_j, and 0 otherwise.
Column j is thus the boundary \partial \sigma_j over \mathbb{F}_2 (Definition 1.2), and the matrix is strictly upper triangular, because a face always precedes its coface. For a non-zero column, the low index is \mathrm{low}(j) = \max \{ i : M[i, j] = 1 \}.
Theorem 4.4 (standard persistence algorithm) Let R be the matrix obtained by reducing M column by column, from left to right: as long as \mathrm{low}(j) is defined and already occupied by an earlier column j' < j (i.e. \mathrm{low}(j') = \mathrm{low}(j)), replace R_{:, j} \leftarrow R_{:, j} + R_{:, j'}. Then:
- each column j with \mathrm{low}(j) = i associates the pair (i, j): a class born with the simplex \sigma_i dies at index j — bar [i, j);
- each zero (reduced) column j creates a class at index j; if j is the low index of no other column, the class never dies — an essential bar [j, \infty);
- the total complexity is O(m^3) in the worst case, O(m^2) in practice on real data (columns already almost reduced).
Proof. Dimensional consistency. If \sigma_j is a k-simplex, its column lives in the rows of the (k-1)-simplices: a pair (i, j) always connects two consecutive dimensions (\sigma_i is a (k-1)-simplex).
A pair (i, j) is a birth-then-death. At step i, the simplex \sigma_i either creates a class (if it completes an independent cycle), or kills one (if it completes a chain whose boundary becomes a trivial cycle).
The algorithm reproduces this alternative: \sigma_i kills a class exactly when the reduced column of \sigma_j has \mathrm{low}(j) = i, that is, when \partial \sigma_j contains \sigma_i as the last unpaired face.
The class carried by the cycle \partial \sigma_j + (\text{already paired boundaries}) was born with \sigma_i.
Zero columns = births. If the reduced column of \sigma_j is zero, the column additions performed exhibit a cycle z = \sigma_j + \dots: \sigma_j creates a class. That class dies at the first later index \ell whose reduced column has \mathrm{low}(\ell) = j — in Example 4.5, the zero column 8 is paired with column 9. If no such column exists, the class lives until the end: bar [j, \infty).
Uniqueness. The choice of pivots is forced: at each step, there is at most one earlier column with the same low index (invariant maintained by the algorithm), so the matching depends on no arbitrary choice — it coincides with the interval decomposition of Theorem 4.2. ∎
# Standard persistence algorithm (Edelsbrunner-Letscher-Zomorodian,
# Zomorodian-Carlsson), over F2. low[j] = row of the last 1 of column j.
import numpy as np
def persistence(M): # M : m x m boundary matrix (0/1)
m = M.shape[1]
R = (M % 2).astype(np.uint8)
pivot = {} # low index -> column that owns it
pairs, born = [], []
for j in range(m):
while True:
nz = np.nonzero(R[:, j])[0]
if len(nz) == 0: # zero column: a class is born at j;
born.append(j) # it dies if a later column has low = j
break
low = int(nz[-1])
if low not in pivot: # free pivot: pair (low, j), bar [low, j)
pivot[low] = j
pairs.append((low, j))
break
R[:, j] ^= R[:, pivot[low]] # column addition (XOR in F2)
essential = [j for j in born if j not in pivot] # never killed: bars [j, inf)
return pairs, essential
# Example 4.5 with 0-based indices (simplex k of the text is row/column k - 1)
cols = {5: [1, 2], 6: [2, 3], 7: [3, 4], 8: [1, 3], 9: [5, 6, 8], 10: [1, 4]}
M = np.zeros((10, 10), dtype=np.uint8)
for j, rows in cols.items():
M[[r - 1 for r in rows], j - 1] = 1
print(persistence(M)) # ([(1, 4), (2, 5), (3, 6), (7, 8)], [0, 9]): the barcode belowExample 4.5 — The algorithm demonstrated step by step on a complete complex Consider the following filtration (a controlled variant of Example 3.2): four vertices v_1, v_2, v_3, v_4, five edges, one triangle. The indices are those of appearance:
| Index | Simplex | Dim. | Expected event |
|---|---|---|---|
| 1, 2, 3, 4 | v_1, v_2, v_3, v_4 | 0 | four H0 births |
| 5 | [v_1, v_2] | 1 | merging of components (H0 death) |
| 6 | [v_2, v_3] | 1 | merging of components (H0 death) |
| 7 | [v_3, v_4] | 1 | merging of components (H0 death) |
| 8 | [v_1, v_3] | 1 | creation of a loop (H1 birth) |
| 9 | [v_1, v_2, v_3] | 2 | filling: H1 death |
| 10 | [v_1, v_4] | 1 | creation of a loop (H1 birth) |
Non-trivial columns of the boundary matrix M (rows = simplices 1 to 10, columns = simplices 5 to 10; columns 1–4 are zero):
| Row\Col. | 5 =[v_1v_2] | 6 =[v_2v_3] | 7 =[v_3v_4] | 8 =[v_1v_3] | 9 =[v_1v_2v_3] | 10 =[v_1v_4] |
|---|---|---|---|---|---|---|
| 1: v_1 | 1 | 0 | 0 | 1 | 0 | 1 |
| 2: v_2 | 1 | 1 | 0 | 0 | 0 | 0 |
| 3: v_3 | 0 | 1 | 1 | 1 | 0 | 0 |
| 4: v_4 | 0 | 0 | 1 | 0 | 0 | 1 |
| 5: [v_1v_2] | 0 | 0 | 0 | 0 | 1 | 0 |
| 6: [v_2v_3] | 0 | 0 | 0 | 0 | 1 | 0 |
| 7: [v_3v_4] | 0 | 0 | 0 | 0 | 0 | 0 |
| 8: [v_1v_3] | 0 | 0 | 0 | 0 | 1 | 0 |
| 9: triangle | 0 | 0 | 0 | 0 | 0 | 0 |
| 10: [v_1v_4] | 0 | 0 | 0 | 0 | 0 | 0 |
Reduction, column by column.
Column 5: \{1, 2\}, \mathrm{low} = 2. No earlier pivot: pair (2, 5). The component born with v_2 dies when edge [v_1v_2] merges it.
Column 6: \{2, 3\}, \mathrm{low} = 3 — pair (3, 6). Likewise for v_3.
Column 7: \{3, 4\}, \mathrm{low} = 4 — pair (4, 7). Likewise for v_4.
Column 8: \{1, 3\}, \mathrm{low} = 3: conflict with column 6. We add: \{1,3\} \oplus \{2,3\} = \{1,2\}, \mathrm{low} = 2: conflict with column 5.
We add: \{1,2\} \oplus \{1,2\} = \emptyset: zero column — a class of H_1 is born at index 8 (the loop v_1 \to v_2 \to v_3 \to v_1). No pivot is destroyed: the existing matching is unchanged.
Column 9: \{5, 6, 8\}, \mathrm{low} = 8. Is pivot 8 occupied? Column 8 is now zero — it occupies nothing: no conflict, pair (8, 9). The loop born at 8 is killed by the triangle [v_1v_2v_3].
Column 10: \{1, 4\}, \mathrm{low} = 4:
- conflict with column 7 → \{1,4\} \oplus \{3,4\} = \{1,3\}, \mathrm{low} = 3;
- conflict with column 6 → \{1,3\} \oplus \{2,3\} = \{1,2\}, \mathrm{low} = 2;
- conflict with column 5 → \{1,2\} \oplus \{1,2\} = \emptyset.
Zero column: a class of H_1 is born at 10 (the loop v_1 \to v_3 \to v_4 \to v_1) and never dies.
Final barcode. H_0 : [1, \infty),\; [2, 5),\; [3, 6),\; [4, 7) \qquad H_1 : [8, 9),\; [10, \infty).
Checks.
- At the end, \beta_0 = 1 and \beta_1 = 1, consistent with the final graph (connected, two independent cycles — formula 3.4: m - n + c = 5 - 4 + 1 = 2, one of which is killed by the triangle).
- Euler characteristic of the final complex: 4 - 5 + 1 = 0 = \beta_0 - \beta_1 (Theorem 3.5).
- Bar count: 4 H0 births (4 vertices), 3 H0 deaths (3 merging edges — the 4th edge [v_1v_3] creates a loop instead of merging), 2 H1 births, 1 H1 death (the triangle).
Everything connects.
From Euler to barcodes, and back The Euler–Poincaré characteristic can be reread through the algorithm: at filtration level i, \chi(K_i) is the number of active H0 bars minus the number of active H1 bars, etc. The Betti curve \beta_k(i) — number of active bars — is a discrete summary of the barcode, strictly less fine but sometimes sufficient (and directly related to the counting functions of ch. 5). Remember: the barcode is the dynamic version of homology; the plain homology of ch. 3 is its slice frozen at i = m.
Variants and limits (general culture) The “faces before cofaces” constraint makes the filtration increasing; to free oneself from it, one uses zigzag persistence (Carlsson, de Silva, Morozov): the arrows alternate left-right, and the algorithm is rewritten with “in-out” columns. For vector-valued functions, one enters multi-dimensional persistence — where Theorem 4.2 fails: no complete discrete barcode (Carlsson–Zomorodian negative structure theorem).
5. Diagrams, barcodes and landscapes
The barcode is a combinatorial object; to confront it with statistics — comparing, testing, averaging — it must be given a geometric habitat. Two representations dominate: the persistence diagram (point cloud of the half-plane, carrier of Wasserstein-type distances) and the landscape (a function from \mathbb{R} to \mathbb{R}, which transports diagrams into a Hilbert space).
Definition 5.1 — Persistence diagram The diagram of a barcode \mathcal{B} is the multiset of points of the plane \{(b, d) : [b, d) \in \mathcal{B}\} \cup \Delta, where each bar becomes the point with coordinates (birth, death); we add the diagonal \Delta = \{(x, x)\} with infinite multiplicity — bars of zero length live on it. The persistence of a class is d - b; essential classes are sent to the line d = \infty. By Theorem 4.2, diagram and barcode contain exactly the same information, and we will use them interchangeably.
Example 5.2 — The noisy circle, archetype of the module 200 points sampled on a circle of radius 1 plus Gaussian noise of standard deviation 0.05. At scale \varepsilon \approx 0: dust (200 H0 bars).
When \varepsilon reaches the local spacing (about 2\pi/200 \approx 0.03, enlarged by the noise), the H0 bars die in a cascade; shortly after, around \varepsilon \approx 0.15 — the largest gap between neighbors — a long H1 bar is born: the central hole.
It dies around \varepsilon \approx 1.6, slightly below \sqrt{3} \approx 1.73, the side of the equilateral triangle inscribed in the circle, which is the scale at which Rips triangles span the whole disk.
Signature: one circle = one very long H1 bar + short dust. Two concentric circles: two long H1 bars; a sphere: no H1, one long H2 bar. This is the sanity check of the lab (ch. 9).
Definition 5.3 — Bottleneck distance Let \mathcal{D}_1, \mathcal{D}_2 be two diagrams and \delta \geq 0.
A \delta-matching is a partial bijection \pi between the two diagrams such that each matched point moves by \|p - \pi(p)\|_\infty \leq \delta, the unmatched points having to be at distance at most \delta from the diagonal (we match them with it). The bottleneck distance is d_B(\mathcal{D}_1, \mathcal{D}_2) \;=\; \inf_{\pi}\; \sup_{p}\; \|p - \pi(p)\|_\infty. The Wasserstein-p distance replaces the sup by the \ell^p mean of the displacements — p = 2 in practice. These are exactly optimal transport distances between measures (Optimal Transport module, ch. 2 — preview): the diagonal plays the role of an infinite mass sink at the cost of distance-to-the-boundary.
Example 5.4 — Bottleneck by hand Take \mathcal{D}_1 = \{(0.3, 1.1)\} and \mathcal{D}_2 = \{(0.4, 1.0)\}. Two options: match the two points (displacement \|(0.1, -0.1)\|_\infty = 0.1), or send everything onto the diagonal (cost \frac{1.1 - 0.3}{2} = 0.4). So d_B = 0.1 . Let us add to \mathcal{D}_1 the ephemeral point (2, 2.05): it matches the diagonal at cost 0.025, and d_B = 0.1 still.
Moral: the bottleneck ignores ephemeral features by construction — an L^\infty distance on the persistent holes.
Definition 5.5 — Persistence landscapes (Bubenik, 2015) For a diagram point (b, d), set the “tent” function \Lambda_{(b, d)}(t) \;=\; \max\big( \min(t - b,\; d - t),\; 0 \big), zero outside (b, d), peaking at \frac{d-b}{2} at t = \frac{b+d}{2}.
The k-th landscape is the k-th largest of these tents at point t (and 0 if there are fewer than k): \lambda_D(k, t) \;=\; k\text{-th largest value of } \{\Lambda_{(b,d)}(t) : (b, d) \in D\}. The sequence (\lambda(k, \cdot))_k is a sequence of Lipschitz functions of L^2(\mathbb{R}): the diagram now lives in a Hilbert space — means, covariances, PCA, tests become available.
Proposition 5.6 — The landscape is 1-Lipschitz and stable Each \lambda(k, \cdot) is 1-Lipschitz, and for two diagrams \| \lambda_{\mathcal{D}_1}(k, \cdot) - \lambda_{\mathcal{D}_2}(k, \cdot) \|_\infty \;\leq\; d_B(\mathcal{D}_1, \mathcal{D}_2) \quad \text{for all } k.
Proof. (Sketch.) Each tent \Lambda_{(b,d)} is 1-Lipschitz: slopes \pm 1 on (b, d), zero elsewhere, peak \frac{d-b}{2} reached at \frac{b+d}{2}. A k-th largest value of Lipschitz families is again Lipschitz (the curves cross at most once per pair, the order of the tents changes only at intersections).
For stability: a bottleneck \delta-matching moves each tent by at most \delta in sup norm. Indeed, moving a vertex from (b, d) to (b', d') with \|(b,d)-(b',d')\|_\infty \leq \delta moves the tent by \leq \delta everywhere.
The “k-th largest” operation is 1-Lipschitz in the sense of Young diagrams (monotone exchange). ∎
Other vectorizations Persistence images (Adams et al., 2017) sample the transform (b, d) \mapsto (b, d - b) on a Gaussian grid — differentiable, hence pluggable into a network. Betti curves and persistence entropies are cheap summaries. The choice of vectorization is a choice of model: the landscape favors the median of persistences, the image the complete field, the kernel of ch. 8 the geometry of transport.
6. The Mapper algorithm
Persistence reads a cloud at all scales; Mapper (Singh, Mémoli, Carlsson, 2007) summarizes it into an interpretable graph — it is the TDA tool most used in industry, because it produces a visualization that the eye of a domain expert knows how to read: arms, flares, isolated groups.
Definition 6.1 — The Mapper pipeline Input:
- a cloud \mathcal{X} (or a measure);
- a filter function f : \mathcal{X} \to \mathbb{R}^{\ell} (\ell = 1 or 2);
- a cover \mathcal{U} = \{U_1, \dots, U_r\} of the image of f (overlapping intervals if \ell = 1, rectangles if \ell = 2);
- a clustering algorithm \mathcal{A}: single linkage (the merges of Definition 2.7, cut at one scale), or DBSCAN, which keeps as clusters the connected groups of points having enough neighbours within a radius (Machine Learning module, section 7.1).
The Mapper graph is built as follows:
- slice: \mathcal{X}_i = f^{-1}(U_i), the fibers of the cover;
- cluster: \mathcal{X}_i = C_{i, 1} \sqcup \dots \sqcup C_{i, k_i} by \mathcal{A}; each cluster becomes a node of the graph;
- connect: an edge connects C_{i, a} and C_{j, b} as soon as C_{i, a} \cap C_{j, b} \neq \emptyset — the nodes that share points.
Key parameters: the resolution (number of intervals), the gain (relative overlap, typically 10 to 50%), the filter (PCA projection, eccentricity, density, DTM…).
Why it works: Mapper ≈ dual Reeb Mapper is a discrete version of the Reeb graph of f — the quotient of the underlying space by the relation “in the same connected component of the same level set of f”.
The overlapping cover plays the role of continuity: the nerve theorem (2.3) adapted to fibers guarantees that, under good hypotheses (fine enough cover, well-chosen overlaps), the Mapper graph reproduces the structure of the Reeb graph — its branches and its loops.
With \ell = 1, an annulus of data gives a cycle in the Mapper graph — the hole becomes visible to the naked eye, without computing any homology: this is persistence “for humans”.
Example 6.2 — Breast cancer (Nicolau, Levine, Carlsson, 2011) Data: gene expression (24,479 dimensions) for 295 breast tumors, plus samples of normal breast tissue.
Filter: how far each tumour deviates from healthy tissue. Disease-Specific Genomic Analysis (DSGA) fits a model of normal tissue and splits each tumour profile into a normal component and a disease component; the filter is a norm of the disease component (the “progression analysis of disease” method of the paper). Clustering: single-linkage.
Result: the Mapper graph shows a main population and a separate arm — ~7% of the patients, labeled ER+ but with much better survival, with a distinct mutational profile (“c-MYB+” group).
No classical clustering method detached this subgroup, which overlaps the main cloud in every 2D projection: Mapper separates it thanks to a filter chosen by biological knowledge and to the topology of the cover, not thanks to distance alone. This is the paper that brought TDA into biology journals (PNAS 2011).
Mapper vs classical clustering — and the Graph ML link A k-means (Machine Learning module, ch. 7) partitions into k balls; Mapper partitions by fiber then glues back by intersection: a point can belong to several clusters, and the result is a graph whose components, bridges and cycles are exploitable (Proposition 3.4 counts its independent cycles). The choice of filter is as important as the architecture of a network: eccentricity → extremes; density → modes; DTM → robustness to outliers (the distance-to-measure of ch. 7).
7. Stability and statistics
The whole practical value of persistence lies in one theorem: two close functions have close diagrams. Without it, the diagram of a noisy cloud would mean nothing — an infinitesimal perturbation could change it utterly. With it, TDA becomes a statistic: one can bound the sampling error, build confidence intervals by bootstrap, and test.
Theorem 7.1 (bottleneck stability — Cohen-Steiner, Edelsbrunner, Harer, 2007) Let K be a finite complex and f, g : |K| \to \mathbb{R} two tame functions (finitely many critical values). Then the persistence diagrams of the sublevel filtrations K_t = \{\sigma : f(\sigma) \leq t\} satisfy:
Key result — stability of persistence diagrams d_B\big( \mathrm{Dgm}(f), \; \mathrm{Dgm}(g) \big) \;\leq\; \|f - g\|_\infty.
Proof. Idea of the proof (interpolation). Set f_t = (1 - t) f + t g for t \in [0, 1], so that \|f_t - f_{t'}\|_\infty \leq |t - t'| \cdot \|f - g\|_\infty . One shows (the “easy bijection” lemma of Cohen-Steiner, Edelsbrunner and Harer — a small enough L^\infty perturbation moves the points of the diagram by at most as much) that for t' - t small, d_B(\mathrm{Dgm}(f_t), \mathrm{Dgm}(f_{t'})) \leq (t' - t) \|f - g\|_\infty up to a coupling near the diagonal.
By subdividing [0, 1] and composing the successive matchings, one obtains a matching of total cost \|f - g\|_\infty. The pairs that are “born and die” during the interpolation correspond to excursions touching the diagonal — they are matched to it for free.
The complete proof requires the decomposition theorem 4.2 to give a continuous meaning to the pairs of f_t (the “space of diagrams” endowed with the bottleneck is geodesic); the book by Chazal et al. (2016) gives the modern algebraic version — cf. ch. 10. ∎
Theorem 7.2 (algebraic stability — Chazal, de Silva, Glisse, Oudot, 2009/2016) The bound 7.1 remains valid for two tame persistence modules \mathbb{V}, \mathbb{W} that are \delta-interleaved (there exist u_t : V_t \to W_{t+\delta} and v_t : W_t \to V_{t+\delta} commuting with the arrows, with v_{t + \delta} u_t equal to the arrow V_t \to V_{t + 2\delta}): d_B\big( \mathrm{Dgm}(\mathbb{V}), \mathrm{Dgm}(\mathbb{W}) \big) \;\leq\; \delta. Taking the infimum over interleavings, d_B \leq d_I, the interleaving distance; the isometry theorem even shows that d_B = d_I.
Interleaving is the right “distance” between modules: the sublevel filtrations of two functions with \|f - g\|_\infty = \delta are \delta-interleaved, which recovers Theorem 7.1. Consequence: stability is not a property of functions but of algebra — two filtrations close in the sense of approximate inclusions have close barcodes.
What 7.1–7.2 buy
- Sampling noise. Two samples \mathcal{X}, \mathcal{X}' with \max_i \|x_i - x'_i\| \leq \eta: every pairwise distance changes by at most 2\eta, so each Rips simplex appears at a level shifted by at most 2\eta; the filtrations are 2\eta-interleaved and the diagrams lie within 2\eta in bottleneck distance.
- Bootstrap. We resample the points, compute the diagrams of the replicas, and the quantiles of d_B around the observed diagram provide confidence bands (Fasy et al.; convergence of empirical landscapes: Chazal et al., SoCG 2013). Cf. Refresher Statistics module, section 4.1 (the bootstrap) and ch. 6 (tests).
- Model comparison. Two experimental conditions (healthy subjects vs patients, ch. 8): test statistic = landscape or bottleneck distance, calibrated by permutation.
The Achilles heel: the sup norm The bound \|f - g\|_\infty is sensitive to a single outlier — one outlier shifts the distance to the sample everywhere around it.
The standard fix: the distance-to-measure (DTM). For a measure \mu and a fraction 0 < k \leq 1 (or a radius h), one replaces d(x, \mathcal{X}) by \delta_{\mu, k}(x) = \big( \frac{1}{k} \int_0^k \delta_t(x)^2 \,\mathrm{d}t \big)^{1/2}, where \delta_t(x) = \inf\{r : \mu(\overline{B}(x, r)) \geq t\} is the radius of the smallest ball around x of mass t — for an empirical measure, a local average of the distances to the nearest sample points.
Its diagrams are Lipschitz with respect to \mu in Wasserstein-2 distance (Optimal Transport module, ch. 2 — preview); an isolated outlier now costs only the weight it carries in the measure, and no longer the sup distance. The DTM and its estimators are developed in the book by Boissonnat, Chazal and Yvinec (references).
Proposition 7.3 — Distances between clouds: Hausdorff and Gromov–Hausdorff The Hausdorff distance d_H(\mathcal{X}, \mathcal{Y}) = \max\big( \sup_x d(x, \mathcal{Y}), \sup_y d(y, \mathcal{X}) \big) controls the interleaving of the Rips complexes: d_B(\mathrm{Dgm}\,\mathrm{Rips}(\mathcal{X}), \mathrm{Dgm}\,\mathrm{Rips}(\mathcal{Y})) \leq 2\, d_H(\mathcal{X}, \mathcal{Y}). For two abstract metric spaces (not embedded in a common one), the Gromov–Hausdorff distance plays this role — it is what makes persistence comparable across graphs (ch. 8).
Proof. (Sketch.) If d_H(\mathcal{X}, \mathcal{Y}) \leq \eta, every edge of \mathrm{Rips}_t(\mathcal{X}) corresponds to a pair of points of \mathcal{Y} at distance \leq t + 2\eta.
The inclusion sending x_i to a nearby y_i is therefore a 2\eta-interleaving of the filtrations — we apply Theorem 7.2. ∎
Proposition 7.4 — Topological inference: guaranteeing the homology of the hidden space Let X \subset \mathbb{R}^d be a compact positively reached space, with reach \tau > 0 (the distance from X to its medial axis: a quantity measuring both curvature and the proximity of different sheets), and \mathcal{X} \subset X an \varepsilon-dense sample.
There exist explicit bounds of the form \varepsilon, \alpha = O(\tau) — in the spirit of Niyogi–Smale–Weinberg — such that, for a radius \alpha lying between the sampling scale and a fraction of \tau, the union of balls \bigcup_{x \in \mathcal{X}} B(x, \alpha) has the homotopy type of X, hence its homology.
By the nerve theorem (th. 2.3), so does the Čech complex \check{C}_\alpha(\mathcal{X}).
Proof. (Sketch.) On a compact of reach \tau, the nearest-point projection is well defined on the tubular neighborhood of radius \tau around X. For \alpha < \tau, the union of balls stays inside this tubular neighborhood.
The density of the sample guarantees that no “branch” of X is missed at scale \alpha, and the nearest-point projection provides the homotopy equivalence between the union and X. The nerve inherits the equivalence through the nerve theorem. ∎
In practice, neither \tau nor \varepsilon is known: it is the persistence diagram of the Čech complex — or of the Rips complex, bracketed by prop. 2.4 — that reveals the interval of scales where the homology remains stable. Read the longest bar in dimension k: there lies the whole topological inference, official topic of the course, put to work.
8. TDA × machine learning
A diagram is neither a vector nor a probability: it is a variable-size multiset of the half-plane. To plug it into a classifier — SVM, forest, network — one must either vectorize it (landscapes, images), put it into a kernel, or turn it into a differentiable layer. This chapter is the bridge toward the heart of the master’s program; it ends with the flagship applications: shapes, neuroimaging, sensor networks.
8.1 — Kernels on diagrams: the sliced Wasserstein kernel (Carrière, Cuturi, Oudot, ICML 2017) The sliced Wasserstein distance between diagrams projects the points onto the lines through the origin and averages the 1D transport distances: \widehat{\mathrm{SW}}(\mathcal{D}_1, \mathcal{D}_2) = \frac{1}{N} \sum_{i=1}^{N} W_1\big( \theta_i^\top \mathcal{D}_1 \cup \Delta,\; \theta_i^\top \mathcal{D}_2 \cup \Delta \big), where the \theta_i are sampled directions and \Delta the projected diagonal (with multiplicities).
The exponential kernel k(\mathcal{D}_1, \mathcal{D}_2) = \exp\big( - \widehat{\mathrm{SW}}(\mathcal{D}_1, \mathcal{D}_2) / \varepsilon \big) is then positive definite, and computes in O((n + m) \log(n + m)) per direction.
One obtains diagram SVMs (Machine Learning module, ch. 3 and 5; Optimal Transport module for the Wasserstein family — preview) that beat fixed vectorizations on graph and shape classification benchmarks. This is one of the founding papers of “topological machine learning” — work of the team, ch. 10.
8.2 — PersLay: a network layer for diagrams (Datashapes, AISTATS 2020) PersLay transforms each point (b, d) of the diagram by a learned function \phi(b, d) (mixture of persistence weights, Gaussians, transform of the point toward (b, d - b)), weights the points by an attention function w(b, d), then aggregates (sum, mean, max, permutation-invariant): \mathrm{PersLay}(\mathcal{D}) = \mathrm{AGG}\big( \{ w(b, d) \cdot \phi(b, d) : (b, d) \in \mathcal{D} \}\big) \;\in\; \mathbb{R}^q. Plugged in front of an MLP, the layer generalizes landscapes and persistence images (particular choices of \phi and w) and trains end to end.
The paper applies it to graph classification via the extended persistence of continuous signatures (heat kernel signatures) — SOTA on several benchmarks of the time. Lab 4 of ch. 9 runs the kernel version of this pipeline on molecules.
Deep Sets in three lines. A function of a diagram must not depend on the order in which its points are listed. Zaheer et al. (2017) showed that, for sets drawn from a countable universe, every such permutation-invariant function has the form f(\mathcal{D}) = \rho\Big( \sum_{p \in \mathcal{D}} \phi(p) \Big): encode each element, pool with a symmetric operation, decode. PersLay is this form, with a weight w and a choice of pooling; graph functions face the same invariance under node permutations (Graph ML module, Definition 2.1 — preview).
Topological losses for deep learning Another use: persistence as a regularizer. After learning an input layer for diagrams (NeurIPS 2017), Hofer et al. regularized auto-encoders with a persistence term on the connectivity of the latent space (ICML 2019): the loss forces the representation to keep the connected components of the data.
Such losses can be optimized because the diagram points are, almost everywhere, differentiable functions of the filtration values, and Theorem 7.1 makes them Lipschitz: when the activations move by \delta in sup norm, the diagram points move by at most \delta. Applications: regularization of segmentations (connectedness of vessels, nerves), latent topology of VAEs — bridge with the Deep Learning module (M1 P1).
8.3 — Flagship applications, with verified references
Neurosciences. Petri et al. (J. R. Soc. Interface, 2014): cerebral functional networks (connectivity of fMRI series) are compared by their diagrams; under psilocybin, the homological structure reorganizes — the “homological scaffolds” identify the functional cycles that mean connectivity masks. It is the most cited TDA study in neuroimaging (> 900 citations).
Sensor networks. de Silva and Ghrist (2007): sensors know only which neighbours they can talk to, within a communication radius r_b, and each covers a disk of radius r_c \geq r_b/\sqrt{3}. Homology then certifies coverage without GPS coordinates.
- Build the Rips complex R of the communication graph and its subcomplex F, the “fence” of sensors along the boundary of the domain.
- Their criterion is sufficient, not an equivalence: if some class of the relative homology H_2(R, F) has a non-zero boundary in H_1(F), the disks cover the domain.
- The vanishing of H_1 of the Rips complex certifies nothing: Rips fills holes that Čech and the union of balls keep (Example 2.5). The factor \sqrt{3} comes from the equilateral triangle of that example: it makes the three disks of any Rips triangle cover the whole triangle.
Shapes and graphs. A network can confuse two meshes close in geometry but different in topology (one extra handle); an H1/H2 persistence feature separates them trivially.
PersLay with the extended persistence of heat kernel signatures is the canonical hybrid. The Shapes module, ch. 9 uses persistence on meshes; the M2 module Analysis and Deep Learning on Geometric Data teaches the heat kernel signature in depth but no persistence, so joining the two is a project, not a topic of that course.
Materials, cosmology, sports… porosity of granular media, galaxy filaments, player trajectories — see the survey by Otter et al. (2017).
Critical positioning (for the exam) TDA is not a predictive model: it is an extractor of structural features that are robust and interpretable, with guarantees (stability) that few deep descriptors have. Its limits: combinatorial cost, loss of fine geometry (a barcode retains only the holes), choice of scale — attenuated but not resolved by persistence. In practice, one concatenates topological features and learned features.
9. Hands-on: GUDHI, scikit-tda, ripser
This chapter turns the theory into code. Three tools cover the workflow: GUDHI (complexes), ripser (fast Rips) and scikit-tda (persim: distances, visualizations). The labs make the canonical shapes speak — circle, two circles, sphere, torus, with noise — then measure stability and feed diagrams to a classifier. The last two labs classify molecular graphs by their persistence and draw a Mapper graph.
# Lab 1 -- Rips persistence with GUDHI: the noisy circle
import numpy as np, gudhi
from gudhi import RipsComplex
t = np.linspace(0, 2*np.pi, 200, endpoint=False)
X = np.stack([np.cos(t), np.sin(t)], 1) + 0.05*np.random.randn(200, 2)
rips = RipsComplex(points=X, max_edge_length=2.0)
st = rips.create_simplex_tree(max_dimension=2)
st.compute_persistence(homology_coeff_field=2, min_persistence=0)
dgm = {k: st.persistence_intervals_in_dimension(k) for k in (0, 1)}
h1 = dgm[1][np.argsort(dgm[1][:, 1] - dgm[1][:, 0])[-1]] # longest H1 bar
print("main hole: birth %.3f, death %.3f" % tuple(h1))
# expected: birth ~0.15 (largest gap), death ~1.6 (close to sqrt(3)) -- cf. example 5.2
pers = st.persistence(homology_coeff_field=2) # keep F2 for the plots (GUDHI's default is 11)
gudhi.plot_persistence_barcode(pers); gudhi.plot_persistence_diagram(pers)# Lab 2 -- ripser + persim: bottleneck and stability to resampling
from ripser import ripser
from persim import plot_diagrams, bottleneck
def sample_circle(n, r, sigma):
t = np.random.rand(n) * 2*np.pi
return np.stack([r*np.cos(t), r*np.sin(t)], 1) + sigma*np.random.randn(n, 2)
D0 = ripser(sample_circle(200, 1, .05))['dgms']
D1 = ripser(sample_circle(200, 1, .05))['dgms']
print("d_b(H1) =", round(bottleneck(D0[1], D1[1]), 3)) # ~ 0.05-0.1: order of the noise
# vary sigma: d_b is smallest near the reference noise 0.05 and grows as sigma
# moves away from it -- numerical illustration of th. 7.1
for sigma in (.01, .05, .1, .2):
D = ripser(sample_circle(200, 1, sigma))['dgms']
print(f"sigma={sigma:4.2f} d_b={bottleneck(D0[1], D[1]):.3f}")# Lab 3 -- landscapes and classification (sklearn): circle vs two circles
from gudhi.representations import Landscape, DiagramSelector
from sklearn.svm import SVC
from sklearn.pipeline import make_pipeline
from sklearn.model_selection import cross_val_score
def diag(n):
"""H1 diagram of a cloud made of k = 1 or 2 random circles, and k"""
k = np.random.randint(2) + 1
pts = [sample_circle(n, r, .05) + np.random.randn(2)*2.5 for r in (.6, 1.3)][:k]
return ripser(np.concatenate(pts))['dgms'][1], k
data = [diag(100) for _ in range(60)]
X = [d for d, _ in data] # 60 H1 diagrams
y = [k for _, k in data] # label = number of circles generated
vec = make_pipeline(DiagramSelector(), Landscape(num_landscapes=3, resolution=100))
model = make_pipeline(vec, SVC(kernel='rbf'))
print(cross_val_score(model, X, y, cv=5).mean()) # expected ~ 0.95-1.0The label is the number of circles that generated the cloud, never computed from the diagram itself; a label read off the bars would let the classifier relearn its own threshold. The few errors come from draws where the two circles overlap.
# Lab 4 -- graph classification: extended persistence of the HKS + sliced Wasserstein kernel
import numpy as np, gudhi
from gudhi.representations import SlicedWassersteinKernel
from scipy.linalg import eigh
from sklearn.svm import SVC
from sklearn.model_selection import GridSearchCV, StratifiedKFold, cross_val_score
def load_tu(path, name="MUTAG"): # TUDataset text files -> [(n, edges)], labels
f = lambda s: np.loadtxt(f"{path}/{name}_{s}.txt", delimiter=",", dtype=int)
gid, y, A = f("graph_indicator") - 1, f("graph_labels"), f("A") - 1
first = np.searchsorted(gid, np.arange(len(y))) # index of each graph's first node
graphs = [(n, []) for n in np.bincount(gid)]
for u, v in A[A[:, 0] < A[:, 1]]: # each undirected edge once
graphs[gid[u]][1].append((u - first[gid[u]], v - first[gid[u]]))
return graphs, y
def hks(n, edges, t): # heat kernel signature of each node
W = np.zeros((n, n))
for u, v in edges: W[u, v] = W[v, u] = 1
d = np.maximum(W.sum(1), 1)
lam, phi = eigh(np.eye(n) - W / np.sqrt(np.outer(d, d))) # L_sym = I - D^-1/2 A D^-1/2
return (np.exp(-t * lam) * phi**2).sum(1)
def ext_dgms(n, edges, t=1.0, min_pers=1e-5): # extended persistence of the HKS filtration
f, st = hks(n, edges, t), gudhi.SimplexTree()
for v in range(n): st.insert([v], filtration=f[v])
for u, v in edges: st.insert([u, v], filtration=max(f[u], f[v]))
st.extend_filtration()
return [np.array([p for _, p in D]).reshape(-1, 2) # for a graph: Ord0, Rel1, Ext0, Ext1
for D in st.extended_persistence(min_persistence=min_pers)]
graphs, y = load_tu("MUTAG") # 188 molecules, 125 of them mutagenic
D = [ext_dgms(n, e) for n, e in graphs]
K = sum(SlicedWassersteinKernel(num_directions=10, bandwidth=1.0)
.fit_transform([d[i] for d in D]) for i in range(4)) # one kernel per diagram type
svm = GridSearchCV(SVC(kernel="precomputed"), {"C": [0.01, 0.1, 1, 10, 100]}, cv=5)
outer = StratifiedKFold(10, shuffle=True, random_state=0)
print(cross_val_score(svm, K, y, cv=outer).mean()) # nested CV: C chosen insideThe filtration is the heat kernel signature of each node on the graph, extended to edges by the maximum, and extended persistence also records the classes that never die (components and rings), which ordinary persistence would leave as infinite bars. GUDHI’s kernel is the one of 8.1, with bandwidth in the role of \varepsilon.
Expected: about 0.90 at t = 1, and between 0.87 and 0.91 over three outer splittings and t \in \{0.1, 1, 10\} — without the atom types. The Weisfeiler–Lehman kernel, which uses them, gives 0.84 to 0.87 under the same nested protocol (Graph ML module, lab sheet of ch. 2 — preview).
Questions for the lab:
- Run
ext_dgmson two disjoint triangles and on the 6-cycle, which the 1-WL test cannot tell apart (Advanced GNN module, ch. 2 — preview). Why are both diagrams empty? Rerun withmin_pers=-1: what separates the two graphs now? (The HKS is constant on these graphs, so every point lies on the diagonal; the kept points count components and rings, as Proposition 3.4 does.) - Replace the four kernels by persistence images of the same diagrams and an RBF SVM: which representation of ch. 5 and 8 wins, and at what cost?
# Lab 5 -- Mapper with GUDHI: a noisy circle becomes a cycle graph
import numpy as np, networkx as nx
from gudhi.cover_complex import MapperComplex
from sklearn.cluster import AgglomerativeClustering
rng = np.random.default_rng(0)
t = rng.uniform(0, 2*np.pi, 1000)
X = np.stack([np.cos(t), np.sin(t)], 1) + 0.05*rng.standard_normal((1000, 2))
f = X[:, :1] # filter: the height x (Definition 6.1)
mapper = MapperComplex(resolutions=[10], gains=[0.3], # 10 intervals, 30 % overlap
clustering=AgglomerativeClustering(n_clusters=None, linkage="single",
distance_threshold=0.3))
mapper.fit(X, filters=f, colors=f)
G = mapper.get_networkx()
n, m, c = G.number_of_nodes(), G.number_of_edges(), nx.number_connected_components(G)
print(n, m, c, "loops:", m - n + c) # Proposition 3.4: expected one loopExpected: about 16 or 17 nodes, as many edges, one component, hence one loop — the hole of the circle, seen without any homology computation. Ex. 10 asks you to rebuild this pipeline by hand.
Points of attention
- max_edge_length truncates the filtration: classes not dead at the end are essential (death = inf), not bugs.
- Memory: limit max_dimension to 2 (or 3 for H2); the number of simplices grows like n^{k+1}; ripser never materializes the boundary matrix — that is its strength (Bauer, 2021).
- Choice of field: GUDHI computes over \mathbb{F}_{11} by default (homology_coeff_field=11), while ripser uses \mathbb{F}_2 (coeff=2). Lab 1 sets 2 explicitly to match the course. Comparing the results over 2 and 3 reveals torsion on exotic examples: a Betti number that changes with the field signals 2- or 3-torsion (the note on torsion of ch. 3).
- Consistency with the course: on Example 4.5, rebuild the filtration by hand (gudhi.SimplexTree, ordered insertion) and verify that persistence() returns exactly the pairs (2,5), (3,6), (4,7), (8,9) and the essential ones 1, 10 — this is Exercise 3.
- Mapper parameters: a fitted
MapperComplexkeeps the filter bounds of its firstfit. Build a new one for each new cloud, or passfilter_bnds, otherwise the cover no longer matches the data and spurious components appear.
10. Course research notes — Inria Datashapes (Oudot)
The module is taught by Steve Oudot, Inria senior researcher (team Datashapes, Inria center of Saclay — the former Geometrica team), member of the computer science laboratory (LIX) of École Polytechnique. The Datashapes team is, with those of Gunnar Carlsson (Stanford) and Herbert Edelsbrunner (IST Austria), one of the three worldwide cradles of TDA: it produced the modern stability theorems, the GUDHI software, and the bridge toward machine learning. Four axes in direct connection with the program; the papers are to be read and presented in project (Exercise 11).
10.1 — Persistence Theory: the theory of quivers (S. Oudot, AMS, 2015) The book Persistence Theory: From Quiver Representations to Data Analysis (Mathematical Surveys and Monographs 209) rebuilds all of persistence — from the decomposition theorem 4.2 to the algorithms — as the representation theory of the quiver A_m: a persistence module is exactly a linear representation of 0 \to 1 \to \dots \to m, and Gabriel’s theorem (classification of the indecomposables by intervals) becomes its key. Chapter 4 of this module follows this algebraic reading: pivots of the boundary matrix = canonical matching of the indecomposables. Posterity: it is the standard reference for moving on to zigzags, multi-dimensional modules and categorical stability questions.
10.2 — Stability: from modules to diagrams (Chazal, Cohen-Steiner, Glisse, Guibas, Oudot, 2009; Chazal, de Silva, Glisse, Oudot, 2016) The paper Proximity of persistence modules and their diagrams (SoCG 2009) defines interleaving between modules and proves the algebraic stability 7.2 — ridding Theorem 7.1 of its tame-function hypotheses; the book The Structure and Stability of Persistence Modules (Springer, 2016) gives the definitive version, with the constancy of barcodes under continuous perturbations. This is the theoretical foundation that allows the statistics of ch. 7: without stability, no bootstrap, no tests, no machine learning on diagrams.
10.3 — ToMATo: clustering by persistence (Chazal, Guibas, Oudot, Škraba, JACM 2013) Persistence-Based Clustering in Riemannian Manifolds combines mode-seeking (gradient ascent on a density estimate, in the style of mean-shift, where each point climbs toward denser neighbours until it reaches a peak) and a merging of modes guided by persistence: two neighboring modes merge if the “pass” separating them has low persistence. Guarantee: under sampling hypotheses (reach conditions, cf. ch. 2 of the book by Boissonnat–Chazal–Yvinec), ToMATo recovers exactly the connected components of the density excursions — the “ideal” clustering — where k-means fails on non-convex shapes. It is the perfect example of an algorithm with topological guarantee.
10.4 — TDA × ML: kernels and layers (Carrière, Cuturi, Oudot, ICML 2017; Datashapes, AISTATS 2020) The sliced Wasserstein kernel (8.1) puts diagrams into the world of SVMs; PersLay (8.2), developed in the same team (M. Carrière, F. Chazal, Y. Ike, T. Lacombe, M. Royer, Y. Umeda — several of them PhDs supervised at LIX), puts them into that of networks. Together, they founded “topological machine learning”: stable topological features + learning capacity.
The natural extension in the master’s program: plugging PersLay on graphs — the graph classification of the Graph ML module, ch. 2, with a descriptor that 1-WL cannot see (Advanced GNN module, ch. 2; both previews). Lab 4 of ch. 9 runs this comparison on MUTAG.
GUDHI: the software of the course The team develops and maintains GUDHI (Geometry Understanding in Higher Dimensions, gudhi.inria.fr): simplex trees, witness Rips, persistence, landscapes, bottleneck — the reference library (C++/Python), written with the team of Mariette Yvinec (former co-author of CGAL). The labs of ch. 9 use it, as well as scikit-tda/ripser for speed comparisons.
Let us also mention Geometric and Topological Inference (Boissonnat, Chazal, Yvinec, Cambridge University Press, 2018 — free PDF on HAL): it is the reference textbook of chapters 2, 3 and 7.
Classic attribution trap at the exam: that book is by Boissonnat, Chazal and Yvinec; Oudot’s book is Persistence Theory (10.1). Both come from the same research lineage — Geometrica, then Datashapes — but not from the same authors.
Exercises
★ Boundary of the boundary over \mathbb{Z}. Detail the proof of Proposition 1.3 in the case k = 3 (tetrahedron): write \partial[a,b,c,d], then \partial(\partial[a,b,c,d]), and verify the term-by-term cancellation with the signs (-1)^i.
★ Sphere and torus. Take up the complete computation 3.3 on the torus as a “square with identified edges” triangulated (2 triangles, 3 edges, 1 vertex — explain why this is not a simplicial complex but only a “Δ-complex”, and why the boundary computation still makes sense): show \beta_0 = 1, \beta_1 = 2, \beta_2 = 1, \chi = 0. What is the minimal abstract complex for the “real” torus (Császár, 7 vertices)?
★ Persistence by hand. Take up Example 4.5 while permuting indices 9 (triangle) and 10 (edge [v_1v_4]) — the filtration remains legal if edge [v_1v_4] appears before the triangle (the triangle does not contain it). Recompute the barcode; which bars change, which are invariant? Verify with GUDHI (note 4 of the hands-on chapter).
★ Bottleneck and Wasserstein. For \mathcal{D}_1 = \{(1, 3), (2, 2.1)\} and \mathcal{D}_2 = \{(1.2, 2.8)\}: compute d_B, then d_{W,1} (sum of the displacements, optimal matching via the diagonal). Build two diagrams with the same d_B but arbitrarily large d_{W,1} — and interpret in terms of noise sensitivity (ch. 7).
★ Landscapes. Compute \lambda(1, \cdot) and \lambda(2, \cdot) for the diagram \{(1, 3), (2, 4)\} (draw the tents; note that they cross at t = 2.5). Verify the bound of Proposition 5.6 against the diagram \{(1, 3), (2, 4.2)\}.
★★ Homology of graphs. Prove the formula \beta_1 = m - n + c (Proposition 3.4) by induction on the number of edges (adding an edge between two components decreases c and leaves \beta_1 unchanged; within one component, it increases \beta_1). Application: what is \beta_1 of the Petersen graph? of a k \times k grid?
★★ Nerve theorem in dimension 1. Let \mathcal{U} be a family of open intervals of \mathbb{R}. Show that the nerve of \mathcal{U} has the same homotopy type as the union:
- (i) each component of the union is an interval (connected, hence contractible);
- (ii) the vertices of the nerve within one component are connected by a path of edges;
- (iii) using Helly’s theorem in dimension 1 — intervals that intersect pairwise have a common point — show that the nerve is the clique complex of the intersection graph, then prove that each of its components is contractible.
Hint: remove the interval with the largest left endpoint; its neighbors all contain a common point, so it is attached along a simplex, and argue by induction.
★★ Jung bracket. Verify Example 2.5 numerically (balls and intersections for an equilateral triangle of side 1), then prove the second inclusion of Proposition 2.4 in the plane: every set of diameter \delta of \mathbb{R}^2 fits in a disk of radius \delta/\sqrt{3} (consider the smallest enclosing disk; if its center is not on the boundary…).
★★ DTM stability. Let \mathcal{X} be a sample and \mathcal{X}' obtained by adding an outlier at distance L from the rest. Bound the variation of d_B for the Rips complex (via Proposition 7.3: here d_H(\mathcal{X}, \mathcal{X}') = L, so the bound becomes 2L).
Explain why the DTM version of ch. 7 degrades only by O(L\sqrt{w/k}), where w is the weight of the outlier and k the mass parameter (the DTM is k^{-1/2}-Lipschitz with respect to the Wasserstein-2 distance between measures).
★★ Mapper. Implement Mapper (30 lines: overlapping histogram + single-linkage from scipy + networkx) on MNIST reduced to 3 dimensions by UMAP; compare two filters (density vs eccentricity). Look for “arms” and loops of the graph and inspect the digits they contain, as Example 6.2 did for tumors (ch. 6).
★★★ Paper. Choose a paper from ch. 10 (Oudot 2015; Chazal et al. 2009/2016; ToMATo 2013; sliced Wasserstein 2017; PersLay 2020), read it and present it in 10 minutes: problem, key theorem, sketched proof, experimental result, limitation. Grid: one figure re-explained, one figure reproduced, one open question.
★★★ Guiding project (optional). Compute the H1 diagrams of the clique complexes of a citation graph (ogbn-arxiv, described in the Graph ML module, ch. 7 — preview) and train a sliced Wasserstein kernel SVM to predict the topic; compare with a GNN (Advanced GNN module — preview); what information does each family capture?
Projects and assessment
The official assessment, as quoted in the fiche above, is a “written final exam, with the possibility of adding a graded lab course” (description of the 2026–2027 sheet; its LLGA assessment section is empty). The subjects below can serve as that graded lab course or as a course project, and the written exam is a sample of the final exam. Everything in this section is a proposal, not an official rule.
The projects exercise mainly O4 (graph-structured data: graph filtrations, graph classification, the 1-WL limit) and O1 (ML foundations: kernels, clustering, auto-encoders, honest evaluation), with O7 (hands-on work with GUDHI and ripser on public data) throughout and O3 for the transformer subject. The ToMATo subject is a course-sized version of the TDA option of the Year 1 capstone Y1.1 (end-of-year projects).
Solo projects
- [Solo · ≈ 20 h] Persistent homology from scratch, then fast. Papers: Chen and Kerber (2011), Persistent homology computation with a twist; Bauer (2021), Ripser.
- Question: how much of ripser’s speed comes from the clearing (“twist”) optimisation alone, and how much from its other ingredients: cohomology, an implicit boundary matrix that is never stored, and apparent pairs?
- Work: in NumPy, build the Rips filtration up to dimension 2 and its boundary matrix (Definition 4.3), and reduce it with the standard algorithm (Theorem 4.4). Then add clearing: reduce the dimensions from the highest down, and when column j ends with \mathrm{low}(j) = i, set column i to zero without reducing it, since a simplex that gives birth has a zero reduced column.
- Data: Example 4.5, then noisy samples of a circle, a sphere and a torus, checked against GUDHI.
- Success: diagrams identical to GUDHI’s (bottleneck distance below 10^{-9}) on every test cloud; time and memory curves against n and the maximal dimension for both reductions and for ripser, with the gain of clearing explained.
- Deliverables: code with unit tests, 4–6 page report, 10-minute talk. Chapters: ch. 1, ch. 2, ch. 4, ch. 9.
- [Solo · ≈ 20 h] Clustering that resists chaining: ToMATo against single linkage and DBSCAN. Paper: Chazal, Guibas, Oudot and Škraba (2013), ToMATo (10.3). Connects this course to Machine Learning, section 7.1 and to the TDA option of the capstone Y1.1.
- Question: when does density persistence beat single linkage and DBSCAN, and can the prominence threshold \tau be read off the diagram without labels?
- Work: scale Examples 2.8 and 2.10 to synthetic data — two or three Gaussian blobs joined by sparse bridges, plus 0–5 % uniform outliers. Then cluster the sentence embeddings of four 20 Newsgroups categories (scikit-learn’s
fetch_20newsgroups, encoded with a small sentence-transformers model such as all-MiniLM-L6-v2). Use GUDHI’sTomato, scipy’s single linkage and scikit-learn’s DBSCAN, with \tau taken at the largest gap of the diagram. - Success: adjusted Rand index against the labels for each method and outlier rate, mean and spread over 5 seeds; at least one setting where single linkage collapses through a bridge and ToMATo does not, explained with Definition 2.9.
- Deliverables: code, 4–6 page report, 10-minute talk. Chapters: ch. 2, ch. 7, ch. 10.
- [Solo · ≈ 20 h] Which bars are signal? Confidence sets for persistence diagrams, reproduced. Paper: Fasy, Lecci, Rinaldo, Wasserman, Balakrishnan and Singh (2014), Confidence sets for persistence diagrams, Annals of Statistics.
- Question: can a bootstrap band separate the true holes from noise without knowing the shape, as the bootstrap note of ch. 7 promises?
- Work: implement the subsampling band of the paper. With q the 95 % quantile of the Hausdorff distance between subsamples of size b \ll n and the full cloud, the paper bounds d_H to the hidden shape by c = 2q (its Theorem 3, stated for Čech diagrams). Proposition 7.3 turns it into the bottleneck bound 2c for Rips diagrams. Add the bottleneck bootstrap as a variant: the 95 % quantile of d_B between replica diagrams and the full diagram.
- Rule: a point farther from the diagonal than the bound, in the sup norm, cannot be matched to it, so its bar is declared significant (Definition 5.3).
- Data: circle, two circles, sphere and torus at increasing noise levels, then one real cloud of your choice (for example a 3D scan from the Stanford repository).
- Success: on noiseless and low-noise circles, whose true Rips diagram is known (one H_1 point (0, r\sqrt{3}) for radius r, Example 5.2), an empirical coverage of at least 95 %, with its excess reported, since the paper calls the subsampling band very conservative; and significant bars matching the Betti numbers of each shape at low noise.
- Deliverables: code, 4–6 page report, 10-minute talk. Chapters: ch. 5, ch. 7, ch. 9.
Group projects
- [Group of 3 · ≈ 30 h each] Topological descriptors versus GNNs for graph classification. Papers: Carrière, Chazal, Ike, Lacombe, Royer and Umeda (2020), PersLay; Xu, Hu, Leskovec and Jegelka (2019), GIN. Connects this course to Graph ML, ch. 2 and 5 and Advanced GNN, ch. 2.
- Question: what do persistence diagrams of graph filtrations capture that the 1-WL test, and hence message passing, cannot — and does it help accuracy?
- Work: on MUTAG, PROTEINS and IMDB-BINARY (TUDataset, Morris et al. 2020), compare the sliced Wasserstein kernel on extended persistence of HKS filtrations (Lab 4, several t), PersLay, the WL subtree kernel and a GIN, under the fair protocol of Errica et al. (2020). Build at least three pairs of 1-WL-indistinguishable graphs, from two triangles against the 6-cycle to larger regular pairs, and test which descriptor separates them.
- Split: filtrations and kernels; PersLay and GIN in PyTorch; evaluation protocol and the 1-WL study.
- Success: 10-fold accuracy (mean ± standard deviation) of the four methods on the three datasets, and a table of the indistinguishable pairs saying, for each descriptor, whether it separates them and why (Proposition 3.4, Theorem 4.2).
- Deliverables: code, joint 8–10 page report, 20-minute talk. Chapters: ch. 3, ch. 4, ch. 8, ch. 9.
- [Group of 3 · ≈ 30 h each] The shape of transformer embedding spaces. Paper: Naitzat, Zhitnikov and Lim (2020), Topology of Deep Neural Networks, JMLR. Connects this course to Large Language Models (M2) and to Text Mining and NLP (Period 2).
- Question: Naitzat et al. found that ReLU networks simplify the topology of the data layer after layer. Does the same hold for the hidden states of a small pretrained transformer, and does fine-tuning change it?
- Work: take bert-base-uncased (or GPT-2 small) from Hugging Face and the SST-2 sentences. At every layer, before and after fine-tuning on SST-2, extract sentence vectors (mean of the token states). For each layer and class, compute Rips persistence of the L2-normalised vectors (ripser, 1,000-point subsamples, H_0 and H_1), landscapes, Betti curves and a Mapper graph. Their Euclidean distance ranks pairs as the cosine distance does but is a metric, which the stability results of ch. 7 need.
- Split: embeddings and fine-tuning; persistence and statistics; Mapper and interpretation.
- Success: per-layer summaries with bootstrap bands (ch. 7) over at least 5 subsamples, and every claimed change, between layers or across fine-tuning, larger than its band.
- Deliverables: code, joint 8–10 page report, 20-minute talk. Chapters: ch. 2, ch. 5, ch. 6, ch. 7, ch. 9.
- [Group of 3 · ≈ 30 h each] A topology-preserving auto-encoder on images. Paper: Moor, Horn, Rieck and Borgwardt (2020), Topological Autoencoders, ICML. Connects this course to Deep Learning (Period 1) and covers the multimedia practice that the official syllabus asks for.
- Question: does a loss on the 0-dimensional persistence pairs of each mini-batch keep the connectivity of the data in the latent space, and at what cost in reconstruction?
- Work: the 0-dimensional pairs of a Rips filtration are the edges of a minimum spanning tree (Definition 2.7). The loss takes the MST edges of the input batch and penalises the squared gap between their lengths in the input space and in the latent space, then does the same with the MST edges of the latent batch. Implement it in PyTorch with scipy’s MST and compare with a plain auto-encoder, PCA and UMAP.
- Data: the nested Spheres of the paper, Fashion-MNIST, and COIL-20 (Nene, Nayar and Murase, 1996), where the 72 views of each rotating object form a loop.
- Split: loss and training; image experiments; evaluation and the H_1 study on COIL-20.
- Success: over 3 seeds, a better trustworthiness (scikit-learn) and density-KL measure of the paper than the plain auto-encoder on all three datasets, at a reconstruction error within 10 % of it; on COIL-20, the number of objects whose latent trace keeps a long H_1 bar, for each method.
- Deliverables: code, joint 8–10 page report, 20-minute talk. Chapters: ch. 2, ch. 5, ch. 7, ch. 8.
Written exam (proposal)
Three hours, one handwritten A4 sheet allowed, no electronic device; four questions. Rips complexes use the diameter convention of Definition 2.2.
Question (5 points). Explain why persistence looks at all scales at once instead of choosing one. State the bottleneck stability theorem and explain how it makes a bootstrap confidence band meaningful. Give the main weakness of the bound and the fix proposed in ch. 7.
Expected: at one scale the complex is either dust or one contractible ball, and a hole seen at a single scale may be noise (Example 5.2); the barcode records births and deaths, and long bars are the features.
Theorem 7.1: for tame f, g on a finite complex, d_B\big(\mathrm{Dgm}(f), \mathrm{Dgm}(g)\big) \leq \|f - g\|_\infty , extended to \delta-interleaved modules by Theorem 7.2; hence d_B \leq 2\, d_H for Rips diagrams (Proposition 7.3). Resampled diagrams therefore move by a controlled amount, and the quantile c of their bottleneck distances gives a band: bars longer than 2c are significant.
Weakness: the sup norm, since one outlier at distance L makes d_H = L. Fix: the distance-to-measure, Lipschitz in Wasserstein-2, where the outlier only costs its mass.
Question (7 points). Let S be the four corners of the unit square and R the corners of the rectangle [0, 1] \times [0, 1.2].
Give the H_0 and H_1 barcodes of the Rips filtrations of S and of R. (b) Compute the bottleneck distance between the two H_1 diagrams.
Compute d_H(S, R) and check Proposition 7.3. (d) Check Theorem 3.5 on the Rips complex of R at scale \varepsilon = 1.3.
Expected: (a) for S, the four sides enter at 1, so H_0 is [0, 1) three times and [0, \infty).
The 4-cycle is born at 1, and at \sqrt{2} \approx 1.414 the diagonals, all triangles and the tetrahedron enter together, so H_1 is [1, \sqrt{2}).
For R, the sides of length 1 enter at 1 and those of length 1.2 at 1.2, so H_0 is [0, 1) twice, [0, 1.2) and [0, \infty). The 4-cycle closes at 1.2 and the diagonals have length \sqrt{2.44}, so H_1 = [1.2, \sqrt{2.44}) \approx [1.2,\ 1.562) .
Matching the two points costs \max(0.2,\ 0.148) = 0.2; sending both to the diagonal costs \max(0.207,\ 0.181) = 0.207; hence d_B = 0.2 .
Two corners move by 0.2, so d_H = 0.2 and d_B = 0.2 \leq 2\, d_H = 0.4. (d) At 1.3 the complex is the hollow 4-cycle: \chi = 4 - 4 = 0 = \beta_0 - \beta_1 = 1 - 1.
Question (5 points). (a) Show that adding one edge e = uv to a finite graph either decreases \beta_0 by one and leaves \beta_1 unchanged, or leaves \beta_0 unchanged and increases \beta_1 by one. (b) Deduce that, when all pairwise distances are distinct, the death times of the 0-dimensional barcode of a Rips filtration are the edge lengths of a minimum spanning tree.
Expected: (a) if u and v lie in different components, the chain u + v was not a boundary, so \mathrm{rank}\, \partial_1 grows by one: \beta_0 drops by one and \dim Z_1 is unchanged.
Otherwise a path already joins them and u + v was a boundary, so the rank is unchanged. Then \dim Z_1 = m - \mathrm{rank}\, \partial_1 grows by one with m, and since B_1 = 0 for a graph, \beta_1 grows by one.
- Triangles and higher simplices do not change \partial_1, hence not H_0. Edges enter by increasing length, and an edge kills an H_0 class exactly when it joins two components — Kruskal’s acceptance rule. Kruskal’s output is a minimum spanning tree (cut property), whose n - 1 edge lengths are the death times.
Question (3 points). A colleague claims that a sensor network covers its domain if and only if H_1 of the Rips complex of its communication graph vanishes. Give a counterexample to each direction, and say what the criterion of de Silva and Ghrist uses instead.
Expected: three sensors at the corners of an equilateral triangle of side s equal to the communication radius, with a coverage radius r such that s/2 \leq r < s/\sqrt{3}: the Rips triangle is filled, so H_1 = 0, yet the circumcenter is not covered (Example 2.5).
Conversely, four sensors at the corners of a square of side s equal to the communication radius: the diagonals are too long, the Rips complex is a hollow square with H_1 \neq 0, yet closed disks of radius s/\sqrt{2} cover the square.
The real criterion is sufficient only: under r_c \geq r_b/\sqrt{3} and a fence F, a class of H_2(R, F) with non-zero boundary in H_1(F) proves coverage.
Grading rubric (proposal)
| Criterion | Weight | What earns the marks |
|---|---|---|
| Understanding of the theory | 25 % | Correct statement of the tools used (filtration, diagram, stability, extended persistence), with their assumptions checked and linked to the chapters |
| Implementation and reproducibility | 25 % | Correct code validated on a hand-computed case (Example 4.5 or a shape of known homology); fixed seeds; scripts that regenerate every figure |
| Experiments and statistics | 25 % | The success criterion reached or the gap explained; honest baselines (single linkage, WL kernel, plain auto-encoder); bootstrap bands or the spread over seeds |
| Analysis and critical view | 15 % | Topological claims tied to long bars, not to noise; failures traced to a cause (scale, outliers, filter choice); one proposed improvement |
| Report and talk | 10 % | Clear structure, readable diagrams and barcodes, talk within time, precise answers; in groups, each member presents their part |
References
- H. Edelsbrunner, J. Harer, Computational Topology: An Introduction, AMS, 2010 — the reference textbook of the module: complexes, homology, persistence algorithm (ch. 1, 3, 4).
- J.-D. Boissonnat, F. Chazal, M. Yvinec, Geometric and Topological Inference, Cambridge Texts in Applied Mathematics 57, Cambridge University Press, 2018 — publisher page (free PDF on HAL): reconstruction, sampling, DTM (ch. 2, 3, 7 of the module).
- S. Y. Oudot, Persistence Theory: From Quiver Representations to Data Analysis, Mathematical Surveys and Monographs 209, AMS, 2015 — AMS page: the algebraic reading of ch. 4 (work of the team, ch. 10.1).
- F. Chazal, V. de Silva, M. Glisse, S. Y. Oudot, The Structure and Stability of Persistence Modules, Springer, 2016 — arXiv:1207.3674: interleavings, algebraic stability (ch. 7; team, ch. 10.2).
- H. Edelsbrunner, D. Letscher, A. Zomorodian, Topological Persistence and Simplification, Discrete & Computational Geometry 28, 2002 — the founding paper of the algorithm of ch. 4.
- A. Zomorodian, G. Carlsson, Computing Persistent Homology, Discrete & Computational Geometry 33, 2005 — the modules-over-a-field version (Theorem 4.2).
- D. Cohen-Steiner, H. Edelsbrunner, J. Harer, Stability of Persistence Diagrams, Discrete & Computational Geometry 37, 2007 — Theorem 7.1.
- F. Chazal, D. Cohen-Steiner, M. Glisse, L. J. Guibas, S. Y. Oudot, Proximity of Persistence Modules and Their Diagrams, SoCG 2009 — algebraic stability (Theorem 7.2; team, ch. 10.2).
- P. Bubenik, Statistical Topological Data Analysis Using Persistence Landscapes, JMLR 16, 2015 — the landscapes of ch. 5.
- F. Chazal, B. Fasy, F. Lecci, A. Rinaldo, A. Singh, L. Wasserman, Stochastic Convergence of Persistence Landscapes and Silhouettes, SoCG 2013 — the convergence of empirical landscapes (note of ch. 7).
- B. T. Fasy, F. Lecci, A. Rinaldo, L. Wasserman, S. Balakrishnan, A. Singh, Confidence Sets for Persistence Diagrams, Annals of Statistics 42(6), 2014 — the subsampling and bootstrap bands of the note of ch. 7 and of solo project 3.
- G. Singh, F. Mémoli, G. Carlsson, Topological Methods for the Analysis of High Dimensional Data Sets and 3D Object Recognition, Eurographics Symposium on Point-Based Graphics, 2007 — the Mapper paper of ch. 6.
- M. Nicolau, A. J. Levine, G. Carlsson, Topology Based Data Analysis Identifies a Subgroup of Breast Cancers with a Unique Mutational Profile and Excellent Survival, PNAS 108(17), 2011 — Example 6.2.
- G. Petri, P. Expert, F. Turkheimer, R. Carhart-Harris, D. Nutt, P. J. Hellyer, F. Vaccarino, Homological Scaffolds of Brain Functional Networks, Journal of the Royal Society Interface 11, 2014 — the neurosciences application of ch. 8.
- V. de Silva, R. Ghrist, Homological Sensor Networks, Notices of the AMS 54(1), 2007 — sensor coverage, Rips = Čech in \ell_\infty (ch. 2, 8).
- G. Carlsson, Topology and Data, Bulletin of the AMS 46(2), 2009 — the great survey of the field.
- N. Otter, M. A. Porter, U. Tillmann, P. Grindrod, H. A. Harrington, A Roadmap for the Computation of Persistent Homology, EPJ Data Science 6:17, 2017 — the practical guide (software, pitfalls) of ch. 9.
- M. Carrière, M. Cuturi, S. Oudot, Sliced Wasserstein Kernel for Persistence Diagrams, ICML 2017 — the kernel of ch. 8.1 (team, ch. 10.4).
- M. Carrière, F. Chazal, Y. Ike, T. Lacombe, M. Royer, Y. Umeda, PersLay: A Neural Network Layer for Persistence Diagrams and New Graph Topological Signatures, AISTATS 2020 — the layer of ch. 8.2.
- M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Póczos, R. Salakhutdinov, A. Smola, Deep Sets, NeurIPS 2017 — the sum form of permutation-invariant set functions (ch. 8.2).
- C. Hofer, R. Kwitt, M. Niethammer, A. Uhl, Deep Learning with Topological Signatures, NeurIPS 2017 — a learned input layer for diagrams, the starting point of the topological losses of ch. 8.
- F. Chazal, L. J. Guibas, S. Y. Oudot, P. Škraba, Persistence-Based Clustering in Riemannian Manifolds, Journal of the ACM 60(6), 2013 — ToMATo (ch. 10.3).
- U. Bauer, Ripser: Efficient Computation of Vietoris–Rips Persistence Barcodes, Journal of Applied and Computational Topology 5, 2021 — the fast matrix-free algorithm (ch. 9).
- Software: GUDHI (Inria Datashapes — the library of the labs); scikit-tda (ripser, persim); PersLay.