Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

610956 views
1
2
3 Residue-Class-Wise Affine Groups
3
4
In this chapter, we describe how to construct residue-class-wise affine
5
groups and how to compute with them.
6
7
8
3.1 Constructing residue-class-wise affine groups
9
10
As any other groups in GAP, residue-class-wise affine (rcwa-) groups can be
11
constructed by Group, GroupByGenerators or GroupWithGenerators.
12
13
 Example 
14

15
gap> G := Group(ClassTransposition(0,2,1,4),ClassShift(0,5));
16
<rcwa group over Z with 2 generators>
17
gap> IsTame(G); Size(G); IsSolvable(G); IsPerfect(G);
18
true
19
infinity
20
false
21
false
22

23

24
25
An rcwa group isomorphic to a given group can be obtained by taking the
26
image of a faithful rcwa representation:
27
28
3.1-1 IsomorphismRcwaGroup
29
30
IsomorphismRcwaGroup( G, R )  attribute
31
IsomorphismRcwaGroup( G )  attribute
32
Returns: a monomorphism from the group G to RCWA(R) or to RCWA(ℤ),
33
respectively.
34
35
The best-supported case is R = ℤ. Currently there are methods available for
36
finite groups, for free products of finite groups and for free groups. The
37
method for free products of finite groups uses the Table-Tennis Lemma (cf.
38
e.g. Section II.B. in [dlH00]), and the method for free groups uses an
39
adaptation of the construction given on page 27 in [dlH00] from PSL(2,ℂ) to
40
RCWA(ℤ).
41
42
 Example 
43

44
gap> F := FreeProduct(Group((1,2)(3,4),(1,3)(2,4)),Group((1,2,3)),
45
>  SymmetricGroup(3));
46
<fp group on the generators [ f1, f2, f3, f4, f5 ]>
47
gap> IsomorphismRcwaGroup(F);
48
[ f1, f2, f3, f4, f5 ] -> [ <rcwa permutation of Z with modulus 12>,
49
 <rcwa permutation of Z with modulus 24>,
50
 <rcwa permutation of Z with modulus 12>,
51
 <rcwa permutation of Z with modulus 72>,
52
 <rcwa permutation of Z with modulus 36> ]
53
gap> IsomorphismRcwaGroup(FreeGroup(2));
54
[ f1, f2 ] -> [ <wild rcwa permutation of Z with modulus 8>,
55
 <wild rcwa permutation of Z with modulus 8> ]
56
gap> F2 := Image(last);
57
<wild rcwa group over Z with 2 generators>
58

59

60
61
Further, new rcwa groups can be constructed from given ones by taking direct
62
products and by taking wreath products with finite groups or with the
63
infinite cyclic group:
64
65
3.1-2 DirectProduct
66
67
DirectProduct( G1, G2, ... )  method
68
Returns: an rcwa group isomorphic to the direct product of the rcwa groups
69
over ℤ given as arguments.
70
71
There is certainly no unique or canonical way to embed a direct product of
72
rcwa groups into RCWA(ℤ). This method chooses to embed the groups G1, G2,
73
G3 ... via restrictions by n ↦ mn, n ↦ mn+1, n ↦ mn+2 ... (→ Restriction
74
(3.1-6)), where m denotes the number of groups given as arguments.
75
76
 Example 
77

78
gap> F2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;
79
gap> F2xF2 := DirectProduct(F2,F2);
80
<wild rcwa group over Z with 4 generators>
81
gap> Image(Projection(F2xF2,1)) = F2;
82
true
83

84

85
86
87
3.1-3 WreathProduct (for an rcwa group over Z, with a permutation group or
88
(ℤ,+))
89
90
WreathProduct( G, P )  method
91
WreathProduct( G, Z )  method
92
Returns: an rcwa group isomorphic to the wreath product of the rcwa group G
93
over ℤ with the finite permutation group P or with the infinite
94
cyclic group Z, respectively.
95
96
The first-mentioned method embeds the NrMovedPoints(P)th direct power of G
97
using the method for DirectProduct, and lets the permutation group P act
98
naturally on the set of residue classes modulo NrMovedPoints(P). The
99
second-mentioned method restricts (→ Restriction (3.1-6)) the group G to the
100
residue class 3(4), and maps the generator of the infinite cyclic group Z to
101
ClassTransposition(0,2,1,2) * ClassTransposition(0,2,1,4).
102
103
 Example 
104

105
gap> F2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;
106
gap> F2wrA5 := WreathProduct(F2,AlternatingGroup(5));;
107
gap> Embedding(F2wrA5,1);
108
[ <wild rcwa permutation of Z with modulus 8>,
109
 <wild rcwa permutation of Z with modulus 8> ] ->
110
[ <wild rcwa permutation of Z with modulus 40>,
111
 <wild rcwa permutation of Z with modulus 40> ]
112
gap> Embedding(F2wrA5,2);
113
[ (1,2,3,4,5), (3,4,5) ] -> [ ( 0(5), 1(5), 2(5), 3(5), 4(5) ), 
114
 ( 2(5), 3(5), 4(5) ) ]
115
gap> ZwrZ := WreathProduct(Group(ClassShift(0,1)),Group(ClassShift(0,1)));
116
<wild rcwa group over Z with 2 generators>
117
gap> Embedding(ZwrZ,1);
118
[ ClassShift( Z ) ] ->
119
[ <tame rcwa permutation of Z with modulus 4, of order infinity> ]
120
gap> Embedding(ZwrZ,2);
121
[ ClassShift( Z ) ] -> [ <wild rcwa permutation of Z with modulus 4> ]
122

123

124
125
Also, rcwa groups can be obtained as particular extensions of finite
126
permutation groups:
127
128
3.1-4 MergerExtension
129
130
MergerExtension( G, points, point )  operation
131
Returns: roughly spoken, an extension of G by an involution which merges
132
points into point.
133
134
The arguments of this operation are a finite permutation group G, a set
135
points of points moved by G and a single point point moved by G which is not
136
in points.
137
138
Let n be the largest moved point of G, and let H be the tame subgroup of
139
CT(ℤ) which respects the partition mathcalP of ℤ into the residue classes
140
(mod n), and which acts on mathcalP as G acts on {1, dots, n}. Further
141
assume that points = {p_1, dots, p_k} and point = p, and put r_i := p_i-1, i
142
= 1, dots, k and r := p-1. Now let σ be the product of the class
143
transpositions τ_r_i(n),r+(i-1)n(kn), i = 1, dots, k. The group returned by
144
this operation is the extension of H by the involution σ. -- On first
145
reading, this may look a little complicated, but really the code of the
146
method is only about half as long as this description.
147
148
 Example 
149

150
gap> # First example -- a group isomorphic to PSL(2,Z):
151
gap> G := MergerExtension(Group((1,2,3)),[1,2],3);
152
<rcwa group over Z with 2 generators>
153
gap> Size(G); 
154
infinity
155
gap> GeneratorsOfGroup(G);
156
[ ( 0(3), 1(3), 2(3) ), ( 0(3), 2(6) ) ( 1(3), 5(6) ) ]
157
gap> B := Ball(G,One(G),6:Spheres);;
158
gap> List(B,Length);
159
[ 1, 3, 4, 6, 8, 12, 16 ]
160
gap> #
161
gap> # Second example -- a group isomorphic to Thompson's group V:
162
gap> G := MergerExtension(Group((1,2,3,4),(1,2)),[1,2],3);
163
<rcwa group over Z with 3 generators>
164
gap> Size(G);
165
infinity
166
gap> GeneratorsOfGroup(G);
167
[ ( 0(4), 1(4), 2(4), 3(4) ), ( 0(4), 1(4) ),
168
 ( 0(4), 2(8) ) ( 1(4), 6(8) ) ]
169
gap> B := Ball(G,One(G),6:Spheres);;
170
gap> List(B,Length);
171
[ 1, 4, 11, 28, 69, 170, 413 ]
172
gap> G = Group(List([[0,2,1,2],[1,2,2,4],[0,2,1,4],[1,4,2,4]],
173
>  ClassTransposition));
174
true
175

176

177
178
It is also possible to build an rcwa group from a list of residue classes:
179
180
3.1-5 GroupByResidueClasses
181
182
GroupByResidueClasses( classes )  function
183
Returns: the group which is generated by all class transpositions which
184
interchange disjoint residue classes in classes.
185
186
The argument classes must be a list of residue classes.
187
188
If the residue classes in classes are pairwise disjoint, then the returned
189
group is the symmetric group on classes. If any two residue classes in
190
classes intersect non-trivially, then the returned group is trivial. In many
191
other cases, the returned group is infinite.
192
193
 Example 
194

195
gap> G := GroupByResidueClasses(List([[0,2],[0,4],[1,4],[2,4],[3,4]],
196
>  ResidueClass));
197
<rcwa group over Z with 8 generators>
198
gap> H := Group(List([[0,2,1,2],[1,2,2,4],[0,2,1,4],[1,4,2,4]],
199
>  ClassTransposition)); # Thompson's group V
200
<(0(2),1(2)),(1(2),2(4)),(0(2),1(4)),(1(4),2(4))>
201
gap> G = H;
202
true
203

204

