File: grpcompl.gi

package info (click to toggle)
gap 4r4p10-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 29,224 kB
  • ctags: 7,084
  • sloc: ansic: 98,591; sh: 3,284; perl: 2,263; makefile: 467; awk: 6
file content (179 lines) | stat: -rw-r--r-- 5,436 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#############################################################################
##
#W  grpcompl.gi                  GAP Library                 Alexander Hulpke
##
#H  @(#)$Id: grpcompl.gi,v 4.13.4.3 2006/08/16 09:13:10 gap Exp $
##
#Y  Copyright (C)  1997
#Y  (C) 1998 School Math and Comp. Sci., University of St.  Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
##  This file contains the operations for the computation of complements in
##  'white box groups'
##
Revision.grpcompl_gi :=
    "@(#)$Id: grpcompl.gi,v 4.13.4.3 2006/08/16 09:13:10 gap Exp $";

ComplementclassesSolvableWBG:=function(G,N)
local s, h, q, fpi, factorpres, com, comgens, cen, ocrels, fpcgs, ncom,
      ncomgens, ncen, nlcom, nlcomgens, nlcen, ocr, generators, 
      modulePcgs, l, v, dimran, opfun, k, afu, i, j, jj;

  # compute a series through N
  s:=ChiefSeriesUnderAction(G,N);

  Info(InfoComplement,1,"Series of factors:",
       List([1..Length(s)-1],i->Size(s[i])/Size(s[i+1])));

  # transfer probably to better group (later, AgCase)

  # construct a presentation
  h:=NaturalHomomorphismByNormalSubgroup(G,N);

  # AH still: Try to find a more simple presentation if available.

  if Source(h)=G then
    q:=ImagesSource(h);
  else
    q:=Image(h,G);
  fi;
  fpi:=IsomorphismFpGroup(q);
  Info(InfoComplement,2,"using a presentation with ",
       Length(MappingGeneratorsImages(fpi)[2])," generators");
  factorpres:=[FreeGeneratorsOfFpGroup(Range(fpi)),
               RelatorsOfFpGroup(Range(fpi)),
	       List(MappingGeneratorsImages(fpi)[2],
	            i->PreImagesRepresentative(fpi,i))];

  Assert(1,ForAll(factorpres[3],i->Image(h,PreImagesRepresentative(h,i))=i));
  # initialize
  com:=[G];
  comgens:=[List(factorpres[3],i->PreImagesRepresentative(h,i))];
  cen:=[s[1]];
  ocrels:=false;

  # step down
  for i in [2..Length(s)] do
    Info(InfoComplement,1,"Step ",i-1);
    # we know the complements after s[i-1], we want them after s[i].
    #fpcgs:=Pcgs(s[i-1]); # the factor pcgs
    #fpcgs:=fpcgs mod InducedPcgsByGenerators(fpcgs,GeneratorsOfGroup(s[i]));
    fpcgs:=ModuloPcgs(s[i-1],s[i]);

    ncom:=[];
    ncomgens:=[];
    ncen:=[];
    # loop over all complements so far
    for j in [1..Length(com)] do
      nlcom:=[];
      nlcomgens:=[];
      nlcen:=[];
      # compute complements
      ocr:=rec(group:=ClosureGroup(com[j],s[i-1]),
               generators:=comgens[j],
	       modulePcgs:=fpcgs,
	       factorpres:=factorpres
	       );
      if ocrels<>false then
        ocr.relators:=ocrels;
	Assert(2,ForAll(ocr.relators,
	                k->Product(List([1..Length(k.generators)],
			      l->ocr.generators[k.generators[l]]^k.powers[l]))
			      in s[i-1]));
      fi;

      OCOneCocycles(ocr,true);
      ocrels:=ocr.relators;

      if IsBound(ocr.complement) then
	# special treatment for trivial case:
	if Dimension(ocr.oneCocycles)=Dimension(ocr.oneCoboundaries) then
	  l:=[ExternalSet(cen[j],[Zero(ocr.oneCocycles)])];
	  SetStabilizerOfExternalSet(l[1],cen[j]);
        else
	  l:=BaseSteinitzVectors(BasisVectors(Basis(ocr.oneCocycles)),
				 BasisVectors(Basis(ocr.oneCoboundaries)));

	  v:=Enumerator(VectorSpace(LeftActingDomain(ocr.oneCocycles),
				    l.factorspace,Zero(ocr.oneCocycles)));

	  dimran:=[1..Length(v[1])];

	  # fuse
	  Info(InfoComplement,2,"fuse ",Length(v)," classes; working in dim ",
	   Dimension(ocr.oneCocycles),"/",Dimension(ocr.oneCoboundaries));

	  opfun:=function(z,g)
	    Assert(3,z in AsList(v));
	    z:=ocr.cocycleToList(z);
	    for k in [1..Length(z)] do
	      z[k]:=Inverse(ocr.complementGens[k])*(ocr.complementGens[k]*z[k])^g;
	    od;
	    Assert(2,ForAll(z,k->k in s[i-1]));
	    z:=ocr.listToCocycle(z);
	    Assert(2,z in ocr.oneCocycles);
	    # sift z
	    for k in dimran do
	      if IsBound(l.heads[k]) and l.heads[k]<0 then
		z:=z-z[k]*l.subspace[-l.heads[k]];
	      fi;
	    od;
	    Assert(1,z in AsList(v));
	    return z;
	  end;

	  l:=ExternalOrbitsStabilizers(cen[j],v,opfun);
	fi;

	Info(InfoComplement,2,"splits in ",Length(l)," complements");
      else
        l:=[];
	Info(InfoComplement,2,"no complements");
      fi;

      for k in l do
	q:=StabilizerOfExternalSet(k);
	k:=ocr.cocycleToComplement(Representative(k));
	Assert(3,Length(GeneratorsOfGroup(k))
	          =Length(MappingGeneratorsImages(fpi)[2]));
	# correct stabilizer to obtain centralizer

	v:=Normalizer(q,ClosureGroup(s[i],k));
	afu:=function(x,g) return CanonicalRightCosetElement(s[i],x^g);end;
	for jj in GeneratorsOfGroup(k) do
	  if ForAny(GeneratorsOfGroup(v),x->not Comm(x,jj) in s[i]) then
	    # we are likely very close as we centralized in the higher level
	    # and stabilize the cohomology. Thus a plain stabilizer
	    # calculation ought to work.
	    v:=Stabilizer(v,CanonicalRightCosetElement(s[i],jj),afu);
	  fi;
	od;


	Add(ncen,v);
        Add(nlcom,k);
	Add(nlcomgens,GeneratorsOfGroup(k));
      od;

      ncom:=Concatenation(ncom,nlcom);
      ncomgens:=Concatenation(ncomgens,nlcomgens);
      ncen:=Concatenation(ncen,nlcen);
    od;
    com:=ncom;
    comgens:=ncomgens;
    cen:=ncen;
    Info(InfoComplement,1,Length(com)," complements in total");
  od;

  return com;

end;

InstallMethod(ComplementclassesSolvableNC,"using cohomology",IsIdenticalObj,
  [IsGroup,IsGroup],1,
  ComplementclassesSolvableWBG);

#############################################################################
##
#E  grpcompl.gi
##