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orCosetAction(GammaBarFP,index3aFP);
index3bFCA:=FactorCosetAction(GammaBarFP,index3bFP);

# Check the indexes of the subgroups

Index(GammaBarFP,index3aFP) = 3;
Index(GammaBarFP,index3bFP) = 3;

# Check normality

IsNormal(GammaBarFP,index3aFP);
not IsNormal(GammaBarFP,index3bFP);

# Free group versions of these subgroups
FPtoFGSubgp:=g->Group(List(GeneratorsOfGroup(g),UnderlyingElement));

index3aFG:=FPtoFGSubgp(index3aFP);
index3bFG:=FPtoFGSubgp(index3bFP);
	
#####
#
# Generators of $(a=1,p=5,\{2\})$
#
#####

#From: "Donald Cartwright" <donald.cartwright@gmail.com>
#To: steger@uniss.it
#Subject: (a=1,p=5) results [Re: ~steger/donald/SU21/C8p3/padic.gap]
#Date: Sun, 23 Dec 2007 19:58:42 +1100

ADM:=One(mm)*[
[1/18*(-2*Sqrt(-1)+3)*Zm^2+1/18*(5*Sqrt(-1)-6)*Zm+1/18*(7*Sqrt(-1)+3),
1/36*(Sqrt(-1)-15)*Zm^2+1/36*(11*Sqrt(-1)+45)*Zm+1/18*(-16*Sqrt(-1)+3),
-1/9*Sqrt(-1)*Zm^2+4/9*Sqrt(-1)*Zm+1/9*(-Sqrt(-1)+3)],
[5/18*Sqrt(-1)*Zm^2+1/18*(-20*Sqrt(-1)+15)*Zm+1/18*(5*Sqrt(-1)+15),
2/9*Sqrt(-1)*Zm^2-5/9*Sqrt(-1)*Zm+1/9*(2*Sqrt(-1)+3),
-2/9*Sqrt(-1)*Zm^2+1/18*(Sqrt(-1)+3)*Zm+1/9*Sqrt(-1)],
[1/36*(35*Sqrt(-1)+75)*Zm^2+1/36*(-65*Sqrt(-1)-255)*Zm+1/18*(-65*Sqrt(-1)+30),
5/18*Sqrt(-1)*Zm^2+1/18*(-20*Sqrt(-1)-15)*Zm+1/18*(5*Sqrt(-1)+45),
1/18*(-2*Sqrt(-1)-3)*Zm^2+1/18*(5*Sqrt(-1)+6)*Zm+1/18*(7*Sqrt(-1)+9)]];

BDM:=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Zm^2+1/18*(-20*Sqrt(-1)+15)*Zm+1/18*(5*Sqrt(-1)+15),
1/18*(-5*Sqrt(-1)+15)*Zm^2+1/18*(5*Sqrt(-1)-45)*Zm+5/9*Sqrt(-1),
1/9*(-2*Sqrt(-1)-3)*Zm^2+1/9*(8*Sqrt(-1)+3)*Zm-5/9*Sqrt(-1)]];

ADMVec:=DMtoDMVec(ADM);;
BDMVec:=DMtoDMVec(BDM);;
CDMVec:=DMtoDMVec(CDM);;

ADMVec in DMVec;
BDMVec in DMVec;
CDMVec in DMVec;

IsOne(iotaDM(ADM)*ADM);
IsOne(iotaDM(BDM)*BDM);
IsOne(iotaDM(CDM)*CDM);

# Check that the relations hold (projectively) for all our matrix
# generators

GammaBarDM:=Group(ADM,BDM,CDM);;
DMHom:=GroupHomomorphismByImages(FreeGp,GammaBarDM,
  [Af,Bf,Cf],[ADM,BDM,CDM]);;
ForAll(RelnList,x->IsPOne(x^DMHom));
	
##### Construct matrices for the group generators acting on~$\D$ by
#conjugation #####

DMtoPDM:=mtx->TransposedMat(
  List(basisDM,
    bmtx->Coefficients(basisDMVec,DMtoDMVec(mtx*bmtx*mtx^-1))
));

