  
  [1X2 [33X[0;0YTransformations and partial permutations[133X[101X
  
  [33X[0;0YA [13Xtransformation[113X is just a function from the set [22X{1,..., n}[122X to itself, and a
  [13Xpartial  permutation[113X is an injective function from a subset of [22X{1,..., n}[122X to
  [22X{1,...,  n}[122X  where  [22Xn[122X  is  a  positive integer. In this chapter, we describe
  functions   for   creating   and   determining   fundamental  properties  of
  transformations  and  partial permutations. Semigroups in the [5XCitrus[105X package
  are  semigroups  of  transformations  and  partial  permutations,  and so we
  describe how to create and manipulate these objects first.[133X
  
  [33X[0;0YThe  functions  described in this section relating to transformations extend
  the functionality of [5XGAP[105X library; see also [14X'Reference: Transformations'[114X.[133X
  
  
  [1X2.1 [33X[0;0YCreating transformations[133X[101X
  
  [33X[0;0YIn  this  section we describe the functions available in [5XCitrus[105X for creating
  transformations.  The  following functions from the [5XGAP[105X reference manual are
  particularly relevant to this section:[133X
  
  [30X    [33X[0;6Y[2XTransformation[102X ([14XReference: Transformation[114X),[133X
  
  [30X    [33X[0;6Y[2XIdentityTransformation[102X ([14XReference: IdentityTransformation[114X),[133X
  
  [30X    [33X[0;6Y[2XRandomTransformation[102X ([14XReference: RandomTransformation[114X),[133X
  
  [30X    [33X[0;6Y[2XAsTransformation[102X ([14XReference: AsTransformation[114X).[133X
  
  [1X2.1-1 ConstantTransformation[101X
  
  [29X[2XConstantTransformation[102X( [3Xm[103X, [3Xn[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA constant transformation of degree [3Xm[103X with value [3Xn[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XConstantTransformation(5, 1);[127X[104X
    [4X[28XTransformation( [ 1, 1, 1, 1, 1 ] )[128X[104X
    [4X[25Xgap>[125X [27XConstantTransformation(6, 4);[127X[104X
    [4X[28XTransformation( [ 4, 4, 4, 4, 4, 4 ] )[128X[104X
  [4X[32X[104X
  
  
  [1X2.1-2 [33X[0;0YIdempotent[133X[101X
  
  [29X[2XIdempotent[102X( [3Xker[103X, [3Ximg[103X ) [32X function
  [29X[2XIdempotentNC[102X( [3Xker[103X, [3Ximg[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YAn idempotent transformation.[133X
  
  [33X[0;0YThis  function  returns  an idempotent with [2XCanonicalTransSameKernel[102X ([14X2.4-1[114X)
  equal  to  [3Xker[103X  and  image  set  equal  to  [3Ximg[103X  after  first  checking that
  [2XIsInjectiveTransOnList[102X ([14X2.4-4[114X) holds with argument [3Xker, img[103X.[133X
  
  [33X[0;0Y[10XIdempotentNC[110X  returns  an  idempotent  with [2XCanonicalTransSameKernel[102X ([14X2.4-1[114X)
  equal   to   [3Xker[103X   and   image  set  equal  to  [3Ximg[103X  without  checking  that
  [2XIsInjectiveTransOnList[102X ([14X2.4-4[114X) holds.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 10, 2, 3, 10, 5, 10, 7, 2, 5, 6 ] );;[127X[104X
    [4X[25Xgap>[125X [27Xker:=CanonicalTransSameKernel(f);[127X[104X
    [4X[28X[ 1, 2, 3, 1, 4, 1, 5, 2, 4, 6 ][128X[104X
    [4X[25Xgap>[125X [27Ximg:=ImageSetOfTransformation(f);[127X[104X
    [4X[28X[ 2, 3, 5, 6, 7, 10 ][128X[104X
    [4X[25Xgap>[125X [27XIdempotent(ker, img);[127X[104X
    [4X[28XTransformation( [ 6, 2, 3, 6, 5, 6, 7, 2, 5, 10 ] )[128X[104X
  [4X[32X[104X
  
  
  [1X2.1-3 [33X[0;0YRandomIdempotent[133X[101X
  
  [29X[2XRandomIdempotent[102X( [3Ximg[103X, [3Xm[103X ) [32X operation
  [29X[2XRandomIdempotentNC[102X( [3Ximg[103X, [3Xm[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YAn idempotent transformation.[133X
  
  [33X[0;0YReturns  a  random  idempotent with image set [3Ximg[103X of degree [3Xm[103X after checking
  that the maximum value in [3Ximg[103X is at most [3Xm[103X.[133X
  
  [33X[0;0Y[10XRandomIdempotentNC[110X  returns a random idempotent with image set [3Ximg[103X of degree
  [3Xm[103X without checking that the maximum value in [3Ximg[103X is at most [3Xm[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRandomIdempotent([ 1, 2, 3 ], 5);[127X[104X
    [4X[28XTransformation( [ 1, 2, 3, 1, 3 ] )[128X[104X
    [4X[25Xgap>[125X [27XRandomIdempotent([ 1, 2, 3 ], 4);[127X[104X
    [4X[28XTransformation( [ 1, 2, 3, 3 ] )[128X[104X
    [4X[25Xgap>[125X [27XRandomIdempotent([ 1, 2, 3 ], 3);            [127X[104X
    [4X[28XTransformation( [ 1, 2, 3 ] )[128X[104X
    [4X[25Xgap>[125X [27XRandomIdempotent([ 1, 2, 4, 5, 6 ], 10);[127X[104X
    [4X[28XTransformation( [ 1, 2, 6, 4, 5, 6, 2, 5, 1, 6 ] )[128X[104X
  [4X[32X[104X
  
  
  [1X2.1-4 [33X[0;0YRandomTransformation[133X[101X
  
  [29X[2XRandomTransformation[102X( [3Xarg[103X ) [32X operation
  [29X[2XRandomTransformationNC[102X( [3Xarg[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA transformation.[133X
  
  [33X[0;0YIf  [3Xarg[103X is a positive integer, then a random transformation of degree [3Xarg[103X is
  returned; see [2XRandomTransformation[102X ([14XReference: RandomTransformation[114X).[133X
  
  [33X[0;0YIf  [3Xarg[103X[10X[1][110X  is a list of positive integers and [3Xarg[103X[10X[2][110X is a positive integer,
  then [10XRandomTransformation[110X returns a random transformation with degree [3Xarg[103X[10X[2][110X
  and image contained in [3Xarg[103X[10X[1][110X.[133X
  
  [33X[0;0YThe  no  check  version  [10XRandomTransformationNC[110X  does  not  check  that  the
  arguments can define a transformation.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRandomTransformation([1,2,3], 6);             [127X[104X
    [4X[28XTransformation( [ 2, 1, 2, 1, 1, 2 ] )[128X[104X
    [4X[25Xgap>[125X [27XRandomTransformationNC([1,2,3], 6);[127X[104X
    [4X[28XTransformation( [ 3, 1, 2, 2, 1, 2 ] )[128X[104X
  [4X[32X[104X
  
  
  [1X2.2 [33X[0;0YCreating partial permutations[133X[101X
  
  [33X[0;0YIn  this  section we describe the functions available in [5XCitrus[105X for creating
  partial  permutations.  In  addition  to  the  functions  described  in this
  section,  partial  permutations  can  also  be created from permutations and
  certain transformations; see Section [14X2.8[114X.[133X
  
  [33X[0;0Y[13XPlease  note  that  the  functions  for  partial  permutations  and  inverse
  semigroups are only available if you have compiled [5XCitrus[105X.[113X[133X
  
  [1X2.2-1 PartialPerm[101X
  
  [29X[2XPartialPerm[102X( [3Xdom[103X, [3Xran[103X ) [32X function
  [29X[2XPartialPerm[102X( [3Xlist[103X ) [32X function
  [29X[2XPartialPermNC[102X( [3Xdom[103X, [3Xran[103X ) [32X function
  [29X[2XPartialPermNC[102X( [3Xlist[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA partial permutation.[133X
  
  [33X[0;0YPartial  permutations  can  be created in two ways: by giving the domain and
  the range, or the dense range list.[133X
  
  [33X[0;0YThe  partial permutation defined by a domain [3Xdom[103X and range [3Xran[103X, where [3Xdom[103X is
  a  set  of  positive  integers  and [3Xran[103X is a duplicate free list of positive
  integers,  maps  [3Xdom[103X[10X[i][110X  to  [3Xran[103X[10X[i][110X.  For  example,  the partial permutation
  mapping [22X1[122X and [22X5[122X to [22X20[122X and [22X2[122X can be created using:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28XPartialPermNC([1,5],[20,2]); [128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  partial  permutation  defined  by  a  dense  range  list [3Xlist[103X, maps the
  positive  integer  [10Xi[110X  to  [3Xlist[103X[10X[i][110X  if  [3Xlist[103X[10X[i]<>>0[110X  and is undefined at [10Xi[110X if
  [3Xlist[103X[10X[i]=0[110X.  For example, the partial permutation mapping [22X1[122X and [22X5[122X to [22X20[122X and [22X2[122X
  can be created using:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28XPartialPermNC([20,0,0,0,2]);[128X[104X
  [4X[32X[104X
  
  [33X[0;0YRegardless  of  which  of  these  two  methods  are used to create a partial
  permutation in [5XGAP[105X the internal representation is the same.[133X
  
  [33X[0;0YIf  the  largest  point in the domain is larger than the rank of the partial
  permutation,  then  using  the  dense  range  list  to  define  the  partial
  permutation  will  require  less  typing; otherwise using the domain and the
  range will require less typing. For example, the partial permutation mapping
  [22X10000[122X to [22X1[122X can be defined using:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28XPartialPermNC([10000], [1]);[128X[104X
  [4X[32X[104X
  
  [33X[0;0Ybut  using the dense range list would require a list with [22X9999[122X entries equal
  to  [22X0[122X  and  the  final  entry equal to [22X1[122X. On the other hand, the identity on
  [10X[1,2,3,4,6][110X can be defined using:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28XPartialPermNC([1,2,3,4,0,6]);[128X[104X
  [4X[32X[104X
  
  [33X[0;0Y[10XPartialPerm[110X checks that the argument defines a partial permatutation whereas
  [10XPartialPermNC[110X  does  not.  [10XPartialPermNC[110X  is a kernel function written in C,
  which  performs  no  checks  on it argument, and so if the argument does not
  define  a partial permutation, then the results can be unpredictable, and it
  could even potentially cause [5XGAP[105X to crash.[133X
  
  [33X[0;0YIt  is  currently  only  possible  to  create partial permutations acting on
  positive  integers  not  greater than [22X65535[122X. Note that this might cause some
  unexpected  behaviour when multiplying partial permutations by permutations.
  For  example, if [10Xf:=PartialPerm([1,2,3]);[110X, then [10Xf*(1,100000)*(1,100000)[110X will
  return  an  error  since  the  result  of  [10Xf*(1,100000)[110X  would  be a partial
  permutation    acting   on   too   many   points.   However,   the   product
  [10Xf*((1,100000)*(1,100000))[110X is just [10Xf[110X and no error is given.[133X
  
  [33X[0;0YPlease  note that a partial permutation in [5XGAP[105X is never a permutation nor is
  a  permutation  ever  a  partial  permutation.  For example, the permutation
  [10X(1,4,2)[110X  fixes  [10X3[110X but the partial permutation [10XPartialPerm([4,1,0,2]);[110X is not
  defined on [10X3[110X.[133X
  
  [1X2.2-2 RestrictedPartialPerm[101X
  
  [29X[2XRestrictedPartialPerm[102X( [3Xf[103X, [3Xset[103X ) [32X operation
  [29X[2XRestrictedPartialPermNC[102X( [3Xf[103X, [3Xset[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA partial permutation.[133X
  
  [33X[0;0Y[10XRestrictedPartialPerm[110X  returns  a  new  partial permutation that acts on the
  points  in  the  set of positive integers [3Xset[103X in the same way as the partial
  permutation [3Xf[103X, and that is undefined on those points that are not in [3Xset[103X.[133X
  
  [33X[0;0Y[10XRestrictedPartialPermNC[110X  does  not  check  whether  [3Xset[103X is a set of positive
  integers, if it is not, then the results of this function are unpredictable.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 3, 4, 7, 8, 9 ], [ 9, 4, 1, 6, 2, 8 ] );;[127X[104X
    [4X[25Xgap>[125X [27XRestrictedPartialPerm(f, [2,3,6,10]);[127X[104X
    [4X[28X[ 3 ] -> [ 4 ][128X[104X
  [4X[32X[104X
  
  
  [1X2.2-3 [33X[0;0YOne[133X[101X
  
  [29X[2XOne[102X( [3Xf[103X ) [32X method
  [6XReturns:[106X  [33X[0;10YA partial permutation.[133X
  
  [33X[0;0YAs described in the reference manual [2XOneImmutable[102X ([14XReference: OneImmutable[114X),
  [10XOne[110X returns the multiplicative neutral element of the partial permutation [3Xf[103X,
  which  is  the  identity  partial permutation on the union of the domain and
  range of [3Xf[103X; see [2XDomainOfPartialPerm[102X ([14X2.5-2[114X) and [2XRangeOfPartialPerm[102X ([14X2.5-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([ 1, 2, 3, 4, 5, 7, 10 ], [ 3, 7, 9, 6, 1, 10, 2 ]);;[127X[104X
    [4X[25Xgap>[125X [27XOne(f);[127X[104X
    [4X[28X<identity on [ 1, 2, 3, 4, 5, 6, 7, 9, 10 ]>[128X[104X
  [4X[32X[104X
  
  [1X2.2-4 LeftOne[101X
  
  [29X[2XLeftOne[102X( [3Xf[103X ) [32X function
  [29X[2XRightOne[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YThe idempotent partial permutation [3Xf[103X[10X*[110X[3Xf^-1[103X or [3Xf^-1[103X[10X*[110X[3Xf[103X.[133X
  
  [33X[0;0Y[10XLeftOne[110X  returns the identity partial permutation on [10XDomainOfPartialPerm([3Xf[103X[10X)[110X,
  which is equal to [3Xf[103X[10X*[110X[3Xf^-1[103X; see [2XDomainOfPartialPerm[102X ([14X2.5-2[114X).[133X
  
  [33X[0;0Y[10XRightOne[110X returns the idenpartial permutation on [10XRangeOfPartialPerm([3Xf[103X[10X)[110X, which
  is equal to [3Xf^-1[103X[10X*[110X[3Xf[103X; see [2XRangeOfPartialPerm[102X ([14X2.5-3[114X).[133X
  
  [33X[0;0YThe  methods  for  [10XLeftOne[110X  and [10XRightOne[110X are more efficient than composing [3Xf[103X
  with [3Xf^-1[103X or vice versa.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ], [127X[104X
    [4X[25X>[125X [27X[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ] );;[127X[104X
    [4X[25Xgap>[125X [27XLeftOne(f);[127X[104X
    [4X[28X<identity on [ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ]>[128X[104X
    [4X[25Xgap>[125X [27XRightOne(f);[127X[104X
    [4X[28X<identity on [ 2, 3, 4, 5, 8, 9, 10, 11, 12, 14, 15, 17, 18, 19, 20 ]>[128X[104X
  [4X[32X[104X
  
  [1X2.2-5 RandomPartialPerm[101X
  
  [29X[2XRandomPartialPerm[102X( [3Xn[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA partial permutation.[133X
  
  [33X[0;0Y[10XRandomPartialPerm[110X returns a randomly chosen partial permutation where points
  in  the domain and range are bounded above by the positive integer [3Xn[103X. Points
  are  chosen in the dense range list of the returned partial permutation with
  the  probability  of  a value being undefined equal to the probability of it
  being defined. Thus the expected rank of the returned partial permutation is
  approximately [10Xn/2[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=RandomPartialPerm(10);  [127X[104X
    [4X[28X[ 1, 2, 3, 4, 7, 8, 9 ] -> [ 5, 9, 1, 7, 2, 8, 4 ][128X[104X
  [4X[32X[104X
  
  
  [1X2.3 [33X[0;0YDisplaying partial permutations[133X[101X
  
  [33X[0;0YPartial permutations [10Xf[110X with rank less than 20 are displayed as:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28XDomainOfPartialPerm(f) -> RangeOfPartialPerm(f)[128X[104X
  [4X[32X[104X
  
  [33X[0;0Ysee  [2XDomainOfPartialPerm[102X  ([14X2.5-2[114X)  and [2XRangeOfPartialPerm[102X ([14X2.5-3[114X). The empty
  mapping is displayed as:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X<empty mapping>[128X[104X
  [4X[32X[104X
  
  [33X[0;0Yand a partial identity is displayed as, for example,[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X<identity on [ 1, 2, 3, 4, 5, 8, 12, 19, 20 ]>[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIf a partial permutation in [5XGAP[105X has rank 20 points or more, then to make the
  display  more readable the domain and the range of the partial permutatation
  are  not  printed,  for  example, a partial permutation with rank 27 will be
  displayed as:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X<partial perm on 27 pts>[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIf  you  want  to display a partial permutation in a form that can be copied
  and pasted back into [5XGAP[105X, then use [10XDisplay[110X:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDisplay(f);               [127X[104X
    [4X[28XPartialPermNC( [ 1, 2, 3, 5, 6, 7, 8 ], [ 5, 9, 10, 6, 3, 8, 4 ] )[128X[104X
  [4X[32X[104X
  
  [33X[0;0YLikewise,  you  can  display  a  collection  of  partial  permutations using
  [10XDisplay[110X:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDisplay(Generators(s));[127X[104X
    [4X[28X[ PartialPermNC( [ 1, 2, 3, 4, 5, 8, 10 ], [ 3, 1, 4, 2, 5, 6, 7 ] ),[128X[104X
    [4X[28XPartialPermNC( [ 1, 2, 4, 7, 8, 9 ], [ 10, 7, 8, 5, 9, 1 ] ) ][128X[104X
  [4X[32X[104X
  
  [1X2.3-1 PrettyPrintPP[101X
  
  [29X[2XPrettyPrintPP[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YNothing.[133X
  
  [33X[0;0Y[10XPrettyPrintPP[110X  will print the partial permutation [3Xf[103X as a product of disjoint
  permutations and chains. A [13Xchain[113X is a list [10XX[110X of length [10Xn[110X such that:[133X
  
  [30X    [33X[0;6Y[10XX[1][110X is an element of the domain of [3Xf[103X but not the range[133X
  
  [30X    [33X[0;6Y[10XX[i]^[3Xf[103X[10X=X[i+1][110X for all [10Xn[110X in [22X{1,..., n-1}[122X[133X
  
  [30X    [33X[0;6Y[10XX[n][110X is in the range of [3Xf[103X but not the domain.[133X
  
  [33X[0;0YIn the display, permutations are displayed as they usually are in [5XGAP[105X, fixed
  points  are  displayed  enclosed in round brackets, and chains are displayed
  enclosed in square brackets.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ],[127X[104X
    [4X[25X>[125X [27X[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ]);;[127X[104X
    [4X[25Xgap>[125X [27XPrettyPrintPP(f);[127X[104X
    [4X[28X[1,3,14][16,8,2,12,15](4)(5,11)[6,18,10,9][7,17,20](19)[128X[104X
  [4X[32X[104X
  
  
  [1X2.4 [33X[0;0YProperties of transformations[133X[101X
  
  [33X[0;0YIn  this  section  we describe the functions available in [5XCitrus[105X for finding
  various properties of transformations.[133X
  
  [33X[0;0YIn  addition  to  those  functions  described  below, [5XCitrus[105X also contains a
  special method for [2XRankOfTransformation[102X ([14XReference: RankOfTransformation[114X).[133X
  
  [1X2.4-1 CanonicalTransSameKernel[101X
  
  [29X[2XCanonicalTransSameKernel[102X( [3Xobj[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA list of positive integers.[133X
  
  [33X[0;0YThe  argument  [3Xobj[103X  should  be  a  transformation or the list of images of a
  transformation. If [3Xobj[103X is a transformation, then we define [10Xf:=[3Xobj[103X[10X[110X and if [3Xobj[103X
  is  the  image  list  of  a transformation we define [10Xf:=Transformation([3Xobj[103X[10X)[110X.
  [10XCanonicalTransSameKernel[110X  returns  the image list of a transformation [10Xg[110X such
  that  the  kernel  of  [10Xg[110X  equals  the  kernel  of  [10Xf[110X  and [10Xj^g=i[110X for all [10Xj[110X in
  [10XKernelOfTransformation(g)[i][110X.  For  a  given  transformation  [10Xf[110X,  there is a
  unique transformation [10Xg[110X with this property.[133X
  
  [33X[0;0YSee  also  [2XImageListOfTransformation[102X  ([14XReference: ImageListOfTransformation[114X)
  and [2XKernelOfTransformation[102X ([14XReference: KernelOfTransformation[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 10, 3, 7, 10, 1, 5, 9, 2, 6, 10 ] );;[127X[104X
    [4X[25Xgap>[125X [27XCanonicalTransSameKernel(f);[127X[104X
    [4X[28X[ 1, 2, 3, 1, 4, 5, 6, 7, 8, 1 ][128X[104X
    [4X[25Xgap>[125X [27Xf:=[ 10, 6, 7, 9, 9, 9, 4, 1, 4, 1 ];;[127X[104X
    [4X[25Xgap>[125X [27XCanonicalTransSameKernel(f);[127X[104X
    [4X[28X[ 1, 2, 3, 4, 4, 4, 5, 6, 5, 6 ][128X[104X
  [4X[32X[104X
  
  [1X2.4-2 IndexPeriodOfTransformation[101X
  
  [29X[2XIndexPeriodOfTransformation[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA pair of positive integers.[133X
  
  [33X[0;0YReturns  the  least  positive integers [10Xm, r[110X such that [10X[3Xf[103X[10X^(m+r)=[3Xf[103X[10X^m[110X, which are
  known as the [13Xindex[113X and [13Xperiod[113X of the transformation [3Xf[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 3, 4, 4, 6, 1, 3, 3, 7, 1 ] );;[127X[104X
    [4X[25Xgap>[125X [27XIndexPeriodOfTransformation(f);[127X[104X
    [4X[28X[ 2, 3 ][128X[104X
    [4X[25Xgap>[125X [27Xf^2=f^5;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X2.4-3 [33X[0;0YInversesOfTransformation[133X[101X
  
  [29X[2XInversesOfTransformation[102X( [3XS[103X, [3Xf[103X ) [32X operation
  [29X[2XInversesOfTransformationNC[102X( [3XS[103X, [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA list of transformations.[133X
  
  [33X[0;0Y[10XInversesOfTransformation[110X   returns   a   list   of   the   inverses  of  the
  transformation [3Xf[103X in the transformation semigroup [3XS[103X after first checking that
  [3Xf[103X is an element of [3XS[103X.[133X
  
  [33X[0;0YA transformation [10Xg[110X in [3XS[103X is an [13Xinverse[113X of [3Xf[103X if [10X[3Xf[103X[10X*g*[3Xf[103X[10X=[3Xf[103X[10X[110X and [10Xg*[3Xf[103X[10X*g=g[110X.[133X
  
  [33X[0;0YThe  function [10XInversesOfTransformationNC[110X does not check that [3Xf[103X is an element
  of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup([ Transformation( [ 3, 1, 4, 2, 5, 2, 1, 6, 1 ] ), [127X[104X
    [4X[25X>[125X [27X Transformation( [ 5, 7, 8, 8, 7, 5, 9, 1, 9 ] ), [127X[104X
    [4X[25X>[125X [27X Transformation( [ 7, 6, 2, 8, 4, 7, 5, 8, 3 ] ) ]);;[127X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 3, 1, 4, 2, 5, 2, 1, 6, 1 ] );;[127X[104X
    [4X[25Xgap>[125X [27XInversesOfTransformationNC(S, f);[127X[104X
    [4X[28X[  ][128X[104X
    [4X[25Xgap>[125X [27XIsRegularTransformation(S, f);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 1, 9, 7, 5, 5, 1, 9, 5, 1 ] );;[127X[104X
    [4X[25Xgap>[125X [27XInversesOfTransformation(S, f);[127X[104X
    [4X[28X[ Transformation( [ 1, 5, 1, 2, 5, 1, 3, 2, 2 ] ), [128X[104X
    [4X[28X  Transformation( [ 1, 2, 3, 5, 5, 1, 3, 5, 2 ] ), [128X[104X
    [4X[28X  Transformation( [ 1, 5, 1, 1, 5, 1, 3, 1, 2 ] ) ][128X[104X
    [4X[25Xgap>[125X [27XIsRegularTransformation(S, f);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X2.4-4 IsInjectiveTransOnList[101X
  
  [29X[2XIsInjectiveTransOnList[102X( [3Xobj[103X, [3Xlist[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThe  argument  [3Xobj[103X  should  be  a  transformation or the list of images of a
  transformation  and  [3Xlist[103X should be a list of positive integers. If [3Xobj[103X is a
  transformation,  then  we  define  [10Xf:=[3Xobj[103X[10X[110X  and if [3Xobj[103X is the image list of a
  transformation   we  define  [10Xf:=Transformation([3Xobj[103X[10X)[110X.  [10XIsInjectiveTransOnList[110X
  returns  [9Xtrue[109X  if  [10Xf[110X is injective on [3Xlist[103X and [9Xfalse[109X if it is not. If [3Xlist[103X is
  not duplicate free, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YSee  also  [2XImageListOfTransformation[102X  ([14XReference: ImageListOfTransformation[114X)
  and [2XTransformation[102X ([14XReference: Transformation[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 2, 6, 7, 2, 6, 9, 9, 1, 1, 5 ] );;[127X[104X
    [4X[25Xgap>[125X [27XIsInjectiveTransOnList(f, [1,5]);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsInjectiveTransOnList(f, [5,1]);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsInjectiveTransOnList(f, [5,1,5,1,1,]);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsInjectiveTransOnList([1,2,3,4,5], [5,1,2,3]);   [127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X2.4-5 IsRegularTransformation[101X
  
  [29X[2XIsRegularTransformation[102X( [3XS[103X, [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  function  returns [9Xtrue[109X if [3Xf[103X is a regular element of the transformation
  semigroup [3XS[103X and [9Xfalse[109X if it is not.[133X
  
  [33X[0;0YA  transformation  [3Xf[103X  is  [13Xregular[113X in a transformation semigroup [3XS[103X if it lies
  inside  a  regular [13XD[113X-class; see [2XIsRegularDClass[102X ([14XReference: IsRegularDClass[114X)
  or  [2XIsRegularDClass[102X  ([14X4.4-6[114X).  Equivalently [3Xf[103X is regular if the orbit of the
  image  of  [3Xf[103X containing a transversal of the kernel of [3Xf[103X; see [2XTransformation[102X
  ([14XReference:   Transformation[114X)   and   [2XImageSetOfTransformation[102X   ([14XReference:
  ImageSetOfTransformation[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Monoid(Transformation([2,2,4,4,5,6]),Transformation([5,3,4,4,6,6]));;[127X[104X
    [4X[25Xgap>[125X [27Xf:=Generators(S)[1];;[127X[104X
    [4X[25Xgap>[125X [27XIsRegularTransformation(S, f);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Ximg:=ImageSetOfTransformation(f);[127X[104X
    [4X[28X[ 2, 4, 5, 6 ][128X[104X
    [4X[25Xgap>[125X [27Xo:=Orb(S, img, OnSets);; Enumerate(o);[127X[104X
    [4X[28X<closed orbit, 3 points>[128X[104X
    [4X[25Xgap>[125X [27XForAny(o, x-> IsInjectiveTransOnList(f, x));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsRegularTransformation(S, Generators(S)[2]);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsRegularTransformation(FullTransformationSemigroup(6), Generators(S)[2]);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X2.4-6 DegreeOfTransformation[101X
  
  [29X[2XDegreeOfTransformation[102X( [3Xf[103X ) [32X function
  [29X[2XDegree[102X( [3Xf[103X ) [32X function
  [29X[2XDegree[102X( [3XC[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThe  [13Xdegree[113X of a transformation [3Xf[103X is the length of [2XImageListOfTransformation[102X
  ([14XReference: ImageListOfTransformation[114X).[133X
  
  [33X[0;0YThe  degree  of a transformation collection [3XC[103X is the degree of any (and all)
  transformations in [3XC[103X.[133X
  
  [33X[0;0YSee also [2XDegreeOfTransformation[102X ([14XReference: DegreeOfTransformation[114X).[133X
  
  [1X2.4-7 RankOfTransformation[101X
  
  [29X[2XRankOfTransformation[102X( [3Xf[103X ) [32X function
  [29X[2XRank[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0Y[10XRankOfTransformation[110X  returns  the  length of the set of image points of the
  transformation       [3Xf[103X;       see      [2XRankOfTransformation[102X      ([14XReference:
  RankOfTransformation[114X).[133X
  
  [33X[0;0Y[10XRank([3Xf[103X[10X)[110X  returns the same result as [10XRankOfTransformation[110X and is included for
  the  sake  of  having  a  shorter  name. [10XRank[110X can also be applied to partial
  permutations; see [2XRankOfPartialPerm[102X ([14X2.5-11[114X)[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 8, 5, 8, 2, 2, 8, 4, 7, 3, 1 ] );;[127X[104X
    [4X[25Xgap>[125X [27XRankOfTransformation(f);[127X[104X
    [4X[28X7[128X[104X
    [4X[25Xgap>[125X [27XRank(f);[127X[104X
    [4X[28X7[128X[104X
  [4X[32X[104X
  
  [1X2.4-8 SmallestIdempotentPower[101X
  
  [29X[2XSmallestIdempotentPower[102X( [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThis   function   returns  the  least  positive  integer  [10Xn[110X  such  that  the
  transformation  [10X[3Xf[103X[10X^n[110X  is  an  idempotent.  See  also  [2XSmallestIdempotentPower[102X
  ([14X2.5-14[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 6, 7, 4, 1, 7, 4, 6, 1, 3, 4 ] );;[127X[104X
    [4X[25Xgap>[125X [27XSmallestIdempotentPower(f);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 6, 6, 6, 2, 7, 1, 5, 3, 10, 6 ] );;[127X[104X
    [4X[25Xgap>[125X [27XSmallestIdempotentPower(f);[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  
  [1X2.5 [33X[0;0YProperties of partial permutations[133X[101X
  
  [33X[0;0YIn  this  section  we describe the functions available in [5XCitrus[105X for finding
  various properties of partial permutations.[133X
  
  [1X2.5-1 IsPartialPerm[101X
  
  [29X[2XIsPartialPerm[102X( [3Xobj[103X ) [32X category
  [29X[2XIsPartialPermCollection[102X( [3Xobj[103X ) [32X category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YEach  [13Xpartial  permutation[113X  in [5XGAP[105X lies in the category [10XIsPartialPerm[110X. Basic
  operations   for   partial  permutations  are  [2XDomainOfPartialPerm[102X  ([14X2.5-2[114X),
  [2XRangeOfPartialPerm[102X ([14X2.5-3[114X), [2XRangeSetOfPartialPerm[102X ([14X2.5-4[114X), [2XRankOfPartialPerm[102X
  ([14X2.5-11[114X),   [2XDegreeOfPartialPerm[102X  ([14X2.5-12[114X),  multiplication  of  two  partial
  permutations is via [9X*[109X, and exponentiation with the first argument a positive
  integer  [10Xi[110X  and  second argument a partial permutation [10Xf[110X where the result is
  the image [10Xi^f[110X of the point [10Xi[110X under [10Xf[110X.[133X
  
  [33X[0;0Y[10XIsPartialPermCollection[110X   is   the   category   of  collections  of  partial
  permutations.  For  example,  a semigroup of partial permutations belongs in
  [10XIsPartialPermCollection[110X.[133X
  
  [1X2.5-2 DomainOfPartialPerm[101X
  
  [29X[2XDomainOfPartialPerm[102X( [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA set of positive integers.[133X
  
  [33X[0;0YThe  [13Xdomain[113X of a partial permutation [3Xf[103X is the set of positive integers where
  [3Xf[103X is defined.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );;[127X[104X
    [4X[25Xgap>[125X [27XDomainOfPartialPerm(f);[127X[104X
    [4X[28X[ 1, 2, 3, 6, 8, 10 ][128X[104X
  [4X[32X[104X
  
  [1X2.5-3 RangeOfPartialPerm[101X
  
  [29X[2XRangeOfPartialPerm[102X( [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA duplicate-free list of positive integers.[133X
  
  [33X[0;0YThe  [13Xrange[113X  of a partial permutation [3Xf[103X is the list of images of the elements
  of the domain [3Xf[103X where [10XRangeOfPartialPerm(f)[i]=DomainOfPartialPerm(f)[i]^f.[110X[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 4, 5, 8, 10 ], [ 7, 1, 4, 3, 2, 6, 5 ] );;[127X[104X
    [4X[25Xgap>[125X [27XRangeOfPartialPerm(f);[127X[104X
    [4X[28X[ 7, 1, 4, 3, 2, 6, 5 ][128X[104X
  [4X[32X[104X
  
  [1X2.5-4 RangeSetOfPartialPerm[101X
  
  [29X[2XRangeSetOfPartialPerm[102X( [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA set of positive integers.[133X
  
  [33X[0;0YThe  range  of a partial permutation [3Xf[103X is the list of images of the elements
  of  the  domain  [3Xf[103X.  [10XRangeSetOfPartialPerm[110X  returns  the  range of a partial
  permutation sorted into increasing order.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 5, 7, 10 ], [ 10, 2, 3, 5, 7, 6 ] );;[127X[104X
    [4X[25Xgap>[125X [27XRangeSetOfPartialPerm(f);[127X[104X
    [4X[28X[ 2, 3, 5, 6, 7, 10 ][128X[104X
  [4X[32X[104X
  
  [1X2.5-5 FixedPointsOfPartialPerm[101X
  
  [29X[2XFixedPointsOfPartialPerm[102X( [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA set of positive integers.[133X
  
  [33X[0;0YA  positive  integer  [10Xi[110X  is  fixed  by  a  partial  permutation  [3Xf[103X if [10Xi^[110X[3Xf[103X[10X=i[110X.
  [10XFixedPointsOfPartialPerm[110X  returns  the  set  of  points fixed by the partial
  permutation [3Xf[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [127X[104X
    [4X[25X>[125X [27X[ 1, 2, 3, 5, 6, 8, 10, 11, 14, 17, 20, 21, 22, 24, 25, 26, 32 ], [127X[104X
    [4X[25X>[125X [27X[ 30, 20, 29, 24, 9, 14, 26, 5, 25, 15, 11, 6, 35, 2, 10, 19, 23 ] );;[127X[104X
    [4X[25Xgap>[125X [27XFixedPointsOfPartialPerm(f);[127X[104X
    [4X[28X[  ][128X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([1..10]);[127X[104X
    [4X[28X<identity on [ 1 .. 10 ]>[128X[104X
    [4X[25Xgap>[125X [27XFixedPointsOfPartialPerm(f);[127X[104X
    [4X[28X[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ][128X[104X
  [4X[32X[104X
  
  [1X2.5-6 MovedPoints[101X
  
  [29X[2XMovedPoints[102X( [3Xf[103X ) [32X operation
  [29X[2XMovedPoints[102X( [3XC[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA set of positive integers.[133X
  
  [33X[0;0YA  positive  integer  [10Xi[110X  is  moved  by  a  partial  permutation [3Xf[103X if [10Xi^[110X[3Xf[103X[10X<>i[110X.
  [10XMovedPoints[110X returns the set of points moved by: the partial permutation [3Xf[103X or
  at least one partial permutation in the collection [3XC[103X, respectively.[133X
  
  [33X[0;0YThe  operation  [2XPoints[102X ([14X4.5-1[114X) returns a list of all the points on which the
  collection [3XC[103X acts, not only those points that are moved.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [127X[104X
    [4X[25X>[125X [27X[ 1, 2, 3, 5, 6, 8, 10, 11, 14, 17, 20, 21, 22, 24, 25, 26, 32 ], [127X[104X
    [4X[25X>[125X [27X[ 30, 20, 29, 24, 9, 14, 26, 5, 25, 15, 11, 6, 35, 2, 10, 19, 23 ] );;[127X[104X
    [4X[25Xgap>[125X [27XMovedPoints(f);[127X[104X
    [4X[28X[ 1, 2, 3, 5, 6, 8, 10, 11, 14, 17, 20, 21, 22, 24, 25, 26, 32 ][128X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([1..10]);[127X[104X
    [4X[28X<identity on [ 1 .. 10 ]>[128X[104X
    [4X[25Xgap>[125X [27XMovedPoints(f);[127X[104X
    [4X[28X[  ][128X[104X
  [4X[32X[104X
  
  [1X2.5-7 NrMovedPoints[101X
  
  [29X[2XNrMovedPoints[102X( [3Xf[103X ) [32X operation
  [29X[2XNrMovedPoints[102X( [3XC[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YA  positive  integer  [10Xi[110X  is  moved  by  a  partial  permutation [3Xf[103X if [10Xi^[110X[3Xf[103X[10X<>i[110X.
  [10XNrMovedPoints[110X returns the number of points moved by: the partial permutation
  [3Xf[103X  or  the  by  at  least  one  partial  permutation  in  the  collection [3XC[103X,
  respectively.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [127X[104X
    [4X[25X>[125X [27X[ 1, 2, 3, 5, 6, 8, 10, 11, 14, 17, 20, 21, 22, 24, 25, 26, 32 ], [127X[104X
    [4X[25X>[125X [27X[ 30, 20, 29, 24, 9, 14, 26, 5, 25, 15, 11, 6, 35, 2, 10, 19, 23 ] );;[127X[104X
    [4X[25Xgap>[125X [27XNrMovedPoints(f);[127X[104X
    [4X[28X17[128X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([1..10]);[127X[104X
    [4X[28X<identity on [ 1 .. 10 ]>[128X[104X
    [4X[25Xgap>[125X [27XNrMovedPoints(f);[127X[104X
    [4X[28X0[128X[104X
  [4X[32X[104X
  
  [1X2.5-8 LargestMovedPoint[101X
  
  [29X[2XLargestMovedPoint[102X( [3Xf[103X ) [32X operation
  [29X[2XLargestMovedPoint[102X( [3XC[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YA positive integer [10Xi[110X is moved by a partial permutation [3Xf[103X if [10Xi^[110X[3Xf[103X[10X<>i[110X.[133X
  
  [8XFor a partial permutation[108X
        [33X[0;6Y[10XLargestMovedPoint[110X  returns  the  largest  point  moved  by the partial
        permutation [3Xf[103X or [22X0[122X if no points are moved by [3Xf[103X.[133X
  
  [8XFor a partial permutation collection[108X
        [33X[0;6Y[10XLargestMovedPoint[110X  returns  the largest point moved by at least one of
        the  partial  permutations  in  the collection [3XC[103X or [22X0[122X if no points are
        moved by any element of [3XC[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [127X[104X
    [4X[25X>[125X [27X[ 1, 2, 3, 5, 6, 8, 10, 11, 14, 17, 20, 21, 22, 24, 25, 26, 32 ], [127X[104X
    [4X[25X>[125X [27X[ 30, 20, 29, 24, 9, 14, 26, 5, 25, 15, 11, 6, 35, 2, 10, 19, 23 ] );;[127X[104X
    [4X[25Xgap>[125X [27XLargestMovedPoint(f);[127X[104X
    [4X[28X32[128X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([1..10]);[127X[104X
    [4X[28X<identity on [ 1 .. 10 ]>[128X[104X
    [4X[25Xgap>[125X [27XLargestMovedPoint(f);[127X[104X
    [4X[28X0[128X[104X
  [4X[32X[104X
  
  [1X2.5-9 SmallestMovedPoint[101X
  
  [29X[2XSmallestMovedPoint[102X( [3Xf[103X ) [32X operation
  [29X[2XSmallestMovedPoint[102X( [3XC[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YA positive integer [10Xi[110X is moved by a partial permutation [3Xf[103X if [10Xi^[110X[3Xf[103X[10X<>i[110X.[133X
  
  [8XFor a partial permutation[108X
        [33X[0;6Y[10XSmallestMovedPoint[110X  returns  the  smallest  point moved by the partial
        permutation [3Xf[103X or [22X0[122X if no points are moved by [3Xf[103X.[133X
  
  [8XFor a partial permutation collection[108X
        [33X[0;6Y[10XSmallestMovedPoint[110X returns the smallest point moved by at least one of
        the  partial  permutations  in  the collection [3XC[103X or [22X0[122X if no points are
        moved by any element of [3XC[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [127X[104X
    [4X[25X>[125X [27X[ 1, 2, 3, 5, 6, 8, 10, 11, 14, 17, 20, 21, 22, 24, 25, 26, 32 ], [127X[104X
    [4X[25X>[125X [27X[ 30, 20, 29, 24, 9, 14, 26, 5, 25, 15, 11, 6, 35, 2, 10, 19, 23 ] );;[127X[104X
    [4X[25Xgap>[125X [27XSmallestMovedPoint(f);[127X[104X
    [4X[28X1[128X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([1..10]);[127X[104X
    [4X[28X<identity on [ 1 .. 10 ]>[128X[104X
    [4X[25Xgap>[125X [27XSmallestMovedPoint(f);[127X[104X
    [4X[28X0[128X[104X
  [4X[32X[104X
  
  [1X2.5-10 DenseRangeList[101X
  
  [29X[2XDenseRangeList[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA list of positive integers.[133X
  
  [33X[0;0YThe  [13Xdense  range  list[113X  of  a  partial  permutation [3Xf[103X is a list of positive
  integers [10Xlist[110X such that [10Xlist[i]=i^[110X[3Xf[103X where [10Xi^[110X[3Xf[103X[10X=0[110X if [3Xf[103X is undefined on [10Xi[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 4, 8, 9, 10 ], [ 5, 8, 9, 7, 2, 6, 10 ] );;[127X[104X
    [4X[25Xgap>[125X [27XDenseRangeList(f);[127X[104X
    [4X[28X[ 5, 8, 9, 7, 0, 0, 0, 2, 6, 10 ][128X[104X
  [4X[32X[104X
  
  [1X2.5-11 RankOfPartialPerm[101X
  
  [29X[2XRankOfPartialPerm[102X( [3Xf[103X ) [32X function
  [29X[2XRank[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThe  [13Xrank[113X  of  a partial permutation [3Xf[103X is the number of points in its domain
  (or equivalently its range).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 4, 5, 6 ], [ 10, 3, 9, 1, 5, 8 ] );;[127X[104X
    [4X[25Xgap>[125X [27XRankOfPartialPerm(f);[127X[104X
    [4X[28X6[128X[104X
  [4X[32X[104X
  
  [1X2.5-12 DegreeOfPartialPerm[101X
  
  [29X[2XDegreeOfPartialPerm[102X( [3Xf[103X ) [32X function
  [29X[2XDegree[102X( [3Xf[103X ) [32X function
  [29X[2XDegree[102X( [3XC[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThe [13Xdegree[113X of a partial permutation [3Xf[103X is the largest positive integer in the
  union of its domain and range.[133X
  
  [33X[0;0YThe  degree  of  a partial permutation collection [3XC[103X is the largest degree of
  any  partial permutation in [3XC[103X, i.e. the largest point in the domain or range
  of any element in [3XC[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 4, 6, 10 ], [ 1, 8, 2, 3, 4, 9 ] );;[127X[104X
    [4X[25Xgap>[125X [27XDegreeOfPartialPerm(f);[127X[104X
    [4X[28X10[128X[104X
  [4X[32X[104X
  
  [1X2.5-13 IndexPeriodOfPartialPerm[101X
  
  [29X[2XIndexPeriodOfPartialPerm[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA pair of positive integers.[133X
  
  [33X[0;0YReturns  the  least  positive integers [10Xm, r[110X such that [10X[3Xf[103X[10X^(m+r)=[3Xf[103X[10X^m[110X, which are
  known as the [13Xindex[113X and [13Xperiod[113X of the partial permutation [3Xf[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([127X[104X
    [4X[25X>[125X [27X[ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ], [127X[104X
    [4X[25X>[125X [27X[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ]);;[127X[104X
    [4X[25Xgap>[125X [27XIndexPeriodOfPartialPerm(f);                                    [127X[104X
    [4X[28X[ 5, 2 ][128X[104X
    [4X[25Xgap>[125X [27Xf^5=f^7;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X2.5-14 SmallestIdempotentPower[101X
  
  [29X[2XSmallestIdempotentPower[102X( [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThis  function  returns  the  least positive integer [10Xn[110X such that the partial
  permutation [10X[3Xf[103X[10X^n[110X is an idempotent. See also [2XSmallestIdempotentPower[102X ([14X2.4-8[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([127X[104X
    [4X[25X>[125X [27X[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 17, 23, 25, 29 ],[127X[104X
    [4X[25X>[125X [27X[ 30, 8, 28, 21, 23, 15, 10, 14, 1, 18, 16, 5, 7, 26, 6, 9, 11, 19 ] );;[127X[104X
    [4X[25Xgap>[125X [27XSmallestIdempotentPower(f);[127X[104X
    [4X[28X6[128X[104X
    [4X[25Xgap>[125X [27Xf^6;[127X[104X
    [4X[28X<empty mapping>[128X[104X
  [4X[32X[104X
  
  
  [1X2.6 [33X[0;0YOperators for transformations[133X[101X
  
  [8X[10X[3Xi[103X[10X ^ [3Xf[103X[10X[110X[108X
        [33X[0;6Yreturns the image of the positive integer [3Xi[103X under the transformation [3Xf[103X
        if [3Xi[103X is less than the degree of [3Xf[103X.[133X
  
  [8X[10X[3Xf[103X[10X ^ [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns  [10X[3Xg[103X[10X^-1*[3Xf[103X[10X*[3Xg[103X[10X[110X when [3Xf[103X is a transformation and [3Xg[103X is a permutation [2X\^[102X
        ([14XReference: ^[114X).[133X
  
  [8X[10X[3Xf[103X[10X * [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns  the  composition  of  the  transformations  [3Xf[103X  and  [3Xg[103X. [5XCitrus[105X
        contains   more   efficient  methods  than  the  [5XGAP[105X  library  for  [2X\*[102X
        ([14XReference:  *[114X)  when [3Xf[103X and [3Xg[103X are transformations or permutations (and
        at least one of [3Xf[103X and [3Xg[103X is a transformation).[133X
  
  [8X[10X[3Xf[103X[10X < [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns [9Xtrue[109X if [10XImageListOfTransformation([3Xf[103X[10X)[110X is lexicographically less
        than   [10XImageListOfTransformation([3Xg[103X[10X)[110X  and  [9Xfalse[109X  if  it  is  not.  See
        [2XImageListOfTransformation[102X ([14XReference: ImageListOfTransformation[114X).[133X
  
  [8X[10X[3Xf[103X[10X = [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns  [9Xtrue[109X  if the transformation [3Xf[103X equals the transformation [3Xg[103X and
        returns [9Xfalse[109X if it does not.[133X
  
  
  [1X2.7 [33X[0;0YOperators for partial permutations[133X[101X
  
  [8X[10X[3Xf[103X[10X ^ [3X-1[103X[10X[110X[108X
        [33X[0;6Yreturns the inverse of the partial permutation [3Xf[103X.[133X
  
  [8X[10X[3Xi[103X[10X ^ [3Xf[103X[10X[110X[108X
        [33X[0;6Yreturns  the  image  of  the  positive  integer  [3Xi[103X  under  the partial
        permutation [3Xf[103X if [3Xf[103X is defined on [3Xi[103X and [9Xfail[109X if [3Xf[103X is undefined on [3Xi[103X.[133X
  
  [8X[10X[3Xf[103X[10X * [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns  the  composition  of the partial permutations [3Xf[103X and [3Xg[103X. Unlike
        transformations, but similar to permutations, in [5XGAP[105X it is possible to
        multiply any two partial permutations. It is also possible to multiply
        partial  permutations  and  permutations acting on integers not larger
        than  65535;  see  [2XPartialPerm[102X ([14X2.2-1[114X) for some further comments about
        composing partial permutations and permutations.[133X
  
  [8X[10X[3Xf[103X[10X < [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns       [9Xtrue[109X       if      [10XConcatenation(DomainOfPartialPerm([3Xf[103X[10X),
        RangeOfPartialPerm([3Xf[103X[10X))[110X        is       short-lex       less       than
        [10XConcatenation(DomainOfPartialPerm([3Xg[103X[10X), RangeOfPartialPerm([3Xg[103X[10X))[110X and [9Xfalse[109X
        if  it  is  not.  Note  that  this is not the natural partial order on
        elements of an inverse semigroup; see [2XNaturalLeqPartialPerm[102X ([14X2.7-1[114X).[133X
  
  [8X[10X[3Xf[103X[10X = [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns   [9Xtrue[109X  if  the  partial  permutation  [3Xf[103X  equals  the  partial
        permutation [3Xg[103X and returns [9Xfalse[109X if it is not.[133X
  
  [8X[10X[3Xf[103X[10X / [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns  [10X[3Xf[103X[10X  *  [3Xg^-1[103X[10X[110X  where [3Xf[103X and [3Xg[103X are partial permutations; [10X[3Xf[103X[10X / [3Xg[103X[10X[110X has
        better performance than [10X[3Xf[103X[10X * [3Xg^-1[103X[10X[110X.[133X
  
  [1X2.7-1 NaturalLeqPartialPerm[101X
  
  [29X[2XNaturalLeqPartialPerm[102X( [3Xf[103X, [3Xg[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThe  [13Xnatural  partial order[113X [22X≤[122X on an inverse semigroup [22XS[122X is defined by [22Xs≤[122X[22Xt[122X if
  there  exists  an  idempotent  [22Xe[122X  in  [22XS[122X such that [22Xs=et[122X. Hence if [3Xf[103X and [3Xg[103X are
  partial  permutations,  then [3Xf[103X[22X≤[122X[3Xg[103X if and only if [3Xf[103X is a restriction of [3Xg[103X; see
  [2XRestrictedPartialPerm[102X  ([14X2.2-2[114X). [10XNaturalLeqPartialPerm[110X returns [9Xtrue[109X if [3Xf[103X is a
  restriction of [3Xg[103X and [9Xfalse[109X if it is not.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC( [ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ], [127X[104X
    [4X[25X>[125X [27X[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ] );;[127X[104X
    [4X[25Xgap>[125X [27Xset:=[ 1, 2, 3, 9, 13, 20 ];;[127X[104X
    [4X[25Xgap>[125X [27Xg:=RestrictedPartialPerm(f, set);[127X[104X
    [4X[28X[ 1 .. 3 ] -> [ 3, 12, 14 ][128X[104X
    [4X[25Xgap>[125X [27XNaturalLeqPartialPerm(g,f);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XNaturalLeqPartialPerm(f,g);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xg:=PartialPermNC( [ 1, 2, 3, 4, 5, 8, 10 ], [ 7, 1, 4, 3, 2, 6, 5 ] );;[127X[104X
    [4X[25Xgap>[125X [27XNaturalLeqPartialPerm(f, g);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XNaturalLeqPartialPerm(g, f);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  
  [1X2.8 [33X[0;0YChanging representations[133X[101X
  
  [33X[0;0YIt  is  possible to change the representation of certain transformations and
  partial permutations using the functions described in this section.[133X
  
  [1X2.8-1 AsPermOfKerImg[101X
  
  [29X[2XAsPermOfKerImg[102X( [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA permutation.[133X
  
  [33X[0;0YThis function returns a permutation [10Xp[110X such that[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28XOnTuples(CanonicalTransSameKernel(f), p)=ImageListOfTransformation(f);[128X[104X
  [4X[32X[104X
  
  [33X[0;0YSee  also  [2XCanonicalTransSameKernel[102X  ([14X2.4-1[114X)  and  [2XImageListOfTransformation[102X
  ([14XReference: ImageListOfTransformation[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 2, 1, 6, 1, 7, 6, 2, 8, 4, 7 ] );;[127X[104X
    [4X[25Xgap>[125X [27XCanonicalTransSameKernel(f); ImageListOfTransformation(f);[127X[104X
    [4X[28X[ 1, 2, 3, 2, 4, 3, 1, 5, 6, 4 ][128X[104X
    [4X[28X[ 2, 1, 6, 1, 7, 6, 2, 8, 4, 7 ][128X[104X
    [4X[25Xgap>[125X [27XAsPermOfKerImg(f);[127X[104X
    [4X[28X(1,2)(3,6,4,7)(5,8)[128X[104X
  [4X[32X[104X
  
  [1X2.8-2 AsPermutation[101X
  
  [29X[2XAsPermutation[102X( [3Xf[103X[, [3Xset[103X] ) [32X operation
  [6XReturns:[106X  [33X[0;10YA permutation.[133X
  
  [33X[0;0YIf  the  transformation or partial permutation [3Xf[103X is a permutation of the set
  of  positive  integers [3Xset[103X, then [10XAsPermutation[110X returns this permutation; see
  [2XPermutation[102X ([14XReference: Permutation[114X).[133X
  
  [33X[0;0YIf  the  optional  argument [3Xset[103X is not specified, then the image set of [3Xf[103X is
  used  by  default  for transformations and the range of [3Xf[103X is used by default
  for   partial   permutations;   see   [2XImageSetOfTransformation[102X   ([14XReference:
  ImageSetOfTransformation[114X) and [2XRangeSetOfPartialPerm[102X ([14X2.5-4[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 5, 8, 3, 5, 8, 6, 2, 2, 7, 8 ] );;[127X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 8, 2, 10, 2, 4, 4, 7, 6, 9, 10 ] );;[127X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 1, 3, 6, 6, 2, 10, 2, 3, 10, 5 ] );;[127X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f);[127X[104X
    [4X[28X(2,3,6,10,5)[128X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 5, 2, 8, 4, 1, 8, 10, 3, 5, 7 ] );;[127X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f);       [127X[104X
    [4X[28X(1,5)(3,8)(7,10)[128X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f, [1,5]);[127X[104X
    [4X[28X(1,5)[128X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f, [3,8,7,10]);[127X[104X
    [4X[28X(3,8)(7,10)[128X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPerm([ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ],[127X[104X
    [4X[25X>[125X [27X[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ]);;[127X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f, [4,5,11]);[127X[104X
    [4X[28X(5,11)[128X[104X
    [4X[25Xgap>[125X [27Xf:=RandomPartialPerm(20);;[127X[104X
    [4X[25Xgap>[125X [27XAsPermutation(f^-1*f);[127X[104X
    [4X[28X()[128X[104X
  [4X[32X[104X
  
  
  [1X2.8-3 [33X[0;0YAsPartialPerm[133X[101X
  
  [29X[2XAsPartialPerm[102X( [3Xf[103X[, [3Xset[103X] ) [32X function
  [29X[2XAsPartialPermNC[102X( [3Xf[103X[, [3Xset[103X] ) [32X function
  [6XReturns:[106X  [33X[0;10YA partial permutation.[133X
  
  [8XFor permutations:[108X
        [33X[0;6Y[10XAsPartialPerm[110X  and [10XAsPartialPermNC[110X return the partial permutation that
        equals  [3Xf[103X  on  the  set  of  positive  integers  [3Xset[103X  and is undefined
        elsewhere.  If  the optional second argument [3Xset[103X is not specfied, then
        [10XMovedPoints(f)[110X is used; see [2XMovedPoints[102X ([14XReference: MovedPoints (for a
        permutation)[114X).[133X
  
        [33X[0;6YIf  the  optional second argument [3Xset[103X is specified, then [10XAsPartialPerm[110X
        first  checks  that  [3Xset[103X  is a set of positive integers and then calls
        [10XAsPartialPermNC[110X.  If  the  optional  second argument is not specified,
        then  [10XAsPartialPerm[110X simply calls [10XAsPartialPermNC[110X and no further checks
        are performed.[133X
  
        [33X[0;6YNote that as explained in [2XPartialPerm[102X ([14X2.2-1[114X) [13Xa permutation is never a
        partial  permutation[113X  in  [5XGAP[105X,  please  keep  this  in mind when using
        [10XAsPartialPerm[110X.[133X
  
  [8XFor transformations:[108X
        [33X[0;6YIf  [3Xf[103X  is  a  transformation  such that [10XDegree([3Xf[103X[10X)^[3Xf[103X[10X=Degree([3Xf[103X[10X)[110X and [3Xf[103X is
        injective   except   on   those   [10Xi[110X   such  that  [10Xi^[3Xf[103X[10X=Degree(f)[110X,  then
        [10XAsPartialPerm[110X returns the corresponding partial permutation.[133X
  
        [33X[0;6Y[10XAsPartialPerm[110X  first  verifies  that  [3Xf[103X has the required form, whereas
        [10XAsPartialPermNC[110X   does   not.   There   is  currently  no  method  for
        [10XAsPartialPerm[110X or [10XAsPartialPermNC[110X with two arguments.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=(2,8,19,9,14,10,20,17,4,13,12,3,5,7,18,16);;[127X[104X
    [4X[25Xgap>[125X [27XAsPartialPerm(f);[127X[104X
    [4X[28X[ 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 19, 20 ] -> [128X[104X
    [4X[28X[ 8, 5, 13, 7, 18, 19, 14, 20, 3, 12, 10, 2, 4, 16, 9, 17 ][128X[104X
    [4X[25Xgap>[125X [27XAsPartialPerm(f, [1,2,3]);[127X[104X
    [4X[28X[ 1 .. 3 ] -> [ 1, 8, 5 ][128X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 8, 3, 5, 9, 6, 2, 9, 7, 9 ] );;[127X[104X
    [4X[25Xgap>[125X [27XAsPartialPerm(f);[127X[104X
    [4X[28X[ 1, 2, 3, 5, 6, 8 ] -> [ 8, 3, 5, 6, 2, 7 ][128X[104X
    [4X[25Xgap>[125X [27XAsPartialPermNC(f);[127X[104X
    [4X[28X[ 1, 2, 3, 5, 6, 8 ] -> [ 8, 3, 5, 6, 2, 7 ][128X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 2, 10, 2, 4, 4, 7, 6, 9, 10, 1 ] );;[127X[104X
    [4X[25Xgap>[125X [27XAsPartialPerm(f);[127X[104X
    [4X[28Xfail[128X[104X
  [4X[32X[104X
  
  [1X2.8-4 AsTransformation[101X
  
  [29X[2XAsTransformation[102X( [3Xf[103X[, [3Xn[103X] ) [32X operation
  [6XReturns:[106X  [33X[0;10YA transformation.[133X
  
  [33X[0;0YIf [3Xf[103X is a partial permutation and [10Xm[110X is the largest point in the union of the
  domain  and  range  of [3Xf[103X, then [10XAsTransformation[110X returns the transformation [10Xg[110X
  such  that  [10Xi^g=i^f[110X  for  all  [10Xi[110X in the domain of [3Xf[103X and [10Xi^g=m+1[110X for all [10Xi[110X in
  [22X{1,..., m+1}[122X that is not in the domain of [3Xf[103X.[133X
  
  [33X[0;0YIf  the  optional  second  argument [3Xn[103X is a positive integer greater than the
  largest  point  in  the  union  of  the  domain  and  range  of  [3Xf[103X, then the
  transformation  obtained is defined by replacing [10Xm[110X in the definition of [10Xg[110X in
  previous paragraph by [10Xn[110X.[133X
  
  [33X[0;0YIt  is  also  possible  to  use [10XAsTransformation[110X to convert permutations and
  binary  relations  into  transformations;  see  [2XAsTransformation[102X ([14XReference:
  AsTransformation[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPerm([ 1, 2, 3, 4, 5, 8, 10 ], [ 3, 1, 4, 2, 5, 6, 7 ]);;[127X[104X
    [4X[25Xgap>[125X [27XAsTransformation(f);[127X[104X
    [4X[28XTransformation( [ 3, 1, 4, 2, 5, 11, 11, 6, 11, 7, 11 ] )[128X[104X
    [4X[25Xgap>[125X [27XAsTransformation(f, 12);[127X[104X
    [4X[28XTransformation( [ 3, 1, 4, 2, 5, 12, 12, 6, 12, 7, 12, 12 ] )[128X[104X
    [4X[25Xgap>[125X [27XAsTransformation(f, 14);[127X[104X
    [4X[28XTransformation( [ 3, 1, 4, 2, 5, 14, 14, 6, 14, 7, 14, 14, 14, 14 ] )[128X[104X
  [4X[32X[104X
  
  
  [1X2.9 [33X[0;0YActions[133X[101X
  
  [33X[0;0YThe  following  actions of transformations and partial permutations are used
  by  [5XCitrus[105X  in  the  computation  of  Green's  relations  and  to test if an
  arbitrary  transformation semigroup has a particular property; see Chapter [14X4[114X
  and [14X'Reference: Basic Actions'[114X.[133X
  
  [1X2.9-1 OnKernelsAntiAction[101X
  
  [29X[2XOnKernelsAntiAction[102X( [3Xker[103X, [3Xf[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA list of positive integers.[133X
  
  [33X[0;0YThe   argument   [3Xker[103X  should  equal  [10XCanonicalTransSameKernel(g);[110X  for  some
  transformation  [10Xg[110X  with  degree equal to the degree of the transformation [3Xf[103X.
  [10XOnKernelsAntiAction[110X    returns   [10XCanonicalTransSameKernel(f*g)[110X.   See   also
  [2XCanonicalTransSameKernel[102X ([14X2.4-1[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=Transformation( [ 3, 6, 9, 2, 4, 2, 2, 2, 8, 2 ] );;[127X[104X
    [4X[25Xgap>[125X [27Xg:=Transformation( [ 7, 1, 4, 3, 2, 7, 7, 6, 6, 5 ] );;[127X[104X
    [4X[25Xgap>[125X [27Xker:=CanonicalTransSameKernel(f);[127X[104X
    [4X[28X[ 1, 2, 3, 4, 5, 4, 4, 4, 6, 4 ][128X[104X
    [4X[25Xgap>[125X [27XOnKernelsAntiAction(ker, g);[127X[104X
    [4X[28X[ 1, 2, 1, 3, 4, 1, 1, 1, 1, 5 ][128X[104X
    [4X[25Xgap>[125X [27XCanonicalTransSameKernel(g*f);[127X[104X
    [4X[28X[ 1, 2, 1, 3, 4, 1, 1, 1, 1, 5 ][128X[104X
  [4X[32X[104X
  
  [1X2.9-2 OnIntegerSetsWithPartialPerm[101X
  
  [29X[2XOnIntegerSetsWithPartialPerm[102X( [3Xset[103X, [3Xf[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA set of positive integers.[133X
  
  [33X[0;0Y[10XOnIntegerSetsWithPartialPerm[110X  is  a  special  method  for [2XOnSets[102X ([14XReference:
  OnSets[114X) for a set of positive integers [3Xset[103X and a partial permutation [3Xf[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=PartialPermNC([ 1, 2, 4, 5, 6, 8, 9, 10, 11, 15, 16, 17, 18 ],[127X[104X
    [4X[25X>[125X [27X[ 13, 20, 2, 14, 18, 7, 3, 19, 9, 11, 5, 16, 8 ]);;[127X[104X
    [4X[25Xgap>[125X [27XOnSets([1,2,3], f);[127X[104X
    [4X[28X[ 13, 20, fail ][128X[104X
    [4X[25Xgap>[125X [27XOnIntegerSetsWithPartialPerm([1,2,3], f);[127X[104X
    [4X[28X[ 13, 20 ][128X[104X
  [4X[32X[104X
  
  [1X2.9-3 TransformationActionNC[101X
  
  [29X[2XTransformationActionNC[102X( [3Xobj[103X, [3Xlist[103X, [3Xfunc[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA transformation or collection of transformations.[133X
  
  [33X[0;0YIf  [3Xobj[103X  is  a  [5XGAP[105X object that acts on the list [3Xlist[103X via the function [3Xfunc[103X,
  then  [10XTransformationActionNC[110X  returns  this  action as a transformation; see
  also   [2XTransformation[102X   ([14XReference:   Transformation[114X).  Mathematically,  the
  argument  [3Xobj[103X  should be an element of a semigroup so that the action of [3Xobj[103X
  on  [3Xlist[103X  via  [3Xfunc[103X  is  a  [12Xsemigroup action[112X. However, it is not technically
  necessary for [3Xobj[103X to be an element of a semigroup in [5XGAP[105X.[133X
  
  [33X[0;0YIf [3Xobj[103X is a semigroup, then [10XTransformationActionNC[110X returns the list obtained
  from applying [10XTransformationActionNC[110X to every generator of [3Xobj[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xmat:=OneMutable(GeneratorsOfGroup(GL(3,3))[1]);[127X[104X
    [4X[28X[ [ Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3) ],[128X[104X
    [4X[28X  [ 0*Z(3), 0*Z(3), Z(3)^0 ] ][128X[104X
    [4X[25Xgap>[125X [27Xmat[3][3]:=Z(3)*0;[127X[104X
    [4X[28X0*Z(3)[128X[104X
    [4X[25Xgap>[125X [27XF:=BaseDomain(mat);[127X[104X
    [4X[28XGF(3)[128X[104X
    [4X[25Xgap>[125X [27XTransformationActionNC(mat, Elements(F^3), OnRight);[127X[104X
    [4X[28XTransformation( [ 1, 1, 1, 4, 4, 4, 7, 7, 7, 10, 10, 10, 13, 13, 13, 16, 16,[128X[104X
    [4X[28X  16, 19, 19, 19, 22, 22, 22, 25, 25, 25 ] )[128X[104X
  [4X[32X[104X
  
  
  [1X2.10 [33X[0;0YOrbits[133X[101X
  
  [33X[0;0YThe  following functions supplement the [5XOrb[105X package by providing methods for
  computations  related  to the strongly connected components of an orbit of a
  semigroup.[133X
  
  [33X[0;0YPlease  note  that  if any of the functions in this section is applied to an
  open  orbit,  then  the  orbit is enumerated before anything else. It is not
  possible  to  calculate  the  strongly connected components of an orbit of a
  semigroup acting on a set until the entire orbit has been found.[133X
  
  [1X2.10-1 OrbSCC[101X
  
  [29X[2XOrbSCC[102X( [3Xo[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YThe strongly connected components of an orbit.[133X
  
  [33X[0;0YIf [3Xo[103X is an orbit created by the [5XOrb[105X package with the option [10Xorbitgraph=true[110X,
  then  [10XOrbSCC[110X  returns  a  set of sets of positions in [3Xo[103X corresponding to its
  strongly connected components.[133X
  
  [33X[0;0YSee also [2XOrbSCCLookup[102X ([14X2.10-2[114X) and [2XOrbSCCTruthTable[102X ([14X2.10-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=FullTransformationSemigroup(4);;[127X[104X
    [4X[25Xgap>[125X [27Xo:=ImagesOfTransSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27XOrbSCC(o);[127X[104X
    [4X[28X[ [ 1 ], [ 2, 3, 4, 5 ], [ 6, 7, 8, 9, 10, 11 ], [ 12, 13, 14, 15 ] ][128X[104X
  [4X[32X[104X
  
  [1X2.10-2 OrbSCCLookup[101X
  
  [29X[2XOrbSCCLookup[102X( [3Xo[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA lookup table for the strongly connected components of an orbit.[133X
  
  [33X[0;0YIf [3Xo[103X is an orbit created by the [5XOrb[105X package with the option [10Xorbitgraph=true[110X,
  then  [10XOrbSCCLookup[110X  returns  a  lookup  table  for  its  strongly  connected
  components.  More  precisely,  [10XOrbSCCLookup(o)[i][110X  equals  the  index of the
  strongly connected component containing [10Xo[i][110X.[133X
  
  [33X[0;0YSee also [2XOrbSCC[102X ([14X2.10-1[114X) and [2XOrbSCCTruthTable[102X ([14X2.10-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=FullTransformationSemigroup(4);;[127X[104X
    [4X[25Xgap>[125X [27Xo:=ImagesOfTransSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27XOrbSCC(o);[127X[104X
    [4X[28X[ [ 1 ], [ 2, 3, 4, 5 ], [ 6, 7, 8, 9, 10, 11 ], [ 12, 13, 14, 15 ] ][128X[104X
    [4X[25Xgap>[125X [27XOrbSCCLookup(o);[127X[104X
    [4X[28X[ 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4 ][128X[104X
    [4X[25Xgap>[125X [27XOrbSCCLookup(o)[1]; OrbSCCLookup(o)[4]; OrbSCCLookup(o)[7]; [127X[104X
    [4X[28X1[128X[104X
    [4X[28X2[128X[104X
    [4X[28X3[128X[104X
  [4X[32X[104X
  
  [1X2.10-3 OrbSCCTruthTable[101X
  
  [29X[2XOrbSCCTruthTable[102X( [3Xo[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YTruth tables for strongly connected components of an orbit.[133X
  
  [33X[0;0YIf [3Xo[103X is an orbit created by the [5XOrb[105X package with the option [10Xorbitgraph=true[110X,
  then   [10XOrbSCCTruthTable[110X   returns   a   list  of  boolean  lists  such  that
  [10XOrbSCCTruthTable(o)[i][j][110X is [9Xtrue[109X if [10Xj[110X belongs to [10XOrbSCC(o)[i][110X.[133X
  
  [33X[0;0YSee also [2XOrbSCC[102X ([14X2.10-1[114X) and [2XOrbSCCLookup[102X ([14X2.10-2[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=FullTransformationSemigroup(4);;[127X[104X
    [4X[25Xgap>[125X [27Xo:=ImagesOfTransSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27XOrbSCC(o);[127X[104X
    [4X[28X[ [ 1 ], [ 2, 3, 4, 5 ], [ 6, 7, 8, 9, 10, 11 ], [ 12, 13, 14, 15 ] ][128X[104X
    [4X[25Xgap>[125X [27XOrbSCCTruthTable(o);[127X[104X
    [4X[28X[ [ true, false, false, false, false, false, false, false, false, false, [128X[104X
    [4X[28X      false, false, false, false, false ], [128X[104X
    [4X[28X  [ false, true, true, true, true, false, false, false, false, false, false, [128X[104X
    [4X[28X      false, false, false, false ], [128X[104X
    [4X[28X  [ false, false, false, false, false, true, true, true, true, true, true, [128X[104X
    [4X[28X      false, false, false, false ], [128X[104X
    [4X[28X  [ false, false, false, false, false, false, false, false, false, false, [128X[104X
    [4X[28X      false, true, true, true, true ] ][128X[104X
  [4X[32X[104X
  
  [1X2.10-4 ReverseSchreierTreeOfSCC[101X
  
  [29X[2XReverseSchreierTreeOfSCC[102X( [3Xo[103X, [3Xi[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YThe  reverse  Schreier  tree  corresponding  to  the  [3Xi[103Xth strongly
            connected component of an orbit.[133X
  
  [33X[0;0YIf  [3Xo[103X is an orbit created by the [5XOrb[105X package with the option [10Xorbitgraph=true[110X
  and    action    [10Xact[110X,    and    [3Xi[103X    is    a    positive    integer,    then
  [10XReverseSchreierTreeOfSCC([3Xo[103X[10X,  [3Xi[103X[10X)[110X  returns  a  pair [10X[ gen, pos ][110X of lists with
  [10XLength(o)[110X entries such that[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28Xact(o[j], o!.gens[gen[j]])=o[pos[j]].[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  pair [10X[ gen, pos ][110X corresponds to a tree with root [10XOrbSCC(o)[i][1][110X and a
  path from every element of [10XOrbSCC(o)[i][110X to the root.[133X
  
  [33X[0;0YSee    also    [2XOrbSCC[102X    ([14X2.10-1[114X),    [2XTraceSchreierTreeOfSCCBack[102X   ([14X2.10-6[114X),
  [2XSchreierTreeOfSCC[102X ([14X2.10-5[114X), and [2XTraceSchreierTreeOfSCCForward[102X ([14X2.10-7[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 2, 2, 1, 4, 4 ] ), [127X[104X
    [4X[25X>[125X [27XTransformation( [ 3, 3, 3, 4, 5 ] ),[127X[104X
    [4X[25X>[125X [27XTransformation( [ 5, 1, 4, 5, 5 ] ) );;[127X[104X
    [4X[25Xgap>[125X [27Xo:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;[127X[104X
    [4X[25Xgap>[125X [27XOrbSCC(o);[127X[104X
    [4X[28X[ [ 1 ], [ 2 ], [ 3, 5, 6, 7, 11 ], [ 4 ], [ 8 ], [ 9 ], [ 10, 12 ] ][128X[104X
    [4X[25Xgap>[125X [27XReverseSchreierTreeOfSCC(o, 3);[127X[104X
    [4X[28X[ [ fail, fail, fail, fail, 2, 1, 2, fail, fail, fail, 1, fail ], [128X[104X
    [4X[28X  [ fail, fail, fail, fail, 3, 5, 3, fail, fail, fail, 7, fail ] ][128X[104X
    [4X[25Xgap>[125X [27XReverseSchreierTreeOfSCC(o, 7);[127X[104X
    [4X[28X[ [ fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, 3 ], [128X[104X
    [4X[28X  [ fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, 10 ] ][128X[104X
    [4X[25Xgap>[125X [27XOnSets(o[11], Generators(S)[1]);[127X[104X
    [4X[28X[ 1, 4 ][128X[104X
    [4X[25Xgap>[125X [27XPosition(o, last);[127X[104X
    [4X[28X7[128X[104X
  [4X[32X[104X
  
  [1X2.10-5 SchreierTreeOfSCC[101X
  
  [29X[2XSchreierTreeOfSCC[102X( [3Xo[103X, [3Xi[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YThe  Schreier  tree  corresponding  to  the [3Xi[103Xth strongly connected
            component of an orbit.[133X
  
  [33X[0;0YIf  [3Xo[103X is an orbit created by the [5XOrb[105X package with the option [10Xorbitgraph=true[110X
  and  action  [10Xact[110X,  and [3Xi[103X is a positive integer, then [10XSchreierTreeOfSCC([3Xo[103X[10X, [3Xi[103X[10X)[110X
  returns a pair [10X[ gen, pos ][110X of lists with [10XLength(o)[110X entries such that[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28Xact(o[pos[j]], o!.gens[gen[j]])=o[j].[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  pair [10X[ gen, pos ][110X corresponds to a tree with root [10XOrbSCC(o)[i][1][110X and a
  path from the root to every element of [10XOrbSCC(o)[i][110X.[133X
  
  [33X[0;0YSee    also    [2XOrbSCC[102X    ([14X2.10-1[114X),    [2XTraceSchreierTreeOfSCCBack[102X   ([14X2.10-6[114X),
  [2XReverseSchreierTreeOfSCC[102X    ([14X2.10-4[114X),    and   [2XTraceSchreierTreeOfSCCForward[102X
  ([14X2.10-7[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 2, 2, 1, 4, 4 ] ), [127X[104X
    [4X[25X>[125X [27XTransformation( [ 3, 3, 3, 4, 5 ] ),[127X[104X
    [4X[25X>[125X [27XTransformation( [ 5, 1, 4, 5, 5 ] ) );;[127X[104X
    [4X[25Xgap>[125X [27Xo:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;[127X[104X
    [4X[25Xgap>[125X [27XOrbSCC(o);[127X[104X
    [4X[28X[ [ 1 ], [ 2 ], [ 3, 5, 6, 7, 11 ], [ 4 ], [ 8 ], [ 9 ], [ 10, 12 ] ][128X[104X
    [4X[25Xgap>[125X [27XSchreierTreeOfSCC(o, 3);[127X[104X
    [4X[28X[ [ fail, fail, fail, fail, 1, 3, 1, fail, fail, fail, 2, fail ], [128X[104X
    [4X[28X  [ fail, fail, fail, fail, 7, 5, 3, fail, fail, fail, 6, fail ] ][128X[104X
    [4X[25Xgap>[125X [27XSchreierTreeOfSCC(o, 7);[127X[104X
    [4X[28X[ [ fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, 1 ], [128X[104X
    [4X[28X  [ fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, 10 ] ][128X[104X
    [4X[25Xgap>[125X [27XOnSets(o[6], Generators(S)[2]);[127X[104X
    [4X[28X[ 3, 5 ][128X[104X
    [4X[25Xgap>[125X [27XPosition(o, last);[127X[104X
    [4X[28X11[128X[104X
  [4X[32X[104X
  
  [1X2.10-6 TraceSchreierTreeOfSCCBack[101X
  
  [29X[2XTraceSchreierTreeOfSCCBack[102X( [3Xorb[103X, [3Xm[103X, [3Xnr[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA word in the generators.[133X
  
  [33X[0;0Y[3Xorb[103X  must  be an orbit object with a Schreier tree and orbit graph, that is,
  the  options  [10Xschreier[110X  and [10Xorbitgraph[110X must have been set to [9Xtrue[109X during the
  creation  of  the  orbit,  [3Xm[103X  must  be  the  number  of a strongly connected
  component  of  [3Xorb[103X, and [10Xnr[110X must be the number of a point in the [3Xm[103Xth strongly
  connect   component   of   [3Xorb[103X.   This   operation   traces  the  result  of
  [2XReverseSchreierTreeOfSCC[102X ([14X2.10-4[114X) and with arguments [3Xorb[103X and [3Xm[103X and returns a
  word in the generators that maps the point with number [3Xnr[103X to the first point
  in  the  [3Xm[103Xth  strongly connected component of [3Xorb[103X. Here, a word is a list of
  integers, where positive integers are numbers of generators. See also [2XOrbSCC[102X
  ([14X2.10-1[114X),[2XEvaluateWord[102X     ([14X4.1-1[114X),     [2XReverseSchreierTreeOfSCC[102X    ([14X2.10-4[114X),
  [2XSchreierTreeOfSCC[102X ([14X2.10-5[114X), and [2XTraceSchreierTreeOfSCCForward[102X ([14X2.10-7[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 1, 3, 4, 1 ] ), [127X[104X
    [4X[25X>[125X [27XTransformation( [ 2, 4, 1, 2 ] ),[127X[104X
    [4X[25X>[125X [27XTransformation( [ 3, 1, 1, 3 ] ), [127X[104X
    [4X[25X>[125X [27XTransformation( [ 3, 3, 4, 1 ] ) );;[127X[104X
    [4X[25Xgap>[125X [27Xo:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;[127X[104X
    [4X[25Xgap>[125X [27XOrbSCC(o);[127X[104X
    [4X[28X[ [ 1 ], [ 2 ], [ 3 ], [ 4, 5, 6, 7, 8 ], [ 9, 10, 11, 12 ] ][128X[104X
    [4X[25Xgap>[125X [27XReverseSchreierTreeOfSCC(o, 4);               [127X[104X
    [4X[28X[ [ fail, fail, fail, fail, 4, 1, 1, 3, fail, fail, fail, fail ], [128X[104X
    [4X[28X  [ fail, fail, fail, fail, 4, 4, 4, 4, fail, fail, fail, fail ] ][128X[104X
    [4X[25Xgap>[125X [27XTraceSchreierTreeOfSCCBack(o, 4, 7);[127X[104X
    [4X[28X[ 1 ][128X[104X
    [4X[25Xgap>[125X [27XTraceSchreierTreeOfSCCBack(o, 4, 8);[127X[104X
    [4X[28X[ 3 ][128X[104X
  [4X[32X[104X
  
  [1X2.10-7 TraceSchreierTreeOfSCCForward[101X
  
  [29X[2XTraceSchreierTreeOfSCCForward[102X( [3Xorb[103X, [3Xm[103X, [3Xnr[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA word in the generators.[133X
  
  [33X[0;0Y[3Xorb[103X  must  be an orbit object with a Schreier tree and orbit graph, that is,
  the  options  [10Xschreier[110X  and [10Xorbitgraph[110X must have been set to [9Xtrue[109X during the
  creation  of  the  orbit,  [3Xm[103X  must  be  the  number  of a strongly connected
  component  of  [3Xorb[103X, and [10Xnr[110X must be the number of a point in the [3Xm[103Xth strongly
  connect   component   of   [3Xorb[103X.   This   operation   traces  the  result  of
  [2XSchreierTreeOfSCC[102X  ([14X2.10-5[114X)  and with arguments [3Xorb[103X and [3Xm[103X and returns a word
  in  the  generators  that maps the first point in the [3Xm[103Xth strongly connected
  component  of  [3Xorb[103X  to  the  point with number [3Xnr[103X. Here, a word is a list of
  integers, where positive integers are numbers of generators. See also [2XOrbSCC[102X
  ([14X2.10-1[114X),    [2XEvaluateWord[102X    ([14X4.1-1[114X),   [2XReverseSchreierTreeOfSCC[102X   ([14X2.10-4[114X),
  [2XSchreierTreeOfSCC[102X ([14X2.10-5[114X), and [2XTraceSchreierTreeOfSCCBack[102X ([14X2.10-6[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 1, 3, 4, 1 ] ), [127X[104X
    [4X[25X>[125X [27XTransformation( [ 2, 4, 1, 2 ] ),[127X[104X
    [4X[25X>[125X [27XTransformation( [ 3, 1, 1, 3 ] ), [127X[104X
    [4X[25X>[125X [27XTransformation( [ 3, 3, 4, 1 ] ) );;[127X[104X
    [4X[25Xgap>[125X [27Xo:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;[127X[104X
    [4X[25Xgap>[125X [27XOrbSCC(o);[127X[104X
    [4X[28X[ [ 1 ], [ 2 ], [ 3 ], [ 4, 5, 6, 7, 8 ], [ 9, 10, 11, 12 ] ][128X[104X
    [4X[25Xgap>[125X [27XSchreierTreeOfSCC(o, 4);[127X[104X
    [4X[28X[ [ fail, fail, fail, fail, 1, 2, 2, 4, fail, fail, fail, fail ], [128X[104X
    [4X[28X  [ fail, fail, fail, fail, 4, 4, 6, 4, fail, fail, fail, fail ] ][128X[104X
    [4X[25Xgap>[125X [27XTraceSchreierTreeOfSCCForward(o, 4, 8);[127X[104X
    [4X[28X[ 4 ][128X[104X
    [4X[25Xgap>[125X [27XTraceSchreierTreeOfSCCForward(o, 4, 7);[127X[104X
    [4X[28X[ 2, 2 ][128X[104X
  [4X[32X[104X
  
