############################################################################
##
#W  attrinv.xml
#Y  Copyright (C) 2011-15                                James D. Mitchell
##                                                          Wilf A. Wilson
##                                                        Rhiannon Dougall
##                                                          Robert Hancock
##                                                           Casey Donoven
##
##  Licensing information can be found in the README file of this package.
##
#############################################################################
##

<#GAPDoc Label="NaturalLeqInverseSemigroup">
<ManSection>
<Attr Name="NaturalLeqInverseSemigroup" Arg="S"/>
  <Returns>
    An function.
  </Returns>
  <Description>
    <C>NaturalLeqInverseSemigroup</C> returns a function that, when given two
    elements <C>x, y</C> of the inverse semigroup <A>S</A>, returns <K>true</K>
    if <C>x</C> is less than or equal to <C>y</C> in the natural partial order
    on <A>S</A>.
<Example><![CDATA[
gap> S := Monoid(Transformation([1, 3, 4, 4]),
>                Transformation([1, 4, 2, 4]));
<transformation monoid of degree 4 with 2 generators>
gap> IsInverseSemigroup(S);
true
gap> Size(S);
6
gap> NaturalPartialOrder(S);
[ [ 2, 5, 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [  ] ]]]></Example>
  </Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="CharacterTableOfInverseSemigroup" >
  <ManSection>
    <Attr Name="CharacterTableOfInverseSemigroup" Arg = "S"/>
    <Returns>
      The character table of the inverse semigroup <A>S</A> and a list
      of conjugacy class representatives of <A>S</A>.
    </Returns>
    <Description>
      Returns a list with two entries: the first entry being the character table
      of the inverse semigroup <A>S</A> as a matrix, while the second entry is a
      list of conjugacy class representatives of <A>S</A>. <P/>

      The order of the columns in the character table matrix follows the order of
      the conjugacy class representatives list. The conjugacy representatives are
      grouped by &D;-class and then sorted by rank. Also, as is typical of
      character tables, the rows of the matrix correspond to the irreducible
      characters and the columns correspond to the conjugacy classes. <P/>

      This function was contributed by Jhevon Smith and Ben Steinberg.
      <Example><![CDATA[
gap> S := InverseMonoid([
>   PartialPerm([1, 2], [3, 1]),
>  PartialPerm([1, 2, 3], [1, 3, 4]),
>  PartialPerm([1, 2, 3], [2, 4, 1]),
>  PartialPerm([1, 3, 4], [3, 4, 1])]);;
gap> CharacterTableOfInverseSemigroup(S);
[ [ [ 1, 0, 0, 0, 0, 0, 0, 0 ], [ 3, 1, 1, 1, 0, 0, 0, 0 ],
      [ 3, 1, E(3), E(3)^2, 0, 0, 0, 0 ],
      [ 3, 1, E(3)^2, E(3), 0, 0, 0, 0 ], [ 6, 3, 0, 0, 1, -1, 0, 0 ],
      [ 6, 3, 0, 0, 1, 1, 0, 0 ], [ 4, 3, 0, 0, 2, 0, 1, 0 ],
      [ 1, 1, 1, 1, 1, 1, 1, 1 ] ],
  [ <identity partial perm on [ 1, 2, 3, 4 ]>,
      <identity partial perm on [ 1, 3, 4 ]>, (1,3,4), (1,4,3),
      <identity partial perm on [ 1, 3 ]>, (1,3),
      <identity partial perm on [ 3 ]>, <empty partial perm> ] ]
gap> S := SymmetricInverseMonoid(4);;
gap> CharacterTableOfInverseSemigroup(S);
[ [ [ 1, -1, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0 ],
      [ 3, -1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0 ],
      [ 2, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0 ],
      [ 3, 1, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0 ],
      [ 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 ],
      [ 4, -2, 1, 0, 0, 1, -1, 1, 0, 0, 0, 0 ],
      [ 8, 0, -1, 0, 0, 2, 0, -1, 0, 0, 0, 0 ],
      [ 4, 2, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0 ],
      [ 6, 0, 0, -2, 0, 3, -1, 0, 1, -1, 0, 0 ],
      [ 6, 2, 0, 2, 0, 3, 1, 0, 1, 1, 0, 0 ],
      [ 4, 2, 1, 0, 0, 3, 1, 0, 2, 0, 1, 0 ],
      [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ],
  [ <identity partial perm on [ 1, 2, 3, 4 ]>, (1)(2)(3,4),
      (1)(2,3,4), (1,2)(3,4), (1,2,3,4),
      <identity partial perm on [ 1, 2, 3 ]>, (1)(2,3), (1,2,3),
      <identity partial perm on [ 2, 3 ]>, (2,3),
      <identity partial perm on [ 1 ]>, <empty partial perm> ] ]]]></Example>
    </Description>
  </ManSection>
<#/GAPDoc>

<#GAPDoc Label="PrimitiveIdempotents">
<ManSection>
  <Attr Name = "PrimitiveIdempotents" Arg = "S"/>
  <Returns>A list of elements.</Returns>
  <Description>
    An idempotent in an inverse semigroup <A>S</A> is <E>primitive</E> if it is
    non-zero and minimal with respect to the
    <Ref Attr="NaturalPartialOrder" BookName="ref"/> on <A>S</A>.
    <C>PrimitiveIdempotents</C> returns the list of primitive idempotents in
    the inverse semigroup <A>S</A>.
    <Example><![CDATA[
gap> S := InverseMonoid(
> PartialPerm([1], [4]),
> PartialPerm([1, 2, 3], [2, 1, 3]),
> PartialPerm([1, 2, 3], [3, 1, 2]));;
gap> MultiplicativeZero(S);
<empty partial perm>
gap> Set(PrimitiveIdempotents(S));
[ <identity partial perm on [ 1 ]>, <identity partial perm on [ 2 ]>,
  <identity partial perm on [ 3 ]>, <identity partial perm on [ 4 ]> ]
gap> S := DualSymmetricInverseMonoid(4);
<inverse block bijection monoid of degree 4 with 3 generators>
gap> Set(PrimitiveIdempotents(S));
[ <block bijection: [ 1, 2, 3, -1, -2, -3 ], [ 4, -4 ]>,
  <block bijection: [ 1, 2, 4, -1, -2, -4 ], [ 3, -3 ]>,
  <block bijection: [ 1, 2, -1, -2 ], [ 3, 4, -3, -4 ]>,
  <block bijection: [ 1, 3, 4, -1, -3, -4 ], [ 2, -2 ]>,
  <block bijection: [ 1, 3, -1, -3 ], [ 2, 4, -2, -4 ]>,
  <block bijection: [ 1, 4, -1, -4 ], [ 2, 3, -2, -3 ]>,
  <block bijection: [ 1, -1 ], [ 2, 3, 4, -2, -3, -4 ]> ]]]></Example>
  </Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="IsJoinIrreducible">
<ManSection>
<Oper Name="IsJoinIrreducible" Arg="S, x"/>
  <Returns>
    <K>true</K> or <K>false</K>.
  </Returns>
  <Description>
    <C>IsJoinIrreducible</C> determines whether an element <A>x</A> of an
    inverse semigroup <A>S</A> of partial permutations, block bijections or
    partial permutation bipartitions is join irreducible.<P/>

    An element <A>x</A> is <E>join irreducible</E> when it is not the least
    upper bound (with respect to the natural partial order
    <Ref Func = "NaturalLeqPartialPerm" BookName="ref"/>) of any subset of
    <A>S</A> not containing <A>x</A>.
  </Description>
</ManSection>
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(3);
<symmetric inverse monoid of degree 3>
gap> x := PartialPerm([1, 2, 3]);
<identity partial perm on [ 1, 2, 3 ]>
gap> IsJoinIrreducible(S, x);
false
gap> T := InverseSemigroup([
>  PartialPerm([1, 2, 4, 3]),
>  PartialPerm([1]),
>  PartialPerm([0, 2])]);
<inverse partial perm semigroup of rank 4 with 3 generators>
gap> y := PartialPerm([1, 2, 3, 4]);
<identity partial perm on [ 1, 2, 3, 4 ]>
gap> IsJoinIrreducible(T, y);
true
gap> B := InverseSemigroup([
>  Bipartition([
>    [1, -5], [2, -2], [3, 5, 6, 7, -1, -4, -6, -7], [4, -3]]),
>  Bipartition([
>    [1, -1], [2, -3], [3, -4], [4, 5, 7, -2, -6, -7], [6, -5]]),
>  Bipartition([
>    [1, -2], [2, -4], [3, -6], [4, -1], [5, 7, -3, -7], [6, -5]]),
>  Bipartition([
>    [1, -5], [2, -1], [3, -6], [4, 5, 7, -2, -4, -7], [6, -3]])]);
<inverse block bijection semigroup of degree 7 with 4 generators>
gap> x := Bipartition([
>   [1, 2, 3, 5, 6, 7, -2, -3, -4, -5, -6, -7], [4, -1]]);
<block bijection: [ 1, 2, 3, 5, 6, 7, -2, -3, -4, -5, -6, -7 ],
 [ 4, -1 ]>
gap> IsJoinIrreducible(B, x);
true
gap> IsJoinIrreducible(B, B.1);
false]]></Example>
<#/GAPDoc>

