<Chapter><Heading>Simplicial complexes &amp; CW complexes</Heading>
<Section><Heading>The Klein bottle as a simplicial complex</Heading>

<P/>
<Alt Only="HTML">&lt;img src="images/klein.jpg" align="center" width="250" alt="Klein bottle"/>
&lt;img src="images/kleingrid.jpg" align="center" width="250"/ alt="simplicial Klein bottle"></Alt>

<P/> The following example constructs the Klein bottle as a simplicial complex <M>K</M> on <M>9</M> vertices, and then constructs the cellular chain complex
<M>C_\ast=C_\ast(K)</M> from which the integral homology groups
 <M>H_1(K,\mathbb Z)=\mathbb Z_2\oplus \mathbb Z</M>, <M>H_2(K,\mathbb Z)=0</M> are computed. The  chain complex 
<M>D_\ast=C_\ast \otimes_{\mathbb Z} \mathbb Z_2</M> is also constructed and used to compute the mod-<M>2</M> homology vector spaces
<M>H_1(K,\mathbb Z_2)=\mathbb Z_2\oplus \mathbb Z_2</M>, <M>H_2(K,\mathbb Z)=\mathbb Z_2</M>.
Finally, a presentation  <M>\pi_1(K) = \langle
x,y : yxy^{-1}x\rangle</M> is computed for the fundamental group of <M>K</M>. 

<Example>
<#Include SYSTEM "tutex/1.1.txt">
</Example>

</Section>
<Section><Heading>The Quillen complex</Heading>
 
<P/> Given a group <M>G </M> one can consider the partially ordered set 
<M>{\cal A}_p(G)</M>
of all non-trivial
elementary abelian <M>p</M>-subgroups of <M>G</M>, the partial order being set inclusion.
The order complex  <M>\Delta{\cal A}_p(G)</M> is a simplicial complex which is
called
 the <E>Quillen complex </E>.

<P/> The following example constructs  the
Quillen complex <M>\Delta{\cal A}_2(S_7)</M>
for the symmetric group of degree <M>7</M> and 
<M>p=2</M>. This  simplicial complex involves  <M>11291</M> simplices, of which
<M>4410</M> are <M>2</M>-simplices..

<Example>
<#Include SYSTEM "tutex/1.2.txt">
</Example>

</Section>
<Section><Heading>The Quillen complex as a reduced CW-complex</Heading>
Any simplicial complex <M>K</M> can be regarded as a regular CW complex.
Different datatypes are used in  <B>HAP</B>  for these two notions.
The following continuation of the above Quillen complex example 
constructs a regular CW complex <M>Y</M>
isomorphic to (i.e. with the same face lattice as) <M>K=\Delta{\cal A}_2(S_7)</M>. An advantage to working in the category of CW complexes is that
it may be possible to find a CW complex <M>X</M> homotopy equivalent to <M>Y</M> but with fewer cells than <M>Y</M>. The cellular chain complex <M>C_\ast(X)</M> of such a CW complex <M>X</M> is computed by the following commands. 
From the number of free generators of <M>C_\ast(X)</M>, which correspond to the cells of <M>X</M>, we see that  there is a single <M>0</M>-cell and <M>160</M> <M>2</M>-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 <M>160</M> <M>2</M>-spheres.
This homotopy equivalence 
is given in <Cite Key="ksontini" Where="(15.1)"/> where it was obtained by purely
theoretical  methods.

<Example>
<#Include SYSTEM "tutex/1.3.txt">
</Example>
Note that for regular  CW complexes <M>Y</M> the function
<C>ChainComplex(Y)</C> returns the cellular chain complex <M>C_\ast(X)</M>
of a (typically non-regular) CW complex <M>X</M> homotopy equivalent to <M>Y</M>. The cellular chain complex
<M>C_\ast(Y)</M> of <M>Y</M> itself can be obtained as follows.

<Example>
<#Include SYSTEM "tutex/1.4.txt">
</Example>

</Section>
<Section><Heading>Constructing a regular CW-complex from its face lattice</Heading>

<P/>
<Alt Only="HTML">&lt;img src="images/cwspace.jpg" align="center" width="250" alt="CW space"/></Alt>

<P/>The following example begins by creating a <M>2</M>-dimensional annulus <M>A</M> as 
a regular CW-complex, and testing  that it has the correct integral homology
<M>H_0(A,\mathbb Z)=\mathbb Z</M>, <M>H_1(A,\mathbb Z)=\mathbb Z</M>, <M>H_2(A,\mathbb Z)=0</M>.

<Example>
<#Include SYSTEM "tutex/1.5.txt">
</Example>

