  
  [1m[4m[31m3. Residue Class-Wise Affine Groups[0m
  
  This  chapter  describes  the  functionality  provided  by  this package for
  computing with residue class-wise affine groups.
  
  
  [1m[4m[31m3.1 Constructing residue class-wise affine groups[0m
  
  Residue  class-wise  affine  groups  can  be constructed using either [22m[32mGroup[0m,
  [22m[32mGroupByGenerators[0m  or  [22m[32mGroupWithGenerators[0m,  as  usual  (see  the  reference
  manual).  Note  that  currently  except  of the groups RCWA(R) only finitely
  generated rcwa groups are supported.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> g := RcwaMapping([[1,0,1],[1,1,1],[3,6,1],[0m
    [22m[35m>                      [1,0,3],[1,1,1],[3,6,1],[0m
    [22m[35m>                      [1,0,1],[1,1,1],[3,-21,1]]);;[0m
    [22m[35mgap> h := RcwaMapping([[1,0,1],[1,1,1],[3,6,1],[0m
    [22m[35m>                      [1,0,3],[1,1,1],[3,-21,1],[0m
    [22m[35m>                      [1,0,1],[1,1,1],[3,6,1]]);;[0m
    [22m[35mgap> List([g,h],Order);[0m
    [22m[35m[ 9, 9 ][0m
    [22m[35mgap> G := Group(g,h);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> Size(G);[0m
    [22m[35minfinity[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  For  rcwa groups, there are methods available for the operations [22m[32mDisplay[0m and
  [22m[32mPrint[0m.
  
  All  rcwa groups over the ring R are subgroups of RCWA(R). The group RCWA(R)
  is not finitely generated, thus cannot be constructed as described above. It
  is handled as a special case:
  
  [1m[4m[31m3.1-1 RCWA[0m
  
  [1m[34m> RCWA( [0m[22m[34mR[0m[1m[34m ) ________________________________________________________[0mfunction
  [1mReturns:[0m  The group RCWA([22m[34mR[0m) of all bijective rcwa mappings of the ring[22m[34mR[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> RCWA_Z := RCWA(Integers);[0m
    [22m[35mRCWA(Z)[0m
    [22m[35mgap> Size(RCWA_Z);[0m
    [22m[35minfinity[0m
    [22m[35mgap> IsFinitelyGeneratedGroup(RCWA_Z);[0m
    [22m[35mfalse[0m
    [22m[35mgap> One(RCWA_Z);[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35mgap> IsSolvable(RCWA_Z);[0m
    [22m[35mfalse[0m
    [22m[35mgap> IsPerfect(RCWA_Z);[0m
    [22m[35mfalse[0m
    [22m[35mgap> Centre(RCWA_Z);[0m
    [22m[35mTrivial rcwa group over Z[0m
    [22m[35mgap> IsSubgroup(RCWA_Z, Group(RcwaMapping((1,2,3),[1..4]),[0m
    [22m[35m>                             RcwaMapping(2,[[0,1],[1,0],[2,3],[3,2]])));[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.1-2 Random[0m
  
  [1m[34m> Random( [0m[22m[34mRCWA_Z[0m[1m[34m ) ___________________________________________________[0mmethod
  [1mReturns:[0m  A pseudo-random element of the group RCWA(Z).
  
  This  method is designed to be suitable for generating interesting examples.
  No  particular distribution is guaranteed -- in fact, the author has no idea
  what a "reasonable" random distribution on RCWA(Z) should be.
  
  [22m[35m-----------------------------  Log  ------------------------------[0m
    [22m[35m[0m
    [22m[35mgap> elm := Random(RCWA_Z);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 60>[0m
    [22m[35mgap> Display(elm);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 60[0m
    [22m[35m[0m
    [22m[35m               n mod 60                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  4  6  8 10 14 16 18 20 24 26 28  | [0m
    [22m[35m  30 34 36 38 40 44 46 48 50 54 56 58  | -3n - 5[0m
    [22m[35m   1                                   | (n - 1)/5[0m
    [22m[35m   2 22 42                             | (3n + 24)/5[0m
    [22m[35m   3  9 15 21 27 33 39 45 51 57        | (-5n + 12)/3[0m
    [22m[35m   5 11 17 29 35 41 47 59              | -n + 2[0m
    [22m[35m   7 13 19 25 37 43 49 55              | -n[0m
    [22m[35m  12 32 52                             | (3n + 4)/5[0m
    [22m[35m  23                                   | (n - 3)/5[0m
    [22m[35m  31                                   | (n + 19)/5[0m
    [22m[35m  53                                   | (n + 17)/5[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The  elements  returned  by  this  method  are obtained by multiplying class
  shifts  (see  [1m[34mClassShift[0m  ([1m2.2-2[0m)),  class  reflections (see [1m[34mClassReflection[0m
  ([1m2.2-3[0m))  and  class  transpositions (see [1m[34mClassTransposition[0m ([1m2.2-4[0m)). These
  factors are stored as an attribute value:
  
  [22m[35m-----------------------------  Log  ------------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Perform(FactorizationIntoGenerators(elm),Display);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 6[0m
    [22m[35m[0m
    [22m[35m                n mod 6                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 2 4                                | 3n + 5[0m
    [22m[35m  1 3                                  | n[0m
    [22m[35m  5                                    | (n - 5)/3[0m
    [22m[35m[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 6[0m
    [22m[35m[0m
    [22m[35m                n mod 6                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 2 4                                | 3n + 3[0m
    [22m[35m  1 5                                  | n[0m
    [22m[35m  3                                    | (n - 3)/3[0m
    [22m[35m[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 10[0m
    [22m[35m[0m
    [22m[35m               n mod 10                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  2  4  6  8                       | 5n + 1[0m
    [22m[35m   1                                   | (n - 1)/5[0m
    [22m[35m   3  5  7  9                          | n[0m
    [22m[35m[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 4[0m
    [22m[35m[0m
    [22m[35m                n mod 4                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 1 3                                | n[0m
    [22m[35m  2                                    | n + 4[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z: n -> -n[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 2[0m
    [22m[35m[0m
    [22m[35m                n mod 2                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0                                    | -n[0m
    [22m[35m  1                                    | n[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Another  possible way to get an rcwa group is by taking the image of an rcwa
  representation, or by "translating" a permutation group:
  
  [1m[4m[31m3.1-3 IsomorphismRcwaGroup[0m
  
  [1m[34m> IsomorphismRcwaGroup( [0m[22m[34mG[0m[1m[34m ) _______________________________________[0mattribute
  [1m[34m> RcwaGroupByPermGroup( [0m[22m[34mG[0m[1m[34m ) ________________________________________[0mfunction
  [1mReturns:[0m  A  monomorphism  from the finite group [22m[34mG[0m toRCWA(Z), resp. an rcwa
            group  over  Z,  which  is  isomorphic to the (finite) permutation
            group[22m[34mG[0m,  and  acts  on  the  range [22m[32m[1..LargestMovedPoint([0m[22m[34mG[0m[22m[32m)][0m as [22m[34mG[0m
            does.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := GL(2,5);;[0m
    [22m[35mgap> IsomorphismRcwaGroup(G);[0m
    [22m[35mCompositionMapping( [0m
    [22m[35m[ (2,3,5,8)(4,7,12,18)(6,10,17,22)(9,15,21,24)(13,14,19,23), [0m
    [22m[35m  (1,2,4)(3,6,11)(5,9,16)(7,13,12)(8,14,20)(10,18,17)(15,22,21)(19,24,23) [0m
    [22m[35m ] -> [ <rcwa mapping of Z with modulus 24>, <rcwa mapping of Z with modulus [0m
    [22m[35m    24> ], <action isomorphism> )[0m
    [22m[35mgap> H := RcwaGroupByPermGroup(Group((1,2),(3,4),(5,6),(7,8),[0m
    [22m[35m>                                    (1,3)(2,4),(1,3,5,7)(2,4,6,8)));[0m
    [22m[35m<rcwa group over Z with 6 generators>[0m
    [22m[35mgap> Size(H);; List(DerivedSeries(H),Size);[0m
    [22m[35m[ 384, 96, 32, 2, 1 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.2 Attributes and properties of rcwa groups[0m
  
  [1m[4m[31m3.2-1 Modulus[0m
  
  [1m[34m> Modulus( [0m[22m[34mG[0m[1m[34m ) _______________________________________________________[0mmethod
  [1m[34m> Mod( [0m[22m[34mG[0m[1m[34m ) ___________________________________________________________[0mmethod
  [1mReturns:[0m  The modulus of the rcwa group[22m[34mG[0m.
  
  The  [22m[36mModulus[0m  of  an  rcwa group is the lcm of the moduli of its elements in
  case such an lcm exists and 0 otherwise.
  
  See also [1m[34mIsTame[0m ([1m3.2-2[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Modulus(Group(g,h));[0m
    [22m[35m27[0m
    [22m[35mgap> g1 := RcwaMapping((1,2),[1..2]);[0m
    [22m[35m<rcwa mapping of Z with modulus 2>[0m
    [22m[35mgap> g2 := RcwaMapping((1,2,3),[1..3]);[0m
    [22m[35m<rcwa mapping of Z with modulus 3>[0m
    [22m[35mgap> g3 := RcwaMapping((1,2,3,4,5),[1..5]);[0m
    [22m[35m<rcwa mapping of Z with modulus 5>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(g1,g2,g3);[0m
    [22m[35m<rcwa group over Z with 3 generators>[0m
    [22m[35mgap> Modulus(G);[0m
    [22m[35m30[0m
    [22m[35mgap> a := RcwaMapping([[3,0,2],[3,1,4],[3,0,2],[3,-1,4]]);; SetName(a,"a");[0m
    [22m[35mgap> b := ClassShift(1,4)*a;; SetName(b,"b");[0m
    [22m[35mgap> c := ClassShift(3,4)*a;; SetName(c,"c");[0m
    [22m[35mgap> Modulus(Group(a,b));[0m
    [22m[35m0[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.2-2 IsTame[0m
  
  [1m[34m> IsTame( [0m[22m[34mG[0m[1m[34m ) ______________________________________________________[0mproperty
  [1mReturns:[0m  [22m[32mtrue[0m if the rcwa group[22m[34mG[0m is tame and [22m[32mfalse[0m otherwise.
  
  An rcwa group is called [22m[36mtame[0m if its modulus is not equal to0.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsTame(G);[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsTame(Group(a,b));[0m
    [22m[35mfalse[0m
    [22m[35mgap> IsTame(Group(Comm(a,b),Comm(a,c)));[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.2-3 PrimeSet[0m
  
  [1m[34m> PrimeSet( [0m[22m[34mG[0m[1m[34m ) ___________________________________________________[0moperation
  [1mReturns:[0m  The prime set of the rcwa group[22m[34mG[0m.
  
  The  [22m[36mprime  set[0m  of  an  rcwa  group  is  the union of the prime sets of its
  elements. See also[1m[34mPrimeSet[0m ([1m2.6-3[0m) for rcwa mappings.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> [ PrimeSet(G), PrimeSet(H) ];[0m
    [22m[35m[ [ 2, 3, 5 ], [ 2 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  An rcwa group is called integral resp. class-wise order-preserving if all of
  its   elements  are  so.  There  are  corresponding  methods  available  for
  [22m[32mIsIntegral[0m and [22m[32mIsClassWiseOrderPreserving[0m.
  
  
  [1m[4m[31m3.3   Membership   testing,   order   computation,   permutation-  /  matrix[0m
  [1m[4m[31mrepresentations[0m
  
  [1m[4m[31m3.3-1 \in[0m
  
  [1m[34m> \in( [0m[22m[34mg, G[0m[1m[34m ) ________________________________________________________[0mmethod
  [1mReturns:[0m  [22m[32mtrue[0m  if  the rcwa mapping[22m[34mg[0m is an element of the rcwa group[22m[34mG[0m and
            [22m[32mfalse[0m if not.
  
  Tries  to  figure  out  whether  [22m[34mg[0m  is  an element of [22m[34mG[0m or not. This will be
  successful  if  [22m[34mG[0m  is  tame and class-wise order-preserving. For wild groups
  only  a  number  of  easy  cases are covered. On [22m[32mInfoLevel(InfoRCWA) = 3[0m the
  method will give information about reasons why [22m[34mg[0m is an element of [22m[34mG[0m or not.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> u := RcwaMapping([[3,0,5],[9,1,5],[3,-1,5],[9,-2,5],[9,4,5]]);;[0m
    [22m[35mgap> u in H;[0m
    [22m[35mfalse[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.3-2 Size[0m
  
  [1m[34m> Size( [0m[22m[34mG[0m[1m[34m ) __________________________________________________________[0mmethod
  [1mReturns:[0m  The order of the rcwa group[22m[34mG[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Size(G);[0m
    [22m[35m265252859812191058636308480000000[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.3-3 IsomorphismPermGroup[0m
  
  [1m[34m> IsomorphismPermGroup( [0m[22m[34mG[0m[1m[34m ) __________________________________________[0mmethod
  [1mReturns:[0m  An  isomorphism  from  the finite rcwa group[22m[34mG[0m to some permutation
            group.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> H := Group(g1,g2);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> phi := IsomorphismPermGroup(H);[0m
    [22m[35m[ <bijective rcwa mapping of Z with modulus 2, of order 2>, [0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 3, of order 3> ] -> [0m
    [22m[35m[ (1,2)(3,4)(5,6), (1,2,3)(4,5,6) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.3-4 IsomorphismMatrixGroup[0m
  
  [1m[34m> IsomorphismMatrixGroup( [0m[22m[34mG[0m[1m[34m ) _____________________________________[0mattribute
  [1mReturns:[0m  An isomorphism from the rcwa group[22m[34mG[0m to some matrix group.
  
  Currently,  there  is  only  a  method  installed  which works for tame rcwa
  groups.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> g := RcwaMapping([[2,2,1],[1, 4,1],[1,0,2],[2,2,1],[1,-4,1],[1,-2,1]]);;[0m
    [22m[35mgap> h := RcwaMapping([[2,2,1],[1,-2,1],[1,0,2],[2,2,1],[1,-1,1],[1, 1,1]]);;[0m
    [22m[35mgap> SetName(g,"g"); SetName(h,"h");[0m
    [22m[35mgap> G := Group(g,h);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> phi := IsomorphismMatrixGroup(G);;[0m
    [22m[35mgap> FieldOfMatrixGroup(Image(phi));[0m
    [22m[35mRationals[0m
    [22m[35mgap> DegreeOfMatrixGroup(Image(phi));[0m
    [22m[35m28[0m
    [22m[35mgap> List(GeneratorsOfGroup(Image(phi)),Order);[0m
    [22m[35m[ 7, 12 ][0m
    [22m[35mgap> Display(GeneratorsOfGroup(Image(phi))[1]*One(GF(5)));[0m
    [22m[35m . . . . . . 1 1 . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . 1 . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . 3 . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . . 1 . . . . . .[0m
    [22m[35m . . . . . . . . 1 3 . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . 1 . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . . . 3 . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . . . . 1 . . . .[0m
    [22m[35m . . 1 4 . . . . . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . 1 . . . . . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . 1 1 . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . 1 . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . . . . . 3 . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . . . . . . 1 . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . 1 3 . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . 1 . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . . . . . . . 3 .[0m
    [22m[35m . . . . . . . . . . . . . . . . . . . . . . . . . . . 1[0m
    [22m[35m . . . . . . . . . . . . 1 4 . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . 1 . . . . . . . . . . . . . .[0m
    [22m[35m 2 2 . . . . . . . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . 1 . . . . . . . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . 2 2 . . . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . 1 . . . . . . . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . 2 2 . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . 1 . . . . . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . 2 2 . . . . . . . . . . . .[0m
    [22m[35m . . . . . . . . . . . . . . . 1 . . . . . . . . . . . .[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.4 Factoring elements into generators[0m
  
  [1m[4m[31m3.4-1 PreImagesRepresentative[0m
  
  [1m[34m> PreImagesRepresentative( [0m[22m[34mphi, g[0m[1m[34m ) __________________________________[0mmethod
  [1mReturns:[0m  A   representative   of  the  set  of  preimages  of[22m[34mg[0m  under  the
            homomorphism[22m[34mphi[0m from a free group to an rcwa group overZ.
  
  This  method  can  be used for factoring elements of rcwa groups over Z into
  generators,  and  for  finding non-trivial relations among the generators if
  the  respective  group  is  not  free and the method returns a factorization
  which  does  not  happen  to  be  equal  to one which is known a priori. The
  homomorphism [22m[34mphi[0m must map the generators of the free group to the generators
  of  the rcwa group one-by-one. This method is also suitable for wild groups.
  The implementation is based on [1m[34mRepresentativeActionPreImage[0m ([1m3.5-3[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(g,h);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> phi := EpimorphismFromFreeGroup(G);[0m
    [22m[35m[ g, h ] -> [ g, h ][0m
    [22m[35mgap> PreImagesRepresentative(phi,h*g^3*h^2*g^-1*h*g*h^-3);[0m
    [22m[35mh*g^3*h^2*g^-1*h*g*h^-3[0m
    [22m[35mgap> nu := RcwaMapping([[1,1,1]]);[0m
    [22m[35mRcwa mapping of Z: n -> n + 1[0m
    [22m[35mgap> SetName(nu,"nu");[0m
    [22m[35mgap> G := Group(a,nu);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> IsTame(G);[0m
    [22m[35mfalse[0m
    [22m[35mgap> phi := EpimorphismFromFreeGroup(G);[0m
    [22m[35m[ a, nu ] -> [ a, nu ][0m
    [22m[35mgap> F := Source(phi);[0m
    [22m[35m<free group on the generators [ a, nu ]>[0m
    [22m[35mgap> w := Comm(F.1,Comm(F.1,F.2^2));[0m
    [22m[35ma^-1*nu^-2*a^-1*nu^2*a*nu^-2*a*nu^2[0m
    [22m[35mgap> f := w^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 18>[0m
    [22m[35mgap> IsTame(f);[0m
    [22m[35mfalse[0m
    [22m[35mgap> pre := PreImagesRepresentative(phi,f);[0m
    [22m[35ma^-2*nu^-2*a^2*nu^2[0m
    [22m[35mgap> one := w*pre^-1; # pre <> w --> We have a non-trivial relation![0m
    [22m[35ma^-1*nu^-2*a^-1*nu^2*a*nu^-2*a^-1*nu^2*a^2[0m
    [22m[35mgap> one^phi;[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.4-2 PreImagesRepresentatives[0m
  
  [1m[34m> PreImagesRepresentatives( [0m[22m[34mphi, g[0m[1m[34m ) ______________________________[0moperation
  [1mReturns:[0m  A  list  of representatives of the set of preimages of[22m[34mg[0m under the
            homomorphism[22m[34mphi[0m from a free group to an rcwa group overZ.
  
  Quite  frequently,  computing several preimages is not harder than computing
  just  one,  i.e.  often  several  preimages  are  found simultaneously. This
  operation is called by [1m[34mPreImagesRepresentative[0m ([1m3.4-1[0m), which simply chooses
  the  shortest  representative -- for a slightly more concise description see
  there.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(g,h);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> phi := EpimorphismFromFreeGroup(G);[0m
    [22m[35m[ g, h ] -> [ g, h ][0m
    [22m[35mgap> f := g^3*h*g^-4*h^5*g;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 12>[0m
    [22m[35mgap> RCWAInfo(2);[0m
    [22m[35mgap> pre := PreImagesRepresentatives(phi,f);[0m
    [22m[35m#I  Orbit lengths after extension step 1: [ 4, 5 ][0m
    [22m[35m#I  |Candidates| = 1[0m
    [22m[35m#I  Orbit lengths after extension step 1: [ 5, 5 ][0m
    [22m[35m#I  Orbit lengths after extension step 2: [ 17, 15 ][0m
    [22m[35m#I  Orbit lengths after extension step 3: [ 52, 39 ][0m
    [22m[35m#I  |Candidates| = 1[0m
    [22m[35m#I  Orbit lengths after extension step 1: [ 5, 5 ][0m
    [22m[35m#I  Orbit lengths after extension step 2: [ 17, 15 ][0m
    [22m[35m#I  Orbit lengths after extension step 3: [ 53, 43 ][0m
    [22m[35m#I  Orbit lengths after extension step 4: [ 158, 119 ][0m
    [22m[35m#I  |Candidates| = 1[0m
    [22m[35m#I  Orbit lengths after extension step 1: [ 5, 5 ][0m
    [22m[35m#I  Orbit lengths after extension step 2: [ 17, 17 ][0m
    [22m[35m#I  Orbit lengths after extension step 3: [ 53, 53 ][0m
    [22m[35m#I  Orbit lengths after extension step 4: [ 159, 158 ][0m
    [22m[35m#I  Orbit lengths after extension step 5: [ 472, 462 ][0m
    [22m[35m#I  Orbit lengths after extension step 6: [ 1356, 1309 ][0m
    [22m[35m#I  Orbit lengths after extension step 7: [ 3822, 3643 ][0m
    [22m[35m#I  |Candidates| = 11[0m
    [22m[35m[ g^3*h*g^3*h^5*g, g^-3*h^-4*g^-3*h^-1*g*h*g, g^3*h*g^-4*h^5*g ][0m
    [22m[35mgap> RCWAInfo(0);[0m
    [22m[35mgap> List(pre,Length);[0m
    [22m[35m[ 13, 14, 14 ][0m
    [22m[35mgap> Set(List(pre,w->w^phi)) = [f];[0m
    [22m[35mtrue[0m
    [22m[35mgap> w := pre[1]*pre[2]^-1;[0m
    [22m[35mg^3*h*g^3*h^4*g^-1*h*g^3*h^4*g^3[0m
    [22m[35mgap> Length(w);[0m
    [22m[35m23[0m
    [22m[35mgap> w^phi; # A relation of length 23.[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.5 The action of an rcwa group on the underlying ring R[0m
  
  The  support  (set  of  moved  points) of an rcwa group can be determined by
  [22m[32mMovedPoints[0m.
  
  In  some  cases  --  in particular in the case that the group in question is
  tame  --  testing  for  transitivity  on  the  underlying  ring is feasible.
  Furthermore  it  is  often  possible to determine group elements which map a
  given  tuple  of  elements of the underlying ring to a given other tuple, if
  such elements exist.
  
  [1m[4m[31m3.5-1 IsTransitive[0m
  
  [1m[34m> IsTransitive( [0m[22m[34mG, Integers[0m[1m[34m ) ________________________________________[0mmethod
  [1mReturns:[0m  [22m[32mtrue[0m  if  the  rcwa  group[22m[34mG[0m  acts  transitively  onZ  and  [22m[32mfalse[0m
            otherwise.
  
  Depending  on  the  particular group this might fail or run into an infinite
  loop, but for tame groups things should work.
  
  [22m[35m-----------------------------  Log  ------------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(g,h);;[0m
    [22m[35mgap> RCWAInfo(3);[0m
    [22m[35mgap> IsTransitive(G,Integers);[0m
    [22m[35m#I  IsTransitive: testing for finiteness and searching short orbits ...[0m
    [22m[35m#I  IsTame: balancedness criterion.[0m
    [22m[35m#I  IsTame:`dead end' criterion.[0m
    [22m[35m#I  IsTame: loop criterion.[0m
    [22m[35m#I  IsTame:`finite order or integral power' criterion.[0m
    [22m[35m[0m
    [22m[35m  [ ... ][0m
    [22m[35m[0m
    [22m[35m#I  Order: the 4th power of the argument is RcwaMapping([0m
    [22m[35m[ [ 1, 12, 1 ], [ 1, 12, 1 ], [ 1, -6, 2 ], [ 2, -10, 1 ], [ 1, -7, 1 ],[0m
    [22m[35m  [ 2, -8, 1 ], [ 1, 12, 1 ], [ 1, 12, 1 ], [ 1, -10, 2 ], [ 2, -10, 1 ],[0m
    [22m[35m  [ 1, -7, 1 ], [ 2, -8, 1 ] ] );[0m
    [22m[35mThere is a `class shift' on the residue class 0(12).[0m
    [22m[35m#I  Trying probabilistic random walk, initial m = 12[0m
    [22m[35m#I  checking modulus ...[0m
    [22m[35m#I  Size: use action on respected partition.[0m
    [22m[35m#I  KernelOfActionOnRespectedPartition: gen. #1, lng = 1[0m
    [22m[35m#I  KernelOfActionOnRespectedPartition: gen. #2, lng = 2[0m
    [22m[35m[0m
    [22m[35m                       [ ... ][0m
    [22m[35m[0m
    [22m[35m#I  KernelOfActionOnRespectedPartition: gen. #14, lng = 10[0m
    [22m[35m#I  Searching for class shifts ...[0m
    [22m[35m#I  ... in generators[0m
    [22m[35m#I  ... in commutators of the generators[0m
    [22m[35m#I  The cyclic group generated by RcwaMapping([0m
    [22m[35m[ [ 1, -9, 1 ], [ 1, 0, 1 ], [ 1, 6, 1 ], [ 1, -3, 1 ], [ 1, 0, 1 ],[0m
    [22m[35m  [ 1, 6, 1 ] ] ) acts transitively on the residue class 2(6).[0m
    [22m[35m#I  OrbitUnion: initial set = ResidueClassUnion( Integers, 6, [ 2 ] )[0m
    [22m[35m#I  Image = Integers[0m
    [22m[35mtrue[0m
    [22m[35mgap> RCWAInfo(0);[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.5-2 RepresentativeAction[0m
  
  [1m[34m> RepresentativeAction( [0m[22m[34mG, src, dest, act[0m[1m[34m ) __________________________[0mmethod
  [1mReturns:[0m  An  element  of  [22m[34mG[0m  which  maps [22m[34msrc[0m to[22m[34mdest[0m under the action given
            by[22m[34mact[0m.
  
  If  an  element satisfying this condition does not exist, this method either
  returns  [22m[32mfail[0m  or runs into an infinite loop. The problem of whether [22m[34msrc[0m and
  [22m[34mdest[0m  lie  in  the  same  orbit under the action of [22m[34mG[0m in general seems to be
  hard. The given method is based on [1m[34mRepresentativeActionPreImage[0m ([1m3.5-3[0m), and
  it  basically just computes an image under an homomorphism. As this involves
  multiplications of rcwa mappings, this can be quite expensive if the group [22m[34mG[0m
  is  wild,  the  preimage  is  a  rather  long word and coefficient explosion
  happens to occur.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(a,b);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> elm := RepresentativeAction(G,[7,4,9],[4,5,13],OnTuples);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 12>[0m
    [22m[35mgap> Display(elm);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 12[0m
    [22m[35m[0m
    [22m[35m               n mod 12                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  2  3  6  8 11                    | n[0m
    [22m[35m   1  7 10                             | n - 3[0m
    [22m[35m   4                                   | n + 1[0m
    [22m[35m   5  9                                | n + 4[0m
    [22m[35m[0m
    [22m[35mgap> List([7,4,9],n->n^elm);[0m
    [22m[35m[ 4, 5, 13 ][0m
    [22m[35mgap> elm := RepresentativeAction(G,[5,4,9],[13,5,4],OnTuples);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 9>[0m
    [22m[35mgap> Display(elm);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 9[0m
    [22m[35m[0m
    [22m[35m                n mod 9                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0                                    | 4n/9[0m
    [22m[35m  1                                    | (8n - 26)/9[0m
    [22m[35m  2                                    | (8n + 2)/9[0m
    [22m[35m  3                                    | (8n + 3)/9[0m
    [22m[35m  4                                    | (16n - 19)/9[0m
    [22m[35m  5                                    | (16n + 37)/9[0m
    [22m[35m  6                                    | (8n + 33)/9[0m
    [22m[35m  7                                    | (16n - 49)/9[0m
    [22m[35m  8                                    | (16n + 7)/9[0m
    [22m[35m[0m
    [22m[35mgap> List([5,4,9],n->n^elm);[0m
    [22m[35m[ 13, 5, 4 ][0m
    [22m[35mgap> RepresentativeAction(G,[7,4,9],[4,5,8],OnTuples);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 256>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.5-3 RepresentativeActionPreImage[0m
  
  [1m[34m> RepresentativeActionPreImage( [0m[22m[34mG, src, dest, act, F[0m[1m[34m ) ____________[0moperation
  [1mReturns:[0m  The  result of [22m[32mRepresentativeAction( [22m[34mG[0m, [22m[34msrc[0m, [22m[34mdest[0m, [22m[34mact[0m )[0m as a word
            in the generators.
  
  The  argument  [22m[34mF[0m  is  a free group to be used to express the resulting word.
  Note  that  the  dependency is just the other way round than suggested above
  ([22m[32mRepresentativeAction[0m   calls  [22m[32mRepresentativeActionPreImage[0m)  and  that  the
  evaluation of the word sometimes takes much more time than its determination
  (the  latter however depends very much on the particular case and is hard to
  predict).  This  causes  [22m[32mRepresentativeActionPreImage[0m  sometimes  to be much
  faster than [22m[32mRepresentativeAction[0m. The employed algorithm is not inefficient,
  as  the  last  two  of the examples below suggest -- it is based on separate
  progressive  computations of the orbits of [22m[34msrc[0m and [22m[34mdest[0m until they intersect
  non-trivially.  It  avoids  multiplying  rcwa  mappings. Of course the other
  warnings  given  in the description of [1m[34mRepresentativeAction[0m ([1m3.5-2[0m) apply to
  this operation, too.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> F := FreeGroup("a","b");;[0m
    [22m[35mgap> w := RepresentativeActionPreImage(G,[7,4,9],[4,5,13],OnPoints,F);[0m
    [22m[35mb^-1*a*b*a^-1[0m
    [22m[35mgap> w := RepresentativeActionPreImage(G,[5,4,9],[13,5,4],OnTuples,F);[0m
    [22m[35mb^-1*a^-1*b*a^-1[0m
    [22m[35mgap> w := RepresentativeActionPreImage(G,[7,4,9],[4,5,8],OnPoints,F);[0m
    [22m[35mb^2*a^2[0m
    [22m[35mgap> phi := GroupHomomorphismByImages(F,G,[F.1,F.2],[a,b]);[0m
    [22m[35m[ a, b ] -> [ a, b ][0m
    [22m[35mgap> w^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 256>[0m
    [22m[35mgap> w^phi = RepresentativeAction(G,[7,4,9],[4,5,8],OnPoints);[0m
    [22m[35mtrue[0m
    [22m[35mgap> List([7,4,9],n->n^(w^phi));[0m
    [22m[35m[ 4, 5, 8 ][0m
    [22m[35mgap> w := RepresentativeActionPreImage(G,[37,4,9],[4,51,8],OnPoints,F);[0m
    [22m[35ma^-1*b^-1*a*b^4*a[0m
    [22m[35mgap> w^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 4608>[0m
    [22m[35mgap> w := RepresentativeActionPreImage(G,[37,4,9],[4,51,8],OnTuples,F);[0m
    [22m[35mb*a^6*b*a^-3*b^-3*a^-1*b*a^2[0m
    [22m[35mgap> w := RepresentativeActionPreImage(G,[17,14,9],[4,51,8],OnPoints,F);[0m
    [22m[35ma^-1*b^-1*a^3*b^2*a*b*a*b^-1*a^2[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.5-4 RepresentativeAction[0m
  
  [1m[34m> RepresentativeAction( [0m[22m[34mRCWA_Z, P1, P2[0m[1m[34m ) _____________________________[0mmethod
  [1mReturns:[0m  An element of RCWA(Z) which maps the partition[22m[34mP1[0m to[22m[34mP2[0m.
  
  The arguments [22m[34mP1[0m and [22m[34mP2[0m must be partitions of the underlying ring R into the
  same number of disjoint unions of residue classes. The method recognizes the
  option  [22m[32mIsTame[0m  --  if  this  option  is  set,  the returned mapping is tame
  provided  that there is a tame mapping satisfying the required condition. If
  the  option  [22m[32mIsTame[0m  is  not  set  and the partitions [22m[34mP1[0m and [22m[34mP2[0m both consist
  entirely  of  single residue classes, then the returned mapping is affine on
  any residue class in[22m[34mP1[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> rc := function(r,m) return ResidueClass(DefaultRing(m),m,r); end;;[0m
    [22m[35mgap> P1 := [rc(0,3),rc(1,3),rc(2,9),rc(5,9),rc(8,9)];[0m
    [22m[35m[ 0(3), 1(3), 2(9), 5(9), 8(9) ][0m
    [22m[35mgap> P2 := [rc(0,2),rc(1,8),rc(5,16),rc(3,4),rc(13,16)];[0m
    [22m[35m[ 0(2), 1(8), 5(16), 3(4), 13(16) ][0m
    [22m[35mgap> elm := RepresentativeAction(RCWA(Integers),P1,P2);[0m
    [22m[35m<rcwa mapping of Z with modulus 9>[0m
    [22m[35mgap> Display(elm);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 9[0m
    [22m[35m[0m
    [22m[35m                n mod 9                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 3 6                                | 2n/3[0m
    [22m[35m  1 4 7                                | (8n - 5)/3[0m
    [22m[35m  2                                    | (16n + 13)/9[0m
    [22m[35m  5                                    | (4n + 7)/9[0m
    [22m[35m  8                                    | (16n - 11)/9[0m
    [22m[35m[0m
    [22m[35mgap> P1^elm = P2;[0m
    [22m[35mtrue[0m
    [22m[35mgap> elm := RepresentativeAction(RCWA(Integers),P1,P2:IsTame);[0m
    [22m[35m<tame rcwa mapping of Z with modulus 1152>[0m
    [22m[35mgap> P := RespectedPartition(elm);;[0m
    [22m[35mgap> Length(P);[0m
    [22m[35m313[0m
    [22m[35mgap> elm := RepresentativeAction(RCWA(Integers),[0m
    [22m[35m>                                [rc(1,3),Union(rc(0,3),rc(2,3))],[0m
    [22m[35m>                                [Union(rc(2,5),rc(4,5)),[0m
    [22m[35m>                                 Union(rc(0,5),rc(1,5),rc(3,5))]);[0m
    [22m[35m<rcwa mapping of Z with modulus 6>[0m
    [22m[35mgap> [rc(1,3),Union(rc(0,3),rc(2,3))]^elm;[0m
    [22m[35m[ 2(5) U 4(5), 0(5) U 1(5) U 3(5) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.5-5 ShortOrbits[0m
  
  [1m[34m> ShortOrbits( [0m[22m[34mG, S, maxlng[0m[1m[34m ) _____________________________________[0moperation
  [1mReturns:[0m  A  list  of  all  finite  orbits  of  the  rcwa group[22m[34mG[0m of maximal
            length[22m[34mmaxlng[0m, which intersect non-trivially with the set[22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> A5 := IntegralRcwaGroupByPermGroup(AlternatingGroup(5));;[0m
    [22m[35mgap> ShortOrbits(A5,[-10..10],100);[0m
    [22m[35m[ [ -14, -13, -12, -11, -10 ], [ -9, -8, -7, -6, -5 ], [ -4, -3, -2, -1, 0 ], [0m
    [22m[35m  [ 1, 2, 3, 4, 5 ], [ 6, 7, 8, 9, 10 ] ][0m
    [22m[35mgap> Action(A5,last[2]);[0m
    [22m[35mGroup([ (1,2,3,4,5), (3,4,5) ])[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(Comm(a,b),Comm(a,c));;[0m
    [22m[35mgap> orb := ShortOrbits(G,[-15..15],100);[0m
    [22m[35m[ [ -15, -12, -7, -6, -5, -4, -3, -2, -1, 1 ], [0m
    [22m[35m  [ -33, -30, -24, -21, -16, -14, -13, -11, -10, -8 ], [ -9 ], [ 0 ], [0m
    [22m[35m  [ 2, 3, 4, 5, 6, 7, 8, 10, 12, 15 ], [ 9 ], [0m
    [22m[35m  [ 11, 13, 14, 16, 17, 19, 21, 24, 30, 33 ] ][0m
    [22m[35mgap> Action(G,orb[1]);[0m
    [22m[35mGroup([ (2,5,8,10,7,6), (1,3,6,9,4,5) ])[0m
    [22m[35mgap> ShortOrbits(Group(u),[-30..30],100);[0m
    [22m[35m[ [ -13, -8, -7, -5, -4, -3, -2 ], [ -10, -6 ], [ -1 ], [ 0 ], [ 1, 2 ], [0m
    [22m[35m  [ 3, 5 ], [ 24, 36, 39, 40, 44, 48, 60, 65, 67, 71, 80, 86, 93, 100, 112, [0m
    [22m[35m      128, 138, 155, 167, 187, 230, 248, 312, 446, 520, 803, 867, 1445 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.5-6 OrbitsModulo[0m
  
  [1m[34m> OrbitsModulo( [0m[22m[34mG, m[0m[1m[34m ) _______________________________________________[0mmethod
  [1mReturns:[0m  A  partition of [22m[32m[0..[22m[34mm[0m-1][0m, such that i and j lie in the same subset
            if  and  only if there is an element g of [22m[34mG[0m which moves an element
            from the residue class i(m) to the residue class j(m).
  
  The  argument  [22m[34mG[0m must be an rcwa group over Z. See also [1m[34mOrbitsModulo[0m ([1m2.8-2[0m)
  for rcwa mappings.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> OrbitsModulo(G,36);[0m
    [22m[35m[ [ 0 ], [ 1, 11, 13, 14, 16, 17, 19, 21, 24, 29, 30, 31, 32, 33, 34, 35 ], [0m
    [22m[35m  [ 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 20, 22, 23, 25, 26, 28 ], [ 9 ], [ 18 ], [0m
    [22m[35m  [ 27 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.6 Conjugacy in RCWA(R)[0m
  
  [1m[4m[31m3.6-1 IsConjugate[0m
  
  [1m[34m> IsConjugate( [0m[22m[34mRCWA_Z, f, g[0m[1m[34m ) ________________________________________[0mmethod
  [1mReturns:[0m  [22m[32mtrue[0m  if  the  bijective  rcwa  mappings  [22m[34mf[0m and[22m[34mg[0m are conjugate in
            RCWA(Z), and [22m[32mfalse[0m otherwise.
  
  This  may  fail  or run into an infinite loop. In particular the support for
  wild  rcwa mappings is currently very poor, since the author does not know a
  way  to  solve  the conjugacy problem for these. Some easy cases are handled
  anyway.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsConjugate(RCWA(Integers),g,h);[0m
    [22m[35mfalse[0m
    [22m[35mgap> IsConjugate(RCWA(Integers),g,g^a);[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsConjugate(RCWA(Integers),a,b);[0m
    [22m[35mfalse[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.6-2 RepresentativeAction[0m
  
  [1m[34m> RepresentativeAction( [0m[22m[34mRCWA_Z, f, g[0m[1m[34m ) _______________________________[0mmethod
  [1mReturns:[0m  An  rcwa mapping[22m[32mx[0m such that [22m[32m[22m[34mf[0m^x = [22m[34mg[0m[0m, if such an [22m[32mx[0m exists and [22m[32mfail[0m
            otherwise.
  
  This  method  currently  works  only  for tame rcwa mappings ofZ, since the
  author  does  not  know  a  way to solve the conjugacy problem for wild rcwa
  mappings.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> elm := RepresentativeAction(RCWA(Integers),h,h^g);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 24>[0m
    [22m[35mgap> h^elm = h^g; # check ...[0m
    [22m[35mtrue[0m
    [22m[35mgap> Order(elm);[0m
    [22m[35m10[0m
    [22m[35mgap> cent := g*elm^-1;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 24>[0m
    [22m[35mgap> Comm(cent,h); # cent must lie in the centralizer of h in RCWA(Z)[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35mgap> Order(cent);[0m
    [22m[35m12[0m
    [22m[35mgap> Display(cent);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 24, of order 12[0m
    [22m[35m[0m
    [22m[35m               n mod 24                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  4 10 12 16 22                    | n - 1[0m
    [22m[35m   1 13                                | 2n[0m
    [22m[35m   2                                   | (n - 2)/2[0m
    [22m[35m   3  9 15 21                          | 2n + 2[0m
    [22m[35m   5  6  7 14 17 18 19                 | n[0m
    [22m[35m   8 20                                | n/2[0m
    [22m[35m  11 23                                | n + 2[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.6-3 ShortCycles[0m
  
  [1m[34m> ShortCycles( [0m[22m[34mf, maxlng[0m[1m[34m ) ________________________________________[0moperation
  [1mReturns:[0m  All "single" finite cycles of the rcwa mapping[22m[34mf[0m of length at most
            [22m[34mmaxlng[0m.
  
  In  this  context, "single" finite cycles are finite cycles not belonging to
  an  infinite  series,  i.e.  there  is  no  constant  m such that adding any
  multiple of m to the elements of the cycle always yields a new cycle.
  
  Since  [1mGAP[0m-permutations  cannot  move  negative  integers, rationals or even
  polynomials,  the  cycles  are  returned  as  lists.  For  example, the list
  [22m[32m[-3,1,2,-2][0m denotes the cycle [22m[32m(-3,1,2,-2)[0m. Mappings having different sets of
  finite cycle lengths are obviously not conjugate in RCWA(R).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> ShortCycles(a,5);[0m
    [22m[35m[ [ 0 ], [ 1 ], [ -1 ], [ 2, 3 ], [ -3, -2 ], [ 4, 6, 9, 7, 5 ], [0m
    [22m[35m  [ -9, -7, -5, -4, -6 ] ][0m
    [22m[35mgap> ShortCycles(u,2);[0m
    [22m[35m[ [ 0 ], [ -1 ], [ 1, 2 ], [ 3, 5 ], [ -10, -6 ] ][0m
    [22m[35mgap> ShortCycles(Comm(a,b),10);[0m
    [22m[35m[  ][0m
    [22m[35mgap> ShortCycles(a*b,2);[0m
    [22m[35m[ [ 0 ], [ 2 ], [ 3 ], [ -26 ], [ 7 ], [ -3 ], [ -1 ] ][0m
    [22m[35mgap> v := RcwaMapping([[-1,2,1],[1,-1,1],[1,-1,1]]);;[0m
    [22m[35mgap> w := RcwaMapping([[-1,3,1],[1,-1,1],[1,-1,1],[1,-1,1]]);;[0m
    [22m[35mgap> List( [ v, w ], Order );[0m
    [22m[35m[ 6, 8 ][0m
    [22m[35mgap> [ ShortCycles(v,10), ShortCycles(w,10) ];[0m
    [22m[35m[ [ [ 0, 2, 1 ] ], [ [ 0, 3, 2, 1 ] ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.6-4 NrConjugacyClassesOfRCWAZOfOrder[0m
  
  [1m[34m> NrConjugacyClassesOfRCWAZOfOrder( [0m[22m[34mord[0m[1m[34m ) __________________________[0mfunction
  [1mReturns:[0m  The  number  of  conjugacy  classes  of  RCWA(Z)  of  elements  of
            order[22m[34mord[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> NrConjugacyClassesOfRCWAZOfOrder(2);[0m
    [22m[35minfinity[0m
    [22m[35mgap> NrConjugacyClassesOfRCWAZOfOrder(105);[0m
    [22m[35m218[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.7 Restriction and induction[0m
  
  [1m[4m[31m3.7-1 Restriction[0m
  
  [1m[34m> Restriction( [0m[22m[34mg, f[0m[1m[34m ) _____________________________________________[0moperation
  [1mReturns:[0m  The  [22m[36mrestriction[0m  of  the  rcwa  mapping  [22m[34mg[0m  by the injective rcwa
            mapping[22m[34mf[0m.
  
  By  definition,  the  restriction g_f of the rcwa mapping [22m[34mg[0m by the injective
  rcwa  mapping[22m[34mf[0m  is the uniquely determined rcwa mapping which satisfies f *
  g_f  =  g  * f and fixes the complement of the image of [22m[34mf[0m pointwise. If [22m[34mf[0m is
  bijective,  the  restriction  of [22m[34mg[0m by [22m[34mf[0m is just the conjugate of [22m[34mg[0m by [22m[34mf[0m. See
  also [1m[34mRestriction[0m ([1m3.7-2[0m) for rcwa groups.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Comm(Restriction(a,RcwaMapping([[2,0,1]])),[0m
    [22m[35m>         Restriction(u,RcwaMapping([[2,1,1]])));[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.7-2 Restriction[0m
  
  [1m[34m> Restriction( [0m[22m[34mG, f[0m[1m[34m ) _____________________________________________[0moperation
  [1mReturns:[0m  The  [22m[36mrestriction[0m  of  the  rcwa  group  [22m[34mG[0m  by  the  injective rcwa
            mapping[22m[34mf[0m.
  
  By  definition,  the  restriction  of the rcwa group [22m[34mG[0m by the injective rcwa
  mapping[22m[34mf[0m consists of the restrictions of its elements by[22m[34mf[0m. The restriction
  of [22m[34mG[0m by [22m[34mf[0m acts on the image of [22m[34mf[0m and fixes its complement pointwise.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Restriction(Group(a,b),RcwaMapping([[5,3,1]]));[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> MovedPoints(G);[0m
    [22m[35m3(5) \ [ -2, 3 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.7-3 Induction[0m
  
  [1m[34m> Induction( [0m[22m[34mg, f[0m[1m[34m ) _______________________________________________[0moperation
  [1m[34m> Induction( [0m[22m[34mG, f[0m[1m[34m ) _______________________________________________[0moperation
  [1mReturns:[0m  The  [22m[36minduction[0m of the rcwa mapping [22m[34mg[0m resp. the rcwa group [22m[34mG[0m by the
            injective rcwa mapping[22m[34mf[0m.
  
  By  definition,  induction  is  the right inverse of restriction. This means
  that    we    always   have   [22m[32mInduction(Restriction([22m[34mg[0m,[22m[34mf[0m),[22m[34mf[0m)   =   [22m[34mg[0m[0m,   resp.
  [22m[32mInduction(Restriction([22m[34mG[0m,[22m[34mf[0m),[22m[34mf[0m)  = [22m[34mG[0m[0m. The mapping [22m[34mg[0m resp. the group [22m[34mG[0m must not
  move points outside the image of[22m[34mf[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Induction(G,RcwaMapping([[5,3,1]])) = Group(a,b);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Restriction  monomorphisms permit forming direct products of any rcwa groups
  (regardless of whether they are tame or not):
  
  [1m[4m[31m3.7-4 DirectProduct[0m
  
  [1m[34m> DirectProduct( [0m[22m[34mG1, G2, ...[0m[1m[34m ) ____________________________________[0moperation
  [1mReturns:[0m  The direct product of the rcwa groups overZ given as arguments.
  
  As  there  is  no  unique or canonical way to embed a direct product of rcwa
  groups into RCWA(Z), this method may choose any such embedding.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := DirectProduct(Group(g,h),Group(a,b),Group(u));;[0m
    [22m[35mgap> Embedding(G,1);[0m
    [22m[35m[ g, h ] -> [ <bijective rcwa mapping of Z with modulus 18, of order 7>, [0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 18, of order 12> ][0m
    [22m[35mgap> List([1..3],i->MovedPoints(Image(Embedding(G,i))));[0m
    [22m[35m[ 0(3), 1(3) \ [ -2, 1 ], 2(3) \ [ -1, 2 ] ][0m
    [22m[35mgap> Image(Projection(G,2)) = Group(a,b);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.8 Special attributes for tame rcwa groups[0m
  
  There is a couple of attributes which a priori make only sense for tame rcwa
  groups. In the sequel, these attributes are described in detail.
  
  With  their  help,  various  structural  information about a given tame rcwa
  group  can  be  obtained.  For example, there are methods for [22m[32mIsSolvable[0m and
  [22m[32mIsPerfect[0m  available for tame rcwa groups (the latter works in some cases by
  other  means also for wild groups). Often it is also feasible to compute the
  derived subgroup of a tame rcwa group.
  
  [1m[4m[31m3.8-1 RespectedPartition[0m
  
  [1m[34m> RespectedPartition( [0m[22m[34mG[0m[1m[34m ) _________________________________________[0mattribute
  [1m[34m> RespectedPartition( [0m[22m[34msigma[0m[1m[34m ) _____________________________________[0mattribute
  [1mReturns:[0m  A [22m[36mrespected partition[0m of [22m[34mG[0m resp. [22m[34msigma[0m.
  
  This  is  a  partition  of  the  base ringR into a finite number of residue
  classes  which the group[22m[34mG[0m resp. the permutation [22m[34msigma[0m acts on, and on those
  elements all elements of[22m[34mG[0m resp. the group generated by [22m[34msigma[0m are affine.
  
  In  the author's thesis it is shown that such a partition exists if and only
  if [22m[34mG[0m resp. [22m[34msigma[0m is tame (see Theorem2.5.8).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(g,h);;[0m
    [22m[35mgap> Size(G);[0m
    [22m[35minfinity[0m
    [22m[35mgap> P := RespectedPartition(G);[0m
    [22m[35m[ 0(12), 1(12), 3(12), 4(12), 5(12), 6(12), 7(12), 9(12), 10(12), 11(12), [0m
    [22m[35m  2(24), 8(24), 14(24), 20(24) ][0m
    [22m[35mgap> Permutation(g,P);[0m
    [22m[35m(1,11,2,5,3,12,4)(6,13,7,10,8,14,9)[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.8-2 ActionOnRespectedPartition[0m
  
  [1m[34m> ActionOnRespectedPartition( [0m[22m[34mG[0m[1m[34m ) _________________________________[0mattribute
  [1mReturns:[0m  The action of the tame rcwa group[22m[34mG[0m on [22m[32mRespectedPartition([22m[34mG[0m)[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> H := ActionOnRespectedPartition(G);[0m
    [22m[35mGroup([ (1,11,2,5,3,12,4)(6,13,7,10,8,14,9), (1,11,2,10)(3,12,4)(5,6,13,7)(8,[0m
    [22m[35m    14,9) ])[0m
    [22m[35mgap> H = Action(G,P);[0m
    [22m[35mtrue[0m
    [22m[35mgap> [ Size(H), Size(DerivedSubgroup(H)), IsPerfect(DerivedSubgroup(H)) ];[0m
    [22m[35m[ 322560, 161280, true ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.8-3 IntegralConjugate[0m
  
  [1m[34m> IntegralConjugate( [0m[22m[34mG[0m[1m[34m ) __________________________________________[0mattribute
  [1m[34m> IntegralConjugate( [0m[22m[34mf[0m[1m[34m ) __________________________________________[0mattribute
  [1mReturns:[0m  Some integral conjugate of the tame rcwa group[22m[34mG[0m resp. of the tame
            bijective rcwa mapping[22m[34mf[0m in the group RCWA(Z).
  
  In  the  author's  thesis it is shown that such a representative exists (see
  Theorem2.5.14).  Since  there is usually not only one such mapping, methods
  for this operation will just choose one of them.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Print(LaTeXObj(IntegralConjugate(g)));[0m
    [22m[35mn \ \longmapsto \[0m
    [22m[35m\begin{cases}[0m
    [22m[35m  n + 10 & \text{if} \ n \in 0(14), \\[0m
    [22m[35m  n + 3  & \text{if} \ n \in 1(14) \cup 6(14), \\[0m
    [22m[35m  n + 9  & \text{if} \ n \in 2(14), \\[0m
    [22m[35m  n - 3  & \text{if} \ n \in 3(14) \cup 8(14), \\[0m
    [22m[35m  n - 2  & \text{if} \ n \in 4(14) \cup 9(14), \\[0m
    [22m[35m  n + 7  & \text{if} \ n \in 5(14), \\[0m
    [22m[35m  n + 6  & \text{if} \ n \in 7(14), \\[0m
    [22m[35m  n - 9  & \text{if} \ n \in 10(14), \\[0m
    [22m[35m  n - 8  & \text{if} \ n \in 11(14), \\[0m
    [22m[35m  n - 6  & \text{if} \ n \in 12(14), \\[0m
    [22m[35m  n - 5  & \text{if} \ n \in 13(14).[0m
    [22m[35m\end{cases}[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.8-4 IntegralizingConjugator[0m
  
  [1m[34m> IntegralizingConjugator( [0m[22m[34mG[0m[1m[34m ) ____________________________________[0mattribute
  [1m[34m> IntegralizingConjugator( [0m[22m[34mf[0m[1m[34m ) ____________________________________[0mattribute
  [1mReturns:[0m  An rcwa mapping mapping[22m[34mx[0m such that [22m[34mG[0m^[22m[34mx[0m resp. [22m[34mf[0m^[22m[34mx[0m is integral.
  
  This   is   of   course   not   defined   uniquely,   but   it   holds  that
  [22m[32m[22m[34mG[0m^IntegralizingConjugator([22m[34mG[0m)        =       IntegralConjugate([22m[34mG[0m)[0m       resp.
  [22m[32m[22m[34mf[0m^IntegralizingConjugator([22m[34mf[0m) = IntegralConjugate([22m[34mf[0m)[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Print(LaTeXObj(IntegralizingConjugator(g)));[0m
    [22m[35mn \ \longmapsto \[0m
    [22m[35m\begin{cases}[0m
    [22m[35m  \frac{7n}{6}        & \text{if} \ n \in 0(12), \\[0m
    [22m[35m  \frac{7n - 1}{6}    & \text{if} \ n \in 1(12), \\[0m
    [22m[35m  \frac{7n + 106}{12} & \text{if} \ n \in 2(24), \\[0m
    [22m[35m  \frac{7n - 9}{6}    & \text{if} \ n \in 3(12), \\[0m
    [22m[35m  \frac{7n - 10}{6}   & \text{if} \ n \in 4(12), \\[0m
    [22m[35m  \frac{7n - 11}{6}   & \text{if} \ n \in 5(12), \\[0m
    [22m[35m  \frac{7n - 12}{6}   & \text{if} \ n \in 6(12), \\[0m
    [22m[35m  \frac{7n - 13}{6}   & \text{if} \ n \in 7(12), \\[0m
    [22m[35m  \frac{7n + 76}{12}  & \text{if} \ n \in 8(24), \\[0m
    [22m[35m  \frac{7n - 21}{6}   & \text{if} \ n \in 9(12), \\[0m
    [22m[35m  \frac{7n - 22}{6}   & \text{if} \ n \in 10(12), \\[0m
    [22m[35m  \frac{7n - 23}{6}   & \text{if} \ n \in 11(12), \\[0m
    [22m[35m  \frac{7n + 46}{12}  & \text{if} \ n \in 14(24), \\[0m
    [22m[35m  \frac{7n + 16}{12}  & \text{if} \ n \in 20(24).[0m
    [22m[35m\end{cases}[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.9 The categories and families of rcwa groups[0m
  
  [1m[4m[31m3.9-1 IsRcwaGroup[0m
  
  [1m[34m> IsRcwaGroup( [0m[22m[34mG[0m[1m[34m ) ___________________________________________________[0mfilter
  [1m[34m> IsIntegralRcwaGroup( [0m[22m[34mG[0m[1m[34m ) ___________________________________________[0mfilter
  [1m[34m> IsSemilocalIntegralRcwaGroup( [0m[22m[34mG[0m[1m[34m ) __________________________________[0mfilter
  [1m[34m> IsModularRcwaGroup( [0m[22m[34mG[0m[1m[34m ) ____________________________________________[0mfilter
  [1mReturns:[0m  [22m[32mtrue[0m  if  [22m[34mG[0m  is an rcwa group resp. an rcwa group over the ring of
            integers  resp.  an rcwa group over a semilocalization of the ring
            of  integers  resp.  an  rcwa  group over a polynomial ring in one
            variable over a finite field, and [22m[32mfalse[0m otherwise.
  
  [1m[4m[31m3.9-2 IntegralRcwaGroupsFamily[0m
  
  [1m[34m> IntegralRcwaGroupsFamily____________________________________________[0mfamily
  
  The family of all rcwa groups over the ring of integers.
  
