  
  [1X7 [33X[0;0YCosets of PcpGroups[133X[101X
  
  [33X[0;0Y[5XGAP[105X  is  well-equipped  to  deal  with [13Xfinite[113X cosets. However, if a coset is
  infinite,  methods  may not be available, may be faulty, or may run forever.
  The  [5XTwistedConjugacy[105X  package  provides  additional  methods  for  existing
  functions that can deal with infinite cosets of PcpGroups.[133X
  
  [33X[0;0YThe  only  completely  new functions are [2XDoubleCosetIndex[102X ([14X7.2-7[114X) and its [10XNC[110X
  version.[133X
  
  
  [1X7.1 [33X[0;0YRight cosets[133X[101X
  
  [33X[0;0YCalculating the intersection of two right cosets [23XHx[123X and [23XKy[123X can be reduced to
  calculating  the  intersection [23XH \cap K[123X and verifying whether [23Xxy^{-1} \in HK[123X
  (see [2X\in[102X ([14X7.2-1[114X)).[133X
  
  [1X7.1-1 Intersection[101X
  
  [33X[1;0Y[29X[2XIntersection[102X( [3XC1[103X, [3XC2[103X, [3X...[103X ) [32X function[133X
  [33X[1;0Y[29X[2XIntersection[102X( [3XL[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ythe intersection of the right cosets [3XC1[103X, [3XC2[103X, ...[133X
  
  [33X[0;0YAlternatively, this function also accepts a single list of right cosets [3XL[103X as
  argument.[133X
  
  [33X[0;0YThis intersection is always a right coset, or the empty list.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := ExamplesOfSomePcpGroups( 5 );;[127X[104X
    [4X[25Xgap>[125X [27XH := Subgroup( G, [ G.1*G.2^-1*G.3^-1*G.4^-1, G.2^-1*G.3*G.4^-2 ] );;[127X[104X
    [4X[25Xgap>[125X [27XK := Subgroup( G, [ G.1*G.3^-2*G.4^2, G.1*G.4^4 ] );;[127X[104X
    [4X[25Xgap>[125X [27Xx := G.1*G.3^-1;;[127X[104X
    [4X[25Xgap>[125X [27Xy := G.1*G.2^-1*G.3^-2*G.4^-1;;[127X[104X
    [4X[25Xgap>[125X [27Xz := G.1*G.2*G.3*G.4^2;;[127X[104X
    [4X[25Xgap>[125X [27XHx := RightCoset( H, x );;[127X[104X
    [4X[25Xgap>[125X [27XKy := RightCoset( K, y );;[127X[104X
    [4X[25Xgap>[125X [27XIntersection( Hx, Ky );[127X[104X
    [4X[28XRightCoset(<group with 2 generators>,<object>)[128X[104X
    [4X[25Xgap>[125X [27XKz := RightCoset( K, z );;[127X[104X
    [4X[25Xgap>[125X [27XIntersection( Hx, Kz );[127X[104X
    [4X[28X[  ][128X[104X
  [4X[32X[104X
  
  
  [1X7.2 [33X[0;0YDouble cosets[133X[101X
  
  [33X[0;0YAlgorithms  designed  for  computing  with  twisted conjugacy classes can be
  leveraged  to  do  computations involving double cosets, see [Ter25, Sec. 9]
  for  a  description on this. When the [5XTwistedConjugacy[105X package is loaded, it
  does  this  automatically,  and  the  functions  below  should then work for
  PcpGroups, even if they are infinite.[133X
  
  
  [1X7.2-1 [33X[0;0Y\in[133X[101X
  
  [33X[1;0Y[29X[2X\in[102X( [3Xg[103X, [3XD[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X if [3Xg[103X is an element of [3XD[103X, otherwise [9Xfalse[109X.[133X
  
  
  [1X7.2-2 [33X[0;0YSize[133X[101X
  
  [33X[1;0Y[29X[2XSize[102X( [3XD[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ythe number of elements in [3XD[103X.[133X
  
  
  [1X7.2-3 [33X[0;0YList[133X[101X
  
  [33X[1;0Y[29X[2XList[102X( [3XD[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya list containing the elements of [3XD[103X.[133X
  
  [33X[0;0YIf [3XD[103X is infinite, this will run forever. It is recommended to first test the
  finiteness of [3XD[103X using [2XSize[102X ([14X7.2-2[114X).[133X
  
  
  [1X7.2-4 [33X[0;0Y\=[133X[101X
  
  [33X[1;0Y[29X[2X\=[102X( [3XC[103X, [3XD[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X if [3XC[103X and [3XD[103X are the same double coset, otherwise [9Xfalse[109X.[133X
  
  
  [1X7.2-5 [33X[0;0YDoubleCosets[133X[101X
  
  [33X[1;0Y[29X[2XDoubleCosets[102X( [3XG[103X, [3XH[103X, [3XK[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDoubleCosetsNC[102X( [3XG[103X, [3XH[103X, [3XK[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ya duplicate-free list of all [10X([3XH[103X[10X,[3XK[103X[10X)[110X-double cosets in [3XG[103X if there are
            finitely many, otherwise [9Xfail[109X.[133X
  
  [33X[0;0YThe groups [3XH[103X and [3XK[103X must be subgroups of the group [3XG[103X. The [10XNC[110X version does not
  check whether this is the case.[133X
  
  
  [1X7.2-6 [33X[0;0YDoubleCosetRepsAndSizes[133X[101X
  
  [33X[1;0Y[29X[2XDoubleCosetRepsAndSizes[102X( [3XG[103X, [3XH[103X, [3XK[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ya  list  containing  pairs  of  the  form  [10X[  r, n ][110X, where [10Xr[110X is a
            representative and [10Xn[110X is the size of a double coset.[133X
  
  [33X[0;0YWhile  for  finite  groups  this  function  is  supposed  to  be faster than
  [2XDoubleCosetsNC[102X ([14X7.2-5[114X), for PcpGroups it is usually [13Xslower[113X.[133X
  
  
  [1X7.2-7 [33X[0;0YDoubleCosetIndex[133X[101X
  
  [33X[1;0Y[29X[2XDoubleCosetIndex[102X( [3XG[103X, [3XH[103X, [3XK[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDoubleCosetIndexNC[102X( [3XG[103X, [3XH[103X, [3XK[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Ythe double coset index of the pair ([3XH[103X,[3XK[103X).[133X
  
  [33X[0;0YThe groups [3XH[103X and [3XK[103X must be subgroups of the group [3XG[103X. The [10XNC[110X version does not
  check whether this is the case.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XHxK := DoubleCoset( H, x, K );;[127X[104X
    [4X[25Xgap>[125X [27XHyK := DoubleCoset( H, y, K );;[127X[104X
    [4X[25Xgap>[125X [27XHzK := DoubleCoset( H, z, K );;[127X[104X
    [4X[25Xgap>[125X [27Xy in HxK;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xz in HxK;[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XHxK = HyK;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XHxK = HzK;[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XDoubleCosets( G, H, K );[127X[104X
    [4X[28X[ DoubleCoset(<group with 2 generators>,<object>,<group with 2 generators>),[128X[104X
    [4X[28X  DoubleCoset(<group with 2 generators>,<object>,<group with 2 generators>) ][128X[104X
    [4X[25Xgap>[125X [27XDoubleCosetIndex( G, H, K );[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
