  
  [1X4 [33X[0;0YPartitioned binary relations (PBRs)[133X[101X
  
  [33X[0;0YIn  this  chapter  we  describe the functions in [5XSemigroups[105X for creating and
  manipulating  partitioned  binary relations, henceforth referred to by their
  acronym PBRs. We begin by describing what these objects are.[133X
  
  [33X[0;0YPBRs  were  introduced in the paper [MM13] as, roughly speaking, the maximum
  generalization    of    bipartitions    and   related   objects.   Although,
  mathematically,  bipartitions  are  a  special  type  of  PBR, in [5XSemigroups[105X
  bipartitions  and  PBRs  are  currently  distinct  types  of  objects. It is
  possible  to change the representation from bipartition to PBR, and from PBR
  to  bipartition,  when  appropriate;  see  Section [14X4.3[114X for more details. The
  reason  for this distinct is largely historical, bipartition appeared in the
  literature, and in the [5XSemigroups[105X package, before PBRs.[133X
  
  
  [1X4.1 [33X[0;0YThe family and categories of PBRs[133X[101X
  
  [1X4.1-1 IsPBR[101X
  
  [33X[1;0Y[29X[2XIsPBR[102X( [3Xobj[103X ) [32X Category[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YEvery  PBR  in  [5XGAP[105X belongs to the category [10XIsPBR[110X. Basic operations for PBRs
  are  [2XDegreeOfPBR[102X  ([14X4.5-2[114X), [2XExtRepOfObj[102X ([14X4.5-3[114X), [2XPBRNumber[102X ([14X4.5-4[114X), [2XNumberPBR[102X
  ([14X4.5-4[114X),  [2XStarOp[102X  ([14X4.5-1[114X), and multiplication of two PBRs of equal degree is
  via [9X*[109X.[133X
  
  [1X4.1-2 IsPBRCollection[101X
  
  [33X[1;0Y[29X[2XIsPBRCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsPBRCollColl[102X( [3Xobj[103X ) [32X Category[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YEvery  collection  of  PBRs  belongs  to  the  category [10XIsPBRCollection[110X. For
  example, PBR semigroups belong to [10XIsPBRCollection[110X.[133X
  
  [33X[0;0YEvery  collection  of  collections  of  PBRs  belongs  to [10XIsPBRCollColl[110X. For
  example, a list of PBR semigroups belongs to [10XIsPBRCollColl[110X.[133X
  
  
  [1X4.2 [33X[0;0YCreating PBRs[133X[101X
  
  [33X[0;0YThere  are several ways of creating PBRs in [5XGAP[105X, which are described in this
  section.[133X
  
  [1X4.2-1 PBR[101X
  
  [33X[1;0Y[29X[2XPBR[102X( [3Xleft[103X, [3Xright[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA PBR.[133X
  
  [33X[0;0YThe  arguments  [3Xleft[103X  and  [3Xright[103X  of  this function should each be a list of
  length [10Xn[110X whose entries are lists of integers in the ranges [10X[-n .. -1][110X and [10X[1
  .. n][110X for some [10Xn[110X greater than 0.[133X
  
  [33X[0;0YGiven such an argument, [10XPBR[110X returns the PBR [10Xx[110X where:[133X
  
  [30X    [33X[0;6Yfor each [10Xi[110X in the range [10X[1 .. n][110X there is an edge from [10Xi[110X to every [10Xj[110X in
        [3Xleft[i][103X;[133X
  
  [30X    [33X[0;6Yfor  each [10Xi[110X in the range [10X[-n .. -1][110X there is an edge from [10Xi[110X to every [10Xj[110X
        in [3Xright[-i][103X;[133X
  
  [33X[0;0Y[10XPBR[110X returns an error if the argument does not define a PBR.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XPBR([[-3, -2, -1, 2, 3], [-1], [-3, -2, 1, 2]],[127X[104X
    [4X[25X>[125X [27X       [[-2, -1, 1, 2, 3], [3], [-3, -2, -1, 1, 3]]);[127X[104X
    [4X[28XPBR([ [ -3, -2, -1, 2, 3 ], [ -1 ], [ -3, -2, 1, 2 ] ],[128X[104X
    [4X[28X  [ [ -2, -1, 1, 2, 3 ], [ 3 ], [ -3, -2, -1, 1, 3 ] ])[128X[104X
  [4X[32X[104X
  
  [1X4.2-2 RandomPBR[101X
  
  [33X[1;0Y[29X[2XRandomPBR[102X( [3Xn[103X[, [3Xp[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA PBR.[133X
  
  [33X[0;0YIf [3Xn[103X is a positive integer and [3Xp[103X is an float between [10X0[110X and [10X1[110X, then [10XRandomPBR[110X
  returns  a  random  PBR  of degree [3Xn[103X where the probability of there being an
  edge from [10Xi[110X to [10Xj[110X is approximately [10Xp[110X.[133X
  
  [33X[0;0YIf  the  optional  second  argument is not present, then a random value [3Xp[103X is
  used (chosen with uniform probability).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRandomPBR(6);[127X[104X
    [4X[28XPBR([128X[104X
    [4X[28X  [ [ -5, 1, 2, 3 ], [ -6, -3, -1, 2, 5 ], [ -5, -2, 2, 3, 5 ],[128X[104X
    [4X[28X      [ -6, -4, -1, 2, 3, 6 ], [ -4, -1, 2, 4 ],[128X[104X
    [4X[28X      [ -5, -3, -1, 1, 2, 3, 5 ] ],[128X[104X
    [4X[28X  [ [ -6, -4, -2, 1, 3, 5, 6 ], [ -5, -2, 1, 2, 3, 5 ],[128X[104X
    [4X[28X      [ -6, -5, -2, 1, 5 ], [ -6, -5, -3, -2, 1, 3, 4 ],[128X[104X
    [4X[28X      [ -6, -5, -4, -2, 3, 5 ], [ -6, -4, -2, -1, 1, 2, 6 ] ])[128X[104X
  [4X[32X[104X
  
  [1X4.2-3 EmptyPBR[101X
  
  [33X[1;0Y[29X[2XEmptyPBR[102X( [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA PBR.[133X
  
  [33X[0;0YIf  [3Xn[103X  is a positive integer, then [10XEmptyPBR[110X returns the PBR of degree [3Xn[103X with
  no edges.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := EmptyPBR(3);[127X[104X
    [4X[28XPBR([ [  ], [  ], [  ] ], [ [  ], [  ], [  ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsEmptyPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X4.2-4 IdentityPBR[101X
  
  [33X[1;0Y[29X[2XIdentityPBR[102X( [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA PBR.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  positive integer, then [10XIdentityPBR[110X returns the identity PBR of
  degree  [3Xn[103X.  This PBR has [10X2[110X[3Xn[103X edges: specifically, for each [10Xi[110X in the ranges [10X[1
  .. n][110X and [10X[-n .. -1][110X, the identity PBR has an edge from [10Xi[110X to [10X-i[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := IdentityPBR(3);[127X[104X
    [4X[28XPBR([ [ -1 ], [ -2 ], [ -3 ] ], [ [ 1 ], [ 2 ], [ 3 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsIdentityPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X4.2-5 UniversalPBR[101X
  
  [33X[1;0Y[29X[2XUniversalPBR[102X( [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA PBR.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a positive integer, then [10XUniversalPBR[110X returns the PBR of degree [3Xn[103X
  with [10X4 * n ^ 2[110X edges, i.e. every possible edge.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := UniversalPBR(2);[127X[104X
    [4X[28XPBR([ [ -2, -1, 1, 2 ], [ -2, -1, 1, 2 ] ],[128X[104X
    [4X[28X  [ [ -2, -1, 1, 2 ], [ -2, -1, 1, 2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsUniversalPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X4.3 [33X[0;0YChanging the representation of a PBR[133X[101X
  
  [33X[0;0YIt  is  possible that a PBR can be represented as another type of object, or
  that  another  type  of  [5XGAP[105X  object  can  be  represented as a PBR. In this
  section,  we  describe  the functions in the [5XSemigroups[105X package for changing
  the  representation  of  PBR,  or for changing the representation of another
  type of object to that of a PBR.[133X
  
  [33X[0;0YThe     operations    [2XAsPermutation[102X    ([14X4.3-4[114X),    [2XAsPartialPerm[102X    ([14X4.3-3[114X),
  [2XAsTransformation[102X ([14X4.3-2[114X), [2XAsBipartition[102X ([14X3.3-1[114X), [2XAsBooleanMat[102X ([14X5.3-2[114X) can be
  used    to   convert   PBRs   into   permutations,   partial   permutations,
  transformations, bipartitions, and boolean matrices where appropriate.[133X
  
  [1X4.3-1 AsPBR[101X
  
  [33X[1;0Y[29X[2XAsPBR[102X( [3Xx[103X[, [3Xn[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA PBR.[133X
  
  [33X[0;0Y[10XAsPBR[110X  returns  the  boolean  matrix,  bipartition,  transformation, partial
  permutation, or permutation [3Xx[103X as a PBR of degree [3Xn[103X.[133X
  
  [33X[0;0YThere are several possible arguments for [10XAsPBR[110X:[133X
  
  [8Xbipartitions[108X
        [33X[0;6YIf  [3Xx[103X is a bipartition and [3Xn[103X is a positive integer, then [10XAsPBR[110X returns
        a  PBR corresponding to [3Xx[103X with degree [3Xn[103X. The resulting PBR has an edge
        from [10Xi[110X to [10Xj[110X whenever [10Xi[110X and [10Xj[110X belong to the same block of [3Xx[103X.[133X
  
        [33X[0;6YIf the optional second argument [3Xn[103X is not specified, then degree of the
        bipartition [3Xx[103X is used by default.[133X
  
  [8Xboolean matrices[108X
        [33X[0;6YIf  [3Xx[103X  is a boolean matrix of even dimension [10X2 * m[110X and [3Xn[103X is a positive
        integer, then [10XAsPBR[110X returns a PBR corresponding to [3Xx[103X with degree [3Xn[103X. If
        the optional second argument [3Xn[103X is not specified, then dimension of the
        boolean matrix [3Xx[103X is used by default.[133X
  
  [8Xtransformations, partial perms, permutations[108X
        [33X[0;6YIf  [3Xx[103X  is  a  transformation,  partial perm, or permutation and [3Xn[103X is a
        positive  integer,  then [10XAsPBR[110X is a synonym for [10XAsPBR(AsBipartition([3Xx[103X[10X,
        [3Xn[103X[10X))[110X. If the optional second argument [3Xn[103X is not specified, then [10XAsPBR[110X is
        a  synonym  for [10XAsPBR(AsBipartition([3Xx[103X[10X))[110X. See [2XAsBipartition[102X ([14X3.3-1[114X) for
        more details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, -1], [3, -2], [4, -3, -4]]);[127X[104X
    [4X[28X<block bijection: [ 1, 2, -1 ], [ 3, -2 ], [ 4, -3, -4 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x, 2);[127X[104X
    [4X[28XPBR([ [ -1, 1, 2 ], [ -1, 1, 2 ] ], [ [ -1, 1, 2 ], [ -2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x, 5);[127X[104X
    [4X[28XPBR([ [ -1, 1, 2 ], [ -1, 1, 2 ], [ -2, 3 ], [ -4, -3, 4 ], [  ] ],[128X[104X
    [4X[28X  [ [ -1, 1, 2 ], [ -2, 3 ], [ -4, -3, 4 ], [ -4, -3, 4 ], [  ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x);[127X[104X
    [4X[28XPBR([ [ -1, 1, 2 ], [ -1, 1, 2 ], [ -2, 3 ], [ -4, -3, 4 ] ],[128X[104X
    [4X[28X  [ [ -1, 1, 2 ], [ -2, 3 ], [ -4, -3, 4 ], [ -4, -3, 4 ] ])[128X[104X
    [4X[25Xgap>[125X [27Xmat := Matrix(IsBooleanMat, [[1, 0, 0, 1],[127X[104X
    [4X[25X>[125X [27X                                [0, 1, 1, 0],[127X[104X
    [4X[25X>[125X [27X                                [1, 0, 1, 1],[127X[104X
    [4X[25X>[125X [27X                                [0, 0, 0, 1]]);;[127X[104X
    [4X[25Xgap>[125X [27XAsPBR(mat);[127X[104X
    [4X[28XPBR([ [ -2, 1 ], [ -1, 2 ] ], [ [ -2, -1, 1 ], [ -2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(mat, 2);[127X[104X
    [4X[28XPBR([ [ 1 ] ], [ [ -1 ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(mat, 6);[127X[104X
    [4X[28XPBR([ [ -2, 1 ], [ -1, 2 ], [  ] ], [ [ -2, -1, 1 ], [ -2 ], [  ] ])[128X[104X
    [4X[25Xgap>[125X [27Xx := Transformation([2, 2, 1]);;[127X[104X
    [4X[25Xgap>[125X [27XAsPBR(x);[127X[104X
    [4X[28XPBR([ [ -2 ], [ -2 ], [ -1 ] ], [ [ 3 ], [ 1, 2 ], [  ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x, 2);[127X[104X
    [4X[28XPBR([ [ -2 ], [ -2 ] ], [ [  ], [ 1, 2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x, 4);[127X[104X
    [4X[28XPBR([ [ -2 ], [ -2 ], [ -1 ], [ -4 ] ],[128X[104X
    [4X[28X  [ [ 3 ], [ 1, 2 ], [  ], [ 4 ] ])[128X[104X
    [4X[25Xgap>[125X [27Xx := PartialPerm([4, 3]);[127X[104X
    [4X[28X[1,4][2,3][128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x);[127X[104X
    [4X[28XPBR([ [ -4 ], [ -3 ], [  ], [  ] ], [ [  ], [  ], [ 2 ], [ 1 ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x, 2);[127X[104X
    [4X[28XPBR([ [  ], [  ] ], [ [  ], [  ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x, 5);[127X[104X
    [4X[28XPBR([ [ -4 ], [ -3 ], [  ], [  ], [  ] ],[128X[104X
    [4X[28X  [ [  ], [  ], [ 2 ], [ 1 ], [  ] ])[128X[104X
    [4X[25Xgap>[125X [27Xx := (1, 3)(2, 4);[127X[104X
    [4X[28X(1,3)(2,4)[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x);[127X[104X
    [4X[28XPBR([ [ -3, 1 ], [ -4, 2 ], [ -1, 3 ], [ -2, 4 ] ],[128X[104X
    [4X[28X  [ [ -1, 3 ], [ -2, 4 ], [ -3, 1 ], [ -4, 2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x, 5);[127X[104X
    [4X[28XPBR([ [ -3, 1 ], [ -4, 2 ], [ -1, 3 ], [ -2, 4 ], [ -5, 5 ] ],[128X[104X
    [4X[28X  [ [ -1, 3 ], [ -2, 4 ], [ -3, 1 ], [ -4, 2 ], [ -5, 5 ] ])[128X[104X
  [4X[32X[104X
  
  [1X4.3-2 AsTransformation[101X
  
  [33X[1;0Y[29X[2XAsTransformation[102X( [3Xx[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA transformation.[133X
  
  [33X[0;0YWhen  the  argument  [3Xx[103X is a PBR which satisfies [2XIsTransformationPBR[102X ([14X4.5-9[114X),
  then this attribute returns that transformation.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-3], [-3], [-2]], [[], [3], [1, 2]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsTransformationPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XAsTransformation(x);[127X[104X
    [4X[28XTransformation( [ 3, 3, 2 ] )[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[1], [1, 2]], [[-2, -1], [-2, -1]]);;[127X[104X
    [4X[25Xgap>[125X [27XAsTransformation(x);[127X[104X
    [4X[28XError, the argument (a pbr) does not define a transformation[128X[104X
  [4X[32X[104X
  
  [1X4.3-3 AsPartialPerm[101X
  
  [33X[1;0Y[29X[2XAsPartialPerm[102X( [3Xx[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA partial perm.[133X
  
  [33X[0;0YWhen the argument [3Xx[103X is a PBR which satisfies [2XIsPartialPermPBR[102X ([14X4.5-11[114X), then
  this function returns that partial perm.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-1, 1], [-3, 2], [-4, 3], [4], [5]],[127X[104X
    [4X[25X>[125X [27X            [[-1, 1], [-2], [-3, 2], [-4, 3], [-5]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPartialPermPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XAsPartialPerm(x);[127X[104X
    [4X[28X[2,3,4](1)[128X[104X
  [4X[32X[104X
  
  [1X4.3-4 AsPermutation[101X
  
  [33X[1;0Y[29X[2XAsPermutation[102X( [3Xx[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA permutation.[133X
  
  [33X[0;0YWhen  the  argument [3Xx[103X is a PBR which satisfies [2XIsPermPBR[102X ([14X4.5-12[114X), then this
  attribute returns that permutation.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-1, 1], [-4, 2], [-2, 3], [-3, 4]],[127X[104X
    [4X[25X>[125X [27X            [[-1, 1], [-2, 3], [-3, 4], [-4, 2]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPermPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XAsPermutation(x);[127X[104X
    [4X[28X(2,4,3)[128X[104X
  [4X[32X[104X
  
  
  [1X4.4 [33X[0;0YOperators for PBRs[133X[101X
  
  [8X[10X[3Xx[103X[8X[10X * [3Xy[103X[8X[10X[110X[8X[108X
        [33X[0;6Yreturns the product of [3Xx[103X and [3Xy[103X when [3Xx[103X and [3Xy[103X are PBRs.[133X
  
  [8X[10X[3Xx[103X[8X[10X < [3Xy[103X[8X[10X[110X[8X[108X
        [33X[0;6Yreturns  [9Xtrue[109X  if the degree of [3Xx[103X is less than the degree of [3Xy[103X, or the
        degrees  are  equal  and the out-neighbours of [3Xx[103X (as a list of list of
        positive  integers)  is lexicographically less than the out-neighbours
        of [3Xy[103X.[133X
  
  [8X[10X[3Xx[103X[8X[10X = [3Xy[103X[8X[10X[110X[8X[108X
        [33X[0;6Yreturns  [9Xtrue[109X  if  the  PBR [3Xx[103X equals the PBR [3Xy[103X and returns [9Xfalse[109X if it
        does not.[133X
  
  
  [1X4.5 [33X[0;0YAttributes for PBRs[133X[101X
  
  [33X[0;0YIn this section we describe various attributes that a PBR can possess.[133X
  
  [1X4.5-1 StarOp[101X
  
  [33X[1;0Y[29X[2XStarOp[102X( [3Xx[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XStar[102X( [3Xx[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA PBR.[133X
  
  [33X[0;0Y[10XStarOp[110X  returns  the  unique  PBR  [10Xy[110X obtained by exchanging the positive and
  negative  numbers  in  [3Xx[103X  (i.e.  multiplying  [2XExtRepOfObj[102X  ([14X4.5-3[114X) by [10X-1[110X and
  swapping its first and second components).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[], [-1], []], [[-3, -2, 2, 3], [-2, 1], []]);;[127X[104X
    [4X[25Xgap>[125X [27XStar(x);[127X[104X
    [4X[28XPBR([ [ -3, -2, 2, 3 ], [ -1, 2 ], [  ] ], [ [  ], [ 1 ], [  ] ])[128X[104X
  [4X[32X[104X
  
  [1X4.5-2 DegreeOfPBR[101X
  
  [33X[1;0Y[29X[2XDegreeOfPBR[102X( [3Xx[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XDegreeOfPBRCollection[102X( [3Xx[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThe  degree  of a PBR is, roughly speaking, the number of points where it is
  defined.  More  precisely,  if  [3Xx[103X is a PBR defined on [10X2 * n[110X points, then the
  degree of [3Xx[103X is [10Xn[110X.[133X
  
  [33X[0;0YThe  degree  of a collection [3Xcoll[103X of PBRs of equal degree is just the degree
  of  any (and every) PBR in [3Xcoll[103X. The degree of collection of PBRs of unequal
  degrees is not defined.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2], [-2, -1, 2, 3], [-1, 1, 2, 3]],[127X[104X
    [4X[25X>[125X [27X            [[-1, 1], [2, 3], [-3, 2, 3]]);[127X[104X
    [4X[28XPBR([ [ -2 ], [ -2, -1, 2, 3 ], [ -1, 1, 2, 3 ] ],[128X[104X
    [4X[28X  [ [ -1, 1 ], [ 2, 3 ], [ -3, 2, 3 ] ])[128X[104X
    [4X[25Xgap>[125X [27XDegreeOfPBR(x);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XS := FullPBRMonoid(2);[127X[104X
    [4X[28X<pbr monoid of degree 2 with 10 generators>[128X[104X
    [4X[25Xgap>[125X [27XDegreeOfPBRCollection(S);[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  [1X4.5-3 ExtRepOfObj[101X
  
  [33X[1;0Y[29X[2XExtRepOfObj[102X( [3Xx[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA pair of lists of lists of integers.[133X
  
  [33X[0;0YIf  [10Xn[110X  is  the  degree  of  the PBR [3Xx[103X, then [10XExtRepOfObj[110X returns the argument
  required by [2XPBR[102X ([14X4.2-1[114X) to create a PBR equal to [3Xx[103X, i.e. [10XPBR(ExtRepOfObj([3Xx[103X[10X))[110X
  returns a PBR equal to [3Xx[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-1, 1], [-2, 2]],[127X[104X
    [4X[25X>[125X [27X            [[-2, -1, 1], [-1, 1, 2]]);[127X[104X
    [4X[28XPBR([ [ -1, 1 ], [ -2, 2 ] ], [ [ -2, -1, 1 ], [ -1, 1, 2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XExtRepOfObj(x);[127X[104X
    [4X[28X[ [ [ -1, 1 ], [ -2, 2 ] ], [ [ -2, -1, 1 ], [ -1, 1, 2 ] ] ][128X[104X
  [4X[32X[104X
  
  [1X4.5-4 PBRNumber[101X
  
  [33X[1;0Y[29X[2XPBRNumber[102X( [3Xm[103X, [3Xn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XNumberPBR[102X( [3Xmat[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA PBR, or a positive integer.[133X
  
  [33X[0;0YThese  functions  implement a bijection from the set of all PBRs of degree [3Xn[103X
  and the numbers [10X[1 .. 2 ^ (4 * [3Xn[103X[10X ^ 2)][110X.[133X
  
  [33X[0;0YMore  precisely, if [3Xm[103X and [3Xn[103X are positive integers such that [3Xm[103X is at most [10X2 ^
  (4 * [3Xn[103X[10X ^ 2)[110X, then [10XPBRNumber[110X returns the [3Xm[103Xth PBR of degree [3Xn[103X.[133X
  
  [33X[0;0YIf  [3Xmat[103X is a PBR of degree [3Xn[103X, then [10XNumberPBR[110X returns the number in [10X[1 .. 2 ^
  (4 * [3Xn[103X[10X ^ 2)][110X that corresponds to [3Xmat[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := FullPBRMonoid(1);[127X[104X
    [4X[28X<pbr monoid of degree 1 with 4 generators>[128X[104X
    [4X[25Xgap>[125X [27XList(S, NumberPBR);[127X[104X
    [4X[28X[ 3, 15, 5, 7, 8, 1, 4, 11, 13, 16, 6, 2, 9, 12, 14, 10 ][128X[104X
  [4X[32X[104X
  
  [1X4.5-5 IsEmptyPBR[101X
  
  [33X[1;0Y[29X[2XIsEmptyPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA  PBR  is [12Xempty[112X if it has no edges. [10XIsEmptyPBR[110X returns [9Xtrue[109X if the PBR [3Xx[103X is
  empty and [9Xfalse[109X if it is not.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[]], [[]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsEmptyPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2, 1], [2]], [[-1], [-2, 1]]);[127X[104X
    [4X[28XPBR([ [ -2, 1 ], [ 2 ] ], [ [ -1 ], [ -2, 1 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsEmptyPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X4.5-6 IsIdentityPBR[101X
  
  [33X[1;0Y[29X[2XIsIdentityPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA  PBR  of degree [10Xn[110X is the [12Xidentity[112X PBR of degree [10Xn[110X if it is the identity of
  the  full PBR monoid of degree [10Xn[110X. The identity PBR of degree [10Xn[110X has [10X2n[110X edges.
  Specifically, for each [10Xi[110X in the ranges [10X[1 .. n][110X and [10X[-n .. -1][110X, the identity
  PBR has an edge from [10Xi[110X to [10X-i[110X.[133X
  
  [33X[0;0Y[10XIsIdentityPBR[110X  returns  [9Xtrue[109X is the PBR [3Xx[103X is an identity PBR and [9Xfalse[109X if it
  is not.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2], [-1]], [[1], [2]]);[127X[104X
    [4X[28XPBR([ [ -2 ], [ -1 ] ], [ [ 1 ], [ 2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsIdentityPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-1]], [[1]]);[127X[104X
    [4X[28XPBR([ [ -1 ] ], [ [ 1 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsIdentityPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X4.5-7 IsUniversalPBR[101X
  
  [33X[1;0Y[29X[2XIsUniversalPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA  PBR  of  degree  [10Xn[110X  is  [12Xuniversal[112X  if  it has [10X4 * n ^ 2[110X edges, i.e. every
  possible edge.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[]], [[]]);[127X[104X
    [4X[28XPBR([ [  ] ], [ [  ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsUniversalPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2, 1], [2]], [[-1], [-2, 1]]);[127X[104X
    [4X[28XPBR([ [ -2, 1 ], [ 2 ] ], [ [ -1 ], [ -2, 1 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsUniversalPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-1, 1]], [[-1, 1]]);[127X[104X
    [4X[28XPBR([ [ -1, 1 ] ], [ [ -1, 1 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsUniversalPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X4.5-8 IsBipartitionPBR[101X
  
  [33X[1;0Y[29X[2XIsBipartitionPBR[102X( [3Xx[103X ) [32X property[133X
  [33X[1;0Y[29X[2XIsBlockBijectionPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the PBR [3Xx[103X defines a bipartition, then [10XIsBipartitionPBR[110X returns [9Xtrue[109X, and
  if not, then it returns [9Xfalse[109X.[133X
  
  [33X[0;0YA  PBR  [3Xx[103X  defines a bipartition if and only if when considered as a boolean
  matrix it is an equivalence.[133X
  
  [33X[0;0YIf [3Xx[103X satisfies [10XIsBipartitionPBR[110X and when considered as a bipartition it is a
  block bijection, then [10XIsBlockBijectionPBR[110X returns [9Xtrue[109X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-1, 3], [-1, 3], [-2, 1, 2, 3]],[127X[104X
    [4X[25X>[125X [27X            [[-2, -1, 2], [-2, -1, 1, 2, 3],[127X[104X
    [4X[25X>[125X [27X             [-2, -1, 1, 2]]);[127X[104X
    [4X[28XPBR([ [ -1, 3 ], [ -1, 3 ], [ -2, 1, 2, 3 ] ],[128X[104X
    [4X[28X  [ [ -2, -1, 2 ], [ -2, -1, 1, 2, 3 ], [ -2, -1, 1, 2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsBipartitionPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2, -1, 1], [2, 3], [2, 3]],[127X[104X
    [4X[25X>[125X [27X            [[-2, -1, 1], [-2, -1, 1], [-3]]);[127X[104X
    [4X[28XPBR([ [ -2, -1, 1 ], [ 2, 3 ], [ 2, 3 ] ],[128X[104X
    [4X[28X  [ [ -2, -1, 1 ], [ -2, -1, 1 ], [ -3 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsBipartitionPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsBlockBijectionPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X4.5-9 IsTransformationPBR[101X
  
  [33X[1;0Y[29X[2XIsTransformationPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the  PBR  [3Xx[103X  defines  a transformation, then [10XIsTransformationPBR[110X returns
  [9Xtrue[109X, and if not, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA   PBR   [3Xx[103X   defines   a   transformation  if  and  only  if  it  satisfies
  [2XIsBipartitionPBR[102X  ([14X4.5-8[114X)  and  when  it  is  considered as a bipartition it
  satisfies [2XIsTransBipartition[102X ([14X3.5-12[114X).[133X
  
  [33X[0;0YWith  this  definition,  [2XAsPBR[102X  ([14X4.3-1[114X)  and [2XAsTransformation[102X ([14X4.3-2[114X) define
  mutually  inverse isomorphisms from the full transformation monoid of degree
  [10Xn[110X  to the submonoid of the full PBR monoid of degree [10Xn[110X consisting of all the
  elements satisfying [10XIsTransformationPBR[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-3], [-1], [-3]], [[2], [], [1, 3]]);[127X[104X
    [4X[28XPBR([ [ -3 ], [ -1 ], [ -3 ] ], [ [ 2 ], [  ], [ 1, 3 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsTransformationPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := AsTransformation(x);[127X[104X
    [4X[28XTransformation( [ 3, 1, 3 ] )[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x) * AsPBR(x) = AsPBR(x ^ 2);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XNumber(FullPBRMonoid(1), IsTransformationPBR);[127X[104X
    [4X[28X1[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2, -1, 2], [-2, 1, 2]], [[-1, 1], [-2]]);[127X[104X
    [4X[28XPBR([ [ -2, -1, 2 ], [ -2, 1, 2 ] ], [ [ -1, 1 ], [ -2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsTransformationPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X4.5-10 IsDualTransformationPBR[101X
  
  [33X[1;0Y[29X[2XIsDualTransformationPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the  PBR  [3Xx[103X  defines a dual transformation, then [10XIsDualTransformationPBR[110X
  returns [9Xtrue[109X, and if not, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA  PBR  [3Xx[103X  defines  a  dual  transformation if and only if [10XStar([3Xx[103X[10X)[110X satisfies
  [2XIsTransformationPBR[102X ([14X4.5-9[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-3, 1, 3], [-1, 2], [-3, 1, 3]],[127X[104X
    [4X[25X>[125X [27X            [[-1, 2], [-2], [-3, 1, 3]]);[127X[104X
    [4X[28XPBR([ [ -3, 1, 3 ], [ -1, 2 ], [ -3, 1, 3 ] ],[128X[104X
    [4X[28X  [ [ -1, 2 ], [ -2 ], [ -3, 1, 3 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsDualTransformationPBR(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsDualTransformationPBR(Star(x));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XNumber(FullPBRMonoid(1), IsDualTransformationPBR);[127X[104X
    [4X[28X1[128X[104X
  [4X[32X[104X
  
  [1X4.5-11 IsPartialPermPBR[101X
  
  [33X[1;0Y[29X[2XIsPartialPermPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the  PBR  [3Xx[103X defines a partial permutation, then [10XIsPartialPermPBR[110X returns
  [9Xtrue[109X, and if not, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA  PBR [3Xx[103X defines a partial perm if and only if it satisfies [2XIsBipartitionPBR[102X
  ([14X4.5-8[114X)  and  and  when  it  is  considered  as  a  bipartition it satisfies
  [2XIsPartialPermBipartition[102X ([14X3.5-15[114X).[133X
  
  [33X[0;0YWith  this  definition,  [2XAsPBR[102X  ([14X4.3-1[114X)  and  [2XAsPartialPerm[102X  ([14X4.3-3[114X)  define
  mutually  inverse isomorphisms from the symmetric inverse monoid of degree [10Xn[110X
  to  the  submonoid  of the full PBR monoid of degree [10Xn[110X consisting of all the
  elements satisfying [10XIsPartialPermPBR[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-1, 1], [2]], [[-1, 1], [-2]]);[127X[104X
    [4X[28XPBR([ [ -1, 1 ], [ 2 ] ], [ [ -1, 1 ], [ -2 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsPartialPermPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := PartialPerm([3, 1]);[127X[104X
    [4X[28X[2,1,3][128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x) * AsPBR(x) = AsPBR(x ^ 2);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XNumber(FullPBRMonoid(1), IsPartialPermPBR);[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  [1X4.5-12 IsPermPBR[101X
  
  [33X[1;0Y[29X[2XIsPermPBR[102X( [3Xx[103X ) [32X property[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf the PBR [3Xx[103X defines a permutation, then [10XIsPermPBR[110X returns [9Xtrue[109X, and if not,
  then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA  PBR  [3Xx[103X defines a permutation if and only if it satisfies [2XIsBipartitionPBR[102X
  ([14X4.5-8[114X)  and  and  when  it  is  considered  as  a  bipartition it satisfies
  [2XIsPermBipartition[102X ([14X3.5-14[114X).[133X
  
  [33X[0;0YWith  this  definition,  [2XAsPBR[102X  ([14X4.3-1[114X)  and  [2XAsPermutation[102X  ([14X4.3-4[114X)  define
  mutually  inverse  isomorphisms  from the symmetric group of degree [10Xn[110X to the
  subgroup  of  the full PBR monoid of degree [10Xn[110X consisting of all the elements
  satisfying  [10XIsPermPBR[110X (i.e. the [2XGroupOfUnits[102X ([14X11.8-1[114X) of the full PBR monoid
  of degree [10Xn[110X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2, 1], [-4, 2], [-1, 3], [-3, 4]],[127X[104X
    [4X[25X>[125X [27X[[-1, 3], [-2, 1], [-3, 4], [-4, 2]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPermPBR(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := (1, 5)(2, 4, 3);[127X[104X
    [4X[28X(1,5)(2,4,3)[128X[104X
    [4X[25Xgap>[125X [27Xy := (1, 4, 3)(2, 5);[127X[104X
    [4X[28X(1,4,3)(2,5)[128X[104X
    [4X[25Xgap>[125X [27XAsPBR(x) * AsPBR(y) = AsPBR(x * y);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XNumber(FullPBRMonoid(1), IsPermPBR);[127X[104X
    [4X[28X1[128X[104X
  [4X[32X[104X
  
  
  [1X4.6 [33X[0;0YSemigroups of PBRs[133X[101X
  
  [33X[0;0YSemigroups  and monoids of PBRs can be created in the usual way in [5XGAP[105X using
  the  functions  [2XSemigroup[102X  ([14XReference:  Semigroup[114X)  and  [2XMonoid[102X  ([14XReference:
  Monoid[114X); see Chapter [14X6[114X for more details.[133X
  
  [33X[0;0YIt  is  possible  to  create  inverse  semigroups  and monoids of PBRs using
  [2XInverseSemigroup[102X ([14XReference: InverseSemigroup[114X) and [2XInverseMonoid[102X ([14XReference:
  InverseMonoid[114X)  when  the  argument  is  a  collection  of  PBRs  satisfying
  [2XIsBipartitionPBR[102X ([14X4.5-8[114X) and when considered as bipartitions, the collection
  satisfies [10XIsGeneratorsOfInverseSemigroup[110X.[133X
  
  [33X[0;0YNote that every PBR semigroup in [5XSemigroups[105X is finite.[133X
  
  [1X4.6-1 IsPBRSemigroup[101X
  
  [33X[1;0Y[29X[2XIsPBRSemigroup[102X( [3XS[103X ) [32X filter[133X
  [33X[1;0Y[29X[2XIsPBRMonoid[102X( [3XS[103X ) [32X filter[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA [13XPBR semigroup[113X is simply a semigroup consisting of PBRs. An object [3Xobj[103X is a
  PBR  semigroup  in  [5XGAP[105X if it satisfies [2XIsSemigroup[102X ([14XReference: IsSemigroup[114X)
  and [2XIsPBRCollection[102X ([14X4.1-2[114X).[133X
  
  [33X[0;0YA  [13XPBR  monoid[113X is a monoid consisting of PBRs. An object [3Xobj[103X is a PBR monoid
  in  [5XGAP[105X  if  it satisfies [2XIsMonoid[102X ([14XReference: IsMonoid[114X) and [2XIsPBRCollection[102X
  ([14X4.1-2[114X).[133X
  
  [33X[0;0YNote  that  it  is  possible  for  a  PBR semigroup to have a multiplicative
  neutral  element  (i.e. an identity element) but not to satisfy [10XIsPBRMonoid[110X.
  For example,[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PBR([[-2, -1, 3], [-2, 2], [-3, -2, 1, 2, 3]],[127X[104X
    [4X[25X>[125X [27X            [[-3, -2, -1, 2, 3], [-3, -2, -1, 2, 3], [-1]]);;[127X[104X
    [4X[25Xgap>[125X [27XS := Semigroup(x, One(x));[127X[104X
    [4X[28X<commutative pbr monoid of degree 3 with 1 generator>[128X[104X
    [4X[25Xgap>[125X [27XIsMonoid(S);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsPBRMonoid(S);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([[127X[104X
    [4X[25X>[125X [27X PBR([[-2, 1], [-3, 2], [-1, 3], [-4, 4, 5], [-4, 4, 5]],[127X[104X
    [4X[25X>[125X [27X     [[-1, 3], [-2, 1], [-3, 2], [-4, 4, 5], [-5]]),[127X[104X
    [4X[25X>[125X [27X PBR([[-2, 1], [-1, 2], [-3, 3], [-4, 4, 5], [-4, 4, 5]],[127X[104X
    [4X[25X>[125X [27X     [[-1, 2], [-2, 1], [-3, 3], [-4, 4, 5], [-5]]),[127X[104X
    [4X[25X>[125X [27X PBR([[-1, 1, 3], [-2, 2], [-1, 1, 3], [-4, 4, 5], [-4, 4, 5]],[127X[104X
    [4X[25X>[125X [27X     [[-1, 1, 3], [-2, 2], [-3], [-4, 4, 5], [-5]])]);[127X[104X
    [4X[28X<pbr semigroup of degree 5 with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XOne(S);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27XMultiplicativeNeutralElement(S);[127X[104X
    [4X[28XPBR([ [ -1, 1 ], [ -2, 2 ], [ -3, 3 ], [ -4, 4, 5 ], [ -4, 4, 5 ] ],[128X[104X
    [4X[28X  [ [ -1, 1 ], [ -2, 2 ], [ -3, 3 ], [ -4, 4, 5 ], [ -5 ] ])[128X[104X
    [4X[25Xgap>[125X [27XIsPBRMonoid(S);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIn  this  example  [10XS[110X  cannot  be  converted  into  a  monoid  using [2XAsMonoid[102X
  ([14XReference:  AsMonoid[114X)  since  the  [2XOne[102X ([14XReference: One[114X) of any element in [10XS[110X
  differs from the multiplicative neutral element.[133X
  
  [33X[0;0YFor more details see [2XIsMagmaWithOne[102X ([14XReference: IsMagmaWithOne[114X).[133X
  
  [1X4.6-2 DegreeOfPBRSemigroup[101X
  
  [33X[1;0Y[29X[2XDegreeOfPBRSemigroup[102X( [3XS[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YThe  [13Xdegree[113X  of  a  PBR  semigroup  [3XS[103X  is just the degree of any (and every)
  element of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([127X[104X
    [4X[25X>[125X [27X PBR([[-1, 1], [-2, 2], [-3, 3]],[127X[104X
    [4X[25X>[125X [27X     [[-1, 1], [-2, 2], [-3, 3]]),[127X[104X
    [4X[25X>[125X [27X PBR([[1, 2], [1, 2], [-3, 3]],[127X[104X
    [4X[25X>[125X [27X     [[-2, -1], [-2, -1], [-3, 3]]),[127X[104X
    [4X[25X>[125X [27X PBR([[-1, 1], [2, 3], [2, 3]],[127X[104X
    [4X[25X>[125X [27X     [[-1, 1], [-3, -2], [-3, -2]]));[127X[104X
    [4X[28X<pbr semigroup of degree 3 with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XDegreeOfPBRSemigroup(S);[127X[104X
    [4X[28X3[128X[104X
  [4X[32X[104X
  
