Lecture Notes
Lecture Notes
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
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
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
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 σ.
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.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?).
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.
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
= r2 − 0 + r2 = 2r2 .
We conclude that s
d
r≤ · diam Q.
2(d + 1)
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:
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?).
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.
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.
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.
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.
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:
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
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 .
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.
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:
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 ]}.
denote the boundary operator represented in the standard basis given by the simplices of all
dimensions.
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}.
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.
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
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
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).
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.
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.
19
Figure 9: A simplicial complex together with its first two barycentric subdivisions.
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.
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 |.
Hence, h∗ is an isomorphism.
20
Figure 10: A homotopy between two functions f and g.
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:
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.
which is (isomorphic to) the abstract simplicial complex associated to the boundary of a 2-
simplex. Clearly, F1 ∪ F2 ∪ F3 ' |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 ))
such that ∂n ◦ ∂n+1 = 0. Hence, we get associated relative homology groups given by
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:
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 .
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].
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).
z
(|R|, |F ]) (R2 , ∂D)
z
But then we get the following diagram in homology where the top arrow is non-zero,
z∗
H2 (|R|, |F ]) H2 (R2 , ∂D)
z∗
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.
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).
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.
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δ+ )).
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
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.
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
we get the following commutative diagram of vector spaces and linear morphisms
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
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
33
Figure 20: A filtered simplicial complex.
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.
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.
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
• ←− • −→ · · · ←− • −→ •
b d
• •
a c
• •
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.
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 ].
V (p≤q)
Vp Vq
fp fq
Wp Wq .
W (p≤q)
W: Z2 0
0.
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
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
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).
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 )
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) .
Furthermore,
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
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 )
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.
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:
and in dimension 1:
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:
1. Write down the boundary matrix D with the simplices ordered by their appearance in the
filtration of a simplicial complex K.
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
(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.
(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
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.
• 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.
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.
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.
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 )
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 ).
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).
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 }.
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.
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
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
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),
• 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 .
Hn (K) ∼
= Hn (K)∗ ∼
= H n (K).
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 )∗
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
Remark 8.10. In fact, if we view H n (K) as an persistence module indexed over [m] with the
opposite ordering,
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:
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 D be the coboundary operator in matrix form, with the columns ordered in the
opposite order of the filtration (as in Example 8.5).
• 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 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.
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.
c(I) = (b − a)/2.
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.
a1 + 2 + 20 ≥ a2 + + 20 ≥ b2 + ≥ b1 ,
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.
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
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
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|.
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
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||∞ .
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,
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
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
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 ···
A 1-interleaving is a collection of slanted morphisms such that the following diagram commutes:
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+ .
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
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
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 ).
Proof of Theorem 9.6. Since ||f − g||∞ ≤ , we have the following commutative diagram of
inclusions for every t ∈ R:
Mtf f
Mt+ f
Mt+2
Mtg g
Mt+ g
Mt+2 .
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
Applying Hi to the above relations defines an -interleaving between Hi (VR(P )) and Hi (VR(Q)).
It follows from Theorem 9.13 that
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
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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:
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 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.
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.
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 ≤ ∞.
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 .
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 ,
Hi (K) ← Hi (K ∩ K 0 ) → Hi (K 0 ).
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 )
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
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.
73
X1 o / ... o / Xk−2 o / U o / Xk+2 o / ... o / Xn
dJJJ
JJ ttt: V
tt
U∩V
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 , ∞)
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
and where the map Mi,j → Mi0 ,j 0 is induced in homology by the inclusion
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.
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.
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:
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:
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.
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.
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
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
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
Hence ft = fa1 .
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:
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:
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.
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:
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)
Hence, X
1 = w(ηI2I ) = w(gJ,I ) · w(fI,J )
J∈µ(I)
and X
0= w(gJ,Ii0 )· w(fIi ,J )
J∈µ(I)
? ···
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 .
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.
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.
[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.
[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.
87