<#GAPDoc Label="IsMajorantlyClosed">
<ManSection>
<Oper Name="IsMajorantlyClosed" Arg="S, T"/>
<Returns>
  <K>true</K> or <K>false</K>.
</Returns>
<Description>
  <C>IsMajorantlyClosed</C> determines whether the subset <A>T</A> of the
  inverse semigroup of partial permutations, block bijections or partial
  permutation bipartitions <A>S</A> is majorantly closed in <A>S</A>. See also
  <Ref Oper="MajorantClosure"/>.<P/>

  We say that <A>T</A> is <E>majorantly closed</E> in <A>S</A> if it
  contains all elements of <A>S</A> which are greater than or equal to any
  element of <A>T</A>, with respect to the natural partial order.
  See <Ref Func = "NaturalLeqPartialPerm" BookName="ref"/>.<P/>

  Note that <A>T</A> can be a subset of <A>S</A> or a subsemigroup of <A>S</A>.
</Description>
</ManSection>
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(2);
<symmetric inverse monoid of degree 2>
gap> T := [Elements(S)[2]];
[ <identity partial perm on [ 1 ]> ]
gap> IsMajorantlyClosed(S, T);
false
gap> U := [Elements(S)[2], Elements(S)[6]];
[ <identity partial perm on [ 1 ]>, <identity partial perm on [ 1, 2 ]
    > ]
