File: groups.msk

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 (1434 lines) | stat: -rw-r--r-- 41,697 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
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%A  groups.msk                  GAP documentation            Alexander Hulpke
%%
%A  @(#)$Id: groups.msk,v 1.99.2.15 2007/09/14 08:18:31 gapchron Exp $
%%
%Y  (C) 1998 School Math and Comp. Sci., University of St  Andrews, Scotland
%Y  Copyright (C) 2002 The GAP Group
%%
\Chapter{Groups}

This chapter explains how to create groups and defines operations for
groups, that is operations whose definition does not depend on the
representation used.
However methods for these operations in most cases will make use of the
representation.

If not otherwise specified, in all examples in this chapter the group `g'
will be the symmetric group $S_4$ acting on the letters $\{1,\ldots,4\}$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Group Elements}

Groups in {\GAP} are written multiplicatively.
The elements from which a group can be generated must permit
multiplication and multiplicative inversion
(see~"Useful Categories of Elements").

\beginexample
gap> a:=(1,2,3);;b:=(2,3,4);;
gap> One(a);
()
gap> Inverse(b);
(2,4,3)
gap> a*b;
(1,3)(2,4)
gap> Order(a*b);
2
gap> Order( [ [ 1, 1 ], [ 0, 1 ] ] );
infinity
\endexample

The next example may run into an infinite loop
because the given matrix in fact has infinite order.

%notest
\beginexample
gap> Order( [ [ 1, 1 ], [ 0, 1 ] ] * Indeterminate( Rationals ) );
#I  Order: warning, order of <mat> might be infinite
\endexample

\index{order! of a group}
Since groups are domains, the recommended command to compute the order
of a group is `Size' (see~"Size").
For convenience, group orders can also be computed with `Order'.

The operation `Comm' (see~"Comm") can be used to compute the commutator of
two elements, the operation `LeftQuotient' (see~"LeftQuotient") computes the
product $x^{-1}y$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Creating Groups}

When groups are created from generators,
this means that the generators must be elements that can be multiplied
and inverted (see also~"Constructing Domains").
For creating a free group on a set of symbols, see~"FreeGroup".

\Declaration{Group}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));
Group([ (1,2,3,4), (1,2) ])
\endexample

\Declaration{GroupWithGenerators}
\Declaration{GeneratorsOfGroup}
\beginexample
gap> g:=GroupWithGenerators([(1,2,3,4),(1,2)]);
Group([ (1,2,3,4), (1,2) ])
gap> GeneratorsOfGroup(g);
[ (1,2,3,4), (1,2) ]
\endexample
While in this example {\GAP} displays the group via the generating set
stored in the attribute `GeneratorsOfGroup', the methods installed for
`View' (see~"View") will in general display only some information about the
group which may even be just the fact that it is a group.

\Declaration{AsGroup}
\beginexample
gap> AsGroup([(1,2)]);
fail
gap> AsGroup([(),(1,2)]);
Group([ (1,2) ])
\endexample

\Declaration{ConjugateGroup}
\beginexample
gap> ConjugateGroup(g,(1,5));
Group([ (2,3,4,5), (2,5) ])
\endexample

\Declaration{IsGroup}
\beginexample
gap> IsGroup(g);
true
\endexample

\Declaration{InfoGroup}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Subgroups}

For the general concept of parents and subdomains,
see~"Parents" and~"Constructing Subdomains".
More functions that construct certain subgroups can be found
in the sections~"Normal Structure", "Specific and Parametrized Subgroups",
"Sylow Subgroups and Hall Subgroups",
and~"Subgroups characterized by prime powers".

\Declaration{Subgroup}
\beginexample
gap> u:=Subgroup(g,[(1,2,3),(1,2)]);
Group([ (1,2,3), (1,2) ])
\endexample

\Declaration{Index}
\beginexample
gap> Index(g,u);
4
\endexample


\Declaration{IndexInWholeGroup}

\Declaration{AsSubgroup}
\beginexample
gap> v:=AsSubgroup(g,Group((1,2,3),(1,4)));
Group([ (1,2,3), (1,4) ])
gap> Parent(v);
Group([ (1,2,3,4), (1,2) ])
\endexample

\Declaration{IsSubgroup}
\beginexample
gap> IsSubgroup(g,u);
true
gap> v:=Group((1,2,3),(1,2));
Group([ (1,2,3), (1,2) ])
gap> u=v;
true
gap> IsSubgroup(g,v);
true
\endexample

\Declaration{IsNormal}
\beginexample
gap> IsNormal(g,u);
false
\endexample

\Declaration{IsCharacteristicSubgroup}
\beginexample
gap> IsCharacteristicSubgroup(g,u);
false
\endexample

\Declaration{ConjugateSubgroup}
\Declaration{ConjugateSubgroups}

\Declaration{IsSubnormal}
\beginexample
gap> IsSubnormal(g,Group((1,2,3)));
false
gap> IsSubnormal(g,Group((1,2)(3,4)));
true
\endexample

\FileHeader{grp}[2]

\Declaration{SubgroupByProperty}
\Declaration{SubgroupShell}
\beginexample
gap> u:=SubgroupByProperty(g,i->3^i=3);
<subgrp of Group([ (1,2,3,4), (1,2) ]) by property>
gap> (1,3) in u; (1,4) in u; (1,5) in u;
false
true
false
gap> GeneratorsOfGroup(u);
[ (1,2), (1,4,2) ]
gap> u:=SubgroupShell(g);
<group>
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Closures of (Sub)groups}

\Declaration{ClosureGroup}
\beginexample
gap> g:=SmallGroup(24,12);;u:=Subgroup(g,[g.3,g.4]);
Group([ f3, f4 ])
gap> ClosureGroup(u,g.2);
Group([ f2, f3, f4 ])
gap> ClosureGroup(u,[g.1,g.2]);
Group([ f1, f2, f3, f4 ])
gap> ClosureGroup(u,Group(g.2*g.1));
Group([ f1*f2^2, f3, f4 ])
\endexample

\Declaration{ClosureGroupAddElm}

\Declaration{ClosureGroupDefault}

\Declaration{ClosureSubgroup}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Expressing Group Elements as Words in Generators}

\index{factorization}
\index{words!in generators}

Using homomorphisms (see chapter~"Group Homomorphisms") is is possible to
express group elements as words in given generators: Create a free group
(see~"FreeGroup") on the correct number of generators and create a
homomorphism from this free group onto the group <G> in whose generators you
want to factorize. Then the preimage of an element of <G> is a word in the
free generators, that will map on this element again.

\Declaration{EpimorphismFromFreeGroup}

The following example shows how to decompose elements of $S_4$ in the
generators `(1,2,3,4)' and `(1,2)':

\beginexample
gap> g:=Group((1,2,3,4),(1,2));
Group([ (1,2,3,4), (1,2) ])
gap> hom:=EpimorphismFromFreeGroup(g:names:=["x","y"]);
[ x, y ] -> [ (1,2,3,4), (1,2) ]
gap> PreImagesRepresentative(hom,(1,4));
y^-1*x^-2*y^-1*x^-1*y^-1*x
\endexample

The following example stems from a real request to the {\GAP} Forum. In
September 2000 a {\GAP} user working with puzzles wanted to express the
permutation `(1,2)' as a word as short as possible in particular generators
of the symmetric group $S_{16}$.

\beginexample
gap> perms := [ (1,2,3,7,11,10,9,5), (2,3,4,8,12,11,10,6),
>   (5,6,7,11,15,14,13,9), (6,7,8,12,16,15,14,10) ];;
gap> puzzle := Group( perms );;Size( puzzle );
20922789888000
gap> hom:=EpimorphismFromFreeGroup(puzzle:names:=["a", "b", "c", "d"]);;
gap> word := PreImagesRepresentative( hom, (1,2) );
a^-1*c*b*c^-1*a*b^-1*a^-2*c^-1*a*b^-1*c*b
gap> Length( word );
13
\endexample

% randomization effect is now gone.

\Declaration{Factorization}

\beginexample
gap> G:=SymmetricGroup( 6 );;
gap> r:=(3,4);; s:=(1,2,3,4,5,6);;
gap> # create a subgroup to force the system to use the generators r and s.
gap> H:= Subgroup(G, [ r, s ] );
Group([ (3,4), (1,2,3,4,5,6) ])
gap> Factorization( H, (1,2,3) );
x2*x1*x2*x1*x2^-2
gap> s*r*s*r*s^-2;
(1,2,3)
gap> MappingGeneratorsImages(EpimorphismFromFreeGroup(H));
[ [ x1, x2 ], [ (3,4), (1,2,3,4,5,6) ] ]
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Structure Descriptions}

\Declaration{StructureDescription}

\beginexample
gap> l := AllSmallGroups(12);;
gap> List(l,StructureDescription);; l;
[ C3 : C4, C12, A4, D12, C6 x C2 ]
gap> List(AllSmallGroups(40),G->StructureDescription(G:short));
[ "5:8", "40", "5:8", "5:Q8", "4xD10", "D40", "2x(5:4)", "(10x2):2", "20x2",
  "5xD8", "5xQ8", "2x(5:4)", "2^2xD10", "10x2^2" ]
gap> List(AllTransitiveGroups(DegreeAction,6),G->StructureDescription(G:short));
[ "6", "S3", "D12", "A4", "3xS3", "2xA4", "S4", "S4", "S3xS3", "(3^2):4",
  "2xS4", "A5", "(S3xS3):2", "S5", "A6", "S6" ]
gap> StructureDescription(PSL(4,2));
"A8"
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Cosets}

\index{right cosets}

\index{coset}
\Declaration{RightCoset}
\beginexample
gap> u:=Group((1,2,3), (1,2));;
gap> c:=RightCoset(u,(2,3,4));
RightCoset(Group( [ (1,2,3), (1,2) ] ),(2,3,4))
gap> ActingDomain(c);
Group([ (1,2,3), (1,2) ])
gap> Representative(c);
(2,3,4)
gap> Size(c);
6
gap> AsList(c);
[ (2,3,4), (1,4,2), (1,3)(2,4), (2,4), (1,4,2,3), (1,3,4,2) ]
\endexample

\Declaration{RightCosets}
\beginexample
gap> RightCosets(g,u);
[ RightCoset(Group( [ (1,2,3), (1,2) ] ),()), 
  RightCoset(Group( [ (1,2,3), (1,2) ] ),(1,3)(2,4)), 
  RightCoset(Group( [ (1,2,3), (1,2) ] ),(1,4)(2,3)), 
  RightCoset(Group( [ (1,2,3), (1,2) ] ),(1,2)(3,4)) ]
\endexample

\Declaration{CanonicalRightCosetElement}
\beginexample
gap> CanonicalRightCosetElement(u,(2,4,3));
(3,4)
\endexample

\Declaration{IsRightCoset}

\index{left cosets}
{\GAP} does not provide left cosets as a separate data type, but as the left
coset $gU$ consists of exactly the inverses of the elements of the right
coset $Ug^{-1}$ calculations with left cosets can be emulated using right
cosets by inverting the representatives.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Transversals}

\Declaration{RightTransversal}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));;
gap> u:=Subgroup(g,[(1,2,3),(1,2)]);;
gap> rt:=RightTransversal(g,u);
RightTransversal(Group([ (1,2,3,4), (1,2) ]),Group([ (1,2,3), (1,2) ]))
gap> Length(rt);
4
gap> Position(rt,(1,2,3));
fail
\endexample

Note that the elements of a right transversal are not necessarily
``canonical'' in the sense of `CanonicalRightCosetElement'
(see~"CanonicalRightCosetElement"), but we may compute a list of
canonical coset representatives by calling that function.

\beginexample
gap> List(RightTransversal(g,u),i->CanonicalRightCosetElement(u,i));
[ (), (2,3,4), (1,2,3,4), (3,4) ]
\endexample

The operation `PositionCanonical' is described in
section~"PositionCanonical".

\beginexample
gap> PositionCanonical(rt,(1,2,3));
1
gap> rt[1];
()
\endexample


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Double Cosets}

\Declaration{DoubleCoset}
\Declaration{RepresentativesContainedRightCosets}
\beginexample
gap> u:=Subgroup(g,[(1,2,3),(1,2)]);;v:=Subgroup(g,[(3,4)]);;
gap> c:=DoubleCoset(u,(2,4),v);
DoubleCoset(Group( [ (1,2,3), (1,2) ] ),(2,4),Group( [ (3,4) ] ))
gap> (1,2,3) in c;
false
gap> (2,3,4) in c;
true
gap> LeftActingGroup(c);
Group([ (1,2,3), (1,2) ])
gap> RightActingGroup(c);
Group([ (3,4) ])
gap> RepresentativesContainedRightCosets(c);
[ (2,3,4) ]
\endexample

\Declaration{DoubleCosets}!{operation}
\beginexample
gap> dc:=DoubleCosets(g,u,v);
[ DoubleCoset(Group( [ (1,2,3), (1,2) ] ),(),Group( [ (3,4) ] )), 
  DoubleCoset(Group( [ (1,2,3), (1,2) ] ),(1,3)(2,4),Group( [ (3,4) ] )), 
  DoubleCoset(Group( [ (1,2,3), (1,2) ] ),(1,4)(2,3),Group( [ (3,4) ] )) ]
gap> List(dc,Representative);
[ (), (1,3)(2,4), (1,4)(2,3) ]
\endexample

\Declaration{IsDoubleCoset}
\Declaration{DoubleCosetRepsAndSizes}
\beginexample
gap> dc:=DoubleCosetRepsAndSizes(g,u,v);
[ [ (), 12 ], [ (1,3)(2,4), 6 ], [ (1,4)(2,3), 6 ] ]
\endexample

\Declaration{InfoCoset}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Conjugacy Classes}

\Declaration{ConjugacyClass}
\Declaration{ConjugacyClasses}[grp]!{attribute}
\beginexample
gap> g:=SymmetricGroup(4);;
gap> cl:=ConjugacyClasses(g);
[ ()^G, (1,2)^G, (1,2)(3,4)^G, (1,2,3)^G, (1,2,3,4)^G ]
gap> Representative(cl[3]);Centralizer(cl[3]);
(1,2)(3,4)
Group([ (1,2), (1,3)(2,4), (3,4) ])
gap> Size(Centralizer(cl[5]));
4
gap> Size(cl[2]);
6
\endexample

In general, you will not need to have to influence the method, but simply
call `ConjugacyClasses' -- GAP will try to select a suitable method on its
own. The method specifications are provided here mainly for expert use. 

\Declaration{ConjugacyClassesByRandomSearch}
\Declaration{ConjugacyClassesByOrbits}

Typically, for small groups (roughly of order up to $10^3$) the computation
of classes as orbits under the action is fastest; memory restrictions (and
the increasing cost of eliminating duplicates) make this less efficient for
larger groups.

Calculation by random search has the smallest memory requirement, but in
generally performs worse, the more classes are there.

The folowing example shows the effect of this for a small group with many
classes:

% this example is time and load-status dependent. No point in testing
\begintt
gap> h:=Group((4,5)(6,7,8),(1,2,3)(5,6,9));;ConjugacyClasses(h:noaction);;time;
110
gap> h:=Group((4,5)(6,7,8),(1,2,3)(5,6,9));;ConjugacyClasses(h:random);;time;
300
gap> h:=Group((4,5)(6,7,8),(1,2,3)(5,6,9));;ConjugacyClasses(h:action);;time;
30
\endtt

\Declaration{NrConjugacyClasses}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));;
gap> NrConjugacyClasses(g);
5
\endexample

