  
  [1X14 [33X[0;0YSemigroup homomorphisms[133X[101X
  
  [33X[0;0YIn this chapter we describe the various ways to define a homomorphism from a
  semigroup to another semigroup.[133X
  
  
  [1X14.1 [33X[0;0YHomomorphisms of arbitrary semigroups[133X[101X
  
  [1X14.1-1 SemigroupHomomorphismByImages[101X
  
  [33X[1;0Y[29X[2XSemigroupHomomorphismByImages[102X( [3XS[103X, [3XT[103X, [3Xgens[103X, [3Ximgs[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupHomomorphismByImages[102X( [3XS[103X, [3XT[103X, [3Ximgs[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupHomomorphismByImages[102X( [3XS[103X, [3XT[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupHomomorphismByImages[102X( [3XS[103X, [3Xgens[103X, [3Ximgs[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA semigroup homomorphism, or [9Xfail[109X.[133X
  
  [33X[0;0Y[10XSemigroupHomomorphismByImages[110X  attempts to construct a homomorphism from the
  semigroup  [3XS[103X  to  the semigroup [3XT[103X by mapping the [10Xi[110X-th element of [3Xgens[103X to the
  [10Xi[110X-th  element  of  [3Ximgs[103X.  If this mapping corresponds to a homomorphism, the
  homomorphism  is  returned, and if not, then [9Xfail[109X is returned. Similarly, if
  [3Xgens[103X does not generate [3XS[103X, [9Xfail[109X is returned.[133X
  
  [33X[0;0YIf omitted, the arguments [3Xgens[103X and [3Ximgs[103X default to the generators of [3XS[103X and [3XT[103X
  respectively. See [2XGeneratorsOfSemigroup[102X ([14XReference: GeneratorsOfSemigroup[114X).[133X
  
  [33X[0;0YIf  [3XT[103X  is  not  given,  then it defaults to the semigroup generated by [3Ximgs[103X,
  resulting in the mapping being surjective.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := FullTransformationMonoid(3);;[127X[104X
    [4X[25Xgap>[125X [27Xgens := GeneratorsOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27XJ := FullTransformationMonoid(4);;[127X[104X
    [4X[25Xgap>[125X [27Ximgs := ListWithIdenticalEntries(4,[127X[104X
    [4X[25X>[125X [27XConstantTransformation(3, 1));;[127X[104X
    [4X[25Xgap>[125X [27Xhom := SemigroupHomomorphismByImages(S, J, gens, imgs);[127X[104X
    [4X[28X<full transformation monoid of degree 3> -> [128X[104X
    [4X[28X<full transformation monoid of degree 4>[128X[104X
  [4X[32X[104X
  
  [1X14.1-2 SemigroupHomomorphismByFunctionNC[101X
  
  [33X[1;0Y[29X[2XSemigroupHomomorphismByFunctionNC[102X( [3XS[103X, [3XT[103X, [3Xfun[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupHomomorphismByFunction[102X( [3XS[103X, [3XT[103X, [3Xfun[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA semigroup homomorphism or [9Xfail[109X.[133X
  
  [33X[0;0Y[10XSemigroupHomomorphismByFunctionNC[110X  returns  a  semigroup  homomorphism  with
  source [3XS[103X and range [3XT[103X, such that each element [10Xs[110X in [3XS[103X is mapped to the element
  [3Xfun[103X[10X(s)[110X, where [3Xfun[103X is a [5XGAP[105X function.[133X
  
  [33X[0;0YThe function [10XSemigroupHomomorphismByFunctionNC[110X performs no checks on whether
  the  function  actually gives a homomorphism, and so it is possible for this
  operation to return a mapping from [3XS[103X to [3XT[103X that is not a homomorphism.[133X
  
  [33X[0;0YThe  function [10XSemigroupHomomorphismByFunction[110X checks that the mapping from [3XS[103X
  to   [3XT[103X   defined   by   [3Xfun[103X   satisfies  [2XRespectsMultiplication[102X  ([14XReference:
  RespectsMultiplication[114X),  which  can be expensive. If [2XRespectsMultiplication[102X
  ([14XReference: RespectsMultiplication[114X) does not hold, then [9Xfail[109X is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg := Semigroup([(1, 2, 3, 4), (1, 2)]);;[127X[104X
    [4X[25Xgap>[125X [27Xh := Semigroup([(1, 2, 3), (1, 2)]);;[127X[104X
    [4X[25Xgap>[125X [27Xhom := SemigroupHomomorphismByFunction(g, h,[127X[104X
    [4X[25X>[125X [27Xfunction(x) [127X[104X
    [4X[25X>[125X [27Xif SignPerm(x) = -1 then return (1, 2);[127X[104X
    [4X[25X>[125X [27Xelse return ();[127X[104X
    [4X[25X>[125X [27Xfi; end);[127X[104X
    [4X[28X<semigroup of size 24, with 2 generators> -> [128X[104X
    [4X[28X<semigroup of size 6, with 2 generators>[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  following  methods  relate  to  semigroup homomorphisms by images or by
  function:[133X
  
  [30X    [33X[0;6Y[2XRange[102X ([14XReference: range[114X),[133X
  
  [30X    [33X[0;6Y[2XImage[102X ([14XReference: Image[114X),[133X
  
  [30X    [33X[0;6Y[2XImages[102X ([14XReference: Images[114X),[133X
  
  [30X    [33X[0;6Y[2XImageElm[102X ([14XReference: ImageElm[114X),[133X
  
  [30X    [33X[0;6Y[2XPreImage[102X ([14XReference: PreImage[114X),[133X
  
  [30X    [33X[0;6Y[2XPreImages[102X ([14XReference: PreImages[114X),[133X
  
  [30X    [33X[0;6Y[2XPreImagesRepresentative[102X ([14XReference: PreImagesRepresentative[114X),[133X
  
  [30X    [33X[0;6Y[2XPreImagesRange[102X ([14XReference: PreImagesRange[114X),[133X
  
  [30X    [33X[0;6Y[2XPreImagesElm[102X ([14XReference: PreImagesElm[114X),[133X
  
  [30X    [33X[0;6Y[2XPreImagesSet[102X ([14XReference: PreImagesSet[114X),[133X
  
  [30X    [33X[0;6Y[2XIsSurjective[102X ([14XReference: IsSurjective[114X),[133X
  
  [30X    [33X[0;6Y[2XIsInjective[102X ([14XReference: IsInjective[114X),[133X
  
  [30X    [33X[0;6Y[2XIsBijective[102X ([14XReference: IsBijective[114X),[133X
  
  [30X    [33X[0;6Y[2XSource[102X ([14XReference: Source[114X),[133X
  
  [30X    [33X[0;6Y[2XRange[102X ([14XReference: range[114X),[133X
  
  [30X    [33X[0;6Y[2XImagesSource[102X ([14XReference: ImagesSource[114X),[133X
  
  [30X    [33X[0;6Y[2XKernelOfSemigroupHomomorphism[102X ([14X14.1-7[114X).[133X
  
  [1X14.1-3 IsSemigroupHomomorphismByImages[101X
  
  [33X[1;0Y[29X[2XIsSemigroupHomomorphismByImages[102X( [3Xhom[103X ) [32X filter[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0Y[10XIsSemigroupHomomorphismByImages[110X   returns   [9Xtrue[109X   if  [3Xhom[103X  is  a  semigroup
  homomorphism by images and [9Xfalse[109X if it is not. A semigroup homomorphism is a
  mapping  from  a  semigroup [10XS[110X to a semigroup [10XT[110X that respects multiplication.
  This  representation  describes  semigroup  homomorphisms  internally by the
  generators  of  [10XS[110X  and  their images in [10XT[110X. See [2XSemigroupHomomorphismByImages[102X
  ([14X14.1-1[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := FullTransformationMonoid(3);;[127X[104X
    [4X[25Xgap>[125X [27Xgens := GeneratorsOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27XT := FullTransformationMonoid(4);;[127X[104X
    [4X[25Xgap>[125X [27Ximgs := ListWithIdenticalEntries(4, ConstantTransformation(3, 1));;[127X[104X
    [4X[25Xgap>[125X [27Xhom := SemigroupHomomorphismByImages(S, T, gens, imgs);[127X[104X
    [4X[28X<full transformation monoid of degree 3> -> [128X[104X
    [4X[28X<full transformation monoid of degree 4>[128X[104X
    [4X[25Xgap>[125X [27XIsSemigroupHomomorphismByImages(hom);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X14.1-4 IsSemigroupHomomorphismByFunction[101X
  
  [33X[1;0Y[29X[2XIsSemigroupHomomorphismByFunction[102X( [3Xhom[103X ) [32X filter[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0Y[10XIsSemigroupHomomorphismByFunction[110X  returns  [9Xtrue[109X  if  [3Xhom[103X  was created using
  [2XSemigroupHomomorphismByFunction[102X  ([14X14.1-2[114X) and [9Xfalse[109X if it was not. Note that
  this  filter  may  return  [9Xtrue[109X even if the underlying [5XGAP[105X function does not
  define  a  homomorphism.  A  semigroup  homomorphism  is  a  mapping  from a
  semigroup   [10XS[110X   to   a   semigroup  [10XT[110X  that  respects  multiplication.  This
  representation  describes  semigroup  homomorphisms  internally  using a [5XGAP[105X
  function mapping elements of [10XS[110X to their images in [10XT[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([(1, 2, 3, 4), (1, 2)]);;[127X[104X
    [4X[25Xgap>[125X [27XT := Semigroup([(1, 2, 3), (1, 2)]);;[127X[104X
    [4X[25Xgap>[125X [27Xhom := SemigroupHomomorphismByFunction(S, T,[127X[104X
    [4X[25X>[125X [27Xfunction(x) if SignPerm(x) = -1 then return (1, 2); [127X[104X
    [4X[25X>[125X [27Xelse return ();fi; end);[127X[104X
    [4X[28X<semigroup of size 24, with 2 generators> -> [128X[104X
    [4X[28X<semigroup of size 6, with 2 generators>[128X[104X
    [4X[25Xgap>[125X [27XIsSemigroupHomomorphismByFunction(hom);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X14.1-5 AsSemigroupHomomorphismByImages[101X
  
  [33X[1;0Y[29X[2XAsSemigroupHomomorphismByImages[102X( [3Xhom[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA semigroup homomorphism, or [9Xfail[109X.[133X
  
  [33X[0;0Y[10XAsSemigroupHomomorphismByImages[110X  takes  [3Xhom[103X,  a  semigroup homomorphism, and
  returns  the same mapping but represented internally using the generators of
  [10XSource([3Xhom[103X[10X)[110X  and  their  images  in  [10XRange([3Xhom[103X[10X)[110X.  If  [3Xhom[103X  not  a  semigroup
  homomorphism,  then  [9Xfail[109X is returned. For example, this could happen if [3Xhom[103X
  was  created  using  [2XSemigroupIsomorphismByFunction[102X  ([14X14.2-9[114X) and a function
  which does not give a homomorphism.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([(1, 2, 3, 4), (1, 2)]);;[127X[104X
    [4X[25Xgap>[125X [27XT := Semigroup([(1, 2, 3), (1, 2)]);;[127X[104X
    [4X[25Xgap>[125X [27Xhom := SemigroupHomomorphismByFunction(S, T,[127X[104X
    [4X[25X>[125X [27Xfunction(x) if SignPerm(x) = -1 then return (1, 2); [127X[104X
    [4X[25X>[125X [27Xelse return (); fi; end);[127X[104X
    [4X[28X<semigroup of size 24, with 2 generators> -> [128X[104X
    [4X[28X<semigroup of size 6, with 2 generators>[128X[104X
  [4X[32X[104X
  
  [1X14.1-6 AsSemigroupHomomorphismByFunction[101X
  
  [33X[1;0Y[29X[2XAsSemigroupHomomorphismByFunction[102X( [3Xhom[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA semigroup homomorphism.[133X
  
  [33X[0;0Y[10XAsSemigroupHomomorphismByFunction[110X  takes  [3Xhom[103X, a semigroup homomorphism, and
  returns the same mapping but described by a [5XGAP[105X function mapping elements of
  [10XSource([3Xhom[103X[10X)[110X to their images in [10XRange([3Xhom[103X[10X)[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XT := TrivialSemigroup();;[127X[104X
    [4X[25Xgap>[125X [27XS := GLM(2, 2);;[127X[104X
    [4X[25Xgap>[125X [27Xgens := GeneratorsOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27Ximgs := ListX(gens, x -> IdentityTransformation);;[127X[104X
    [4X[25Xgap>[125X [27Xhom := SemigroupHomomorphismByImages(S, T, gens, imgs);;[127X[104X
    [4X[25Xgap>[125X [27Xhom := AsSemigroupHomomorphismByFunction(hom);[127X[104X
    [4X[28X<general linear monoid 2x2 over GF(2)> -> [128X[104X
    [4X[28X<trivial transformation group of degree 0 with 1 generator>[128X[104X
  [4X[32X[104X
  
  [1X14.1-7 KernelOfSemigroupHomomorphism[101X
  
  [33X[1;0Y[29X[2XKernelOfSemigroupHomomorphism[102X( [3Xhom[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA semigroup congruence.[133X
  
  [33X[0;0Y[10XKernelOfSemigroupHomomorphism[110X   returns   the   kernel   of   the  semigroup
  homomorphism  [3Xhom[103X. The kernel of a semigroup homomorphism [3Xhom[103X is a semigroup
  congruence  relating  pairs  of  elements in [10XSource([3Xhom[103X[10X)[110X mapping to the same
  element under [3Xhom[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([Transformation([2, 1, 5, 1, 5]),[127X[104X
    [4X[25X>[125X [27X      Transformation([1, 1, 1, 5, 3]),[127X[104X
    [4X[25X>[125X [27X      Transformation([2, 5, 3, 5, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27Xcongs := CongruencesOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := congs[3];;[127X[104X
    [4X[25Xgap>[125X [27XT := S / cong;;[127X[104X
    [4X[25Xgap>[125X [27Xgens := GeneratorsOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27Ximages := List(gens, gen -> EquivalenceClassOfElement(cong, gen));;[127X[104X
    [4X[25Xgap>[125X [27Xhom1 := SemigroupHomomorphismByImages(S, T, gens, images);;[127X[104X
    [4X[25Xgap>[125X [27Xcong = KernelOfSemigroupHomomorphism(hom1);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X14.2 [33X[0;0YIsomorphisms of arbitrary semigroups[133X[101X
  
  [1X14.2-1 IsIsomorphicSemigroup[101X
  
  [33X[1;0Y[29X[2XIsIsomorphicSemigroup[102X( [3XS[103X, [3XT[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf [3XS[103X and [3XT[103X are semigroups, then this operation attempts to determine whether
  [3XS[103X    and    [3XT[103X   are   isomorphic   semigroups   by   using   the   operation
  [2XIsomorphismSemigroups[102X  ([14X14.2-6[114X).  If  [10XIsomorphismSemigroups([3XS[103X[10X, [3XT[103X[10X)[110X returns an
  isomorphism,   then  [10XIsIsomorphicSemigroup([3XS[103X[10X,  [3XT[103X[10X)[110X  returns  [9Xtrue[109X,  while  if
  [10XIsomorphismSemigroups([3XS[103X[10X,  [3XT[103X[10X)[110X  returns [9Xfail[109X, then [10XIsIsomorphicSemigroup([3XS[103X[10X, [3XT[103X[10X)[110X
  returns [9Xfalse[109X.[133X
  
  [33X[0;0YNote  that  in  some  cases,  at present, there is no method for determining
  whether  [3XS[103X  is isomorphic to [3XT[103X, even if it is obvious to the user whether or
  not [3XS[103X and [3XT[103X are isomorphic. There are plans to improve this in the future.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup(PartialPerm([1, 2, 4], [1, 3, 5]),[127X[104X
    [4X[25X>[125X [27X                  PartialPerm([1, 3, 5], [1, 2, 4]));;[127X[104X
    [4X[25Xgap>[125X [27XT := AsSemigroup(IsTransformationSemigroup, S);;[127X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicSemigroup(S, T);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicSemigroup(FullTransformationMonoid(4),[127X[104X
    [4X[25X>[125X [27XPartitionMonoid(4));[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X14.2-2 SmallestMultiplicationTable[101X
  
  [33X[1;0Y[29X[2XSmallestMultiplicationTable[102X( [3XS[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YThe lex-least multiplication table of a semigroup.[133X
  
  [33X[0;0YThis  function  returns  the  lex-least  multiplication table of a semigroup
  isomorphic  to  the  semigroup  [3XS[103X.  [10XSmallestMultiplicationTable[110X  returns the
  lex-least  multiplication  of any semigroup isomoprhic to [3XS[103X. Due to the high
  complexity  of  computing  the smallest multiplication table of a semigroup,
  this  function  only performs well for semigroups with at most approximately
  50 elements.[133X
  
  [33X[0;0Y[10XSmallestMultiplicationTable[110X   is  based  on  the  function  [2XIdSmallSemigroup[102X
  ([14XSmallsemi: IdSmallSemigroup[114X) by Andreas Distler.[133X
  
  [33X[0;0YFrom   Version   3.3.0  of  [5XSemigroups[105X  this  attribute  is  computed  using
  [2XMinimalImage[102X  ([14Ximages:  MinimalImage[114X) from the the [5Ximages[105X package. See also:
  [2XCanonicalMultiplicationTable[102X ([14X14.2-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3, -1, -3], [-2]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3, -1], [-2], [-3]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3], [-1], [-2, -3]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, -1], [3, -2], [-3]]));;[127X[104X
    [4X[25Xgap>[125X [27XSize(S);[127X[104X
    [4X[28X8[128X[104X
    [4X[25Xgap>[125X [27XSmallestMultiplicationTable(S);[127X[104X
    [4X[28X[ [ 1, 1, 3, 4, 5, 6, 7, 8 ], [ 1, 1, 3, 4, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 1, 1, 3, 4, 5, 6, 7, 8 ], [ 1, 3, 3, 4, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 5, 5, 6, 7, 5, 6, 7, 8 ], [ 5, 5, 6, 7, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 5, 6, 6, 7, 5, 6, 7, 8 ], [ 5, 6, 6, 7, 5, 6, 7, 8 ] ][128X[104X
  [4X[32X[104X
  
  [1X14.2-3 CanonicalMultiplicationTable[101X
  
  [33X[1;0Y[29X[2XCanonicalMultiplicationTable[102X( [3XS[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA   canonical  multiplication  table  (up  to  isomorphism)  of  a
            semigroup.[133X
  
  [33X[0;0YThis  function  returns  a multiplication table of a semigroup isomorphic to
  the  semigroup [3XS[103X. [10XCanonicalMultiplicationTable[110X returns a multiplication that
  is  canonical,  in  the sense that if two semigroups [10XS[110X and [10XT[110X are isomorphic,
  then the return values of [10XCanonicalMultiplicationTable[110X are equal.[133X
  
  [33X[0;0Y[10XCanonicalMultiplicationTable[110X  uses  the machinery for canonical labelling of
  vertex  coloured  digraphs  in  [5Xbliss[105X via [2XBlissCanonicalLabelling[102X ([14XDigraphs:
  BlissCanonicalLabelling for a digraph and a list[114X).[133X
  
  [33X[0;0YThe  multiplication  table  returned  by  this  function  is  the  result of
  [10XOnMultiplicationTable(MultiplicationTable([3XS[103X[10X),
  CanonicalMultiplicationTablePerm([3XS[103X[10X));[110X[133X
  
  [33X[0;0YNote that the performance of [10XCanonicalMultiplicationTable[110X is vastly superior
  to that of [10XSmallestMultiplicationTable[110X.[133X
  
  [33X[0;0YSee       also:      [2XCanonicalMultiplicationTablePerm[102X      ([14X14.2-4[114X)      and
  [2XOnMultiplicationTable[102X ([14X14.2-5[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3, -1, -3], [-2]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3, -1], [-2], [-3]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3], [-1], [-2, -3]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, -1], [3, -2], [-3]]));;[127X[104X
    [4X[25Xgap>[125X [27XSize(S);[127X[104X
    [4X[28X8[128X[104X
    [4X[25Xgap>[125X [27XCanonicalMultiplicationTable(S);[127X[104X
    [4X[28X[ [ 1, 2, 2, 8, 1, 2, 7, 8 ], [ 1, 2, 2, 8, 1, 2, 7, 8 ], [128X[104X
    [4X[28X  [ 1, 2, 6, 4, 5, 6, 7, 8 ], [ 1, 2, 5, 4, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 1, 2, 6, 4, 5, 6, 7, 8 ], [ 1, 2, 6, 4, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 1, 2, 1, 8, 1, 2, 7, 8 ], [ 1, 2, 1, 8, 1, 2, 7, 8 ] ][128X[104X
  [4X[32X[104X
  
  [1X14.2-4 CanonicalMultiplicationTablePerm[101X
  
  [33X[1;0Y[29X[2XCanonicalMultiplicationTablePerm[102X( [3XS[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA permutation.[133X
  
  [33X[0;0YThis      function     returns     a     permutation     [10Xp[110X     such     that
  [10XOnMultiplicationTable(MultiplicationTable([3XS[103X[10X),           p);[110X           equals
  [10XCanonicalMultiplicationTable([3XS[103X[10X)[110X.[133X
  
  [33X[0;0YSee [2XCanonicalMultiplicationTable[102X ([14X14.2-3[114X) for more details.[133X
  
  [33X[0;0Y[10XCanonicalMultiplicationTablePerm[110X  uses the machinery for canonical labelling
  of  vertex coloured digraphs in [5Xbliss[105X via [2XBlissCanonicalLabelling[102X ([14XDigraphs:
  BlissCanonicalLabelling for a digraph and a list[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3, -1, -3], [-2]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3, -1], [-2], [-3]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, 3], [-1], [-2, -3]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[1, 2, -1], [3, -2], [-3]]));;[127X[104X
    [4X[25Xgap>[125X [27XSize(S);[127X[104X
    [4X[28X8[128X[104X
    [4X[25Xgap>[125X [27XCanonicalMultiplicationTablePerm(S);[127X[104X
    [4X[28X(1,5,8,3,6,7,2,4)[128X[104X
  [4X[32X[104X
  
  [1X14.2-5 OnMultiplicationTable[101X
  
  [33X[1;0Y[29X[2XOnMultiplicationTable[102X( [3Xtable[103X, [3Xp[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA multiplication table.[133X
  
  [33X[0;0YIf  [3Xtable[103X is a multiplication table of a semigroup and the second argument [3Xp[103X
  is  a  permutation  of  [10X[1  .. Length([3Xtable[103X[10X)][110X, then this operation returns a
  multiplication  table  of  a  semigroup  isomorphic to that defined by [3Xtable[103X
  where the elements [10X[1 .. Length([3Xtable[103X[10X)][110X are relabelled according to [3Xp[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xtable := [[1, 1, 3, 4, 5, 6, 7, 8], [127X[104X
    [4X[25X>[125X [27X             [1, 1, 3, 4, 5, 6, 7, 8], [127X[104X
    [4X[25X>[125X [27X             [1, 1, 3, 4, 5, 6, 7, 8], [127X[104X
    [4X[25X>[125X [27X             [1, 3, 3, 4, 5, 6, 7, 8], [127X[104X
    [4X[25X>[125X [27X             [5, 5, 6, 7, 5, 6, 7, 8], [127X[104X
    [4X[25X>[125X [27X             [5, 5, 6, 7, 5, 6, 7, 8], [127X[104X
    [4X[25X>[125X [27X             [5, 6, 6, 7, 5, 6, 7, 8], [127X[104X
    [4X[25X>[125X [27X             [5, 6, 6, 7, 5, 6, 7, 8]];;[127X[104X
    [4X[25Xgap>[125X [27Xp := (1, 2, 3, 4)(10, 11, 12);;[127X[104X
    [4X[25Xgap>[125X [27XOnMultiplicationTable(table, p);[127X[104X
    [4X[28X[ [ 1, 2, 4, 4, 5, 6, 7, 8 ], [ 1, 2, 2, 4, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 1, 2, 2, 4, 5, 6, 7, 8 ], [ 1, 2, 2, 4, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 7, 5, 5, 6, 5, 6, 7, 8 ], [ 7, 5, 5, 6, 5, 6, 7, 8 ], [128X[104X
    [4X[28X  [ 7, 5, 6, 6, 5, 6, 7, 8 ], [ 7, 5, 6, 6, 5, 6, 7, 8 ] ][128X[104X
  [4X[32X[104X
  
  [1X14.2-6 IsomorphismSemigroups[101X
  
  [33X[1;0Y[29X[2XIsomorphismSemigroups[102X( [3XS[103X, [3XT[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YAn isomorphism, or [9Xfail[109X.[133X
  
  [33X[0;0YThis  operation  attempts to find an isomorphism from the semigroup [3XS[103X to the
  semigroup  [3XT[103X. If it finds one, then it is returned, and if not, then [9Xfail[109X is
  returned.[133X
  
  [33X[0;0Y[10XIsomorphismSemigroups[110X  uses  the  machinery for finding isomorphisms between
  vertex   coloured  digraphs  in  [5Xbliss[105X  via  [2XIsomorphismDigraphs[102X  ([14XDigraphs:
  IsomorphismDigraphs  for  digraphs  and  homogeneous  lists[114X)  using digraphs
  constructed from the multiplication tables of [3XS[103X and [3XT[103X.[133X
  
  [33X[0;0YNote  that  finding  an isomorphism between two semigroups is difficult, and
  may  not  be  possible  for  semigroups  whose  size  exceeds  a few hundred
  elements. On the other hand, [10XIsomorphismSemigroups[110X may be able deduce that [3XS[103X
  and  [3XT[103X  are not isomorphic by finding that some of their semigroup-theoretic
  properties differ.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := RectangularBand(IsTransformationSemigroup, 4, 5);[127X[104X
    [4X[28X<regular transformation semigroup of size 20, degree 9 with 5 [128X[104X
    [4X[28X generators>[128X[104X
    [4X[25Xgap>[125X [27XT := RectangularBand(IsBipartitionSemigroup, 4, 5);[127X[104X
    [4X[28X<regular bipartition semigroup of size 20, degree 3 with 5 generators>[128X[104X
    [4X[25Xgap>[125X [27XIsomorphismSemigroups(S, T) <> fail;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := DClass(FullTransformationMonoid(5),[127X[104X
    [4X[25X>[125X [27X               Transformation([1, 2, 3, 4, 1]));;[127X[104X
    [4X[25Xgap>[125X [27XS := PrincipalFactor(D);;[127X[104X
    [4X[25Xgap>[125X [27XStructureDescription(UnderlyingSemigroup(S));[127X[104X
    [4X[28X"S4"[128X[104X
    [4X[25Xgap>[125X [27XS;[127X[104X
    [4X[28X<Rees 0-matrix semigroup 10x5 over S4>[128X[104X
    [4X[25Xgap>[125X [27XD := DClass(PartitionMonoid(5),[127X[104X
    [4X[25X>[125X [27XBipartition([[1], [2, -2], [3, -3], [4, -4], [5, -5], [-1]]));;[127X[104X
    [4X[25Xgap>[125X [27XT := PrincipalFactor(D);;[127X[104X
    [4X[25Xgap>[125X [27XStructureDescription(UnderlyingSemigroup(T));[127X[104X
    [4X[28X"S4"[128X[104X
    [4X[25Xgap>[125X [27XT;[127X[104X
    [4X[28X<Rees 0-matrix semigroup 15x15 over S4>[128X[104X
    [4X[25Xgap>[125X [27XIsomorphismSemigroups(S, T);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27XI := SemigroupIdeal(FullTransformationMonoid(5),[127X[104X
    [4X[25X>[125X [27X                       Transformation([1, 1, 2, 3, 4]));;[127X[104X
    [4X[25Xgap>[125X [27XT := PrincipalFactor(DClass(I, I.1));;[127X[104X
    [4X[25Xgap>[125X [27XStructureDescription(UnderlyingSemigroup(T));[127X[104X
    [4X[28X"S4"[128X[104X
    [4X[25Xgap>[125X [27XT;[127X[104X
    [4X[28X<Rees 0-matrix semigroup 10x5 over S4>[128X[104X
    [4X[25Xgap>[125X [27XIsomorphismSemigroups(S, T) <> fail;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X14.2-7 AutomorphismGroup[101X
  
  [33X[1;0Y[29X[2XAutomorphismGroup[102X( [3XS[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA group.[133X
  
  [33X[0;0YThis  operation  returns  the  group  of  automorphisms  of the semigroup [3XS[103X.
  [10XAutomorphismGroup[110X    uses    [5Xbliss[105X    via    [2XAutomorphismGroup[102X    ([14XDigraphs:
  AutomorphismGroup  for  a  digraph  and  a  homogeneous list[114X) using a vertex
  coloured   digraph   constructed   from   the  multiplication  table  of  [3XS[103X.
  Consequently,  this method is only really feasible for semigroups whose size
  does not exceed a few hundred elements.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := RectangularBand(IsTransformationSemigroup, 4, 5);[127X[104X
    [4X[28X<regular transformation semigroup of size 20, degree 9 with 5 [128X[104X
    [4X[28X generators>[128X[104X
    [4X[25Xgap>[125X [27XStructureDescription(AutomorphismGroup(S));[127X[104X
    [4X[28X"S4 x S5"[128X[104X
  [4X[32X[104X
  
  [1X14.2-8 SemigroupIsomorphismByImages[101X
  
  [33X[1;0Y[29X[2XSemigroupIsomorphismByImages[102X( [3XS[103X, [3XT[103X, [3Xgens[103X, [3Ximgs[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupIsomorphismByImages[102X( [3XS[103X, [3XT[103X, [3Ximgs[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupIsomorphismByImages[102X( [3XS[103X, [3XT[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupIsomorphismByImages[102X( [3XS[103X, [3Xgens[103X, [3Ximgs[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA semigroup isomorphism, or [9Xfail[109X.[133X
  
  [33X[0;0Y[10XSemigroupIsomorphismByImages[110X  attempts  to  construct a isomorphism from the
  semigroup  [3XS[103X  to the semigroup [3XT[103X, by mapping the [10Xi[110X-th element of [3Xgens[103X to the
  [10Xi[110X-th  element  of  [3Ximgs[103X.  If this mapping corresponds to an isomorphism, the
  isomorphism  is  returned, and if not, then [9Xfail[109X is returned. An isomorphism
  is   a   bijective   homomorphism.  See  also  [2XSemigroupHomomorphismByImages[102X
  ([14X14.1-1[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([[127X[104X
    [4X[25X>[125X [27X Matrix(IsNTPMatrix, [[0, 1, 2], [4, 3, 0], [0, 2, 0]], 9, 4),[127X[104X
    [4X[25X>[125X [27X Matrix(IsNTPMatrix, [[1, 1, 0], [4, 1, 1], [0, 0, 0]], 9, 4)]);;[127X[104X
    [4X[25Xgap>[125X [27XT := AsSemigroup(IsTransformationSemigroup, S);;[127X[104X
    [4X[25Xgap>[125X [27Xiso := SemigroupIsomorphismByImages(S, T);[127X[104X
    [4X[28X<semigroup of size 46, 3x3 ntp matrices with 2 generators> -> [128X[104X
    [4X[28X<transformation semigroup of size 46, degree 47 with 2 generators>[128X[104X
  [4X[32X[104X
  
  [1X14.2-9 SemigroupIsomorphismByFunctionNC[101X
  
  [33X[1;0Y[29X[2XSemigroupIsomorphismByFunctionNC[102X( [3XS[103X, [3XT[103X, [3Xfun[103X, [3XinvFun[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSemigroupIsomorphismByFunction[102X( [3XS[103X, [3XT[103X, [3Xfun[103X, [3XinvFun[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA semigroup isomorphism or [9Xfail[109X.[133X
  
  [33X[0;0Y[10XSemigroupIsomorphismByFunctionNC[110X returns a semigroup isomorphism with source
  [3XS[103X  and  range  [3XT[103X,  such  that  each  element [10Xs[110X in [3XS[103X is mapped to the element
  [3Xfun[103X[10X(s)[110X,  where [3Xfun[103X is a [5XGAP[105X function, and [3XinvFun[103X its inverse, mapping [3Xfun[103X[10X(s)[110X
  back to [10Xs[110X.[133X
  
  [33X[0;0YThe  function [10XSemigroupIsomorphismByFunctionNC[110X performs no checks on whether
  the  function  actually gives an isomorphism, and so it is possible for this
  operation to return a mapping from [3XS[103X to [3XT[103X that is not a homomorphism, or not
  a  bijection, or where the return value of [2XInverseGeneralMapping[102X ([14XReference:
  InverseGeneralMapping[114X) is not the inverse of the returned function.[133X
  
  [33X[0;0YThe  function [10XSemigroupIsomorphismByFunction[110X checks that: the mapping from [3XS[103X
  to   [3XT[103X   defined   by   [3Xfun[103X   satisfies  [2XRespectsMultiplication[102X  ([14XReference:
  RespectsMultiplication[114X);  that  the  function  from [3XT[103X to [3XS[103X defined by [3XinvFun[103X
  satisfies  [2XRespectsMultiplication[102X  ([14XReference:  RespectsMultiplication[114X); and
  that  these  functions are mutual inverses. This can be expensive. If any of
  these checks fails, then [9Xfail[109X is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := MonogenicSemigroup(IsTransformationSemigroup, 3, 2);;[127X[104X
    [4X[25Xgap>[125X [27XT := MonogenicSemigroup(IsBipartitionSemigroup, 3, 2);;[127X[104X
    [4X[25Xgap>[125X [27Xmap := x -> T.1 ^ Length(Factorization(S, x));;[127X[104X
    [4X[25Xgap>[125X [27Xinv := x -> S.1 ^ Length(Factorization(T, x));;[127X[104X
    [4X[25Xgap>[125X [27Xiso := SemigroupIsomorphismByFunction(S, T, map, inv);[127X[104X
    [4X[28X<commutative non-regular transformation semigroup of size 4, degree 5 [128X[104X
    [4X[28X  with 1 generator> -> <commutative non-regular block bijection [128X[104X
    [4X[28X  semigroup of size 4, degree 6 with 1 generator>[128X[104X
  [4X[32X[104X
  
  [1X14.2-10 IsSemigroupIsomorphismByFunction[101X
  
  [33X[1;0Y[29X[2XIsSemigroupIsomorphismByFunction[102X( [3Xiso[103X ) [32X filter[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0Y[10XIsSemigroupIsomorphismByFunction[110X    returns    [9Xtrue[109X    if    [3Xhom[103X   satisfies
  [2XIsSemigroupHomomorphismByFunction[102X   ([14X14.1-4[114X)   and  [2XIsBijective[102X  ([14XReference:
  IsBijective[114X),  and  [9Xfalse[109X if does not. Note that this filter may return [9Xtrue[109X
  even  if  the  underlying  [5XGAP[105X  function  does  not define a homomorphism. A
  semigroup  isomorphism is a mapping from a semigroup [10XS[110X to a semigroup [10XT[110X that
  respects    multiplication.    This   representation   describes   semigroup
  isomorphisms  internally  by  using  a [5XGAP[105X function mapping elements of [10XS[110X to
  their images in [10XT[110X. See [2XSemigroupIsomorphismByFunction[102X ([14X14.2-9[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := MonogenicSemigroup(IsTransformationSemigroup, 3, 2);;[127X[104X
    [4X[25Xgap>[125X [27XT := MonogenicSemigroup(IsBipartitionSemigroup, 3, 2);;[127X[104X
    [4X[25Xgap>[125X [27Xmap := x -> T.1 ^ Length(Factorization(S, x));;[127X[104X
    [4X[25Xgap>[125X [27Xinv := x -> S.1 ^ Length(Factorization(T, x));;[127X[104X
    [4X[25Xgap>[125X [27Xiso := SemigroupIsomorphismByFunction(S, T, map, inv);[127X[104X
    [4X[28X<commutative non-regular transformation semigroup of size 4, degree 5 [128X[104X
    [4X[28X  with 1 generator> -> <commutative non-regular block bijection [128X[104X
    [4X[28X  semigroup of size 4, degree 6 with 1 generator>[128X[104X
    [4X[25Xgap>[125X [27XIsSemigroupIsomorphismByFunction(iso);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X14.2-11 AsSemigroupIsomorphismByFunction[101X
  
  [33X[1;0Y[29X[2XAsSemigroupIsomorphismByFunction[102X( [3Xhom[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA semigroup isomorphism, or [9Xfail[109X.[133X
  
  [33X[0;0Y[10XAsSemigroupIsomorphismByFunction[110X  takes  a  semigroup  homomorphism  [3Xhom[103X and
  returns  a  semigroup  isomorphism  represented  using [5XGAP[105X functions for the
  isomorphism and its inverse. If [3Xhom[103X is not bijective, then [9Xfail[109X is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := FullTransformationMonoid(3);;[127X[104X
    [4X[25Xgap>[125X [27Xgens := GeneratorsOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27Ximgs := ListWithIdenticalEntries(4, ConstantTransformation(3, 1));;[127X[104X
    [4X[25Xgap>[125X [27Xhom := SemigroupHomomorphismByImages(S, S, gens, gens);;[127X[104X
    [4X[25Xgap>[125X [27XAsSemigroupIsomorphismByFunction(hom);[127X[104X
    [4X[28X<full transformation monoid of degree 3> -> [128X[104X
    [4X[28X<full transformation monoid of degree 3>[128X[104X
  [4X[32X[104X
  
  [1X14.2-12 SmallerDegreeTransformationRepresentation[101X
  
  [33X[1;0Y[29X[2XSmallerDegreeTransformationRepresentation[102X( [3XS[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YAn isomorphism to a transformation semigroup.[133X
  
  [33X[0;0YThis  function attempts to find a small degree transformation representation
  of  the  semigroup [3XS[103X. The implementation attempts to find a right congruence
  of [3XS[103X that [3XS[103X acts on (the equivalence classes of) faithfully.[133X
  
  [33X[0;0YIf [3XS[103X is not a finitely presented semigroup, then the returned isomorphism is
  the  composition  of an isomorphism to a finitely presented semigroup and an
  isomorphism  from  that  finitely  presented  semigroup  to a transformation
  semigroup.[133X
  
  [33X[0;0YThe  runtime  of  this  function  depends  on the presentation for [3XS[103X that is
  either  given  explicitly  or  computed by the [5XSemigroups[105X package, but it is
  difficult  to  predict what properties of the presentation lead to a shorter
  runtime.  This  is  unlikely to terminate in a reasonable amount of time for
  semigroups  with  more  than  approx.  [10X10000[110X  elements,  but  might also not
  terminate quickly for smaller semigroups depending on the presentation used.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := BrauerMonoid(3);[127X[104X
    [4X[28X<regular bipartition *-monoid of degree 3 with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XIsomorphismTransformationSemigroup(S);[127X[104X
    [4X[28X<regular bipartition *-monoid of size 15, degree 3 with 3 generators> [128X[104X
    [4X[28X-> <transformation monoid of size 15, degree 15 with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XSmallerDegreeTransformationRepresentation(S);[127X[104X
    [4X[28XCompositionMapping( [128X[104X
    [4X[28X<fp semigroup with 4 generators and 20 relations of length 81> -> [128X[104X
    [4X[28X<transformation monoid of degree 7 with 3 generators>, [128X[104X
    [4X[28X<regular bipartition *-monoid of size 15, degree 3 with 3 generators> [128X[104X
    [4X[28X-> <fp semigroup with 4 generators and 20 relations of length 81> )[128X[104X
    [4X[25Xgap>[125X [27XS := JonesMonoid(5);[127X[104X
    [4X[28X<regular bipartition *-monoid of degree 5 with 4 generators>[128X[104X
    [4X[25Xgap>[125X [27XSize(S);[127X[104X
    [4X[28X42[128X[104X
    [4X[25Xgap>[125X [27XSmallerDegreeTransformationRepresentation(S);[127X[104X
    [4X[28XCompositionMapping( [128X[104X
    [4X[28X<fp semigroup with 5 generators and 28 relations of length 120> -> [128X[104X
    [4X[28X<transformation monoid of degree 10 with 4 generators>, [128X[104X
    [4X[28X<regular bipartition *-monoid of size 42, degree 5 with 4 generators> [128X[104X
    [4X[28X-> <fp semigroup with 5 generators and 28 relations of length 120> )[128X[104X
  [4X[32X[104X
  
  [1X14.2-13 MinimalFaithfulTransformationDegree[101X
  
  [33X[1;0Y[29X[2XMinimalFaithfulTransformationDegree[102X( [3XS[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThis  function  returns  the  minimal  degree  of  a faithful transformation
  representation  of the semigroup [3XS[103X. This is currently only implemented for a
  very small number of types of semigroups.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := RightZeroSemigroup(10);[127X[104X
    [4X[28X<transformation semigroup of degree 7 with 10 generators>[128X[104X
    [4X[25Xgap>[125X [27XMinimalFaithfulTransformationDegree(S);[127X[104X
    [4X[28X7[128X[104X
  [4X[32X[104X
  
  
  [1X14.3 [33X[0;0YIsomorphisms of Rees (0-)matrix semigroups[133X[101X
  
  [33X[0;0YAn  isomorphism  between two regular finite Rees (0-)matrix semigroups whose
  underlying  semigroups  are  groups  can be described by a triple defined in
  terms  of  the  matrices and underlying groups of the semigroups. For a full
  description of the theory involved, see Section 3.4 of [How95].[133X
  
  [33X[0;0YAn isomorphism described in this way can be constructed using [2XRMSIsoByTriple[102X
  ([14X14.3-2[114X)   or   [2XRZMSIsoByTriple[102X   ([14X14.3-2[114X),  and  will  satisfy  the  filter
  [2XIsRMSIsoByTriple[102X ([14X14.3-1[114X) or [2XIsRZMSIsoByTriple[102X ([14X14.3-1[114X).[133X
  
  [1X14.3-1 IsRMSIsoByTriple[101X
  
  [33X[1;0Y[29X[2XIsRMSIsoByTriple[102X [32X Category[133X
  [33X[1;0Y[29X[2XIsRZMSIsoByTriple[102X [32X Category[133X
  
  [33X[0;0YThe  isomorphisms  between finite Rees matrix or 0-matrix semigroups [10XS[110X and [10XT[110X
  over groups [10XG[110X and [10XH[110X, respectively, specified by a triple consisting of:[133X
  
  [31X1[131X   [33X[0;6Yan isomorphism of the underlying graph of [10XS[110X to the underlying graph of
        of [10XT[110X[133X
  
  [31X2[131X   [33X[0;6Yan isomorphism from [10XG[110X to [10XH[110X[133X
  
  [31X3[131X   [33X[0;6Ya function from [10XRows(S)[110X union [10XColumns(S)[110X to [10XH[110X[133X
  
  [33X[0;0Ybelong  to  the  categories  [10XIsRMSIsoByTriple[110X  and  [10XIsRZMSIsoByTriple[110X. Basic
  operators  for  such  isomorphism  are given in [14X14.3-7[114X, and basic operations
  are:   [2XRange[102X   ([14XReference:  range[114X),  [2XSource[102X  ([14XReference:  Source[114X),  [2XELM_LIST[102X
  ([14X14.3-3[114X),   [2XCompositionMapping[102X  ([14XReference:  CompositionMapping[114X),  [2XImagesElm[102X
  ([14X14.3-5[114X),  [2XImagesRepresentative[102X  ([14X14.3-5[114X), [2XInverseGeneralMapping[102X ([14XReference:
  InverseGeneralMapping[114X),          [2XPreImagesRepresentative[102X         ([14XReference:
  PreImagesRepresentative[114X), [2XIsOne[102X ([14XReference: IsOne[114X).[133X
  
  [1X14.3-2 RMSIsoByTriple[101X
  
  [33X[1;0Y[29X[2XRMSIsoByTriple[102X( [3XR1[103X, [3XR2[103X, [3Xtriple[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XRZMSIsoByTriple[102X( [3XR1[103X, [3XR2[103X, [3Xtriple[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YAn isomorphism.[133X
  
  [33X[0;0YIf  [3XR1[103X  and  [3XR2[103X  are  isomorphic  regular  Rees  0-matrix  semigroups  whose
  underlying   semigroups   are   groups   then  [10XRZMSIsoByTriple[110X  returns  the
  isomorphism  between  [3XR1[103X  and  [3XR2[103X  defined by [3Xtriple[103X, which should be a list
  consisting of the following:[133X
  
  [30X    [33X[0;6Y[10X[3Xtriple[103X[10X[1][110X  should  be a permutation describing an isomorphism from the
        graph   of   [3XR1[103X   to   the   graph  of  [3XR2[103X,  i.e.  it  should  satisfy
        [10XOnDigraphs(RZMSDigraph([3XR1[103X[10X), [3Xtriple[103X[10X[1]) = RZMSDigraph([3XR2[103X[10X)[110X.[133X
  
  [30X    [33X[0;6Y[10X[3Xtriple[103X[10X[2][110X  should be an isomorphism from the underlying group of [3XR1[103X to
        the  underlying  group  of  [3XR2[103X  (see  [2XUnderlyingSemigroup[102X  ([14XReference:
        UnderlyingSemigroup for a Rees 0-matrix semigroup[114X)).[133X
  
  [30X    [33X[0;6Y[10X[3Xtriple[103X[10X[3][110X  should  be  a list of elements from the underlying group of
        [3XR2[103X.  If the [2XMatrix[102X ([14XReference: Matrix[114X) of [3XR1[103X has [22Xm[122X columns and [22Xn[122X rows,
        then  the  list  should  have  length [22Xm + n[122X, where the first [22Xm[122X entries
        should  correspond  to  the  columns  of  [3XR1[103X's  matrix, and the last [22Xn[122X
        entries  should  correspond  to the rows. These column and row entries
        should  correspond  to  the  [22Xu_i[122X  and [22Xv_λ[122X elements in Theorem 3.4.1 of
        [How95].[133X
  
  [33X[0;0YIf  [3Xtriple[103X describes a valid isomorphism from [3XR1[103X to [3XR2[103X then this will return
  an  object  in  the  category [2XIsRZMSIsoByTriple[102X ([14X14.3-1[114X); otherwise an error
  will be returned.[133X
  
  [33X[0;0YIf  [3XR1[103X  and  [3XR2[103X  are  instead  Rees  matrix  semigroups  (without zero) then
  [10XRMSIsoByTriple[110X  should  be  used instead. This operation is used in the same
  way,  but  it  should  be  noted  that  since  an  RMS's graph is a complete
  bipartite  graph,  [10X[3Xtriple[103X[10X[1][110X can be any permutation on [10X[1 .. m + n][110X, so long
  as no point in [10X[1 .. m][110X is mapped to a point in [10X[m + 1 .. m + n][110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg := SymmetricGroup(3);;[127X[104X
    [4X[25Xgap>[125X [27Xmat := [[0, 0, (1, 3)], [(1, 2, 3), (), (2, 3)], [0, 0, ()]];;[127X[104X
    [4X[25Xgap>[125X [27XR := ReesZeroMatrixSemigroup(g, mat);;[127X[104X
    [4X[25Xgap>[125X [27Xid := IdentityMapping(g);;[127X[104X
    [4X[25Xgap>[125X [27Xg_elms_list := [(), (), (), (), (), ()];;[127X[104X
    [4X[25Xgap>[125X [27XRZMSIsoByTriple(R, R, [(), id, g_elms_list]);[127X[104X
    [4X[28X((), IdentityMapping( SymmetricGroup( [ 1 .. 3 ] ) ), [128X[104X
    [4X[28X[ (), (), (), (), (), () ])[128X[104X
  [4X[32X[104X
  
  [1X14.3-3 ELM_LIST[101X
  
  [33X[1;0Y[29X[2XELM_LIST[102X( [3Xmap[103X, [3Xpos[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA  component  of  an  isomorphism of Rees (0-)matrix semigroups by
            triple.[133X
  
  [33X[0;0Y[10XELM_LIST([3Xmap[103X[10X,  [3Xi[103X[10X)[110X returns the [10Xi[110Xth component of the Rees (0-)matrix semigroup
  isomorphism by triple [3Xmap[103X when [10Xi = 1, 2, 3[110X.[133X
  
  [33X[0;0YThe  components  of  an  isomorphism of Rees (0-)matrix semigroups by triple
  are:[133X
  
  [31X1[131X   [33X[0;6YAn  isomorphism  of  the  underlying graphs of the source and range of
        [3Xmap[103X, respectively.[133X
  
  [31X2[131X   [33X[0;6YAn  isomorphism  of  the  underlying groups of the source and range of
        [3Xmap[103X, respectively.[133X
  
  [31X3[131X   [33X[0;6YAn  function  from  the union of the rows and columns of the source of
        [3Xmap[103X to the underlying group of the range of [3Xmap[103X.[133X
  
  [1X14.3-4 CompositionMapping2[101X
  
  [33X[1;0Y[29X[2XCompositionMapping2[102X( [3Xmap1[103X, [3Xmap2[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XCompositionMapping2[102X( [3Xmap1[103X, [3Xmap2[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA Rees (0-)matrix semigroup by triple.[133X
  
  [33X[0;0YIf  [3Xmap1[103X  and  [3Xmap2[103X  are  isomorphisms of Rees matrix or 0-matrix semigroups
  specified  by  triples  and  the range of [3Xmap2[103X is contained in the source of
  [3Xmap1[103X,  then  [10XCompositionMapping2([3Xmap1[103X[10X,  [3Xmap2[103X[10X)[110X  returns  the isomorphism from
  [10XSource([3Xmap2[103X[10X)[110X to [10XRange([3Xmap1[103X[10X)[110X specified by the triple with components:[133X
  
  [31X1[131X   [33X[0;6Y[10X[3Xmap1[103X[10X[1] * [3Xmap2[103X[10X[1][110X[133X
  
  [31X2[131X   [33X[0;6Y[10X[3Xmap1[103X[10X[2] * [3Xmap2[103X[10X[2][110X[133X
  
  [31X3[131X   [33X[0;6Ythe componentwise product of [10X[3Xmap1[103X[10X[1] * [3Xmap2[103X[10X[3][110X and [10X[3Xmap1[103X[10X[3] * [3Xmap2[103X[10X[2][110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR := ReesZeroMatrixSemigroup(Group([(1, 2, 3, 4)]),[127X[104X
    [4X[25X>[125X [27X[[(1, 3)(2, 4), (1, 4, 3, 2), (), (1, 2, 3, 4), (1, 3)(2, 4), 0],[127X[104X
    [4X[25X>[125X [27X [(1, 4, 3, 2), 0, (), (1, 4, 3, 2), (1, 2, 3, 4), (1, 2, 3, 4)],[127X[104X
    [4X[25X>[125X [27X [(), (), (1, 4, 3, 2), (1, 2, 3, 4), 0, (1, 2, 3, 4)],[127X[104X
    [4X[25X>[125X [27X [(1, 2, 3, 4), (1, 4, 3, 2), (1, 2, 3, 4), 0, (), (1, 2, 3, 4)],[127X[104X
    [4X[25X>[125X [27X [(1, 3)(2, 4), (1, 2, 3, 4), 0, (), (1, 4, 3, 2), (1, 2, 3, 4)],[127X[104X
    [4X[25X>[125X [27X [0, (1, 2, 3, 4), (1, 2, 3, 4), (1, 2, 3, 4), (1, 2, 3, 4), ()]]);[127X[104X
    [4X[28X<Rees 0-matrix semigroup 6x6 over Group([ (1,2,3,4) ])>[128X[104X
    [4X[25Xgap>[125X [27XG := AutomorphismGroup(R);;[127X[104X
    [4X[25Xgap>[125X [27XG.2;[127X[104X
    [4X[28X((), IdentityMapping( Group( [ (1,2,3,4) ] ) ), [128X[104X
    [4X[28X[ (), (), (), (), (), (), (), (), (), (), (), () ])[128X[104X
    [4X[25Xgap>[125X [27XG.3;[127X[104X
    [4X[28X(( 2, 4)( 3, 5)( 8,10)( 9,11), GroupHomomorphismByImages( Group( [128X[104X
    [4X[28X[ (1,2,3,4) ] ), Group( [ (1,2,3,4) ] ), [ (1,2,3,4) ], [128X[104X
    [4X[28X[ (1,2,3,4) ] ), [ (), (1,3)(2,4), (1,3)(2,4), (1,3)(2,4), [128X[104X
    [4X[28X  (1,3)(2,4), (1,3)(2,4), (), (1,3)(2,4), (1,3)(2,4), (1,3)(2,4), [128X[104X
    [4X[28X  (1,3)(2,4), (1,3)(2,4) ])[128X[104X
    [4X[25Xgap>[125X [27XCompositionMapping2(G.2, G.3);[127X[104X
    [4X[28X(( 2, 4)( 3, 5)( 8,10)( 9,11), GroupHomomorphismByImages( Group( [128X[104X
    [4X[28X[ (1,2,3,4) ] ), Group( [ (1,2,3,4) ] ), [ (1,2,3,4) ], [128X[104X
    [4X[28X[ (1,2,3,4) ] ), [ (), (1,3)(2,4), (1,3)(2,4), (1,3)(2,4), [128X[104X
    [4X[28X  (1,3)(2,4), (1,3)(2,4), (), (1,3)(2,4), (1,3)(2,4), (1,3)(2,4), [128X[104X
    [4X[28X  (1,3)(2,4), (1,3)(2,4) ])[128X[104X
  [4X[32X[104X
  
  [1X14.3-5 ImagesElm[101X
  
  [33X[1;0Y[29X[2XImagesElm[102X( [3Xmap[103X, [3Xpt[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XImagesRepresentative[102X( [3Xmap[103X, [3Xpt[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YAn  element  of  a  Rees (0-)matrix semigroup or a list containing
            such an element.[133X
  
  [33X[0;0YIf  [3Xmap[103X is an isomorphism of Rees matrix or 0-matrix semigroups specified by
  a   triple   and   [3Xpt[103X   is   an   element   of   the  source  of  [3Xmap[103X,  then
  [10XImagesRepresentative([3Xmap[103X[10X, [3Xpt[103X[10X) = [3Xpt[103X[10X ^ [3Xmap[103X[10X[110X returns the image of [3Xpt[103X under [3Xmap[103X.[133X
  
  [33X[0;0YThe image of [3Xpt[103X under [3Xmap[103X of [10XRange([3Xmap[103X[10X)[110X is the element with components:[133X
  
  [31X1[131X   [33X[0;6Y[10X[3Xpt[103X[10X[1] ^ [3Xmap[103X[10X[1][110X[133X
  
  [31X2[131X   [33X[0;6Y[10X([3Xpt[103X[10X[1] ^ [3Xmap[103X[10X[3]) * ([3Xpt[103X[10X[2] ^ [3Xmap[103X[10X[2]) * ([3Xpt[103X[10X[3] ^ [3Xmap[103X[10X[3]) ^ -1[110X[133X
  
  [31X3[131X   [33X[0;6Y[10X[3Xpt[103X[10X[3] ^ [3Xmap[103X[10X[1][110X.[133X
  
  [33X[0;0Y[10XImagesElm([3Xmap[103X[10X, [3Xpt[103X[10X)[110X simply returns [10X[ImagesRepresentative([3Xmap[103X[10X, [3Xpt[103X[10X)][110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR := ReesZeroMatrixSemigroup(Group([(2, 8), (2, 8, 6)]),[127X[104X
    [4X[25X>[125X [27X[[0, (2, 8), 0, 0, 0, (2, 8, 6)],[127X[104X
    [4X[25X>[125X [27X [(), 0, (2, 8, 6), (2, 6), (2, 6, 8), 0],[127X[104X
    [4X[25X>[125X [27X [(2, 8, 6), 0, (2, 6, 8), (2, 8), (), 0],[127X[104X
    [4X[25X>[125X [27X [(2, 8, 6), 0, (2, 6, 8), (2, 8), (), 0],[127X[104X
    [4X[25X>[125X [27X [0, (2, 8, 6), 0, 0, 0, (2, 8)],[127X[104X
    [4X[25X>[125X [27X [(2, 8, 6), 0, (2, 6, 8), (2, 8), (), 0]]);[127X[104X
    [4X[28X<Rees 0-matrix semigroup 6x6 over Group([ (2,8), (2,8,6) ])>[128X[104X
    [4X[25Xgap>[125X [27Xmap := RZMSIsoByTriple(R, R,[127X[104X
    [4X[25X>[125X [27X[(), IdentityMapping(Group([(2, 8), (2, 8, 6)])),[127X[104X
    [4X[25X>[125X [27X[(), (2, 6, 8), (), (), (), (2, 8, 6),[127X[104X
    [4X[25X>[125X [27X (2, 8, 6), (), (), (), (2, 6, 8), ()]]);;[127X[104X
    [4X[25Xgap>[125X [27XImagesElm(map, RMSElement(R, 1, (2, 8), 2));[127X[104X
    [4X[28X[ (1,(2,8),2) ][128X[104X
  [4X[32X[104X
  
  [1X14.3-6 CanonicalReesZeroMatrixSemigroup[101X
  
  [33X[1;0Y[29X[2XCanonicalReesZeroMatrixSemigroup[102X( [3XS[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XCanonicalReesMatrixSemigroup[102X( [3XS[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA Rees zero matrix semigroup.[133X
  
  [33X[0;0YIf  [3XS[103X  is  a  Rees  0-matrix semigroup then [10XCanonicalReesZeroMatrixSemigroup[110X
  returns   an   isomorphic   Rees   0-matrix   semigroup   [10XT[110X  with  the  same
  [2XUnderlyingSemigroup[102X  ([14XReference:  UnderlyingSemigroup  for  a  Rees 0-matrix
  semigroup[114X)   as  [3XS[103X  but  the  [2XMatrix[102X  ([14XReference:  Matrix[114X)  of  [10XT[110X  has  been
  canonicalized.  The  output  [10XT[110X  is  canonical  in the sense that for any two
  inputs  which  are isomorphic Rees zero matrix semigroups the output of this
  function is the same.[133X
  
  [33X[0;0Y[10XCanonicalReesMatrixSemigroup[110X works the same but for Rees matrix semigroups.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3),[127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(), ()]]);;[127X[104X
    [4X[25Xgap>[125X [27XT := CanonicalReesZeroMatrixSemigroup(S);[127X[104X
    [4X[28X<Rees 0-matrix semigroup 2x2 over Sym( [ 1 .. 3 ] )>[128X[104X
    [4X[25Xgap>[125X [27XMatrix(S);[127X[104X
    [4X[28X[ [ (), (1,3,2) ], [ (), () ] ][128X[104X
    [4X[25Xgap>[125X [27XMatrix(T);[127X[104X
    [4X[28X[ [ (), () ], [ (), (1,2,3) ] ][128X[104X
  [4X[32X[104X
  
  
  [1X14.3-7 [33X[0;0YOperators for isomorphisms of Rees (0-)matrix semigroups[133X[101X
  
  [8X[10X[3Xmap[103X[8X[10X[[3Xi[103X[8X[10X][110X[8X[108X
        [33X[0;6Y[10X[3Xmap[103X[10X[i][110X  returns  the  [3Xi[103Xth  component  of the Rees (0-)matrix semigroup
        isomorphism by triple [3Xmap[103X when [10X[3Xi[103X[10X = 1, 2, 3[110X; see [2XELM_LIST[102X ([14X14.3-3[114X).[133X
  
  [8X[10X[3Xmap1[103X[8X[10X * [3Xmap2[103X[8X[10X[110X[8X[108X
        [33X[0;6Yreturns  the  composition  of  [3Xmap2[103X  and [3Xmap1[103X; see [2XCompositionMapping2[102X
        ([14X14.3-4[114X).[133X
  
  [8X[10X[3Xmap1[103X[8X[10X < [3Xmap2[103X[8X[10X[110X[8X[108X
        [33X[0;6Yreturns [9Xtrue[109X if [3Xmap1[103X is lexicographically less than [3Xmap2[103X.[133X
  
  [8X[10X[3Xmap1[103X[8X[10X = [3Xmap2[103X[8X[10X[110X[8X[108X
        [33X[0;6Yreturns  [9Xtrue[109X  if the Rees (0-)matrix semigroup isomorphisms by triple
        [3Xmap1[103X and [3Xmap2[103X have equal source and range, and are equal as functions,
        and [9Xfalse[109X otherwise.[133X
  
        [33X[0;6YIt  is  possible  for  [3Xmap1[103X  and [3Xmap2[103X to be equal but to have distinct
        components.[133X
  
  [8X[10X[3Xpt[103X[8X[10X ^ [3Xmap[103X[8X[10X[110X[8X[108X
        [33X[0;6Yreturns  the  image  of  the element [3Xpt[103X of the source of [3Xmap[103X under the
        isomorphism [3Xmap[103X; see [2XImagesElm[102X ([14X14.3-5[114X).[133X
  
