0% found this document useful (0 votes)
109 views

Lecture Notes

This document provides an overview of the course "Topological Data Analysis Spring 2020". It introduces fundamental concepts in topological data analysis, such as simplices, simplicial complexes, homology, persistent homology, zigzag persistence, and Mapper. It also describes computational techniques for computing topological features as well as theoretical results such as the stability of persistent homology. The document is divided into 13 weeks of content covering topics ranging from simplicial complexes to applications in clustering and sensor networks.

Uploaded by

mobius
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views

Lecture Notes

This document provides an overview of the course "Topological Data Analysis Spring 2020". It introduces fundamental concepts in topological data analysis, such as simplices, simplicial complexes, homology, persistent homology, zigzag persistence, and Mapper. It also describes computational techniques for computing topological features as well as theoretical results such as the stability of persistent homology. The document is divided into 13 weeks of content covering topics ranging from simplicial complexes to applications in clustering and sensor networks.

Uploaded by

mobius
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 87

Topological Data Analysis Spring 2020

Magnus Bakke Botnan

Contents
1 Week 1: Introduction and Simplicial Complexes 3
1.1 Simplices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Simplicial Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Abstract Simplicial Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Triangulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 The Cech and Vietoris–Rips Simplical Complexes . . . . . . . . . . . . . . . . . . 6

2 Week 2: Simplicial Homology 7


2.1 Free Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 The Betti Number and the Euler Characteristic . . . . . . . . . . . . . . . . . . . 10
2.3 A Remark on the Choice of Coefficients . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Homology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3 Week 3: Computation, Induced Maps and Invariance 15


3.1 The Standard Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.1 The Homology of a Triangle . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.2 The Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Simplicial Maps and their Induced Maps in Homology . . . . . . . . . . . . . . . 17
3.3 Simplicial Approximations and Invariance of Homology . . . . . . . . . . . . . . 18
3.3.1 Simplicial Maps Revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.2 Simplicial Approximations . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4 Week 4: Homotopy Equivalence, Relative Homology and Sensor Networks 21


4.1 Homotopy Equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 The Nerve Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2.1 The Cech Complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Relative Homology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.4 Sensor Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4.1 The covering problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5 Week 5: Topology & Homology Inference and Persistent Betti Numbers 28


5.1 Topology & Homology Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.2 Persistent Betti Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2.1 The Cech and Vietoris–Rips Filtrations . . . . . . . . . . . . . . . . . . . 32

6 Week 6: Algebraic Foundations 34


6.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.2 Persistence Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

1
7 Week 7: The Persistence Algorithm 40
7.1 The standard algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.2 Clearing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

8 Week 9: Cohomology 45
8.1 Dual persistence modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8.2 Simplicial Cohomology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
8.3 Persistent Cohomology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
8.3.1 Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
8.3.2 Clearing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

9 Week 10: Stability of Persistent Homology 52


9.1 The Bottleneck Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
9.1.1 Stability of Persistent Homology . . . . . . . . . . . . . . . . . . . . . . . 53
9.1.2 Generalizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.2 Interleavings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

10 Week 11: Clustering and TDA 59


10.1 Some Examples and Kleinberg’s Theorem . . . . . . . . . . . . . . . . . . . . . . 59
10.2 ToMATo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
10.2.1 The Discrete Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
10.3 A First Taste of Mapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

11 Week 12: Reeb Graphs and Mapper Continued 66


11.1 Reeb Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
11.2 The Continuous Mapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
11.3 Mapper in Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

12 Week 13: Generalized Persistence 71


12.1 Zigzag Persistent Homology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
12.1.1 Levelset Zigzag Persistent Homology . . . . . . . . . . . . . . . . . . . . . 72
12.1.2 Reeb Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
12.2 Multiparameter Persistent Homology . . . . . . . . . . . . . . . . . . . . . . . . . 74
12.2.1 RIVET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
12.2.2 Distances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

13 Week 14: dI = dB 81
13.1 dI ≤ dB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
13.2 dB ≤ dI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
13.2.1 Hall’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
13.2.2 Wrapping Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

2
1 Week 1: Introduction and Simplicial Complexes
The idea of Topological Data Analysis (TDA) is to assign topological invariants to data. Data
however is typically presented as a discrete sample whose topology is rather uninteresting.
Therefore we must transform the data into a ”continuous” object which (hopefully) is topolog-
ically similar to the shape of the underlying geometric object from which the data is sampled.
Take for example the discrete set of data points in the figure below. Clearly there is ”circular
structure” to the data and our pattern-seeking brains have no trouble inferring such informa-
tion. Topology per-se does not measure this circularity but after thickening every point by a
certain predefined thickness an annulus appears. This is a topological object with a well-defined
”circular structure”.

In general, the resulting continuous spaces need to be discretized before we can feed them
into our computers, and this is typically done by means of simplicial complexes. In the first
lecture we discuss simplicial complexes in general and two constructions in particular: the Cech
and Vietoris–Rips complexes.
Most of the following material can be found in [10, Sections 1.1-3] and [8, III.1-3].

1.1 Simplices
A set of points {p0 , . . . , pn } ⊂ Rd is said to be geometrically independent1 if for any (real)
scalars {ti }ni=0 , the equations
n
X n
X
ti = 0 ti ai = 0 (1)
i=0 i=0

imply that t0 = t1 = . . . = tn = 0. This is clearly equivalent to the vectors {p1 − p0 , . . . , pn − p0 }


being linearly independent.

Definition 1.1. Let {p0 , . . . , pn } be a geometrically independent set in Rd . We define the


n-simplex spanned by the points pi to be the set of all points x ∈ Rd of the form
n
X
x= ti pi
i=0

where ni=0 ti = 1, and ti ≥ 0 for all i. The point x is a convex combination of the points
P
p0 , . . . , pn , and the uniquely determined numbers ti are called the barycentric coordinates.

One immediately observes that any point is a 0-simplex, any two distinct points form a
1-simplex (a line), three non-collinear points form a 2-simplex (a triangle), four non-coplaner
points form a 3-simplex (a tetrahedron) and so forth. Note that there can be no n-simplex in Rd
for n > d. The points p0 , . . . , pn that span a simplex σ are called the vertices of σ; the number
1
Or affinely independent.

3
Figure 1: examples of simplices

Figure 2: Left: A simplicial complex of dimension 2. Middle: not a simplicial complex as the
intersection of the two simplices is not a face. Right: not a proper simplex.

n is the dimension of σ. A simplex is regular if all its edges have the same length. The
standard n-simplex ∆n spanned by the endpoints of the unit vectors along the coordinate
axes in Rn+1 is a regular simplex.
By definition, any subset of {p0 , . . . , pn } is again geometrically independent and thus defines
a simplex in its own right. We say that τ is a face of σ if τ is spanned by a subset of the vertices
defining σ. We denote this by τ ⊆ σ or τ ⊂ σ if τ is a proper face of σ, i.e. τ 6= σ. The union
of the proper faces of σ is called the boundary of σ and is denoted by Bd(σ). The simplex σ
is a (proper) coface of τ if τ is a (proper) face of σ.

1.2 Simplicial Complexes


By gluing simplices along faces we obtain topological spaces whose properties are determined
by their combinatorial properties.

Definition 1.2. A simplicial complex K in Rd is a finite2 collection of simplices in Rd such


that:

1. Every face of a simplex of K is in K.

2. The non-empty intersection of any two simplices of K is a face of each of them.

The dimension of K is the maximum dimension of its simplices and is denoted by dim K.
If L is a subcollection of simplices that contains all faces of its elements, then L is a simplicial
complex in its own right; it is called a subcomplex of K. The p-skeleton K (p) of K is the
collection of all simplices of K of dimension at most p. In particular, K (0) is the vertex set of
K.
2
We will only consider finite simplicial complexes in this course.

4
Let |K| denote the subset of Rd given by the union of all the simplices in K, equipped with
the subspace topology. This space is called the underlying space of K. A polyhedron is a
subset of Rd that can be realized as the underlying space of a simplicial complex.

1.3 Abstract Simplicial Complexes


Often the precise geometry of the simplicial complex is not important. We now introduce a
purely combinatorial description of simplical complexes under which two objects are isomorphic
if and only if their geometric counterparts are linearly isomorphic.
Definition 1.3. An abstract simplicial complex is a finite collection A of finite non-empty
sets, such that if α is an element of A, then so is every nonempty subset of α.
We call the elements of A simplices and the dimension of α ∈ A is dim α = |α| − 1.
As above the dimension of A is given by dim A = maxα∈A dim α. We say that B ⊆ A is a
subcomplex of A if B is an abstract simplicial complex. The vertices VA of A is the union
of the one-point elements of A. We say that two simplical complexes A and B are isomorphic
if there is a bijective correspondence f : VA → VB satisfying {a0 , . . . , an } ∈ A if and only if
{f (a0 ), . . . , f (an )} ∈ B. A (geometric) simplicial complex K defines an abstract simplicial
complex A by identifying any K with its vertices. We say that A is the vertex scheme of
K. The line connecting p0 and p1 has vertex scheme {{p0 }, {p1 }, {p0 , p1 }}. If A is the vertex
scheme of K, then we say that K is the geometric realization of A. It is easy to see that
any abstract simplicial complex on d + 1 vertices can be geometrically realized as subcomplex
of any d-simplex in Rd . The next lemma shows that we often can do considerably better.
A finite subset P ⊂ Rd is in general position if any subset of at most d + 1 points is
geometrically independent.
Remark 1.4. Most point-sets are in general position, and those who are not can be brought into
general position by an arbitrary small perturbation. One may verify that any subset of at most
r + 1 points in the image of the curve γ : R → Rr defined by γ(t) = (t, t2 , . . . , tr ) is in general
position.
Lemma 1.5. An abstract simplicial complex A with dim A = d has a geometric realization in
R2d+1 .
Proof. Let h : VA → R2d+1 be any function such that h(VA ) is in general position. Any simplex
α ∈ A has at most d+1 vertices, and thus its vertices correspond to a geometrically independent
set under the function h. We denote this set by h(α), and the associated geometric simplex by
σα . It remains to show that the intersection of any two simplices is a face of both the simplices.
Let α and β be any two simplices and observe that |α ∪ β| ≤ 2(d + 1), and therefore
h(α) ∪ h(β) forms a geometrically independent set. It follows that any point x ∈ σα ∩ σβ can be
uniquely represented as a convex combination of the vertices h(α) ∪ h(β). Hence the barycentric
coordinates of x can be non-zero only for ti ∈ h(α ∩ β). We conclude that x ∈ σα∩β .

1.4 Triangulations
Definition 1.6. A topological space X is triangulable if there exists a simplicial complex
K whose underlying space is homeomorphic to X. Any homeomorphism h : |K| → X is a
triangulation.
Example 1.7. Abstract simplicial complexes can be very useful in defining triangulations of
spaces; see Fig. 3 for an example of how to specify a triangulation of the cylinder (of finite
height).

5
Figure 3: Using an abstract simplicial complex to generate a triangulation of the cylinder.

Remark 1.8. It is a well-known fact that any closed surface can be triangulated and the same
holds true for 3-dimensional manifolds. The situation becomes significantly more complicated
in dimension 4 where manifolds need not admit a triangulation. The comb space is an example
of a compact, path-connected subset of the plane that cannot be triangulated (why?).

1.5 The Cech and Vietoris–Rips Simplical Complexes


We now turn our attention to two of the most widely used simplicial complexes constructed
in topological data analysis. We will return to them for a more formal treatment later in the
course. In what follows P = {p0 , . . . , pn } ⊂ Rd .

The Cech complex. For a point x ∈ Rd , let Br (x) := {x0 ∈ Rd : ||x − x0 || ≤ r} denote the
closed ball of radius r centred at x. The Cech complex of P at scale r is the simplicial
complex \
Cechr (P ) = {σ ⊆ P : Br (p) 6= ∅}.
p∈σ
S
Remark 1.9. We shall see that | Cechr (P )| faithfully captures the topology of p∈P Br (P ).
Determining if σ ∈ Cechr (P ) may appear unwieldy for simplices of large cardinality. The
following theorem shows that we need not consider all possible intersections as long as the
embedding dimension is small.

Theorem 1.10 (Helly’s Theorem). Let F denote a finite collection of closed, convex sets in
Rd . If the intersection of any d + 1 sets is non-empty, then the whole collection has non-empty
intersection.

Proof. See e.g. [8, III.2].

Hence, if P ⊂ R3 , then computing all quadruple intersections will be sufficient for deter-
mining Cechr (P ). Furthermore, one observes that σ ∈ Cechr (P ) if and only if there exists a
ball of radius r containing all the elements of σ. The unique (exercise) smallest enclosing ball
containing a set of points σ ⊆ P is called the minimal enclosing ball, and it can be effectively
computed with the miniball algorithm[8, III.2].

6
The Vietoris–Rips complex. Recall that the diameter of a subset σ ⊆ P is given by
diam σ = maxpi ,pj ∈P ||pi − pj ||. The Vietoris–Rips complex of P at scale r is the simplicial
complex
VRr (P ) = {σ ⊆ P : diam σ ≤ 2r}.
It is straightforward to verify that Cechr (P ) ⊆ VRr (P ) ⊆ Cech2r (P ). The latter bound can
however be significantly sharpened.
Theorem 1.11 (Jung’s Theorem). Let Q be a finite point set in Rd with q diameter diam Q.
d
Then Q is contained in a closed ball with radius r ≤ δdiam Q where δ = 2(d+1) .

Proof. Assume that the minimal enclosing ball of Q has center z and radius r, and let Sr (z)
denote its boundary. By minimality, Sr (z) ∩ Q 6= ∅ and we let {q1 , . . . , qn } be a maximally
geometrically independent subset of Sr (z) ∩ Q. Note that n ≤ d + 1 since the points lie in Rd .
If n < d + 1, then extend the set with elements {qn+1 , . . . , qd+1 } ⊂ Sr (z) \ Sr (z) ∩ Q such that
{q1 , . . . , qd+1 } is geometrically independent. Then Sr (z) is the unique sphere passing through
the qi0 s, and z can be expressed as a convex combination as follows
d+1
X d+1
X
z= t i qi ti = 1.
i=1 i=1

Without loss of generality we will assume that z = 0. For a fixed 1 ≤ k ≤ d + 1 we get


d+1
X d+1
X d+1
X d+1
X d+1
X
ti ||qi − qk ||2 = ti ||qi − qk ||2 = ti ||qi ||2 − 2qk · ti qi + ||qk ||2 ti
i=1,i6=k i=1 i=1 i=1 i=1

= r2 − 0 + r2 = 2r2 .

Summing over all 1 ≤ k ≤ (d + 1) gives


d+1 X
X d+1 d+1 X
X n
2 2
(d + 1)(2r ) = ti ||qi − qk || ≤ ti (diam Q)2
k=1 i=1,i6=k k=1 i=1,i6=k
d+1
X
= (1 − tk )(diam Q)2 = d(diam Q)2 .
k=1

We conclude that s
d
r≤ · diam Q.
2(d + 1)

The bound is tight for regular d-simplices in Rd (exercise).


q q
d 2d
Corollary 1.12. Cechr (P ) ⊆ VRr (P ) ⊆ Cech2δr (P ) where 2δ = 2 2(d+1) = d+1 .

2 Week 2: Simplicial Homology


Distinguishing topological spaces is a notoriously difficult problem: deciding if two simplicial
complexes are homeomorphic (or homotopy equivalent) is an undecidable problem. Roughly
speaking, this means that there exists no algorithm which takes as input two simplicial com-
plexes and outputs ”true” if and only if they are homeomorphic. Hence, to show that two

7
Figure 4: The Euler characterstic counts the number of circular holes.

spaces are not homeomorphic, it is often more fruitful to show that they look different under
the lens of a tool which is insensitive to homeomorphism (or other forms of equivalence). Al-
gebraic topology offers one such approach: algebraic invariants such as homology and homotopy
groups are associated to topological spaces. We shall focus on the former of these two as its
computation reduces to simple linear algebra whereas the latter is exceptionally hard to com-
pute. Although the outputted homology invariants can be hard to interpret, we shall see that
for low-dimensional simplicial complexes, the invariants have a clear interpretation in terms of
connectivity, ”circularity” and cavities. Our first topological invariant, the Euler characteristic,
will illustrate this.
Definition 2.1. Let K be a simplicial complex and let Ki denote the number of i-simplices in
K. The Euler characteristic of K is the integer
X
χ(K) = (−1)i Ki .
i≥0

It is not at all clear that this number depends only on the homemorphism type of the
underlying space |K|, and we will return to that fact in the next lecture. For now, we will try
to see what it represents by considering some familiar topological spaces.
Example 2.2. Consider the planar simplicial complex of Fig. 4. Its Euler characteristic is
χ = #vertices − #edges + #triangles = 11 − 17 + 3 = −3.
We see that |χ| is one less than the number of ”holes” in the graph. The reader may verify that
the same relation holds for other planar simplicial complexes. This is no coincidence: in the
exercises we saw that for a connected planar graph the following is always true
2 = #vertices − #edges + #faces.
The number of faces may in turn be added up as follows:
#faces = #triangles + #holes + 1(the unbouded component).
Hence,
1 − #holes = #vertices − #edges + #triangles = χ.

Example 2.3. The regular tetrahedron and regular icosahedron are two of the five platonic
solids. They are both triangulations of the sphere and one can easily verify that their Euler
characteristics coincide:
χ(tetrahedron) = 4 − 6 + 4 = 2
χ(icosahedron) = 12 − 30 + 20 = 2.

8
Figure 5: Left: A triangulation of torus. Right: the torus and two independent loops

The torus on the other hand has a triangulation as shown in Fig. 5. The Euler characteristic of
the triangulation is χ = 9 − 27 + 18 = 0. Again this is no coincidence: for a simplicial complex
K embedded in R3 the following relation holds:

χ(K) = #connected components − #independent loops + #voids.

There are no non-trivial loops on the sphere, whereas the torus has two, as depicted in Fig. 5.

The fact that the Euler Characteristic is invariant under homeomorphism allows us one talk
about the Euler characteristic of a triangulated topological space. Hence, the previous example
shows that the torus and the sphere are not homeomorphic.
Remark 2.4. Remarkably, two closed, oriented surfaces are homeomorphic if and only if they
have the same Euler characteristic: the Euler characteristic of a genus g surface is 2 − 2g.
In light of the introduction above, this can clearly not be the case for manifolds of arbitrary
dimension (why?).

2.1 Free Vector Spaces


We briefly recap the construction of a free vector space on a finite set. Let S be a finite set and
k an arbitrary field. We define the free k-vector space generated P by S to be the vector
space F (S) with elements given by formal linear combinations si ∈S ai si where each ai ∈ k
and si ∈ S. Here addition is defined component-wise in the obvious way:
X X X
ai si + bi si = (ai + bi )si ,
si ∈S si ∈S si ∈S

where ai + bi ∈ k. The resulting k-vector space has a canonical vector space basis given by the
elements in S.

Example 2.5. Let k = Z2 be the field of two elements and S = {a, b, c} a set of three elements.
Then F (S) is the 3-dimensional vector space with elements {0, a, b, c, a + b, a + c, b + c} and a
basis {a, b, c}. Addition is straight-forward: (a + b) + (a + c) = (2a) + b + c = b + c.

Example 2.6. If we instead let k = Z3 and S = {a, b} then

F (S) = {0, a, 2a, b, 2b, a + b, a + 2b, 2a + b, 2a + 2b}.

We observe that F (S) has dimension |S| and cardinality |S||k| .

9
2.2 The Betti Number and the Euler Characteristic
We shall now construct a family of topological invariants which measure ”connectedness” in a
given dimension. By means of this we can make the interpretation of the Euler characteristic
precise. For the time being we shall assume that k = Z2 .
Definition 2.7. Let n ≥ 0 be an integer and K a simplicial complex. The vector space of
n-chains in K is the free Z2 -vector space Cn (K) generated by the n-simplices of K.
By defining the boundary of an n-simplex to be the formal sum of its (n − 1)-dimensional
faces, we get a linear transformation ∂n : Cn (K) → Cn−1 (K). Formally, for a simplex {p0 , . . . , pn },
let {p0 , . . . , pˆi , . . . , pn } denote the (n − 1)-simplex obtained by omitting the vertex pi .
Definition 2.8. The boundary operator ∂n : Cn (K) → Cn−1 (K) is the linear transformation
defined on simplices by
n
X
∂n ({p0 , . . . , pn }) = {p0 , . . . , pˆi , . . . , pn }
i=0

The following lemma is what makes the theory work. Intuitively, it states that a boundary
has no boundary.
Lemma 2.9. The composition ∂n ◦ ∂n+1 = 0 for all n ≥ 0.
Proof. By linearity it suffices to shown that ∂n ◦ ∂n+1 (σ) = 0 for a (n + 1)-simplex σ =
{p0 , . . . , pn+1 }.
n+1
! n+1
X X
∂n ◦ ∂n+1 (σ) = ∂n {p0 , . . . , pˆi , . . . , pn+1 } = ∂({p0 , . . . , pˆi , . . . , pn+1 })
i=0 i=0
n+1
X n+1
X
= {p0 , . . . , pˆj , . . . , pˆi , . . . , pn+1 }.
i=0 j=0,j6=i

For i 6= j we see that the (n − 1)-simplex {p0 , . . . , pˆj , . . . , pˆi , . . . , pn+1 } appears precisely two
times in the sum. Since we are working over Z2 , the result follows.

We say that c ∈ Cn (K) is an n-cycle if ∂n (c) = 0 and we denote the associated vector space
of p-cycles by Zn (K) = ker ∂n = {c ∈ Cn (K) : ∂n (c) = 0}. If c is in the image of ∂n+1 , that
is c = ∂n+1 (d) for some (n + 1)-cycle d, then c is an n-boundary. We denote the associated
vector space of n-boundaries by Bn (K) = Im ∂n+1 = {∂n+1 (d) : d ∈ Cn+1 (K).}
Example 2.10. Consider the simplicial complex in Fig. 6. Observe that the cycle c to the
left can be written as a linear combination c = c1 + c2 + c3 . In fact, it is not hard to see that
{c1 , c2 , c3 } forms a basis for the cycles in S1 (K); any ”hole” in in the simplicial complex can
be expressed as a linear of those cycles. We are however interested in counting the number of
”unbounded holes” and therefore we ignore any contribution from the cycles of B1 (K) = {c3 }.
The number of ”circular holes” is thus dim Z1 (K) − dim B1 (K) = 3 − 1 = 2.
With the previous example fresh in mind we define
Definition 2.11. The n-th Betti number of K is βn (K) = dim Zn (K) − dim Bn (K).
For simplicial complexes in R3 the interpretation of the Betti numbers is clear: β1 is the
number of loops, and β2 is the number of cavities. In general, interpreting the betti numbers
can be quite subtle. The following is however always true.

10
Figure 6: The cycle to the left is the sum of three other cycles.

Definition 2.12. We say that a simplicial complex K is path-connected if any two vertices
in K are connected by an edge path.

Remark 2.13. A simplicial complex K is path-connected if and only if |K| is path-connected in


the topological sense. Proof: Assume that |K| is path-connected. Fix a vertex p in K and let
K0 denote the simplicial complex (verify this) consisting of all simplices with the property that
all of its vertices can be joined to p by an edge-path. We let K1 denote the subcomplex of K
consisting of all simplices that are not in K0 . Hence, K = K0 ∪ K1 and K0 ∩ K1 = ∅. Since
|K0 | and |K1 | are closed subsets of |K|, it follows from connectivity that K1 = ∅. The converse
statement is immediate.

Lemma 2.14. β0 (K) equals the number of path-connected components of |K|.