\Declaration{RationalClass}
\Declaration{RationalClasses}
\beginexample
gap> RationalClasses(DerivedSubgroup(g));
[ RationalClass( AlternatingGroup( [ 1 .. 4 ] ), () ), 
  RationalClass( AlternatingGroup( [ 1 .. 4 ] ), (1,2)(3,4) ), 
  RationalClass( AlternatingGroup( [ 1 .. 4 ] ), (1,2,3) ) ]
\endexample
\Declaration{GaloisGroup}[clas]!{of rational class of a group}

\Declaration{IsConjugate}
\beginexample
gap> IsConjugate(g,Group((1,2,3,4),(1,3)),Group((1,3,2,4),(1,2)));
true
\endexample

`RepresentativeAction' (see~"RepresentativeAction") can be used to
obtain conjugating elements.
\beginexample
gap> RepresentativeAction(g,(1,2),(3,4));
(1,3)(2,4)
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Normal Structure}

For the operations `Centralizer' and `Centre', see Chapter~"Magmas".
\index{normalizer}
\Declaration{Normalizer}
\beginexample
gap> Normalizer(g,Subgroup(g,[(1,2,3)]));
Group([ (1,2,3), (2,3) ])
\endexample

\Declaration{Core}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));;
gap> Core(g,Subgroup(g,[(1,2,3,4)]));
Group(())
\endexample