205
206
Various ways to construct rcwa groups are based on certain monomorphisms
207
from the group RCWA(R) into itself. Examples are the constructions of direct
208
products and wreath products described above. The support of the image of
209
such a monomorphism is the image of a given injective rcwa mapping. For this
210
reason, these monomorphisms are called restriction monomorphisms. The
211
following operation computes images of rcwa mappings and -groups under these
212
embeddings of RCWA(R) into itself:
213
214
215
3.1-6 Restriction (of an rcwa mapping or -group, by an injective rcwa
216
mapping)
217
218
Restriction( g, f )  operation
219
Restriction( G, f )  operation
220
Returns: the restriction of the rcwa mapping g (respectively the rcwa group
221
G) by the injective rcwa mapping f.
222
223
By definition, the restriction g_f of an rcwa mapping g by an injective rcwa
224
mapping f is the unique rcwa mapping which satisfies the equation f ⋅ g_f =
225
g ⋅ f and which fixes the complement of the image of f pointwise. If f is
226
bijective, the restriction of g by f is just the conjugate of g under f.
227
228
The restriction of an rcwa group G by an injective rcwa mapping f is defined
229
as the group whose elements are the restrictions of the elements of G by f.
230
The restriction of G by f acts on the image of f and fixes its complement
231
pointwise.
232
233
 Example 
234

235
gap> F2tilde := Restriction(F2,RcwaMapping([[5,3,1]]));
236
<wild rcwa group over Z with 2 generators>
237
gap> Support(F2tilde);
238
3(5)
239

240

241
242
243
3.1-7 Induction (of an rcwa mapping or -group, by an injective rcwa mapping)
244
245
Induction( g, f )  operation
246
Induction( G, f )  operation
247
Returns: the induction of the rcwa mapping g (respectively the rcwa group
248
G) by the injective rcwa mapping f.
249
250
Induction is the right inverse of restriction, i.e. it is
251
Induction(Restriction(g,f),f) = g and Induction(Restriction(G,f),f) = G. The
252
mapping g respectively the group G must not move points outside the image
253
of f.
254
255
 Example 
256

257
gap> Induction(F2tilde,RcwaMapping([[5,3,1]])) = F2;
258
true
259

260

261
262
Once having constructed an rcwa group, it is sometimes possible to obtain a
263
smaller generating set by the operation SmallGeneratingSet.
264
265
There are methods for the operations View, Display, Print and String which
266
are applicable to rcwa groups.
267
268
Basic attributes of an rcwa group which are derived from the coefficients of
269
its elements are Modulus, Multiplier, Divisor and PrimeSet. The modulus of
270
an rcwa group is the lcm of the moduli of its elements if such an lcm
271
exists, i.e. if the group is tame, and 0 otherwise. The multiplier
272
respectively divisor of an rcwa group is the lcm of the multipliers
273
respectively divisors of its elements in case such an lcm exists and ∞
274
otherwise. The prime set of an rcwa group is the union of the prime sets of
275
its elements. There are shorthands Mod, Mult and Div defined for Modulus,
276
Multiplier and Divisor, respectively. An rcwa group is called class-wise
277
translating, integral or class-wise order-preserving if all of its elements
278
are so. There are corresponding methods available for
279
IsClassWiseTranslating, IsIntegral and IsClassWiseOrderPreserving. There is
280
a property IsSignPreserving, which indicates whether a given rcwa group
281
over ℤ acts on the set of nonnegative integers. The latter holds for any
282
subgroup of CT(ℤ) (cf. below).
283
284
 Example 
285

286
gap> G := Group(ClassTransposition(0,2,1,2),ClassTransposition(1,3,2,6),
287
>  ClassReflection(2,4));
288
<rcwa group over Z with 3 generators>
289
gap> List([Modulus,Multiplier,Divisor,PrimeSet,IsClassWiseTranslating,
290
>  IsIntegral,IsClassWiseOrderPreserving,IsSignPreserving],f->f(G));
291
[ 24, 2, 2, [ 2, 3 ], false, false, false, false ]
292

293

294
295
All rcwa groups over a ring R are subgroups of RCWA(R). The group RCWA(R)
296
itself is not finitely generated, thus cannot be constructed as described
297
above. It is handled as a special case:
298
299
3.1-8 RCWA
300
301
RCWA( R )  function
302
Returns: the group RCWA(R) of all residue-class-wise affine permutations of
303
the ring R.
304
305
 Example 
306

307
gap> RCWA_Z := RCWA(Integers);
308
RCWA(Z)
309
gap> IsSubgroup(RCWA_Z,G);
310
true
311

312

313
314
Examples of rcwa permutations can be obtained via Random(RCWA(R)), see
315
Section 3.5. The number of conjugacy classes of RCWA(ℤ) of elements of given
316
order is known, cf. Corollary 2.7.1 (b) in [Koh05]. It can be determined by
317
the function NrConjugacyClassesOfRCWAZOfOrder:
318
319
 Example 
320

321
gap> List([2,105],NrConjugacyClassesOfRCWAZOfOrder);
322
[ infinity, 218 ]
323

324

325
326
We denote the group which is generated by all class transpositions of the
327
ring R by CT(R). This group is handled as a special case as well:
328
329
3.1-9 CT
330
331
CT( R )  function
332
CT( P, Integers )  function
333
Returns: the group CT(R) which is generated by all class transpositions of
334
the ring R, respectively, the group CT(P,ℤ) which is generated by
335
all class transpositions of ℤ which interchange residue classes
336
whose moduli have only prime factors in the finite set P.
337
338
 Example 
339

340
gap> CT_Z := CT(Integers);
341
CT(Z)
342
gap> IsSimple(CT_Z); # One of a number of stored attributes/properties.
343
true
344
gap> V := CT([2],Integers);
345
CT_[ 2 ](Z)
346
gap> GeneratorsOfGroup(V);
347
[ ( 0(2), 1(2) ), ( 1(2), 2(4) ), ( 0(2), 1(4) ), ( 1(4), 2(4) ) ]
348
gap> G := CT([2,3],Integers); 
349
CT_[ 2, 3 ](Z)
350
gap> GeneratorsOfGroup(G);
351
[ ( 0(2), 1(2) ), ( 0(3), 1(3) ), ( 1(3), 2(3) ), ( 0(2), 1(4) ), 
352
 ( 0(2), 5(6) ), ( 0(3), 1(6) ) ]
353

354

355
356
The group CT(ℤ) has an outer automorphism which is given by conjugation with
357
n ↦ -n - 1. This automorphism can be applied to an rcwa mapping of ℤ or to
358
an rcwa group over ℤ by the operation Mirrored. The group Mirrored(G) acts
359
on the nonnegative integers as G acts on the negative integers, and vice
360
versa.
361
362
 Example 
363

364
gap> ct := ClassTransposition(0,2,1,6);
365
( 0(2), 1(6) )
366
gap> Mirrored(ct);
367
( 1(2), 4(6) )
368
gap> G := Group(List([[0,2,1,2],[0,3,2,3],[2,4,1,6]],ClassTransposition));;
369
gap> ShortOrbits(G,[-100..100],100);
370
[ [ 0, 1, 2, 3, 4, 5 ] ]
371
gap> ShortOrbits(Mirrored(G),[-100..100],100);
372
[ [ -6, -5, -4, -3, -2, -1 ] ]
373

374

375
376
Under the hypothesis that CT(ℤ) is the setwise stabilizer of ℕ_0 in RCWA(ℤ),
377
the elements of CT(ℤ) with modulus dividing a given positive integer m are
378
parametrized by the ordered partitions of ℤ into m residue classes. The list
379
of these elements for given m can be obtained by the function
380
AllElementsOfCTZWithGivenModulus, and the numbers of such elements for m ≤
381
24 are stored in the list NrElementsOfCTZWithGivenModulus.
382
383
 Example 
384

385
gap> NrElementsOfCTZWithGivenModulus{[1..8]};
386
[ 1, 1, 17, 238, 4679, 115181, 3482639, 124225680 ]
387

388

389
390
The number of conjugacy classes of CT(ℤ) of elements of given order is also
391
known under the hypothesis that CT(ℤ) is the setwise stabilizer of ℕ_0 in
392
RCWA(ℤ). It can be determined by the function
393
NrConjugacyClassesOfCTZOfOrder.
394
395
396
3.2 Basic routines for investigating residue-class-wise affine groups
397
398
In the previous section we have seen how to construct rcwa groups. The
399
purpose of this section is to describe how to obtain information on the
400
structure of an rcwa group and on its action on the underlying ring. The
401
easiest way to get a little (but really only a very little!) information on
402
the group structure is a dedicated method for the operation
403
StructureDescription:
404
405
3.2-1 StructureDescription
406
407
StructureDescription( G )  method
408
Returns: a string which sometimes gives a little glimpse of the structure
409
of the rcwa group G.
410
411
The attribute StructureDescription for finite groups is documented in the
412
GAP Reference Manual. Therefore we describe here only issues which are
413
specific to infinite groups, and in particular to rcwa groups.
414
415
Wreath products are denoted by wr, and free products are denoted by *. The
416
infinite cyclic group (ℤ,+) is denoted by Z, the infinite dihedral group is
417
denoted by D0 and free groups of rank 2,3,4,dots are denoted by F2, F3,
418
F4, dots. While for finite groups the symbol . is used to denote a non-split
419
extension, for rcwa groups in general it stands for an extension which may
420
be split or not. For wild groups in most cases it happens that there is a
421
large section on which no structural information can be obtained. Such
422
sections of the group with unknown structure are denoted by <unknown>. In
423
general, the structure of a section denoted by <unknown> can be very
424
complicated and very difficult to exhibit.
425
426
 Example 
427

428
gap> G := Group(ClassTransposition(0,2,1,4),ClassShift(0,5));;
429
gap> StructureDescription(G);
430
"(Z x Z x Z x Z x Z x Z x Z) . (C2 x S7)"
431
gap> G := Group(ClassTransposition(0,2,1,4),
432
>  ClassShift(2,4),ClassReflection(1,2));;
433
gap> StructureDescription(G:short);
434
"Z^2.((S3xS3):2)"
435
gap> F2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;
436
gap> PSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(3),
437
>  CyclicGroup(2))));;
438
gap> G := DirectProduct(PSL2Z,F2);
439
<wild rcwa group over Z with 4 generators>
440
gap> StructureDescription(G);
441
"(C3 * C2) x F2"
442
gap> G := WreathProduct(G,CyclicGroup(IsRcwaGroupOverZ,infinity));
443
<wild rcwa group over Z with 5 generators>
444
gap> StructureDescription(G);
445
"((C3 * C2) x F2) wr Z"
446
gap> Collatz := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);;
447
gap> G := Group(Collatz,ClassShift(0,1));;
448
gap> StructureDescription(G:short);
449
"<unknown>.Z"
450

