## The `MONOID` Package

Version 3.1.2
J. D. Mitchell jdm3@st-and.ac.uk
&copyright; 2008 J. D. Mitchell.

If you use the `MONOID` package, I would really appreciate it if you would let me know by sending me an email to jdm3@st-and.ac.uk. If you notice that there are any features missing that you think are important or if you find a bug, please let me know.
The author would like to thank P. v. Bunau, A. Distler, S. Linton, J. Neubueser, V. Maltcev, M. Neuhoeffer, M. R. Quick, E. F. Robertson, and N. Ruskuc for their help and suggestions. Special thanks go to J. Araujo for his mathematical suggestions.

I would also like to acknowledge the support of the Centre of Algebra at the University of Lisbon, and of EPSRC grant number GR/S/56085/01.
The `MONOID` package
Introduction
This manual describes the `MONOID` package version 3.1.2 for computing with transformation semigroups. `MONOID` 3.1.2 is an updated version of the package with the same name for &GAP; 3; see http://schmidt.nuigalway.ie/monoid/index.html

for more information about the original `MONOID` by Goetz Pfeiffer and Steve A. Linton, Edmund F. Robertson and Nik Ruskuc.

MONOID
3.1.2 retains all the functionality of the original `MONOID` package. In particular, `MONOID` 3.1.2 contains more efficient methods than those available in the &GAP; library for computing orbits, calculating Green's classes, finding the size, the elements, and testing membership in transformation semigroups; see Chapters and . After `MONOID` has been loaded many of these methods are automatically used in preference to those in the library and do not need to be called explicitly by the user. These methods are described in and the algorithms themselves are described in .

In addition, there are new methods for testing if a semigroup satisfies a particular property, such as if it is regular, simple, inverse, or completely regular, see Chapter ; methods for computing the automorphism group of a transformation semigroup see Section ; methods for finding homomorphisms and isomorphism between some types of semigroups see Chapter ; and functions to create some well-known semigroups see Chapter . The property testing methods are described in and the method for computing the automorphism group of a semigroup is described in .

The `MONOID` package is written in &GAP; code only but relies on the `GRAPE` package Version 4.2 or higher in the methods for computing the automorphism group of a semigroup. The following functions can only be used fully if `GRAPE` is fully installed (and loaded): with argument satisfying or with argument satisfying with both arguments satisfying Installation of `GRAPE` is described in the README file of the `GRAPE` distribution and in the section entitled `Installing the GRAPE Package' of the `GRAPE` manual; see http://www.maths.qmul.ac.uk/~leonard/grape/ or the main &GAP; webpages for more information.

If you want to take advantage of the online help facilities in `MONOID`, then the `gapdoc` package Version 1.1 or higher is also required; see http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc/ for further details of how to obtain and install `gapdoc`.
Installing `MONOID`

In this section we give a brief description of how to start using `MONOID`. If you have any problems getting `MONOID` working, then please email me directly at jdm3@st-and.ac.uk.

It is assumed that you have a working copy of &GAP; with version number 4.4.10 or higher. The most up-to-date version of &GAP; and instructions on how to install it can be obtained from the main &GAP; webpage http://www.gap-system.org

Those functions in `MONOID` described in Chapter relating to automorphism groups of semigroups require the `GRAPE` (for computing with graphs and groups) to be loaded. In particular, `GRAPE` must be installed in a UNIX operating system so that the automorphism group and isomorphism testing functions (for graphs) can be used.

Please go to http://www.maths.qmul.ac.uk/~leonard/grape/ or the main &GAP; webpage for further details on how to obtain and install `GRAPE`.

The following is a summary of the steps that should lead to a successful installation of `MONOID`.

download the package archive monoid3r1p1.tar.gz or monoid3r1p1.tar.bz2 from http://www-history.mcs.st-and.ac.uk/~jamesm/monoid/index.html
unzip & untar the file, this should create a directory called MONOID.
move the directory MONOID into the pkg directory of your &GAP; directory (the one containing the directories lib, doc, pkg, and so on)
start &GAP; in the usual way
type LoadPackage("monoid");

Below is an example of an installation of `MONOID` in UNIX where GAPROOT should be substituted with the main &GAP; directory (the one containing the folders `bin', `lib', and so on) in your installation of &GAP;.

> gunzip monoid3r1p1.tar.gz > tar -xf monoid3r1p1.tar > mv MONOID GAPROOT/pkg > gap

[ ... ]

