  
  [1X2 [33X[0;0YBasics[133X[101X
  
  [33X[0;0YWe  give some examples of semigroups to be used later. We also describe some
  basic functions that are not directly available from [5XGAP[105X, but are useful for
  the purposes of this package.[133X
  
  
  [1X2.1 [33X[0;0YExamples[133X[101X
  
  [33X[0;0YThese are some examples of semigroups that will be used through this manual[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf := FreeMonoid("a","b");[127X[104X
    [4X[28X<free monoid on the generators [ a, b ]>[128X[104X
    [4X[25Xgap>[125X [27Xa := GeneratorsOfMonoid( f )[ 1 ];;[127X[104X
    [4X[25Xgap>[125X [27Xb := GeneratorsOfMonoid( f )[ 2 ];;[127X[104X
    [4X[25Xgap>[125X [27Xr:=[[a^3,a^2],[127X[104X
    [4X[25X>[125X [27X[a^2*b,a^2],[127X[104X
    [4X[25X>[125X [27X[b*a^2,a^2],[127X[104X
    [4X[25X>[125X [27X[b^2,a^2],[127X[104X
    [4X[25X>[125X [27X[a*b*a,a],[127X[104X
    [4X[25X>[125X [27X[b*a*b,b] ];[127X[104X
    [4X[28X[ [ a^3, a^2 ], [ a^2*b, a^2 ], [ b*a^2, a^2 ], [ b^2, a^2 ], [ a*b*a, a ], [128X[104X
    [4X[28X  [ b*a*b, b ] ][128X[104X
    [4X[25Xgap>[125X [27Xb21:= f/r;[127X[104X
    [4X[28X<fp monoid on the generators [ a, b ]>[128X[104X
    [4X[28X      [128X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg0:=Transformation([4,1,2,4]);;[127X[104X
    [4X[25Xgap>[125X [27Xg1:=Transformation([1,3,4,4]);;[127X[104X
    [4X[25Xgap>[125X [27Xg2:=Transformation([2,4,3,4]);;[127X[104X
    [4X[25Xgap>[125X [27Xpoi3:= Monoid(g0,g1,g2);[127X[104X
    [4X[28X<monoid with 3 generators>[128X[104X
    [4X[28X     [128X[104X
  [4X[32X[104X
  
  
  [1X2.2 [33X[0;0YSome attributes[133X[101X
  
  [33X[0;0YThese functions are semigroup attributes that get stored once computed.[133X
  
  [1X2.2-1 HasCommutingIdempotents[101X
  
  [29X[2XHasCommutingIdempotents[102X( [3XM[103X ) [32X attribute
  
  [33X[0;0YTests whether the idempotents of the semigroup [3XM [103Xcommute.[133X
  
  [1X2.2-2 IsInverseSemigroup[101X
  
  [29X[2XIsInverseSemigroup[102X( [3XS[103X ) [32X attribute
  
  [33X[0;0YTests  whether  a  finite  semigroup  [3XS [103Xis inverse. It is well-known that it
  suffices  to test whether the idempotents of [3XS [103Xcommute and [3XS [103Xis regular. The
  function [10XIsRegularSemigroup [110Xis part of [5XGAP[105X.[133X
  
  
  [1X2.3 [33X[0;0YSome basic functions[133X[101X
  
  [1X2.3-1 PartialTransformation[101X
  
  [29X[2XPartialTransformation[102X( [3XL[103X ) [32X function
  
  [33X[0;0YA  partial  transformation is a partial function of a set of integers of the
  form  [22X{1,dots,  n}[122X.  It  is  given by means of the list of images [3XL[103X. When an
  element  has  no  image,  we write 0. Returns a full transformation on a set
  with one more element that acts like a zero.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XPartialTransformation([2,0,4,0]);[127X[104X
    [4X[28XTransformation( [ 2, 5, 4, 5, 5 ] )[128X[104X
    [4X[28X      [128X[104X
  [4X[32X[104X
  
  [1X2.3-2 ReduceNumberOfGenerators[101X
  
  [29X[2XReduceNumberOfGenerators[102X( [3XL[103X ) [32X function
  
  [33X[0;0YGiven  a  subset  [3XL[103X  of  the  generators  of  a semigroup, returns a list of
  generators of the same semigroup but possibly with less elements than [3XL[103X.[133X
  
  [1X2.3-3 SemigroupFactorization[101X
  
  [29X[2XSemigroupFactorization[102X( [3XS[103X, [3XL[103X ) [32X function
  
  [33X[0;0Y[3XL[103X  is an element (or list of elements) of the semigroup [3XS[103X. Returns a minimal
  factorization  on the generators of [3XS[103X of the element(s) of [3XL[103X. Works only for
  transformation semigroups.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xel1 := Transformation( [ 2, 3, 4, 4 ] );;[127X[104X
    [4X[25Xgap>[125X [27Xel2 := Transformation( [ 2, 4, 3, 4 ] );;[127X[104X
    [4X[25Xgap>[125X [27Xf1 := SemigroupFactorization(poi3,el1);[127X[104X
    [4X[28X[ [ Transformation( [ 1, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] ) ] ][128X[104X
    [4X[25Xgap>[125X [27Xf1[1][1] * f1[1][2] = el1;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XSemigroupFactorization(poi3,[el1,el2]);[127X[104X
    [4X[28X[ [ Transformation( [ 1, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] ) ],[128X[104X
    [4X[28X  [ Transformation( [ 2, 4, 3, 4 ] ) ] ][128X[104X
  [4X[32X[104X
  
  [1X2.3-4 GrahamBlocks[101X
  
  [29X[2XGrahamBlocks[102X( [3Xmat[103X ) [32X function
  
  [33X[0;0Y[3Xmat[103X  is  a  matrix  as  displayed  by [10XDisplayEggBoxOfDClass(D);[110X of a regular
  D-class  [10XD[110X.  This  function  outputs a list [10X[gmat, phi][110X where [10Xgmat[110X is [3Xmat[103X in
  Graham's  blocks  form  and  [10Xphi[110X maps H-classes of [10Xgmat[110X to the corresponding
  ones  of  [3Xmat[103X,  i.e., [10Xphi[i][j] = [i',j'][110X where [10Xmat[i'][j'] = gmat[i][j][110X. If
  the  argument  to  this  function is not a matrix corresponding to a regular
  D-class, the function may abort in error.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xp1 := PartialTransformation([6,2,0,0,2,6,0,0,10,10,0,0]);;[127X[104X
    [4X[25Xgap>[125X [27Xp2 := PartialTransformation([0,0,1,5,0,0,5,9,0,0,9,1]);;[127X[104X
    [4X[25Xgap>[125X [27Xp3 := PartialTransformation([0,0,3,3,0,0,7,7,0,0,11,11]);;[127X[104X
    [4X[25Xgap>[125X [27Xp4 := PartialTransformation([4,4,0,0,8,8,0,0,12,12,0,0]);;[127X[104X
    [4X[25Xgap>[125X [27Xcss3:=Semigroup(p1,p2,p3,p4);[127X[104X
    [4X[28X<transformation semigroup of degree 13 with 4 generators>[128X[104X
    [4X[25Xgap>[125X [27Xel := Elements(css3)[8];;[127X[104X
    [4X[25Xgap>[125X [27XD := GreensDClassOfElement(css3, el);;[127X[104X
    [4X[25Xgap>[125X [27XIsRegularDClass(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XDisplayEggBoxOfDClass(D);[127X[104X
    [4X[28X[ [  1,  1,  0,  0 ],[128X[104X
    [4X[28X  [  1,  1,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  1,  1 ],[128X[104X
    [4X[28X  [  0,  0,  1,  1 ] ][128X[104X
    [4X[25Xgap>[125X [27Xmat := [ [  1,  0,  1,  0 ],[127X[104X
    [4X[25X>[125X [27X  [  0,  1,  0,  1 ],[127X[104X
    [4X[25X>[125X [27X  [  0,  1,  0,  1 ],[127X[104X
    [4X[25X>[125X [27X  [  1,  0,  1,  0 ] ];;[127X[104X
    [4X[25Xgap>[125X [27Xres := GrahamBlocks(mat);;[127X[104X
    [4X[25Xgap>[125X [27XPrintArray(res[1]);[127X[104X
    [4X[28X[ [  1,  1,  0,  0 ],[128X[104X
    [4X[28X  [  1,  1,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  1,  1 ],[128X[104X
    [4X[28X  [  0,  0,  1,  1 ] ][128X[104X
    [4X[25Xgap>[125X [27XPrintArray(res[2]);[127X[104X
    [4X[28X[ [  [ 1, 1 ],  [ 1, 3 ],  [ 1, 2 ],  [ 1, 4 ] ],[128X[104X
    [4X[28X  [  [ 4, 1 ],  [ 4, 3 ],  [ 4, 2 ],  [ 4, 4 ] ],[128X[104X
    [4X[28X  [  [ 2, 1 ],  [ 2, 3 ],  [ 2, 2 ],  [ 2, 4 ] ],[128X[104X
    [4X[28X  [  [ 3, 1 ],  [ 3, 3 ],  [ 3, 2 ],  [ 3, 4 ] ] ][128X[104X
  [4X[32X[104X
  
  
  [1X2.4 [33X[0;0YCayley graphs[133X[101X
  
  [1X2.4-1 RightCayleyGraphAsAutomaton[101X
  
  [29X[2XRightCayleyGraphAsAutomaton[102X( [3XS[103X ) [32X function
  
  [33X[0;0YComputes  the  right Cayley graph of a finite monoid or semigroup [3XS[103X. It uses
  the  [5XGAP[105X  buit-in  function [10XCayleyGraphSemigroup[110X to compute the Cayley Graph
  and  returns  it  as an automaton without initial nor final states. (In this
  automaton  state  [10Xi[110X  represents  the  element  [10XElements(S)[i][110X.) The [5XAutomata[105X
  package is used to this effect.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xrcg := RightCayleyGraphAsAutomaton(b21);[127X[104X
    [4X[28X< deterministic automaton on 2 letters with 6 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(rcg);[127X[104X
    [4X[28X   |  1  2  3  4  5  6[128X[104X
    [4X[28X-----------------------[128X[104X
    [4X[28X a |  2  4  6  4  2  4[128X[104X
    [4X[28X b |  3  5  4  4  4  3[128X[104X
    [4X[28XInitial state:   [ ][128X[104X
    [4X[28XAccepting state: [ ][128X[104X
    [4X[28X      [128X[104X
  [4X[32X[104X
  
  [1X2.4-2 RightCayleyGraphMonoidAsAutomaton[101X
  
  [29X[2XRightCayleyGraphMonoidAsAutomaton[102X( [3XS[103X ) [32X function
  
  [33X[0;0YThis function is a synonym of [2XRightCayleyGraphAsAutomaton[102X ([14X2.4-1[114X).[133X
  