451

452
453
The extent to which the structure of an rcwa group can be exhibited
454
automatically is severely limited. In general, one can find out much more
455
about the structure of a given rcwa group in an interactive session using
456
the functionality described in the rest of this section and elsewhere in
457
this manual.
458
459
The order of an rcwa group can be computed by the operation Size. An rcwa
460
group is finite if and only if it is tame and its action on a suitably
461
chosen respected partition (see RespectedPartition (3.4-1)) is faithful.
462
Hence the problem of computing the order of an rcwa group reduces to the
463
problem of deciding whether it is tame, the problem of deciding whether it
464
acts faithfully on a respected partition and the problem of computing the
465
order of the finite permutation group induced on the respected partition.
466
467
 Example 
468

469
gap> G := Group(ClassTransposition(0,2,1,2),ClassTransposition(1,3,2,3),
470
>  ClassReflection(0,5));
471
<rcwa group over Z with 3 generators>
472
gap> Size(G);
473
46080
474

475

476
477
For a finite rcwa group, an isomorphism to a permutation group can be
478
computed by IsomorphismPermGroup:
479
480
 Example 
481

482
gap> G := Group(ClassTransposition(0,2,1,2),ClassTransposition(0,3,1,3));;
483
gap> IsomorphismPermGroup(G);
484
[ ( 0(2), 1(2) ), ( 0(3), 1(3) ) ] -> [ (1,2)(3,4)(5,6), (1,2)(4,5) ]
485

486

487
488
In general the membership problem for rcwa groups is algorithmically
489
unsolvable, see Corollary 4.5 in [Koh10]. A consequence of this is that a
490
membership test g in G may run into an infinite loop if the rcwa permutation
491
g is not an element of the rcwa group G. For tame rcwa groups however
492
membership can always be decided. For wild rcwa groups, membership can very
493
often be decided quite quick as well, but -- as said -- not always. Anyway,
494
if g is contained in G, the membership test will eventually always return
495
true, provided that there are sufficient computing resources available
496
(memory etc.).
497
498
On Info level 2 of InfoRCWA the membership test provides information on
499
reasons why the given rcwa permutation is an element of the given rcwa group
500
or not.
501
502
The membership test g in G recognizes an option OrbitLengthBound. If this
503
option is set, it returns false once it has computed balls of size exceeding
504
OrbitLengthBound about 1 and g in G, and these balls are still disjoint.
505
Note however that due to the algorithmic unsolvability of the membership
506
problem, RCWA has no means to check the correctness of such bound in a given
507
case. So the correct use of this option has to remain within the full
508
responsibility of the user.
509
510
 Example 
511

512
gap> G := Group(ClassShift(0,3),ClassTransposition(0,3,2,6));;
513
gap>  ClassShift(2,6)^7 * ClassTransposition(0,3,2,6)
514
>  * ClassShift(0,3)^-3 in G;
515
true
516
gap> ClassShift(0,1) in G;
517
false
518

519

520
521
The conjugacy problem for rcwa groups is difficult, and RCWA provides only
522
methods to solve it in some reasonably easy cases.
523
524
 Example 
525

526
gap> IsConjugate(RCWA(Integers),
527
>  ClassTransposition(0,2,1,4),ClassShift(0,1));
528
false
529
gap> IsConjugate(CT(Integers),ClassTransposition(0,2,1,6),
530
>  ClassTransposition(1,4,0,8));
531
true
532
gap> g := RepresentativeAction(CT(Integers),ClassTransposition(0,2,1,6),
533
>  ClassTransposition(1,4,0,8));
534
<rcwa permutation of Z with modulus 48>
535
gap> ClassTransposition(0,2,1,6)^g = ClassTransposition(1,4,0,8);
536
true
537

538

539
540
There is a property IsTame which indicates whether an rcwa group is tame or
541
not:
542
543
 Example 
544

545
gap> G := Group(ClassTransposition(0,2,1,4),ClassShift(1,3));;
546
gap> H := Group(ClassTransposition(0,2,1,6),ClassShift(1,3));;
547
gap> IsTame(G);
548
true
549
gap> IsTame(H);
550
false
551

552

553
554
For tame rcwa groups, there are methods for IsSolvable and IsPerfect
555
available, and usually derived subgroups and subgroup indices can be
556
computed as well. Linear representations of tame groups over the rationals
557
can be determined by the operation IsomorphismMatrixGroup. Testing a wild
558
group for solvability or perfectness is currently not always feasible, and
559
wild groups have in general no faithful finite-dimensional linear
560
representations. There is a method for Exponent available, which works
561
basically for any rcwa group.
562
563
 Example 
564

565
gap> G := Group(ClassTransposition(0,2,1,4),ClassShift(1,2));;
566
gap> IsPerfect(G);
567
false
568
gap> IsSolvable(G);
569
true
570
gap> D1 := DerivedSubgroup(G);; D2 := DerivedSubgroup(D1);;
571
gap> IsAbelian(D2);
572
true
573
gap> Index(G,D1); Index(D1,D2);
574
infinity
575
9
576
gap> StructureDescription(G); StructureDescription(D1);
577
"(Z x Z x Z) . S3"
578
"(Z x Z) . C3"
579
gap> Q := D1/D2;
580
Group([ (), (1,2,4)(3,5,7)(6,8,9), (1,3,6)(2,5,8)(4,7,9) ])
581
gap> StructureDescription(Q); 
582
"C3 x C3"
583
gap> Exponent(G);
584
infinity
585
gap> phi := IsomorphismMatrixGroup(G);;
586
gap> Display(Image(phi,ClassTransposition(0,2,1,4)));
587
[ [ 0, 0, 1/2, -1/2, 0, 0 ], 
588
 [ 0, 0, 0, 1, 0, 0 ], 
589
 [ 2, 1, 0, 0, 0, 0 ], 
590
 [ 0, 1, 0, 0, 0, 0 ], 
591
 [ 0, 0, 0, 0, 1, 0 ], 
592
 [ 0, 0, 0, 0, 0, 1 ] ]
593

594

595
596
When investigating a group, a basic task is to find relations among the
597
generators:
598
599
3.2-2 EpimorphismFromFpGroup
600
601
EpimorphismFromFpGroup( G, r )  method
602
EpimorphismFromFpGroup( G, r, maxparts )  method
603
Returns: an epimorphism from a finitely presented group to the rcwa
604
group G.
605
606
The argument r is the search radius, i.e. the radius of the ball around 1
607
which is scanned for relations. In general, the larger r is chosen the
608
smaller the kernel of the returned epimorphism is. If the group G has finite
609
presentations, the kernel will in principle get trivial provided that r is
610
chosen large enough. If the optional argument maxparts is given, it limits
611
the search space to elements with at most maxparts affine parts.
612
613
 Example 
614

615
gap> a := ClassTransposition(2,4,3,4);;
616
gap> b := ClassTransposition(4,6,8,12);;
617
gap> c := ClassTransposition(3,4,4,6);;
618
gap> G := SparseRep(Group(a,b,c));
619
<(2(4),3(4)),(4(6),8(12)),(3(4),4(6))>
620
gap> phi := EpimorphismFromFpGroup(G,6);
621
#I there are 3 generators and 12 relators of total length 330
622
#I there are 3 generators and 11 relators of total length 312
623
[ a, b, c ] -> [ ( 2(4), 3(4) ), ( 4(6), 8(12) ), ( 3(4), 4(6) ) ]
624
gap> RelatorsOfFpGroup(Source(phi));
625
[ a^2, b^2, c^2, (b*c)^3, (a*b)^6, (a*b*c*b)^3, (a*c*b*c)^3, 
626
 (a*b*a*c)^12, ((a*b)^2*a*c)^12, (a*b*(a*c)^2)^12, (a*b*c*a*c*b)^12 ]
627

628

629
630
A related very common task is to factor group elements into generators:
631
632
3.2-3 PreImagesRepresentative
633
634
PreImagesRepresentative( phi, g )  method
635
Returns: a representative of the set of preimages of g under the
636
epimorphism phi from a free group to an rcwa group.
637
638
The epimorphism phi must map the generators of the free group to the
639
generators of the rcwa group one-by-one.
640
641
This method can be used for factoring elements of rcwa groups into
642
generators. The implementation is based on RepresentativeActionPreImage, see
643
RepresentativeAction (3.3-10).
644
645
Quite frequently, computing several preimages is not harder than computing
646
just one, i.e. often several preimages are found simultaneously. The
647
operation PreImagesRepresentatives takes care of this. It takes the same
648
arguments as PreImagesRepresentative and returns a list of preimages. If
649
multiple preimages are found, their quotients give rise to nontrivial
650
relations among the generators of the image of phi.
651
652
 Example 
653