APDM:=DMtoPDM(ADM);;
BPDM:=DMtoPDM(BDM);;
CPDM:=DMtoPDM(CDM);;

IsZero(LieBracket(iotaPDM,APDM));
IsZero(LieBracket(iotaPDM,BPDM));
IsZero(LieBracket(iotaPDM,CPDM));

GammaBarPDM:=Group(APDM,BPDM,CPDM);;
FGtoPDM:=GroupHomomorphismByImages(FreeGp,GammaBarPDM,
  [Af,Bf,Cf],[APDM,BPDM,CPDM]);;
ForAll(RelnList,x->IsOne(x^FGtoPDM));

######
#
# Find the matrices for the group generators acting by conjugation on
# the self-adjoint, traceless part of~$\D$.
#
#####

PDMtoPSA:=mtx->TransposedMat(
  List(DMVecSelfAdjBasis,SAVec->
    Coefficients(DMVecSelfAdjBasis,mtx*SAVec)
));

APSA0:=PDMtoPSA(APDM);;
BPSA0:=PDMtoPSA(BPDM);;
CPSA0:=PDMtoPSA(CPDM);;

#####
#
# Adjust the basis of the self-adjoint part of~$\D$ so that
# the group generators correspond to integral matrices.
#
#####

GammaBarPSA0:=Group(APSA0,BPSA0,CPSA0);;

ILatPSA0:=InvariantLattice(GammaBarPSA0)^-1;
APSA:=APSA0^ILatPSA0;
BPSA:=BPSA0^ILatPSA0;
CPSA:=CPSA0^ILatPSA0;

GammaBarPSA:=Group(APSA,BPSA,CPSA);;
FGtoPSA:=GroupHomomorphismByImages(FreeGp,GammaBarPSA,
  [Af,Bf,Cf],[APSA,BPSA,CPSA]);;
ForAll(RelnList,x->IsOne(x^FGtoPSA));

######
#
# Do calculations $\mod 2$
#
######

toMod2:=x->x*One(GF(2));
toMod2M:=mtx->fOnM(toMod2,mtx);

APSAMod2:=toMod2M(APSA);;
BPSAMod2:=toMod2M(BPSA);;
CPSAMod2:=toMod2M(CPSA);;

GammaBarPSAMod2:=Group(APSAMod2,BPSAMod2,CPSAMod2);;
FGtoPSAMod2:=GroupHomomorphismByImages(FreeGp,GammaBarPSAMod2,
  [Af,Bf,Cf],[APSAMod2,BPSAMod2,CPSAMod2]);;
ForAll(RelnList,x->IsOne(x^FGtoPSAMod2));
	
Size(GammaBarPSAMod2) = 192;
ListMod2H1:=Filtered(NormalSubgroups(GammaBarPSAMod2),h->Size(h)=32);
Size(ListMod2H1) = 1;
Mod2H1:=ListMod2H1[1];
Mod2H1LAL:=LinearActionLayer(
  GammaBarPSAMod2,GeneratorsOfGroup(GammaBarPSAMod2),Pcgs(Mod2H1));
Mod2Q1:=Group(Mod2H1LAL);
Size(Mod2Q1)*Size(Mod2H1) = Size(GammaBarPSAMod2);
StructureDescription(Mod2H1) = "C2 x C2 x C2 x C2 x C2";
IdSmallGroup(Mod2Q1) = IdSmallGroup(SymmetricGroup(3));

MTXMod2H1:=GModuleByMats(Mod2H1LAL,GF(2));
List(MTX.BasesCompositionSeries(MTXMod2H1),Size) = [0,2,3,5];
List(MTX.BasesMinimalSubmodules(MTXMod2H1),Size) = [1,2,2,2];

index3aPSAMod2:=Image(FGtoPSAMod2,index3aFG);
index3bPSAMod2:=Image(FGtoPSAMod2,index3bFG);

index3aPSAMod2 = GammaBarPSAMod2;
Index(GammaBarPSAMod2,index3bPSAMod2) = 3;

FGtoMod2Q1:=GroupHomomorphismByImages(FreeGp,Mod2Q1,
  [Af,Bf,Cf],Mod2H1LAL);;

