
<Section Label="sect:IsInverseSemigroup">
  <Heading>Inverse semigroups and monoids</Heading>
  <ManSection>
    <Func Name="InverseSemigroup"  Arg="obj1, obj2, ... "/>
    <Returns>An inverse semigroup.</Returns>
    <Description>
      If <A>obj1</A>, <A>obj2</A>, ... are (any combination) of
      associative elements with unique semigroup inverses,
      semigroups of such elements, or collections of such elements, then
      <C>InverseSemigroup</C>
      returns the inverse semigroup generated by the union of
      <A>obj1</A>, <A>obj2</A>, .... This equals the semigroup generated by the
      union of <A>obj1</A>, <A>obj2</A>, ... and their inverses.<P/>

      For example if <C>S</C> and <C>T</C> are inverse semigroups, then
      <C>InverseSemigroup(S, f, Idempotents(T));</C> is the inverse semigroup
      generated by
      <C>Union(GeneratorsOfInverseSemigroup(S), [f], Idempotents(T)));</C>.<P/>

      As present, the only associative elements with unique semigroup inverses,
      which do not always generate a group, are partial permutations; see
      Chapter <Ref Chap="Partial permutations"/>.

      <Example>
gap> S := InverseSemigroup(
> PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] ) );;
gap> f := PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ],
> [ 7, 1, 4, 3, 2, 6, 5 ] );;
gap> S := InverseSemigroup(S, f, Idempotents(SymmetricInverseSemigroup(5)));
&lt;inverse partial perm semigroup of rank 10 with 34 generators>
gap> Size(S);
1233</Example>
  </Description>
  </ManSection>

  <ManSection>
    <Func Name="InverseMonoid"  Arg="obj1, obj2, ... "/>
    <Returns>An inverse monoid.</Returns>
    <Description>
      If <A>obj1</A>, <A>obj2</A>, ... are (any combination) of
      associative elements with unique semigroup inverses,
      semigroups of such elements, or collections of such elements, then
      <C>InverseMonoid</C>
      returns the inverse monoid generated by the union of
      <A>obj1</A>, <A>obj2</A>, .... This equals the monoid generated by the
      union of <A>obj1</A>, <A>obj2</A>, ... and their inverses.<P/>

      As present, the only associative elements with unique semigroup inverses
      are partial permutations; see Chapter
      <Ref Chap="Partial permutations"/>.<P/>

      For example if <C>S</C> and <C>T</C> are inverse monoids, then
      <C>InverseMonoid(S, f, Idempotents(T));</C> is the inverse monoid
      generated by
      <C>Union(GeneratorsOfInverseMonoid(S), [f], Idempotents(T)));</C>.
      <Example>
gap> S := InverseMonoid(
> PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] ) );;
gap> f := PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ],
> [ 7, 1, 4, 3, 2, 6, 5 ] );;
gap> S := InverseMonoid(S, f, Idempotents(SymmetricInverseSemigroup(5)));
&lt;inverse partial perm monoid of rank 10 with 35 generators>
gap> Size(S);
1243</Example>
  </Description>
  </ManSection>

<ManSection>
  <Attr Name="GeneratorsOfInverseSemigroup" Arg="S"/>
  <Returns>The generators of an inverse semigroup.</Returns>
  <Description>
    If <A>S</A> is an inverse semigroup, then
    <C>GeneratorsOfInverseSemigroup</C> returns the generators used to define
    <A>S</A>, i.e. an inverse semigroup
    generating set for <A>S</A>. <P/>

    The value of <C>GeneratorsOfSemigroup(<A>S</A>)</C>, for an inverse
    semigroup <A>S</A>, is the union of
    inverse semigroup generator and their inverses.
    So, <A>S</A> is the semigroup, as opposed to inverse semigroup,
    generated by the elements of <C>GeneratorsOfInverseSemigroup(<A>S</A>)</C>
    and their inverses.  <P/>

    If <A>S</A> is an inverse monoid, then <C>GeneratorsOfInverseSemigroup</C>
    returns the generators used to define <A>S</A>, as
    described above, and the identity of <A>S</A>.

    <Example><![CDATA[
gap> S:=InverseMonoid(
>  PartialPerm( [ 1, 2 ], [ 1, 4 ] ),
>  PartialPerm( [ 1, 2, 4 ], [ 3, 4, 1 ] ) );;
gap> GeneratorsOfSemigroup(S);
[ <identity partial perm on [ 1, 2, 3, 4 ]>, [2,4](1), [2,4,1,3],
  [4,2](1), [3,1,4,2] ]
gap> GeneratorsOfInverseSemigroup(S);
[ [2,4](1), [2,4,1,3], <identity partial perm on [ 1, 2, 3, 4 ]> ]
gap> GeneratorsOfMonoid(S);
[ [2,4](1), [2,4,1,3], [4,2](1), [3,1,4,2] ]]]></Example>
  </Description>
</ManSection>

<ManSection>
  <Attr Name="GeneratorsOfInverseMonoid" Arg="S"/>
  <Returns>The generators of an inverse monoid.</Returns>
  <Description>
    If <A>S</A> is an inverse monoid, then
    <C>GeneratorsOfInverseMonoid</C> returns the generators used to
    define <A>S</A>, i.e. an inverse monoid
    generating set for <A>S</A>. <P/>

    There are four different possible generating sets which define an inverse
    monoid. More precisely, an inverse monoid can be generated as an inverse
    monoid, inverse semigroup, monoid, or semigroup. The different generating
    sets in each case can be obtained using
    <Ref Attr="GeneratorsOfInverseMonoid"/>,
    <Ref Attr="GeneratorsOfInverseSemigroup"/>,
    <Ref Attr="GeneratorsOfMonoid"/>, and
    <Ref Attr="GeneratorsOfSemigroup"/>, respectively.

    <Example>
gap> S:=InverseMonoid(
>  PartialPerm( [ 1, 2 ], [ 1, 4 ] ),
>  PartialPerm( [ 1, 2, 4 ], [ 3, 4, 1 ] ) );;
gap> GeneratorsOfInverseMonoid(S);
[ [2,4](1), [2,4,1,3] ]</Example>
  </Description>
</ManSection>

<ManSection>
  <Oper Name="IsInverseSubsemigroup" Arg="S, T"/>
  <Returns><K>true</K> or <K>false</K>.</Returns>
  <Description>
    If the semigroup <A>T</A> is an inverse subsemigroup of the semigroup
    <A>S</A>, then this operation returns <K>true</K>.

    <Example>
gap> T:=InverseSemigroup(RandomPartialPerm(4));;
gap> IsInverseSubsemigroup(SymmetricInverseSemigroup(4), T);
true
gap> T:=Semigroup(Transformation( [ 1, 2, 4, 5, 6, 3, 7, 8 ] ),
> Transformation( [ 3, 3, 4, 5, 6, 2, 7, 8 ] ),
> Transformation([ 1, 2, 5, 3, 6, 8, 4, 4 ] ));;
gap> IsInverseSubsemigroup(FullTransformationSemigroup(8), T);
true</Example>
  </Description>
</ManSection>

</Section>