654
gap> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; SetName(a,"a");
655
gap> b := ClassShift(0,1);; SetName(b,"b");
656
gap> G := Group(a,b);; # G = <<Collatz permutation>, n -> n + 1>
657
gap> phi := EpimorphismFromFreeGroup(G);;
658
gap> g := Comm(a^2*b^4,a*b^3); # a sample element to be factored
659
<rcwa permutation of Z with modulus 8>
660
gap> PreImagesRepresentative(phi,g); # -> a factorization of g
661
b^-3*(b^-1*a^-1)^2*b^3*a*b^-1*a*b^3
662
gap> g = b^-4*a^-1*b^-1*a^-1*b^3*a*b^-1*a*b^3; # check
663
true
664
gap> g := Comm(a*b,Comm(a,b^3));
665
<rcwa permutation of Z with modulus 8>
666
gap> pre := PreImagesRepresentatives(phi,g);
667
[ (b^-1*a^-1)^2*b^2*(b*a)^2*b^-2, b^-1*(a^-1*b)^2*b^2*(a*b^-1)^2*b^-1 ]
668
gap> rel := pre[1]/pre[2]; # -> a nontrivial relation
669
(b^-1*a^-1)^2*b^3*a*b^2*a^-1*b^-2*(b^-1*a)^2*b
670
gap> rel^phi;
671
IdentityMapping( Integers )
672

673

674
675
676
3.3 The natural action of an rcwa group on the underlying ring
677
678
Knowing a natural permutation representation of a group usually helps
679
significantly in computing in it and in obtaining results on its structure.
680
This holds particularly for the natural action of an rcwa group on its
681
underlying ring. In this section we describe RCWA's functionality related to
682
this action.
683
684
The support, i.e. the set of moved points, of an rcwa group can be
685
determined by Support or MovedPoints (these are synonyms). Testing for
686
transitivity on the underlying ring or on a union of residue classes thereof
687
is often feasible:
688
689
 Example 
690

691
gap> G := Group(ClassTransposition(1,2,0,4),ClassShift(0,2));;
692
gap> IsTransitive(G,Integers);
693
true
694

695

696
697
Groups generated by class transpositions of the integers act on the set of
698
nonnegative integers. There is a property
699
IsTransitiveOnNonnegativeIntegersInSupport(G) which indicates whether such
700
group acts transitively on the set of nonnegative integers in its support.
701
Since such transitivity test is a computationally hard problem, methods may
702
fail. If IsTransitiveOnNonnegativeIntegersInSupport returns true, an
703
attribute TransitivityCertificate is set; this is a record containing
704
components phi, words, classes, smallpointbound, status and complete as
705
follows:
706
707
phi
708
is an epimorphism from a free group to G which maps generators to
709
generators.
710
711
words, classes
712
two lists. -- words[i] is a preimage under phi of an element of G
713
which maps all sufficiently large positive integers in the residue
714
classes classes[i] to smaller nonnegative integers.
715
716
smallpointbound
717
in addition to finding a list of group elements g_i such that for any
718
large enough integer n in the support of G there is some g_i such that
719
n^g_i < n, for verifying transitivity it was necessary to check that
720
all integers less than or equal to smallpointbound in the support of G
721
lie in the same orbit.
722
723
status
724
the string "transitive" in case all checks have been completed
725
successfully.
726
727
complete
728
true in case all checks have been completed successfully.
729
730
Parts of this information for possibly intransitive groups can be obtained
731
by the operation TryToComputeTransitivityCertificate(G,searchlimit), where
732
searchlimit is the maximum radius about a point within which smaller points
733
are searched and taken into consideration. This operation interprets an
734
option abortdensity -- if set, the operation returns the data computed so
735
far once the density of the set of positive integers in the support of G for
736
which no group element is found which maps them to smaller integers reaches
737
or drops below abortdensity. A simplified certificate can be obtained via
738
SimplifiedCertificate(cert).
739
740
 Example 
741

742
gap> G := Group(List([[0,2,1,2],[0,3,2,3],[1,2,2,4]],
743
>  ClassTransposition));
744
<(0(2),1(2)),(0(3),2(3)),(1(2),2(4))>
745
gap> IsTransitiveOnNonnegativeIntegersInSupport(G);
746
true
747
gap> TransitivityCertificate(G);
748
rec( 
749
 classes := [ [ 1(2) ], [ 2(6) ], [ 6(12), 10(12) ], [ 0(12) ], 
750
 [ 4(12) ] ], complete := true, 
751
 phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 0(3), 2(3) ), ( 1(2), 2(4) ) 
752
 ], smallpointbound := 4, status := "transitive", 
753
 words := [ a, b, c, b*c, a*b ] )
754
gap> SimplifiedCertificate(last);
755
rec( classes := [ [ 1(2) ], [ 2(4) ], [ 4(12) ], [ 0(12), 8(12) ] ], 
756
 complete := true, 
757
 phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 0(3), 2(3) ), ( 1(2), 2(4) ) 
758
 ], smallpointbound := 4, status := "transitive", 
759
 words := [ a, c, a*b, b*c ] )
760
gap> G := Group(List([[0,2,1,2],[1,2,2,4],[1,4,2,6]],
761
>  ClassTransposition)); # '3n+1 group'
762
<(0(2),1(2)),(1(2),2(4)),(1(4),2(6))>
763
gap> cert := TryToComputeTransitivityCertificate(G,10);
764
rec(
765
 classes := [ [ 1(2) ], [ 2(4) ], [ 4(32) ], [ 8(24), 44(48), 20(96) ], 
766
 [ 0(24), 16(24) ] ], complete := false, 
767
 phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 1(2), 2(4) ), ( 1(4), 2(6) ) 
768
 ], remaining := [ 12(48), 28(48), 52(96), 84(96) ], 
769
 smallpointbound := 42, status := "unclear", 
770
 words := [ a, b, (a*c)^2*b*a*b, c, a*c*b ] )
771
gap> Union(Flat(cert.classes));
772
<union of 90 residue classes (mod 96) (6 classes)>
773
gap> Difference(Integers,Union(Flat(cert.classes)));
774
12(48) U 28(48) U 52(96) U 84(96)
775
gap> cert := TryToComputeTransitivityCertificate(G,20); # try larger bound
776
rec(
777
 classes := [ [ 1(2) ], [ 2(4) ], [ 4(32) ], [ 8(24), 44(48), 20(96) ], 
778
 [ 0(24), 16(24) ], [ 12(768), 268(768) ], [ 28(768), 540(768) ] ], 
779
 complete := false, 
780
 phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 1(2), 2(4) ), ( 1(4), 2(6) ) 
781
 ], 
782
 remaining := [ 52(96), 84(96), 60(192), 108(192), 124(192), 172(192), 
783
 76(384), 204(384), 220(384), 348(384), 156(768), 396(768), 
784
 412(768), 652(768) ], smallpointbound := 1074, status := "unclear", 
785
 words := [ a, b, (a*c)^2*b*a*b, c, a*c*b, (a*c)^3*b*c*b*a*b, 
786
 (a*c)^4*b*a*b*a*b ] )
787
gap> Difference(Integers,Union(Flat(cert.classes)));
788
<union of 44 residue classes (mod 768) (14 classes)>
789
gap> Intersection([0..100],last);
790
[ 52, 60, 76, 84 ]
791

792

793
794
Further, there are methods to compute orbits under the action of an rcwa
795
group:
796
797
798
3.3-1 Orbit (for an rcwa group and either a point or a set)
799
800
Orbit( G, point )  method
801
Orbit( G, set )  method
802
Returns: the orbit of the point point respectively the set set under the
803
natural action of the rcwa group G on its underlying ring.
804
805
The second argument can either be an element or a subset of the underlying
806
ring of the rcwa group G. Since orbits under the action of rcwa groups can
807
be finite or infinite, and since infinite orbits are not necessarily residue
808
class unions, the orbit may either be returned in the form of a list, in the
809
form of a residue class union or in the form of an orbit object. It is
810
possible to loop over orbits returned as orbit objects, they can be compared
811
and there is a membership test for them. However note that equality and
812
membership for such orbits cannot always be decided.
813
814
 Example 
815

816
gap> G := Group(ClassShift(0,2),ClassTransposition(0,3,1,3));
817
<rcwa group over Z with 2 generators>
818
gap> Orbit(G,0);
819
Z \ 5(6)
820
gap> Orbit(G,5);
821
[ 5 ]
822
gap> Orbit(G,ResidueClass(0,2));
823
[ 0(2), 1(6) U 2(6) U 3(6), 1(3) U 3(6), 0(3) U 1(6), 0(3) U 4(6), 
824
 1(3) U 0(6), 0(3) U 2(6), 0(6) U 1(6) U 2(6), 2(6) U 3(6) U 4(6), 
825
 1(3) U 2(6) ]
826
gap> Length(Orbit(G,ResidueClass(0,4)));
827
80
828
gap> G := Group(ClassTransposition(0,2,1,2),ClassTransposition(0,2,1,4),
829
>  ClassReflection(0,3));
830
<rcwa group over Z with 3 generators>
831
gap> orb := Orbit(G,2);
832
<orbit of 2 under <wild rcwa group over Z with 3 generators>>
833
gap> 1015808 in orb;
834
true
835
gap> First(orb,n->ForAll([n,n+2,n+6,n+8,n+30,n+32,n+36,n+38],IsPrime));
836
-19
837

838

839
840
3.3-2 GrowthFunctionOfOrbit
841
842
GrowthFunctionOfOrbit( G, n, r_max, size_max )  operation
843
GrowthFunctionOfOrbit( orb, r_max, size_max )  method
844
Returns: a list whose (r+1)-th entry is the size of the sphere of radius r
845
about n under the action of the group G, where the argument r_max
846
is the largest possible radius to be considered, and the
847
computation stops once the sphere size exceeds size_max.
848
849
An option "small" is interpreted -- see example below. In place of the group
850
G and the point n, one can pass as first argument also an rcwa group orbit
851
object orb.
852
853
 Example 
854

