% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[a4paper,11pt]{report}

\usepackage[top=37mm,bottom=37mm,left=27mm,right=27mm]{geometry}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}

\definecolor{linkColor}{rgb}{0.0,0.0,0.554}
\definecolor{citeColor}{rgb}{0.0,0.0,0.554}
\definecolor{fileColor}{rgb}{0.0,0.0,0.554}
\definecolor{urlColor}{rgb}{0.0,0.0,0.554}
\definecolor{promptColor}{rgb}{0.0,0.0,0.589}
\definecolor{brkpromptColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapinputColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapoutputColor}{rgb}{0.0,0.0,0.0}

%%  for a long time these were red and blue by default,
%%  now black, but keep variables to overwrite
\definecolor{FuncColor}{rgb}{0.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,0.0}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}


\usepackage{fancyvrb}

\usepackage{mathptmx,helvet}
\usepackage[T1]{fontenc}
\usepackage{textcomp}


\usepackage[
            pdftex=true,
            bookmarks=true,        
            a4paper=true,
            pdftitle={Written with GAPDoc},
            pdfcreator={LaTeX with hyperref package / GAPDoc},
            colorlinks=true,
            backref=page,
            breaklinks=true,
            linkcolor=linkColor,
            citecolor=citeColor,
            filecolor=fileColor,
            urlcolor=urlColor,
            pdfpagemode={UseNone}, 
           ]{hyperref}

\newcommand{\maintitlesize}{\fontsize{50}{55}\selectfont}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
%% were never documented, give conflicts with some additional packages

\newcommand{\GAP}{\textsf{GAP}}

%% nicer description environments, allows long labels
\usepackage{enumitem}
\setdescription{style=nextline}

%% depth of toc
\setcounter{tocdepth}{1}





