<Chapter><Heading>Group theoretic computations</Heading>
<Section><Heading>Third homotopy group of a supsension of an Eilenberg-MacLane space </Heading>

<P/>The following example uses the nonabelian tensor square of groups  to compute
the third homotopy group
<P/><M>\pi_3(S(K(G,1))) = \mathbb Z^{30}</M>
<P/>of the suspension of the Eigenberg-MacLane space <M>K(G,1)</M>
for <M>G</M> the free nilpotent group of class <M>2</M> on four generators.
<Example>
<#Include SYSTEM "tutex/5.1.txt">
</Example>

</Section>
<Section><Heading>Representations of knot quandles</Heading>

<P/> 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 <M>17</M>-th quandle in <B>HAP</B>'s library of connected quandles of order <M>24</M>. The number of homomorphisms differs between the two cases. The computation therefore  establishes that the complement in <M>\mathbb R^3</M>
of the granny knot is not homeomorphic to the complement of the square knot.

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

<P/> The following commands compute a knot quandle directly from a pdf file containing the following  hand-drawn image of the  knot.

<P/>
<Alt Only="HTML">&lt;img src="images/myknot.png" align="center" height="160" alt="hand-drawn image of the trefoil knot"/>
</Alt>

<Example>
<#Include SYSTEM "tutex/5.2A.txt">
</Example>

</Section>
<Section><Heading>Identifying knots</Heading>
Low index subgrops of the knot group can be used to identify knots with few crossings. For instance, the following commands read in the following image of a knot and identify it as a sum of two trefoils. The commands determine the prime components only up to reflection, and so they don't distinguish between the granny and square knots.
<P/>
<Alt Only="HTML">&lt;img src="images/myknot2.png" align="center" height="160" alt="hand-drawn image of a knot"/>
</Alt>

<Example>
<#Include SYSTEM "tutex/5.2B.txt">
</Example>

</Section>
<Section><Heading>Aspherical <M>2</M>-complexes</Heading>

<P/>The following example uses Polymake's linear programming routines to
establish  that the <M>2</M>-complex associated to the group presentation <M>&lt;x,y,z : xyx=yxy,\, yzy=zyz,\, xzx=zxz></M> is aspherical (that is, has contractible universal cover). The presentation is Tietze equivalent to the presentation used in the computer code, and the associated <M>2</M>-complexes are thus homotopy equivalent. 

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


</Section>
<Section><Heading>Bogomolov multiplier</Heading>

<P/>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 <M>243</M> with non-trivial Bogomolov multiplier. The groups in question are numbered 28, 29 and 30 in <B>GAP</B>'s library of small groups of order <M>243</M>.

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

</Section>

<Section Label="secExtensions"><Heading>Second group cohomology and group extensions</Heading>

Any group extension <M>N\rightarrowtail E \twoheadrightarrow G</M> gives rise to:
<List>
<Item> an outer action <M>\alpha\colon G\rightarrow Out(G)</M> of <M>G</M> on <M>N</M>.</Item>

<Item>an action <M>G\rightarrow Aut(Z(N))</M> of <M>G</M> on the centre of <M>N</M>, uniquely induced by the outer action <M>\alpha</M> and the canonical action of <M>Out(N)</M> on <M>Z(N)</M>.</Item>
<Item>a <M>2</M>-cocycle <M>f\colon G\times G\rightarrow Z(N)</M> with values in the <M>G</M>-module <M>A=Z(N)</M>.</Item>
</List>

<P/>Any outer homomorphism <M>\alpha\colon G\rightarrow Out(N)</M> gives rise to a cohomology class <M>k</M> in <M>H^3(G,Z(N))</M>. It was shown by Eilenberg and Mac<M>\,</M>Lane that the class <M>k</M> is trivial if and only if the outer action
<M>\alpha</M> arises from some group extension <M>N\rightarrowtail E\twoheadrightarrow G</M>. If <M>k</M> is trivial then there is a bijection between the second cohomology group <M>H^2(G,Z(N))</M> and Yoneda equivalence classes of extensions of <M>G</M> by <M>N</M> that are compatible with <M>\alpha</M>. 

<P/><B>First Example.</B>