gap> IsMajorantlyClosed(S, U);
true
gap> D := DualSymmetricInverseSemigroup(3);
<inverse block bijection monoid of degree 3 with 3 generators>
gap> x := Bipartition([[1, -2], [2, -3], [3, -1]]);;
gap> IsMajorantlyClosed(D, [x]);
true
gap> y := Bipartition([[1, 2, -1, -2], [3, -3]]);;
gap> IsMajorantlyClosed(D, [x, y]);
false
]]></Example>
<#/GAPDoc>

<#GAPDoc Label="JoinIrreducibleDClasses">
<ManSection>
<Attr Name="JoinIrreducibleDClasses" Arg="S"/>
  <Returns>
    A list of &D;-classes.
  </Returns>
  <Description>
    <C>JoinIrreducibleDClasses</C> returns a list of the join irreducible
    &D;-classes of the inverse semigroup of partial permutations, block
    bijections or partial permutation bipartitions <A>S</A>.<P/>

    A <E>join irreducible &D;-class</E> is a &D;-class containing only join
    irreducible elements.  See <Ref Oper="IsJoinIrreducible"/>.
    If a &D;-class contains one join irreducible element, then all of the
    elements in the &D;-class are join irreducible.
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(3);
<symmetric inverse monoid of degree 3>
gap> JoinIrreducibleDClasses(S);
[ <Green's D-class: <identity partial perm on [ 2 ]>> ]
gap> T := InverseSemigroup([
>   PartialPerm([1, 2, 4, 3]),
>   PartialPerm([1]),
>   PartialPerm([0, 2])]);
<inverse partial perm semigroup of rank 4 with 3 generators>
gap> JoinIrreducibleDClasses(T);
[ <Green's D-class: <identity partial perm on [ 1, 2, 3, 4 ]>>,
  <Green's D-class: <identity partial perm on [ 1 ]>>,
  <Green's D-class: <identity partial perm on [ 2 ]>> ]
gap> D := DualSymmetricInverseSemigroup(3);
<inverse block bijection monoid of degree 3 with 3 generators>
gap> JoinIrreducibleDClasses(D);
[ <Green's D-class: <block bijection: [ 1, 2, -1, -2 ], [ 3, -3 ]>> ]]]></Example>
  </Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="MajorantClosure">
<ManSection>
<Oper Name="MajorantClosure" Arg="S,T"/>
  <Returns>
    A majorantly closed list of elements.
  </Returns>
  <Description>
    <C>MajorantClosure</C> returns a majorantly closed subset of an inverse
    semigroup of partial permutations, block bijections or partial permutation
    bipartitions, <A>S</A>, as a list. See <Ref Oper="IsMajorantlyClosed"/>.<P/>
    The result contains all elements of <A>S</A> which are greater than or
    equal to any element of <A>T</A> (with respect to the natural partial
    order <Ref Func = "NaturalLeqPartialPerm" BookName="ref"/>).
    In particular, the result is a superset of <A>T</A>.<P/>
    Note that <A>T</A> can be a subset of <A>S</A> or a subsemigroup of <A>S</A>.
  </Description>
</ManSection>
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(4);
<symmetric inverse monoid of degree 4>
gap> T := [PartialPerm([1, 0, 3, 0])];
[ <identity partial perm on [ 1, 3 ]> ]
gap> U := MajorantClosure(S, T);
[ <identity partial perm on [ 1, 3 ]>,
  <identity partial perm on [ 1, 2, 3 ]>, [2,4](1)(3), [4,2](1)(3),
  <identity partial perm on [ 1, 3, 4 ]>,
  <identity partial perm on [ 1, 2, 3, 4 ]>, (1)(2,4)(3) ]
gap> B := InverseSemigroup([
>  Bipartition([[1, -2], [2, -1], [3, -3], [4, 5, -4, -5]]),
>  Bipartition([[1, -3], [2, -4], [3, -2], [4, -1], [5, -5]])]);;
gap> T := [Bipartition([[1, -2], [2, 3, 5, -1, -3, -5], [4, -4]]),
>  Bipartition([[1, -4], [2, 3, 5, -1, -3, -5], [4, -2]])];;
gap> IsMajorantlyClosed(B, T);
false
gap> MajorantClosure(B, T);
[ <block bijection: [ 1, -2 ], [ 2, 3, 5, -1, -3, -5 ], [ 4, -4 ]>,
  <block bijection: [ 1, -4 ], [ 2, 3, 5, -1, -3, -5 ], [ 4, -2 ]>,
  <block bijection: [ 1, -2 ], [ 2, 5, -1, -5 ], [ 3, -3 ], [ 4, -4 ]>
    , <block bijection: [ 1, -2 ], [ 2, -1 ], [ 3, 5, -3, -5 ],
     [ 4, -4 ]>,
  <block bijection: [ 1, -4 ], [ 2, 5, -3, -5 ], [ 3, -1 ], [ 4, -2 ]>
    , <block bijection: [ 1, -4 ], [ 2, -3 ], [ 3, 5, -1, -5 ],
     [ 4, -2 ]>, <block bijection: [ 1, -4 ], [ 2, -3 ], [ 3, -1 ],
     [ 4, -2 ], [ 5, -5 ]> ]
gap> IsMajorantlyClosed(B, last);
true
]]></Example>
<#/GAPDoc>

<#GAPDoc Label="Minorants">
<ManSection>
<Oper Name="Minorants" Arg="S,f"/>
  <Returns>
    A list of elements.
  </Returns>
  <Description>
    <C>Minorants</C> takes an element <A>f</A> from an inverse semigroup of
    partial permutations, block bijections or partial permutation bipartitions
    <A>S</A>, and returns a list of the minorants of <A>f</A> in <A>S</A>. <P/>

    A <E>minorant</E> of <A>f</A> is an element of <A>S</A> which is strictly
    less than <A>f</A> in the natural partial order of <A>S</A>.
    See <Ref Attr="NaturalLeqPartialPerm" BookName="ref" />.
  </Description>
</ManSection>
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(3);
<symmetric inverse monoid of degree 3>
gap> x := Elements(S)[13];
[1,3](2)
gap> Minorants(S, x);
[ <empty partial perm>, [1,3], <identity partial perm on [ 2 ]> ]
gap> x := PartialPerm([3, 2, 4, 0]);
[1,3,4](2)
gap> S := InverseSemigroup(x);
<inverse partial perm semigroup of rank 4 with 1 generator>
gap> Minorants(S, x);
[ <identity partial perm on [ 2 ]>, [1,3](2), [3,4](2) ]]]></Example>
<#/GAPDoc>