index3aMod2Q1:=Image(FGtoMod2Q1,index3aFG);
index3bMod2Q1:=Image(FGtoMod2Q1,index3bFG);

index3aMod2Q1 = Mod2Q1;
Index(Mod2Q1,index3bMod2Q1) = 3;

######
#
# Do calculations $\mod 4$
#
######

toMod4M:=mtx->fOnM(x->ZmodnZObj(x,4),mtx);

APSAMod4:=toMod4M(APSA);;
BPSAMod4:=toMod4M(BPSA);;
CPSAMod4:=toMod4M(CPSA);;

GammaBarPSAMod4:=Group(APSAMod4,BPSAMod4,CPSAMod4);;
FGtoPSAMod4:=GroupHomomorphismByImages(FreeGp,GammaBarPSAMod4,
  [Af,Bf,Cf],[APSAMod4,BPSAMod4,CPSAMod4]);;
ForAll(RelnList,x->IsOne(x^FGtoPSAMod4));
	
Size(GammaBarPSAMod4) = 192*2^8;

index3aPSAMod4:=Image(FGtoPSAMod4,index3aFG);
index3bPSAMod4:=Image(FGtoPSAMod4,index3bFG);

index3aPSAMod4 = GammaBarPSAMod4;
Index(GammaBarPSAMod4,index3bPSAMod4) = 3;

###### Do calculations $\mod 3$ #####

toMod3:=x->x*One(GF(3));
toMod3M:=mtx->fOnM(toMod3,mtx);

APSAMod3:=toMod3M(APSA);;
BPSAMod3:=toMod3M(BPSA);;
CPSAMod3:=toMod3M(CPSA);;

GammaBarPSAMod3:=Group(APSAMod3,BPSAMod3,CPSAMod3);;
FGtoPSAMod3:=GroupHomomorphismByImages(FreeGp,GammaBarPSAMod3,
  [Af,Bf,Cf],[APSAMod3,BPSAMod3,CPSAMod3]);;
ForAll(RelnList,x->IsOne(x^FGtoPSAMod3));
	
Size(GammaBarPSAMod3) = 6048;
IsomorphismGroups(PSU(3,3),GammaBarPSAMod3);

index3aPSAMod3:=Image(FGtoPSAMod3,index3aFG);
index3bPSAMod3:=Image(FGtoPSAMod3,index3bFG);

index3aPSAMod3 = GammaBarPSAMod3;
index3bPSAMod3 = GammaBarPSAMod3;

######
#
# Do calculations $\mod 5$
#
######

toMod5:=x->x*One(GF(5));
toMod5M:=mtx->fOnM(toMod5,mtx);

APSAMod5:=toMod5M(APSA);;
BPSAMod5:=toMod5M(BPSA);;
CPSAMod5:=toMod5M(CPSA);;

GammaBarPSAMod5:=Group(APSAMod5,BPSAMod5,CPSAMod5);;
FGtoPSAMod5:=GroupHomomorphismByImages(FreeGp,GammaBarPSAMod5,
  [Af,Bf,Cf],[APSAMod5,BPSAMod5,CPSAMod5]);;
ForAll(RelnList,x->IsOne(x^FGtoPSAMod5));

ChSGammaBarPSAMod5:=ChiefSeries(GammaBarPSAMod5);
List(ChSGammaBarPSAMod5,Size) = [3*31*5^6,31*5^6,5^6,5^3,1];
Mod5H1:=ChSGammaBarPSAMod5[3];
Mod5H0:=ChSGammaBarPSAMod5[4];
Mod5H0 = Center(Mod5H1);
StructureDescription(Mod5H0) = "C5 x C5 x C5";
StructureDescription(Mod5H1/Mod5H0) = "C5 x C5 x C5";
#
# whence follows
# StructureDescription(Mod5H1) = "(C5 x C5 x C5) . (C5 x C5 x C5)"
#
Mod5Q1Hom:=NaturalHomomorphismByNormalSubgroup(GammaBarPSAMod5,Mod5H1);;
Mod5Q1:=Image(Mod5Q1Hom);
StructureDescription(Mod5Q1) = "C31 : C3";

