3 Covering spaces 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 datatype of a π_1Y-equivariant CW-complex. The cellular chain complex C_∗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_∗ widetilde Y involving one free generator for each critical cell in the vector field. 3.1 Cellular chains on the universal cover The following commands construct a 6-dimensional regular CW-complex Y≃ S^1 × S^1× S^1 homotopy equivalent to a product of three circles.  Example  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);; Regular CW-complex of dimension 6  gap> Size(Y); 110592   The CW-somplex Y has 110592 cells. The next commands construct a free π_1Y-equivariant chain complex C_∗widetilde Y homotopy equivalent to the chain complex of the universal cover of Y. The chain complex C_∗widetilde Y has just 8 free generators.  Example  gap> Y:=ContractedComplex(Y);; gap> CU:=ChainComplexOfUniversalCover(Y);; gap> List([0..Dimension(Y)],n->CU!.dimension(n)); [ 1, 3, 3, 1 ]   The next commands construct a subgroup H < π_1Y of index 50 and the chain complex C_∗widetilde Y⊗_ ZH Z which is homotopy equivalent to the cellular chain complex C_∗widetilde Y_H of the 50-fold cover widetilde Y_H of Y corresponding to H.  Example  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 .  gap> List([0..3],D!.dimension); [ 50, 150, 150, 50 ]   General theory implies that the 50-fold covering space widetilde Y_H should again be homotopy equivalent to a product of three circles. In keeping with this, the following commands verify that widetilde Y_H has the same integral homology as S^1× S^1× S^1.  Example  gap> Homology(D,0); [ 0 ] gap> Homology(D,1); [ 0, 0, 0 ] gap> Homology(D,2); [ 0, 0, 0 ] gap> Homology(D,3); [ 0 ]   3.2 Spun knots and the Satoh tube map We'll contruct two spaces Y,W with isomorphic fundamental groups and isomorphic intergal homology, and use the integral homology of finite covering spaces to establsh that the two spaces have distinct homotopy types. By spinning a link K ⊂ R^3 about a plane P⊂ R^3 with P∩ K=∅, we obtain a collection Sp(K)⊂ R^4 of knotted tori. The following commands produce the two tori obtained by spinning the Hopf link K and show that the space Y= R^4∖ Sp(K) = Sp( R^3∖ K) is connected with fundamental group π_1Y = Z× Z and homology groups H_0(Y)= Z, H_1(Y)= Z^2, H_2(Y)= Z^4, H_3(Y, Z)= Z^2. The space Y is only constructed up to homotopy, and for this reason is 3-dimensional.  Example  gap> Hopf:=PureCubicalLink("Hopf"); Pure cubical link.  gap> Y:=SpunAboutInitialHyperplane(PureComplexComplement(Hopf)); Regular CW-complex of dimension 3  gap> Homology(Y,0); [ 0 ] gap> Homology(Y,1); [ 0, 0 ] gap> Homology(Y,2); [ 0, 0, 0, 0 ] gap> Homology(Y,3); [ 0, 0 ] gap> Homology(Y,4); [ ] gap> GY:=FundamentalGroup(Y);; gap> GeneratorsOfGroup(GY); [ f2, f3 ] gap> RelatorsOfFpGroup(GY); [ f3^-1*f2^-1*f3*f2 ]   An alternative embedding of two tori L⊂ R^4 can be obtained by applying the 'tube map' of Shin Satoh to a welded Hopf link [Sat00]. The following commands construct the complement W= R^4∖ L of this alternative embedding and show that W has the same fundamental group and integral homology as Y above.  Example  gap> L:=HopfSatohSurface(); Pure cubical complex of dimension 4.  gap> W:=ContractedComplex(RegularCWComplex(PureComplexComplement(L))); Regular CW-complex of dimension 3  gap> Homology(W,0); [ 0 ] gap> Homology(W,1); [ 0, 0 ] gap> Homology(W,2); [ 0, 0, 0, 0 ] gap> Homology(W,3); [ 0, 0 ] gap> Homology(W,4); [ ]  gap> GW:=FundamentalGroup(W);; gap> GeneratorsOfGroup(GW); [ f1, f2 ] gap> RelatorsOfFpGroup(GW); [ f1^-1*f2^-1*f1*f2 ]   Despite having the same fundamental group and integral homology groups, the above two spaces Y and W were shown by Kauffman and Martins [KFM08] to be not homotopy equivalent. Their technique involves the fundamental crossed module derived from the first three dimensions of the universal cover of a space, and counts the representations of this fundamental crossed module into a given finite crossed module. This homotopy inequivalence is recovered by the following commands which involves the 5-fold covers of the spaces.  Example  gap> CY:=ChainComplexOfUniversalCover(Y); Equivariant chain complex of dimension 3 gap> LY:=LowIndexSubgroups(CY!.group,5);; gap> invY:=List(LY,g->Homology(TensorWithIntegersOverSubgroup(CY,g),2));;  gap> CW:=ChainComplexOfUniversalCover(W); Equivariant chain complex of dimension 3 gap> LW:=LowIndexSubgroups(CW!.group,5);; gap> invW:=List(LW,g->Homology(TensorWithIntegersOverSubgroup(CW,g),2));;  gap> SSortedList(invY)=SSortedList(invW); false   3.3 Cohomology with local coefficients The π_1Y-equivariant cellular chain complex C_∗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 Zπ_1Y-module A. To illustrate this we consister the space Y arising as the complement of the trefoil knot, with fundamental group π_1Y = ⟨ x,y : xyx=yxy ⟩. We take A= Z to be the integers with non-trivial π_1Y-action given by x.1=-1, y.1=-1. We then compute beginarraylcl H_0(Y,A) &= & Z_2 , H_1(Y,A) &= & Z_3 , H_2(Y,A) &= & Z .endarray  Example  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  gap> #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 ]   3.4 Distinguishing between two non-homeomorphic homotopy equivalent spaces The granny knot is the sum of the trefoil knot and its mirror image. The reef knot is the sum of two identical copies of the trefoil knot. The following commands show that the degree 1 homology homomorphisms H_1(p^-1(B), Z) → H_1(widetilde X_H, Z) distinguish between the homeomorphism types of the complements X⊂ R^3 of the granny knot and the reef knot, where B⊂ X is the knot boundary, and where p: widetilde X_H → X is the covering map corresponding to the finite index subgroup H < π_1X. More precisely, p^-1(B) is in general a union of path components p^-1(B) = B_1 ∪ B_2 ∪ ⋯ ∪ B_t . The function FirstHomologyCoveringCokernels(f,c) inputs an integer c and the inclusion f: B↪ X of a knot boundary B into the knot complement X. The function returns the ordered list of the lists of abelian invariants of cokernels coker( H_1(p^-1(B_i), Z) → H_1(widetilde X_H, Z) ) arising from subgroups H < π_1X of index c. To distinguish between the granny and reef knots we use index c=6.  Example  gap> K:=PureCubicalKnot(3,1);; gap> L:=ReflectedCubicalKnot(K);; gap> granny:=KnotSum(K,L);; gap> reef:=KnotSum(K,K);; gap> fg:=KnotComplementWithBoundary(ArcPresentation(granny));; gap> fr:=KnotComplementWithBoundary(ArcPresentation(reef));; gap> a:=FirstHomologyCoveringCokernels(fg,6);; gap> b:=FirstHomologyCoveringCokernels(fr,6);; gap> a=b; false   3.5 Second homotopy groups of spaces with finite fundamental group If p:widetilde Y → Y is the universal covering map, then the fundamental group of widetilde Y is trivial and the Hurewicz homomorphism π_2widetilde Y→ H_2(widetilde Y, 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 π_2widetilde Y → π_2Y. Thus H_2(widetilde Y, Z) is isomorphic to the second homotopy group π_2Y. If the fundamental group of Y happens to be finite, then in principle we can calculate H_2(widetilde Y, Z) ≅ π_2Y. We illustrate this computation for Y equal to the real projective plane. The above computation shows that Y has second homotopy group π_2Y ≅ Z.  Example  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);  Regular CW-complex of dimension 2 gap> # Y is a regular CW-complex corresponding to the projective plane.  gap> U:=UniversalCover(Y); Equivariant CW-complex of dimension 2  gap> G:=U!.group;;  gap> # G is the fundamental group of Y, which by the next command  gap> # is finite of order 2. gap> Order(G); 2  gap> U:=EquivariantCWComplexToRegularCWComplex(U,Group(One(G)));  Regular CW-complex of dimension 2 gap> #U is the universal cover of Y  gap> Homology(U,0); [ 0 ] gap> Homology(U,1); [ ] gap> Homology(U,2); [ 0 ]   3.6 Third homotopy groups of simply connected spaces 3.6-1 First example: Whitehead's certain exact sequence For any path connected space Y with universal cover widetilde Y there is an exact sequence → π_4widetilde Y → H_4(widetilde Y, Z) → H_4( K(π_2widetilde Y,2), Z ) → π_3widetilde Y → H_3(widetilde Y, Z) → 0 due to J.H.C.Whitehead. Here K(π_2(widetilde Y),2) is an Eilenberg-MacLane space with second homotopy group equal to π_2widetilde Y. Continuing with the above example where Y is the real projective plane, we see that H_4(widetilde Y, Z) = H_3(widetilde Y, Z) = 0 since widetilde Y is a 2-dimensional CW-space. The exact sequence implies π_3widetilde Y ≅ H_4(K(π_2widetilde Y,2), Z ). Furthermore, π_3widetilde Y = π_3 Y. The following commands establish that π_3Y ≅ Z.  Example  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 ]   3.6-2 Second example: the Hopf invariant The following commands construct a 4-dimensional simplicial complex Y with 9 vertices and 36 4-dimensional simplices, and establish that π_1Y=0 , π_2Y= Z , H_3(Y, Z)=0, H_4(Y, Z)= Z.  Example  gap> smp:=[ [ 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> K:=MaximalSimplicesToSimplicialComplex(smp); 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 ]   Previous commands have established H_4(K( Z,2), Z)= Z. So Whitehead's sequence reduces to an exact sequence Z → Z → π_3Y → 0 in which the first map is H_4(Y, Z)= Z → H_4(K(π_2Y,2), Z )= Z. Hence π_3Y is cyclic. HAP is currently unable to compute the order of π_3Y directly from Whitehead's sequence. Instead, we can use the Hopf invariant. For any map ϕ: S^3 → S^2 we consider the space C(ϕ) = S^2 ∪_ϕ e^4 obtained by attaching a 4-cell e^4 to S^2 via the attaching map ϕ. The cohomology groups H^2(C(ϕ), Z)= Z, H^4(C(ϕ), Z)= Z are generated by elements α, β say, and the cup product has the form - ∪ -: H^2(C(ϕ), Z)× H^2(C(ϕ), Z) → H^4(C(ϕ), Z), (α,α) ↦ h_ϕ β for some integer h_ϕ. The integer h_ϕ is the Hopf invariant. The function h: π_3(S^3)→ Z is a homomorphism and there is an isomorphism π_3(S^2∪ e^4) ≅ Z/⟨ h_ϕ⟩. The following commands begin by simplifying the cell structure on the above CW-complex Y≅ K to obtain a homeomorphic CW-complex W with fewer cells. They then create a space S by removing one 4-cell from W. The space S is seen to be homotopy equivalent to a CW-complex e^2∪ e^0 with a single 0-cell and single 2-cell. Hence S≃ S^2 is homotopy equivalent to the 2-sphere. Consequently Y ≃ C(ϕ ) = S^2∪_ϕ e^4 for some map ϕ: S^3 → S^2.  Example  gap> W:=SimplifiedComplex(Y); Regular CW-complex of dimension 4  gap> S:=RegularCWComplexWithRemovedCell(W,4,6); Regular CW-complex of dimension 4  gap> CriticalCells(S); [ [ 2, 6 ], [ 0, 5 ] ]   The next commands show that the map ϕ in the construction Y ≃ C(ϕ) has Hopf invariant -1. Hence h: π_3(S^3)→ Z is an isomorphism. Therefore π_3Y=0.  Example  gap> IntersectionForm(K); [ [ -1 ] ]   [The simplicial complex K in this second example is due to W. Kuehnel and T. F. Banchoff and is homeomorphic to the complex projective plane. ] 3.7 Computing the second homotopy group of a space with infinite fundamental group The following commands compute the second integral homology H_2(π_1W, Z) = Z of the fundamental group π_1W of the complement W of the Hopf-Satoh surface.  Example  gap> L:=HopfSatohSurface(); Pure cubical complex of dimension 4.  gap> W:=ContractedComplex(RegularCWComplex(PureComplexComplement(L))); Regular CW-complex of dimension 3  gap> GW:=FundamentalGroup(W);; gap> IsAspherical(GW); Presentation is aspherical. true gap> R:=ResolutionAsphericalPresentation(GW);; gap> Homology(TensorWithIntegers(R),2); [ 0 ]   From Hopf's exact sequence π_2W stackrelh⟶ H_2(W, Z) ↠ H_2(π_1W, Z) → 0 and the computation H_2(W, Z)= Z^4 we see that the image of the Hurewicz homomorphism is im(h)= Z^3 . The image of h is referred to as the subgroup of spherical homology classes and often denoted by Σ^2W. The following command computes the presentation of π_1W corresponding to the 2-skeleton W^2 and establishes that W^2 = S^2∨ S^2 ∨ S^2 ∨ (S^1× S^1) is a wedge of three spheres and a torus.  Example  gap> F:=FundamentalGroupOfRegularCWComplex(W,"no simplification"); < fp group on the generators [ f1, f2 ]> gap> RelatorsOfFpGroup(F); [ < identity ...>, f1^-1*f2^-1*f1*f2, < identity ...>, ]   The next command shows that the 3-dimensional space W has two 3-cells each of which is attached to the base-point of W with trivial boundary (up to homotopy in W^2). Hence W = S^3∨ S^3∨ S^2 ∨ S^2 ∨ S^2 ∨ (S^1× S^1).  Example  gap> CriticalCells(W); [ [ 3, 1 ], [ 3, 3148 ], [ 2, 6746 ], [ 2, 20510 ], [ 2, 33060 ],   [ 2, 50919 ], [ 1, 29368 ], [ 1, 50822 ], [ 0, 21131 ] ] gap> CriticalBoundaryCells(W,3,1); [ ] gap> CriticalBoundaryCells(W,3,3148); [ -50919, 50919 ]   Therefore π_1W is the free abelian group on two generators, and π_2W is the free Zπ_1W-module on three free generators.