  
  [1X3 [33X[0;0YResidue-Class-Wise Affine Groups[133X[101X
  
  [33X[0;0YIn  this  chapter,  we  describe  how to construct residue-class-wise affine
  groups and how to compute with them.[133X
  
  
  [1X3.1 [33X[0;0YConstructing residue-class-wise affine groups[133X[101X
  
  [33X[0;0YAs  any other groups in [5XGAP[105X, residue-class-wise affine (rcwa-) groups can be
  constructed by [10XGroup[110X, [10XGroupByGenerators[110X or [10XGroupWithGenerators[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,4),ClassShift(0,5));[127X[104X
    [4X[28X<rcwa group over Z with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XIsTame(G); Size(G); IsSolvable(G); IsPerfect(G);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xinfinity[128X[104X
    [4X[28Xfalse[128X[104X
    [4X[28Xfalse[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YAn  rcwa  group  isomorphic  to  a given group can be obtained by taking the
  image of a faithful rcwa representation:[133X
  
  [1X3.1-1 IsomorphismRcwaGroup[101X
  
  [33X[1;0Y[29X[2XIsomorphismRcwaGroup[102X( [3XG[103X, [3XR[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XIsomorphismRcwaGroup[102X( [3XG[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10Ya   monomorphism  from  the  group  [3XG[103X  to RCWA([3XR[103X)  or  to RCWA(ℤ),
            respectively.[133X
  
  [33X[0;0YThe  best-supported case is [3XR[103X = ℤ. 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 (cf.
  e.g.  Section II.B.  in [dlH00]),  and  the  method  for free groups uses an
  adaptation  of the construction given on page 27 in [dlH00] from PSL(2,ℂ) to
  RCWA(ℤ).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XF := FreeProduct(Group((1,2)(3,4),(1,3)(2,4)),Group((1,2,3)),[127X[104X
    [4X[25X>[125X [27X                    SymmetricGroup(3));[127X[104X
    [4X[28X<fp group on the generators [ f1, f2, f3, f4, f5 ]>[128X[104X
    [4X[25Xgap>[125X [27XIsomorphismRcwaGroup(F);[127X[104X
    [4X[28X[ f1, f2, f3, f4, f5 ] -> [ <rcwa permutation of Z with modulus 12>,[128X[104X
    [4X[28X  <rcwa permutation of Z with modulus 24>,[128X[104X
    [4X[28X  <rcwa permutation of Z with modulus 12>,[128X[104X
    [4X[28X  <rcwa permutation of Z with modulus 72>,[128X[104X
    [4X[28X  <rcwa permutation of Z with modulus 36> ][128X[104X
    [4X[25Xgap>[125X [27XIsomorphismRcwaGroup(FreeGroup(2));[127X[104X
    [4X[28X[ f1, f2 ] -> [ <wild rcwa permutation of Z with modulus 8>,[128X[104X
    [4X[28X  <wild rcwa permutation of Z with modulus 8> ][128X[104X
    [4X[25Xgap>[125X [27XF2 := Image(last);[127X[104X
    [4X[28X<wild rcwa group over Z with 2 generators>[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YFurther, new rcwa groups can be constructed from given ones by taking direct
  products  and  by  taking  wreath  products  with  finite groups or with the
  infinite cyclic group:[133X
  
  [1X3.1-2 DirectProduct[101X
  
  [33X[1;0Y[29X[2XDirectProduct[102X( [3XG1[103X, [3XG2[103X, [3X...[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Yan  rcwa group isomorphic to the direct product of the rcwa groups
            over ℤ given as arguments.[133X
  
  [33X[0;0YThere  is  certainly no unique or canonical way to embed a direct product of
  rcwa  groups  into  RCWA(ℤ). This method chooses to embed the groups [3XG1[103X, [3XG2[103X,
  [3XG3[103X ...  via  restrictions  by  [22Xn ↦ mn[122X, [22Xn ↦ mn+1[122X, [22Xn ↦ mn+2[122X ... ([22X→[122X [2XRestriction[102X
  ([14X3.1-6[114X)), where [22Xm[122X denotes the number of groups given as arguments.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XF2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;[127X[104X
    [4X[25Xgap>[125X [27XF2xF2 := DirectProduct(F2,F2);[127X[104X
    [4X[28X<wild rcwa group over Z with 4 generators>[128X[104X
    [4X[25Xgap>[125X [27XImage(Projection(F2xF2,1)) = F2;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.1-3  [33X[0;0YWreathProduct  (for an rcwa group over Z, with a permutation group or[101X
  [1X(ℤ,+))[133X[101X
  
  [33X[1;0Y[29X[2XWreathProduct[102X( [3XG[103X, [3XP[103X ) [32X method[133X
  [33X[1;0Y[29X[2XWreathProduct[102X( [3XG[103X, [3XZ[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Yan rcwa group isomorphic to the wreath product of the rcwa group [3XG[103X
            over ℤ  with  the  finite permutation group [3XP[103X or with the infinite
            cyclic group [3XZ[103X, respectively.[133X
  
  [33X[0;0YThe  first-mentioned  method embeds the [10XNrMovedPoints([3XP[103X[10X)[110Xth direct power of [3XG[103X
  using  the  method  for  [10XDirectProduct[110X, and lets the permutation group [3XP[103X act
  naturally  on  the  set  of  residue  classes  modulo  [10XNrMovedPoints([3XP[103X[10X)[110X. The
  second-mentioned method restricts ([22X→[122X [2XRestriction[102X ([14X3.1-6[114X)) the group [3XG[103X to the
  residue class 3(4), and maps the generator of the infinite cyclic group [3XZ[103X to
  [10XClassTransposition(0,2,1,2) * ClassTransposition(0,2,1,4)[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XF2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;[127X[104X
    [4X[25Xgap>[125X [27XF2wrA5 := WreathProduct(F2,AlternatingGroup(5));;[127X[104X
    [4X[25Xgap>[125X [27XEmbedding(F2wrA5,1);[127X[104X
    [4X[28X[ <wild rcwa permutation of Z with modulus 8>,[128X[104X
    [4X[28X  <wild rcwa permutation of Z with modulus 8> ] ->[128X[104X
    [4X[28X[ <wild rcwa permutation of Z with modulus 40>,[128X[104X
    [4X[28X  <wild rcwa permutation of Z with modulus 40> ][128X[104X
    [4X[25Xgap>[125X [27XEmbedding(F2wrA5,2);[127X[104X
    [4X[28X[ (1,2,3,4,5), (3,4,5) ] -> [ ( 0(5), 1(5), 2(5), 3(5), 4(5) ), [128X[104X
    [4X[28X  ( 2(5), 3(5), 4(5) ) ][128X[104X
    [4X[25Xgap>[125X [27XZwrZ := WreathProduct(Group(ClassShift(0,1)),Group(ClassShift(0,1)));[127X[104X
    [4X[28X<wild rcwa group over Z with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XEmbedding(ZwrZ,1);[127X[104X
    [4X[28X[ ClassShift( Z ) ] ->[128X[104X
    [4X[28X[ <tame rcwa permutation of Z with modulus 4, of order infinity> ][128X[104X
    [4X[25Xgap>[125X [27XEmbedding(ZwrZ,2);[127X[104X
    [4X[28X[ ClassShift( Z ) ] -> [ <wild rcwa permutation of Z with modulus 4> ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YAlso,  rcwa  groups  can  be  obtained  as  particular  extensions of finite
  permutation groups:[133X
  
  [1X3.1-4 MergerExtension[101X
  
  [33X[1;0Y[29X[2XMergerExtension[102X( [3XG[103X, [3Xpoints[103X, [3Xpoint[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Yroughly  spoken,  an  extension of [3XG[103X by an involution which [21Xmerges[121X
            [3Xpoints[103X into [3Xpoint[103X.[133X
  
  [33X[0;0YThe  arguments  of  this  operation  are a finite permutation group [3XG[103X, a set
  [3Xpoints[103X of points moved by [3XG[103X and a single point [3Xpoint[103X moved by [3XG[103X which is not
  in [3Xpoints[103X.[133X
  
  [33X[0;0YLet  [22Xn[122X  be  the  largest moved point of [3XG[103X, and let [22XH[122X be the tame subgroup of
  CT(ℤ)  which  respects  the partition [22XmathcalP[122X of ℤ into the residue classes
  (mod [22Xn[122X),  and  which  acts  on  [22XmathcalP[122X  as [3XG[103X acts on [22X{1, dots, n}[122X. Further
  assume that [3Xpoints[103X = [22X{p_1, dots, p_k}[122X and [3Xpoint[103X = [22Xp[122X, and put [22Xr_i := p_i-1, i
  =  1,  dots,  k[122X  and  [22Xr  :=  p-1[122X.  Now  let  [22Xσ[122X  be  the product of the class
  transpositions  [22Xτ_r_i(n),r+(i-1)n(kn), i = 1, dots, k[122X. The group returned by
  this  operation  is  the  extension  of  [22XH[122X  by the involution [22Xσ[122X. -- On first
  reading,  this  may  look  a  little complicated, but really the code of the
  method is only about half as long as this description.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27X# First example -- a group isomorphic to PSL(2,Z):[127X[104X
    [4X[25Xgap>[125X [27XG := MergerExtension(Group((1,2,3)),[1,2],3);[127X[104X
    [4X[28X<rcwa group over Z with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XSize(G); [127X[104X
    [4X[28Xinfinity[128X[104X
    [4X[25Xgap>[125X [27XGeneratorsOfGroup(G);[127X[104X
    [4X[28X[ ( 0(3), 1(3), 2(3) ), ( 0(3), 2(6) ) ( 1(3), 5(6) ) ][128X[104X
    [4X[25Xgap>[125X [27XB := Ball(G,One(G),6:Spheres);;[127X[104X
    [4X[25Xgap>[125X [27XList(B,Length);[127X[104X
    [4X[28X[ 1, 3, 4, 6, 8, 12, 16 ][128X[104X
    [4X[25Xgap>[125X [27X#[127X[104X
    [4X[25Xgap>[125X [27X# Second example -- a group isomorphic to Thompson's group V:[127X[104X
    [4X[25Xgap>[125X [27XG := MergerExtension(Group((1,2,3,4),(1,2)),[1,2],3);[127X[104X
    [4X[28X<rcwa group over Z with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XSize(G);[127X[104X
    [4X[28Xinfinity[128X[104X
    [4X[25Xgap>[125X [27XGeneratorsOfGroup(G);[127X[104X
    [4X[28X[ ( 0(4), 1(4), 2(4), 3(4) ), ( 0(4), 1(4) ),[128X[104X
    [4X[28X  ( 0(4), 2(8) ) ( 1(4), 6(8) ) ][128X[104X
    [4X[25Xgap>[125X [27XB := Ball(G,One(G),6:Spheres);;[127X[104X
    [4X[25Xgap>[125X [27XList(B,Length);[127X[104X
    [4X[28X[ 1, 4, 11, 28, 69, 170, 413 ][128X[104X
    [4X[25Xgap>[125X [27XG = Group(List([[0,2,1,2],[1,2,2,4],[0,2,1,4],[1,4,2,4]],[127X[104X
    [4X[25X>[125X [27X                  ClassTransposition));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIt is also possible to build an rcwa group from a list of residue classes:[133X
  
  [1X3.1-5 GroupByResidueClasses[101X
  
  [33X[1;0Y[29X[2XGroupByResidueClasses[102X( [3Xclasses[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ythe  group  which  is  generated by all class transpositions which
            interchange disjoint residue classes in [3Xclasses[103X.[133X
  
  [33X[0;0YThe argument [3Xclasses[103X must be a list of residue classes.[133X
  
  [33X[0;0YIf  the  residue classes in [3Xclasses[103X are pairwise disjoint, then the returned
  group  is  the  symmetric  group  on  [3Xclasses[103X. If any two residue classes in
  [3Xclasses[103X intersect non-trivially, then the returned group is trivial. In many
  other cases, the returned group is infinite.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := GroupByResidueClasses(List([[0,2],[0,4],[1,4],[2,4],[3,4]],[127X[104X
    [4X[25X>[125X [27X                                   ResidueClass));[127X[104X
    [4X[28X<rcwa group over Z with 8 generators>[128X[104X
    [4X[25Xgap>[125X [27XH := Group(List([[0,2,1,2],[1,2,2,4],[0,2,1,4],[1,4,2,4]],[127X[104X
    [4X[25X>[125X [27X                   ClassTransposition)); # Thompson's group V[127X[104X
    [4X[28X<(0(2),1(2)),(1(2),2(4)),(0(2),1(4)),(1(4),2(4))>[128X[104X
    [4X[25Xgap>[125X [27XG = H;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YVarious  ways  to  construct  rcwa groups are based on certain monomorphisms
  from the group RCWA([22XR[122X) into itself. Examples are the constructions of direct
  products  and  wreath  products described above. The support of the image of
  such a monomorphism is the image of a given injective rcwa mapping. For this
  reason,  these  monomorphisms  are  called  [13Xrestriction  monomorphisms[113X.  The
  following operation computes images of rcwa mappings and -groups under these
  embeddings of RCWA([22XR[122X) into itself:[133X
  
  
  [1X3.1-6  [33X[0;0YRestriction  (of  an  rcwa  mapping  or  -group, by an injective rcwa[101X
  [1Xmapping)[133X[101X
  
  [33X[1;0Y[29X[2XRestriction[102X( [3Xg[103X, [3Xf[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XRestriction[102X( [3XG[103X, [3Xf[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ythe restriction of the rcwa mapping [3Xg[103X (respectively the rcwa group
            [3XG[103X) by the injective rcwa mapping [3Xf[103X.[133X
  
  [33X[0;0YBy definition, the [13Xrestriction[113X [22Xg_f[122X of an rcwa mapping [3Xg[103X by an injective rcwa
  mapping [3Xf[103X  is the unique rcwa mapping which satisfies the equation [22Xf ⋅ g_f =
  g  ⋅  f[122X  and which fixes the complement of the image of [3Xf[103X pointwise. If [3Xf[103X is
  bijective, the restriction of [3Xg[103X by [3Xf[103X is just the conjugate of [3Xg[103X under [3Xf[103X.[133X
  
  [33X[0;0YThe [13Xrestriction[113X of an rcwa group [3XG[103X by an injective rcwa mapping [3Xf[103X is defined
  as  the group whose elements are the restrictions of the elements of [3XG[103X by [3Xf[103X.
  The  restriction  of [3XG[103X  by [3Xf[103X acts on the image of [3Xf[103X and fixes its complement
  pointwise.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XF2tilde := Restriction(F2,RcwaMapping([[5,3,1]]));[127X[104X
    [4X[28X<wild rcwa group over Z with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XSupport(F2tilde);[127X[104X
    [4X[28X3(5)[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.1-7 [33X[0;0YInduction (of an rcwa mapping or -group, by an injective rcwa mapping)[133X[101X
  
  [33X[1;0Y[29X[2XInduction[102X( [3Xg[103X, [3Xf[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XInduction[102X( [3XG[103X, [3Xf[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ythe  induction  of the rcwa mapping [3Xg[103X (respectively the rcwa group
            [3XG[103X) by the injective rcwa mapping [3Xf[103X.[133X
  
  [33X[0;0Y[13XInduction[113X    is   the   right   inverse   of   restriction,   i.e.   it   is
  [10XInduction(Restriction([3Xg[103X[10X,[3Xf[103X[10X),[3Xf[103X[10X) = [3Xg[103X[10X[110X and [10XInduction(Restriction([3XG[103X[10X,[3Xf[103X[10X),[3Xf[103X[10X) = [3XG[103X[10X[110X. The
  mapping [3Xg[103X  respectively  the  group [3XG[103X must not move points outside the image
  of [3Xf[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XInduction(F2tilde,RcwaMapping([[5,3,1]])) = F2;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YOnce  having constructed an rcwa group, it is sometimes possible to obtain a
  smaller generating set by the operation [10XSmallGeneratingSet[110X.[133X
  
  [33X[0;0YThere  are  methods for the operations [10XView[110X, [10XDisplay[110X, [10XPrint[110X and [10XString[110X which
  are applicable to rcwa groups.[133X
  
  [33X[0;0YBasic attributes of an rcwa group which are derived from the coefficients of
  its  elements  are [10XModulus[110X, [10XMultiplier[110X, [10XDivisor[110X and [10XPrimeSet[110X. The [13Xmodulus[113X of
  an  rcwa  group  is  the  lcm  of  the moduli of its elements if such an lcm
  exists,  i.e.  if  the  group  is  tame,  and  0  otherwise.  The [13Xmultiplier[113X
  respectively  [13Xdivisor[113X  of  an  rcwa  group  is  the  lcm  of the multipliers
  respectively  divisors  of  its  elements  in  case such an lcm exists and [22X∞[122X
  otherwise.  The [13Xprime set[113X of an rcwa group is the union of the prime sets of
  its  elements.  There  are shorthands [10XMod[110X, [10XMult[110X and [10XDiv[110X defined for [10XModulus[110X,
  [10XMultiplier[110X  and  [10XDivisor[110X,  respectively.  An rcwa group is called [13Xclass-wise
  translating[113X,  [13Xintegral[113X or [13Xclass-wise order-preserving[113X if all of its elements
  are     so.     There    are    corresponding    methods    available    for
  [10XIsClassWiseTranslating[110X,  [10XIsIntegral[110X and [10XIsClassWiseOrderPreserving[110X. There is
  a  property  [10XIsSignPreserving[110X,  which  indicates  whether a given rcwa group
  over ℤ  acts  on  the  set of nonnegative integers. The latter holds for any
  subgroup of CT(ℤ) (cf. below).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,2),ClassTransposition(1,3,2,6),[127X[104X
    [4X[25X>[125X [27X              ClassReflection(2,4));[127X[104X
    [4X[28X<rcwa group over Z with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XList([Modulus,Multiplier,Divisor,PrimeSet,IsClassWiseTranslating,[127X[104X
    [4X[25X>[125X [27X         IsIntegral,IsClassWiseOrderPreserving,IsSignPreserving],f->f(G));[127X[104X
    [4X[28X[ 24, 2, 2, [ 2, 3 ], false, false, false, false ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YAll  rcwa  groups  over a ring [22XR[122X are subgroups of RCWA([22XR[122X). The group RCWA([22XR[122X)
  itself  is  not  finitely generated, thus cannot be constructed as described
  above. It is handled as a special case:[133X
  
  [1X3.1-8 RCWA[101X
  
  [33X[1;0Y[29X[2XRCWA[102X( [3XR[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ythe group RCWA([3XR[103X) of all residue-class-wise affine permutations of
            the ring [3XR[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XRCWA_Z := RCWA(Integers);[127X[104X
    [4X[28XRCWA(Z)[128X[104X
    [4X[25Xgap>[125X [27XIsSubgroup(RCWA_Z,G);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YExamples  of  rcwa  permutations  can  be  obtained via [10XRandom(RCWA([3XR[103X[10X))[110X, see
  Section [14X3.5[114X. The number of conjugacy classes of RCWA(ℤ) of elements of given
  order  is known, cf. Corollary 2.7.1 (b) in [Koh05]. It can be determined by
  the function [10XNrConjugacyClassesOfRCWAZOfOrder[110X:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XList([2,105],NrConjugacyClassesOfRCWAZOfOrder);[127X[104X
    [4X[28X[ infinity, 218 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YWe  denote  the  group which is generated by all class transpositions of the
  ring [22XR[122X by CT([22XR[122X). This group is handled as a special case as well:[133X
  
  [1X3.1-9 CT[101X
  
  [33X[1;0Y[29X[2XCT[102X( [3XR[103X ) [32X function[133X
  [33X[1;0Y[29X[2XCT[102X( [3XP[103X, [3XIntegers[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ythe  group CT([3XR[103X) which is generated by all class transpositions of
            the  ring [3XR[103X, respectively, the group CT([3XP[103X,ℤ) which is generated by
            all  class  transpositions  of ℤ which interchange residue classes
            whose moduli have only prime factors in the finite set [3XP[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XCT_Z := CT(Integers);[127X[104X
    [4X[28XCT(Z)[128X[104X
    [4X[25Xgap>[125X [27XIsSimpleGroup(CT_Z); # One of a number of stored attributes/properties.[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XV := CT([2],Integers);[127X[104X
    [4X[28XCT_[ 2 ](Z)[128X[104X
    [4X[25Xgap>[125X [27XGeneratorsOfGroup(V);[127X[104X
    [4X[28X[ ( 0(2), 1(2) ), ( 1(2), 2(4) ), ( 0(2), 1(4) ), ( 1(4), 2(4) ) ][128X[104X
    [4X[25Xgap>[125X [27XG := CT([2,3],Integers); [127X[104X
    [4X[28XCT_[ 2, 3 ](Z)[128X[104X
    [4X[25Xgap>[125X [27XGeneratorsOfGroup(G);[127X[104X
    [4X[28X[ ( 0(2), 1(2) ), ( 0(3), 1(3) ), ( 1(3), 2(3) ), ( 0(2), 1(4) ), [128X[104X
    [4X[28X  ( 0(2), 5(6) ), ( 0(3), 1(6) ) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe group CT(ℤ) has an outer automorphism which is given by conjugation with
  [22Xn  ↦  -n - 1[122X. This automorphism can be applied to an rcwa mapping of ℤ or to
  an  rcwa  group over ℤ by the operation [10XMirrored[110X. The group [10XMirrored([110X[3XG[103X[10X)[110X acts
  on  the  nonnegative  integers  as [3XG[103X acts on the negative integers, and vice
  versa.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xct := ClassTransposition(0,2,1,6);[127X[104X
    [4X[28X( 0(2), 1(6) )[128X[104X
    [4X[25Xgap>[125X [27XMirrored(ct);[127X[104X
    [4X[28X( 1(2), 4(6) )[128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[0,2,1,2],[0,3,2,3],[2,4,1,6]],ClassTransposition));;[127X[104X
    [4X[25Xgap>[125X [27XShortOrbits(G,[-100..100],100);[127X[104X
    [4X[28X[ [ 0 .. 5 ] ][128X[104X
    [4X[25Xgap>[125X [27XShortOrbits(Mirrored(G),[-100..100],100);[127X[104X
    [4X[28X[ [ -6 .. -1 ] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YUnder the hypothesis that CT(ℤ) is the setwise stabilizer of [22Xℕ_0[122X in RCWA(ℤ),
  the  elements  of CT(ℤ) with modulus dividing a given positive integer [22Xm[122X are
  parametrized by the ordered partitions of ℤ into [22Xm[122X residue classes. The list
  of   these   elements   for   given  [22Xm[122X  can  be  obtained  by  the  function
  [10XAllElementsOfCTZWithGivenModulus[110X,  and  the numbers of such elements for [22Xm ≤
  24[122X are stored in the list [10XNrElementsOfCTZWithGivenModulus[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XNrElementsOfCTZWithGivenModulus{[1..8]};[127X[104X
    [4X[28X[ 1, 1, 17, 238, 4679, 115181, 3482639, 124225680 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  number of conjugacy classes of CT(ℤ) of elements of given order is also
  known  under  the  hypothesis that CT(ℤ) is the setwise stabilizer of [22Xℕ_0[122X in
  RCWA(ℤ).      It      can      be     determined     by     the     function
  [10XNrConjugacyClassesOfCTZOfOrder[110X.[133X
  
  
  [1X3.2 [33X[0;0YBasic routines for investigating residue-class-wise affine groups[133X[101X
  
  [33X[0;0YIn  the  previous  section  we  have  seen how to construct rcwa groups. The
  purpose  of  this  section  is  to describe how to obtain information on the
  structure  of  an  rcwa  group and on its action on the underlying ring. The
  easiest  way to get a little (but really only [13Xa very little[113X!) information on
  the   group   structure   is   a   dedicated   method   for   the  operation
  [10XStructureDescription[110X:[133X
  
  [1X3.2-1 StructureDescription[101X
  
  [33X[1;0Y[29X[2XStructureDescription[102X( [3XG[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Ya  string  which sometimes gives a little glimpse of the structure
            of the rcwa group [3XG[103X.[133X
  
  [33X[0;0YThe  attribute  [10XStructureDescription[110X  for finite groups is documented in the
  [5XGAP[105X  Reference  Manual.  Therefore  we  describe  here only issues which are
  specific to infinite groups, and in particular to rcwa groups.[133X
  
  [33X[0;0YWreath  products  are denoted by [10Xwr[110X, and free products are denoted by [10X*[110X. The
  infinite  cyclic group (ℤ,+) is denoted by [10XZ[110X, the infinite dihedral group is
  denoted  by [10XD0[110X  and  free  groups  of rank [22X2,3,4,dots[122X are denoted by [10XF2[110X, [10XF3[110X,
  [10XF4[110X, [22Xdots[122X. While for finite groups the symbol [10X.[110X 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 [10X<unknown>[110X. In
  general,  the  structure  of  a  section  denoted  by  [10X<unknown>[110X can be very
  complicated and very difficult to exhibit.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,4),ClassShift(0,5));;[127X[104X
    [4X[25Xgap>[125X [27XStructureDescription(G);[127X[104X
    [4X[28X"(Z x Z x Z x Z x Z x Z x Z) . (C2 x S7)"[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,4),[127X[104X
    [4X[25X>[125X [27X              ClassShift(2,4),ClassReflection(1,2));;[127X[104X
    [4X[25Xgap>[125X [27XStructureDescription(G:short);[127X[104X
    [4X[28X"Z^2.((S3xS3):2)"[128X[104X
    [4X[25Xgap>[125X [27XF2 := Image(IsomorphismRcwaGroup(FreeGroup(2)));;[127X[104X
    [4X[25Xgap>[125X [27XPSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(3),[127X[104X
    [4X[25X>[125X [27X                                                   CyclicGroup(2))));;[127X[104X
    [4X[25Xgap>[125X [27XG := DirectProduct(PSL2Z,F2);[127X[104X
    [4X[28X<wild rcwa group over Z with 4 generators>[128X[104X
    [4X[25Xgap>[125X [27XStructureDescription(G);[127X[104X
    [4X[28X"(C3 * C2) x F2"[128X[104X
    [4X[25Xgap>[125X [27XG := WreathProduct(G,CyclicGroup(IsRcwaGroupOverZ,infinity));[127X[104X
    [4X[28X<wild rcwa group over Z with 5 generators>[128X[104X
    [4X[25Xgap>[125X [27XStructureDescription(G);[127X[104X
    [4X[28X"((C3 * C2) x F2) wr Z"[128X[104X
    [4X[25Xgap>[125X [27XCollatz := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);;[127X[104X
    [4X[25Xgap>[125X [27XG := Group(Collatz,ClassShift(0,1));;[127X[104X
    [4X[25Xgap>[125X [27XStructureDescription(G:short);[127X[104X
    [4X[28X"<unknown>.Z"[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  extent  to  which  the  structure  of  an  rcwa  group can be exhibited
  automatically  is  severely  limited. In general, one can find out much more
  about  the  structure  of a given rcwa group in an interactive session using
  the  functionality  described  in  the rest of this section and elsewhere in
  this manual.[133X
  
  [33X[0;0YThe  order  of  an rcwa group can be computed by the operation [10XSize[110X. An rcwa
  group  is  finite  if  and  only  if it is tame and its action on a suitably
  chosen  respected  partition  (see [2XRespectedPartition[102X  ([14X3.4-1[114X)) 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.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,2),ClassTransposition(1,3,2,3),[127X[104X
    [4X[25X>[125X [27X              ClassReflection(0,5));[127X[104X
    [4X[28X<rcwa group over Z with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XSize(G);[127X[104X
    [4X[28X46080[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YFor  a  finite  rcwa  group,  an  isomorphism  to a permutation group can be
  computed by [10XIsomorphismPermGroup[110X:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,2),ClassTransposition(0,3,1,3));;[127X[104X
    [4X[25Xgap>[125X [27XIsomorphismPermGroup(G);[127X[104X
    [4X[28X[ ( 0(2), 1(2) ), ( 0(3), 1(3) ) ] -> [ (1,2)(3,4)(5,6), (1,2)(4,5) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIn  general  the  membership  problem  for  rcwa  groups  is algorithmically
  unsolvable,  see  Corollary 4.5  in [Koh10]. A consequence of this is that a
  membership test [21X[10Xg in G[110X[121X may run into an infinite loop if the rcwa permutation
  [10Xg[110X  is  not  an  element  of  the  rcwa group [10XG[110X. For tame rcwa groups however
  membership  can always be decided. For wild rcwa groups, membership can very
  often  be decided quite quick as well, but -- as said -- not always. Anyway,
  if  [10Xg[110X  is  contained in [10XG[110X, the membership test will eventually always return
  [10Xtrue[110X,  provided  that  there  are  sufficient  computing resources available
  (memory etc.).[133X
  
  [33X[0;0YOn  Info  level 2  of  [10XInfoRCWA[110X  the membership test provides information on
  reasons why the given rcwa permutation is an element of the given rcwa group
  or not.[133X
  
  [33X[0;0YThe  membership  test  [21X[10Xg in G[110X[121X recognizes an option [10XOrbitLengthBound[110X. If this
  option is set, it returns [10Xfalse[110X once it has computed balls of size exceeding
  [10XOrbitLengthBound[110X  about  1  and  [10Xg[110X in [10XG[110X, and these balls are still disjoint.
  Note  however  that  due  to the algorithmic unsolvability of the membership
  problem, [5XRCWA[105X has no means to check the correctness of such bound in a given
  case.  So  the  correct  use  of  this  option has to remain within the full
  responsibility of the user.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassShift(0,3),ClassTransposition(0,3,2,6));;[127X[104X
    [4X[25Xgap>[125X [27X ClassShift(2,6)^7 * ClassTransposition(0,3,2,6)[127X[104X
    [4X[25X>[125X [27X  * ClassShift(0,3)^-3 in G;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XClassShift(0,1) in G;[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  conjugacy  problem for rcwa groups is difficult, and [5XRCWA[105X provides only
  methods to solve it in some reasonably easy cases.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XIsConjugate(RCWA(Integers),[127X[104X
    [4X[25X>[125X [27X               ClassTransposition(0,2,1,4),ClassShift(0,1));[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsConjugate(CT(Integers),ClassTransposition(0,2,1,6),[127X[104X
    [4X[25X>[125X [27X                            ClassTransposition(1,4,0,8));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xg := RepresentativeAction(CT(Integers),ClassTransposition(0,2,1,6),[127X[104X
    [4X[25X>[125X [27X                                          ClassTransposition(1,4,0,8));[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 48>[128X[104X
    [4X[25Xgap>[125X [27XClassTransposition(0,2,1,6)^g = ClassTransposition(1,4,0,8);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThere  is a property [10XIsTame[110X which indicates whether an rcwa group is tame or
  not:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,4),ClassShift(1,3));;[127X[104X
    [4X[25Xgap>[125X [27XH := Group(ClassTransposition(0,2,1,6),ClassShift(1,3));;[127X[104X
    [4X[25Xgap>[125X [27XIsTame(G);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsTame(H);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YFor   tame   rcwa   groups,   there  are  methods  for  [10XIsSolvableGroup[110X  and
  [10XIsPerfectGroup[110X available, and usually derived subgroups and subgroup indices
  can  be  computed  as  well.  Linear representations of tame groups over the
  rationals can be determined by the operation [10XIsomorphismMatrixGroup[110X. Testing
  a  wild  group  for  solvability  or  perfectness  is  currently  not always
  feasible,  and  wild  groups  have in general no faithful finite-dimensional
  linear  representations.  There  is  a  method for [10XExponent[110X available, which
  works basically for any rcwa group.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,4),ClassShift(1,2));;[127X[104X
    [4X[25Xgap>[125X [27XIsPerfect(G);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsSolvable(G);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD1 := DerivedSubgroup(G);; D2 := DerivedSubgroup(D1);;[127X[104X
    [4X[25Xgap>[125X [27XIsAbelian(D2);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIndex(G,D1); Index(D1,D2);[127X[104X
    [4X[28Xinfinity[128X[104X
    [4X[28X9[128X[104X
    [4X[25Xgap>[125X [27XStructureDescription(G); StructureDescription(D1);[127X[104X
    [4X[28X"(Z x Z x Z) . S3"[128X[104X
    [4X[28X"(Z x Z) . C3"[128X[104X
    [4X[25Xgap>[125X [27XQ := D1/D2;[127X[104X
    [4X[28XGroup([ (), (1,2,4)(3,5,7)(6,8,9), (1,3,6)(2,5,8)(4,7,9) ])[128X[104X
    [4X[25Xgap>[125X [27XStructureDescription(Q); [127X[104X
    [4X[28X"C3 x C3"[128X[104X
    [4X[25Xgap>[125X [27XExponent(G);[127X[104X
    [4X[28Xinfinity[128X[104X
    [4X[25Xgap>[125X [27Xphi := IsomorphismMatrixGroup(G);;[127X[104X
    [4X[25Xgap>[125X [27XDisplay(Image(phi,ClassTransposition(0,2,1,4)));[127X[104X
    [4X[28X[ [     0,     0,   1/2,  -1/2,     0,     0 ], [128X[104X
    [4X[28X  [     0,     0,     0,     1,     0,     0 ], [128X[104X
    [4X[28X  [     2,     1,     0,     0,     0,     0 ], [128X[104X
    [4X[28X  [     0,     1,     0,     0,     0,     0 ], [128X[104X
    [4X[28X  [     0,     0,     0,     0,     1,     0 ], [128X[104X
    [4X[28X  [     0,     0,     0,     0,     0,     1 ] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YWhen  investigating  a  group,  a  basic task is to find relations among the
  generators:[133X
  
  [1X3.2-2 EpimorphismFromFpGroup[101X
  
  [33X[1;0Y[29X[2XEpimorphismFromFpGroup[102X( [3XG[103X, [3Xr[103X ) [32X method[133X
  [33X[1;0Y[29X[2XEpimorphismFromFpGroup[102X( [3XG[103X, [3Xr[103X, [3Xmaxparts[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Yan  epimorphism  from  a  finitely  presented  group  to  the rcwa
            group [3XG[103X.[133X
  
  [33X[0;0YThe  argument  [3Xr[103X  is the [21Xsearch radius[121X, i.e. the radius of the ball around 1
  which  is  scanned  for  relations.  In  general, the larger [3Xr[103X is chosen the
  smaller the kernel of the returned epimorphism is. If the group [3XG[103X has finite
  presentations,  the  kernel will in principle get trivial provided that [3Xr[103X is
  chosen  large  enough. If the optional argument [3Xmaxparts[103X is given, it limits
  the search space to elements with at most [3Xmaxparts[103X affine parts.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xa := ClassTransposition(2,4,3,4);;[127X[104X
    [4X[25Xgap>[125X [27Xb := ClassTransposition(4,6,8,12);;[127X[104X
    [4X[25Xgap>[125X [27Xc := ClassTransposition(3,4,4,6);;[127X[104X
    [4X[25Xgap>[125X [27XG := SparseRep(Group(a,b,c));[127X[104X
    [4X[28X<(2(4),3(4)),(4(6),8(12)),(3(4),4(6))>[128X[104X
    [4X[25Xgap>[125X [27Xphi := EpimorphismFromFpGroup(G,6);[127X[104X
    [4X[28X#I  there are 3 generators and 12 relators of total length 330[128X[104X
    [4X[28X#I  there are 3 generators and 11 relators of total length 312[128X[104X
    [4X[28X[ a, b, c ] -> [ ( 2(4), 3(4) ), ( 4(6), 8(12) ), ( 3(4), 4(6) ) ][128X[104X
    [4X[25Xgap>[125X [27XRelatorsOfFpGroup(Source(phi));[127X[104X
    [4X[28X[ a^2, b^2, c^2, (b*c)^3, (a*b)^6, (a*b*c*b)^3, (a*c*b*c)^3, [128X[104X
    [4X[28X  (a*b*a*c)^12, ((a*b)^2*a*c)^12, (a*b*(a*c)^2)^12, (a*b*c*a*c*b)^12 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YA related very common task is to factor group elements into generators:[133X
  
  [1X3.2-3 PreImagesRepresentative[101X
  
  [33X[1;0Y[29X[2XPreImagesRepresentative[102X( [3Xphi[103X, [3Xg[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Ya   representative   of  the  set  of  preimages  of [3Xg[103X  under  the
            epimorphism [3Xphi[103X from a free group to an rcwa group.[133X
  
  [33X[0;0YThe  epimorphism  [3Xphi[103X  must  map  the  generators  of  the free group to the
  generators of the rcwa group one-by-one.[133X
  
  [33X[0;0YThis  method  can  be  used  for  factoring  elements  of  rcwa  groups into
  generators. The implementation is based on [10XRepresentativeActionPreImage[110X, see
  [2XRepresentativeAction[102X ([14X3.3-10[114X).[133X
  
  [33X[0;0YQuite  frequently,  computing several preimages is not harder than computing
  just  one,  i.e.  often  several  preimages  are  found  simultaneously. The
  operation  [10XPreImagesRepresentatives[110X  takes  care  of this. It takes the same
  arguments  as  [10XPreImagesRepresentative[110X  and  returns a list of preimages. If
  multiple  preimages  are  found,  their  quotients  give  rise to nontrivial
  relations among the generators of the image of [3Xphi[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xa := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; SetName(a,"a");[127X[104X
    [4X[25Xgap>[125X [27Xb := ClassShift(0,1);; SetName(b,"b");[127X[104X
    [4X[25Xgap>[125X [27XG := Group(a,b);; # G = <<Collatz permutation>, n -> n + 1>[127X[104X
    [4X[25Xgap>[125X [27Xphi := EpimorphismFromFreeGroup(G);;[127X[104X
    [4X[25Xgap>[125X [27Xg := Comm(a^2*b^4,a*b^3); # a sample element to be factored[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 8>[128X[104X
    [4X[25Xgap>[125X [27XPreImagesRepresentative(phi,g); # -> a factorization of g[127X[104X
    [4X[28Xb^-3*(b^-1*a^-1)^2*b^3*a*b^-1*a*b^3[128X[104X
    [4X[25Xgap>[125X [27Xg = b^-4*a^-1*b^-1*a^-1*b^3*a*b^-1*a*b^3; # check[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xg := Comm(a*b,Comm(a,b^3));[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 8>[128X[104X
    [4X[25Xgap>[125X [27Xpre := PreImagesRepresentatives(phi,g);[127X[104X
    [4X[28X[ (b^-1*a^-1)^2*b^2*(b*a)^2*b^-2, b^-1*(a^-1*b)^2*b^2*(a*b^-1)^2*b^-1 ][128X[104X
    [4X[25Xgap>[125X [27Xrel := pre[1]/pre[2]; # -> a nontrivial relation[127X[104X
    [4X[28X(b^-1*a^-1)^2*b^3*a*b^2*a^-1*b^-2*(b^-1*a)^2*b[128X[104X
    [4X[25Xgap>[125X [27Xrel^phi;[127X[104X
    [4X[28XIdentityMapping( Integers )[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.3 [33X[0;0YThe natural action of an rcwa group on the underlying ring[133X[101X
  
  [33X[0;0YKnowing  a  natural  permutation  representation  of  a  group usually helps
  significantly  in computing in it and in obtaining results on its structure.
  This  holds  particularly  for  the  natural  action of an rcwa group on its
  underlying ring. In this section we describe [5XRCWA[105X's functionality related to
  this action.[133X
  
  [33X[0;0YThe  support,  i.e.  the  set  of  moved  points,  of  an  rcwa group can be
  determined  by  [10XSupport[110X  or  [10XMovedPoints[110X  (these  are synonyms). Testing for
  transitivity on the underlying ring or on a union of residue classes thereof
  is often feasible:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(1,2,0,4),ClassShift(0,2));;[127X[104X
    [4X[25Xgap>[125X [27XIsTransitive(G,Integers);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YGroups  generated  by class transpositions of the integers act on the set of
  nonnegative        integers.        There        is        a        property
  [10XIsTransitiveOnNonnegativeIntegersInSupport([3XG[103X[10X)[110X  which  indicates whether such
  group  acts  transitively on the set of nonnegative integers in its support.
  Since  such transitivity test is a computationally hard problem, methods may
  fail.   If   [10XIsTransitiveOnNonnegativeIntegersInSupport[110X   returns  [10Xtrue[110X,  an
  attribute  [10XTransitivityCertificate[110X  is  set;  this  is  a  record containing
  components  [10Xphi[110X,  [10Xwords[110X,  [10Xclasses[110X,  [10Xsmallpointbound[110X,  [10Xstatus[110X and [10Xcomplete[110X as
  follows:[133X
  
  [8X[10Xphi[110X[8X[108X
        [33X[0;6Yis  an  epimorphism  from  a  free group to [3XG[103X which maps generators to
        generators.[133X
  
  [8X[10Xwords[110X[8X, [10Xclasses[110X[8X[108X
        [33X[0;6Ytwo  lists.  --  [10Xwords[i][110X  is  a preimage under [10Xphi[110X of an element of [3XG[103X
        which  maps  all  sufficiently  large positive integers in the residue
        classes [10Xclasses[i][110X to smaller nonnegative integers.[133X
  
  [8X[10Xsmallpointbound[110X[8X[108X
        [33X[0;6Yin  addition to finding a list of group elements [22Xg_i[122X such that for any
        large enough integer [22Xn[122X in the support of [3XG[103X there is some [22Xg_i[122X such that
        [22Xn^g_i  <  n[122X, for verifying transitivity it was necessary to check that
        all integers less than or equal to [10Xsmallpointbound[110X in the support of [3XG[103X
        lie in the same orbit.[133X
  
  [8X[10Xstatus[110X[8X[108X
        [33X[0;6Ythe  string  [10X"transitive"[110X  in  case  all  checks  have  been completed
        successfully.[133X
  
  [8X[10Xcomplete[110X[8X[108X
        [33X[0;6Y[10Xtrue[110X in case all checks have been completed successfully.[133X
  
  [33X[0;0YParts  of  this information for possibly intransitive groups can be obtained
  by  the  operation [10XTryToComputeTransitivityCertificate([3XG[103X[10X,[3Xsearchlimit[103X[10X)[110X, where
  [3Xsearchlimit[103X  is the maximum radius about a point within which smaller points
  are  searched  and  taken  into  consideration. This operation interprets an
  option  [10Xabortdensity[110X  --  if set, the operation returns the data computed so
  far once the density of the set of positive integers in the support of [3XG[103X for
  which  no group element is found which maps them to smaller integers reaches
  or  drops  below  [10Xabortdensity[110X. A simplified certificate can be obtained via
  [10XSimplifiedCertificate([3Xcert[103X[10X)[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[0,2,1,2],[0,3,2,3],[1,2,2,4]],[127X[104X
    [4X[25X>[125X [27X                   ClassTransposition));[127X[104X
    [4X[28X<(0(2),1(2)),(0(3),2(3)),(1(2),2(4))>[128X[104X
    [4X[25Xgap>[125X [27XIsTransitiveOnNonnegativeIntegersInSupport(G);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XTransitivityCertificate(G);[127X[104X
    [4X[28Xrec( [128X[104X
    [4X[28X  classes := [ [ 1(2) ], [ 2(6) ], [ 6(12), 10(12) ], [ 0(12) ], [128X[104X
    [4X[28X      [ 4(12) ] ], complete := true, [128X[104X
    [4X[28X  phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 0(3), 2(3) ), ( 1(2), 2(4) ) [128X[104X
    [4X[28X     ], smallpointbound := 4, status := "transitive", [128X[104X
    [4X[28X  words := [ a, b, c, b*c, a*b ] )[128X[104X
    [4X[25Xgap>[125X [27XSimplifiedCertificate(last);[127X[104X
    [4X[28Xrec( classes := [ [ 1(2) ], [ 2(4) ], [ 4(12) ], [ 0(12), 8(12) ] ], [128X[104X
    [4X[28X  complete := true, [128X[104X
    [4X[28X  phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 0(3), 2(3) ), ( 1(2), 2(4) ) [128X[104X
    [4X[28X     ], smallpointbound := 4, status := "transitive", [128X[104X
    [4X[28X  words := [ a, c, a*b, b*c ] )[128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[0,2,1,2],[1,2,2,4],[1,4,2,6]],[127X[104X
    [4X[25X>[125X [27X                   ClassTransposition));              # '3n+1 group'[127X[104X
    [4X[28X<(0(2),1(2)),(1(2),2(4)),(1(4),2(6))>[128X[104X
    [4X[25Xgap>[125X [27Xcert := TryToComputeTransitivityCertificate(G,10);[127X[104X
    [4X[28Xrec([128X[104X
    [4X[28X  classes := [ [ 1(2) ], [ 2(4) ], [ 4(32) ], [ 8(24), 44(48), 20(96) ], [128X[104X
    [4X[28X      [ 0(24), 16(24) ] ], complete := false, [128X[104X
    [4X[28X  phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 1(2), 2(4) ), ( 1(4), 2(6) ) [128X[104X
    [4X[28X     ], remaining := [ 12(48), 28(48), 52(96), 84(96) ], [128X[104X
    [4X[28X  smallpointbound := 42, status := "unclear", [128X[104X
    [4X[28X  words := [ a, b, (a*c)^2*b*a*b, c, a*c*b ] )[128X[104X
    [4X[25Xgap>[125X [27XUnion(Flat(cert.classes));[127X[104X
    [4X[28X<union of 90 residue classes (mod 96) (6 classes)>[128X[104X
    [4X[25Xgap>[125X [27XDifference(Integers,Union(Flat(cert.classes)));[127X[104X
    [4X[28X12(48) U 28(48) U 52(96) U 84(96)[128X[104X
    [4X[25Xgap>[125X [27Xcert := TryToComputeTransitivityCertificate(G,20); # try larger bound[127X[104X
    [4X[28Xrec([128X[104X
    [4X[28X  classes := [ [ 1(2) ], [ 2(4) ], [ 4(32) ], [ 8(24), 44(48), 20(96) ], [128X[104X
    [4X[28X      [ 0(24), 16(24) ], [ 12(768), 268(768) ], [ 28(768), 540(768) ] ], [128X[104X
    [4X[28X  complete := false, [128X[104X
    [4X[28X  phi := [ a, b, c ] -> [ ( 0(2), 1(2) ), ( 1(2), 2(4) ), ( 1(4), 2(6) ) [128X[104X
    [4X[28X     ], [128X[104X
    [4X[28X  remaining := [ 52(96), 84(96), 60(192), 108(192), 124(192), 172(192), [128X[104X
    [4X[28X      76(384), 204(384), 220(384), 348(384), 156(768), 396(768), [128X[104X
    [4X[28X      412(768), 652(768) ], smallpointbound := 1074, status := "unclear", [128X[104X
    [4X[28X  words := [ a, b, (a*c)^2*b*a*b, c, a*c*b, (a*c)^3*b*c*b*a*b, [128X[104X
    [4X[28X      (a*c)^4*b*a*b*a*b ] )[128X[104X
    [4X[25Xgap>[125X [27XDifference(Integers,Union(Flat(cert.classes)));[127X[104X
    [4X[28X<union of 44 residue classes (mod 768) (14 classes)>[128X[104X
    [4X[25Xgap>[125X [27XIntersection([0..100],last);[127X[104X
    [4X[28X[ 52, 60, 76, 84 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YLet  [3XG[103X be a subgroup of CT(ℤ). Then, a set which has nontrivial intersection
  with   every  orbit  of  [3XG[103X  on  [22Xℕ_0[122X  can  be  determined  by  the  operation
  [10XSupersetOfOrbitRepresentatives([3XG[103X[10X,[3Xmaxsaddle[103X[10X,[3Xmaxprog[103X[10X)[110X.  This operation returns
  a record with the following components:[133X
  
  [8X[10XR[110X[8X[108X
        [33X[0;6YA  set  which -- possibly among other numbers -- contains the smallest
        representatives  of  all  the orbits of [3XG[103X on the nonnegative integers.
        The  parameters  [3Xmaxsaddle[103X and [3Xmaxprog[103X can be used to control the size
        of this set. In general, larger values may make the set smaller.[133X
  
  [8X[10XD[110X[8X[108X
        [33X[0;6YA  list  of  residue  class  unions  whose union is a (not necessarily
        proper)  superset  the complement of [10XR[110X in ℤ. The intersection of [10XR[110X and
        the union of the sets in [10XD[110X is always finite.[133X
  
  [8X[10Xg[110X[8X[108X
        [33X[0;6YA  list  of  elements  of  [3XG[103X such that [10Xn^g[i] < n[110X for all sufficiently
        large [10Xn[110X in [10XD[i][110X, for [10Xi = 1, ... , Length(g) = Length(D)[110X.[133X
  
  [8X[10Xphi[110X[8X[108X
        [33X[0;6YAn epimorphism from a free group [10XF[110X of rank the number of generators of
        [3XG[103X to [3XG[103X which maps generators to generators.[133X
  
  [8X[10Xw[110X[8X[108X
        [33X[0;6YA  list of words [10Xw[i][110X in [10XF[110X such that [10Xw[i]^phi = g[i][110X, for [10Xi = 1, ... ,
        Length(w) = Length(g)[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(1,3,2,3),ClassTransposition(3,4,4,6),[127X[104X
    [4X[25X>[125X [27X              ClassTransposition(2,4,1,6));[127X[104X
    [4X[28X<(1(3),2(3)),(3(4),4(6)),(2(4),1(6))>[128X[104X
    [4X[25Xgap>[125X [27XR := SupersetOfOrbitRepresentatives(G,4,6);[127X[104X
    [4X[28Xrec( D := [ 2(3), 4(6), 1(6) ], R := 0(3) U [ 1 ], [128X[104X
    [4X[28X  g := [128X[104X
    [4X[28X    [ ( 1(3), 2(3) ), <rcwa permutation of Z with modulus 12 and [128X[104X
    [4X[28X        5 affine parts>, <rcwa permutation of Z with modulus 12 and [128X[104X
    [4X[28X        5 affine parts> ], [128X[104X
    [4X[28X  pi := [ a, b, c ] -> [ ( 1(3), 2(3) ), ( 3(4), 4(6) ), ( 2(4), 1(6) ) ], [128X[104X
    [4X[28X  w := [ a, b, c ] )[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YFurther,  there  are  methods  to compute orbits under the action of an rcwa
  group:[133X
  
  
  [1X3.3-1 [33X[0;0YOrbit (for an rcwa group and either a point or a set)[133X[101X
  
  [33X[1;0Y[29X[2XOrbit[102X( [3XG[103X, [3Xpoint[103X ) [32X method[133X
  [33X[1;0Y[29X[2XOrbit[102X( [3XG[103X, [3Xset[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Ythe  orbit  of  the point [3Xpoint[103X respectively the set [3Xset[103X under the
            natural action of the rcwa group [3XG[103X on its underlying ring.[133X
  
  [33X[0;0YThe  second  argument can either be an element or a subset of the underlying
  ring  of  the rcwa group [3XG[103X. Since orbits under the action of rcwa groups can
  be finite or infinite, and since infinite orbits are not necessarily residue
  class unions, the orbit may either be returned in the form of a list, in the
  form  of  a  residue  class  union  or in the form of an orbit object. It is
  possible to loop over orbits returned as orbit objects, they can be compared
  and  there  is  a  membership  test for them. However note that equality and
  membership for such orbits cannot always be decided.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassShift(0,2),ClassTransposition(0,3,1,3));[127X[104X
    [4X[28X<rcwa group over Z with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XOrbit(G,0);[127X[104X
    [4X[28XZ \ 5(6)[128X[104X
    [4X[25Xgap>[125X [27XOrbit(G,5);[127X[104X
    [4X[28X[ 5 ][128X[104X
    [4X[25Xgap>[125X [27XOrbit(G,ResidueClass(0,2));[127X[104X
    [4X[28X[ 0(2), 1(6) U 2(6) U 3(6), 1(3) U 3(6), 0(3) U 1(6), 0(3) U 4(6), [128X[104X
    [4X[28X  1(3) U 0(6), 0(3) U 2(6), 0(6) U 1(6) U 2(6), 2(6) U 3(6) U 4(6), [128X[104X
    [4X[28X  1(3) U 2(6) ][128X[104X
    [4X[25Xgap>[125X [27XLength(Orbit(G,ResidueClass(0,4)));[127X[104X
    [4X[28X80[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,2),ClassTransposition(0,2,1,4),[127X[104X
    [4X[25X>[125X [27X              ClassReflection(0,3));[127X[104X
    [4X[28X<rcwa group over Z with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27Xorb := Orbit(G,2);[127X[104X
    [4X[28X<orbit of 2 under <wild rcwa group over Z with 3 generators>>[128X[104X
    [4X[25Xgap>[125X [27X1015808 in orb;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XFirst(orb,n->ForAll([n,n+2,n+6,n+8,n+30,n+32,n+36,n+38],IsPrime));[127X[104X
    [4X[28X-19[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.3-2 GrowthFunctionOfOrbit[101X
  
  [33X[1;0Y[29X[2XGrowthFunctionOfOrbit[102X( [3XG[103X, [3Xn[103X, [3Xr_max[103X, [3Xsize_max[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XGrowthFunctionOfOrbit[102X( [3Xorb[103X, [3Xr_max[103X, [3Xsize_max[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Ya  list whose ([22Xr+1[122X)-th entry is the size of the sphere of radius [22Xr[122X
            about  [3Xn[103X under the action of the group [3XG[103X, where the argument [3Xr_max[103X
            is   the  largest  possible  radius  to  be  considered,  and  the
            computation stops once the sphere size exceeds [3Xsize_max[103X.[133X
  
  [33X[0;0YAn option [10X"small"[110X is interpreted -- see example below. In place of the group
  [3XG[103X  and  the point [3Xn[103X, one can pass as first argument also an rcwa group orbit
  object [3Xorb[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[0,4,1,4],[0,3,5,6],[0,4,5,6]],ClassTransposition));[127X[104X
    [4X[28X<(0(4),1(4)),(0(3),5(6)),(0(4),5(6))>[128X[104X
    [4X[25Xgap>[125X [27XGrowthFunctionOfOrbit(G,18,100,20);[127X[104X
    [4X[28X[ 1, 1, 2, 3, 4, 3, 4, 4, 4, 4, 3, 3, 3, 4, 3, 4, 4, 5, 5, 6, 8, 6, 5, [128X[104X
    [4X[28X  5, 4, 3, 3, 4, 4, 4, 3, 3, 5, 4, 5, 6, 5, 2, 3, 3, 2, 3, 3, 4, 5, 4, [128X[104X
    [4X[28X  4, 4, 6, 5, 5, 3, 4, 2, 3, 4, 4, 2, 3, 4, 4, 2, 3, 3, 4, 3, 5, 3, 5, [128X[104X
    [4X[28X  4, 5, 6, 5, 3, 4, 5, 6, 5, 4, 3, 5, 4, 5, 5, 4, 4, 5, 5, 3, 4, 5, 3, [128X[104X
    [4X[28X  3, 4, 5, 4, 2, 3, 4, 4, 4 ][128X[104X
    [4X[25Xgap>[125X [27Xlast = GrowthFunctionOfOrbit(Orbit(G,18),100,20);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XGrowthFunctionOfOrbit(G,18,20,20:small:=[0..100]);[127X[104X
    [4X[28Xrec( smallpoints := [ 18, 24, 25, 27, 30, 32, 33, 36, 37, 39, 40, 41, [128X[104X
    [4X[28X      42, 44, 45, 48, 49, 51, 52, 53, 56, 57, 59, 60, 61, 64, 65, 66, [128X[104X
    [4X[28X      68, 69, 71, 75, 76, 77, 80, 81, 83, 88, 89, 92, 93, 95, 100 ], [128X[104X
    [4X[28X  spheresizes := [ 1, 1, 2, 3, 4, 3, 4, 4, 4, 4, 3, 3, 3, 4, 3, 4, 4, 5, [128X[104X
    [4X[28X      5, 6, 8 ] )[128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[0,2,1,2],[1,2,2,4],[1,4,2,6]],ClassTransposition));[127X[104X
    [4X[28X<(0(2),1(2)),(1(2),2(4)),(1(4),2(6))>[128X[104X
    [4X[25Xgap>[125X [27XGrowthFunctionOfOrbit(G,0,100,10000);[127X[104X
    [4X[28X[ 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 4, 5, 7, 6, 7, 9, 12, 14, 19, 21, 28, [128X[104X
    [4X[28X  29, 37, 42, 55, 57, 72, 78, 99, 113, 148, 164, 215, 226, 288, 344, [128X[104X
    [4X[28X  462, 478, 612, 686, 894, 985, 1284, 1416, 1847, 2018, 2620, 2902, [128X[104X
    [4X[28X  3786, 4167, 5432, 5958, 7749, 8568, 11178 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YGiven    an    rcwa    group    [3XG[103X    over    ℤ    and    an    integer    [3Xn[103X,
  [10XDistanceToNextSmallerPointInOrbit([110X[3XG[103X[10X,[110X[3Xn[103X[10X)[110X  computes  the smallest number [22Xd[122X such
  that  there  is  a  product [22Xg[122X of [22Xd[122X generators or inverses of generators of [3XG[103X
  which  maps [3Xn[103X to an integer with absolute value less than |[3Xn[103X|, provided that
  the  orbit  of  [3Xn[103X  contains  such  integer. [5XRCWA[105X provides a function to draw
  pictures  of orbits of rcwa groups on [22Xℤ^2[122X. The pictures are written to files
  in  bitmap-  (bmp-)  format. The author has successfully tested this feature
  both  under  Linux  and  under  Windows,  and  the generated pictures can be
  processed further with many common graphics programs:[133X
  
  [1X3.3-3 DrawOrbitPicture[101X
  
  [33X[1;0Y[29X[2XDrawOrbitPicture[102X( [3XG[103X, [3Xp0[103X, [3Xbound[103X, [3Xh[103X, [3Xw[103X, [3Xcolored[103X, [3Xpalette[103X, [3Xfilename[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ynothing.[133X
  
  [33X[0;0YDraws  a  picture of the orbit(s) of the point(s) [3Xp0[103X under the action of the
  group [3XG[103X on [22Xℤ^2[122X. The argument [3Xp0[103X is either one point or a list of points. The
  argument  [3Xbound[103X  denotes  the  bound  to  which  the  ball about [3Xp0[103X is to be
  computed,  in  terms  of  absolute  values  of  coordinates. The size of the
  generated  picture  is [3Xh[103X x [3Xw[103X pixels. The argument [3Xcolored[103X is a boolean which
  indicates whether a 24-bit true color picture or a monochrome picture should
  be  generated.  In  the  former  case,  [3Xpalette[103X must be a list of triples of
  integers in the range [22X0, dots, 255[122X, denoting the RGB values of the colors to
  be  used.  In  the  latter  case,  [3Xpalette[103X is not used, and any value can be
  passed.  The  picture  is  written  in bitmap- (bmp-) format to a file named
  [3Xfilename[103X.  This  is done using the utility function [10XSaveAsBitmapPicture[110X from
  [5XResClasses[105X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XPSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(2),[127X[104X
    [4X[25X>[125X [27X                                                   CyclicGroup(3))));;[127X[104X
    [4X[25Xgap>[125X [27XDrawOrbitPicture(PSL2Z,[0,1],2000,512,512,false,fail,"example1.bmp");[127X[104X
    [4X[25Xgap>[125X [27XDrawOrbitPicture(PSL2Z,Combinations([1..4],2),2000,512,512,true,[127X[104X
    [4X[25X>[125X [27X                    [[255,0,0],[0,255,0],[0,0,255]],"example2.bmp");[127X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe pictures drawn in the examples are shown on [5XRCWA[105X's webpage.[133X
  
  [33X[0;0YFinite  orbits  give  rise to finite quotients of a group, and finite cycles
  can  help  to  check  for conjugacy. Therefore it is important to be able to
  determine them:[133X
  
  
  [1X3.3-4 [33X[0;0YShortOrbits (for rcwa groups) & ShortCycles (for rcwa permutations)[133X[101X
  
  [33X[1;0Y[29X[2XShortOrbits[102X( [3XG[103X, [3XS[103X, [3Xmaxlng[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XShortOrbits[102X( [3XG[103X, [3XS[103X, [3Xmaxlng[103X, [3Xmaxn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XShortCycles[102X( [3Xg[103X, [3XS[103X, [3Xmaxlng[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XShortCycles[102X( [3Xg[103X, [3XS[103X, [3Xmaxlng[103X, [3Xmaxn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XShortCycles[102X( [3Xg[103X, [3Xmaxlng[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Yin  the  first  form  a  list of all orbits of the rcwa group [3XG[103X of
            length  at  most  [3Xmaxlng[103X  which  intersect  non-trivially with the
            set [3XS[103X. In the second form a list of all orbits of the rcwa group [3XG[103X
            of  length  at  most [3Xmaxlng[103X which intersect non-trivially with the
            set [3XS[103X  and  which, in terms of euclidean norm, do not exceed [3Xmaxn[103X.
            In  the  third form a list of all cycles of the rcwa permutation [3Xg[103X
            of  length  at  most [3Xmaxlng[103X which intersect non-trivially with the
            set [3XS[103X.  In  the  fourth  form  a  list  of  all cycles of the rcwa
            permutation   [3Xg[103X   of   length   at   most [3Xmaxlng[103X  which  intersect
            non-trivially  with  the  set [3XS[103X  and  which, in terms of euclidean
            norm,  do  not exceed [3Xmaxn[103X. In the fifth form a list of all cycles
            of  the  rcwa  permutation [3Xg[103X of length at most [3Xmaxlng[103X which do not
            correspond to cycles consisting of residue classes.[133X
  
  [33X[0;0YThe  operation  [2XShortOrbits[102X  recognizes  an option [3Xfinite[103X. If this option is
  set,  it  is  assumed  that  all orbits are finite, in order to speed up the
  computation.  If  furthermore [3Xmaxlng[103X is negative, a list of [13Xall[113X orbits which
  intersect non-trivially with [3XS[103X is returned.[133X
  
  [33X[0;0YThere is an operation [10XCyclesOnFiniteOrbit([110X[3XG[103X[10X,[110X[3Xg[103X[10X,[110X[3Xn[103X[10X)[110X which returns a list of all
  cycles  of  the  rcwa  permutation  [3Xg[103X  on the orbit of the point [3Xn[103X under the
  action of the rcwa group [3XG[103X. Here [3Xg[103X is assumed to be an element of [3XG[103X, and the
  orbit of [3Xn[103X is assumed to be finite.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(1,4,2,4)*ClassTransposition(1,4,3,4),[127X[104X
    [4X[25X>[125X [27X              ClassTransposition(3,9,6,18)*ClassTransposition(1,6,3,9));;[127X[104X
    [4X[25Xgap>[125X [27XList(ShortOrbits(G,[-15..15],100),[127X[104X
    [4X[25X>[125X [27X        orb->StructureDescription(Action(G,orb)));[127X[104X
    [4X[28X[ "A15", "A4", "1", "1", "C3", "1", "(C2 x C2 x C2) : (C7 : C3)", "1", [128X[104X
    [4X[28X  "1", "C3", "A19" ][128X[104X
    [4X[25Xgap>[125X [27XShortCycles(mKnot(7),[1..100],20);[127X[104X
    [4X[28X[ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7, 8 ], [ 9, 10 ], [128X[104X
    [4X[28X  [ 11, 12 ], [ 13, 14, 16, 18, 20, 22, 19, 17, 15 ], [ 21, 24 ], [128X[104X
    [4X[28X  [ 23, 26 ], [ 25, 28, 32, 36, 31, 27, 30, 34, 38, 33, 29 ], [128X[104X
    [4X[28X  [ 35, 40 ], [ 37, 42, 48, 54, 47, 41, 46, 52, 45, 39, 44, 50, 43 ], [128X[104X
    [4X[28X  [ 77, 88, 100, 114, 130, 148, 127, 109, 124, 107, 122, 105, 120, 103, [128X[104X
    [4X[28X      89 ] ][128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[0,2,1,2],[0,5,4,5],[1,4,0,6]],ClassTransposition));;[127X[104X
    [4X[25Xgap>[125X [27XCyclesOnFiniteOrbit(G,G.1*G.2,0);[127X[104X
    [4X[28X[ [ 0, 1, 4, 9, 8, 5 ], [ 6, 7 ], [ 10, 11, 14, 19, 18, 15 ], [ 12, 13 ] ][128X[104X
    [4X[25Xgap>[125X [27XList(CyclesOnFiniteOrbit(G,G.1*G.2*G.3*G.1*G.3*G.2,32),Length);[127X[104X
    [4X[28X[ 3148, 3148 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.3-5 [33X[0;0YShortResidueClassOrbits & ShortResidueClassCycles[133X[101X
  
  [33X[1;0Y[29X[2XShortResidueClassOrbits[102X( [3XG[103X, [3Xmodulusbound[103X, [3Xmaxlng[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XShortResidueClassCycles[102X( [3Xg[103X, [3Xmodulusbound[103X, [3Xmaxlng[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XResidueClassCyclesThroughResidueClass[102X( [3Xg[103X, [3Xcl[103X, [3Xmodulusbound[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Yin  the  first  form a list of all orbits of residue classes under
            the  action of the rcwa group [3XG[103X which contain a residue class [22Xr(m)[122X
            such  that  [22Xm[122X  divides  [3Xmodulusbound[103X and which are not longer than
            [3Xmaxlng[103X. In the second form a list of all cycles of residue classes
            of  the rcwa permutation [3Xg[103X which contain a residue class [22Xr(m)[122X such
            that  [22Xm[122X divides [3Xmodulusbound[103X and which are not longer than [3Xmaxlng[103X.
            In  the  third form a list of all cycles of residue classes of the
            rcwa  permutation [3Xg[103X  which contain a residue class [22Xr(m)[122X which is a
            subset  of  the  residue  class  [3Xcl[103X on which [3Xg[103X is affine and whose
            modulus [22Xm[122X divides [3Xmodulusbound[103X.[133X
  
  [33X[0;0YWe  are only talking about a [13Xcycle[113X of residue classes of an rcwa permutation
  [22Xg[122X  if  the  restrictions  of  [22Xg[122X to all contained residue classes are affine.
  Similarly  we  are  only talking about an [13Xorbit[113X of residue classes under the
  action  of  an  rcwa group [22XG[122X if the restrictions of all elements of [22XG[122X to all
  residue classes in the orbit are affine.[133X
  
  [33X[0;0YThe  returned  lists  may contain additional cycles, resp., orbits, which do
  not contain a residue class [22Xr(m)[122X such that [22Xm[122X divides [3Xmodulusbound[103X, but which
  happen to be found without additional efforts.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xg := ClassTransposition(0,2,1,2)*ClassTransposition(0,4,1,6);[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 12>[128X[104X
    [4X[25Xgap>[125X [27XShortResidueClassCycles(g,Mod(g)^2,20);[127X[104X
    [4X[28X[ [ 2(12), 3(12) ], [ 10(12), 11(12) ], [ 4(24), 5(24), 7(36), 6(36) ], [128X[104X
    [4X[28X  [ 20(24), 21(24), 31(36), 30(36) ], [128X[104X
    [4X[28X  [ 8(48), 9(48), 13(72), 19(108), 18(108), 12(72) ], [128X[104X
    [4X[28X  [ 40(48), 41(48), 61(72), 91(108), 90(108), 60(72) ], [128X[104X
    [4X[28X  [ 16(96), 17(96), 25(144), 37(216), 55(324), 54(324), 36(216), 24(144) [128X[104X
    [4X[28X     ], [128X[104X
    [4X[28X  [ 80(96), 81(96), 121(144), 181(216), 271(324), 270(324), 180(216), [128X[104X
    [4X[28X      120(144) ] ][128X[104X
    [4X[25Xgap>[125X [27XResidueClassCyclesThroughResidueClass(g,ResidueClass(1,4),2^2*12);[127X[104X
    [4X[28X[ [ 5(24), 7(36), 6(36), 4(24) ], [ 21(24), 31(36), 30(36), 20(24) ], [128X[104X
    [4X[28X  [ 9(48), 13(72), 19(108), 18(108), 12(72), 8(48) ], [128X[104X
    [4X[28X  [ 41(48), 61(72), 91(108), 90(108), 60(72), 40(48) ] ][128X[104X
    [4X[25Xgap>[125X [27XCollected(List(ResidueClassCyclesThroughResidueClass(g,[127X[104X
    [4X[25X>[125X [27X                  ResidueClass(1,4),2^6*12),Length));[127X[104X
    [4X[28X[ [ 4, 2 ], [ 6, 4 ], [ 8, 6 ], [ 10, 8 ], [ 12, 4 ], [ 14, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27XList(ResidueClassCyclesThroughResidueClass(g,[127X[104X
    [4X[25X>[125X [27X        ResidueClass(1,4),2^4*12),cyc->cyc[1]);[127X[104X
    [4X[28X[ 5(24), 21(24), 9(48), 41(48), 13(72), 61(72), 17(96), 81(96), 25(144), [128X[104X
    [4X[28X  121(144), 33(192), 161(192) ][128X[104X
    [4X[25Xgap>[125X [27XDisplay(Difference(ResidueClass(1,4),Union(last)));[127X[104X
    [4X[28X1(36) U 49(144) U 97(144) U 65(192) U 129(192)[128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[0,6,5,6],[1,4,4,6],[2,4,3,6]],ClassTransposition));[127X[104X
    [4X[28X<(0(6),5(6)),(1(4),4(6)),(2(4),3(6))>[128X[104X
    [4X[25Xgap>[125X [27XShortResidueClassOrbits(G,48,10);[127X[104X
    [4X[28X[ [ 7(12) ], [ 8(12) ], [ 1(24), 4(36) ], [ 2(24), 3(36) ], [128X[104X
    [4X[28X  [ 12(24), 17(24), 28(36) ], [ 18(24), 23(24), 27(36) ], [128X[104X
    [4X[28X  [ 37(48), 58(72), 87(108) ], [ 38(48), 57(72), 88(108) ], [128X[104X
    [4X[28X  [ 0(48), 5(48), 10(72), 15(108) ], [ 6(48), 11(48), 9(72), 16(108) ] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.3-6 ComputeCycleLength[101X
  
  [33X[1;0Y[29X[2XComputeCycleLength[102X( [3Xg[103X, [3Xn[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya record containing the length, the largest point and the position
            of  the largest point of the cycle of the rcwa permutation [3Xg[103X which
            contains the point [3Xn[103X, provided that this cycle is finite.[133X
  
  [33X[0;0YIf the cycle is infinite, the function will run into an infinite loop unless
  the  option  [10X"abortat"[110X  is set to the maximum number of iterates to be tried
  before  aborting.  Iterates  are  not  stored,  to save memory. The function
  interprets  an  option  [10X"notify"[110X,  which  defaults  to  10000;  every [21Xnotify[121X
  iterations,  the  number  of binary digits of the latest iterate is printed.
  This  output  can  be  suppressed  by  the  option  [10Xquiet[110X. The function also
  interprets an option [10X"small"[110X, which may be set to a range within which small
  points are recorded and returned in a component [10Xsmallpoints[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xg := Product(List([[0,5,3,5],[1,2,0,6],[2,4,3,6]],[127X[104X
    [4X[25X>[125X [27X                     ClassTransposition));[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 180>[128X[104X
    [4X[25Xgap>[125X [27XComputeCycleLength(g,20:small:=[0..1000]);[127X[104X
    [4X[28Xn = 20: after 10000 steps, the iterate has 1919 binary digits.[128X[104X
    [4X[28Xn = 20: after 20000 steps, the iterate has 2908 binary digits.[128X[104X
    [4X[28Xn = 20: after 30000 steps, the iterate has 1531 binary digits.[128X[104X
    [4X[28Xn = 20: after 40000 steps, the iterate has 708 binary digits.[128X[104X
    [4X[28Xrec( aborted := false, g := <rcwa permutation of Z with modulus 180>, [128X[104X
    [4X[28X  length := 45961, [128X[104X
    [4X[28X  maximum := 180479928411509527091314790144929480041473309862957394384783\[128X[104X
    [4X[28X0525935437431021442346166422201250935268553945158085769924448388724679753\[128X[104X
    [4X[28X5271669245363980744610119632280105994423399614803956244808653465492205657\[128X[104X
    [4X[28X8650363041608376587943180444494842094693691286183613056599672737336761093\[128X[104X
    [4X[28X3101035841077322874883200384115281051837032147150147712534199292886436789\[128X[104X
    [4X[28X7520389780289517825203780151058517520194926468391308525704499649905091899\[128X[104X
    [4X[28X9667529835495635671154681958992898010506577172313321500572646883756736685\[128X[104X
    [4X[28X0158653917532084531267455434808219032998691038943070902228427549279555530\[128X[104X
    [4X[28X6429870190316109419051531138721361826083376315737131067799731181096142797\[128X[104X
    [4X[28X4868525347003646887454985757711743327946232372385342293662007684758208408\[128X[104X
    [4X[28X8635715976464060647431260835037213863991037813998261883899050447111540742\[128X[104X
    [4X[28X5857187943077255493709629738212709349458790098815926920248565399938335540\[128X[104X
    [4X[28X8092502449690267365120996852, maxpos := 19825, n := 20, [128X[104X
    [4X[28X  smallpoints := [ 20, 23, 66, 99, 294, 295, 298, 441, 447, 882, 890, [128X[104X
    [4X[28X      893 ] )[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.3-7 CycleRepresentativesAndLengths[101X
  
  [33X[1;0Y[29X[2XCycleRepresentativesAndLengths[102X( [3Xg[103X, [3XS[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ya  list  of  pairs (cycle representative, length of cycle) for all
            cycles   of  the  rcwa  permutation  [3Xg[103X  which  have  a  nontrivial
            intersection with the set [3XS[103X, where fixed points are omitted.[133X
  
  [33X[0;0YThe  rcwa  permutation  [3Xg[103X is assumed to have only finite cycles. If [3Xg[103X has an
  infinite  cycle  which  intersects  non-trivially  with [3XS[103X, this may cause an
  infinite loop unless a cycle length limit is set via the option [10Xabortat[110X. The
  output can be suppressed by the option [10Xquiet[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xg := ClassTransposition(0,2,1,2)*ClassTransposition(0,4,1,6);;[127X[104X
    [4X[25Xgap>[125X [27XCycleRepresentativesAndLengths(g,[0..50]);[127X[104X
    [4X[28X[ [ 2, 2 ], [ 4, 4 ], [ 8, 6 ], [ 10, 2 ], [ 14, 2 ], [ 16, 8 ], [128X[104X
    [4X[28X  [ 20, 4 ], [ 22, 2 ], [ 26, 2 ], [ 28, 4 ], [ 32, 10 ], [ 34, 2 ], [128X[104X
    [4X[28X  [ 38, 2 ], [ 40, 6 ], [ 44, 4 ], [ 46, 2 ], [ 50, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27Xg := Product(List([[0,5,3,5],[1,2,0,6],[2,4,3,6]],[127X[104X
    [4X[25X>[125X [27X                     ClassTransposition));[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 180>[128X[104X
    [4X[25Xgap>[125X [27XCycleRepresentativesAndLengths(g,[0..100]:abortat:=100000);[127X[104X
    [4X[28Xn = 20: after 10000 steps, the iterate has 1919 binary digits.[128X[104X
    [4X[28Xn = 20: after 20000 steps, the iterate has 2908 binary digits.[128X[104X
    [4X[28Xn = 20: after 30000 steps, the iterate has 1531 binary digits.[128X[104X
    [4X[28Xn = 20: after 40000 steps, the iterate has 708 binary digits.[128X[104X
    [4X[28Xn = 79: after 10000 steps, the iterate has 1679 binary digits.[128X[104X
    [4X[28Xn = 100: after 10000 steps, the iterate has 712 binary digits.[128X[104X
    [4X[28Xn = 100: after 20000 steps, the iterate has 2507 binary digits.[128X[104X
    [4X[28Xn = 100: after 30000 steps, the iterate has 3311 binary digits.[128X[104X
    [4X[28Xn = 100: after 40000 steps, the iterate has 3168 binary digits.[128X[104X
    [4X[28Xn = 100: after 50000 steps, the iterate has 3947 binary digits.[128X[104X
    [4X[28Xn = 100: after 60000 steps, the iterate has 4793 binary digits.[128X[104X
    [4X[28Xn = 100: after 70000 steps, the iterate has 5325 binary digits.[128X[104X
    [4X[28Xn = 100: after 80000 steps, the iterate has 6408 binary digits.[128X[104X
    [4X[28Xn = 100: after 90000 steps, the iterate has 7265 binary digits.[128X[104X
    [4X[28Xn = 100: after 100000 steps, the iterate has 7918 binary digits.[128X[104X
    [4X[28X[ [ 0, 7 ], [ 5, 3 ], [ 7, 7159 ], [ 11, 9 ], [ 19, 342 ],[128X[104X
    [4X[28X  [ 20, 45961 ], [ 25, 3 ], [ 26, 21 ], [ 29, 2 ], [ 31, 3941 ],[128X[104X
    [4X[28X  [ 34, 19 ], [ 37, 7 ], [ 40, 5 ], [ 41, 7 ], [ 46, 3 ], [ 49, 2 ],[128X[104X
    [4X[28X  [ 59, 564 ], [ 61, 577 ], [ 65, 3 ], [ 67, 23 ], [ 71, 41 ],[128X[104X
    [4X[28X  [ 79, 16984 ], [ 80, 5 ], [ 85, 3 ], [ 86, 3 ], [ 89, 2 ], [ 91, 9 ],[128X[104X
    [4X[28X  [ 94, 1355 ], [ 97, 7 ], [ 100, fail ] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YOften  one  also  wants  to know which residue classes an rcwa mapping or an
  rcwa group fixes setwise:[133X
  
  [1X3.3-8 FixedResidueClasses[101X
  
  [33X[1;0Y[29X[2XFixedResidueClasses[102X( [3Xg[103X, [3Xmaxmod[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XFixedResidueClasses[102X( [3XG[103X, [3Xmaxmod[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ythe  set  of  residue classes with modulus greater than 1 and less
            than or equal to [3Xmaxmod[103X which the rcwa mapping [3Xg[103X, respectively the
            rcwa group [3XG[103X, fixes setwise.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XFixedResidueClasses(ClassTransposition(0,2,1,4),8);[127X[104X
    [4X[28X[ 2(3), 3(4), 4(5), 6(7), 3(8), 7(8) ][128X[104X
    [4X[25Xgap>[125X [27XFixedResidueClasses(Group(ClassTransposition(0,2,1,4),[127X[104X
    [4X[25X>[125X [27X                             ClassTransposition(0,3,1,3)),12);[127X[104X
    [4X[28X[ 2(3), 8(9), 11(12) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YFrequently  one  needs  to  compute balls of certain radius around points or
  group elements, be it to estimate the growth of a group, be it to see how an
  orbit  looks  like,  be  it  to  search  for  a  group  element with certain
  properties or be it for other purposes:[133X
  
  
  [1X3.3-9  [33X[0;0YBall  (for  group,  element  and  radius  or group, point, radius and[101X
  [1Xaction)[133X[101X
  
  [33X[1;0Y[29X[2XBall[102X( [3XG[103X, [3Xg[103X, [3Xr[103X ) [32X method[133X
  [33X[1;0Y[29X[2XBall[102X( [3XG[103X, [3Xp[103X, [3Xr[103X, [3Xaction[103X ) [32X method[133X
  [33X[1;0Y[29X[2XBall[102X( [3XG[103X, [3Xp[103X, [3Xr[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Ythe  ball  of  radius [3Xr[103X  around  the  element [3Xg[103X  in  the  group [3XG[103X,
            respectively  the  ball  of  radius [3Xr[103X around the point [3Xp[103X under the
            action [3Xaction[103X  of  the  group [3XG[103X, respectively the ball of radius [3Xr[103X
            around the point [3Xp[103X under the action [10XOnPoints[110X of the group [3XG[103X,[133X
  
  [33X[0;0YAll balls are understood with respect to [10XGeneratorsOfGroup([3XG[103X[10X)[110X. As membership
  tests can be expensive, the former method does not check whether [3Xg[103X is indeed
  an  element  of [3XG[103X. The methods require that element- / point comparisons are
  cheap. They are not only applicable to rcwa groups. If the option [3XSpheres[103X is
  set,  the  ball  is  split  up and returned as a list of spheres. There is a
  related  operation  [10XRestrictedBall([3XG[103X[10X,[3Xg[103X[10X,[3Xr[103X[10X,[3Xmodulusbound[103X[10X)[110X specifically for rcwa
  groups  which  computes  only those elements of the ball whose moduli do not
  exceed  [3Xmodulusbound[103X,  and  which  can  be  reached from [3Xg[103X without computing
  intermediate  elements  whose  moduli  do  exceed  [3Xmodulusbound[103X.  The latter
  operation  interprets an option [10X"boundaffineparts"[110X. -- If this option is set
  and  the  group  [3XG[103X  and  the  element  [3Xg[103X  are in sparse representation, then
  [3Xmodulusbound[103X  is  actually taken to be a bound on the number of affine parts
  rather than a bound on the modulus.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XPSL2Z := Image(IsomorphismRcwaGroup(FreeProduct(CyclicGroup(2),[127X[104X
    [4X[25X>[125X [27X                                                   CyclicGroup(3))));;[127X[104X
    [4X[25Xgap>[125X [27XList([1..10],k->Length(Ball(PSL2Z,[0,1],k,OnTuples)));[127X[104X
    [4X[28X[ 4, 8, 14, 22, 34, 50, 74, 106, 154, 218 ][128X[104X
    [4X[25Xgap>[125X [27XBall(Group((1,2),(2,3),(3,4)),(),2:Spheres);[127X[104X
    [4X[28X[ [ () ], [ (3,4), (2,3), (1,2) ],[128X[104X
    [4X[28X  [ (2,3,4), (2,4,3), (1,2)(3,4), (1,2,3), (1,3,2) ] ][128X[104X
    [4X[25Xgap>[125X [27XG := Group(List([[1,2,4,6],[1,3,2,6],[2,3,4,6]],ClassTransposition));;[127X[104X
    [4X[25Xgap>[125X [27XB := RestrictedBall(G,One(G),20,36:Spheres);; # try replacing 36 by 72[127X[104X
    [4X[25Xgap>[125X [27XList(B,Length);[127X[104X
    [4X[28X[ 1, 3, 6, 12, 4, 6, 6, 4, 4, 4, 6, 6, 3, 3, 2, 0, 0, 0, 0, 0, 0 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIt  is  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:[133X
  
  [1X3.3-10 RepresentativeAction[101X
  
  [33X[1;0Y[29X[2XRepresentativeAction[102X( [3XG[103X, [3Xsource[103X, [3Xdestination[103X, [3Xaction[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Yan  element of [3XG[103X which maps [3Xsource[103X to [3Xdestination[103X under the action
            given by [3Xaction[103X.[133X
  
  [33X[0;0YIf  an  element satisfying this condition does not exist, this method either
  returns  [10Xfail[110X  or runs into an infinite loop. The problem whether [3Xsource[103X and
  [3Xdestination[103X  lie in the same orbit under the action [3Xaction[103X of [3XG[103X is hard, and
  in its general form most likely computationally undecidable.[133X
  
  [33X[0;0YIn  cases  where  rather a word in the generators of [3XG[103X than the actual group
  element is needed, one should use the operation [10XRepresentativeActionPreImage[110X
  instead. This operation takes five arguments. The first four are the same as
  those  of  [10XRepresentativeAction[110X,  and  the  fifth  is  a  free  group  whose
  generators  are  to  be  used  as  letters  of  the returned word. Note that
  [10XRepresentativeAction[110X  calls  [10XRepresentativeActionPreImage[110X  and evaluates the
  returned  word.  The  evaluation  of the word can very well take most of the
  time if [3XG[103X is wild and coefficient explosion occurs.[133X
  
  [33X[0;0YThe algorithm is based on computing balls of increasing radius around [3Xsource[103X
  and [3Xdestination[103X until they intersect non-trivially.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xa := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; SetName(a,"a");[127X[104X
    [4X[25Xgap>[125X [27Xb := ClassShift(1,4:Name:="b");; G := Group(a,b);;[127X[104X
    [4X[25Xgap>[125X [27Xelm := RepresentativeAction(G,[7,4,9],[4,5,13],OnTuples);;[127X[104X
    [4X[25Xgap>[125X [27XDisplay(elm);[127X[104X
    [4X[28X[128X[104X
    [4X[28XRcwa permutation of Z with modulus 12[128X[104X
    [4X[28X[128X[104X
    [4X[28X        /[128X[104X
    [4X[28X        | n-3 if n in 1(6) U 10(12)[128X[104X
    [4X[28X        | n+4 if n in 5(12) U 9(12)[128X[104X
    [4X[28X n |-> <  n+1 if n in 4(12)[128X[104X
    [4X[28X        | n   if n in 0(6) U 2(6) U 3(12) U 11(12)[128X[104X
    [4X[28X        |[128X[104X
    [4X[28X        \[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XList([7,4,9],n->n^elm);[127X[104X
    [4X[28X[ 4, 5, 13 ][128X[104X
    [4X[25Xgap>[125X [27Xelm := RepresentativeAction(G,[6,-3,8],[-9,4,11],OnPoints);;[127X[104X
    [4X[25Xgap>[125X [27XDisplay(elm);[127X[104X
    [4X[28X[128X[104X
    [4X[28XRcwa permutation of Z with modulus 12[128X[104X
    [4X[28X[128X[104X
    [4X[28X        /[128X[104X
    [4X[28X        | 2n/3      if n in 0(6) U 3(12)[128X[104X
    [4X[28X        | (4n+1)/3  if n in 2(6) U 11(12)[128X[104X
    [4X[28X        | (4n-1)/3  if n in 4(6) U 7(12)[128X[104X
    [4X[28X n |-> <  (2n-8)/3  if n in 1(12)[128X[104X
    [4X[28X        | (4n-17)/3 if n in 5(12)[128X[104X
    [4X[28X        | (4n-15)/3 if n in 9(12)[128X[104X
    [4X[28X        |[128X[104X
    [4X[28X        \[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27X[6,-3,8]^elm; List([6,-3,8],n->n^elm); # `OnPoints' allows reordering[127X[104X
    [4X[28X[ -9, 4, 11 ][128X[104X
    [4X[28X[ 4, -9, 11 ][128X[104X
    [4X[25Xgap>[125X [27XF := FreeGroup("a","b");; phi := EpimorphismByGenerators(F,G);;[127X[104X
    [4X[25Xgap>[125X [27Xw := RepresentativeActionPreImage(G,[10,-4,9,5],[4,5,13,-8],[127X[104X
    [4X[25X>[125X [27X                                     OnTuples,F);[127X[104X
    [4X[28Xa*b^-1*a^-1*(b^-1*a)^2*b*a*b^-2*a*b*a^-1*b[128X[104X
    [4X[25Xgap>[125X [27Xelm := w^phi;[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 324>[128X[104X
    [4X[25Xgap>[125X [27XList([10,-4,9,5],n->n^elm);[127X[104X
    [4X[28X[ 4, 5, 13, -8 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YSometimes  an  rcwa  group  fixes a certain partition of the underlying ring
  into unions of residue classes. If this happens, then any orbit is clearly a
  subset  of exactly one of these parts. Further, such a partition often gives
  rise to proper quotients of the group:[133X
  
  [1X3.3-11 ProjectionsToInvariantUnionsOfResidueClasses[101X
  
  [33X[1;0Y[29X[2XProjectionsToInvariantUnionsOfResidueClasses[102X( [3XG[103X, [3Xm[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ythe  projections  of  the  rcwa  group [3XG[103X  to the unions of residue
            classes (mod [3Xm[103X) which it fixes setwise.[133X
  
  [33X[0;0YThe  corresponding  partition  of  a  set of representatives for the residue
  classes (mod [3Xm[103X) can be obtained by the operation [10XOrbitsModulo([3XG[103X[10X,[3Xm[103X[10X)[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,2),ClassShift(3,4));;[127X[104X
    [4X[25Xgap>[125X [27XProjectionsToInvariantUnionsOfResidueClasses(G,4);[127X[104X
    [4X[28X[ [ ( 0(2), 1(2) ), ClassShift( 3(4) ) ] -> [128X[104X
    [4X[28X    [ ( 0(4), 1(4) ), IdentityMapping( Integers ) ], [128X[104X
    [4X[28X  [ ( 0(2), 1(2) ), ClassShift( 3(4) ) ] -> [128X[104X
    [4X[28X    [ ( 2(4), 3(4) ), <rcwa permutation of Z with modulus 4> ] ][128X[104X
    [4X[25Xgap>[125X [27XList(last,phi->Support(Image(phi)));[127X[104X
    [4X[28X[ 0(4) U 1(4), 2(4) U 3(4) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YGiven  two  partitions of the underlying ring into the same number of unions
  of  residue  classes, there is always an rcwa permutation which maps the one
  to the other:[133X
  
  [1X3.3-12 RepresentativeAction[101X
  
  [33X[1;0Y[29X[2XRepresentativeAction[102X( [3XRCWA(R)[103X, [3XP1[103X, [3XP2[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Yan element of RCWA([22XR[122X) which maps the partition [3XP1[103X to [3XP2[103X.[133X
  
  [33X[0;0YThe arguments [3XP1[103X and [3XP2[103X must be partitions of the underlying ring [22XR[122X into the
  same  number  of  unions of residue classes. The method for [22XR = ℤ[122X recognizes
  the option [10XIsTame[110X, which can be used to demand a tame result. If this option
  is set and there is no tame rcwa permutation which maps [3XP1[103X to [3XP2[103X, the method
  runs  into  an infinite loop. This happens if the condition in Theorem 2.8.9
  in [Koh05]  is  not  satisfied.  If  the  option  [10XIsTame[110X  is not set and the
  partitions  [3XP1[103X  and [3XP2[103X both consist entirely of single residue classes, then
  the returned mapping is affine on any residue class in [3XP1[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XP1 := AllResidueClassesModulo(3);[127X[104X
    [4X[28X[ 0(3), 1(3), 2(3) ][128X[104X
    [4X[25Xgap>[125X [27XP2 := List([[0,2],[1,4],[3,4]],ResidueClass);[127X[104X
    [4X[28X[ 0(2), 1(4), 3(4) ][128X[104X
    [4X[25Xgap>[125X [27Xelm := RepresentativeAction(RCWA(Integers),P1,P2);[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 3>[128X[104X
    [4X[25Xgap>[125X [27XP1^elm = P2;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsTame(elm);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xelm := RepresentativeAction(RCWA(Integers),P1,P2:IsTame);[127X[104X
    [4X[28X<tame rcwa permutation of Z with modulus 24>[128X[104X
    [4X[25Xgap>[125X [27XP1^elm = P2;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xelm := RepresentativeAction(RCWA(Integers),[127X[104X
    [4X[25X>[125X [27X            [ResidueClass(1,3),[127X[104X
    [4X[25X>[125X [27X             ResidueClassUnion(Integers,3,[0,2])],[127X[104X
    [4X[25X>[125X [27X            [ResidueClassUnion(Integers,5,[2,4]),[127X[104X
    [4X[25X>[125X [27X             ResidueClassUnion(Integers,5,[0,1,3])]);[127X[104X
    [4X[28X<rcwa permutation of Z with modulus 6>[128X[104X
    [4X[25Xgap>[125X [27X[ResidueClass(1,3),ResidueClassUnion(Integers,3,[0,2])]^elm;[127X[104X
    [4X[28X[ 2(5) U 4(5), Z \ 2(5) U 4(5) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.3-13 CollatzLikeMappingByOrbitTree[101X
  
  [33X[1;0Y[29X[2XCollatzLikeMappingByOrbitTree[102X( [3XG[103X, [3Xn[103X, [3Xmin_r[103X, [3Xmax_r[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Yeither an rcwa mapping [22Xf[122X which maps the sphere of radius [22Xr[122X about [3Xn[103X
            under  the  action  of [3XG[103X into the sphere of radius [22Xr-1[122X about [3Xn[103X for
            every [22Xr[122X ranging from [3Xmin_r[103X to [3Xmax_r[103X, or [10Xfail[110X.[133X
  
  [33X[0;0YObviously  not  for  every  rcwa group and every root point a mapping [22Xf[122X with
  these  properties exists, and if it exists, it usually depends on the choice
  of generators of the group.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,2,1,2),ClassTransposition(1,2,2,4),[127X[104X
    [4X[25X>[125X [27X              ClassTransposition(1,4,2,6));;[127X[104X
    [4X[25Xgap>[125X [27XG := SparseRep(G);;[127X[104X
    [4X[25Xgap>[125X [27Xf := CollatzLikeMappingByOrbitTree(G,0,4,10);[127X[104X
    [4X[28X<rcwa mapping of Z with modulus 4 and 4 affine parts>[128X[104X
    [4X[25Xgap>[125X [27XDisplay(f);[127X[104X
    [4X[28X[128X[104X
    [4X[28XRcwa mapping of Z with modulus 4 and 4 affine parts[128X[104X
    [4X[28X[128X[104X
    [4X[28X        /[128X[104X
    [4X[28X        | n+1      if n in 0(4)[128X[104X
    [4X[28X        | (3n+1)/2 if n in 1(4)[128X[104X
    [4X[28X n |-> <  n/2      if n in 2(4)[128X[104X
    [4X[28X        | n-1      if n in 3(4)[128X[104X
    [4X[28X        |[128X[104X
    [4X[28X        \[128X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XB := Ball(G,0,15:Spheres);[127X[104X
    [4X[28X[ [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 6 ], [ 7 ], [ 14 ], [ 9, 15 ], [ 8, 18, 30 ], [128X[104X
    [4X[28X  [ 5, 19, 31 ], [ 4, 10, 38, 62 ], [ 11, 25, 39, 41, 63 ], [128X[104X
    [4X[28X  [ 22, 24, 40, 50, 78, 82, 126 ], [ 23, 33, 51, 79, 83, 127 ], [128X[104X
    [4X[28X  [ 32, 46, 66, 102, 158, 166, 254 ], [128X[104X
    [4X[28X  [ 21, 47, 67, 103, 105, 159, 167, 169, 255 ] ][128X[104X
    [4X[25Xgap>[125X [27XList([3..15],i->IsSubset(B[i-1],B[i]^f));[127X[104X
    [4X[28X[ true, true, true, true, true, true, true, true, true, true, true, true,[128X[104X
    [4X[28X  true ][128X[104X
    [4X[25Xgap>[125X [27XTrajectory(f,52,[0,1]);[127X[104X
    [4X[28X[ 52, 53, 80, 81, 122, 61, 92, 93, 140, 141, 212, 213, 320, 321, 482, 241, [128X[104X
    [4X[28X  362, 181, 272, 273, 410, 205, 308, 309, 464, 465, 698, 349, 524, 525, 788, [128X[104X
    [4X[28X  789, 1184, 1185, 1778, 889, 1334, 667, 666, 333, 500, 501, 752, 753, 1130, [128X[104X
    [4X[28X  565, 848, 849, 1274, 637, 956, 957, 1436, 1437, 2156, 2157, 3236, 3237, [128X[104X
    [4X[28X  4856, 4857, 7286, 3643, 3642, 1821, 2732, 2733, 4100, 4101, 6152, 6153, [128X[104X
    [4X[28X  9230, 4615, 4614, 2307, 2306, 1153, 1730, 865, 1298, 649, 974, 487, 486, [128X[104X
    [4X[28X  243, 242, 121, 182, 91, 90, 45, 68, 69, 104, 105, 158, 79, 78, 39, 38, 19, [128X[104X
    [4X[28X  18, 9, 14, 7, 6, 3, 2, 1 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.4 [33X[0;0YSpecial attributes of tame residue-class-wise affine groups[133X[101X
  
  [33X[0;0YThere  are  a  couple  of attributes which a priori make only sense for tame
  rcwa  groups.  With their help, various structural information about a given
  such  group  can  be obtained. We have already seen above that there are for
  example  methods  for  [10XIsSolvableGroup[110X,  [10XIsPerfectGroup[110X  and [10XDerivedSubgroup[110X
  available for tame rcwa groups, while testing wild groups for solvability or
  perfectness is currently not always feasible. The purpose of this section is
  to  describe  the  specific  attributes  of tame groups which are needed for
  these computations.[133X
  
  
  [1X3.4-1 [33X[0;0YRespectedPartition (of a tame rcwa group or -permutation)[133X[101X
  
  [33X[1;0Y[29X[2XRespectedPartition[102X( [3XG[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XRespectedPartition[102X( [3Xg[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10Ya  shortest  and coarsest possible respected partition of the rcwa
            group [3XG[103X / of the rcwa permutation [3Xg[103X.[133X
  
  [33X[0;0YA  tame  element  [22Xg[122X [22X∈[122X RCWA([22XR[122X)  permutes  a partition of [22XR[122X into finitely many
  residue  classes  on  all  of  which  it  is  affine.  Given  a  tame  group
  [22XG[122X [22X<[122X RCWA([22XR[122X), there is a common such partition for all elements of [22XG[122X. We call
  the mentioned partitions [13Xrespected partitions[113X of [22Xg[122X or [22XG[122X, respectively.[133X
  
  [33X[0;0YAn  rcwa  group or an rcwa permutation has a respected partition if and only
  if  it  is  tame.  This  holds  either  by  definition  or  by Theorem 2.5.8
  in [Koh05], depending on how one introduces the notion of tameness.[133X
  
  [33X[0;0YThere is an operation [10XRespectsPartition([3XG[103X[10X,[3XP[103X[10X)[110X / [10XRespectsPartition([3Xg[103X[10X,[3XP[103X[10X)[110X, which
  tests  whether  [3XG[103X or [3Xg[103X respects a given partition [3XP[103X. The permutation induced
  by [3Xg[103X on [10XP[110X can be computed efficiently by [10XPermutationOpNC([3Xg[103X[10X,P,OnPoints)[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,4,1,6),ClassShift(0,2));[127X[104X
    [4X[28X<rcwa group over Z with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XIsTame(G);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XSize(G);[127X[104X
    [4X[28Xinfinity[128X[104X
    [4X[25Xgap>[125X [27XP := RespectedPartition(G);[127X[104X
    [4X[28X[ 0(4), 2(4), 1(6), 3(6), 5(6) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.4-2 [33X[0;0YActionOnRespectedPartition & KernelOfActionOnRespectedPartition[133X[101X
  
  [33X[1;0Y[29X[2XActionOnRespectedPartition[102X( [3XG[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XKernelOfActionOnRespectedPartition[102X( [3XG[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XRankOfKernelOfActionOnRespectedPartition[102X( [3XG[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10Ythe  action of the tame rcwa group [3XG[103X on [10XRespectedPartition([3XG[103X[10X)[110X, the
            kernel of this action or the rank of the latter, respectively.[133X
  
  [33X[0;0YThe   method   for   [10XKernelOfActionOnRespectedPartition[110X   uses  the  package
  [5XPolycyclic[105X [EHN13].  The  rank  of  the largest free abelian subgroup of the
  kernel   of   the   action   of [3XG[103X  on  its  stored  respected  partition  is
  [10XRankOfKernelOfActionOnRespectedPartition([3XG[103X[10X)[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,4,1,6),ClassShift(0,2));;[127X[104X
    [4X[25Xgap>[125X [27XH := ActionOnRespectedPartition(G);[127X[104X
    [4X[28XGroup([ (1,3), (1,2) ])[128X[104X
    [4X[25Xgap>[125X [27XH = Action(G,P);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XSize(H);[127X[104X
    [4X[28X6[128X[104X
    [4X[25Xgap>[125X [27XK := KernelOfActionOnRespectedPartition(G);[127X[104X
    [4X[28X<rcwa group over Z with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XRankOfKernelOfActionOnRespectedPartition(G);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XIndex(G,K);[127X[104X
    [4X[28X6[128X[104X
    [4X[25Xgap>[125X [27XList(GeneratorsOfGroup(K),Factorization);[127X[104X
    [4X[28X[ [ ClassShift( 0(4) ) ], [ ClassShift( 2(4) ) ], [ ClassShift( 1(6) ) ] ][128X[104X
    [4X[25Xgap>[125X [27XImage(IsomorphismPcpGroup(K));[127X[104X
    [4X[28XPcp-group with orders [ 0, 0, 0 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YLet  [22XG[122X  be  a  tame rcwa group over ℤ, let [22XmathcalP[122X be a respected partition
  of [22XG[122X and put [22Xm := |mathcalP|[122X. Then there is an rcwa permutation [22Xg[122X which maps
  [22XmathcalP[122X  to  the  partition  of ℤ into the residue classes (mod [22Xm[122X), and the
  conjugate  [22XG^g[122X  of [22XG[122X  under  such  a  permutation  is integral (cf. [Koh05],
  Theorem 2.5.14).[133X
  
  [33X[0;0YThe  conjugate [22XG^g[122X can be determined by the operation [10XIntegralConjugate[110X, and
  the   conjugating   permutation [22Xg[122X   can   be  determined  by  the  operation
  [10XIntegralizingConjugator[110X. Both operations are applicable to rcwa permutations
  as  well.  Note  that  a  tame  rcwa  group  does not determine its integral
  conjugate uniquely.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XG := Group(ClassTransposition(0,4,1,6),ClassShift(0,2));;[127X[104X
    [4X[25Xgap>[125X [27XG^IntegralizingConjugator(G) = IntegralConjugate(G);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XRespectedPartition(G);[127X[104X
    [4X[28X[ 0(4), 2(4), 1(6), 3(6), 5(6) ][128X[104X
    [4X[25Xgap>[125X [27XRespectedPartition(G)^IntegralizingConjugator(G);[127X[104X
    [4X[28X[ 0(5), 1(5), 2(5), 3(5), 4(5) ][128X[104X
    [4X[25Xgap>[125X [27Xlast = RespectedPartition(IntegralConjugate(G));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.5 [33X[0;0YGenerating pseudo-random elements of RCWA(R) and CT(R)[133X[101X
  
  [33X[0;0YThere  are  methods  for  the  operation [10XRandom[110X for RCWA([22XR[122X) and CT([22XR[122X). These
  methods  are designed to be suitable for generating interesting examples. No
  particular distribution is guaranteed.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xelm := Random(RCWA(Integers));;[127X[104X
    [4X[25Xgap>[125X [27XDisplay(elm);[127X[104X
    [4X[28X[128X[104X
    [4X[28XRcwa permutation of Z with modulus 180[128X[104X
    [4X[28X[128X[104X
    [4X[28X        /[128X[104X
    [4X[28X        | 6n+12     if n in 2(10) U 4(10) U 6(10) U 8(10)[128X[104X
    [4X[28X        | 3n+3      if n in 1(20) U 5(20) U 9(20) U 17(20)[128X[104X
    [4X[28X        | 6n+10     if n in 0(10)[128X[104X
    [4X[28X        | (n+1)/2   if n in 15(60) U 27(60) U 39(60) U 51(60)[128X[104X
    [4X[28X        | (n+7)/2   if n in 19(60) U 31(60) U 43(60) U 55(60)[128X[104X
    [4X[28X        | 3n+1      if n in 13(20)[128X[104X
    [4X[28X        | (-n+17)/6 if n in 23(180) U 35(180) U 59(180) U 71(180) U [128X[104X
    [4X[28X n |-> <                    95(180) U 131(180) U 143(180) U 179(180)[128X[104X
    [4X[28X        | (-n-1)/6  if n in 11(180) U 47(180) U 83(180) U 155(180)[128X[104X
    [4X[28X        | (-n+7)/2  if n in 3(60)[128X[104X
    [4X[28X        | (n+3)/2   if n in 7(60)[128X[104X
    [4X[28X        | (n-17)/6  if n in 107(180)[128X[104X
    [4X[28X        | (-n+11)/6 if n in 119(180)[128X[104X
    [4X[28X        | (-n+29)/6 if n in 167(180)[128X[104X
    [4X[28X        |[128X[104X
    [4X[28X        \[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  elements  which are returned by this method are obtained by multiplying
  class    shifts   (see   [2XClassShift[102X   ([14X2.2-1[114X)),   class   reflections   (see
  [2XClassReflection[102X  ([14X2.2-2[114X))  and  class transpositions (see [2XClassTransposition[102X
  ([14X2.2-3[114X)). These factors can be retrieved by factoring:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XFactorization(elm);[127X[104X
    [4X[28X[ ClassTransposition(0,2,3,4), ClassTransposition(1,2,4,6), ClassShift(0,2), [128X[104X
    [4X[28X  ClassShift(1,3), ClassReflection(2,5), ClassReflection(1,3), [128X[104X
    [4X[28X  ClassReflection(1,2) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X3.6 [33X[0;0YThe categories of residue-class-wise affine groups[133X[101X
  
  [1X3.6-1 IsRcwaGroup[101X
  
  [33X[1;0Y[29X[2XIsRcwaGroup[102X( [3XG[103X ) [32X filter[133X
  [33X[1;0Y[29X[2XIsRcwaGroupOverZ[102X( [3XG[103X ) [32X filter[133X
  [33X[1;0Y[29X[2XIsRcwaGroupOverZ_pi[102X( [3XG[103X ) [32X filter[133X
  [33X[1;0Y[29X[2XIsRcwaGroupOverGFqx[102X( [3XG[103X ) [32X filter[133X
  [6XReturns:[106X  [33X[0;10Y[10Xtrue[110X  if  [3XG[103X  is  an  rcwa  group,  an  rcwa group over the ring of
            integers,  an  rcwa  group  over a semilocalization of the ring of
            integers  or  an rcwa group over a polynomial ring in one variable
            over a finite field, respectively, and [10Xfalse[110X otherwise.[133X
  
  [33X[0;0YOften 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
  [10XIsRcwaGroupOverZOrZ_pi[110X   which   is   the   union  of  [10XIsRcwaGroupOverZ[110X  and
  [10XIsRcwaGroupOverZ_pi[110X.[133X
  
  [33X[0;0YTo  allow distinguishing the groups RCWA([22XR[122X) and CT([22XR[122X) from others, they have
  the characteristic property [10XIsNaturalRCWA[110X or [10XIsNaturalCT[110X, respectively.[133X
  