index3aPSAMod5:=Image(FGtoPSAMod5,index3aFG);
index3bPSAMod5:=Image(FGtoPSAMod5,index3bFG);

Index(GammaBarPSAMod5,index3aPSAMod5) = 3;
index3bPSAMod5 = GammaBarPSAMod5;

######
#
# Do calculations $\mod 7$
#
######

toMod7:=x->x*One(GF(7));
toMod7M:=mtx->fOnM(toMod7,mtx);

APSAMod7:=toMod7M(APSA);;
BPSAMod7:=toMod7M(BPSA);;
CPSAMod7:=toMod7M(CPSA);;

GammaBarPSAMod7:=Group(APSAMod7,BPSAMod7,CPSAMod7);;
FGtoPSAMod7:=GroupHomomorphismByImages(FreeGp,GammaBarPSAMod7,
  [Af,Bf,Cf],[APSAMod7,BPSAMod7,CPSAMod7]);;
ForAll(RelnList,x->IsOne(x^FGtoPSAMod7));
	
#IsomorphismGroups(PGU(3,7),GammaBarPSAMod7);
#Size(GammaBarPSAMod7) = 5663616;

index3aPSAMod7:=Image(FGtoPSAMod7,index3aFG);
index3bPSAMod7:=Image(FGtoPSAMod7,index3bFG);

index3aPSAMod7 = GammaBarPSAMod7;
index3bPSAMod7 = GammaBarPSAMod7;

######
#
# Do calculations $\mod 11$
#
######

toMod11:=x->x*One(GF(11));
toMod11M:=mtx->fOnM(toMod11,mtx);

APSAMod11:=toMod11M(APSA);;
BPSAMod11:=toMod11M(BPSA);;
CPSAMod11:=toMod11M(CPSA);;

GammaBarPSAMod11:=Group(APSAMod11,BPSAMod11,CPSAMod11);;
FGtoPSAMod11:=GroupHomomorphismByImages(FreeGp,GammaBarPSAMod11,
  [Af,Bf,Cf],[APSAMod11,BPSAMod11,CPSAMod11]);;
ForAll(RelnList,x->IsOne(x^FGtoPSAMod11));

#ChSGammaBarPSAMod11:=ChiefSeries(GammaBarPSAMod11);
#List(ChSGammaBarPSAMod11,Size) =
#  [(11^3+1)*(11^2-1)*11^3,(11^3+1)*(11^2-1)*11^3/3,1];
#Size(GammaBarPSAMod11) = 212747040;	
#
##### According to both theory and evidence:
##### StructureDescription(GammaBarPSAMod11) = "PGU(3,11)"

index3aPSAMod11:=Image(FGtoPSAMod11,index3aFG);
index3bPSAMod11:=Image(FGtoPSAMod11,index3bFG);

#Index(GammaBarPSAMod11,index3aPSAMod11) = 3;
#index3bPSAMod11 = GammaBarPSAMod11;

#####
#
# Consider abelianizations
#
#####

# (a=1,p=5,\{2\})
AbelianInvariants(GammaBarFP) = [3,4];
AbelianInvariants(GammaBarPSAMod2) = [4];
AbelianInvariants(GammaBarPSAMod4) = [4];
AbelianInvariants(GammaBarPSAMod3) = [];
AbelianInvariants(GammaBarPSAMod5) = [3];

# (a=1,p=5,\{2\},D_3)
AbelianInvariants(index3aFP) = [4,31];
AbelianInvariants(index3aPSAMod2) = [4];
AbelianInvariants(index3aPSAMod4) = [4];
AbelianInvariants(index3aPSAMod3) = [];
AbelianInvariants(index3aPSAMod5) = [31];

# (a=1,p=5,\{2I\})
#
AbelianInvariants(index3bFP) = [2,3,4,4];
AbelianInvariants(index3bPSAMod2) = [2,2,4];
AbelianInvariants(index3bPSAMod4) = [2,4,4];
AbelianInvariants(index3bPSAMod3) = [];
AbelianInvariants(index3bPSAMod5) = [3];