<#GAPDoc Label="RightCosetsOfInverseSemigroup">
<ManSection>
<Oper Name="RightCosetsOfInverseSemigroup" Arg="S,T"/>
  <Returns>
    A list of lists of elements.
  </Returns>
  <Description>
    <C>RightCosetsOfInverseSemigroup</C> takes a majorantly closed inverse
    subsemigroup <A>T</A>  of an inverse semigroup of partial permutations,
    block bijections or partial permutation bipartitions <A>S</A>. See
    <Ref Oper="IsMajorantlyClosed"/>. The result is a list of the right cosets
    of <A>T</A> in <A>S</A>.<P/>
    For <M>s \in S</M>, the right coset <M>\overline{Ts}</M> is defined if and
    only if <M>ss^{-1} \in T</M>, in which case it is defined to be the
    majorant closure of the set <M>Ts</M>. See <Ref Oper="MajorantClosure"/>.
    Distinct cosets are disjoint but do not necessarily partition <A>S</A>.
  </Description>
</ManSection>
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(3);
<symmetric inverse monoid of degree 3>
gap> T := InverseSemigroup(MajorantClosure(S, [PartialPerm([1])]));
<inverse partial perm monoid of rank 3 with 6 generators>
gap> IsMajorantlyClosed(S, T);
true
gap> RC := RightCosetsOfInverseSemigroup(S, T);
[ [ <identity partial perm on [ 1 ]>,
      <identity partial perm on [ 1, 2 ]>, [2,3](1), [3,2](1),
      <identity partial perm on [ 1, 3 ]>,
      <identity partial perm on [ 1, 2, 3 ]>, (1)(2,3) ],
  [ [1,3], [2,1,3], [1,3](2), (1,3), [1,3,2], (1,3,2), (1,3)(2) ],
  [ [1,2], (1,2), [1,2,3], [3,1,2], [1,2](3), (1,2)(3), (1,2,3) ] ]]]></Example>