\Declaration{PCore}
\beginexample
gap> PCore(g,2);
Group([ (1,4)(2,3), (1,2)(3,4) ])
\endexample

\Declaration{NormalClosure}
\beginexample
gap> NormalClosure(g,Subgroup(g,[(1,2,3)]));
Group([ (1,2,3), (1,3,4) ])
\endexample

\Declaration{NormalIntersection}
\beginexample
gap> NormalIntersection(Group((1,2)(3,4),(1,3)(2,4)),Group((1,2,3,4)));
Group([ (1,3)(2,4) ])
\endexample

\Declaration{Complementclasses}
\beginexample
gap> Complementclasses(g,Group((1,2)(3,4),(1,3)(2,4)));
[ Group([ (3,4), (2,4,3) ]) ]
\endexample

\Declaration{InfoComplement}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Specific and Parametrized Subgroups}

The Centre of a group (the subgroup of those elements that commute with all
other elements of the group) can be computed by the operation `Centre'
(see~"Centre").

\Declaration{TrivialSubgroup}
\beginexample
gap> TrivialSubgroup(g);
Group(())
\endexample

\Declaration{CommutatorSubgroup}
\beginexample
gap> CommutatorSubgroup(Group((1,2,3),(1,2)),Group((2,3,4),(3,4)));
Group([ (1,4)(2,3), (1,3,4) ])
gap> Size(last);
12
\endexample

\Declaration{DerivedSubgroup}
\beginexample
gap> DerivedSubgroup(g);
Group([ (1,3,2), (1,4,3) ])
\endexample

\Declaration{CommutatorLength}
\beginexample
gap> CommutatorLength( g );
1
\endexample

\Declaration{FittingSubgroup}
\beginexample
gap> FittingSubgroup(g);
Group([ (1,2)(3,4), (1,4)(2,3) ])
\endexample

\Declaration{FrattiniSubgroup}
\beginexample
gap> FrattiniSubgroup(g);
Group(())
\endexample

\Declaration{PrefrattiniSubgroup}
\beginexample
gap> G := SmallGroup( 60, 7 );
<pc group of size 60 with 4 generators>
gap> P := PrefrattiniSubgroup(G);
Group([ f2 ])
gap> Size(P);
2
gap> IsNilpotent(P);
true
gap> Core(G,P);
Group([  ])
gap> FrattiniSubgroup(G);
Group([  ])
\endexample

\Declaration{PerfectResiduum}
\beginexample
gap> PerfectResiduum(Group((1,2,3,4,5),(1,2)));
Group([ (1,3,2), (1,4,3), (1,5,4) ])
\endexample

\Declaration{RadicalGroup}
\beginexample
gap> RadicalGroup(SL(2,5));
<group of 2x2 matrices of size 2 in characteristic 5>
gap> Size(last);
2
\endexample

\Declaration{Socle}
\beginexample
gap> Socle(g);
Group([ (1,4)(2,3), (1,2)(3,4) ])
\endexample

\Declaration{SupersolvableResiduum}
\beginexample
gap> SupersolvableResiduum(g);
Group([ (1,2)(3,4), (1,4)(2,3) ])
\endexample

\Declaration{PRump}

*@example missing!@*


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Sylow Subgroups and Hall Subgroups}

\Declaration{SylowSubgroup}
\beginexample
gap> g:=SymmetricGroup(4);;
gap> SylowSubgroup(g,2);
Group([ (1,2), (3,4), (1,3)(2,4) ])
\endexample

With respect to the following {\GAP} functions,
please note that by theorems of P.~Hall,
a group $G$ is solvable if and only if one of the following conditions holds.
\beginlist%ordered
\item{1.}
    For each prime $p$ dividing the order of $G$,
    there exists a $p$-complement (see~"SylowComplement").
\item{2.}
    For each set $P$ of primes dividing the order of $G$,
    there exists a $P$-Hall subgroup (see~"HallSubgroup").
\item{3.}
    $G$ has a Sylow system (see~"SylowSystem").
\item{4.}
    $G$ has a complement system (see~"ComplementSystem").
\endlist

\Declaration{SylowComplement}
\beginexample
gap> SylowComplement(g,3);
Group([ (3,4), (1,4)(2,3), (1,3)(2,4) ])
\endexample

\Declaration{HallSubgroup}
\beginexample
gap> h:=SmallGroup(60,10);;
gap> u:=HallSubgroup(h,[2,3]);
Group([ f1, f2, f3 ])
gap> Size(u);
12
\endexample

\Declaration{SylowSystem}
\beginexample
gap> h:=SmallGroup(60,10);;
gap> SylowSystem(h);
[ Group([ f1, f2 ]), Group([ f3 ]), Group([ f4 ]) ]
gap> List(last,Size);
[ 4, 3, 5 ]
\endexample

\Declaration{ComplementSystem}
\beginexample
gap> ComplementSystem(h);
[ Group([ f3, f4 ]), Group([ f1, f2, f4 ]), Group([ f1, f2, f3 ]) ]
gap> List(last,Size);
[ 15, 20, 12 ]
\endexample

\Declaration{HallSystem}
\beginexample
gap> HallSystem(h);
[ Group([  ]), Group([ f1, f2 ]), Group([ f1, f2, f3 ]), 
  Group([ f1, f2, f3, f4 ]), Group([ f1, f2, f4 ]), Group([ f3 ]), 
  Group([ f3, f4 ]), Group([ f4 ]) ]
gap> List(last,Size);
[ 1, 4, 12, 60, 20, 3, 15, 5 ]
\endexample

%%  The methods for Sylow subgroups in polycyclic groups and for Hall
%%  Systems are due to Bettina Eick.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Subgroups characterized by prime powers}

\Declaration{Omega}
\beginexample
gap> h:=SmallGroup(16,10);
<pc group of size 16 with 4 generators>
gap> Omega(h,2);
Group([ f4, f2, f3 ])
\endexample

\Declaration{Agemo}
\beginexample
gap> Agemo(h,2);Agemo(h,2,2);
Group([ f4 ])
Group([  ])
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Group Properties}

Some properties of groups can be defined not only for groups but also for
other structures.
For example, nilpotency and solvability make sense also for algebras.
Note that these names refer to different definitions for groups and
algebras, contrary to the situation with finiteness or commutativity.
In such cases, the name of the function for groups got a suffix `Group'
to distinguish different meanings for different structures.

