


Some classical theoryThe second cohomology
H^{2}(G,A) of G with coefficients in a Gmodule A, together
with the corresponding 2cocycles,
have
a
useful grouptheoretic interpretation. Any group extension N >> E >> G gives rise to
Any outer homomorphism alpha:G>Out(N) gives rise to a
cohomology class [c] in H^{3}(G,Z(N)). It was shown
by Eilenberg and Mac Lane that the cohomology class [c] is
trivial if and only if the outer action alpha arises from some group
extension N >> E >> G. If [c] is
trivial then there is a bijection between the second cohomology group H^{2}(G,Z(N))
and
Yoneda
equivalence classes of extensions of G by N that are
compatible with alpha. 

An exampleConsider the group
H=SmallGroup(64,134). This is the Sylow 2subgroup
of the Mathieu group M_{12}. Consider the normal subgroup
N:=NormalSubgroups(G)[16] and quotient group G=H/N. We have N=C_{2}×D_{4}
, A=Z(N)=C_{2}×C_{2} and G=C_{2}×C_{2}
.
Suppose that we wish to classify all extensions C_{2}×D_{4}_{ }>> E > C_{2}×C_{2} which induce the given outer action of G on N. The following commands show that, up to Yoneda equivalence, there are two such extensions. 

gap>
H:=SmallGroup(64,134);; gap> N:=NormalSubgroups(H)[15];; gap> A:=Centre(GOuterGroup(H,N));; gap> G:=ActingGroup(A);; gap> R:=ResolutionFiniteGroup(G,3);; gap> C:=HomToGModule(R,A);; gap> Cohomology(C,2); [ 2 ] 

The following additional commands return a standard 2cocycle f:G×G>A =Z_{2}_{}_{}×Z_{2 }corresponding to the nontrivial element in H^{2}(G,A). The value f(g,h) of the 2cocycle is calculated for all 16 pairs g,h in G.  
gap>
CH:=CohomologyModule(C,2);; gap> Elts:=Elements(ActedGroup(CH)); [ <identity> of ..., f1 ] gap> x:=Elts[2];; gap> c:=CH!.representativeCocycle(x); Standard 2cocycle gap> f:=Mapping(c);; gap> for g in G do for h in G do > Print(f(g,h),"\n"); > od; > od; <identity> of ... <identity> of ... <identity> of ... <identity> of ... <identity> of ... f6 <identity> of ... f6 <identity> of ... <identity> of ... <identity> of ... <identity> of ... <identity> of ... f6 <identity> of ... f6 

The
following extended example illustrates how to construct a cohomology
class C in H^{2}(G, A) from a cocycle c:G x G > A. 

gap>
#We'll construct G=SL(2,Z_4) as a permutation group. gap> G:=SL(2,ZmodnZ(4));; gap> G:=Image(IsomorphismPermGroup(G));; gap> #We'll construct Z_8=Z/8Z as a Gouter group gap> z_8:=Group((1,2,3,4,5,6,7,8));; gap> Z_8:=TrivialGModuleAsGOuterGroup(G,z_8);; gap> #We'll compute the group h=H^2(G,Z_8) gap> R:=ResolutionFiniteGroup(G,3);; #R is a free resolution gap> C:=HomToGModule(R,Z_8);; # C is a chain complex gap> H:=CohomologyModule(C,2);; #H is the second cohomology H^2(G,Z_8) gap> h:=ActedGroup(H);; #h is the underlying group of H gap> #We'll compute cocycles c2, c5 for the second and fifth cohomology classs gap> c2:=H!.representativeCocycle(Elements(h)[2]); Standard 2cocycle gap> c5:=H!.representativeCocycle(Elements(h)[5]); Standard 2cocycle gap> #Now we'll construct the cohomology classes C2, C5 in the group h corresponding to the cocycles c2, c5. gap> C2:=CohomologyClass(H,c2);; gap> C5:=CohomologyClass(H,c5);; gap> #Finally, we'll show that C2, C5 are distinct cohomology classes, both of order 4. gap> C2=C5; false gap> Order(C2); 4 gap> Order(C5); 4 

The
HAPcocyclic package
developed by Robert Morse can be used to construct an extension of G by
N for each cohomology class in H^{2}(G,A). An initial
developmental version of this package can be downloaded and untarred
in
directory ../gap/pkg . The following commands will then construct and identify all extensions of N by G corresponding to the given outer action of G on N. 

gap>
#The
following
commands only work if the HAPcocyclic package by Robert
Morse is loaded. gap> LoadPackage("HAPcocyclic");; gap> H := SmallGroup(64,134);; gap> N := NormalSubgroups(H)[16];; gap> ON := GOuterGroup(H,N);; gap> A := Centre(ON);; gap> G:=ActingGroup(A);; gap> R:=ResolutionFiniteGroup(G,3);; gap> C:=HomToGModule(R,A);; gap> CH:=CohomologyModule(C,2);; gap> Elts:=Elements(ActedGroup(CH));; gap> lst := List(Elts{[1..Length(Elts)]},x>CH!.representativeCocycle(x));; gap> ccgrps := List(lst, x>CcGroup(ON, x));; gap> #So ccgrps is a list of groups, each being an extension of G by N, corresponding gap> #to the two elements in H^2(G,A). gap> #The following command produces the GAP identification number for each group. gap> L:=List(ccgrps,IdGroup); [ [ 64, 134 ], [ 64, 135 ] ] 

