  
  [1X5 [33X[0;0YHomomorphisms of Groupoids[133X[101X
  
  [33X[0;0YA  [13Xhomomorphism[113X  [22Xm[122X  from a groupoid [22XG[122X to a groupoid [22XH[122X consists of a map from
  the objects of [22XG[122X to those of [22XH[122X together with a map from the elements of [22XG[122X to
  those  of  [22XH[122X  which  is  compatible  with  tail and head and which preserves
  multiplication:[133X
  
  
        [33X[1;6Y[24X[33X[0;0Ym(g1 : o1 \to o2)*m(g2 : o2 \to o3) ~=~ m(g1*g2 : o1 \to o3).[133X [124X[133X
  
  
  [33X[0;0YNote  that when a homomorphism is not injective on objects, the image of the
  source  need  not be a subgroupoid of the range. A simple example of this is
  given  by  a  homomorphism  from  the two-object, four-element groupoid with
  trivial  group  to  the free group [22X⟨ a ⟩[122X on one generator, when the image is
  [22X[1,a^n,a^-n][122X for some [22Xn>0[122X.[133X
  
  
  [1X5.1 [33X[0;0YHomomorphisms from a connected groupoid[133X[101X
  
  [1X5.1-1 GroupoidHomomorphismFromSinglePiece[101X
  
  [29X[2XGroupoidHomomorphismFromSinglePiece[102X( [3Xsrc[103X, [3Xrng[103X, [3Xhom[103X, [3Ximobs[103X, [3Ximrays[103X ) [32X operation
  [29X[2XGroupoidHomomorphism[102X( [3Xargs[103X ) [32X function
  [29X[2XInclusionMappingGroupoids[102X( [3Xgpd[103X, [3Xsgpd[103X ) [32X operation
  [29X[2XIsomorphismNewObjects[102X( [3Xsrc[103X, [3Xobjlist[103X ) [32X operation
  [29X[2XIsomorphismStandardGroupoid[102X( [3Xgpd[103X, [3Xobs[103X ) [32X operation
  
  [33X[0;0YAs  usual, there are various homomorphism operations. The basic construction
  is  a  homomorphism  [22Xϕ  :  G -> H[122X with [22XG[122X the direct product of a group and a
  complete   graph.   The   homomorphism   has   attributes   [10XSource[110X,   [10XRange[110X,
  [10XImagesOfObjects[110X  and  [10XRootGroupHomomorphism[110X.  The input data consists of the
  source; the range; and[133X
  
  [30X    [33X[0;6Ya homomorphism [10Xhom[110X from the root group of [22XG[122X to that of [22XH[122X;[133X
  
  [30X    [33X[0;6Ya list [10Ximobs[110X of the images of the objects of [22XG[122X;[133X
  
  [30X    [33X[0;6Ya  list [10Ximrays[110X of the elements in the images of the rays of [22XG[122X, so that
        the   image   [22Xϕ(r_i   :   o_1   ->   o_i)[122X   of   the   [22Xi[122X-th   ray   is
        [10X(imrays[i]:imobs[1][110X[22X->[122X[10Ximobs[i])[110X.[133X
  
  [33X[0;0YThe  operation [10XIsomorphismNewObjects[110X returns the isomorphism from a groupoid
  to  a  groupoid with the same object group and rays but with a different set
  of objects.[133X
  
  [33X[0;0YThe  operation  [10XIsomorphismStandardGroupoid(gpd,obs)[110X returns the isomorphism
  from    a    groupoid    with    rays    to    the    groupoid    of    type
  [10XIsDirectProductWithCompleteGraph[110X on the given objects.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xgend12 := [ (15,16,17,18,19,20), (15,20)(16,19)(17,18) ];; [127X[104X
    [4X[25Xgap>[125X [27Xd12 := Group( gend12 );; [127X[104X
    [4X[25Xgap>[125X [27XGd12 := Groupoid( d12, [-37,-36,-35,-34] );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( d12, "d12" );  [127X[104X
    [4X[25Xgap>[125X [27XSetName( Gd12, "Gd12" );[127X[104X
    [4X[25Xgap>[125X [27Xs3 := Subgroup( d12, [ (15,17,19)(16,18,20), (15,20)(16,19)(17,18) ] );;[127X[104X
    [4X[25Xgap>[125X [27XGs3 := SubgroupoidByPieces( Gd12, [ [ s3, [-36,-35,-34] ] ] );;[127X[104X
    [4X[25Xgap>[125X [27XSetName( s3, "s3" );  [127X[104X
    [4X[25Xgap>[125X [27XSetName( Gs3, "Gs3" );[127X[104X
    [4X[25Xgap>[125X [27Xgend8 := GeneratorsOfGroup( d8 );;[127X[104X
    [4X[25Xgap>[125X [27Ximhd8 := [ ( ), (15,20)(16,19)(17,18) ];;[127X[104X
    [4X[25Xgap>[125X [27Xhd8 := GroupHomomorphismByImages( d8, s3, gend8, imhd8 );;[127X[104X
    [4X[25Xgap>[125X [27Xhomd8 := GroupoidHomomorphism( Gd8, Gs3, hd8 ); [127X[104X
    [4X[28Xgroupoid homomorphism : Gd8 -> Gs3[128X[104X
    [4X[28X[ [ GroupHomomorphismByImages( d8, s3, [ (1,2,3,4), (1,3) ], [128X[104X
    [4X[28X        [ (), (15,20)(16,19)(17,18) ] ), [ -36, -35, -34 ], [ (), (), () ] ] ][128X[104X
    [4X[25Xgap>[125X [27Xe2; ImageElm( homd8, e2 );[127X[104X
    [4X[28X[(1,3) : -8 -> -7][128X[104X
    [4X[28X[(15,20)(16,19)(17,18) : -35 -> -34][128X[104X
    [4X[25Xgap>[125X [27XincGs3 := InclusionMappingGroupoids( Gd12, Gs3 );; [127X[104X
    [4X[25Xgap>[125X [27Xihomd8 := homd8 * incGs3;; [127X[104X
    [4X[25Xgap>[125X [27XIsBijectiveOnObjects( ihomd8 );[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XDisplay( ihomd8 );[127X[104X
    [4X[28X  groupoid mapping: [ Gd8 ] -> [ Gd12 ][128X[104X
    [4X[28X root homomorphism: [ [ (1,2,3,4), (1,3) ], [ (), (15,20)(16,19)(17,18) ] ][128X[104X
    [4X[28X images of objects: [ -36, -35, -34 ][128X[104X
    [4X[28Ximage elts of rays: [ (), (), () ][128X[104X
    [4X[25Xgap>[125X [27Xe2; ImageElm( homd8, e2 );[127X[104X
    [4X[28X[(1,3) : -8 -> -7][128X[104X
    [4X[28X[(15,20)(16,19)(17,18) : -35 -> -36][128X[104X
    [4X[25Xgap>[125X [27Xc6d := Subgroup( d12, [ (15,16,17,18,19,20) ] );;                        [127X[104X
    [4X[25Xgap>[125X [27Xrays := [ (), (16,20)(17,19), (15,17)(18,20), (15,19)(16,18) ];;        [127X[104X
    [4X[25Xgap>[125X [27XGc6d := SubgroupoidWithRays( Gd12, c6d, rays );                   [127X[104X
    [4X[28Xsingle piece groupoid with rays: < Group( [ (15,16,17,18,19,20) ] ), [128X[104X
    [4X[28X[ -37, -36, -35, -34 ], [ (), (16,20)(17,19), (15,17)(18,20), (15,19)(16,18) [128X[104X
    [4X[28X ] >[128X[104X
    [4X[25Xgap>[125X [27Xiso1 := IsomorphismNewObjects( Gd12, [-7,-6,-5,-4] );     [127X[104X
    [4X[28Xgroupoid homomorphism : [128X[104X
    [4X[28X[ [ IdentityMapping( d12 ), [ -7, -6, -5, -4 ], [ (), (), (), () ] ] ][128X[104X
    [4X[25Xgap>[125X [27Xiso2 := IsomorphismStandardGroupoid( Gc6d, [-7,-6,-5,-4] );[127X[104X
    [4X[28Xgroupoid homomorphism : [128X[104X
    [4X[28X[ [ IdentityMapping( Group( [ (15,16,17,18,19,20) ] ) ), [ -7, -6, -5, -4 ], [128X[104X
    [4X[28X      [ (), (), (), () ] ] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X5.2 [33X[0;0YHomomorphisms to a connected groupoid[133X[101X
  
  [1X5.2-1 HomomorphismToSinglePiece[101X
  
  [29X[2XHomomorphismToSinglePiece[102X( [3Xsrc[103X, [3Xrng[103X, [3Xpieces[103X ) [32X operation
  
  [33X[0;0YWhen  [22XG[122X  is  made  up  of  two  or more pieces, all of which get mapped to a
  connected  groupoid,  we  have  a  [13Xhomomorphism to a single piece[113X. The third
  input  parameter in this case is a list of the [10XPieceImages[110X of the individual
  homomorphisms  [13Xfrom[113X the single pieces. See section [14X3.1[114X for the corresponding
  operation on homomorphisms of magmas with objects.[133X
  
  [33X[0;0YIn the following example the source [10XV3[110X of [10XhomV3[110X has three pieces, and one of
  the component homomorphisms is an [10XIdentityMapping[110X .[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xhc6 := GroupHomomorphismByImages( c6, s3, [127X[104X
    [4X[25X>[125X [27X           [(5,6,7)(8,9)], [(15,16)(17,20)(18,19)] );;[127X[104X
    [4X[25Xgap>[125X [27XFs3 := FullSubgroupoid( Gs3, [ -35 ] );; [127X[104X
    [4X[25Xgap>[125X [27XSetName( Fs3, "Fs3" ); [127X[104X
    [4X[25Xgap>[125X [27Xhomc6 := GroupoidHomomorphism( Gc6, Fs3, hc6 );;[127X[104X
    [4X[25Xgap>[125X [27XincFs3 := InclusionMappingGroupoids( Gs3, Fs3 );; [127X[104X
    [4X[25Xgap>[125X [27Xihomc6 := homc6 * incFs3; [127X[104X
    [4X[28Xgroupoid homomorphism : Gc6 -> Gs3[128X[104X
    [4X[28X[ [ GroupHomomorphismByImages( c6, s3, [ (5,6,7)(8,9) ], [128X[104X
    [4X[28X        [ (15,16)(17,20)(18,19) ] ), [ -35 ], [ () ] ] ][128X[104X
    [4X[25Xgap>[125X [27XidGs3 := IdentityMapping( Gs3 );;[127X[104X
    [4X[25Xgap>[125X [27XV3 := ReplaceOnePieceInUnion( U3, 1, Gs3 ); [127X[104X
    [4X[28Xgroupoid with 3 pieces:[128X[104X
    [4X[28X[ Gs3, Gd8, Gc6 ][128X[104X
    [4X[25Xgap>[125X [27Ximages3 := [ PieceImages( idGs3 )[1], [127X[104X
    [4X[25X>[125X [27X                PieceImages( homd8 )[1], [127X[104X
    [4X[25X>[125X [27X                PieceImages( ihomc6 )[1] ];; [127X[104X
    [4X[25Xgap>[125X [27XhomV3 := HomomorphismToSinglePiece( V3, Gs3, images3 );; [127X[104X
    [4X[25Xgap>[125X [27XDisplay( homV3 );         [127X[104X
    [4X[28Xhomomorphism to single piece magma with pieces:[128X[104X
    [4X[28X(1): [ Gs3 ] -> [ Gs3 ][128X[104X
    [4X[28Xmagma mapping: [ [ (15,17,19)(16,18,20), (15,20)(16,19)(17,18) ], [128X[104X
    [4X[28X  [ (15,17,19)(16,18,20), (15,20)(16,19)(17,18) ] ][128X[104X
    [4X[28X   object map: [ -36, -35, -34 ] -> [ -36, -35, -34 ][128X[104X
    [4X[28X(2): [ Gd8 ] -> [ Gs3 ][128X[104X
    [4X[28Xmagma mapping: [ [ (1,2,3,4), (1,3) ], [ (), (15,20)(16,19)(17,18) ] ][128X[104X
    [4X[28X   object map: [ -9, -8, -7 ] -> [ -36, -35, -34 ][128X[104X
    [4X[28X(3): [ Gc6 ] -> [ Gs3 ][128X[104X
    [4X[28Xmagma mapping: [ [ (5,6,7)(8,9) ], [ (15,16)(17,20)(18,19) ] ][128X[104X
    [4X[28X   object map: [ -6 ] -> [ -35 ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X5.3 [33X[0;0YHomomorphisms to more than one piece[133X[101X
  
  [1X5.3-1 HomomorphismByUnion[101X
  
  [29X[2XHomomorphismByUnion[102X( [3Xsrc[103X, [3Xrng[103X, [3Xhoms[103X ) [32X operation
  
  [33X[0;0YAs in section [14X3.3[114X, when the range [22XH[122X has more than one connected component, a
  homomorphism is a union of homomorphisms, one for each piece.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xisoq8 := IsomorphismNewObjects( Gq8, [-38,-37] ); [127X[104X
    [4X[28Xgroupoid homomorphism : [128X[104X
    [4X[28X[ [128X[104X
    [4X[28X  [ IdentityMapping( q8 ), [ -38, -37 ], [128X[104X
    [4X[28X      [ <identity> of ..., <identity> of ... ] ] ][128X[104X
    [4X[25Xgap>[125X [27XGq8b := Range( isoq8 );; [127X[104X
    [4X[25Xgap>[125X [27XSetName( Gq8b, "Gq8b" ); [127X[104X
    [4X[25Xgap>[125X [27XV4 := UnionOfPieces( [ V3, Gq8 ] ); [127X[104X
    [4X[28Xgroupoid with 4 pieces:[128X[104X
    [4X[28X[ Gs3, Gq8, Gd8, Gc6 ][128X[104X
    [4X[25Xgap>[125X [27XSetName( V4, "V4" ); [127X[104X
    [4X[25Xgap>[125X [27XVs3q8b := UnionOfPieces( [ Gs3, Gq8b ] ); [127X[104X
    [4X[25Xgap>[125X [27XSetName( Vs3q8b, "Vs3q8b" ); [127X[104X
    [4X[25Xgap>[125X [27Xhom4 := HomomorphismByUnion( V4, Vs3q8b, [ homV3, isoq8 ] );; [127X[104X
    [4X[25Xgap>[125X [27XPiecesOfMapping( hom4 );[127X[104X
    [4X[28X[ groupoid homomorphism : Gq8 -> Gq8b[128X[104X
    [4X[28X    [ [ IdentityMapping( q8 ), [ -38, -37 ], [128X[104X
    [4X[28X          [ <identity> of ..., <identity> of ... ] ] ], [128X[104X
    [4X[28X  groupoid homomorphism : [128X[104X
    [4X[28X    [ [ IdentityMapping( s3 ), [ -36, -35, -34 ], [ (), (), () ] ], [128X[104X
    [4X[28X      [ GroupHomomorphismByImages( d8, s3, [ (1,2,3,4), (1,3) ], [128X[104X
    [4X[28X            [ (), (15,20)(16,19)(17,18) ] ), [ -36, -35, -34 ], [128X[104X
    [4X[28X          [ (), (), () ] ], [128X[104X
    [4X[28X      [ GroupHomomorphismByImages( c6, s3, [ (5,6,7)(8,9) ], [128X[104X
    [4X[28X            [ (15,16)(17,20)(18,19) ] ), [ -35 ], [ () ] ] ] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X5.4 [33X[0;0YGroupoid automorphisms[133X[101X
  
  [1X5.4-1 GroupoidAutomorphismByObjectPerm[101X
  
  [29X[2XGroupoidAutomorphismByObjectPerm[102X( [3Xgpd[103X, [3Ximobs[103X ) [32X operation
  [29X[2XGroupoidAutomorphismByGroupAuto[102X( [3Xgpd[103X, [3Xgpauto[103X ) [32X operation
  [29X[2XGroupoidAutomorphismByRayShifts[102X( [3Xgpd[103X, [3Ximrays[103X ) [32X operation
  
  [33X[0;0YWe  first  describe  automorphisms  of  a  groupoid  [22XG[122X where [22XG[122X is the direct
  product  of  a  group  [22Xg[122X  and  a  complete  graph. The automorphism group is
  generated by three types of automorphism:[133X
  
  [30X    [33X[0;6Ygiven  a  permutation  [22Xπ[122X  of  the  [22Xn[122X  objects,  we define [22Xπ : G -> G,~
        (o_i,g,o_j) ↦ (o_π i,g,o_π j)[122X;[133X
  
  [30X    [33X[0;6Ygiven  an  automorphism  [22Xα[122X of the root group [22Xg[122X, we define [22Xα : G -> G,~
        (o_i,g,o_j) ↦ (o_i,α g,o_j)[122X;[133X
  
  [30X    [33X[0;6Ygiven  [22XL  =  [1,g_2,g_3,...,g_n]  ∈  g^n[122X  we  define  [22Xθ_L  :  G -> G,~
        (o_i,g,o_j)  ↦  (o_i,g_i^-1gg_j,o_j)[122X so that, in particular, for all [22Xi[122X
        the  rays [22X(r_i : o_1 -> o_i)[122X are shifted by [22Xg_i[122X: they map to [22X(g_ir_i :
        o_1 -> o_i)[122X.[133X
  
  [33X[0;0YNotice,  at the end of the following example, that the calculated inverse of
  [10Xaut123[110X  is  [13Xnot[113X  in  fact  the correct morphism. Hopefully this error can be
  corrected in the next release.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xa4 := Subgroup( s4, [(1,2,3),(2,3,4)] );; [127X[104X
    [4X[25Xgap>[125X [27XSetName( a4, "a4" ); [127X[104X
    [4X[25Xgap>[125X [27Xgensa4 := GeneratorsOfGroup( a4 );; [127X[104X
    [4X[25Xgap>[125X [27XGa4 := SubgroupoidByPieces( Gs4, [ [a4, [-15,-13,-11]] ] ); [127X[104X
    [4X[28Xsingle piece groupoid: < a4, [ -15, -13, -11 ] >[128X[104X
    [4X[25Xgap>[125X [27XSetName( Ga4, "Ga4" ); [127X[104X
    [4X[25Xgap>[125X [27Xaut1 := GroupoidAutomorphismByObjectPerm( Ga4, [-13,-11,-15] );; [127X[104X
    [4X[25Xgap>[125X [27XDisplay( aut1 ); [127X[104X
    [4X[28X  groupoid mapping: [ Ga4 ] -> [ Ga4 ][128X[104X
    [4X[28X root homomorphism: [ [ (1,2,3), (2,3,4) ], [ (1,2,3), (2,3,4) ] ][128X[104X
    [4X[28X images of objects: [ -13, -11, -15 ][128X[104X
    [4X[28Ximage elts of rays: [ (), (), () ][128X[104X
    [4X[25Xgap>[125X [27Xh2 := GroupHomomorphismByImages( a4, a4, gensa4, [(2,3,4), (1,3,4)] );; [127X[104X
    [4X[25Xgap>[125X [27Xaut2 := GroupoidAutomorphismByGroupAuto( Ga4, h2 );; [127X[104X
    [4X[25Xgap>[125X [27XDisplay( aut2 ); [127X[104X
    [4X[28X  groupoid mapping: [ Ga4 ] -> [ Ga4 ][128X[104X
    [4X[28X root homomorphism: [ [ (1,2,3), (2,3,4) ], [ (2,3,4), (1,3,4) ] ][128X[104X
    [4X[28X images of objects: [ -15, -13, -11 ][128X[104X
    [4X[28Ximage elts of rays: [ (), (), () ][128X[104X
    [4X[25Xgap>[125X [27Xim3 := [(), (1,3,2), (2,4,3)];; [127X[104X
    [4X[25Xgap>[125X [27Xaut3 := GroupoidAutomorphismByRayShifts( Ga4, im3 );; [127X[104X
    [4X[25Xgap>[125X [27XDisplay( aut3 ); [127X[104X
    [4X[28X  groupoid mapping: [ Ga4 ] -> [ Ga4 ][128X[104X
    [4X[28X root homomorphism: [ [ (1,2,3), (2,3,4) ], [ (1,2,3), (2,3,4) ] ][128X[104X
    [4X[28X images of objects: [ -15, -13, -11 ][128X[104X
    [4X[28Ximage elts of rays: [ (), (1,3,2), (2,4,3) ][128X[104X
    [4X[25Xgap>[125X [27Xaut123 := aut1*aut2*aut3;; [127X[104X
    [4X[25Xgap>[125X [27XDisplay( aut123 ); [127X[104X
    [4X[28X  groupoid mapping: [ Ga4 ] -> [ Ga4 ][128X[104X
    [4X[28X root homomorphism: [ [ (1,2,3), (2,3,4) ], [ (2,3,4), (1,3,4) ] ][128X[104X
    [4X[28X images of objects: [ -13, -11, -15 ][128X[104X
    [4X[28Ximage elts of rays: [ (), (1,4,3), (1,2,3) ][128X[104X
    [4X[25Xgap>[125X [27Xinv123a := InverseGeneralMapping( aut123 );; [127X[104X
    [4X[25Xgap>[125X [27XDisplay( inv123a ); [127X[104X
    [4X[28X  groupoid mapping: [ Ga4 ] -> [ Ga4 ][128X[104X
    [4X[28X root homomorphism: [ [ (2,3,4), (1,3,4) ], [ (1,2,3), (2,3,4) ] ][128X[104X
    [4X[28X images of objects: [ -11, -15, -13 ][128X[104X
    [4X[28Ximage elts of rays: [ (), (1,2,4), (1,3,4) ][128X[104X
    [4X[25Xgap>[125X [27Xinv1 := InverseGeneralMapping( aut1 );; [127X[104X
    [4X[25Xgap>[125X [27Xinv2 := InverseGeneralMapping( aut2 );; [127X[104X
    [4X[25Xgap>[125X [27Xinv3 := InverseGeneralMapping( aut3 );;[127X[104X
    [4X[25Xgap>[125X [27Xinv123b := inv3*inv2*inv1;;[127X[104X
    [4X[25Xgap>[125X [27XDisplay( inv123b ); [127X[104X
    [4X[28X  groupoid mapping: [ Ga4 ] -> [ Ga4 ][128X[104X
    [4X[28X root homomorphism: [ [ (1,2,3), (2,3,4) ], [ (1,2,4), (1,2,3) ] ][128X[104X
    [4X[28X images of objects: [ -11, -15, -13 ][128X[104X
    [4X[28Ximage elts of rays: [ (), (1,2,4), (1,2,3) ][128X[104X
    [4X[25Xgap>[125X [27Xok := inv123a = inv123b;[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  
  [1X5.4-2 [33X[0;0YAutomorphisms of a groupoid with rays[133X[101X
  
  [33X[0;0YIf  [22XS[122X  is  a  wide  subgroupoid  with  rays of a standard groupoid [22XG[122X then an
  automorphism  [22Xα[122X  of  [22XG[122X  may  map  [22XS[122X  to a different subgroupoid. When [22Xα[122X is a
  [10XGroupoidAutomorphismByObjectPerm[110X,  then it restricts to an automorphism of [22XS[122X
  provided the objects in each orbit have the same ray elements.[133X
  
  [33X[0;0YThis subsection needs to be expanded and examples added.[133X
  
  [1X5.4-3 AutomorphismGroupOfGroupoid[101X
  
  [29X[2XAutomorphismGroupOfGroupoid[102X( [3Xgpd[103X ) [32X operation
  [29X[2XNiceObjectAutoGroupGroupoid[102X( [3Xgpd[103X, [3Xaut[103X ) [32X operation
  
  [33X[0;0YThe [10XAutomorphismGroup[110X of [22XG[122X is isomorphic to the quotient of [22XS_n × A × g^n[122X by
  a  subgroup  isomorphic to [22Xg[122X, where [22XA[122X is the automorphism group of [22Xg[122X and [22XS_n[122X
  is  the  symmetric group on the [22Xn[122X objects. This is one of the main topics in
  [AW10].[133X
  
  [33X[0;0YThe  function [10XNiceObjectAutoGroupGroupoid[110X takes a groupoid and a subgroup of
  its automorphism group and retuns a [13Xnice monomorphism[113X from this automorphism
  group  to  a  pc-group,  if  one is available. The current implementation is
  experimental.  Note  that  [10XImageElm[110X  at  present  only  works  on generating
  elements.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XAGa4 := AutomorphismGroupOfGroupoid( Ga4 ); [127X[104X
    [4X[28X<group with 8 generators>[128X[104X
    [4X[25Xgap>[125X [27XPrint( GeneratorsOfGroup( AGa4 ), "\n" ); [127X[104X
    [4X[28X[ groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ ConjugatorAutomorphism( a4, (2,3,4) ), [ -15, -13, -11 ], [128X[104X
    [4X[28X          [ (), (), () ] ] ], groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ ConjugatorAutomorphism( a4, (1,4,2,3) ), [ -15, -13, -11 ], [128X[104X
    [4X[28X          [ (), (), () ] ] ], groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ GroupHomomorphismByImages( a4, a4, [ (1,2,3), (2,3,4) ], [128X[104X
    [4X[28X            [ (1,2,3), (2,3,4) ] ), [ -13, -11, -15 ], [ (), (), () ] ] ], [128X[104X
    [4X[28X  groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ GroupHomomorphismByImages( a4, a4, [ (1,2,3), (2,3,4) ], [128X[104X
    [4X[28X            [ (1,2,3), (2,3,4) ] ), [ -13, -15, -11 ], [ (), (), () ] ] ], [128X[104X
    [4X[28X  groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ IdentityMapping( a4 ), [ -15, -13, -11 ], [ (), (1,2,3), () ] ] ], [128X[104X
    [4X[28X  groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ IdentityMapping( a4 ), [ -15, -13, -11 ], [ (), (2,3,4), () ] ] ], [128X[104X
    [4X[28X  groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ IdentityMapping( a4 ), [ -15, -13, -11 ], [ (), (), (1,2,3) ] ] ], [128X[104X
    [4X[28X  groupoid homomorphism : Ga4 -> Ga4[128X[104X
    [4X[28X    [ [ IdentityMapping( a4 ), [ -15, -13, -11 ], [ (), (), (2,3,4) ] ] ] ][128X[104X
    [4X[25Xgap>[125X [27XNGa4 := NiceObject( AGa4 ); [127X[104X
    [4X[28XGroup([ f6, f3, f11*f12, f12, f2, f1, f4*f9, f4^2, f5*f9*f10*f11*f12, f5^2 ])[128X[104X
    [4X[25Xgap>[125X [27XMGa4 := NiceMonomorphism( AGa4 );; [127X[104X
    [4X[25Xgap>[125X [27XSize( AGa4 ); [127X[104X
    [4X[28X20736[128X[104X
    [4X[25Xgap>[125X [27XSetName( AGa4, "AGa4" ); [127X[104X
    [4X[25Xgap>[125X [27XSetName( NGa4, "NGa4" ); [127X[104X
    [4X[25Xgap>[125X [27XPrint( Image( MGa4 ), "\n" ); [127X[104X
    [4X[28XGroup( [ f4*f5*f6, f3*f9*f10*f11, f2, f1*f2, f5*f11, f5^2, f4*f9, f4^2 ] )[128X[104X
    [4X[25Xgap>[125X [27X##  Now do some tests![127X[104X
    [4X[25Xgap>[125X [27Xmgi := MappingGeneratorsImages( MGa4 );; [127X[104X
    [4X[25Xgap>[125X [27Xautgen := mgi[1];; [127X[104X
    [4X[25Xgap>[125X [27Xpcgen := mgi[2];;[127X[104X
    [4X[25Xgap>[125X [27Xngen := Length( autgen );; [127X[104X
    [4X[25Xgap>[125X [27XForAll( [1..ngen], i -> Order(autgen[i]) = Order(pcgen[i]) ); [127X[104X
    [4X[28Xtrue [128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X5.4-4 GroupoidAutomorphismByGroupAutos[101X
  
  [29X[2XGroupoidAutomorphismByGroupAutos[102X( [3Xgpd[103X, [3Xauts[103X ) [32X operation
  
  [33X[0;0YHomogeneous,  discrete groupoids are the second type of groupoid for which a
  method is provided for [10XAutomorphismGroupOfGroupoid[110X. This is used in the [5XXMod[105X
  package  for  constructing  crossed  modules  of groupoids. The two types of
  generating automorphism are [10XGroupoidAutomorphismByGroupAutos[110X, which requires
  a   list   of   group   automorphisms,   one  for  each  object  group,  and
  [10XGroupoidAutomorphismByObjectPerm[110X, which permutes the objects.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XHs3 := HomogeneousDiscreteGroupoid( s3, [ -13..-10] ); [127X[104X
    [4X[28Xhomogeneous, discrete groupoid: < s3, [ -13 .. -10 ] >[128X[104X
    [4X[25Xgap>[125X [27Xaut4 := GroupoidAutomorphismByObjectPerm( Hs3, [-12,-10,-11,-13] ); [127X[104X
    [4X[28Xgroupoid homomorphism : morphism from a homogeneous discrete groupoid:[128X[104X
    [4X[28X[ -13, -12, -11, -10 ] -> [ -12, -10, -11, -13 ][128X[104X
    [4X[28Xobject homomorphisms:[128X[104X
    [4X[28XIdentityMapping( s3 )[128X[104X
    [4X[28XIdentityMapping( s3 )[128X[104X
    [4X[28XIdentityMapping( s3 )[128X[104X
    [4X[28XIdentityMapping( s3 )[128X[104X
    [4X[25Xgap>[125X [27Xgens3 := GeneratorsOfGroup( s3 );; [127X[104X
    [4X[25Xgap>[125X [27Xg1 := gens3[1];; [127X[104X
    [4X[25Xgap>[125X [27Xg2 := gens3[2];; [127X[104X
    [4X[25Xgap>[125X [27Xb1 := GroupHomomorphismByImages( s3, s3, gens3, [ g1, g2^g1 ] );; [127X[104X
    [4X[25Xgap>[125X [27Xb2 := GroupHomomorphismByImages( s3, s3, gens3, [ g1^g2, g2 ] );; [127X[104X
    [4X[25Xgap>[125X [27Xb3 := GroupHomomorphismByImages( s3, s3, gens3, [ g1^g2, g2^(g1*g2) ] );; [127X[104X
    [4X[25Xgap>[125X [27Xb4 := GroupHomomorphismByImages( s3, s3, gens3, [ g1^(g2*g1), g2^g1 ] );; [127X[104X
    [4X[25Xgap>[125X [27Xaut5 := GroupoidAutomorphismByGroupAutos( Hs3, [b1,b2,b3,b4] ); [127X[104X
    [4X[28Xgroupoid homomorphism : morphism from a homogeneous discrete groupoid:[128X[104X
    [4X[28X[ -13, -12, -11, -10 ] -> [ -13, -12, -11, -10 ][128X[104X
    [4X[28Xobject homomorphisms:[128X[104X
    [4X[28XGroupHomomorphismByImages( s3, s3, [128X[104X
    [4X[28X[ (15,17,19)(16,18,20), (15,20)(16,19)(17,18) ], [128X[104X
    [4X[28X[ (15,17,19)(16,18,20), (15,18)(16,17)(19,20) ] )[128X[104X
    [4X[28XGroupHomomorphismByImages( s3, s3, [128X[104X
    [4X[28X[ (15,17,19)(16,18,20), (15,20)(16,19)(17,18) ], [128X[104X
    [4X[28X[ (15,19,17)(16,20,18), (15,20)(16,19)(17,18) ] )[128X[104X
    [4X[28XGroupHomomorphismByImages( s3, s3, [128X[104X
    [4X[28X[ (15,17,19)(16,18,20), (15,20)(16,19)(17,18) ], [128X[104X
    [4X[28X[ (15,19,17)(16,20,18), (15,16)(17,20)(18,19) ] )[128X[104X
    [4X[28XGroupHomomorphismByImages( s3, s3, [128X[104X
    [4X[28X[ (15,17,19)(16,18,20), (15,20)(16,19)(17,18) ], [128X[104X
    [4X[28X[ (15,19,17)(16,20,18), (15,18)(16,17)(19,20) ] )[128X[104X
    [4X[25Xgap>[125X [27XAHs3 := AutomorphismGroupOfGroupoid( Hs3 );[127X[104X
    [4X[28X<group of size 31104 with 4 generators>[128X[104X
    [4X[25Xgap>[125X [27XGeneratorsOfGroup( AHs3 )[2];[127X[104X
    [4X[28Xgroupoid homomorphism : morphism from a homogeneous discrete groupoid:[128X[104X
    [4X[28X[ -13, -12, -11, -10 ] -> [ -13, -12, -11, -10 ][128X[104X
    [4X[28Xobject homomorphisms:[128X[104X
    [4X[28XConjugatorAutomorphism( s3, (15,19,17)(16,20,18) )[128X[104X
    [4X[28XIdentityMapping( s3 )[128X[104X
    [4X[28XIdentityMapping( s3 )[128X[104X
    [4X[28XIdentityMapping( s3 )[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X5.4-5 RootGroupHomomorphism[101X
  
  [29X[2XRootGroupHomomorphism[102X( [3Xgpdhom[103X ) [32X attribute
  [29X[2XObjectGroupHomomorphism[102X( [3Xgpdhom[103X, [3Xobj[103X ) [32X operation
  
  [33X[0;0YA  homomorphism  from  a  single  piece  groupoid has one further attribute,
  namely  [10XRootGroupHomomorphism[110X.  This is the group homomorphism from the root
  group  of  the  source to the object group at the image object in the range.
  Similarly,  the group homomorphism from an object group of the source to the
  object   group   at   the   image   object   in   the   range  is  given  by
  [10XObjectGroupHomomorphism[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XRootGroupHomomorphism( aut123 );[127X[104X
    [4X[28X[ (1,2,3), (2,3,4) ] -> [ (2,3,4), (1,3,4) ][128X[104X
    [4X[25Xgap>[125X [27XObjectGroupHomomorphism( aut123, -13 );[127X[104X
    [4X[28X[ (1,2,3), (2,3,4) ] -> [ (1,3,2), (1,3,4) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