gap> LoadPackage("monoid"); Loading MONOID 3.1.2 by James Mitchell (www-groups.mcs.st-and.ac.uk/~jamesm) For help, type: ?the monoid package true gap>

Presuming that the above steps can be completed successfully you will be running the `MONOID` package!

If you want to check that the package is working correctly, please see Section .

Please note: before you can used `MONOID` fully you must install `GRAPE` as described above.

Testing `MONOID`

In this section we describe how to test that `MONOID` is working as intended. To test that `MONOID` is installed correctly copy the following lines into &GAP;. LoadPackage( "monoid" );; dirs := DirectoriesPackageLibrary( "monoid", "tst" );; Read(Filename( dirs, "installtest.g" ) ); and press return. Please note that it will take a few moments before the tests are complete.

If the output looks like the following, then it is probable that you have a fully working copy of `MONOID` 3.1.2.

gap> LoadPackage( "monoid" );; gap> dirs := DirectoriesPackageLibrary( "monoid", "tst" );; gap> Read( Filename( dirs, "installtest.g" ) );; + install_no_grape.tst 3.1.2 + GAP4stones: 1 + install_with_grape.tst 3.1.2 + GAP4stones: 2

If you want to perform more extensive tests, then copy the following lines into &GAP;. LoadPackage( "monoid" );; dirs := DirectoriesPackageLibrary( "monoid", "tst" );; Read(Filename( dirs, "testall.g" ) ); Please note that these tests could take a long time to finish.

If something goes wrong, then please review the instructions in Section and ensure that `MONOID` has been properly installed. If you continue having problems, please email me at jdm3@st-and.ac.uk.

Changes
from 3.1.1 to 3.1.2: the following new functions have been introduced: , , , , , , , , , , the following functions were renamed: PermRepTrans was renamed AsPermOfRange ImagesTransformationMonoid was renamed ImagesOfTransSemigroup GradedImagesTransformationMonoid was renamed GradedImagesOfTransSemigroup KernelsTransformationMonoid was renamed KernelsOfTransSemigroup GradedKernelsTransformationMonoid was renamed GradedKernelsOfTransSemigroup the following bugs were fixed: a bug relating to the definition of the semigroup of order preserving functions was resolved
from 3.1 to 3.1.1: fixed a bug that produced an error when loading MONOID with the GRAPE package present but not fully installed.
from 2 to 3:

new methods for testing if a semigroup satisfies a particular property, such as if it is regular, simple, inverse, or completely regular, see Chapter ;
implementations of new algorithms for computing the automorphism group of an arbitrary semigroup generated by transformations including an interactive function that allows the user to decide how the computation should proceed, see Chapter ;
functions for finding automorphisms of Rees matrix semigroups and Rees 0-matrix semigroups; see Section .
functions for defining homomorphisms and isomorphisms between some types of semigroups; see Chapter .
Forthcoming Features

The features are currently under development and will be available in a future version of `MONOID`:

the number of special types of semigroups available in `MONOID` will be expanded to include all of the standard examples of transformation semigroups and some matrix semigroups.
methods analogous to those used to find Green's relations and other structural properties of transformation semigroups in the current version of `MONOID` but for semigroups generated by partial transformations, binary relations, and matrix semigroups.
a suite of functions for computing with inverse semigroups generated by partial bijections, including finding faithful representations of smaller degree and small generating sets.
an algorithm for finding a small generating set of a semigroup.
Transformations
The functions described in this section extend the functionality of &GAP; relating to transformations.

Creating Transformations
<#Include Label="TransformationByKernelAndImage"> <#Include Label="AllTransformationsWithKerAndImg"> <#Include Label="Idempotent"> <#Include Label="RandomIdempotent"> <#Include Label="RandomTransformation"> <#Include Label="TransformationActionNC">
Properties & Attributes
<#Include Label="IsTransversal"> <#Include Label="IsKerImgOfTransformation"> <#Include Label="KerImgOfTransformation"> <#Include Label="IsRegularTransformation"> <#Include Label="IndexPeriodOfTransformation"> <#Include Label="SmallestIdempotentPower"> <#Include Label="InversesOfTransformation">
Changing Representation
<#Include Label="AsBooleanMatrix"> <#Include Label="AsPermOfRange">
Monoid Actions and Orbits
Introduction
The functions described in this section relate to how a transformation semigroup acts on its underlying set.

Let S be a transformation semigroup of degree n. Then the orbit of i in {1,...,n} is the set of elements j in {1,...,n} such that there exists f in S where (i)f=j. Note that the essential difference between monoid orbits and group orbits is that monoid orbits do not describe an equivalence relation on S. In particular, the relation described by monoid orbits is not symmetric.

