File: quotientcomplex.gi

package info (click to toggle)
gap-hap 1.66%2Bds-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 55,348 kB
  • sloc: xml: 15,368; sh: 216; javascript: 155; makefile: 126; ansic: 57; perl: 36
file content (651 lines) | stat: -rw-r--r-- 18,530 bytes parent folder | download | duplicates (2)
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651

InstallGlobalFunction(QuotientByTorsionSubcomplex,
function(C,p)
local pTorsionSubcomplex, celldata, quotient, torsionCells,
      i, j, k, t, l, currentCell, BoundaryImage, dim0, ReIndexCell,
      lnth, dims,n, Elts, Boundary, StabilizerGroups, RotSubGroups, s,
      boundaryList, BI, SGN, LstEl, tmp, G, Stabilizer, Action, Dimension;

    pTorsionSubcomplex:=GetTorsionSubcomplex(C,p);
    celldata:=StructuralCopy(pTorsionSubcomplex!.originalData);
    torsionCells:=[];
    for i in [1..Length(celldata)] do
          torsionCells[i]:=List(pTorsionSubcomplex!.torsionPosition[i],a->a[2]);
          Sort(torsionCells[i],function(v,w) return v>w;end);
    od;
#    Print(torsionCells,"\n");
    quotient:=StructuralCopy(celldata);
    i:=Length(quotient);
    while i > 0 do
        if Length(quotient[i])=0 then
            Remove(quotient,i);
            i:=i-1;
        else break;
        fi;
    od;
#    Print(quotient,"\n");
    if not Length(torsionCells[1])=0 then

    ## ** Delete torsion vertices ** ##
          for i in torsionCells[1] do
#              Print(torsionCells[1],"\n");
              Remove(quotient[1],i);
#              Print(quotient[1],"\n");
          od;
    ## ** Add a new vertex which is the collapsing point ** ##
          Add(quotient[1],rec(TheMatrixStab :=C!.group,
                      TheRotSubgroup:=C!.group,
                      BoundaryImage :=rec(
                            ListIFace:=[],
                            ListSign:=[],
                            ListElt:=[])
                      )
          );
#          Print(quotient[1],"\n");
          dim0:=Length(quotient[1]);
    ## ** Search for those edges that having torsion vertex and replace
    ## ** them with the collapsing vertex
          for j in torsionCells[2] do
              Remove(quotient[2],j);
          od;
          for i in [1..Length(quotient[2])] do
                currentCell:=quotient[2][i];
                BoundaryImage:=currentCell.BoundaryImage;
                for j in [1..Length(BoundaryImage.ListIFace)] do
                    if BoundaryImage.ListIFace[j] in torsionCells[1] then
                        BoundaryImage.ListIFace[j]:=dim0;
                        BoundaryImage.ListElt[j]:=One(C!.group);
                    fi;
                od;
                currentCell.BoundaryImage:=BoundaryImage;
                quotient[2][i]:=currentCell;
          od;
          for i in [3..Length(quotient)] do
    ## ** Remove the torsion i-cells
              for j in torsionCells[i] do
                  Remove(quotient[i],j);
              od;
    ## ** Search the boundary of an i-cell for the torsion (i-1)-cells
    ## ** and delete them
              for j in [1..Length(quotient[i])] do
                  currentCell:=quotient[i][j];
                  BoundaryImage:=currentCell.BoundaryImage;
                  l:=Length(BoundaryImage.ListIFace);
                  for k in [1..l] do
                      t:=l+1-k;
                      if BoundaryImage.ListIFace[t] in torsionCells[i-1] then
                          Remove(BoundaryImage.ListIFace,t);
                          Remove(BoundaryImage.ListSign,t);
                          Remove(BoundaryImage.ListElt,t);
                      fi;
                  od;
                  currentCell.BoundaryImage:=BoundaryImage;
                  quotient[i][j]:=currentCell;
              od;
          od;
    fi;

    ## ** A subfunction which reindexes cells after deleting torsion cells
    ReIndexCell:=function(k,currentCell)
    local i,j, BoundaryImage, x;
        BoundaryImage:=currentCell.BoundaryImage;
        for j in [1..Length(BoundaryImage.ListIFace)] do
            for i in torsionCells[k] do
                if BoundaryImage.ListIFace[j]>i then
                    BoundaryImage.ListIFace[j]:=BoundaryImage.ListIFace[j]-1;
                fi;
            od;
        od;
        currentCell.BoundaryImage:=BoundaryImage;
        return currentCell;
    end;
    ##

    for i in [2..Length(quotient)] do
        for j in [1..Length(quotient[i])] do
            quotient[i][j]:=ReIndexCell(i-1,quotient[i][j]);
        od;
    od;

    ############Taken from dutour.gi implemented by Graham Ellis#########
    lnth:=Length(quotient)-1;

    dims:=List([1..lnth+1],n->Length(quotient[n]));

    ###################
    Dimension:=function(n);
    if n>lnth then return 0; fi;
    return dims[n+1];
    end;
    ###################

    Elts:=[Identity(quotient[1][1].TheMatrixStab)];
    StabilizerGroups:=[];
    RotSubGroups:=[];
    boundaryList:=[];


    #######
    for n in [1..lnth+1] do
    boundaryList[n]:=[];
    StabilizerGroups[n]:=[];
    RotSubGroups[n]:=[];
      for k in [1..Dimension(n-1)] do
      #if not name in InfGrps then
#      Append(Elts,Elements(quotient[n][k].TheMatrixStab));
      #fi;
      Add(StabilizerGroups[n],quotient[n][k].TheMatrixStab);
      Add(RotSubGroups[n],quotient[n][k].TheRotSubgroup);
      od;
    od;
    ####

    Elts:=SSortedList(Elts);

    #######
    for n in [1..lnth+1] do
    boundaryList[n]:=[];
    for k in [1..Dimension(n-1)] do
    tmp:=quotient[n][k].BoundaryImage;
    BI:=tmp.ListIFace;
    SGN:=tmp.ListSign;
    LstEl:=StructuralCopy(tmp.ListElt);
    Append(Elts,Difference(LstEl,Elts));
    for s in [1..Length(BI)] do
    BI[s]:=[SGN[s]*BI[s],Position(Elts,LstEl[s])];
    od;
    Add(boundaryList[n],BI);
    od;
    od;
    ####

    G:=C!.group;

    ####################
    Boundary:=function(n,k);
    if k>0 then
    return boundaryList[n+1][k];
    else
    return NegateWord(boundaryList[n+1][-k]);
    fi;
    end;
    ####################

    ####################
    Stabilizer:=function(n,k);
    return StabilizerGroups[n+1][k];
    end;
    ####################


    ####################
    Action:=function(n,k,g)
    return 1;
    end;


    ##################################################################
return Objectify(HapNonFreeResolution,
    rec(
    quotientCells:=quotient,
    stabilizer:=Stabilizer,
    elts:=Elts,
    group:=G,
    length:=lnth,
    boundary:=Boundary,
    homotopy:=fail,
    action:=Action,
    dimension:=Dimension,
    properties:=
    [["length",Maximum(1000,lnth)],
    ["characteristic",0],
    ["type","resolution"]]  ));
end);