<P/> Consider the group <M>H=SmallGroup(64,134)</M>. 
Consider the normal subgroup <M>N=NormalSubgroups(G)[15]</M> and quotient group
<M>G=H/N</M>. We have <M>N=C_2\times D_4</M>, <M>A=Z(N)=C_2\times C_2</M> and <M>G=C_2\times C_2</M>.

<P/> Suppose we wish to classify all extensions <M>C_2\times D_4 \rightarrowtail E \twoheadrightarrow C_2\times C_2</M> that induce the given outer action of <M>G</M> on <M>N</M>. The following commands show that, up to Yoneda equivalence, there are two such extensions.

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

<P/>The following additional commands return a standard <M>2</M>-cocycle <M>f:G\times G\rightarrow A =C_2\times C_2</M> corresponding to the non-trivial element in 
<M>H^2(G,A)</M>. The value <M>f(g,h)</M> of the <M>2</M>-cocycle is calculated for all <M>16</M> pairs <M>g,h \in G</M>.

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

<P/>The following commands will then construct and identify all extensions of <M>N</M> by <M>G</M> corresponding to the given outer action of <M>G</M> on <M>N</M>.

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


<P/><B>Second Example</B>

<P/>The following example illustrates how to construct a cohomology class <M>k</M> in <M>H^2(G, A)</M> from a cocycle <M>f:G \times G \rightarrow A</M>, where <M>G=SL_2(\mathbb Z_4)</M> and <M>A=\mathbb Z_8</M> with trivial action.

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

</Section>

<Section Label="secHadamard"><Heading>Second group cohomology and cocyclic Hadamard matrices</Heading>

An <E>Hadamard matrix</E> is a square <M>n\times n</M> 
matrix <M>H</M> whose entries are either <M>+1</M> or <M>-1</M> and whose rows are mutually orthogonal, that is <M>H H^t = nI_n</M> where <M>H^t</M> denotes the transpose and <M>I_n</M> denotes the <M>n\times n</M> identity matrix. 

<P/>Given a group <M>G=\{g_1,g_2,\ldots,g_n\}</M> of order <M>n</M> and the abelian group 
<M>A=\{1,-1\}</M> of square roots of unity, any <M>2</M>-cocycle 
<M>f\colon G\times G\rightarrow A</M> corresponds to an <M>n\times n</M> matrix <M>F=(f(g_i,g_j))_{1\le i,j\le n}</M> whose entries are <M>\pm 1</M>. If <M>F</M> is Hadamard it is called a <E>cocyclic Hadamard matrix</E> corresponding to <M>G</M>. 

<P/>The following commands compute all <M>192</M> of the cocyclic Hadamard matrices for the abelian group <M>G=\mathbb Z_4\oplus \mathbb Z_4</M> of order <M>n=16</M>.

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

</Section>

<Section Label="secCat1">
<Heading>Third group cohomology and homotopy <M>2</M>-types</Heading>

<B>Homotopy 2-types</B>

<P/>
The third cohomology <M>H^3(G,A)</M> of a group <M>G</M> with coefficients in a <M>G</M>-module <M>A</M>, together with the corresponding <M>3</M>-cocycles, can be used to classify homotopy <M>2</M>-types.
A <E>homotopy 2-type</E> is a CW-complex whose homotopy groups are trivial in dimensions <M>n=0</M> and <M>n>2</M>. There is an equivalence between the  two  categories

<Enum>
<Item>
(Homotopy category of connected CW-complexes <M>X</M> with trivial homotopy groups <M>\pi_n(X)</M> for <M>n&gt;2</M>)
</Item>
<Item>
(Localization of the category of simplicial groups with Moore complex of length <M>1</M>, where localization is with respect to homomorphisms inducing isomorphisms on homotopy groups)
</Item>
</Enum>
which reduces the homotopy theory of <M>2</M>-types to a 'computable' algebraic theory. Furthermore, a simplicial group with Moore complex of length <M>1</M> can be represented by a group <M>H</M> endowed with two endomorphisms <M>s\colon H\rightarrow H</M> and <M>t\colon H\rightarrow H</M> satisfying the axioms
<List>
<Item><M>ss=s</M>, <M>ts=s</M>,</Item>
<Item><M>tt=t</M>, <M>st=t</M>,</Item>
<Item> <M>[\ker s, \ker t] = 1</M>.</Item>
</List>
Ths triple <M>(H,s,t)</M> was termed a <E>cat<M>^1</M>-group</E>
by J.-L. Loday since it can be regarded as a group <M>H</M> endowed with one compatible category structure.

