## The problem

Consider two simplicial complexes X and Y as pictured below.

*Our goal is to understand an algorithm which reveals how a map of complexes induces a map on (co)homology.*

This post is laid out in the following two parts:

- We will start by reviewing an algorithm others have shared for computing the basis for homology: i.e. given matrices multiplying to zero, A・B = 0, we compute a basis for the quotient space ker(A) / im(B).
- The above simplicial complexes come with an inclusion map X → Y, which gives a map of cochain complexes, C(X) → C(Y), and thus a map on cohomology H(X) → H(Y). We will show how to make the above algorithm give a map of bases on cohomology which is useful in persistent cohomology, for example.

## Computing the Homology of AB=0

Given two matrices whose product is zero, A・B = 0, we review a process in general which computes a basis for ker(A) / im(B) as found in this post and the follow up post by Jeremy Kun. A condensed version of the steps are:

- First augment A over the identity matrix I, and column reduce
^{1}it to obtain A・Q augmented over I・Q = Q. As shown below, this process produces a basis for ker(A) but is not yet combatible with im(B). - Now apply Q
^{-1}to B as row operations via Q^{-1}・B. Since this matrix is not necessarily fully reduced, we can not just read off pivots. Instead we now finish row-reducing B in the form of P・Q^{-1}・B. - Finally, we apply P
^{-1}to our kernel basis by A・Q・P^{-1}. At this point we can read off the two bases: one for im(B) which sits inside the basis for ker(A).

The example that we use below comes from computing H(Y) where B: C^{0}(Y) → C^{1}(Y) and A: C^{1}(Y) → C^{2}(Y).

As outlined above, first we column reduce (see the footnotes^{2} for steps) A by A・Q in our first step toward computing a basis for ker(A).

The labels with two indices correspond to the edges of the simplicial complex Y, and the labels with the three indices correspond to the filled in triangles for Y. The five highlighted column vectors of Q form a basis for ker(A). However, this basis is not compatible with any basis for im(B) yet. Notice that the first and third columns of Q are not part of the basis for ker(A)…

Next, we apply Q^{-1}・B en route to a basis for im(B).

Notice that the first and third rows are all zeros, and thus do not contribute to the image basis, and that these correspond to the first and third columns of Q. However these rows are not yet linearly independent so we need to further row-reduce (see the footnotes^{3} for steps).

The circled values tell us which rows are the pivot rows, and we label this set of rows S={y_{2}, y_{4}, y_{6}, y_{7}}. Once we apply P^{-1} to our initial kernel basis by A・Q・P^{-1} we will have a new kernel basis which is compatible with S:

Finally we have the desired bases. The column vectors of Q・P^{-1} above which are circled provide us a basis for the kernel of A. They are y_{2}= u_{01} + u_{02}, y_{4} = -u_{01} + u_{12} + u_{13} + u_{14}, y_{5}=u_{14}, y_{6} = u_{01} – u_{12} + u_{23}, and y_{7} = u_{34}. So our preferred basis for ker(A) is T = { y_{2}, y_{4}, y_{5}, y_{6}, y_{7} } while recall that our basis for im(B) was the subset S={y_{2}, y_{4}, y_{6}, y_{7}}. Thus the basis for the cohomology ker(A) / im(B) is the singleton set of classes { [y_{5}] }.

## An algorithm for maps of (co)homology of filtered complexes

The following two constructions induce computationally-equivalent quotient (vector) spaces to compute:

- Given a data set, , for each real number ε we define a simplicial (Čech) complex X
^{ε}as follows. The vertices are the data points p_{i}. Now center at each point an open epsilon ball. The edges p_{ij}are the pairs of points whose epsilon balls intersect. The triangles p_{ijk}are the triples of points whose epsilon balls triple-intersect. And so on… Construct the usual chain complex by defining boundary maps to be the alternating sums of the face maps. Call these boundary maps and consider their transposes, . Define the (Čech) cohomology by . Now for each pair of resolutions ε < ε’ we get an induced map H(X^{ε’}) → H(X^{ε}). Explicitly analyzing which classes get sent to which classes under this map is the context of this post. - Given a topological space, X, consider a finite open cover
*U*= {U_{i}}_{i𝜖I}and define the Čech cochain complex^{4}as follows. The zero cochain vector space Č^{0}(*U*) is the free vector on the elements of the open cover. The pth cochain vector space Č^{p}(*U*) is the free vector space on the (p+1)-fold intersection of the elements of the open cover. The boundary maps are defined are defined component wise as follows: where means the index is removed. Define the (Čech) cohomology by . Now for each pair of covers we get an induced map . Explicitly analyzing which classes get sent to which classes under this map is*equivalent to*the context of this post.

So whichever context you prefer, we now want to see how to compute bases for the cohomology of the simplicial complexes C(X) and C(Y) above. Let’s focus on H^{1}. The computations involving the matrices A and B from the previous section, using either of the first context written immediately above in this section, with X representing resolution ε and Y representing ε’, we have and . So the above computation is computing H^{1}(Y) = H^{1}(X^{ε’}). To compute H^{1}(X^{ε}) and simultaneously analyze the map H^{1}(X^{ε’}) → H^{1}(X^{ε}) we see that the map of cochain complexes amounts to sending basis elements to zero if the simplex is no longer represented^{5}. Below we call this map I_{X} since it is like the identity on most basis elements but for some simplices the basis element is sent to zero.

Thus we are going to merely apply the transformations P and Q as above but now to the boundary maps for X = X^{ε}:

As with computing the basis for ker(A) above, the columns below the zeros of form a basis for . In this case those columns are x_{2} = v_{01}, x_{3} = -v_{01} + v_{12}, x_{4} = -v_{01} + v_{12} + v_{13}, x_{6} = v_{01} – v_{12} + v_{23}. Notice that x_{5} and x_{7} are trivial. So the basis for the kernel is D = {x_{2}, x_{3}, x_{4}, x_{6}}. Of these basis vectors, those which are contributing to the image (seen in the matrix of rows for ) are E = {x_{2}, x_{4}, x_{6}}. If these were not linearly independent we would have to perform further row reduction R and corresponding column operations R^{-1} to the kernel basis. However, these basis vectors for the image are linearly independent in the image and so we have the singleton class basis for homology H^{1}(X) = { [x_{3}]}.

Under the map H(Y) = {[y_{5}=u_{14}]}→ H(X) = {[x_{3} = -v_{01} + v_{12}]}, we see that y_{5}=u_{14} gets sent to zero and x_{3} = -v_{01} + v_{12} is not in the image. In the language of persistence this corresponds to the fact that the loop in the complex for X “dies” when we move to the complex Y, and a new loop is “born”!

⃞

## Footnotes

- It turns out that during this algorithm, reduction should only ever take the form of scaling or “column j is replaced by column j added to a scalar multiple of column i” with i < j (similar for row operations. Swapping rows/columns or applying the above operation with i greater than or equal to j will cause consistency issues.
- The column reductions are given by the following steps: (i) col
_{2}+= col_{1}, (ii) col_{3}+= -col_{1}, (iii) col_{4}+= col_{3}, (iv) col_{6}+= -col_{3}. - The row reductions are given by the following step: (i) row
_{4}+= -row_{3}. - I’m translating for the special case where we are taking the Čech complex for the sheaf of locally constant real-valued functions.
- Our setup has the property that for ε < ε’ the complex X
^{ε}is a subcomplex of X^{ε’}.