\Declaration{IsCyclic}
\Declaration{IsElementaryAbelian}
\Declaration{IsNilpotentGroup}
\Declaration{NilpotencyClassOfGroup}
\Declaration{IsPerfectGroup}
\Declaration{IsSolvableGroup}
\Declaration{IsPolycyclicGroup}
\Declaration{IsSupersolvableGroup}
\Declaration{IsMonomialGroup}

\Declaration{IsSimpleGroup}
\Declaration{IsomorphismTypeInfoFiniteSimpleGroup}
\beginexample
gap> IsomorphismTypeInfoFiniteSimpleGroup(Group((4,5)(6,7),(1,2,4)(3,5,6)));
rec( series := "L", parameter := [ 2, 7 ], 
  name := "A(1,7) = L(2,7) ~ B(1,7) = O(3,7) ~ C(1,7) = S(2,7) ~ 2A(1,7) = U(2\
,7) ~ A(2,2) = L(3,2)" )
\endexample

\Declaration{IsFinitelyGeneratedGroup}
\Declaration{IsSubsetLocallyFiniteGroup}

\atindex{p-group}{@$p$-group}
\Declaration{IsPGroup}
\Declaration{PrimePGroup}
\Declaration{PClassPGroup}
\Declaration{RankPGroup}
\beginexample
gap> h:=Group((1,2,3,4),(1,3));;
gap> PClassPGroup(h);
2
gap> RankPGroup(h);
2
\endexample

Note that the following functions, although they are mathematical
properties, are not properties in the sense of {\GAP} (see~"Attributes" and
"Properties"), as they depend on a parameter.

\Declaration{IsPSolvable}

\Declaration{IsPNilpotent}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Numerical Group Attributes}

\Declaration{AbelianInvariants}[grp]!{for groups}
\beginexample
gap> g:=Group((1,2,3,4),(1,2),(5,6));;
gap> AbelianInvariants(g);
[ 2, 2 ]
\endexample

\Declaration{Exponent}
\beginexample
gap> Exponent(g);
12
\endexample

