  
  [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, cp. the [1mGAP[0m reference
  manual.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassTransposition(0,2,1,4),ClassShift(0,5));[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> IsTame(G); Size(G); IsSolvable(G); IsPerfect(G);[0m
    [22m[35mtrue[0m
    [22m[35minfinity[0m
    [22m[35mfalse[0m
    [22m[35mfalse[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  There  are  methods for the operations [22m[32mView[0m, [22m[32mDisplay[0m, [22m[32mPrint[0m and [22m[32mString[0m which
  are  applicable  to rcwa groups. All rcwa groups over a ring R are subgroups
  of  RCWA(R). The group RCWA(R) itself is not finitely generated, thus cannot
  be constructed in the way 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 residue class-wise affine permutations 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[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> One(RCWA_Z); Size(RCWA_Z); IsFinitelyGeneratedGroup(RCWA_Z);[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35minfinity[0m
    [22m[35mfalse[0m
    [22m[35mgap> IsSolvable(RCWA_Z) or 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,G);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  There  is  a  method  for the operation [22m[32mRandom[0m which generates pseudo-random
  elements of RCWA(Z) -- see Section[1m3.10[0m.
  
  Another  way  of  constructing  an rcwa group is taking the image of an rcwa
  representation:
  
  [1m[4m[31m3.1-2 IsomorphismRcwaGroupOverZ[0m
  
  [1m[34m> IsomorphismRcwaGroupOverZ( [0m[22m[34mG[0m[1m[34m ) __________________________________[0mattribute
  [1m[34m> IsomorphismRcwaGroup( [0m[22m[34mG[0m[1m[34m ) _______________________________________[0mattribute
  [1mReturns:[0m  A monomorphism from the group [22m[34mG[0m toRCWA(Z).
  
  Currently  there  are methods available for finite groups, for free products
  of finite groups and for free groups. The method for free products of finite
  groups  uses  the  Table-Tennis Lemma (cp. e.g. SectionII.B. in[H00]), and
  the  method  for free groups uses an adaptation of the construction given on
  page27 in[H00] from PSL(2,C) to RCWA(Z).
  
  In  case  [22m[34mG[0m is a finite-degree permutation group, the image under a specific
  embedding  can be obtained by [22m[32mRcwaGroupByPermGroup([22m[34mG[0m)[0m. The resulting group[22m[32mH[0m
  satisfies  the  relation [22m[32mAction(H^ClassShift(0,1),[1..LargestMovedPoint([22m[34mG[0m)])
  =G[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> F := FreeProduct(Group((1,2)(3,4),(1,3)(2,4)),Group((1,2,3)),[0m
    [22m[35m>                     SymmetricGroup(3));[0m
    [22m[35m<fp group on the generators [ f1, f2, f3, f4, f5 ]>[0m
    [22m[35mgap> IsomorphismRcwaGroup(F);[0m
    [22m[35m[ f1, f2, f3, f4, f5 ] -> [ <bijective rcwa mapping of Z with modulus 12>,[0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 24>,[0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 12>,[0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 72>,[0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 36> ][0m
    [22m[35mgap> IsomorphismRcwaGroup(FreeGroup(2));[0m
    [22m[35m[ f1, f2 ] -> [ <wild bijective rcwa mapping of Z with modulus 8>,[0m
    [22m[35m  <wild bijective rcwa mapping of Z with modulus 8> ][0m
    [22m[35mgap> F2 := Image(last);[0m
    [22m[35m<wild rcwa group over Z with 2 generators>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.1-3 StructureDescription[0m
  
  [1m[34m> StructureDescription( [0m[22m[34mG[0m[1m[34m ) __________________________________________[0mmethod
  [1mReturns:[0m  A string which describes the structure of the rcwa group[22m[34mG[0m to some
            extent.
  
  The  attribute  [22m[32mStructureDescription[0m  for finite groups is documented in the
  [1mGAP[0m  Reference  Manual.  Therefore  we  describe  here only issues which are
  specific to infinite groups, and in particular to rcwa groups.
  
  Wreath  products  are denoted by[22m[32mwr[0m, and free products are denoted by[22m[32m*[0m. The
  infinite  cyclic group (Z,+) is denoted by[22m[32mZ[0m, the infinite dihedral group is
  denoted  by[22m[32mD0[0m  and  free  groups  of rank 2,3,4,dots are denoted by[22m[32mF2[0m, [22m[32mF3[0m,
  [22m[32mF4[0m,dots. While for finite groups the symbol[22m[32m.[0m is used to denote a non-split
  extension,  for  rcwa groups in general it stands for an extension which may
  be  split  or  not. For wild groups in most cases it happens that there is a
  large  section  on  which  no  structural  information can be obtained. Such
  sections  of  the  group with unknown structure are denoted by [22m[32m<unknown>[0m. In
  general,  the  structure  of  a  section  denoted  by  [22m[32m<unknown>[0m can be very
  complicate and very difficult to exhibit. While for isomorphic finite groups
  always the same structure description is computed, this cannot be guaranteed
  for isomorphic rcwa groups.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassTransposition(0,2,1,4),ClassShift(0,5));;[0m
    [22m[35mgap> StructureDescription(G);[0m
    [22m[35m"(Z x Z x Z x Z x Z x Z x Z) . (C2 x S7)"[0m
    [22m[35mgap> G := Group(ClassTransposition(0,2,1,4),[0m
    [22m[35m>               ClassShift(2,4),ClassReflection(1,2));;[0m
    [22m[35mgap> StructureDescription(G:short);[0m
    [22m[35m"Z^2.((S3xS3):2)"[0m
    [22m[35mgap> F2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;[0m
    [22m[35mgap> PSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(3),[0m
    [22m[35m>                                                    CyclicGroup(2))));;[0m
    [22m[35mgap> G := DirectProduct(PSL2Z,F2);[0m
    [22m[35m<wild rcwa group over Z with 4 generators>[0m
    [22m[35mgap> StructureDescription(G);[0m
    [22m[35m"(C3 * C2) x F2"[0m
    [22m[35mgap> G := WreathProduct(G,CyclicGroup(IsRcwaGroupOverZ,infinity));[0m
    [22m[35m<wild rcwa group over Z with 5 generators>[0m
    [22m[35mgap> StructureDescription(G);[0m
    [22m[35m"((C3 * C2) x F2) wr Z"[0m
    [22m[35mgap> Collatz := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);;[0m
    [22m[35mgap> G := Group(Collatz,ClassShift(0,1));;[0m
    [22m[35mgap> StructureDescription(G:short);[0m
    [22m[35m"<unknown>.Z"[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.2 Direct products and wreath products[0m
  
  The  class  of  groups which can faithfully be represented as rcwa groups is
  closed under forming direct products, wreath products with finite groups and
  wreath products with the infinite cyclic group (Z,+). For information on how
  direct  products and wreath products of subgroups of RCWA(Z) are embedded in
  RCWA(Z), see Section[1m3.9[0m below.
  
  [1m[4m[31m3.2-1 DirectProduct[0m
  
  [1m[34m> DirectProduct( [0m[22m[34mG1, G2, ...[0m[1m[34m ) _______________________________________[0mmethod
  [1mReturns:[0m  An  rcwa group isomorphic to the direct product of the rcwa groups
            overZ given as arguments.
  
  There  is  certainly no unique or canonical way to embed a direct product of
  rcwa  groups  into  RCWA(Z). This method chooses to embed the groups [22m[34mG1[0m, [22m[34mG2[0m,
  [22m[34mG3[0m... via restrictions by n -> mn, n -> mn+1, n -> mn+2... (->[1m[34mRestriction[0m
  ([1m3.9-1[0m)), where m denotes the number of groups given as arguments.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> F2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;[0m
    [22m[35mgap> F2xF2 := DirectProduct(F2,F2);[0m
    [22m[35m<wild rcwa group over Z with 4 generators>[0m
    [22m[35mgap> Image(Projection(F2xF2,1)) = F2;[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.2-2 WreathProduct[0m
  
  [1m[34m> WreathProduct( [0m[22m[34mG, P[0m[1m[34m ) ______________________________________________[0mmethod
  [1m[34m> WreathProduct( [0m[22m[34mG, Z[0m[1m[34m ) ______________________________________________[0mmethod
  [1mReturns:[0m  An rcwa group isomorphic to the wreath product of the rcwa group[22m[34mG[0m
            overZ  with  the  finite  permutation  group[22m[34mP[0m,  resp.  with  the
            infinite cyclic group[22m[34mZ[0m.
  
  The  first-mentioned  method  embeds the [22m[32mDegreeAction([22m[34mP[0m)[0mth direct power of[22m[34mG[0m
  using  the  method  for  [22m[32mDirectProduct[0m, and lets the permutation group[22m[34mP[0m act
  naturally  on  the  set  of  residue  classes  modulo  [22m[32mDegreeAction([22m[34mP[0m)[0m.  The
  second-mentioned  method  restricts  (->[1m[34mRestriction[0m ([1m3.9-1[0m)) the group[22m[34mG[0m to
  the  residue  class3(4),  and  maps  the  generator  of the infinite cyclic
  group[22m[34mZ[0m to [22m[32mClassTransposition(0,2,1,2) * ClassTransposition(0,2,1,4)[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> F2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;[0m
    [22m[35mgap> F2wrA5 := WreathProduct(F2,AlternatingGroup(5));;[0m
    [22m[35mgap> Embedding(F2wrA5,1);[0m
    [22m[35m[ <wild bijective rcwa mapping of Z with modulus 8>,[0m
    [22m[35m  <wild bijective rcwa mapping of Z with modulus 8> ] ->[0m
    [22m[35m[ <wild bijective rcwa mapping of Z with modulus 40>,[0m
    [22m[35m  <wild bijective rcwa mapping of Z with modulus 40> ][0m
    [22m[35mgap> Embedding(F2wrA5,2);[0m
    [22m[35m[ (1,2,3,4,5), (3,4,5) ] ->[0m
    [22m[35m[ <bijective rcwa mapping of Z with modulus 5, of order 5>,[0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 5, of order 3> ][0m
    [22m[35mgap> ZwrZ := WreathProduct(Group(ClassShift(0,1)),Group(ClassShift(0,1)));[0m
    [22m[35m<wild rcwa group over Z with 2 generators>[0m
    [22m[35mgap> Embedding(ZwrZ,1);[0m
    [22m[35m[ ClassShift(0,1) ] ->[0m
    [22m[35m[ <tame bijective rcwa mapping of Z with modulus 4, of order infinity> ][0m
    [22m[35mgap> Embedding(ZwrZ,2);[0m
    [22m[35m[ ClassShift(0,1) ] -> [ <wild bijective rcwa mapping of Z with modulus 4> ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.3 The membership test[0m
  
  There  is  a  method for the operation [22m[32min[0m. Given an rcwa group[22m[32mG[0m and an rcwa
  mapping[22m[32mg[0m,  this method tries to decide whether [22m[32mg[0m is an element of[22m[32mG[0m or not.
  It  can  always  decide  this question if [22m[32mG[0m is tame. For wild groups this is
  sometimes  not  the  case.  On  Info  level2  of  [22m[32mInfoRCWA[0m the method gives
  information on reasons why [22m[32mg[0m is an element of[22m[32mG[0m ornot.
  
  The  direct  product  of  two  free  groups  of  rank2  can  faithfully  be
  represented  as  an  rcwa  group.  According  to[M58]  this implies that in
  general   the   membership   problem  for  rcwa  groups  is  algorithmically
  undecidable.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassShift(0,3),ClassTransposition(0,3,2,6));;[0m
    [22m[35mgap> ClassShift(2,6)^7*ClassTransposition(0,3,2,6)*ClassShift(0,3)^-3 in G;[0m
    [22m[35mtrue[0m
    [22m[35mgap> ClassShift(0,1) in G;[0m
    [22m[35mfalse[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.4 Basic attributes and properties of rcwa groups[0m
  
  There  is a method available for the operation [22m[32mSize[0m. An rcwa group is finite
  if  and  only  if  it  is tame and its action on a suitably chosen respected
  partition  (see[1m[34mRespectedPartition[0m  ([1m3.11-1[0m)) is faithful. Hence the problem
  of  computing  the order of an rcwa group reduces to the problem of deciding
  whether  it is tame, the problem of deciding whether it acts faithfully on a
  respected  partition  and  the  problem of computing the order of the finite
  permutation  group  induced  on  the  respected  partition. Basic attributes
  derived  from  the  affine partial mappings of the elements of an rcwa group
  and  their  coefficients  are [22m[32mModulus[0m, [22m[32mMultiplier[0m, [22m[32mDivisor[0m and [22m[32mPrimeSet[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. The [22m[36mmultiplier[0m resp. [22m[36mdivisor[0m of an rcwa
  group  is  the lcm of the multipliers resp. divisors of its elements in case
  such  an  lcm  exists and infty otherwise. The [22m[36mprime set[0m of an rcwa group is
  the  union of the prime sets of its elements. There are shorthands [22m[32mMod[0m, [22m[32mMult[0m
  and  [22m[32mDiv[0m  defined  for  [22m[32mModulus[0m,  [22m[32mMultiplier[0m resp. [22m[32mDivisor[0m. Technically, the
  modulus of an rcwa group is stored as an attribute [22m[32mModulusOfRcwaGroup[0m.
  
  A tame rcwa group, i.e. one with modulus0, has the property [22m[32mIsTame[0m. An rcwa
  group  is  called  [22m[36mintegral[0m  resp. [22m[36mclass-wise order-preserving[0m if all of its
  elements  are  so.  There are corresponding methods available for [22m[32mIsIntegral[0m
  and [22m[32mIsClassWiseOrderPreserving[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> g1 := RcwaMapping((1,2),[1..2]);;[0m
    [22m[35mgap> g2 := RcwaMapping((1,2,3),[1..3]);;[0m
    [22m[35mgap> g3 := RcwaMapping((1,2,3,4,5),[1..5]);;[0m
    [22m[35mgap> List([g1,g2,g3],Modulus);[0m
    [22m[35m[ 2, 3, 5 ][0m
    [22m[35mgap> G := Group(g1,g2,g3);;[0m
    [22m[35mgap> Size(G);[0m
    [22m[35m265252859812191058636308480000000[0m
    [22m[35mgap> List([Modulus,Multiplier,Divisor,PrimeSet,[0m
    [22m[35m>          IsIntegral,IsClassWiseOrderPreserving],f->f(G));[0m
    [22m[35m[ 30, 1, 1, [ 2, 3, 5 ], true, true ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.5 Permutation- and matrix representations[0m
  
  [1m[4m[31m3.5-1 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 a finite-degree
            permutation group.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsomorphismPermGroup(Group(ClassTransposition(0,2,1,2),[0m
    [22m[35m>                               ClassTransposition(0,3,1,3)));[0m
    [22m[35m[ ClassTransposition(0,2,1,2), ClassTransposition(0,3,1,3) ] -> [0m
    [22m[35m[ (1,2)(3,4)(5,6), (1,2)(4,5) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.5-2 IsomorphismMatrixGroup[0m
  
  [1m[34m> IsomorphismMatrixGroup( [0m[22m[34mG[0m[1m[34m ) _____________________________________[0mattribute
  [1mReturns:[0m  An  isomorphism  from the rcwa group[22m[34mG[0m to a matrix group, provided
            that  [22m[34mG[0m  embeds  into  a matrix group and that there is a suitable
            method available. Both conditions are fulfilled if [22m[34mG[0m is tame.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassTransposition(0,2,1,4),ClassShift(2,4));[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[35m10[0m
    [22m[35mgap> Display(GeneratorsOfGroup(Image(phi))[1]*One(GF(5)));[0m
    [22m[35m . . . . . . 3 2 . .[0m
    [22m[35m . . . . . . . 1 . .[0m
    [22m[35m . . . . . . . . 3 2[0m
    [22m[35m . . . . . . . . . 1[0m
    [22m[35m . . . . 1 . . . . .[0m
    [22m[35m . . . . . 1 . . . .[0m
    [22m[35m 2 1 . . . . . . . .[0m
    [22m[35m . 1 . . . . . . . .[0m
    [22m[35m . . 2 1 . . . . . .[0m
    [22m[35m . . . 1 . . . . . .[0m
    [22m[35mgap> Display(GeneratorsOfGroup(Image(phi))[2]*One(GF(5)));[0m
    [22m[35m 1 . . . . . . . . .[0m
    [22m[35m . 1 . . . . . . . .[0m
    [22m[35m . . 1 4 . . . . . .[0m
    [22m[35m . . . 1 . . . . . .[0m
    [22m[35m . . . . 1 . . . . .[0m
    [22m[35m . . . . . 1 . . . .[0m
    [22m[35m . . . . . . 1 . . .[0m
    [22m[35m . . . . . . . 1 . .[0m
    [22m[35m . . . . . . . . 1 .[0m
    [22m[35m . . . . . . . . . 1[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.6 Factoring elements into generators[0m
  
  [1m[4m[31m3.6-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.  It  can also be used for finding nontrivial 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 already
  known. 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.7-3[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> a  := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; # Collatz' permutation.[0m
    [22m[35mgap> nu := RcwaMapping([[1,1,1]]);;                  # n -> n + 1.[0m
    [22m[35mgap> SetName(nu,"nu"); SetName(a,"a"); # For displaying purposes.[0m
    [22m[35mgap> G  := Group(a,nu);[0m
    [22m[35m<rcwa group over Z with 2 generators>[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^2*F.2^4,F.1*F.2^3);[0m
    [22m[35mnu^-4*a^-2*nu^-3*a*nu^4*a*nu^3[0m
    [22m[35mgap> g := w^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 8>[0m
    [22m[35mgap> pre := PreImagesRepresentative(phi,g);[0m
    [22m[35mnu^-4*a^-1*nu^-1*a^-1*nu^3*a*nu^-1*a*nu^3[0m
    [22m[35mgap> rel := w/pre; # pre <> w --> We have a nontrivial relation![0m
    [22m[35mnu^-4*a^-2*nu^-3*a*nu^5*a^-1*nu^-3*a*nu*a*nu^4[0m
    [22m[35mgap> rel := rel^(F.2^-4*F.1^-1); # Cyclically reduced form.[0m
    [22m[35ma^-1*nu^-3*a*nu^5*a^-1*nu^-3*a*nu[0m
    [22m[35mgap> rel^phi;[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.6-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.6-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> w := Comm(F.1*F.2,Comm(F.1,F.2^2)); # We continue the example above.[0m
    [22m[35mnu^-1*a^-1*nu^-2*a^-1*nu^2*a^2*nu*a^-1*nu^-2*a*nu^2[0m
    [22m[35mgap> g := w^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 16>[0m
    [22m[35mgap> pre := PreImagesRepresentatives(phi,g);[0m
    [22m[35m[ nu^-1*a^-2*nu^-2*a*nu^2*a*nu^-1*a^-1*nu^2*a,[0m
    [22m[35m  nu^-1*a^-1*nu^-2*a^-1*nu^2*a^2*nu^-1*a^-1*nu^2*a ][0m
    [22m[35mgap> rel := pre[1]/pre[2];[0m
    [22m[35mnu^-1*a^-2*nu^-2*a*nu^2*a^-1*nu^-2*a*nu^2*a*nu[0m
    [22m[35mgap> rel := (rel^(F.2^-1*F.1^-1))^-1; # Cyclically reduced form.[0m
    [22m[35mnu^-2*a^-1*nu^2*a*nu^-2*a^-1*nu^2*a[0m
    [22m[35mgap> rel^phi;[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.7 The action of an rcwa group on the underlying ring[0m
  
  The support, i.e. set of moved points, of an rcwa group can be determined by
  [22m[32mSupport[0m   or   [22m[32mMovedPoints[0m  (these  are  synonyms).  Sometimes  testing  for
  transitivity  on  the underlying ring is feasible. This is e.g. the case for
  tame groups overZ. Further 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.7-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.
  
  If [22m[34mG[0m is wild, this may fail or run into an infinite loop.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassTransposition(1,2,0,4),ClassShift(0,2));;[0m
    [22m[35mgap> IsTransitive(G,Integers);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.7-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 to decide 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 method is based on [1m[34mRepresentativeActionPreImage[0m ([1m3.7-3[0m), and it
  basically  just  computes  an  image  under an epimorphism. 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> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; # Collatz' permutation.[0m
    [22m[35mgap> G := Group(a,ClassShift(1,4));[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> 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.7-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  word in
            generators.
  
  The  argument  [22m[34mF[0m is a free group whose generators are used as letters of the
  returned  word.  Note  that the dependency is just in the opposite direction
  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.  For  this  reason,
  [22m[32mRepresentativeActionPreImage[0m     is     sometimes     much    faster    than
  [22m[32mRepresentativeAction[0m.  The  used  algorithm  is  based on computing balls of
  increasing  radius around [22m[34msrc[0m and [22m[34mdest[0m until they intersect nontrivially. It
  avoids  multiplying rcwa mappings. Of course the other warnings given in the
  description of [1m[34mRepresentativeAction[0m ([1m3.7-2[0m) apply to this operation as well.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> g := ClassTransposition(0,2,1,2)*ClassShift(0,3);;      SetName(g,"g");[0m
    [22m[35mgap> h := ClassTransposition(3,4,4,6)*ClassReflection(0,4);; SetName(h,"h");[0m
    [22m[35mgap> G := Group(g,h);;[0m
    [22m[35mgap> F := FreeGroup("g","h");; phi := EpimorphismByGenerators(F,G);;[0m
    [22m[35mgap> w1 := RepresentativeActionPreImage(G,[1,2,3,4],[2,3,5,7],OnPoints,F);[0m
    [22m[35mh^-1*g^3*h^-1*g^-1*h^-2[0m
    [22m[35mgap> elm1 := w1^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 864>[0m
    [22m[35mgap> List([1,2,3,4],n->n^elm1); # `OnPoints' permits reordering[0m
    [22m[35m[ 2, 7, 3, 5 ][0m
    [22m[35mgap> w2 := RepresentativeActionPreImage(G,[1,2,3,4],[2,3,5,7],OnTuples,F);[0m
    [22m[35mg*h^-1*g^-1*h^-1*g^-2*h*g^-2*h^2*g^-1*h*g[0m
    [22m[35mgap> elm2 := w2^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 432>[0m
    [22m[35mgap> List([1,2,3,4],n->n^elm2); # `OnTuples' does not permit reordering[0m
    [22m[35m[ 2, 3, 5, 7 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.7-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 which satisfies the given 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> P1 := List([[0,3],[1,3],[2,9],[5,9],[8,9]],ResidueClass);[0m
    [22m[35m[ 0(3), 1(3), 2(9), 5(9), 8(9) ][0m
    [22m[35mgap> P2 := List([[0,2],[1,8],[5,16],[3,4],[13,16]],ResidueClass);[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<bijective rcwa mapping of Z with modulus 9>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> P1^elm = P2;[0m
    [22m[35mtrue[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 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> elm := RepresentativeAction(RCWA(Integers),P1,P2:IsTame);[0m
    [22m[35m<tame bijective 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>             [ResidueClass(1,3),Union(ResidueClass(0,3),ResidueClass(2,3))],[0m
    [22m[35m>             [Union(ResidueClass(2,5),ResidueClass(4,5)),[0m
    [22m[35m>              Union(ResidueClass(0,5),ResidueClass(1,5),ResidueClass(3,5))]);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 6>[0m
    [22m[35mgap> [ResidueClass(1,3),Union(ResidueClass(0,3),ResidueClass(2,3))]^elm;[0m
    [22m[35m[ 2(5) U 4(5), Z \ 2(5) U 4(5) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.7-5 ShortOrbits[0m
  
  [1m[34m> ShortOrbits( [0m[22m[34mG, S, maxlng[0m[1m[34m ) _____________________________________[0moperation
  [1m[34m> ShortCycles( [0m[22m[34mg, S, maxlng[0m[1m[34m ) _____________________________________[0moperation
  [1mReturns:[0m  A  list  of  all  finite  orbits  of the rcwa group[22m[34mG[0m resp. of all
            finite  cycles  of  the  bijective  rcwa  mapping  [22m[34mg[0m  of length at
            most[22m[34mmaxlng[0m which intersect nontrivially with the set[22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassTransposition(1,4,2,4)  * ClassTransposition(1,4,3,4),[0m
    [22m[35m>               ClassTransposition(3,9,6,18) * ClassTransposition(1,6,3,9));;[0m
    [22m[35mgap> List(ShortOrbits(G,[-15..15],100),orb->StructureDescription(Action(G,orb)));[0m
    [22m[35m[ "A15", "A4", "1", "1", "C3", "1", "((C2 x C2 x C2) : C7) : C3", "1", "1", [0m
    [22m[35m  "C3", "A19" ][0m
    [22m[35mgap> ShortCycles(mKnot(5),[1..100],20);[0m
    [22m[35m[ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5, 6 ], [ 7, 8 ], [0m
    [22m[35m  [ 9, 10, 12, 14, 16, 13, 11 ], [ 15, 18 ], [0m
    [22m[35m  [ 17, 20, 24, 28, 23, 19, 22, 26, 21 ], [0m
    [22m[35m  [ 45, 54, 64, 76, 61, 49, 58, 47, 56 ], [0m
    [22m[35m  [ 59, 70, 84, 100, 120, 144, 172, 206, 165, 198, 159, 190, 228, 183, 147, [0m
    [22m[35m      176, 141, 113, 91, 73 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.7-6 Projections[0m
  
  [1m[34m> Projections( [0m[22m[34mG, m[0m[1m[34m ) _____________________________________________[0moperation
  [1mReturns:[0m  The  projections  of  the  rcwa  group[22m[34mG[0m  to the unions of residue
            classes (mod[22m[34mm[0m) which it fixes setwisely.
  
  The  corresponding  partition  of  a  set of representatives for the residue
  classes (mod[22m[34mm[0m) can be obtained by the operation [22m[32mOrbitsModulo([22m[34mG[0m,[22m[34mm[0m)[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassTransposition(0,2,1,2),ClassShift(3,4));;[0m
    [22m[35mgap> Projections(G,4);[0m
    [22m[35m[ [ ClassTransposition(0,2,1,2), ClassShift(3,4) ] ->[0m
    [22m[35m    [ <bijective rcwa mapping of Z with modulus 4>,[0m
    [22m[35m      IdentityMapping( Integers ) ],[0m
    [22m[35m  [ ClassTransposition(0,2,1,2), ClassShift(3,4) ] ->[0m
    [22m[35m    [ <bijective rcwa mapping of Z with modulus 4>,[0m
    [22m[35m      <bijective rcwa mapping of Z with modulus 4> ] ][0m
    [22m[35mgap> List(last,phi->Support(Image(phi)));[0m
    [22m[35m[ 0(4) U 1(4), 2(4) U 3(4) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.7-7 Ball[0m
  
  [1m[34m> Ball( [0m[22m[34mG, p, d, act[0m[1m[34m ) _______________________________________________[0mmethod
  [1m[34m> Ball( [0m[22m[34mG, g, d[0m[1m[34m ) ____________________________________________________[0mmethod
  [1mReturns:[0m  The  ball  of  radius[22m[34md[0m around the point[22m[34mp[0m under the action[22m[34mact[0m of
            the  group[22m[34mG[0m,  resp.  the ball of radius[22m[34md[0m around the element[22m[34mg[0m in
            the group[22m[34mG[0m.
  
  All  balls  are understood w.r.t. [22m[32mGeneratorsOfGroup([22m[34mG[0m)[0m. As element tests can
  be  expensive,  the  latter  method  does  not  check whether [22m[34mg[0m is indeed an
  element  of[22m[34mG[0m.  The  methods  require  that  point comparisons resp. element
  comparisons are cheap. They are not only applicable to rcwa groups.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> PSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(3),[0m
    [22m[35m>                                                    CyclicGroup(2))));[0m
    [22m[35m<wild rcwa group over Z with 2 generators>[0m
    [22m[35mgap> List([1..10],k->Length(Ball(PSL2Z,0,k,OnPoints)));[0m
    [22m[35m[ 3, 4, 6, 8, 12, 16, 24, 32, 48, 64 ][0m
    [22m[35mgap> List([1..10],k->Length(Ball(PSL2Z,[0,1],k,OnTuples)));[0m
    [22m[35m[ 4, 8, 14, 22, 34, 50, 74, 106, 154, 218 ][0m
    [22m[35mgap> Ball(Group((1,2),(2,3),(3,4)),(),2);[0m
    [22m[35m[ (), (3,4), (2,3), (2,3,4), (2,4,3), (1,2), (1,2)(3,4), (1,2,3), (1,3,2) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.8 Conjugacy in RCWA(Z)[0m
  
  [1m[4m[31m3.8-1 IsConjugate[0m
  
  [1m[34m> IsConjugate( [0m[22m[34mRCWA(Integers), 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.
  
  The  author  does  not know a general way to solve the conjugacy problem for
  elements of RCWA(Z), thus the method may fail or run into an infinite loop.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsConjugate(RCWA(Integers),ClassTransposition(0,2,1,4),[0m
    [22m[35m>                               ClassTransposition(1,2,0,4));[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsConjugate(RCWA(Integers),ClassTransposition(0,2,1,4),ClassShift(0,1));[0m
    [22m[35mfalse[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  In  its  2-argument form, [22m[32mShortCycles([22m[34mf[0m,[22m[34mmaxlng[0m)[0m returns a list of all cycles
  of  [22m[34mf[0m  of length at most [22m[34mmaxlng[0m which do not correspond to cycles consisting
  of  residue classes. The cycles are sorted by increasing length. If for some
  value   of   [22m[34mmaxlng[0m   the   lists   [22m[32mList(ShortCycles([22m[34mf[0m,[22m[34mmaxlng[0m),Length)[0m   and
  [22m[32mList(ShortCycles([22m[34mg[0m,[22m[34mmaxlng[0m),Length)[0m  differ,  then  [22m[34mf[0m  and  [22m[34mg[0m are clearly not
  conjugate.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; # Collatz' permutation.[0m
    [22m[35mgap> ShortCycles(a,5);[0m
    [22m[35m[ [ 0 ], [ 1 ], [ -1 ], [ 2, 3 ], [ -3, -2 ], [ 4, 5, 7, 9, 6 ],[0m
    [22m[35m  [ -9, -6, -4, -5, -7 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.8-2 RepresentativeAction[0m
  
  [1m[34m> RepresentativeAction( [0m[22m[34mRCWA(Integers), 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 may fail for the same reasons as [1m[34mIsConjugate[0m ([1m3.8-1[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> rep := RepresentativeAction(RCWA(Integers),ClassTransposition(0,2,1,4),[0m
    [22m[35m>                                               ClassTransposition(1,2,0,4));[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 32>[0m
    [22m[35mgap> ClassTransposition(0,2,1,4)^rep = ClassTransposition(1,2,0,4); # check[0m
    [22m[35mtrue[0m
    [22m[35mgap> Factorization(rep);[0m
    [22m[35m[ ClassTransposition(0,2,3,16), ClassTransposition(1,4,11,16),[0m
    [22m[35m  ClassTransposition(2,8,3,16), ClassTransposition(6,8,11,16),[0m
    [22m[35m  ClassTransposition(1,2,2,8), ClassTransposition(0,4,6,8) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.8-3 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, as given in Corollary2.7.1(b) in[K05].
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List([2,105],NrConjugacyClassesOfRCWAZOfOrder);[0m
    [22m[35m[ infinity, 218 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.9 Restriction and induction[0m
  
  There  are  monomorphisms from the group RCWA(Z) into itself. The support of
  the  image  of  such  a  monomorphism is the image of a given injective rcwa
  mapping. Therefore these monomorphisms are called [22m[36mrestriction monomorphisms[0m.
  Taking  images  of  rcwa  groups  under  restrictions  by rcwa mappings with
  pairwise  distinct  images  permits  forming  their direct product and their
  wreath  product  with  some  finite permutation group, regardless of whether
  they are tame or not (cp. Section[1m3.2[0m).
  
  [1m[4m[31m3.9-1 Restriction[0m
  
  [1m[34m> Restriction( [0m[22m[34mg, f[0m[1m[34m ) _____________________________________________[0moperation
  [1m[34m> Restriction( [0m[22m[34mG, f[0m[1m[34m ) _____________________________________________[0moperation
  [1mReturns:[0m  The  [22m[36mrestriction[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, the restriction g_f of an rcwa mapping [22m[34mg[0m by an injective rcwa
  mapping[22m[34mf[0m  is the unique rcwa mapping which satisfies the equation f * g_f =
  g  *  f  and which 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 under[22m[34mf[0m.
  
  The restriction of an rcwa group[22m[34mG[0m by an injective rcwa mapping[22m[34mf[0m is defined
  as  the group whose elements are the restrictions of the elements of[22m[34mG[0m 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> F2tilde := Restriction(F2,RcwaMapping([[5,3,1]]));[0m
    [22m[35m<wild rcwa group over Z with 2 generators>[0m
    [22m[35mgap> Support(F2tilde);[0m
    [22m[35m3(5)[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.9-2 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      it      is     [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(F2tilde,RcwaMapping([[5,3,1]])) = F2;[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.10 Getting pseudo-random elements of RCWA(Z)[0m
  
  There  is  a  method  for  the  operation [22m[32mRandom[0m for RCWA(Z). This method is
  designed  to  be suitable for generating interesting examples. No particular
  distribution is guaranteed.
  
  [22m[35m-----------------------------  Log  ------------------------------[0m
    [22m[35m[0m
    [22m[35mgap> elm := Random(RCWA(Integers));[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 12[0m
    [22m[35m[0m
    [22m[35m               n mod 12                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  2  4  6  8 10                    | 3n + 2[0m
    [22m[35m   1  5  9                             | -n + 2[0m
    [22m[35m   3  7                                | (n - 7)/2[0m
    [22m[35m  11                                   | (-n + 20)/3[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The  elements  which are returned by this method are obtained by multiplying
  class    shifts   (see   [1m[34mClassShift[0m   ([1m2.2-1[0m)),   class   reflections   (see
  [1m[34mClassReflection[0m  ([1m2.2-2[0m))  and  class transpositions (see [1m[34mClassTransposition[0m
  ([1m2.2-3[0m)). These factors can be retrieved by factoring:
  
  [22m[35m-----------------------------  Log  ------------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Factorization(elm);[0m
    [22m[35m[ ClassTransposition(0,2,3,4), ClassTransposition(3,4,4,6),[0m
    [22m[35m  ClassShift(0,2)^-1, ClassReflection(3,4), ClassReflection(1,4) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  An  auxiliary  function which is used in this context for choosing the class
  transpositions  is  [22m[32mClassPairs([22m[34mm[0m)[0m.  This function returns a list of 4-tuples
  (r_1,m_1,r_2,m_2) of integers corresponding to the pairs of disjoint residue
  classes r_1(m_1) and r_2(m_2) with m_1, m_2 <= m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List(ClassPairs(4),ClassTransposition);[0m
    [22m[35m[ ClassTransposition(0,2,1,2), ClassTransposition(0,2,1,4),[0m
    [22m[35m  ClassTransposition(0,2,3,4), ClassTransposition(0,3,1,3),[0m
    [22m[35m  ClassTransposition(0,3,2,3), ClassTransposition(0,4,1,4),[0m
    [22m[35m  ClassTransposition(0,4,2,4), ClassTransposition(0,4,3,4),[0m
    [22m[35m  ClassTransposition(1,2,0,4), ClassTransposition(1,2,2,4),[0m
    [22m[35m  ClassTransposition(1,3,2,3), ClassTransposition(1,4,2,4),[0m
    [22m[35m  ClassTransposition(1,4,3,4), ClassTransposition(2,4,3,4) ][0m
    [22m[35mgap> List(last,TransposedClasses);[0m
    [22m[35m[ [ 0(2), 1(2) ], [ 0(2), 1(4) ], [ 0(2), 3(4) ], [ 0(3), 1(3) ],[0m
    [22m[35m  [ 0(3), 2(3) ], [ 0(4), 1(4) ], [ 0(4), 2(4) ], [ 0(4), 3(4) ],[0m
    [22m[35m  [ 1(2), 0(4) ], [ 1(2), 2(4) ], [ 1(3), 2(3) ], [ 1(4), 2(4) ],[0m
    [22m[35m  [ 1(4), 3(4) ], [ 2(4), 3(4) ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.11 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, while testing wild groups for
  solvability  or  perfectness  is  currently not always feasible. It is often
  also possible to compute the derived subgroup of a tame rcwa group.
  
  [1m[4m[31m3.11-1 RespectedPartition[0m
  
  [1m[34m> RespectedPartition( [0m[22m[34mG[0m[1m[34m ) _________________________________________[0mattribute
  [1m[34m> RespectedPartition( [0m[22m[34mg[0m[1m[34m ) _________________________________________[0mattribute
  [1mReturns:[0m  A  respected  partition  of  the  rcwa  group  [22m[34mG[0m resp. of the rcwa
            mapping[22m[34mg[0m.
  
  A  [22m[36mrespected  partition[0m of[22m[34mG[0m resp.[22m[34mg[0m is a partition of the underlying ringR
  into  a  finite  number of residue classes on which[22m[34mG[0m resp. the cyclic group
  generated  by[22m[34mg[0m  acts  in a natural way as a permutation group, and on whose
  elements  all  elements  of[22m[34mG[0m  resp.  all  powers  of[22m[34mg[0m  are  affine. Such a
  partition   exists   if   and   only  if  [22m[34mG[0m  resp.  [22m[34mg[0m  is  tame  (see[K05],
  Theorem2.5.8).
  
  Related  attributes  are [22m[32mRespectedPartitionShort[0m and [22m[32mRespectedPartitionLong[0m.
  They  are  used to denote respected partitions consisting of residue classes
  r(m)  where m divides the modulus of[22m[34mG[0m resp. [22m[34mg[0m, resp. where the modulus of [22m[34mG[0m
  resp. [22m[34mg[0m dividesm.
  
  There  is  an operation [22m[32mRespectsPartition([22m[34mG[0m,[22m[34mP[0m)[0m resp. [22m[32mRespectsPartition([22m[34mg[0m,[22m[34mP[0m)[0m,
  which  tests whether [22m[34mG[0m resp.[22m[34mg[0m respects a given partition[22m[34mP[0m. The permutation
  induced     by    [22m[34mg[0m    on[22m[32mP[0m    can    be    computed    efficiently    using
  [22m[32mPermutationOpNC([22m[34mg[0m,P,OnPoints)[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassTransposition(0,4,1,6),ClassShift(0,2));[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> IsTame(G);[0m
    [22m[35mtrue[0m
    [22m[35mgap> Size(G);[0m
    [22m[35minfinity[0m
    [22m[35mgap> P := RespectedPartition(G);[0m
    [22m[35m[ 3(6), 5(6), 0(8), 2(8), 4(8), 6(8), 1(12), 7(12) ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.11-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([ (3,7)(5,8), (3,4,5,6) ])[0m
    [22m[35mgap> H = Action(G,P);[0m
    [22m[35mtrue[0m
    [22m[35mgap> StructureDescription(H);[0m
    [22m[35m"C2 x S4"[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.11-3 KernelOfActionOnRespectedPartition[0m
  
  [1m[34m> KernelOfActionOnRespectedPartition( [0m[22m[34mG[0m[1m[34m ) _________________________[0mattribute
  [1m[34m> RankOfKernelOfActionOnRespectedPartition( [0m[22m[34mG[0m[1m[34m ) ___________________[0mattribute
  [1mReturns:[0m  The   kernel   of   the   action  of  the  tame  rcwa  group[22m[34mG[0m  on
            [22m[32mRespectedPartition([22m[34mG[0m)[0m,  resp. the rank of the largest free abelian
            subgroup of this kernel.
  
  The   method   for   [22m[32mKernelOfActionOnRespectedPartition[0m   uses  the  package
  [1mPolycyclic[0m[EN03].
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> K := KernelOfActionOnRespectedPartition(G);[0m
    [22m[35m<rcwa group over Z with 3 generators>[0m
    [22m[35mgap> RankOfKernelOfActionOnRespectedPartition(G);[0m
    [22m[35m3[0m
    [22m[35mgap> Index(G,K);[0m
    [22m[35m48[0m
    [22m[35mgap> List(GeneratorsOfGroup(K),Factorization);[0m
    [22m[35m[ [ ClassShift(0,4)^2 ], [ ClassShift(2,4)^2 ], [ ClassShift(1,6)^2 ] ][0m
    [22m[35mgap> IsomorphismPcpGroup(K);[0m
    [22m[35m[ <bijective rcwa mapping of Z with modulus 4>,[0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 4>,[0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 6> ] -> [ g6*g10, g8*g12, g14*g16[0m
    [22m[35m ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m3.11-4 IntegralConjugate[0m
  
  [1m[34m> IntegralConjugate( [0m[22m[34mG[0m[1m[34m ) __________________________________________[0mattribute
  [1m[34m> IntegralConjugate( [0m[22m[34mg[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[34mg[0m in the group RCWA(Z).
  
  Such  conjugates  exist,  see[K05],  Theorem2.5.14.  In  general there are
  infinitely   many   of   them.   An   rcwa   mapping   mapping[22m[34mx[0m  such  that
  [22m[32m[22m[34mG[0m^[22m[34mx[0m=IntegralConjugate([22m[34mG[0m)[0m  resp.  [22m[32m[22m[34mg[0m^[22m[34mx[0m=IntegralConjugate([22m[34mg[0m)[0m  is  stored  as an
  attribute [22m[32mIntegralizingConjugator[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsIntegral(IntegralConjugate(G));[0m
    [22m[35mtrue[0m
    [22m[35mgap> G^IntegralizingConjugator(G) = IntegralConjugate(G);[0m
    [22m[35mtrue[0m
    [22m[35mgap> RespectedPartition(G);[0m
    [22m[35m[ 3(6), 5(6), 0(8), 2(8), 4(8), 6(8), 1(12), 7(12) ][0m
    [22m[35mgap> RespectedPartition(G)^IntegralizingConjugator(G);[0m
    [22m[35m[ 0(8), 1(8), 2(8), 3(8), 4(8), 5(8), 6(8), 7(8) ][0m
    [22m[35mgap> last = RespectedPartition(IntegralConjugate(G));[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Display(IntegralizingConjugator(G));[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 24[0m
    [22m[35m[0m
    [22m[35m               n mod 24                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  8 16                             | n + 2[0m
    [22m[35m   1 13                                | (2n + 16)/3[0m
    [22m[35m   2 10 18                             | n + 1[0m
    [22m[35m   3  9 15 21                          | (4n - 12)/3[0m
    [22m[35m   4 12 20                             | n[0m
    [22m[35m   5 11 17 23                          | (4n - 17)/3[0m
    [22m[35m   6 14 22                             | n - 1[0m
    [22m[35m   7 19                                | (2n + 7)/3[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m3.12 Some general utility functions[0m
  
  [1mRCWA[0m  introduces  a few small utility functions which can be used for groups
  in   general:  The  function  [22m[32mGeneratorsAndInverses([22m[34mG[0m)[0m  returns  a  list  of
  generators  of  [22m[34mG[0m  and  their  inverses,  [22m[32mEpimorphismByGenerators([22m[34mG[0m,[22m[34mH[0m)[0m  is a
  shorthand                 for                 [22m[32mGroupHomomorphismByImages([22m[34mG[0m,[22m[34mH[0m,
  GeneratorsOfGroup([22m[34mG[0m),GeneratorsOfGroup([22m[34mH[0m))[0m  (there  is also an [22m[32mNC[0m version of
  this)  and the function [22m[32mAllProducts([22m[34ml[0m,[22m[34mk[0m)[0m returns the list of all products of
  [22m[34mk[0m entries of the list[22m[34ml[0m.
  
  
  [1m[4m[31m3.13 The categories of rcwa groups[0m
  
  [1m[4m[31m3.13-1 IsRcwaGroup[0m
  
  [1m[34m> IsRcwaGroup( [0m[22m[34mG[0m[1m[34m ) ___________________________________________________[0mfilter
  [1m[34m> IsRcwaGroupOverZ( [0m[22m[34mG[0m[1m[34m ) ______________________________________________[0mfilter
  [1m[34m> IsRcwaGroupOverZ_pi( [0m[22m[34mG[0m[1m[34m ) ___________________________________________[0mfilter
  [1m[34m> IsRcwaGroupOverGFqx( [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.
  
  Often the same methods can be used for rcwa groups over the ring of integers
  and  over  its  semilocalizations.  For  this  reason  there  is  a category
  [22m[32mIsRcwaGroupOverZOrZ_pi[0m   which   is   the   union  of  [22m[32mIsRcwaGroupOverZ[0m  and
  [22m[32mIsRcwaGroupOverZ_pi[0m.  To  allow distinguishing the entire group RCWA(R) from
  others  by means of the method selection, it has the characteristic property
  [22m[32mIsNaturalRCWA_Z[0m   resp.   one   of   the  properties  [22m[32mIsNaturalRCWA_Z_pi[0m  or
  [22m[32mIsNaturalRCWA_GFqx[0m,  depending  on whether R is the ring of integers, one of
  its semilocalizations or a univariate polynomial ring over a finite field.
  
