  
  [1X11 [33X[0;0YFree inverse semigroups[133X[101X
  
  [33X[0;0YThis  chapter  describes  the  functions in [5XSemigroups[105X for dealing with free
  inverse semigroups and free bands. This part of the manual and the functions
  described herein were written by Julius Jonušas.[133X
  
  
  [1X11.1 [33X[0;0YFree inverse semigroups[133X[101X
  
  [33X[0;0YAn inverse semigroup [22XF[122X is said to be [13Xfree[113X on a non-empty set [22XX[122X if there is a
  map [22Xf[122X from [22XF[122X to [22XX[122X such that for every inverse semigroup [22XS[122X and a map [22Xg[122X from [22XX[122X
  to  [22XS[122X  there  exists a unique homomorphism [22Xg'[122X from [22XF[122X to [22XS[122X such that [22Xfg' = g[122X.
  Moreover,  by  this  universal  property,  every  inverse  semigroup  can be
  expressed as a quotient of a free inverse semigroup.[133X
  
  [33X[0;0YThe internal representation of an element of a free inverse semigroup uses a
  Munn  tree.  A  [13XMunn  tree[113X  is  a directed tree with distinguished start and
  terminal  vertices and where the edges are labeled by generators so that two
  edges  labeled by the same generator are only incident to the same vertex if
  one  of the edges is coming in and the other is leaving the vertex. For more
  information  regarding  free inverse semigroups and the Munn representations
  see Section 5.10 of [How95].[133X
  
  [33X[0;0YSee  also  [14X'Reference:  Inverse semigroups and monoids'[114X, [14X'Reference: Partial
  permutations'[114X and [14X'Reference: Free Groups, Monoids and Semigroups'[114X.[133X
  
  [33X[0;0YAn  element  of  a  free  inverse  semigroup  in [5XSemigroups[105X is displayed, by
  default,  as  a  shortest  word corresponding to the element. However, there
  might  be  more than one word of the minimum length. For example, if [22Xx[122X and [22Xy[122X
  are generators of a free inverse semigroups, then[133X
  
  
        [33X[1;6Y[24X[33X[0;0Yxyy ^ {-1}xx ^ {-1}x ^ {-1} = xxx ^ {-1}yy ^ {-1}x ^ {-1}.[133X [124X[133X
  
  
  [33X[0;0YSee [2XMinimalWord[102X ([14X11.3-2[114X). Therefore we provide a another method for printing
  elements  of  a  free inverse semigroup: a unique canonical form. Suppose an
  element  of  a  free inverse semigroup is given as a Munn tree. Let [22XL[122X be the
  set  of  words  corresponding to the shortest paths from the start vertex to
  the  leaves  of the tree. Also let [22Xw[122X be a word corresponding to the shortest
  path  from start to terminal vertices. The word [22Xvv ^ -1[122X is an idempotent for
  every  [22Xv[122X in [22XL[122X. The canonical form is given by multiplying these idempotents,
  in  shortlex order, and then postmultiplying by [22Xw[122X. For example, consider the
  word  [22Xxyy  ^  -1xx ^ -1x ^ -1[122X again. The words corresponding to the paths to
  the  leaves  are  in this case [22Xxx[122X and [22Xxy[122X. And [22Xw[122X is an empty word since start
  and terminal vertices are the same. Therefore, the canonical form is[133X
  
  
        [33X[1;6Y[24X[33X[0;0Yxxx ^ {-1}x ^ {-1}xyy ^ {-1}x ^ {-1}.[133X [124X[133X
  
  
  [33X[0;0YSee [2XCanonicalForm[102X ([14X11.3-1[114X).[133X
  
  [1X11.1-1 FreeInverseSemigroup[101X
  
  [29X[2XFreeInverseSemigroup[102X( [3Xrank[103X[, [3Xname[103X] ) [32X function
  [29X[2XFreeInverseSemigroup[102X( [3Xname1[103X, [3Xname2[103X, [3X...[103X ) [32X function
  [29X[2XFreeInverseSemigroup[102X( [3Xnames[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA free inverse semigroup.[133X
  
  [33X[0;0YReturns  a  free  inverse  semigroup  on  [3Xrank[103X  generators,  where [3Xrank[103X is a
  positive  integer. If [3Xrank[103X is not specified, the number of [3Xnames[103X is used. If
  [10XS[110X  is  a free inverse semigroup, then the generators can be accessed by [10XS.1[110X,
  [10XS.2[110X and so on.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := FreeInverseSemigroup(7);[127X[104X
    [4X[28X<free inverse semigroup on the generators [128X[104X
    [4X[28X[ x1, x2, x3, x4, x5, x6, x7 ]>[128X[104X
    [4X[25Xgap>[125X [27XS := FreeInverseSemigroup(7, "s");[127X[104X
    [4X[28X<free inverse semigroup on the generators [128X[104X
    [4X[28X[ s1, s2, s3, s4, s5, s6, s7 ]>[128X[104X
    [4X[25Xgap>[125X [27XS := FreeInverseSemigroup("a", "b", "c");[127X[104X
    [4X[28X<free inverse semigroup on the generators [ a, b, c ]>[128X[104X
    [4X[25Xgap>[125X [27XS := FreeInverseSemigroup(["a", "b", "c"]);[127X[104X
    [4X[28X<free inverse semigroup on the generators [ a, b, c ]>[128X[104X
    [4X[25Xgap>[125X [27XS.1;[127X[104X
    [4X[28Xa[128X[104X
    [4X[25Xgap>[125X [27XS.2;[127X[104X
    [4X[28Xb[128X[104X
  [4X[32X[104X
  
  [1X11.1-2 IsFreeInverseSemigroupCategory[101X
  
  [29X[2XIsFreeInverseSemigroupCategory[102X( [3Xobj[103X ) [32X Category
  
  [33X[0;0YEvery free inverse semigroup in [5XGAP[105X created by [2XFreeInverseSemigroup[102X ([14X11.1-1[114X)
  belongs  to the category [10XIsFreeInverseSemigroup[110X. Basic operations for a free
  inverse     semigroup    are:    [2XGeneratorsOfInverseSemigroup[102X    ([14XReference:
  GeneratorsOfInverseSemigroup[114X)    and    [2XGeneratorsOfSemigroup[102X    ([14XReference:
  GeneratorsOfSemigroup[114X).  Elements  of a free inverse semigroup belong to the
  category [2XIsFreeInverseSemigroupElement[102X ([14X11.1-4[114X).[133X
  
  [1X11.1-3 IsFreeInverseSemigroup[101X
  
  [29X[2XIsFreeInverseSemigroup[102X( [3XS[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YAttempts  to  determine  whether  the  given semigroup [3X S [103X is a free inverse
  semigroup.[133X
  
  [1X11.1-4 IsFreeInverseSemigroupElement[101X
  
  [29X[2XIsFreeInverseSemigroupElement[102X[32X Category
  
  [33X[0;0YEvery   element  of  a  free  inverse  semigroup  belongs  to  the  category
  [10XIsFreeInverseSemigroupElement[110X.[133X
  
  
  [1X11.2 [33X[0;0YDisplaying free inverse semigroup elements[133X[101X
  
  [33X[0;0YThere  is  a  way to change how [5XGAP[105X displays free inverse semigroup elements
  using    the   user   preference   [10XFreeInverseSemigroupElementDisplay[110X.   See
  [2XUserPreference[102X  ([14XReference:  UserPreference[114X) for more information about user
  preferences.[133X
  
  [33X[0;0YThere are two possible values for [10XFreeInverseSemigroupElementDisplay[110X:[133X
  
  [8Xminimal [108X
        [33X[0;6YWith   this   option  selected,  [5XGAP[105X  will  display  a  shortest  word
        corresponding  to  the  free  inverse semigroup element. However, this
        shortest word is not unique. This is a default setting.[133X
  
  [8Xcanonical[108X
        [33X[0;6YWith  this  option selected, [5XGAP[105X will display a free inverse semigroup
        element in the canonical form.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XSetUserPreference("semigroups", [127X[104X
    [4X[25X>[125X [27X                     "FreeInverseSemigroupElementDisplay",[127X[104X
    [4X[25X>[125X [27X                     "minimal");[127X[104X
    [4X[25Xgap>[125X [27XS := FreeInverseSemigroup(2);[127X[104X
    [4X[28X<free inverse semigroup on the generators [ x1, x2 ]>[128X[104X
    [4X[25Xgap>[125X [27XS.1 * S.2;[127X[104X
    [4X[28Xx1*x2[128X[104X
    [4X[25Xgap>[125X [27XSetUserPreference("semigroups", [127X[104X
    [4X[25X>[125X [27X                     "FreeInverseSemigroupElementDisplay", [127X[104X
    [4X[25X>[125X [27X                     "canonical");[127X[104X
    [4X[25Xgap>[125X [27XS.1 * S.2;[127X[104X
    [4X[28Xx1x2x2^-1x1^-1x1x2[128X[104X
  [4X[32X[104X
  
  
  [1X11.3 [33X[0;0YOperators and operations for free inverse semigroup elements[133X[101X
  
  [8X[10X[3Xw[103X[10X ^ -1[110X[108X
        [33X[0;6Yreturns the semigroup inverse of the free inverse semigroup element [3Xw[103X.[133X
  
  [8X[10X[3Xu[103X[10X * [3Xv[103X[10X[110X[108X
        [33X[0;6Yreturns the product of two free inverse semigroup elements [3Xu[103X and [3Xv[103X.[133X
  
  [8X[10X[3Xu[103X[10X = [3Xv[103X[10X [110X[108X
        [33X[0;6Ychecks  if two free inverse semigroup elements are equal, by comparing
        their canonical forms.[133X
  
  [1X11.3-1 CanonicalForm[101X
  
  [29X[2XCanonicalForm[102X( [3Xw[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA string.[133X
  
  [33X[0;0YEvery  element of a free inverse semigroup has a unique canonical form. If [3Xw[103X
  is  such an element, then [10XCanonicalForm[110X returns the canonical form of [3Xw[103X as a
  string.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := FreeInverseSemigroup(3);[127X[104X
    [4X[28X<free inverse semigroup on the generators [ x1, x2, x3 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx := S.1; y := S.2;[127X[104X
    [4X[28Xx1[128X[104X
    [4X[28Xx2[128X[104X
    [4X[25Xgap>[125X [27XCanonicalForm(x ^ 3 * y ^ 3);[127X[104X
    [4X[28X"x1x1x1x2x2x2x2^-1x2^-1x2^-1x1^-1x1^-1x1^-1x1x1x1x2x2x2"[128X[104X
  [4X[32X[104X
  
  [1X11.3-2 MinimalWord[101X
  
  [29X[2XMinimalWord[102X( [3Xw[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA string.[133X
  
  [33X[0;0YFor  an  element [3Xw[103X of a free inverse semigroup [10XS[110X, [10XMinimalWord[110X returns a word
  of minimal length equal to [3Xw[103X in [10XS[110X as a string.[133X
  
  [33X[0;0YNote that there maybe more than one word of minimal length which is equal to
  [3Xw[103X in [10XS[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := FreeInverseSemigroup(3);[127X[104X
    [4X[28X<free inverse semigroup on the generators [ x1, x2, x3 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx := S.1;[127X[104X
    [4X[28Xx1[128X[104X
    [4X[25Xgap>[125X [27Xy := S.2;[127X[104X
    [4X[28Xx2[128X[104X
    [4X[25Xgap>[125X [27XMinimalWord(x ^ 3 * y ^ 3);[127X[104X
    [4X[28X"x1*x1*x1*x2*x2*x2"[128X[104X
  [4X[32X[104X
  