<#/GAPDoc>

<#GAPDoc Label="SameMinorantsSubgroup">
<ManSection>
<Attr Name="SameMinorantsSubgroup" Arg="H"/>
  <Returns>
    A list of elements of the group &H;-class <A>H</A>.
  </Returns>
  <Description>
    Given a group &H;-class <A>H</A> in an inverse semigroup of partial
    permutations, block bijections or partial permutation bipartitions <C>S</C>,
    <C>SameMinorantsSubgroup</C> returns a list of the elements of <A>H</A>
    which have the same strict minorants as the identity element of <A>H</A>.

    A <E>strict minorant</E> of <C>x</C> in <A>H</A> is an element of <C>S</C>
    which is less than <C>x</C> (with respect to the natural partial order),
    but is not equal to <C>x</C>.<P/>

    The returned list of elements of <A>H</A> describe a subgroup of <A>H</A>.
  </Description>
</ManSection>
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(3);
<symmetric inverse monoid of degree 3>
gap> H := GroupHClass(DClass(S, PartialPerm([1, 2, 3])));
<Green's H-class: <identity partial perm on [ 1, 2, 3 ]>>
gap> Elements(H);
[ <identity partial perm on [ 1, 2, 3 ]>, (1)(2,3), (1,2)(3),
  (1,2,3), (1,3,2), (1,3)(2) ]
gap> SameMinorantsSubgroup(H);
[ <identity partial perm on [ 1, 2, 3 ]> ]
gap> T := InverseSemigroup(
> PartialPerm([1, 2, 3, 4], [1, 2, 4, 3]),
> PartialPerm([1], [1]), PartialPerm([2], [2]));
<inverse partial perm semigroup of rank 4 with 3 generators>
gap> Elements(T);
[ <empty partial perm>, <identity partial perm on [ 1 ]>,
  <identity partial perm on [ 2 ]>,
  <identity partial perm on [ 1, 2, 3, 4 ]>, (1)(2)(3,4) ]
gap> x := GroupHClass(DClass(T, PartialPerm([1, 2, 3, 4])));
<Green's H-class: <identity partial perm on [ 1, 2, 3, 4 ]>>
gap> Elements(x);
[ <identity partial perm on [ 1, 2, 3, 4 ]>, (1)(2)(3,4) ]
gap> AsSet(SameMinorantsSubgroup(x));
[ <identity partial perm on [ 1, 2, 3, 4 ]>, (1)(2)(3,4) ]]]></Example>
<#/GAPDoc>