################### end of ControlledSubdivision ############################




InstallGlobalFunction( "ExtractTorsionSubcomplex", function(C, p)
#####################################################################
## Here, p is the prime for which to take the torsion subcomplex.  ##
## We extract the cells the stabilizer of which contains p-torsion.##
#####################################################################
local vcd, stabilizerCardinalities, celldata, data, torsionPosition,
torsionCells, numberOfTorsionCells, n, j, returnedData, warned,
groupname, admissibilityCheck, x, i, b, tmpCell, cell, boundary, groupName,
lnth, dims, Elts, Boundary, StabilizerGroups, RotSubGroups, s,k,
boundaryList, BI, SGN, LstEl, tmp, G, Stabilizer, Action, Dimension;

    admissibilityCheck := function(celldata)
    #########################################################
    ## A cell complex is admissible in the sense of Brown, ##
    ## if each cell stabilizer fixes its cell pointwise.   ##
    ## Additionally,				       ##
    ## we gather the cardinalities of the stabilizers.     ##
    #########################################################
    local stabilizerCardinalities, G, card, n, j, R, vcd, warned;
       warned := false;
       stabilizerCardinalities := [];
       vcd := Length(celldata)-1;

       for n in [0..vcd] do
	    stabilizerCardinalities[n+1] := [];
	    for j in [1..Length(celldata[n+1])] do
	       G :=   celldata[n+1][j]!.TheMatrixStab;
	       if IsFinite(G) then
	          card := Order(G);
	          stabilizerCardinalities[n+1][j] := card;
	          ## *** Now we have to compare              *** ##
	          ## *** with the order of "TheRotSubgroup"  *** ##
	          R := celldata[n+1][j]!.TheRotSubgroup;
	          if card > Order(R) and warned = false then
		    Print("****Warning: cell complex not admissible ",
			    "in the sense of Brown!****\n",
		    " Torsion subcomplex reduction requires cell subdivision.\n");
		    warned := true;
	          fi;
	       fi;
	    od;
       od;
       return [stabilizerCardinalities, warned];
   end;

   # Case 1: the input is a group name
   if IsString(C) then
   groupName:=C;
   groupname := Filtered( C, function ( x )
            return not (x = '(' or x = ')' or x = ',' or x = '[' or x = ']');
   end );
   Read(Concatenation( 	DirectoriesPackageLibrary("HAP")[1]![1],
			"Perturbations/Gcomplexes/",groupname));
   celldata := StructuralCopy(HAP_GCOMPLEX_LIST);

   # Case 2: the input is a variable
   else
       groupName:=fail;
       celldata:=[];
       i:=0;
       while C!.dimension(i) > 0 do
           cell:=[];
           for j in [1..C!.dimension(i)] do
               if not i=0 then
               boundary:=C!.boundary(i,j);
               Add(cell,rec(TheMatrixStab :=C!.stabilizer(i,j),
                           TheRotSubgroup:=C!.stabilizer(i,j),
                           BoundaryImage :=rec(
                                 ListIFace:=List(boundary,w->AbsInt(w[1])),
                                 ListSign:=List(boundary,w->SignInt(w[1])),
                                 ListElt:=List(boundary,w->C!.elts[w[2]])
                           )
                       )
               );
               else
               Add(cell,rec(TheMatrixStab :=C!.stabilizer(i,j),
                           TheRotSubgroup:=C!.stabilizer(i,j),
                           BoundaryImage :=rec(
                                 ListIFace:=[],
                                 ListSign:=[],
                                 ListElt:=[]
                           )
                       )
               );
               fi;
           od;
           Add(celldata,cell);
           i:=i+1;
       od;
   fi;
   vcd := Length(celldata) -1;
#   Print("Extracting the ",p,"-torsion subcomplex of the ",
#		vcd,"-dimensional ",groupName,"-cell complex ... \n");
   returnedData := admissibilityCheck(celldata);
   stabilizerCardinalities := returnedData[1];
   warned := returnedData[2];
   torsionCells := [];
   numberOfTorsionCells := [];
   for n in [0..vcd] do
	torsionCells[n+1] := [];
	numberOfTorsionCells[n+1] := 0;
	for j in [1..Length(celldata[n+1])] do
	   ## Check if the stabilizer contains p-torsion ##
	   if stabilizerCardinalities[n+1][j] mod p = 0 then
#		Print("Extracted ",n,"-cell numero ",j,
#			" of stabilizer cardinality ",
#			stabilizerCardinalities[n+1][j],".\n");
		numberOfTorsionCells[n+1]
			:= numberOfTorsionCells[n+1]+1;
	        torsionCells[n+1][numberOfTorsionCells[n+1]]
			:=[n, j];
	   fi;
	od;
   od;
#   return
#     [torsionCells, numberOfTorsionCells, celldata, stabilizerCardinalities, warned];
  data:=[];
  for i in [1..Length(torsionCells)] do
      data[i]:=[];
      for x in torsionCells[i] do
          Add(data[i],celldata[i][x[2]]);
      od;
  od;
for j in [2..Size(data)] do
  for i in [1..Size(data[j])] do
      tmpCell:=StructuralCopy(data[j][i]!.BoundaryImage);
      b:=List(tmpCell!.ListIFace,w->Position(torsionCells[j-1], [j-2,w]));
      tmpCell!.ListIFace:=b;
      data[j][i]!.BoundaryImage:=tmpCell;
  od;
od;
  torsionPosition:=torsionCells;
  torsionCells:=[];
  for i in [1..Size(data)] do
     torsionCells[i]:=[];
     for j in [1..Size(data[i])] do
         torsionCells[i][j]:=[i-1,j];
     od;
  od;
  ############################
  ############Taken from dutour.gi implemented by Graham Ellis#########
  lnth:=Length(data)-1;

  dims:=List([1..lnth+1],n->Length(data[n]));

  ###################
  Dimension:=function(n);
  if n>lnth then return 0; fi;
  return dims[n+1];
  end;
  ###################

  Elts:=[Identity(data[1][1].TheMatrixStab)];
  StabilizerGroups:=[];
  RotSubGroups:=[];
  boundaryList:=[];


  #######
  for n in [1..lnth+1] do
  boundaryList[n]:=[];
  StabilizerGroups[n]:=[];
  RotSubGroups[n]:=[];
    for k in [1..Dimension(n-1)] do
    #if not name in InfGrps then
    Append(Elts,Elements(data[n][k].TheMatrixStab));
    #fi;
    Add(StabilizerGroups[n],data[n][k].TheMatrixStab);
    Add(RotSubGroups[n],data[n][k].TheRotSubgroup);
    od;
  od;
  ####

  Elts:=SSortedList(Elts);

  #######
  for n in [1..lnth+1] do
  boundaryList[n]:=[];
  for k in [1..Dimension(n-1)] do
  tmp:=data[n][k].BoundaryImage;
  BI:=tmp.ListIFace;
  SGN:=tmp.ListSign;
  LstEl:=StructuralCopy(tmp.ListElt);
  Append(Elts,Difference(LstEl,Elts));
  for s in [1..Length(BI)] do
  BI[s]:=[SGN[s]*BI[s],Position(Elts,LstEl[s])];
  od;
  Add(boundaryList[n],BI);
  od;
  od;
  ####

  G:=C!.group;

  ####################
  Boundary:=function(n,k);
  if k>0 then
  return boundaryList[n+1][k];
  else
  return NegateWord(boundaryList[n+1][-k]);
  fi;
  end;
  ####################

  ####################
  Stabilizer:=function(n,k);
  return StabilizerGroups[n+1][k];
  end;
  ####################


  ####################
  Action:=function(n,k,g)
  return 1;
  end;



  #############################
  return Objectify(HapNonFreeResolution,
            rec(
            stabilizer:=Stabilizer,
            elts:=Elts,
            group:=G,
            length:=lnth,
            boundary:=Boundary,
            homotopy:=fail,
            action:=Action,
            dimension:=Dimension,
            torsion:=p,
            groupname:=groupName,
            torsionCells:=torsionCells,
            torsionPosition:=torsionPosition,
            originalData:=celldata,
            celldata:= data,
            numberOfTorsionCells:= numberOfTorsionCells,
            stabilizerCardinalities:= stabilizerCardinalities,
            warned:= warned,
            properties:=
            [["length",Maximum(1000,lnth)],
            ["characteristic",0],
            ["type","resolution"]]  ));

end);