855
gap> G := Group(List([[0,4,1,4],[0,3,5,6],[0,4,5,6]],ClassTransposition));
856
<(0(4),1(4)),(0(3),5(6)),(0(4),5(6))>
857
gap> GrowthFunctionOfOrbit(G,18,100,20);
858
[ 1, 1, 2, 3, 4, 3, 4, 4, 4, 4, 3, 3, 3, 4, 3, 4, 4, 5, 5, 6, 8, 6, 5, 
859
 5, 4, 3, 3, 4, 4, 4, 3, 3, 5, 4, 5, 6, 5, 2, 3, 3, 2, 3, 3, 4, 5, 4, 
860
 4, 4, 6, 5, 5, 3, 4, 2, 3, 4, 4, 2, 3, 4, 4, 2, 3, 3, 4, 3, 5, 3, 5, 
861
 4, 5, 6, 5, 3, 4, 5, 6, 5, 4, 3, 5, 4, 5, 5, 4, 4, 5, 5, 3, 4, 5, 3, 
862
 3, 4, 5, 4, 2, 3, 4, 4, 4 ]
863
gap> last = GrowthFunctionOfOrbit(Orbit(G,18),100,20);
864
true
865
gap> GrowthFunctionOfOrbit(G,18,20,20:small:=[0..100]);
866
rec( smallpoints := [ 18, 24, 25, 27, 30, 32, 33, 36, 37, 39, 40, 41, 
867
 42, 44, 45, 48, 49, 51, 52, 53, 56, 57, 59, 60, 61, 64, 65, 66, 
868
 68, 69, 71, 75, 76, 77, 80, 81, 83, 88, 89, 92, 93, 95, 100 ], 
869
 spheresizes := [ 1, 1, 2, 3, 4, 3, 4, 4, 4, 4, 3, 3, 3, 4, 3, 4, 4, 5, 
870
 5, 6, 8 ] )
871
gap> G := Group(List([[0,2,1,2],[1,2,2,4],[1,4,2,6]],ClassTransposition));
872
<(0(2),1(2)),(1(2),2(4)),(1(4),2(6))>
873
gap> GrowthFunctionOfOrbit(G,0,100,10000);
874
[ 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 4, 5, 7, 6, 7, 9, 12, 14, 19, 21, 28, 
875
 29, 37, 42, 55, 57, 72, 78, 99, 113, 148, 164, 215, 226, 288, 344, 
876
 462, 478, 612, 686, 894, 985, 1284, 1416, 1847, 2018, 2620, 2902, 
877
 3786, 4167, 5432, 5958, 7749, 8568, 11178 ]
878

879

880
881
Given an rcwa group G over ℤ and an integer n,
882
DistanceToNextSmallerPointInOrbit(G,n) computes the smallest number d such
883
that there is a product g of d generators or inverses of generators of G
884
which maps n to an integer with absolute value less than |n|, provided that
885
the orbit of n contains such integer. RCWA provides a function to draw
886
pictures of orbits of rcwa groups on ℤ^2. The pictures are written to files
887
in bitmap- (bmp-) format. The author has successfully tested this feature
888
both under Linux and under Windows, and the generated pictures can be
889
processed further with many common graphics programs:
890
891
3.3-3 DrawOrbitPicture
892
893
DrawOrbitPicture( G, p0, bound, h, w, colored, palette, filename )  function
894
Returns: nothing.
895
896
Draws a picture of the orbit(s) of the point(s) p0 under the action of the
897
group G on ℤ^2. The argument p0 is either one point or a list of points. The
898
argument bound denotes the bound to which the ball about p0 is to be
899
computed, in terms of absolute values of coordinates. The size of the
900
generated picture is h x w pixels. The argument colored is a boolean which
901
indicates whether a 24-bit true color picture or a monochrome picture should
902
be generated. In the former case, palette must be a list of triples of
903
integers in the range 0, dots, 255, denoting the RGB values of the colors to
904
be used. In the latter case, palette is not used, and any value can be
905
passed. The picture is written in bitmap- (bmp-) format to a file named
906
filename. This is done using the utility function SaveAsBitmapPicture from
907
ResClasses.
908
909
 Example 
910

911
gap> PSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(2),
912
>  CyclicGroup(3))));;
913
gap> DrawOrbitPicture(PSL2Z,[0,1],2000,512,512,false,fail,"example1.bmp");
914
gap> DrawOrbitPicture(PSL2Z,Combinations([1..4],2),2000,512,512,true,
915
>  [[255,0,0],[0,255,0],[0,0,255]],"example2.bmp");
916

917

918
919
The pictures drawn in the examples are shown on RCWA's webpage.
920
921
Finite orbits give rise to finite quotients of a group, and finite cycles
922
can help to check for conjugacy. Therefore it is important to be able to
923
determine them:
924
925
926
3.3-4 ShortOrbits (for rcwa groups) & ShortCycles (for rcwa permutations)
927
928
ShortOrbits( G, S, maxlng )  operation
929
ShortOrbits( G, S, maxlng, maxn )  operation
930
ShortCycles( g, S, maxlng )  operation
931
ShortCycles( g, S, maxlng, maxn )  operation
932
ShortCycles( g, maxlng )  operation
933
Returns: in the first form a list of all orbits of the rcwa group G of
934
length at most maxlng which intersect non-trivially with the
935
set S. In the second form a list of all orbits of the rcwa group G
936
of length at most maxlng which intersect non-trivially with the
937
set S and which, in terms of euclidean norm, do not exceed maxn.
938
In the third form a list of all cycles of the rcwa permutation g
939
of length at most maxlng which intersect non-trivially with the
940
set S. In the fourth form a list of all cycles of the rcwa
941
permutation g of length at most maxlng which intersect
942
non-trivially with the set S and which, in terms of euclidean
943
norm, do not exceed maxn. In the fifth form a list of all cycles
944
of the rcwa permutation g of length at most maxlng which do not
945
correspond to cycles consisting of residue classes.
946
947
The operation ShortOrbits recognizes an option finite. If this option is
948
set, it is assumed that all orbits are finite, in order to speed up the
949
computation. If furthermore maxlng is negative, a list of all orbits which
950
intersect non-trivially with S is returned.
951
952
There is an operation CyclesOnFiniteOrbit(G,g,n) which returns a list of all
953
cycles of the rcwa permutation g on the orbit of the point n under the
954
action of the rcwa group G. Here g is assumed to be an element of G, and the
955
orbit of n is assumed to be finite.
956
957
 Example 
958

959
gap> G := Group(ClassTransposition(1,4,2,4)*ClassTransposition(1,4,3,4),
960
>  ClassTransposition(3,9,6,18)*ClassTransposition(1,6,3,9));;
961
gap> List(ShortOrbits(G,[-15..15],100),
962
>  orb->StructureDescription(Action(G,orb)));
963
[ "A15", "A4", "1", "1", "C3", "1", "((C2 x C2 x C2) : C7) : C3", "1", 
964
 "1", "C3", "A19" ]
965
gap> ShortCycles(mKnot(7),[1..100],20);
966
[ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7, 8 ], [ 9, 10 ], 
967
 [ 11, 12 ], [ 13, 14, 16, 18, 20, 22, 19, 17, 15 ], [ 21, 24 ], 
968
 [ 23, 26 ], [ 25, 28, 32, 36, 31, 27, 30, 34, 38, 33, 29 ], 
969
 [ 35, 40 ], [ 37, 42, 48, 54, 47, 41, 46, 52, 45, 39, 44, 50, 43 ], 
970
 [ 77, 88, 100, 114, 130, 148, 127, 109, 124, 107, 122, 105, 120, 103, 
971
 89 ] ]
972
gap> G := Group(List([[0,2,1,2],[0,5,4,5],[1,4,0,6]],ClassTransposition));;
973
gap> CyclesOnFiniteOrbit(G,G.1*G.2,0);
974
[ [ 0, 1, 4, 9, 8, 5 ], [ 6, 7 ], [ 10, 11, 14, 19, 18, 15 ], [ 12, 13 ] ]
975
gap> List(CyclesOnFiniteOrbit(G,G.1*G.2*G.3*G.1*G.3*G.2,32),Length);
976
[ 3148, 3148 ]
977

978

979
980
981
3.3-5 ShortResidueClassOrbits & ShortResidueClassCycles
982
983
ShortResidueClassOrbits( G, modulusbound, maxlng )  operation
984
ShortResidueClassCycles( g, modulusbound, maxlng )  operation
985
Returns: in the first form a list of all orbits of residue classes under
986
the action of the rcwa group G which contain a residue class r(m)
987
such that m divides modulusbound and which are not longer than
988
maxlng. In the second form a list of all cycles of residue classes
989
of the rcwa permutation g which contain a residue class r(m) such
990
that m divides modulusbound and which are not longer than maxlng.
991
992
We are only talking about a cycle of residue classes of an rcwa permutation
993
g if the restrictions of g to all contained residue classes are affine.
994
Similarly we are only talking about an orbit of residue classes under the
995
action of an rcwa group G if the restrictions of all elements of G to all
996
residue classes in the orbit are affine.
997
998
The returned lists may contain additional cycles, resp., orbits, which do
999
not contain a residue class r(m) such that m divides modulusbound, but which
1000
happen to be found without additional efforts.
1001
1002
 Example 
1003

1004
gap> g := ClassTransposition(0,2,1,2)*ClassTransposition(0,4,1,6);
1005
<rcwa permutation of Z with modulus 12>
1006
gap> ShortResidueClassCycles(g,Mod(g)^2,20);
1007
[ [ 2(12), 3(12) ], [ 10(12), 11(12) ], [ 4(24), 5(24), 7(36), 6(36) ], 
1008
 [ 20(24), 21(24), 31(36), 30(36) ], 
1009
 [ 8(48), 9(48), 13(72), 19(108), 18(108), 12(72) ], 
1010
 [ 40(48), 41(48), 61(72), 91(108), 90(108), 60(72) ], 
1011
 [ 16(96), 17(96), 25(144), 37(216), 55(324), 54(324), 36(216), 24(144) 
1012
 ], 
1013
 [ 80(96), 81(96), 121(144), 181(216), 271(324), 270(324), 180(216), 
1014
 120(144) ] ]