<P/>Next we construct the direct product
<M>Y=A\times A\times A\times A\times A</M> of five copies of the annulus.
This is a <M>10</M>-dimensional CW complex involving <M>248832</M> cells.
It will be homotopy equivalent <M>Y\simeq X</M> to a CW complex <M>X</M>
involving fewer cells. The CW complex <M>X</M> may be non-regular.
We compute the cochain complex <M>D_\ast = {\rm Hom}_{\mathbb Z}(C_\ast(X),\mathbb Z)</M> from which the cohomology groups
<Br/><M>H^0(Y,\mathbb Z)=\mathbb Z</M>,
<Br/><M>H^1(Y,\mathbb Z)=\mathbb Z^5</M>,
<Br/><M>H^2(Y,\mathbb Z)=\mathbb Z^{10}</M>,
<Br/><M>H^3(Y,\mathbb Z)=\mathbb Z^{10}</M>,
<Br/><M>H^4(Y,\mathbb Z)=\mathbb Z^5</M>,
<Br/><M>H^5(Y,\mathbb Z)=\mathbb Z</M>,
<Br/><M>H^6(Y,\mathbb Z)=0</M><Br/>
are obtained.

<Example>
<#Include SYSTEM "tutex/1.6.txt">
</Example>

</Section>
<Section><Heading>Cup products</Heading>

<P/>Continuing with the previous example, we consider 
the first and fifth generators <M>g_1^1, g_5^1\in H^1(W,\mathbb Z) =\mathbb Z^5</M>
and establish that their cup product <M> g_1^1 \cup g_5^1 = - g_7^2 \in H^2(W,\mathbb Z) =\mathbb Z^{10}</M> is equal to minus the seventh generator of <M>H^2(W,\mathbb Z)</M>.
We also verify that <M>g_5^1\cup g_1^1 = - g_1^1 \cup g_5^1</M>.

<Example>
<#Include SYSTEM "tutex/1.7.txt">
</Example>

<P/>This computation of low-dimensional cup products is achieved using group-theoretic methods to approximate the diagonal map <M>\Delta \colon Y \rightarrow  Y\times Y</M> in dimensions <M>\le 2</M>. In order to construct cup products in
higher degrees <B>HAP</B> requires a cellular inclusion <M>\overline Y \hookrightarrow Y\times Y</M> with projection <M>p\colon \overline Y \twoheadrightarrow Y</M> that induces isomorphisms on integral homology.
The function <C>DiagonalApproximation(Y)</C> constructs a candidate inclusion,
but the projection <M>p\colon \overline Y \twoheadrightarrow Y</M> 
needs to be tested for homology equivalence. If the candidate inclusion
 passes this test then the function <C>CupProduct(Y)</C>,  involving
 the candidate space,  can be used for cup products.  

<P/>The following example calculates <M>g_3^3 \cup g_3^1 = g_1^4</M> where
<M>W=S\times S\times S\times S</M> is  the 
direct product of four circles, and where
<M>g_k^n</M> denotes the <M>k</M>-th generator of <M>H^n(W,\mathbb Z)</M>. 

<Example>
<#Include SYSTEM "tutex/1.8.txt">
</Example>


</Section>
<Section><Heading>CW maps and induced homomorphisms</Heading>

<P/>A <E>strictly cellular</E> map <M>f\colon X\rightarrow Y</M> 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 <B>HAP</B>, and their induced homomorphisms on (co)homology and on fundamental groups can be computed. 

<P/>
The following example begins by visualizing the trefoil knot
<M>\kappa \in \mathbb R^3</M>. It then constructs a regular 
CW structure on the complement <M>Y= D^3\setminus {\rm Nbhd}(\kappa) </M> 
of a small tubular open neighbourhood of
the knot lying inside a large closed ball <M>D^3</M>. The boundary of this
tubular neighbourhood is a <M>2</M>-dimensional CW-complex <M>B</M> homeomorphic to a torus <M>\mathbb S^1\times \mathbb S^1</M> with 
fundamental group <M>\pi_1(B)=&lt;a,b\, :\, aba^{-1}b^{-1}=1></M>.  The inclusion map
<M>f\colon B\hookrightarrow Y</M> is constructed. Then a presentation
<M>\pi_1(Y)= &lt;x,y\, |\, xy^{-1}x^{-1}yx^{-1}y^{-1}></M> 
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 <E>peripheral system</E> and is known to contain sufficient information to characterize the knot up to ambient isotopy.

<P/> Finally, it is verified that the induced homology homomorphism <M>H_2(B,\mathbb Z) \rightarrow H_2(Y,\mathbb Z)</M> is an isomomorphism.

<Example>
<#Include SYSTEM "tutex/1.9.txt">
</Example>
<Alt Only="HTML">&lt;img src="images/trefoil.png" align="center" width="150" alt="trefoil knot"/></Alt>
<Example>
<#Include SYSTEM "tutex/1.10.txt">
</Example>




</Section>
</Chapter>
