  
  [1X4 [33X[0;0YGroupoids[133X[101X
  
  [33X[0;0YA   [13Xgroupoid[113X  is  a  (mathematical)  category  in  which  every  element  is
  invertible.  It  consists  of  a set of [13Xpieces[113X, each of which is a connected
  groupoid.  The  usual  terminology  is  `connected  component',  but  in [5XGAP[105X
  `component' is used for `record component', so we use the term [13Xsingle piece[113X.[133X
  
  [33X[0;0YThe  simplest  form  for  a [13Xsingle piece groupoid[113X is the direct product of a
  group and a complete digraph, and so is determined by a set of [13Xobjects[113X [10Xobs[110X [22X=
  Ω[122X  (the  least  of which is the [13Xroot object[113X), and a [13Xroot group[113X [10Xgrp[110X [22X= G[122X. Then
  the  elements  of  the groupoid are [13Xarrows[113X [22Xg : o_1 -> o_2[122X, stored as triples
  [10X[g,o1,o2][110X, where [22Xg ∈ G[122X and [22Xo_1,o_2 ∈ Ω[122X. The objects will generally be chosen
  to  be  consecutive  negative  integers,  but  any  suitable  ordered set is
  acceptable,  and  `consecutive'  is  not  a requirement. The root group will
  usually  be  taken  to  be a permutation group, but pc-groups, fp-groups and
  matrix groups are also supported.[133X
  
  [33X[0;0YA [13Xgroup[113X may be considered as a single piece groupoid with one object.[133X
  
  [33X[0;0YA  [13Xgroupoid[113X  is a set of one or more single piece groupoids, its [13Xpieces[113X, and
  is represented as [10XIsGroupoidRep[110X, with attribute [10XPiecesOfGroupoid[110X.[133X
  
  [33X[0;0YA  groupoid  is  [13Xhomogeneous[113X  if  it has two of more isomorphic pieces, with
  identical groups. The special case of [13Xhomogeneous, discrete[113X groupoids, where
  each  piece  has a single object, is given its own representation. These are
  used in the [5XXMod[105X package as the source of a crossed modules of groupoids.[133X
  
  [33X[0;0YFor  the  definitions of the standard properties of groupoids we refer to R.
  Brown's   book  ``Topology''  [Bro88],  recently  revised  and  reissued  as
  ``Topology and Groupoids'' [Bro06].[133X
  
  
  [1X4.1 [33X[0;0YGroupoids: their properties and attributes[133X[101X
  
  [1X4.1-1 SinglePieceGroupoid[101X
  
  [29X[2XSinglePieceGroupoid[102X( [3Xgrp[103X, [3Xobs[103X ) [32X operation
  [29X[2XGroupoid[102X( [3Xargs[103X ) [32X function
  [29X[2XDomainWithSingleObject[102X( [3Xgp[103X, [3Xobj[103X ) [32X operation
  
  [33X[0;0YThe  simplest construction of a groupoid is as the direct product of a group
  and  a complete digraph. Such a groupoid will be called a [13Xstandard groupoid[113X.
  Many  subgroupoids of such a groupoid do not have this simple form, and will
  be  considered  in  section  [14X4.3[114X. The global function [10XGroupoid[110X will normally
  find the appropriate constructor to call, the options being:[133X
  
  [30X    [33X[0;6Ythe object group, a set of objects;[133X
  
  [30X    [33X[0;6Ya group being converted to a groupoid, a single object;[133X
  
  [30X    [33X[0;6Ya list of groupoids which have already been constructed (see [14X4.1-4[114X).[133X
  
  [33X[0;0YMethods for [10XViewObj[110X, [10XPrintObj[110X and [10XDisplay[110X are provided for groupoids and the
  other types of object in this package. Users are advised to supply names for
  all the groups and groupoids they construct.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xs4 := Group( (1,2,3,4), (3,4) );; [127X[104X
    [4X[25Xgap>[125X [27Xd8 := Subgroup( s4, [ (1,2,3,4), (1,3) ] );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( s4, "s4" );  SetName( d8, "d8" ); [127X[104X
    [4X[25Xgap>[125X [27XGs4 := SinglePieceGroupoid( s4, [-15 .. -11] ); [127X[104X
    [4X[28Xsingle piece groupoid: < s4, [ -15 .. -11 ] >[128X[104X
    [4X[25Xgap>[125X [27XGd8 := Groupoid( d8, [-9,-8,-7] );[127X[104X
    [4X[28Xsingle piece groupoid: < d8, [ -9, -8, -7 ] >[128X[104X
    [4X[25Xgap>[125X [27Xc6 := Group( (5,6,7)(8,9) );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( c6, "c6" );[127X[104X
    [4X[25Xgap>[125X [27XGc6 := DomainWithSingleObject( c6, -6 );[127X[104X
    [4X[28Xsingle piece groupoid: < c6, [ -6 ] >[128X[104X
    [4X[25Xgap>[125X [27XSetName( Gs4, "Gs4" );  SetName( Gd8, "Gd8" );  SetName( Gc6, "Gc6" );  [127X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.1-2 ObjectList[101X
  
  [29X[2XObjectList[102X( [3Xgpd[103X ) [32X attribute
  [29X[2XRootObject[102X( [3Xgpd[103X ) [32X attribute
  [29X[2XRootGroup[102X( [3Xgpd[103X ) [32X attribute
  [29X[2XObjectGroup[102X( [3Xgpd[103X, [3Xobj[103X ) [32X operation
  
  [33X[0;0YThe  [10XObjectList[110X  of a groupoid is the sorted list of objects. The [10XRootObject[110X
  in  a  single-piece  groupoid  is  the object with least label. A [13Xloop[113X is an
  arrow  of the form [22Xg : o -> o[122X, and the loops at a particular object [22Xo[122X form a
  group,  the  [10XObjectGroup[110X  at  [22Xo[122X.  The  [10XRootGroup[110X  is  the [10XObjectGroup[110X at the
  [10XRootObject[110X.[133X
  
  [33X[0;0YIn  the  example the groupoids [10XGf2c6[110X and [10XGabc[110X show that the objects need not
  be integers.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XObjectList( Gs4 );    [127X[104X
    [4X[28X[ -15 .. -11 ][128X[104X
    [4X[25Xgap>[125X [27X[ RootObject( Gd8 ), RootGroup( Gc6 ), ObjectGroup( Gs4, -11 ) ];[127X[104X
    [4X[28X[ -9, c6, s4 ][128X[104X
    [4X[25Xgap>[125X [27Xf2 := FreeGroup(2);;[127X[104X
    [4X[25Xgap>[125X [27XGf2c6 := Groupoid( c6, GeneratorsOfGroup(f2) );[127X[104X
    [4X[28Xsingle piece groupoid: < c6, [ f1, f2 ] >[128X[104X
    [4X[25Xgap>[125X [27XArrow( Gf2c6, (5,7,6), f2.1, f2.2 );[127X[104X
    [4X[28X[(5,7,6) : f1 -> f2][128X[104X
    [4X[25Xgap>[125X [27XGabc := Groupoid( d8, [ "a", "b", "c" ] );[127X[104X
    [4X[28Xsingle piece groupoid: < d8, [ "a", "b", "c" ] >[128X[104X
    [4X[25Xgap>[125X [27XArrow( Gabc, (2,4), "c", "b" );[127X[104X
    [4X[28X[(2,4) : c -> b][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.1-3 IsPermGroupoid[101X
  
  [29X[2XIsPermGroupoid[102X( [3Xgpd[103X ) [32X property
  [29X[2XIsPcGroupoid[102X( [3Xgpd[103X ) [32X property
  [29X[2XIsFpGroupoid[102X( [3Xgpd[103X ) [32X property
  [29X[2XIsMatrixGroupoid[102X( [3Xgpd[103X ) [32X property
  [29X[2XIsFreeGroupoid[102X( [3Xgpd[103X ) [32X property
  
  [33X[0;0YA  groupoid  is  a  permutation  groupoid if all its pieces have permutation
  groups.  Most of the examples in this chapter are permutation groupoids, but
  in principle any type of group known to [5XGAP[105X may be used.[133X
  
  [33X[0;0YIn the following example [10XGf2[110X is an fp-groupoid and also a free groupoid, [10XGq8[110X
  is a pc-groupoid, and [10XGgl43[110X is a matrix groupoid. See section [14X5.7[114X for matrix
  representations of groupoids.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xf2 := FreeGroup( 2 );;[127X[104X
    [4X[25Xgap>[125X [27XGf2 := Groupoid( f2, -22 );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( f2, "f2" );  SetName( Gf2, "Gf2" ); [127X[104X
    [4X[25Xgap>[125X [27Xq8 := SmallGroup( 8, 4 );;[127X[104X
    [4X[25Xgap>[125X [27XGq8 := Groupoid( q8, [ -28, -27 ] );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( q8, "q8" );  SetName( Gq8, "Gq8" );[127X[104X
    [4X[25Xgap>[125X [27Xgl43 := SpecialLinearGroup( 4, 3 );;[127X[104X
    [4X[25Xgap>[125X [27XGgl43 := SinglePieceGroupoid( gl43, [ -35..-31 ] );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( gl43, "gl43" );  SetName( Ggl43, "Ggl43" );[127X[104X
    [4X[25Xgap>[125X [27X[ IsMatrixGroupoid( Ggl43 ), IsFpGroupoid( Gf2 ), IsFreeGroupoid( Gf2 ), [127X[104X
    [4X[25X>[125X [27X     IsPcGroupoid( Gq8 ), IsPermGroupoid( Gs4 ) ]; [127X[104X
    [4X[28X[ true, true, true, true, true ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.1-4 UnionOfPieces[101X
  
  [29X[2XUnionOfPieces[102X( [3Xpieces[103X ) [32X operation
  [29X[2XPieces[102X( [3Xgpd[103X ) [32X attribute
  [29X[2XSize[102X( [3Xgpd[103X ) [32X attribute
  [29X[2XReplaceOnePieceInUnion[102X( [3XU[103X, [3Xold_piece[103X, [3Xnew_piece[103X ) [32X operation
  
  [33X[0;0YWhen  a  groupoid  consists  of  two or more pieces, we require their object
  lists  to be disjoint. The operation [10XUnionOfPieces[110X and the attribute [10XPieces[110X,
  introduced  in  section  [14X2.5[114X,  are  also  used for groupoids. The pieces are
  sorted  by  the  least  object  in their object lists. The [10XObjectList[110X is the
  sorted concatenation of the objects in the pieces.[133X
  
  [33X[0;0YThe  [10XSize[110X  of  a  groupoid  is  the number of its arrows. For a single piece
  groupoid,  this  is  the product of the size of the group with the square of
  the  number of objects. For a non-connected groupoid, the size is the sum of
  the sizes of its pieces.[133X
  
  [33X[0;0YOne  of  the  pieces  in  a groupoid may be replaced by an alternative piece
  using  the operation [10XReplaceOnePieceInUnion[110X. The [13Xold_piece[113X may be either the
  [13Xposition[113X of the piece to be replaced, or one of the pieces in [10XU[110X. The objects
  in  the  new  piece  may  or  may not overlap the objects in the piece being
  removed  --  we  just  require  that  the  object lists in the new union are
  disjoint.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XU3 := UnionOfPieces( [ Gc6, Gd8, Gs4 ] );;[127X[104X
    [4X[25Xgap>[125X [27XDisplay( U3 );[127X[104X
    [4X[28Xgroupoid with 3 pieces:[128X[104X
    [4X[28X< objects: [ -15 .. -11 ][128X[104X
    [4X[28X    group: s4 = <[ (1,2,3,4), (3,4) ]> >[128X[104X
    [4X[28X< objects: [ -9, -8, -7 ][128X[104X
    [4X[28X    group: d8 = <[ (1,2,3,4), (1,3) ]> >[128X[104X
    [4X[28X< objects: [ -6 ][128X[104X
    [4X[28X    group: c6 = <[ (5,6,7)(8,9) ]> >[128X[104X
    [4X[25Xgap>[125X [27XPieces( U3 );[127X[104X
    [4X[28X[ Gs4, Gd8, Gc6 ][128X[104X
    [4X[25Xgap>[125X [27XObjectList( U3 );[127X[104X
    [4X[28X[ -15, -14, -13, -12, -11, -9, -8, -7, -6 ][128X[104X
    [4X[25Xgap>[125X [27XU2 := Groupoid( [ Gf2, Gq8 ] );;[127X[104X
    [4X[25Xgap>[125X [27X[ Size(Gs4), Size(Gd8), Size(Gc6), Size(U3) ];[127X[104X
    [4X[28X[ 600, 72, 6, 678 ][128X[104X
    [4X[25Xgap>[125X [27X[ Size(Gf2), Size(Gq8), Size(U2) ];           [127X[104X
    [4X[28X[ infinity, 32, infinity ][128X[104X
    [4X[25Xgap>[125X [27XU5 := UnionOfPieces( [ U3, U2 ] );[127X[104X
    [4X[28Xgroupoid with 5 pieces:[128X[104X
    [4X[28X[ Gq8, Gf2, Gs4, Gd8, Gc6 ][128X[104X
    [4X[25Xgap>[125X [27XDisplay( U5 );[127X[104X
    [4X[28Xgroupoid with 5 pieces:[128X[104X
    [4X[28X< objects: [ -28, -27 ][128X[104X
    [4X[28X    group: q8 = <[ f1, f2, f3 ]> >[128X[104X
    [4X[28X< objects: [ -22 ][128X[104X
    [4X[28X    group: f2 = <[ f1, f2 ]> >[128X[104X
    [4X[28X< objects: [ -15 .. -11 ][128X[104X
    [4X[28X    group: s4 = <[ (1,2,3,4), (3,4) ]> >[128X[104X
    [4X[28X< objects: [ -9, -8, -7 ][128X[104X
    [4X[28X    group: d8 = <[ (1,2,3,4), (1,3) ]> >[128X[104X
    [4X[28X< objects: [ -6 ][128X[104X
    [4X[28X    group: c6 = <[ (5,6,7)(8,9) ]> >[128X[104X
    [4X[25Xgap>[125X [27XV5 := ReplaceOnePieceInUnion( U5, 3, Ggl43 ); [127X[104X
    [4X[28Xgroupoid with 5 pieces:[128X[104X
    [4X[28X[ Ggl43, Gq8, Gf2, Gd8, Gc6 ][128X[104X
    [4X[25Xgap>[125X [27XObjectList( V5 );             [127X[104X
    [4X[28X[ -35, -34, -33, -32, -31, -28, -27, -22, -9, -8, -7, -6 ][128X[104X
    [4X[25Xgap>[125X [27XU5 = V5;[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XW5 := ReplaceOnePieceInUnion( V5, Gc6, Gs4 ); [127X[104X
    [4X[28Xgroupoid with 5 pieces:[128X[104X
    [4X[28X[ Ggl43, Gq8, Gf2, Gs4, Gd8 ][128X[104X
    [4X[25Xgap>[125X [27XObjectList( W5 );[127X[104X
    [4X[28X[ -35, -34, -33, -32, -31, -28, -27, -22, -15, -14, -13, -12, -11, -9, -8, -7 [128X[104X
    [4X[28X ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.1-5 HomogeneousGroupoid[101X
  
  [29X[2XHomogeneousGroupoid[102X( [3Xgpd[103X, [3Xoblist[103X ) [32X operation
  [29X[2XHomogeneousDiscreteGroupoid[102X( [3Xgp[103X, [3Xobs[103X ) [32X operation
  
  [33X[0;0YSpecial  functions  are provided for the case where a groupoid has more than
  one  connected component, and when these components are identical except for
  their object sets. Such groupoids are said to be [13Xhomogeneous[113X.[133X
  
  [33X[0;0YThe  operation  [10XHomogeneousGroupoid[110X is used when the components each contain
  more  than  one object. The arguments consist of a single piece groupoid [10Xgpd[110X
  and  a  list  of  lists  of objects [10Xoblist[110X, each of whose lists has the same
  length  as  the object list [10Xobs[110X of [10Xgpd[110X. Note that [10Xgpd[110X is [13Xnot[113X included as one
  of  the  pieces  in the output unless [10Xobs[110X is included as one of the lists in
  [10Xoblist[110X.[133X
  
  [33X[0;0YThe  operation  [10XHomogeneousDiscreteGroupoid[110X is used when the components each
  have a single object. In this case the first argument is just a group -- the
  root  group for each component. These groupoids are used in the [5XXMod[105X package
  as the source of many crossed modules of groupoids.[133X
  
  [33X[0;0YBoth  types of groupoid have the property [10XIsHomogeneousDomainWithObjects[110X. In
  the  latter  case a separate representation [10XIsHomogeneousDiscreteGroupoidRep[110X
  is used.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XHd8 := HomogeneousGroupoid( Gd8, [ [-12,-11,-10], [-16,-15,-14] ] );[127X[104X
    [4X[28Xhomogeneous groupoid with 2 pieces:[128X[104X
    [4X[28X1:  single piece groupoid: < d8, [ -16, -15, -14 ] >[128X[104X
    [4X[28X2:  single piece groupoid: < d8, [ -12, -11, -10 ] >[128X[104X
    [4X[25Xgap>[125X [27XSize(Hd8);   ## 8x3x3 + 8x3x3[127X[104X
    [4X[28X144[128X[104X
    [4X[25Xgap>[125X [27XIsHomogeneousDomainWithObjects( Hd8 );               [127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XHc6 := HomogeneousDiscreteGroupoid( c6, [-7..-4] ); [127X[104X
    [4X[28Xhomogeneous, discrete groupoid: < c6, [ -7 .. -4 ] >[128X[104X
    [4X[25Xgap>[125X [27XSize(Hc6);   ## 6x4[127X[104X
    [4X[28X24[128X[104X
    [4X[25Xgap>[125X [27XRepresentationsOfObject(Gd8);[127X[104X
    [4X[28X[ "IsComponentObjectRep", "IsAttributeStoringRep", "IsMWOSinglePieceRep" ][128X[104X
    [4X[25Xgap>[125X [27XRepresentationsOfObject(Hd8);[127X[104X
    [4X[28X[ "IsComponentObjectRep", "IsAttributeStoringRep", "IsPiecesRep" ][128X[104X
    [4X[25Xgap>[125X [27XRepresentationsOfObject(Hc6);[127X[104X
    [4X[28X[ "IsComponentObjectRep", "IsAttributeStoringRep", [128X[104X
    [4X[28X  "IsHomogeneousDiscreteGroupoidRep" ][128X[104X
    [4X[25Xgap>[125X [27Xktpo := KnownTruePropertiesOfObject(Hc6);; [127X[104X
    [4X[25Xgap>[125X [27Xans := [127X[104X
    [4X[25X>[125X [27X[ "CanEasilyCompareElements", "CanEasilySortElements", [127X[104X
    [4X[25X>[125X [27X  "IsDuplicateFree", "IsAssociative", "IsCommutative", [127X[104X
    [4X[25X>[125X [27X  "IsDiscreteDomainWithObjects", "IsHomogeneousDomainWithObjects" ];;[127X[104X
    [4X[25Xgap>[125X [27XForAll( ans, a -> ( a in ktpo ) ); [127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.1-6 DirectProductOp[101X
  
  [29X[2XDirectProductOp[102X( [3Xlist[103X, [3Xgpd[103X ) [32X operation
  [29X[2XProjection[102X( [3Xgpd[103X, [3Xpos[103X ) [32X operation
  [29X[2XEmbedding[102X( [3Xgpd[103X, [3Xpos[103X ) [32X operation
  
  [33X[0;0YThe  direct  product of groupoids [22XG,H[122X has as group the direct product of the
  groups  in  [22XG[122X and [22XH[122X and as object list the cartesian product of their object
  lists.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xprod := DirectProductOp( [Gd8,Gc6], Gd8 );[127X[104X
    [4X[28Xsingle piece groupoid: < Group( [ (1,2,3,4), (1,3), (5,6,7)(8,9) ] ), [128X[104X
    [4X[28X[ [ -9, -6 ], [ -8, -6 ], [ -7, -6 ] ] >[128X[104X
    [4X[25Xgap>[125X [27XProjection( prod, 1 );                    [127X[104X
    [4X[28Xgroupoid homomorphism : [128X[104X
    [4X[28X[ [ [(1,2,3,4) : [ -9, -6 ] -> [ -9, -6 ]], [(1,3) : [ -9, -6 ] -> [ -9, -6 ]][128X[104X
    [4X[28X        , [(5,6,7)(8,9) : [ -9, -6 ] -> [ -9, -6 ]], [128X[104X
    [4X[28X      [() : [ -9, -6 ] -> [ -8, -6 ]], [() : [ -9, -6 ] -> [ -7, -6 ]] ], [128X[104X
    [4X[28X  [ [(1,2,3,4) : -9 -> -9], [(1,3) : -9 -> -9], [() : -9 -> -9], [128X[104X
    [4X[28X      [() : -9 -> -8], [() : -9 -> -7] ] ][128X[104X
    [4X[25Xgap>[125X [27XEmbedding(prod,2);                        [127X[104X
    [4X[28Xgroupoid homomorphism : [128X[104X
    [4X[28X[ [ [(5,6,7)(8,9) : -6 -> -6] ], [128X[104X
    [4X[28X  [ [(5,6,7)(8,9) : [ -9, -6 ] -> [ -9, -6 ]] ] ][128X[104X
    [4X[25Xgap>[125X [27XDirectProductInfo( prod );[127X[104X
    [4X[28Xrec( embeddings := [ , groupoid homomorphism : [128X[104X
    [4X[28X        [ [ [(5,6,7)(8,9) : -6 -> -6] ], [128X[104X
    [4X[28X          [ [(5,6,7)(8,9) : [ -9, -6 ] -> [ -9, -6 ]] ] ] ], first := Gd8, [128X[104X
    [4X[28X  groupoids := [ Gd8, Gc6 ], groups := [ d8, c6 ], [128X[104X
    [4X[28X  objectlists := [ [ -9, -8, -7 ], [ -6 ] ], [128X[104X
    [4X[28X  projections := [ groupoid homomorphism : [128X[104X
    [4X[28X        [ [ [(1,2,3,4) : [ -9, -6 ] -> [ -9, -6 ]], [128X[104X
    [4X[28X              [(1,3) : [ -9, -6 ] -> [ -9, -6 ]], [128X[104X
    [4X[28X              [(5,6,7)(8,9) : [ -9, -6 ] -> [ -9, -6 ]], [128X[104X
    [4X[28X              [() : [ -9, -6 ] -> [ -8, -6 ]], [128X[104X
    [4X[28X              [() : [ -9, -6 ] -> [ -7, -6 ]] ], [128X[104X
    [4X[28X          [ [(1,2,3,4) : -9 -> -9], [(1,3) : -9 -> -9], [() : -9 -> -9], [128X[104X
    [4X[28X              [() : -9 -> -8], [() : -9 -> -7] ] ] ] )[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X4.2 [33X[0;0YGroupoid elements; stars; costars; homsets[133X[101X
  
  [1X4.2-1 GroupoidElement[101X
  
  [29X[2XGroupoidElement[102X( [3Xgpd[103X, [3Xelt[103X, [3Xtail[103X, [3Xhead[103X ) [32X operation
  [29X[2XElementOfArrow[102X( [3Xelt[103X ) [32X operation
  [29X[2XTailOfArrow[102X( [3Xelt[103X ) [32X operation
  [29X[2XHeadOfArrow[102X( [3Xelt[103X ) [32X operation
  
  [33X[0;0YThe  operation  [10XGroupoidElement[110X  is  a  synonym  for the operation [10XArrow[110X, as
  described  in  subsection  [14X2.1-2[114X.  To recapitulate, an arrow [10Xe[110X consists of a
  group  element, [10XElementOfArrow(e)[110X; the tail (source) object, [10XTailOfArrow(e)[110X;
  and  the  head  (target)  object,  [10XHeadOfArrow(e)[110X.  Arrows  have  a  [13Xpartial
  composition[113X:  two  arrows  may  be  multiplied  when  the  head of the first
  coincides  with  the  tail  of the second. If an attempt is made to multiply
  arrows where this condition does not hold, then the value [10Xfail[110X is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xe1 := GroupoidElement( Gd8, (1,2,3,4), -9, -8 );[127X[104X
    [4X[28X[(1,2,3,4) : -9 -> -8][128X[104X
    [4X[25Xgap>[125X [27Xe2 := Arrow( Gd8, (1,3), -8, -7 );[127X[104X
    [4X[28X[(1,3) : -8 -> -7][128X[104X
    [4X[25Xgap>[125X [27XPrint( [ ElementOfArrow(e1), TailOfArrow(e1), HeadOfArrow(e1) ], "\n" );[127X[104X
    [4X[28X[ (1,2,3,4), -9, -8 ][128X[104X
    [4X[25Xgap>[125X [27Xprod := e1*e2;[127X[104X
    [4X[28X[(1,2)(3,4) : -9 -> -7][128X[104X
    [4X[25Xgap>[125X [27Xe2*e1;[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27Xe3 := Arrow( Gd8, (2,4), -7, -9 );;[127X[104X
    [4X[25Xgap>[125X [27Xloop := prod*e3;[127X[104X
    [4X[28X[(1,4,3,2) : -9 -> -9][128X[104X
    [4X[25Xgap>[125X [27Xloop^2;[127X[104X
    [4X[28X[(1,3)(2,4) : -9 -> -9][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.2-2 IdentityArrow[101X
  
  [29X[2XIdentityArrow[102X( [3Xgpd[103X, [3Xobj[103X ) [32X operation
  
  [33X[0;0YThe  identity  arrow  [22X1_o[122X  of  [22XG[122X  at  object  [22Xo[122X is [22X(e:o -> o)[122X where [22Xe[122X is the
  identity  element  in the object group. The [13Xinverse arrow[113X [22Xe^-1[122X of [22Xe = (c : p
  -> q)[122X is [22X(c^-1 : q -> p)[122X, so that [22Xe*e^-1=1_p[122X and [22Xe^-1*e = 1_q[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xi8 := IdentityArrow( Gd8, -8 );[127X[104X
    [4X[28X[() : -8 -> -8][128X[104X
    [4X[25Xgap>[125X [27X[ e1*i8, i8*e1, e1^-1]; [127X[104X
    [4X[28X[ [(1,2,3,4) : -9 -> -8], fail, [(1,4,3,2) : -8 -> -9] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.2-3 Order[101X
  
  [29X[2XOrder[102X( [3Xarr[103X ) [32X attribute
  
  [33X[0;0YA  groupoid  element is a [13Xloop[113X when the tail and head coincide. In this case
  the order of the element is defined to be the order of its group element.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xi8; Order(i8);[127X[104X
    [4X[28X[() : -8 -> -8][128X[104X
    [4X[28X1[128X[104X
    [4X[25Xgap>[125X [27Xloop; Order(loop);[127X[104X
    [4X[28X[(1,4,3,2) : -9 -> -9][128X[104X
    [4X[28X4[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.2-4 ObjectStar[101X
  
  [29X[2XObjectStar[102X( [3Xgpd[103X, [3Xobj[103X ) [32X operation
  [29X[2XObjectCostar[102X( [3Xgpd[103X, [3Xobj[103X ) [32X operation
  [29X[2XHomset[102X( [3Xgpd[103X, [3Xtail[103X, [3Xhead[103X ) [32X operation
  
  [33X[0;0YThe  [13Xstar[113X  at  [10Xobj[110X  is  the  set of arrows which have [10Xobj[110X as tail, while the
  [13Xcostar[113X  is the set of arrows which have [10Xobj[110X as head. The [13Xhomset[113X from [10Xobj1[110X to
  [10Xobj2[110X  is  the  set  of  arrows  with  the specified tail and head, and so is
  bijective  with the elements of the object groups. Thus every star and every
  costar  is  a  union  of  homsets. The identity arrow at an object is a left
  identity for the star and a right identity for the costar at that object.[133X
  
  [33X[0;0YIn  order  not  to create unneccessarily long lists, these operations return
  objects  of  type  [10XIsHomsetCosetsRep[110X  for which an [10XIterator[110X is provided. (An
  [10XEnumerator[110X is not yet implemented.)[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xstar9 := ObjectStar( Gd8, -9 );[127X[104X
    [4X[28X<star at [ -9 ] with group d8>[128X[104X
    [4X[25Xgap>[125X [27XSize( star9 ); [127X[104X
    [4X[28X24[128X[104X
    [4X[25Xgap>[125X [27Xfor e in star9 do[127X[104X
    [4X[25X>[125X [27X     if ( Order( ElementOfArrow(e) ) = 4 ) then Print( e, "\n" ); fi;[127X[104X
    [4X[25X>[125X [27X   od;[127X[104X
    [4X[28X[(1,4,3,2) : -9 -> -9][128X[104X
    [4X[28X[(1,4,3,2) : -9 -> -8][128X[104X
    [4X[28X[(1,4,3,2) : -9 -> -7][128X[104X
    [4X[28X[(1,2,3,4) : -9 -> -9][128X[104X
    [4X[28X[(1,2,3,4) : -9 -> -8][128X[104X
    [4X[28X[(1,2,3,4) : -9 -> -7][128X[104X
    [4X[25Xgap>[125X [27Xcostar6 := ObjectCostar( Gc6, -6 );[127X[104X
    [4X[28X<costar at [ -6 ] with group c6>[128X[104X
    [4X[25Xgap>[125X [27XSize( costar6 ); [127X[104X
    [4X[28X6[128X[104X
    [4X[25Xgap>[125X [27Xhsetq8 := Homset( Gq8, -28, -27 );[127X[104X
    [4X[28X<homset -28 -> -27 with group q8>[128X[104X
    [4X[25Xgap>[125X [27Xfor e in hsetq8 do Print(e,"\n"); od;[127X[104X
    [4X[28X[<identity> of ... : -28 -> -27][128X[104X
    [4X[28X[f3 : -28 -> -27][128X[104X
    [4X[28X[f2 : -28 -> -27][128X[104X
    [4X[28X[f2*f3 : -28 -> -27][128X[104X
    [4X[28X[f1 : -28 -> -27][128X[104X
    [4X[28X[f1*f3 : -28 -> -27][128X[104X
    [4X[28X[f1*f2 : -28 -> -27][128X[104X
    [4X[28X[f1*f2*f3 : -28 -> -27][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X4.3 [33X[0;0YSubgroupoids[133X[101X
  
  [1X4.3-1 Subgroupoid[101X
  
  [29X[2XSubgroupoid[102X( [3Xargs[103X ) [32X function
  [29X[2XSubgroupoidByPieces[102X( [3Xgpd[103X, [3Xobhoms[103X ) [32X operation
  [29X[2XIsSubgroupoid[102X( [3Xgpd[103X, [3Xsgpd[103X ) [32X operation
  [29X[2XIsWideSubgroupoid[102X( [3Xgpd[103X, [3Xsgpd[103X ) [32X operation
  
  [33X[0;0YA [13Xsubgroupoid[113X [22XS[122X of a groupoid [22XG[122X has as objects some subset of the objects of
  [22XG[122X.  It  is  [13Xwide[113X in [22XG[122X if both groupoids have the same object set. It is [13Xfull[113X
  if,  for  any  two  objects  in  [22XS[122X, the [10XHomset[110X is the same as that in [22XG[122X. The
  arrows of [22XS[122X are a subset of those of [22XG[122X, closed under multiplication and with
  tail and head in the chosen object set.[133X
  
  [33X[0;0YThere  are  a  variety  of  constructors  for  a  subgroupoid  of a standard
  groupoid, and the most general is the operation [10XSubgroupoidByPieces[110X. Its two
  parameters  are  a groupoid and a list of pieces, each piece being specified
  as  a  list  [10X[sgp,obs][110X,  where  [10Xsgp[110X  is a subgroup of the root group in that
  piece, and [10Xobs[110X is a subset of the objects in that piece.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xc4 := Subgroup( d8, [ (1,2,3,4) ] );;[127X[104X
    [4X[25Xgap>[125X [27Xk4 := Subgroup( d8, [ (1,2)(3,4), (1,3)(2,4) ] );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( c4, "c4" );  SetName( k4, "k4" );[127X[104X
    [4X[25Xgap>[125X [27XUd8 := Subgroupoid( Gd8, [ [ k4, [-9] ], [ c4, [-8,-7] ] ] );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( Ud8, "Ud8" );[127X[104X
    [4X[25Xgap>[125X [27XDisplay( Ud8 );[127X[104X
    [4X[28Xgroupoid with 2 pieces:[128X[104X
    [4X[28X< objects: [ -9 ][128X[104X
    [4X[28X    group: k4 = <[ (1,2)(3,4), (1,3)(2,4) ]> >[128X[104X
    [4X[28X< objects: [ -8, -7 ][128X[104X
    [4X[28X    group: c4 = <[ (1,2,3,4) ]> >[128X[104X
    [4X[25Xgap>[125X [27X[ Parent( Ud8 ), IsWide( Gd8, Ud8 ) ]; [127X[104X
    [4X[28X[ Gd8, true ][128X[104X
    [4X[25Xgap>[125X [27Xgenf2b := List( GeneratorsOfGroup(f2), g -> g^2 );[127X[104X
    [4X[28X[ f1^2, f2^2 ][128X[104X
    [4X[25Xgap>[125X [27Xf2b := Subgroup( f2, genf2b );;[127X[104X
    [4X[25Xgap>[125X [27XSU2 := SubgroupoidByPieces( U2, [ [q8,[-27]], [f2b,[-22]] ] );[127X[104X
    [4X[28Xgroupoid with 2 pieces:[128X[104X
    [4X[28X1:  single piece groupoid: < q8, [ -27 ] >[128X[104X
    [4X[28X2:  single piece groupoid: < Group( [ f1^2, f2^2 ] ), [ -22 ] >[128X[104X
    [4X[25Xgap>[125X [27XIsWideSubgroupoid( U2, SU2 );[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsSubgroupoid( Gf2, Groupoid( f2b, [-22] ) );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.3-2 FullSubgroupoid[101X
  
  [29X[2XFullSubgroupoid[102X( [3Xgpd[103X, [3Xobs[103X ) [32X operation
  [29X[2XFullTrivialSubgroupoid[102X( [3Xgpd[103X ) [32X attribute
  
  [33X[0;0YThe  [10XFullSubgroupoid[110X  of  a  groupoid  [10Xgpd[110X  on  a  subset [10Xobs[110X of its objects
  contains  all  the  arrows  of  [10Xgpd[110X  with  tail  and  head in [10Xobs[110X. A [13Xtrivial
  subgroupoid[113X  has  trivial  object groups, but need not be discrete. A single
  piece  trivial  groupoid  is  sometimes  called  a  [13Xtree groupoid[113X. (The term
  [13Xidentity  subgroupoid[113X  was used in versions up to 1.14.) The global function
  [10XSubgroupoid[110X should call the appropriate operation.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XFullSubgroupoid( U3, [-7,-6] );[127X[104X
    [4X[28Xgroupoid with 2 pieces:[128X[104X
    [4X[28X1:  single piece groupoid: < d8, [ -7 ] >[128X[104X
    [4X[28X2:  single piece groupoid: < c6, [ -6 ] >[128X[104X
    [4X[25Xgap>[125X [27XFullTrivialSubgroupoid( Ud8 );[127X[104X
    [4X[28Xgroupoid with 2 pieces:[128X[104X
    [4X[28X1:  single piece groupoid: < id(k4), [ -9 ] >[128X[104X
    [4X[28X2:  single piece groupoid: < id(c4), [ -8, -7 ] >[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.3-3 DiscreteSubgroupoid[101X
  
  [29X[2XDiscreteSubgroupoid[102X( [3Xgpd[103X, [3Xsgps[103X, [3Xobs[103X ) [32X operation
  [29X[2XMaximalDiscreteSubgroupoid[102X( [3Xgpd[103X ) [32X attribute
  [29X[2XDiscreteTrivialSubgroupoid[102X( [3Xgpd[103X ) [32X attribute
  
  [33X[0;0YA   subgroupoid   is   [13Xdiscrete[113X   if   it   is   a   union  of  groups.  The
  [10XMaximalDiscreteSubgroupoid[110X of [10Xgpd[110X is the union of all the single-object full
  subgroupoids of [10Xgpd[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XDiscreteSubgroupoid( U3, [ c4, k4 ], [-9,-7] );[127X[104X
    [4X[28Xgroupoid with 2 pieces:[128X[104X
    [4X[28X1:  single piece groupoid: < c4, [ -9 ] >[128X[104X
    [4X[28X2:  single piece groupoid: < k4, [ -7 ] >[128X[104X
    [4X[25Xgap>[125X [27XMaximalDiscreteSubgroupoid(U2);[127X[104X
    [4X[28Xgroupoid with 3 pieces:[128X[104X
    [4X[28X1:  single piece groupoid: < q8, [ -28 ] >[128X[104X
    [4X[28X2:  single piece groupoid: < q8, [ -27 ] >[128X[104X
    [4X[28X3:  single piece groupoid: < f2, [ -22 ] >[128X[104X
    [4X[25Xgap>[125X [27XDiscreteTrivialSubgroupoid( U2 );[127X[104X
    [4X[28Xgroupoid with 3 pieces:[128X[104X
    [4X[28X1:  single piece groupoid: < id(q8), [ -28 ] >[128X[104X
    [4X[28X2:  single piece groupoid: < id(q8), [ -27 ] >[128X[104X
    [4X[28X3:  single piece groupoid: < id(f2), [ -22 ] >[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.3-4 SubgroupoidWithRays[101X
  
  [29X[2XSubgroupoidWithRays[102X( [3Xgpd[103X, [3Xsgp[103X, [3Xrays[103X ) [32X operation
  [29X[2XRaysOfGroupoid[102X( [3Xgpd[103X ) [32X operation
  [29X[2XRayElementsOfGroupoid[102X( [3Xgpd[103X ) [32X operation
  
  [33X[0;0YIf groupoid [22XG[122X is of type [10XIsDirectProductWithCompleteDigraph[110X with group [22Xg[122X and
  [22Xn[122X  objects,  then  a typical wide subgroupoid [22XH[122X of [22XG[122X is formed by choosing a
  subgroup  [22Xh[122X of [22Xg[122X to be the object group at the root object [22Xq[122X, and an arrow [22Xr
  :  q  -> p[122X for each of the objects [22Xp[122X. The chosen loop arrow at [22Xq[122X must be the
  identity  arrow.  These [22Xn[122X arrows are called the [13Xrays[113X of the subgroupoid. The
  arrows  in  the homset from [22Xp[122X to [22Xp'[122X have the form [22Xr^-1xr'[122X where [22Xr,r'[122X are the
  rays from [22Xq[122X to [22Xp,p'[122X respectively, and [22Xx ∈ h[122X.[133X
  
  [33X[0;0YThe  operation [10XRaysOfGroupoid[110X returns a list of arrows, one for each object,
  while the operation [10XRayElementsOfGroupoid[110X returns the list of group elements
  in these arrows.[133X
  
  [33X[0;0YIn  the  following  example we construct a subgroupoid with rays on three of
  the   five  objects.  It  is  therefore  necessary  to  construct  the  full
  subgroupoid on these three objects first.[133X
  
  [33X[0;0YNote  that  it  is  also  possible to construct a subgroupoid with rays of a
  subgroupoid with rays.[133X
  
  [33X[0;0YNote also that the function [10XAncestor[110X provides an iteration of [10XParent[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XHs4 := FullSubgroupoid( Gs4, [-14,-13,-12] );; [127X[104X
    [4X[25Xgap>[125X [27XSetName( Hs4, "Hs4" ); [127X[104X
    [4X[25Xgap>[125X [27XHd8a := SubgroupoidWithRays( Hs4, d8, [(),(2,3),(3,4)] );[127X[104X
    [4X[28Xsingle piece groupoid with rays: < d8, [ -14, -13, -12 ], [ (), (2,3), (3,4) [128X[104X
    [4X[28X ] >[128X[104X
    [4X[25Xgap>[125X [27Xhs1413 := Homset( Hd8a, -14, -13 );[127X[104X
    [4X[28X<homset -14 -> -13 with group d8>[128X[104X
    [4X[25Xgap>[125X [27Xfor e in hs1413 do  Print(e,", "); od;  Print( "\n");[127X[104X
    [4X[28X[(2,3) : -14 -> -13], [(2,4,3) : -14 -> -13], [(1,2,4,3) : -14 -> -13], [[128X[104X
    [4X[28X(1,2,3) : -14 -> -13], [(1,4,2) : -14 -> -13], [(1,4) : -14 -> -13], [[128X[104X
    [4X[28X(1,3,4) : -14 -> -13], [(1,3,4,2) : -14 -> -13], [128X[104X
    [4X[25Xgap>[125X [27XHd8b := SubgroupoidWithRays( Hs4, d8, [(),(1,2,3),(1,2,4)] );[127X[104X
    [4X[28Xsingle piece groupoid with rays: < d8, [ -14, -13, -12 ], [128X[104X
    [4X[28X[ (), (1,2,3), (1,2,4) ] >[128X[104X
    [4X[25Xgap>[125X [27XHd8a = Hd8b; [127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XSetName( Hd8b, "Hd8b" ); [127X[104X
    [4X[25Xgap>[125X [27XRayElementsOfGroupoid( Hd8b ); [127X[104X
    [4X[28X[ (), (1,2,3), (1,2,4) ][128X[104X
    [4X[25Xgap>[125X [27XParent( Hd8a );[127X[104X
    [4X[28XHs4[128X[104X
    [4X[25Xgap>[125X [27XAncestor( Hd8a ); [127X[104X
    [4X[28XGs4[128X[104X
    [4X[25Xgap>[125X [27XFd8a := FullSubgroupoid( Hd8a, [-13,-12] );            [127X[104X
    [4X[28Xsingle piece groupoid with rays: < Group( [ (1,3,2,4), (1,2) ] ), [128X[104X
    [4X[28X[ -13, -12 ], [ (), (2,4,3) ] >[128X[104X
    [4X[25Xgap>[125X [27XKd8a := SubgroupoidWithRays( Fd8a, k4, [ (), (1,3) ] ); [127X[104X
    [4X[28Xsingle piece groupoid with rays: < k4, [ -13, -12 ], [ (), (1,3) ] >[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.3-5 SinglePieceSubgroupoidByGenerators[101X
  
  [29X[2XSinglePieceSubgroupoidByGenerators[102X( [3Xparent[103X, [3Xgens[103X ) [32X operation
  
  [33X[0;0YA  set  of  arrows  generates a groupoid by taking all possible products and
  inverses.  So  far,  the  only  implementation  is  for  the  case  of loops
  generating  a group at an object [22Xo[122X together with a set of rays from [22Xo[122X, where
  [22Xo[122X  is  [13Xnot[113X the least object. A suitably large supergroupoid, which must be a
  direct product with a complete digraph, should be provided. This is the case
  needed  for [10XConjugateGroupoid[110X in section [14X4.5-2[114X. Other cases will be added as
  time permits.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xu := Arrow( Gs4, (1,2,3), -15, -13 ); [127X[104X
    [4X[28X[(1,2,3) : -15 -> -13][128X[104X
    [4X[25Xgap>[125X [27Xgensa := GeneratorsOfGroupoid( Hd8a );[127X[104X
    [4X[28X[ [(1,2,3,4) : -14 -> -14], [(1,3) : -14 -> -14], [(2,3) : -14 -> -13], [128X[104X
    [4X[28X  [(3,4) : -14 -> -12] ][128X[104X
    [4X[25Xgap>[125X [27Ximsa := List( gensa, g -> g^u ); [127X[104X
    [4X[28X[ [(1,2,3,4) : -14 -> -14], [(1,3) : -14 -> -14], [(1,3) : -14 -> -15], [128X[104X
    [4X[28X  [(3,4) : -14 -> -12] ][128X[104X
    [4X[25Xgap>[125X [27XC := SinglePieceSubgroupoidByGenerators( Gs4, imsa ); [127X[104X
    [4X[28Xsingle piece groupoid with rays: < Group( [ (1,4,3,2), (1,3) ] ), [128X[104X
    [4X[28X[ -15, -14, -12 ], [ (), (1,3), (1,4,3) ] >[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X4.4 [33X[0;0YLeft, right and double cosets[133X[101X
  
  [1X4.4-1 RightCoset[101X
  
  [29X[2XRightCoset[102X( [3XG[103X, [3XU[103X, [3Xelt[103X ) [32X operation
  [29X[2XRightCosetRepresentatives[102X( [3XG[103X, [3XU[103X ) [32X operation
  [29X[2XLeftCoset[102X( [3XG[103X, [3XU[103X, [3Xelt[103X ) [32X operation
  [29X[2XLeftCosetRepresentatives[102X( [3XG[103X, [3XU[103X ) [32X operation
  [29X[2XLeftCosetRepresentativesFromObject[102X( [3XG[103X, [3XU[103X, [3Xobj[103X ) [32X operation
  [29X[2XDoubleCoset[102X( [3XG[103X, [3XU[103X, [3Xelt[103X, [3XV[103X ) [32X operation
  [29X[2XDoubleCosetRepresentatives[102X( [3XG[103X, [3XU[103X, [3XV[103X ) [32X operation
  
  [33X[0;0YIf  [10XU[110X  is  a  wide  subgroupoid  of [22XG[122X, the [13Xright cosets[113X [22XUg[122X of [22XU[122X in [22XG[122X are the
  equivalence  classes for the relation on the arrows of [22XG[122X where [22Xg1[122X is related
  to  [22Xg2[122X  if  and  only  if  [22Xg2  = u*g1[122X for some arrow [22Xu[122X of [22XU[122X. The right coset
  containing  [22Xg[122X  is  written [22XUg[122X. These right cosets partition the costars of [22XG[122X
  and,  in  particular,  the  costar  [22XU1_o[122X  of  [22XU[122X at object [22Xo[122X, so that (unlike
  groups) [22XU[122X is itself a coset only when [22XG[122X has a single object.[133X
  
  [33X[0;0YThe  [13Xright coset representatives[113X for [22XU[122X in [22XG[122X form a list containing one arrow
  for  each  coset where, in a particular piece of [22XU[122X, the group element chosen
  is the right coset representative of the group of [22XU[122X in the group of [22XG[122X.[133X
  
  [33X[0;0YSimilarly, the [13Xleft cosets[113X [22XgU[122X refine the stars of [22XG[122X, while [13Xdouble cosets[113X are
  unions    of    left    cosets    and    right    cosets.    The   operation
  [10XLeftCosetRepresentativesFromObject(  G,  U,  obj )[110X is used in Chapter 4, and
  returns only those representatives which have tail at [10Xobj[110X.[133X
  
  [33X[0;0YAs  with stars and homsets, these cosets are implemented with representation
  [10XIsHomsetCosetsRep[110X  and provided with an iterator. Note that, when [22XU[122X has more
  than one piece, cosets may have differing lengths.[133X
  
  [33X[0;0YIn the example the representative for the right coset [10Xre2[110X is the last one in
  the list [10Xrcrd8[110X, namely [10X[(2,4):-8->-7][110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xre2 := RightCoset( Gd8, Ud8, e2 );[127X[104X
    [4X[28XRightCoset(single piece groupoid: < c4, [ -8, -7 ] >,[(1,3) : -8 -> -7])[128X[104X
    [4X[25Xgap>[125X [27Xfor x in re2 do Print( x, "\n" ); od;[127X[104X
    [4X[28X[(1,3) : -8 -> -7][128X[104X
    [4X[28X[(1,3) : -7 -> -7][128X[104X
    [4X[28X[(2,4) : -8 -> -7][128X[104X
    [4X[28X[(2,4) : -7 -> -7][128X[104X
    [4X[28X[(1,4)(2,3) : -8 -> -7][128X[104X
    [4X[28X[(1,4)(2,3) : -7 -> -7][128X[104X
    [4X[28X[(1,2)(3,4) : -8 -> -7][128X[104X
    [4X[28X[(1,2)(3,4) : -7 -> -7][128X[104X
    [4X[25Xgap>[125X [27Xrcrd8 := RightCosetRepresentatives( Gd8, Ud8 );[127X[104X
    [4X[28X[ [() : -9 -> -9], [() : -9 -> -8], [() : -9 -> -7], [(2,4) : -9 -> -9],[128X[104X
    [4X[28X  [(2,4) : -9 -> -8], [(2,4) : -9 -> -7], [() : -8 -> -9], [() : -8 -> -8],[128X[104X
    [4X[28X  [() : -8 -> -7], [(2,4) : -8 -> -9], [(2,4) : -8 -> -8], [(2,4) : -8 -> -7][128X[104X
    [4X[28X ][128X[104X
    [4X[25Xgap>[125X [27Xlcr7 := LeftCosetRepresentativesFromObject( Gd8, Ud8, -7 );[127X[104X
    [4X[28X[ [() : -7 -> -9], [(2,4) : -7 -> -9], [() : -7 -> -8], [(2,4) : -7 -> -8] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X4.5 [33X[0;0YConjugation[133X[101X
  
  [1X4.5-1 \^[101X
  
  [29X[2X\^[102X( [3Xe1[103X, [3Xe[103X ) [32X operation
  
  [33X[0;0YConjugation  by an arrow [22Xe = (c : p -> q)[122X is the groupoid inner automorphism
  (see  section  [14X5.6[114X)  defined as follows. There are two cases to consider. In
  the case [22Xp ≠ q[122X,[133X
  
  [30X    [33X[0;6Yobjects [22Xp,q[122X are interchanged, and the remaining objects are fixed;[133X
  
  [30X    [33X[0;6Yloops  at [22Xp,q[122X: [22X(b: p -> p) ↦ (b^c : q -> q)[122X and [22X(b: q -> q) ↦ (b^c^-1}
        : p -> p)[122X;[133X
  
  [30X    [33X[0;6Yarrows between [22Xp[122X and [22Xq[122X: [22X(b : p -> q) ↦ (c^-1bc^-1 : q -> p)[122X and [22X(b : q
        -> p) ↦ (cbc : p -> q)[122X;[133X
  
  [30X    [33X[0;6Ycostars at [22Xp,q[122X: [22X(b : r -> p) ↦ (bc : r -> q)[122X and [22X(b : r -> q) ↦ (bc^-1
        : r -> p)[122X;[133X
  
  [30X    [33X[0;6Ystars at [22Xp,q[122X: [22X(b : p -> r) ↦ (c^-1b : -> q)[122X and [22X(b : q -> r) ↦ (cb : p
        -> r)[122X;[133X
  
  [30X    [33X[0;6Ythe remaining arrows are unchanged.[133X
  
  [33X[0;0YIn the case [22Xp=q[122X,[133X
  
  [30X    [33X[0;6Yall the objects are fixed;[133X
  
  [30X    [33X[0;6Yloops at [22Xp[122X are conjugated by [22Xc[122X, so [22X(b : p -> p) ↦ (b^c : p -> p)[122X;[133X
  
  [30X    [33X[0;6Ythe rest of the costar and star at [22Xp[122X are permuted,[133X
  
  
  [24X      [33X[0;6Y(b  :  r \to p) \mapsto (bc : r \to p) \quad\mbox{and}\quad (b : p \to
        r) \mapsto (c^{-1}b : p \to r);[133X
  
  [124X
  
  [30X    [33X[0;6Ythe remaining arrows are unchanged.[133X
  
  [33X[0;0YThe details of this construction may be found in section 3.2 of [AW10].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xx := Arrow( Gd8, (1,3), -9, -9 );; [127X[104X
    [4X[25Xgap>[125X [27Xy := Arrow( Gd8, (1,2,3,4), -8, -9 );; [127X[104X
    [4X[25Xgap>[125X [27Xz := Arrow( Gd8, (1,2)(3,4), -9, -7 );; [127X[104X
    [4X[25Xgap>[125X [27Xw := Arrow( Gd8, (1,2,3,4), -7, -8 );; [127X[104X
    [4X[25Xgap>[125X [27X##  conjugation with elements x, y, and z in Gd8: [127X[104X
    [4X[25Xgap>[125X [27Xx^y;[127X[104X
    [4X[28X[(2,4) : -8 -> -8][128X[104X
    [4X[25Xgap>[125X [27Xx^z;[127X[104X
    [4X[28X[(2,4) : -7 -> -7][128X[104X
    [4X[25Xgap>[125X [27Xy^x;[127X[104X
    [4X[28X[() : -8 -> -9][128X[104X
    [4X[25Xgap>[125X [27Xy^z;[127X[104X
    [4X[28X[(2,4) : -8 -> -7][128X[104X
    [4X[25Xgap>[125X [27Xz^x;[127X[104X
    [4X[28X[(1,4,3,2) : -9 -> -7][128X[104X
    [4X[25Xgap>[125X [27Xz^y;[127X[104X
    [4X[28X[(2,4) : -8 -> -7][128X[104X
    [4X[25Xgap>[125X [27Xw^z[127X[104X
    [4X[28X[(1,3) : -9 -> -8][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X4.5-2 ConjugateGroupoid[101X
  
  [29X[2XConjugateGroupoid[102X( [3Xgpd[103X, [3Xe[103X ) [32X operation
  
  [33X[0;0YWhen  [22XH[122X  is  a  subgroupoid of a groupoid [22XG[122X and [22Xa[122X is an arrow of [22XG[122X, then the
  conjugate  of  [22XH[122X  by [22Xa[122X is the subgroupoid generated by the conjugates of the
  generators of [22XH[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XConjugateGroupoid( Hd8a, u^-1 ); [127X[104X
    [4X[28Xsingle piece groupoid with rays: < Group( [ (1,4,3,2), (1,3) ] ), [128X[104X
    [4X[28X[ -15, -14, -12 ], [ (), (1,3), (1,4,3) ] >[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [33X[0;0YMore  examples  of  all  these  operations  may be found in the example file
  [11Xgroupoids/examples/gpd.g[111X.[133X
  