1015
gap> G := Group(List([[0,6,5,6],[1,4,4,6],[2,4,3,6]],ClassTransposition));
1016
<(0(6),5(6)),(1(4),4(6)),(2(4),3(6))>
1017
gap> ShortResidueClassOrbits(G,48,10);
1018
[ [ 7(12) ], [ 8(12) ], [ 1(24), 4(36) ], [ 2(24), 3(36) ], 
1019
 [ 12(24), 17(24), 28(36) ], [ 18(24), 23(24), 27(36) ], 
1020
 [ 37(48), 58(72), 87(108) ], [ 38(48), 57(72), 88(108) ], 
1021
 [ 0(48), 5(48), 10(72), 15(108) ], [ 6(48), 11(48), 9(72), 16(108) ] ]
1022

1023

1024
1025
3.3-6 ComputeCycleLength
1026
1027
ComputeCycleLength( g, n )  function
1028
Returns: a record containing the length, the largest point and the position
1029
of the largest point of the cycle of the rcwa permutation g which
1030
contains the point n, provided that this cycle is finite.
1031
1032
If the cycle is infinite, the function will run into an infinite loop unless
1033
the option "abortat" is set to the maximum number of iterates to be tried
1034
before aborting. Iterates are not stored, to save memory. The function
1035
interprets an option "notify", which defaults to 10000; every notify
1036
iterations, the number of binary digits of the latest iterate is printed.
1037
This output can be suppressed by the option quiet. The function also
1038
interprets an option "small", which may be set to a range within which small
1039
points are recorded and returned in a component smallpoints.
1040
1041
 Example 
1042

1043
gap> g := Product(List([[0,5,3,5],[1,2,0,6],[2,4,3,6]],
1044
>  ClassTransposition));
1045
<rcwa permutation of Z with modulus 180>
1046
gap> ComputeCycleLength(g,20:small:=[0..1000]);
1047
n = 20: after 10000 steps, the iterate has 1919 binary digits.
1048
n = 20: after 20000 steps, the iterate has 2908 binary digits.
1049
n = 20: after 30000 steps, the iterate has 1531 binary digits.
1050
n = 20: after 40000 steps, the iterate has 708 binary digits.
1051
rec( aborted := false, g := <rcwa permutation of Z with modulus 180>, 
1052
 length := 45961, 
1053
 maximum := 180479928411509527091314790144929480041473309862957394384783\
1054
0525935437431021442346166422201250935268553945158085769924448388724679753\
1055
5271669245363980744610119632280105994423399614803956244808653465492205657\
1056
8650363041608376587943180444494842094693691286183613056599672737336761093\
1057
3101035841077322874883200384115281051837032147150147712534199292886436789\
1058
7520389780289517825203780151058517520194926468391308525704499649905091899\
1059
9667529835495635671154681958992898010506577172313321500572646883756736685\
1060
0158653917532084531267455434808219032998691038943070902228427549279555530\
1061
6429870190316109419051531138721361826083376315737131067799731181096142797\
1062
4868525347003646887454985757711743327946232372385342293662007684758208408\
1063
8635715976464060647431260835037213863991037813998261883899050447111540742\
1064
5857187943077255493709629738212709349458790098815926920248565399938335540\
1065
8092502449690267365120996852, maxpos := 19825, n := 20, 
1066
 smallpoints := [ 20, 23, 66, 99, 294, 295, 298, 441, 447, 882, 890, 
1067
 893 ] )
1068

1069

1070
1071
3.3-7 CycleRepresentativesAndLengths
1072
1073
CycleRepresentativesAndLengths( g, S )  operation
1074
Returns: a list of pairs (cycle representative, length of cycle) for all
1075
cycles of the rcwa permutation g which have a nontrivial
1076
intersection with the set S, where fixed points are omitted.
1077
1078
The rcwa permutation g is assumed to have only finite cycles. If g has an
1079
infinite cycle which intersects non-trivially with S, this may cause an
1080
infinite loop unless a cycle length limit is set via the option abortat. The
1081
output can be suppressed by the option quiet.
1082
1083
 Example 
1084

1085
gap> g := ClassTransposition(0,2,1,2)*ClassTransposition(0,4,1,6);;
1086
gap> CycleRepresentativesAndLengths(g,[0..50]);
1087
[ [ 2, 2 ], [ 4, 4 ], [ 8, 6 ], [ 10, 2 ], [ 14, 2 ], [ 16, 8 ], 
1088
 [ 20, 4 ], [ 22, 2 ], [ 26, 2 ], [ 28, 4 ], [ 32, 10 ], [ 34, 2 ], 
1089
 [ 38, 2 ], [ 40, 6 ], [ 44, 4 ], [ 46, 2 ], [ 50, 2 ] ]
1090
gap> g := Product(List([[0,5,3,5],[1,2,0,6],[2,4,3,6]],
1091
>  ClassTransposition));
1092
<rcwa permutation of Z with modulus 180>
1093
gap> CycleRepresentativesAndLengths(g,[0..100]:abortat:=100000);
1094
n = 20: after 10000 steps, the iterate has 1919 binary digits.
1095
n = 20: after 20000 steps, the iterate has 2908 binary digits.
1096
n = 20: after 30000 steps, the iterate has 1531 binary digits.
1097
n = 20: after 40000 steps, the iterate has 708 binary digits.
1098
n = 79: after 10000 steps, the iterate has 1679 binary digits.
1099
n = 100: after 10000 steps, the iterate has 712 binary digits.
1100
n = 100: after 20000 steps, the iterate has 2507 binary digits.
1101
n = 100: after 30000 steps, the iterate has 3311 binary digits.
1102
n = 100: after 40000 steps, the iterate has 3168 binary digits.
1103
n = 100: after 50000 steps, the iterate has 3947 binary digits.
1104
n = 100: after 60000 steps, the iterate has 4793 binary digits.
1105
n = 100: after 70000 steps, the iterate has 5325 binary digits.
1106
n = 100: after 80000 steps, the iterate has 6408 binary digits.
1107
n = 100: after 90000 steps, the iterate has 7265 binary digits.
1108
n = 100: after 100000 steps, the iterate has 7918 binary digits.
1109
[ [ 0, 7 ], [ 5, 3 ], [ 7, 7159 ], [ 11, 9 ], [ 19, 342 ],
1110
 [ 20, 45961 ], [ 25, 3 ], [ 26, 21 ], [ 29, 2 ], [ 31, 3941 ],
1111
 [ 34, 19 ], [ 37, 7 ], [ 40, 5 ], [ 41, 7 ], [ 46, 3 ], [ 49, 2 ],
1112
 [ 59, 564 ], [ 61, 577 ], [ 65, 3 ], [ 67, 23 ], [ 71, 41 ],
1113
 [ 79, 16984 ], [ 80, 5 ], [ 85, 3 ], [ 86, 3 ], [ 89, 2 ], [ 91, 9 ],
1114
 [ 94, 1355 ], [ 97, 7 ], [ 100, fail ] ]
1115

1116

1117
1118
Often one also wants to know which residue classes an rcwa mapping or an
1119
rcwa group fixes setwise:
1120
1121
3.3-8 FixedResidueClasses
1122
1123
FixedResidueClasses( g, maxmod )  operation
1124
FixedResidueClasses( G, maxmod )  operation
1125
Returns: the set of residue classes with modulus greater than 1 and less
1126
than or equal to maxmod which the rcwa mapping g, respectively the
1127
rcwa group G, fixes setwise.
1128
1129
 Example 
1130

1131
gap> FixedResidueClasses(ClassTransposition(0,2,1,4),8);
1132
[ 2(3), 3(4), 4(5), 6(7), 3(8), 7(8) ]
1133
gap> FixedResidueClasses(Group(ClassTransposition(0,2,1,4),
1134
>  ClassTransposition(0,3,1,3)),12);
1135
[ 2(3), 8(9), 11(12) ]
1136

1137

1138
1139
Frequently one needs to compute balls of certain radius around points or
1140
group elements, be it to estimate the growth of a group, be it to see how an
1141
orbit looks like, be it to search for a group element with certain
1142
properties or be it for other purposes:
1143
1144
1145
3.3-9 Ball (for group, element and radius or group, point, radius and
1146
action)
1147
1148
Ball( G, g, r )  method
1149
Ball( G, p, r, action )  method
1150
Ball( G, p, r )  method
1151
Returns: the ball of radius r around the element g in the group G,
1152
respectively the ball of radius r around the point p under the
1153
action action of the group G, respectively the ball of radius r
1154
around the point p under the action OnPoints of the group G,
1155
1156
All balls are understood with respect to GeneratorsOfGroup(G). As membership
1157
tests can be expensive, the former method does not check whether g is indeed
1158
an element of G. The methods require that element- / point comparisons are
1159
cheap. They are not only applicable to rcwa groups. If the option Spheres is
1160
set, the ball is split up and returned as a list of spheres. There is a
1161
related operation RestrictedBall(G,g,r,modulusbound) specifically for rcwa
1162
groups which computes only those elements of the ball whose moduli do not
1163
exceed modulusbound, and which can be reached from g without computing
1164
intermediate elements whose moduli do exceed modulusbound. The latter
1165
operation interprets an option "boundaffineparts". -- If this option is set
1166
and the group G and the element g are in sparse representation, then
1167
modulusbound is actually taken to be a bound on the number of affine parts
1168
rather than a bound on the modulus.
1169
1170
 Example 
1171