Again the
following are mathematical attributes, but not {\GAP} `Attributes' as
they are depending on a parameter:

\Declaration{EulerianFunction}
\beginexample
gap> EulerianFunction(g,2);
432
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Subgroup Series}

In group theory many subgroup series are considered,
and {\GAP} provides commands to compute them.
In the following sections, there is always a series
$G = U_1 > U_2 > \cdots > U_m = \langle 1 \rangle$ of subgroups considered.
A series also may stop without reaching $G$ or $\langle1\rangle$.

A series is called *subnormal* if every $U_{i+1}$ is normal in $U_i$.

A series is called *normal* if every $U_i$ is normal in $G$.

A series of normal subgroups is called *central* if $U_i/U_{i+1}$ is
central in $G/U_{i+1}$.

We call a series *refinable* if intermediate subgroups can be added to
the series without destroying the properties of the series.

\FileHeader[1]{grp}

\Declaration{ChiefSeries}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));;
gap> ChiefSeries(g);
[ Group([ (1,2,3,4), (1,2) ]), Group([ (2,4,3), (1,4)(2,3), (1,3)(2,4) ]), 
  Group([ (1,4)(2,3), (1,3)(2,4) ]), Group(()) ]
\endexample

\Declaration{ChiefSeriesThrough}

\Declaration{ChiefSeriesUnderAction}

\Declaration{SubnormalSeries}
\beginexample
gap> s:=SubnormalSeries(g,Group((1,2)(3,4)));
[ Group([ (1,2,3,4), (1,2) ]), Group([ (1,2)(3,4), (1,4)(2,3) ]), 
  Group([ (1,2)(3,4) ]) ]
\endexample

\Declaration{CompositionSeries}

\Declaration{DisplayCompositionSeries}
\beginexample
gap> CompositionSeries(g);
[ Group([ (3,4), (2,4,3), (1,4)(2,3), (1,3)(2,4) ]), 
  Group([ (2,4,3), (1,4)(2,3), (1,3)(2,4) ]), 
  Group([ (1,4)(2,3), (1,3)(2,4) ]), Group([ (1,3)(2,4) ]), Group(()) ]
gap> DisplayCompositionSeries(Group((1,2,3,4,5,6,7),(1,2)));
G (2 gens, size 5040)
 || Z(2)
S (5 gens, size 2520)
 || A(7)
1 (0 gens, size 1)
\endexample

\Declaration{DerivedSeriesOfGroup}
\Declaration{DerivedLength}
\beginexample
gap> List(DerivedSeriesOfGroup(g),Size);
[ 24, 12, 4, 1 ]
gap> DerivedLength(g);
3
\endexample

\Declaration{ElementaryAbelianSeries}
\beginexample
gap> List(ElementaryAbelianSeries(g),Size);
[ 24, 12, 4, 1 ]
\endexample

\Declaration{InvariantElementaryAbelianSeries}
\beginexample
gap> g:=Group((1,2,3,4),(1,3));
Group([ (1,2,3,4), (1,3) ])
gap> hom:=GroupHomomorphismByImages(g,g,GeneratorsOfGroup(g),
> [(1,4,3,2),(1,4)(2,3)]);
[ (1,2,3,4), (1,3) ] -> [ (1,4,3,2), (1,4)(2,3) ]
gap> InvariantElementaryAbelianSeries(g,[hom]);
[ Group([ (1,2,3,4), (1,3) ]), Group([ (1,3)(2,4) ]), Group(()) ]
\endexample

\Declaration{LowerCentralSeriesOfGroup}

\Declaration{UpperCentralSeriesOfGroup}

\Declaration{PCentralSeries}

\Declaration{JenningsSeries}

\Declaration{DimensionsLoewyFactors}

\beginexample
gap> G:= SmallGroup( 3^6, 100 );
<pc group of size 729 with 6 generators>
gap> JenningsSeries( G );
[ <pc group of size 729 with 6 generators>, Group([ f3, f4, f5, f6 ]), 
  Group([ f4, f5, f6 ]), Group([ f5, f6 ]), Group([ f5, f6 ]), 
  Group([ f5, f6 ]), Group([ f6 ]), Group([ f6 ]), Group([ f6 ]), 
  Group([ <identity> of ... ]) ]
gap> DimensionsLoewyFactors(G);
[ 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 27, 27, 
  27, 27, 27, 27, 27, 27, 27, 26, 25, 23, 22, 20, 19, 17, 16, 14, 13, 11, 10, 
  8, 7, 5, 4, 2, 1 ]
\endexample

\Declaration{AscendingChain}

\Declaration{IntermediateGroup}

\Declaration{IntermediateSubgroups}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Factor Groups}

\Declaration{NaturalHomomorphismByNormalSubgroup}
\Declaration{FactorGroup}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));;n:=Subgroup(g,[(1,2)(3,4),(1,3)(2,4)]);;
gap> hom:=NaturalHomomorphismByNormalSubgroup(g,n);
[ (1,2,3,4), (1,2) ] -> [ f1*f2, f1 ]
gap> Size(ImagesSource(hom));
6
gap> FactorGroup(g,n);
Group([ f1, f2 ])
\endexample
\Declaration{CommutatorFactorGroup}
\beginexample
gap> CommutatorFactorGroup(g);
Group([ f1 ])
\endexample

\Declaration{MaximalAbelianQuotient}

\Declaration{HasAbelianFactorGroup}
\Declaration{HasElementaryAbelianFactorGroup}
\beginexample
gap> HasAbelianFactorGroup(g,n);
false
gap> HasAbelianFactorGroup(DerivedSubgroup(g),n);
true
\endexample

\Declaration{CentralizerModulo}
\beginexample
gap> CentralizerModulo(g,n,(1,2));
Group([ (3,4), (1,3)(2,4), (1,4)(2,3) ])
\endexample

%%  The code for factor groups is due to Alexander Hulpke and Heiko Thei{\ss}en.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Sets of Subgroups}

\Declaration{ConjugacyClassSubgroups}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));;IsNaturalSymmetricGroup(g);;
gap> cl:=ConjugacyClassSubgroups(g,Subgroup(g,[(1,2)]));
Group( [ (1,2) ] )^G
gap> Size(cl);
6
gap> ClassElementLattice(cl,4);
Group([ (2,3) ])
\endexample

\Declaration{IsConjugacyClassSubgroupsRep}

\Declaration{ConjugacyClassesSubgroups}
\beginexample
gap> ConjugacyClassesSubgroups(g);
[ Group( () )^G, Group( [ (1,3)(2,4) ] )^G, Group( [ (3,4) ] )^G, 
  Group( [ (2,4,3) ] )^G, Group( [ (1,4)(2,3), (1,3)(2,4) ] )^G, 
  Group( [ (1,2)(3,4), (3,4) ] )^G, Group( [ (1,2)(3,4), (1,3,2,4) ] )^G, 
  Group( [ (3,4), (2,4,3) ] )^G, Group( [ (1,3)(2,4), (1,4)(2,3), (1,2) ] )^G,
  Group( [ (1,3)(2,4), (1,4)(2,3), (2,4,3) ] )^G, 
  Group( [ (1,3)(2,4), (1,4)(2,3), (2,4,3), (1,2) ] )^G ]
\endexample

\Declaration{ConjugacyClassesMaximalSubgroups}
\beginexample
gap> ConjugacyClassesMaximalSubgroups(g);
[ AlternatingGroup( [ 1 .. 4 ] )^G, Group( [ (1,2,3), (1,2) ] )^G, 
  Group( [ (1,2), (3,4), (1,3)(2,4) ] )^G ]
\endexample

\Declaration{MaximalSubgroupClassReps}
\beginexample
gap> MaximalSubgroupClassReps(g);
[ Alt( [ 1 .. 4 ] ), Group([ (1,2,3), (1,2) ]), 
  Group([ (1,2), (3,4), (1,3)(2,4) ]) ]
\endexample

\Declaration{MaximalSubgroups}
\beginexample
gap> MaximalSubgroups(Group((1,2,3),(1,2)));
[ Group([ (1,2,3) ]), Group([ (2,3) ]), Group([ (1,2) ]), Group([ (1,3) ]) ]
\endexample

\Declaration{NormalSubgroups}
\beginexample
gap> g:=SymmetricGroup(4);;NormalSubgroups(g);
[ Group(()), Group([ (1,4)(2,3), (1,3)(2,4) ]), 
  Group([ (2,4,3), (1,4)(2,3), (1,3)(2,4) ]), Sym( [ 1 .. 4 ] ) ]
\endexample
The algorithm used for the computation of normal subgroups of permutation
groups and pc groups is described in \cite{Hulpke98}.

\Declaration{MaximalNormalSubgroups}
\beginexample
gap> MaximalNormalSubgroups( g );
[ Group([ (2,4,3), (1,4)(2,3), (1,3)(2,4) ]) ]
\endexample

\Declaration{MinimalNormalSubgroups}
\beginexample
gap> MinimalNormalSubgroups( g );
[ Group([ (1,4)(2,3), (1,3)(2,4) ]) ]
\endexample

%%  Bettina Eick designed and wrote the code for maximal subgroups of a solvable
%%  group. The code for normal subgroups \cite{Hulpke98} and for subgroups of a
%%  solvable group is due to Alexander Hulpke.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Subgroup Lattice}

The {\GAP} package \package{XGAP} permits a graphical display of the lattice
of subgroups in a nice way.

\Declaration{LatticeSubgroups}
\beginexample
gap> g:=SymmetricGroup(4);;
gap> l:=LatticeSubgroups(g);
<subgroup lattice of Sym( [ 1 .. 4 ] ), 11 classes, 30 subgroups>
gap> ConjugacyClassesSubgroups(l);
[ Group( () )^G, Group( [ (1,3)(2,4) ] )^G, Group( [ (3,4) ] )^G, 
  Group( [ (2,4,3) ] )^G, Group( [ (1,4)(2,3), (1,3)(2,4) ] )^G, 
  Group( [ (1,2)(3,4), (3,4) ] )^G, Group( [ (1,2)(3,4), (1,3,2,4) ] )^G,
  Group( [ (3,4), (2,4,3) ] )^G, Group( [ (1,3)(2,4), (1,4)(2,3), (1,2) ] )^G,
  Group( [ (1,3)(2,4), (1,4)(2,3), (2,4,3) ] )^G, 
  Group( [ (1,3)(2,4), (1,4)(2,3), (2,4,3), (1,2) ] )^G ]
\endexample
\Declaration{ClassElementLattice}

\Declaration{MaximalSubgroupsLattice}
\beginexample
gap> MaximalSubgroupsLattice(l);
[ [  ], [ [ 1, 1 ] ], [ [ 1, 1 ] ], [ [ 1, 1 ] ], 
  [ [ 2, 1 ], [ 2, 2 ], [ 2, 3 ] ], [ [ 3, 1 ], [ 3, 6 ], [ 2, 3 ] ], 
  [ [ 2, 3 ] ], [ [ 4, 1 ], [ 3, 1 ], [ 3, 2 ], [ 3, 3 ] ],
  [ [ 7, 1 ], [ 6, 1 ], [ 5, 1 ] ], 
  [ [ 5, 1 ], [ 4, 1 ], [ 4, 2 ], [ 4, 3 ], [ 4, 4 ] ], 
  [ [ 10, 1 ], [ 9, 1 ], [ 9, 2 ], [ 9, 3 ], [ 8, 1 ], [ 8, 2 ], [ 8, 3 ], 
      [ 8, 4 ] ] ]
gap> last[6];
[ [ 3, 1 ], [ 3, 6 ], [ 2, 3 ] ]
gap> u1:=Representative(ConjugacyClassesSubgroups(l)[6]);
Group([ (1,2)(3,4), (3,4) ])
gap> u2:=ClassElementLattice(ConjugacyClassesSubgroups(l)[3],1);;
gap> u3:=ClassElementLattice(ConjugacyClassesSubgroups(l)[3],6);;
gap> u4:=ClassElementLattice(ConjugacyClassesSubgroups(l)[2],3);;
gap> IsSubgroup(u1,u2);IsSubgroup(u1,u3);IsSubgroup(u1,u4);
true
true
true
\endexample

\Declaration{MinimalSupergroupsLattice}
\beginexample
gap> MinimalSupergroupsLattice(l);
[ [ [ 2, 1 ], [ 2, 2 ], [ 2, 3 ], [ 3, 1 ], [ 3, 2 ], [ 3, 3 ], [ 3, 4 ], 
      [ 3, 5 ], [ 3, 6 ], [ 4, 1 ], [ 4, 2 ], [ 4, 3 ], [ 4, 4 ] ], 
  [ [ 5, 1 ], [ 6, 2 ], [ 7, 2 ] ], [ [ 6, 1 ], [ 8, 1 ], [ 8, 3 ] ], 
  [ [ 8, 1 ], [ 10, 1 ] ], [ [ 9, 1 ], [ 9, 2 ], [ 9, 3 ], [ 10, 1 ] ],
  [ [ 9, 1 ] ], [ [ 9, 1 ] ], [ [ 11, 1 ] ], [ [ 11, 1 ] ], [ [ 11, 1 ] ], 
  [  ] ]
gap> last[3];
[ [ 6, 1 ], [ 8, 1 ], [ 8, 3 ] ]
gap> u5:=ClassElementLattice(ConjugacyClassesSubgroups(l)[8],1);
Group([ (3,4), (2,4,3) ])
gap> u6:=ClassElementLattice(ConjugacyClassesSubgroups(l)[8],3);
Group([ (1,3), (1,3,4) ])
gap> IsSubgroup(u5,u2);
true
gap> IsSubgroup(u6,u2);
true
\endexample

\Declaration{RepresentativesPerfectSubgroups}
\beginexample
gap> m11:=TransitiveGroup(11,6);
M(11)
gap> r:=RepresentativesPerfectSubgroups(m11);
[ Group([ (3,5,8)(4,11,7)(6,9,10), (2,3)(4,10)(5,9)(8,11) ]),
  Group([ (1,2,4)(5,11,8)(6,9,7), (2,3)(4,10)(5,9)(8,11) ]),
  Group([ (3,4,10)(5,11,6)(7,9,8), (1,4,9)(3,6,10)(7,11,8) ]),
  Group([ (1,2,5)(3,11,10)(6,7,8), (2,3)(4,10)(5,9)(8,11) ]), M(11),
  Group(()) ]
gap> List(r,Size);
[ 60, 60, 360, 660, 7920, 1 ]
\endexample

\Declaration{ConjugacyClassesPerfectSubgroups}
\beginexample
gap> ConjugacyClassesPerfectSubgroups(m11);
[ Group( [ ( 3, 5, 8)( 4,11, 7)( 6, 9,10), ( 2, 3)( 4,10)( 5, 9)( 8,11) ] )^G,
  Group( [ ( 1, 2, 4)( 5,11, 8)( 6, 9, 7), ( 2, 3)( 4,10)( 5, 9)( 8,11) ] )^G,
  Group( [ ( 3, 4,10)( 5,11, 6)( 7, 9, 8), ( 1, 4, 9)( 3, 6,10)( 7,11, 8)
     ] )^G,
  Group( [ ( 1, 2, 5)( 3,11,10)( 6, 7, 8), ( 2, 3)( 4,10)( 5, 9)( 8,11) ] )^G,
  M(11)^G, Group( () )^G ]
\endexample

\Declaration{Zuppos}

\Declaration{InfoLattice}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Specific Methods for Subgroup Lattice Computations}

\Declaration{LatticeByCyclicExtension}
\beginexample
gap> g:=WreathProduct(Group((1,2,3),(1,2)),Group((1,2,3,4)));;
gap> l:=LatticeByCyclicExtension(g,function(G)
> return Size(G) in [1,2,3,6];end);
<subgroup lattice of <permutation group of size 5184 with 9 generators>, 
47 classes, 2628 subgroups, restricted under further condition l!.func>
\endexample

The total number of classes in this example is much bigger, as the
following example shows:
\beginexample
gap> LatticeSubgroups(g);
<subgroup lattice of <permutation group of size 5184 with 9 generators>, 
566 classes, 27134 subgroups>
\endexample

\Declaration{InvariantSubgroupsElementaryAbelianGroup}
\beginexample
gap> g:=Group((1,2,3),(4,5,6),(7,8,9));
Group([ (1,2,3), (4,5,6), (7,8,9) ])
gap> hom:=GroupHomomorphismByImages(g,g,[(1,2,3),(4,5,6),(7,8,9)],
> [(7,8,9),(1,2,3),(4,5,6)]);
[ (1,2,3), (4,5,6), (7,8,9) ] -> [ (7,8,9), (1,2,3), (4,5,6) ]
gap> u:=InvariantSubgroupsElementaryAbelianGroup(g,[hom]);
[ Group(()), Group([ (1,2,3)(4,5,6)(7,8,9) ]), 
  Group([ (1,3,2)(7,8,9), (1,3,2)(4,5,6) ]), 
  Group([ (7,8,9), (4,5,6), (1,2,3) ]) ]
\endexample

\Declaration{SubgroupsSolvableGroup}
\beginexample
gap> g:=Group((1,2,3),(1,2),(4,5,6),(4,5),(7,8,9),(7,8));
Group([ (1,2,3), (1,2), (4,5,6), (4,5), (7,8,9), (7,8) ])
gap> hom:=GroupHomomorphismByImages(g,g,
> [(1,2,3),(1,2),(4,5,6),(4,5),(7,8,9),(7,8)],
> [(4,5,6),(4,5),(7,8,9),(7,8),(1,2,3),(1,2)]);
[ (1,2,3), (1,2), (4,5,6), (4,5), (7,8,9), (7,8) ] -> 
[ (4,5,6), (4,5), (7,8,9), (7,8), (1,2,3), (1,2) ]
gap> l:=SubgroupsSolvableGroup(g,rec(actions:=[hom]));;
gap> List(l,Size);
[ 1, 3, 9, 27, 54, 2, 6, 18, 108, 4, 216, 8 ]
gap> Length(ConjugacyClassesSubgroups(g)); # to compare
162
\endexample

\Declaration{SizeConsiderFunction}
\beginexample
gap> l:=SubgroupsSolvableGroup(g,rec(actions:=[hom],
> consider:=SizeConsiderFunction(6)));;
gap> List(l,Size);
[ 1, 3, 9, 27, 54, 6, 18, 108, 216 ]
\endexample
This example shows that in general the `consider' function does not provide
a perfect filter. It is guaranteed that all subgroups fulfilling the
condition are returned, but not all subgroups returned necessarily fulfill
the condition.