%% command for ColorPrompt style examples
\newcommand{\gapprompt}[1]{\color{promptColor}{\bfseries #1}}
\newcommand{\gapbrkprompt}[1]{\color{brkpromptColor}{\bfseries #1}}
\newcommand{\gapinput}[1]{\color{gapinputColor}{#1}}


\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\mbox{}\vfill

\begin{center}{\maintitlesize \textbf{A short HAP tutorial\mbox{}}}\\
\vfill

\hypersetup{pdftitle=A short HAP tutorial}
\markright{\scriptsize \mbox{}\hfill A short HAP tutorial \hfill\mbox{}}
{\Huge \textbf{(\href{../../www/SideLinks/About/aboutContents.html} {A more comprehensive tutorial is available here}\\
 and\\
 \href{https://global.oup.com/academic/product/an-invitation-to-computational-homotopy-9780198832980} {A related book is available here}\\
 and\\
 \href{../../www/index.html} {The \textsc{HAP} home page is here})\mbox{}}}\\
\vfill

\mbox{}\\[2cm]
{\Large \textbf{Graham Ellis\mbox{}}}\\
\hypersetup{pdfauthor=Graham Ellis}
\end{center}\vfill

\mbox{}\\
\end{titlepage}

\newpage\setcounter{page}{2}
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 1 ]}}

\tableofcontents
\newpage

 
\chapter{\textcolor{Chapter }{Simplicial complexes \& CW complexes}}\logpage{[ 1, 0, 0 ]}
\hyperdef{L}{X7E5EA9587D4BCFB4}{}
{
 
\section{\textcolor{Chapter }{The Klein bottle as a simplicial complex}}\logpage{[ 1, 1, 0 ]}
\hyperdef{L}{X85691C6980034524}{}
{
 

  

 The following example constructs the Klein bottle as a simplicial complex $K$ on $9$ vertices, and then constructs the cellular chain complex $C_\ast=C_\ast(K)$ from which the integral homology groups $H_1(K,\mathbb Z)=\mathbb Z_2\oplus \mathbb Z$, $H_2(K,\mathbb Z)=0$ are computed. The chain complex $D_\ast=C_\ast \otimes_{\mathbb Z} \mathbb Z_2$ is also constructed and used to compute the mod-$2$ homology vector spaces $H_1(K,\mathbb Z_2)=\mathbb Z_2\oplus \mathbb Z_2$, $H_2(K,\mathbb Z)=\mathbb Z_2$. Finally, a presentation $\pi_1(K) = \langle x,y : yxy^{-1}x\rangle$ is computed for the fundamental group of $K$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@2simplices:=|
  !gapprompt@>| !gapinput@[[1,2,5], [2,5,8], [2,3,8], [3,8,9], [1,3,9], [1,4,9],|
  !gapprompt@>| !gapinput@ [4,5,8], [4,6,8], [6,8,9], [6,7,9], [4,7,9], [4,5,7],|
  !gapprompt@>| !gapinput@ [1,4,6], [1,2,6], [2,6,7], [2,3,7], [3,5,7], [1,3,5]];;|
  !gapprompt@gap>| !gapinput@K:=SimplicialComplex(2simplices);|
  Simplicial complex of dimension 2.
  
  !gapprompt@gap>| !gapinput@C:=ChainComplex(K);|
  Chain complex of length 2 in characteristic 0 .
  
  !gapprompt@gap>| !gapinput@Homology(C,1);|
  [ 2, 0 ]
  !gapprompt@gap>| !gapinput@Homology(C,2);|
  [  ]
  
  !gapprompt@gap>| !gapinput@D:=TensorWithIntegersModP(C,2);|
  Chain complex of length 2 in characteristic 2 .
  
  !gapprompt@gap>| !gapinput@Homology(D,1);|
  2
  !gapprompt@gap>| !gapinput@Homology(D,2);|
  1
  
  !gapprompt@gap>| !gapinput@G:=FundamentalGroup(K);|
  <fp group of size infinity on the generators [ f1, f2 ]>
  !gapprompt@gap>| !gapinput@RelatorsOfFpGroup(G);|
  [ f2*f1*f2^-1*f1 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{The Quillen complex}}\logpage{[ 1, 2, 0 ]}
\hyperdef{L}{X80A72C347D99A58E}{}
{
 

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

 The following example constructs the Quillen complex $\Delta{\cal A}_2(S_7)$ for the symmetric group of degree $7$ and $p=2$. This simplicial complex involves $11291$ simplices, of which $4410$ are $2$-simplices.. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|K:=QuillenComplex(SymmetricGroup(7),2);A
  Simplicial complex of dimension 2.
  
  @gapprompt|gap>A @gapinput|Size(K);A
  11291
  
  @gapprompt|gap>A @gapinput|K!.nrSimplices(2);A
  4410
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{The Quillen complex as a reduced CW-complex}}\logpage{[ 1, 3, 0 ]}
\hyperdef{L}{X7C4A2B8B79950232}{}
{
 Any simplicial complex $K$ can be regarded as a regular CW complex. Different datatypes are used in \textsc{HAP} for these two notions. The following continuation of the above Quillen complex
example constructs a regular CW complex $Y$ isomorphic to (i.e. with the same face lattice as) $K=\Delta{\cal A}_2(S_7)$. An advantage to working in the category of CW complexes is that it may be
possible to find a CW complex $X$ homotopy equivalent to $Y$ but with fewer cells than $Y$. The cellular chain complex $C_\ast(X)$ of such a CW complex $X$ is computed by the following commands. From the number of free generators of $C_\ast(X)$, which correspond to the cells of $X$, we see that there is a single $0$-cell and $160$ $2$-cells. Thus the Quillen complex
\$\$\texttt{\symbol{92}}Delta\texttt{\symbol{123}}\texttt{\symbol{92}}cal
A\texttt{\symbol{125}}{\textunderscore}2(S{\textunderscore}7)
\texttt{\symbol{92}}simeq
\texttt{\symbol{92}}bigvee{\textunderscore}\texttt{\symbol{123}}1\texttt{\symbol{92}}le
i\texttt{\symbol{92}}le 160\texttt{\symbol{125}} S\texttt{\symbol{94}}2\$\$
has the homotopy type of a wedge of $160$ $2$-spheres. This homotopy equivalence is given in \cite[(15.1)]{ksontini} where it was obtained by purely theoretical methods. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|Y:=RegularCWComplex(K);A
  Regular CW-complex of dimension 2
  
  @gapprompt|gap>A @gapinput|C:=ChainComplex(Y);A
  Chain complex of length 2 in characteristic 0 . 
  
  @gapprompt|gap>A @gapinput|C!.dimension(0);A
  1
  @gapprompt|gap>A @gapinput|C!.dimension(1);A
  0
  @gapprompt|gap>A @gapinput|C!.dimension(2);A
  160
  
\end{Verbatim}
 Note that for regular CW complexes $Y$ the function \texttt{ChainComplex(Y)} returns the cellular chain complex $C_\ast(X)$ of a (typically non-regular) CW complex $X$ homotopy equivalent to $Y$. The cellular chain complex $C_\ast(Y)$ of $Y$ itself can be obtained as follows. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|CC:=ChainComplexOfRegularCWComplex(Y);A
  Chain complex of length 2 in characteristic 0 . 
  
  @gapprompt|gap>A @gapinput|CC!.dimension(0);A
  1316
  @gapprompt|gap>A @gapinput|CC!.dimension(1);A
  5565
  @gapprompt|gap>A @gapinput|CC!.dimension(2);A
  4410
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Constructing a regular CW-complex from its face lattice}}\logpage{[ 1, 4, 0 ]}
\hyperdef{L}{X7B7354E68025FC92}{}
{
 

  

The following example begins by creating a $2$-dimensional annulus $A$ as a regular CW-complex, and testing that it has the correct integral homology $H_0(A,\mathbb Z)=\mathbb Z$, $H_1(A,\mathbb Z)=\mathbb Z$, $H_2(A,\mathbb Z)=0$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@FL:=[];; #The face lattice|
  !gapprompt@gap>| !gapinput@FL[1]:=[[1,0],[1,0],[1,0],[1,0]];;|
  !gapprompt@gap>| !gapinput@FL[2]:=[[2,1,2],[2,3,4],[2,1,4],[2,2,3],[2,1,4],[2,2,3]];;|
  !gapprompt@gap>| !gapinput@FL[3]:=[[4,1,2,3,4],[4,1,2,5,6]];;|
  !gapprompt@gap>| !gapinput@FL[4]:=[];;|
  !gapprompt@gap>| !gapinput@A:=RegularCWComplex(FL);|
  Regular CW-complex of dimension 2
  
  !gapprompt@gap>| !gapinput@Homology(A,0);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Homology(A,1);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Homology(A,2);|
  [  ]
  
  
\end{Verbatim}
 

Next we construct the direct product $Y=A\times A\times A\times A\times A$ of five copies of the annulus. This is a $10$-dimensional CW complex involving $248832$ cells. It will be homotopy equivalent $Y\simeq X$ to a CW complex $X$ involving fewer cells. The CW complex $X$ may be non-regular. We compute the cochain complex $D_\ast = {\rm Hom}_{\mathbb Z}(C_\ast(X),\mathbb Z)$ from which the cohomology groups \\
$H^0(Y,\mathbb Z)=\mathbb Z$, \\
$H^1(Y,\mathbb Z)=\mathbb Z^5$, \\
$H^2(Y,\mathbb Z)=\mathbb Z^{10}$, \\
$H^3(Y,\mathbb Z)=\mathbb Z^{10}$, \\
$H^4(Y,\mathbb Z)=\mathbb Z^5$, \\
$H^5(Y,\mathbb Z)=\mathbb Z$, \\
$H^6(Y,\mathbb Z)=0$\\
 are obtained. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Y:=DirectProduct(A,A,A,A,A);|
  Regular CW-complex of dimension 10
  
  !gapprompt@gap>| !gapinput@Size(Y);|
  248832
  !gapprompt@gap>| !gapinput@C:=ChainComplex(Y);|
  Chain complex of length 10 in characteristic 0 . 
  
  !gapprompt@gap>| !gapinput@D:=HomToIntegers(C);|
  Cochain complex of length 10 in characteristic 0 . 
  
  !gapprompt@gap>| !gapinput@Cohomology(D,0);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Cohomology(D,1);|
  [ 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Cohomology(D,2);|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Cohomology(D,3);|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Cohomology(D,4);|
  [ 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Cohomology(D,5);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Cohomology(D,6);|
  [  ]
  
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Cup products}}\logpage{[ 1, 5, 0 ]}
\hyperdef{L}{X823FA6A9828FF473}{}
{
 

Continuing with the previous example, we consider the first and fifth
generators $g_1^1, g_5^1\in H^1(W,\mathbb Z) =\mathbb Z^5$ and establish that their cup product $ g_1^1 \cup g_5^1 = - g_7^2 \in H^2(W,\mathbb Z) =\mathbb Z^{10}$ is equal to minus the seventh generator of $H^2(W,\mathbb Z)$. We also verify that $g_5^1\cup g_1^1 = - g_1^1 \cup g_5^1$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@cup11:=CupProduct(FundamentalGroup(Y));|
  function( a, b ) ... end
  
  !gapprompt@gap>| !gapinput@cup11([1,0,0,0,0],[0,0,0,0,1]);|
  [ 0, 0, 0, 0, 0, 0, -1, 0, 0, 0 ]
  
  !gapprompt@gap>| !gapinput@cup11([0,0,0,0,1],[1,0,0,0,0]);|
  [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ]
  
  
\end{Verbatim}
 

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

The following example calculates $g_3^3 \cup g_3^1 = g_1^4$ where $W=S\times S\times S\times S$ is the direct product of four circles, and where $g_k^n$ denotes the $k$-th generator of $H^n(W,\mathbb Z)$. 
\begin{Verbatim}[commandchars=@|B,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>B @gapinput|S:=SimplicialComplex([[1,2],[2,3],[1,3]]);;B
  @gapprompt|gap>B @gapinput|S:=RegularCWComplex(S);;B
  @gapprompt|gap>B @gapinput|W:=DirectProduct(S,S,S,S);;B
  @gapprompt|gap>B @gapinput|cup:=CupProduct(W);B
  function( p, q, vv, ww ) ... end
  
  @gapprompt|gap>B @gapinput|cup(3,1,[0,0,1,0],[0,0,1,0]);B
  [ 1 ]
  	  
  #Now test that the diagonal construction is valid.
  @gapprompt|gap>B @gapinput|D:=DiagonalApproximation(W);;B
  @gapprompt|gap>B @gapinput|p:=D!.projection;B
  Map of regular CW-complexes
  
  @gapprompt|gap>B @gapinput|P:=ChainMap(p);B
  Chain Map between complexes of length 4 . 
  
  @gapprompt|gap>B @gapinput|IsIsomorphismOfAbelianFpGroups(Homology(P,0));B
  true
  @gapprompt|gap>B @gapinput|IsIsomorphismOfAbelianFpGroups(Homology(P,1));B
  true
  @gapprompt|gap>B @gapinput|IsIsomorphismOfAbelianFpGroups(Homology(P,2));B
  true
  @gapprompt|gap>B @gapinput|IsIsomorphismOfAbelianFpGroups(Homology(P,3));B
  true
  @gapprompt|gap>B @gapinput|IsIsomorphismOfAbelianFpGroups(Homology(P,4));B
  true
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{CW maps and induced homomorphisms}}\logpage{[ 1, 6, 0 ]}
\hyperdef{L}{X8771FF2885105154}{}
{
 

A \emph{strictly cellular} map $f\colon X\rightarrow Y$ 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 \textsc{HAP}, and their induced homomorphisms on (co)homology and on fundamental groups
can be computed. 

 The following example begins by visualizing the trefoil knot $\kappa \in \mathbb R^3$. It then constructs a regular CW structure on the complement $Y= D^3\setminus {\rm Nbhd}(\kappa) $ of a small tubular open neighbourhood of the knot lying inside a large closed
ball $D^3$. The boundary of this tubular neighbourhood is a $2$-dimensional CW-complex $B$ homeomorphic to a torus $\mathbb S^1\times \mathbb S^1$ with fundamental group $\pi_1(B)=<a,b\, :\, aba^{-1}b^{-1}=1>$. The inclusion map $f\colon B\hookrightarrow Y$ is constructed. Then a presentation $\pi_1(Y)= <x,y\, |\, xy^{-1}x^{-1}yx^{-1}y^{-1}>$ and the induced homomorphism
\$\$\texttt{\symbol{92}}pi{\textunderscore}1(B)\texttt{\symbol{92}}rightarrow
\texttt{\symbol{92}}pi{\textunderscore}1(Y), a\texttt{\symbol{92}}mapsto
y\texttt{\symbol{94}}\texttt{\symbol{123}}-1\texttt{\symbol{125}}xy\texttt{\symbol{94}}2xy\texttt{\symbol{94}}\texttt{\symbol{123}}-1\texttt{\symbol{125}},
b\texttt{\symbol{92}}mapsto y \$\$ are computed. This induced homomorphism is
an example of a \emph{peripheral system} and is known to contain sufficient information to characterize the knot up to
ambient isotopy. 

 Finally, it is verified that the induced homology homomorphism $H_2(B,\mathbb Z) \rightarrow H_2(Y,\mathbb Z)$ is an isomomorphism. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@K:=PureCubicalKnot(3,1);;|
  !gapprompt@gap>| !gapinput@ViewPureCubicalKnot(K);;|
  
\end{Verbatim}
  
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@K:=PureCubicalKnot(3,1);;|
  !gapprompt@gap>| !gapinput@f:=KnotComplementWithBoundary(ArcPresentation(K));|
  Map of regular CW-complexes
  
  !gapprompt@gap>| !gapinput@G:=FundamentalGroup(Target(f));|
  <fp group of size infinity on the generators [ f1, f2 ]>
  !gapprompt@gap>| !gapinput@RelatorsOfFpGroup(G);|
  [ f1*f2^-1*f1^-1*f2*f1^-1*f2^-1 ]
  
  !gapprompt@gap>| !gapinput@F:=FundamentalGroup(f);|
  [ f1, f2 ] -> [ f2^-1*f1*f2^2*f1*f2^-1, f1 ]
  
  
  !gapprompt@gap>| !gapinput@phi:=ChainMap(f);|
  Chain Map between complexes of length 2 . 
  
  !gapprompt@gap>| !gapinput@H:=Homology(phi,2);|
  [ g1 ] -> [ g1 ]
  
  
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Cubical complexes \& permutahedral complexes}}\logpage{[ 2, 0, 0 ]}
\hyperdef{L}{X7F8376F37AF80AAC}{}
{
 
\section{\textcolor{Chapter }{Cubical complexes}}\logpage{[ 2, 1, 0 ]}
\hyperdef{L}{X7D67D5F3820637AD}{}
{
 A \emph{finite simplicial complex} can be defined to be a CW-subcomplex of the canonical regular CW-structure on
a simplex $\Delta^n$ of some dimension $n$. Analogously, a \emph{finite cubical complex} is a CW-subcomplex of the regular CW-structure on a cube $[0,1]^n$ of some dimension $n$. Equivalently, but more conveniently, we can replace the unit interval $[0,1]$ by an interval $[0,k]$ with CW-structure involving $2k+1$ cells, namely one $0$-cell for each integer $0\le j\le k$ and one $1$-cell for each open interval $(j,j+1)$ for $0\le j\le k-1$. A \emph{finite cuical complex} $M$ is a CW-subcompex $M\subset [0,k_1]\times [0,k_2]\times \cdots [0,k_n]$ of a direct product of intervals, the direct product having the usual direct
product CW-structure. The equivalence of these two definitions follows from
the Gray code embedding of a mesh into a hypercube. We say that the cubical
complex has \emph{ambient dimension} $n$. A cubical complex $M$ of ambient dimension $n$ is said to be \emph{pure} if each cell lies in the boundary of an $n$-cell. In other words, $M$ is pure if it is a union of unit $n$-cubes in $\mathbb R^n$, each unit cube having vertices with integer coordinates. 

\textsc{HAP} has a datatype for finite cubical complexes, and a slightly different datatype
for pure cubical complexes. 

 The following example constructs the granny knot (the sum of a trefoil knot
with its reflection) as a $3$-dimensional pure cubical complex, and then displays it. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@K:=PureCubicalKnot(3,1);|
  prime knot 1 with 3 crossings
  
  !gapprompt@gap>| !gapinput@L:=ReflectedCubicalKnot(K);|
  Reflected( prime knot 1 with 3 crossings )
  
  !gapprompt@gap>| !gapinput@M:=KnotSum(K,L);|
  prime knot 1 with 3 crossings + Reflected( prime knot 1 with 3 crossings )
  
  !gapprompt@gap>| !gapinput@Display(M);|
  
\end{Verbatim}
  

 Next we construct the complement $Y=D^3\setminus \mathring{M}$ of the interior of the pure cubical complex $M$. Here $D^3$ is a rectangular region with $M \subset \mathring{D^3}$. This pure cubical complex $Y$ is a union of $5891$ unit $3$-cubes. We contract $Y$ to get a homotopy equivalent pure cubical complex $YY$ consisting of the union of just $775$ unit $3$-cubes. Then we convert $YY$ to a regular CW-complex $W$ involving $11939$ cells. We contract $W$ to obtain a homotopy equivalent regular CW-complex $WW$ involving $5993$ cells. Finally we compute the fundamental group of the complement of the
granny knot, and use the presentation of this group to establish that the
Alexander polynomial $P(x)$ of the granny is 

$P(x) = x^4-2x^3+3x^2-2x+1 \ .$ 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Y:=PureComplexComplement(M);|
  Pure cubical complex of dimension 3.
  
  !gapprompt@gap>| !gapinput@Size(Y);|
  5891
  
  !gapprompt@gap>| !gapinput@YY:=ZigZagContractedComplex(Y);|
  Pure cubical complex of dimension 3.
  
  !gapprompt@gap>| !gapinput@Size(YY);|
  775
  
  !gapprompt@gap>| !gapinput@W:=RegularCWComplex(YY);|
  Regular CW-complex of dimension 3
  
  !gapprompt@gap>| !gapinput@Size(W);|
  11939
  
  !gapprompt@gap>| !gapinput@WW:=ContractedComplex(W);|
  Regular CW-complex of dimension 2
  
  !gapprompt@gap>| !gapinput@Size(WW);|
  5993
  
  !gapprompt@gap>| !gapinput@G:=FundamentalGroup(WW);|
  <fp group of size infinity on the generators [ f1, f2, f3 ]>
  
  !gapprompt@gap>| !gapinput@AlexanderPolynomial(G);|
  x_1^4-2*x_1^3+3*x_1^2-2*x_1+1
  
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Permutahedral complexes}}\logpage{[ 2, 2, 0 ]}
\hyperdef{L}{X85D8195379F2A8CA}{}
{
 

A finite pure cubical complex is a union of finitely many cubes in a
tessellation of $\mathbb R^n$ by unit cubes. One can also tessellate $\mathbb R^n$ by permutahedra, and we define a finite $n$-dimensional pure \emph{permutahedral complex} to be a union of finitely many permutahdra from such a tessellation. There are
two features of pure permutahedral complexes that are particularly useful in
some situations: 
\begin{itemize}
\item  Pure permutahedral complexes are topological manifolds with boundary. 
\item  The method used for finding a smaller pure cubical complex $M'$ homotopy equivalent to a given pure cubical complex $M$ retains the homeomorphism type, and not just the homotopy type, of the space $M$.
\end{itemize}
 To illustrate these features the following example begins by reading in a
protein backbone from the online \href{https://www.rcsb.org/} {Protein Database}, and storing it as a pure cubical complex $K$. The ends of the protein have been joined, and the homology $H_i(K,\mathbb Z)=\mathbb Z$, $i=0,1$ is seen to be that of a circle. We can thus regard the protein as a knot $K\subset \mathbb R^3$. The protein is visualized as a pure permutahedral complex. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@file:=HapFile("data1V2X.pdb");;|
  !gapprompt@gap>| !gapinput@K:=ReadPDBfileAsPurePermutahedralComplex("file");|
  Pure permutahedral complex of dimension 3.
  
  !gapprompt@gap>| !gapinput@Homology(K,0);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Homology(K,1);|
  [ 0 ]
  
  Display(K);
  
\end{Verbatim}
  

An alternative method for seeing that the pure permutahedral complex $K$ has the homotopy type of a circle is to note that it is covered by open
permutahedra (small open neighbourhoods of the closed $3$-dimensional permutahedral titles) and to form the nerve $N=Nerve({\mathcal U})$ of this open covering $\mathcal U$. The nerve $N$ has the same homotopy type as $K$. The following commands establish that $N$ is a $1$-dimensional simplicial complex and display $N$ as a circular graph. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@N:=Nerve(K);|
  Simplicial complex of dimension 1.
  
  !gapprompt@gap>| !gapinput@Display(GraphOfSimplicialComplex(N));|
  
\end{Verbatim}
  

 The boundary of the pure permutahedral complex $K$ is a $2$-dimensional CW-complex $B$ homeomorphic to a torus. We next use the advantageous features of pure
permutahedral complexes to compute the homomorphism 

$\phi\colon \pi_1(B) \rightarrow \pi_1(\mathbb R^3\setminus \mathring{K}), a
\mapsto yx^{-3}y^2x^{-2}yxy^{-1}, b\mapsto yx^{-1}y^{-1}x^2y^{-1}$ 

where\\
 $\pi_1(B)=< a,b\, :\, aba^{-1}b^{-1}=1>$,\\
 $\pi_1(\mathbb R^3\setminus \mathring{K}) \cong < x,y\, :\,
y^2x^{-2}yxy^{-1}=1, yx^{-2}y^{-1}x(xy^{-1})^2=1>$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Y:=PureComplexComplement(K);|
  Pure permutahedral complex of dimension 3.
  !gapprompt@gap>| !gapinput@Size(Y);|
  418922
  
  !gapprompt@gap>| !gapinput@YY:=ZigZagContractedComplex(Y);|
  Pure permutahedral complex of dimension 3.
  !gapprompt@gap>| !gapinput@Size(YY);|
  3438
  
  !gapprompt@gap>| !gapinput@W:=RegularCWComplex(YY);|
  Regular CW-complex of dimension 3
  
  !gapprompt@gap>| !gapinput@f:=BoundaryMap(W);|
  Map of regular CW-complexes
  
  !gapprompt@gap>| !gapinput@CriticalCells(Source(f));|
  [ [ 2, 1 ], [ 2, 261 ], [ 1, 1043 ], [ 1, 1626 ], [ 0, 2892 ], [ 0, 24715 ] ]
  
  !gapprompt@gap>| !gapinput@F:=FundamentalGroup(f,2892);|
  [ f1, f2 ] -> [ f2*f1^-3*f2^2*f1^-2*f2*f1*f2^-1, f2*f1^-1*f2^-1*f1^2*f2^-1 ]
  
  !gapprompt@gap>| !gapinput@G:=Target(F);|
  <fp group on the generators [ f1, f2 ]>
  !gapprompt@gap>| !gapinput@RelatorsOfFpGroup(G);|
  [ f2^2*f1^-2*f2*f1*f2^-1, f2*f1^-2*f2^-1*f1*(f1*f2^-1)^2 ]
  
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Constructing pure cubical and permutahedral complexes}}\logpage{[ 2, 3, 0 ]}
\hyperdef{L}{X78D3037283B506E0}{}
{
 

 An $n$-dimensional pure cubical or permutahedral complex can be created from an $n$-dimensional array of 0s and 1s. The following example creates and displays
two $3$-dimensional complexes. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@A:=[[[0,0,0],[0,0,0],[0,0,0]],|
  !gapprompt@>| !gapinput@       [[1,1,1],[1,0,1],[1,1,1]],|
  !gapprompt@>| !gapinput@       [[0,0,0],[0,0,0],[0,0,0]]];;|
  !gapprompt@gap>| !gapinput@M:=PureCubicalComplex(A);|
  Pure cubical complex of dimension 3.
  
  !gapprompt@gap>| !gapinput@P:=PurePermutahedralComplex(A);|
  Pure permutahedral complex of dimension 3.
  
  !gapprompt@gap>| !gapinput@Display(M);|
  !gapprompt@gap>| !gapinput@Display(P);|
  
\end{Verbatim}
  }

 
\section{\textcolor{Chapter }{Computations in dynamical systems}}\logpage{[ 2, 4, 0 ]}
\hyperdef{L}{X8462CF66850CC3A8}{}
{
 

Pure cubical complexes can be useful for rigourous interval arithmetic
calculations in numerical analysis. They can also be useful for trying to
estimate approximations of certain numerical quantities. To illustrate the
latter we consider the \emph{Henon map} 

$f\colon \mathbb R^2 \rightarrow \mathbb R^2, \left( \begin{array}{cc} x\\ y
\end{array}\right) \mapsto \left( \begin{array}{cc} y+1-ax^2\\ bx \\
\end{array}\right) .$\\
 

Starting with $(x_0,y_0)=(0,0)$ and iterating $(x_{n+1},y_{n+1}) = f(x_n,y_n)$ with the parameter values $a=1.4$, $b=0.3$ one obtains a sequence of points which is known to be dense in the so called \emph{strange attractor} ${\cal A}$ of the Henon map. The first $10$ million points in this sequence are plotted in the following example, with
arithmetic performed to 100 decimal places of accuracy. The sequence is stored
as a $2$-dimensional pure cubical complex where each $2$-cell is square of side equal to $\epsilon =1/500$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@M:=HenonOrbit([0,0],14/10,3/10,10^7,500,100);|
  Pure cubical complex of dimension 2.
  
  !gapprompt@gap>| !gapinput@Size(M);|
  10287
  
  !gapprompt@gap>| !gapinput@Display(M);|
  
\end{Verbatim}
  

Repeating the computation but with squares of side $\epsilon =1/1000$ 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@M:=HenonOrbit([0,0],14/10,3/10,10^7,1000,100);|
  
  !gapprompt@gap>| !gapinput@Size(M);|
  24949
  
\end{Verbatim}
 

 we obtain the heuristic estimate 

$\delta \simeq \frac{ \log{ 24949}- \log{ 10287}} {\log{2}} = 1.277 $ 

 for the box-counting dimension of the attractor $\cal A$. }

 }

 
\chapter{\textcolor{Chapter }{Covering spaces}}\logpage{[ 3, 0, 0 ]}
\hyperdef{L}{X87472058788D76C0}{}
{
 

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 $\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. 
\section{\textcolor{Chapter }{Cellular chains on the universal cover}}\logpage{[ 3, 1, 0 ]}
\hyperdef{L}{X85FB4CA987BC92CC}{}
{
 

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. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@A:=[[1,1,1],[1,0,1],[1,1,1]];;|
  !gapprompt@gap>| !gapinput@S:=PureCubicalComplex(A);;|
  !gapprompt@gap>| !gapinput@T:=DirectProduct(S,S,S);;|
  !gapprompt@gap>| !gapinput@Y:=RegularCWComplex(T);;|
  Regular CW-complex of dimension 6
  
  !gapprompt@gap>| !gapinput@Size(Y);|
  110592
  
\end{Verbatim}
 

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. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|Y:=ContractedComplex(Y);;A
  @gapprompt|gap>A @gapinput|CU:=ChainComplexOfUniversalCover(Y);;A
  @gapprompt|gap>A @gapinput|List([0..Dimension(Y)],n->CU!.dimension(n));A
  [ 1, 3, 3, 1 ]
  
\end{Verbatim}
 

The next commands construct a subgroup $H < \pi_1Y$ of index $50$ and the chain complex $C_\ast\widetilde Y\otimes_{\mathbb ZH}\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$. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|L:=LowIndexSubgroupsFpGroup(CU!.group,50);;A
  @gapprompt|gap>A @gapinput|H:=L[Length(L)-1];;A
  @gapprompt|gap>A @gapinput|Index(CU!.group,H);A
  50
  @gapprompt|gap>A @gapinput|D:=TensorWithIntegersOverSubgroup(CU,H);A
  Chain complex of length 3 in characteristic 0 .
  
  @gapprompt|gap>A @gapinput|List([0..3],D!.dimension);A
  [ 50, 150, 150, 50 ]
  
\end{Verbatim}
 

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\times S^1\times S^1$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Homology(D,0);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Homology(D,1);|
  [ 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(D,2);|
  [ 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(D,3);|
  [ 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Spun knots and the Satoh tube map}}\logpage{[ 3, 2, 0 ]}
\hyperdef{L}{X7E5CC04E7E3CCDAD}{}
{
 

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 \emph{spinning} a link $K \subset \mathbb R^3$ about a plane $ P\subset \mathbb R^3$ with $P\cap K=\emptyset$, we obtain a collection $Sp(K)\subset \mathbb 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=\mathbb R^4\setminus Sp(K) = Sp(\mathbb R^3\setminus K)$ is connected with fundamental group $\pi_1Y = \mathbb Z\times \mathbb Z$ and homology groups $H_0(Y)=\mathbb Z$, $H_1(Y)=\mathbb Z^2$, $H_2(Y)=\mathbb Z^4$, $H_3(Y,\mathbb Z)=\mathbb Z^2$. The space $Y$ is only constructed up to homotopy, and for this reason is $3$-dimensional. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Hopf:=PureCubicalLink("Hopf");|
  Pure cubical link.
  
  !gapprompt@gap>| !gapinput@Y:=SpunAboutInitialHyperplane(PureComplexComplement(Hopf));|
  Regular CW-complex of dimension 3
  
  !gapprompt@gap>| !gapinput@Homology(Y,0);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Homology(Y,1);|
  [ 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(Y,2);|
  [ 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(Y,3);|
  [ 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(Y,4);|
  [  ]
  !gapprompt@gap>| !gapinput@GY:=FundamentalGroup(Y);;|
  !gapprompt@gap>| !gapinput@GeneratorsOfGroup(GY);|
  [ f2, f3 ]
  !gapprompt@gap>| !gapinput@RelatorsOfFpGroup(GY);|
  [ f3^-1*f2^-1*f3*f2 ]
  
\end{Verbatim}
 

An alternative embedding of two tori $L\subset \mathbb R^4 $ can be obtained by applying the 'tube map' of Shin Satoh to a welded Hopf link \cite{MR1758871}. The following commands construct the complement $W=\mathbb R^4\setminus L$ of this alternative embedding and show that $W $ has the same fundamental group and integral homology as $Y$ above. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@L:=HopfSatohSurface();|
  Pure cubical complex of dimension 4.
  
  !gapprompt@gap>| !gapinput@W:=ContractedComplex(RegularCWComplex(PureComplexComplement(L)));|
  Regular CW-complex of dimension 3
  
  !gapprompt@gap>| !gapinput@Homology(W,0);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Homology(W,1);|
  [ 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(W,2);|
  [ 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(W,3);|
  [ 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(W,4);|
  [  ]
  
  !gapprompt@gap>| !gapinput@GW:=FundamentalGroup(W);;|
  !gapprompt@gap>| !gapinput@GeneratorsOfGroup(GW);|
  [ f1, f2 ]
  !gapprompt@gap>| !gapinput@RelatorsOfFpGroup(GW);|
  [ f1^-1*f2^-1*f1*f2 ]
  
\end{Verbatim}
 

Despite having the same fundamental group and integral homology groups, the
above two spaces $Y$ and $W$ were shown by Kauffman and Martins \cite{MR2441256} 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. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|CY:=ChainComplexOfUniversalCover(Y);A
  Equivariant chain complex of dimension 3
  @gapprompt|gap>A @gapinput|LY:=LowIndexSubgroups(CY!.group,5);;A
  @gapprompt|gap>A @gapinput|invY:=List(LY,g->Homology(TensorWithIntegersOverSubgroup(CY,g),2));;A
  
  @gapprompt|gap>A @gapinput|CW:=ChainComplexOfUniversalCover(W);A
  Equivariant chain complex of dimension 3
  @gapprompt|gap>A @gapinput|LW:=LowIndexSubgroups(CW!.group,5);;A
  @gapprompt|gap>A @gapinput|invW:=List(LW,g->Homology(TensorWithIntegersOverSubgroup(CW,g),2));;A
  
  @gapprompt|gap>A @gapinput|SSortedList(invY)=SSortedList(invW);A
  false
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Cohomology with local coefficients}}\logpage{[ 3, 3, 0 ]}
\hyperdef{L}{X7C304A1C7EF0BA60}{}
{
 

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}$ 
\begin{Verbatim}[commandchars=@|E,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>E @gapinput|K:=PureCubicalKnot(3,1);;E
  @gapprompt|gap>E @gapinput|Y:=PureComplexComplement(K);;E
  @gapprompt|gap>E @gapinput|Y:=ContractedComplex(Y);;E
  @gapprompt|gap>E @gapinput|Y:=RegularCWComplex(Y);;E
  @gapprompt|gap>E @gapinput|Y:=SimplifiedComplex(Y);;E
  @gapprompt|gap>E @gapinput|C:=ChainComplexOfUniversalCover(Y);;E
  @gapprompt|gap>E @gapinput|G:=C!.group;;E
  @gapprompt|gap>E @gapinput|GeneratorsOfGroup(G);E
  [ f1, f2 ]
  @gapprompt|gap>E @gapinput|RelatorsOfFpGroup(G);E
  [ f2^-1*f1^-1*f2^-1*f1*f2*f1, f1^-1*f2^-1*f1^-1*f2*f1*f2 ]
  @gapprompt|gap>E @gapinput|hom:=GroupHomomorphismByImages(G,Group([[-1]]),[G.1,G.2],[[[-1]],[[-1]]]);;E
  @gapprompt|gap>E @gapinput|A:=function(x); return Determinant(Image(hom,x)); end;;E
  @gapprompt|gap>E @gapinput|D:=TensorWithTwistedIntegers(C,A); #Here the function A represents E
  @gapprompt|gap>E @gapinput|#the integers with twisted action of G.E
  Chain complex of length 3 in characteristic 0 .
  @gapprompt|gap>E @gapinput|Homology(D,0);E
  [ 2 ]
  @gapprompt|gap>E @gapinput|Homology(D,1);E
  [ 3 ]
  @gapprompt|gap>E @gapinput|Homology(D,2);E
  [ 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Distinguishing between two non-homeomorphic homotopy equivalent spaces}}\logpage{[ 3, 4, 0 ]}
\hyperdef{L}{X7A4F34B780FA2CD5}{}
{
 

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),\mathbb Z) \rightarrow H_1(\widetilde X_H,\mathbb Z)$ 

 distinguish between the homeomorphism types of the complements $X\subset \mathbb R^3$ of the granny knot and the reef knot, where $B\subset X$ is the knot boundary, and where $p\colon \widetilde X_H \rightarrow X$ is the covering map corresponding to the finite index subgroup $H < \pi_1X$. More precisely, $p^{-1}(B)$ is in general a union of path components 

$p^{-1}(B) = B_1 \cup B_2 \cup \cdots \cup B_t$ . 

 The function \texttt{FirstHomologyCoveringCokernels(f,c)} inputs an integer $c$ and the inclusion $f\colon B\hookrightarrow 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 

${\rm coker}(\ H_1(p^{-1}(B_i),\mathbb Z) \rightarrow H_1(\widetilde
X_H,\mathbb Z)\ )$ 

arising from subgroups $H < \pi_1X$ of index $c$. To distinguish between the granny and reef knots we use index $c=6$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@K:=PureCubicalKnot(3,1);;|
  !gapprompt@gap>| !gapinput@L:=ReflectedCubicalKnot(K);;|
  !gapprompt@gap>| !gapinput@granny:=KnotSum(K,L);;|
  !gapprompt@gap>| !gapinput@reef:=KnotSum(K,K);;|
  !gapprompt@gap>| !gapinput@fg:=KnotComplementWithBoundary(ArcPresentation(granny));;|
  !gapprompt@gap>| !gapinput@fr:=KnotComplementWithBoundary(ArcPresentation(reef));;|
  !gapprompt@gap>| !gapinput@a:=FirstHomologyCoveringCokernels(fg,6);;|
  !gapprompt@gap>| !gapinput@b:=FirstHomologyCoveringCokernels(fr,6);;|
  !gapprompt@gap>| !gapinput@a=b;|
  false
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{ Second homotopy groups of spaces with finite fundamental group}}\logpage{[ 3, 5, 0 ]}
\hyperdef{L}{X869FD75B84AAC7AD}{}
{
 

If $p:\widetilde Y \rightarrow Y$ is the universal covering map, 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(\widetilde Y,\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. The above computation shows that $Y$ has second homotopy group $\pi_2Y \cong \mathbb Z$. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|K:=[ [1,2,3], [1,3,4], [1,2,6], [1,5,6], [1,4,5], A
  @gapprompt|>A @gapinput|        [2,3,5], [2,4,5], [2,4,6], [3,4,6], [3,5,6]];;A
  
  @gapprompt|gap>A @gapinput|K:=MaximalSimplicesToSimplicialComplex(K);A
  Simplicial complex of dimension 2.
  
  @gapprompt|gap>A @gapinput|Y:=RegularCWComplex(K);  A
  Regular CW-complex of dimension 2
  @gapprompt|gap>A @gapinput|# Y is a regular CW-complex corresponding to the projective plane.A
  
  @gapprompt|gap>A @gapinput|U:=UniversalCover(Y);A
  Equivariant CW-complex of dimension 2
  
  @gapprompt|gap>A @gapinput|G:=U!.group;; A
  @gapprompt|gap>A @gapinput|# G is the fundamental group of Y, which by the next command A
  @gapprompt|gap>A @gapinput|# is finite of order 2.A
  @gapprompt|gap>A @gapinput|Order(G);A
  2
  
  @gapprompt|gap>A @gapinput|U:=EquivariantCWComplexToRegularCWComplex(U,Group(One(G))); A
  Regular CW-complex of dimension 2
  @gapprompt|gap>A @gapinput|#U is the universal cover of YA
  
  @gapprompt|gap>A @gapinput|Homology(U,0);A
  [ 0 ]
  @gapprompt|gap>A @gapinput|Homology(U,1);A
  [  ]
  @gapprompt|gap>A @gapinput|Homology(U,2);A
  [ 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Third homotopy groups of simply connected spaces}}\logpage{[ 3, 6, 0 ]}
\hyperdef{L}{X87F8F6C3812A7E73}{}
{
  

For any path connected space $Y$ with universal cover $\widetilde Y$ 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_3(\widetilde Y,\mathbb Z) \rightarrow 0 $ 

 due to J.H.C.Whitehead. Here $K(\pi_2(\widetilde Y),2)$ is an Eilenberg-MacLane space with second homotopy group equal to $\pi_2\widetilde Y$. 
\subsection{\textcolor{Chapter }{First example}}\logpage{[ 3, 6, 1 ]}
\hyperdef{L}{X78F3D0B97B42A34C}{}
{
 Continuing with the above example where $Y$ is the real projective plane, we see that $H_4(\widetilde Y,\mathbb Z) = H_3(\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\, $. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@A:=AbelianPcpGroup([0]);|
  Pcp-group with orders [ 0 ]
  
  !gapprompt@gap>| !gapinput@K:=EilenbergMacLaneSimplicialGroup(A,2,5);;|
  !gapprompt@gap>| !gapinput@C:=ChainComplexOfSimplicialGroup(K);|
  Chain complex of length 5 in characteristic 0 .
  
  !gapprompt@gap>| !gapinput@Homology(C,4);|
  [ 0 ]
  
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{Second example}}\logpage{[ 3, 6, 2 ]}
\hyperdef{L}{X84C89D4A7DD0CDD6}{}
{
 

 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 $. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Y:=[ [ 1, 2, 4, 5, 6 ], [ 1, 2, 4, 5, 9 ], [ 1, 2, 5, 6, 8 ], |
  !gapprompt@>| !gapinput@        [ 1, 2, 6, 4, 7 ], [ 2, 3, 4, 5, 8 ], [ 2, 3, 5, 6, 4 ], |
  !gapprompt@>| !gapinput@        [ 2, 3, 5, 6, 7 ], [ 2, 3, 6, 4, 9 ], [ 3, 1, 4, 5, 7 ],|
  !gapprompt@>| !gapinput@        [ 3, 1, 5, 6, 9 ], [ 3, 1, 6, 4, 5 ], [ 3, 1, 6, 4, 8 ], |
  !gapprompt@>| !gapinput@        [ 4, 5, 7, 8, 3 ], [ 4, 5, 7, 8, 9 ], [ 4, 5, 8, 9, 2 ], |
  !gapprompt@>| !gapinput@        [ 4, 5, 9, 7, 1 ], [ 5, 6, 7, 8, 2 ], [ 5, 6, 8, 9, 1 ],|
  !gapprompt@>| !gapinput@        [ 5, 6, 8, 9, 7 ], [ 5, 6, 9, 7, 3 ], [ 6, 4, 7, 8, 1 ], |
  !gapprompt@>| !gapinput@        [ 6, 4, 8, 9, 3 ], [ 6, 4, 9, 7, 2 ], [ 6, 4, 9, 7, 8 ], |
  !gapprompt@>| !gapinput@        [ 7, 8, 1, 2, 3 ], [ 7, 8, 1, 2, 6 ], [ 7, 8, 2, 3, 5 ],|
  !gapprompt@>| !gapinput@        [ 7, 8, 3, 1, 4 ], [ 8, 9, 1, 2, 5 ], [ 8, 9, 2, 3, 1 ], |
  !gapprompt@>| !gapinput@        [ 8, 9, 2, 3, 4 ], [ 8, 9, 3, 1, 6 ], [ 9, 7, 1, 2, 4 ], |
  !gapprompt@>| !gapinput@        [ 9, 7, 2, 3, 6 ], [ 9, 7, 3, 1, 2 ], [ 9, 7, 3, 1, 5 ] ];;|
  
  !gapprompt@gap>| !gapinput@Y:=MaximalSimplicesToSimplicialComplex(Y);|
  Simplicial complex of dimension 4.
  
  !gapprompt@gap>| !gapinput@Y:=RegularCWComplex(Y);|
  Regular CW-complex of dimension 4
  
  !gapprompt@gap>| !gapinput@Order(FundamentalGroup(Y));|
  1
  !gapprompt@gap>| !gapinput@Homology(Y,2);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@Homology(Y,3);|
  [  ]
  !gapprompt@gap>| !gapinput@Homology(Y,4);|
  [ 0 ]
  
\end{Verbatim}
 

 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$.] }

 }

 }

 
\chapter{\textcolor{Chapter }{Topological data analysis}}\logpage{[ 4, 0, 0 ]}
\hyperdef{L}{X7B7E077887694A9F}{}
{
 
\section{\textcolor{Chapter }{Persistent homology }}\logpage{[ 4, 1, 0 ]}
\hyperdef{L}{X80A70B20873378E0}{}
{
 

Pairwise distances between $74$ points from some metric space have been recorded and stored in a $74\times 74$ matrix $D$. The following commands load the matrix, construct a filtration of length $100$ on the first two dimensions of the assotiated clique complex (also known as
the \emph{Rips Complex}), and display the resulting degree $0$ persistent homology as a barcode. A single bar with label $n$ denotes $n$ bars with common starting point and common end point. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@file:=HapFile("data253a.txt");;|
  !gapprompt@gap>| !gapinput@Read(file);|
  
  !gapprompt@gap>| !gapinput@G:=SymmetricMatrixToFilteredGraph(D,100);|
  Filtered graph on 74 vertices.
  
  !gapprompt@gap>| !gapinput@K:=FilteredRegularCWComplex(CliqueComplex(G,2));|
  Filtered regular CW-complex of dimension 2
  
  !gapprompt@gap>| !gapinput@P:=PersistentBettiNumbers(K,0);;|
  !gapprompt@gap>| !gapinput@BarCodeCompactDisplay(P);|
  
\end{Verbatim}
  

 The next commands display the resulting degree $1$ persistent homology as a barcode. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@P:=PersistentBettiNumbers(K,1);;|
  !gapprompt@gap>| !gapinput@BarCodeCompactDisplay(P);|
  
\end{Verbatim}
  

 The following command displays the $1$ skeleton of the simplicial complex arizing as the $65$-th term in the filtration on the clique complex. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Y:=FiltrationTerm(K,65);|
  Regular CW-complex of dimension 1
  
  !gapprompt@gap>| !gapinput@Display(HomotopyGraph(Y));|
  
\end{Verbatim}
  

These computations suuggest that the dataset contains two persistent path
components (or clusters), and that each path component is in some sense
periodic. The final command displays one possible representation of the data
as points on two circles. 
\subsection{\textcolor{Chapter }{Background to the data}}\logpage{[ 4, 1, 1 ]}
\hyperdef{L}{X7D512DA37F789B4C}{}
{
 

Each point in the dataset was an image consisting of $732\times 761$ pixels. This point was regarded as a vector in $\mathbb R^{732\times 761}$ and the matrix $D$ was constructed using the Euclidean metric. The images were the following: 

  }

 }

 
\section{\textcolor{Chapter }{Mapper clustering}}\logpage{[ 4, 2, 0 ]}
\hyperdef{L}{X849556107A23FF7B}{}
{
 

The following example reads in a set $S$ of vectors of rational numbers. It uses the Euclidean distance $d(u,v)$ between vectors. It fixes some vector
\$u{\textunderscore}0\texttt{\symbol{92}}in S\$ and uses the associated
function $f\colon D\rightarrow [0,b] \subset \mathbb R, v\mapsto d(u_0,v)$. In addition, it uses an open cover of the interval $[0,b]$ consisting of $100$ uniformly distributed overlapping open subintervals of radius $r=29$. It also uses a simple clustering algorithm implemented in the function \texttt{cluster}. 

 These ingredients are input into the Mapper clustering procedure to produce a
simplicial complex $M$ which is intended to be a representation of the data. The complex $M$ is $1$-dimensional and the final command uses GraphViz software to visualize the
graph. The nodes of this simplicial complex are "buckets" containing data
points. A data point may reside in several buckets. The number of points in
the bucket determines the size of the node. Two nodes are connected by an edge
when their end-point nodes contain common data points. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@file:=HapFile("data134.txt");;|
  !gapprompt@gap>| !gapinput@Read(file);|
  !gapprompt@gap>| !gapinput@dx:=EuclideanApproximatedMetric;;|
  !gapprompt@gap>| !gapinput@dz:=EuclideanApproximatedMetric;;|
  !gapprompt@gap>| !gapinput@L:=List(S,x->Maximum(List(S,y->dx(x,y))));;|
  !gapprompt@gap>| !gapinput@n:=Position(L,Minimum(L));;|
  !gapprompt@gap>| !gapinput@f:=function(x); return [dx(S[n],x)]; end;;|
  !gapprompt@gap>| !gapinput@P:=30*[0..100];; P:=List(P, i->[i]);;|
  !gapprompt@gap>| !gapinput@r:=29;;|
  !gapprompt@gap>| !gapinput@epsilon:=75;;|
  !gapprompt@gap>| !gapinput@ cluster:=function(S)|
  !gapprompt@>| !gapinput@  local Y, P, C;|
  !gapprompt@>| !gapinput@  if Length(S)=0 then return S; fi;|
  !gapprompt@>| !gapinput@  Y:=VectorsToOneSkeleton(S,epsilon,dx);|
  !gapprompt@>| !gapinput@  P:=PiZero(Y);|
  !gapprompt@>| !gapinput@  C:=Classify([1..Length(S)],P[2]);|
  !gapprompt@>| !gapinput@  return List(C,x->S{x});|
  !gapprompt@>| !gapinput@ end;;|
  !gapprompt@gap>| !gapinput@M:=Mapper(S,dx,f,dz,P,r,cluster);|
  Simplicial complex of dimension 1.
  
  !gapprompt@gap>| !gapinput@Display(GraphOfSimplicialComplex(M));|
  
\end{Verbatim}
  
\subsection{\textcolor{Chapter }{Background to the data}}\logpage{[ 4, 2, 1 ]}
\hyperdef{L}{X7D512DA37F789B4C}{}
{
 

 The datacloud $S$ consists of the $400$ points in the plane shown in the following picture. 

  }

 }

 
\section{\textcolor{Chapter }{Digital image analysis}}\logpage{[ 4, 3, 0 ]}
\hyperdef{L}{X825C5B837A08F579}{}
{
 

The following example reads in a digital image as a filtered pure cubical
complexex. The filtration is obtained by thresholding at a sequence of
uniformly spaced values on the greyscale range. The persistent homology of
this filtered complex is calculated in degrees $0$ and $1$ and displayed as two barcodes. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@file:=HapFile("image1.3.2.png");;|
  !gapprompt@gap>| !gapinput@F:=ReadImageAsFilteredPureCubicalComplex(file,20);|
  Filtered pure cubical complex of dimension 2.
  !gapprompt@gap>| !gapinput@P:=PersistentBettiNumbers(F,0);;|
  !gapprompt@gap>| !gapinput@BarCodeCompactDisplay(P);|
  
\end{Verbatim}
  
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@P:=PersistentBettiNumbers(F,1);;|
  !gapprompt@gap>| !gapinput@BarCodeCompactDisplay(P);|
  
\end{Verbatim}
  

The $20$ persistent bars in the degree $0$ barcode suggest that the image has $20$ objects. The degree $1$ barcode suggests that $14$ (or possibly $17$) of these objects have holes in them. 
\subsection{\textcolor{Chapter }{Background to the data}}\logpage{[ 4, 3, 1 ]}
\hyperdef{L}{X7D512DA37F789B4C}{}
{
 

The following image was used in the example. 

  }

 }

 }

 
\chapter{\textcolor{Chapter }{Group theoretic computations}}\logpage{[ 5, 0, 0 ]}
\hyperdef{L}{X7C07F4BD8466991A}{}
{
 
\section{\textcolor{Chapter }{Third homotopy group of a supsension of an Eilenberg-MacLane space }}\logpage{[ 5, 1, 0 ]}
\hyperdef{L}{X86D7FBBD7E5287C9}{}
{
 

The following example uses the nonabelian tensor square of groups to compute
the third homotopy group 

$\pi_3(S(K(G,1))) = \mathbb Z^{30}$ 

of the suspension of the Eigenberg-MacLane space $K(G,1)$ for $G$ the free nilpotent group of class $2$ on four generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@F:=FreeGroup(4);;G:=NilpotentQuotient(F,2);;|
  !gapprompt@gap>| !gapinput@ThirdHomotopyGroupOfSuspensionB(G);|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Representations of knot quandles}}\logpage{[ 5, 2, 0 ]}
\hyperdef{L}{X803FDFFE78A08446}{}
{
 

 The following example constructs the finitely presented quandles associated to
the granny knot and square knot, and then computes the number of quandle
homomorphisms from these two finitely prresented quandles to the $17$-th quandle in \textsc{HAP}'s library of connected quandles of order $24$. The number of homomorphisms differs between the two cases. The computation
therefore establishes that the complement in $\mathbb R^3$ of the granny knot is not homeomorphic to the complement of the square knot. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=ConnectedQuandle(24,17,"import");;|
  !gapprompt@gap>| !gapinput@K:=PureCubicalKnot(3,1);;|
  !gapprompt@gap>| !gapinput@L:=ReflectedCubicalKnot(K);;|
  !gapprompt@gap>| !gapinput@square:=KnotSum(K,L);;|
  !gapprompt@gap>| !gapinput@granny:=KnotSum(K,K);;|
  !gapprompt@gap>| !gapinput@gcsquare:=GaussCodeOfPureCubicalKnot(square);;|
  !gapprompt@gap>| !gapinput@gcgranny:=GaussCodeOfPureCubicalKnot(granny);;|
  !gapprompt@gap>| !gapinput@Qsquare:=PresentationKnotQuandle(gcsquare);;|
  !gapprompt@gap>| !gapinput@Qgranny:=PresentationKnotQuandle(gcgranny);;|
  !gapprompt@gap>| !gapinput@NumberOfHomomorphisms(Qsquare,Q);|
  408
  !gapprompt@gap>| !gapinput@NumberOfHomomorphisms(Qgranny,Q);|
  24
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Aspherical $2$-complexes}}\logpage{[ 5, 3, 0 ]}
\hyperdef{L}{X8664E986873195E6}{}
{
 

The following example uses Polymake's linear programming routines to establish
that the $2$-complex associated to the group presentation $<x,y,z : xyx=yxy,\, yzy=zyz,\, xzx=zxz>$ is aspherical (that is, has contractible universal cover). The presentation is
Tietze equivalent to the presentation used in the computer code, and the
associated $2$-complexes are thus homotopy equivalent. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@F:=FreeGroup(6);;|
  !gapprompt@gap>| !gapinput@x:=F.1;;y:=F.2;;z:=F.3;;a:=F.4;;b:=F.5;;c:=F.6;;|
  !gapprompt@gap>| !gapinput@rels:=[a^-1*x*y, b^-1*y*z, c^-1*z*x, a*x*(y*a)^-1,|
  !gapprompt@>| !gapinput@   b*y*(z*b)^-1, c*z*(x*c)^-1];;|
  !gapprompt@gap>| !gapinput@Print(IsAspherical(F,rels),"\n");|
  Presentation is aspherical.
  
  true
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Bogomolov multiplier}}\logpage{[ 5, 4, 0 ]}
\hyperdef{L}{X7F719758856A443D}{}
{
 

The Bogomolov multiplier of a group is an isoclinism invariant. Using this
property, the following example shows that there are precisely three groups of
order $243$ with non-trivial Bogomolov multiplier. The groups in question are numbered 28,
29 and 30 in \textsc{GAP}'s library of small groups of order $243$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@L:=AllSmallGroups(3^5);;|
  !gapprompt@gap>| !gapinput@C:=IsoclinismClasses(L);;|
  !gapprompt@gap>| !gapinput@for c in C do|
  !gapprompt@>| !gapinput@if Length(BogomolovMultiplier(c[1]))>0 then|
  !gapprompt@>| !gapinput@Print(List(c,g->IdGroup(g)),"\n\n\n"); fi;|
  !gapprompt@>| !gapinput@od;|
  [ [ 243, 28 ], [ 243, 29 ], [ 243, 30 ] ]
  
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Cohomology of groups}}\logpage{[ 6, 0, 0 ]}
\hyperdef{L}{X7E34E2C6868F2726}{}
{
 
\section{\textcolor{Chapter }{Finite groups }}\logpage{[ 6, 1, 0 ]}
\hyperdef{L}{X807B265978F90E01}{}
{
 

 The following example computes the fourth integral cohomomogy of the Mathieu
group $M_{24}$. 

$H^4(M_{24},\mathbb Z) = \mathbb Z_{12}$ 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@GroupCohomology(MathieuGroup(24),4);|
  [ 4, 3 ]
  
\end{Verbatim}
 

The following example computes the third integral homology of the Weyl group $W=Weyl(E_8)$, a group of order $696729600$. 

$H_3(Weyl(E_8),\mathbb Z) = \mathbb Z_2 \oplus \mathbb Z_2 \oplus \mathbb
Z_{12}$ 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  p> L:=SimpleLieAlgebra("E",8,Rationals);;
  !gapprompt@gap>| !gapinput@W:=WeylGroup(RootSystem(L));;|
  !gapprompt@gap>| !gapinput@Order(W);|
  696729600
  !gapprompt@gap>| !gapinput@GroupHomology(W,3);|
  [ 2, 2, 4, 3 ]
  
\end{Verbatim}
 

The preceding calculation could be achieved more quickly by noting that $W=Weyl(E_8)$ is a Coxeter group, and by using the associated Coxeter polytope. The
following example uses this approach to compute the fourth integral homology
of $W$. It begins by displaying the Coxeter diagram of $W$, and then computes 

$H_4(Weyl(E_8),\mathbb Z) = \mathbb Z_2 \oplus \mathbb Z_2 \oplus Z_2 \oplus
\mathbb Z_2$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@D:=[[1,[2,3]],[2,[3,3]],[3,[4,3],[5,3]],[5,[6,3]],[6,[7,3]],[7,[8,3]]];;|
  !gapprompt@gap>| !gapinput@CoxeterDiagramDisplay(D);|
  
\end{Verbatim}
  
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@polytope:=CoxeterComplex_alt(D,5);;|
  !gapprompt@gap>| !gapinput@R:=FreeGResolution(polytope,5);|
  Resolution of length 5 in characteristic 0 for <matrix group with 
  8 generators> . 
  No contracting homotopy available. 
  
  !gapprompt@gap>| !gapinput@C:=TensorWithIntegers(R);|
  Chain complex of length 5 in characteristic 0 . 
  
  !gapprompt@gap>| !gapinput@Homology(C,4);|
  [ 2, 2, 2, 2 ]
  
\end{Verbatim}
 

The following example computes the sixth mod-$2$ homology of the Sylow $2$-subgroup $Syl_2(M_{24})$ of the Mathieu group $M_{24}$. 

$H_6(Syl_2(M_{24}),\mathbb Z_2) = \mathbb Z_2^{143}$ 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@GroupHomology(SylowSubgroup(MathieuGroup(24),2),6,2);|
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
  
\end{Verbatim}
 

The following example constructs the Poincare polynomial 

$p(x)=\frac{1}{-x^3+3*x^2-3*x+1}$ 

for the cohomology $H^\ast(Syl_2(M_{12},\mathbb F_2)$. The coefficient of $x^n$ in the expansion of $p(x)$ is equal to the dimension of the vector space $H^n(Syl_2(M_{12},\mathbb F_2)$. The computation involves \textsc{Singular}'s Groebner basis algorithms and the Lyndon-Hochschild-Serre spectral
sequence. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G:=SylowSubgroup(MathieuGroup(12),2);;|
  !gapprompt@gap>| !gapinput@PoincareSeriesLHS(G);|
  (1)/(-x_1^3+3*x_1^2-3*x_1+1)
  
\end{Verbatim}
 

The following example constructs the polynomial 

$p(x)=\frac{x^4-x^3+x^2-x+1}{x^6-x^5+x^4-2*x^3+x^2-x+1}$ 

whose coefficient of $x^n$ is equal to the dimension of the vector space $H^n(M_{11},\mathbb F_2)$ for all $n$ in the range $0\le n\le 14$. The coefficient is not guaranteed correct for $n\ge 15$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@PoincareSeriesPrimePart(MathieuGroup(11),2,14);|
  (x_1^4-x_1^3+x_1^2-x_1+1)/(x_1^6-x_1^5+x_1^4-2*x_1^3+x_1^2-x_1+1)
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Nilpotent groups}}\logpage{[ 6, 2, 0 ]}
\hyperdef{L}{X8463EF6A821FFB69}{}
{
 The following example computes 

$H_4(N,\mathbb Z) = \mathbb (Z_3)^4 \oplus \mathbb Z^{84}$ 

for the free nilpotent group $N$ of class $2$ on four generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@F:=FreeGroup(4);; N:=NilpotentQuotient(F,2);;|
  !gapprompt@gap>| !gapinput@GroupHomology(N,4);|
  [ 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Crystallographic groups}}\logpage{[ 6, 3, 0 ]}
\hyperdef{L}{X7DEBF2BB7D1FB144}{}
{
 

The following example computes 

$H_5(G,\mathbb Z) = \mathbb Z_2 \oplus \mathbb Z_2$ 

for the $3$-dimensional crystallographic space group $G$ with Hermann-Mauguin symbol "P62" 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@GroupHomology(SpaceGroupBBNWZ("P62"),5);|
  [ 2, 2 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Arithmetic groups}}\logpage{[ 6, 4, 0 ]}
\hyperdef{L}{X7AFFB32587D047FE}{}
{
 

The following example computes 

$H_6(SL_2({\cal O},\mathbb Z) = \mathbb Z_2$ 

for ${\cal O}$ the ring of integers of the number field $\mathbb Q(\sqrt{-2})$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@C:=ContractibleGcomplex("SL(2,O-2)");;|
  !gapprompt@gap>| !gapinput@R:=FreeGResolution(C,7);;|
  !gapprompt@gap>| !gapinput@Homology(TensorWithIntegers(R),6);|
  [ 2, 12 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Artin groups}}\logpage{[ 6, 5, 0 ]}
\hyperdef{L}{X800CB6257DC8FB3A}{}
{
 

The following example computes 

$H_5(G,\mathbb Z) = \mathbb Z_3$ 

for $G$ the classical braid group on eight strings. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@D:=[[1,[2,3]],[2,[3,3]],[3,[4,3]],[4,[5,3]],[5,[6,3]],[6,[7,3]]];;|
  !gapprompt@gap>| !gapinput@CoxeterDiagramDisplay(D);;|
  
\end{Verbatim}
  
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@R:=ResolutionArtinGroup(D,6);;|
  !gapprompt@gap>| !gapinput@C:=TensorWithIntegers(R);;|
  !gapprompt@gap>| !gapinput@Homology(C,5);|
  [ 3 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Graphs of groups}}\logpage{[ 6, 6, 0 ]}
\hyperdef{L}{X7BAFCA3680E478AE}{}
{
 

The following example computes 

$H_5(G,\mathbb Z) = \mathbb Z_2\oplus Z_2\oplus Z_2 \oplus Z_2 \oplus Z_2$ 

for $G$ the graph of groups corresponding to the amalgamated product $G=S_5*_{S_3}S_4$ of the symmetric groups $S_5$ and $S_4$ over the canonical subgroup $S_3$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S5:=SymmetricGroup(5);SetName(S5,"S5");|
  !gapprompt@gap>| !gapinput@S4:=SymmetricGroup(4);SetName(S4,"S4");|
  !gapprompt@gap>| !gapinput@A:=SymmetricGroup(3);SetName(A,"S3");|
  !gapprompt@gap>| !gapinput@AS5:=GroupHomomorphismByFunction(A,S5,x->x);|
  !gapprompt@gap>| !gapinput@AS4:=GroupHomomorphismByFunction(A,S4,x->x);|
  !gapprompt@gap>| !gapinput@D:=[S5,S4,[AS5,AS4]];|
  !gapprompt@gap>| !gapinput@GraphOfGroupsDisplay(D);|
  
\end{Verbatim}
  
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@R:=ResolutionGraphOfGroups(D,6);;|
  !gapprompt@gap>| !gapinput@Homology(TensorWithIntegers(R),5);|
  [ 2, 2, 2, 2, 2 ]
  
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Cohomology operations}}\logpage{[ 7, 0, 0 ]}
\hyperdef{L}{X81FDD09B8454C905}{}
{
 
\section{\textcolor{Chapter }{Steenrod operations on the classifying space of a finite $2$-group}}\logpage{[ 7, 1, 0 ]}
\hyperdef{L}{X80638C137E300A52}{}
{
 The following example determines a presentation for the cohomology ring $H^\ast(Syl_2(M_{12}),\mathbb Z_2)$. The Lyndon-Hochschild-Serre spectral sequence, and Groebner basis routines
from \textsc{Singular}, are used to determine how much of a resolution to compute for the
presentation. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G:=SylowSubgroup(MathieuGroup(12),2);;|
  !gapprompt@gap>| !gapinput@Mod2CohomologyRingPresentation(G);|
  Graded algebra GF(2)[ x_1, x_2, x_3, x_4, x_5, x_6, x_7 ] / 
  [ x_2*x_3, x_1*x_2, x_2*x_4, x_3^3+x_3*x_5, 
    x_1^2*x_4+x_1*x_3*x_4+x_3^2*x_4+x_3^2*x_5+x_1*x_6+x_4^2+x_4*x_5, 
    x_1^2*x_3^2+x_1*x_3*x_5+x_3^2*x_5+x_3*x_6, 
    x_1^3*x_3+x_3^2*x_4+x_3^2*x_5+x_1*x_6+x_3*x_6+x_4*x_5, 
    x_1*x_3^2*x_4+x_1*x_3*x_6+x_1*x_4*x_5+x_3*x_4^2+x_3*x_4*x_5+x_3*x_5^\
  2+x_4*x_6, x_1^2*x_3*x_5+x_1*x_3^2*x_5+x_3^2*x_6+x_3*x_5^2, 
    x_3^2*x_4^2+x_3^2*x_5^2+x_1*x_5*x_6+x_3*x_4*x_6+x_4*x_5^2, 
    x_1*x_3*x_4^2+x_1*x_3*x_4*x_5+x_1*x_3*x_5^2+x_3^2*x_5^2+x_1*x_4*x_6+\
  x_2^2*x_7+x_2*x_5*x_6+x_3*x_4*x_6+x_3*x_5*x_6+x_4^2*x_5+x_4*x_5^2+x_6^\
  2, x_1*x_3^2*x_6+x_3^2*x_4*x_5+x_1*x_5*x_6+x_4*x_5^2, 
    x_1^2*x_3*x_6+x_1*x_5*x_6+x_2^2*x_7+x_2*x_5*x_6+x_3*x_5*x_6+x_6^2 
   ] with indeterminate degrees [ 1, 1, 1, 2, 2, 3, 4 ]
  
\end{Verbatim}
 The command \texttt{CohomologicalData(G,n)} prints complete information for the cohomology ring $H^\ast(G, Z_2 )$ of a $2$-group $G$ provided that the integer $n$ is at least the maximal degree of a relator in a minimal set of relators for
the ring. Groebner basis routines from \textsc{Singular} are called involved in the example. 

The following example produces complete information on the Steenrod algebra of
group number $8$ in \textsc{GAP}'s library of groups of order $32$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  Group number: 8
  Group description: C2 . ((C4 x C2) : C2) = (C2 x C2) . (C4 x C2)
  
  Cohomology generators
  Degree 1: a, b
  Degree 2: c, d
  Degree 3: e
  Degree 5: f, g
  Degree 6: h
  Degree 8: p
  
  Cohomology relations
  1: f^2
  2: c*h+e*f
  3: c*f
  4: b*h+c*g
  5: b*e+c*d
  6: a*h
  7: a*g
  8: a*f+b*f
  9: a*e+c^2
  10: a*c
  11: a*b
  12: a^2
  13: d*e*h+e^2*g+f*h
  14: d^2*h+d*e*f+d*e*g+f*g
  15: c^2*d+b*f
  16: b*c*g+e*f
  17: b*c*d+c*e
  18: b^2*g+d*f
  19: b^2*c+c^2
  20: b^3+a*d
  21: c*d^2*e+c*d*g+d^2*f+e*h
  22: c*d^3+d*e^2+d*h+e*f+e*g
  23: b^2*d^2+c*d^2+b*f+e^2
  24: b^3*d
  25: d^3*e^2+d^2*e*f+c^2*p+h^2
  26: d^4*e+b*c*p+e^2*g+g*h
  27: d^5+b*d^2*g+b^2*p+f*g+g^2
  
  Poincare series
  (x^5+x^2+1)/(x^8-2*x^7+2*x^6-2*x^5+2*x^4-2*x^3+2*x^2-2*x+1)
  
  Steenrod squares
  Sq^1(c)=0
  Sq^1(d)=b*b*b+d*b
  Sq^1(e)=c*b*b
  Sq^2(e)=e*d+f
  Sq^1(f)=c*d*b*b+d*d*b*b
  Sq^2(f)=g*b*b
  Sq^4(f)=p*a
  Sq^1(g)=d*d*d+g*b
  Sq^2(g)=0
  Sq^4(g)=c*d*d*d*b+g*d*b*b+g*d*d+p*a+p*b
  Sq^1(h)=c*d*d*b+e*d*d
  Sq^2(h)=d*d*d*b*b+c*d*d*d+g*c*b
  Sq^4(h)=d*d*d*d*b*b+g*e*d+p*c
  Sq^1(p)=c*d*d*d*b
  Sq^2(p)=d*d*d*d*b*b+c*d*d*d*d
  Sq^4(p)=d*d*d*d*d*b*b+d*d*d*d*d*d+g*d*d*d*b+g*g*d+p*d*d
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Steenrod operations on the classifying space of a finite $p$-group}}\logpage{[ 7, 2, 0 ]}
\hyperdef{L}{X7D5ACA56870A40E9}{}
{
 The following example constructs the first eight degrees of the mod-$3$ cohomology ring $H^\ast(G,\mathbb Z_3)$ for the group $G$ number 4 in \textsc{GAP}'s library of groups of order $81$. It determines a minimal set of ring generators lying in degree $\le 8$ and it evaluates the Bockstein operator on these generators. Steenrod powers
for $p\ge 3$ are not implemented as no efficient method of implementation is known. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G:=SmallGroup(81,4);;|
  !gapprompt@gap>| !gapinput@A:=ModPSteenrodAlgebra(G,8);;|
  !gapprompt@gap>| !gapinput@List(ModPRingGenerators(A),x->Bockstein(A,x));|
  [ 0*v.1, 0*v.1, v.5, 0*v.1, (Z(3))*v.7+v.8+(Z(3))*v.9 ]
  
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Bredon homology}}\logpage{[ 8, 0, 0 ]}
\hyperdef{L}{X786DB80A8693779E}{}
{
 
\section{\textcolor{Chapter }{Davis complex}}\logpage{[ 8, 1, 0 ]}
\hyperdef{L}{X7B0212F97F3D442A}{}
{
 

The following example computes the Bredon homology 

$\underline H_0(W,{\cal R}) = \mathbb Z^{21}$ 

 for the infinite Coxeter group $W$ associated to the Dynkin diagram shown in the computation, with coefficients
in the complex representation ring. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@D:=[[1,[2,3]],[2,[3,3]],[3,[4,3]],[4,[5,6]]];;|
  !gapprompt@gap>| !gapinput@CoxeterDiagramDisplay(D);|
  
\end{Verbatim}
  
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@C:=DavisComplex(D);;|
  !gapprompt@gap>| !gapinput@D:=TensorWithComplexRepresentationRing(C);;|
  !gapprompt@gap>| !gapinput@Homology(D,0);|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Arithmetic groups}}\logpage{[ 8, 2, 0 ]}
\hyperdef{L}{X7AFFB32587D047FE}{}
{
 

The following example computes the Bredon homology 

$\underline H_0(SL_2({\cal O}_{-3}),{\cal R}) = \mathbb Z_2\oplus \mathbb Z^{9}$ 

$\underline H_1(SL_2({\cal O}_{-3}),{\cal R}) = \mathbb Z$ 

for ${\cal O}_{-3}$ the ring of integers of the number field $\mathbb Q(\sqrt{-3})$, and $\cal R$ the complex reflection ring. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@R:=ContractibleGcomplex("SL(2,O-3)");;|
  !gapprompt@gap>| !gapinput@IsRigid(R);|
  false
  !gapprompt@gap>| !gapinput@S:=BaryCentricSubdivision(R);;|
  !gapprompt@gap>| !gapinput@IsRigid(S);|
  true
  !gapprompt@gap>| !gapinput@C:=TensorWithComplexRepresentationRing(S);;|
  !gapprompt@gap>| !gapinput@Homology(C,0);|
  [ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(C,1);|
  [ 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Crystallographic groups}}\logpage{[ 8, 3, 0 ]}
\hyperdef{L}{X7DEBF2BB7D1FB144}{}
{
 

The following example computes the Bredon homology 

$\underline H_0(G,{\cal R}) = \mathbb Z^{17}$ 

 for $G$ the second crystallographic group of dimension $4$ in \textsc{GAP}'s library of crystallographic groups, and for $\cal R$ the Burnside ring. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G:=SpaceGroup(4,2);;|
  !gapprompt@gap>| !gapinput@gens:=GeneratorsOfGroup(G);;|
  !gapprompt@gap>| !gapinput@B:=CrystGFullBasis(G);;|
  !gapprompt@gap>| !gapinput@R:=CrystGcomplex(gens,B,1);;|
  !gapprompt@gap>| !gapinput@IsRigid(R);|
  false
  !gapprompt@gap>| !gapinput@S:=CrystGcomplex(gens,B,0);;|
  !gapprompt@gap>| !gapinput@IsRigid(S);|
  true
  !gapprompt@gap>| !gapinput@D:=TensorWithBurnsideRing(S);;|
  !gapprompt@gap>| !gapinput@Homology(D,0);|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Simplicial groups}}\logpage{[ 9, 0, 0 ]}
\hyperdef{L}{X7D818E5F80F4CF63}{}
{
 
\section{\textcolor{Chapter }{Crossed modules}}\logpage{[ 9, 1, 0 ]}
\hyperdef{L}{X808C6B357F8BADC1}{}
{
 The following example concerns the crossed module 

$\partial\colon G\rightarrow Aut(G), g\mapsto (x\mapsto gxg^{-1})$ 

associated to the dihedral group $G$ of order $16$. This crossed module represents, up to homotopy type, a connected space $X$ with $\pi_iX=0$ for $i\ge 3$, $\pi_2X=Z(G)$, $\pi_1X = Aut(G)/Inn(G)$. The space $X$ can be represented, up to homotopy, by a simplicial group. That simplicial
group is used in the example to compute 

$H_1(X,\mathbb Z)= \mathbb Z_2 \oplus \mathbb Z_2$, 

$H_2(X,\mathbb Z)= \mathbb Z_2 $, 

$H_3(X,\mathbb Z)= \mathbb Z_2 \oplus \mathbb Z_2 \oplus \mathbb Z_2$, 

$H_4(X,\mathbb Z)= \mathbb Z_2 \oplus \mathbb Z_2 \oplus \mathbb Z_2$, 

$H_5(X,\mathbb Z)= \mathbb Z_2 \oplus \mathbb Z_2 \oplus \mathbb Z_2 \oplus
\mathbb Z_2\oplus \mathbb Z_2\oplus \mathbb Z_2$. 

The simplicial group is obtained by viewing the crossed module as a crossed
complex and using a nonabelian version of the Dold-Kan theorem. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@C:=AutomorphismGroupAsCatOneGroup(DihedralGroup(16));|
  Cat-1-group with underlying group Group( 
  [ f1, f2, f3, f4, f5, f6, f7, f8, f9 ] ) . 
  
  !gapprompt@gap>| !gapinput@Size(C);|
  512
  !gapprompt@gap>| !gapinput@Q:=QuasiIsomorph(C);|
  Cat-1-group with underlying group Group( [ f9, f8, f1, f2*f3, f5 ] ) . 
  
  !gapprompt@gap>| !gapinput@Size(Q);|
  32
  
  !gapprompt@gap>| !gapinput@N:=NerveOfCatOneGroup(Q,6);|
  Simplicial group of length 6
  
  !gapprompt@gap>| !gapinput@K:=ChainComplexOfSimplicialGroup(N);|
  Chain complex of length 6 in characteristic 0 . 
  
  !gapprompt@gap>| !gapinput@Homology(K,1);|
  [ 2, 2 ]
  !gapprompt@gap>| !gapinput@Homology(K,2);|
  [ 2 ]
  !gapprompt@gap>| !gapinput@Homology(K,3);|
  [ 2, 2, 2 ]
  !gapprompt@gap>| !gapinput@Homology(K,4);|
  [ 2, 2, 2 ]
  !gapprompt@gap>| !gapinput@Homology(K,5);|
  [ 2, 2, 2, 2, 2, 2 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Eilenberg-MacLane spaces}}\logpage{[ 9, 2, 0 ]}
\hyperdef{L}{X7FD979227A993C6F}{}
{
 

The following example concerns the Eilenberg-MacLane space $X=K(\mathbb Z,3)$ which is a path-connected space with $\pi_3X=\mathbb Z$, $\pi_iX=0$ for $3\ne i\ge 1$. This space is represented by a simplicial group, and perturbation techniques
are used to compute 

$H_7(X,\mathbb Z)=\mathbb Z_3$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@A:=AbelianPcpGroup([0]);;AbelianInvariants(A);|
  [ 0 ]
  !gapprompt@gap>| !gapinput@K:=EilenbergMacLaneSimplicialGroup(A,3,8);|
  Simplicial group of length 8
  
  !gapprompt@gap>| !gapinput@C:=ChainComplexOfSimplicialGroup(K);|
  Chain complex of length 8 in characteristic 0 . 
  
  !gapprompt@gap>| !gapinput@Homology(C,7);|
  [ 3 ]
  
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Congruence Subgroups, Cuspidal Cohomology and Hecke Operators}}\logpage{[ 10, 0, 0 ]}
\hyperdef{L}{X86D5DB887ACB1661}{}
{
 In this chapter we explain how HAP can be used to make computions about
modular forms associated to congruence subgroups $\Gamma$ of $SL_2(\mathbb Z)$. Also, in Subsection 10.8 onwards, we demonstrate cohomology computations for
the \emph{Picard group} $SL_2(\mathbb Z[i])$, some \emph{Bianchi groups} $PSL_2({\cal O}_{-d}) $ where ${\cal O}_{d}$ is the ring of integers of $\mathbb Q(\sqrt{-d})$ for square free positive integer $d$, and some other groups of the form $SL_m({\cal O})$, $GL_m({\cal O})$, $PSL_m({\cal O})$, $PGL_m({\cal O})$, for $m=2,3,4$ and certain ${\cal O}=\mathbb Z, {\cal O}_{-d}$. 
\section{\textcolor{Chapter }{Eichler-Shimura isomorphism}}\label{sec:EichlerShimura}
\logpage{[ 10, 1, 0 ]}
\hyperdef{L}{X79A1974B7B4987DE}{}
{
 

We begin by recalling the Eichler-Shimura isomorphism \cite{eichler}\cite{shimura} 
\[ S_k(\Gamma) \oplus \overline{S_k(\Gamma)} \oplus E_k(\Gamma) \cong_{\sf Hecke}
H^1(\Gamma,P_{\mathbb C}(k-2))\]
 

 which relates the cohomology of groups to the theory of modular forms
associated to a finite index subgroup $\Gamma$ of $SL_2(\mathbb Z)$. In subsequent sections we explain how to compute with the right-hand side of
the isomorphism. But first, for completeness, let us define the terms on the
left-hand side. 

 Let $N$ be a positive integer. A subgroup $\Gamma$ of $SL_2(\mathbb Z)$ is said to be a \emph{congruence subgroup} of level $N $ if it contains the kernel of the canonical homomorphism $\pi_N\colon SL_2(\mathbb Z) \rightarrow SL_2(\mathbb Z/N\mathbb Z)$. So any congruence subgroup is of finite index in $SL_2(\mathbb Z)$, but the converse is not true. 

One congruence subgroup of particular interest is the group $\Gamma_1(N)=\ker(\pi_N)$, known as the \emph{principal congruence subgroup} of level $N$. Another congruence subgroup of particular interest is the group $\Gamma_0(N)$ of those matrices that project to upper triangular matrices in $SL_2(\mathbb Z/N\mathbb Z)$. 

A \emph{modular form} of weight $k$ for a congruence subgroup $\Gamma$ is a complex valued function on the upper-half plane, $f\colon {\frak{h}}=\{z\in \mathbb C : Re(z)>0\} \rightarrow \mathbb C$, satisfying: 
\begin{itemize}
\item  $\displaystyle f(\frac{az+b}{cz+d}) = (cz+d)^k f(z)$ for $\left(\begin{array}{ll}a&b\\ c &d \end{array}\right) \in \Gamma$, 
\item  $f$ is `holomorphic' on the \emph{extended upper-half plane} $\frak{h}^\ast = \frak{h} \cup \mathbb Q \cup \{\infty\}$ obtained from the upper-half plane by `adjoining a point at each cusp'. 
\end{itemize}
 The collection of all weight $k$ modular forms for $\Gamma$ form a vector space $M_k(\Gamma)$ over $\mathbb C$. 

A modular form $f$ is said to be a \emph{cusp form} if $f(\infty)=0$. The collection of all weight $k$ cusp forms for $\Gamma$ form a vector subspace $S_k(\Gamma)$. There is a decomposition 
\[M_k(\Gamma) \cong S_k(\Gamma) \oplus E_k(\Gamma)\]
 

 involving a summand $E_k(\Gamma)$ known as the \emph{Eisenstein space}. See \cite{stein} for further introductory details on modular forms. 

The Eichler-Shimura isomorphism is more than an isomorphism of vector spaces.
It is an isomorphism of Hecke modules: both sides admit notions of \emph{Hecke operators}, and the isomorphism preserves these operators. The bar on the left-hand side
of the isomorphism denotes complex conjugation, or \emph{anti-holomorphic} forms. See \cite{wieser} for a full account of the isomorphism. 



 On the right-hand side of the isomorphism, the $\mathbb Z\Gamma$-module $P_{\mathbb C}(k-2)\subset \mathbb C[x,y]$ denotes the space of homogeneous degree $k-2$ polynomials with action of $\Gamma$ given by 
\[\left(\begin{array}{ll}a&b\\ c &d \end{array}\right)\cdot p(x,y) =
p(dx-by,-cx+ay)\ .\]
 In particular $P_{\mathbb C}(0)=\mathbb C$ is the trivial module. Below we shall compute with the integral analogue $P_{\mathbb Z}(k-2) \subset \mathbb Z[x,y]$. 



 In the following sections we explain how to use the right-hand side of the
Eichler-Shimura isomorphism to compute eigenvalues of the Hecke operators
restricted to the subspace $S_k(\Gamma)$ of cusp forms. }

 
\section{\textcolor{Chapter }{Generators for $SL_2(\mathbb Z)$ and the cubic tree}}\logpage{[ 10, 2, 0 ]}
\hyperdef{L}{X7BFA2C91868255D9}{}
{
 

 The matrices $S=\left(\begin{array}{rr}0&-1\\ 1 &0 \end{array}\right)$ and $T=\left(\begin{array}{rr}1&1\\ 0 &1 \end{array}\right)$ generate $SL_2(\mathbb Z)$ and it is not difficult to devise an algorithm for expressing an arbitrary
integer matrix $A$ of determinant $1$ as a word in $S$, $T$ and their inverses. The following illustrates such an algorithm. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@A:=[[4,9],[7,16]];;|
  !gapprompt@gap>| !gapinput@word:=AsWordInSL2Z(A);|
  [ [ [ 1, 0 ], [ 0, 1 ] ], [ [ 0, 1 ], [ -1, 0 ] ], [ [ 1, -1 ], [ 0, 1 ] ], 
    [ [ 0, 1 ], [ -1, 0 ] ], [ [ 1, 1 ], [ 0, 1 ] ], [ [ 0, 1 ], [ -1, 0 ] ], 
    [ [ 1, -1 ], [ 0, 1 ] ], [ [ 1, -1 ], [ 0, 1 ] ], [ [ 1, -1 ], [ 0, 1 ] ], 
    [ [ 0, 1 ], [ -1, 0 ] ], [ [ 1, 1 ], [ 0, 1 ] ], [ [ 1, 1 ], [ 0, 1 ] ] ]
  !gapprompt@gap>| !gapinput@Product(word);|
  [ [ 4, 9 ], [ 7, 16 ] ]
  
\end{Verbatim}
 It is convenient to introduce the matrix $U=ST = \left(\begin{array}{rr}0&-1\\ 1 &1 \end{array}\right)$. The matrices $S$ and $U$ also generate $SL_2(\mathbb Z)$. In fact we have a free presentation $SL_2(\mathbb Z)= \langle S,U\, |\, S^4=U^6=1 \rangle $. 



 The \emph{cubic tree} $\cal T$ is a tree (\emph{i.e.} a $1$-dimensional contractible regular CW-complex) with countably infinitely many
edges in which each vertex has degree $3$. We can realize the cubic tree $\cal T$ by taking the left cosets of ${\cal U}=\langle U\rangle$ in $SL_2(\mathbb Z)$ as vertices, and joining cosets $x\,{\cal U} $ and $y\,{\cal U}$ by an edge if, and only if, $x^{-1}y \in {\cal U}\, S\,{\cal U}$. Thus the vertex $\cal U $ is joined to $S\,{\cal U} $, $US\,{\cal U}$ and $U^2S\,{\cal U}$. The vertices of this tree are in one-to-one correspondence with all reduced
words in $S$, $U$ and $U^2$ that, apart from the identity, end in $S$. 

 From our realization of the cubic tree $\cal T$ we see that $SL_2(\mathbb Z)$ acts on $\cal T$ in such a way that each vertex is stabilized by a cyclic subgroup conjugate to ${\cal U}=\langle U\rangle$ and each edge is stabilized by a cyclic subgroup conjugate to ${\cal S} =\langle S \rangle$. 

 In order to store this action of $SL_2(\mathbb Z)$ on the cubic tree $\cal T$ we just need to record the following finite amount of information. 

  }

 
\section{\textcolor{Chapter }{One-dimensional fundamental domains and generators for congruence subgroups}}\logpage{[ 10, 3, 0 ]}
\hyperdef{L}{X7D1A56967A073A8B}{}
{
 The modular group ${\cal M}=PSL_2(\mathbb Z)$ is isomorphic, as an abstract group, to the free product $\mathbb Z_2\ast \mathbb Z_3$. By the Kurosh subgroup theorem, any finite index subgroup $M \subset {\cal M}$ is isomorphic to the free product of finitely many copies of $\mathbb Z_2$s, $\mathbb Z_3$s and $\mathbb Z$s. A subset $\underline x \subset M$ is an \emph{independent} set of subgroup generators if $M$ is the free product of the cyclic subgroups $<x >$ as $x$ runs over $\underline x$. Let us say that a set of elements in $SL_2(\mathbb Z)$ is \emph{projectively independent} if it maps injectively onto an independent set of subgroup generators $\underline x\subset {\cal M}$. The generating set $\{S,U\}$ for $SL_2(\mathbb Z)$ given in the preceding section is projectively independent. 

 We are interested in constructing a set of generators for a given congruence
subgroup $\Gamma$. If a small generating set for $\Gamma$ is required then we should aim to construct one which is close to being
projectively independent. 

 It is useful to invoke the following general result which follows from a
perturbation result about free $\mathbb ZG$-resolutons in \cite[Theorem 2]{ellisharrisskoldberg} and an old observation of John Milnor that a free $\mathbb ZG$-resolution can be realized as the cellular chain complex of a CW-complex if
it can be so realized in low dimensions. 

\textsc{Theorem.} Let $X$ be a contractible CW-complex on which a group $G$ acts by permuting cells. The cellular chain complex $C_\ast X$ is a $\mathbb ZG$-resolution of $\mathbb Z$ which typically is not free. Let $[e^n]$ denote the orbit of the n-cell $e^n$ under the action. Let $G^{e^n} \le G$ denote the stabilizer subgroup of $e^n$, in which group elements are not required to stabilize $e^n$ point-wise. Let $Y_{e^n}$ denote a contractible CW-complex on which $G^{e^n}$ acts cellularly and freely. Then there exists a contractible CW-complex $W$ on which $G$ acts cellularly and freely, and in which the orbits of $n$-cells are labelled by $[e^p]\otimes [f^q]$ where $p+q=n$ and $[e^p]$ ranges over the $G$-orbits of $p$-cells in $X$, $[f^q]$ ranges over the $G^{e^p}$-orbits of $q$-cells in $Y_{e^p}$. 

 

Let $W$ be as in the theorem. Then the quotient CW-complex $B_G=W/G$ is a classifying space for $G$. Let $T$ denote a maximal tree in the $1$-skeleton $B^1_G$. Basic geometric group theory tells us that the $1$-cells in $B^1_G\setminus T$ correspond to a generating set for $G$. 

 Suppose we wish to compute a set of generators for a principal congruence
subgroup $\Gamma=\Gamma_1(N)$. In the above theorem take $X={\cal T}$ to be the cubic tree, and note that $\Gamma$ acts freely on $\cal T$ and thus that $W={\cal T}$. To determine the $1$-cells of $B_{\Gamma}\setminus T$ we need to determine a cellular subspace $D_\Gamma \subset \cal T$ whose images under the action of $\Gamma$ cover $\cal T$ and are pairwise either disjoint or identical. The subspace $D_\Gamma$ will not be a CW-complex as it won't be closed, but it can be chosen to be
connected, and hence contractible. We call $D_\Gamma$ a \emph{fundamental region} for $\Gamma$. We denote by $\mathring D_\Gamma$ the largest CW-subcomplex of $D_\Gamma$. The vertices of $\mathring D_\Gamma$ are the same as the vertices of $D_\Gamma$. Thus $\mathring D_\Gamma$ is a subtree of the cubic tree with $|\Gamma|/6$ vertices. For each vertex $v$ in the tree $\mathring D_\Gamma$ define $\eta(v)=3 -{\rm degree}(v)$. Then the number of generators for $ \Gamma $ will be $(1/2)\sum_{v\in \mathring D_\Gamma} \eta(v)$. 

 The following commands determine projectively independent generators for $\Gamma_1(6)$ and display $\mathring D_{\Gamma_1(6)}$. The subgroup $\Gamma_1(6)$ is free on $13$ generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G:=HAP_PrincipalCongruenceSubgroup(6);;|
  !gapprompt@gap>| !gapinput@gens:=GeneratorsOfGroup(G);|
  [ [ [ -83, -18 ], [ 60, 13 ] ], [ [ -77, -18 ], [ 30, 7 ] ], 
    [ [ -65, -12 ], [ 168, 31 ] ], [ [ -53, -12 ], [ 84, 19 ] ], 
    [ [ -47, -18 ], [ 222, 85 ] ], [ [ -41, -12 ], [ 24, 7 ] ], 
    [ [ -35, -6 ], [ 6, 1 ] ], [ [ -11, -18 ], [ 30, 49 ] ], 
    [ [ -11, -6 ], [ 24, 13 ] ], [ [ -5, -18 ], [ 12, 43 ] ], 
    [ [ -5, -12 ], [ 18, 43 ] ], [ [ -5, -6 ], [ 6, 7 ] ], 
    [ [ 1, 0 ], [ -6, 1 ] ] ]
  
\end{Verbatim}
 

  

An alternative but very related approach to computing generators of congruence
subgroups of $SL_2(\mathbb Z)$ is described in \cite{kulkarni}. 

The congruence subgroup $\Gamma_0(N)$ does not act freely on the vertices of $\cal T$, and so one needs to incorporate a generator for the cyclic stabilizer group
according to the above theorem. Alternatively, we can replace the cubic tree
by a six-fold cover ${\cal T}'$ on whose vertex set $\Gamma_0(N)$ acts freely. This alternative approach will produce a redundant set of
generators. The following commands display $\mathring D_{\Gamma_0(39)}$ for a fundamental region in ${\cal T}'$. They also use the corresponding generating set for $\Gamma_0(39)$, involving $18$ generators, to compute the abelianization $\Gamma_0(39)^{ab}= \mathbb Z_2 \oplus \mathbb Z_3^2 \oplus \mathbb Z^9$. The abelianization shows that any generating set has at least $11$ generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G:=HAP_CongruenceSubgroupGamma0(39);;|
  !gapprompt@gap>| !gapinput@HAP_SL2TreeDisplay(G);|
  !gapprompt@gap>| !gapinput@Length(GeneratorsOfGroup(G));|
  18
  !gapprompt@gap>| !gapinput@AbelianInvariants(G);|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3 ]
  
\end{Verbatim}
 

  

 Note that to compute $D_\Gamma$ one only needs to be able to test whether a given matrix lies in $\Gamma$ or not. Given an inclusion $\Gamma'\subset \Gamma$ of congruence subgroups, it is straightforward to use the trees $\mathring D_{\Gamma'}$ and $\mathring D_{\Gamma}$ to compute a system of coset representative for $\Gamma'\setminus \Gamma$. }

 
\section{\textcolor{Chapter }{Cohomology of congruence subgroups}}\logpage{[ 10, 4, 0 ]}
\hyperdef{L}{X818BFA9A826C0DB3}{}
{
 To compute the cohomology $H^n(\Gamma,A)$ of a congruence subgroup $\Gamma$ with coefficients in a $\mathbb Z\Gamma$-module $A$ we need to construct $n+1$ terms of a free $\mathbb ZG$-resolution of $\mathbb Z$. We can do this by first using perturbation techniques (as described in \cite{buiellis}) to combine the cubic tree with resolutions for the cyclic groups of order $4$ and $6$ in order to produce a free $\mathbb ZG$-resolution $R_\ast$ for $G=SL_2(\mathbb Z)$. This resolution is also a free $\mathbb Z\Gamma$-resolution with each term of rank 
\[{\rm rank}_{\mathbb Z\Gamma} R_k = |G:\Gamma|\times {\rm rank}_{\mathbb ZG}
R_k\ .\]
 

For congruence subgroups of lowish index in $G$ this resolution suffices to make computations. 

The following commands compute 
\[H^1(\Gamma_0(39),\mathbb Z) = \mathbb Z^9\ .\]
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@R:=ResolutionSL2Z_alt(2);|
  Resolution of length 2 in characteristic 0 for SL(2,Integers) .
  
  !gapprompt@gap>| !gapinput@gamma:=HAP_CongruenceSubgroupGamma0(39);;|
  !gapprompt@gap>| !gapinput@S:=ResolutionFiniteSubgroup(R,gamma);|
  Resolution of length 2 in characteristic 0 for 
  CongruenceSubgroupGamma0( 39)  .
  
  !gapprompt@gap>| !gapinput@Cohomology(HomToIntegers(S),1);|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 

This computation establishes that the space $M_2(\Gamma_0(39))$ of weight $2$ modular forms is of dimension $9$. 

The following commands show that ${\rm rank}_{\mathbb Z\Gamma_0(39)} R_1 = 112$ but that it is possible to apply `Tietze like' simplifications to $R_\ast$ to obtain a free $\mathbb Z\Gamma_0(39)$-resolution $T_\ast$ with ${\rm rank}_{\mathbb Z\Gamma_0(39)} T_1 = 11$. It is more efficient to work with $T_\ast$ when making cohomology computations with coefficients in a module $A$ of large rank. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|S!.dimension(1);A
  112
  @gapprompt|gap>A @gapinput|T:=TietzeReducedResolution(S);A
  Resolution of length 2 in characteristic 0 for CongruenceSubgroupGamma0(
  39)  . 
  
  @gapprompt|gap>A @gapinput|T!.dimension(1);A
  11
  
\end{Verbatim}
 

The following commands compute 
\[H^1(\Gamma_0(39),P_{\mathbb Z}(8)) = \mathbb Z_3 \oplus \mathbb Z_6 \oplus
\mathbb Z_{168} \oplus \mathbb Z^{84}\ ,\]
 
\[H^1(\Gamma_0(39),P_{\mathbb Z}(9)) = \mathbb Z_2 \oplus \mathbb Z_2 .\]
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@P:=HomogeneousPolynomials(gamma,8);;|
  !gapprompt@gap>| !gapinput@c:=Cohomology(HomToIntegralModule(T,P),1);|
  [ 3, 6, 168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Length(c);|
  87
  
  !gapprompt@gap>| !gapinput@P:=HomogeneousPolynomials(gamma,9);;|
  !gapprompt@gap>| !gapinput@c:=Cohomology(HomToIntegralModule(T,P),1);|
  [ 2, 2 ]
  
\end{Verbatim}
 

This computation establishes that the space $M_{10}(\Gamma_0(39))$ of weight $10$ modular forms is of dimension $84$, and $M_{11}(\Gamma_0(39))$ is of dimension $0$. (There are never any modular forms of odd weight, and so $M_k(\Gamma)=0$ for all odd $k$ and any congruence subgroup $\Gamma$.) }

 
\section{\textcolor{Chapter }{Cuspidal cohomology}}\logpage{[ 10, 5, 0 ]}
\hyperdef{L}{X84D30F1580CD42D1}{}
{
 To define and compute cuspidal cohomology we consider the action of $SL_2(\mathbb Z)$ on the upper-half plane ${\frak h}$ given by 
\[\left(\begin{array}{ll}a&b\\ c &d \end{array}\right) z = \frac{az +b}{cz+d}\ .\]
 A standard 'fundamental domain' for this action is the region 
\[\begin{array}{ll} D=&\{z\in {\frak h}\ :\ |z| > 1, |{\rm Re}(z)| <
\frac{1}{2}\} \\ & \cup\ \{z\in {\frak h} \ :\ |z| \ge 1, {\rm
Re}(z)=-\frac{1}{2}\}\\ & \cup\ \{z \in {\frak h}\ :\ |z|=1, -\frac{1}{2} \le
{\rm Re}(z) \le 0\} \end{array} \]
 illustrated below. 

 

 The action factors through an action of $PSL_2(\mathbb Z) =SL_2(\mathbb Z)/\langle \left(\begin{array}{rr}-1&0\\ 0 &-1
\end{array}\right)\rangle$. The images of $D$ under the action of $PSL_2(\mathbb Z)$ cover the upper-half plane, and any two images have at most a single point in
common. The possible common points are the bottom left-hand corner point which
is stabilized by $\langle U\rangle$, and the bottom middle point which is stabilized by $\langle S\rangle$. 

 A congruence subgroup $\Gamma$ has a `fundamental domain' $D_\Gamma$ equal to a union of finitely many copies of $D$, one copy for each coset in $\Gamma\setminus SL_2(\mathbb Z)$. The quotient space $X=\Gamma\setminus {\frak h}$ is not compact, and can be compactified in several ways. We are interested in
the Borel-Serre compactification. This is a space $X^{BS}$ for which there is an inclusion $X\hookrightarrow X^{BS}$ and this inclusion is a homotopy equivalence. One defines the \emph{boundary} $\partial X^{BS} = X^{BS} - X$ and uses the inclusion $\partial X^{BS} \hookrightarrow X^{BS} \simeq X$ to define the cuspidal cohomology group, over the ground ring $\mathbb C$, as 
\[ H_{cusp}^n(\Gamma,P_{\mathbb C}(k-2)) = \ker (\ H^n(X,P_{\mathbb C}(k-2))
\rightarrow H^n(\partial X^{BS},P_{\mathbb C}(k-2)) \ ).\]
 Strictly speaking, this is the definition of \emph{interior cohomology} $H_!^n(\Gamma,P_{\mathbb C}(k-2))$ which in general contains the cuspidal cohomology as a subgroup. However, for
congruence subgroups of $SL_2(\mathbb Z)$ there is equality $H_!^n(\Gamma,P_{\mathbb C}(k-2)) = H_{cusp}^n(\Gamma,P_{\mathbb C}(k-2))$. 

 Working over $\mathbb C$ has the advantage of avoiding the technical issue that $\Gamma $ does not necessarily act freely on ${\frak h}$ since there are points with finite cyclic stabilizer groups in $SL_2(\mathbb Z)$. But it has the disadvantage of losing information about torsion in
cohomology. So HAP confronts the issue by working with a contractible
CW-complex $\tilde X^{BS}$ on which $\Gamma$ acts freely, and $\Gamma$-equivariant inclusion $\partial \tilde X^{BS} \hookrightarrow \tilde X^{BS}$. The definition of cuspidal cohomology that we use, which coincides with the
above definition when working over $\mathbb C$, is 
\[ H_{cusp}^n(\Gamma,A) = \ker (\ H^n({\rm Hom}_{\, \mathbb
Z\Gamma}(C_\ast(\tilde X^{BS}), A)\, ) \rightarrow H^n(\ {\rm Hom}_{\, \mathbb
Z\Gamma}(C_\ast(\tilde \partial X^{BS}), A)\, \ ).\]
 

The following data is recorded and, using perturbation theory, is combined
with free resolutions for $C_4$ and $C_6$ to constuct $\tilde X^{BS}$. 

 

 The following commands calculate 
\[H^1_{cusp}(\Gamma_0(39),\mathbb Z) = \mathbb Z^6\ .\]
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gamma:=HAP_CongruenceSubgroupGamma0(39);;|
  !gapprompt@gap>| !gapinput@k:=2;; deg:=1;; c:=CuspidalCohomologyHomomorphism(gamma,deg,k);|
  [ g1, g2, g3, g4, g5, g6, g7, g8, g9 ] -> [ g1^-1*g3, g1^-1*g3, g1^-1*g3, 
    g1^-1*g3, g1^-1*g2, g1^-1*g3, g1^-1*g4, g1^-1*g4, g1^-1*g4 ]
  !gapprompt@gap>| !gapinput@AbelianInvariants(Kernel(c));|
  [ 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 From the Eichler-Shimura isomorphism and the already calculated dimension of $M_2(\Gamma_0(39))\cong \mathbb C^9$, we deduce from this cuspidal cohomology that the space $S_2(\Gamma_0(39))$ of cuspidal weight $2$ forms is of dimension $3$, and the Eisenstein space $E_2(\Gamma_0(39))\cong \mathbb C^3$ is of dimension $3$. 

The following commands show that the space $S_4(\Gamma_0(39))$ of cuspidal weight $4$ forms is of dimension $12$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gamma:=HAP_CongruenceSubgroupGamma0(39);;|
  !gapprompt@gap>| !gapinput@k:=4;; deg:=1;; c:=CuspidalCohomologyHomomorphism(gamma,deg,k);;|
  !gapprompt@gap>| !gapinput@AbelianInvariants(Kernel(c));|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Hecke operators}}\logpage{[ 10, 6, 0 ]}
\hyperdef{L}{X8577E83782C87EBD}{}
{
 A congruence subgroup $\Gamma \le SL_m(\mathbb Z)$ and element $g\in SL_m(\mathbb Q)$ determine the subgroup $\Gamma' = \Gamma \cap g\Gamma g^{-1} $ and homomorphisms 
\[ \Gamma\ \hookleftarrow\ \Gamma'\ \ \stackrel{\gamma \mapsto g^{-1}\gamma
g}{\longrightarrow}\ \ g^{-1}\Gamma' g\ \hookrightarrow \Gamma\ . \]
 These homomorphisms give rise to homomorphisms of cohomology groups 
\[H^n(\Gamma,\mathbb Z)\ \ \stackrel{tr}{\leftarrow} \ \ H^n(\Gamma',\mathbb Z)
\ \ \stackrel{\alpha}{\leftarrow} \ \ H^n(g^{-1}\Gamma' g,\mathbb Z) \ \
\stackrel{\beta}{\leftarrow} H^n(\Gamma, \mathbb Z) \]
 with $\alpha$, $\beta$ functorial maps, and $tr$ the transfer map. We define the composite $T_g=tr \circ \alpha \circ \beta\colon H^n(\Gamma, \mathbb Z) \rightarrow
H^n(\Gamma, \mathbb Z)$ to be the \emph{ Hecke operator } determined by $g$. Further details on this description of Hecke operators can be found in \cite[Appendix by P. Gunnells]{stein}. 

For each integer $s\ge 1$ we set $T_s =T_s$ with for $g=\left(\begin{array}{cc}1&0\\0&\frac{1}{s}\end{array}\right)$. 

The following commands compute $T_2$ and $T_5$ for $n=1$ and $\Gamma=\Gamma_0(39)$. The commands also compute the eigenvalues of these two Hecke operators. The
final command confirms that $T_2$ and $T_5$ commute. (It is a fact that $T_pT_q=T_qT_p$ for all integers $p,q$.) 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gamma:=HAP_CongruenceSubgroupGamma0(39);;|
  !gapprompt@gap>| !gapinput@p:=2;;N:=1;;h:=HeckeOperator(gamma,p,N);;|
  !gapprompt@gap>| !gapinput@AbelianInvariants(Source(h));|
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@T2:=HomomorphismAsMatrix(h);;|
  !gapprompt@gap>| !gapinput@Display(T2);|
  [ [  -2,  -2,   2,   2,   1,   2,   0,   0,   0 ],
    [  -2,   0,   1,   2,  -2,   2,   2,   2,  -2 ],
    [  -2,  -1,   2,   2,  -1,   2,   1,   1,  -1 ],
    [  -2,  -1,   2,   2,   1,   1,   0,   0,   0 ],
    [  -1,   0,   0,   2,  -3,   2,   3,   3,  -3 ],
    [   0,   1,   1,   1,  -1,   0,   1,   1,  -1 ],
    [  -1,   1,   1,  -1,   0,   1,   2,  -1,   1 ],
    [  -1,  -1,   0,   2,  -3,   2,   1,   4,  -1 ],
    [   0,   1,   0,  -1,  -2,   1,   1,   1,   2 ] ]
  !gapprompt@gap>| !gapinput@Eigenvalues(Rationals,T2);|
  [ 3, 1 ]
  
  !gapprompt@gap>| !gapinput@p:=5;;N:=1;;h:=HeckeOperator(gamma,p,N);;|
  !gapprompt@gap>| !gapinput@T5:=HomomorphismAsMatrix(h);;|
  !gapprompt@gap>| !gapinput@Display(T5);|
  [ [  -1,  -1,   3,   4,   0,   0,   1,   1,  -1 ],
    [  -5,  -1,   5,   4,   0,   0,   3,   3,  -3 ],
    [  -2,   0,   4,   4,   1,   0,  -1,  -1,   1 ],
    [  -2,   0,   3,   2,  -3,   2,   4,   4,  -4 ],
    [  -4,  -2,   4,   4,   3,   0,   1,   1,  -1 ],
    [  -6,  -4,   5,   6,   1,   2,   2,   2,  -2 ],
    [   1,   5,   0,  -4,  -3,   2,   5,  -1,   1 ],
    [  -2,  -2,   2,   4,   0,   0,  -2,   4,   2 ],
    [   1,   3,   0,  -4,  -4,   2,   2,   2,   4 ] ]
  !gapprompt@gap>| !gapinput@Eigenvalues(Rationals,T5);|
  [ 6, 2 ]
  
  gap>T2*T5=T5*T2;
  true
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Reconstructing modular forms from cohomology computations}}\logpage{[ 10, 7, 0 ]}
\hyperdef{L}{X84CC51EE8525E0D9}{}
{
 

Given a modular form $f\colon {\frak h} \rightarrow \mathbb C$ associated to a congruence subgroup $\Gamma$, and given a compact edge $e$ in the tessellation of ${\frak h}$ (\emph{i.e.} an edge in the cubic tree $\cal T$) arising from the above fundamental domain for $SL_2(\mathbb Z)$, we can evaluate 
\[\int_e f(z)\,dz \ .\]
 In this way we obtain a cochain $f_1\colon C_1({\cal T}) \rightarrow \mathbb C$ in $Hom_{\mathbb Z\Gamma}(C_1({\cal T}), \mathbb C)$ representing a cohomology class $c(f) \in H^1(\, Hom_{\mathbb Z\Gamma}(C_\ast({\cal T}), \mathbb C) \,) =
H^1(\Gamma,\mathbb C)$. The correspondence $f\mapsto c(f)$ underlies the Eichler-Shimura isomorphism. Hecke operators can be used to
recover modular forms from cohomology classes. 

Hecke operators restrict to operators on cuspidal cohomology. On the left-hand
side of the Eichler-Shimura isomorphism Hecke operators restrict to operators $T_s\colon S_2(\Gamma) \rightarrow S_2(\Gamma)$ for $s\ge 1$. 

Let us now introduce the function $q=q(z)=e^{2\pi i z}$ which is holomorphic on $\mathbb C$. For any modular form $f(z)$ there are numbers $a_n$ such that 
\[f(z) = \sum_{s=0}^\infty a_sq^s \]
 for all $z\in {\frak h}$. The form $f$ is a cusp form if $a_0=0$. 

 A non-zero cusp form $f\in S_2(\Gamma)$ is an \emph{eigenform} if it is simultaneously an eigenvector for the Hecke operators $T_s$ for all $s =1,2,3,\cdots$. An eigenform is said to be \emph{normalized} if its coefficient $a_1=1$. It turns out that if $f$ is a normalized eigenform then the coefficient $a_s$ is an eigenvalue for $T_s$ (see for instance \cite{stein} for details). It can be shown \cite{atkinlehner} that $f\in S_2(\Gamma_0(N))$ admits a basis of eigenforms. 

 This all implies that, in principle, we can construct an approximation to an
explicit basis for the space $S_2(\Gamma)$ of cusp forms by computing eigenvalues for Hecke operators. 

 Suppose that we would like a basis for $S_2(\Gamma_0(11))$. The following commands first show that $H^1_{cusp}(\Gamma_0(11),\mathbb Z)=\mathbb Z\oplus \mathbb Z$ from which we deduce that $S_2(\Gamma_0(11)) =\mathbb C$ is $1$-dimensional. Then eigenvalues of Hecke operators are calculated to establish
that the modular form 
\[f = q -2q^2 -q^3 +q^4 +q^5 +2q^6 -2q^7 +2q^8 -3q^9 -2q^{10} + \cdots \]
 constitutes a basis for $S_2(\Gamma_0(11))$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gamma:=HAP_CongruenceSubgroupGamma0(11);;|
  !gapprompt@gap>| !gapinput@AbelianInvariants(Kernel(CuspidalCohomologyHomomorphism(gamma,1,2)));|
  [ 0, 0 ]
  
  !gapprompt@gap>| !gapinput@T1:=HomomorphismAsMatrix(HeckeOperator(gamma,1,1));; Display(T1);|
  [ [  1,  0,  0 ],
    [  0,  1,  0 ],
    [  0,  0,  1 ] ]
  !gapprompt@gap>| !gapinput@T2:=HomomorphismAsMatrix(HeckeOperator(gamma,2,1));; Display(T2);|
  [ [   3,  -4,   4 ],
    [   0,  -2,   0 ],
    [   0,   0,  -2 ] ]
  !gapprompt@gap>| !gapinput@T3:=HomomorphismAsMatrix(HeckeOperator(gamma,3,1));; Display(T3);|
  [ [   4,  -4,   4 ],
    [   0,  -1,   0 ],
    [   0,   0,  -1 ] ]
  !gapprompt@gap>| !gapinput@T4:=HomomorphismAsMatrix(HeckeOperator(gamma,4,1));; Display(T4);|
  [ [   6,  -4,   4 ],
    [   0,   1,   0 ],
    [   0,   0,   1 ] ]
  !gapprompt@gap>| !gapinput@T5:=HomomorphismAsMatrix(HeckeOperator(gamma,5,1));; Display(T5);|
  [ [   6,  -4,   4 ],
    [   0,   1,   0 ],
    [   0,   0,   1 ] ]
  !gapprompt@gap>| !gapinput@T6:=HomomorphismAsMatrix(HeckeOperator(gamma,6,1));; Display(T6);|
  [ [  12,  -8,   8 ],
    [   0,   2,   0 ],
    [   0,   0,   2 ] ]
  !gapprompt@gap>| !gapinput@T7:=HomomorphismAsMatrix(HeckeOperator(gamma,7,1));; Display(T7);|
  [ [   8,  -8,   8 ],
    [   0,  -2,   0 ],
    [   0,   0,  -2 ] ]
  !gapprompt@gap>| !gapinput@T8:=HomomorphismAsMatrix(HeckeOperator(gamma,8,1));; Display(T8);|
  [ [  12,  -8,   8 ],
    [   0,   2,   0 ],
    [   0,   0,   2 ] ]
  !gapprompt@gap>| !gapinput@T9:=HomomorphismAsMatrix(HeckeOperator(gamma,9,1));; Display(T9);|
  [ [   12,  -12,   12 ],
    [    0,   -3,    0 ],
    [    0,    0,   -3 ] ]
  !gapprompt@gap>| !gapinput@T10:=HomomorphismAsMatrix(HeckeOperator(gamma,10,1));; Display(T10);|
  [ [   18,  -16,   16 ],
    [    0,   -2,    0 ],
    [    0,    0,   -2 ] ]
  
\end{Verbatim}
 

 For a normalized eigenform $f=1 + \sum_{s=2}^\infty a_sq^s$ the coefficients $a_s$ with $s$ a composite integer can be expressed in terms of the coefficients $a_p$ for prime $p$. If $r,s$ are coprime then $T_{rs} =T_rT_s$. If $p$ is a prime that is not a divisor of the level $N$ of $\Gamma$ then $a_{p^m} =a_{p^{m-1}}a_p - p a_{p^{m-2}}.$ If the prime $ p$ divides $N$ then $a_{p^m} = (a_p)^m$. It thus suffices to compute the coefficients $a_p$ for prime integers $p$ only. }

 
\section{\textcolor{Chapter }{The Picard group}}\logpage{[ 10, 8, 0 ]}
\hyperdef{L}{X8180E53C834301EF}{}
{
 Let us now consider the \emph{Picard group} $G=SL_2(\mathbb Z[ i])$ and its action on \emph{upper-half space} 
\[{\frak h}^3 =\{(z,t) \in \mathbb C\times \mathbb R\ |\ t > 0\} \ . \]
 To describe the action we introduce the symbol $j$ satisfying $j^2=-1$, $ij=-ji$ and write $z+tj$ instead of $(z,t)$. The action is given by 
\[\left(\begin{array}{ll}a&b\\ c &d \end{array}\right)\cdot (z+tj) \ = \
\left(a(z+tj)+b\right)\left(c(z+tj)+d\right)^{-1}\ .\]
 Alternatively, and more explicitly, the action is given by 
\[\left(\begin{array}{ll}a&b\\ c &d \end{array}\right)\cdot (z+tj) \ = \
\frac{(az+b)\overline{(cz+d) } + a\overline c y^2}{|cz +d|^2 + |c|^2y^2} \ +\
\frac{y}{|cz+d|^2+|c|^2y^2}\, j \ .\]
 

A standard 'fundamental domain' $D$ for this action is the following region (with some of the boundary points
removed). 
\[ \{z+tj\in {\frak h}^3\ |\ 0 \le |{\rm Re}(z)| \le \frac{1}{2}, 0\le {\rm
Im}(z) \le \frac{1}{2}, z\overline z +t^2 \ge 1\} \]
  

The four bottom vertices of $D$ are $a = -\frac{1}{2} +\frac{1}{2}i +\frac{\sqrt{2}}{2}j$, $b = -\frac{1}{2} +\frac{\sqrt{3}}{2}j$, $c = \frac{1}{2} +\frac{\sqrt{3}}{2}j$, $d = \frac{1}{2} +\frac{1}{2}i +\frac{\sqrt{2}}{2}j$. 

The upper-half space ${\frak h}^3$ can be retracted onto a $2$-dimensional subspace ${\cal T} \subset {\frak h}^3$. The space ${\cal T}$ is a contractible $2$-dimensional regular CW-complex, and the action of the Picard group $G$ restricts to a cellular action of $G$ on ${\cal T}$. Under this action there is one orbit of $2$-cells, represented by the curvilinear square with vertices $a$, $b$, $c$ and $d$ in the picture. This $2$-cell has stabilizer group isomorphic to the quaternion group $Q_4$ of order $8$. There are two orbits of $1$-cells, both with stabilizer group isomorphic to a semi-direct product $C_3:C_4$. There is one orbit of $0$-cells, with stabilizer group isomorphic to $SL(2,3)$. 

Using perturbation techniques, the $2$-complex ${\cal T}$ can be combined with free resolutions for the cell stabilizer groups to
contruct a regular CW-complex $X$ on which the Picard group $G$ acts freely. The following commands compute the first few terms of the free $\mathbb ZG$-resolution $R_\ast =C_\ast X$. Then $R_\ast$ is used to compute 
\[H^1(G,\mathbb Z) =0\ ,\]
 
\[H^2(G,\mathbb Z) =\mathbb Z_2\oplus \mathbb Z_2\ ,\]
 
\[H^3(G,\mathbb Z) =\mathbb Z_6\ ,\]
 
\[H^4(G,\mathbb Z) =\mathbb Z_4\oplus \mathbb Z_{24}\ ,\]
 and compute a free presentation for $G$ involving four generators and seven relators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@K:=ContractibleGcomplex("SL(2,O-1)");;|
  !gapprompt@gap>| !gapinput@R:=FreeGResolution(K,5);;|
  !gapprompt@gap>| !gapinput@Cohomology(HomToIntegers(R),1);|
  [  ]
  !gapprompt@gap>| !gapinput@Cohomology(HomToIntegers(R),2);|
  [ 2, 2 ]
  !gapprompt@gap>| !gapinput@Cohomology(HomToIntegers(R),3);|
  [ 6 ]
  !gapprompt@gap>| !gapinput@Cohomology(HomToIntegers(R),4);|
  [ 4, 24 ]
  !gapprompt@gap>| !gapinput@P:=PresentationOfResolution(R);|
  rec( freeGroup := <free group on the generators [ f1, f2, f3, f4 ]>, 
    gens := [ 184, 185, 186, 187 ], 
    relators := [ f1^2*f2^-1*f1^-1*f2^-1, f1*f2*f1*f2^-2, 
        f3*f2^2*f1*(f2*f1^-1)^2*f3^-1*f1^2*f2^-2, 
        f1*(f2*f1^-1)^2*f3^-1*f1^2*f2^-1*f3^-1, 
        f4*f2*f1*(f2*f1^-1)^2*f4^-1*f1*f2^-1, f1*f4^-1*f1^-2*f4^-1, 
        f3*f2*f1*(f2*f1^-1)^2*f4^-1*f1*f2^-1*f3^-1*f4*f2 ] )
  
\end{Verbatim}
 We can also compute the cohomology of $G=SL_2(\mathbb Z[i])$ with coefficients in a module such as the module $P_{\mathbb Z[i]}(k)$ of degree $k$ homogeneous polynomials with coefficients in $\mathbb Z[i]$ and with the action described above. For instance, the following commands
compute 
\[H^1(G,P_{\mathbb Z[i]}(24)) = (\mathbb Z_2)^4 \oplus \mathbb Z_4 \oplus
\mathbb Z_8 \oplus \mathbb Z_{40} \oplus \mathbb Z_{80}\, ,\]
 
\[H^2(G,P_{\mathbb Z[i]}(24)) = (\mathbb Z_2)^{24} \oplus \mathbb
Z_{520030}\oplus \mathbb Z_{1040060} \oplus \mathbb Z^2\, ,\]
 
\[H^3(G,P_{\mathbb Z[i]}(24)) = (\mathbb Z_2)^{22} \oplus \mathbb Z_{4}\oplus
(\mathbb Z_{12})^2 \, .\]
 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|G:=R!.group;;A
  @gapprompt|gap>A @gapinput|M:=HomogeneousPolynomials(G,24);;A
  @gapprompt|gap>A @gapinput|C:=HomToIntegralModule(R,M);;A
  @gapprompt|gap>A @gapinput|Cohomology(C,1);A
  [ 2, 2, 2, 2, 4, 8, 40, 80 ]
  @gapprompt|gap>A @gapinput|Cohomology(C,2);A
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    520030, 1040060, 0, 0 ]
  @gapprompt|gap>A @gapinput|Cohomology(C,3);A
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 12, 12 
   ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Bianchi groups}}\logpage{[ 10, 9, 0 ]}
\hyperdef{L}{X858B1B5D8506FE81}{}
{
 The \emph{Bianchi groups} are the groups $G=PSL_2({\cal O}_{-d})$ where $d$ is a square free positive integer and ${\cal O}_{-d}$ is the ring of integers of the imaginary quadratic field $\mathbb Q(\sqrt{-d})$. More explicitly, 
\[{\cal O}_{-d} = \mathbb Z\left[\sqrt{-d}\right]~~~~~~~~ {\rm if~} d \equiv 1
{\rm ~mod~} 4\, ,\]
 
\[{\cal O}_{-d} = \mathbb Z\left[\frac{1+\sqrt{-d}}{2}\right]~~~~~ {\rm if~} d
\equiv 2,3 {\rm ~mod~} 4\, .\]
 These groups act on upper-half space ${\frak h}^3$ in the same way as the Picard group. Upper-half space can be tessellated by a
'fundamental domain' for this action. Moreover, as with the Picard group, this
tessellation contains a $2$-dimensional cellular subspace ${\cal T}\subset {\frak h}^3$ where ${\cal T}$ is a contractible CW-complex on which $G$ acts cellularly. It should be mentioned that the fundamental domain and the
contractible $2$-complex ${\cal T}$ are not uniquely determined by $G$. Various algorithms exist for computing ${\cal T}$ and its cell stabilizers. One algorithm due to Swan \cite{swan} has been implemented by Alexander Rahm \cite{rahmthesis} and the output for various values of $d$ are stored in HAP. Another approach is to use Voronoi's theory of perfect
forms. This approach has been implemented by Sebastian Schoennenbeck \cite{schoennenbeck} and, again, its output for various values of $d$ are stored in HAP. The following commands combine data from Schoennenbeck's
algorithm with free resolutions for cell stabiliers to compute 
\[H^1(PSL_2({\cal O}_{-6}),P_{{\cal O}_{-6}}(24)) = (\mathbb Z_2)^4 \oplus
\mathbb Z_{12} \oplus \mathbb Z_{24} \oplus \mathbb Z_{9240} \oplus \mathbb
Z_{55440} \oplus \mathbb Z^4\,, \]
 
\[H^2(PSL_2({\cal O}_{-6}),P_{{\cal O}_{-6}}(24)) = \begin{array}{l} (\mathbb
Z_2)^{26} \oplus \mathbb (Z_{6})^8 \oplus \mathbb (Z_{12})^{9} \oplus \mathbb
Z_{24} \oplus (\mathbb Z_{120})^2 \oplus (\mathbb Z_{840})^3\\ \oplus \mathbb
Z_{2520} \oplus (\mathbb Z_{27720})^2 \oplus (\mathbb Z_{24227280})^2 \oplus
(\mathbb Z_{411863760})^2\\ \oplus \mathbb
Z_{2454438243748928651877425142836664498129840}\\ \oplus \mathbb
Z_{14726629462493571911264550857019986988779040}\\ \oplus \mathbb
Z^4\end{array}\ , \]
 
\[H^3(PSL_2({\cal O}_{-6}),P_{{\cal O}_{-6}}(24)) = (\mathbb Z_2)^{23} \oplus
\mathbb Z_{4} \oplus (\mathbb Z_{12})^2\ . \]
 Note that the action of $SL_2({\cal O}_{-d})$ on $P_{{\cal O}_{-d}}(k)$ induces an action of $PSL_2({\cal O}_{-d})$ provided $k$ is even. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|R:=ResolutionPSL2QuadraticIntegers(-6,4);A
  Resolution of length 4 in characteristic 0 for PSL(2,O-6) . 
  No contracting homotopy available. 
  
  @gapprompt|gap>A @gapinput|G:=R!.group;;A
  @gapprompt|gap>A @gapinput|M:=HomogeneousPolynomials(G,24);;A
  @gapprompt|gap>A @gapinput|C:=HomToIntegralModule(R,M);;A
  @gapprompt|gap>A @gapinput|Cohomology(C,1);A
  [ 2, 2, 2, 2, 12, 24, 9240, 55440, 0, 0, 0, 0 ]
  @gapprompt|gap>A @gapinput|Cohomology(C,2);A
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 120, 120, 
    840, 840, 840, 2520, 27720, 27720, 24227280, 24227280, 411863760, 411863760, 
    2454438243748928651877425142836664498129840, 
    14726629462493571911264550857019986988779040, 0, 0, 0, 0 ]
  @gapprompt|gap>A @gapinput|Cohomology(C,3);A
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 12, 
    12 ]
  
\end{Verbatim}
 

We can also consider the coefficient module 
\[ P_{{\cal O}_{-d}}(k,\ell) = P_{{\cal O}_{-d}}(k) \otimes_{{\cal O}_{-d}}
\overline{P_{{\cal O}_{-d}}(\ell)} \]
 where the bar denotes a twist in the action obtained from complex conjugation.
For an action of the projective linear group we must insist that $k+\ell$ is even. The following commands compute 
\[H^2(PSL_2({\cal O}_{-11}),P_{{\cal O}_{-11}}(5,5)) = (\mathbb Z_2)^8 \oplus
\mathbb Z_{60} \oplus (\mathbb Z_{660})^3 \oplus \mathbb Z^6\,, \]
 a computation which was first made, along with many other cohomology
computationsfor Bianchi groups, by Mehmet Haluk Sengun \cite{sengun}. 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|R:=ResolutionPSL2QuadraticIntegers(-11,3);;A
  @gapprompt|gap>A @gapinput|M:=HomogeneousPolynomials(R!.group,5,5);;A
  @gapprompt|gap>A @gapinput|C:=HomToIntegralModule(R,M);;A
  @gapprompt|gap>A @gapinput|Cohomology(C,2);A
  [ 2, 2, 2, 2, 2, 2, 2, 2, 60, 660, 660, 660, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 

The function \texttt{ResolutionPSL2QuadraticIntegers(-d,n)} relies on a limited data base produced by the algorithms implemented by
Schoennenbeck and Rahm. The function also covers some cases covered by
entering a sring "-d+I" as first variable. These cases correspond to
projective special groups of module automorphisms of lattices of rank 2 over
the integers of the imaginary quadratic number field $\mathbb Q(\sqrt{-d})$ with non-trivial Steinitz-class. In the case of a larger class group there are
cases labelled "-d+I2",...,"-d+Ik" and the Ij together with O-d form a system
of representatives of elements of the class group modulo squares and Galois
action. For instance, the following commands compute 
\[H_2(PSL({\cal O}_{-21+I2}),\mathbb Z) = \mathbb Z_2\oplus \mathbb Z^6\, .\]
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@R:=ResolutionPSL2QuadraticIntegers("-21+I2",3);|
  Resolution of length 3 in characteristic 0 for PSL(2,O-21+I2)) . 
  No contracting homotopy available. 
  
  !gapprompt@gap>| !gapinput@Homology(TensorWithIntegers(R),2);|
  [ 2, 0, 0, 0, 0, 0, 0 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Some other infinite matrix groups}}\logpage{[ 10, 10, 0 ]}
\hyperdef{L}{X86A6858884B9C05B}{}
{
 Analogous to the functions for Bianchi groups, HAP has functions 
\begin{itemize}
\item \texttt{ResolutionSL2QuadraticIntegers(-d,n)} 
\item \texttt{ResolutionSL2ZInvertedInteger(m,n)}
\item \texttt{ResolutionGL2QuadraticIntegers(-d,n)}
\item \texttt{ResolutionPGL2QuadraticIntegers(-d,n)}
\item \texttt{ResolutionGL3QuadraticIntegers(-d,n)}
\item \texttt{ResolutionPGL3QuadraticIntegers(-d,n)}
\end{itemize}
 for computing free resolutions for certain values of $SL_2({\cal O}_{-d})$, $SL_2(\mathbb Z[\frac{1}{m}])$, $GL_2({\cal O}_{-d})$ and $PGL_2({\cal O}_{-d})$. Additionally, the function 
\begin{itemize}
\item \texttt{ResolutionArithmeticGroup("string",n)}
\end{itemize}
 can be used to compute resolutions for groups whose data (provided by
Sebastian Schoennenbeck, Alexander Rahm and Mathieu Dutour) is stored in the
directory \texttt{gap/pkg/Hap/lib/Perturbations/Gcomplexes} . 

For instance, the following commands compute 
\[H^1(SL_2({\cal O}_{-6}),P_{{\cal O}_{-6}}(24)) = (\mathbb Z_2)^4 \oplus
\mathbb Z_{12} \oplus \mathbb Z_{24} \oplus \mathbb Z_{9240} \oplus \mathbb
Z_{55440} \oplus \mathbb Z^4\,, \]
 
\[H^2(SL_2({\cal O}_{-6}),P_{{\cal O}_{-6}}(24)) = \begin{array}{l} (\mathbb
Z_2)^{26} \oplus \mathbb (Z_{6})^7 \oplus \mathbb (Z_{12})^{10} \oplus \mathbb
Z_{24} \oplus (\mathbb Z_{120})^2 \oplus (\mathbb Z_{840})^3\\ \oplus \mathbb
Z_{2520} \oplus (\mathbb Z_{27720})^2 \oplus (\mathbb Z_{24227280})^2 \oplus
(\mathbb Z_{411863760})^2\\ \oplus \mathbb
Z_{2454438243748928651877425142836664498129840}\\ \oplus \mathbb
Z_{14726629462493571911264550857019986988779040}\\ \oplus \mathbb
Z^4\end{array}\ , \]
 
\[H^3(SL_2({\cal O}_{-6}),P_{{\cal O}_{-6}}(24)) = (\mathbb Z_2)^{58} \oplus
(\mathbb Z_{4})^4 \oplus (\mathbb Z_{12})\ . \]
 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  @gapprompt|gap>A @gapinput|R:=ResolutionSL2QuadraticIntegers(-6,4);A
  Resolution of length 4 in characteristic 0 for PSL(2,O-6) . 
  No contracting homotopy available. 
  
  @gapprompt|gap>A @gapinput|G:=R!.group;;A
  @gapprompt|gap>A @gapinput|M:=HomogeneousPolynomials(G,24);;A
  @gapprompt|gap>A @gapinput|C:=HomToIntegralModule(R,M);;A
  @gapprompt|gap>A @gapinput|Cohomology(C,1);A
  [ 2, 2, 2, 2, 12, 24, 9240, 55440, 0, 0, 0, 0 ]
  @gapprompt|gap>A @gapinput|Cohomology(C,2);A
  @gapprompt|gap>A @gapinput|Cohomology(C,2);A
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 120, 
    120, 840, 840, 840, 2520, 27720, 27720, 24227280, 24227280, 411863760, 
    411863760, 2454438243748928651877425142836664498129840, 
    14726629462493571911264550857019986988779040, 0, 0, 0, 0 ]
  @gapprompt|gap>A @gapinput|Cohomology(C,3);A
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 12, 12 ]
  
\end{Verbatim}
 

The following commands construct free resolutions up to degree 5 for the
groups $SL_2(\mathbb Z[\frac{1}{2}])$, $GL_2({\cal O}_{-2})$, $GL_2({\cal O}_{2})$, $PGL_2({\cal O}_{2})$, $GL_3({\cal O}_{-2})$, $PGL_3({\cal O}_{-2})$. The final command constructs a free resolution up to degree 3 for $PSL_4(\mathbb Z)$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@R1:=ResolutionSL2ZInvertedInteger(2,5);|
  Resolution of length 5 in characteristic 0 for SL(2,Z[1/2]) . 
  
  !gapprompt@gap>| !gapinput@R2:=ResolutionGL2QuadraticIntegers(-2,5);|
  Resolution of length 5 in characteristic 0 for GL(2,O-2) . 
  No contracting homotopy available. 
  
  !gapprompt@gap>| !gapinput@R3:=ResolutionGL2QuadraticIntegers(2,5);|
  Resolution of length 5 in characteristic 0 for GL(2,O2) . 
  No contracting homotopy available. 
  
  !gapprompt@gap>| !gapinput@R4:=ResolutionPGL2QuadraticIntegers(2,5);|
  Resolution of length 5 in characteristic 0 for PGL(2,O2) . 
  No contracting homotopy available. 
  
  !gapprompt@gap>| !gapinput@R5:=ResolutionGL3QuadraticIntegers(-2,5);|
  Resolution of length 5 in characteristic 0 for GL(3,O-2) . 
  No contracting homotopy available. 
  
  !gapprompt@gap>| !gapinput@R6:=ResolutionPGL3QuadraticIntegers(-2,5);|
  Resolution of length 5 in characteristic 0 for PGL(3,O-2) . 
  No contracting homotopy available. 
  
  !gapprompt@gap>| !gapinput@R7:=ResolutionArithmeticGroup("PSL(4,Z)",3);|
  Resolution of length 3 in characteristic 0 for <matrix group with 655 generators> . 
  No contracting homotopy available. 
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Ideals and finite quotient groups}}\logpage{[ 10, 11, 0 ]}
\hyperdef{L}{X7EF5D97281EB66DA}{}
{
 The following commands first construct the number field $\mathbb Q(\sqrt{-7})$, its ring of integers ${\cal O}_{-7}={\cal O}(\mathbb Q(\sqrt{-7}))$, and the principal ideal $I=\langle 5 + 2\sqrt{-7}\rangle \triangleleft {\cal O}(\mathbb Q(\sqrt{-7}))$ of norm ${\cal N}(I)=53$. The ring $I$ is prime since its norm is a prime number. The primality of $I$ is also demonstrated by observing that the quotient ring $R={\cal O}_{-7}/I$ is an integral domain and hence isomorphic to the unique finite field of order $53 $, $R\cong \mathbb Z/53\mathbb Z$ . (In a ring of quadratic integers \emph{prime ideal} is the same as \emph{maximal ideal}). 

The finite group $G=SL_2({\cal O}_{-7}\,/\,I)$ is then constructed and confirmed to be isomorphic to $SL_2(\mathbb Z/53\mathbb Z)$. The group $G$ is shown to admit a periodic $\mathbb ZG$-resolution of $\mathbb Z$ of period dividing $52$. 

Finally the integral homology 
\[H_n(G,\mathbb Z) = \left\{\begin{array}{ll} 0 & n\ne 3,7, {\rm~for~} 0\le n
\le 8,\\ \mathbb Z_{2808} & n=3,7, \end{array}\right.\]
 is computed. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=QuadraticNumberField(-7);|
  Q(Sqrt(-7))
  
  !gapprompt@gap>| !gapinput@OQ:=RingOfIntegers(Q);|
  O(Q(Sqrt(-7)))
  
  !gapprompt@gap>| !gapinput@I:=QuadraticIdeal(OQ,5+2*Sqrt(-7));|
  ideal of norm 53 in O(Q(Sqrt(-7)))
  
  !gapprompt@gap>| !gapinput@R:=OQ mod I;|
  ring mod ideal of norm 53
  
  !gapprompt@gap>| !gapinput@IsIntegralRing(R);|
  true
  
  !gapprompt@gap>| !gapinput@gens:=GeneratorsOfGroup( SL2QuadraticIntegers(-7) );;|
  !gapprompt@gap>| !gapinput@G:=Group(gens*One(R));;G:=Image(IsomorphismPermGroup(G));;|
  !gapprompt@gap>| !gapinput@StructureDescription(G);|
  "SL(2,53)"
  
  !gapprompt@gap>| !gapinput@IsPeriodic(G);|
  true
  !gapprompt@gap>| !gapinput@CohomologicalPeriod(G);|
  52
  
  !gapprompt@gap>| !gapinput@GroupHomology(G,1);|
  [  ]
  !gapprompt@gap>| !gapinput@GroupHomology(G,2);|
  [  ]
  !gapprompt@gap>| !gapinput@GroupHomology(G,3);|
  [ 8, 27, 13 ]
  !gapprompt@gap>| !gapinput@GroupHomology(G,4);|
  [  ]
  !gapprompt@gap>| !gapinput@GroupHomology(G,5);|
  [  ]
  !gapprompt@gap>| !gapinput@GroupHomology(G,6);|
  [  ]
  !gapprompt@gap>| !gapinput@GroupHomology(G,7);|
  [ 8, 27, 13 ]
  !gapprompt@gap>| !gapinput@GroupHomology(G,8);|
  [  ]
  
\end{Verbatim}
 

The following commands show that the rational prime $7$ is not prime in ${\cal O}_{-5}={\cal O}(\mathbb Q(\sqrt{-5}))$. Moreover, $7$ totally splits in ${\cal O}_{-5}$ since the final command shows that only the rational primes $2$ and $5$ ramify in ${\cal O}_{-5}$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=QuadraticNumberField(-5);;|
  !gapprompt@gap>| !gapinput@OQ:=RingOfIntegers(Q);;|
  !gapprompt@gap>| !gapinput@I:=QuadraticIdeal(OQ,7);;|
  !gapprompt@gap>| !gapinput@IsPrime(I);|
  false
  
  !gapprompt@gap>| !gapinput@Factors(Discriminant(OQ));|
  [ -2, 2, 5 ]
  
\end{Verbatim}
 

 For $d < 0$ the rings ${\cal O}_d={\cal O}(\mathbb Q(\sqrt{d}))$ are unique factorization domains for precisely 
\[ d = -1, -2, -3, -7, -11, -19, -43, -67, -163.\]
 This result was conjectured by Gauss, and essentially proved by Kurt Heegner,
and then later proved by Harold Stark. 

The following commands construct the classic example of a prime ideal $I$ that is not principal. They then illustrate reduction modulo $I$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=QuadraticNumberField(-5);;|
  !gapprompt@gap>| !gapinput@OQ:=RingOfIntegers(Q);;|
  !gapprompt@gap>| !gapinput@I:=QuadraticIdeal(OQ,[2,1+Sqrt(-5)]);|
  ideal of norm 2 in O(Q(Sqrt(-5)))
  
  !gapprompt@gap>| !gapinput@6 mod I;|
  0
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Congruence subgroups for ideals}}\logpage{[ 10, 12, 0 ]}
\hyperdef{L}{X7D1F72287F14C5E1}{}
{
 

 Given a ring of integers ${\cal O}$ and ideal $I \triangleleft {\cal O}$ there is a canonical homomorphism $\pi_I\colon SL_2({\cal O}) \rightarrow SL_2({\cal O}/I)$. A subgroup $\Gamma \le SL_2({\cal O})$ is said to be a \emph{congruence subgroup} if it contains $\ker \pi_I$. Thus congruence subgroups are of finite index. Generalizing the definition
in \ref{sec:EichlerShimura} above, we define the \emph{principal congruence subgroup} $\Gamma_1(I)=\ker \pi_I$, and the congruence subgroup $\Gamma_0(I)$ consisting of preimages of the upper triangular matrices in $SL_2({\cal O}/I)$. 

 The following commands construct $\Gamma=\Gamma_0(I)$ for the ideal $I\triangleleft {\cal O}\mathbb Q(\sqrt{-5})$ generated by $12$ and $36\sqrt{-5}$. The group $\Gamma$ has index $385$ in $SL_2({\cal O}\mathbb Q(\sqrt{-5}))$. The final command displays a tree in a Cayley graph for $SL_2({\cal O}\mathbb Q(\sqrt{-5}))$ whose nodes represent a transversal for $\Gamma$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=QuadraticNumberField(-5);;|
  !gapprompt@gap>| !gapinput@OQ:=RingOfIntegers(Q);;|
  !gapprompt@gap>| !gapinput@I:=QuadraticIdeal(OQ,[36*Sqrt(-5), 12]);;|
  !gapprompt@gap>| !gapinput@G:=HAP_CongruenceSubgroupGamma0(I);|
  CongruenceSubgroupGamma0(ideal of norm 144 in O(Q(Sqrt(-5)))) 
  
  !gapprompt@gap>| !gapinput@IndexInSL2O(G);|
  385
   
  !gapprompt@gap>| !gapinput@HAP_SL2TreeDisplay(G);|
  
\end{Verbatim}
  

The next commands first construct the congruence subgroup $\Gamma_0(I)$ of index $144$ in $SL_2({\cal O}\mathbb Q(\sqrt{-2}))$ for the ideal $I$ in ${\cal O}\mathbb Q(\sqrt{-2})$ generated by $4+5\sqrt{-2}$. The commands then compute 
\[H_1(\Gamma_0(I),\mathbb Z) = \mathbb Z_3 \oplus \mathbb Z_6 \oplus \mathbb
Z_{30} \oplus \mathbb Z^8\, ,\]
 
\[H_2(\Gamma_0(I), \mathbb Z) = (\mathbb Z_2)^9 \oplus \mathbb Z^7\, ,\]
 
\[H_3(\Gamma_0(I), \mathbb Z) = (\mathbb Z_2)^9 \, .\]
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=QuadraticNumberField(-2);;|
  !gapprompt@gap>| !gapinput@OQ:=RingOfIntegers(Q);;|
  !gapprompt@gap>| !gapinput@I:=QuadraticIdeal(OQ,4+5*Sqrt(-2));;|
  !gapprompt@gap>| !gapinput@G:=HAP_CongruenceSubgroupGamma0(I);|
  CongruenceSubgroupGamma0(ideal of norm 66 in O(Q(Sqrt(-2)))) 
  
  !gapprompt@gap>| !gapinput@IndexInSL2O(G);|
  144
  
  !gapprompt@gap>| !gapinput@R:=ResolutionSL2QuadraticIntegers(-2,4,true);;|
  !gapprompt@gap>| !gapinput@S:=ResolutionFiniteSubgroup(R,G);;|
  
  !gapprompt@gap>| !gapinput@Homology(TensorWithIntegers(S),1);|
  [ 3, 6, 30, 0, 0, 0, 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(TensorWithIntegers(S),2);|
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0 ]
  !gapprompt@gap>| !gapinput@Homology(TensorWithIntegers(S),3);|
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{First homology}}\logpage{[ 10, 13, 0 ]}
\hyperdef{L}{X85E912617AFE03F4}{}
{
 The isomorphism $H_1(G,\mathbb Z) \cong G_{ab}$ allows for the computation of first integral homology using computational
methods for finitely presented groups. Such methods underly the following
computation of 
\[H_1( \Gamma_0(I),\mathbb Z) \cong \mathbb Z_2 \oplus \cdots \oplus \mathbb
Z_{4078793513671}\]
 where $I$ is the prime ideal in the Gaussian integers generated by $41+56\sqrt{-1}$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=QuadraticNumberField(-1);;|
  !gapprompt@gap>| !gapinput@OQ:=RingOfIntegers(Q);;|
  !gapprompt@gap>| !gapinput@I:=QuadraticIdeal(OQ,41+56*Sqrt(-1));|
  ideal of norm 4817 in O(GaussianRationals)
  !gapprompt@gap>| !gapinput@G:=HAP_CongruenceSubgroupGamma0(I);;|
  !gapprompt@gap>| !gapinput@AbelianInvariants(G);|
  [ 2, 2, 4, 5, 7, 16, 29, 43, 157, 179, 1877, 7741, 22037, 292306033, 
    4078793513671 ]
  
\end{Verbatim}
 

We write $G^{ab}_{tors}$ to denote the maximal finite summand of the first homology group of $G$ and refer to this as the \emph{torsion subgroup}. Nicholas Bergeron and Akshay Venkatesh \cite{bergeron} have conjectured relationships between the torsion in congruence subgroups $\Gamma$ and the volume of their quotient manifold ${\frak h}^3/\Gamma$. For instance, for the Gaussian integers they conjecture 
\[ \frac{\log |\Gamma_0(I)_{tors}^{ab}|}{{\rm Norm}(I)} \rightarrow
\frac{\lambda}{18\pi},\ \lambda =L(2,\chi_{\mathbb Q(\sqrt{-1})}) = 1
-\frac{1}{9} + \frac{1}{25} - \frac{1}{49} + \cdots\]
 as the norm of the prime ideal $I$ tends to $\infty$. The following approximates $\lambda/18\pi = 0.0161957$ and $\frac{\log |\Gamma_0(I)_{tors}^{ab}|}{{\rm Norm}(I)} = 0.00913432$ for the above example. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Q:=QuadraticNumberField(-1);;|
  !gapprompt@gap>| !gapinput@Lfunction(Q,2)/(18*3.142);|
  0.0161957
  
  !gapprompt@gap>| !gapinput@1.0*Log(Product(AbelianInvariants(F)),10)/Norm(I);|
  0.00913432
  
\end{Verbatim}
 

 The link with volume is given by the Humbert volume formula 
\[ {\rm Vol} ( {\frak h}^3 / PSL_2( {\cal O}_{d} ) ) = \frac{|D|^{3/2}}{24}
\zeta_{ \mathbb Q( \sqrt{d} ) }(2)/\zeta_{\mathbb Q}(2) \]
 valid for square-free $d<0$, where $D$ is the discriminant of $\mathbb Q(\sqrt{d})$. The volume of a finite index subgroup $\Gamma$is obtained by multiplying the right-hand side by the index $|PSL_2({\cal O}_d)\,:\, \Gamma|$. }

 }

 
\chapter{\textcolor{Chapter }{Parallel computation}}\logpage{[ 11, 0, 0 ]}
\hyperdef{L}{X7F571E8F7BBC7514}{}
{
 
\section{\textcolor{Chapter }{An embarassingly parallel computation}}\logpage{[ 11, 1, 0 ]}
\hyperdef{L}{X7EAE286B837D27BA}{}
{
 

The following example creates five child processes and uses them
simultaneously to compute the second integral homology of each of the $267$ groups of order $64$. The final command shows that 

$H_2(G,\mathbb Z)=\mathbb Z_2^{15}$ 

for the $267$-th group $G$ in \textsc{GAP}'s library of small groups. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Processes:=List([1..5],i->ChildProcess());;|
  !gapprompt@gap>| !gapinput@fn:=function(i);return GroupHomology(SmallGroup(64,i),2);end;;|
  !gapprompt@gap>| !gapinput@for p in Processes do|
  !gapprompt@>| !gapinput@ChildPut(fn,"fn",p);|
  !gapprompt@>| !gapinput@od;|
  
  !gapprompt@gap>| !gapinput@NrSmallGroups(64);|
  267
  
  !gapprompt@gap>| !gapinput@L:=ParallelList([1..267],"fn",Processes);;|
  
  !gapprompt@gap>| !gapinput@L[267];|
  [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
  
\end{Verbatim}
 

The function \texttt{ParallelList()} is built from \textsc{HAP}'s six core functions for parallel computation. }

 }

 \def\bibname{References\logpage{[ "Bib", 0, 0 ]}
\hyperdef{L}{X7A6F98FD85F02BFE}{}
}

\bibliographystyle{alpha}
\bibliography{mybib.xml}

\addcontentsline{toc}{chapter}{References}

\def\indexname{Index\logpage{[ "Ind", 0, 0 ]}
\hyperdef{L}{X83A0356F839C696F}{}
}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
