  
  [1X1 [33X[0;0YSimplicial complexes & CW complexes[133X[101X
  
  
  [1X1.1 [33X[0;0YThe Klein bottle as a simplicial complex[133X[101X
  
  [33X[0;0YThe  following example constructs the Klein bottle as a simplicial complex [22XK[122X
  on  [22X9[122X  vertices,  and  then constructs the cellular chain complex [22XC_∗=C_∗(K)[122X
  from  which  the integral homology groups [22XH_1(K, Z)= Z_2⊕ Z[122X, [22XH_2(K, Z)=0[122X are
  computed. The chain complex [22XD_∗=C_∗ ⊗_ Z Z_2[122X is also constructed and used to
  compute  the  mod-[22X2[122X homology vector spaces [22XH_1(K, Z_2)= Z_2⊕ Z_2[122X, [22XH_2(K, Z)=
  Z_2[122X.  Finally,  a presentation [22Xπ_1(K) = ⟨ x,y : yxy^-1x⟩[122X is computed for the
  fundamental group of [22XK[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27X2simplices:=[127X[104X
    [4X[25X>[125X [27X[[1,2,5], [2,5,8], [2,3,8], [3,8,9], [1,3,9], [1,4,9],[127X[104X
    [4X[25X>[125X [27X [4,5,8], [4,6,8], [6,8,9], [6,7,9], [4,7,9], [4,5,7],[127X[104X
    [4X[25X>[125X [27X [1,4,6], [1,2,6], [2,6,7], [2,3,7], [3,5,7], [1,3,5]];;[127X[104X
    [4X[25Xgap>[125X [27XK:=SimplicialComplex(2simplices);[127X[104X
    [4X[28XSimplicial complex of dimension 2.[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XC:=ChainComplex(K);[127X[104X
    [4X[28XChain complex of length 2 in characteristic 0 .[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XHomology(C,1);[127X[104X
    [4X[28X[ 2, 0 ][128X[104X
    [4X[25Xgap>[125X [27XHomology(C,2);[127X[104X
    [4X[28X[  ][128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XD:=TensorWithIntegersModP(C,2);[127X[104X
    [4X[28XChain complex of length 2 in characteristic 2 .[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XHomology(D,1);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XHomology(D,2);[127X[104X
    [4X[28X1[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG:=FundamentalGroup(K);[127X[104X
    [4X[28X<fp group of size infinity on the generators [ f1, f2 ]>[128X[104X
    [4X[25Xgap>[125X [27XRelatorsOfFpGroup(G);[127X[104X
    [4X[28X[ f2*f1*f2^-1*f1 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X1.2 [33X[0;0YThe Quillen complex[133X[101X
  
  [33X[0;0YGiven a group [22XG[122X one can consider the partially ordered set [22Xcal A_p(G)[122X of all
  non-trivial elementary abelian [22Xp[122X-subgroups of [22XG[122X, the partial order being set
  inclusion.  The  order  complex [22X∆cal A_p(G)[122X is a simplicial complex which is
  called the [13XQuillen complex [113X.[133X
  
  [33X[0;0YThe  following  example constructs the Quillen complex [22X∆cal A_2(S_7)[122X for the
  symmetric  group of degree [22X7[122X and [22Xp=2[122X. This simplicial complex involves [22X11291[122X
  simplices, of which [22X4410[122X are [22X2[122X-simplices..[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XK:=QuillenComplex(SymmetricGroup(7),2);[127X[104X
    [4X[28XSimplicial complex of dimension 2.[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XSize(K);[127X[104X
    [4X[28X11291[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XK!.nrSimplices(2);[127X[104X
    [4X[28X4410[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X1.3 [33X[0;0YThe Quillen complex as a reduced CW-complex[133X[101X
  
  [33X[0;0YAny  simplicial complex [22XK[122X can be regarded as a regular CW complex. Different
  datatypes  are used in [12XHAP[112X for these two notions. The following continuation
  of  the  above  Quillen  complex  example  constructs a regular CW complex [22XY[122X
  isomorphic  to  (i.e.  with  the  same  face lattice as) [22XK=∆cal A_2(S_7)[122X. An
  advantage  to  working  in  the  category  of CW complexes is that it may be
  possible  to  find  a  CW  complex [22XX[122X homotopy equivalent to [22XY[122X but with fewer
  cells  than  [22XY[122X.  The cellular chain complex [22XC_∗(X)[122X of such a CW complex [22XX[122X is
  computed  by  the  following commands. From the number of free generators of
  [22XC_∗(X)[122X,  which  correspond  to the cells of [22XX[122X, we see that there is a single
  [22X0[122X-cell  and  [22X160[122X  [22X2[122X-cells.  Thus the Quillen complex $$\Delta{\cal A}_2(S_7)
  \simeq \bigvee_{1\le i\le 160} S^2$$ has the homotopy type of a wedge of [22X160[122X
  [22X2[122X-spheres.  This  homotopy  equivalence is given in [Kso00, (15.1)] where it
  was obtained by purely theoretical methods.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XY:=RegularCWComplex(K);[127X[104X
    [4X[28XRegular CW-complex of dimension 2[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XC:=ChainComplex(Y);[127X[104X
    [4X[28XChain complex of length 2 in characteristic 0 . [128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XC!.dimension(0);[127X[104X
    [4X[28X1[128X[104X
    [4X[25Xgap>[125X [27XC!.dimension(1);[127X[104X
    [4X[28X0[128X[104X
    [4X[25Xgap>[125X [27XC!.dimension(2);[127X[104X
    [4X[28X160[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YNote  that  for  regular CW complexes [22XY[122X the function [10XChainComplex(Y)[110X returns
  the  cellular chain complex [22XC_∗(X)[122X of a (typically non-regular) CW complex [22XX[122X
  homotopy  equivalent to [22XY[122X. The cellular chain complex [22XC_∗(Y)[122X of [22XY[122X itself can
  be obtained as follows.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XCC:=ChainComplexOfRegularCWComplex(Y);[127X[104X
    [4X[28XChain complex of length 2 in characteristic 0 . [128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XCC!.dimension(0);[127X[104X
    [4X[28X1316[128X[104X
    [4X[25Xgap>[125X [27XCC!.dimension(1);[127X[104X
    [4X[28X5565[128X[104X
    [4X[25Xgap>[125X [27XCC!.dimension(2);[127X[104X
    [4X[28X4410[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X1.4 [33X[0;0YConstructing a regular CW-complex from its face lattice[133X[101X
  
  [33X[0;0YThe  following  example  begins  by  creating a [22X2[122X-dimensional annulus [22XA[122X as a
  regular  CW-complex,  and  testing that it has the correct integral homology
  [22XH_0(A, Z)= Z[122X, [22XH_1(A, Z)= Z[122X, [22XH_2(A, Z)=0[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFL:=[];; #The face lattice[127X[104X
    [4X[25Xgap>[125X [27XFL[1]:=[[1,0],[1,0],[1,0],[1,0]];;[127X[104X
    [4X[25Xgap>[125X [27XFL[2]:=[[2,1,2],[2,3,4],[2,1,4],[2,2,3],[2,1,4],[2,2,3]];;[127X[104X
    [4X[25Xgap>[125X [27XFL[3]:=[[4,1,2,3,4],[4,1,2,5,6]];;[127X[104X
    [4X[25Xgap>[125X [27XFL[4]:=[];;[127X[104X
    [4X[25Xgap>[125X [27XA:=RegularCWComplex(FL);[127X[104X
    [4X[28XRegular CW-complex of dimension 2[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XHomology(A,0);[127X[104X
    [4X[28X[ 0 ][128X[104X
    [4X[25Xgap>[125X [27XHomology(A,1);[127X[104X
    [4X[28X[ 0 ][128X[104X
    [4X[25Xgap>[125X [27XHomology(A,2);[127X[104X
    [4X[28X[  ][128X[104X
    [4X[28X[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YNext  we  construct the direct product [22XY=A× A× A× A× A[122X of five copies of the
  annulus. This is a [22X10[122X-dimensional CW complex involving [22X248832[122X cells. It will
  be  homotopy equivalent [22XY≃ X[122X to a CW complex [22XX[122X involving fewer cells. The CW
  complex  [22XX[122X  may  be  non-regular.  We compute the cochain complex [22XD_∗ = Hom_
  Z(C_∗(X), Z)[122X from which the cohomology groups[133X
  [33X[0;0Y[22XH^0(Y, Z)= Z[122X,[133X
  [33X[0;0Y[22XH^1(Y, Z)= Z^5[122X,[133X
  [33X[0;0Y[22XH^2(Y, Z)= Z^10[122X,[133X
  [33X[0;0Y[22XH^3(Y, Z)= Z^10[122X,[133X
  [33X[0;0Y[22XH^4(Y, Z)= Z^5[122X,[133X
  [33X[0;0Y[22XH^5(Y, Z)= Z[122X,[133X
  [33X[0;0Y[22XH^6(Y, Z)=0[122X[133X
  [33X[0;0Yare obtained.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XY:=DirectProduct(A,A,A,A,A);[127X[104X
    [4X[28XRegular CW-complex of dimension 10[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XSize(Y);[127X[104X
    [4X[28X248832[128X[104X
    [4X[25Xgap>[125X [27XC:=ChainComplex(Y);[127X[104X
    [4X[28XChain complex of length 10 in characteristic 0 . [128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XD:=HomToIntegers(C);[127X[104X
    [4X[28XCochain complex of length 10 in characteristic 0 . [128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XCohomology(D,0);[127X[104X
    [4X[28X[ 0 ][128X[104X
    [4X[25Xgap>[125X [27XCohomology(D,1);[127X[104X
    [4X[28X[ 0, 0, 0, 0, 0 ][128X[104X
    [4X[25Xgap>[125X [27XCohomology(D,2);[127X[104X
    [4X[28X[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ][128X[104X
    [4X[25Xgap>[125X [27XCohomology(D,3);[127X[104X
    [4X[28X[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ][128X[104X
    [4X[25Xgap>[125X [27XCohomology(D,4);[127X[104X
    [4X[28X[ 0, 0, 0, 0, 0 ][128X[104X
    [4X[25Xgap>[125X [27XCohomology(D,5);[127X[104X
    [4X[28X[ 0 ][128X[104X
    [4X[25Xgap>[125X [27XCohomology(D,6);[127X[104X
    [4X[28X[  ][128X[104X
    [4X[28X[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X1.5 [33X[0;0YCup products[133X[101X
  
  [33X[0;0YContinuing  with  the  previous  example,  we  consider  the first and fifth
  generators  [22Xg_1^1,  g_5^1∈  H^1(W,  Z)  =  Z^5[122X  and establish that their cup
  product  [22Xg_1^1  ∪  g_5^1  = - g_7^2 ∈ H^2(W, Z) = Z^10[122X is equal to minus the
  seventh generator of [22XH^2(W, Z)[122X. We also verify that [22Xg_5^1∪ g_1^1 = - g_1^1 ∪
  g_5^1[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xcup11:=CupProduct(FundamentalGroup(Y));[127X[104X
    [4X[28Xfunction( a, b ) ... end[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xcup11([1,0,0,0,0],[0,0,0,0,1]);[127X[104X
    [4X[28X[ 0, 0, 0, 0, 0, 0, -1, 0, 0, 0 ][128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xcup11([0,0,0,0,1],[1,0,0,0,0]);[127X[104X
    [4X[28X[ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ][128X[104X
    [4X[28X[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThis   computation   of  low-dimensional  cup  products  is  achieved  using
  group-theoretic  methods  to  approximate  the  diagonal map [22X∆ : Y → Y× Y[122X in
  dimensions  [22Xle  2[122X.  In order to construct cup products in higher degrees [12XHAP[112X
  requires  a cellular inclusion [22Xoverline Y ↪ Y× Y[122X with projection [22Xp: overline
  Y  ↠  Y[122X  that  induces  isomorphisms  on  integral  homology.  The  function
  [10XDiagonalApproximation(Y)[110X   constructs   a   candidate   inclusion,  but  the
  projection [22Xp: overline Y ↠ Y[122X needs to be tested for homology equivalence. If
  the  candidate  inclusion  passes this test then the function [10XCupProduct(Y)[110X,
  involving the candidate space, can be used for cup products.[133X
  
  [33X[0;0YThe following example calculates [22Xg_3^3 ∪ g_3^1 = g_1^4[122X where [22XW=S× S× S× S[122X is
  the  direct  product  of  four  circles,  and  where  [22Xg_k^n[122X denotes the [22Xk[122X-th
  generator of [22XH^n(W, Z)[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=SimplicialComplex([[1,2],[2,3],[1,3]]);;[127X[104X
    [4X[25Xgap>[125X [27XS:=RegularCWComplex(S);;[127X[104X
    [4X[25Xgap>[125X [27XW:=DirectProduct(S,S,S,S);;[127X[104X
    [4X[25Xgap>[125X [27Xcup:=CupProduct(W);[127X[104X
    [4X[28Xfunction( p, q, vv, ww ) ... end[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xcup(3,1,[0,0,1,0],[0,0,1,0]);[127X[104X
    [4X[28X[ 1 ][128X[104X
    [4X[28X	  [128X[104X
    [4X[28X#Now test that the diagonal construction is valid.[128X[104X
    [4X[25Xgap>[125X [27XD:=DiagonalApproximation(W);;[127X[104X
    [4X[25Xgap>[125X [27Xp:=D!.projection;[127X[104X
    [4X[28XMap of regular CW-complexes[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XP:=ChainMap(p);[127X[104X
    [4X[28XChain Map between complexes of length 4 . [128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphismOfAbelianFpGroups(Homology(P,0));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphismOfAbelianFpGroups(Homology(P,1));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphismOfAbelianFpGroups(Homology(P,2));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphismOfAbelianFpGroups(Homology(P,3));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphismOfAbelianFpGroups(Homology(P,4));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X1.6 [33X[0;0YCW maps and induced homomorphisms[133X[101X
  
  [33X[0;0YA  [13Xstrictly  cellular[113X  map [22Xf: X→ Y[122X of regular CW-complexes is a cellular map
  for  which  the  image  of any cell is a cell (of possibly lower dimension).
  Inclusions  of  CW-subcomplexes,  and projections from a direct product to a
  factor, are examples of such maps. Strictly cellular maps can be represented
  in  [12XHAP[112X,  and their induced homomorphisms on (co)homology and on fundamental
  groups can be computed.[133X
  
  [33X[0;0YThe  following  example  begins  by visualizing the trefoil knot [22Xκ ∈ R^3[122X. It
  then  constructs a regular CW structure on the complement [22XY= D^3∖ Nbhd(κ)[122X of
  a  small  tubular open neighbourhood of the knot lying inside a large closed
  ball  [22XD^3[122X.  The  boundary  of  this tubular neighbourhood is a [22X2[122X-dimensional
  CW-complex  [22XB[122X  homeomorphic  to  a  torus  [22XS^1×  S^1[122X  with fundamental group
  [22Xπ_1(B)=<a,b  : aba^-1b^-1=1>[122X. The inclusion map [22Xf: B↪ Y[122X is constructed. Then
  a   presentation   [22Xπ_1(Y)=   <x,y  |  xy^-1x^-1yx^-1y^-1>[122X  and  the  induced
  homomorphism  $$\pi_1(B)\rightarrow  \pi_1(Y),  a\mapsto  y^{-1}xy^2xy^{-1},
  b\mapsto  y  $$  are  computed. This induced homomorphism is an example of a
  [13Xperipheral  system[113X  and  is  known  to  contain  sufficient  information  to
  characterize the knot up to ambient isotopy.[133X
  
  [33X[0;0YFinally,  it  is verified that the induced homology homomorphism [22XH_2(B, Z) →
  H_2(Y, Z)[122X is an isomomorphism.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XK:=PureCubicalKnot(3,1);;[127X[104X
    [4X[25Xgap>[125X [27XViewPureCubicalKnot(K);;[127X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XK:=PureCubicalKnot(3,1);;[127X[104X
    [4X[25Xgap>[125X [27Xf:=KnotComplementWithBoundary(ArcPresentation(K));[127X[104X
    [4X[28XMap of regular CW-complexes[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG:=FundamentalGroup(Target(f));[127X[104X
    [4X[28X<fp group of size infinity on the generators [ f1, f2 ]>[128X[104X
    [4X[25Xgap>[125X [27XRelatorsOfFpGroup(G);[127X[104X
    [4X[28X[ f1*f2^-1*f1^-1*f2*f1^-1*f2^-1 ][128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XF:=FundamentalGroup(f);[127X[104X
    [4X[28X[ f1, f2 ] -> [ f2^-1*f1*f2^2*f1*f2^-1, f1 ][128X[104X
    [4X[28X[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xphi:=ChainMap(f);[127X[104X
    [4X[28XChain Map between complexes of length 2 . [128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XH:=Homology(phi,2);[127X[104X
    [4X[28X[ g1 ] -> [ g1 ][128X[104X
    [4X[28X[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
