Let \(Y\) denote a finite regular CW-complex. Let \(\widetilde Y\) denote its universal covering space. The covering space inherits a regular CW-structure which can be computed and stored using the data type of a \(\pi_1Y\)-equivariant CW-complex. The cellular chain complex \(C_\ast\widetilde Y\) of \(\widetilde Y\) can be computed and stored as an equivariant chain complex. Given an admissible discrete vector field on \( Y\), we can endow \(Y\) with a smaller non-regular CW-structre whose cells correspond to the critical cells in the vector field. This smaller CW-structure leads to a more efficient chain complex \(C_\ast \widetilde Y\) involving one free generator for each critical cell in the vector field.

The following commands construct a \(6\)-dimensional regular CW-complex \(Y\simeq S^1 \times S^1\times S^1\) homotopy equivalent to a product of three circles.

```
gap> A:=[[1,1,1],[1,0,1],[1,1,1]];;
```

gap> S:=PureCubicalComplex(A);;

gap> T:=DirectProduct(S,S,S);;

gap> Y:=RegularCWComplex(T);;

gap> Size(Y);

110592

The CW-somplex \(Y\) has \(110592\) cells. The next commands construct a free \(\pi_1Y\)-equivariant chain complex \(C_\ast\widetilde Y\) homotopy equivalent to the chain complex of the universal cover of \(Y\). The chain complex \(C_\ast\widetilde Y\) has just \(8\) free generators.

```
gap> Y:=ContractedComplex(Y);
```

gap> CU:=ChainComplexOfUniversalCover(Y,"vector field");;

gap> List([0..Dimension(Y)],n->CU!.dimension(n));

[ 1, 3, 3, 1 ]

The next commands construct a subgroup \(H < \pi_1Y\) of index \(50\) and the chain complex \(C_\ast\widetilde Y\otimes_{\mathbb H}\mathbb Z\) which is homotopy equivalent to the cellular chain complex \(C_\ast\widetilde Y_H\) of the \(50\)-fold cover \(\widetilde Y_H\) of \(Y\) corresponding to \(H\).

```
gap> L:=LowIndexSubgroupsFpGroup(CU!.group,50);;
```

gap> H:=L[Length(L)-1];;

gap> Index(CU!.group,H);

50

gap> D:=TensorWithIntegersOverSubgroup(CU,H);

Chain complex of length 3 in characteristic 0 .

General theory implies that the \(50\)-fold covering space \(\widetilde Y_H\) should again be homotopy equivalent to a product of three circles. As a check for this, the following commands establish that \(\widetilde Y_H\) has the same integral homology as \(S^1\times S^1\times S^1\).

```
gap> Homology(D,0);
```

[ 0 ]

gap> Homology(D,1);

[ 0, 0, 0 ]

gap> Homology(D,2);

[ 0, 0, 0 ]

gap> Homology(D,3);

[ 0 ]

The \(\pi_1Y\)-equivariant cellular chain complex \(C_\ast\widetilde Y\) of the universal cover \(\widetilde Y\) of a regular CW-complex \(Y\) can be used to compute the homology \(H_n(Y,A)\) and cohomology \(H^n(Y,A)\) of \(Y\) with local coefficients in a \(\mathbb Z\pi_1Y\)-module \(A\). To illustrate this we consister the space \(Y\) arising as the complement of the trefoil knot, with fundamental group \(\pi_1Y = \langle x,y : xyx=yxy \rangle\). We take \(A= \mathbb Z\) to be the integers with non-trivial \(\pi_1Y\)-action given by \(x.1=-1, y.1=-1\). We then compute $$\begin{array}{lcl} H_0(Y,A) &= &\mathbb Z_2\, ,\\ H_1(Y,A) &= &\mathbb Z_3\, ,\\ H_2(Y,A) &= &\mathbb Z\, .\end{array}$$

```
gap> K:=PureCubicalKnot(3,1);;
```

gap> Y:=PureComplexComplement(K);;

gap> Y:=ContractedComplex(Y);;

gap> Y:=RegularCWComplex(Y);;

gap> Y:=SimplifiedComplex(Y);;

gap> C:=ChainComplexOfUniversalCover(Y);;

gap> G:=C!.group;;

gap> GeneratorsOfGroup(G);

[ f1, f2 ]

gap> RelatorsOfFpGroup(G);

[ f2^-1*f1^-1*f2^-1*f1*f2*f1, f1^-1*f2^-1*f1^-1*f2*f1*f2 ]

gap> hom:=GroupHomomorphismByImages(G,Group([[-1]]),[G.1,G.2],[[[-1]],[[-1]]]);;

gap> A:=function(x); return Determinant(Image(hom,x)); end;;

gap> D:=TensorWithTwistedIntegers(C,A); #Here the function A represents the integers with twisted action of G.

Chain complex of length 3 in characteristic 0 .

gap> Homology(D,0);

[ 2 ]

gap> Homology(D,1);

[ 3 ]