\Declaration{ExactSizeConsiderFunction}
\beginexample
gap> l:=SubgroupsSolvableGroup(g,rec(actions:=[hom],
> consider:=ExactSizeConsiderFunction(6)));;
gap> List(l,Size);
[ 1, 3, 9, 27, 54, 6, 108, 216 ]
\endexample
Again, the `consider' function does not provide
a perfect filter. It is guaranteed that all subgroups fulfilling the
condition are returned, but not all subgroups returned necessarily fulfill
the condition.

\Declaration{InfoPcSubgroup}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Special Generating Sets}

\Declaration{GeneratorsSmallest}
\beginexample
gap> g:=SymmetricGroup(4);;
gap> GeneratorsSmallest(g);
[ (3,4), (2,3), (1,2) ]
\endexample
\Declaration{LargestElementGroup}

\Declaration{MinimalGeneratingSet}
\beginexample
gap> MinimalGeneratingSet(g);
[ (2,4,3), (1,4,2,3) ]
\endexample

\Declaration{SmallGeneratingSet}
\beginexample
gap> SmallGeneratingSet(g);
[ (1,2), (1,2,3,4) ]
\endexample

\Declaration{IndependentGeneratorsOfAbelianGroup}
\beginexample
gap> g:=AbelianGroup(IsPermGroup,[15,14,22,78]);;
gap> List(IndependentGeneratorsOfAbelianGroup(g),Order);
[ 2, 2, 2, 3, 3, 5, 7, 11, 13 ]
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{1-Cohomology}

\index{one cohomology}
\index{cohomology}
\index{cocycles}

Let $G$ be a finite group and  $M$ an elementary abelian normal $p$-subgroup
of $G$.  Then the group  of 1-cocycles $Z^1(  G/M, M  )$ is
defined as
$$
Z^1(G/M, M) = \{ \gamma: G/M \rightarrow M \mid \forall g_1, g_2\in G :
                                 \gamma(g_1 M . g_2 M ) 
                                   = \gamma(g_1 M)^{g_2} . \gamma(g_2 M) \}
$$
and is a $GF(p)$-vector space.

The group of 1-coboundaries $B^1( G/M, M )$ is defined as
$$
B^1(G/M, M) = \{ \gamma : G/M \rightarrow M \mid \exists m\in M
                                 \forall g\in G : 
                                  \gamma(gM) = (m^{-1})^g . m \}
$$
It also is a $GF(p)$-vector space.

Let $\alpha$ be the isomorphism of $M$ into a row vector space ${\cal W}$
and $(g_1,\ldots,g_l)$  representatives for  a  generating set  of $G/M$.
Then  there exists a  monomorphism   $\beta$ of $Z^1( G/M, M )$  in   the
$l$-fold direct sum of ${\cal W}$, such that $\beta( \gamma ) = ( \alpha(
\gamma(g_1 M) ),\ldots, \alpha( \gamma(g_l M) ) )$  for  every $\gamma\in
Z^1( G/M, M )$.

\Declaration{OneCocycles}
\Declaration{OneCoboundaries}

The operations `OneCocycles' and `OneCoboundaries' return a record with
(at least) the components:

