To use this calculator, consider a shape (cell complex) and give a name to each cell (vertex, edge, face, etc.). For example, the diagram to the right represents a torus constructed with one 0-dimensinal cell (named v), three 1-dimensional cells (named a, b, and c), and two 2-dimensional cells (named U and L). In the first input box below, list the cells of each dimension. In the second input box, specify the boundary of each face in terms of the cells one dimension lower. The blue output box will list the homology or cohomology of the resulting shape, algebraic structures representing how the holes in each dimension fit together. Click through the buttons under Example Inputs for a demo. |
From Hatcher, p.102 |
The Cell Names by Dimension box should consist of a number of lines, each line consisting of an integer, followed by a colon, followed by a comma-separated list of names in that dimension. Cell names can include ascii letters or digits or underscores, but cannot start with a digit.
Each line in the Boundary box
should consist of a cell name, followed by a colon,
followed by a chain of cells one dimension lower.
A chain consists of a list of cell names,
perhaps preceded by integer coefficients,
separated by +
and -
signs.
Semicolons (;
) are treated
the same as line breaks, so
multiple cell boundaries
can be specified in the same physical line.
Whitespace other than line breaks is generally ignored.
The Homology Result box will display not only the isomorphism type of the homology in each dimension, but also specific chains representing homology classes that generate the direct summands of the Abelian group. The result will be be computed from dimension 0 (or lower) up to the dimension of the highest-dimensional cell. All groups not listed are trivial.
If the Cohomology checkbox is checked, cohomology is computed instead of homology. For the listed generators, a cell a is identified with its dual cochain, so a(a)=1, but a(x)=0 for any cell x other than a.
The Coefficients input accepts a nonnegative integer, and determines the coefficient group to compute with. If the box is blank, this is interpreted as using coefficients in ℤ/0ℤ ≅ ℤ, i.e., integral coefficients.
In the Relative to subcomplex box, list all cells of some (closed) subcomplex, separated by commas. This should be closed under the boundary homomorphism, and the computation will fail if this is not the case. However, the calculator makes no further attempt to detect that you've entered a subcomplex.
For an introduction to homology, see Hatcher's free textbook. Homology is defined as "(kernel of boundary) modulo (image of boundary)", often using the terminology "cycles modulo boundaries". More explicitly, if we define Ci to be chains (i.e. formal sums) of i-dimensional-cells, and let ∂i : Ci → Ci−1 be the Abelian group homomorphism that maps a cell to its boundary, then we define Hi to be the quotient (ker ∂i) / (im ∂i+1) of Abelian groups.
Suppose that x, y, z are 1-cells and each with boundary p − q and that F is a 2-cell with boundary 2x − 2y. We'll compute H1.
First, ker ∂1 is
If we write u = x − y and v = z − y then ker ∂1 = 〈 u, v 〉 is the free Abelian group generated by u and v.
But since im ∂2 is generated by 2x − 2y = 2u, this shows that H1 = (ker ∂1) / (im ∂2) has the Abelian group presentation 〈 u, v | 2u = 0 〉, so H1 ≅ ℤ/2ℤ ⊕ ℤ. Click to compute Example 1.
It's always true that ker ∂i is a free Abelian group because it's a subgroup of the free Abelian group Ci. This lines up with what we saw in Example 1. So beyond translating into new variables like in Example 1, the heart of the calculator must manipulate Abelian group presentations with several potentially complicated relations to get to a normalized form. We can do this with the Abelian group version of Tietze transformations.
Here's an example:
The above sort of Euclidean algorithm can be done systematically for many variables and relations simultaneously by working with matrices and using row and column operations to compute the Smith Normal Form of boundary matrices. Click to compute the equivalent of Example 2. Generalizing from this example, you could treat this page as an Abelian group simplifier!
Given any integer matrix A, we can find invertible integer matrices S and T such that D := SAT is a diagonal matrix: we repeatedly apply row and column operations to A until it is diagonal. Even if A is not a square matrix, the result D has the same shape as A and can be made zero except on the one main diagonal. Row operations are given by left-multiplying by elementary matrices S1, … Su, and column operations are given by right-multiplying by elementary matrices T1, … Tv, so we find D = Su⋯S1AT1⋯Tv, and put S = Su⋯S1 and T = T1⋯Tv. The inverse matrices can be computed at the same time, as S−1 = S1−1⋯Su−1 and T−1 = Tv−1⋯T1−1. All matrices here have integer entries.
Smith normal form can be used to compute the cokernel of a ℤ-linear map (i.e. a matrix) A : ℤn → ℤm. Let D be the Smith normal form for A, and write A = UDV for invertible U := S−1 and V := T−1. Then coker A = ℤm / (im UDV) = ℤm / (im UD). Because U is invertible, we have an isomorphism of pairs U : (ℤm, im D) → (ℤm, im UD). This descends to an isomorphism ℤm / im D → ℤm / im UD. The generators of ℤm / im D are the elements of the standard basis of ℤm, but the corresponding diagonal entries of D indicate whether each generator generates a ℤ direct summand (if the entry is 0 or the matrix is too small to have a corresponding entry), a finite nontrivial cyclic direct summand ℤ/dℤ (if the entry is d > 1), or a trivial summand (if the entry is 1). The image of this standard basis under U gives the corresponding generators for ℤm / im UD = coker A.
If a ℤ-linear map A : ℤn → ℤm has a Smith normal form D = SAT, then by the invertibility of S and T,
Write R := ℤ/qℤ for our coefficient group. Given R-linear maps A' : Rn → Rm and B' : Rm → Rk satisfying B'A' = 0, we want to compute the homology (ker B') / (im A') at Rm.
Write p: ℤ → R for the canonical morphism, and also write p: ℤm → Rm. Write A and B for integer matrices representing A' and B' respectively, and not that this makes p a chain map. We begin computing:
Write the Smith normal form SBT=D for B. Then Bv ∈ qℤk holds iff S−1DT−1v ∈ qℤk, which holds iff DT−1v ∈ qℤk. The set of such v is T(D−1(qℤk)), where D−1 denotes preimage. Because D is diagonal, this can be computed explicity: D−1(qℤk) = E ℤr, where E has as columns the nonzero vectors with a single entry q/Dii. We conclude that the cycles are ker B' = pTE ℤr.
The homolgy is (pTE ℤr)/(pAℤn). For the purpose of only working with integer matrices, we can quotient out by the modulus q (via the map p) and by the boundaries Aℤn simultaneously: the homology can be computed as (TE ℤr)/(Aℤn + qℤm). We can write this as (TE ℤr)/([A|qid]ℤm+n) with a block matrix. Now our homology is
Above, [T]([v]) := [Tv], i.e., [T] is the map T descended to the quotient. Likewise for E. The matrix F is chosen so that EF=[T−1A|qid], and is computed by dividing through each row by the corresponding entry of E and ignoring the zero rows corresponding to zero entries of E. Since T and E are injections, the homology is isomorphic to (coker F), so we can compute generators as above, and then translate them over to the appropriate vectors in ℤm via TE.