gap> Homology(D,2);

[ 0 ]

We next construct a 4-dimensional CW-complex \(Y\simeq S^1\times S^1\) homotopy equivalent to a \(2\)-dimensional torus, involving \(2304\) cells. We choose a subgroup \(H < \pi_1Y\) of index \(50\) and construct the covering space \(\widetilde Y_H\) corresponding to \(H\) as a finite regular CW-complex. The fundamental group \(\pi_1 (\widetilde Y_H)\) is shown to be free abelian on two generators. This is in keeping with the fact that \(\widetilde Y_H\) is homotopy equivalent to \(Y\).

```
gap> G:=U!.group;;
```

gap> L:=LowIndexSubgroupsFpGroup(G,50);;

gap> H:=L[Length(L)-3];;Index(G,H);

50

gap> W:=EquivariantCWComplexToRegularCWComplex(U,H);

Regular CW-complex of dimension 4

gap> Size(W);

115200

gap> F:=FundamentalGroup(W);

<fp group of size infinity on the generators [ f1, f2 ]>

gap> RelatorsOfFpGroup(F);

[ f2^-1*f1*f2*f1^-1 ]

It may be that we are interested in the covering map \(p:\widetilde Y_H \rightarrow Y\) and not just the covering \(\widetilde Y_H\) itself. As an illustration we construct the map \(p\) for \(Y\) homotopy equivalent to a torus, for \(H<\pi_1Y\) a subgroup with $$\pi_1Y / H \cong \mathbb Z_3 \oplus \mathbb Z_3\,,$$ and for \(p\) the corresponding covering map.

```
gap> A:=[[1,1,1],[1,0,1],[1,1,1]];;
```

gap> S:=PureCubicalComplex(A);;

gap> T:=DirectProduct(S,S);;

gap> Y:=RegularCWComplex(T);;

gap> U:=UniversalCover(Y);

Equivariant CW-complex of dimension 4

gap> G:=U!.group;;

gap> L:=LowIndexSubgroupsFpGroup(G,9);;

gap> H:=L[58];;

gap> AbelianInvariants(G/H);

[ 3, 3 ]

gap> p:=EquivariantCWComplexToRegularCWMap(U,H);

Map of regular CW-complexes

gap> Source(p);

Regular CW-complex of dimension 4

gap> Size(Source(p));

20736

gap> Target(p);

Regular CW-complex of dimension 4

gap> Size(Target(p));

2304

The covering map \(p\) induces homomorphisms \(H_n(p):H_n(W,\mathbb Z) \rightarrow H_n(Y,\mathbb Z)\) on integral homology. These homomorphisms, together with their cokernels, can be computed as follows.

```
gap> P:=ChainMap(p);
```

Chain Map between complexes of length 4 .

gap> h0:=Homology(P,0);;

gap> AbelianInvariants(Target(h0)/Image(h0));

[ ]

gap> h1:=Homology(P,1);;

gap> AbelianInvariants(Target(h1)/Image(h1));

[ 3, 3 ]

gap> h2:=Homology(P,2);;

gap> AbelianInvariants(Target(h2)/Image(h2));

[ 9 ]

If \(p:\widetilde Y \rightarrow Y\) is the map from the universal cover \(\widetilde Y\) of \(Y\), then the fundamental group of \(\widetilde Y\) is trivial and the Hurewicz homomorphism \(\pi_2\widetilde Y\rightarrow H_2(\widetilde Y,\mathbb Z)\) from the second homotopy group of \(\widetilde Y\) to the second integral homology of \(\widetilde Y\) is an isomorphism. Furthermore, the map \(p\) induces an isomorphism \(\pi_2\widetilde Y \rightarrow \pi_2Y\). Thus \(H_2(U,\mathbb Z)\) is isomorphic to the second homotopy group \(\pi_2Y\).

If the fundamental group of \(Y\) happens to be finite, then in principle we can calculate \(H_2(\widetilde Y,\mathbb Z) \cong \pi_2Y\). We illustrate this computation for \(Y\) equal to the real projective plane.

```
gap> K:=[ [1,2,3], [1,3,4], [1,2,6], [1,5,6], [1,4,5], [2,3,5], [2,4,5], [2,4,6], [3,4,6], [3,5,6]];;
```

gap> K:=MaximalSimplicesToSimplicialComplex(K);

Simplicial complex of dimension 2.

gap> Y:=RegularCWComplex(K); # Y is a regular CW-complex corresponding to the projective plane.

Regular CW-complex of dimension 2

gap> U:=UniversalCover(Y);

Equivariant CW-complex of dimension 2

gap> G:=U!.group;; #G is the fundamental group of Y, which by the next command is finite of order 2.

gap> Order(G);

2

gap> U:=EquivariantCWComplexToRegularCWComplex(U,Group(One(G))); #U is the universal cover of Y

Regular CW-complex of dimension 2

gap> Homology(U,0);

[ 0 ]

gap> Homology(U,1);

