Finitely Presented Semigroups and Monoids

A finitely presented semigroup (resp. finitely presented monoid) is a quotient of a free semigroup (resp. free monoid) on a finite number of generators over a finitely generated congruence on the free semigroup (resp. free monoid).

Finitely presented semigroups are obtained by factoring a free semigroup by a set of relations (a generating set for the congruence), i.e., a set of pairs of words in the free semigroup.

gap> f:=FreeSemigroup("a","b");; gap> x:=GeneratorsOfSemigroup(f);; gap> s:=f/[ [x[1]*x[2],x[2]*x[1]] ]; <fp semigroup on the generators [ a, b ]> gap> GeneratorsOfSemigroup(s); [ a, b ] gap> RelationsOfFpSemigroup(s); [ [ a*b, b*a ] ]

Finitely presented monoids are obtained by factoring a free monoid by a set of relations, i.e. a set of pairs of words in the free monoid.

gap> f:=FreeMonoid("a","b");; gap> x:=GeneratorsOfMonoid(f); [ a, b ] gap> e:=Identity(f); <identity ...> gap> m:=f/[ [x[1]*x[2],e] ]; <fp monoid on the generators [ a, b ]> gap> RelationsOfFpMonoid(m); [ [ a*b, <identity ...> ] ]

Notice that for &GAP; a finitely presented monoid is not a finitely presented semigroup.

gap> IsFpSemigroup(m); false

However, one can build a finitely presented semigroup isomorphic to that finitely presented monoid (see ).

Also note that is not possible to refer to the generators by their names. These names are not variables, but just display figures. So, if one wants to access the generators by their names, one first has to introduce the respective variables and to assign the generators to them.

gap> Unbind(a); gap> f:=FreeSemigroup("a","b");; gap> x:=GeneratorsOfSemigroup(f);; gap> s:=f/[ [x[1]*x[2],x[2]*x[1]] ];; gap> a; Error, Variable: 'a' must have a value gap> a:=GeneratorsOfSemigroup(s)[1]; a gap> b:=GeneratorsOfSemigroup(s)[2]; b gap> a in f; false gap> a in s; true

The generators of the free semigroup (resp. free monoid) are different from the generators of the finitely presented semigroup (resp. finitely presented monoid) (even though they are displayed by the same names). This means that words in the generators of the free semigroup (resp. free monoid) are not elements of the finitely presented semigroup (resp. finitely presented monoid). Conversely elements of the finitely presented semigroup (resp. finitely presented monoid) are not words of the free semigroup (resp. free monoid).

Calculations comparing elements of an finitely presented semigroup may run into problems: there are finitely presented semigroups for which no algorithm exists (it is known that no such algorithm can exist) that will tell for two arbitrary words in the generators whether the corresponding elements in the finitely presented semigroup are equal. Therefore the methods used by &GAP; to compute in finitely presented semigroups may run into warning errors, run out of memory or run forever. If the finitely presented semigroup is (by theory) known to be finite the algorithms are guaranteed to terminate (if there is sufficient memory available), but the time needed for the calculation cannot be bounded a priori. The same can be said for monoids. (See .)

gap> a*b=a^5; false gap> a^5*b^2*a=a^6*b^2; true

Note that elements of a finitely presented semigroup (or monoid) are not printed in a unique way:

gap> a^5*b^2*a; a^5*b^2*a gap> a^6*b^2; a^6*b^2
IsSubsemigroupFpSemigroup (Filter)
<#Include Label="IsSubsemigroupFpSemigroup"> <#Include Label="IsSubmonoidFpMonoid"> <#Include Label="IsFpSemigroup"> <#Include Label="IsFpMonoid"> <#Include Label="IsElementOfFpSemigroup"> <#Include Label="IsElementOfFpMonoid"> <#Include Label="FpGrpMonSmgOfFpGrpMonSmgElement">

Creating Finitely Presented Semigroups
quotient
creates a finitely presented semigroup given by the presentation \langle gens \mid rels \rangle where gens are the generators of the free semigroup F, and the relations rels are entered as pairs of words in the generators of the free semigroup.

The same result is obtained with the infix operator /, i.e., as F / rels.

