Inverse semigroups and monoids
An inverse semigroup.
If obj1, obj2, ... are (any combination) of associative elements with unique semigroup inverses, semigroups of such elements, or collections of such elements, then InverseSemigroup returns the inverse semigroup generated by the union of obj1, obj2, .... This equals the semigroup generated by the union of obj1, obj2, ... and their inverses.

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

As present, the only associative elements with unique semigroup inverses, which do not always generate a group, are partial permutations; see Chapter .

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))); <inverse partial perm semigroup on 10 pts with 34 generators> gap> Size(S); 1233
An inverse monoid.
If obj1, obj2, ... are (any combination) of associative elements with unique semigroup inverses, semigroups of such elements, or collections of such elements, then InverseMonoid returns the inverse monoid generated by the union of obj1, obj2, .... This equals the monoid generated by the union of obj1, obj2, ... and their inverses.

As present, the only associative elements with unique semigroup inverses are partial permutations; see Chapter .

For example if S and T are inverse monoids, then InverseMonoid(S, f, Idempotents(T)); is the inverse monoid generated by Union(GeneratorsOfInverseMonoid(S), [f], Idempotents(T)));. 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))); <inverse partial perm monoid on 10 pts with 35 generators> gap> Size(S); 1243
The generators of an inverse semigroup.
If S is an inverse semigroup, then GeneratorsOfInverseSemigroup returns the generators used to define S, i.e. an inverse semigroup generating set for S.

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

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

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] ]
The generators of an inverse monoid.
If S is an inverse monoid, then GeneratorsOfInverseMonoid returns the generators used to define S, i.e. an inverse monoid generating set for S.

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 , , , and , respectively.

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] ]
true
or false.
If the semigroup T is an inverse subsemigroup of the semigroup S, then this operation returns true.

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