1172
gap> PSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(2),
1173
>  CyclicGroup(3))));;
1174
gap> List([1..10],k->Length(Ball(PSL2Z,[0,1],k,OnTuples)));
1175
[ 4, 8, 14, 22, 34, 50, 74, 106, 154, 218 ]
1176
gap> Ball(Group((1,2),(2,3),(3,4)),(),2:Spheres);
1177
[ [ () ], [ (3,4), (2,3), (1,2) ],
1178
 [ (2,3,4), (2,4,3), (1,2)(3,4), (1,2,3), (1,3,2) ] ]
1179
gap> G := Group(List([[1,2,4,6],[1,3,2,6],[2,3,4,6]],ClassTransposition));;
1180
gap> B := RestrictedBall(G,One(G),20,36:Spheres);; # try replacing 36 by 72
1181
gap> List(B,Length);
1182
[ 1, 3, 6, 12, 4, 6, 6, 4, 4, 4, 6, 6, 3, 3, 2, 0, 0, 0, 0, 0, 0 ]
1183

1184

1185
1186
It is possible to determine group elements which map a given tuple of
1187
elements of the underlying ring to a given other tuple, if such elements
1188
exist:
1189
1190
3.3-10 RepresentativeAction
1191
1192
RepresentativeAction( G, source, destination, action )  method
1193
Returns: an element of G which maps source to destination under the action
1194
given by action.
1195
1196
If an element satisfying this condition does not exist, this method either
1197
returns fail or runs into an infinite loop. The problem whether source and
1198
destination lie in the same orbit under the action action of G is hard, and
1199
in its general form most likely computationally undecidable.
1200
1201
In cases where rather a word in the generators of G than the actual group
1202
element is needed, one should use the operation RepresentativeActionPreImage
1203
instead. This operation takes five arguments. The first four are the same as
1204
those of RepresentativeAction, and the fifth is a free group whose
1205
generators are to be used as letters of the returned word. Note that
1206
RepresentativeAction calls RepresentativeActionPreImage and evaluates the
1207
returned word. The evaluation of the word can very well take most of the
1208
time if G is wild and coefficient explosion occurs.
1209
1210
The algorithm is based on computing balls of increasing radius around source
1211
and destination until they intersect non-trivially.
1212
1213
 Example 
1214

1215
gap> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; SetName(a,"a");
1216
gap> b := ClassShift(1,4:Name:="b");; G := Group(a,b);;
1217
gap> elm := RepresentativeAction(G,[7,4,9],[4,5,13],OnTuples);;
1218
gap> Display(elm);
1219

1220
Rcwa permutation of Z with modulus 12
1221

1222
 /
1223
 | n-3 if n in 1(6) U 10(12)
1224
 | n+4 if n in 5(12) U 9(12)
1225
 n |-> < n+1 if n in 4(12)
1226
 | n if n in 0(6) U 2(6) U 3(12) U 11(12)
1227
 |
1228
 \
1229

1230
gap> List([7,4,9],n->n^elm);
1231
[ 4, 5, 13 ]
1232
gap> elm := RepresentativeAction(G,[6,-3,8],[-9,4,11],OnPoints);;
1233
gap> Display(elm);
1234

1235
Rcwa permutation of Z with modulus 12
1236

1237
 /
1238
 | 2n/3 if n in 0(6) U 3(12)
1239
 | (4n+1)/3 if n in 2(6) U 11(12)
1240
 | (4n-1)/3 if n in 4(6) U 7(12)
1241
 n |-> < (2n-8)/3 if n in 1(12)
1242
 | (4n-17)/3 if n in 5(12)
1243
 | (4n-15)/3 if n in 9(12)
1244
 |
1245
 \
1246

1247
gap> [6,-3,8]^elm; List([6,-3,8],n->n^elm); # `OnPoints' allows reordering
1248
[ -9, 4, 11 ]
1249
[ 4, -9, 11 ]
1250
gap> F := FreeGroup("a","b");; phi := EpimorphismByGenerators(F,G);;
1251
gap> w := RepresentativeActionPreImage(G,[10,-4,9,5],[4,5,13,-8],
1252
>  OnTuples,F);
1253
a*b^-1*a^-1*(b^-1*a)^2*b*a*b^-2*a*b*a^-1*b
1254
gap> elm := w^phi;
1255
<rcwa permutation of Z with modulus 324>
1256
gap> List([10,-4,9,5],n->n^elm);
1257
[ 4, 5, 13, -8 ]
1258

1259

1260
1261
Sometimes an rcwa group fixes a certain partition of the underlying ring
1262
into unions of residue classes. If this happens, then any orbit is clearly a
1263
subset of exactly one of these parts. Further, such a partition often gives
1264
rise to proper quotients of the group:
1265
1266
3.3-11 ProjectionsToInvariantUnionsOfResidueClasses
1267
1268
ProjectionsToInvariantUnionsOfResidueClasses( G, m )  operation
1269
Returns: the projections of the rcwa group G to the unions of residue
1270
classes (mod m) which it fixes setwise.
1271
1272
The corresponding partition of a set of representatives for the residue
1273
classes (mod m) can be obtained by the operation OrbitsModulo(G,m).
1274
1275
 Example 
1276

1277
gap> G := Group(ClassTransposition(0,2,1,2),ClassShift(3,4));;
1278
gap> ProjectionsToInvariantUnionsOfResidueClasses(G,4);
1279
[ [ ( 0(2), 1(2) ), ClassShift( 3(4) ) ] -> 
1280
 [ ( 0(4), 1(4) ), IdentityMapping( Integers ) ], 
1281
 [ ( 0(2), 1(2) ), ClassShift( 3(4) ) ] -> 
1282
 [ ( 2(4), 3(4) ), <rcwa permutation of Z with modulus 4> ] ]
1283
gap> List(last,phi->Support(Image(phi)));
1284
[ 0(4) U 1(4), 2(4) U 3(4) ]
1285

1286

1287
1288
Given two partitions of the underlying ring into the same number of unions
1289
of residue classes, there is always an rcwa permutation which maps the one
1290
to the other:
1291
1292
3.3-12 RepresentativeAction
1293
1294
RepresentativeAction( RCWA(R), P1, P2 )  method
1295
Returns: an element of RCWA(R) which maps the partition P1 to P2.
1296
1297
The arguments P1 and P2 must be partitions of the underlying ring R into the
1298
same number of unions of residue classes. The method for R = ℤ recognizes
1299
the option IsTame, which can be used to demand a tame result. If this option
1300
is set and there is no tame rcwa permutation which maps P1 to P2, the method
1301
runs into an infinite loop. This happens if the condition in Theorem 2.8.9
1302
in [Koh05] is not satisfied. If the option IsTame is not set and the
1303
partitions P1 and P2 both consist entirely of single residue classes, then
1304
the returned mapping is affine on any residue class in P1.
1305
1306
 Example 
1307

1308
gap> P1 := AllResidueClassesModulo(3);
1309
[ 0(3), 1(3), 2(3) ]
1310
gap> P2 := List([[0,2],[1,4],[3,4]],ResidueClass);
1311
[ 0(2), 1(4), 3(4) ]
1312
gap> elm := RepresentativeAction(RCWA(Integers),P1,P2);
1313
<rcwa permutation of Z with modulus 3>
1314
gap> P1^elm = P2;
1315
true
1316
gap> IsTame(elm);
1317
false
1318
gap> elm := RepresentativeAction(RCWA(Integers),P1,P2:IsTame);
1319
<tame rcwa permutation of Z with modulus 24>
1320
gap> P1^elm = P2;
1321
true
1322
gap> elm := RepresentativeAction(RCWA(Integers),
1323
>  [ResidueClass(1,3),
1324
>  ResidueClassUnion(Integers,3,[0,2])],
1325
>  [ResidueClassUnion(Integers,5,[2,4]),
1326
>  ResidueClassUnion(Integers,5,[0,1,3])]);
1327
<rcwa permutation of Z with modulus 6>
1328
gap> [ResidueClass(1,3),ResidueClassUnion(Integers,3,[0,2])]^elm;
1329
[ 2(5) U 4(5), Z \ 2(5) U 4(5) ]
1330

1331

1332
1333
3.3-13 CollatzLikeMappingByOrbitTree
1334
1335
CollatzLikeMappingByOrbitTree( G, n, min_r, max_r )  operation
1336
Returns: either an rcwa mapping f which maps the sphere of radius r about n
1337
under the action of G into the sphere of radius r-1 about n for
1338
every r ranging from min_r to max_r, or fail.
1339
1340
Obviously not for every rcwa group and every root point a mapping f with
1341
these properties exists, and if it exists, it usually depends on the choice
1342
of generators of the group.
1343
1344
 Example 
1345

1346
gap> G := Group(ClassTransposition(0,2,1,2),ClassTransposition(1,2,2,4),
1347
>  ClassTransposition(1,4,2,6));;
1348
gap> G := SparseRep(G);;
1349
gap> f := CollatzLikeMappingByOrbitTree(G,0,4,10);
1350
<rcwa mapping of Z with modulus 4 and 4 affine parts>
1351
gap> Display(f);
1352

1353
Rcwa mapping of Z with modulus 4 and 4 affine parts
1354

1355
 /
1356
 | n+1 if n in 0(4)
1357
 | (3n+1)/2 if n in 1(4)
1358
 n |-> < n/2 if n in 2(4)
1359
 | n-1 if n in 3(4)
1360
 |
1361
 \
1362

1363
gap> B := Ball(G,0,15:Spheres);
1364
[ [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 6 ], [ 7 ], [ 14 ], [ 9, 15 ], [ 8, 18, 30 ], 
1365
 [ 5, 19, 31 ], [ 4, 10, 38, 62 ], [ 11, 25, 39, 41, 63 ], 
1366
 [ 22, 24, 40, 50, 78, 82, 126 ], [ 23, 33, 51, 79, 83, 127 ], 
1367
 [ 32, 46, 66, 102, 158, 166, 254 ], 
1368
 [ 21, 47, 67, 103, 105, 159, 167, 169, 255 ] ]