gap> f:=FreeSemigroup(3);; gap> s:=GeneratorsOfSemigroup(f);; gap> f/[ [s[1]*s[2]*s[1],s[1]] , [s[2]^4,s[1]] ]; <fp semigroup on the generators [ s1, s2, s3 ]>
<#Include Label="FactorFreeSemigroupByRelations"> <#Include Label="IsomorphismFpSemigroup">

Comparison of Elements of Finitely Presented Semigroups
comparison
Two elements a, b of a finitely presented semigroup are equal if they are equal in the semigroup. Nevertheless they may be represented as different words in the generators. Because of the fundamental problems mentioned in the introduction to this chapter such a test may take a very long time and cannot be guaranteed to finish (see ).
Preimages in the Free Semigroup

Elements of a finitely presented semigroup are not words, but are represented using a word from the free semigroup as representative.

for an element elm of a finitely presented semigroup, it returns the word from the free semigroup that is used as a representative for elm.

gap> f := FreeSemigroup( "a" , "b" );; gap> a := GeneratorsOfSemigroup( f )[ 1 ];; gap> b := GeneratorsOfSemigroup( f )[ 2 ];; gap> s := f / [ [ a^3 , a ] , [ b^3 , b ] , [ a*b , b*a ] ]; <fp semigroup on the generators [ a, b ]> gap> w := GeneratorsOfSemigroup(s)[1] * GeneratorsOfSemigroup(s)[2]; a*b gap> IsWord (w ); false gap> ue := UnderlyingElement( w ); a*b gap> IsWord( ue ); true
<#Include Label="ElementOfFpSemigroup"> <#Include Label="FreeSemigroupOfFpSemigroup"> <#Include Label="FreeGeneratorsOfFpSemigroup"> <#Include Label="RelationsOfFpSemigroup">

Finitely presented monoids

The functionality available for finitely presented monoids is essentially the same as that available for finitely presented semigroups, and thus the previous sections apply (with the obvious changes) to finitely presented monoids.

quotient
creates a finitely presented monoid given by the monoid presentation \langle gens \mid rels \rangle where gens are the generators of the free monoid F, and the relations rels are entered as pairs of words in both the identity and the generators of the free monoid.

The same result is obtained with the infix operator /, i.e., as F/rels.

gap> f := FreeMonoid( 3 ); <free monoid on the generators [ m1, m2, m3 ]> gap> x := GeneratorsOfMonoid( f ); [ m1, m2, m3 ] gap> e:= Identity ( f ); <identity ...> gap> m := f/[ [x[1]^3,e] , [x[1]*x[2],x[2] ]]; <fp monoid on the generators [ m1, m2, m3 ]>
Rewriting Systems and the Knuth-Bendix Procedure

If a finitely presented semigroup has a confluent rewriting system then it has a solvable word problem, that is, there is an algorithm to decide when two words in the free underlying semigroup represent the same element of the finitely presented semigroup. Indeed, once we have a confluent rewriting system, it is possible to successfully test that two words represent the same element in the semigroup, by reducing both words using the rewriting system rules. This is, at the moment, the method that &GAP; uses to check equality in finitely presented semigroups and monoids.

<#Include Label="ReducedConfluentRewritingSystem"> <#Include Label="KB_REW">

KnuthBendixRewritingSystem
in the first form, for a semigroup s and a reduction ordering for the underlying free semigroup, it returns the Knuth-Bendix rewriting system of the finitely presented semigroup s using the reduction ordering wordord. In the second form, for a monoid m and a reduction ordering for the underlying free monoid, it returns the Knuth-Bendix rewriting system of the finitely presented monoid m using the reduction ordering wordord.
<#Include Label="SemigroupOfRewritingSystem"> <#Include Label="MonoidOfRewritingSystem"> <#Include Label="FreeSemigroupOfRewritingSystem"> <#Include Label="FreeMonoidOfRewritingSystem">

Todd-Coxeter Procedure

This procedure gives a standard way of finding a transformation representation of a finitely presented semigroup. Usually one does not explicitly call this procedure but uses or .

<#Include Label="CosetTableOfFpSemigroup">