The strong orbit of i in {1,...,n} is the set of elements j in {1,...,n} such that there exists f, g in S where (i)f=j and (j)g=i.

Recall that a grading is a function f from a transformation semigroup S of degree n to the natural numbers such that if s in S and X is a subset of {1,...,n}, then (Xs)f is at most (X)f.
Actions
In addition to the actions define in the reference manual the following two actions are available in `MONOID`.

<#Include Label="OnTuplesOfSetsAntiAction"> <#Include Label="OnKernelsAntiAction">
General Orbits
The following functions allow the calculation of arbitrary orbits in transformation semigroups. Several more specific orbits that are often useful are given in Section .

<#Include Label="MonoidOrbit"> <#Include Label="MonoidOrbits"> <#Include Label="StrongOrbit"> <#Include Label="StrongOrbits"> <#Include Label="GradedOrbit"> <#Include Label="ShortOrbit"> <#Include Label="GradedStrongOrbit"> <#Include Label="ShortStrongOrbit">
Some Specific Orbits
The following specific orbits are used in the computation of Green's relations and to test if an arbitrary transformation semigroup has a particular property; see Chapter and Chapter .

<#Include Label="ImagesOfTransSemigroup"> <#Include Label="GradedImagesOfTransSemigroup"> <#Include Label="KernelsOfTransSemigroup"> <#Include Label="GradedKernelsOfTransSemigroup"> <#Include Label="StrongOrbitOfImage"> <#Include Label="StrongOrbitsOfImages">
Green's Relations
Introduction

This chapter contains instructions on how to use the algorithms for computing Green's relations and related notions for transformation semigroups and monoids that are implemented in `MONOID`.

The theory behind these algorithms is developed in and the algorithms themselves are described in . Another reference is .

Calculation of Green's relations using the `MONOID` package are invoked in the same way as they are in &GAP; without the `MONOID` package loaded; see . For example, in &GAP; with the `MONOID` package loaded:

gap> a:=Transformation([2,1,1,2,1]);; gap> b:=Transformation([3,4,3,4,4]);; gap> c:=Transformation([3,4,3,4,3]);; gap> d:=Transformation([4,3,3,4,4]);; gap> S:=Semigroup(a,b,c,d); <semigroup with 4 generators> gap> GreensRClasses(S); [ {Transformation( [ 2, 1, 1, 2, 1 ] )}, {Transformation( [ 1, 2, 1, 2, 2 ] )} , {Transformation( [ 1, 2, 1, 2, 1 ] )}, {Transformation( [ 2, 1, 1, 2, 2 ] )} ]
Without the `MONOID` package loaded: gap> a:=Transformation([2,1,1,2,1]);; gap> b:=Transformation([3,4,3,4,4]);; gap> c:=Transformation([3,4,3,4,3]);; gap> d:=Transformation([4,3,3,4,4]);; gap> S:=Semigroup(a,b,c,d); <semigroup with 4 generators> gap> GreensRClasses(S); [ {Transformation( [ 1, 2, 1, 2, 1 ] )}, {Transformation( [ 1, 2, 1, 2, 2 ] )} , {Transformation( [ 1, 2, 2, 1, 1 ] )}, {Transformation( [ 1, 2, 2, 1, 2 ] )} ] The only noticable differences are the representatives of the classes and the order the classes appear in the list. These differences are caused by the differences in the methods used to behind the function GreensRClasses in `MONOID` and the &GAP; library.

Most of the commands in this section relate to how Green's relations are calculated in `MONOID`. Although some of the commands might be used for other purposes, if all that is required is to calculate Green's classes, relations and so on, then this is done in the exactly the same way as described in the &GAP; manual; see .

Due to inherent difficulties with computing Green's L- and D-classes, the methods used to compute with Green's R-classes are the most efficient available in `MONOID`. Thus wherever possible it is advisable to use the commands relating to Green's R-classes rather than those relating to Green's L-classes, D-classes, or H-classes.

For small examples of semigroups, say with fewer than 40 elements, it may be more efficient to use the methods from the library than those in `MONOID`. This stems from the fact that there are higher overheads in the methods used in `MONOID`. In either case, with such small examples computing Green's relations does not take much time.

