#Usage::Assume we have a set of generators x1..xk of a group G. #rep1 and rep2 are representations of a G over a finite field F, #given as lists of matrices, where repj[i] represents the map xi->repj[i] #relns is a set of relations for G in the generators x1..xk, given as a list #e.g. the relation (x1x2)^3=1 with [x1,x2] generators 1 and 2 #is written as [1,2,1,2,1,2] #Whether a notrivial extension exists can be determined by computing the difference #-Dimension(cohomBoundaries(rep1,rep2,F))+Dimension(cohomCyc(rep1,rep2,F)); #If a nontrivial extension exists, it can be constructed by choosing an element cohomvec which is in # Basis((cohomCyc(rep1,rep2,F)) but which is not in Basis(cohomBoundaries(rep1,rep2,F)) #and computing constructExtension(rep1,rep2,cohomvec,F) nullVec:=function(n,F) return List([1..n],x->Zero(F));end; kp:=function(a,b) return KroneckerProduct(a,b);end; nsm:=function(mat) return NullspaceMat(mat);end; tm:=function(a) return TransposedMat(a);end; vsSpan:=function(v1,v2,f) return VectorSpace(f,Concatenation(Basis(v1),Basis(v2)));end; colIdem:=function(n,i,F) local r,j; r:=[]; for j in [1..n] do r[j]:=[];od; for j in [1..n] do if j=i then r[j]:=[One(F)]; else r[j]:=[Zero(F)];fi;od; return r; end; rowIdem:=function(n,i,F) local r,j; r:=[]; for j in [1..n] do r[j]:=[];od; for j in [1..n] do if j=i then r[j]:=One(F); else r[j]:=Zero(F);fi;od; return r; end; matIdem:=function(n,i,F) local r,j,k; r:=[]; for j in [1..n] do r[j]:=[];od; for j in [1..n] do if j=i then r[j]:=rowIdem(n,i,F); else r[j]:=nullVec(n,F);fi;od; return r; end; dropFirst:=function(l) return List([1..Length(l)-1],i->l[i+1]);end; prodMatGens:=function(rep,l) return Product(l,i->rep[AbsInt(i)]^SignInt(i));end; #n is the number of generators of the group #reln is a list of integers representing a relation, with the integer i #corresponding to the ith generator #e.g. the relation (xy)^3=1 with [x,y] generators 1 and 2 #is written as [1,2,1,2,1,2] #this function computes the cycle cohomology matrix of 2 representations #rep1,rep2 corresponding to reln #rep1,rep2 are lists of matrices, each of length n cohomMatCyc:=function(rep1,rep2,mat2,reln,mat1,F) if Length(reln)=1 then if reln[1]<0 then return kp(colIdem(Length(rep1),-reln[1],F), -kp(tm(mat2*(rep2[-reln[1]])^(-1)),(rep1[-reln[1]])^(-1)*mat1)); else return kp(colIdem(Length(rep1),reln[1],F),kp(tm(mat2),mat1));fi; else return cohomMatCyc(rep1,rep2,mat2,[reln[1]],prodMatGens(rep1,dropFirst(reln))*mat1,F) +cohomMatCyc(rep1,rep2,mat2*rep2[AbsInt(reln[1])]^SignInt(reln[1]),dropFirst(reln),mat1,F);fi;end; cohomCyc:=function(rep1,rep2,relns,F) return Intersection(List([1..Length(relns)], x->VectorSpace(F,NullspaceMat(cohomMatCyc(rep1,rep2,rep2[1]^0,relns[x],rep1[1]^0,F)))));end; coboundaryMat:=function(rep1,rep2,F) return Sum([1..Length(rep1)], i->kp([rowIdem(Length(rep1),i,F)],kp(tm(rep2[i]),rep1[i]^0) -kp(tm(rep2[i])^0,rep1[i])));end; cohomBoundaries:=function (rep1,rep2,F) return VectorSpace(F,coboundaryMat(rep1,rep2,F));end; ax:=Z(2)*[[1,0],[1,1]]; ay:=Z(2)*[[1,0],[0,1]]; bx:=Z(2)*[[1,0,0],[1,1,0],[0,0,1]]; by:=Z(2)*[[1,0,0],[0,1,0],[0,1,1]]; d4rep1:=[ax,ay]; d4rep2:=[bx,by]; relnsd4:=[[1,1],[2,2],[1,2,1,2,1,2,1,2]]; #Simple module of dimension 3 sl25Simp3Generators := [ [ [ Z(5)^2, Z(5)^2, Z(5)^3 ], [ 0*Z(5), Z(5)^0, Z(5)^2 ], [ 0*Z(5), 0*Z(5), Z(5)^2 ] ], [ [ 0*Z(5), Z(5), Z(5)^3 ], [ Z(5)^2, Z(5)^0, Z(5) ], [ Z(5)^2, Z(5), Z(5)^2 ] ] ]; sl25SteinbergGenerators := [ [ [ Z(5)^0, 0*Z(5), 0*Z(5), Z(5)^0, 0*Z(5) ], [ 0*Z(5), Z(5)^2, 0*Z(5), 0*Z(5), Z(5) ], [ 0*Z(5), 0*Z(5), Z(5)^0, Z(5)^0, 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^2, 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^0 ] ], [ [ Z(5), 0*Z(5), Z(5)^2, 0*Z(5), Z(5)^0 ], [ Z(5), Z(5), Z(5), 0*Z(5), Z(5)^3 ], [ 0*Z(5), Z(5)^0, Z(5)^0, Z(5)^3, Z(5)^2 ], [ Z(5)^3, Z(5), 0*Z(5), Z(5)^2, Z(5)^3 ], [ Z(5)^0, 0*Z(5), 0*Z(5), Z(5)^3, 0*Z(5) ] ] ]; sl25Simp5Generators:=sl25SteinbergGenerators; #Simple module of dimension 4 sl25Simp4Generators := [ [ [ Z(5)^3, 0*Z(5), 0*Z(5), Z(5)^2 ], [ 0*Z(5), Z(5), Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), Z(5)^3, 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), Z(5) ] ], [ [ Z(5)^3, Z(5), 0*Z(5), Z(5)^3 ], [ 0*Z(5), Z(5)^0, 0*Z(5), 0*Z(5) ], [ Z(5), Z(5), Z(5)^0, Z(5)^3 ], [ Z(5)^2, 0*Z(5), 0*Z(5), Z(5)^0 ] ] ]; sl25Simp2Generators :=[ [ [ Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^3 ] ], [ [ Z(5)^2, Z(5)^0 ], [ Z(5)^2, 0*Z(5) ] ] ]; sl25rep1:=[[[Z(5)^0]],[[Z(5)^0]]]; sl25rep2:=sl25Simp2Generators; sl25rep3:=sl25Simp3Generators; sl25rep4:=sl25Simp4Generators; sl25rep5:=sl25Simp5Generators; relnssl25:=[[1,1,1,1],[2,2,2],[1,1,2,1,1,-2],[2,1,2,1,2,-1,2,-1,2,-1]]; b33:=cohomBoundaries(sl25rep3,sl25rep3,GF(5)); c33:=cohomCyc(sl25rep3,sl25rep3,relnssl25,GF(5)); constructExtensionMat:=function(mat1,mat2,vec,F) local m,i,j; m:=NullMat(Length(mat1)+Length(mat2),Length(mat1)+Length(mat2),F); for i in [1..Length(mat1)] do for j in [1..Length(mat1)] do m[i][j]:=mat1[i][j];od;od; for i in [1..Length(mat2)] do for j in [1..Length(mat2)] do m[i+Length(mat1)][j+Length(mat1)]:=mat2[i][j];od;od; for i in [1..Length(mat2)] do for j in [1..Length(mat1)] do m[i+Length(mat1)][j]:=vec[Length(mat1)*(i-1)+j];od;od; return m;end; #constructs an extension of the 2 representations rep1,rep2 #rep1,rep2 are lists of matrices, each of length n #This function returns a 3rd list of matrices of length n #n is the number of generators #The length of cohomvec should be the number of generators *k, k an integer #cohomvec is decomposed into n vectors,each of length k constructExtension:=function(rep1,rep2,cohomvec,F) local n,k,cvPart,i,j,r; n:=Length(rep1); k:=Length(cohomvec)/n; cvPart:=[]; for i in [1..n] do cvPart[i]:=[]; for j in [1..k] do cvPart[i][j]:=cohomvec[(i-1)*k+j];od;od; r:=[]; for i in [1..n] do r[i]:=constructExtensionMat(rep1[i],rep2[i],cvPart[i],F);od; return r;end; List(Basis(c33),x->x in b33); #first element of basis is not in boundary constructExtension(sl25rep3,sl25rep3,Basis(c33)[1],GF(5));