<P/>The <E>homotopy groups</E> of a cat<M>^1</M>-group <M>H</M> are defined as: <M>\pi_1(H) = {\rm image}(s)/t(\ker(s))</M>; <M>\pi_2(H)=\ker(s) \cap \ker(t)</M>; <M>\pi_n(H)=0</M> for <M>n&gt; 2</M> or <M>n=0</M>.
Note that <M>\pi_2(H)</M> is a <M>\pi_1(H)</M>-module where the action is induced by conjugation in <M>H</M>. 

<P/>A homotopy <M>2</M>-type <M>X</M> can be represented by a  cat<M>^1</M>-group <M>H</M> or by the homotopy groups <M>\pi_1X=\pi_1H</M>, <M>\pi_2X=\pi_2H</M> and a cohomology class <M>k\in H^3(\pi_1X,\pi_2X)</M>. This class <M>k</M> is the <E>Postnikov invariant</E>.

<P/><B>Relation to Group Theory</B>

<P/>A number of standard group-theoretic constructions can be viewed naturally as a cat<M>^1</M>-group.
<Enum>
<Item>
A <M>\mathbb ZG</M>-module <M>A</M> can be viewed as a cat<M>^1</M>-group <M>(H,s,t)</M> where <M>H</M> is the semi-direct product <M>A\rtimes G</M>
 and <M>s(a,g)=(1,g)</M>, <M>t(a,g)=(1,g)</M>. Here <M>\pi_1(H)=G</M>
 and <M>\pi_2(H)=A</M>.</Item>
<Item>
    A group <M>G</M> with normal subgroup <M>N</M> can be viewed as a cat<M>^1</M>-group <M>(H,s,t)</M> where <M>H</M> is the semi-direct product <M>N\rtimes G</M>
 and <M>s(n,g)=(1,g)</M>, <M>t(n,g)=(1,ng)</M>. Here <M>\pi_1(H)=G/N</M>
 and <M>\pi_2(H)=0</M>.</Item>
   <Item> The homomorphism <M>\iota \colon G\rightarrow Aut(G)</M>
 which sends elements of a group <M>G</M> to the corresponding inner automorphism can be viewed as a cat<M>^1</M>-group <M>(H,s,t)</M> where <M>H</M> is the semi-direct product <M>G\rtimes Aut(G)</M> and <M>s(g,a)=(1,a)</M>, <M>t(g,a)=(1,\iota (g)a)</M>. Here <M>\pi_1(H)=Out(G)</M> is the outer automorphism group of <M>G</M>
 and <M>\pi_2(H)=Z(G)</M> is the centre of <M>G</M>.</Item>
</Enum>

These three constructions are implemented in <B>HAP</B>. 

<P/><B>Example</B>

<P/>The following commands begin by constructing the cat<M>^1</M>-group 
<M>H</M>
of Construction 3  for the group <M>G=SmallGroup(64,134)</M>. They then 
construct the fundamental group of <M>H</M> and  the second homotopy group of as a 
<M>\pi_1</M>-module. These homotopy groups have orders <M>8</M> and <M>2</M> respectively.

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

<P/>
The following additional commands show that there are <M>1024</M> Yoneda equivalence classes of cat<M>^1</M>-groups with fundamental group <M>\pi_1</M> and
<M>\pi_1</M>- module  equal to <M>\pi_2</M> in our example.

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

A <M>3</M>-cocycle  <M>f \colon \pi_1 \times \pi_1 \times \pi_1 \rightarrow
\pi_2</M> corresponding to  a random cohomology class  <M>k\in H^3(\pi_1,\pi_2)</M> can be produced using the following command. 
</Section>
<Example>
<#Include SYSTEM "tutex/5.11.txt">
</Example>
The <M>3</M>-cocycle corresponding to the Postnikov invariant of
 <M>H</M> itself can be easily constructed directly from its definition in terms of a set-theoretic 'section' of the crossed module corresponding to <M>H</M>.
</Chapter>