[ ]

gap> Homology(U,2);

[ 0 ]

The above computation shows that the space \(Y\) has infinite cyclic second homotopy group \(\pi_2Y \cong \mathbb Z\).

For any simply connected space \(U\) there is an exact sequence $$ \rightarrow \pi_4\widetilde Y \rightarrow H_4(\widetilde Y,\mathbb Z) \rightarrow H_4( K(\pi_2\widetilde Y,2), \mathbb Z ) \rightarrow \pi_3\widetilde Y \rightarrow H_4(\widetilde Y,\mathbb Z) \rightarrow 0 $$ due to J.H.C.Whitehead. Here \(K(\pi_2U,2)\) is an Eilenberg-MacLane space with second homotopy group equal to \(\pi_2U\).

Continuing with the above example where \(Y\) is the real projective plane and \(\widetilde Y\) its universal cover, we see that \(H_4(\widetilde Y,\mathbb Z) = H_4(\widetilde Y,\mathbb Z) = 0\) since \(\widetilde Y\) is a 2-dimensional CW-space. The exact sequence implies \(\pi_3\widetilde Y \cong H_4(K(\pi_2\widetilde Y,2), \mathbb Z )\). Furthermore, \(\pi_3\widetilde Y = \pi_3 Y\). The following commands establish that $$ \pi_3Y \cong \mathbb Z\, . $$

```
gap> A:=AbelianPcpGroup([0]);
```

Pcp-group with orders [ 0 ]

gap> K:=EilenbergMacLaneSimplicialGroup(A,2,5);;

gap> C:=ChainComplexOfSimplicialGroup(K);

Chain complex of length 5 in characteristic 0 .

gap> Homology(C,4);

[ 0 ]

The following commands construct a 4-dimensional simplicial complex \(Y\) with 9 vertices and 36 4-dimensional simplices, and establish that $$ \pi_1Y=0 , \pi_2Y=\mathbb Z , H_3(Y,\mathbb Z)=0, H_4(Y,\mathbb Z)=\mathbb Z, H_4(K(\pi_2Y,2), \mathbb Z) =\mathbb Z . $$

```
gap> Y:=[ [ 1, 2, 4, 5, 6 ], [ 1, 2, 4, 5, 9 ], [ 1, 2, 5, 6, 8 ], [ 1, 2, 6, 4, 7 ], [ 2, 3, 4, 5, 8 ], [ 2, 3, 5, 6, 4 ], [ 2, 3, 5, 6, 7 ], [ 2, 3, 6, 4, 9 ], [ 3, 1, 4, 5, 7 ],
```

[ 3, 1, 5, 6, 9 ], [ 3, 1, 6, 4, 5 ], [ 3, 1, 6, 4, 8 ], [ 4, 5, 7, 8, 3 ], [ 4, 5, 7, 8, 9 ], [ 4, 5, 8, 9, 2 ], [ 4, 5, 9, 7, 1 ], [ 5, 6, 7, 8, 2 ], [ 5, 6, 8, 9, 1 ],

[ 5, 6, 8, 9, 7 ], [ 5, 6, 9, 7, 3 ], [ 6, 4, 7, 8, 1 ], [ 6, 4, 8, 9, 3 ], [ 6, 4, 9, 7, 2 ], [ 6, 4, 9, 7, 8 ], [ 7, 8, 1, 2, 3 ], [ 7, 8, 1, 2, 6 ], [ 7, 8, 2, 3, 5 ],

[ 7, 8, 3, 1, 4 ], [ 8, 9, 1, 2, 5 ], [ 8, 9, 2, 3, 1 ], [ 8, 9, 2, 3, 4 ], [ 8, 9, 3, 1, 6 ], [ 9, 7, 1, 2, 4 ], [ 9, 7, 2, 3, 6 ], [ 9, 7, 3, 1, 2 ], [ 9, 7, 3, 1, 5 ] ];;

gap> Y:=MaximalSimplicesToSimplicialComplex(Y);

Simplicial complex of dimension 4.

gap> Y:=RegularCWComplex(Y);

Regular CW-complex of dimension 4

gap> Order(FundamentalGroup(Y));

1

gap> Homology(Y,2);

[ 0 ]

gap> Homology(Y,3);

[ ]

gap> Homology(Y,4);

[ 0 ]

Whitehead's sequence reduces to an exact sequence $$\mathbb Z \rightarrow \mathbb Z \rightarrow \pi_3Y \rightarrow 0$$ in which the first map is \( H_4(Y,\mathbb Z)=\mathbb Z \rightarrow H_4(K(\pi_2Y,2), \mathbb Z )=\mathbb Z \). In order to determine \(\pi_3Y\) it remains compute this first map. This computation is currently not available in HAP.

[The simplicial complex in this second example is due to W. Kiihnel and T. F. Banchoff and is of the homotopy type of the complex projective plane. So, assuming this extra knowledge, we have \(\pi_3Y=0\).]