  
  [1X3 [33X[0;0YBipartitions and blocks[133X[101X
  
  [33X[0;0YIn  this  chapter  we  describe the functions in [5XSemigroups[105X for creating and
  manipulating  bipartitions  and  semigroups  of  bipartitions.  We  begin by
  describing what these objects are.[133X
  
  [33X[0;0YA  [13Xpartition[113X of a set [10XX[110X is a set of pairwise disjoint non-empty subsets of [10XX[110X
  whose  union is [10XX[110X. A partition of [10XX[110X is the collection of equivalence classes
  of an equivalence relation on [10XX[110X, and vice versa.[133X
  
  [33X[0;0YLet [22Xn∈[122X[13XN[113X, let [13Xn[113X[22X= {1, 2, ..., n}[122X, and let [22X-[122X[13Xn[113X[22X= {-1, -2, ..., -n}[122X.[133X
  
  [33X[0;0YThe [13Xpartition monoid[113X of degree [10Xn[110X is the set of all partitions of [13Xn[113X[22X∪[122X-[13Xn[113X with a
  multiplication  we  describe below. To avoid conflict with other uses of the
  word  "partition"  in [5XGAP[105X, and to reflect their definition, we have opted to
  refer  to  the elements of the partition monoid as [13Xbipartitions[113X of degree [10Xn[110X;
  we will do so from this point on.[133X
  
  [33X[0;0YLet  [10Xx[110X  be any bipartition of degree [10Xn[110X. Then [10Xx[110X is a set of pairwise disjoint
  non-empty  subsets of [13Xn[113X[22X∪[122X-[13Xn[113X whose union is [13Xn[113X[22X∪[122X-[13Xn[113X; these subsets are called the
  [13Xblocks[113X  of  [10Xx[110X.  A  block  containing  elements  of both [13Xn[113X and -[13Xn[113X is called a
  [13Xtransverse  block[113X. If [10Xi[110X, [10Xj[110X[22X∈[122X[13Xn[113X[22X∪[122X-[13Xn[113X belong to the same block of a bipartition [10Xx[110X,
  then we write ([10Xi[110X, [10Xj[110X)[22X∈[122X[10Xx[110X.[133X
  
  [33X[0;0YLet  [10Xx[110X  and [10Xy[110X be bipartitions of degree [10Xn[110X. Their product [10Xx[110X[10Xy[110X can be described
  as  follows.  Define [13Xn[113X'[22X= {1', 2', ..., n'}[122X. From [10Xx[110X, create a partition [10Xx[110X' of
  the  set  [13Xn[113X[22X∪[122X[13Xn[113X'  by  replacing  each negative point -[10Xi[110X in a block of [10Xx[110X by the
  point  [10Xi[110X',  and  create  from [10Xy[110X a partition [10Xy[110X' of the set [13Xn[113X'[22X∪[122X-[13Xn[113X by replacing
  each  positive  point  [10Xi[110X  in  a  block  of  [10Xy[110X by the point [10Xi[110X'. Then define a
  relation  on  the set [13Xn[113X[22X∪[122X[13Xn[113X'[22X∪[122X-[13Xn[113X, where [10Xi[110X and [10Xj[110X are related if they are related
  in  either  [10Xx[110X'  or [10Xy[110X', and let [10Xp[110X be the transitive closure of this relation.
  Finally,  define  [10Xx[110X[10Xy[110X  to  be  the  bipartition  of  degree  [10Xn[110X defined by the
  restriction of the equivalence relation [10Xp[110X to the set [13Xn[113X[22X∪[122X-[13Xn[113X.[133X
  
  [33X[0;0YEquivalently, the product [10Xx[110X[10Xy[110X is defined to be the bipartition where [10Xi[110X,[10Xj[110X[22X∈[122X[13Xn[113X[22X∪[122X-[13Xn[113X
  (we  assume without loss of generality that [10Xi[110X[22X≥[122X[10Xj[110X) belong to the same block of
  [10Xx[110X[10Xy[110X if either:[133X
  
  [30X    [33X[0;6Y[10Xi[110X[10X=[110X[10Xj[110X,[133X
  
  [30X    [33X[0;6Y[10Xi[110X, [10Xj[110X [22X∈[122X [13Xn[113X and [22X([122X[10Xi[110X,[10Xj[110X[22X)[122X[22X∈[122X [10Xx[110X, or[133X
  
  [30X    [33X[0;6Y[10Xi[110X, [10Xj[110X [22X∈[122X -[13Xn[113X and [22X([122X[10Xi[110X,[10Xj[110X[22X)[122X[22X∈[122X [10Xy[110X;[133X
  
  [33X[0;0Yor  there  exists  [22Xr∈[122X[13XN[113X  and  [10Xk(1),k(2)[110X,[22X...[122X,[10Xk(r)[110X[22X∈[122X[13Xn[113X , and one of the following
  holds:[133X
  
  [30X    [33X[0;6Y[10Xr=2s-1[110X for some [10Xs[110X[22X≥[122X[10X1[110X , [10Xi[110X[22X∈[122X[13Xn[113X, [10Xj[110X[22X∈[122X -[13Xn[113X and[133X
  
        [33X[0;6Y[10X(i,-k(1))[110X[22X∈[122X[10Xx[110X,        [10X(k(1),k(2))[110X[22X∈[122X[10Xy[110X,        [10X(-k(2),-k(3))[110X[22X∈[122X[10Xx[110X,        [22X...[122X,
        [10X(-k(2s-2),-k(2s-1))[110X[22X∈[122X[10Xx[110X, [10X(k(2s-1),j)[110X[22X∈[122X[10Xy[110X;[133X
  
  [30X    [33X[0;6Y[10Xr=2s[110X for some [10Xs[110X[22X≥[122X[10X1[110X , and either [10Xi[110X,[10Xj[110X[22X∈[122X[13Xn[113X, and[133X
  
        [33X[0;6Y[10X(i,-k(1))[110X[22X∈[122X[10Xx[110X,  [10X(k(1),k(2))[110X[22X∈[122X[10Xy[110X,  [10X(-k(2),-k(3))[110X[22X∈[122X[10Xx[110X, [22X...[122X, [10X(k(2s-1),k(2s))[110X[22X∈[122X[10Xx[110X,
        [10X(-k(2s),j)[110X[22X∈[122X[10Xy[110X,[133X
  
        [33X[0;6Yor [10Xi[110X,[10Xj[110X[22X∈[122X-[13Xn[113X, and[133X
  
        [33X[0;6Y[10X(i,k(1))[110X[22X∈[122X[10Xy[110X,  [10X(-k(1),-k(2))[110X[22X∈[122X[10Xx[110X, [10X(k(2),k(3))[110X[22X∈[122X[10Xy[110X, [22X...[122X, [10X(-k(2s-1),-k(2s))[110X[22X∈[122X[10Xy[110X,
        [10X(k(2s),j)[110X[22X∈[122X[10Xx[110X.[133X
  
  [33X[0;0YThis multiplication can be shown to be associative, and so the collection of
  all  bipartitions of any particular degree is a monoid; the identity element
  of  the  partition  monoid  of  degree [22Xn[122X is the bipartition {{[22Xi[122X,-[22Xi[122X}:[22Xi ∈[122X[13Xn[113X}. A
  bipartition  is  a  unit if and only if each block is of the form [22X{[122X[10Xi[110X,-[10Xj[110X[22X}[122X for
  some  [10Xi[110X,  [10Xj[110X[22X∈[122X[13Xn[113X. Hence the group of units is isomorphic to the symmetric group
  on [13Xn[113X.[133X
  
  [33X[0;0YLet [10Xx[110X be a bipartition of degree [10Xn[110X. Then we define [10Xx[110X[22X^*[122X to be the bipartition
  obtained from [10Xx[110X by replacing [10Xi[110X by -[10Xi[110X and -[10Xi[110X by [10Xi[110X in every block of [10Xx[110X for all
  [10Xi[110X[22X∈[122X[13Xn[113X.  It  is routine to verify that if [10Xx[110X and [10Xy[110X are arbitrary bipartitions of
  equal degree, then[133X
  
  [33X[0;0Y[10X(x^*)^*=x, xx^*x=x, x^*xx^*=x^*, (xy)^*=y^*x^*.[110X[133X
  
  [33X[0;0YIn this way, the partition monoid is a [13Xregular *-semigroup[113X.[133X
  
  [33X[0;0YA  bipartition [10Xx[110X of degree [10Xn[110X is called [13Xplanar[113X if there do not exist distinct
  blocks  [22XA, U ∈[122X [10Xx[110X, along with [22Xa, b ∈ A[122X and [22Xu, v ∈ U[122X, such that [22Xa < u < b < v[122X.
  Define  [10Xp[110X to be the bipartition of degree [10Xn[110X with blocks {{[10Xi[110X,-[10X(i+1)[110X}:[10Xi[110X[22X∈[122X[13Xn[113X,[10Xi[110X<[13Xn[113X}
  and  {[10Xn[110X,-[10X1[110X}  .  Note that [10Xp[110X is a unit. A bipartition [10Xx[110X of degree [10Xn[110X is called
  [13Xannular[113X  if  [10Xx  =(p^i)y(p^j)[110X  for some planar bipartition [10Xy[110X of degree [10Xn[110X, and
  some integers [10Xi[110X and [10Xj[110X.[133X
  
  [33X[0;0YFrom  a  graphical  perspective,  as on Page 873 in [HR05], a bipartition of
  degree  [10Xn[110X  is  planar  if  it  can  be  represented as a graph without edges
  crossing  inside of the rectangle formed by its vertices [13Xn[113X[22X∪[122X-[13Xn[113X. Similarly, as
  shown in Figure 2 in [Aui12], a bipartition of degree [10Xn[110X is annular if it can
  be represented as a graph without edges crossing inside an annulus.[133X
  
  
  [1X3.1 [33X[0;0YThe family and categories of bipartitions[133X[101X
  
  [1X3.1-1 IsBipartition[101X
  
  [29X[2XIsBipartition[102X( [3Xobj[103X ) [32X Category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YEvery  bipartition  in  [5XGAP[105X  belongs  to  the  category [10XIsBipartition[110X. Basic
  operations  for  bipartitions  are  [2XRightBlocks[102X ([14X3.5-5[114X), [2XLeftBlocks[102X ([14X3.5-6[114X),
  [2XExtRepOfObj[102X ([14X3.5-3[114X), [2XLeftProjection[102X ([14X3.2-4[114X), [2XRightProjection[102X ([14X3.2-5[114X), [2XStarOp[102X
  ([14X3.2-6[114X),    [2XDegreeOfBipartition[102X    ([14X3.5-1[114X),    [2XRankOfBipartition[102X    ([14X3.5-2[114X),
  multiplication of two bipartitions of equal degree is via [9X*[109X.[133X
  
  [1X3.1-2 IsBipartitionCollection[101X
  
  [29X[2XIsBipartitionCollection[102X( [3Xobj[103X ) [32X Category
  [29X[2XIsBipartitionCollColl[102X( [3Xobj[103X ) [32X Category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YEvery    collection    of    bipartitions    belongs    to    the   category
  [10XIsBipartitionCollection[110X.  For  example,  bipartition  semigroups  belong  to
  [10XIsBipartitionCollection[110X.[133X
  
  [33X[0;0YEvery    collection    of    collections    of   bipartitions   belongs   to
  [10XIsBipartitionCollColl[110X. For example, a list of bipartition semigroups belongs
  to [10XIsBipartitionCollColl[110X.[133X
  
  
  [1X3.2 [33X[0;0YCreating bipartitions[133X[101X
  
  [33X[0;0YThere  are several ways of creating bipartitions in [5XGAP[105X, which are described
  in this section.[133X
  
  [1X3.2-1 Bipartition[101X
  
  [29X[2XBipartition[102X( [3Xblocks[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0Y[10XBipartition[110X returns the bipartition [10Xx[110X with equivalence classes [3Xblocks[103X, which
  should  be a list of duplicate-free lists whose union is [10X[-n .. -1][110X union [10X[1
  .. n][110X for some positive integer [10Xn[110X.[133X
  
  [33X[0;0Y[10XBipartition[110X returns an error if the argument does not define a bipartition.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -1], [2, 3, -3], [-2]]);[127X[104X
    [4X[28X<bipartition: [ 1, -1 ], [ 2, 3, -3 ], [ -2 ]>[128X[104X
  [4X[32X[104X
  
  [1X3.2-2 BipartitionByIntRep[101X
  
  [29X[2XBipartitionByIntRep[102X( [3Xlist[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0YIt  is  possible  to create a bipartition using its internal representation.
  The argument [3Xlist[103X must be a list of positive integers not greater than [10Xn[110X, of
  length  [10X2 * n[110X, and where [10Xi[110X appears in the list only if [10Xi-1[110X occurs earlier in
  the list.[133X
  
  [33X[0;0YFor example, the internal representation of the bipartition with blocks[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[1, -1], [2, 3, -2], [-3][128X[104X
  [4X[32X[104X
  
  [33X[0;0Yhas internal representation[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[1, 2, 2, 1, 2, 3][128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  internal  representation indicates that the number [10X1[110X is in class [10X1[110X, the
  number  [10X2[110X  is  in  class  [10X2[110X, the number [10X3[110X is in class [10X2[110X, the number [10X-1[110X is in
  class  [10X1[110X,  the  number  [10X-2[110X  is  in class [10X2[110X, and [10X-3[110X is in class [10X3[110X. As another
  example,  [10X[1, 3, 2, 1][110X is not the internal representation of any bipartition
  since there is no [10X2[110X before the [10X3[110X in the second position.[133X
  
  [33X[0;0YIn its first form [10XBipartitionByIntRep[110X verifies that the argument [3Xlist[103X is the
  internal representation of a bipartition.[133X
  
  [33X[0;0YSee also [2XIntRepOfBipartition[102X ([14X3.5-4[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBipartitionByIntRep([1, 2, 2, 1, 3, 4]);[127X[104X
    [4X[28X<bipartition: [ 1, -1 ], [ 2, 3 ], [ -2 ], [ -3 ]>[128X[104X
  [4X[32X[104X
  
  [1X3.2-3 IdentityBipartition[101X
  
  [29X[2XIdentityBipartition[102X( [3Xn[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe identity bipartition.[133X
  
  [33X[0;0YReturns the identity bipartition with degree [3Xn[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XIdentityBipartition(10);[127X[104X
    [4X[28X<block bijection: [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ], [128X[104X
    [4X[28X [ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], [ 10, -10 ]>[128X[104X
  [4X[32X[104X
  
  [1X3.2-4 LeftOne[101X
  
  [29X[2XLeftOne[102X( [3Xx[103X ) [32X attribute
  [29X[2XLeftProjection[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0YThe  [10XLeftProjection[110X of a bipartition [3Xx[103X is the bipartition [10X[3Xx[103X[10X * Star([3Xx[103X[10X)[110X. It is
  so-named,  since  the left and right blocks of the left projection equal the
  left blocks of [3Xx[103X.[133X
  
  [33X[0;0YThe  left projection [10Xe[110X of [3Xx[103X is also a bipartition with the property that [10Xe *
  [3Xx[103X[10X = [3Xx[103X[10X[110X. [10XLeftOne[110X and [10XLeftProjection[110X are synonymous.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[127X[104X
    [4X[25X>[125X [27X  [1, 4, -1, -2, -6], [2, 3, 5, -4], [6, -3], [-5]]);;[127X[104X
    [4X[25Xgap>[125X [27XLeftOne(x);[127X[104X
    [4X[28X<block bijection: [ 1, 4, -1, -4 ], [ 2, 3, 5, -2, -3, -5 ], [128X[104X
    [4X[28X [ 6, -6 ]>[128X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1*, 4* ], [ 2*, 3*, 5* ], [ 6* ]>[128X[104X
    [4X[25Xgap>[125X [27XRightBlocks(LeftOne(x));[127X[104X
    [4X[28X<blocks: [ 1*, 4* ], [ 2*, 3*, 5* ], [ 6* ]>[128X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(LeftOne(x));[127X[104X
    [4X[28X<blocks: [ 1*, 4* ], [ 2*, 3*, 5* ], [ 6* ]>[128X[104X
    [4X[25Xgap>[125X [27XLeftOne(x) * x = x;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.2-5 RightOne[101X
  
  [29X[2XRightOne[102X( [3Xx[103X ) [32X attribute
  [29X[2XRightProjection[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0YThe [10XRightProjection[110X of a bipartition [3Xx[103X is the bipartition [10XStar([3Xx[103X[10X) * [3Xx[103X[10X[110X. It is
  so-named,  since the left and right blocks of the right projection equal the
  right blocks of [3Xx[103X.[133X
  
  [33X[0;0YThe right projection [10Xe[110X of [3Xx[103X is also a bipartition with the property that [10X[3Xx[103X[10X *
  e = [3Xx[103X[10X[110X. [10XRightOne[110X and [10XRightProjection[110X are synonymous.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -1, -4], [2, -2, -3], [3, 4], [5, -5]]);;[127X[104X
    [4X[25Xgap>[125X [27XRightOne(x);[127X[104X
    [4X[28X<block bijection: [ 1, 4, -1, -4 ], [ 2, 3, -2, -3 ], [ 5, -5 ]>[128X[104X
    [4X[25Xgap>[125X [27XRightBlocks(RightOne(x));[127X[104X
    [4X[28X<blocks: [ 1*, 4* ], [ 2*, 3* ], [ 5* ]>[128X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(RightOne(x));[127X[104X
    [4X[28X<blocks: [ 1*, 4* ], [ 2*, 3* ], [ 5* ]>[128X[104X
    [4X[25Xgap>[125X [27XRightBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1*, 4* ], [ 2*, 3* ], [ 5* ]>[128X[104X
    [4X[25Xgap>[125X [27Xx * RightOne(x) = x;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.2-6 StarOp[101X
  
  [29X[2XStarOp[102X( [3Xx[103X ) [32X operation
  [29X[2XStar[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0Y[10XStarOp[110X  returns the unique bipartition [10Xg[110X with the property that: [10X[3Xx[103X[10X * g * [3Xx[103X[10X =
  [3Xx[103X[10X[110X,  [10XRightBlocks([3Xx[103X[10X)  = LeftBlocks(g)[110X, and [10XLeftBlocks([3Xx[103X[10X) = RightBlocks(g)[110X. The
  star  [10Xg[110X  can be obtained from [3Xx[103X by changing the sign of every integer in the
  external representation of [3Xx[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -4], [2, 3, 4], [5], [-1], [-2, -3], [-5]]);[127X[104X
    [4X[28X<bipartition: [ 1, -4 ], [ 2, 3, 4 ], [ 5 ], [ -1 ], [ -2, -3 ], [128X[104X
    [4X[28X [ -5 ]>[128X[104X
    [4X[25Xgap>[125X [27Xy := Star(x);[127X[104X
    [4X[28X<bipartition: [ 1 ], [ 2, 3 ], [ 4, -1 ], [ 5 ], [ -2, -3, -4 ], [128X[104X
    [4X[28X [ -5 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx * y * x = x;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(x) = RightBlocks(y);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XRightBlocks(x) = LeftBlocks(y);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.2-7 RandomBipartition[101X
  
  [29X[2XRandomBipartition[102X( [[3Xrs[103X, ][3Xn[103X ) [32X operation
  [29X[2XRandomBlockBijection[102X( [[3Xrs[103X, ][3Xn[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  positive  integer,  then  [10XRandomBipartition[110X  returns  a random
  bipartition  of  degree  [3Xn[103X,  and [10XRandomBlockBijection[110X returns a random block
  bijection of degree [3Xn[103X.[133X
  
  [33X[0;0YIf  the  optional first argument [3Xrs[103X is a random source, then this is used to
  generate    the    bipartition    returned    by    [10XRandomBipartition[110X    and
  [10XRandomBlockBijection[110X.[133X
  
  [33X[0;0YNote that neither of these functions has a uniform distribution.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := RandomBipartition(6);[127X[104X
    [4X[28X<bipartition: [ 1, 2, 3, 4 ], [ 5 ], [ 6, -2, -3, -4 ], [ -1, -5 ], [ -6 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx := RandomBlockBijection(4);[127X[104X
    [4X[28X<block bijection: [ 1, 4, -2 ], [ 2, -4 ], [ 3, -1, -3 ]>[128X[104X
  [4X[32X[104X
  
  
  [1X3.3 [33X[0;0YChanging the representation of a bipartition[133X[101X
  
  [33X[0;0YIt  is  possible  that  a  bipartition can be represented as another type of
  object,  or  that  another  type  of  [5XGAP[105X  object  can  be  represented as a
  bipartition.  In  this  section, we describe the functions in the [5XSemigroups[105X
  package  for changing the representation of bipartition, or for changing the
  representation of another type of object to that of a bipartition.[133X
  
  [33X[0;0YThe     operations    [2XAsPermutation[102X    ([14X3.3-5[114X),    [2XAsPartialPerm[102X    ([14X3.3-4[114X),
  [2XAsTransformation[102X   ([14X3.3-3[114X)   can   be  used  to  convert  bipartitions  into
  permutations, partial permutations, or transformations where appropriate.[133X
  
  [1X3.3-1 AsBipartition[101X
  
  [29X[2XAsBipartition[102X( [3Xx[103X[, [3Xn[103X] ) [32X operation
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0Y[10XAsBipartition[110X  returns  the  bipartition,  permutation,  transformation,  or
  partial permutation [3Xx[103X, as a bipartition of degree [3Xn[103X.[133X
  
  [33X[0;0YThere are several possible arguments for [10XAsBipartition[110X:[133X
  
  [8Xpermutations[108X
        [33X[0;6YIf   [3Xx[103X   is   a   permutation  and  [3Xn[103X  is  a  positive  integer,  then
        [10XAsBipartition([3Xx[103X[10X,  [3Xn[103X[10X)[110X  returns the bipartition on [10X[1 .. [3Xn[103X[10X][110X with classes
        [10X[i, i ^ [3Xx[103X[10X][110X for all [10Xi = 1 .. n[110X.[133X
  
        [33X[0;6YIf no positive integer [3Xn[103X is specified, then the largest moved point of
        [3Xx[103X  is  used  as  the  value  for  [3Xn[103X; see [2XLargestMovedPoint[102X ([14XReference:
        LargestMovedPoint (for a permutation)[114X).[133X
  
  [8Xtransformations[108X
        [33X[0;6YIf  [3Xx[103X is a transformation and [3Xn[103X is a positive integer such that [3Xx[103X is a
        transformation   of  [10X[1  ..  [3Xn[103X[10X][110X,  then  [10XAsTransformation[110X  returns  the
        bipartition with classes [22X(i)f ^ -1∪ {i}[122X for all [10Xi[110X in the image of [3Xx[103X.[133X
  
        [33X[0;6YIf  the  positive  integer [3Xn[103X is not specified, then the degree of [3Xx[103X is
        used as the value for [3Xn[103X.[133X
  
  [8Xpartial permutations[108X
        [33X[0;6YIf  [3Xx[103X  is  a  partial  permutation  and  [3Xn[103X is a positive integer, then
        [10XAsBipartition[110X returns the bipartition with classes [10X[i, i ^ [3Xx[103X[10X][110X for [10Xi[110X in
        [10X[1  ..  [3Xn[103X[10X][110X. Thus the degree of the returned bipartition is the maximum
        of [3Xn[103X and the values [10Xi ^ [3Xx[103X[10X[110X where [10Xi[110X in [10X[1 .. [3Xn[103X[10X][110X.[133X
  
        [33X[0;6YIf  the  optional argument [3Xn[103X is not present, then the default value of
        the  maximum  of  the  largest  moved point and the largest image of a
        moved point of [3Xx[103X plus [10X1[110X is used.[133X
  
  [8Xbipartitions[108X
        [33X[0;6YIf  [3Xx[103X  is  a  bipartition  and  [3Xn[103X  is  a  non-negative  integer,  then
        [10XAsBipartition[110X returns a bipartition corresponding to [3Xx[103X with degree [3Xn[103X.[133X
  
        [33X[0;6YIf [3Xn[103X equals the degree of [3Xx[103X, then [3Xx[103X is returned. If [3Xn[103X is less than the
        degree  of [3Xx[103X, then this function returns the bipartition obtained from
        [3Xx[103X  by  removing the values exceeding [3Xn[103X or less than [3X-n[103X from the blocks
        of [3Xx[103X. If [3Xn[103X is greater than the degree of [3Xx[103X, then this function returns
        the  bipartition  with the same blocks as [3Xx[103X and the singleton blocks [10Xi[110X
        and [10X-i[110X for all [10Xi[110X greater than the degree of [3Xx[103X[133X
  
  [8Xpbrs[108X
        [33X[0;6YIf  [3Xx[103X  is  a  pbr  satisfying  [2XIsBipartitionPBR[102X  ([14X4.5-8[114X)  and  [3Xn[103X  is a
        non-negative  integer,  then  [10XAsBipartition[110X  returns  the  bipartition
        corresponding to [3Xx[103X with degree [3Xn[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Transformation([3, 5, 3, 4, 1, 2]);;[127X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 5);[127X[104X
    [4X[28X<bipartition: [ 1, 3, -3 ], [ 2, -5 ], [ 4, -4 ], [ 5, -1 ], [ -2 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x);[127X[104X
    [4X[28X<bipartition: [ 1, 3, -3 ], [ 2, -5 ], [ 4, -4 ], [ 5, -1 ], [128X[104X
    [4X[28X [ 6, -2 ], [ -6 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 10);[127X[104X
    [4X[28X<bipartition: [ 1, 3, -3 ], [ 2, -5 ], [ 4, -4 ], [ 5, -1 ], [128X[104X
    [4X[28X [ 6, -2 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], [ 10, -10 ], [ -6 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition((1, 3)(2, 4));[127X[104X
    [4X[28X<block bijection: [ 1, -3 ], [ 2, -4 ], [ 3, -1 ], [ 4, -2 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition((1, 3)(2, 4), 10);[127X[104X
    [4X[28X<block bijection: [ 1, -3 ], [ 2, -4 ], [ 3, -1 ], [ 4, -2 ], [128X[104X
    [4X[28X [ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], [ 10, -10 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx := PartialPerm([1, 2, 3, 4, 5, 6], [6, 7, 1, 4, 3, 2]);;[127X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 11);[127X[104X
    [4X[28X<bipartition: [ 1, -6 ], [ 2, -7 ], [ 3, -1 ], [ 4, -4 ], [ 5, -3 ], [128X[104X
    [4X[28X [ 6, -2 ], [ 7 ], [ 8 ], [ 9 ], [ 10 ], [ 11 ], [ -5 ], [ -8 ], [128X[104X
    [4X[28X [ -9 ], [ -10 ], [ -11 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x);[127X[104X
    [4X[28X<bipartition: [ 1, -6 ], [ 2, -7 ], [ 3, -1 ], [ 4, -4 ], [ 5, -3 ], [128X[104X
    [4X[28X [ 6, -2 ], [ 7 ], [ -5 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(Transformation([1, 1, 2]), 1);[127X[104X
    [4X[28X<block bijection: [ 1, -1 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, -2], [3], [4, 5, 6, -1],[127X[104X
    [4X[25X>[125X [27X                     [-3, -4, -5, -6]]);;[127X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 0);[127X[104X
    [4X[28X<empty bipartition>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 2);[127X[104X
    [4X[28X<bipartition: [ 1, 2, -2 ], [ -1 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 8);[127X[104X
    [4X[28X<bipartition: [ 1, 2, -2 ], [ 3 ], [ 4, 5, 6, -1 ], [ 7 ], [ 8 ], [128X[104X
    [4X[28X [ -3, -4, -5, -6 ], [ -7 ], [ -8 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx := PBR([127X[104X
    [4X[25X>[125X [27X[[-1, 1, 2, 3, 4], [-1, 1, 2, 3, 4],[127X[104X
    [4X[25X>[125X [27X [-1, 1, 2, 3, 4], [-1, 1, 2, 3, 4]],[127X[104X
    [4X[25X>[125X [27X[[-1, 1, 2, 3, 4], [-2], [-3], [-4]]);;[127X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x);[127X[104X
    [4X[28X<bipartition: [ 1, 2, 3, 4, -1 ], [ -2 ], [ -3 ], [ -4 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 2);[127X[104X
    [4X[28X<bipartition: [ 1, 2, -1 ], [ -2 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 4);[127X[104X
    [4X[28X<bipartition: [ 1, 2, 3, 4, -1 ], [ -2 ], [ -3 ], [ -4 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 5);[127X[104X
    [4X[28X<bipartition: [ 1, 2, 3, 4, -1 ], [ 5 ], [ -2 ], [ -3 ], [ -4 ], [128X[104X
    [4X[28X [ -5 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 0);[127X[104X
    [4X[28X<empty bipartition>[128X[104X
  [4X[32X[104X
  
  [1X3.3-2 AsBlockBijection[101X
  
  [29X[2XAsBlockBijection[102X( [3Xx[103X[, [3Xn[103X] ) [32X operation
  [6XReturns:[106X  [33X[0;10YA block bijection.[133X
  
  [33X[0;0YWhen  the  argument [3Xx[103X is a partial perm and [3Xn[103X is a positive integer which is
  greater  than  the  maximum  of  the degree and codegree of [3Xx[103X, this function
  returns  a  block bijection corresponding to [3Xx[103X. This block bijection has the
  same  non-singleton  classes  as [10Xg := AsBipartition([3Xx[103X[10X, [3Xn[103X[10X)[110X and one additional
  class which is the union the singleton classes of [10Xg[110X.[133X
  
  [33X[0;0YIf  the  optional  second argument [3Xn[103X is not present, then the maximum of the
  degree and codegree of [3Xx[103X plus 1 is used by default. If the second argument [3Xn[103X
  is not greater than this maximum, then an error is given.[133X
  
  [33X[0;0YThis is the value at [3Xx[103X of the embedding of the symmetric inverse monoid into
  the  dual  symmetric  inverse  monoid  given in the FitzGerald-Leech Theorem
  [FL98].[133X
  
  [33X[0;0YWhen    the    argument    [3Xx[103X    is   a   partial   perm   bipartition   (see
  [2XIsPartialPermBipartition[102X    ([14X3.5-15[114X))    then    this    operation   returns
  [10XAsBlockBijection(AsPartialPerm([3Xx[103X[10X)[, [3Xn[103X[10X])[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := PartialPerm([1, 2, 3, 6, 7, 10], [9, 5, 6, 1, 7, 8]);[127X[104X
    [4X[28X[2,5][3,6,1,9][10,8](7)[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(x, 11);[127X[104X
    [4X[28X<bipartition: [ 1, -9 ], [ 2, -5 ], [ 3, -6 ], [ 4 ], [ 5 ], [128X[104X
    [4X[28X [ 6, -1 ], [ 7, -7 ], [ 8 ], [ 9 ], [ 10, -8 ], [ 11 ], [ -2 ], [128X[104X
    [4X[28X [ -3 ], [ -4 ], [ -10 ], [ -11 ]>[128X[104X
    [4X[25Xgap>[125X [27XAsBlockBijection(x, 10);[127X[104X
    [4X[28XError, Semigroups: AsBlockBijection (for a partial perm and pos int):[128X[104X
    [4X[28Xthe 2nd argument must be strictly greater than the maximum of the[128X[104X
    [4X[28Xdegree and codegree of the 1st argument,[128X[104X
    [4X[25Xgap>[125X [27XAsBlockBijection(x, 11);[127X[104X
    [4X[28X<block bijection: [ 1, -9 ], [ 2, -5 ], [ 3, -6 ], [128X[104X
    [4X[28X [ 4, 5, 8, 9, 11, -2, -3, -4, -10, -11 ], [ 6, -1 ], [ 7, -7 ], [128X[104X
    [4X[28X [ 10, -8 ]>[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -3], [2], [3, -2], [-1]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPartialPermBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XAsBlockBijection(x);[127X[104X
    [4X[28X<block bijection: [ 1, -3 ], [ 2, 4, -1, -4 ], [ 3, -2 ]>[128X[104X
  [4X[32X[104X
  
  [1X3.3-3 AsTransformation[101X
  
  [29X[2XAsTransformation[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA transformation.[133X
  
  [33X[0;0YWhen  the  argument  [3Xx[103X  is  a  bipartition,  that  mathematically  defines a
  transformation,  this  function returns that transformation. A bipartition [3Xx[103X
  defines  a transformation if and only if its right blocks are the image list
  of a permutation of [10X[1 .. n][110X where [10Xn[110X is the degree of [3Xx[103X.[133X
  
  [33X[0;0YSee [2XIsTransBipartition[102X ([14X3.5-12[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -3], [2, -2], [3, 5, 10, -7],[127X[104X
    [4X[25X>[125X [27X                     [4, -12], [6, 7, -6], [8, -5], [9, -11],[127X[104X
    [4X[25X>[125X [27X                     [11, 12, -10], [-1], [-4], [-8], [-9]]);;[127X[104X
    [4X[25Xgap>[125X [27XAsTransformation(x);[127X[104X
    [4X[28XTransformation( [ 3, 2, 7, 12, 7, 6, 6, 5, 11, 7, 10, 10 ] )[128X[104X
    [4X[25Xgap>[125X [27XIsTransBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 5], [2, 4, 8, 10],[127X[104X
    [4X[25X>[125X [27X                     [3, 6, 7, -1, -2], [9, -4, -6, -9],[127X[104X
    [4X[25X>[125X [27X                     [-3, -5], [-7, -8], [-10]]);;[127X[104X
    [4X[25Xgap>[125X [27XAsTransformation(x);[127X[104X
    [4X[28XError, Semigroups: AsTransformation (for a bipartition):[128X[104X
    [4X[28Xthe argument does not define a transformation,[128X[104X
  [4X[32X[104X
  
  [1X3.3-4 AsPartialPerm[101X
  
  [29X[2XAsPartialPerm[102X( [3Xx[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA partial perm.[133X
  
  [33X[0;0YWhen  the  argument [3Xx[103X is a bipartition that mathematically defines a partial
  perm, this function returns that partial perm.[133X
  
  [33X[0;0YA  bipartition  [3Xx[103X  defines a partial perm if and only if its numbers of left
  and right blocks both equal its degree.[133X
  
  [33X[0;0YSee [2XIsPartialPermBipartition[102X ([14X3.5-15[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -4], [2, -2], [3, -10], [4, -5],[127X[104X
    [4X[25X>[125X [27X                     [5, -9], [6], [7], [8, -6], [9, -3], [10, -8],[127X[104X
    [4X[25X>[125X [27X                     [-1], [-7]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPartialPermBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XAsPartialPerm(x);[127X[104X
    [4X[28X[1,4,5,9,3,10,8,6](2)[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -2, -4], [2, 3, 4, -3], [-1]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPartialPermBipartition(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XAsPartialPerm(x);[127X[104X
    [4X[28XError, Semigroups: AsPartialPerm (for a bipartition):[128X[104X
    [4X[28Xthe argument does not define a partial perm,[128X[104X
  [4X[32X[104X
  
  [1X3.3-5 AsPermutation[101X
  
  [29X[2XAsPermutation[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA permutation.[133X
  
  [33X[0;0YWhen  the  argument  [3Xx[103X  is  a  bipartition  that  mathematically  defines  a
  permutation, this function returns that permutation.[133X
  
  [33X[0;0YA  bipartition  [3Xx[103X  defines a permutation if and only if its numbers of left,
  right, and transverse blocks all equal its degree.[133X
  
  [33X[0;0YSee [2XIsPermBipartition[102X ([14X3.5-14[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -6], [2, -4], [3, -2], [4, -5],[127X[104X
    [4X[25X>[125X [27X                     [5, -3], [6, -1]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPermBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XAsPermutation(x);[127X[104X
    [4X[28X(1,6)(2,4,5,3)[128X[104X
    [4X[25Xgap>[125X [27XAsBipartition(last) = x;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X3.4 [33X[0;0YOperators for bipartitions[133X[101X
  
  [8X[10X[3Xf[103X[10X * [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns the composition of [3Xf[103X and [3Xg[103X when [3Xf[103X and [3Xg[103X are bipartitions.[133X
  
  [8X[10X[3Xf[103X[10X < [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns  [9Xtrue[109X if the internal representation of [3Xf[103X is lexicographically
        less than the internal representation of [3Xg[103X and [9Xfalse[109X if it is not.[133X
  
  [8X[10X[3Xf[103X[10X = [3Xg[103X[10X[110X[108X
        [33X[0;6Yreturns [9Xtrue[109X if the bipartition [3Xf[103X equals the bipartition [3Xg[103X and returns
        [9Xfalse[109X if it does not.[133X
  
  [1X3.4-1 PartialPermLeqBipartition[101X
  
  [29X[2XPartialPermLeqBipartition[102X( [3Xx[103X, [3Xy[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf   [3Xx[103X   and   [3Xy[103X   are   partial   perm   bipartitions,  i.e.  they  satisfy
  [2XIsPartialPermBipartition[102X    ([14X3.5-15[114X),    then    this    function    returns
  [10XAsPartialPerm([3Xx[103X[10X) < AsPartialPerm([3Xy[103X[10X)[110X.[133X
  
  [1X3.4-2 NaturalLeqPartialPermBipartition[101X
  
  [29X[2XNaturalLeqPartialPermBipartition[102X( [3Xx[103X, [3Xy[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThe [13Xnatural partial order[113X [22X≤[122X on an inverse semigroup [10XS[110X is defined by [10Xs[110X [22X≤[122X [10Xt[110X if
  there  exists  an  idempotent  [10Xe[110X in [10XS[110X such that [10Xs = et[110X. Hence if [3Xx[103X and [3Xy[103X are
  partial  perm  bipartitions, then [3Xx[103X [22X≤[122X [3Xy[103X if and only if [10XAsPartialPerm([3Xx[103X[10X)[110X is a
  restriction of [10XAsPartialPerm([3Xy[103X[10X)[110X.[133X
  
  [33X[0;0Y[10XNaturalLeqPartialPermBipartition[110X  returns  [9Xtrue[109X  if  [10XAsPartialPerm([3Xx[103X[10X)[110X  is  a
  restriction of [10XAsPartialPerm([3Xy[103X[10X)[110X and [9Xfalse[109X if it is not. Note that since this
  is  a  partial  order and not a total order, it is possible that [3Xx[103X and [3Xy[103X are
  incomparable with respect to the natural partial order.[133X
  
  [1X3.4-3 NaturalLeqBlockBijection[101X
  
  [29X[2XNaturalLeqBlockBijection[102X( [3Xx[103X, [3Xy[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThe [13Xnatural partial order[113X [22X≤[122X on an inverse semigroup [10XS[110X is defined by [10Xs[110X [22X≤[122X [10Xt[110X if
  there  exists  an  idempotent  [10Xe[110X in [10XS[110X such that [10Xs = et[110X. Hence if [3Xx[103X and [3Xy[103X are
  block bijections, then [3Xx[103X [22X≤[122X [3Xy[103X if and only if [3Xx[103X contains [3Xy[103X.[133X
  
  [33X[0;0Y[10XNaturalLeqBlockBijection[110X returns [9Xtrue[109X if [3Xx[103X is contained in [3Xy[103X and [9Xfalse[109X if it
  is not. Note that since this is a partial order and not a total order, it is
  possible  that  [3Xx[103X and [3Xy[103X are incomparable with respect to the natural partial
  order.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, -3], [3, -1, -2], [4, -4],[127X[104X
    [4X[25X>[125X [27X                     [5, -5], [6, -6], [7, -7],[127X[104X
    [4X[25X>[125X [27X                     [8, -8], [9, -9], [10, -10]]);;[127X[104X
    [4X[25Xgap>[125X [27Xy := Bipartition([[1, -2], [2, -1], [3, -3],[127X[104X
    [4X[25X>[125X [27X                     [4, -4], [5, -5], [6, -6], [7, -7],[127X[104X
    [4X[25X>[125X [27X                     [8, -8], [9, -9], [10, -10]]);;[127X[104X
    [4X[25Xgap>[125X [27Xz := Bipartition([Union([1 .. 10], [-10 .. -1])]);;[127X[104X
    [4X[25Xgap>[125X [27XNaturalLeqBlockBijection(x, y);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XNaturalLeqBlockBijection(y, x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XNaturalLeqBlockBijection(z, x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XNaturalLeqBlockBijection(z, y);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.4-4 PermLeftQuoBipartition[101X
  
  [29X[2XPermLeftQuoBipartition[102X( [3Xx[103X, [3Xy[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA permutation.[133X
  
  [33X[0;0YIf  [3Xx[103X  and  [3Xy[103X  are  bipartitions  with  equal  left  and  right blocks, then
  [10XPermLeftQuoBipartition[110X  returns  the permutation of the indices of the right
  blocks of [3Xx[103X (and [3Xy[103X) induced by [10XStar([3Xx[103X[10X) * [3Xy[103X[10X[110X.[133X
  
  [33X[0;0Y[10XPermLeftQuoBipartition[110X  verifies  that  [3Xx[103X  and  [3Xy[103X  have equal left and right
  blocks, and returns an error if they do not.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, 6, 7, 8, 10], [2, 5, -1, -2, -8],[127X[104X
    [4X[25X>[125X [27X                     [3, -3, -6, -7, -9], [9, -4, -5], [-10]]);;[127X[104X
    [4X[25Xgap>[125X [27Xy := Bipartition([[1, 4, 6, 7, 8, 10], [2, 5, -3, -6, -7, -9],[127X[104X
    [4X[25X>[125X [27X                     [3, -4, -5], [9, -1, -2, -8], [-10]]);;[127X[104X
    [4X[25Xgap>[125X [27XPermLeftQuoBipartition(x, y);[127X[104X
    [4X[28X(1,2,3)[128X[104X
    [4X[25Xgap>[125X [27XStar(x) * y;[127X[104X
    [4X[28X<bipartition: [ 1, 2, 8, -3, -6, -7, -9 ], [ 3, 6, 7, 9, -4, -5 ], [128X[104X
    [4X[28X [ 4, 5, -1, -2, -8 ], [ 10 ], [ -10 ]>[128X[104X
  [4X[32X[104X
  
  
  [1X3.5 [33X[0;0YAttributes for bipartitons[133X[101X
  
  [33X[0;0YIn  this  section  we  describe  various  attributes  that a bipartition can
  possess.[133X
  
  [1X3.5-1 DegreeOfBipartition[101X
  
  [29X[2XDegreeOfBipartition[102X( [3Xx[103X ) [32X attribute
  [29X[2XDegreeOfBipartitionCollection[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YThe degree of a bipartition is, roughly speaking, the number of points where
  it  is  defined.  More  precisely,  if  [3Xx[103X  is a bipartition 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 bipartitions of equal degree is just the
  degree  of  any (and every) bipartition in [3Xcoll[103X. The degree of collection of
  bipartitions of unequal degrees is not defined.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 7, -3, -8], [2, 6],[127X[104X
    [4X[25X>[125X [27X                     [3], [4, -7, -9], [5, 9, -2],[127X[104X
    [4X[25X>[125X [27X                     [8, -1, -4, -6], [-5]]);;[127X[104X
    [4X[25Xgap>[125X [27XDegreeOfBipartition(x);[127X[104X
    [4X[28X9[128X[104X
    [4X[25Xgap>[125X [27XS := BrauerMonoid(5);[127X[104X
    [4X[28X<regular bipartition *-monoid of degree 5 with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XIsBipartitionCollection(S);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XDegreeOfBipartitionCollection(S);[127X[104X
    [4X[28X5[128X[104X
  [4X[32X[104X
  
  [1X3.5-2 RankOfBipartition[101X
  
  [29X[2XRankOfBipartition[102X( [3Xx[103X ) [32X attribute
  [29X[2XNrTransverseBlocks[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YThe rank of a bipartition.[133X
  
  [33X[0;0YWhen  the  argument is a bipartition [3Xx[103X, [10XRankOfBipartition[110X returns the number
  of  blocks  of  [3Xx[103X  containing  both  positive and negative entries, i.e. the
  number of transverse blocks of [3Xx[103X.[133X
  
  [33X[0;0Y[10XNrTransverseBlocks[110X is just a synonym for [10XRankOfBipartition[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, 6, 7, -4, -5, -7], [3, 4, 5, -1, -3],[127X[104X
    [4X[25X>[125X [27X                     [8, -9], [9, -2], [-6], [-8]]);[127X[104X
    [4X[28X<bipartition: [ 1, 2, 6, 7, -4, -5, -7 ], [ 3, 4, 5, -1, -3 ], [128X[104X
    [4X[28X [ 8, -9 ], [ 9, -2 ], [ -6 ], [ -8 ]>[128X[104X
    [4X[25Xgap>[125X [27XRankOfBipartition(x);[127X[104X
    [4X[28X4[128X[104X
  [4X[32X[104X
  
  [1X3.5-3 ExtRepOfObj[101X
  
  [29X[2XExtRepOfObj[102X( [3Xx[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA partition of [10X[1 .. 2 * n][110X.[133X
  
  [33X[0;0YIf  [10Xn[110X  is  the  degree  of  the  bipartition [3Xx[103X, then [10XExtRepOfObj[110X returns the
  partition  of  [10X[-n .. -1][110X union [10X[1 .. n][110X corresponding to [3Xx[103X as a sorted list
  of duplicate-free lists.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 5, -3], [2, 4, -2, -4], [3, -1, -5]]);[127X[104X
    [4X[28X<block bijection: [ 1, 5, -3 ], [ 2, 4, -2, -4 ], [ 3, -1, -5 ]>[128X[104X
    [4X[25Xgap>[125X [27XExtRepOfObj(x);[127X[104X
    [4X[28X[ [ 1, 5, -3 ], [ 2, 4, -2, -4 ], [ 3, -1, -5 ] ][128X[104X
  [4X[32X[104X
  
  [1X3.5-4 IntRepOfBipartition[101X
  
  [29X[2XIntRepOfBipartition[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA list of positive integers.[133X
  
  [33X[0;0YIf  [3Xx[103X  is  a bipartition with degree [10Xn[110X, then [10XIntRepOfBipartition[110X returns the
  [13Xinternal  representation[113X  of  [3Xx[103X:  a list of length [10X2 * n[110X containing positive
  integers which correspond to the blocks of [3Xx[103X.[133X
  
  [33X[0;0YIf  [10Xi[110X  is in [10X[1 .. n][110X, then [10Xlist[i][110X refers to the point [10Xi[110X; if [10Xi[110X is in [10X[n + 1
  ..  2  *  n][110X, then [10Xlist[i][110X refers to the point [10Xn - i[110X (a negative point). Two
  points lie in the same block of the bipartition if and only if their entries
  in the list are equal.[133X
  
  [33X[0;0YSee also [2XBipartitionByIntRep[102X ([14X3.2-2[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -3], [3, 4], [2, -1, -2], [-4]]);[127X[104X
    [4X[28X<bipartition: [ 1, -3 ], [ 2, -1, -2 ], [ 3, 4 ], [ -4 ]>[128X[104X
    [4X[25Xgap>[125X [27XIntRepOfBipartition(x);[127X[104X
    [4X[28X[ 1, 2, 3, 3, 2, 2, 1, 4 ][128X[104X
  [4X[32X[104X
  
  [1X3.5-5 RightBlocks[101X
  
  [29X[2XRightBlocks[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YThe right blocks of a bipartition.[133X
  
  [33X[0;0Y[10XRightBlocks[110X returns the right blocks of the bipartition [3Xx[103X.[133X
  
  [33X[0;0YThe [13Xright blocks[113X of a bipartition [3Xx[103X are just the intersections of the blocks
  of  [3Xx[103X  with  [10X[-n .. -1][110X where [10Xn[110X is the degree of [3Xx[103X, the values in transverse
  blocks are positive, and the values in non-transverse blocks are negative.[133X
  
  [33X[0;0YThe  right  blocks  of a bipartition are [5XGAP[105X objects in their own right, and
  are not simply a list of blocks of [3Xx[103X; see [14X3.6[114X for more information.[133X
  
  [33X[0;0YThe  significance  of this notion lies in the fact that bipartitions [3Xx[103X and [10Xy[110X
  are  [13XL[113X-related  in the partition monoid if and only if they have equal right
  blocks.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, 7, 8, -4], [2, 3, 5, -2, -7],[127X[104X
    [4X[25X>[125X [27X                     [6, -1], [-3], [-5, -6, -8]]);;[127X[104X
    [4X[25Xgap>[125X [27XRightBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1* ], [ 2*, 7* ], [ 3 ], [ 4* ], [ 5, 6, 8 ]>[128X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1*, 4*, 7*, 8* ], [ 2*, 3*, 5* ], [ 6* ]>[128X[104X
  [4X[32X[104X
  
  [1X3.5-6 LeftBlocks[101X
  
  [29X[2XLeftBlocks[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YThe left blocks of a bipartition.[133X
  
  [33X[0;0Y[10XLeftBlocks[110X returns the left blocks of the bipartition [3Xx[103X.[133X
  
  [33X[0;0YThe  [13Xleft blocks[113X of a bipartition [3Xx[103X are just the intersections of the blocks
  of [3Xx[103X with [10X[1..n][110X where [10Xn[110X is the degree of [3Xx[103X, the values in transverse blocks
  are positive, and the values in non-transverse blocks are negative.[133X
  
  [33X[0;0YThe left blocks of a bipartition are [5XGAP[105X objects in their own right, and are
  not simply a list of blocks of [3Xx[103X; see [14X3.6[114X for more information.[133X
  
  [33X[0;0YThe  significance  of this notion lies in the fact that bipartitions [3Xx[103X and [10Xy[110X
  are  [13XR[113X-related  in  the partition monoid if and only if they have equal left
  blocks.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, 7, 8, -4], [2, 3, 5, -2, -7],[127X[104X
    [4X[25X>[125X [27X                     [6, -1], [-3], [-5, -6, -8]]);;[127X[104X
    [4X[25Xgap>[125X [27XRightBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1* ], [ 2*, 7* ], [ 3 ], [ 4* ], [ 5, 6, 8 ]>[128X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1*, 4*, 7*, 8* ], [ 2*, 3*, 5* ], [ 6* ]>[128X[104X
  [4X[32X[104X
  
  [1X3.5-7 NrLeftBlocks[101X
  
  [29X[2XNrLeftBlocks[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YWhen  the  argument  is  a bipartition [3Xx[103X, [10XNrLeftBlocks[110X returns the number of
  left  blocks  of  [3Xx[103X,  i.e.  the  number of blocks of [3Xx[103X intersecting [10X[1 .. n][110X
  non-trivially.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, 3, 4, 5, 6, 8], [7, -2, -3],[127X[104X
    [4X[25X>[125X [27X                     [-1, -4, -7, -8], [-5, -6]]);;[127X[104X
    [4X[25Xgap>[125X [27XNrLeftBlocks(x);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1, 2, 3, 4, 5, 6, 8 ], [ 7* ]>[128X[104X
  [4X[32X[104X
  
  [1X3.5-8 NrRightBlocks[101X
  
  [29X[2XNrRightBlocks[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YWhen  the  argument  is a bipartition [3Xx[103X, [10XNrRightBlocks[110X returns the number of
  right  blocks  of  [3Xx[103X, i.e. the number of blocks of [3Xx[103X intersecting [10X[-n .. -1][110X
  non-trivially.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, 3, 4, 6, -2, -7], [5, -1, -3, -8],[127X[104X
    [4X[25X>[125X [27X                     [7, -4, -6], [8], [-5]]);;[127X[104X
    [4X[25Xgap>[125X [27XRightBlocks(x);[127X[104X
    [4X[28X<blocks: [ 1*, 3*, 8* ], [ 2*, 7* ], [ 4*, 6* ], [ 5 ]>[128X[104X
    [4X[25Xgap>[125X [27XNrRightBlocks(x);[127X[104X
    [4X[28X4[128X[104X
  [4X[32X[104X
  
  [1X3.5-9 NrBlocks[101X
  
  [29X[2XNrBlocks[102X( [3Xblocks[103X ) [32X attribute
  [29X[2XNrBlocks[102X( [3Xf[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA positive integer.[133X
  
  [33X[0;0YIf  [3Xblocks[103X  is  some blocks or [3Xf[103X is a bipartition, then [10XNrBlocks[110X returns the
  number of blocks in [3Xblocks[103X or [3Xf[103X, respectively.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xblocks := BlocksNC([[-1, -2, -3, -4], [-5], [6]]);[127X[104X
    [4X[28X<blocks: [ 1, 2, 3, 4 ], [ 5 ], [ 6* ]>[128X[104X
    [4X[25Xgap>[125X [27XNrBlocks(blocks);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[127X[104X
    [4X[25X>[125X [27X  [1, 5], [2, 4, -2, -4], [3, 6, -1, -5, -6], [-3]]);[127X[104X
    [4X[28X<bipartition: [ 1, 5 ], [ 2, 4, -2, -4 ], [ 3, 6, -1, -5, -6 ], [128X[104X
    [4X[28X [ -3 ]>[128X[104X
    [4X[25Xgap>[125X [27XNrBlocks(x);[127X[104X
    [4X[28X4[128X[104X
  [4X[32X[104X
  
  [1X3.5-10 DomainOfBipartition[101X
  
  [29X[2XDomainOfBipartition[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA list of positive integers.[133X
  
  [33X[0;0YIf [3Xx[103X is a bipartition, then [10XDomainOfBipartition[110X returns the domain of [3Xx[103X. The
  [13Xdomain[113X of [3Xx[103X consists of those numbers [10Xi[110X in [10X[1 .. n][110X such that [10Xi[110X is contained
  in   a   transverse   block   of  [3Xx[103X,  where  [10Xn[110X  is  the  degree  of  [3Xx[103X  (see
  [2XDegreeOfBipartition[102X ([14X3.5-1[114X)).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2], [3, 4, 5, -5], [6, -6], [127X[104X
    [4X[25X>[125X [27X                     [-1, -2, -3], [-4]]);[127X[104X
    [4X[28X<bipartition: [ 1, 2 ], [ 3, 4, 5, -5 ], [ 6, -6 ], [ -1, -2, -3 ], [128X[104X
    [4X[28X [ -4 ]>[128X[104X
    [4X[25Xgap>[125X [27XDomainOfBipartition(x);[127X[104X
    [4X[28X[ 3, 4, 5, 6 ][128X[104X
  [4X[32X[104X
  
  [1X3.5-11 CodomainOfBipartition[101X
  
  [29X[2XCodomainOfBipartition[102X( [3Xx[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA list of positive integers.[133X
  
  [33X[0;0YIf [3Xx[103X is a bipartition, then [10XCodomainOfBipartition[110X returns the codomain of [3Xx[103X.
  The  [13Xcodomain[113X  of [3Xx[103X consists of those numbers [10Xi[110X in [10X[-n .. -1][110X such that [10Xi[110X is
  contained  in  a  transverse  block  of  [3Xx[103X,  where [10Xn[110X is the degree of [3Xx[103X (see
  [2XDegreeOfBipartition[102X ([14X3.5-1[114X)).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2], [3, 4, 5, -5], [6, -6], [127X[104X
    [4X[25X>[125X [27X                     [-1, -2, -3], [-4]]);[127X[104X
    [4X[28X<bipartition: [ 1, 2 ], [ 3, 4, 5, -5 ], [ 6, -6 ], [ -1, -2, -3 ], [128X[104X
    [4X[28X [ -4 ]>[128X[104X
    [4X[25Xgap>[125X [27XCodomainOfBipartition(x);[127X[104X
    [4X[28X[ -5, -6 ][128X[104X
  [4X[32X[104X
  
  [1X3.5-12 IsTransBipartition[101X
  
  [29X[2XIsTransBipartition[102X( [3Xx[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the  bipartition  [3Xx[103X  defines  a  transformation, then [10XIsTransBipartition[110X
  returns [9Xtrue[109X, and if not, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA  bipartition  [3Xx[103X defines a transformation if and only if the number of left
  blocks equals the number of transverse blocks and the number of right blocks
  equals the degree.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, -2], [2, 5, -6], [3, -7],[127X[104X
    [4X[25X>[125X [27X                     [6, 7, -9], [8, 9, -1], [10, -5],[127X[104X
    [4X[25X>[125X [27X                     [-3], [-4], [-8], [-10]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsTransBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, -3, -6], [2, 5, -4, -5],[127X[104X
    [4X[25X>[125X [27X                     [3, 6, -1], [-2]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsTransBipartition(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XNumber(PartitionMonoid(3), IsTransBipartition);[127X[104X
    [4X[28X27[128X[104X
  [4X[32X[104X
  
  [1X3.5-13 IsDualTransBipartition[101X
  
  [29X[2XIsDualTransBipartition[102X( [3Xx[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf   the   star   of  the  bipartition  [3Xx[103X  defines  a  transformation,  then
  [10XIsDualTransBipartition[110X returns [9Xtrue[109X, and if not, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA  bipartition  is the dual of a transformation if and only if its number of
  right  blocks  equals its number of transverse blocks and its number of left
  blocks equals its degree.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -8, -9], [2, -1, -4], [3],[127X[104X
    [4X[25X>[125X [27X                     [4], [5, -10], [6, -2, -5], [7, -3],[127X[104X
    [4X[25X>[125X [27X                     [8], [9, -6, -7], [10]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsDualTransBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, -3, -6], [2, 5, -4, -5],[127X[104X
    [4X[25X>[125X [27X                     [3, 6, -1], [-2]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsTransBipartition(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XNumber(PartitionMonoid(3), IsDualTransBipartition);[127X[104X
    [4X[28X27[128X[104X
  [4X[32X[104X
  
  [1X3.5-14 IsPermBipartition[101X
  
  [29X[2XIsPermBipartition[102X( [3Xx[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the  bipartition [3Xx[103X defines a permutation, then [10XIsPermBipartition[110X returns
  [9Xtrue[109X, and if not, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA bipartition is a permutation if its numbers of left, right, and transverse
  blocks all equal its degree.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[127X[104X
    [4X[25X>[125X [27X  [1, 4, -1], [2, -3], [3, 6, -5], [5, -2, -4, -6]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPermBipartition(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -3], [2, -4], [3, -6], [4, -1],[127X[104X
    [4X[25X>[125X [27X                     [5, -5], [6, -2], [7, -8], [8, -7]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPermBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-15 IsPartialPermBipartition[101X
  
  [29X[2XIsPartialPermBipartition[102X( [3Xx[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf    the    bipartition    [3Xx[103X    defines   a   partial   permutation,   then
  [10XIsPartialPermBipartition[110X returns [9Xtrue[109X, and if not, then [9Xfalse[109X is returned.[133X
  
  [33X[0;0YA  bipartition [3Xx[103X defines a partial permutation if and only if the numbers of
  left and right blocks of [3Xx[103X equal the degree of [3Xx[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[127X[104X
    [4X[25X>[125X [27X  [1, 4, -1], [2, -3], [3, 6, -5], [5, -2, -4, -6]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPartialPermBipartition(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, -3], [2], [-4], [3, -6], [4, -1],[127X[104X
    [4X[25X>[125X [27X                     [5, -5], [6, -2], [7, -8], [8, -7]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsPermBipartition(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsPartialPermBipartition(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-16 IsBlockBijection[101X
  
  [29X[2XIsBlockBijection[102X( [3Xx[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the  bipartition  [3Xx[103X induces a bijection from the quotient of [10X[1 .. n][110X by
  the  blocks  of  [3Xf[103X  to  the  quotient of [10X[-n .. -1][110X by the blocks of [3Xf[103X, then
  [10XIsBlockBijection[110X return [9Xtrue[109X, and if not, then it returns [9Xfalse[109X.[133X
  
  [33X[0;0YA bipartition is a block bijection if and only if its number of blocks, left
  blocks and right blocks are equal.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, 5, -2], [2, 3, -1], [6, -5, -6],[127X[104X
    [4X[25X>[125X [27X                     [-3, -4]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsBlockBijection(x);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, -3], [3, -1, -2], [4, -4], [5, -5]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsBlockBijection(x);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-17 IsUniformBlockBijection[101X
  
  [29X[2XIsUniformBlockBijection[102X( [3Xx[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YIf  the  bipartition  [3Xx[103X  is  a block bijection where every block contains an
  equal  number of positive and negative entries, then [10XIsUniformBlockBijection[110X
  returns [9Xtrue[109X, and otherwise it returns [9Xfalse[109X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, -3, -4], [3, -5], [4, -6],[127X[104X
    [4X[25X>[125X [27X[5, -7], [6, -8], [7, -9], [8, -1], [9, -2]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsBlockBijection(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 2, -3], [3, -1, -2], [4, -4],[127X[104X
    [4X[25X>[125X [27X[5, -5]]);;[127X[104X
    [4X[25Xgap>[125X [27XIsUniformBlockBijection(x);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X3.5-18 CanonicalBlocks[101X
  
  [29X[2XCanonicalBlocks[102X( [3Xblocks[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YBlocks of a bipartition.[133X
  
  [33X[0;0YIf  [3Xblocks[103X is the blocks of a bipartition, then the function [10XCanonicalBlocks[110X
  returns a canonical representative of [3Xblocks[103X.[133X
  
  [33X[0;0YIn  particular, let [10XC(n)[110X be a largest class such that any element of [10XC(n)[110X is
  blocks of a bipartition of degree [10Xn[110X and such that for every pair of elements
  [10Xx[110X  and [10Xy[110X of [10XC(n)[110X the number of signed, and similarly unsigned, blocks of any
  given  size  in  both  [10Xx[110X  and [10Xy[110X are the same. Then [10XCanonicalBlocks[110X returns a
  canonical  representative  of  a class [10XC(n)[110X containing [3Xblocks[103X where [10Xn[110X is the
  degree of [3Xblocks[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XB := BlocksNC([[-1, -3], [2, 4, 7], [5, 6]]);[127X[104X
    [4X[28X<blocks: [ 1, 3 ], [ 2*, 4*, 7* ], [ 5*, 6* ]>[128X[104X
    [4X[25Xgap>[125X [27XCanonicalBlocks(B);[127X[104X
    [4X[28X<blocks: [ 1*, 2*, 3* ], [ 4, 5 ], [ 6*, 7* ]>[128X[104X
  [4X[32X[104X
  
  
  [1X3.6 [33X[0;0YCreating blocks and their attributes[133X[101X
  
  [33X[0;0YAs  described  above the left and right blocks of a bipartition characterise
  Green's  [13XR[113X-  and  [13XL[113X-relation of the partition monoid; see [2XLeftBlocks[102X ([14X3.5-6[114X)
  and  [2XRightBlocks[102X  ([14X3.5-5[114X). The left or right blocks of a bipartition are [5XGAP[105X
  objects in their own right.[133X
  
  [33X[0;0YIn  this  section,  we  describe the functions in the [5XSemigroups[105X package for
  creating and manipulating the left or right blocks of a bipartition.[133X
  
  [1X3.6-1 IsBlocks[101X
  
  [29X[2XIsBlocks[102X( [3Xobj[103X ) [32X Category
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YEvery  blocks  object  in  [5XGAP[105X  belongs  to  the  category  [10XIsBlocks[110X.  Basic
  operations   for  blocks  are  [2XExtRepOfObj[102X  ([14X3.6-3[114X),  [2XRankOfBlocks[102X  ([14X3.6-4[114X),
  [2XDegreeOfBlocks[102X ([14X3.6-5[114X), [2XOnRightBlocks[102X ([14X3.7-1[114X), and [2XOnLeftBlocks[102X ([14X3.7-2[114X).[133X
  
  [1X3.6-2 BlocksNC[101X
  
  [29X[2XBlocksNC[102X( [3Xclasses[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA blocks.[133X
  
  [33X[0;0YThis  function makes it possible to create a [5XGAP[105X object corresponding to the
  left or right blocks of a bipartition without reference to any bipartitions.[133X
  
  [33X[0;0Y[10XBlocksNC[110X  returns  the blocks with equivalence classes [3Xclasses[103X, which should
  be  a list of duplicate-free lists consisting solely of positive or negative
  integers,  where  the  union of the absolute values of the lists is [10X[1 .. n][110X
  for some [10Xn[110X. The blocks with positive entries correspond to transverse blocks
  and the classes with negative entries correspond to non-transverse blocks.[133X
  
  [33X[0;0YThis method function does not check that its arguments are valid, and should
  be used with caution.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBlocksNC([[1], [2], [-3, -6], [-4, -5]]);[127X[104X
    [4X[28X<blocks: [ 1* ], [ 2* ], [ 3, 6 ], [ 4, 5 ]>[128X[104X
  [4X[32X[104X
  
  [1X3.6-3 ExtRepOfObj[101X
  
  [29X[2XExtRepOfObj[102X( [3Xblocks[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA list of integers.[133X
  
  [33X[0;0YIf  [10Xn[110X  is the degree of a bipartition with left or right blocks [3Xblocks[103X, then
  [10XExtRepOfObj[110X  returns  the partition corresponding to [3Xblocks[103X as a sorted list
  of duplicate-free lists.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xblocks := BlocksNC([[1, 6], [2, 3, 7], [4, 5], [-8]]);;[127X[104X
    [4X[25Xgap>[125X [27XExtRepOfObj(blocks);[127X[104X
    [4X[28X[ [ 1, 6 ], [ 2, 3, 7 ], [ 4, 5 ], [ -8 ] ][128X[104X
  [4X[32X[104X
  
  [1X3.6-4 RankOfBlocks[101X
  
  [29X[2XRankOfBlocks[102X( [3Xblocks[103X ) [32X attribute
  [29X[2XNrTransverseBlocks[102X( [3Xblocks[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YWhen  the  argument  [3Xblocks[103X  is  the  left or right blocks of a bipartition,
  [10XRankOfBlocks[110X returns the number of blocks of [3Xblocks[103X containing only positive
  entries, i.e. the number of transverse blocks in [3Xblocks[103X.[133X
  
  [33X[0;0Y[10XNrTransverseBlocks[110X is a synonym of [10XRankOfBlocks[110X in this context.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xblocks := BlocksNC([[-1, -2, -4, -6], [3, 10, 12], [5, 7],[127X[104X
    [4X[25X>[125X [27X                       [8], [9], [-11]]);;[127X[104X
    [4X[25Xgap>[125X [27XRankOfBlocks(blocks);[127X[104X
    [4X[28X4[128X[104X
  [4X[32X[104X
  
  [1X3.6-5 DegreeOfBlocks[101X
  
  [29X[2XDegreeOfBlocks[102X( [3Xblocks[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YThe degree of [3Xblocks[103X is the number of points [10Xn[110X where it is defined, i.e. the
  union  of  the  blocks  in [3Xblocks[103X will be [10X[1 .. n][110X after taking the absolute
  value of every element.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xblocks := BlocksNC([[-1, -11], [2], [3, 5, 6, 7], [4, 8], [9, 10],[127X[104X
    [4X[25X>[125X [27X                       [12]]);;[127X[104X
    [4X[25Xgap>[125X [27XDegreeOfBlocks(blocks);[127X[104X
    [4X[28X12[128X[104X
  [4X[32X[104X
  
  [1X3.6-6 ProjectionFromBlocks[101X
  
  [29X[2XProjectionFromBlocks[102X( [3Xblocks[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA bipartition.[133X
  
  [33X[0;0YWhen  the argument [3Xblocks[103X is the left or right blocks of a bipartition, this
  operation  returns  the  unique  bipartition whose left and right blocks are
  equal to [3Xblocks[103X.[133X
  
  [33X[0;0YIf [3Xblocks[103X is the left blocks of a bipartition [10Xx[110X, then this operation returns
  a  bipartition  equal  to  the left projection of [10Xx[110X. The analogous statement
  holds when [3Xblocks[103X is the right blocks of a bipartition.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1], [2, -2, -3], [3], [-1]]);[127X[104X
    [4X[28X<bipartition: [ 1 ], [ 2, -2, -3 ], [ 3 ], [ -1 ]>[128X[104X
    [4X[25Xgap>[125X [27XProjectionFromBlocks(LeftBlocks(x));[127X[104X
    [4X[28X<bipartition: [ 1 ], [ 2, -2 ], [ 3 ], [ -1 ], [ -3 ]>[128X[104X
    [4X[25Xgap>[125X [27XLeftProjection(x);[127X[104X
    [4X[28X<bipartition: [ 1 ], [ 2, -2 ], [ 3 ], [ -1 ], [ -3 ]>[128X[104X
    [4X[25Xgap>[125X [27XProjectionFromBlocks(RightBlocks(x));[127X[104X
    [4X[28X<bipartition: [ 1 ], [ 2, 3, -2, -3 ], [ -1 ]>[128X[104X
    [4X[25Xgap>[125X [27XRightProjection(x);[127X[104X
    [4X[28X<bipartition: [ 1 ], [ 2, 3, -2, -3 ], [ -1 ]>[128X[104X
  [4X[32X[104X
  
  
  [1X3.7 [33X[0;0YActions on blocks[133X[101X
  
  [33X[0;0YBipartitions  act  on  left  and  right  blocks  in  several ways, which are
  described in this section.[133X
  
  [1X3.7-1 OnRightBlocks[101X
  
  [29X[2XOnRightBlocks[102X( [3Xblocks[103X, [3Xx[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe blocks of a bipartition.[133X
  
  [33X[0;0Y[10XOnRightBlocks[110X  returns  the right blocks of the product [10Xg * [3Xx[103X[10X[110X where [10Xg[110X is any
  bipartition whose right blocks are equal to [3Xblocks[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 4, 5, 8], [2, 3, 7], [6, -3, -4, -5],[127X[104X
    [4X[25X>[125X [27X                     [-1, -2, -6], [-7, -8]]);;[127X[104X
    [4X[25Xgap>[125X [27Xy := Bipartition([[1, 5], [2, 4, 8, -2], [3, 6, 7, -3, -4],[127X[104X
    [4X[25X>[125X [27X                     [-1, -6, -8], [-5, -7]]);;[127X[104X
    [4X[25Xgap>[125X [27XRightBlocks(y * x);[127X[104X
    [4X[28X<blocks: [ 1, 2, 6 ], [ 3*, 4*, 5* ], [ 7, 8 ]>[128X[104X
    [4X[25Xgap>[125X [27XOnRightBlocks(RightBlocks(y), x);[127X[104X
    [4X[28X<blocks: [ 1, 2, 6 ], [ 3*, 4*, 5* ], [ 7, 8 ]>[128X[104X
  [4X[32X[104X
  
  [1X3.7-2 OnLeftBlocks[101X
  
  [29X[2XOnLeftBlocks[102X( [3Xblocks[103X, [3Xx[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe blocks of a bipartition.[133X
  
  [33X[0;0Y[10XOnLeftBlocks[110X  returns  the  left  blocks of the product [10X[3Xx[103X[10X * y[110X where [10Xy[110X is any
  bipartition whose left blocks are equal to [3Xblocks[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[1, 5, 7, -1, -3, -4, -6], [2, 3, 6, 8],[127X[104X
    [4X[25X>[125X [27X                     [4, -2, -5, -8], [-7]]);;[127X[104X
    [4X[25Xgap>[125X [27Xy := Bipartition([[1, 3, -4, -5], [2, 4, 5, 8], [6, -1, -3],[127X[104X
    [4X[25X>[125X [27X                     [7, -2, -6, -7, -8]]);;[127X[104X
    [4X[25Xgap>[125X [27XLeftBlocks(x * y);[127X[104X
    [4X[28X<blocks: [ 1*, 4*, 5*, 7* ], [ 2, 3, 6, 8 ]>[128X[104X
    [4X[25Xgap>[125X [27XOnLeftBlocks(LeftBlocks(y), x);[127X[104X
    [4X[28X<blocks: [ 1*, 4*, 5*, 7* ], [ 2, 3, 6, 8 ]>[128X[104X
  [4X[32X[104X
  
  
  [1X3.8 [33X[0;0YSemigroups of bipartitions[133X[101X
  
  [33X[0;0YSemigroups  and  monoids  of bipartitions 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 bipartitions
  using   [2XInverseSemigroup[102X  ([14XReference:  InverseSemigroup[114X)  and  [2XInverseMonoid[102X
  ([14XReference:  InverseMonoid[114X)  when  the  argument  is  a  collection of block
  bijections  or  partial  perm  bipartions; see [2XIsBlockBijection[102X ([14X3.5-16[114X) and
  [2XIsPartialPermBipartition[102X  ([14X3.5-15[114X). Note that every bipartition semigroup in
  [5XSemigroups[105X is finite.[133X
  
  [1X3.8-1 IsBipartitionSemigroup[101X
  
  [29X[2XIsBipartitionSemigroup[102X( [3XS[103X ) [32X filter
  [29X[2XIsBipartitionMonoid[102X( [3XS[103X ) [32X filter
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA [13Xbipartition semigroup[113X is simply a semigroup consisting of bipartitions. An
  object  [3Xobj[103X  is  a  bipartition semigroup in [5XGAP[105X if it satisfies [2XIsSemigroup[102X
  ([14XReference: IsSemigroup[114X) and [2XIsBipartitionCollection[102X ([14X3.1-2[114X).[133X
  
  [33X[0;0YA  [13Xbipartition  monoid[113X is a monoid consisting of bipartitions. An object [3Xobj[103X
  is  a  bipartition  monoid  in  [5XGAP[105X  if  it  satisfies  [2XIsMonoid[102X ([14XReference:
  IsMonoid[114X) and [2XIsBipartitionCollection[102X ([14X3.1-2[114X).[133X
  
  [33X[0;0YNote   that   it   is  possible  for  a  bipartition  semigroup  to  have  a
  multiplicative neutral element (i.e. an identity element) but not to satisfy
  [10XIsBipartitionMonoid[110X. For example,[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Bipartition([[127X[104X
    [4X[25X>[125X [27X[1, 4, -2], [2, 5, -6], [3, -7], [6, 7, -9], [8, 9, -1],[127X[104X
    [4X[25X>[125X [27X[10, -5], [-3], [-4], [-8], [-10]]);;[127X[104X
    [4X[25Xgap>[125X [27XS := Semigroup(x, One(x));[127X[104X
    [4X[28X<commutative bipartition monoid of degree 10 with 1 generator>[128X[104X
    [4X[25Xgap>[125X [27XIsMonoid(S);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsBipartitionMonoid(S);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XS := Semigroup([[127X[104X
    [4X[25X>[125X [27XBipartition([[127X[104X
    [4X[25X>[125X [27X  [1, -3], [2, -8], [3, 8, -1], [4, -4], [5, -5], [6, -6],[127X[104X
    [4X[25X>[125X [27X  [7, -7], [9, 10, -10], [-2], [-9]]),[127X[104X
    [4X[25X>[125X [27XBipartition([[127X[104X
    [4X[25X>[125X [27X  [1, -1], [2, -2], [3, -3], [4, -4], [5, -5], [6, -6],[127X[104X
    [4X[25X>[125X [27X  [7, -7], [8, -8], [9, 10, -10], [-9]])]);;[127X[104X
    [4X[25Xgap>[125X [27XOne(S);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27XMultiplicativeNeutralElement(S);[127X[104X
    [4X[28X<bipartition: [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ], [ 5, -5 ], [128X[104X
    [4X[28X [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, 10, -10 ], [ -9 ]>[128X[104X
    [4X[25Xgap>[125X [27XIsMonoid(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
  
  [1X3.8-2 IsBlockBijectionSemigroup[101X
  
  [29X[2XIsBlockBijectionSemigroup[102X( [3XS[103X ) [32X property
  [29X[2XIsBlockBijectionMonoid[102X( [3XS[103X ) [32X filter
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA  [13Xblock  bijection  semigroup[113X  is  simply  a  semigroup consisting of block
  bijections.  A  [13Xblock  bijection  monoid[113X  is  a  monoid  consisting of block
  bijections.[133X
  
  [33X[0;0YAn  object  in  [5XGAP[105X  is  a  block  bijection monoid if it satisfies [2XIsMonoid[102X
  ([14XReference: IsMonoid[114X) and [2XIsBlockBijectionSemigroup[102X.[133X
  
  [33X[0;0YSee [2XIsBlockBijection[102X ([14X3.5-16[114X).[133X
  
  [1X3.8-3 IsPartialPermBipartitionSemigroup[101X
  
  [29X[2XIsPartialPermBipartitionSemigroup[102X( [3XS[103X ) [32X property
  [29X[2XIsPartialPermBipartitionMonoid[102X( [3XS[103X ) [32X filter
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA  [13Xpartial  perm  bipartition  semigroup[113X is simply a semigroup consisting of
  partial  perm  bipartitions.  A  [13Xpartial perm bipartition monoid[113X is a monoid
  consisting of partial perm bipartitions.[133X
  
  [33X[0;0YAn  object  in  [5XGAP[105X  is  a  partial  perm bipartition monoid if it satisfies
  [2XIsMonoid[102X ([14XReference: IsMonoid[114X) and [2XIsPartialPermBipartitionSemigroup[102X.[133X
  
  [33X[0;0YSee [2XIsPartialPermBipartition[102X ([14X3.5-15[114X).[133X
  
  [1X3.8-4 IsPermBipartitionGroup[101X
  
  [29X[2XIsPermBipartitionGroup[102X( [3XS[103X ) [32X property
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YA   [13Xperm  bipartition  group[113X  is  simply  a  semigroup  consisting  of  perm
  bipartitions.[133X
  
  [33X[0;0YSee [2XIsPermBipartition[102X ([14X3.5-14[114X).[133X
  
  [1X3.8-5 DegreeOfBipartitionSemigroup[101X
  
  [29X[2XDegreeOfBipartitionSemigroup[102X( [3XS[103X ) [32X attribute
  [6XReturns:[106X  [33X[0;10YA non-negative integer.[133X
  
  [33X[0;0YThe  [13Xdegree[113X  of  a  bipartition  semigroup  [3XS[103X is just the degree of any (and
  every) element of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDegreeOfBipartitionSemigroup(JonesMonoid(8));[127X[104X
    [4X[28X8[128X[104X
  [4X[32X[104X
  