###########################################################################
DeclareGlobalFunction("PrintTorsionSubcomplex");
InstallGlobalFunction("PrintTorsionSubcomplex",
function(R)
local N, reducedTorsionCells,J,n,j,G,B,b, ReduceModP, p, celldata, Stab,freq,
      t, StabList, StabListStr;

reducedTorsionCells:=R!.torsionCells;
celldata:=R!.celldata;
p:=R!.torsion;
#########
ReduceModP := function( G, p)
local K, h, H, Q, P;

	Q := G;
	K := ConjugacyClassesSubgroups(G);
	for h in K do
          if Size(h)=1 then
	       H := Representative(h);
	           if Size(H) > 1 then
	     	       if Gcd(Size(H),p) = 1 then
            	       # We pass to the quotient Q in the extension
		       # 1 -> H -> G -> Q -> 1,
		       # because H has trivial mod p cohomology.
		       # Our loop ends up using the normal subgroup H of maximal size,
		       # because the list K is ordered from small to large.
		           Q := Image( NaturalHomomorphismByNormalSubgroup( G,H ));
	              fi;
	           fi;
	    fi;
	od;
       P:=Q;
       if IsPNormal(Q,p) then P:=Normalizer(Q,Center(SylowSubgroup(Q,p)));fi;
  return P;
end;
#########

freq:=[];
StabList:=[];
for N in [1..Size(reducedTorsionCells)] do
  freq[N]:=[];
  for J in reducedTorsionCells[N] do
	n := J[1];
	j := J[2];
	G := celldata[n+1][j]!.TheMatrixStab;;

	Stab:=IdSmallGroup(ReduceModP(G,p));
  t:=Position(StabList,Stab);
  if t=fail then
      Add(StabList,Stab);
      freq[N][Length(StabList)]:=1;
  else
      if IsBound(freq[N][t]) then
          freq[N][t]:=freq[N][t]+1;
      else
          freq[N][t]:=1;
      fi;
  fi;
  od;

od;
StabListStr:=StructuralCopy(StabList);
for J in [1..Length(StabList)] do
    StabList[J]:=StructureDescription(SmallGroup(StabList[J]));
od;
for N in [1..Size(reducedTorsionCells)] do
    for J in [1..Length(StabList)] do
        if not IsBound(freq[N][J]) then
            freq[N][J]:=0;
        fi;
    od;

od;



return [StabListStr,StabList,freq];
end);