<#GAPDoc Label="SmallerDegreePartialPermRepresentation">
<ManSection>
<Attr Name="SmallerDegreePartialPermRepresentation" Arg="S"/>
  <Returns>
    An isomorphism.
  </Returns>
  <Description>
    <C>SmallerDegreePartialPermRepresentation</C> attempts to find an
    isomorphism from the inverse semigroup <A>S</A> to
    an inverse semigroup of partial permutations with small degree.
    If <A>S</A> is already a partial permutation semigroup, and the function
    cannot reduce the degree, the identity mapping is returned. <P/>

    There is no guarantee that the smallest possible degree
    representation is returned. For more information see
    <Cite Key ="Schein1992aa"/>.
  </Description>
</ManSection>
<Example><![CDATA[
gap> S := InverseSemigroup(PartialPerm([2, 1, 4, 3, 6, 5, 8, 7]));
<partial perm group of rank 8 with 1 generator>
gap> Elements(S);
[ <identity partial perm on [ 1, 2, 3, 4, 5, 6, 7, 8 ]>,
  (1,2)(3,4)(5,6)(7,8) ]
gap> iso := SmallerDegreePartialPermRepresentation(S);;
gap> Source(iso) = S;
true
gap> R := Range(iso);
<partial perm group of rank 2 with 1 generator>
gap> Elements(R);
[ <identity partial perm on [ 1, 2 ]>, (1,2) ]
gap> S := DualSymmetricInverseMonoid(5);;
gap> T := Range(IsomorphismPartialPermSemigroup(S));
<inverse partial perm monoid of size 6721, rank 6721 with 3
 generators>
gap> SmallerDegreePartialPermRepresentation(T);
<inverse partial perm monoid of size 6721, rank 6721 with 3
  generators> -> <inverse partial perm monoid of rank 30 with 3
  generators>]]></Example>
<#/GAPDoc>

<#GAPDoc Label="VagnerPrestonRepresentation">
<ManSection>
  <Attr Name="VagnerPrestonRepresentation" Arg="S"/>
  <Returns>
    An isomorphism to an inverse semigroup of partial permutations.
  </Returns>
  <Description>
    <C>VagnerPrestonRepresentation</C> returns an isomorphism from an inverse
    semigroup <A>S</A> where the elements of <A>S</A> have a unique semigroup
    inverse accessible via <Ref Attr="Inverse" BookName="ref"/>, to the inverse
    semigroup of partial permutations <A>T</A> of degree equal to the size of
    <A>S</A>, which is obtained using the Vagner-Preston Representation Theorem.
    <P/>

    More precisely, if <M>f:S\to T</M> is the isomorphism returned by
    <C>VagnerPrestonRepresentation(<A>S</A>)</C> and <M>x</M> is in <A>S</A>,
    then <M>f(x)</M> is the partial permutation with domain <M>Sx^{-1}</M> and
    range <M>Sx^{-1}x</M> defined by <M>f(x): sx^{-1}\mapsto sx^{-1}x</M>. <P/>

    In many cases, it is possible to find a smaller degree representation than
    that provided by <C>VagnerPrestonRepresentation</C> using
    <Ref Oper="IsomorphismPartialPermSemigroup" BookName="ref" /> or
    <Ref Attr="SmallerDegreePartialPermRepresentation"/>.
  </Description>
</ManSection>
<Example><![CDATA[
gap> S := SymmetricInverseSemigroup(2);
<symmetric inverse monoid of degree 2>
gap> Size(S);
7
gap> iso := VagnerPrestonRepresentation(S);
<symmetric inverse monoid of degree 2> ->
<inverse partial perm monoid of rank 7 with 2 generators>
gap> RespectsMultiplication(iso);
true
gap> inv := InverseGeneralMapping(iso);;
gap> ForAll(S, x -> (x ^ iso) ^ inv = x);
true
gap> V := InverseSemigroup(
> Bipartition([[1, -4], [2, -1], [3, -5], [4], [5], [-2], [-3]]),
> Bipartition([[1, -5], [2, -1], [3, -3], [4], [5], [-2], [-4]]),
> Bipartition([[1, -2], [2, -4], [3, -5], [4, -1], [5, -3]]));
<inverse bipartition semigroup of degree 5 with 3 generators>
gap> IsInverseSemigroup(V);
true
gap> VagnerPrestonRepresentation(V);
<inverse bipartition semigroup of size 394, degree 5 with 3
  generators> -> <inverse partial perm semigroup of rank 394 with 5
  generators>]]></Example>
<#/GAPDoc>