\beginitems
`generators'&
Is a list of representatives for a generating set of $G/M$. Cocycles are
represented with respect to these generators.

`oneCocycles'&
A space of row vectors over GF($p$), representing $Z^1$. The vectors are
represented in dimension $a\cdot b$ where $a$ is the length of `generators'
and $p^b$ the size of $M$.

`oneCoboundaries'&
A space of row vectors that represents $B^1$.

`cocycleToList'&
is a function to convert a cocycle (a row vector in `oneCocycles') to
a corresponding list of elements of $M$.

`listToCocycle'&
is a function to convert a list of elements of $M$ to a cocycle.

`isSplitExtension'&
indicates whether $G$ splits over $M$.
The following components are only bound if the extension splits. Note that
if $M$ is given by a modulo pcgs all subgroups are given as subgroups of $G$
by generators corresponding to `generators' and thus may not contain the
denominator of the modulo pcgs. In this case taking the closure with this
denominator will give the full preimage of the complement in the factor
group.

`complement'&
One complement to $M$ in $G$.

`cocycleToComplement(<cyc>)'&
is a function that takes a cocycle from `oneCocycles' and returns the
corresponding complement to $M$ in $G$ (with respect to the fixed complement
`complement').

`complementToCocycle(<U>)'&
is a function that takes a complement and returns the corresponding cocycle.

\enditems

If the factor <G>/<M> is given by a (modulo) pcgs <gens> then special
methods are used that compute a presentation for the factor implicitly from
the pcgs.

Note that the groups of 1-cocycles and 1-coboundaries are not `Group's in
the sense of {\GAP} but vector spaces.

\beginexample
gap> g:=Group((1,2,3,4),(1,2));;
gap> n:=Group((1,2)(3,4),(1,3)(2,4));;
gap> oc:=OneCocycles(g,n);
rec( oneCoboundaries := <vector space over GF(2), with 2 generators>, 
  oneCocycles := <vector space over GF(2), with 2 generators>, 
  generators := [ (3,4), (2,4,3) ], isSplitExtension := true, 
  complement := Group([ (3,4), (2,4,3) ]), 
  cocycleToList := function( c ) ... end, 
  listToCocycle := function( L ) ... end, 
  cocycleToComplement := function( c ) ... end, 
  factorGens := [ (3,4), (2,4,3) ], 
  complementToCocycle := function( K ) ... end )
gap> oc.cocycleToList([ 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0 ]);
[ (1,2)(3,4), (1,2)(3,4) ]
gap> oc.listToCocycle([(),(1,3)(2,4)]);
[ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ]
gap> oc.cocycleToComplement([ 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0 ]);
Group([ (1,2), (1,2,3) ])
gap> oc.cocycleToComplement([ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ]);
Group([ (3,4), (1,3,4) ])
gap> oc.complementToCocycle(Group((1,2,4),(1,4)));
[ 0*Z(2), Z(2)^0, Z(2)^0, Z(2)^0 ]
\endexample

The factor group $H^1(G/M,M)=Z^1(G/M,M)/B^1(G/M,M)$ is called the first
cohomology group. Currently there is no function which explicitly computes
this group. The easiest way to represent it is as a vector space complement to
$B^1$ in $Z^1$.

{}

If the only purpose of the calculation of $H^1$ is the determination of
complements it might be desirable to stop calculations once it is known that
the extension cannot split.  This can be achieved via the more technical
function `OCOneCocycles'.
\Declaration{OCOneCocycles}

\Declaration{ComplementclassesEA}

\Declaration{InfoCoh}

%%  The computation of the 1-Cohomology follows \cite{CNW90} and was implemented
%%  by Frank Celler and Alexander Hulpke.

% \Section{AutomorphisGroups and Testing Isomorphism}
%T Is dealt with in section on group homomorphisms!


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Schur Covers and Multipliers}