#################################
DeclareGlobalFunction("ConvertTorsionComplexToGcomplex");
InstallGlobalFunction("ConvertTorsionComplexToGcomplex",
function(C)
local data, Elts,n,lnth,dims,Dimension, StabilizerGroups,
      RotSubGroups,boundaryList,k, tmp, BI, SGN, LstEl,
      s, G, Boundary, Stabilizer, Action;

data:=StructuralCopy(C!.celldata);

lnth:=Length(data)-1;

dims:=List([1..lnth+1],n->Length(data[n]));

###################
Dimension:=function(n);
if n>lnth then return 0; fi;
return dims[n+1];
end;
###################

Elts:=[Identity(data[1][1].TheMatrixStab)];
StabilizerGroups:=[];
RotSubGroups:=[];
boundaryList:=[];


#######
for n in [1..lnth+1] do
boundaryList[n]:=[];
StabilizerGroups[n]:=[];
RotSubGroups[n]:=[];
  for k in [1..Dimension(n-1)] do
  #if not name in InfGrps then
  Append(Elts,Elements(data[n][k].TheMatrixStab));
  #fi;
  Add(StabilizerGroups[n],data[n][k].TheMatrixStab);
  Add(RotSubGroups[n],data[n][k].TheRotSubgroup);
  od;
od;
####

Elts:=SSortedList(Elts);

#######
for n in [1..lnth+1] do
boundaryList[n]:=[];
for k in [1..Dimension(n-1)] do
tmp:=data[n][k].BoundaryImage;
# Print(tmp,"\n");
BI:=tmp.ListIFace;
SGN:=tmp.ListSign;
LstEl:=StructuralCopy(tmp.ListElt);
Append(Elts,Difference(LstEl,Elts));
for s in [1..Length(BI)] do
BI[s]:=[SGN[s]*BI[s],Position(Elts,LstEl[s])];
od;
Add(boundaryList[n],BI);
od;
od;
####

G:=Group(Elts);

####################
Boundary:=function(n,k);
if k>0 then
return boundaryList[n+1][k];
else
return NegateWord(boundaryList[n+1][-k]);
fi;
end;
####################

####################
Stabilizer:=function(n,k);
return StabilizerGroups[n+1][k];
end;
####################


####################
Action:=function(n,k,g)
return 1;
end;



#############################
return Objectify(HapNonFreeResolution,
          rec(
          stabilizer:=Stabilizer,
          elts:=Elts,
          group:=G,
          length:=lnth,
          boundary:=Boundary,
          homotopy:=fail,
          action:=Action,
          dimension:=Dimension,
          torsion:=C!.torsion,
          groupname:=C!.groupname,
          torsionCells:=C!.torsionCells,
#          torsionPosition:=torsionPosition,
#          originalData:=celldata,
          celldata:= data,
#          numberOfTorsionCells:= numberOfTorsionCells,
#          stabilizerCardinalities:= stabilizerCardinalities,
#          warned:= warned,
          properties:=
          [["length",Maximum(1000,lnth)],
          ["characteristic",0],
          ["type","resolution"]]  ));


end);