The methods in `MONOID` allow the computation of individual Green's classes without the need to compute all the elements of the underlying semigroup. It is also possible to compute all the R-classes, the number of elements and test membership in a transformation semigroup without computing all the elements. This may be useful if you want to study a very large semigroup where computing all the elements of the semigroup would take too long.
Data Structures
<#Include Label="GreensData"> <#Include Label="GreensRClassData"> <#Include Label="GreensLClassData"> <#Include Label="GreensHClassData"> <#Include Label="GreensDClassData"> <#Include Label="IsGreensData"> <#Include Label="RClassData"> <#Include Label="IsGreensRClassDataRep"> <#Include Label="IsAssociatedSemigpTransSemigp"> <#Include Label="SchutzenbergerGroup"> <#Include Label="Idempotents"> <#Include Label="PartialOrderOfDClasses">
Properties of Semigroups
Introduction

In this section we give the theoretical results and the corresponding &GAP; functions that can be used to determine whether a set of transformations generates a semigroup of a given type. Let S be a semigroup. Then S is a left zero semigroup if xy=x for all x,y in S. S is a right zero semigroup if xy=y for all x,y in S. S is commutative if xy=yx for all x,y in S. S is simple if it has no proper two-sided ideals. S is regular if for all x in S there exists y in S such that xyx=x. S is completely regular if every element of S lies in a subgroup. S is an inverse semigroup if for all elements x in S there exists a unique semigroup inverse, that is, a unique element y such that xyx=x and yxy=y. S is a Clifford semigroup if it is a regular semigroup whose idempotents are central, that is, for all e in S with e^2=e and x in S we have that ex=xe. S is a band if every element is an idempotent, that is, x^2=x for all x in S. S is a rectangular band if for all x,y,z in S we have that x^2=x and xyz=xz. S is a semiband if it is generated by its idempotent elements, that is, elements satisfying x^2=x. S is an orthodox semigroup if its idempotents (elements satisfying x^2=x) form a subsemigroup. S is a zero semigroup if there exists an element 0 in S such that xy=0 for all x,y in S. S is a zero group if there exists an element 0 in S such that S without 0 is a group and for all x in S we have that x0=0x=0.

The following results provide efficient methods to determine if an arbitrary transformation semigroup is a left zero, right zero, simple, completely regular, inverse or Clifford semigroup. Proofs of these results can be found in .

Let S be a semigroup generated by a set of transformations U on a finite set. Then the following hold: S is a left zero semigroup if and only if for all f, g in U the image of f equals the image of g and f^2=f. S is a right zero semigroup if and only if for all f, g in U the kernel of f equals the kernel of g and f^2=f. S is simple if and only if for all f, g in U every class of the kernel of f contains exactly 1 element of the image of g. S is completely regular if and only if for all f in U and g in S, every class of the kernel of f contains at most 1 element of the set found by applying g to the image of f. S is inverse if and only if it is regular and there is a bijection \phi from the set of kernels of elements of S to the set of images of elements of S such that every class of a kernel K contains exactly 1 element in (K)\phi. S is a Clifford semigroup if and only if for all f, g in U f permutes its image f commutes with the power of g that acts as the identity on its image.

It is straightforward to verify that a transformation semigroup S generated by U is a group if and only if for all f, g in U the kernel of f equals the kernel of g. the image of f equals the image of g. f permutes its image.

At first glance it might not be obvious why these conditions are an improvement over the original definitions. The main point is that it can be easily determined whether a semigroup S generated by a set U of mappings satisfies these conditions by considering the generators U and their action on the underlying set only.
Property Tests
<#Include Label="IsCompletelyRegularSemigroup"> <#Include Label="IsCompletelySimpleSemigroup"> <#Include Label="IsGroupAsSemigroup"> <#Include Label="IsCommutativeSemigroup"> <#Include Label="IsRegularSemigroup"> <#Include Label="IsInverseSemigroup"> <#Include Label="IsCliffordSemigroup"> <#Include Label="IsBand"> <#Include Label="IsRectangularBand"> <#Include Label="IsSemiBand"> <#Include Label="IsOrthodoxSemigroup"> <#Include Label="IsRightZeroSemigroup"> <#Include Label="IsLeftZeroSemigroup"> <#Include Label="IsZeroSemigroup"> <#Include Label="IsZeroGroup"> <#Include Label="MultiplicativeZero">

Special Classes of Semigroup

In this chapter functions for creating certain semigroups are given.