1369
gap> List([3..15],i->IsSubset(B[i-1],B[i]^f));
1370
[ true, true, true, true, true, true, true, true, true, true, true, true,
1371
 true ]
1372
gap> Trajectory(f,52,[0,1]);
1373
[ 52, 53, 80, 81, 122, 61, 92, 93, 140, 141, 212, 213, 320, 321, 482, 241, 
1374
 362, 181, 272, 273, 410, 205, 308, 309, 464, 465, 698, 349, 524, 525, 788, 
1375
 789, 1184, 1185, 1778, 889, 1334, 667, 666, 333, 500, 501, 752, 753, 1130, 
1376
 565, 848, 849, 1274, 637, 956, 957, 1436, 1437, 2156, 2157, 3236, 3237, 
1377
 4856, 4857, 7286, 3643, 3642, 1821, 2732, 2733, 4100, 4101, 6152, 6153, 
1378
 9230, 4615, 4614, 2307, 2306, 1153, 1730, 865, 1298, 649, 974, 487, 486, 
1379
 243, 242, 121, 182, 91, 90, 45, 68, 69, 104, 105, 158, 79, 78, 39, 38, 19, 
1380
 18, 9, 14, 7, 6, 3, 2, 1 ]
1381

1382

1383
1384
1385
3.4 Special attributes of tame residue-class-wise affine groups
1386
1387
There are a couple of attributes which a priori make only sense for tame
1388
rcwa groups. With their help, various structural information about a given
1389
such group can be obtained. We have already seen above that there are for
1390
example methods for IsSolvable, IsPerfect and DerivedSubgroup available for
1391
tame rcwa groups, while testing wild groups for solvability or perfectness
1392
is currently not always feasible. The purpose of this section is to describe
1393
the specific attributes of tame groups which are needed for these
1394
computations.
1395
1396
1397
3.4-1 RespectedPartition (of a tame rcwa group or -permutation)
1398
1399
RespectedPartition( G )  attribute
1400
RespectedPartition( g )  attribute
1401
Returns: a shortest and coarsest possible respected partition of the rcwa
1402
group G / of the rcwa permutation g.
1403
1404
A tame element g ∈ RCWA(R) permutes a partition of R into finitely many
1405
residue classes on all of which it is affine. Given a tame group
1406
G < RCWA(R), there is a common such partition for all elements of G. We call
1407
the mentioned partitions respected partitions of g or G, respectively.
1408
1409
An rcwa group or an rcwa permutation has a respected partition if and only
1410
if it is tame. This holds either by definition or by Theorem 2.5.8
1411
in [Koh05], depending on how one introduces the notion of tameness.
1412
1413
There is an operation RespectsPartition(G,P) / RespectsPartition(g,P), which
1414
tests whether G or g respects a given partition P. The permutation induced
1415
by g on P can be computed efficiently by PermutationOpNC(g,P,OnPoints).
1416
1417
 Example 
1418

1419
gap> G := Group(ClassTransposition(0,4,1,6),ClassShift(0,2));
1420
<rcwa group over Z with 2 generators>
1421
gap> IsTame(G);
1422
true
1423
gap> Size(G);
1424
infinity
1425
gap> P := RespectedPartition(G);
1426
[ 0(4), 2(4), 1(6), 3(6), 5(6) ]
1427

1428

1429
1430
1431
3.4-2 ActionOnRespectedPartition & KernelOfActionOnRespectedPartition
1432
1433
ActionOnRespectedPartition( G )  attribute
1434
KernelOfActionOnRespectedPartition( G )  attribute
1435
RankOfKernelOfActionOnRespectedPartition( G )  attribute
1436
Returns: the action of the tame rcwa group G on RespectedPartition(G), the
1437
kernel of this action or the rank of the latter, respectively.
1438
1439
The method for KernelOfActionOnRespectedPartition uses the package
1440
Polycyclic [EHN13]. The rank of the largest free abelian subgroup of the
1441
kernel of the action of G on its stored respected partition is
1442
RankOfKernelOfActionOnRespectedPartition(G).
1443
1444
 Example 
1445

1446
gap> G := Group(ClassTransposition(0,4,1,6),ClassShift(0,2));;
1447
gap> H := ActionOnRespectedPartition(G);
1448
Group([ (1,3), (1,2) ])
1449
gap> H = Action(G,P);
1450
true
1451
gap> Size(H);
1452
6
1453
gap> K := KernelOfActionOnRespectedPartition(G);
1454
<rcwa group over Z with 3 generators>
1455
gap> RankOfKernelOfActionOnRespectedPartition(G);
1456
3
1457
gap> Index(G,K);
1458
6
1459
gap> List(GeneratorsOfGroup(K),Factorization);
1460
[ [ ClassShift( 0(4) ) ], [ ClassShift( 2(4) ) ], [ ClassShift( 1(6) ) ] ]
1461
gap> Image(IsomorphismPcpGroup(K));
1462
Pcp-group with orders [ 0, 0, 0 ]
1463

1464

1465
1466
Let G be a tame rcwa group over ℤ, let mathcalP be a respected partition
1467
of G and put m := |mathcalP|. Then there is an rcwa permutation g which maps
1468
mathcalP to the partition of ℤ into the residue classes (mod m), and the
1469
conjugate G^g of G under such a permutation is integral (cf. [Koh05],
1470
Theorem 2.5.14).
1471
1472
The conjugate G^g can be determined by the operation IntegralConjugate, and
1473
the conjugating permutation g can be determined by the operation
1474
IntegralizingConjugator. Both operations are applicable to rcwa permutations
1475
as well. Note that a tame rcwa group does not determine its integral
1476
conjugate uniquely.
1477
1478
 Example 
1479

1480
gap> G := Group(ClassTransposition(0,4,1,6),ClassShift(0,2));;
1481
gap> G^IntegralizingConjugator(G) = IntegralConjugate(G);
1482
true
1483
gap> RespectedPartition(G);
1484
[ 0(4), 2(4), 1(6), 3(6), 5(6) ]
1485
gap> RespectedPartition(G)^IntegralizingConjugator(G);
1486
[ 0(5), 1(5), 2(5), 3(5), 4(5) ]
1487
gap> last = RespectedPartition(IntegralConjugate(G));
1488
true
1489

1490

1491
1492
1493
3.5 Generating pseudo-random elements of RCWA(R) and CT(R)
1494
1495
There are methods for the operation Random for RCWA(R) and CT(R). These
1496
methods are designed to be suitable for generating interesting examples. No
1497
particular distribution is guaranteed.
1498
1499
 Example 
1500

1501
gap> elm := Random(RCWA(Integers));;
1502
gap> Display(elm);
1503

1504
Rcwa permutation of Z with modulus 180
1505

1506
 /
1507
 | 6n+12 if n in 2(10) U 4(10) U 6(10) U 8(10)
1508
 | 3n+3 if n in 1(20) U 5(20) U 9(20) U 17(20)
1509
 | 6n+10 if n in 0(10)
1510
 | (n+1)/2 if n in 15(60) U 27(60) U 39(60) U 51(60)
1511
 | (n+7)/2 if n in 19(60) U 31(60) U 43(60) U 55(60)
1512
 | 3n+1 if n in 13(20)
1513
 | (-n+17)/6 if n in 23(180) U 35(180) U 59(180) U 71(180) U 
1514
 n |-> < 95(180) U 131(180) U 143(180) U 179(180)
1515
 | (-n-1)/6 if n in 11(180) U 47(180) U 83(180) U 155(180)
1516
 | (-n+7)/2 if n in 3(60)
1517
 | (n+3)/2 if n in 7(60)
1518
 | (n-17)/6 if n in 107(180)
1519
 | (-n+11)/6 if n in 119(180)
1520
 | (-n+29)/6 if n in 167(180)
1521
 |
1522
 \
1523

1524

1525
1526
The elements which are returned by this method are obtained by multiplying
1527
class shifts (see ClassShift (2.2-1)), class reflections (see
1528
ClassReflection (2.2-2)) and class transpositions (see ClassTransposition
1529
(2.2-3)). These factors can be retrieved by factoring:
1530
1531
 Example 
1532

1533
gap> Factorization(elm);
1534
[ ClassTransposition(0,2,3,4), ClassTransposition(1,2,4,6), ClassShift(0,2), 
1535
 ClassShift(1,3), ClassReflection(2,5), ClassReflection(1,3), 
1536
 ClassReflection(1,2) ]
1537

1538

1539
1540
1541
3.6 The categories of residue-class-wise affine groups
1542
1543
3.6-1 IsRcwaGroup
1544
1545
IsRcwaGroup( G )  filter
1546
IsRcwaGroupOverZ( G )  filter
1547
IsRcwaGroupOverZ_pi( G )  filter
1548
IsRcwaGroupOverGFqx( G )  filter
1549
Returns: true if G is an rcwa group, an rcwa group over the ring of
1550
integers, an rcwa group over a semilocalization of the ring of
1551
integers or an rcwa group over a polynomial ring in one variable
1552
over a finite field, respectively, and false otherwise.
1553
1554
Often the same methods can be used for rcwa groups over the ring of integers
1555
and over its semilocalizations. For this reason there is a category
1556
IsRcwaGroupOverZOrZ_pi which is the union of IsRcwaGroupOverZ and
1557
IsRcwaGroupOverZ_pi.
1558
1559
To allow distinguishing the groups RCWA(R) and CT(R) from others, they have
1560
the characteristic property IsNaturalRCWA or IsNaturalCT, respectively.
1561
1562
1563