Proof. Observe that Z0 (K) = S0 (K). Order the connected components of |K| from 1 to u,
and let {pi1 , . . . , piim } denote the set of vertices belonging to the i-th path-component. A basis
for Z0 (K) is given by ∪ui=1 {pi1 , pi2 + pi1 , . . . , pimi + pi1 }. Similarly, path-connectivity implies that
there cannot be a 1-chain c whose boundary is contained in {p11 , . . . , pu1 }. Hence, dim Z0 (K) −
dim B1 (K) = u.

Theorem 2.15 (Euler-Poincare formula). For a simplicial complex K,



X ∞
X
i
χ(K) = (−1) Ki = (−1)i βi (K).
i=0 i=0

Proof. From linear algebra we remember that for a liner transformation T : V → W we have
dim V = dim ker T + dim Im T . In our context this implies Ki = dim Ci (K) = dim Zi (K) +
dim Bi−1 (K). Letting B−1 (K) = 0 we get the following:

X ∞
X
χ(K) = (−1)i Ki = (−1)i (dim Zi (K) + dim Bi−1 (K))
i=0 i=0
X∞
= (−1)i (dim Zi (K) − dim Bi (K))
i=0
X∞
= (−1)i βi (K).
i=0

11
Computation Computing βn (K) comes down to elementary linear algebra: represent ∂n in
the canonical bases of Cn (K) and Cn−1 (K) and reduce the resulting matrices to diagonal form
using elementary row and column operations. From the diagonal form it is easy to read off
dim Bn−1 (K) as the number of non-zero diagonal terms, and dim Zn (K) as the number of zero
columns. The following example will make it clear.
Example 2.16. Let K be the faces of a 2-simplex {1, 2, 3}. By identifying a simplex with its
vertices and representing the matrices ∂2 and ∂1 in their standard bases we obtain

123
12 1 !
∂2 = 13 1
23 1

12 13 23
1 1 1 0! 1 0 0!
∂1 = 2 1 0 1 ∼ row/column operations ∼ 0 1 0
3 0 1 1 0 0 0

We conclude that dim B2 (K) = 1 and dim Z1 (K) = 1, and therefore β1 (K) = 1 − 1 = 0.

2.3 A Remark on the Choice of Coefficients


The previous discussion has been for the field k = Z2 . Homology is well-defined for coefficients in
any other field, or more generally, in any abelian group. For simplicial complexes in R3 the Betti
numbers are independent of the choice of coefficients. In higher dimensions however, the Betti
numbers may depend on the underlying field. Instead of developing a full theory of simplicial
homology in this more general setting, we shall limit ourselves to an example illustrating the
subtleties arising.

The boundary operator Let k be any field and let Cn (K; k) denote the free k-vector space
on the n-simplices of K. In order for the boundary operator to satisfy ∂n ∂n+1 = 0 the simplices
need to be ordered. Intuitively, this means that we add a direction to every edge, and a left- or
right-handed coordinate system to any 2-simplex, and so forth for higher dimensions. One way
of obtaining such an orientation is to give a total order to the vertices of K:

p0 < p1 < . . . < pm .

The boundary of the Pnsimplexi {p0 , p1 } is then ∂1 ({p0 , p1 }) = p1 − p0 , and more generally,
∂n ({p0 , . . . , pn }) = i=0 (−1) {p0 , . . . , pˆi , . . . , pn }. It is now a simple exercise to show that
the boundary of the boundary vanishes. Hence, one gets cycle and boundary vector spaces
satisfying Bn (K; k) ⊆ Zn (K; k).
Example 2.17. Let K be the faces of a 2-simplex with vertex set {1, 2, 3} and k any field. By
identifying a simplex with its vertices and representing the matrices ∂2 and ∂1 in their standard
bases we obtain
123
12 1 !
∂2 = 13 −1
23 1

12
Figure 7: projective plane

12 13 23
1 −1 −1 0! 1 0 0!
∂1 = 2 1 0 −1 ∼ row/column operations ∼ 0 1 0
3 0 1 1 0 0 0

Hence the betti numbers are independent of the choice of coefficients.


Example 2.18. The projective plane RP 2 is an unoriented closed surface which does not admit
an embedding in R3 . A triangulation of RP 2 can be seen in Fig. 7. The diligent reader may
write down the associated boundary matrices and verify that the Betti numbers differ between
the choices k = Z3 and k = Z2 :

β0 (RP 2 ; Z3 ) = 1 β1 (RP 2 ; Z3 ) = 0 β2 (RP 2 ; Z3 ) = 0


β0 (RP 2 ; Z2 ) = 1 β1 (RP 2 ; Z2 ) = 1 β2 (RP 2 ; Z2 ) = 1.

The Euler characteristic is obviously independent of the field.

2.4 Homology
The modern approach to defining the betti numbers is by means of vector spaces. Working
with vector spaces, rather than mere integers, allow us to push homological information along
continuous maps. This property, called functoriality, is instrumental in showing invariance
under topological invariance and in the development of persistent homology.
Definition 2.19. The n-th simplicial homology vector space of a simplicial complex K is
the quotient space Hn (K) = Zn (K)/Bn (K).
It follows from the definition that βn (K) = dim Hn (K). We say that two cycles z1 and z2
are homologous if z1 = z2 + b where b is a boundary. We write [z1 ] = [z2 ] for the associated
equivalence class in Hn (K). Intuitively, two homologous cycles represent the same ”hole” in
the sense that their sum is either trivial or cycles around boundaries.

13
Lemma 2.20. Let V ⊆ W be two finite-dimensional vector spaces (over some field). A basis
B 0 for V extends to a basis B for W . Furthermore, the elements of B \ B 0 are representatives of
a basis for W/V .

Proof. Left to the reader.

The previous lemma provides us with an algorithm for computing a basis for Hn (K): first
find a basis B 0 for Bn (K) and then extend this basis to a basis B for Zn (K). Then the elements
of B \ B 0 provide us with a basis for Hn (K). Doing so by hand however can involve a significant
amount of row reductions even for rather small simplicial complexes. Therefore we shall let the
computer do the job!

Example 2.21. We return to the simplicial complex depicted in Fig. 6. The vector space
H0 (K) is generated by [pi ] for any vertex pi . Furthermore, Hi (K) = 0 for any i > 1. We have
already seen that B2 = {σ3 }. Hence {[c1 ], [c2 ]} is a basis for H1 (K) ∼
= Z22 .

14
3 Week 3: Computation, Induced Maps and Invariance
This week will discuss the ”standard algorithm” for computing simplicial homology, as well as
induced maps and invariance of homology.

3.1 The Standard Algorithm


Denote the i-th column of a matrix M by Mi . If Mi is non-zero, then we define low(Mi ) =
max{j : Mji 6= 0}. For a zero-column Mi we let low(Mi ) = 0. We say that M is reduced if
i 6= j implies low(Mi ) 6= low(Mj ) or 0 = low(Mi ) = low(Mj ).
The following algorithm reduces the matrix M to a reduced matrix R with R = M V where
V is a upper-triangular and of full rank.
Data: m1 × m2 matrix M .
Result: Reduced m1 × m2 matrix R, full-rank upper-triangular V , such that R = M V .
Let R = M and V = Im2 (the m2 × m2 identity matrix).
for j ∈ {1, 2, . . . , m2 } do
while there exists i < j with 0 6= low(Ri ) = low(Rj ) do
add column i of R to column j of R;
add column i of V to column j of V ;
end
end
Algorithm 1: Reducing a matrix M in O((m2 )3 ).

3.1.1 The Homology of a Triangle


We illustrate the algorithm on the simplicial complex given by the boundary of a triangle,
K = {{1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}}. The first step is to stack all the boundary operators
together in one big boundary matrix D and define a corresponding identity matrix V :

1 2 3 12 13 23
1 0 0 0 0 0
 
1 0 0 0 1 1 0
2 0 0 0 1 0 1 0 1 0 0 0 0
 
0 0 1 0 0 0
R := D = 3  0 0 0 0 1 1 ,
 
V =
0
.
12 0

0 0 0 0 0

 0 0 1 0 0
13 0

0 0 0 0 0
 0 0 0 0 1 0
23 0 0 0 0 0 0 0 0 0 0 0 1

Observe that D is a linear transformation D : C0 (K) ⊕ C1 (K) → C0 (K) ⊕ C1 (K) and that we
may identify every simplex with its corresponding basis vector in C0 (K) ⊕ C1 (K) in a natural
way, i.e. the column vector (100000)T corresponds to the simplex {1}, (000100)T corresponds to
{1, 2} and (000111)T corresponds to the linear combination {1, 2} + {1, 3} + {2, 3}. Likewise, we
see that ker D = Z0 (K) ⊕ Z1 (K) and Im D = B0 (K) ⊕ B1 (K) as subspaces of C0 (K) ⊕ C1 (K).
We will now bring D into reduced form by adding columns from left to right, and at the
same time adding the corresponding columns in V . By iterating from the left to right, we check
for every column j, if there exists a non-zero column i < j with low(Ri ) = low(Rj ). By adding
column 5 to column 6, and then adding column 4 to column 6, we obtain the following two

15
matrices
1 2 3 12 13 13 + 12 + 23
1 0 0 0 0 0
 
1 0 0 0 1 1 0 
2 0 0 0 1 0 0  0 1 0 0 0 0
 
0 0 1 0 0 0
R := D = 3  0 0 0 0 1 0
 
, V = .
12 0

0 0 0 0 0

 0 0 0 1 0 1
 
13 0

0 0 0 0 0
 0 0 0 0 1 1
23 0 0 0 0 0 0 0 0 0 0 0 1

where R = DV . The non-zero columns of a reduced matrix must necessarily be linearly indepen-
dent, and therefore the non-zero columns corresponding to elements of C1 (K) will define a basis
for B0 (K). Indeed, following the notation introduced above we see that {(110000)T , (101000)T }
forms a basis for B0 (K). The zero-vectors necessarily form a basis for Z0 (K) ⊕ Z1 (K). By
construction, the i-th column of V corresponds precisely to the linear combination of sim-
plices whose images under D adds up to the i-th column of R. In other words, a basis
for Z0 (K) ⊕ Z1 (K) is given by the columns of V corresponding to 0-vectors in R. Hence,
{(100000)T , (010000)T , (001000)T } ∪ {(000111)T } constitutes a basis for Z0 (K) ⊕ Z1 (K). Since
B1 (K) = 0 it follows that H1 (K) ∼ = Z2 with a basis {[(000111)T ]}. Next step is to extend the
basis for B0 (K) into a basis for Z0 (K), and then use Lemma 2.20 to obtain a basis for H0 (K).
Consider the two bases:

ΣB0 = {(110000)T , (101000)T }


T T T
ΣZ0 = {(100000) , (010000) , (001000) }
g

Since low((100000)T ) 6∈ {low((11000)T ), low((101000)T ), the set ΣB0 ∪ {(100000)T )} must nec-
essarily be linearly independent. (This can be seen by constructing a matrix with the three
vectors as column vectors and observing that the resulting matrix is reduced.) Furthermore,
it contains the same number of basis elements as Σ g Z0 which spans Z0 (K). Hence, ΣZ0 :=
ΣB0 ∪ {(100000) )} forms a basis for Z0 (K) and H0 ∼
T
= Z2 has a basis {[(100000)T ]}.

3.1.2 The Algorithm


Let K be a simplicial complex of dimension d, and let

D : C0 (K) ⊕ . . . ⊕ Cd (K) → C0 (K) ⊕ . . . ⊕ Cd (K)

denote the boundary operator represented in the standard basis given by the simplices of all
dimensions.

1. Use Algorithm 1 to obtain a decomposition R = DV .

2. The columns Ri with low(i) 6= 0 form a basis ΣB = ΣB0 ∪. . .∪ΣBd for B0 (K)⊕. . .⊕Bd (K),

3. The columns Vi such that Ri = 0 form a basis Σ Z0 ∪. . .∪ ΣZd for Z0 (K)⊕. . .⊕Zd (K),
fZ = Σ
g g

fZ \ {Vi ∈ Σ
4. Let ΣE = Σ fZ : ∃Rj with low(j) = low(i) = i}.

(a) ΣB ∪ ΣE is a basis for Z0 (K) ⊕ . . . ⊕ Zd (K),


(b) {[Vi ] : Vi ∈ ΣE } is a basis for H0 (K) ⊕ . . . ⊕ Hd (K).

Although the steps are justified in the example above, we briefly re-iterate the explanations.

16
1. -
2. The columns are linearly independent and all other columns are 0. Hence they must span
the image of the linear transformation.
3. The zero-columns of R correspond to the kernel of D. By construction, the basis elements
for the kernel can be found in the corresponding columns of V .
4. (a) From the correctness of Algorithm 1, low(Ri ) 6= low(Rj ) for any Ri 6= Rj ∈ ΣB ,
and low(Vi ) 6= low(Vj ) for any Vi 6= Vj ∈ Σ fZ . Since ΣB spans a subset of Σ fZ in
C0 (K) ⊕ . . . ⊕ Cd (K), there must exist exactly |ΣfZ | − |ΣB | vectors Vi in Σ
fZ such that
low(Vi ) 6= low(Rj ) for all Rj ∈ ΣB .
(b) By Lemma 2.20.

3.2 Simplicial Maps and their Induced Maps in Homology


