  
  [1X19 [33X[0;0YCongruences[133X[101X
  
  [33X[0;0YCongruences in [5XSemigroups[105X can be described in several different ways:[133X
  
  [30X    [33X[0;6YGenerating pairs -- the minimal congruence which contains these pairs[133X
  
  [30X    [33X[0;6YRees congruences -- the congruence specified by a given ideal[133X
  
  [30X    [33X[0;6YUniversal congruences -- the unique congruence with only one class[133X
  
  [30X    [33X[0;6YLinked triples -- only for simple or 0-simple semigroups (see below)[133X
  
  [30X    [33X[0;6YKernel and trace -- only for inverse semigroups[133X
  
  [33X[0;0YThe  operation  [2XSemigroupCongruence[102X  ([14X19.2-1[114X)  can  be used to create any of
  these,  interpreting  the  arguments  in  a  smart  way.  The  usual  way of
  specifying  a  congruence will be by giving a set of generating pairs, but a
  user  with  an  ideal  could  instead  create a Rees congruence or universal
  congruence.[133X
  
  [33X[0;0YIf  a  congruence is specified by generating pairs on a simple, 0-simple, or
  inverse  semigroup,  then  the congruence will be converted automatically to
  one of the last two items in the above list, to reduce the complexity of any
  calculations to be performed. The user need not manually specify, or even be
  aware of, the congruence's linked triple or kernel and trace.[133X
  
  [33X[0;0YWe  can  also  create  left  congruences  and  right  congruences, using the
  [2XLeftSemigroupCongruence[102X   ([14X19.2-2[114X)   and  [2XRightSemigroupCongruence[102X  ([14X19.2-3[114X)
  functions.[133X
  
  [33X[0;0YPlease  note  that  congruence  objects  made  in  [5XGAP[105X  before  loading  the
  [5XSemigroups[105X  package  may not behave correctly after [5XSemigroups[105X is loaded. If
  [5XSemigroups[105X  is  loaded  at  the  beginning  of  the  session,  or before any
  congruence work is done, then the objects should behave correctly.[133X
  
  
  [1X19.1 [33X[0;0YSemigroup congruence objects[133X[101X
  
  [1X19.1-1 IsSemigroupCongruence[101X
  
  [29X[2XIsSemigroupCongruence[102X( [3Xobj[103X ) [32X property
  
  [33X[0;0YA  semigroup  congruence  [10Xcong[110X  is  an equivalence relation on a semigroup [10XS[110X
  which respects left and right multiplication.[133X
  
  [33X[0;0YThat  is, if [22X(a,b)[122X is a pair in [10Xcong[110X, and [22Xx[122X is an element of [10XS[110X, then [22X(ax,bx)[122X
  and [22X(xa,xb)[122X are both in [10Xcong[110X.[133X
  
  [33X[0;0YThe  simplest  way  of  creating  a  congruence in [5XSemigroups[105X is by a set of
  [13Xgenerating pairs[113X. See [2XSemigroupCongruence[102X ([14X19.2-1[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 2, 1, 1, 2, 1 ] ), [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 4, 3, 4, 4 ] ), [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 4, 3, 4, 3 ] ),  [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 4, 3, 3, 4, 4 ] ));;[127X[104X
    [4X[25Xgap>[125X [27Xpair1 := [Transformation( [ 3, 4, 3, 4, 3 ] ),[127X[104X
    [4X[25X>[125X [27X             Transformation( [ 1, 2, 1, 2, 1 ] )];;[127X[104X
    [4X[25Xgap>[125X [27Xpair2 := [Transformation( [ 4, 3, 4, 3, 4 ] ),[127X[104X
    [4X[25X>[125X [27X             Transformation( [ 3, 4, 3, 4, 3 ] )];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(S, [pair1, pair2]);[127X[104X
    [4X[28X<semigroup congruence over <simple transformation semigroup of [128X[104X
    [4X[28X degree 5 with 4 generators> with linked triple (2,4,1)>[128X[104X
    [4X[25Xgap>[125X [27XIsSemigroupCongruence(cong);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.1-2 IsLeftSemigroupCongruence[101X
  
  [29X[2XIsLeftSemigroupCongruence[102X( [3Xobj[103X ) [32X property
  
  [33X[0;0YA left semigroup congruence [10Xcong[110X is an equivalence relation on a semigroup [10XS[110X
  which respects left multiplication.[133X
  
  [33X[0;0YThat  is, if [22X(a,b)[122X is a pair in [10Xcong[110X, and [22Xx[122X is an element of [10XS[110X, then [22X(xa,xb)[122X
  is also in [10Xcong[110X.[133X
  
  [33X[0;0YThe  simplest way of creating a left congruence in [5XSemigroups[105X is by a set of
  [13Xgenerating pairs[113X. See [2XLeftSemigroupCongruence[102X ([14X19.2-2[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 2, 1, 1, 2, 1 ] ), [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 4, 3, 4, 4 ] ), [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 4, 3, 4, 3 ] ),  [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 4, 3, 3, 4, 4 ] ));;[127X[104X
    [4X[25Xgap>[125X [27Xpair1 := [Transformation( [ 3, 4, 3, 4, 3 ] ),[127X[104X
    [4X[25X>[125X [27X             Transformation( [ 1, 2, 1, 2, 1 ] )];;[127X[104X
    [4X[25Xgap>[125X [27Xpair2 := [Transformation( [ 4, 3, 4, 3, 4 ] ),[127X[104X
    [4X[25X>[125X [27X             Transformation( [ 3, 4, 3, 4, 3 ] )];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := LeftSemigroupCongruence(S, [pair1, pair2]);[127X[104X
    [4X[28X<left semigroup congruence over <transformation semigroup of degree 5 [128X[104X
    [4X[28X with 4 generators> with 2 generating pairs>[128X[104X
    [4X[25Xgap>[125X [27XIsLeftSemigroupCongruence(cong);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.1-3 IsRightSemigroupCongruence[101X
  
  [29X[2XIsRightSemigroupCongruence[102X( [3Xobj[103X ) [32X property
  
  [33X[0;0YA  right semigroup congruence [10Xcong[110X is an equivalence relation on a semigroup
  [10XS[110X which respects right multiplication.[133X
  
  [33X[0;0YThat  is, if [22X(a,b)[122X is a pair in [10Xcong[110X, and [22Xx[122X is an element of [10XS[110X, then [22X(ax,bx)[122X
  is also in [10Xcong[110X.[133X
  
  [33X[0;0YThe simplest way of creating a right congruence in [5XSemigroups[105X is by a set of
  [13Xgenerating pairs[113X. See [2XRightSemigroupCongruence[102X ([14X19.2-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 2, 1, 1, 2, 1 ] ), [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 4, 3, 4, 4 ] ), [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 4, 3, 4, 3 ] ),  [127X[104X
    [4X[25X>[125X [27X                Transformation( [ 4, 3, 3, 4, 4 ] ));;[127X[104X
    [4X[25Xgap>[125X [27Xpair1 := [Transformation( [ 3, 4, 3, 4, 3 ] ),[127X[104X
    [4X[25X>[125X [27X             Transformation( [ 1, 2, 1, 2, 1 ] )];;[127X[104X
    [4X[25Xgap>[125X [27Xpair2 := [Transformation( [ 4, 3, 4, 3, 4 ] ),[127X[104X
    [4X[25X>[125X [27X             Transformation( [ 3, 4, 3, 4, 3 ] )];;[127X[104X
    [4X[25Xgap>[125X [27XRightSemigroupCongruence(S, [pair1, pair2]);[127X[104X
    [4X[28X<right semigroup congruence over <transformation semigroup of [128X[104X
    [4X[28X degree 5 with 4 generators> with 2 generating pairs>[128X[104X
    [4X[25Xgap>[125X [27XIsRightSemigroupCongruence(cong);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X19.2 [33X[0;0YCreating congruences[133X[101X
  
  [1X19.2-1 SemigroupCongruence[101X
  
  [29X[2XSemigroupCongruence[102X( [3XS[103X, [3Xpairs[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA semigroup congruence.[133X
  
  [33X[0;0YThis function returns a semigroup congruence over the semigroup [3XS[103X.[133X
  
  [33X[0;0YIf  [3Xpairs[103X  is  a  list  of  lists  of size 2 with elements from [3XS[103X, then this
  function  will  return  the semigroup congruence defined by these generating
  pairs. The individual pairs may instead be given as separate arguments.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup(Transformation([2, 1, 1, 2, 1]), [127X[104X
    [4X[25X>[125X [27X                  Transformation([3, 4, 3, 4, 4]), [127X[104X
    [4X[25X>[125X [27X                  Transformation([3, 4, 3, 4, 3]),  [127X[104X
    [4X[25X>[125X [27X                  Transformation([4, 3, 3, 4, 4]));;[127X[104X
    [4X[25Xgap>[125X [27Xpair1 := [Transformation([3, 4, 3, 4, 3]),[127X[104X
    [4X[25X>[125X [27X             Transformation([1, 2, 1, 2, 1])];;[127X[104X
    [4X[25Xgap>[125X [27Xpair2 := [Transformation([4, 3, 4, 3, 4]),[127X[104X
    [4X[25X>[125X [27X             Transformation([3, 4, 3, 4, 3])];;[127X[104X
    [4X[25Xgap>[125X [27XSemigroupCongruence(S, [pair1, pair2]);[127X[104X
    [4X[28X<semigroup congruence over <simple transformation semigroup of [128X[104X
    [4X[28X degree 5 with 4 generators> with linked triple (2,4,1)>[128X[104X
    [4X[25Xgap>[125X [27XSemigroupCongruence(S, pair1, pair2);[127X[104X
    [4X[28X<semigroup congruence over <simple transformation semigroup of [128X[104X
    [4X[28X degree 5 with 4 generators> with linked triple (2,4,1)>[128X[104X
  [4X[32X[104X
  
  [1X19.2-2 LeftSemigroupCongruence[101X
  
  [29X[2XLeftSemigroupCongruence[102X( [3XS[103X, [3Xpairs[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA left semigroup congruence.[133X
  
  [33X[0;0YThis function returns a left semigroup congruence over the semigroup [3XS[103X.[133X
  
  [33X[0;0YIf  [3Xpairs[103X  is  a  list  of  lists  of size 2 with elements from [3XS[103X, then this
  function will return the least left semigroup congruence on [3XS[103X which contains
  these  generating  pairs.  The  individual  pairs  may  instead  be given as
  separate arguments.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup(Transformation([2, 1, 1, 2, 1]), [127X[104X
    [4X[25X>[125X [27X                  Transformation([3, 4, 3, 4, 4]), [127X[104X
    [4X[25X>[125X [27X                  Transformation([3, 4, 3, 4, 3]),  [127X[104X
    [4X[25X>[125X [27X                  Transformation([4, 3, 3, 4, 4]));;[127X[104X
    [4X[25Xgap>[125X [27Xpair1 := [Transformation([3, 4, 3, 4, 3]),[127X[104X
    [4X[25X>[125X [27X             Transformation([1, 2, 1, 2, 1])];;[127X[104X
    [4X[25Xgap>[125X [27Xpair2 := [Transformation([4, 3, 4, 3, 4]),[127X[104X
    [4X[25X>[125X [27X             Transformation([3, 4, 3, 4, 3])];;[127X[104X
    [4X[25Xgap>[125X [27XLeftSemigroupCongruence(S, [pair1, pair2]);[127X[104X
    [4X[28X<left semigroup congruence over <transformation semigroup of degree 5 [128X[104X
    [4X[28X with 4 generators> with 2 generating pairs>[128X[104X
    [4X[25Xgap>[125X [27XLeftSemigroupCongruence(S, pair1, pair2);[127X[104X
    [4X[28X<left semigroup congruence over <transformation semigroup of degree 5 [128X[104X
    [4X[28X with 4 generators> with 2 generating pairs>[128X[104X
  [4X[32X[104X
  
  [1X19.2-3 RightSemigroupCongruence[101X
  
  [29X[2XRightSemigroupCongruence[102X( [3XS[103X, [3Xpairs[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA right semigroup congruence.[133X
  
  [33X[0;0YThis function returns a right semigroup congruence over the semigroup [3XS[103X.[133X
  
  [33X[0;0YIf  [3Xpairs[103X  is  a  list  of  lists  of size 2 with elements from [3XS[103X, then this
  function  will  return  the  least  right  semigroup  congruence  on [3XS[103X which
  contains  these  generating pairs. The individual pairs may instead be given
  as separate arguments.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup(Transformation([2, 1, 1, 2, 1]), [127X[104X
    [4X[25X>[125X [27X                Transformation([3, 4, 3, 4, 4]), [127X[104X
    [4X[25X>[125X [27X                Transformation([3, 4, 3, 4, 3]),  [127X[104X
    [4X[25X>[125X [27X                Transformation([4, 3, 3, 4, 4]));;[127X[104X
    [4X[25Xgap>[125X [27Xpair1 := [Transformation([3, 4, 3, 4, 3]),[127X[104X
    [4X[25X>[125X [27X             Transformation([1, 2, 1, 2, 1])];;[127X[104X
    [4X[25Xgap>[125X [27Xpair2 := [Transformation([4, 3, 4, 3, 4]),[127X[104X
    [4X[25X>[125X [27X             Transformation([3, 4, 3, 4, 3])];;[127X[104X
    [4X[25Xgap>[125X [27XRightSemigroupCongruence(S, [pair1, pair2]);[127X[104X
    [4X[28X<right semigroup congruence over <transformation semigroup of [128X[104X
    [4X[28X degree 5 with 4 generators> with 2 generating pairs>[128X[104X
    [4X[25Xgap>[125X [27XRightSemigroupCongruence(S, pair1, pair2);[127X[104X
    [4X[28X<right semigroup congruence over <transformation semigroup of [128X[104X
    [4X[28X degree 5 with 4 generators> with 2 generating pairs>[128X[104X
  [4X[32X[104X
  
  
  [1X19.3 [33X[0;0YCongruence classes[133X[101X
  
  [1X19.3-1 IsCongruenceClass[101X
  
  [29X[2XIsCongruenceClass[102X( [3Xobj[103X ) [32X category
  
  [33X[0;0YThis  category  contains  any  object  which  is  an  equivalence class of a
  semigroup  congruence  (see  [2XIsSemigroupCongruence[102X ([14X19.1-1[114X)). An object will
  only  be  in  this  category  if  the  relation  is  known to be a semigroup
  congruence when the congruence class is created.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Monoid([Transformation( [ 1, 2, 2 ] ),[127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 1, 3 ] )]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(S, [Transformation( [ 1, 2, 1 ] ), [127X[104X
    [4X[25X>[125X [27X                                   Transformation( [ 2, 1, 2 ] )]);;[127X[104X
    [4X[25Xgap>[125X [27Xclass := EquivalenceClassOfElement(cong,[127X[104X
    [4X[25X>[125X [27X                                      Transformation([ 3, 1, 1 ] ));[127X[104X
    [4X[28X<congruence class of Transformation( [ 3, 1, 1 ] )>[128X[104X
    [4X[25Xgap>[125X [27XIsCongruenceClass(class);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.3-2 IsLeftCongruenceClass[101X
  
  [29X[2XIsLeftCongruenceClass[102X( [3Xobj[103X ) [32X category
  
  [33X[0;0YThis  category  contains  any object which is an equivalence class of a left
  semigroup  congruence  (see  [2XIsLeftSemigroupCongruence[102X  ([14X19.1-2[114X)). An object
  will  only  be  in  this  category  if  the  relation  is known to be a left
  semigroup congruence when the class is created.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Monoid([Transformation( [ 1, 2, 2 ] ),[127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 1, 3 ] )]);;[127X[104X
    [4X[25Xgap>[125X [27Xpairs := [Transformation( [ 1, 2, 1 ] ), [127X[104X
    [4X[25X>[125X [27X             Transformation( [ 2, 1, 2 ] )];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := LeftSemigroupCongruence(S, pairs);;[127X[104X
    [4X[25Xgap>[125X [27Xclass := EquivalenceClassOfElement(cong,[127X[104X
    [4X[25X>[125X [27X                                      Transformation( [ 3, 1, 1 ] ));[127X[104X
    [4X[28X<left congruence class of Transformation( [ 3, 1, 1 ] )>[128X[104X
    [4X[25Xgap>[125X [27XIsLeftCongruenceClass(class);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.3-3 IsRightCongruenceClass[101X
  
  [29X[2XIsRightCongruenceClass[102X( [3Xobj[103X ) [32X category
  
  [33X[0;0YThis  category  contains any object which is an equivalence class of a right
  semigroup  congruence  (see  [2XIsRightSemigroupCongruence[102X ([14X19.1-3[114X)). An object
  will  only  be  in  this  category  if  the  relation is known to be a right
  semigroup congruence when the class is created.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Monoid([Transformation( [ 1, 2, 2 ] ),[127X[104X
    [4X[25X>[125X [27X                Transformation( [ 3, 1, 3 ] )]);;[127X[104X
    [4X[25Xgap>[125X [27Xpairs := [Transformation( [ 1, 2, 1 ] ),[127X[104X
    [4X[25X>[125X [27X             Transformation( [ 2, 1, 2 ] )];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := RightSemigroupCongruence(S, pairs);;[127X[104X
    [4X[25Xgap>[125X [27Xclass := EquivalenceClassOfElement(cong,[127X[104X
    [4X[25X>[125X [27X                                      Transformation( [ 3, 1, 1 ] ));[127X[104X
    [4X[28X<right congruence class of Transformation( [ 3, 1, 1 ] )>[128X[104X
    [4X[25Xgap>[125X [27XIsRightCongruenceClass(class);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.3-4 CongruenceClassOfElement[101X
  
  [29X[2XCongruenceClassOfElement[102X( [3Xcong[103X, [3Xelm[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA congruence class.[133X
  
  [33X[0;0YThis  operation  is  a synonym of [10XEquivalenceClassOfElement[110X in the case that
  the argument [3Xcong[103X is a congruence of a semigroup.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := CongruencesOfSemigroup(S)[3];;[127X[104X
    [4X[25Xgap>[125X [27Xelm := ReesZeroMatrixSemigroupElement(S, 1, (1,3,2), 1);;[127X[104X
    [4X[25Xgap>[125X [27XCongruenceClassOfElement(cong, elm);[127X[104X
    [4X[28X<congruence class of (1,(1,3,2),1)>[128X[104X
  [4X[32X[104X
  
  [1X19.3-5 CongruenceClasses[101X
  
  [29X[2XCongruenceClasses[102X( [3Xcong[103X ) [32X operation
  [29X[2XLeftCongruenceClasses[102X( [3Xcong[103X ) [32X operation
  [29X[2XRightCongruenceClasses[102X( [3Xcong[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA list of equivalence classes.[133X
  
  [33X[0;0YThese  operations  acts  as a synonym of [10XEquivalenceClasses[110X in the case that
  the  argument  [3Xcong[103X  is  a  congruence, left congruence, or right congruence
  (respectively) of a semigroup.[133X
  
  [33X[0;0YSee [2XIsLeftSemigroupCongruence[102X ([14X19.1-2[114X), [2XIsRightSemigroupCongruence[102X ([14X19.1-3[114X),
  and [2XIsSemigroupCongruence[102X ([14X19.1-1[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := CongruencesOfSemigroup(S)[3];;[127X[104X
    [4X[25Xgap>[125X [27Xelm := ReesZeroMatrixSemigroupElement(S, 1, (1,3,2), 1);;[127X[104X
    [4X[25Xgap>[125X [27XCongruenceClassOfElement(cong, elm);[127X[104X
    [4X[28X<congruence class of (1,(1,3,2),1)>[128X[104X
  [4X[32X[104X
  
  [1X19.3-6 NonTrivialEquivalenceClasses[101X
  
  [29X[2XNonTrivialEquivalenceClasses[102X( [3Xeq[103X ) [32X attribute
  [29X[2XNonTrivialCongruenceClasses[102X( [3Xcong[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA list.[133X
  
  [33X[0;0YIf  [3Xeq[103X is an equivalence relation, then this attribute returns a list of all
  equivalence classes of [3Xeq[103X which contain more than one element.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Monoid([Transformation([1, 2, 2]),[127X[104X
    [4X[25X>[125X [27X                Transformation([3, 1, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(S, [Transformation([1, 2, 1]), [127X[104X
    [4X[25X>[125X [27X                                   Transformation([2, 1, 2])]);;[127X[104X
    [4X[25Xgap>[125X [27XNonTrivialEquivalenceClasses(cong);[127X[104X
    [4X[28X[ <congruence class of Transformation( [ 1, 2, 2 ] )>, [128X[104X
    [4X[28X  <congruence class of Transformation( [ 3, 1, 3 ] )>, [128X[104X
    [4X[28X  <congruence class of Transformation( [ 3, 1, 1 ] )>, [128X[104X
    [4X[28X  <congruence class of Transformation( [ 2, 1, 2 ] )>, [128X[104X
    [4X[28X  <congruence class of Transformation( [ 3, 3, 3 ] )> ][128X[104X
  [4X[32X[104X
  
  [1X19.3-7 NrEquivalenceClasses[101X
  
  [29X[2XNrEquivalenceClasses[102X( [3Xeq[103X ) [32X attribute
  [29X[2XNrCongruenceClasses[102X( [3Xcong[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YIf  [3Xeq[103X  is an equivalence relation, then this attribute describes the number
  of equivalence classes it has.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1,3,2)], [(1,2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := CongruencesOfSemigroup(S)[3];;[127X[104X
    [4X[25Xgap>[125X [27XNrEquivalenceClasses(cong);[127X[104X
    [4X[28X9[128X[104X
  [4X[32X[104X
  
  [1X19.3-8 CongruencesOfSemigroup[101X
  
  [29X[2XCongruencesOfSemigroup[102X( [3XS[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YThe congruences of a semigroup.[133X
  
  [33X[0;0YThis attribute gives a list of the congruences of the semigroup [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1,3,2)],[(1,2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcongs := CongruencesOfSemigroup(S);[127X[104X
    [4X[28X[ <universal semigroup congruence over [128X[104X
    [4X[28X    <Rees 0-matrix semigroup 2x2 over Sym( [ 1 .. 3 ] )>>, [128X[104X
    [4X[28X  <semigroup congruence over <Rees 0-matrix semigroup 2x2 over [128X[104X
    [4X[28X      Sym( [ 1 .. 3 ] )> with linked triple (1,2,2)>, [128X[104X
    [4X[28X  <semigroup congruence over <Rees 0-matrix semigroup 2x2 over [128X[104X
    [4X[28X      Sym( [ 1 .. 3 ] )> with linked triple (3,2,2)>, [128X[104X
    [4X[28X  <semigroup congruence over <Rees 0-matrix semigroup 2x2 over [128X[104X
    [4X[28X      Sym( [ 1 .. 3 ] )> with linked triple (S3,2,2)> ][128X[104X
  [4X[32X[104X
  
  [1X19.3-9 LatticeOfCongruences[101X
  
  [29X[2XLatticeOfCongruences[102X( [3XS[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA list of lists.[133X
  
  [33X[0;0YIf  [3XS[103X  is a semigroup, then this attribute gives a list of lists showing how
  the congruences of [3XS[103X are contained in each other.[133X
  
  [33X[0;0YThe congruence numbered [22Xi[122X is a subcongruence of the congruence numbered [22Xj[122X if
  and only if [22Xi[122X is in the [22Xj[122Xth list.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := OrderEndomorphisms(2);;[127X[104X
    [4X[25Xgap>[125X [27XLatticeOfCongruences(S);[127X[104X
    [4X[28X[ [  ], [ 1, 3 ], [ 1 ] ][128X[104X
  [4X[32X[104X
  
  [1X19.3-10 AsLookupTable[101X
  
  [29X[2XAsLookupTable[102X( [3Xcong[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA list.[133X
  
  [33X[0;0YThis attribute describes the semigroup congruence [3Xcong[103X as a list of positive
  integers with length the size of the semigroup over which [3Xcong[103X is defined.[133X
  
  [33X[0;0YEach position in the list corresponds to an element of the semigroup (in the
  order  defined  by [10XSSortedList[110X) and the integer at that position is a unique
  identifier  for  that  element's  congruence  class  under  [3Xcong[103X. Hence, two
  elements are congruent if and only if they have the same number at their two
  positions in the list.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Monoid(Transformation([1, 2, 2]),[127X[104X
    [4X[25X>[125X [27X               Transformation([3, 1, 3]));;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(S,[127X[104X
    [4X[25X>[125X [27X[Transformation([1, 2, 1]), Transformation([2, 1, 2])]);;[127X[104X
    [4X[25Xgap>[125X [27XAsLookupTable(cong);[127X[104X
    [4X[28X[ 1, 2, 3, 4, 5, 6, 2, 3, 6, 4, 5, 6 ][128X[104X
  [4X[32X[104X
  
  
  [1X19.4 [33X[0;0YComparing congruences[133X[101X
  
  [1X19.4-1 IsSubrelation[101X
  
  [29X[2XIsSubrelation[102X( [3Xcong1[103X, [3Xcong2[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YTrue or false.[133X
  
  [33X[0;0YIf  [3Xcong1[103X  and  [3Xcong2[103X  are  congruences  over  the same semigroup, then this
  operation returns whether [3Xcong2[103X is a refinement of [3Xcong1[103X, i.e. whether every
  pair in [3Xcong2[103X is contained in [3Xcong1[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong1 := CongruencesOfSemigroup(S)[3];;[127X[104X
    [4X[25Xgap>[125X [27Xcong2 := CongruencesOfSemigroup(S)[2];;[127X[104X
    [4X[25Xgap>[125X [27XIsSubrelation(cong1, cong2);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.4-2 IsSuperrelation[101X
  
  [29X[2XIsSuperrelation[102X( [3Xcong1[103X, [3Xcong2[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YTrue or false.[133X
  
  [33X[0;0YIf  [3Xcong1[103X  and  [3Xcong2[103X  are  congruences  over  the same semigroup, then this
  operation returns whether [3Xcong1[103X is a refinement of [3Xcong2[103X, i.e. whether every
  pair in [3Xcong1[103X is contained in [3Xcong2[103X.[133X
  
  [33X[0;0YSee [2XIsSubrelation[102X ([14X19.4-1[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong1 := CongruencesOfSemigroup(S)[3];;[127X[104X
    [4X[25Xgap>[125X [27Xcong2 := CongruencesOfSemigroup(S)[2];;[127X[104X
    [4X[25Xgap>[125X [27XIsSuperrelation(cong1, cong2);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X19.4-3 MeetSemigroupCongruences[101X
  
  [29X[2XMeetSemigroupCongruences[102X( [3Xc1[103X, [3Xc2[103X ) [32X operation
  [29X[2XMeetLeftSemigroupCongruences[102X( [3Xc1[103X, [3Xc2[103X ) [32X operation
  [29X[2XMeetRightSemigroupCongruences[102X( [3Xc1[103X, [3Xc2[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA semigroup congruence.[133X
  
  [33X[0;0YThis  operation  returns the [13Xmeet[113X of the two semigroup congruences [3Xc1[103X and [3Xc2[103X
  -- that is, the largest semigroup congruence contained in both [3Xc1[103X and [3Xc2[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcongs := CongruencesOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27XMeetSemigroupCongruences(congs[2], congs[3]);[127X[104X
    [4X[28X<semigroup congruence over <Rees 0-matrix semigroup 2x2 over [128X[104X
    [4X[28X  Sym( [ 1 .. 3 ] )> with linked triple (1,2,2)>[128X[104X
  [4X[32X[104X
  
  [1X19.4-4 JoinSemigroupCongruences[101X
  
  [29X[2XJoinSemigroupCongruences[102X( [3Xc1[103X, [3Xc2[103X ) [32X operation
  [29X[2XJoinLeftSemigroupCongruences[102X( [3Xc1[103X, [3Xc2[103X ) [32X operation
  [29X[2XJoinRightSemigroupCongruences[102X( [3Xc1[103X, [3Xc2[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA semigroup congruence.[133X
  
  [33X[0;0YThis  operation  returns the [13Xjoin[113X of the two semigroup congruences [3Xc1[103X and [3Xc2[103X
  --  that  is, the smallest semigroup congruence containing all the relations
  in both [3Xc1[103X and [3Xc2[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcongs := CongruencesOfSemigroup(S);;[127X[104X
    [4X[25Xgap>[125X [27XJoinSemigroupCongruences(congs[2], congs[3]);[127X[104X
    [4X[28X<semigroup congruence over <Rees 0-matrix semigroup 2x2 over [128X[104X
    [4X[28X  Sym( [ 1 .. 3 ] )> with linked triple (3,2,2)>[128X[104X
  [4X[32X[104X
  
  
  [1X19.5 [33X[0;0YCongruences on Rees matrix semigroups[133X[101X
  
  [33X[0;0YThis  section  describes  the  implementation  of  congruences of simple and
  0-simple  semigroups in the [5XSemigroups[105X package, and the functions associated
  with  them.  This  code  and this part of the manual were written by Michael
  Torpey.  Most  of  the theorems used in this chapter are from Section 3.5 of
  [How95].[133X
  
  [33X[0;0YBy  the  Rees  Theorem,  any  0-simple  semigroup  [22XS[122X is isomorphic to a [13XRees
  0-matrix  semigroup[113X  (see [14X'Reference: Rees Matrix Semigroups'[114X) over a group,
  with a regular sandwich matrix.[133X
  
  [33X[0;0YThat  is,  [10XS[110X  is isomorphic to [10XM ^ 0[G; I, L; P][110X where [10XG[110X is a group, [10XL[110X and [10XI[110X
  are  non-empty  sets and the matrix [10XP[110X is regular in the sense that it has no
  rows or columns consisting solely of zeroes.[133X
  
  [33X[0;0YThe  congruences of a Rees 0-matrix semigroup are in 1-1 correspondence with
  the [13Xlinked triple[113X, which is a triple of the form [10X[N, S, T][110X where:[133X
  
  [30X    [33X[0;6Y[10XN[110X is a normal subgroup of the underlying group [10XG[110X,[133X
  
  [30X    [33X[0;6Y[10XS[110X is an equivalence relation on the columns of [10XP[110X,[133X
  
  [30X    [33X[0;6Y[10XT[110X is an equivalence relation on the rows of [10XP[110X,[133X
  
  [33X[0;0Ysatisfying the following conditions:[133X
  
  [30X    [33X[0;6Ya  pair of [10XS[110X-related columns must contain zeroes in precisely the same
        rows,[133X
  
  [30X    [33X[0;6Ya  pair  of  [10XT[110X-related  rows must contain zeroes in precisely the same
        columns,[133X
  
  [30X    [33X[0;6Yif [10Xi[110X and [10Xj[110X are [10XS[110X-related, [10Xk[110X and [10Xl[110X are [10XT[110X-related and the matrix entries
        [22Xp_k, i, p_k, j, p_l, i, p_l, j ≠ 0[122X, then [22Xq_k, l, i, j ∈ N[122X, where[133X
  
  
              [33X[1;12Y[24X [33X[0;6Yq_{k, l, i, j} = p_{k, i} p_{l, i} ^ {-1} p_{l, j} p_{k, j} ^
              {-1}.[133X [124X[133X
  
  
  [33X[0;0YBy  Theorem  3.5.9  in  [How95],  for  any  finite  0-simple  Rees  0-matrix
  semigroup,  there  is  a bijection between its non-universal congruences and
  its  linked triples. In this way, we can internally represent any congruence
  of such a semigroup by storing its associated linked triple instead of a set
  of  generating  pairs,  and  thus  perform  many  calculations  on  it  more
  efficiently.[133X
  
  [33X[0;0YIf a congruence is defined by a linked triple [10X(N, S, T)[110X, then a single class
  of  that  congruence can be defined by a triple [10X(Nx, i / S, k / S)[110X, where [10XNx[110X
  is  a  right coset of [10XN[110X, [10Xi / S[110X is the equivalence class of [10Xi[110X in [10XS[110X, and [10Xk / S[110X
  is  the  equivalence  class  of [10Xk[110X in [10XT[110X. Thus we can internally represent any
  class  of  such  a congruence as a triple simply consisting of a right coset
  and two positive integers.[133X
  
  [33X[0;0YAn  analogous  condition  exists  for  finite  simple Rees matrix semigroups
  without zero.[133X
  
  [1X19.5-1 IsRMSCongruenceByLinkedTriple[101X
  
  [29X[2XIsRMSCongruenceByLinkedTriple[102X( [3Xobj[103X ) [32X category
  [29X[2XIsRZMSCongruenceByLinkedTriple[102X( [3Xobj[103X ) [32X category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThese  categories describe a type of semigroup congruence over a Rees matrix
  or 0-matrix semigroup. Externally, an object of this type may be used in the
  same   way  as  any  other  object  in  the  category  [2XIsSemigroupCongruence[102X
  ([14XReference:  IsSemigroupCongruence[114X)  but it is represented internally by its
  [13Xlinked  triple[113X, and certain functions may take advantage of this information
  to reduce computation times.[133X
  
  [33X[0;0YAn  object  of this type may be constructed with [10XRMSCongruenceByLinkedTriple[110X
  or  [10XRZMSCongruenceByLinkedTriple[110X,  or  this  representation  may be selected
  automatically by [2XSemigroupCongruence[102X ([14X19.2-1[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := Group([(1, 4, 5), (1, 5, 3, 4)]);;[127X[104X
    [4X[25Xgap>[125X [27Xmat := [ [  0,  0, (1,4,5),     0,     0, (1,4,3,5) ],[127X[104X
    [4X[25X>[125X [27X            [  0, (),       0,     0, (3,5),         0 ],[127X[104X
    [4X[25X>[125X [27X            [ (),  0,       0, (3,5),     0,         0 ] ];;[127X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(G, mat);;[127X[104X
    [4X[25Xgap>[125X [27XN := Group([ (1,4)(3,5), (1,5)(3,4) ]);;[127X[104X
    [4X[25Xgap>[125X [27XcolBlocks := [[1], [2, 5], [3, 6], [4]];;[127X[104X
    [4X[25Xgap>[125X [27XrowBlocks := [[1], [2], [3]];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := RZMSCongruenceByLinkedTriple(S, N, colBlocks, rowBlocks);;[127X[104X
    [4X[25Xgap>[125X [27XIsRZMSCongruenceByLinkedTriple(cong);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.5-2 RMSCongruenceByLinkedTriple[101X
  
  [29X[2XRMSCongruenceByLinkedTriple[102X( [3XS[103X, [3XN[103X, [3XcolBlocks[103X, [3XrowBlocks[103X ) [32X function
  [29X[2XRZMSCongruenceByLinkedTriple[102X( [3XS[103X, [3XN[103X, [3XcolBlocks[103X, [3XrowBlocks[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA Rees matrix or 0-matrix semigroup congruence by linked triple.[133X
  
  [33X[0;0YThis  function  returns  a  semigroup  congruence  over  the  Rees matrix or
  0-matrix  semigroup  [3XS[103X  corresponding  to  the  linked triple ([3XN[103X, [3XcolBlocks[103X,
  [3XrowBlocks[103X).  The  argument  [3XN[103X  should be a normal subgroup of the underlying
  semigroup of [3XS[103X; [3XcolBlocks[103X should be a partition of the columns of the matrix
  of  [3XS[103X;  and  [3XrowBlocks[103X should be a partition of the rows of the matrix of [3XS[103X.
  For  example,  if  the  matrix  has 5 rows, then a possibility for [3XrowBlocks[103X
  might be [10X[[1, 3], [2, 5], [4]][110X.[133X
  
  [33X[0;0YIf  the arguments describe a valid linked triple on [3XS[103X, then an object in the
  category [10XIsRZMSCongruenceByLinkedTriple[110X is returned. This object can be used
  like any other semigroup congruence in [5XGAP[105X.[133X
  
  [33X[0;0YIf  the  arguments  describe  a  triple  which  is  not  [13Xlinked[113X in the sense
  described above, then this function returns an error.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := Group([(1, 4, 5), (1, 5, 3, 4)]);;[127X[104X
    [4X[25Xgap>[125X [27Xmat := [[  0,  0, (1,4,5),     0,     0, (1,4,3,5)],[127X[104X
    [4X[25X>[125X [27X           [  0, (),       0,     0, (3,5),         0],[127X[104X
    [4X[25X>[125X [27X           [ (),  0,       0, (3,5),     0,         0]];;[127X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(G, mat);;[127X[104X
    [4X[25Xgap>[125X [27XN := Group((1, 4)(3, 5), (1, 5)(3, 4));;[127X[104X
    [4X[25Xgap>[125X [27XcolBlocks := [[1], [2, 5], [3, 6], [4]];;[127X[104X
    [4X[25Xgap>[125X [27XrowBlocks := [[1], [2], [3]];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := RZMSCongruenceByLinkedTriple(S, N, colBlocks, rowBlocks);[127X[104X
    [4X[28X<semigroup congruence over <Rees 0-matrix semigroup 6x3 over [128X[104X
    [4X[28X  Group([ (1,4,5), (1,5,3,4) ])> with linked triple (2^2,4,3)>[128X[104X
  [4X[32X[104X
  
  [1X19.5-3 RMSCongruenceClassByLinkedTriple[101X
  
  [29X[2XRMSCongruenceClassByLinkedTriple[102X( [3Xcong[103X, [3XnCoset[103X, [3XcolClass[103X, [3XrowClass[103X ) [32X operation
  [29X[2XRZMSCongruenceClassByLinkedTriple[102X( [3Xcong[103X, [3XnCoset[103X, [3XcolClass[103X, [3XrowClass[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA  Rees  matrix  or  0-matrix semigroup congruence class by linked
            triple.[133X
  
  [33X[0;0YThis  operation  returns  one  congruence  class  of the congruence [3Xcong[103X, as
  defined by the other three parameters.[133X
  
  [33X[0;0YThe  argument [3Xcong[103X must be a Rees matrix or 0-matrix semigroup congruence by
  linked  triple.  If  the  linked  triple consists of the three parameters [10XN[110X,
  [10XcolBlocks[110X  and  [10XrowBlocks[110X,  then [3XnCoset[103X must be a right coset of [10XN[110X, [3XcolClass[103X
  must  be  a  positive  integer  corresponding  to  a  position  in  the list
  [10XcolBlocks[110X,  and  [3XrowClass[103X  must  be  a  positive  integer corresponding to a
  position in the list [10XrowBlocks[110X.[133X
  
  [33X[0;0YIf   the  arguments  are  valid,  an  [10XIsRMSCongruenceClassByLinkedTriple[110X  or
  [10XIsRZMSCongruenceClassByLinkedTriple[110X  object  is  returned, which can be used
  like any other equivalence class in [5XGAP[105X. Otherwise, an error is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := Group([(1, 4, 5), (1, 5, 3, 4)]);;[127X[104X
    [4X[25Xgap>[125X [27Xmat := [ [  0,  0, (1,4,5),     0,     0, (1,4,3,5) ],[127X[104X
    [4X[25X>[125X [27X            [  0, (),       0,     0, (3,5),         0 ],[127X[104X
    [4X[25X>[125X [27X            [ (),  0,       0, (3,5),     0,         0 ] ];;[127X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(G, mat);;[127X[104X
    [4X[25Xgap>[125X [27Xn := Group([ (1,4)(3,5), (1,5)(3,4) ]);;[127X[104X
    [4X[25Xgap>[125X [27XcolBlocks := [[1], [2, 5], [3, 6], [4]];;[127X[104X
    [4X[25Xgap>[125X [27XrowBlocks := [[1], [2], [3]];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := RZMSCongruenceByLinkedTriple(S, n, colBlocks, rowBlocks);;[127X[104X
    [4X[25Xgap>[125X [27Xclass := RZMSCongruenceClassByLinkedTriple(cong, [127X[104X
    [4X[25X>[125X [27XRightCoset(n, (1, 5)), 2, 3);[127X[104X
    [4X[28X<congruence class of (2,(3,4),3)>[128X[104X
  [4X[32X[104X
  
  [1X19.5-4 IsLinkedTriple[101X
  
  [29X[2XIsLinkedTriple[102X( [3XS[103X, [3XN[103X, [3XcolBlocks[103X, [3XrowBlocks[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  operation  returns  true  if  and only if the arguments ([3XN[103X, [3XcolBlocks[103X,
  [3XrowBlocks[103X) describe a linked triple of the Rees matrix or 0-matrix semigroup
  [3XS[103X, as described above.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := Group([(1,4,5), (1,5,3,4)]);;[127X[104X
    [4X[25Xgap>[125X [27Xmat := [ [  0,  0, (1,4,5),     0,     0, (1,4,3,5) ],[127X[104X
    [4X[25X>[125X [27X            [  0, (),       0,     0, (3,5),         0 ],[127X[104X
    [4X[25X>[125X [27X            [ (),  0,       0, (3,5),     0,         0 ] ];;[127X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(G, mat);;[127X[104X
    [4X[25Xgap>[125X [27XN := Group([ (1,4)(3,5), (1,5)(3,4) ]);;[127X[104X
    [4X[25Xgap>[125X [27XcolBlocks := [[1], [2, 5], [3, 6], [4]];;[127X[104X
    [4X[25Xgap>[125X [27XrowBlocks := [[1], [2], [3]];;[127X[104X
    [4X[25Xgap>[125X [27XIsLinkedTriple(S, N, colBlocks, rowBlocks);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.5-5 CanonicalRepresentative[101X
  
  [29X[2XCanonicalRepresentative[102X( [3Xclass[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA congruence class.[133X
  
  [33X[0;0YThis attribute gives a canonical representative for the semigroup congruence
  class [3Xclass[103X. This representative can be used to identify a class uniquely.[133X
  
  [33X[0;0YAt present this only works for simple and 0-simple semigroups.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := CongruencesOfSemigroup(S)[3];;[127X[104X
    [4X[25Xgap>[125X [27Xclass := CongruenceClasses(cong)[3];;[127X[104X
    [4X[25Xgap>[125X [27XCanonicalRepresentative(class);[127X[104X
    [4X[28X(1,(1,2,3),2)[128X[104X
  [4X[32X[104X
  
  [1X19.5-6 AsSemigroupCongruenceByGeneratingPairs[101X
  
  [29X[2XAsSemigroupCongruenceByGeneratingPairs[102X( [3Xcong[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA semigroup congruence.[133X
  
  [33X[0;0YThis  operation  takes  [3Xcong[103X,  a  semigroup congruence, and returns the same
  congruence  relation,  but  described  by  [5XGAP[105X's  default method of defining
  semigroup congruences: a set of generating pairs for the congruence.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1,3,2)], [(1,2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := CongruencesOfSemigroup(S)[3];;[127X[104X
    [4X[25Xgap>[125X [27XAsSemigroupCongruenceByGeneratingPairs(cong);[127X[104X
    [4X[28X<semigroup congruence over <Rees 0-matrix semigroup 2x2 over [128X[104X
    [4X[28X  Sym( [ 1 .. 3 ] )> with 3 generating pairs>[128X[104X
  [4X[32X[104X
  
  [1X19.5-7 AsRMSCongruenceByLinkedTriple[101X
  
  [29X[2XAsRMSCongruenceByLinkedTriple[102X( [3Xcong[103X ) [32X operation
  [29X[2XAsRZMSCongruenceByLinkedTriple[102X( [3Xcong[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA Rees matrix or 0-matrix semigroup congruence by linked triple.[133X
  
  [33X[0;0YThis  operation  takes  a  semigroup congruence [3Xcong[103X over a finite simple or
  0-simple  Rees 0-matrix semigroup, and returns that congruence relation in a
  new  form:  as  either  a  congruence  by  linked  triple,  or  a  universal
  congruence.[133X
  
  [33X[0;0YIf the congruence is not defined over an appropriate type of semigroup, then
  this function returns an error.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27Xx := ReesZeroMatrixSemigroupElement(S, 1, (1,3,2), 1);;[127X[104X
    [4X[25Xgap>[125X [27Xy := ReesZeroMatrixSemigroupElement(S, 1, (), 1);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruenceByGeneratingPairs(S, [[x, y]]);;[127X[104X
    [4X[25Xgap>[125X [27XAsRZMSCongruenceByLinkedTriple(cong);[127X[104X
    [4X[28X<semigroup congruence over <Rees 0-matrix semigroup 2x2 over [128X[104X
    [4X[28X  Sym( [ 1 .. 3 ] )> with linked triple (3,2,2)>[128X[104X
  [4X[32X[104X
  
  
  [1X19.6 [33X[0;0YCongruences on inverse semigroups[133X[101X
  
  [33X[0;0YThis   section  describes  the  implementation  of  congruences  of  inverse
  semigroups  in  the  [5XSemigroups[105X  package,  and the functions associated with
  them.  This code and this part of the manual were written by Michael Torpey.
  Most of the theorems used in this chapter are from Section 5.3 of [How95].[133X
  
  [33X[0;0YThe  congruences  of an inverse semigroup are in 1-1 correspondence with its
  [13Xcongruence pairs[113X. A congruence pair is a pair [10X(N, t)[110X such that:[133X
  
  [30X    [33X[0;6Y[10XN[110X  is  a  normal  subsemigroup  of  [10XS[110X  --  that  is,  a self-conjugate
        subsemigroup which contains all the idempotents of [10XS[110X,[133X
  
  [30X    [33X[0;6Y[10Xt[110X  is a normal congruence on [10XE[110X, the subsemigroup of all idempotents in
        [10XS[110X  --  that  is, a congruence on [10XE[110X such that if [22X(e, f)[122X is a pair in [10Xt[110X,
        then the pair [22X(a ^ -1 e a, a ^ -1 f a)[122X is also in [10Xt[110X,[133X
  
  [33X[0;0Ysatisfying the following conditions:[133X
  
  [30X    [33X[0;6YIf [22Xae ∈ N[122X and [22X(e, a ^ -1 a) ∈ t[122X, then [22Xa ∈ N[122X,[133X
  
  [30X    [33X[0;6YIf [22Xa ∈ N[122X, then [22X(aa ^ -1 , a ^ -1 a) ∈ t[122X.[133X
  
  [33X[0;0YBy Theorem 5.3.3 in [How95], for any inverse semigroup, there is a bijection
  between  its  congruences  and  its  congruence  pairs.  In this way, we can
  internally  represent  any  congruence  of  such  a semigroup by storing its
  associated  congruence  pair  instead of a set of generating pairs, and thus
  perform many calculations on it more efficiently.[133X
  
  [33X[0;0YIf  we  have a congruence [10XC[110X with congruence pair [10X(N, t)[110X, it turns out that [10XN[110X
  is  its [13Xkernel[113X (that is, the set of all elements congruent to an idempotent)
  and  that [10Xt[110X is its [13Xtrace[113X (that is, the restriction of [10XC[110X to the idempotents).
  Hence,  we  refer  to a congruence stored in this format as a "congruence by
  kernel and trace".[133X
  
  [1X19.6-1 IsInverseSemigroupCongruenceByKernelTrace[101X
  
  [29X[2XIsInverseSemigroupCongruenceByKernelTrace[102X( [3Xcong[103X ) [32X Category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  category  contains  any  inverse  semigroup  congruence  [3Xcong[103X which is
  represented  internally  by  its  kernel  and trace. The [2XSemigroupCongruence[102X
  ([14X19.2-1[114X)  function  will  almost always create an object of this category if
  its first argument [3XS[103X is an inverse semigroup.[133X
  
  [33X[0;0YSee     [How95]     Section    5.3    for    more    details.    See    also
  [2XInverseSemigroupCongruenceByKernelTrace[102X ([14X19.6-2[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xi := InverseSemigroup([[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 2], [2, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 3], [2, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(i,[127X[104X
    [4X[25X>[125X [27X[[PartialPerm([2, 3], [1, 3]),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([2], [1])],[127X[104X
    [4X[25X>[125X [27X [PartialPerm([], []),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([1, 2], [1, 2])]]);[127X[104X
    [4X[28X<semigroup congruence over <inverse partial perm semigroup of rank 3 [128X[104X
    [4X[28X with 2 generators> with congruence pair (19,1)>[128X[104X
    [4X[25Xgap>[125X [27XIsInverseSemigroupCongruenceByKernelTrace(cong);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.6-2 InverseSemigroupCongruenceByKernelTrace[101X
  
  [29X[2XInverseSemigroupCongruenceByKernelTrace[102X( [3XS[103X, [3Xkernel[103X, [3XtraceBlocks[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YAn inverse semigroup congruence by kernel and trace.[133X
  
  [33X[0;0YIf  [3XS[103X is an inverse semigroup, [3Xkernel[103X is a subsemigroup of [3XS[103X, [3XtraceBlocks[103X is
  a  list  of  lists  describing  a  congruence  on  the idempotents of [3XS[103X, and
  [22X([3Xkernel[103X, [3Xtrace[103X)[122X describes a valid congruence pair for [3XS[103X (see [How95] Section
  5.3)  then  this  function  returns the semigroup congruence defined by that
  congruence pair.[133X
  
  [33X[0;0YSee also [2XKernelOfSemigroupCongruence[102X ([14X19.6-4[114X) and [2XTraceOfSemigroupCongruence[102X
  ([14X19.6-5[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := InverseSemigroup([[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 2], [2, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 3], [2, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27Xkernel := InverseSemigroup([[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 3], [1, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([2, 3], [2, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 2], [1, 2]), [127X[104X
    [4X[25X>[125X [27XPartialPerm([1], [3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1], [2])]);;[127X[104X
    [4X[25Xgap>[125X [27Xtrace := [[PartialPerm([2, 3], [2, 3])], [127X[104X
    [4X[25X>[125X [27X             [PartialPerm([1, 2], [1, 2])], [127X[104X
    [4X[25X>[125X [27X             [PartialPerm([1, 3], [1, 3])], [127X[104X
    [4X[25X>[125X [27X             [PartialPerm([3], [3]),[127X[104X
    [4X[25X>[125X [27X              PartialPerm([2], [2]), [127X[104X
    [4X[25X>[125X [27X              PartialPerm([1], [1]),[127X[104X
    [4X[25X>[125X [27X              PartialPerm([], [])]];;[127X[104X
    [4X[25Xgap>[125X [27Xcong := InverseSemigroupCongruenceByKernelTrace(S, kernel, trace);[127X[104X
    [4X[28X<semigroup congruence over <inverse partial perm semigroup of rank 3 [128X[104X
    [4X[28X with 2 generators> with congruence pair (13,4)>[128X[104X
  [4X[32X[104X
  
  [1X19.6-3 AsInverseSemigroupCongruenceByKernelTrace[101X
  
  [29X[2XAsInverseSemigroupCongruenceByKernelTrace[102X( [3Xcong[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YAn inverse semigroup congruence by kernel and trace.[133X
  
  [33X[0;0YIf  [3Xcong[103X  is  a  semigroup  congruence  over an inverse semigroup, then this
  attribute returns an object which describes the same congruence, but with an
  internal representation defined by that congruence's kernel and trace.[133X
  
  [33X[0;0YSee [How95] section 5.3 for more details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xi := InverseSemigroup([[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 2], [2, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 3], [2, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruenceByGeneratingPairs(i,[127X[104X
    [4X[25X>[125X [27X[[PartialPerm([2, 3], [1, 3]),[127X[104X
    [4X[25X>[125X [27X   PartialPerm([2], [1])],[127X[104X
    [4X[25X>[125X [27X [PartialPerm([], []),[127X[104X
    [4X[25X>[125X [27X   PartialPerm([1, 2], [1, 2])]]);[127X[104X
    [4X[28X<semigroup congruence over <inverse partial perm semigroup of rank 3 [128X[104X
    [4X[28X with 2 generators> with 2 generating pairs>[128X[104X
    [4X[25Xgap>[125X [27Xcong2 := AsInverseSemigroupCongruenceByKernelTrace(cong);[127X[104X
    [4X[28X<semigroup congruence over <inverse partial perm semigroup of rank 3 [128X[104X
    [4X[28X with 2 generators> with congruence pair (19,1)>[128X[104X
  [4X[32X[104X
  
  [1X19.6-4 KernelOfSemigroupCongruence[101X
  
  [29X[2XKernelOfSemigroupCongruence[102X( [3Xcong[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YAn inverse semigroup.[133X
  
  [33X[0;0YIf  [3Xcong[103X  is  an inverse semigroup congruence by kernel and trace, then this
  attribute  returns  the  [13Xkernel[113X  of  that  congruence;  that is, the inverse
  subsemigroup  consisting  of all elements which are related to an idempotent
  by [3Xcong[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xi := InverseSemigroup([127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 2], [2, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 3], [2, 3]));;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(i,[127X[104X
    [4X[25X>[125X [27X[[PartialPerm([2, 3], [1, 3]),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([2], [1])],[127X[104X
    [4X[25X>[125X [27X [PartialPerm([], []),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([1, 2], [1, 2])]]);[127X[104X
    [4X[28X<semigroup congruence over <inverse partial perm semigroup of rank 3 [128X[104X
    [4X[28X with 2 generators> with congruence pair (19,1)>[128X[104X
    [4X[25Xgap>[125X [27XKernelOfSemigroupCongruence(cong);[127X[104X
    [4X[28X<inverse partial perm semigroup of size 19, rank 3 with 5 generators>[128X[104X
  [4X[32X[104X
  
  [1X19.6-5 TraceOfSemigroupCongruence[101X
  
  [29X[2XTraceOfSemigroupCongruence[102X( [3Xcong[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA list of lists.[133X
  
  [33X[0;0YIf  [3Xcong[103X  is  an inverse semigroup congruence by kernel and trace, then this
  attribute  returns  the  restriction  of  [3Xcong[103X  to  the  idempotents  of the
  semigroup.  This  is in block form: each idempotent will appear in precisely
  one  list,  and two idempotents will be in the same list if and only if they
  are related by [3Xcong[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xi := InverseSemigroup([127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 2], [2, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 3], [2, 3]));;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(i,[127X[104X
    [4X[25X>[125X [27X[[PartialPerm([2, 3], [1, 3]),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([2], [1])],[127X[104X
    [4X[25X>[125X [27X [PartialPerm([], []),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([1, 2], [1, 2])]]);[127X[104X
    [4X[28X<semigroup congruence over <inverse partial perm semigroup of rank 3 [128X[104X
    [4X[28X with 2 generators> with congruence pair (19,1)>[128X[104X
    [4X[25Xgap>[125X [27XTraceOfSemigroupCongruence(cong);[127X[104X
    [4X[28X[ [ <empty partial perm>, <identity partial perm on [ 1 ]>, [128X[104X
    [4X[28X      <identity partial perm on [ 2 ]>, [128X[104X
    [4X[28X      <identity partial perm on [ 1, 2 ]>, [128X[104X
    [4X[28X      <identity partial perm on [ 3 ]>, [128X[104X
    [4X[28X      <identity partial perm on [ 2, 3 ]>, [128X[104X
    [4X[28X      <identity partial perm on [ 1, 3 ]> ] ][128X[104X
  [4X[32X[104X
  
  [1X19.6-6 IsInverseSemigroupCongruenceClassByKernelTrace[101X
  
  [29X[2XIsInverseSemigroupCongruenceClassByKernelTrace[102X( [3Xobj[103X ) [32X Category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  category  contains  any congruence class which belongs to a congruence
  which   is   represented   internally   by   its   kernel   and  trace.  See
  [2XInverseSemigroupCongruenceByKernelTrace[102X ([14X19.6-2[114X).[133X
  
  [33X[0;0YSee [How95] Section 5.3 for more details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xi := InverseSemigroup([[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 2], [2, 3]),[127X[104X
    [4X[25X>[125X [27XPartialPerm([1, 3], [2, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := SemigroupCongruence(i,[127X[104X
    [4X[25X>[125X [27X[[PartialPerm([2, 3], [1, 3]),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([2], [1])],[127X[104X
    [4X[25X>[125X [27X [PartialPerm([], []),[127X[104X
    [4X[25X>[125X [27X  PartialPerm([1, 2], [1, 2])]]);;[127X[104X
    [4X[25Xgap>[125X [27Xclass := CongruenceClassOfElement(cong,[127X[104X
    [4X[25X>[125X [27X                                     PartialPerm([1, 2], [2, 3]));;[127X[104X
    [4X[25Xgap>[125X [27XIsInverseSemigroupCongruenceClassByKernelTrace(class);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.6-7 MinimumGroupCongruence[101X
  
  [29X[2XMinimumGroupCongruence[102X( [3XS[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YAn inverse semigroup congruence by kernel and trace.[133X
  
  [33X[0;0YIf  [3XS[103X  is  an  inverse  semigroup,  then  this  function  returns  the least
  congruence on [3XS[103X whose quotient is a group.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := InverseSemigroup([127X[104X
    [4X[25X>[125X [27X      [PartialPerm([1,2,5,6], [5,2,1,4]),[127X[104X
    [4X[25X>[125X [27X       PartialPerm([1,2,3,4,5,7], [1,4,6,3,5,2])]);;[127X[104X
    [4X[25Xgap>[125X [27Xcong := MinimumGroupCongruence(S);[127X[104X
    [4X[28X<semigroup congruence over <inverse partial perm semigroup of rank 7 [128X[104X
    [4X[28X with 2 generators> with congruence pair (59,1)>[128X[104X
    [4X[25Xgap>[125X [27XIsGroupAsSemigroup(S / cong);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X19.7 [33X[0;0YRees congruences[133X[101X
  
  [33X[0;0YA  Rees  congruence is defined by a semigroup ideal. It is a congruence on a
  semigroup  [10XS[110X  which has one congruence class equal to a semigroup ideal [10XI[110X of
  [10XS[110X, and every other congruence class being a singleton.[133X
  
  [1X19.7-1 SemigroupIdealOfReesCongruence[101X
  
  [29X[2XSemigroupIdealOfReesCongruence[102X( [3Xcong[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA semigroup ideal.[133X
  
  [33X[0;0YIf   [3Xcong[103X   is   a   rees   congruence   (see  [2XIsReesCongruence[102X  ([14XReference:
  IsReesCongruence[114X))  then this attribute returns the two-sided ideal that was
  used  to  define  it,  i.e.~the  ideal  of  elements in the only non-trivial
  congruence class of [3Xcong[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([[127X[104X
    [4X[25X>[125X [27XTransformation([2, 3, 4, 3, 1, 1]),[127X[104X
    [4X[25X>[125X [27XTransformation([6, 4, 4, 4, 6, 1])]);;[127X[104X
    [4X[25Xgap>[125X [27XI := SemigroupIdeal(S,[127X[104X
    [4X[25X>[125X [27XTransformation([4, 4, 4, 4, 4, 2]),[127X[104X
    [4X[25X>[125X [27XTransformation([3, 3, 3, 3, 3, 2]));;[127X[104X
    [4X[25Xgap>[125X [27Xcong := ReesCongruenceOfSemigroupIdeal(I);;[127X[104X
    [4X[25Xgap>[125X [27XSemigroupIdealOfReesCongruence(cong);[127X[104X
    [4X[28X<non-regular transformation semigroup ideal of degree 6 with[128X[104X
    [4X[28X  2 generators>[128X[104X
  [4X[32X[104X
  
  [1X19.7-2 IsReesCongruenceClass[101X
  
  [29X[2XIsReesCongruenceClass[102X( [3Xobj[103X ) [32X category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  category  describes  a  congruence  class  of  a  Rees  congruence.  A
  congruence class of a Rees congruence either contains all the elements of an
  ideal,    or    is    a    singleton   (see   [2XIsReesCongruence[102X   ([14XReference:
  IsReesCongruence[114X)).[133X
  
  [33X[0;0YAn  object  of this type may be used in the same way as any other congruence
  class object.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([127X[104X
    [4X[25X>[125X [27XTransformation([2, 3, 4, 3, 1, 1]),[127X[104X
    [4X[25X>[125X [27XTransformation([6, 4, 4, 4, 6, 1]));;[127X[104X
    [4X[25Xgap>[125X [27XI := SemigroupIdeal(S,[127X[104X
    [4X[25X>[125X [27XTransformation([4, 4, 4, 4, 4, 2]),[127X[104X
    [4X[25X>[125X [27XTransformation([3, 3, 3, 3, 3, 2]));;[127X[104X
    [4X[25Xgap>[125X [27Xcong := ReesCongruenceOfSemigroupIdeal(I);;[127X[104X
    [4X[25Xgap>[125X [27Xclasses := CongruenceClasses(cong);;[127X[104X
    [4X[25Xgap>[125X [27XIsReesCongruenceClass(classes[1]);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X19.8 [33X[0;0YUniversal congruences[133X[101X
  
  [33X[0;0YThe linked triples of a completely 0-simple Rees 0-matrix semigroup describe
  only its non-universal congruences. In any one of these, the zero element of
  the  semigroup  is  related only to itself. However, for any semigroup [22XS[122X the
  universal  relation  [22XS  xS[122X is a congruence; called the [13Xuniversal congruence[113X.
  The universal congruence on a semigroup has its own unique representation.[133X
  
  [33X[0;0YSince  many things we want to calculate about congruences are trivial in the
  case   of  the  universal  congruence,  this  package  contains  a  category
  specifically designed for it, [10XIsUniversalSemigroupCongruence[110X. We also define
  [10XIsUniversalSemigroupCongruenceClass[110X,  which represents the single congruence
  class of the universal congruence.[133X
  
  [1X19.8-1 IsUniversalSemigroupCongruence[101X
  
  [29X[2XIsUniversalSemigroupCongruence[102X( [3Xobj[103X ) [32X category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  category describes a type of semigroup congruence, which must refer to
  the [13Xuniversal semigroup congruence[113X [22XS × S[122X. Externally, an object of this type
  may  be  used  in  the  same  way  as  any  other  object  in  the  category
  [2XIsSemigroupCongruence[102X ([14XReference: IsSemigroupCongruence[114X).[133X
  
  [33X[0;0YAn  object of this type may be constructed with [10XUniversalSemigroupCongruence[110X
  or this representation may be selected automatically as an alternative to an
  [10XIsRZMSCongruenceByLinkedTriple[110X object (since the universal congruence cannot
  be represented by a linked triple).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([Transformation([3, 2, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27XU := UniversalSemigroupCongruence(S);;[127X[104X
    [4X[25Xgap>[125X [27XIsUniversalSemigroupCongruence(U);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.8-2 IsUniversalSemigroupCongruenceClass[101X
  
  [29X[2XIsUniversalSemigroupCongruenceClass[102X( [3Xobj[103X ) [32X category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  category  describes a class of the universal semigroup congruence (see
  [2XIsUniversalSemigroupCongruence[102X  ([14X19.8-1[114X)).  A universal semigroup congruence
  by  definition has precisely one congruence class, which contains all of the
  elements of the semigroup in question.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([Transformation([3, 2, 3])]);;[127X[104X
    [4X[25Xgap>[125X [27XU := UniversalSemigroupCongruence(S);;[127X[104X
    [4X[25Xgap>[125X [27Xclasses := CongruenceClasses(U);;[127X[104X
    [4X[25Xgap>[125X [27XIsUniversalSemigroupCongruenceClass(classes[1]);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X19.8-3 UniversalSemigroupCongruence[101X
  
  [29X[2XUniversalSemigroupCongruence[102X( [3XS[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA universal semigroup congruence.[133X
  
  [33X[0;0YThis  operation returns the universal semigroup congruence for the semigroup
  [3XS[103X. It can be used in the same way as any other semigroup congruence object.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := ReesZeroMatrixSemigroup(SymmetricGroup(3), [127X[104X
    [4X[25X>[125X [27X[[(), (1, 3, 2)], [(1, 2), 0]]);;[127X[104X
    [4X[25Xgap>[125X [27XUniversalSemigroupCongruence(S);[127X[104X
    [4X[28X<universal semigroup congruence over [128X[104X
    [4X[28X<Rees 0-matrix semigroup 2x2 over Sym( [ 1 .. 3 ] )>>[128X[104X
  [4X[32X[104X
  