Some Classes of Semigroup
<#Include Label="SingularSemigroup"> <#Include Label="OrderPreservingSemigroup"> <#Include Label="KiselmanSemigroup">
Zero Groups and Zero Semigroups
<#Include Label="ZeroSemigroup"> <#Include Label="ZeroSemigroupElt"> <#Include Label="ZeroGroup"> <#Include Label="ZeroGroupElt"> <#Include Label="UnderlyingGroupOfZG"> <#Include Label="UnderlyingGroupEltOfZGElt">
Random Semigroups
<#Include Label="RandomMonoid"> <#Include Label="RandomSemigroup"> <#Include Label="RandomReesMatrixSemigroup"> <#Include Label="RandomReesZeroMatrixSemigroup">
Semigroup Homomorphisms
Introduction
In this chapter we give instructions on how to create semigroup homomorphisms using `MONOID` in several different ways.

In Section , we give functions for creating arbitrary semigroup homomorphism specified by a function on the elements, the images of the generators, or the images of all the semigroup elements. These functions were written to support the functions for computing the automorphism group of an arbitrary transformation semigroup and to specify isomorphisms between different classes of semigroup, such as finitely presented semigroups and transformation semigroups.

In Section , we show how to specify and compute the inner automorphisms of a transformation semigroup. The functions that can be used to find the entire automorphism group of an arbitrary transformation semigroup are given in Section . The has an interactive mode that allows the user to decide how the computation should proceed. This can be invoked by using the command SetInfoLevel(InfoAutos, 4); see .

In Section , commands for creating automorphisms and finding all automorphisms of Rees matrix semigroups and Rees 0-matrix semigroups are given.

In Section , functions for specifying the automorphisms of a zero group are given.

In the final section (), functions for finding isomorphisms between various kinds of semigroups are given.

The methods behind the commands in this chapter are taken from .

Please note: the following functions can only be used fully if `GRAPE` is fully installed (and loaded): with argument satisfying or with argument satisfying with both arguments satisfying Please see Chapter for further details on how to obtain `GRAPE`.

<#Include Label="InfoAutos">
Creating Homomorphisms
The principal functions for creating arbitrary semigroup homomorphisms are the following three.

<#Include Label="SemigroupHomomorphismByFunction"> <#Include Label="SemigroupHomomorphismByImagesOfGens"> <#Include Label="SemigroupHomomorphismByImages">
Inner Automorphisms
<#Include Label="InnerAutomorphismOfSemigroup"> <#Include Label="ConjugatorOfInnerAutomorphismOfSemigroup"> <#Include Label="IsInnerAutomorphismOfSemigroup"> <#Include Label="InnerAutomorphismsOfSemigroup"> <#Include Label="InnerAutomorphismsOfSemigroupInGroup"> <#Include Label="InnerAutomorphismsAutomorphismGroup"> <#Include Label="IsInnerAutomorphismsOfSemigroup"> <#Include Label="IsInnerAutomorphismsOfZeroGroup">
Automorphism Groups
<#Include Label="AutomorphismGroup"> <#Include Label="AutomorphismsSemigroupInGroup"> <#Include Label="IsAutomorphismGroupOfSemigroup"> <#Include Label="IsAutomorphismGroupOfSimpleSemigp"> <#Include Label="IsAutomorphismGroupOfZeroGroup"> <#Include Label="IsAutomorphismGroupOfZeroSemigroup"> <#Include Label="IsAutomorphismGroupOfRMS"> <#Include Label="IsAutomorphismGroupOfRZMS">
Rees Matrix Semigroups
<#Include Label="RMSIsoByTriple"> <#Include Label="RZMSIsoByTriple"> <#Include Label="IsRMSIsoByTripleRep"> <#Include Label="IsRZMSIsoByTripleRep"> <#Include Label="RMSInducedFunction"> <#Include Label="RZMSInducedFunction"> <#Include Label="RZMStoRZMSInducedFunction"> <#Include Label="RZMSGraph"> <#Include Label="RightTransStabAutoGroup">
Zero Groups
<#Include Label="ZeroGroupAutomorphism"> <#Include Label="IsZeroGroupAutomorphismRep"> <#Include Label="UnderlyingGroupAutoOfZeroGroupAuto">
Isomorphisms
<#Include Label="IsomorphismAutomorphismGroupOfRMS"> <#Include Label="IsomorphismPermGroup"> <#Include Label="IsomorphismFpSemigroup"> <#Include Label="IsomorphismFpMonoid"> <#Include Label="IsomorphismSemigroups"> <#Include Label="IsomorphismReesMatrixSemigroupOfDClass"> <#Include Label="IsomorphismReesMatrixSemigroup">