Let K and L be abstract simplicial complexes with vertex sets VK and VL respectively. A
simplicial map f : K → L is a function such that for every simplex {p0 , . . . , pn } in K its
image {f (p0 ), . . . , f (pn )} is a simplex in L. Associated to a simplicial map we get an induced
linear map in all dimensions:
(
f (σ) if dim f (σ) = dim σ
f# : Cn (K) → Cn (L), f# (σ) = .
0 otherwise
Example 3.1. Let K denote the 2-simplex defined on the vertices {a, b, c} and let L = K −
{a, b, c}. Then f : K → L defines a simplicial map by f (a) = a, f (b) = f (c) = b. It follows that
f# : C2 (K) → C2 (L) is the zero-map, and that f# : C1 (K) → C1 (L) has matrix representation
ab ac bc
ab 1 1 0!
ac 0 0 0 .
bc 0 0 0

Lemma 3.2. We have the following commutative diagram


∂n
Cn (K) Cn−1 (K)
f# f#
∂n
Cn (L) Cn−1 (L)

I.e., f# ◦ ∂n = ∂n ◦ f# .
Proof. It suffices to prove the result for a single simplex σ = {p0 , . . . , pn }.
Case 1: dim f (σ) = dim σ. In this case we have that
n n
{f (p0 ), . . . , f[
X X
f# (∂n (σ)) = f# ({p0 , . . . , pbi , . . . , pn }) = (pi ), . . . , f (pn )} = ∂n ◦ f# (σ).
i=0 i=0

Case 2: dim f (σ) ≤ dim σ − 2. It is immediate that ∂n ◦ f# (σ) = 0. Furthermore,


dim({f (p0 ), . . . , f[
(pi ), . . . , f (pn ))} ≤ dim σ − 2, and therefore
n
X n
X
f# ({p0 , . . . , pbi , . . . , pn }) = 0 = 0.
i=0 i=0

17
Case 3: dim f (σ) = dim σ − 1. It is immediate that ∂n ◦ f# (σ) = 0. Assume without loss
of generality that f (p0 ) = f (p1 ). Then dim({f (p0 ), . . . , f[
(pi ), . . . , f (pn )}) ≤ dim σ − 2 for all
2 ≤ i ≤ n. Thus,
n
X
f# ({p0 , . . . , pbi , . . . , pn }) = f# ({p1 , . . . , pn }) + f# ({p0 , . . . , pn }) = 0.
i=0

Corollary 3.3. A simplicial map f : K → L induces a well-defined map f∗ : Hn (K) → Hn (L)


defined by f∗ ([c]) = [f# (c)].

Proof. Since Hn (K) = Zn (K)/Bn (K) and Hn (L) = Zn (L)/Bn (L), it suffices to show that
f# (Zn (K)) ⊆ Zn (L) and f# (Bn (K)) ⊆ Bn (L).
Assume that ∂n (c) = 0 for c ∈ Cn (K). Then by Lemma 3.2 we have ∂n (f# (c)) = f# (∂n (c)) =
0. We conclude that f# (c) ∈ Zn (L). Now assume that c = ∂n+1 (d) for some d ∈ Cn+1 (K).
Then f# (c) = f# (∂n+1 (d)) = ∂n+1 (f# (d)). Hence f# (c) ∈ Bn (L).

3.3 Simplicial Approximations and Invariance of Homology


In order to put the homology vector spaces on a firm footing we need to prove that if |K| is
homeomorphic to |L|, then Hn (K) ∼ = Hn (L). A complete proof of this fact is no easy task
and we will not discuss the proof in detail. The goal of this part is merely to outline how a
continuous map h : |K| → |L| induces a map h∗ : Hn (K) → Hn (L) in homology, and that this
construction is functorial. An easy consequence will be that f∗ is an isomorphism whenever f
is a homeomorphism. The full story can be found in [10].

3.3.1 Simplicial Maps Revisited


For geometric simplicial complexes K and L we define a simplicial map f : K → L to be a
function f : K (0) → L(0) such that if σ is spanned by p0 , . . . , pn , then the simplex spanned by
f (p0 ), . . . , f (pn ) is contained in L.
Remark 3.4. Recall that any geometric simplicial complex K can be naturally identified with
an abstract simplicial complex through its vertex scheme, i.e. by identifying every geometric
simplex with the vertices that span it. A simplicial map of geometric simplicial complexes
naturally induces a simplicial map between the associated vertex schemes. Hence, a simplicial
map f : K → L between geometric simplicial complexes induces a map f∗ : Hn (K) → Hn (L) in
homology.
The simplicial map f : K → L induces a continuous (affine) map |f | : |K| → |L| given by
n n n
!
X X X
f ti pi = ti f (pi ), where ti = 1, and 0 ≤ ti ≤ 1.
i=0 i=0 i=0

3.3.2 Simplicial Approximations


We shall now see how a well-defined morphism h∗ : Hn (K) → Hn (L) can be associated to any
continuous map h : |K| → |L|.

Definition 3.5. Let K and L be geometric simplicial complexes and h : |K| → |L|. We say
that f : K → L is a simplicial approximation to h, if for each x ∈ |K|, |f |(x) is contained
in the minimal simplex which contains h(x).

18
Figure 8: Simplicial approximation

The following theorem makes it clear why simplicial approximations are relevant.

Theorem 3.6. If f1 , f2 : K → L are simplicial approximations to h : |K| → |L|, then f1,∗ =


f2,∗ : Hn (K) → Hn (L).

In particular, for any continuous map h that admits a simplicial approximation f , we have
a well-defined map f∗ : Hn (K) → Hn (L) in homology. However, not all maps admit such
approximations.

Example 3.7. Let K be the triangulation of the triangle shown in Fig. 8, and let L be the
triangulation of a filled rectangle with a hole in the same figure. The curve in |L| shows the
image of |K| under a continuous mapping h. We see that h admits a simplicial approximation
f : K → L which is obtained by pushing the images of the vertices of K onto the corresponding
vertices of L as indicated by arrows. Note that if |K| had a less refined triangulation given by
{{a}, {b}, {c}, {a, b}, {a, c}, {b, c}} then h would not admit a simplicial approximation.

The previous example shows that for a given K and L, and a function h : |K| → |L|, there
need not exist a simplicial approximation f : K → L to h. However, it seems plausible that one
can always ”subdivide” the simplices of K to be so ”small” that we can push the image of its
vertices onto the vertices of L in a way that gives a well-defined simplicial map.

Definition 3.8. A simplicial complex K1 is a subdivision of a simplicial complex K if |K1 | =


|K| and each simplex of K1 is contained in a simplex of K.

One way to subdivide a simplicial complex K is through barycentric subdivision. Let


σ ∈ K be a simplex in Rk spanned by vertices {p0 , . . . , pn }. The barycenter of σ is
1
σ̂ = (p0 + . . . + pn ).
n+1
The first barycentric subdivision of K is the simplicial complex Sd(K) consisting of all
simplices spanned by vertices σˆ0 , . . . , σˆr where σ0 ⊂ σ1 . . . ⊂ σr is a sequence of different
simplices in K. In particular, the vertex set of Sd(K) is {σ̂ : σ ∈ K}.

19
Figure 9: A simplicial complex together with its first two barycentric subdivisions.

Remark 3.9. Sd(K) is a simplicial complex and | Sd(K)| = |K|.


For j > 1 we define the j-th barycentric subdivision Sdj (K) to be the barycentric subdivision
of Sdj−1 (K).

Example 3.10. Fig. 9 shows a simplicial complex K together with its first two barycentric
subdivisions Sd(K) and Sd2 (K). Observe that any function f : Sd(K)(0) → K (0) which maps
a vertex σ̂ to any vertex of σ defines a simplicial map.

We state the following important theorem due to Alexander without a proof.

Theorem 3.11 (Simplicial Approximation Theorem). Let K and L be simplicial complexes and
h : |K| → |L| a continuous map. Then h admits a simplicial approximation f : Sdj (K) → L for
some sufficiently large j.

In conjunction with Theorem 3.6 this shows that h induces a well-defined map f∗ : Hn (Sdj (K)) →
Hn (L) for some sufficiently large j.

Lemma 3.12. Let f : Sd(K)(0) → K (0) denote any map which sends a vertex σ̂ in Sd(K) to any
vertex of σ. Then f is a simplicial map and an approximation to the identity id|K| : | Sd(K)| →
|K|.

Hence, Theorem 3.6 implies that any such map induces a canonical map Hn (Sd(K)) →
Hn (K). Crucially, it turns out that this morphism is in fact an isomorphism. Let ηj : Hn (Sdj (K)) →
Hn (K) denote the canonical isomorphism given by the composition

= ∼
= ∼
= ∼
=
→ Hn (Sdj−1 ) −
Hn (Sdj (K)) − → ··· −
→ Hn (Sd(K)) −
→ Hn (K).

Theorem 3.13. Any continuous map h : |K| → |L| between polyhedra of simplicial com-
plexes induces a well-defined linear map h∗ := f∗ ◦ ηj−1 : Hp (K) → Hp (L) in homology, where
f : Sdj (K) → L is a simplicial approximation to h and ηj : Hn (Sdj (K)) → Hn (K) is the canon-
ical isomorphism. Furthermore, h∗ is functorial, i.e. (id|K| )∗ = idHn (K) and (g ◦ h)∗ = g∗ ◦ h∗
for any pair of continuous maps h : |K| → |L| and g : |L| → |M |.

If h : |K| → |L| is a homeomorphism, then

idHn (K) = (id|K| )∗ = (h−1 ◦ h)∗ = (h−1 )∗ ◦ h∗ : Hn (K) → Hn (K),


idHn (L) = (id|L| )∗ = (h ◦ h−1 )∗ = h∗ ◦ (h−1 )∗ : Hn (L) → Hn (L).

Hence, h∗ is an isomorphism.

20
Figure 10: A homotopy between two functions f and g.

4 Week 4: Homotopy Equivalence, Relative Homology and Sen-


sor Networks
4.1 Homotopy Equivalence
In the last lecture we outlined how a continuous map h : |K| → |L| between polyhedra induces
a linear map in homology, and that this map is an isomorphism if h is a homeomorphism. We
shall now discuss a weaker condition on h for which the induced map is an isomorphism. Every
function is assumed to be continuous.
Definition 4.1. A homotopy between two maps f, g : X → Y is a map F : X × [0, 1] → Y ,
such that F (x, 0) = f (x) and F (x, 1) = g(x) for all x ∈ X. (X × [0, 1] is equipped with the
product topology.)
If there is a homotopy between f and g then we say that f and g are homotopic and denote
this by f ' g. It is a standard fact that homotopy defines an equivalence relation.
Example 4.2. Fig. 10 shows an example of a homotopy between two functions f, g : [0, 1] → R2 .
Example 4.3. The two functions f, g : [0, 1] → {0, 1} defined by f (x) = 0 and g(x) = 1 for all
x are not homotopic.
We will however need a stricter version of homotopy. Let A ⊆ X and B ⊆ Y . A map of
pairs f : (X, A) → (Y, B) is a map f : X → Y such that f (A) ⊆ B. A homotopy of pairs
between f, g : (X, A) → (Y, B) is a homotopy F : X × [0, 1] → Y between f and g such that
Ft (A) ⊆ B for all t ∈ [0, 1].
Example 4.4. Let X = [0, 1], A = {0, 1}, Y = R2 − {0} and B = {p} where 0 6= p ∈ R2 .
The equivalence classes of homotopic maps constitute the fundamental group of R2 − {0} (w.r.t
point p); see Fig. 11.

Definition 4.5. The spaces (X, A) and (Y, B) are homotopy equivalent if there exists maps
f : (X, A) → (Y, B) and g : (Y, B) → (X, A) such that g ◦ f ' id(X,A) and f ◦ g ' id(Y,B) .
We write (X, A) ' (Y, B) if (X, A) and (Y, B) are homotopy equivalent. If i : (Y, B) ,→
(X, A) denotes an inclusion of a subspace, and r : (X, A) → (Y, B) is such that r ◦ i = id(Y,B)
and i ◦ r ' id(X,A) , then (Y, B) is a deformation retract of (X, A). If (X, A) ' {pt} then
(X, A) is contractible; see Fig. 12.
Our interest in homotopic maps stems from the following theorem.
Theorem 4.6. If f ' g : |K| → |L| then f∗ = g∗ : Hn (K) → Hn (L).
Corollary 4.7. If f : |K| → |L| is a homotopy equivalence of polyhedra, then is f∗ : Hn (K) →
Hn (L) an isomorphism.

21
Figure 11: The functions f and g are homotopic, but neither of them is homotopic to h.

Figure 12: The disk deformation retracts down onto its origin and is thus contractible. The
disk with a hole in the middle deformation retracts onto the circle (and is not contractible).

22
Proof. Let g be such that g ◦ f ' id|K| and f ◦ g ' id|L| . Since homology is functorial:

idHn (K) = (id|K| )∗ = (g ◦ f )∗ = g∗ ◦ f∗ : Hn (K) → Hn (K),


idHn (L) = (id|L| )∗ = (f ◦ g)∗ = f∗ ◦ g∗ : Hn (L) → Hn (L).

Hence, h∗ is an isomorphism.

Remark 4.8. This suggests that we can give a well-defined definition of the homology of any
topological space which is homotopy equivalent to a polyhedra. While this is (in a techni-
cal sense) possible when restricted to triangulated spaces, the formal treatment is somewhat
technical and we will not consider such details.
There is a more general homology theory called singular homology which is defined for any
topological space and which coincides with simplicial homology when restricted to polyhedra.
So in particular, whenever X ' |K|, we can compute its singular homology HnS (X) by means
of the simplicial homology Hn (K). Furthermore, if f : X → Y with |K| ∼ = X and Y ∼ = |L|
then there is the following commutative diagram where fˆ is the map given by the composition
f
|K| → X −
→ Y → |L|,
f∗
HnS (X) HnS (Y )

= ∼
=
fˆ∗
Hn (K) Hn (L).
In conclusion: from time to time we need to consider the homology of a topological space X
which is not a polyhedron and we will simply denote its homology by Hn (X) where this is to
be understood as the simplicial homology of any polyhedron homotopy equivalent to X. We
will not consider spaces which are not homotopy equivalent to a simplicial complex.

4.2 The Nerve Theorem


A particular instance of a homotopy equivalence is the nerve theorem.
Let F be a finite collection of closed, convex sets in Euclidean space. Define the nerve of
F to be the abstract simplicial complex
\
N (F ) := {G ⊆ F : Fi 6= ∅}.
Fi ∈G

Example 4.9. Consider the set F = {F1 , F2 , F3 } in Fig. 13. Then

N (F ) = {{F1 }, {F2 }, {F3 }, {F1 , F2 }, {F2 , F3 }, {F1 , F3 }}

which is (isomorphic to) the abstract simplicial complex associated to the boundary of a 2-
simplex. Clearly, F1 ∪ F2 ∪ F3 ' |N (F )|.

If F = {F1 , . . . , Fm } and F 0 = {F10 , . . . , Fm


0 } are such that F ⊆ F 0 for all F ∈ F , then there
i i i
is an induced simplicial map σ : N (F ) → N (F 0 ) defined by sending Fi to Fi0 . In particular, we
have an induced linear transformation σ∗ : Hn (N (F )) → Hn (N (F 0 )).
S
Theorem 4.10. 1. Let F be as above, then Fi ∈F Fi ' |N (F )|.

23
Figure 13: The Nerve (right) associated to the cover to the left.

Figure 14: The union of balls is homotopy equivalent to the associated nerve (middle).

2. Let F and F 0 be as above and let j : Fi0 denote the inclusion. Then
S S
Fi ∈F Fi ,→ Fi0 ∈F 0
the following diagram commutes:
j∗
Fi0 )
S S
Hn ( Fi ∈F Fi ) Hn ( Fi0 ∈F 0


= ∼
=
σ∗
Hn (N (F )) Hn (N (F 0 ))

4.2.1 The Cech Complex


Let P ⊂ Rn be a finite set of points. By definition of the Cech complex we have that Cechr (P ) =
N (F ) where F = {Br (p) : p ∈ P }, and it follows from the Nerve theorem that the geometric
realization of the Cech complex is homotopy equivalent to the union of closed r-balls. This
shows that the Betti numbers associated to the Cech complex can be interpreted as ”holes” of
various dimension formed by the associated union of balls in Euclidean space; see Fig. 14

4.3 Relative Homology


Let K0 ⊆ K be a subcomplex. The vector space of relative n-chains is the quotient vector
space C(K, K0 ) = C(K)/C(K0 ). Since ∂n (Cn (K0 )) ⊆ Cn−1 (K0 ) by construction, it follows
that ∂ descends to a boundary map

∂n : Cn (K, K0 ) → Cn−1 (K, K0 )

such that ∂n ◦ ∂n+1 = 0. Hence, we get associated relative homology groups given by

Zn (K, K0 ) ker ∂n : Cn (K, K0 ) → Cn−1 (K, K0 )


Hn (K, K0 ) = := .
Bn (K, K0 ) Im ∂n+1 : Cn+1 (K, K0 ) → Cn (K, K0 )

24
Example 4.11. Let K denote the simplicial complex given by a 2-simplex and all its faces,
and let K0 denote its 1-skeleton. It follows that:

dim C2 (K) = 1 dim C2 (K0 ) = 0


dim C1 (K) = 3 dim C1 (K0 ) = 3
dim C0 (K) = 3 dim C0 (K0 ) = 3

We conclude that H2 (K, K0 ) ∼


= Z2 , H1 (K, K0 ) = H0 (K, K0 ) = 0.
The previous example generalizes to any n-simplex: let K be denote a n-simplex with its
faces, and K0 its (n − 1)-skeleton. Then Hn (K, K0 ) ∼
= Z2 and all other homology vector spaces
are trivial. The following theorem explains why.
Theorem 4.12. Let K0 ⊆ K. Then, Hn (K, K0 ) ∼
= Hn (|K|/|K0 |) for all n ≥ 1.
Here |K|/|K0 | need not be a simplicial complex; see Remark 4.8.
Example 4.13. Returning to the previous example we see that |K|/|K0 | ' S 2 ' Bd(∆3 ) (the
boundary of the standard 3-simplex). Thus, H2 (K, K0 ) ∼
= H2 (|K|/|K0 |) ∼
= H2 (Bd(∆3 )) ∼
= Z2 .
Next we observe that if f : (K, K0 ) → (L, L0 ) is a (geometric) simplicial map of pairs, then
f# (Cn (K0 )) ⊆ Cn (L0 ). Therefore the induced map f# : Cn (K, K0 ) → Cn (L, L0 ) defined by
f# ([c]) = [f (c)] is well-defined. Furthermore, it follows from Lemma 3.2 that

∂n ◦ f# ([c]) = [∂n ◦ f# (c)] = [f# ◦ ∂n (c)] = f# ◦ ∂n ([c]).

Just as in the proof of Corollary 3.3 this gives an induced map in relative homology

f∗ : Hn (K, K0 ) → Hp (L, L0 ).

Theorem 4.14. If f, g : (|K|, |K0 |) → (|L|, |L0 |) are homotopic, then f∗ = g∗ : Hn (K, K0 ) →
Hn (L, L0 ).
Corollary 4.15. If h : (|K|, |K0 |) → (|L|, |L0 |) is a homotopy equivalence, then h∗ an isomor-
phism.
Proof. See the proof of Corollary 4.7.

Example 4.16. Let D2 denote the unit disk. Then (D2 − {0}, S 1 ) ' (S 1 , S 1 ) and therefore
H2 (D2 − {0}, S 1 ) ∼
= 0. On the other hand, (D2 , S 1 ) ' (∆2 , Bd(∆2 )) and therefore

H2 (D, S 1 ) ∼
= H2 (∆2 /Bd(∆2 )) ∼
= H2 (S 2 ) ∼
= H2 (Bd(∆3 )) ∼
= Z2 .

The following linear transformation will be important in the next section.


Theorem 4.17. Let K0 ⊆ K. The linear map δ∗ : Hn (K, K0 ) → Hn−1 (K0 ) given by δ∗ ([c]) =
[∂n (c)] is well-defined, and if f : (K, K0 ) → (L, L0 ) is a simplical map of pairs, then the following
diagram commutes:
δ∗
Hn (K, K0 ) Hn−1 (K0 )
f∗ f∗
δ∗
Hn (L, L0 ) Hn−1 (L0 ).

Proof. Left as an exercise.

25
4.4 Sensor Networks
We now show how relative homology can be used to determine if a region is covered by a finite
set of simple sensors. We will prove [6, Theorem 1]. For a beautiful overview of homological
sensor networks see [7].

4.4.1 The covering problem


The problem is as follows: assume that you are given a collection of nodes X (i.e. a finite
point set) contained in a domain D ⊂ R2 , where each node can sense, broadcast, and cover a
region of a given radius. Does the collection of coverage disks of X cover the domain? In the
illustration above we see that the answer is ”yes” in the left case and ”no” in the right case.
Assuming the location of every sensor is known, then this is a trivial task. But we will work
under the assumption that we do not known the specific location of the sensors - merely which
sensors are close to each other. Again, see the above references for the motivation for these
sensor networks.
We will work under four assumptions:
1. Nodes X broadcast their unique ID numbers. Each node can detect the identity of any
node within broadcast radius rb .

2. Nodes have radially symmetric covering domains of cover radius rc ≥ rb / 3.
3. Nodes X lie in a compact connected domain D ⊂ R2 whose boundary ∂D is connected
and piecewise-linear with vertices marked fence nodes Xf .
4. Each fence node x ∈ Xf knows the identities of its neighbors on ∂D and these neighbors
both lie within distance rb of x.
For simplicity we employ the notation R := VRrb /2 (X) and we let F denote the 1-dimensional
cycle associated to the boundary nodes, i.e. ∂D is a geometric realization of F . Lastly, recall
from Theorem 4.17 that there is a well-defined morphism δ∗ : H2 (R, F ) → H1 (F ).
Theorem 4.18. If there exists [α] ∈ H2 (R, F ) such that 0 6= δ∗ ([α]) = [∂2 (α)] ∈ H1 (F ), then
the union U = ∪x∈X Brc (x) covers D.
Proof. Let z : |R| → R2 be the affine map which sends a vertex vi of |R| to its corresponding
node in the plane, and which extends linearly to all higher-dimensional simplices: z( ni=0 ti vi ) =
P
P n
i=0 ti z(vi ). First we observe that z(|R|) ⊆ U . Indeed, let Q be a set of nodes which form a
simplex τ in R,√i.e. Diam Q ≤ rb . Then, by Theorem 1.11, z(τ ) is contained in a closed ball
with radius rb / 3, or equivalently, z(τ ) is contained in
[ [
Brb /√3 (x) ⊆ Brc (x) ⊆ U.
x∈Q x∈Q

26
Since this holds for every simplex τ , it follows that z(|R|) ⊆ U .
From Theorem 4.17 we have the following commutative diagram:

δ∗
H2 (R, F ) H1 (F )
z∗ z∗
δ∗
H2 (R2 , ∂D) H1 (δD).

Since the rightmost z∗ is an isomorphism, it follows that z∗ ◦ δ∗ ([α]) 6= 0 and therefore it


must be true that z∗ ([α]) 6= 0. Assume for the sake of contradiction that there is a p ∈ D which
is not contained in U . Then the map z factors as

z
(|R|, |F ]) (R2 , ∂D)
z

(U, ∂D) (R2 \ {p}, ∂D)

But then we get the following diagram in homology where the top arrow is non-zero,
z∗
H2 (|R|, |F ]) H2 (R2 , ∂D)
z∗

H2 (U, ∂D) H2 (R2 \ {p}, ∂D)

This leads to a contradiction because (R2 \ {p}, ∂D) ' (∂D, ∂D) and thus

H2 (D \ {p}, ∂D) ∼
= H2 (∂D, ∂D) = 0.

Corollary 4.19. Let α be as in Theorem 4.18. Then the restriction of U to those nodes which
make up α covers D.

27
Figure 15: The medial axis and reach.

5 Week 5: Topology & Homology Inference and Persistent Betti


Numbers
5.1 Topology & Homology Inference
Given an (unknown) compact subset K ⊆ Rd and a set of points P which lie ”close” to K, is
it possible to infer the topology of K from P assuming the sample is dense enough and with
little noise? We shall state one theorem which answers that question to the affirmative under
quite strong assumptions on K. These assumptions can be significantly weakened; See Chapter
4 and 5 of [11].
For K and P as above and x ∈ Rd , define

dK (x) = min ||x − y||, dP (x) = min ||x − y|


y∈K y∈P

where the norm is the standard 2-norm. We get the following associated sublevel-set filtrations:
Kr := d−1 −1
K (−∞, r] and Pr := dP (−∞, r] = ∪p∈P Br (p).

Definition 5.1. The Hausdorff distance between two non-empty subsets X, Y ⊆ Rd is


defined by
dH (X, Y ) := max{sup inf ||x − y||, sup inf ||y − x||}.
x∈X y∈Y y∈Y x∈X

For a given x ∈ Rd we define ΠK (x) to be the set of all points y ∈ Y such that dK (x) =
||x − y||. Note that |ΠK (x)| ≥ 1 for all x. The medial axis of K is the set M (K) := {x :
|ΠK (x)| ≥ 2}, see Fig. 15 for an illustration.

Definition 5.2. The reach of K is given by

Rch(K) := min d(y, M (K))


y∈K

where M (K) denotes the topological closure of M (K).

Remark 5.3. If K has positive reach, then one can show (not surprisingly) that the map Kr → K
defined by mapping x to ΠK (x) is a homotopy equivalence for all r < Rch(K).

q submanifold of R with
Theorem 5.4 (Nioygi, Smale, Weinberger (2006)). Let K be a compact d

3
positive reach. Let P be a point set such that dH (K, P ) =  < 20 Rch(K). Then for any
q
r ∈ (2, 35 Rch(K)), the offset Pr deformation retracts onto K.

28
This shows that the topology of K can be recovered under fairly strong assumptions. By
replacing the reach with the weak feature size these results can be generalized substantially, but
that is beyond the scope of this course. In particular, for a ”reasonable” space K together with
an adequate sampling, one can recover the homology Hn (K) from Hn (Pr )) for some r ≥ 0.
We now proceed to give an elementary proof of the fact that the homology of a (not nec-
essarily compact) space can be recovered from the persistent homology of a sufficiently good
sampling.
Theorem 5.5. Let K ⊆ Rd , P ⊆ Rd a finite point set and , δ > 0 such that
1. K ⊆ Pδ (sampling density),
2. P ⊆ K (sampling error: points need not lie on K),
3. The inclusion K ,→ Kδ+ induces an isomorphism Hn (K) → Hn (Kδ+ ),
4. The inclusion Kδ+ ,→ K2(+δ) induces a monomorphism Hn (Kδ+ ) → Hn (K2(+δ) ).
Then Hn (K) ∼
= Im(Hn (Pδ ) → Hn (P2δ+ )).
Proof. Assumption 1. and 2. yield the following commutative diagram of inclusions

K Kδ+ K2(δ+)

Pδ P2δ+

which induces the following commutative diagram in homology (see Remark 4.8 and Theo-
rem 3.6)

= mono
Hn (K) Hn (Kδ+ ) Hn (K2(δ+) )
a
b

Hn (Pδ ) Hn (P2δ+ )
Since the top-left morphism is an isomorphism, we must have that a is surjective. Similarly, b
must be a monomorphism. We conclude that
Hn (K) ∼
= Hn (Kδ+ ) ∼
= Im b = Im b ◦ a = Im(Hn (Pδ ) → Hn (P2δ+ )).

5.2 Persistent Betti Numbers


For a point set P ⊆ Rd , the Betti numbers βi (Pr ) are very unstable in the scale parameter r.
That is, a small perturbation of the point set may result in completely different Betti numbers.
Furthermore, although there does exist a ”perfect” scale for a good enough sampling of a
sufficiently nice space, it is not at all clear what this scale actually is. Therefore we shall study
a tool from applied algebraic topology which is both stable and scale-free.
Let us first consider β0 - the connected components. In this setting things are particularly
simple and we can use a tool from statistics called a dendrogram.
Example 5.6. Let P = {p1 , p2 , p3 , p4 , p5 , p6 , p7 , p8 , p9 } be the points of Fig. 16. When consid-
ered at a sufficiently small scale, Pr consists of 9 connected components (clusters). For a slightly
larger r there are 3 connected components, and in the end there is one giant component. The
dendrogram tracks how these connected components merge as the scale parameter increases:
the result can be seen to the right of Fig. 16.

29
Figure 16: A point set together with its (single-linkage) dendrogram.

Persistent homology in dimension 0 will turn out to be closely related to that of a dendrogram
provided that you forget precisely which points belong to each cluster. The idea is to consider
a filtration of a simplicial complex K,

K0 ⊆ K1 ⊆ . . . ⊆ Kn = K

and then apply simplicial homology to get a collection of vector spaces and linear maps

f∗i,j : Hn (Ki ) → Hn (Kj )

for all i ≤ j. The associated n-th persistent Betti numbers are given by βni,j = dim Im f∗i,j .
Example 5.7. Consider the filtration depicted in Fig. 17. Some persistent Betti numbers are:
β01,2 = 1, β02,4 = 2, β02,5 = 2, β02,6 = 2, β02,7 = 1, β17,8 = β17,9 = 1, β18,9 = 1 and β17,10 = 0.

Let 0 6= [c] ∈ Hn (Ki ). Then we say that c is born at Ki if [c] 6∈ Im f∗i−1,i . If [c] is born
at Ki , then it dies at Kj if it merges with an older class as we go from Kj−1 to Kj . That is,
f∗i,j−1 ([c]) 6∈ Im f∗i−1,j−1 but f∗i,j ([c]) ∈ Im f∗i−1,j .
Example 5.8 (Example 5.7 continued). We see that there is a class [c] ∈ H1 (K7 ) born at K7
as well as a class [c0 ] ∈ H1 (K8 ) is born at K8 . These two classes ultimately coincide in H1 (K9 ).
This means that the class [c0 ] born at K8 vanishes at K9 because it is merged with an older
class. This is the elder rule: precedence is given to the class with the earliest birth time.
Define µi,j
n to be the number of classes in dimension n born at index i which die at index j.
The number of classes born at index i which never die is denoted by µi,∞
n .

Proposition 5.9.
µi,j i,j−1
n = (βn − βni,j ) − (βni−1,j−1 − βni−1,j ).

Proof. The first term, (βni,j−1 − βni,j ), counts the number of classes born before or at index i
which which die at index j. Accordingly, the second term, βni−1,j−1 − βni−1,j , counts the number
of classes born strictly before index i which die at index j. Hence, µi,j
n is given by the difference
of the two terms.

30
Figure 17: A filtered simplicial complex.

Figure 18: The barcodes and persistence diagrams of Example 5.7.

The numbers µi,j


n are often visualized in either of the following ways:

• The barcode in dimension n is obtained by interpreting every non-zero µi,j n as the


interval [i, j) (representing the time when the ”feature” was alive), and stacking all the
intervals on top of each other in the plane; see Example 5.10.

• The persistence diagram in dimension n is obtained by plotting (i, j) (with multi-


plicity) in the plane for every non-zero µi,j
n ; see Example 5.10.

Example 5.10 (Example 5.8 continued). We see that the only non-zero µi,j
n ’s are the following:

µ1,∞
0 =1 µ2,7
0 =1 µ03,5 = 1 µ4,6
0 =1
µ7,10
1 =1 µ8,9
1 =1

The associated barcodes and persistence diagrams are shown in Fig. 18.

31
5.2.1 The Cech and Vietoris–Rips Filtrations
The Cech Filtration For a given point set P ⊆ Rd , we know from Theorem 4.10 that
Cechr (P ) ' ∪x∈P Br (x). In particular, given a filtration

Cechr0 (P ) ,→ Cechr1 (P ) ,→ Cechr2 (P ) ,→ · · · ,→ Cechrm (P )

we get the following commutative diagram of vector spaces and linear morphisms

Hn (Pr0 ) Hn (Pr1 ) Hn (Pr2 ) ··· Hn (Prm )



= ∼
= ∼
= ∼
= ∼
=

Hn (Cechr0 (P )) Hn (Cechr1 (P )) Hn (Cechr2 (P )) ··· Hn (Cechrm (P ))

It is not difficult to prove that the persistent Betti numbers for the two rows coincide, and
therefore the barcode/persistence diagram of the Cech filtration has a clear geometric interpre-
tation: it captures the evolution of ”holes” of a given dimension formed by balls of increasing
radius around the points in P .

The Vietoris-Rips Filtration For a given scale r, it need not be the case that VRr (P ) ' Pr
and therefore it may appear unclear how to interpret the persistent Betti numbers associated
to a filtration of the form

VRr0 (P ) ,→ VRr1 (P ) ,→ VRr2 (P ) ,→ · · · ,→ VRrm (P )

However, from Corollary 1.12 we have the following chain of inclusions

Cechr (P ) ⊆ VRr (P ) ⊆ Cech2δr (P ) ⊆ VR2δr (P ))


q
d
where δ = 2(d+1) , and in turn the following commutative diagram of vector spaces:

Hn (Cechr (P )) Hn (Cech2δr (P ))

Hn (VRr (P )) Hn (VR2δr (P )

This diagram shows that any class in Hn (VRr (P )) which has non-zero image in Hn (VR2δr (P ))
must be non-zero in Hn (Cech2δr (P )). Importantly, this means that it represents a true topo-
logical feature of P2δr (P ). Conversely, any class of Hn (Cechr (P )) which has non-zero image in
Hn (Cech2δr (P )) must factor through Hn (VRr (P )). Summarized: sufficiently long intervals in
the barcode of the Cech filtration give rise to intervals in the barcode of the Vietoris–Rips filtra-
tion, and conversely, any sufficiently long interval in the barcode of the Vietoris–Rips filtration
corresponds to a true geometrical feature. This relation will be made precise later in the course
when we discuss the theory of interleavings
With this obvious drawback of the Vietoris–Rips complex, one may wonder why consider it
at all. There are primarily two reasons for doing so:
• Computation from a distance matrix. To construct the Cech complex one needs the
coordinates of the points in Rd , whereas the Vietoris–Rips is built exclusively from pairwise
distances. Furthermore, this allows us to construct filtered simplicial complexes for points
that do not embed in Rd for any d. An example could be a distance matrix obtained
through correlations of genes.

32
Figure 19: Vietoris–Rips filtration w/ associated barcode.

• Computations. Working with the Rips complex allows for certain heuristics to be imple-
mented which in practice yield significant speed-ups.

Example 5.11. Any finite metric space has an associated Vietoris–Rips filtration. As an
example, consider the metric space consisting of three points {p1 , p2 , p3 , p4 } and distance matrix
 
0 1 1 2
1 0 2 1
 
1 2 0 1
2 1 1 0

By defining VRr (P ) = {σ ⊆ P : diam σ ≤ 2r} as before, we obtain a filtration:

VR0 (P ) ⊆ VR1/2 (P ) ⊆ VR1 (P ).

See Fig. 19 for a (non-isometric) visualization of this filtration.

33
Figure 20: A filtered simplicial complex.

6 Week 6: Algebraic Foundations


Last week we introduced the notion of persistent Betti numbers, and used them to compute
the barcode. In this lecture we will give an algebraic characterization of the barcode. A
more thorough discussion of the topics in this lecture can be found in any book on Quiver
Representations.

6.1 Motivation
Consider the filtered simplicial complex K shown in Fig. 20, together with the associated col-
lection of vector spaces and linear maps
H1 (K1 ) → H1 (K2 ) → H1 (K3 ) → H1 (K4 ) → H1 (K5 ).
From Proposition 5.9 it is an easy task to compute the barcode B1 (K) of K in dimension 1:
B1 (K) = {[2, 5), [3, 4)}.
This barcode clearly does not depend on the particular basis we choose at each index as the
computation only amounts to rank considerations. From the algebraic point of view, however,
there are some bases which are to be preferred. We will now illustrate this with two examples.
In the first case, let {AB + BD + CD + AC}, {AB + BD + CD + AC, AC + CD + AD} and
{AB + BD + CD + AC} be the bases for K2 , K3 , and K4 . In the second case we replace
{AB + BD + CD + AC, AC + CD + AD} with {AB + BD + CD + AC, AB + BD + AD}.
Representing the linear maps with respect to these bases yields:
 
1
  h i
0 1 0
0 → Z2 −−−→ Z2 ⊕ Z2 −−−−−→ Z2 → 0.
 
1
  h i
0 1 1
0 → Z2 −−−→ Z2 ⊕ Z2 −−−−−→ Z2 → 0.
The former of these two splits into a direct sum:
1 1
M
(0 → Z2 →− Z2 → − Z2 → 0) (0 → 0 → Z2 → 0 → 0),
whereas the latter does not ”split up”. An advantage of such a decomposition is that the
barcode can be easily read off from the support of its components (summands):
 
1 1
µi,j
M
1 (0 → Z2 →
− Z2 →
− Z2 → 0) (0 → 0 → Z2 → 0 → 0) =
(

1 1
 1 if (i, j) ∈ {(2, 5), (3, 4)}
µi,j
1 0 → Z2 → − Z2 → 0 + µi,j
− Z2 → 1 (0 → 0 → Z2 → 0 → 0) =
0 otherwise.

34
The goal of this section will be to prove that such a choice of basis always exists. This algebraic
characterization of the barcode will be important when proving stability later in the course.

6.2 Persistence Modules


Definition 6.1. A partially ordered set (poset) P is a set P together with a binary relation
≤ such that

1. p ≤ p, for all p ∈ P ,

2. p ≤ q and q ≤ p implies p = q,

3. p ≤ q and q ≤ r implies p ≤ r.

If p ≤ q and p 6= q, then we write p < q.

Here are some posets that appear in topological data analysis.

Example 6.2. The set [n] = {1, 2, . . . , n} is a partially ordered set under the standard ordering
of the natural numbers. It will be convenient to represent this poset as a graph in the following
way:
1 2 n−1 n
• −→ • −→ · · · −→ • −→ •.
More generally, N, Z and R are posets in the obvious way.

Example 6.3. One can also assign a zigzag structure to {1, 2, . . . , n}:
1 2 n−1 n
• ←− • −→ · · · ←− • −→ •

Example 6.4. The poset P = {a, b, c, d} with the binary relation a ≤ b, c ≤ d:

b d
• •

a c
• •

Definition 6.5. A P -indexed persistence module (P -module) V is a collection of vector


spaces {Vp }p∈P and linear maps {V (p ≤ q) : Vp → Vq }p≤q such that

1. V (p ≤ p) = id : Vp → Vp ,

2. V (q ≤ r) ◦ V (p ≤ q) = V (p ≤ r).

Remark 6.6. A P -module is a functor from the partially ordered set P seen as a category in
the obvious way, to the category of vector spaces.

Example 6.7. A filtered simplicial complex K1 ⊆ K2 ⊆ · · · ⊆ Kn yields an [n]-module for


every integer i,
Hi (K1 ) → Hi (K2 ) → · · · → Hi (Kn ).

Example 6.8. We can also consider a zigzag of inclusions: K1 ⊆ K2 ⊇ K3 ⊆ · · · ⊇ Kn ,

Hi (K1 ) → Hi (K2 ) ← Hi (K3 ) → · · · ← Hi (Kn ).

35
Example 6.9. Given a topological space X and a real-valued function f : X → R, we get an
R-module M by
Mt = Hn (f −1 (−∞, t])
together with maps Mt → Mt0 in homology induced by the inclusion f −1 (−∞, t] ⊆ f −1 (−∞, t0 ].

A morphism f : V → W between P -modules is a collection of linear maps {fp : Vp →


Wp }p∈P such that the following diagram commutes for all p ≤ q:

V (p≤q)
Vp Vq
fp fq

Wp Wq .
W (p≤q)

We say that f is an epi-/mono-/isomorpism if fp is an epi-/mono-/isomorphism for all p.

Example 6.10. The following is an example of an epimorphism:


1
V: Z2 Z2
f 1 0

W: Z2 0
0.

Note that there are no non-zero morphisms from W to V .

The direct sum of two P -modules V and W is the P -module V ⊕ W defined pointwise by
(V ⊕ W )p = Vp ⊕ Wp and on linear maps by:
 

V (p ≤ q) 0 
0 W (p ≤ q)
Vp ⊕ Vq −−−−−−−−−−−−−−−−−−→ Wp ⊕ Wq .

Definition 6.11. We say that V is decomposable if there exist non-zero W, W 0 such that
V ∼
= W ⊕ W 0 . If no such W, W 0 exist, then we say that V is indecomposable.
P
For a P -module V , we define the total dimension of V by dim V = p∈P dim Vp whenever
the sum exists.

Lemma 6.12. Let P be finite and assume that Vp is finite-dimensional for all p. Then

V ∼
= W1 ⊕ ··· ⊕ Wk

where each W i is indecomposable.

Proof. We will work inductively on the total dimension of V . If dim V = 1 then V is necessarily
indecomposable. So assume that the statement holds for dim V ≤ n and consider V with
dim V = n + 1. If V is indecomposable, then we are done. If not, we can write V = W ⊕ W 0
where
dim V = dim W + dim W 0
and both of the terms to the right are non-zero. Hence, by the inductive property, W and W 0
decompose into a direct sums of indecomposables.

36
A submodule V 0 of V is a collection of subspaces Vp0 ⊆ Vp such that the following diagram
commutes for all p ≤ q
Vp0 Vq0
⊆ ⊆

Vp Vq

If there exists a non-trivial submodule V 00 ⊆ V such that V = V 0 ⊕ V 00 , then we say that


V 0 and V 00 are summands of V . For a morphism f : V → W we get submodules ker f ⊆ V
and Im f ⊆ W by taking pointwise kernels and images. These submodules are in general not
summands.

Example 6.13.
ker(f ) 0 0 Z2
⊆ 1
1
V 0 Z2 Z2
f 1
1
W Z2 Z2 0
⊆ 1

Im(f ) 0 Z2 0

Lemma 6.14 (Fitting Lemma). Let P be finite and dim Vp < ∞ for all p. For every morphism
f : V → V there exists an n ≥ 1 such that

V = Im f n ⊕ ker f n .

Proof. Since f (V ) ⊇ f 2 (V ) ⊇ f 3 (V ) ⊇ · · · and dim V is finite, there must exists an l such that
f l (V ) = f l+1 (V ) = f l+2 (V ) = . . .. Define φ := f l : V → V . There exists for every v ∈ V a
v 0 ∈ V such that φ(v) = φ2 (v 0 ), and thus v−φ(v 0 ) ∈ ker φ. This shows that v = (v−φ(v 0 ))+φ(v 0 )
where v − φ(v 0 ) ∈ ker φ and φ(v 0 ) ∈ Im φ. It remains to show that ker φ ∩ Im φ = 0.
If v ∈ ker φ ∩ Im φ, then v = φ(v 0 ) and 0 = φ(v) = φ2 (v 0 ). But φ : φ(V ) → φ2 (V ) is an
isomorphism, and therefore v = φ(v 0 ) = 0.

Now we restrict our attention to the poset [n]. Let k be any field, and for a < b ∈ [n] ∪ {∞},
define [a, b) to be the subset of [n] given by the elements {i : a ≤ i < b}. We define the interval
module associated to [a, b) to be the [n]-module I [a,b) defined by
(
[a,b) k if i ∈ [a, b)
Ii = ,
0 otherwise

[a,b) [a,b)
together with the identity morphism id : Ii → Ij whenever i, j ∈ [a, b).

Example 6.15. For n = 2 we have the following interval modules


id
k→0 0→k k−
→ k.

37
Theorem 6.16. Let V be an [n]-module such that dim Vp < ∞ for all p ∈ [n]. Then

V ∼
M
= I [a,b)
[a,b)∈B(V )

where B(V ) is a multiset of intervals in [n] called the barcode of V .

Proof. We know from Lemma 6.12 that V decomposes into a direct sum of indecomposables.
Hence it suffices to show that if V is indecomposable, then V ∼ = I [a,b) for some interval [a, b).
Assume without loss of generality that V1 6= 0 and choose 0 6= v ∈ V1 . Let b denote the smallest
index for which V (1 ≤ b)(v) = 0 and let j = b − 1. If no such b exists, then let b = ∞ and
j = n.
First we define a (well-defined) monomorphism f : I [1,b) → V by fi (1k ) = V (1 ≤ i)(v). Since
Vj is a vector space, we can extend {f (1k )} to a basis for Vj and thus define an epimorphism
gj : Vj → k which satisfies gj (fj (1k )) = 1k . This extends to an (well-defined) epimorphism
g : V → I [1,b) by defining gi (w) = gj (V (i ≤ j)(w)) for i ≤ j, and 0 otherwise. Importantly,

g ◦ f = idI [1,b) .

From Lemma 6.14 there exists an m ≥ 1 such that

V = Im(f ◦ g)m ⊕ ker(f ◦ g)m .

Furthermore,

(f ◦ g)m (V ) = f ◦ (g ◦ f ) ◦ (g ◦ f ) ◦ · · · ◦ (g ◦ f ) ◦ g(V ) = f ◦ g(V ) = f (I [1,b) ),

where the last equality follows from g being an epimorphism. Since V was assumed to be
indecomposable, and since f is a monomorphism, it follows that

V = Im(f ◦ g)m = f (I [1,b) ) ∼


= I [1,b) .

Proposition 6.17. Let V be as in Theorem 6.16. Then µi,j


n counts the number of occurrences
of [i, j) in B(V ).

Proof. This follows from the following two observations


 
M X
µi,j
n (V ) = µ i,j 
I [a,b) 
= µi,j (I [a,b) ),
[a,b)∈B(V ) [a,b)∈B(V )

and (
1 if (i, j) = (a, b)
µi,j (I [a,b) ) = .
0 otherwise.

Just as the dimension of a vector space is independent of the choice of basis, the previous
result shows that although the particular decomposition in Theorem 6.16 is not unique, the
associated multiset B(V ) is.
We state the following generalization of Theorem 6.16 without proof.

38
Theorem 6.18 (Crawley-Boevey (2015), Botnan & Crawley-Boevey (2020)). Let T be a totally
ordered set and V a T -module such that dim Vt < ∞ for all t ∈ T . Then

V ∼
M
= IJ
J∈B(V )

where B(V ) is a multiset of intervals in T .

An interval in T is a subset J with the property that if x < y < z and x, z ∈ J then y ∈ J.
Interval modules are defined accordingly.

39
Figure 21: Yet another filtered simplicial complex.

7 Week 7: The Persistence Algorithm


The algorithm for computing simplicial homology can be straightforwardly applied to compute
persistent homology. In this lecture we will have a look at the algorithm and an improvement
which makes computations faster in practice.

7.1 The standard algorithm


The standard algorithm for computing persistent homology is nothing more than the standard
algorithm for simplicial homology with the ordering of the simplices given by the time they
appear in the filtration. We illustrate this by computing the barcode of the filtration in Fig. 21.
Expressing the boundary matrix in the order given by the simplices yields:

1 2 3 4 13 12 24 34 14 134 124
1 0 0 0 0 1 1 0 0 1 0 0
 
2  0 0 0 0 0 1 1 0 0 0 0 
 
3 0 0 0 0 1 0 0 1 0 0 0 

4 0 0 0 0 0 0 1 1 1 0 0 

13 0 0 0 0 0 0 0 0 0 1 0 
D = 12 0

 0 0 0 0 0 0 0 0 0 1 

24 0 0 0 0 0 0 0 0 0 0 1 

34 0 0 0 0 0 0 0 0 0 1 0 

14 0 0 0 0 0 0 0 0 0 1 1 

134 0 0 0 0 0 0 0 0 0 0 0 
124 0 0 0 0 0 0 0 0 0 0 0

and the corresponding identity matrix V = I12×12 . The resulting matrices R and V after

40
applying Algorithm 1 to D are:

1 2 3 4 13 12 24 34 14 134 124
1 0 0 0 0 1 1 0 0 0 0 0
 
2 0 0 0 0 0 1 1 0 0 0 0 
 
3 0 0 0 0 1 0 0 0 0 0 0 

4 0 0 0 0 0 0 1 0 0 0 0 

13 
0 0 0 0 0 0 0 0 0 1 1 
R = 12 0

 0 0 0 0 0 0 0 0 0 1 

24 
0 0 0 0 0 0 0 0 0 0 1 

34 
0 0 0 0 0 0 0 0 0 1 1 

14 
0 0 0 0 0 0 0 0 0 1 0 

134 0 0 0 0 0 0 0 0 0 0 0 
124 0 0 0 0 0 0 0 0 0 0 0

and
1 2 3 4 13 12 24 34 14 134 124
1 1 0 0 0 0 0 0 0 0 0 0
 
2 0 1 0 0 0 0 0 0 0 0 0 
 
3 0 0 1 0 0 0 0 0 0 0 0 

4 0 0 0 1 0 0 0 0 0 0 0 

13 0 0 0 0 1 0 0 1 0 0 0 
V = 12 0 .

 0 0 0 0 1 0 1 1 0 0 

24 0 0 0 0 0 0 1 1 1 0 0 

34 0 0 0 0 0 0 0 1 0 0 0 

14 0 0 0 0 0 0 0 0 1 0 0 

134 0 0 0 0 0 0 0 0 0 1 1 
124 0 0 0 0 0 0 0 0 0 0 1

Observe that the simplicial homology of Ki - the filtered simplicial complex at time i - can be
obtained by restricting R and V to the first i columns.
Following the steps in Section 3.1.2:

ΣB0 = {(10100000000)T , (11000000000)T , (01010000000)T }


T T T T
Σ Z0 = {(10000000000) , (01000000000) , (00100000000) , (00010000000) }
g
ΣB1 = {(00001001100)T , (00001111000)T }
T T
Σ Z1 = {(00001111000) , (00000110100) }.
g

The next step is to pair the vectors of Σ


g Z0 to those of ΣB0 based on their lowest entries:

(10000000000)T ↔ ∅ (01000000000)T ↔ (11000000000)T


(00100000000)T ↔ (10100000000)T (00010000000)T ↔ (01010000000)T

and in dimension 1:

(00001111000)T ↔ (00001111000)T (00000110100)T ↔ (00001001100)T

From this we conclude that H0 (K11 ) ∼


= Z2 is generated by the vertex v1 , and that Hi (K11 ) = 0
for i ≥ 1. However, from the point of view of persistent homology, we are interested in the

41
particular pairings: a pairing v ↔ w yields a bar [tv , tw ) in the barcode, where tv is the time
at which the cycle v appears in the filtration, and tw is the time where w becomes a boundary.
We see that tv = low(v) and tw = j where low(Rj ) = tv . We summarize our findings in the
following table:

Dimension Birth Death Rep. cycle Vertex notation


0 1 ∞ (10000000000)T 1
0 2 6 (01000000000)T 2
0 3 5 (00100000000)T 3 .
0 4 7 (00010000000)T 4
1 8 11 (00001111000)T 13 + 12 + 24 + 34
1 9 10 (00001001100)T 13 + 34 + 14

This completes the computation of persistent homology. We summarize our findings:

1. Write down the boundary matrix D with the simplices ordered by their appearance in the
filtration of a simplicial complex K.

2. Use Algorithm 1 to obtain a decomposition R = DV .

3. The columns Ri with low(i) 6= 0 form a basis ΣB = ΣB0 ∪. . .∪ΣBd for B0 (K)⊕. . .⊕Bd (K),

4. The columns Vi such that Ri = 0 form a basis Σ Z0 ∪. . .∪ ΣZd for Z0 (K)⊕. . .⊕Zd (K),
fZ = Σ
g g

5. For every n-cycle Vi ∈ Σ


fZ do the following:

(a) If there exists Rj ∈ ΣB with low(Rj ) = low(Vi ) = i, then output an interval [i, j) in
dimension n.
(b) If there exists no such Rj , then output an interval [i, ∞) in dimension n.

At the algebraic level we also get bases at every filtration step:

1. Let ΣHj = {Vi ∈ Σ


fZ : i ≤ j and ∃Rl where j < l and low(Rl ) = i },

2. Let ΣHj1 ,j2 = ΣHj1 ∩ ΣHj2 ,

3. Let ΣEj = {Vi ∈ Σ


fZ \ ΣH : i ≤ j}.
j

4. It is a good exercise to verify the following properties

(a) The set of n-cycles in ΣHj ∪ ΣEj forms a basis for Hn (Kj ).
(b) The rank of the map Hn (Kj1 ) → Hn (Kj2 ) is given by the cardinality of

ΣHj1 ,j2 ∪ ΣEj1

Justification Let us convince ourselves that our persistence algorithm outputs an interval
[i, j) if and only if µi,j = 1. For every step of the filtration the addition of an n-simplex results
in
dim Hn (Kj ) = dim Hn (Kj−1 ) + 1,
or
dim Hn−1 (Kj ) = dim Hn−1 (Kj−1 ) − 1.

42
The dimension increases if Rj = 0 (addition of a new cycle Vj ) and decreases if Rj 6= 0 (addition
of a boundary Rj ). Assuming that the dimension decreases, then µi,j n−1 = 1 for a unique i < j.
The persistence algorithm pairs Rj to the unique vector Vs ∈ Σ^ Zn−1 with low(Rj ) = low(Vs ) = s.
Since Rj is an (n − 1)-boundary it can be written as a sum of (n − 1)-cycles which satisfies the
following property
 
Rj = Vs + sum of other vectors Vk ∈ Σ ^ Zn−1 with low(Vk ) < s .

This shows that Vs , which is generated at index s, gets identified with a sum of cycles appearing
before index s as we enter Kj . Consequently, s = low(Rj ), and µs,j n−1 = 1. We conclude that
the standard algorithm computes all the finite intervals correctly.
Now assume that µj,∞ n = 1. Since dim Hn (Kj ) = dim Hn (Kj−1 ) + 1, we must have µj,l n = 0
for all l < ∞. If the persistence algorithm would pair Vj to an Rl for an l > j, then the preceding
discussion shows that µj,l j,l
n = 1, contradicting that µn = 0. Hence Vj remains unpaired and the
persistence algorithm also computes all infinite intervals correctly.

Algebraic justification The standard algorithm actually provides us with enough data to
decompose the homology persistence modules into summands isomorphic to interval modules.
We saw above that the n-cycles of ΣHj ∪ ΣEj form a basis forPHn (Kj ). We modify the basis
slightly: every Vi ∈ ΣHj is paired to an Rl such that Rl = Vi + k Vk where each Vk in the sum
appeared before Vi . We can thus replace the basis element Vi with Rl , and then the morphism
Hn (Kl−1 ) → Hn (Kl ) maps the basis element Rl of Hn (Kl−1 ) to 0. Hence, all the morphisms
diagonalize and the persistence module decomposes into indecomposable summands. Let us
illustrate this for the case n = 1 above. Using the basis as given by the persistence algorithm
we get the bases (using vertex notation) {12 + 13 + 24 + 34, 12 + 24 + 14} and {12 + 13 + 24 + 34},
for H1 (K9 ) and H1 (K10 ), respectively. However, the cycle 12 + 24 + 14 becomes equivalent to
12 + 13 + 24 + 14 in homology as we enter K10 , and therefore the linear maps take the form:
[1 1]
span{12 + 13 + 24 + 34, 12 + 24 + 14} −−−→ span{12 + 13 + 24 + 34}.
If we, however, replace 12 + 24 + 14 with the boundary to which it gets paired, then we obtain
a new basis {12 + 13 + 24 + 34, 13 + 34 + 14} and the matrix diagonalizes to:
[1 0]
span{12 + 13 + 24 + 34, 13 + 34 + 14} −−−→ span{12 + 13 + 24 + 34}.
And therefore 0 → H1 (K8 ) → H1 (K9 ) → H1 (K10 ) → 0 decomposes as
1 1
M
(0 → Z2 →− Z2 →− Z2 → 0) (0 → 0 → Z2 → 0 → 0),
See the Section 6.1 for how this decomposition relates to the barcode.
We conclude that a pairing Vi ↔ Rj corresponds to an interval summand with support [i, j),
and that an unpaired Vi corresponds to an interval summand with support [0, ∞).

7.2 Clearing
Consider the reduced matrix R in the previous section. Since the column corresponding to the
simplex 134 is non-zero, we know from the previous discussion that column number i = low(134),
which in this case is corresponds to the simplex 14, must be zeroed out. Likewise, we know that
the column number low(124), which corresponds to simplex 34, must be zeroed out. Hence, if
we first reduced the 2-simplices, then we could skip the columns 14 and 34 when reducing the
1-simplices, as we know that they will be zeroed out. This is the whole idea behind clearing
and can be summarized as follows:

43
• Let K be a filtered simplicial complex with dim K = d.

• Use the standard algorithm to reduce the columns of D corresponding to d-simplices in


order to obtain ΣBd−1 and Σ
d Zd .

• For every Rj ∈ ΣBd−1 , zero out column number low(Rj ) in D. Reduce the (d−1)-simplices
^
of the resulting boundary matrix to obtain the set ΣBd−2 . A basis Σ Zd−1 for Zd−1 (K) is
given by the set ΣBd−1 together with all columns Vi corresponding to zero columns Ri
that were not zeroed out prior to the reduction.

• Continue the same way until a bases for B0 (K) and Z1 (K) are computed.

The total number of rows that need not be reduced are

dim Bd−1 (K) + dim Bd−2 (K) + . . . + dim B1 (K). (2)

We do however need to reduce all columns corresponding to d-simplices, and in applications


this number typically is much larger than the sum in Eq. (2). But the crux of the matter
lies with the fact that reducing a column to zero is typically more expensive than reducing a
column to become a boundary. And in the above case we still need to zero out a large number
of columns corresponding to d-simplices. This turns out to be a major bottleneck and working
with cohomology avoids this issue in practice.

Example 7.1. Let P be a set of 100 points in Euclidean space and say we want to compute
the persistent homology of the Vietoris–Rips filtration in dimensions 0,1 and 2. Counting the
total number of 1, 2 and 3-simplices gives the total number of columns to be reduced in the
naı̈ve approach (0-simplices are already reduced):
     
100 100 100
+ + = 4087875.
2 3 4

Now (exercise)
   
99 99
dim B2 (VR∞ (P )) + dim B1 (VR∞ (P )) = + = 161700.
3 2

Clearing only marginally improves the computation time and the reason for this is the substan-
tial number of 3-simplices that still need to be reduced in the initial step.
 Indeed, the number
of columns which need to be zeroed out equals dim Z3 (VR∞ (P )) = 99 4 = 3764376.

44
8 Week 9: Cohomology
Cohomology is a prominent tool in algebraic topology which carries more structure than ho-
mology, and homology and cohomology groups are often non-isomorphic. When computing
homology and cohomology with coefficients in a field however, their vector spaces have the
same dimensions. In particular, the barcodes of persistent homology and the barcodes of per-
sistent cohomology of a filtered space are equivalent.
Somewhat surprisingly computing cohomology is often much faster in practice. The goal of
this lecture is to introduce cohomology and see why its computation is faster.

8.1 Dual persistence modules


Recall that the dual of a vector space V over a field k is the vector space of linear maps
V ∗ := Hom(V, k). It is well-known (and easy to prove) that if {v1 , . . . , vd } is a basis for V ,
then {1 , . . . , d } is a basis for V ∗ , where i (vi ) = 1 and i (vj ) = 0 for i 6= j. Therefore
dim V = dim V ∗ if V is finite-dimensional.3 Furthermore, if f : V → W is a linear map, then
we get an induced linear map f ∗ : W ∗ → V ∗ given by f ∗ (α)(x) = α(f (x)). If f is represented
by the matrix A, then f ∗ is represented in the dual bases by the matrix AT . It is clear that
(g ◦ f )∗ = f ∗ ◦ g ∗ . Hence, for an [m]-module V
V (1≤2) V (2≤3) V (m−1≤m)
V1 −−−−→ V2 −−−−→ · · · −−−−−−−→ Vm

we get an [m]-module V ∗
V (m−1≤m)∗ V (m−2≤m−1)∗ V (1≤2)∗
Vm∗ −−−−−−−−→ Vm−1

−−−−−−−−−−→ · · · −−−−−→ V1∗ .

We observe (exercise) that dualization respects direct sums of persistence modules: for two
[m]-modules V and W , there is an isomorphism V ∗ ⊕ W ∗ ∼ = (V ⊕ W )∗ .
Consider the interval module I [a,b) for an interval [a, b) in [m],

k 1k k1 1
0 → · · · → 0 → k −→ k −→ · · · −→ k → 0 → · · · → 0.

Its dual (I [a,b) )∗ is isomorphic to the interval module I (m+1−b,m+1−a] where (m + 1 − b, m + 1 − a]


is the interval {i ∈ [m] : m + 1 − b < i ≤ m + 1 − a}.
1 1 k k 1 1
Example 8.1. The dual of 0 → k →
− k→
− k is isomorphic to k −→ k −→ k → 0.

The following proposition follows from the previous two observations and Theorem 6.16

Proposition 8.2. Let V be an [m]-module such that dim Vi < ∞ for all i ∈ [m]. Then

V∗ ∼
M
= I (m+1−b,m+1−a] .
[a,b)∈B(V )

In particular, B(V ∗ ) = {(m + 1 − b, m + 1 − a] : [a, b) ∈ B(V )}.


3
This is in fact an if and only if statement but the converse is non-trivial to prove.

45
8.2 Simplicial Cohomology
In the following we are working over the field k = Z2 .

Definition 8.3. Let n ≥ 0 be an integer and K a simplicial complex. The vector space of
n-cochains in K is the dual vector space C n (K) = Cn (K)∗ = Hom(Cn (K), Z2 ).

There is a coboundary operator ∂ n : C n (K) → C n+1 (K) defined on α : Cn (K) → Z2 by

∂ n (α)(c) = α(∂n+1 (c))

where ∂n is the boundary operator in homology. If ∂ n (α) = 0, then we say that α is an n-


cocycle, and if α = ∂ n−1 (β), then we say that α is an n-coboundary. The n-cocycles and
n-coboundaries define vector spaces Z n (K) and B n (K), respectively.
We immediately observe that

∂ n+1 ◦ ∂ n (α)(c) = α(∂n+1 ◦ ∂n+2 (c)) = α(0) = 0. (3)

It follows that B n (K) ⊆ Z n (K) as in homology.

Definition 8.4. The n-th simplicial cohomology vector space of a simplicial complex K
is the quotient vector space H n (K) = Z n (K)/B n (K).

For every n-simplex σ in K we have a dual σ ∗ : Cn (K) → Z2 given by


(
1 if σ = τ,
σ ∗ (τ ) =
0 otherwise.

By representing the coboundary operator in all dimensions in the bases given by the duals of
simplices, we can apply Algorithm 1 to compute H n (K) in all dimensions. For the moment we
shall order the columns and rows in the opposite order of what we would do in homology. The
reason for doing this will become clear when we turn to persistent cohomology.

Example 8.5. Consider the simplicial complex in Fig. 22. For σ = {3, 4} ∈ K we get ∂ 1 (σ ∗ ) =
τ = {2, 3, 4}∗ , and for v = {2} we get ∂ 0 (v ∗ ) = {2, 3}∗ + {2, 4}∗ + {1, 2}∗ . Representing the
coboundary operator as mentioned above yields,

234 34 23 24 13 12 4 3 2 1
234 0 1 1 1 0 0 0 0 0 0
 
34  0 0 0 0 0 0 1 1 0 0
23  0 0 0 0 0 0 0 1 1 0
24  0 0 0 0 0 0 1 0 1 0
M= 13  0
 0 0 0 0 0 0 1 0 1
12  0 0 0 0 0 0 0 0 1 1
4  0 0 0 0 0 0 0 0 0 0
3  0 0 0 0 0 0 0 0 0 0
2  0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0

46
Figure 22: See Example 8.5.

Applying Algorithm 1 to the above matrix yields the following R and V , respectively:

234 34 23 24 13 12 4 3 2 1
1 0 0 0 0 0 0 0 0 0
 
234 0 1 0 0 0 0 0 0 0 0
 
0 1 1 1 0 0 0 0 0 0
34 
 0 0 0 0 0 0 1 1 0 0 
0

 0 1 0 0 0 0 0 0 0
23 
 0 0 0 0 0 0 0 1 1 0 
0

 0 0 1 0 0 0 0 0 0
24 
 0 0 0 0 0 0 1 0 1 0 
0

 0 0 0 1 0 0 0 0 0
13 
 0 0 0 0 0 0 0 1 0 0,
.
 
0 0 0 0 0 1 0 0 0 0
12 
 0 0 0 0 0 0 0 0 1 0 
0
 0 0 0 0 0 1 0 0 1
4  0 0 0 0 0 0 0 0 0 0 
0

 0 0 0 0 0 0 1 0 1
3  0 0 0 0 0 0 0 0 0 0 
0

 0 0 0 0 0 0 0 1 1
2  0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0

Using vector notation as in Section 3.1.2, we find bases for Z 2 (K), B 2 (K), Z 1 (K), B 1 (K), Z 0 (K):
T
Σ Z 2 = {(1000000000) }
g
ΣB 2 = {(1000000000)T }
T T T T
Σ Z 1 = {(0110000000) , (0101000000) , (0000100000) , (0000010000) }
g
ΣB 1 = {(0101000000)T , (0110100000)T , (0011010000)T }
T
Σ Z 0 = {(0000001111) }.
g

By means of Lemma 2.20 we extend ΣB i to a basis ΣZ i for Z i (K) as in the homology case:

ΣZ 2 = ΣB 2 ΣZ 1 = {(0110000000)T } ∪ ΣB 1 ΣZ 0 = {(0000001111)T }.

We conclude that H 2 (K) = 0, H 1 (K) ∼


= Z2 and H 0 (K) ∼
= Z2 .

The fact that H n (K) ∼ = Hn (K) can easily be proven by showing that dim H n (K) =
dim Z n (K) − dim B n (K) = dim Zn (K) − dim Bn (K) = dim Hn (K). We shall give an alter-
native proof. First we need the following characterization of cycles and cocycles.

Lemma 8.6.

1. γ ∈ Z n (K) if and only if γ(c) = 0 for all c ∈ Bn (K),

2. γ ∈ B n (K) if and only if γ(c) = 0 for all c ∈ Zn (K).

Proof. .

47
1. Assume γ ∈ Z n (K) and c = ∂n+1 (d). Then γ(c) = γ(∂n+1 (d)) = ∂ n (γ)(d) = 0. Con-
versely, if γ is not in Z n (K), then there must exist some d such that 0 6= ∂ n (γ)(d) =
γ(∂n (d)).
2. Assume γ(c) = 0 for all c ∈ Zn (K). Define β : Bn−1 (K) → Z2 by β(d) = γ(c) where
d = ∂n (c). This is well-defined, because if d = ∂n (c) = ∂n (c0 ), then ∂n (c − c0 ) = 0 and
thus c − c0 ∈ Zn (K). It follows that γ(c) = γ(c0 ). By extending a basis for Bn−1 (K) to a
basis for Cn−1 (K), we can extend β to a linear map β : Cn−1 (K) → Z2 satisfying

∂ n−1 (β)(c) = β(∂n (c)) = γ(c).

We conclude that γ = ∂ n−1 (β). The converse statement is straightforward.

Lemma 8.7. The morphism h : H n (K) → Hn (K)∗ given by h([α])[c] = α(c) is well-defined,
and it is an isomorphism.
Proof. Let α = α0 + ∂ n−1 (β). Then

h([α])[c] = α(c) = α0 (c) + ∂ n (β(c)) = α0 (c) + β(∂n (c)) = α0 (c)

where the last equality follows from c being an n-cycle. This shows that h is independent of
the representative cocycle. Next, let c = c0 + ∂n+1 (d),

α(c) = α(c0 ) + α(∂n+1 (d)) = α(c0 ) + ∂ n (α)(d) = α(c0 ),

since α is an n-cocycle. This shows that h is well-defined.

• h is injective: If h([α]) = 0, then α(c) = 0 for all c ∈ Zn (K). It follows from Lemma 8.6
that α ∈ B n (K), hence [α] = 0.
• h is surjective: Let f : Hn (K) → Z2 . Pre-composing f with the linear map Zn (K) →
Hn (K), defines a f 0 : Zn (K) → Z2 . By extending a basis for Zn (K) to a basis for Cn (K),
we can lift f 0 to a linear map f 0 : Cn (K) → Z2 . Since f 0 (b) = f ([b]) = f (0) = 0 for
b ∈ Bn (K), it follows that f 0 ∈ Z n (K) by Lemma 8.6. Hence h([f 0 ]) = f .

Since dim V = dim V ∗ for V finite-dimensional, it follows that

Hn (K) ∼
= Hn (K)∗ ∼
= H n (K).

8.3 Persistent Cohomology


For an inclusion f : Ki ⊆ Kj of simplicial complexes, there is an induced map f ∗ : H n (Kj ) →
H n (Ki ) given by
f ∗ ([α])(c) = α(f (c)).
We leave it as an exercise to verify that this map is well-defined.
To a filtration K1 ⊆ K2 ⊆ · · · ⊆ Km we thus get the following cohomology persistence
module:
H n (K) : H n (Km ) → H n (Km−1 ) → · · · → H n (K2 ) → H n (K1 ).
Let Hn (K) denote the associated homology persistence module,

Hn (K) : Hn (K1 ) → H2 (K) → · · · → Hn (Km−1 ) → Hn (Km ).

48
Lemma 8.8. The persistence modules H n (K) and Hn (K)∗ are isomorphic.

Proof. For i ∈ [m], define hi : H n (Ki ) → Hn (Ki )∗ by hi ([α])(c) = α(c). That yields the
following commutative diagram for all i ≤ j

H n (Kj ) H n (Ki )

= hj ∼
= hi

Hn (Kj )∗ Hn (Ki )∗

where the vertical morphisms are isomorphisms by Lemma 8.7.

The following theorem is an immediate consequence of the previous lemma and Proposi-
tion 8.2.

Theorem 8.9. There is a bijection between the barcodes B(H n (K)) and B(Hn (K)) given by

B(Hn (K)) 3 [a, b) ↔ (m + 1 − b, m + 1 − a] ∈ B(H n (K)).

Remark 8.10. In fact, if we view H n (K) as an persistence module indexed over [m] with the
opposite ordering,

H n (K1 ) ← H n (K2 ) ← · · · H n (Km−1 ) ← H n (Km ),

then the barcode of H n (K) coincides with the barcode of Hn (K).

8.3.1 Computation
It is tempting to think that persistent cohomology can be computed by applying the standard
algorithm to the coboundary matrix as in Example 8.5. This turns out to almost be the case.

Example 8.11. Returning to Example 8.5 and pairing vectors based on their lowest non-zero
entry as in the standard algorithm for persistent homology we get the pairs

(1000000000)T ↔ (1000000000)T
(0101000000)T ↔ (0101000000)T (0000100000)T ↔ (0110100000)T
(0000010000)T ↔ (0011010000)T (0110000000)T ↔ ∅
(0000001111)T ↔ ∅

Let us start with the first pairing, which is between {2, 3, 4}∗ and the column corresponding to
{3, 4}∗ . Since the duals of simplices appear in the opposite order of the simplices, this results in
an interval [1, 2) in dimension 2 (no, this is not a typo). Similarly we get intervals [4, 7),[5, 8),
[6, 9) and [3, ∞) in dimension 1. Lastly we get an interval [10, ∞) in dimension 0.

The barcode of the previous example can easily be transformed into the barcode of persistent
cohomology, and thus persistent homology. One can prove that applying the standard algorithm
to the boundary matrix as above computes the barcode of the following persistence module in
relative cohomology:

H n (K, Km−1 ) → H n (K, Km−2 ) → . . . → H n (K, K1 ) → H n (K).

The barcode of relative cohomology corresponds to the barcode of H n (K) according to the
following table:

49
Relative Cohomology Cohomology Homology
[a, b) in dim. i (a, b] in dim. i − 1 [m + 1 − b, m + 1 − a) in dim. i − 1
[a, ∞) in dim. i (−∞, a] in dim. i [m + 1 − a, ∞) in dim. i
The reader may easily verify that transforming the barcode of Example 8.11 into the homology
barcode yields the expected result.

8.3.2 Clearing
The salient point of the last subsection is that the persistent homology barcode can be computed
by means of cohomology. A naı̈ve implementation will not improve computational speed much
compared to the standard algorithm. However, the speed improves dramatically if we employ
the clearing technique discussed in the previous lecture.
Just as in the homology case, we know that if the column corresponding to the n-cochain
σ ∗ forms an n-coboundary with lowest non-zero entry at row i, then the column corresponding
to the (n + 1)-cochain added at time i will be reduced to 0 under Algorithm 1. This means that
if we have reduced all the (n − 1)-cochains to form a basis for B n (K), then we avoid reducing
|B n (K)| columns when computing bases for Z n (K) and B n+1 (K). This is the whole idea behind
clearing and can be summarized as follows:

• Let K be a filtered simplicial complex with dim K = d.

• Let D be the coboundary operator in matrix form, with the columns ordered in the
opposite order of the filtration (as in Example 8.5).

• Use the standard algorithm to reduce the columns of D corresponding to 0-simplices in


order to obtain ΣB 1 and Σ
d Z0 .

• For every Rj ∈ ΣB 1 , zero out column number low(Rj ) in D. Reduce the 1-cochains of
the resulting boundary matrix to obtain the set ΣB 2 . A basis Σ 1
Z 1 for Z (K) is given by
g
the set ΣB 1 together with all columns Vi corresponding to zero columns Ri that were not
zeroed out prior to the reduction.

• Continue the same way until a bases for Z d−1 (K) and B d (K) are computed.

The total number of columns that need not be reduced are

dim B 1 (K) + dim B 2 (K) + . . . + dim B d−1 (K). (4)

The difference with homology is that we avoid zeroing out a large number of columns corre-
sponding to d-simplices. Let us return to Example 7.1 in the case of cohomology.
Example 8.12. When working with cohomology we know that Z 3 (K) = C 3 (K) if restricted to
a simplicial complex without 4-simplices. Hence, if we were to naı̈vely reduce the coboundary
matrix without using clearing we would have to do a total number of
     
0 1 2 100 100 100
dim C (VR∞ (P ))+dim C (VR∞ (P ))+dim C (VR∞ (P )) = + + = 166750
1 2 3
column reductions. This number is much lower than for the naı̈ve homology algorithm, but the
computations are not faster in practice because the columns to be reduced are much larger.
Furthermore, the total number of columns to be zeroed out equals
   
2 1 0 99 99
dim Z (VR∞ (P )) + dim Z (VR∞ (P )) + dim Z (VR∞ (P )) = + + 1 = 4951.
2 1

50
With clearing on the other hand, we need not zero out the following number of columns:
   
1 2 99 99
dim B (VR∞ (P )) + dim B (VR∞ (P )) = + = 4950.
1 2

In conclusion: 161800 column reductions but only a single column will be reduced to 0.

The previous example illustrates one of the reasons why cohomology with clearing typically
performs much faster than homology with clearing: the number of columns to zero out becomes
small, and it is comparatively much cheaper to reduce a column to a boundary. Furthermore,
it turns out that in practice a large number of the boundary columns need no reduction. More
on this can be found in [1].

51
9 Week 10: Stability of Persistent Homology
In this lecture we shall discuss metrics on barcodes/persistence diagrams and discuss to what
extent persistent homology is stable under perturbation of the input data.

9.1 The Bottleneck Distance


Let C and D be multisets of intervals ha, bi in R. Here the notation ha, bi denotes that the
interval can be any well-defined member of {[a, b], [a, b), (a, b], (a, b)}. We define a matching
between C and D to be a collection of pairs χ = {(I, J) ∈ C × D} where each I and each J can
occur in at most one pair. Equivalently, a matching is a bijection between a subset of C and a
subset of D. If (I, J) ∈ χ, then we say that I is matched to J. If I does not appear in a pair,
then we say that I is unmatched.

Example 9.1. Let C = {I1 , I2 } and D = {J}. Then the pair (I1 , J) defines a matching where
I2 is unmatched. Note that {(I1 , J), (I2 , J)} does not define a matching.

Define the cost c(I, J) of matching I = ha, bi to J = hc, di to be

c(I, J) = max(|c − a|, |d − b|),

and define the cost c(I) of not matching I to be

c(I) = (b − a)/2.

Given this we define the cost of a matching χ to be


!
c(χ) := max sup c(I, J), sup c(I) . (5)
(I,J)∈χ unmatched I∈C∪D

We say that χ is an -matching if c(χ) ≤ .


Remark 9.2. A geometric interpretation of this is as follows: consider the intervals of C and D
as points in R2 . An -matching then pairs up points p and q, corresponding to intervals of C
and D respectively, such that ||p − q||∞ ≤ , and such that any unmatched point is at most 
away from the diagonal in the l∞ -norm.

Lemma 9.3. If there exists an -matching between C and D, and an 0 -matching between D
and E, then the compositions of matching yields an ( + 0 )-matching between C and E.

Proof. Let I = ha1 , b1 i ∈ C, J = ha2 , b2 i ∈ D and K = ha3 , b3 i ∈ E such that I is matched to J,


and J is matched to K. Then |a3 − a1 | ≤ |a3 − a2 | + |a2 − a1 | ≤  + 0 , and similarly for |b3 − b1 |.
If I and J are as above, but J is unmatched in the second matching, then by assumption
we have b2 ≤ a2 + 20 . It follows that

a1 + 2 + 20 ≥ a2 +  + 20 ≥ b2 +  ≥ b1 ,

and thus c(I) ≤  + 0 .


A similar argument applies if J is matched to K under the second matching, but unmatched
under the first matching.

It follows from the definition of a matching and the previous lemma that the following defines
a distance.

52
Figure 23: Left: A graph (black) and its perturbation (red). Right: The persistence diagrams
of the 0-th sublevel set persistent homology of the two graphs.

Definition 9.4. The bottleneck distance between C and D is

dB (C, D) = inf{c(χ) : χ is a matching between C and D}.

Example 9.5. Let C = {[0, 6), [4, 6)} and D = {[2, 8), [10, 12)}. The trivial matching which
leaves everything unmatched has a cost of the half the length of the longest interval: (8−2)/2 =
3. Hence, dB (C, D) ≤ 3. In order to improve this bound we need to match the interval [2, 8) to
either [0, 6) or [4, 6). These two pairings come at the same expense

c([0, 6), [2, 8)) = c([4, 6), [2, 8)) = 2.

If we match [0, 6) with [2, 8), then we can either match [4, 6) to [10, 12) or leave both of the
unmatched. We see that leaving them both unmatched comes at the lowest cost of

max{c([0, 6), [2, 8)), c([4, 6)), c([10, 12))} = 2.

If we however match [4, 6) to [2, 8), then the best we can do is

max{c([4, 6), [2, 8)), c([0, 6)), c([10, 12))} = 3.

We conclude that dB (C, D) = 2.

The previous example was somewhat tedious but luckily there are fast algorithms for com-
puting the bottleneck distance in practice. By recasting the problem as an instance of a bi-
partite matching problem, state-of-the-art algorithms compute dB (C, D) in O(n1.5 log n) where
n = |C| + |D|.

9.1.1 Stability of Persistent Homology


One of the key properties of persistent homology is the fact that it is stable in the bottleneck
distance. As an example, consider the two graphs shown to the left in Fig. 23. Associated
to these graphs we get persistence diagrams in dimension 0 by considering sublevel sets and
applying homology in dimension 0. The persistence diagram of the perturbed graph has two
points close to the points of the original persistence diagrams, together with two points close to
the diagonal (noise). This suggests a matching where the latter two points (intervals) are left
unmatched, and the two other points (intervals) will be matched with a cost bounded by the
perturbation in the l∞ -norm.

53
More generally, let X be a topological space equipped with two functions f, g : X → R.
Associated to these functions we have R-modules M f and M g given by

Mtf = Hi (f −1 (−∞, t]) Mtg = Hi (g −1 (−∞, t]). (6)

Assuming that dim Mtf < ∞ and dim Mtg < ∞ for all t, which ensures that we have well-defined
barcodes by Theorem 6.18, the following is true

Theorem 9.6.
dB (B(M f ), B(M g )) ≤ ||f − g||∞ .

We shall prove this theorem for sufficiently tame functions.


Similar stability results apply to point sets: Fig. 24 shows a noisy sample from the circle
and its perturbation, together with the persistence diagrams in dimension 1 of the associated
to the Vietoris–Rips filtrations. For a finite point set P , let Hi (VR(P )) denote the R-indexed
persistence module defined at t by Hi (VRt (P )) and for which the morphism Hi (VRs (P )) →
Hi (VRt (P )) is induced by the inclusion VRs (P ) ⊆ VRt (P ).

Theorem 9.7. Let P and Q be finite sets of points in Rd , and σ : P → Q a bijection such that
||p − σ(p)|| ≤  for all p ∈ P . Then,

dB (B(Hi (VR(P ))), B(Hi (VR(Q)))) ≤ .

By means of the Gromov–Hausdorff distance this theorem can be strengthened to include


point sets that need not be embedded in a common space nor have the same cardinality. We
will not concern ourselves with the more general result.
A stability theorem for the Cech filtration in the case that P and Q need not have the same
cardinality follows from Theorem 9.6. Let Hi (Cech(P )) denote the R-module associated to the
Cech filtration. Recall the notation Pr := d−1
P (−∞, r] introduced in Section 5.1.

Theorem 9.8. Let P and Q be finite sets of points in Rd . If there exists an  ≥ 0 such that
P ⊆ Q and Q ⊆ P , then

dB (B(Hi (Cech(P ))), B(Hi (Cech(Q)))) ≤ .

Proof. Define functions dP , dQ : Rd → R by

dP (x) = min ||x − p|| dQ (x) = min ||x − q||.


p∈P q∈Q

Fix an x ∈ R2 and let p ∈ P be a point closest to x. Then, from the assumption that P ⊆ Q ,
there exists some q ∈ Q with ||p−q|| ≤ . This shows that dP (x) ≤ dQ (x)+, and symmetrically,
dQ (x) ≤ dP (x) + . We conclude that ||dP − dQ ||∞ ≤ .
Now define R-modules M dP and M dQ as above. From Theorem 4.10 we know that M dP ∼ =
Hi (Cech(P )) and N dQ ∼
= Hi (Cech(Q)). Since isomorphic R-modules necessarily have the same
barcode, we conclude that

dB (B(Hi (Cech(P ))), B(Hi (Cech(Q)))) = dB (B(M dP ), B(M dQ )) ≤ ||dP − dQ ||∞ ≤ .

54
Figure 24: Left: A sample from a circle and its perturbation. Right: The associated persistence
diagrams in dimension 1 computed using Ripser.

9.1.2 Generalizations
The bottleneck distance is only sensitive to the maximum over a matching. There are other
”more discriminative” distances which are more frequently used in data analysis, although they
do not exhibit the same type of stability as the bottleneck distance. One such distance is the
degree q Wasserstein distance,
 1/q
X X
Wq (C, D) = inf  c(I, J)q + c(I)q  ,
matchings χ between C and D
(I,J)∈χ unmatched I∈C∪D

where q is some positive real number. The bottleneck distance can be obtained as a limit in the
following way:
lim Wq (C, D) = dB (C, D).
q→∞

9.2 Interleavings
We will now introduce the theory of interleavings and an associated interleaving distance be-
tween persistence modules. Importantly, and as we will see, the interleaving distance coincides
with the bottleneck distance, and it is easy to show stability in the interleaving distance. Hence,
our stability results will follow from this equivalence.

Discrete setting For the moment, let us assume that we are working with persistence mod-
ule indexed by the integers. A 0-interleaving is nothing more than an isomorphism, i.e. a
collection of morphisms {Mi → Ni } and a collection of morphisms {Ni → Mi } such that the
following diagrams commute:

55
··· Mi Mi+1 Mi+2 ···

··· Ni Ni+1 Ni+2 ···

A 1-interleaving is a collection of slanted morphisms such that the following diagram commutes:

··· Mi Mi+1 Mi+2 ···

··· Ni Ni+1 Ni+2 ···

Note that a 1-interleaving requires that the morphism Mi → Mi+2 factors through Ni+1 in a
natural way. Intuitively, this means that every “2-persistent” feature of Mi —a bar of length at
least two that overlaps the index i—is also present in Ni , and vice versa. A 2-interleaving is a
collection of morphisms {Mi → Ni+2 } and {Ni → Mi+2 } making a similar diagram commute.
It should now be possible to deduce what an n-interleaving is.

The formal definition Now we shall assume that the modules M and N are indexed over the
real numbers. Define the -shift of M to be the persistence module M  defined by Mt = Mt+
and M  (s ≤ t) = M (s +  ≤ t + ) for all s ≤ t ∈ R. If f : M → N is a morphism, then we get
an -shifted morphism f  : M  → N  defined by ft = ft+ .

Example 9.9. The  shift of the interval module I [a,b) is I [a−,b−) .

Let ηM : M → M  be the morphism whose restriction to each M is the internal morphism
t
M (t ≤ t + ).

Definition 9.10. Given  ∈ [0, ∞), an -interleaving between M and N is a pair of morphisms
ψ : M → N  and ϕ : N → M  such that ϕ ◦ ψ = ηM 2 and ψ  ◦ ϕ = η 2 . We say that M and N
N
are -interleaved.

Explicitly, the last condition states the following two diagrams commute for all t ∈ R:

M (t≤t+2)
Mt Mt+2 Mt+
φt ψt+
ψt ϕt+
N (t≤t+2)
Nt+ Nt Nt+2

Lemma 9.11. If M and N are -interleaved, and N and L are 0 -interleaved, then M and L
are ( + 0 )-interleaved.
0 0
Proof. Let ψ : M → N  , ϕ : N → M  , ψ 0 : N → L and ϕ0 : L → N  be the respective mor-
0
phisms satisfying the interleaving condition. They yield a morphism ψ 00 : M → L+ through
the composition
0
ψt+
ψt
Mt −→ Nt+ −−−→ Lt++0 ,
0
and a morphism ϕ00 ◦ M → L+ given by

tϕ0 ϕt+0
Lt −→ Nt+0 −−−→ Mt++0 .

56
0 2(+0 ) 0 2(+0 )
It remains to check that (ϕ00 )+ ◦ ψ 00 = ηM and (ψ 00 )+ ◦ ϕ00 = ηL . The first equality
follows from the following commutative diagram:
M (t≤t+2) M (t+2≤t+2+20 )
Mt Mt+2 Mt+2+20
ϕt+
ψt ϕt++20
N (t+≤t++20 )
Nt+ N t++20

0
ψt+ ϕt++0
Lt++0

The second equality follows from a similar commutative diagram.

It follows from the definition of an interleaving and the previous lemma that the following
indeed defines a metric.
Definition 9.12. The interleaving distance between two R-modules M and N is

dI (M, N ) = inf{ : there exists an -interleaving between M and N }.

The following result is fundamental to topological data analysis and non-trivial. We defer
its proof to a later lecture.
Theorem 9.13. Let M and N be R-modules such that Mt and Nt are finite-dimensional for
all t ∈ R. Then,
dB (B(M ), B(N )) = dI (M, N ).

An immediate corollary is a proof of Theorem 9.6.

Proof of Theorem 9.6. Since ||f − g||∞ ≤ , we have the following commutative diagram of
inclusions for every t ∈ R:

f −1 (−∞, t] f −1 (−∞, t + ] f −1 (−∞, t + 2]

g −1 (−∞, t] g −1 (−∞, t + ] g −1 (−∞, t + 2].

Applying Hi yields the following commutative diagram

Mtf f
Mt+ f
Mt+2

Mtg g
Mt+ g
Mt+2 .

It is easy to see that this defines an -interleaving pair.

Proof of Theorem 9.7. This proof is analogous to the previous proof. Label the points of P =
{p1 , . . . , pm } and Q = {q1 , . . . , qm } such that ||pi − qi || ≤ . If σ = {pi1 , . . . , pim } is a simplex of
VRr (P ), then we have by definition of the Vietoris–Rips complex that diam σ ≤ 2r. From the
bijection we get that the corresponding set τ = {qi1 , . . . , qim } satisfies diam τ ≤ 2r + 2. Hence,

57
we have an inclusion VRr (P ) ⊆ VRr+ (Q) defined by the simplicial mapping which sends the
vertex pi to qi . Symmetrically we have an inclusion VRr (Q) ⊆ VRr+ (P ). Putting these two
relations together we find

VRr (P ) ⊆ VRr+ (Q) ⊆ VRr+2 (P )


VRr (Q) ⊆ VRr+ (P ) ⊆ VRr+2 (Q)

Applying Hi to the above relations defines an -interleaving between Hi (VR(P )) and Hi (VR(Q)).
It follows from Theorem 9.13 that

dB (B(Hi (VR(P ))), B(Hi (VR(Q)))) = dI (Hi (VR(P )), Hi (VR(Q))) ≤ .

58
Figure 25: Points belonging to the same cluster drawn are in the same color. The figure can
be generated with the code found here: https://scikit-learn.org/stable/auto_examples/
cluster/plot_cluster_comparison.html

10 Week 11: Clustering and TDA


Clustering is the task of partitioning data into (disjoint) subsets, such that data belonging to
different partitions differ among themselves more than data which belong to the same partition.
Put topologically, clustering is the task of inferring the connected components of the data.
Fig. 25 shows that there is a wide range of available clusteirng methods. In this section we shall
focus on methods inspired by topology.

10.1 Some Examples and Kleinberg’s Theorem


We briefly list some classical clustering methods.

The -neighborhood graph Given a finite set of points P and a distance d(pi , pj ) between
every pair of points pi , pj ∈ P , we define the -neighborhood graph to be the graph on the
vertex set P , with an edge between pi and pj if d(pi , pj ) ≤ . In other words, the 1-skeleton
of VR (P ). The set of points P is then partitioned according to the following rule: pi and pj
belong to the same partition if and only if they belong to the same connected component of the
neighborhood graph.

kN N - k-th nearest neighbor graph An alternative to the -neighborhood is to define a


graph by drawing an edge between the point pi and pj if pj is amongst the k closest points of
pi .

k-means clustering Assuming that P is a finite set of points in Rd and k > 0 is an integer,
the goal of k-means clustering is to partition the objects into k clusters such that intra-cluster

59
variance is minimal, i.e. the object is to to partition P into P1 , . . . , Pk such that
k X
X
||p − µi ||2
i=1 p∈Pi

is minimal. Here µi denotes the mean of the points in Pi . Computing such an optimal partition
is an NP-hard problem, and iterative techniques are employed to find local minima. This
technique is ill-suited if your clusters are non-convex.

DBSCAN A density based refinement of the -neighborhood graph which is suited for non-
convex domains is as follows: let m be a positive integer and let C denote the set of points in P
which have at least m points within distance . The elements of C are called the core points.
Now, construct the -neighborhood graph on the core points, and use the -neighborhood graph
approach to cluster the points of C. Any other point p ∈ P which is not a core point, is then
added to the partition containing the core point pi if d(pi , p) ≤ . If p is not within  distance
to any core point, then p is labelled as noise.

Kleinberg’s Theorem Let P be a finite set with |P | ≥ 2. A clustering function (on P )


is a function which takes as input a distance function d : P × P → R≥0 and outputs a partition
Γ of P . We say that a clustering function f is isometry invariant if f (d) = f (d0 ) whenever
(P, d) and (P, d0 ) are isometric. If f (α · d) = f (d) for all α > 0, then f is scale invariant.
Lastly, let d0 be such that d0 (pi , pj ) ≤ d(pi , pj ) whenever pi , pj are clustered together in f (d),
and d0 (pi , pj ) ≥ d(pi , pj ) whenever pi and pj do not belong to the same partition. If f (d) = f (d0 )
for all such d and d0 , then we say that f is consistent.

Theorem 10.1 (Kleinberg). If f is isometry-invariant, scale-invariant and consistent, then

1. (lump) f (d) = {P } for all distances d, or

2. (discrete) f (d) = {{p} : p ∈ P } for all distances d.

Proof. Let |P | = n and let d be such that d(pi , pj ) = 1 for all pi 6= pj . By isometry invariance
we must have that f (d) = {P } or f (d) = {{p} : p ∈ P }. Assume the former is the case, and let
d0 be any other distance on P , and rescale such that αd0 < d. Then
scale inv consistency
f (d0 ) = f (αd0 ) = f (d) = {P }.

If f (d) = {{p} : p ∈ P }, then scale such that αd0 > d and apply a similar argument.

An issue with clustering is that there might be no unique correct scale at which the data
should be considered. Indeed, Fig. 26 illustrates that what appears to be well-defined clusters
at one scale, may reveal a finer structure upon inspection at a smaller scale. One may attempt
to rectify these issues by considering hierarchical clustering methods. Such methods do
not assign a single partition to the input metric space, but rather a one-parameter family of
clusters capturing the evolution of the clusters as the connectivity parameter increases - much
like persistent homology. The output of such a method is typically a graph like the one shown
in Fig. 27. These methods do however also have their deficiencies but we will not discuss this
here.

60
Figure 26: Example illustrating the multiscale nature of the clustering problem. At a coarse
scale, two clusters (dark shading) are apparent. At a finer scale, each of these two clusters
appear to decompose further into two subclusters (light shading).
.

Figure 27: Dendrogram for the point set shown in Fig. 26.
.

10.2 ToMATo
ToMATo - Topological Mode Analysis Tool - is the result of combing the classical hill climbing
algorithm with persistent homology. The algorithm first appeared in [5] and in this section we
follow their exposition.
To illustrate the idea of ToMATo in the continuous setting, consider the graph shown to the
left in Fig. 28 which depicts an example density-function of an assumed underlying distribution
from which we sample. As there are two clear maxima, we say that each of them represent a
cluster, and the points belonging to the respective clusters are those points belonging to their
respective ascending regions. That is, the ascending region of a critical point m is the set
of all points x in the domain which end up at m by following the flow induced by the gradient
vector field of the density function. In the example in the question, this means that every
point to the left of the valley where the two peaks meet are clustered to one cluster, and all
the points to the right of the valley are clustered to the other cluster. But what if we consider
the density function to the right in Fig. 28 - defining every local peak to be a cluster seems
counter-productive. To proceed one chooses a threshold τ > 0 and defines a local maxima to
define a cluster if the associated peak has a prominence of at least τ . That is, one needs to
descend a height of at least τ in order to reach a higher peak. Persistent homology is in turn
used to select the appropriate τ : let f : X → R denote the density function and consider the
persistent homology of the superlevel filtration given by

H0 (f −1 [s, ∞)) → H0 (f −1 [t, ∞))

for s ≥ t. In Fig. 29 we show the right-most function of Fig. 28 together with its persistence
diagram. Note that the diagram is drawn upside down as we are considering the superlevel

61
Figure 28: Two density functions on the same domain.

Figure 29: A density function and the persistence diagram of its superlevel filtration in dimen-
sion 0.

filtration and not the sublevel filtration we have frequently encountered. The blue line in the
figure is the separating line which is used to distinguish the noisy peaks from the peaks that
are to define clusters. Note that the line defines the parameter τ by means of the the equation
y = x − τ . Once we have settled on such a τ we select the prominent peaks mp and for a peak
m of prominence less than τ , we consider the minimum  such that m belongs to the same
connected component as a τ -prominent peak mp in f −1 [m − , ∞). Any point which belongs to
the ascending region of m will now be associated to the point mp , and the clusters are defined
accordingly. E.g, in Fig. 29 the points to left of the deepest valley define a cluster, and the
points to the right define another cluster.

10.2.1 The Discrete Case


For the purpose of this lecture we shall assume that we are given a point sample P and an
estimate fˆ(p) of the density at every point p ∈ P . Such an estimate can be obtained in
numerous ways, the most naı̈ve being a simple normalized count of the number of points of P
within a δ-ball around p for some δ > 0.
Fix an  > 0 and consider the -neighborhood graph G constructed from the points in P .
With this information we can form our initial clusters: every local maximum, i.e. all points pi

62
x 10 -3
2.2
2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2

-∞
0.5 1 1.5 2
(a) (b) x 10-3 (d)
(c)

Figure 2: Our approach in a nutshell: (a) estimation of the underlying density function f at the data points; (b) result
of the basic graph-based hill-climbing step; (c) approximate PD showing 2 points far off the diagonal corresponding to
the 2 prominent peaks of f ; (d) final result obtained after merging the clusters of non-prominent peaks.

cluster merging Figurestep guided30:byThe pipelineAsofillustrated


persistence. the discretefaithfulalgorithm (copied
approximation from
of the PD of[5]).
f . Under conditions of a
in Figure 2(b), hill-climbing is very sensitive to perturba- sufficient signal-to-noise ratio in this PD, we can determine
tions of the density function f that arise from a density the correct number of clusters and show that significant clus-
estimator f˜. Computing the PD of f˜ enables us to separate ters always have stable regions. The precise statements and
satisfying
the prominent fˆ(ppeaks ˆ from
i ) >offf˜(p j ) for all neighborsones.
the inconsequential of p Ini in G, represents
proofs are included a in
cluster. If pj is
the full version notpaper
of the a local
[7]; in
Figure 2(c) then
maximum for instance, we can see
we associate pj2 topoints
the(pointed
same clusterto this
as conference
its neighbor version we give
with theangreatest
intuitive explanation
filtration to
by arrows) that are clearly further from the diagonal than highlight how interpretation can be aided by our approach.
value. If there
other points: these are n localtomaxima,
correspond then peaks
the 2 prominent we get of a collection of clusters
In some applications, the {C 1 , . .of
number Cn }. is not obvious
. ,clusters
f˜ (one
By ofdefining
the points the filtration
is at y = −∞, as value fˆ(e) peak
the highest of an edge e connecting
never and we see thispini and pj to be max(
the corresponding PDs.fˆ (pi ), fˆ(p
However, ))
injthese
dies). To obtain the final clusters, we merge every cluster of cases the relationship between the choice of parameters and
weprominence
obtain alesssuperlevel filtration of the
than a given thresholding parameter τ into graph G. The algorithm proceeds precisely
the number of obtained clusters is transparent. as in the
continuous case:in compute
its parent cluster the persistence the hierarchy.
persistence diagram inObtaining
As shown dimension 0 ofinthe
guarantees suchsuperlevel
general settingsfiltration
using only
ofinfˆFigures
: G → 2(c) and 2(d), the PD gives us a precise under-
R and use the persistence diagram to simple tools like neighborhood graphs is made possible by re-
determine a threshold parameter τ . Upon
standing of the relationship between the choice of τ and the cent advances on the stability of persistence diagrams [4, 6].
choosing a τ , iterate
number of obtained clusters. over the points in the order given by fˆ(p ) > fˆ(p ) > . . . > fˆ(p )
Previous stability1 results [12]2 required the use ofnpiecewise- and
In practice we run
merge clusters as follows: ToMATo twice: in the first run we set linear approximations of the density functions, as in Fig-
τ = +∞ to merge all clusters and thus compute the PD; ure 1(b) for instance. The construction of such approxima-
then, using the PD we choose a value for τ (which amounts tions becomes quickly intractable when the dimensionality of
to • If fˆ(pthe
selecting i ) number
is a local maximum
of clusters) in the
and re-run G, algorithm
then do nothing. the data grows. This fact might explain why topological per-
to obtain the final result. The feedback provided by the sistence was never really exploited in mode analysis before,
If fˆ(pinvaluable
PD• proves i ) is not ina local maximum,
interpreting the then
clustering p
results
i belongs to aincluster
except Ck . Iterating
some restricted (in an arbitrary
or low-dimensional settings [22].
in many cases. Indeed, the PD gives a clear indication of ˆ ˆ
whetherorder)
or notoverthere the neighbors
is a natural number pjofofclusters,
pi inand G with f (pj ) ≥ f (pi ), we merge the cluster Cl
becausecontaining
it is a planar pj with Ck ifwe can understand its
point cloud
2. THE ALGORITHM
structure visually, regardless of the dimensionality of the We first provide an intuitive insight into our approach by
input data set. considering the continuous setting underlying our input. We
ToMATo is highly generic min(max{
and agnosticfˆ(p) p∈
to :the Cl },ofmax{then
choice fˆ(p)give ∈ details
: pthe Ck }) of fˆ(p
<the i ) + τ in the discrete setting.
algorithm
distance, underlying graph, and density estimator. Our the-
oretical guarantees
is, wemake use ofCgraphs that do not require The continuous setting. Consider an m-dimensional Rie-
That replace k and Cl in C by Cl ∪ Cmannian k. manifold X and a Morse function f : X → R, i.e. a
the geographic coordinates of the data points at hand (only
pairwise distances are used) nor estimates of the density at C 2 -continuous function with non-degenerate critical points.
The
extraresulting
points. This C makes
contains the clusters.
the algorithm applicableThe in very four steps
Assume ofthat
thef discrete
has a finitealgorithm and the
number of critical points.end The
result
generalissettings.
shown ToMAToin Fig. is30. also This
highly illustration
efficient: in theis copied ascending
from region
[5] ofanda critical point m,isnoted
the reader A(m), is the
encouraged
worst case it has an almost-linear running time in the dis- subset of the points of X that eventually reach m by moving
totance
havematrixa looksize, at
andthat
only apaper for other
linear memory usagenice
in theexamples. Note
along the that the
flow induced above
by the gradientexplanation
vector field ofwas
f . For
written
number of indata
a conceptual
points (as in mostway applications
and that distances
an implementation
to would
all x ∈ A(m), we iterate
call m theover
root of the
x. points
Ascending using
regionsa of
near-neighbors suffice). Most often we use Euclidean dis- the peaks of f are known to form pairwise-disjoint open cells
union-find structure. We include the algorithm from
tances, however other metrics such as diffusion distances
[5] in Fig.to31.
homeomorphic Rm . Furthermore, assuming X to have no
can be used. Indeed, the choice of metric and density es- boundary and f to be bounded from above and proper1 , the
timator define the space we study, while our algorithm gives ascending regions of the peaks of f cover X up to a subset
the structure of this space. Finally, ToMATo comes with a of Hausdorff measure zero. It is then natural to use them to
solid mathematical formulation. We show that, given a fi- partition (almost all) the space X into regions of influence.
nite sampling of an unknown space with pointwise estimates 1
This means that for any bounded closed interval [a, b] ⊂ R, the
of an unknown density function f , our algorithm computes a
pre-image f −1
([a, b]) is a compact subset of X.

63
The mode-seeking phase takes a linear time in the size of G once the vertices have been sorted.
As for the merging phase, it makes O(n) union and O(m) find queries to the union-find data
structure U, where n and m are respectively the number of vertices and the number of edges of
G. If an appropriate representation is used for U (e.g. a disjoint-set forest [16]), and if the vertex
gradients and the entry roots are stored in separate containers with constant-time access (e.g.
arrays), then the worst-case time complexity of Algorithm 1 becomes O(n log n + mα(n)), where α
stands for the inverse Ackermann function.
As for the space complexity, note that the graph G does not have to be stored entirely in main
memory, since only the neighborhood of the current vertex i is involved at the i-th iteration of the
clustering procedure. The main memory usage is thus reduced to O(n), where n is the number
of vertices of G. The total space complexity remains O(n + m) though, as the graph needs to be
stored somewhere (e.g. on the disk).

ALGORITHM 1: Clustering
Input: simple graph G with n vertices, n-dimensional vector f˜, real parameter τ ≥ 0.

Sort the vertex indices {1, 2, · · · , n} so that f˜(1) ≥ f˜(2) ≥ · · · ≥ f˜(n);


Initialize a union-find data structure U and two vectors g, r of size n;
for i = 1 to n do
Let N be the set of neighbors of i in G that have indices lower than i;
if N = ∅ then
// vertex i is a peak of f˜ within G
Create a new entry e in U and attach vertex i to it;
r(e) ← i; // r(e) stores the root vertex associated with the entry e
else
// vertex i is not a peak of f˜ within G
g(i) ← argmaxj∈N f˜(j); // g(i) stores the approximate gradient at vertex i
ei ← U.find(g(i));
Attach vertex i to the entry ei ;
for j ∈ N do
e ← U.find(j);
if e 6= ei min{f˜(r(e)), f˜(r(ei ))} < f˜(i) + τ then
U.union(e, ei );
r(e ∪ ei ) ← argmax{r(e), r(ei )} f˜;
ei ← e ∪ ei ;
end
end
end
end

Output: the collection of entries e of U such that f˜(r(e)) ≥ τ .

Figure 31: The algorithm copied from the journal version of [5].
3 Parameter selection
ToMATo takes in three inputs: the neighborhood graph G, the density estimator f˜, and the merging
parameter τ . Although the freedom left to the user in the choice of these inputs gives our approach

64
Figure 32: The mapper pipeline for a dense sample of the circle together with the height
function.

10.3 A First Taste of Mapper


Mapper was first introduced in [12]. We now give a very brief introduction to a simplified
version of Mapper and postpone a more thorough discussion until next week.
The idea is to start with a finite metric space P together with a function f : P → R. One
may choose f as one likes, and typical examples include density and eccentricity estimates.
Furthermore, we shall assume that R is covered by a collection of intervals I1 , I2 , . . . , Ik such
that Ii ∩ Ii+1 6= ∅ for all i < k and such that no three intervals have a common intersection.
The algorithm now proceeds as follows:

1. Let G denote the empty graph.

2. For every interval Ij cluster the points of f −1 (Ij ) according to some pre-defined clustering
algorithm. A typical choice is to consider the -neighborhood graph of f −1 (Ij ) for some
fixed  > 0.

3. For every cluster in f −1 (Ij ) add a vertex to G.

4. We draw an edge between any two vertices in G if their respective clusters have a non-
empty intersection.

Example 10.2. A simple example is shown in Fig. 32. Here we assume a dense sampling of
the circle, and the function is the height function. Observe that covering the real line with two
covering elements would result in a graph without a loop.

A more interesting example taken from [12] is shown in Fig. 33.

65
Figure 33: The mapper algorithm applied to a set of points together with a function measuring
eccentricity.
9: Refer to Section 5.3 Illustration
for details. Each takenshows
row of this image fromtwo[12].
poses of the same shape along with the Mapper
which is computed as described in Section 5.3. For each Mapper computation, we used 15 intervals in the range of the
ith a 50% overlap.
11 Week 12: Reeb Graphs and Mapper Continued
The Mapper construction introduced last week can be seen as an approximate Reeb graph.

11.1 Reeb Graphs


Let X be a topological space and f : X → R a continuous function. We define the Reeb
graph associated to the pair (X, f ) to be the quotient space R(X, f ) = X/ ∼ where ∼ is the
equivalence relation generated by x ∼ y if f (x) = f (y) = t and x and y belong to the same path
component of the fiber f −1 (t). Note that this space in general is not a graph but it will be for
reasonable pairs such as 1) M is a compact manifold and f is a generic smooth function, and
2) X is a compact polyhedron and f is a piecewise-linear map. By the following lemma from
undergraduate topology we see that f induces a well-defined continuous map fˆ: R(X, f ) → R
given by fˆ([x]) = f (x).
Lemma 11.1. Let X/ ∼ be the quotient of a topological space X by an equivalence relation
∼. Any continuous function f : X → Y which is constant on equivalence classes induces a
continuous function X/ ∼→ Y with respect to the quotient topology.
Reeb graphs were originally introduced in the context of Morse theory to study the evolution
level sets of real-valued functions.
rographics Association 2007.
Example 11.2. In Fig. 34 we see a typical example of a Reeb graph and how the graph captures
connectivity information as well as ”loops” in the original manifold. This illustrates a lemma
from [8] that says that the Reeb graph asscoiated to a closed orientable 2-manifold of genus g
has exactly g loops.
Clearly the Reeb graph loses a lot of higher-dimensional connectivity information of the
space X. It is however always true that the surjection X  X/ ∼ induces an isomorphism
H0 (X) ∼
= H0 (X/ ∼) and an epimorphism H1 (X)  H1 (X/ ∼). In particular, if X is connected
and simply-connected, then R(X, f ) must be a tree regardless of the function f .
By replacing R with Rd we can associate a Reeb space to a function f : X → Rd precisely
as we did for the Reeb graph. The resulting spaces are typically quite complicated.

11.2 The Continuous Mapper


An open cover of a topological space X is a collection U = {Ui }i∈I of open sets such that
∪i∈I Ui = X. Associated to a finite cover there is a simplicial complex N (U) called the nerve
of U containing simplices {σ ⊆ I : ∩i∈σ Ui 6= ∅}. Assuming a continuous function f : X → Rd ,
and a finite open cover U of Rd , we get a pullback cover of X defined by
f ∗ U = {f −1 (Ui ) : Ui ∈ U}.

66
Figure 34: A Reeb graph.

We can further refine the pullback cover f ∗ U by splitting every open set f −1 (Ui ) into its path
components. We denote the resulting refined cover by fd ∗ U. The (continuous) mapper
∗ U).
associated to the pair (X, f ) is the simplicial complex M (X, f ) := N (fd

Example 11.3. Fig. 35 shows a continuous map on a surface and the resulting Mapper graph.

While the resulting simplicial complex of the previous example turned out to be a graph,
that need not be the case in general. We do however have the following result:

Lemma 11.4. The dimension of M (X, f ) is bounded by the dimension of N (U).

Proof. If V and V 0 are different path-connected components of someTf −1 (Ui ) then clearly V ∩
V 0 = ∅. Let Vi be a path-component of f −1 (Ui ) and assume that m+1i=1 Vi is non-empty. By
the previous assumption we must have that each Ui is distinct, and furthermore
m+1
\ m+1
\
∅=
6 f( Vi ) ⊆ Ui .
i=1 i=1

We conclude that if M (X, f ) contains an m-simplex, then so does N (U).

We define the resolution of a cover to be res(U) = sup{diam Ui : Ui ∈ U}. One can think
mapper M (X, f ) as an approximation to R(X, f ) as the resolution of the cover goes to 0 (this
can be made precise): rather than probing the connectivity information over every fiber, we
only consider the connectivity information over preimages of (small) open sets. It is no surprise
that as long as the fibers are ”locally constant” that the Mapper graph should resemble the
Reeb graph for covers of low enough resolution. The next example illustrates this.

67
Figure 35: The mapper graph associated to a function f : X → R.

Example 11.5. Consider the Reeb graph and two mapper graphs shown in Fig. 36. The first
cover is rather coarse and fails to detect any of the two loops, whereas the cover to the right
captures the larger loop but an even smaller resolution would be needed to detect both loops.

11.3 Mapper in Practice


Given a finite set of data P together with a metric (or dissimilarity measure) between data
points, the user is typically left to decide the filter function f : P → Rd and the cover of Rd .
The outputted Mapper graph (simplicial complex) will be highly sensitive in this parameters.
Furthermore, in order to compute path components (clusters) of pre-images, there is typically
yet another parameter involved in the construction of the Mapper graph. Assuming for the
moment that f and U are provided, and that we have a way of clustering data, then the
Mapper algorithm is as follows:

Data: A data set P with a pairwise distance measure d, a function f : P → Rd


and a cover U of Rd .
Result: The mapper graph associated to (P, d).
Let K = ∅.
for U ∈ U do
Decompose f −1 (U ) into clusters CU,1 , . . . , CU,kU .
Add a vertex vU,i to K for every cluster CU,i .
end T T
if CUi1 ,j1 . . . CUim ,jm then
Add the simplex {vUi1 ,j1 , . . . , vUim ,jm } to K.
end
return K.
Algorithm 2: The Mapper algorithm.

Some remarks on the parameters in question:

The filter function f Examples of typical functions encountered in the literature.


• For data in Rd one can project down onto a lower-dimensional subspace, e.g. by means of
principal component analysis or by a non-linear dimension reduction algorithm.

68
Figure 36: Left: the Reeb graph of a pair (X, f ). Middle: the Mapper graph for a coarse cover.
Right: The Mapper graph for a cover of smaller resolution.

Figure 37: Mapper from a finite data set.

69
• Eccentricity measures, in an intuitive sense, how far from the ”center” of the data a given
point is. That is,
P r 1/r
q∈P d(p, q)
Er (p) =
N
where 1 ≤ r ≤ ∞.

• Density estimates such as Gaussian kernel,


X
δ (p) = exp(−d(p, q)2 /),
q∈P

where  > 0.

The cover U For covers of R it is customary to let U consist of regularly spaced intervals of
equal resolution, and such that neighbouring cover elements overlap with a percentage below
50%. For covers of Rd one typically considers hypercubes in the analogue way. The resulting
Mapper will in general not be graphs but for ease of visualization it is customary to merely
output the 1-skeleton. Note that the output of the algorithm is very sensitive to the chosen
cover.

Clustering The most common choices are kN N clustering, DBSCAN and a simple -neighborhood
graph. Note that one can approach the clustering problem in two ways: one can either clus-
ter all the data immediately and then computing connected components of preimages can be
done by means of standard graph algorithms. Another, more local, approach is to cluster each
preimage separately. A local computation may be a better option when dealing with very large
data.

70
Figure 38: A zigzag of simplicial complexes: K ←- K ∩ K 0 ,→ K 0 .

12 Week 13: Generalized Persistence


It is now time to look at homology groups indexed by more general posets than the linear one.

12.1 Zigzag Persistent Homology


A zigzag poset on n vertices is a partial order of the form
1 2 n−1 n
• ↔ • ↔ ··· ↔ • ↔ •

where ↔ denotes that the arrow can be either ← or →. For instance, these are both examples
of zigzag posets on n vertices:
1 2 n−1 n
• ←− • −→ · · · ←− • −→ •
1 2 n−1 n
• −→ • −→ · · · −→ • −→ •

The latter we have seen in the context of persistent homology, the former is integral in the
construction of levelset zigzag persistent homology.

Example 12.1. Let K and K 0 be two simplicial complexes indexed over the same index set
and let K ∩ K 0 denote the simplex-wise intersection. This defines a zigzag of simplicial complex

K ←- K ∩ K 0 ,→ K 0 ,

and a corresponding zigzag of vector spaces:

Hi (K) ← Hi (K ∩ K 0 ) → Hi (K 0 ).

The simplicial complexes in Fig. 38 give such an example. By choosing a basis

{{1, 2} + {1, 3} + {2, 3}, {2, 3} + {2, 4} + {3, 4}}

for H1 (K ∩ K 0 ), we get
[1,0] [0,1]
   
1 1
Z2 ←−− Z2 ⊕ Z2 −−→ Z2 = Z2 ←
− Z2 → 0 ⊕ 0 ← Z2 →
− Z2 .

The previous example illustrates the important fact that zigzag modules too have a well-
defined barcodes. For a zigzag on n vertices, let [a, b] denote the restriction of the poset to all
vertices i ∈ [a, b]. The associated interval module I [a,b] is defined by
(
[a,b] k if i ∈ [a, b]
Ii = ,
0 otherwise

71
[a,b] [a,b]
together with the identify morphism id : Ii → Ij whenever i, j ∈ [a, b]. E.g. if n = 4, and
the arrows alternate, then I [2,3] is the persistence module
1
0→k←
− k → 0.
We state the following result without proof. A proof can be obtained by a variation of the proof
of Theorem 6.16.
Theorem 12.2. Let V be a zigzag module on n vertices such that dim Vp < ∞ for all p ∈ [n].
Then
V ∼
M
= I [a,b]
[a,b]∈B(V )

where B(V ) is a multiset of intervals in [n] called the barcode of V .

12.1.1 Levelset Zigzag Persistent Homology


The persistent homology of a continuous function f : X → R studies the evolution of the
homology of the sublevel sets. An alternative approach would be to study how the homology
changes across the levelsets f −1 (t) as the parameter t sweeps over the real line. Consider
for instance the topological space in Fig. 39 with the real function being projection onto the
horizontal axis. We notice two properties of the function:
• f −1 (ai , ai+1 ) is homeomorphic to f −1 (si+1 ) × (ai , ai+1 ) with f being the projection onto
the second component,
• f −1 (si , si+1 ) deformation detracts onto f −1 (ai+1 ).
In particular, we can study the evolution of the homology of the levelsets by applying homology
to the following zigzag of topological spaces:

f −1 (−∞, s1 ] f −1 [s1 , s2 ] f −1 [s2 , s3 ] f −1 [s3 , s4 ] f −1 [s4 , ∞)

f −1 (s1 ) f −1 (s2 ) f −1 (s3 ) f −1 (s4 )

Proceeding in H0 with the ”obvious basis” we get the following zigzag of vector spaces

Z2 ⊕ Z2 Z2 Z2 Z2 Z2
[1,1] 1 [1,1] 1
I2 1 [1,1] 1
Z2 ⊕ Z2 Z2 Z2 ⊕ Z2 Z2

For each copy of Z2 ⊕ Z2 above, we replace current basis {v1 , v2 } with the basis {v1 , v1 + v2 }.
The zigzag then diagonalizes as

Z2 ⊕ Z2 Z2 Z2 Z2 Z2
[1,0] 1 [1,0] 1
I2 1 [1,0] 1
Z2 ⊕ Z2 Z2 Z2 ⊕ Z2 Z2

which is the direct sum of the following three zigzags:

Z2 Z2 Z2 Z2 Z2
1 1 1 1
1 1 1 1
Z2 Z2 Z2 Z2

72
Z2 0 0 0 0
0
1
Z2 0 0 0

0 0 0 0 0

0 0 Z2 0

The corresponding bars will all be given in terms of the critical values ai : For the first zigzag the
feature is generated over f −1 (−∞, s1 ] ' f −1 (ai ) and it lives up to and including f −1 [s4 , ∞) '
f −1 (a5 ). Therefore we identify this feature with the interval [a1 , a5 ]; this represents the global
connected component of the topological space. For the second zigzag we have an interval module
generated over f −1 (−∞, s1 ] ' f −1 (ai 1 which vanishes as it enters f −1 [s1 , s2 ] ' f −1 (a2 ). This is
identified with the half-open interval [a1 , a2 ) and represents one of the two ”legs” living over the
interval [a1 , a2 ). Lastly we have an interval which lives over f −1 (s3 ) and vanishes as it enters
f −1 [s2 , s3 ] ' f −1 (a3 ) and f −1 [s3 , s4 ] ' f −1 (a4 ). Hence, this yields an interval (a3 , a4 ) and its
geometrical interpretation is clear from the figure. Denoting the resulting barcode by ZZ0 (f )
we have shown that
ZZ0 (f ) = {[a1 , a5 ], [a1 , a2 ), (a3 , a4 )}.
And for H1 (exercise)
ZZ1 (f ) = {[a1 , a5 ), [a1 , a2 ], [a3 , a4 ]}.
What about sublevel persistent homology? The intervals in dimension 0 and dimension 1 are,
respectively

{[a1 , ∞), [a1 , a2 )} and {[a1 , ∞), [a1 , a5 ), [a3 , ∞), [a4 , ∞)}.

These two barcodes seem closely related. We now state a theorem which makes this connection
precise.

Theorem 12.3 (See [4]). The sublevel set barcode in dimension n is given as may the following
union:

{[ai , aj ) : [ai , aj ) ∈ ZZn (f )} ∪ {[ai , ∞) : [ai , aj ] ∈ ZZn (f )} ∪ {[aj , ∞) : (ai , aj ) ∈ ZZn−1 (f ).}

Hence, levelset zigzag persistent homology contains strictly more information. Assuming
functions of morse type - i.e. that the function has a finite set of critical value as in the previous
example - one also has the following stability theorem.

Theorem 12.4. Let f, g : X → R, and assume that dim Hi (f −1 (t)), Hi (g −1 (t)) < ∞ for all
t ∈ R. Then
dB (ZZn (f ), ZZn (g)) ≤ ||f − g||∞ .

Much more can be said about levelset zizag persistent homology, but we will not pursue
this.

12.1.2 Reeb Graphs


For Reeb Graphs the intervals in the levelset zigzag barcode have a clear geometric interpreta-
tion. We illustrate this with an example.

73
X1 o / ... o / Xk−2 o / U o / Xk+2 o / ... o / Xn
dJJJ
JJ ttt: V
tt
U∩V

Figure 1: Diagram for the Mayer–Vietoris Diamond Principle.

he kernel of Hp (U ∩ V) → Hp (U) ⊕
morphism is given by the connecting α δ
he Mayer–Vietoris theorem.
γ ζ
our principal application, consider a
nd a continuous function f : X → R. β 
levelsets Xt = f −1 (t) for t ∈ R, and
r intervals I ⊂ R. We suppose that f
e. By this, we mean that there is a
d indices a1 < a2 < · · · < an called a1 s1 a2 s2 a3 s3 a4 s4 a5
at over each open interval
n , ∞)
a1 , a2 ), . . . , (an−1 , an ), (aFigure [X10 , space
39: A topological X11 ] [X33horizontal
projected onto the , X33 ] axis. Copied from [4].
orphic to a product of the form Y × I, H0 : [X10 , X54 ]
ection onto the factor I. Moreover,
Y × I → XI should Example
extend to a12.5.
con- Consider the Reeb graph shown in Fig. 40. It has 7 critical points valued
→ XI¯, where I¯ is the
a1closure
< a2 of< Ia⊂ R.
3 < a4 . Choosing values si such that ai < si < ai+1 yields the following zigzag of
at each slice Xt has finitely-generated
topological spaces: [X10 , X21 ] [X32 , X43 ]
H1 : [X10 , X44 ]
compact manifold and f is a Morse
f −1 (−∞, s1 ] f −1 [s1 , s2 ] f −1 [s2 , s3 ] f −1 [s3 , ∞)

Figure−12: Morse function on a 2-manifold−1with


an open manifold which is compact- f (s ) f −1 (s2 ) f (s3 )
boundary,1 with levelset zigzag persistence intervals
and f is a proper Morse function with in H0 and H1 .
oints. Applying H then produces the following zigzag of vector spaces:
0
critical value ai . Each Xii is labelled by the regular interval
an arbitrary zigzag diagram of spaces that contains it: 1 1 0
Z2 ⊕ Z2 0
Z2 1 n−1 Z2 ⊕n Z2 Z2 ⊕ Z2
X X 0 0 Xn−1 Xn
 
[1,1] 0 1 · · · 1 I2
f1 g2 fn−1 gn (−∞, a1 ) [1,1,1] (a1 , a2 ) · · · (an−1 , an ) (an , ∞) I
→ Z2 ← · · · → Zn−1 ← Yn I2 2
Zigzag
Z2 ⊕ Z2 persistence intervals
Z2 ⊕ Zof X are then labelled by tak- Z2 ⊕ Z2
2 ⊕ Z2
ing the union of the labels of the terms Xii and Xii−1 over
which they are supported. Thus each persistence interval
∪g1 . . . ∪fn−1 ZnThe Yn × [an , ∞)barcode is: ZZ (f ) = {[a , a ], [a , a ), (a , a ], (a , a )} with the interpretation
∪gn associated
is labelled 0by an open,1 closed 4 or
1 half-open
2 2 interval
4 2 of3the
cylinders on the Yi to the spaces Zi , real line. Practically, we translate between X notation and
• [a1 ,factor
projection onto the interval a4 ]: the
of global connected
critical value notationcomponent.
as follows:
j
ˆ i
X , Xj−1
˜
↔ [ai , aj ] for 1 ≤ i ≤ j ≤ n,
• [a1 , a2 ): the downwardˆ i−1i facing
j−1
˜ branch.
e type, select a set of indices si which X i−1 , X j−1 ↔ [ai , aj ) for 1 ≤ i < j ≤ n + 1,
ˆ i j ˜
Xi , Xj−1 ↔ (ai , aj ] for 0 ≤ i < j ≤ n,
• (a2 , a4 ]: the upwardˆ facing branch.
Xii , Xj−1
˜
j−1 ↔ (ai , aj ) for 0 ≤ i < j ≤ n + 1.
< a2 < · · · < sn−1 < an < sn < ∞
• (a2 , a3 ): the loop.
We interpret a0 = −∞ and an+1 = +∞ in this scheme. In
ram this way we get infinite and semi-infinite intervals. These
← X11 → X21 ← · · · → Xn The interpretation
n doofnotdifferent
occur iftypesX00 = of Xnnintervals
= ∅, which as particular
is the case graph
if X is theoretic features holds
n−1 ← Xn ,
constructed from a function on a compact space
for Reeb graphs in general. While different (=non-isomorphic) Reeb graphs may exhibit the X.
e levelset zigzag persistence of (X, f ) Each interval, of any of the four types, may be labelled by
zag persistence of thesame barcode,
above sequence.the associated bottleneck
the corresponding pointdistance
(ai , aj ) ∈still
R2 .provides an efficiently
The aggregation of computable similar-
ity measure.
of the choice of intermediate values si ,This contrasts the more discriminative distances
these points — taken with multiplicity and labelled by type - such as an interleaving distance
structure betweenfor critical values. To and homological dimension
Reeb graphs - which are generally NP-hard to compute. — together with all points on the
ence on critical values, we adopt the diagonal in every dimension taken with infinite multiplicity
vention. Each Xii−1 is labelled by the is called the levelset zigzag persistence diagram DgmZZ(f ).
12.2 Multiparameter Persistent Homology
Persistent homology is stable with respect to perturbation, but at the same time highly sensitive
to noise and outliers. Take for instance the noisy sample of a circle depicted in Fig. 41: its
associated barcode in dimension 1 will exhibit no significant features. One could attempt to
rectify that by restricting to data points with a local density estimate greater than a predefined
threshold δ. However, the resulting barcode would be highly sensitive to the choice of δ: chosen
too large and there won’t be enough points to cover a circle, chosen too small and the data will
be too noisy.

74
Figure 40: A Reeb graph.

Another approach would be to consider all possible density thresholds at once and construct a
P -module where P is a grid. That is the idea behind multiparameter persistent homology.
Define [n] × [m] to be the partially ordered set consisting of pairs (i, j) ∈ [n] × [m] and
(i, j) ≤ (i0 , j 0 ) if and only if i ≤ i0 and j ≤ j 0 . E.g. [3] × [2] is the following grid:

• • •
.
• • •

Let (Q, d) be a finite metric space and let f : Q → R be any function. For a collection
of function thresholds δ1 > . . . > δm and distance thresholds 1 < 2 < . . . < n we get an
[n] × [m]-module M by defining

Mi,j = Hl (VRi (f −1 [δj , ∞)))

and where the map Mi,j → Mi0 ,j 0 is induced in homology by the inclusion

VRi (f −1 [δj , ∞)) ,→ VRi0 (f −1 [δj 0 , ∞)).

Example 12.6. Let Q = {q1 , q2 , q3 } with pairwise distances d(q2 , q3 ) < d(q1 , q3 ) = d(q1 , q2 )
and f (q1 ) = f (q2 ) > f (q3 ), as depicted in Fig. 42. The resulting [3] × [2]-module in 0-dimension
homology is:
 
1 0 0
 
0 1 1 [1,1]
span{q1 , q2 , q3 } span{q1 , q2 } span{q1 }
 
1 0  
  1 0
0 1     1
0 1
 
1 0
0 0  
0 1 [1,1]
span{q1 , q2 } span{q1 , q2 } span{q1 }

75
Figure 41: Noisy circle.

Figure 42: Bifiltration

By an appropriate change of basis this diagram transforms to:


 
1 0 0
 
0 1 0 [1,0]
span{q1 , q1 + q2 , q2 + q3 } span{q1 , q1 + q2 } span{q1 }
 
1 0  
  1 0
0 1     1
0 1
 
1 0
0 0  
0 1 [1,0]
span{q1 , q1 + q2 } span{q1 , q1 + q2 } span{q1 }

which is isomorphic the direct sum of the following three modules:


1 1 1
Z2 Z2 Z2 Z2 Z2 0 Z2 0 0
1 1 1 , 1 1 ,
1 1 1
Z2 Z2 Z2 Z2 Z2 0 0 0 0

76
Figure 43: Bifiltration

With the previous example fresh in mind one may be tempted to conjecture that one can
decompose multiparameter peristence modules into simple components as in Theorem 12.2.
That turns out to be very far from the truth.

Example 12.7. By applying H1 to the diagram depicted in Fig. 43 one arrives at the following
commutative diagram of vector spaces

Z2 0 0
[0,1]
[1,1]
Z22 Z2 0
I2 [1,1]
I2 [1,0]
Z22 Z22 Z2

One can show that this diagram is indecomposable: no matter what change of basis you perform,
the diagram will not split up into simpler components.

The previous example illustrates an algebraic fact that makes multiparameter persistent
homology significantly more involved than the one-parameter case. While it follows from 6.12
that any [n] × [m]-module decomposes into a direct sum of indecomposable modules, one does
not have a reasonable way of parametrizing all the indecomposable representations which could
potentially arise 4 . Granted, for a specific module M , one can decompose M into its indecom-
posable summands (up to isomorphism). How to use such indecomposable modules in data
analysis is not clear and is an active topic of research.

12.2.1 RIVET
Rather than seeking to understand the full complexity of multiparameter persistence modules,
one can study them through the lens of restrictions to linear subposets. Specifically, assuming
that M is an R2 -indexed persistence module, we can restrict M to an arbitrary straight line L
in the plane with non-negative slope. The restricted module M |L has a well-defined barcode by
means of Theorem 6.18, assuming that the vector space dimensions are finite. As L ranges over
all valid lines we can gain valuable insight the underlying 2-parameter persistence module M .
RIVET (the Rank Invariant Visualization and Exploration Tool) [13] allows for the visu-
alization and analysis of two-parameter persistence modules, and arguably its main feature is
the fast computation of M |L for all lines L. The algorithm is rather involved and requires a
discussion of commutative algebra beyond the scope of this course.
4
A so-called wild quiver.

77
(a) All points (b) Density at least 10. (c) Density at least 18.

Figure 44: See example.

(a) The barcode along a slanted


(b) Density at least 10. (c) Density at least 18.
line.

Figure 45: See example.

Example 12.8. Let Q be the points in Fig. 41 and let f : Q → R be the function which for
each point q counts the number of data points within unit distance. Associated to this data
RIVET considers the R2 -indexed persistence module M given by
M(s,t) = VRt (f −1 [s, ∞)).
Be aware that the density filtration takes place in the horizontal direction, and that the scale
parameter in RIVET - as in Ripser - is twice the one in the definition of the Vietoris–Rips
complex used in these notes. Consider the subset of Q admitting a local density estimate at
least 18, as seen in Fig. 44c. Its associated barcode in the Rips filtration is displayed along
the thick blue line in Fig. 45c. We see that there is a short bar generated at a fairly large
scale corresponding to the scale at which the right-end of the point cloud connects. For a much
cleaner barcode we consider all the points with local density estimate at least 10, as shown in
Fig. 44b together with its barcode in Fig. 45b. It is often more fruitful to consider the barcode
along a slanted line; see Fig. 45a. RIVET updates the barcode in real-time as the user modifies
the slope and intercept.

12.2.2 Distances
With the failure of a barcode-like decomposition for multiparameter persistence module the
question of how to compare modules arises. We now give an informal introduction to two

78
well-studied distances in the context of multiparameter persistent homology.

The matching distance Let L be a line with positive slope in R2 and let M and N be
R2 -indexed persistence modules satisfying dim M(s,t) < ∞ and dim N(s,t) < ∞ for all (s, t).
Assuming that L is described by ax + b for some a > 0, we define the distance between M and
N along L to be the following weighted bottleneck distance:

F M,N (L) = w(L)dB (M |L , N |L )

where w(L) is given by 


1
√
1+a2
a≥1
w(L) := 1 .
q 1 a≤1
1+ 2
a

We define the matching distance by:

dmatch (M, N ) = sup F M,N (L).


L

Remark 12.9. The introduction of a weight in the supremum is order to make sure that the
distance is ”stable” in a precise way. We omit the details.
While the matching distance can be approximated efficiently, a major drawback is that it is
a rather insensitive distance measure.

The interleaving distance We follow the definition of an interleaving in 9.10 Define the
-shift of an R2 -indexed persistence module M to be the persistence module M  defined by

M(s,t) = M(s,t)+(,) and M  ((s, t) ≤ (s0 , t0 )) = M ((s, t) + (, ) ≤ (s0 , t0 ) + (, )) for all (s, t) ≤
(s0 , t0 ) ∈ R2 . If f : M → N is a morphism, then we get an -shifted morphism f  : M  → N 
defined by f(s,t)  : M → M  be the morphism whose restriction to each
= f(s,t)+(,) . Let ηM
M(s,t) is the internal morphism M ((s, t) ≤ (s, t) + (, )).
Definition 12.10. Given  ∈ [0, ∞), an -interleaving between M and N is a pair of mor-
2 and ψ  ◦ ϕ = η 2 . We say that M
phisms ψ : M → N  and ϕ : N → M  such that ϕ ◦ ψ = ηM N
and N are -interleaved.
This definition generalizes to more parameters in a straightforward way.
Michael Lesnick[9] showed that the interleaving distance is the most discriminative and
stable distance measure on multiparameter persistence modules5 . Unfortunately, it turns out
that its computation is NP-hard.
Theorem 12.11 (Bjerkevik-Botnan-Kerber[3]). It is NP-hard to approximate the interleaving
distance within a factor of 3.
The proof proceeds by a reduction from the following problem which is subsequently shown
to be NP-complete: let A and B be n × n-matrices and assume that a pre-assigned subset of
the indices of A and B are set 0. Is it possible to fill in the remaining indices such that the
resulting product AB is the identify matrix In ?
Example 12.12. Let    
∗ ∗ ∗ ∗ ∗ ∗
A = ∗ 0 ∗ B = ∗ ∗ 0 .
∗ ∗ 0 ∗ 0 ∗
5
Assuming the field is Zp or Q.

79
In this case the decision problem has a positive answer:
   
1 1 1 −1 1 1
1 0 1 ·  1 −1 0  = I3 .
1 1 0 1 0 −1

80
13 Week 14: dI = dB
In this section we will prove Theorem 9.13 by showing that dI ≤ dB and dB ≤ dI . The former
inequality first appeared in [9] and is rather straightforward. For the latter we will be following
the work of Bjerkevik [2]. Other proofs do exist in the literature but we will focus on this
particular approach because 1) it is combinatorial in nature, 2) it generalizes to multiparameter
modules in a way that other approaches do not. We shall however work under the additional
assumption of a finite number of intervals. This is just for notational simplicity as essentially
the same proof works in the more general setting of Theorem 9.13.
In the second part of the proof we shall make two additional assumptions for the sake of
brevity:

1. All the intervals have finite support.

2. Every interval is of the form [a, b).

Under the assumptions of a finite number of intervals, the first of these can be made without
loss of generality. Indeed, one can replace infinite intervals with intervals of the form [−u, b),
[u, ∞) and [−u, u) for u sufficiently large. The latter assumption can also be made without loss
of generality as the following lemma shows.

Lemma 13.1. Let M ∼


= ⊕ha,bi∈B(M ) I ha,bi and let M
c = ⊕ha,bi∈B(M ) I [a,b) . Then

dB (B(M ), B(M̂ )) = 0, dI (M, M


c) = 0.

Proof. Exercise.

Hence, from the triangle inequality it follows that dB (B(M ), B(N )) = dB (B(M
c), B(N
b ))
and dI (M, N ) = dI (M
c, N
b ).

13.1 dI ≤ dB
Recall that for an interval J ⊆ R we have the interval module I J defined by
(
k if t ∈ J
ItJ = ,
0 otherwise.

and with I J (t ≤ t0 ) the identity morphism whenever t, t0 ∈ J.

Lemma 13.2. Let J and K be intervals in R. Then,

dB ({J}, {K}) = dI (I J , I K ),

and
dB ({J}, ∅) = dI (I J , 0).

Proof. Exercise.

Lemma 13.3. If M and N are -interleaved, and M 0 and N 0 are -interleaved, then M ⊕ M 0
and N ⊕ N 0 are -interleaved.

81
Proof. Let f : M → N  and g : N → M  , and f 0 : M 0 → (N 0 ) and g 0 : N 0 → (M 0 ) constitute
-interleavings. We thus get morphisms
 
f 0
: M ⊕ M 0 → N  ⊕ (N 0 )
0 f0

and  
g 0
: N ⊕ N 0 → M  ⊕ (M 0 ) .
0 g0
It remains to check that they constitute an -interleaving. That is straightforward:
         2 
g 0 f 0 g ◦f 0 ηM 0 2
· = = = ηM ⊕M 0 .
0 (g 0 ) 0 f0 0 (g 0 ) ◦ f 0 2
0 ηM 0

Likewise,     
f 0 g 0 2
· = ηN ⊕N 0 .
0 (f 0 ) 0 g0

Combining the two previous lemmas we arrive at our result:

Theorem 13.4. Let B(M ) and B(N ) be a finite multisets of intervals. Then dI (M, N ) ≤
dB (B(M ), B(N )).

Proof. Let χ be a matching between dB (B(M ), B(N )) with cost c(χ) = . If J ∈ B(M )
is matched to K ∈ B(N ), then dB ({J}, {K}) ≤ C(J, K) = , and by Lemma 13.2 there is
an ( + δ)-interleaving between I J and I K for an arbitrary small δ > 0. Likewise, if J ∈
B(M ) ∪ B(N ) is unmatched, then I J is ( + δ)-interleaved with the 0-module for an arbitrary
small δ > 0. Hence, by invoking Lemma 13.3 we conclude that
   
0
M∼
M M M M
= IJ   IJ  0
J ∈ B(M ) matched J 0 ∈ B(M ) unmatched

is ( + δ)-interleaved with
   
0
N∼
M M M M
= IK 0  IJ 
K ∈ B(N ) matched K 0 ∈ B(N ) unmatched

Since δ > 0 is arbitrary small, it follows that dI (M, N ) ≤ .

The more general case where B(M ) and B(N ) contain an infinite number of intervals follows
by showing that Lemma 13.3 generalizes to arbitrary direct sums. We leave that as an exercise.

13.2 dB ≤ dI
In the following, every interval is assumed to be of the form [a, b) for b < ∞.

Lemma 13.5. If I1 = [a1 , b1 ) and I2 = [a2 , b2 ) are intervals and f : I I1 → I I2 is non-zero, then
a2 ≤ a1 and b2 ≤ b1 .

82
Proof. Assume a2 > a1 . The following diagram must necessarily commute for any t ∈ [a1 , b1 ):

IaI11 = k 1
ItI1 = k
fa1 ft

IaI12 = 0 0
ItI2 .

Since the morphism fa1 = 0, it follows that ft = 0. Hence f is the zero-morphism. A similar
argument shows that b2 ≤ b1 .

Lemma 13.6. Any morphism f : I [a1 ,b1 ) → : I [a2 ,b2 ) is determined by fa1 ∈ k.

Proof. The morphism is trivial outside of [a1 , b2 ) by the previous lemma. For any t ∈ [a1 , b2 )
we have the following commutative diagram

[a ,b1 ) 1 [a1 ,b1 )


Ia11 =k It =k
fa1 ft

[a ,b2 ) 1 [a1 ,b2 )


Ia11 =k It = k.

Hence ft = fa1 .

For an interval I = [a, b) define α(I) = a + b. This defines a preorder on intervals: I ≤α J


if α(I) ≤ α(J).

Lemma 13.7. Let I1 , I2 and I3 be intervals, α(I1 ) ≤ α(I3 ), and 0 6= f : I I1 → (I I2 ) and


0 6= g : I I2 → (I I3 ) . Then I I2 is -interleaved with I I1 or I I3 .

Proof. Write I1 = [a1 , b1 ), I2 = [a2 , b2 ) and I3 = [a3 , b3 ). From Lemma 13.5,

a2 ≤ a1 + 
b2 ≤ b1 + .

Assume that I I1 and I I2 are not -interleaved. The modules I [a1 ,b1 ) and I [a2 ,b2 ) are -interleaved
if |a1 − a2 | ≤  and |b1 − b2 | ≤ , and thus we may assume that a2 < a1 −  or b2 < b1 − .
Assuming the former:

α(I1 ) = a1 + b1 > a2 +  + b1 ≥ a2 + b2 = α(I2 ),

and assuming the latter:

α(I1 ) = a1 + b1 > a1 + b2 +  ≥ a2 + b2 = α(I2 ).

In either case, α(I1 ) > α(I2 ). Assuming that I I2 and I I3 are not -interleaved and by substi-
tuting I2 for I1 , and I3 for I2 in the above argument, we get α(I2 ) > α(I3 ). In conclusion:

α(I1 ) > α(I2 ) > α(I3 ),

a contradiction.

Lemma 13.8. Let I1 = [a1 , b1 ), I2 = [a2 , b2 ) and I3 = [a3 , b3 ) be such that b1 − a1 > 2,
b3 − a3 > 2 and α(I1 ) ≤ α(I3 ). If 0 6= f : I I1 → (I I2 ) and 0 6= g : I I2 → (I I3 ) . Then
g  ◦ f 6= 0.

83
Proof. Applying Lemma 13.5 twice,

a3 ≤ a1 + 2 b3 ≤ b1 + 2.

Assuming for the sake of contradiction that g  ◦ f = 0, we must have that

[a1 , b1 ) ∩ [a3 − 2, b3 − 2) = ∅,

and thus b3 ≤ a1 + 2. Hence, b1 > a1 + 2 ≥ b3 > a3 + 2, where the first and last inequalities
follow from the assumptions of the lemma. In particular, a1 > a3 and b1 > b3 . We conclude
that
α(I1 ) = a1 + b1 > a3 + b3 = α(I3 ).
A contradiction.

For an interval J ∈ B(M ) let µ(J) := {K ∈ B(N ) : I J and I K are -interleaved}, and for a
collection of intervals A ⊆ B(M ) let µ(A) = ∪J∈A µ(J).

Lemma 13.9. Assume that M and N are -interleaved, and let A ⊆ B(M ) be a collection of
intervals {[aj , bj )} satisfying bj > aj + 2. Then

|A| ≤ |µ(A)|.

Before proving this lemma we need to introduce some notation. Assume that M = ⊕I∈B(M ) I I
and N = ⊕J∈B(N ) I J , and let ιM I N J
I : I ,→ M and ιJ : I ,→ N denote the obvious inclusions.
Dually, we also have projections πIM : M  I I and πJN : N  I J . For a morphism f : M → N 
we let f |I = f ◦ιM N  M 
I and fI,J = (πJ ) ◦f ◦ιI , and similarly we define g|J and gJ,I for g : N → M .
2 M 2 2 M
Observing that ηI is equal to the composition (πI ) ◦ ηM ◦ ιI , we arrive at the following
commutative diagram whenever f and g constitute an -interleaving
f g
M N M 2
ιM
I (πIM )2
η 2I
II I
(I I )2

Using the aforementioned notation we see that we can rewrite this as:

ηI2I = (πIM )2 ◦ g  ◦ f |I (7)


 
X
= (πIM )2 ◦  g|J ◦ πJN  ◦ f |I (8)
J∈B(N )
X
= (πIM )2 ◦ (g|J ) ◦ (πJN ) ◦ f |I (9)
J∈B(N )
X

= gJ,I ◦ fI,J . (10)
J∈B(N )

Furthermore, by definition of a direct sum, 0 = (πIM0 )2 ◦ ηM 2 ◦ ιM whenever i 6= i0 . In turn,


I
X

0= gJ,I 0 ◦ fI,J . (11)
J∈B(N )

84
Proof of Lemma 13.9. Order the elements of A = {I1 , . . . , Ir } such that α(Ii ) ≤ α(Ii0 ) for i ≤ i0 ,
and let µ(A) = {J1 , . . . , Js }. By combining Lemma 13.7 with Eq. (10), we arrive at
X X
 
ηI2I = gJ,I ◦ fI,J = gJ,I ◦ fI,J
J∈B(N ) J∈µ(A)

This is true because fI,J = 0 or gJ,I = 0 for every J 6∈ µ(I). Likewise, assuming i < i0 ,
Lemma 13.7 together with Eq. (11) yield
X X
 
0= gJ,Ii 0
◦ fI i ,J = gJ,Ii0
◦ fIi ,J .
J∈B(N ) J∈µ(A)

For I = [a, b) ∈ A, Lemma 13.6 states that every morphism h : I I → I K is determined by


 ) = w(f
the constant ha . Let w(h) ∈ k denote this constant. Clearly, w(fI,J 0
I,J ). If i ≤ i , then
Lemma 13.8 asserts that
 
w(gJ,Ii0
◦ fIi ,J ) = w(gJ,Ii0
) · w(fIi ,J ) = w(gJ,Ii0 ) · w(fIi ,J ).

Hence, X
1 = w(ηI2I ) = w(gJ,I ) · w(fI,J )
J∈µ(I)

and X
0= w(gJ,Ii0 )· w(fIi ,J )
J∈µ(I)

for i < i0 . Putting this in matrix form:

? ···
 
    1 ? ?
w(gJ1 ,I1 ) · · · w(gJs ,I1 ) w(fI1 ,J1 ) · · · w(fIr ,J1 )
.. .. .. ..
0 1 ? ··· ?
.. · .. = .. 
     
. . . . . . . .
0 .. ..

0 .
w(gJ1 ,Ir ) · · · w(gJs ,Ir ) w(fI1 ,Js ) · · · w(fIr ,Js )
0 0 0 ··· 1

where we the products on the upper diagonal are unknown. The right hand side has rank
r = |A|, whereas the the rank of the left hand side is bounded by s = |µ(A)|. We conclude that
|A| ≤ |µ(A)|.

It turns out that the previous lemma together with Hall’s theorem proves that dI ≤ dB .

13.2.1 Hall’s Theorem


Consider a hypothetical course where students have to present a particular paper, but no two
students can work on the same paper. Each student naturally has a preference, and the problem
is whether or not one can assign papers such that all students are satisfied. Let P denote the
set of papers and let Aj ⊆ P denote the set of paper student j would like to study.

Example 13.10. Let P = {1, 2, 3, 4, 5} and A1 = {1, 2, 3}, A2 = {1, 4, 5} and A3 = {3, 5}. In
this case Student 1 can work on Paper 1, Student 2 can work on Paper 4 and Student 3 can
work on Paper 5.

Example 13.11. Let P = {1, 2, 3, 4, 5} and A1 = {2, 3, 4, 5}, A2 = {4, 5}, A3 = {4} and
A5 = {5}. In this case no assignment is possible.

85
Let G be a bipartite graph on sets X and Y , and for a subset of vertices X 0 ⊆ X,
NG (X 0 ) = {w ∈ G : there is an edge between w and v ∈ X 0 }.
Theorem 13.12 (Hall’s Theorem). The following two are equivalent:
1. There exists an injection χ : X ,→ Y such that χ(v) = w only if there is an edge between
v and w.
2. |X 0 | ≤ |NG (X 0 )| for all X 0 ⊆ X.

Example 13.13. Returning to Example 13.11 we see let X = {S1 , S2 , S3 , S4 , S5 } and Y =


{1, 2, 3, 4, 5}, and we connect Si ∈ X with j ∈ Y if j ∈ Ai . There is no way of assigning papers
as 3 = |{S3 , S4 , S5 }| > |NG ({S3 , S4 , S5 })| = |{4, 5}| = 2.

13.2.2 Wrapping Up
Let B(M )2 = {[a, b) ∈ B(M ) : b − a > 2} and B(N )2 = {[a, b) ∈ B(N ) : b − a > 2}.
Recalling the definition of the cost of a matching from Eq. (5), we see that for intervals I and J
dB ({I}, {J}) = min{max{c(I), c(J)}, c(I, J)}.
If I ∈ B(M )2 or J ∈ B(M )2 and dB ({I}, {J}) = dI (I I , I J ) ≤ , it must thus be true that
c(I, J) ≤ .
Theorem 13.14. Let B(M ) and B(N ) be finite multisets of finite intervals. Then,
dB (B(M ), B(N )) ≤ dI (M, N ).
Proof. Assume that M and N are -interleaved. Combing Lemma 13.9 with Theorem 13.12 we
get injections χ1 : B(M )2 ,→ B(N ) and χ2 : B(N )2 ,→ B(M ) such that
χ1 (I) = J ⇒ I I and I J are -interleaved
χ2 (J) = I ⇒ I I and I J are -interleaved.
In either case, c(I, J) ≤ .
We now explain how these combine to yield a matching χ between B(M ) and B(N ) with
cost at most . Form a bipartite graph G with vertex set B(M ) t B(N ) and with a directed
edge from I → J if χ1 (I) = J or χ2 (I) = J. Note that there is a directed edge going out of any
interval in B(M )2 ∪ B(N )2 .
We define a matching for each connected component Ci of G as follows:
1. If Ci forms a directed cycle, add (I, χ1 (I)) to χ for all I ∈ Ci ∩ B(M ). This matches every
element of Ci , and c(I, χ1 (I)) ≤ .
2. If Ci does not form a directed cycle, then Ci must contain an initial interval J and a
terminal interval K. If J ∈ B(M ), then add (I, χ1 (I)) to χ for all I ∈ Ci ∩ B(M ).
Otherwise, add (χ2 (I), I) to χ for all I ∈ Ci ∩ B(N ). This matches all intervals in
Ci with the possible exception of K. As K is not the source of a directed edge, K ∈
B(M ) \ B(M )2 ∪ B(N ) \ B(N )2 . Therefore K can be left unmatched at a cost of
c(K) ≤ .
The resulting matching χ between B(M ) and B(N ) is an -matching. We conclude that
dB (B(M ), B(N )) ≤ dI (M, N ).

86
References
[1] Ulrich Bauer. Ripser: efficient computation of vietoris-rips persistence barcodes. arXiv
preprint arXiv:1908.02518, 2019.

[2] Håvard Bakke Bjerkevik. Stability of higher-dimensional interval decomposable persistence


modules. arXiv preprint arXiv:1609.02086, 2016.

[3] Håvard Bakke Bjerkevik, Magnus Bakke Botnan, and Michael Kerber. Computing the
interleaving distance is np-hard. Foundations of Computational Mathematics, pages 1–35,
2019.

[4] Gunnar Carlsson, Vin De Silva, and Dmitriy Morozov. Zigzag persistent homology and real-
valued functions. In Proceedings of the twenty-fifth annual symposium on Computational
geometry, pages 247–256, 2009.

[5] Frédéric Chazal, Leonidas J Guibas, Steve Y Oudot, and Primoz Skraba. Persistence-based
clustering in riemannian manifolds. Journal of the ACM (JACM), 60(6):1–38, 2013.

[6] Vin De Silva and Robert Ghrist. Coordinate-free coverage in sensor networks with
controlled boundaries via homology. The International Journal of Robotics Research,
25(12):1205–1222, 2006.

[7] Vin De Silva and Robert Ghrist. Homological sensor networks. Notices of the American
mathematical society, 54(1), 2007.

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

[9] Michael Lesnick. The theory of the interleaving distance on multidimensional persistence
modules. Foundations of Computational Mathematics, 15(3):613–650, 2015.

[10] James R Munkres. Elements of algebraic topology. CRC Press, 2018.

[11] Steve Y Oudot. Persistence theory: from quiver representations to data analysis, volume
209. American Mathematical Society Providence, 2015.

[12] Gurjeet Singh, Facundo Mémoli, and Gunnar E Carlsson. Topological methods for the
analysis of high dimensional data sets and 3d object recognition. In SPBG, pages 91–100,
2007.

[13] The RIVET Developers. Rivet. https://github.com/rivetTDA/rivet, 2020.

87

You might also like