\atindex{Darstellungsgruppe!see EpimorphismSchurCover}%
{@Darstellungsgruppe!see \noexpand`EpimorphismSchurCover'}

\Declaration{EpimorphismSchurCover}
\Declaration{SchurCover}
\beginexample
gap> g:=Group((1,2,3,4),(1,2));;
gap> epi:=EpimorphismSchurCover(g);
[ f1, f2, f3 ] -> [ (3,4), (2,4,3), (1,4)(2,3) ]
gap> Size(Source(epi));
48
\endexample

If the group becomes bigger, Schur Cover calculations might become
unfeasible.

There is another operation
which only returns the structure of the Multiplier.
% , and which should work
% for larger groups as well.

\Declaration{AbelianInvariantsMultiplier}
\beginexample
gap> AbelianInvariantsMultiplier(g);
[ 2 ]
\endexample
%beginexample
% gap> AbelianInvariantsMultiplier(g);
% [ 2 ]
% gap> AbelianInvariantsMultiplier(MathieuGroup(22));
% [ 4, 3 ]
%endexample

Note that the following example will take some time.

%notest
\beginexample
gap> AbelianInvariantsMultiplier(PSU(6,2));
[ 2, 2, 3 ]
\endexample

At the moment, this operation will not give any information about how to
extend the multiplier to a Schur Cover.

Additional attributes and properties of a group can be derived
from computing its Schur Cover. For example, if $G$ is a
finitely presented group, the
derived subgroup a Schur Cover of $G$ is invariant and isomorphic to
the NonabelianExteriorSquare of $G$ \cite{BJR87}.

\Declaration{Epicentre}
\Declaration{NonabelianExteriorSquare}
\Declaration{EpimorphismNonabelianExteriorSquare}
\Declaration{IsCentralFactor}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Tests for the Availability of Methods}

\FileHeader{grp}[3]

\Declaration{CanEasilyTestMembership}
\Declaration{CanComputeSize}
\Declaration{CanComputeSizeAnySubgroup}
\Declaration{CanComputeIndex}
\Declaration{CanComputeIsSubset}
\Declaration{KnowsHowToDecompose}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%E