% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[a4paper,11pt]{report}

\usepackage{a4wide}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}

\definecolor{linkColor}{rgb}{0.0,0.0,0.554}
\definecolor{citeColor}{rgb}{0.0,0.0,0.554}
\definecolor{fileColor}{rgb}{0.0,0.0,0.554}
\definecolor{urlColor}{rgb}{0.0,0.0,0.554}
\definecolor{promptColor}{rgb}{0.0,0.0,0.589}
\definecolor{brkpromptColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapinputColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapoutputColor}{rgb}{0.0,0.0,0.0}

%%  for a long time these were red and blue by default,
%%  now black, but keep variables to overwrite
\definecolor{FuncColor}{rgb}{0.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,0.0}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}


\usepackage{fancyvrb}

\usepackage{mathptmx,helvet}
\usepackage[T1]{fontenc}
\usepackage{textcomp}


\usepackage[
            pdftex=true,
            bookmarks=true,        
            a4paper=true,
            pdftitle={Written with GAPDoc},
            pdfcreator={LaTeX with hyperref package / GAPDoc},
            colorlinks=true,
            backref=page,
            breaklinks=true,
            linkcolor=linkColor,
            citecolor=citeColor,
            filecolor=fileColor,
            urlcolor=urlColor,
            pdfpagemode={UseNone}, 
           ]{hyperref}

\newcommand{\maintitlesize}{\fontsize{50}{55}\selectfont}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
%% were never documented, give conflicts with some additional packages

\newcommand{\GAP}{\textsf{GAP}}

%% nicer description environments, allows long labels
\usepackage{enumitem}
\setdescription{style=nextline}

%% depth of toc
\setcounter{tocdepth}{1}





%% command for ColorPrompt style examples
\newcommand{\gapprompt}[1]{\color{promptColor}{\bfseries #1}}
\newcommand{\gapbrkprompt}[1]{\color{brkpromptColor}{\bfseries #1}}
\newcommand{\gapinput}[1]{\color{gapinputColor}{#1}}


\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\mbox{}\vfill

\begin{center}{\maintitlesize \textbf{\textsf{Semigroups}\mbox{}}}\\
\vfill

\hypersetup{pdftitle=\textsf{Semigroups}}
\markright{\scriptsize \mbox{}\hfill \textsf{Semigroups} \hfill\mbox{}}
{\Huge \textbf{Method for semigroups\mbox{}}}\\
\vfill

{\Huge Version 2.5\mbox{}}\\[1cm]
\mbox{}\\[2cm]
{\Large \textbf{J. D. Mitchell   \mbox{}}}\\
{\Large \textbf{Manuel Delgado\mbox{}}}\\
{\Large \textbf{James East\mbox{}}}\\
{\Large \textbf{Attila Egri-Nagy\mbox{}}}\\
{\Large \textbf{Julius Jonu{\v s}as\mbox{}}}\\
{\Large \textbf{Markus Pfeiffer\mbox{}}}\\
{\Large \textbf{Ben Steinberg\mbox{}}}\\
{\Large \textbf{Jhevon Smith\mbox{}}}\\
{\Large \textbf{Michael Torpey\mbox{}}}\\
{\Large \textbf{Wilf Wilson\mbox{}}}\\
\hypersetup{pdfauthor=J. D. Mitchell   ; Manuel Delgado; James East; Attila Egri-Nagy; Julius Jonu{\v s}as; Markus Pfeiffer; Ben Steinberg; Jhevon Smith; Michael Torpey; Wilf Wilson}
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{J. D. Mitchell   }  Email: \href{mailto://jdm3@st-and.ac.uk} {\texttt{jdm3@st-and.ac.uk}}\\
  Homepage: \href{http://tinyurl.com/jdmitchell} {\texttt{http://tinyurl.com/jdmitchell}}}\\
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Abstract}
\logpage{[ 0, 0, 2 ]}
 The \textsf{Semigroups} package is a \textsf{GAP} package containing methods for semigroups, monoids, and inverse semigroups,
principally of transformations, partial permutations, bipartitions,
subsemigroups of regular Rees 0-matrix semigroups, and the free inverse
semigroup. 

 \textsf{Semigroups} contains more efficient methods than those available in the \textsf{GAP} library (and in many cases more efficient than any other software) for
creating semigroups, monoids, and inverse semigroup, calculating their Green's
structure, ideals, size, elements, group of units, small generating sets,
testing membership, finding the inverses of a regular element, factorizing
elements over the generators, and many more. It is also possible to test if a
semigroup satisfies a particular property, such as if it is regular, simple,
inverse, completely regular, and a variety of further properties. 

 There are methods for finding congruences of certain types of semigroups, the
normalizer of a semigroup in a permutation group, the maximal subsemigroups of
a finite semigroup, and smaller degree partial permutation representations and
the character tables of inverse semigroups. There are functions for producing
pictures of the Green's structure of a semigroup, and for drawing
bipartitions. \mbox{}}\\[1cm]
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 1 ]}
{\copyright} 2011-15 by J. D. Mitchell.

 \textsf{Semigroups} is free software; you can redistribute it and/or modify it under the terms of
the \href{ http://www.fsf.org/licenses/gpl.html} {GNU General Public License} as published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. \mbox{}}\\[1cm]
{\small 
\section*{Acknowledgements}
\logpage{[ 0, 0, 3 ]}
 I would like to thank P. von Bunau, A. Distler, S. Linton, C. Nehaniv, J.
Neubueser, M. R. Quick, E. F. Robertson, and N. Ruskuc for their help and
suggestions. Special thanks go to J. Araujo for his mathematical suggestions
and to M. Neunhoeffer for his invaluable help in improving the efficiency of
the package. 

 Manuel Delgado and Attila Egri-Nagy contributed to the functions \texttt{Splash} (\ref{Splash}) and \texttt{DotDClasses} (\ref{DotDClasses}).

 James East, Attila Egri-Nagy, and Markus Pfeiffer contributed to the part of
the package relating to bipartitions. I would like to thank the University of
Western Sydney for their support of the development of this part of the
package. 

 Julius Jonu{\v s}as contributed the part of the package relating to free
inverse semigroups, and contributed to the code for ideals.

 Yann Peresse and Yanhui Wang contributed to the function \texttt{MunnSemigroup} (\ref{MunnSemigroup}).

 Jhevon Smith and Ben Steinberg contributed the function \texttt{CharacterTableOfInverseSemigroup} (\ref{CharacterTableOfInverseSemigroup}).

 Michael Torpey contributed the part of the package relating to congruences of
Rees (0-)matrix semigroups.

 Wilf Wilson contributed to the part of the package relating maximal
subsemigroups and smaller degree partial permutation representations of
inverse semigroups. We are also grateful to C. Donoven and R. Hancock for
their contribution to the development of the algorithms for maximal
subsemigroups and smaller degree partial permutation representations.

 We 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. \mbox{}}\\[1cm]
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 4 ]}}

\tableofcontents
\newpage

 
\chapter{\textcolor{Chapter }{The \textsf{Semigroups} package}}\label{semigroups}
\logpage{[ 1, 0, 0 ]}
\hyperdef{L}{X7C913C76836AC46D}{}
{
  \index{Semigroups@\textsf{Semigroups} package overview} 
\section{\textcolor{Chapter }{Introduction}}\logpage{[ 1, 1, 0 ]}
\hyperdef{L}{X7DFB63A97E67C0A1}{}
{
 This is the manual for the \textsf{Semigroups} package version 2.5. \textsf{Semigroups} 2.5 is a descendant of the \href{ http://schmidt.nuigalway.ie/monoid/index.html} {Monoid package for GAP 3} by Goetz Pfeiffer, Steve A. Linton, Edmund F. Robertson, and Nik Ruskuc; and
the Monoid package for GAP 4 by J. D. Mitchell.

 Many of the operations, methods, properties, and functions described in this
manual only apply to semigroups of transformations, partial permutations,
bipartitions, and subsemigroups of regular Rees 0-matrix semigroups over
groups. For the sake of brevity, we have opted to say \textsc{semigroup} rather than \textsc{semigroup of transformations, partial permutations, bipartitions, and
subsemigroups of regular Rees 0-matrix semigroups over groups}.

 \textsf{Semigroups} 2.5 contains more efficient methods than those available in the \textsf{GAP} library (and in many cases more efficient than any other software) for
creating semigroups and ideals, calculating their Green's structure, size,
elements, group of units, minimal ideal, and testing membership, finding the
inverses of a regular element, and factorizing elements over the generators,
and many more; see Chapters \ref{create}, \ref{Ideals}, and \ref{green}. There are also methods for testing if a semigroup satisfies a particular
property, such as if it is regular, simple, inverse, completely regular, and a
variety of further properties; see Chapter \ref{green}. The theory behind the main algorithms in \textsf{Semigroups} will be described in a forthcoming article. 

 It is harder for \textsf{Semigroups} to compute Green's $\mathcal{L}$- and $\mathcal{H}$-classes of a transformation semigroup and the methods used to compute with
Green's $\mathcal{R}$- and $\mathcal{D}$-classes are the most efficient in \textsf{Semigroups}. Thus, if you are computing with a transformation semigroup, wherever
possible, it is advisable to use the commands relating to Green's $\mathcal{R}$- or $\mathcal{D}$-classes rather than those relating to Green's $\mathcal{L}$- or $\mathcal{H}$-classes. No such difficulties are present when computing with semigroups of
partial permutations, bipartitions, or subsemigroups of a regular Rees
0-matrix semigroup over a group.

 The methods in \textsf{Semigroups} allow the computation of individual Green's classes without computing the
entire data structure of the underlying semigroup; see \texttt{GreensRClassOfElementNC} (\ref{GreensRClassOfElementNC}). It is also possible to compute the $\mathcal{R}$-classes, the number of elements and test membership in a semigroup without
computing all the elements; see, for example, \texttt{GreensRClasses} (\ref{GreensRClasses}), \texttt{RClassReps} (\ref{RClassReps}), \texttt{IteratorOfRClassReps} (\ref{IteratorOfRClassReps}), \texttt{IteratorOfRClasses} (\ref{IteratorOfRClasses}), or \texttt{NrRClasses} (\ref{NrRClasses}). This may be useful if you want to study a very large semigroup where
computing all the elements of the semigroup is not feasible.

 There are methods for finding: congruences of certain types of semigroups
(based on Section 3.5 in \cite{howie}), the normalizer of a semigroup in a permutation group (as given in \cite{Araujo2010aa}), the maximal subsemigroups of a finite semigroup (based on \cite{Graham1968aa}), smaller degree partial permutation representations (based on \cite{Schein1992aa}) and the character table of an inverse semigroup. There are functions for
producing pictures of the Green's structure of a semigroup, and for drawing
bipartitions. 

 Several standard examples of semigroups are provided see Section \ref{Examples}. \textsf{Semigroups} also provides functions to read and write collections of transformations,
partial permutations, and bipartitions to a file; see \texttt{ReadGenerators} (\ref{ReadGenerators}) and \texttt{WriteGenerators} (\ref{WriteGenerators}).

 Details of how to create and manipulate semigroups of bipartitions can be
found in Chapter \ref{bipartition}.

 There are also functions in \textsf{Semigroups} to define and manipulate free inverse semigroups and their elements; this part
of the package was written by Julius Jonu{\v s}as; see Chapter \ref{Free inverse semigroups} and Section 5.10 in \cite{howie} for more details.

 \textsf{Semigroups} contains functions synonymous to some of those defined in the \textsf{GAP} library but, for the sake of convenience, they have abbreviated names; further
details can be found at the appropriate points in the later chapters of this
manual. 

 \textsf{Semigroups} contains different methods for some \textsf{GAP} library functions, and so you might notice that \textsf{GAP} behaves differently when \textsf{Semigroups} is loaded. For more details about semigroups in \textsf{GAP} or Green's relations in particular, see  (\textbf{Reference: Semigroups}) or  (\textbf{Reference: Green's Relations}).

 The \textsf{Semigroups} package is written \textsf{GAP} code and requires the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/orb.html } {Orb} and \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/io.html } {IO} packages. The \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/orb.html } {Orb} package is used to efficiently compute components of actions, which underpin
many of the features of \textsf{Semigroups}. The \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/io.html } {IO} package is used to read and write transformations, partial permutations, and
bipartitions to a file. 

 The \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package must be loaded for the operation \texttt{SmallestMultiplicationTable} (\ref{SmallestMultiplicationTable}) to work, and it must be fully compiled for the following functions to work: 
\begin{itemize}
\item  \texttt{MunnSemigroup} (\ref{MunnSemigroup}) 
\item  \texttt{MaximalSubsemigroups} (\ref{MaximalSubsemigroups:for an acting semigroup}) 
\item  \texttt{IsIsomorphicSemigroup} (\ref{IsIsomorphicSemigroup}) 
\item  \texttt{IsomorphismSemigroups} (\ref{IsomorphismSemigroups}). 
\end{itemize}
 If \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} is not available or is not compiled, then \textsf{Semigroups} can be used as normal with the exception that the functions above will not
work. 

 The \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/genss.html } {genss} package is used in one version of the function \texttt{Normalizer} (\ref{Normalizer:for a perm group, semigroup, record}) but nowhere else in \textsf{Semigroups}. If \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/genss.html } {genss} is not available, then \textsf{Semigroups} can be used as normal with the exception that this function will not work. 

 Some further details about semigroups in \textsf{GAP} and Green's relations in particular, can be found in  (\textbf{Reference: Semigroups}) and  (\textbf{Reference: Green's Relations}).

 If you find a bug or an issue with the package, then report this using the \href{http://bitbucket.org/james-d-mitchell/semigroups/issues} {issue tracker}. }

 
\section{\textcolor{Chapter }{Installing the \textsf{Semigroups} package}}\label{install}
\logpage{[ 1, 2, 0 ]}
\hyperdef{L}{X7BA677207FAC28B3}{}
{
  In this section we give a brief description of how to start using \textsf{Semigroups}.

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

 The following is a summary of the steps that should lead to a successful
installation of \textsf{Semigroups}: 
\begin{itemize}
\item  ensure that the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/io.html } {IO} package version 4.4.4 or higher is available. \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/io.html } {IO} must be compiled before \textsf{Semigroups} can be loaded. 
\item  ensure that the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/orb.html } {Orb} package version 4.7.3 or higher is available. \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/orb.html } {Orb} and \textsf{Semigroups} both perform better if \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/orb.html } {Orb} is compiled. 
\item  \textsc{This step is optional:} certain functions in \textsf{Semigroups} require the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package to be available and fully compiled; a full list of these functions can
be found above. To use these functions make sure that the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package version 4.5 or higher is available. If \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} is not fully installed (i.e. compiled), then \textsf{Semigroups} can be used as normal with the exception that the functions listed above will
not work. 
\item  \textsc{This step is optional:} the non-deterministic version of the function \texttt{Normalizer} (\ref{Normalizer:for a perm group, semigroup, record}) requires the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/genss.html } {genss} package to be loaded. If you want to use this function, then please ensure
that the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/genss.html } {genss} package version 1.5 or higher is available. 
\item  download the package archive \texttt{semigroups-2.5.tar.gz} from \href{http://www-groups.mcs.st-andrews.ac.uk/~jamesm/semigroups.php} {the Semigroups package webpage}. 
\item  unzip and untar the file, this should create a directory called \texttt{semigroups-2.5}.
\item  locate the \texttt{pkg} directory of your \textsf{GAP} directory, which contains the directories \texttt{lib}, \texttt{doc} and so on. Move the directory \texttt{semigroups-2.5} into the \texttt{pkg} directory. 
\item  start \textsf{GAP} in the usual way.
\item  type \texttt{LoadPackage("semigroups");}
\item  compile the documentation by using \texttt{SemigroupsMakeDoc} (\ref{SemigroupsMakeDoc}). 
\end{itemize}
  Presuming that the above steps can be completed successfully you will be
running the \textsf{Semigroups} package!

 If you want to check that the package is working correctly, you should run
some of the tests described in Section \ref{testing}.

 }

  
\section{\textcolor{Chapter }{Compiling the documentation}}\label{doc}
\logpage{[ 1, 3, 0 ]}
\hyperdef{L}{X7E61798C7D949C4E}{}
{
 To compile the documentation use \texttt{SemigroupsMakeDoc} (\ref{SemigroupsMakeDoc}). If you want to use the help system, it is essential that you compile the
documentation. 

\subsection{\textcolor{Chapter }{SemigroupsMakeDoc}}
\logpage{[ 1, 3, 1 ]}\nobreak
\hyperdef{L}{X838F4B0D780C2A3F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupsMakeDoc({\mdseries\slshape })\index{SemigroupsMakeDoc@\texttt{SemigroupsMakeDoc}}
\label{SemigroupsMakeDoc}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
Nothing.



 This function should be called with no argument to compile the \textsf{Semigroups} documentation. }

 }

 
\section{\textcolor{Chapter }{Testing the installation}}\label{testing}
\logpage{[ 1, 4, 0 ]}
\hyperdef{L}{X7AE7A7077F513655}{}
{
 In this section we describe how to test that \textsf{Semigroups} is working as intended. To test that \textsf{Semigroups} is installed correctly use \texttt{SemigroupsTestInstall} (\ref{SemigroupsTestInstall}) or for more extensive tests use \texttt{SemigroupsTestAll} (\ref{SemigroupsTestAll}). Please note that it will take a few seconds for \texttt{SemigroupsTestInstall} (\ref{SemigroupsTestInstall}) to finish and it may take several minutes for \texttt{SemigroupsTestAll} (\ref{SemigroupsTestAll}) to finish.

 If something goes wrong, then please review the instructions in Section \ref{install} and ensure that \textsf{Semigroups} has been properly installed. If you continue having problems, please use the \href{http://bitbucket.org/james-d-mitchell/semigroups/issues} {issue tracker} to report the issues you are having. 

\subsection{\textcolor{Chapter }{SemigroupsTestInstall}}
\logpage{[ 1, 4, 1 ]}\nobreak
\hyperdef{L}{X80F85B577A3DFCF9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupsTestInstall({\mdseries\slshape })\index{SemigroupsTestInstall@\texttt{SemigroupsTestInstall}}
\label{SemigroupsTestInstall}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
Nothing.



 This function should be called with no argument to test your installation of \textsf{Semigroups} is working correctly. These tests should take no more than a fraction of a
second to complete. To more comprehensively test that \textsf{Semigroups} is installed correctly use \texttt{SemigroupsTestAll} (\ref{SemigroupsTestAll}). }

 

\subsection{\textcolor{Chapter }{SemigroupsTestManualExamples}}
\logpage{[ 1, 4, 2 ]}\nobreak
\hyperdef{L}{X7E6C196A78E8665C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupsTestManualExamples({\mdseries\slshape })\index{SemigroupsTestManualExamples@\texttt{SemigroupsTestManualExamples}}
\label{SemigroupsTestManualExamples}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
Nothing.



 This function should be called with no argument to test the examples in the \textsf{Semigroups} manual. These tests should take no more than a few minutes to complete. To
more comprehensively test that \textsf{Semigroups} is installed correctly use \texttt{SemigroupsTestAll} (\ref{SemigroupsTestAll}). See also \texttt{SemigroupsTestInstall} (\ref{SemigroupsTestInstall}). }

 

\subsection{\textcolor{Chapter }{SemigroupsTestAll}}
\logpage{[ 1, 4, 3 ]}\nobreak
\hyperdef{L}{X8544F4BD79F0BF3C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupsTestAll({\mdseries\slshape })\index{SemigroupsTestAll@\texttt{SemigroupsTestAll}}
\label{SemigroupsTestAll}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
Nothing.



 This function should be called with no argument to comprehensively test that \textsf{Semigroups} is working correctly. These tests should take no more than a few minutes to
complete. To quickly test that \textsf{Semigroups} is installed correctly use \texttt{SemigroupsTestInstall} (\ref{SemigroupsTestInstall}). }

 }

 
\section{\textcolor{Chapter }{More information during a computation}}\logpage{[ 1, 5, 0 ]}
\hyperdef{L}{X798CBC46800AB80F}{}
{
 

\subsection{\textcolor{Chapter }{InfoSemigroups}}
\logpage{[ 1, 5, 1 ]}\nobreak
\hyperdef{L}{X85CD4E6C82BECAF3}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{InfoSemigroups\index{InfoSemigroups@\texttt{InfoSemigroups}}
\label{InfoSemigroups}
}\hfill{\scriptsize (info class)}}\\


 \texttt{InfoSemigroups} is the info class of the \textsf{Semigroups} package. The info level is initially set to 0 and no info messages are
displayed. We recommend that you set the level to 1 so that basic info
messages are displayed. To increase the amount of information displayed during
a computation increase the info level to 2 or 3. To stop all info messages
from being displayed, set the info level to 0. See also  (\textbf{Reference: Info Functions}) and \texttt{SetInfoLevel} (\textbf{Reference: SetInfoLevel}). }

 }

 
\section{\textcolor{Chapter }{Reading and writing elements to a file}}\logpage{[ 1, 6, 0 ]}
\hyperdef{L}{X7CE72BB17F2D49F8}{}
{
 The functions \texttt{ReadGenerators} (\ref{ReadGenerators}) and \texttt{WriteGenerators} (\ref{WriteGenerators}) can be used to read or write transformations, partial permutations, and
bipartitions to a file. 

\subsection{\textcolor{Chapter }{SemigroupsDir}}
\logpage{[ 1, 6, 1 ]}\nobreak
\hyperdef{L}{X7BCF050D7C9CB451}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupsDir({\mdseries\slshape })\index{SemigroupsDir@\texttt{SemigroupsDir}}
\label{SemigroupsDir}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A string.



 This function returns the absolute path to the \textsf{Semigroups} package directory as a string. The same result can be obtained typing: 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  PackageInfo("semigroups")[1]!.InstallationPath;
\end{Verbatim}
 at the \textsf{GAP} prompt. }

 

\subsection{\textcolor{Chapter }{ReadGenerators}}
\logpage{[ 1, 6, 2 ]}\nobreak
\hyperdef{L}{X8728096E8427EDE8}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ReadGenerators({\mdseries\slshape filename[, nr]})\index{ReadGenerators@\texttt{ReadGenerators}}
\label{ReadGenerators}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A list of lists of semigroup elements.



 If \mbox{\texttt{\mdseries\slshape filename}} is the name of a file created using \texttt{WriteGenerators} (\ref{WriteGenerators}), then \texttt{ReadGenerators} returns the contents of this file as a list of lists of transformations,
partial permutations, or bipartitions. 

 If the optional second argument \mbox{\texttt{\mdseries\slshape nr}} is present, then \texttt{ReadGenerators} returns the elements stored in the \mbox{\texttt{\mdseries\slshape nr}}th line of \mbox{\texttt{\mdseries\slshape filename}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@file:=Concatenation(SemigroupsDir(), "/tst/test.gz");;|
  !gapprompt@gap>| !gapinput@ReadGenerators(file, 1378);|
  [ Transformation( [ 1, 2, 2 ] ), IdentityTransformation, 
    Transformation( [ 1, 2, 3, 4, 5, 7, 7 ] ), 
    Transformation( [ 1, 3, 2, 4, 7, 6, 7 ] ), 
    Transformation( [ 4, 2, 1, 1, 6, 5 ] ), 
    Transformation( [ 4, 3, 2, 1, 6, 7, 7 ] ), 
    Transformation( [ 4, 4, 5, 7, 6, 1, 1 ] ), 
    Transformation( [ 7, 6, 6, 1, 2, 4, 4 ] ), 
    Transformation( [ 7, 7, 5, 4, 3, 1, 1 ] ) ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{WriteGenerators}}
\logpage{[ 1, 6, 3 ]}\nobreak
\hyperdef{L}{X78041E8F87EFDE62}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{WriteGenerators({\mdseries\slshape filename, list[, append]})\index{WriteGenerators@\texttt{WriteGenerators}}
\label{WriteGenerators}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{fail}.



 This function provides a method for writing transformations, partial
permutations, and bipartitions to a file, that uses a relatively small amount
of disk space. The resulting file can be further compressed using \texttt{gzip} or \texttt{xz}.

 The argument \mbox{\texttt{\mdseries\slshape list}} should be a list of elements, a semigroup, or a list of lists of elements, or
semigroups. The types of elements and semigroups supported are:
transformations, partial permutations, and bipartitions. 

 The argument \mbox{\texttt{\mdseries\slshape filename}} should be a string containing the name of a file where the entries in \mbox{\texttt{\mdseries\slshape list}} will be written or an \textsf{IO} package file object.

 If the optional third argument \mbox{\texttt{\mdseries\slshape append}} is given and equals \texttt{"w"}, then the previous content of the file is deleted. If the optional third
argument is \texttt{"a"} or is not present, then \texttt{list} is appended to the file. This function returns \texttt{true} if everything went well or \texttt{fail} if something went wrong.

 \texttt{WriteGenerators} appends a line to the file \mbox{\texttt{\mdseries\slshape filename}} for every entry in \mbox{\texttt{\mdseries\slshape list}}. If any element of \mbox{\texttt{\mdseries\slshape list}} is a semigroup, then the generators of that semigroup are written to \mbox{\texttt{\mdseries\slshape filename}}. 

 The first character of the appended line indicates which type of element is
contained in that line, the second character \texttt{m} is the number of characters in the degree of the elements to be written, the
next \texttt{m} characters are the degree \texttt{n} of the elements to be written, and the internal representation of the elements
themselves are written in blocks of \texttt{m*n} in the remainder of the line. For example, the transformations: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  [ Transformation( [ 2, 6, 7, 2, 6, 9, 9, 1, 1, 5 ] ), 
    Transformation( [ 3, 8, 1, 9, 9, 4, 10, 5, 10, 6 ] )]
\end{Verbatim}
 are written as: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  t210 2 2 6 7 2 6 9 9 1 1 5 3 8 1 9 9 410 510 6
\end{Verbatim}
 The file \mbox{\texttt{\mdseries\slshape filename}} can be read using \texttt{ReadGenerators} (\ref{ReadGenerators}). }

 

\subsection{\textcolor{Chapter }{IteratorFromGeneratorsFile}}
\logpage{[ 1, 6, 4 ]}\nobreak
\hyperdef{L}{X8711D6E280F87E67}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorFromGeneratorsFile({\mdseries\slshape filename})\index{IteratorFromGeneratorsFile@\texttt{IteratorFromGeneratorsFile}}
\label{IteratorFromGeneratorsFile}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
An iterator.



 If \mbox{\texttt{\mdseries\slshape filename}} is a string containing the name of a file created using \texttt{WriteGenerators} (\ref{WriteGenerators}), then \texttt{IteratorFromGeneratorsFile} returns an iterator \texttt{iter} such that \texttt{NextIterator(iter)} returns the next collection of generators stored in the file \mbox{\texttt{\mdseries\slshape filename}}. 

 This function is a convenient way of, for example, looping over a collection
of generators in a file without loading every object in the file into memory.
This might be useful if the file contains more information than there is
available memory. }

 }

 }

 
\chapter{\textcolor{Chapter }{Creating semigroups and monoids}}\label{create}
\logpage{[ 2, 0, 0 ]}
\hyperdef{L}{X79A4C070831D989D}{}
{
 In this chapter we describe the various ways that semigroups and monoids can
be created in \textsf{Semigroups}, the options that are available at the time of creation, and describe some
standard examples available in \textsf{Semigroups}. 

 Any semigroup created before \textsf{Semigroups} has been loaded must be recreated after \textsf{Semigroups} is loaded so that the options record (described in Section \ref{opts}) is defined. Almost all of the functions and methods provided by \textsf{Semigroups}, including those methods for existing \textsf{GAP} library functions, will return an error when applied to a semigroup created
before \textsf{Semigroups} is loaded. 
\section{\textcolor{Chapter }{Random semigroups}}\logpage{[ 2, 1, 0 ]}
\hyperdef{L}{X7C3F130B8362D55A}{}
{
 

\subsection{\textcolor{Chapter }{RandomInverseMonoid}}
\logpage{[ 2, 1, 1 ]}\nobreak
\hyperdef{L}{X7B341D6C7CECFB55}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomInverseMonoid({\mdseries\slshape m, n})\index{RandomInverseMonoid@\texttt{RandomInverseMonoid}}
\label{RandomInverseMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomInverseSemigroup({\mdseries\slshape m, n})\index{RandomInverseSemigroup@\texttt{RandomInverseSemigroup}}
\label{RandomInverseSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
An inverse monoid or semigroup.



 Returns a random inverse monoid or semigroup of partial permutations with
degree at most \mbox{\texttt{\mdseries\slshape n}} with \mbox{\texttt{\mdseries\slshape m}} generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=RandomInverseSemigroup(10,10);                                |
  <inverse partial perm semigroup on 10 pts with 10 generators>
  !gapprompt@gap>| !gapinput@S:=RandomInverseMonoid(10,10);   |
  <inverse partial perm monoid on 10 pts with 10 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomTransformationMonoid}}
\logpage{[ 2, 1, 2 ]}\nobreak
\hyperdef{L}{X79834BC080B011B4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomTransformationMonoid({\mdseries\slshape m, n})\index{RandomTransformationMonoid@\texttt{RandomTransformationMonoid}}
\label{RandomTransformationMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomTransformationSemigroup({\mdseries\slshape m, n})\index{RandomTransformationSemigroup@\texttt{RandomTransformationSemigroup}}
\label{RandomTransformationSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A transformation semigroup or monoid.



 Returns a random transformation monoid or semigroup of at most degree \mbox{\texttt{\mdseries\slshape n}} with \mbox{\texttt{\mdseries\slshape m}} generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=RandomTransformationMonoid(5,5);|
  <transformation monoid on 5 pts with 5 generators>
  !gapprompt@gap>| !gapinput@S:=RandomTransformationSemigroup(5,5);|
  <transformation semigroup on 5 pts with 5 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomPartialPermMonoid}}
\logpage{[ 2, 1, 3 ]}\nobreak
\hyperdef{L}{X843D7E2B7D951523}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomPartialPermMonoid({\mdseries\slshape m, n})\index{RandomPartialPermMonoid@\texttt{RandomPartialPermMonoid}}
\label{RandomPartialPermMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomPartialPermSemigroup({\mdseries\slshape m, n})\index{RandomPartialPermSemigroup@\texttt{RandomPartialPermSemigroup}}
\label{RandomPartialPermSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A partial perm semigroup or monoid.



 Returns a random partial perm monoid or semigroup of degree at most \mbox{\texttt{\mdseries\slshape n}} with \mbox{\texttt{\mdseries\slshape m}} generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=RandomPartialPermSemigroup(5, 5);|
  <partial perm semigroup on 4 pts with 5 generators>
  !gapprompt@gap>| !gapinput@S:=RandomPartialPermMonoid(5, 5);|
  <partial perm monoid on 5 pts with 5 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomBinaryRelationMonoid}}
\logpage{[ 2, 1, 4 ]}\nobreak
\hyperdef{L}{X84882D0F7F6C12D3}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomBinaryRelationMonoid({\mdseries\slshape m, n})\index{RandomBinaryRelationMonoid@\texttt{RandomBinaryRelationMonoid}}
\label{RandomBinaryRelationMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomBinaryRelationSemigroup({\mdseries\slshape m, n})\index{RandomBinaryRelationSemigroup@\texttt{RandomBinaryRelationSemigroup}}
\label{RandomBinaryRelationSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup or monoid of binary relations.



 Returns a random monoid or semigroup of binary relations on \mbox{\texttt{\mdseries\slshape n}} points with \mbox{\texttt{\mdseries\slshape m}} generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@RandomBinaryRelationSemigroup(5,5);|
  <semigroup with 5 generators>
  !gapprompt@gap>| !gapinput@RandomBinaryRelationMonoid(5,5);   |
  <monoid with 5 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomBipartitionSemigroup}}
\logpage{[ 2, 1, 5 ]}\nobreak
\hyperdef{L}{X7ED057FE7D9B7C5B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomBipartitionSemigroup({\mdseries\slshape m, n})\index{RandomBipartitionSemigroup@\texttt{RandomBipartitionSemigroup}}
\label{RandomBipartitionSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomBipartitionMonoid({\mdseries\slshape m, n})\index{RandomBipartitionMonoid@\texttt{RandomBipartitionMonoid}}
\label{RandomBipartitionMonoid}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A bipartition semigroup or monoid.



 Returns a random monoid or semigroup of bipartition on \mbox{\texttt{\mdseries\slshape n}} points with \mbox{\texttt{\mdseries\slshape m}} generators. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@RandomBipartitionMonoid(5,5);|
  <bipartition monoid on 5 pts with 5 generators>
  !gapprompt@gap>| !gapinput@RandomBipartitionSemigroup(5,5);|
  <bipartition semigroup on 5 pts with 5 generators>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{New semigroups from old}}\logpage{[ 2, 2, 0 ]}
\hyperdef{L}{X7A5CFD4F8607CBF7}{}
{
 

\subsection{\textcolor{Chapter }{ClosureInverseSemigroup}}
\logpage{[ 2, 2, 1 ]}\nobreak
\hyperdef{L}{X78A488637BBEF7AD}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ClosureInverseSemigroup({\mdseries\slshape S, coll[, opts]})\index{ClosureInverseSemigroup@\texttt{ClosureInverseSemigroup}}
\label{ClosureInverseSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
An inverse semigroup or monoid.



 This function returns the inverse semigroup or monoid generated by the inverse
semigroup \mbox{\texttt{\mdseries\slshape S}} and the collection of elements \mbox{\texttt{\mdseries\slshape coll}} after first removing duplicates and elements in \mbox{\texttt{\mdseries\slshape coll}} that are already in \mbox{\texttt{\mdseries\slshape S}}. In most cases, the new semigroup knows at least as much information about
its structure as was already known about that of \mbox{\texttt{\mdseries\slshape S}}. 

 If present, the optional third argument \mbox{\texttt{\mdseries\slshape opts}} should be a record containing the values of the options for the inverse
semigroup being created; these options are described in Section \ref{opts}. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseMonoid(|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5, 6, 7, 8 ], [ 5, 9, 10, 6, 3, 8, 4 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 4, 7, 8, 9 ], [ 10, 7, 8, 5, 9, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@f:=PartialPerm(|
  !gapprompt@>| !gapinput@[ 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 18, 19, 20 ],|
  !gapprompt@>| !gapinput@[ 5, 1, 7, 3, 10, 2, 12, 14, 11, 16, 6, 9, 15 ]);;|
  !gapprompt@gap>| !gapinput@S:=ClosureInverseSemigroup(S, f);|
  <inverse partial perm semigroup on 19 pts with 4 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  9744
  !gapprompt@gap>| !gapinput@T:=Idempotents(SymmetricInverseSemigroup(10));;|
  !gapprompt@gap>| !gapinput@S:=ClosureInverseSemigroup(S, T);|
  <inverse partial perm semigroup on 19 pts with 854 generators>
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(SmallGeneratingSet(S));|
  <inverse partial perm semigroup on 19 pts with 14 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ClosureSemigroup}}
\logpage{[ 2, 2, 2 ]}\nobreak
\hyperdef{L}{X7BE36790862AE26F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ClosureSemigroup({\mdseries\slshape S, coll[, opts]})\index{ClosureSemigroup@\texttt{ClosureSemigroup}}
\label{ClosureSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup or monoid.



 This function returns the semigroup or monoid generated by the semigroup \mbox{\texttt{\mdseries\slshape S}} and the collection of elements \mbox{\texttt{\mdseries\slshape coll}} after removing duplicates and elements from \mbox{\texttt{\mdseries\slshape coll}} that are already in \mbox{\texttt{\mdseries\slshape S}}. In most cases, the new semigroup knows at least as much information about
its structure as was already known about that of \mbox{\texttt{\mdseries\slshape S}}. 

 If present, the optional third argument \mbox{\texttt{\mdseries\slshape opts}} should be a record containing the values of the options for the semigroup
being created as described in Section \ref{opts}.

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 6, 7, 2, 6, 1, 1, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 3, 8, 1, 4, 5, 6, 7, 1 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 4, 3, 2, 7, 7, 6, 6, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 7, 1, 7, 4, 2, 5, 6, 3 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Monoid(gens[1]);;|
  !gapprompt@gap>| !gapinput@for i in [2..4] do S:=ClosureSemigroup(S, gens[i]); od;|
  !gapprompt@gap>| !gapinput@S;|
  <transformation monoid on 8 pts with 4 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  233606
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SubsemigroupByProperty (for a semigroup and function)}}
\logpage{[ 2, 2, 3 ]}\nobreak
\hyperdef{L}{X7E5B4C5A82F9E0E0}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SubsemigroupByProperty({\mdseries\slshape S, func})\index{SubsemigroupByProperty@\texttt{SubsemigroupByProperty}!for a semigroup and function}
\label{SubsemigroupByProperty:for a semigroup and function}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SubsemigroupByProperty({\mdseries\slshape S, func, limit})\index{SubsemigroupByProperty@\texttt{SubsemigroupByProperty}!for a semigroup, function, and limit on the size of the subsemigroup}
\label{SubsemigroupByProperty:for a semigroup, function, and limit on the size of the subsemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup.



 \texttt{SubsemigroupByProperty} returns the subsemigroup of the semigroup \mbox{\texttt{\mdseries\slshape S}} generated by those elements of \mbox{\texttt{\mdseries\slshape S}} fulfilling \mbox{\texttt{\mdseries\slshape func}} (which should be a function returning \texttt{true} or \texttt{false}).

 If no elements of \mbox{\texttt{\mdseries\slshape S}} fulfil \mbox{\texttt{\mdseries\slshape func}}, then \texttt{fail} is returned.

 If the optional third argument \mbox{\texttt{\mdseries\slshape limit}} is present and a positive integer, then once the subsemigroup has at least \mbox{\texttt{\mdseries\slshape limit}} elements the computation stops. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@func:=function(f) return 1^f<>1 and|
  !gapprompt@>| !gapinput@ForAll([1..DegreeOfTransformation(f)], y-> y=1 or y^f=y); end;|
  function( f ) ... end
  !gapprompt@gap>| !gapinput@T:=SubsemigroupByProperty(FullTransformationSemigroup(3), func);|
  <transformation semigroup of size 2, on 3 pts with 2 generators>
  !gapprompt@gap>| !gapinput@T:=SubsemigroupByProperty(FullTransformationSemigroup(4), func);|
  <transformation semigroup of size 3, on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@T:=SubsemigroupByProperty(FullTransformationSemigroup(5), func);|
  <transformation semigroup of size 4, on 5 pts with 4 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{InverseSubsemigroupByProperty}}
\logpage{[ 2, 2, 4 ]}\nobreak
\hyperdef{L}{X832AEDCC7BA9E5F5}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{InverseSubsemigroupByProperty({\mdseries\slshape S, func})\index{InverseSubsemigroupByProperty@\texttt{InverseSubsemigroupByProperty}}
\label{InverseSubsemigroupByProperty}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
An inverse semigroup.



 \texttt{InverseSubsemigroupByProperty} returns the inverse subsemigroup of the inverse semigroup \mbox{\texttt{\mdseries\slshape S}} generated by those elements of \mbox{\texttt{\mdseries\slshape S}} fulfilling \mbox{\texttt{\mdseries\slshape func}} (which should be a function returning \texttt{true} or \texttt{false}).

 If no elements of \mbox{\texttt{\mdseries\slshape S}} fulfil \mbox{\texttt{\mdseries\slshape func}}, then \texttt{fail} is returned.

 If the optional third argument \mbox{\texttt{\mdseries\slshape limit}} is present and a positive integer, then once the subsemigroup has at least \mbox{\texttt{\mdseries\slshape limit}} elements the computation stops. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@IsIsometry:=function(f)|
  !gapprompt@>| !gapinput@local n, i, j, k, l;|
  !gapprompt@>| !gapinput@ n:=RankOfPartialPerm(f);|
  !gapprompt@>| !gapinput@ for i in [1..n-1] do|
  !gapprompt@>| !gapinput@   k:=DomainOfPartialPerm(f)[i];|
  !gapprompt@>| !gapinput@   for j in [i+1..n] do|
  !gapprompt@>| !gapinput@     l:=DomainOfPartialPerm(f)[j];|
  !gapprompt@>| !gapinput@     if not AbsInt(k^f-l^f)=AbsInt(k-l) then|
  !gapprompt@>| !gapinput@       return false;|
  !gapprompt@>| !gapinput@     fi;|
  !gapprompt@>| !gapinput@   od;|
  !gapprompt@>| !gapinput@ od;|
  !gapprompt@>| !gapinput@ return true;|
  !gapprompt@>| !gapinput@end;;|
  !gapprompt@gap>| !gapinput@S:=InverseSubsemigroupByProperty(SymmetricInverseSemigroup(5),|
  !gapprompt@>| !gapinput@IsIsometry);;|
  !gapprompt@gap>| !gapinput@Size(S);|
  142
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Options when creating semigroups}}\label{opts}
\logpage{[ 2, 3, 0 ]}
\hyperdef{L}{X799EBA2F819D8867}{}
{
 When using any of the functions: 
\begin{itemize}
\item \texttt{InverseSemigroup} (\textbf{Reference: InverseSemigroup}),
\item \texttt{InverseMonoid} (\textbf{Reference: InverseMonoid}),
\item \texttt{Semigroup} (\textbf{Reference: Semigroup}),
\item \texttt{Monoid} (\textbf{Reference: Monoid}),
\item \texttt{SemigroupByGenerators} (\textbf{Reference: SemigroupByGenerators}),
\item \texttt{MonoidByGenerators} (\textbf{Reference: MonoidByGenerators}),
\item \texttt{ClosureInverseSemigroup} (\ref{ClosureInverseSemigroup}),
\item \texttt{ClosureSemigroup} (\ref{ClosureSemigroup}),
\item \texttt{SemigroupIdeal} (\ref{SemigroupIdeal})
\end{itemize}
 a record can be given as an optional final argument. The components of this
record specify the values of certain options for the semigroup being created.
A list of these options and their default values is given below. 

 Assume that \mbox{\texttt{\mdseries\slshape S}} is the semigroup created by one of the functions given above and that either: \mbox{\texttt{\mdseries\slshape S}} is generated by a collection \mbox{\texttt{\mdseries\slshape gens}} of transformations, partial permutations, Rees 0-matrix semigroup elements, or
bipartitions; or \mbox{\texttt{\mdseries\slshape S}} is an ideal of such a semigroup. 
\begin{description}
\item[{\texttt{acting}}]  this component should be \texttt{true} or \texttt{false}. In order for a semigroup to use the methods in \textsf{Semigroups} it must satisfy \texttt{IsActingSemigroup}. By default any semigroup or monoid of transformations, partial permutations,
Rees 0-matrix elements, or bipartitions satisfies \texttt{IsActingSemigroup}. From time to time, it might be preferable to use the exhaustive algorithm in
the \textsf{GAP} library to compute with a semigroup. If this is the case, then the value of
this component can be set \texttt{false} when the semigroup is created. Following this none of the methods in the \textsf{Semigroups} package will be used to compute anything about the semigroup. 
\item[{\texttt{regular}}]  this component should be \texttt{true} or \texttt{false}. If it is known \emph{a priori} that the semigroup \texttt{S} being created is a regular semigroup, then this component can be set to \texttt{true}. In this case, \texttt{S} knows it is a regular semigroup and can take advantage of the methods for
regular semigroups in \textsf{Semigroups}. It is usually much more efficient to compute with a regular semigroup that
to compute with a non-regular semigroup.

 If this option is set to \texttt{true} when the semigroup being defined is \textsc{not} regular, then the results might be unpredictable. 

 The default value for this option is \texttt{false}. 
\item[{\texttt{hashlen}}]  this component should be a positive integer, which roughly specifies the
lengths of the hash tables used internally by \textsf{Semigroups}. \textsf{Semigroups} uses hash tables in several fundamental methods. The lengths of these tables
are a compromise between performance and memory usage; larger tables provide
better performance for large computations but use more memory. Note that it is
unlikely that you will need to specify this option unless you find that \textsf{GAP} runs out of memory unexpectedly or that the performance of \textsf{Semigroups} is poorer than expected. If you find that \textsf{GAP} runs out of memory unexpectedly, or you plan to do a large number of
computations with relatively small semigroups (say with tens of thousands of
elements), then you might consider setting \texttt{hashlen} to be less than the default value of \texttt{25013} for each of these semigroups. If you find that the performance of \textsf{Semigroups} is unexpectedly poor, or you plan to do a computation with a very large
semigroup (say, more than 10 million elements), then you might consider
setting \texttt{hashlen} to be greater than the default value of \texttt{25013}. 

 You might find it useful to set the info level of the info class \texttt{InfoOrb} to 2 or higher since this will indicate when hash tables used by \textsf{Semigroups} are being grown; see \texttt{SetInfoLevel} (\textbf{Reference: SetInfoLevel}). 
\item[{\texttt{small}}] if this component is set to \texttt{true}, then \textsf{Semigroups} will compute a small subset of \mbox{\texttt{\mdseries\slshape gens}} that generates \mbox{\texttt{\mdseries\slshape S}} at the time that \mbox{\texttt{\mdseries\slshape S}} is created. This will increase the amount of time required to create \mbox{\texttt{\mdseries\slshape S}} substantially, but may decrease the amount of time required for subsequent
calculations with \mbox{\texttt{\mdseries\slshape S}}. If this component is set to \texttt{false}, then \textsf{Semigroups} will return the semigroup generated by \mbox{\texttt{\mdseries\slshape gens}} without modifying \mbox{\texttt{\mdseries\slshape gens}}. The default value for this component is \texttt{false}.

 This option is ignored when passed to \texttt{ClosureSemigroup} (\ref{ClosureSemigroup}) or \texttt{ClosureInverseSemigroup} (\ref{ClosureInverseSemigroup}). 
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 1, 2, 3, 3 ] ), |
  !gapprompt@>| !gapinput@rec(hashlen:=100003, small:=false));|
  <commutative transformation semigroup on 4 pts with 1 generator>
\end{Verbatim}
 The default values of the options described above are stored in a global
variable named \texttt{SemigroupsOptionsRec} (\ref{SemigroupsOptionsRec}). If you want to change the default values of these options for a single \textsf{GAP} session, then you can simply redefine the value in \textsf{GAP}. For example, to change the option \texttt{small} from the default value of \mbox{\texttt{\mdseries\slshape false}} use: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@SemigroupsOptionsRec.small:=true;|
  true
\end{Verbatim}
 If you want to change the default values of the options stored in \texttt{SemigroupsOptionsRec} (\ref{SemigroupsOptionsRec}) for all \textsf{GAP} sessions, then you can edit these values in the file \texttt{semigroups/gap/options.g}. 

 

\subsection{\textcolor{Chapter }{SemigroupsOptionsRec}}
\logpage{[ 2, 3, 1 ]}\nobreak
\hyperdef{L}{X7969E83287A8FD5D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupsOptionsRec\index{SemigroupsOptionsRec@\texttt{SemigroupsOptionsRec}}
\label{SemigroupsOptionsRec}
}\hfill{\scriptsize (global variable)}}\\


 This global variable is a record whose components contain the default values
of certain options for transformation semigroups created after \textsf{Semigroups} has been loaded. A description of these options is given above in Section \ref{opts}. 

 The value of \texttt{SemigroupsOptionsRec} is defined in the file \texttt{semigroups/gap/options.g} as: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  rec( acting := true, hashlen := rec( L := 25013, M := 6257, S :=
           251 ), regular := false, small := false )
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Changing the representation of a semigroup}}\logpage{[ 2, 4, 0 ]}
\hyperdef{L}{X82CCC1A781650878}{}
{
 In addition, to the library functions 
\begin{itemize}
\item \texttt{IsomorphismReesMatrixSemigroup} (\textbf{Reference: IsomorphismReesMatrixSemigroup}),
\item \texttt{AntiIsomorphismTransformationSemigroup} (\textbf{Reference: AntiIsomorphismTransformationSemigroup}), 
\item \texttt{IsomorphismTransformationSemigroup} (\textbf{Reference: IsomorphismTransformationSemigroup}), 
\item \texttt{IsomorphismPartialPermSemigroup} (\textbf{Reference: IsomorphismPartialPermSemigroup}),
\end{itemize}
 there are several methods for changing the representation of a semigroup in \textsf{Semigroups}. There are also methods for the operations given above for the types of
semigroups defined in \textsf{Semigroups} which are not mentioned in the reference manual. 

\subsection{\textcolor{Chapter }{AsTransformationSemigroup}}
\logpage{[ 2, 4, 1 ]}\nobreak
\hyperdef{L}{X7C6F3A667F09BAEC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsTransformationSemigroup({\mdseries\slshape S})\index{AsTransformationSemigroup@\texttt{AsTransformationSemigroup}}
\label{AsTransformationSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsPartialPermSemigroup({\mdseries\slshape S})\index{AsPartialPermSemigroup@\texttt{AsPartialPermSemigroup}}
\label{AsPartialPermSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsBipartitionSemigroup({\mdseries\slshape S})\index{AsBipartitionSemigroup@\texttt{AsBipartitionSemigroup}}
\label{AsBipartitionSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsBlockBijectionSemigroup({\mdseries\slshape S})\index{AsBlockBijectionSemigroup@\texttt{AsBlockBijectionSemigroup}}
\label{AsBlockBijectionSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup.



 \texttt{AsTransformationSemigroup(\mbox{\texttt{\mdseries\slshape S}})} is just shorthand for \texttt{Range(IsomorphismTransformationSemigroup(\mbox{\texttt{\mdseries\slshape S}}))}, when \mbox{\texttt{\mdseries\slshape S}} is a semigroup; see \texttt{IsomorphismTransformationSemigroup} (\textbf{Reference: IsomorphismTransformationSemigroup}) for more details.

 The operations: 
\begin{itemize}
\item  \texttt{AsPartialPermSemigroup};
\item  \texttt{AsBipartitionSemigroup};
\item  \texttt{AsBlockBijectionSemigroup};
\end{itemize}
 are analogous to \texttt{AsTransformationSemigroup}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( [ Bipartition( [ [ 1, 2 ], [ 3, 6, -2 ], |
  !gapprompt@>| !gapinput@[ 4, 5, -3, -4 ], [ -1, -6 ], [ -5 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -4 ], [ 2, 3, 4, 5 ], [ 6 ], [ -1, -6 ], |
  !gapprompt@>| !gapinput@[ -2, -3 ], [ -5 ] ] ) ] );|
  <bipartition semigroup on 6 pts with 2 generators>
  !gapprompt@gap>| !gapinput@AsTransformationSemigroup(S);|
  <transformation semigroup on 12 pts with 2 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsomorphismPermGroup}}
\logpage{[ 2, 4, 2 ]}\nobreak
\hyperdef{L}{X80B7B1C783AA1567}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsomorphismPermGroup({\mdseries\slshape S})\index{IsomorphismPermGroup@\texttt{IsomorphismPermGroup}}
\label{IsomorphismPermGroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 An isomorphism. 



 If the semigroup \mbox{\texttt{\mdseries\slshape S}} satisfies \texttt{IsGroupAsSemigroup} (\ref{IsGroupAsSemigroup}), then \texttt{IsomorphismPermGroup} returns an isomorphism to a permutation group.

 If \mbox{\texttt{\mdseries\slshape S}} does not satisfy \texttt{IsGroupAsSemigroup} (\ref{IsGroupAsSemigroup}), then an error is given. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 2, 2, 3, 4, 6, 8, 5, 5 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 8, 2, 5, 6, 4, 4 ] ) );;|
  !gapprompt@gap>| !gapinput@IsGroupAsSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@IsomorphismPermGroup(S); |
  MappingByFunction( <transformation group on 8 pts with 2 generators>
   , Group([ (5,6,8), (2,3,8,
  4) ]), <Attribute "PermutationOfImage">, function( x ) ... end )
  !gapprompt@gap>| !gapinput@StructureDescription(Range(IsomorphismPermGroup(S)));|
  "S6"
  !gapprompt@gap>| !gapinput@S:=Range(IsomorphismPartialPermSemigroup(SymmetricGroup(4)));|
  <inverse partial perm semigroup on 4 pts with 2 generators>
  !gapprompt@gap>| !gapinput@IsomorphismPermGroup(S);|
  MappingByFunction( <partial perm group on 4 pts with 2 generators>
   , Group([ (1,2,3,4), (1,
  2) ]), <Attribute "AsPermutation">, function( x ) ... end )
  !gapprompt@gap>| !gapinput@G:=GroupOfUnits(PartitionMonoid(4));|
  <bipartition group on 4 pts with 2 generators>
  !gapprompt@gap>| !gapinput@StructureDescription(G);|
  "S4"
  !gapprompt@gap>| !gapinput@iso:=IsomorphismPermGroup(G);  |
  MappingByFunction( <bipartition group on 4 pts with 2 generators>
   , S4, <Attribute "AsPermutation">, function( x ) ... end )
  !gapprompt@gap>| !gapinput@RespectsMultiplication(iso);|
  true
  !gapprompt@gap>| !gapinput@inv:=InverseGeneralMapping(iso);;|
  !gapprompt@gap>| !gapinput@ForAll(G, x-> (x^iso)^inv=x);|
  true
  !gapprompt@gap>| !gapinput@ForAll(G, x-> ForAll(G, y-> (x*y)^iso=x^iso*y^iso));|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsomorphismBipartitionSemigroup}}
\logpage{[ 2, 4, 3 ]}\nobreak
\hyperdef{L}{X83FC67AE7ECDD526}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsomorphismBipartitionSemigroup({\mdseries\slshape S})\index{IsomorphismBipartitionSemigroup@\texttt{IsomorphismBipartitionSemigroup}}
\label{IsomorphismBipartitionSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsomorphismBipartitionMonoid({\mdseries\slshape S})\index{IsomorphismBipartitionMonoid@\texttt{IsomorphismBipartitionMonoid}}
\label{IsomorphismBipartitionMonoid}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
An isomorphism.



 If \mbox{\texttt{\mdseries\slshape S}} is a semigroup, then \texttt{IsomorphismBipartitionSemigroup} returns an isomorphism from \mbox{\texttt{\mdseries\slshape S}} to a bipartition semigroup. When \mbox{\texttt{\mdseries\slshape S}} is a transformation semigroup, partial permutation semigroup, or a permutation
group, on \texttt{n} points, \texttt{IsomorphismBipartitionSemigroup} returns the natural embedding of \mbox{\texttt{\mdseries\slshape S}} into the partition monoid on \texttt{n} points. When \mbox{\texttt{\mdseries\slshape S}} is a generic semigroup, this funciton returns the right regular representation
of \mbox{\texttt{\mdseries\slshape S}} acting on \mbox{\texttt{\mdseries\slshape S}} with an identity adjoined.

 See \texttt{AsBipartition} (\ref{AsBipartition}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 6, 7, 8, 10 ], |
  !gapprompt@>| !gapinput@ [ 3, 8, 1, 9, 4, 10, 5, 6 ] ) );;|
  !gapprompt@gap>| !gapinput@IsomorphismBipartitionSemigroup(S);|
  MappingByFunction( <inverse partial perm semigroup on 10 pts
   with 2 generators>, <inverse bipartition semigroup 
   on 10 pts with 2 generators>
   , function( x ) ... end, <Operation "AsPartialPerm"> )
  !gapprompt@gap>| !gapinput@ForAll(Generators(Range(last)), IsPartialPermBipartition);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsomorphismBlockBijectionSemigroup}}
\logpage{[ 2, 4, 4 ]}\nobreak
\hyperdef{L}{X869E6EF87DE8529D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsomorphismBlockBijectionSemigroup({\mdseries\slshape S})\index{IsomorphismBlockBijectionSemigroup@\texttt{IsomorphismBlockBijectionSemigroup}}
\label{IsomorphismBlockBijectionSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsomorphismBlockBijectionMonoid({\mdseries\slshape S})\index{IsomorphismBlockBijectionMonoid@\texttt{IsomorphismBlockBijectionMonoid}}
\label{IsomorphismBlockBijectionMonoid}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
An isomorphism.



 If \mbox{\texttt{\mdseries\slshape S}} is a partial perm semigroup on \texttt{n} points, then this function returns the embedding of \mbox{\texttt{\mdseries\slshape S}} into a subsemigroup of the dual symmetric inverse monoid on \texttt{n+1} points given by the FitzGerald-Leech Theorem \cite{Fitzgerald1998aa}.

 See \texttt{AsBlockBijection} (\ref{AsBlockBijection}) for more details. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseMonoid(4);                                    |
  <symmetric inverse semigroup on 4 pts>
  !gapprompt@gap>| !gapinput@IsomorphismBlockBijectionSemigroup(S);|
  MappingByFunction( <symmetric inverse semigroup on 4 pts>, 
  <inverse bipartition monoid on 5 pts with 3 generators>
   , function( x ) ... end, function( x ) ... end )
  !gapprompt@gap>| !gapinput@Size(Range(last));|
  209
  !gapprompt@gap>| !gapinput@S:=Semigroup( PartialPerm( [ 1, 2 ], [ 3, 1 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3 ], [ 1, 3, 4 ] ) );;|
  !gapprompt@gap>| !gapinput@IsomorphismBlockBijectionSemigroup(S);|
  MappingByFunction( <partial perm semigroup on 3 pts
   with 2 generators>, <bipartition semigroup on 5 pts with 2 generators
    >, function( x ) ... end, function( x ) ... end )
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Standard examples}}\label{Examples}
\logpage{[ 2, 5, 0 ]}
\hyperdef{L}{X7C76D1DC7DAF03D3}{}
{
 In this section, we describe the operations in \textsf{Semigroups} that can be used to creating semigroups belonging to several standard classes
of example. See Chapter \ref{bipartition} for more information about semigroups of bipartitions. 

\subsection{\textcolor{Chapter }{EndomorphismsPartition}}
\logpage{[ 2, 5, 1 ]}\nobreak
\hyperdef{L}{X85C1D4307D0F5FF7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{EndomorphismsPartition({\mdseries\slshape list})\index{EndomorphismsPartition@\texttt{EndomorphismsPartition}}
\label{EndomorphismsPartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A transformation monoid.



 If \mbox{\texttt{\mdseries\slshape list}} is a list of positive integers, then \texttt{EndomorphismsPartition} returns a monoid of endomorphisms preserving a partition of \texttt{[1..Sum(\mbox{\texttt{\mdseries\slshape list}})]} with a part of length \texttt{\mbox{\texttt{\mdseries\slshape list}}[i]} for every \texttt{i}. For example, if \texttt{\mbox{\texttt{\mdseries\slshape list}}=[1,2,3]}, then \texttt{EndomorphismsPartition} returns the monoid of endomorphisms of the partition \texttt{[[1],[2,3],[4,5,6]]}. 

 If \texttt{f} is a transformation of \texttt{[1..n]}, then it is an \textsc{endomorphism} of a partition \texttt{P} on \texttt{[1..n]} if \texttt{(i,j)} in \texttt{P} implies that \texttt{(i\texttt{\symbol{94}}f, j\texttt{\symbol{94}}f)} is in \texttt{P}. 

 \texttt{EndomorphismsPartition} returns a monoid with a minimal size generating set, as described in \cite{Araujo2014aa}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=EndomorphismsPartition([3,3,3]);|
  <transformation semigroup on 9 pts with 4 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  531441
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{PartitionMonoid}}
\logpage{[ 2, 5, 2 ]}\nobreak
\hyperdef{L}{X7E4B61FF7CCFD74A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PartitionMonoid({\mdseries\slshape n})\index{PartitionMonoid@\texttt{PartitionMonoid}}
\label{PartitionMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SingularPartitionMonoid({\mdseries\slshape n})\index{SingularPartitionMonoid@\texttt{SingularPartitionMonoid}}
\label{SingularPartitionMonoid}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A bipartition monoid.



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then this operation returns the partition monoid of
degree \mbox{\texttt{\mdseries\slshape n}} which is the monoid consisting of all the bipartitions of degree \mbox{\texttt{\mdseries\slshape n}}. 

 \texttt{SingularPartitionMonoid} returns the ideal of the partition monoid consisting of the non-invertible
elements (i.e. those not in the group of units). 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=PartitionMonoid(5);|
  <regular bipartition monoid on 5 pts with 4 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  115975
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{BrauerMonoid}}
\logpage{[ 2, 5, 3 ]}\nobreak
\hyperdef{L}{X79D33B2E7BA3073A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{BrauerMonoid({\mdseries\slshape n})\index{BrauerMonoid@\texttt{BrauerMonoid}}
\label{BrauerMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SingularBrauerMonoid({\mdseries\slshape n})\index{SingularBrauerMonoid@\texttt{SingularBrauerMonoid}}
\label{SingularBrauerMonoid}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A bipartition monoid.



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then this operation returns the Brauer monoid of degree \mbox{\texttt{\mdseries\slshape n}}. The \textsc{Brauer monoid} is the subsemigroup of the partition monoid consisiting of those bipartitions
where the size of every block is 2. 

 \texttt{SingularBrauerMonoid} returns the ideal of the Brauer monoid consisting of the non-invertible
elements (i.e. those not in the group of units), when \mbox{\texttt{\mdseries\slshape n}} is at least 2. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=BrauerMonoid(4);|
  <regular bipartition monoid on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsSubsemigroup(S, JonesMonoid(4));|
  true
  !gapprompt@gap>| !gapinput@Size(S);|
  105
  !gapprompt@gap>| !gapinput@SingularBrauerMonoid(8);|
  <regular bipartition semigroup ideal on 8 pts with 1 generator>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{JonesMonoid}}
\logpage{[ 2, 5, 4 ]}\nobreak
\hyperdef{L}{X8378FC8B840B9706}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{JonesMonoid({\mdseries\slshape n})\index{JonesMonoid@\texttt{JonesMonoid}}
\label{JonesMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TemperleyLiebMonoid({\mdseries\slshape n})\index{TemperleyLiebMonoid@\texttt{TemperleyLiebMonoid}}
\label{TemperleyLiebMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SingularJonesMonoid({\mdseries\slshape n})\index{SingularJonesMonoid@\texttt{SingularJonesMonoid}}
\label{SingularJonesMonoid}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A bipartition monoid.



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then this operation returns the Jones monoid of degree \mbox{\texttt{\mdseries\slshape n}}. The \textsc{Jones monoid} is the subsemigroup of the Brauer monoid consisting of those bipartitions with
a planar diagram. The Jones monoid is sometimes referred to as the \textsc{Temperley-Lieb monoid}. 

 \texttt{SingularJonesMonoid} returns the ideal of the Jones monoid consisting of the non-invertible
elements (i.e. those not in the group of units), when \mbox{\texttt{\mdseries\slshape n}} is at least 2. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=JonesMonoid(4);|
  <regular bipartition monoid on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@SingularJonesMonoid(8);|
  <regular bipartition semigroup ideal on 8 pts with 1 generator>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{FactorisableDualSymmetricInverseSemigroup}}
\logpage{[ 2, 5, 5 ]}\nobreak
\hyperdef{L}{X7D4C502582298AA4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FactorisableDualSymmetricInverseSemigroup({\mdseries\slshape n})\index{FactorisableDualSymmetricInverseSemigroup@\texttt{Factorisable}\-\texttt{Dual}\-\texttt{Symmetric}\-\texttt{Inverse}\-\texttt{Semigroup}}
\label{FactorisableDualSymmetricInverseSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SingularFactorisableDualSymmetricInverseSemigroup({\mdseries\slshape n})\index{SingularFactorisableDualSymmetricInverseSemigroup@\texttt{Singular}\-\texttt{Factorisable}\-\texttt{Dual}\-\texttt{Symmetric}\-\texttt{Inverse}\-\texttt{Semigroup}}
\label{SingularFactorisableDualSymmetricInverseSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
An inverse bipartition monoid.



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then this operation returns the largest factorisable
inverse subsemigroup of the dual symmetric inverse monoid of degree \mbox{\texttt{\mdseries\slshape n}}. 

 \texttt{SingularFactorisableDualSymmetricInverseSemigroup} returns the ideal of the factorisable dual symmetric inverse semigroup
consisting of the non-invertible elements (i.e. those not in the group of
units), when \mbox{\texttt{\mdseries\slshape n}} is at least 2.

 See \texttt{IsUniformBlockBijection} (\ref{IsUniformBlockBijection}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(4);|
  <inverse bipartition monoid on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsFactorisableSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@S:=FactorisableDualSymmetricInverseSemigroup(4);|
  <inverse bipartition monoid on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsFactorisableSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@S:=Range(IsomorphismBipartitionSemigroup(SymmetricInverseMonoid(5)));|
  <inverse bipartition monoid on 5 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsFactorisableSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{DualSymmetricInverseSemigroup}}
\logpage{[ 2, 5, 6 ]}\nobreak
\hyperdef{L}{X83C7587C81B985BA}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DualSymmetricInverseSemigroup({\mdseries\slshape n})\index{DualSymmetricInverseSemigroup@\texttt{DualSymmetricInverseSemigroup}}
\label{DualSymmetricInverseSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DualSymmetricInverseMonoid({\mdseries\slshape n})\index{DualSymmetricInverseMonoid@\texttt{DualSymmetricInverseMonoid}}
\label{DualSymmetricInverseMonoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SingularDualSymmetricInverseSemigroup({\mdseries\slshape n})\index{SingularDualSymmetricInverseSemigroup@\texttt{Singular}\-\texttt{Dual}\-\texttt{Symmetric}\-\texttt{Inverse}\-\texttt{Semigroup}}
\label{SingularDualSymmetricInverseSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
An inverse bipartition monoid.



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then these operations return the dual symmetric inverse
monoid of degree \mbox{\texttt{\mdseries\slshape n}}, which is the subsemigroup of the partition monoid consisting of the block
bijections of degree \mbox{\texttt{\mdseries\slshape n}}.

 \texttt{SingularDualSymmetricInverseSemigroup} returns the ideal of the dual symmetric inverse monoid consisting of the
non-invertible elements (i.e. those not in the group of units), when \mbox{\texttt{\mdseries\slshape n}} is at least 2.

 See \texttt{IsBlockBijection} (\ref{IsBlockBijection}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@Number(PartitionMonoid(3), IsBlockBijection);|
  25
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseSemigroup(3);|
  <inverse bipartition monoid on 3 pts with 3 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  25
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{PartialTransformationSemigroup}}
\logpage{[ 2, 5, 7 ]}\nobreak
\hyperdef{L}{X7E1A7FF08064440C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PartialTransformationSemigroup({\mdseries\slshape n})\index{PartialTransformationSemigroup@\texttt{PartialTransformationSemigroup}}
\label{PartialTransformationSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A transformation monoid.



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then this function returns a semigroup of
transformations on \texttt{\mbox{\texttt{\mdseries\slshape n}}+1} points which is isomorphic to the semigroup consisting of all partial
transformation on \mbox{\texttt{\mdseries\slshape n}} points. This monoid has \texttt{(\mbox{\texttt{\mdseries\slshape n}}+1)\texttt{\symbol{94}}\mbox{\texttt{\mdseries\slshape n}}} elements.  
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@PartialTransformationSemigroup(8); |
  <regular transformation monoid on 9 pts with 4 generators>
  !gapprompt@gap>| !gapinput@Size(last);|
  43046721
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{FullMatrixSemigroup}}
\logpage{[ 2, 5, 8 ]}\nobreak
\hyperdef{L}{X78F9812D79A457EF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FullMatrixSemigroup({\mdseries\slshape d, q})\index{FullMatrixSemigroup@\texttt{FullMatrixSemigroup}}
\label{FullMatrixSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GeneralLinearSemigroup({\mdseries\slshape d, q})\index{GeneralLinearSemigroup@\texttt{GeneralLinearSemigroup}}
\label{GeneralLinearSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A matrix semigroup.



 \texttt{FullMatrixSemigroup} and \texttt{GeneralLinearSemigroup} are synonyms for each other. They both return the full matrix semigroup, or if
you prefer the general linear semigroup, of \mbox{\texttt{\mdseries\slshape d}} by \mbox{\texttt{\mdseries\slshape d}} matrices with entries over the field with \mbox{\texttt{\mdseries\slshape q}} elements. This semigroup has \texttt{q\texttt{\symbol{94}}(d\texttt{\symbol{94}}2)} elements. 

 \textsc{Please note:} there are currently no special methods for computing with matrix semigroups in \textsf{Semigroups} and so it might be advisable to use \texttt{IsomorphismTransformationSemigroup} (\textbf{Reference: IsomorphismTransformationSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=FullMatrixSemigroup(3,4);|
  <full matrix semigroup 3x3 over GF(2^2)>
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismTransformationSemigroup(S));;|
  !gapprompt@gap>| !gapinput@Size(T);|
  262144
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsFullMatrixSemigroup}}
\logpage{[ 2, 5, 9 ]}\nobreak
\hyperdef{L}{X85D49CF2826D3AA4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFullMatrixSemigroup({\mdseries\slshape S})\index{IsFullMatrixSemigroup@\texttt{IsFullMatrixSemigroup}}
\label{IsFullMatrixSemigroup}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsGeneralLinearSemigroup({\mdseries\slshape S})\index{IsGeneralLinearSemigroup@\texttt{IsGeneralLinearSemigroup}}
\label{IsGeneralLinearSemigroup}
}\hfill{\scriptsize (property)}}\\


 \texttt{IsFullMatrixSemigroup} and \texttt{IsGeneralLinearSemigroup} return \texttt{true} if the semigroup \texttt{S} was created using either of the commands \texttt{FullMatrixSemigroup} (\ref{FullMatrixSemigroup}) or \texttt{GeneralLinearSemigroup} (\ref{GeneralLinearSemigroup}) and \texttt{false} otherwise. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=RandomTransformationSemigroup(4,4);;|
  !gapprompt@gap>| !gapinput@IsFullMatrixSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@S:=GeneralLinearSemigroup(3,3);|
  <full matrix semigroup 3x3 over GF(3)>
  !gapprompt@gap>| !gapinput@IsFullMatrixSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MunnSemigroup}}
\logpage{[ 2, 5, 10 ]}\nobreak
\hyperdef{L}{X78FBE6DD7BCA30C1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MunnSemigroup({\mdseries\slshape S})\index{MunnSemigroup@\texttt{MunnSemigroup}}
\label{MunnSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
The Munn semigroup of a semilattice.



 If \mbox{\texttt{\mdseries\slshape S}} is a semilattice, then \texttt{MunnSemigroup} returns the inverse semigroup of partial permutations of isomorphisms of
principal ideals of \mbox{\texttt{\mdseries\slshape S}}; called the \emph{Munn semigroup} of \mbox{\texttt{\mdseries\slshape S}}.

 This function was written jointly by J. D. Mitchell, Yann Peresse (St
Andrews), Yanhui Wang (York). 

 \textsc{Please note:} the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package version 4.5 or higher must be available and compiled for this function
to work. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 10 ], [ 4, 6, 7, 3, 8, 2, 9, 5 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 7, 9 ], [ 5, 6, 4, 3 ] ) );|
  <inverse partial perm semigroup on 10 pts with 2 generators>
  !gapprompt@gap>| !gapinput@T:=InverseSemigroup(Idempotents(S), rec(small:=true));;|
  !gapprompt@gap>| !gapinput@M:=MunnSemigroup(T);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(M);|
  60
  !gapprompt@gap>| !gapinput@NrIdempotents(S);|
  60
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{Monoids of order preserving functions}}\logpage{[ 2, 5, 11 ]}
\hyperdef{L}{X87B855227B9870BD}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{OrderEndomorphisms({\mdseries\slshape n})\index{OrderEndomorphisms@\texttt{OrderEndomorphisms}!monoid of order preserving transformations}
\label{OrderEndomorphisms:monoid of order preserving transformations}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{POI({\mdseries\slshape n})\index{POI@\texttt{POI}!monoid of order preserving partial perms}
\label{POI:monoid of order preserving partial perms}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{POPI({\mdseries\slshape n})\index{POPI@\texttt{POPI}!monoid of orientation preserving partial
      perms}
\label{POPI:monoid of orientation preserving partial
      perms}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup of transformations or partial permutations related to a linear
order. 



 
\begin{description}
\item[{\texttt{OrderEndomorphisms(\mbox{\texttt{\mdseries\slshape n}})}}]  \texttt{OrderEndomorphisms(\mbox{\texttt{\mdseries\slshape n}})} returns the monoid of transformations that preserve the usual order on $\{1,2,\ldots, n\}$ where \mbox{\texttt{\mdseries\slshape n}} is a positive integer.  \texttt{OrderEndomorphisms(\mbox{\texttt{\mdseries\slshape n}})} is generated by the $\mbox{\texttt{\mdseries\slshape n+1}}$ transformations: 
\[ \left( \begin{array}{ccccccccc} 1&2&3&\cdots&n-1& n\\ 1&1&2&\cdots&n-2&n-1
\end{array}\right), \qquad \left( \begin{array}{ccccccccc} 1&2&\cdots&i-1& i&
i+1&i+2&\cdots &n\\ 1&2&\cdots&i-1& i+1&i+1&i+2&\cdots &n\\ \end{array}\right) \]
 where $i=0,\ldots,n-1$ and has ${2n-1\choose n-1}$ elements.  
\item[{\texttt{POI(\mbox{\texttt{\mdseries\slshape n}})}}]  \texttt{POI(\mbox{\texttt{\mdseries\slshape n}})} returns the inverse monoid of partial permutations that preserve the usual
order on $\{1,2,\ldots, n\}$ where \mbox{\texttt{\mdseries\slshape n}} is a positive integer.  \texttt{POI(\mbox{\texttt{\mdseries\slshape n}})} is generated by the $\mbox{\texttt{\mdseries\slshape n}}$ partial permutations: 
\[ \left( \begin{array}{ccccc} 1&2&3&\cdots&n\\ -&1&2&\cdots&n-1
\end{array}\right), \qquad \left( \begin{array}{ccccccccc} 1&2&\cdots&i-1& i&
i+1&i+2&\cdots &n\\ 1&2&\cdots&i-1& i+1&-&i+2&\cdots&n\\ \end{array}\right) \]
 where $i=1, \ldots, n-1$ and has ${2n\choose n}$ elements.  
\item[{\texttt{POPI(\mbox{\texttt{\mdseries\slshape n}})}}]  \texttt{POPI(\mbox{\texttt{\mdseries\slshape n}})} returns the inverse monoid of partial permutation that preserve the
orientation of $\{1,2,\ldots, n\}$ where $n$ is a positive integer.  \texttt{POPI(\mbox{\texttt{\mdseries\slshape n}})} is generated by the partial permutations: 
\[ \left( \begin{array}{ccccc} 1&2&\cdots&n-1&n\\ 2&3&\cdots&n&1
\end{array}\right),\qquad \left( \begin{array}{cccccc} 1&2&\cdots&n-2&n-1&n\\
1&2&\cdots&n-2&n&- \end{array}\right). \]
 and has $1+\frac{n}{2}{2n\choose n}$ elements.  
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=POPI(10);                                            |
  <inverse partial perm monoid on 10 pts with 2 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  923781
  !gapprompt@gap>| !gapinput@1+5*Binomial(20, 10);|
  923781
  !gapprompt@gap>| !gapinput@S:=POI(10);|
  <inverse partial perm monoid on 10 pts with 10 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  184756
  !gapprompt@gap>| !gapinput@Binomial(20,10);|
  184756
  !gapprompt@gap>| !gapinput@IsSubsemigroup(POPI(10), POI(10));|
  true
  !gapprompt@gap>| !gapinput@S:=OrderEndomorphisms(5);|
  <regular transformation monoid on 5 pts with 5 generators>
  !gapprompt@gap>| !gapinput@IsIdempotentGenerated(S);|
  true
  !gapprompt@gap>| !gapinput@Size(S)=Binomial(2*5-1, 5-1);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SingularTransformationSemigroup}}
\logpage{[ 2, 5, 12 ]}\nobreak
\hyperdef{L}{X7894EE357D103806}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SingularTransformationSemigroup({\mdseries\slshape n})\index{SingularTransformationSemigroup@\texttt{SingularTransformationSemigroup}}
\label{SingularTransformationSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SingularTransformationMonoid({\mdseries\slshape n})\index{SingularTransformationMonoid@\texttt{SingularTransformationMonoid}}
\label{SingularTransformationMonoid}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
The semigroup of non-invertible transformations.



 If \mbox{\texttt{\mdseries\slshape n}} is a integer greater than 1, then this function returns the semigroup of
non-invertible transformations, which is generated by the \texttt{\mbox{\texttt{\mdseries\slshape n}}(\mbox{\texttt{\mdseries\slshape n}}-1)} idempotents of degree \mbox{\texttt{\mdseries\slshape n}} and rank \texttt{\mbox{\texttt{\mdseries\slshape n}}-1} and has $n^n-n!$ elements. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SingularTransformationSemigroup(5);|
  <regular transformation semigroup ideal on 5 pts with 1 generator>
  !gapprompt@gap>| !gapinput@Size(S);|
  3005
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RegularBinaryRelationSemigroup}}
\logpage{[ 2, 5, 13 ]}\nobreak
\hyperdef{L}{X831612CD78F55B3C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RegularBinaryRelationSemigroup({\mdseries\slshape n})\index{RegularBinaryRelationSemigroup@\texttt{RegularBinaryRelationSemigroup}}
\label{RegularBinaryRelationSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup of binary relations.



 \texttt{RegularBinaryRelationSemigroup} return the semigroup generated by the regular binary relations on the set $\{1,\ldots, \mbox{\texttt{\mdseries\slshape n}}\}$ for a positive integer \mbox{\texttt{\mdseries\slshape n}}.  \texttt{RegularBinaryRelationSemigroup(\mbox{\texttt{\mdseries\slshape n}})} is generated by the $4$ binary relations: 
\[ \begin{array}{ll} \left(\begin{array}{ccccccccc} 1&2&\cdots&n-1& n\\
2&3&\cdots&n&1 \end{array}\right),& \quad \left(\begin{array}{ccccccccc}
1&2&3&\cdots&n\\ 2&1&3&\cdots&n \end{array}\right),\\
\left(\begin{array}{ccccccccc} 1&2&\cdots&n-1& n\\ 2&2&\cdots&n-1&\{1,n\}
\end{array}\right), &\quad \left(\begin{array}{ccccccccc} 1&2&\cdots&n-1&n\\
2&2&\cdots&n-1&- \end{array}\right). \end{array} \]
  This semigroup has nearly $2^{(n^2)}$ elements. }

 

\subsection{\textcolor{Chapter }{MonogenicSemigroup}}
\logpage{[ 2, 5, 14 ]}\nobreak
\hyperdef{L}{X8411EBD97A220921}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MonogenicSemigroup({\mdseries\slshape m, r})\index{MonogenicSemigroup@\texttt{MonogenicSemigroup}}
\label{MonogenicSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A monogenic transformation semigroup with index \mbox{\texttt{\mdseries\slshape m}} and period \mbox{\texttt{\mdseries\slshape r}}. 



 If \mbox{\texttt{\mdseries\slshape m}} and \mbox{\texttt{\mdseries\slshape r}} are positive integers, then this function returns a monogenic transformation
semigroup \texttt{S} with index \mbox{\texttt{\mdseries\slshape m}} and period \mbox{\texttt{\mdseries\slshape r}}. 

 The semigroup \texttt{S} is generated by a transformation \texttt{f} which has index \mbox{\texttt{\mdseries\slshape m}} and period \mbox{\texttt{\mdseries\slshape r}} (see \texttt{IndexPeriodOfTransformation} (\textbf{Reference: IndexPeriodOfTransformation})). \texttt{S} consists of the elements $f, f ^ {2}, \ldots, f ^ {m}, \ldots, f ^ {m + r - 1}$. The minimal ideal of \texttt{S} consists of the elements $f ^ {m}, \ldots, f ^ {m + r - 1}$ and is isomorphic to the cyclic group of order $r$. 

 See \texttt{IsMonogenicSemigroup} (\ref{IsMonogenicSemigroup}) for more information. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := MonogenicSemigroup(5, 3);|
  <commutative non-regular transformation semigroup of size 7, 
   on 8 pts with 1 generator>
  !gapprompt@gap>| !gapinput@IsMonogenicSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@I := MinimalIdeal(S);|
  <transformation group on 8 pts with 1 generator>
  !gapprompt@gap>| !gapinput@StructureDescription(I);|
  "C3"
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RectangularBand}}
\logpage{[ 2, 5, 15 ]}\nobreak
\hyperdef{L}{X7E4DFDE27BF8B8F7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RectangularBand({\mdseries\slshape m, n})\index{RectangularBand@\texttt{RectangularBand}}
\label{RectangularBand}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A Rees matrix semigroup isomorphic to an \mbox{\texttt{\mdseries\slshape m}} by \mbox{\texttt{\mdseries\slshape n}} rectangular band. 



 If \mbox{\texttt{\mdseries\slshape m}} and \mbox{\texttt{\mdseries\slshape n}} are positive integers, then this function returns a Rees matrix semigroup with \mbox{\texttt{\mdseries\slshape m}} rows and \mbox{\texttt{\mdseries\slshape n}} columns over the trivial group. Such a Rees matrix semigroup is isomorphic to
an \mbox{\texttt{\mdseries\slshape m}} by \mbox{\texttt{\mdseries\slshape n}} rectangular band. 

 See \texttt{IsRectangularBand} (\ref{IsRectangularBand}) for more information. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := RectangularBand(4, 8);|
  <Rees matrix semigroup 4x8 over Group(())>
  !gapprompt@gap>| !gapinput@IsRectangularBand(S);|
  true
  !gapprompt@gap>| !gapinput@IsCompletelySimpleSemigroup(S) and IsHTrivial(S);|
  true
  !gapprompt@gap>| !gapinput@T := AsTransformationSemigroup(S);|
  <transformation semigroup on 33 pts with 8 generators>
  !gapprompt@gap>| !gapinput@IsRectangularBand(T);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ZeroSemigroup}}
\logpage{[ 2, 5, 16 ]}\nobreak
\hyperdef{L}{X801FC1D97D832A6F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ZeroSemigroup({\mdseries\slshape n})\index{ZeroSemigroup@\texttt{ZeroSemigroup}}
\label{ZeroSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A zero partial permutation semigroup of order \mbox{\texttt{\mdseries\slshape n}}. 



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then this function returns a zero semigroup consisting
of \mbox{\texttt{\mdseries\slshape n}} partial permutations. The zero of this semigroup is the empty partial
permutation. 

 See \texttt{IsZeroSemigroup} (\ref{IsZeroSemigroup}) for more information. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ZeroSemigroup(15);|
  <partial perm semigroup of size 15, on 14 pts with 14 generators>
  !gapprompt@gap>| !gapinput@Size(S);|
  15
  !gapprompt@gap>| !gapinput@z := MultiplicativeZero(S);|
  <empty partial perm>
  !gapprompt@gap>| !gapinput@IsZeroSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@ForAll(S, x -> ForAll(S, y -> x * y = z));|
  true
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{Ideals}}\label{Ideals}
\logpage{[ 3, 0, 0 ]}
\hyperdef{L}{X83629803819C4A6F}{}
{
 In this chapter we describe the various ways that an ideal of a semigroup can
be created and manipulated in \textsf{Semigroups}.

 We write \emph{ideal} to mean two-sided ideal everywhere in this chapter.

 The methods in the \textsf{Semigroups} package apply to any ideal of a transformation, partial permutation, or
bipartition semigroup, or an ideal of a subsemigroup of a Rees 0-matrix
semigroup, that is created by the function \texttt{SemigroupIdeal} (\ref{SemigroupIdeal}) or \texttt{SemigroupIdealByGenerators}. Anything that can be calculated for a semigroup defined by a generating set
can also be found for an ideal. This works particularly well for regular
ideals, since such an ideal can be represented using a similar data structure
to that used to represent a semigroup defined by a generating set but without
the necessity to find a generating set for the ideal. Many methods for
non-regular ideals rely on first finding a generating set for the ideal, which
can be costly (but not nearly as costly as an exhaustive enumeration of the
elements of the ideal). We plan to improve the functionality of \textsf{Semigroups} for non-regular ideals in the future. 
\section{\textcolor{Chapter }{Creating ideals}}\logpage{[ 3, 1, 0 ]}
\hyperdef{L}{X82D4D9A578A56A8D}{}
{
 

\subsection{\textcolor{Chapter }{SemigroupIdeal}}
\logpage{[ 3, 1, 1 ]}\nobreak
\hyperdef{L}{X78E15B0184A1DC14}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupIdeal({\mdseries\slshape S, obj1, obj2, ...})\index{SemigroupIdeal@\texttt{SemigroupIdeal}}
\label{SemigroupIdeal}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
An ideal of a semigroup.



 If \mbox{\texttt{\mdseries\slshape obj1}}, \mbox{\texttt{\mdseries\slshape obj2}}, ... are (any combination) of elements of the semigroup \mbox{\texttt{\mdseries\slshape S}} or collections of elements of \mbox{\texttt{\mdseries\slshape S}} (including subsemigroups and ideals of \mbox{\texttt{\mdseries\slshape S}}), then \texttt{SemigroupIdeal} returns the 2-sided ideal of the semigroup \mbox{\texttt{\mdseries\slshape S}} generated by the union of \mbox{\texttt{\mdseries\slshape obj1}}, \mbox{\texttt{\mdseries\slshape obj2}}, ....

 The \texttt{Parent} (\textbf{Reference: Parent}) of the ideal returned by this function is \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseMonoid(10);|
  <symmetric inverse semigroup on 10 pts>
  !gapprompt@gap>| !gapinput@I:=SemigroupIdeal(S, PartialPerm([1,2]));|
  <inverse partial perm semigroup ideal on 10 pts with 1 generator>
  !gapprompt@gap>| !gapinput@Size(I);|
  4151
  !gapprompt@gap>| !gapinput@I:=SemigroupIdeal(S, I, Idempotents(S));|
  <inverse partial perm semigroup ideal on 10 pts with 1025 generators>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Attributes of ideals}}\logpage{[ 3, 2, 0 ]}
\hyperdef{L}{X85D4E72B787B1C49}{}
{
 

\subsection{\textcolor{Chapter }{GeneratorsOfSemigroupIdeal}}
\logpage{[ 3, 2, 1 ]}\nobreak
\hyperdef{L}{X87BB45DB844D41BC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GeneratorsOfSemigroupIdeal({\mdseries\slshape I})\index{GeneratorsOfSemigroupIdeal@\texttt{GeneratorsOfSemigroupIdeal}}
\label{GeneratorsOfSemigroupIdeal}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The generators of an ideal of a semigroup.



 This function returns the generators of the two-sided ideal \mbox{\texttt{\mdseries\slshape I}}, which were used to defined \mbox{\texttt{\mdseries\slshape I}} when it was created. 

 If \mbox{\texttt{\mdseries\slshape I}} is an ideal of a semigroup, then \mbox{\texttt{\mdseries\slshape I}} is defined to be the least 2-sided ideal of a semigroup \texttt{S} containing a set \texttt{J} of elements of \texttt{S}. The set \texttt{J} is said to \emph{generate} \mbox{\texttt{\mdseries\slshape I}}. 

 The notion of the generators of an ideal is distinct from the notion of the
generators of a semigroup or monoid. In particular, the semigroup generated by
the generators of an ideal is not, in general, equal to that ideal. Use \texttt{GeneratorsOfSemigroup} (\textbf{Reference: GeneratorsOfSemigroup}) to obtain a semigroup generating set for an ideal, but beware that this can be
very costly. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, 4, -1 ], [ -2, -4 ], [ -3 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, -3 ], [ 4 ], [ -1 ], [ -2, -4 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 3, -2 ], [ 2, 4 ], [ -1, -3, -4 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1 ], [ 2, 3, 4 ], [ -1, -3, -4 ], [ -2 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1 ], [ 2, 4, -2 ], [ 3, -4 ], [ -1 ], [ -3 ] ] ) );;|
  !gapprompt@gap>| !gapinput@I:=SemigroupIdeal(S, S.1*S.2*S.5);|
  <regular bipartition semigroup ideal on 4 pts with 1 generator>
  !gapprompt@gap>| !gapinput@GeneratorsOfSemigroupIdeal(I);|
  [ <bipartition: [ 1, 2, 3, 4, -4 ], [ -1 ], [ -2 ], [ -3 ]> ]
  !gapprompt@gap>| !gapinput@I=Semigroup(GeneratorsOfSemigroupIdeal(I));|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalIdealGeneratingSet}}
\logpage{[ 3, 2, 2 ]}\nobreak
\hyperdef{L}{X8777E71A82C2BAF9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MinimalIdealGeneratingSet({\mdseries\slshape I})\index{MinimalIdealGeneratingSet@\texttt{MinimalIdealGeneratingSet}}
\label{MinimalIdealGeneratingSet}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A minimal set ideal generators of an ideal.



 This function returns a minimal set of elements of the parent of the semigroup
ideal \mbox{\texttt{\mdseries\slshape I}} required to generate \mbox{\texttt{\mdseries\slshape I}} as an ideal. 

 The notion of the generators of an ideal is distinct from the notion of the
generators of a semigroup or monoid. In particular, the semigroup generated by
the generators of an ideal is not, in general, equal to that ideal. Use \texttt{GeneratorsOfSemigroup} (\textbf{Reference: GeneratorsOfSemigroup}) to obtain a semigroup generating set for an ideal, but beware that this can be
very costly. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Monoid( |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, -2 ], [ 4 ], [ -1, -4 ], [ -3 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 4, -2, -4 ], [ 2, -1, -3 ], [ 3 ] ] ) );;|
  !gapprompt@gap>| !gapinput@I:=SemigroupIdeal(S, S);|
  <non-regular bipartition semigroup ideal on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@MinimalIdealGeneratingSet(I);|
  [ <block bijection: [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ]> ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SupersemigroupOfIdeal}}
\logpage{[ 3, 2, 3 ]}\nobreak
\hyperdef{L}{X7DB8699784FA4114}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SupersemigroupOfIdeal({\mdseries\slshape I})\index{SupersemigroupOfIdeal@\texttt{SupersemigroupOfIdeal}}
\label{SupersemigroupOfIdeal}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
An ideal of a semigroup.



 The \texttt{Parent} (\textbf{Reference: Parent}) of an ideal is the semigroup in which the ideal was created, i.e. the first
argument of \texttt{SemigroupIdeal} (\ref{SemigroupIdeal}) or \texttt{SemigroupByGenerators}. This function returns the semigroup containing \texttt{GeneratorsOfSemigroup} (\textbf{Reference: GeneratorsOfSemigroup}) which are used to compute the ideal. 

 For a regular semigroup ideal, \texttt{SupersemigroupOfIdeal} will always be the top most semigroup used to create any of the predecessors
of the current ideal. For example, if \texttt{S} is a semigroup, \texttt{I} is a regular ideal of \texttt{S}, and \texttt{J} is an ideal of \texttt{I}, then \texttt{Parent(J)} is \texttt{I} and \texttt{SupersemigroupOfIdeal(J)} is \texttt{S}. This is to avoid computing a generating set for \texttt{I}, in this example, which is expensive and unnecessary since \texttt{I} is regular (in which case the Green's relations of \texttt{I} are just restrictions of the Green's relations on \texttt{S}). If \texttt{S} is a semigroup, \texttt{I} is a non-regular ideal of \texttt{S}, \texttt{J} is an ideal of \texttt{I}, then \texttt{SupersemigroupOfIdeal(J)} is \texttt{I}, since we currently have to use \texttt{GeneratorsOfSemigroup(I)} to compute anything about \texttt{I} other than its size and membership. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=FullTransformationSemigroup(8);|
  <full transformation semigroup on 8 pts>
  !gapprompt@gap>| !gapinput@x:=Transformation( [ 2, 6, 7, 2, 6, 1, 1, 5 ] );;|
  !gapprompt@gap>| !gapinput@D:=DClassNC(S, x);|
  {Transformation( [ 2, 6, 7, 2, 6, 1, 1, 5 ] )}
  !gapprompt@gap>| !gapinput@R:=PrincipalFactor(D);|
  <Rees 0-matrix semigroup 1050x56 over Group([ (3,4), (2,8,7,4,3) ])>
  !gapprompt@gap>| !gapinput@S:=Semigroup(List([1..10], x-> Random(R)));|
  <subsemigroup of 1050x56 Rees 0-matrix semigroup with 10 generators>
  !gapprompt@gap>| !gapinput@I:=SemigroupIdeal(S, MultiplicativeZero(S));|
  <regular Rees 0-matrix semigroup ideal with 1 generator>
  !gapprompt@gap>| !gapinput@SupersemigroupOfIdeal(I);|
  <subsemigroup of 1050x56 Rees 0-matrix semigroup with 10 generators>
  !gapprompt@gap>| !gapinput@J:=SemigroupIdeal(I, Representative(MinimalDClass(S)));|
  <regular Rees 0-matrix semigroup ideal with 1 generator>
  !gapprompt@gap>| !gapinput@Parent(J)=I;|
  true
  !gapprompt@gap>| !gapinput@SupersemigroupOfIdeal(J)=I;|
  false
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{ Determining the structure of a semigroup }}\label{green}
\logpage{[ 4, 0, 0 ]}
\hyperdef{L}{X86BAA72482D1C658}{}
{
  In this chapter we describe the functions in \textsf{Semigroups} for determining the structure of a semigroup, in particular for computing
Green's classes and related properties of semigroups. 
\section{\textcolor{Chapter }{Expressing semigroup elements as words in generators}}\logpage{[ 4, 1, 0 ]}
\hyperdef{L}{X81CEB3717E021643}{}
{
  It is possible to express an element of a semigroup as a word in the
generators of that semigroup. This section describes how to accomplish this in \textsf{Semigroups}. 

 

\subsection{\textcolor{Chapter }{EvaluateWord}}
\logpage{[ 4, 1, 1 ]}\nobreak
\hyperdef{L}{X799D2F3C866B9AED}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{EvaluateWord({\mdseries\slshape gens, w})\index{EvaluateWord@\texttt{EvaluateWord}}
\label{EvaluateWord}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup element.



 The argument \mbox{\texttt{\mdseries\slshape gens}} should be a collection of generators of a semigroup and the argument \mbox{\texttt{\mdseries\slshape w}} should be a list of positive integers less than or equal to the length of \mbox{\texttt{\mdseries\slshape gens}}. This operation evaluates the word \mbox{\texttt{\mdseries\slshape w}} in the generators \mbox{\texttt{\mdseries\slshape gens}}. More precisely, \texttt{EvaluateWord} returns the equivalent of: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  Product(List(w, i-> gens[i]));
\end{Verbatim}
 see also \texttt{Factorization} (\ref{Factorization}).

 
\begin{description}
\item[{for elements of a semigroup}]  When \mbox{\texttt{\mdseries\slshape gens}} is a list of elements of a semigroup and \mbox{\texttt{\mdseries\slshape w}} is a list of positive integers less than or equal to the length of \mbox{\texttt{\mdseries\slshape gens}}, this operation returns the product \texttt{gens[w[1]]*gens[w[2]]*...*gens[w[n]]} when the length of \mbox{\texttt{\mdseries\slshape w}} is \texttt{n}. 
\item[{for elements of an inverse semigroup}]  When \mbox{\texttt{\mdseries\slshape gens}} is a list of elements with a semigroup inverse and \mbox{\texttt{\mdseries\slshape w}} is a list of non-zero integers whose absolute value does not exceed the length
of \mbox{\texttt{\mdseries\slshape gens}}, this operation returns the product \texttt{gens[AbsInt(w[1])]\texttt{\symbol{94}}SignInt(w[1])*...*gens[AbsInt(w[n])]\texttt{\symbol{94}}SignInt(w[n])} where \texttt{n} is the length of \mbox{\texttt{\mdseries\slshape w}}. 
\end{description}
 Note that \texttt{EvaluateWord(\mbox{\texttt{\mdseries\slshape gens}}, [])} returns \texttt{One(\mbox{\texttt{\mdseries\slshape gens}})} if \mbox{\texttt{\mdseries\slshape gens}} belongs to the category \texttt{IsMultiplicativeElementWithOne} (\textbf{Reference: IsMultiplicativeElementWithOne}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 4, 4, 6, 8, 8, 6, 6 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 2, 7, 4, 1, 4, 6, 5, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 6, 2, 4, 2, 2, 2, 8 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 4, 3, 6, 4, 2, 1, 2, 6 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 4, 5, 1, 3, 8, 5, 8, 2 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 1, 4, 6, 1, 7, 2, 7, 6 ] );;|
  !gapprompt@gap>| !gapinput@Factorization(S, f);|
  [ 4, 2 ]
  !gapprompt@gap>| !gapinput@EvaluateWord(gens, last);|
  Transformation( [ 1, 4, 6, 1, 7, 2, 7, 6 ] )
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseMonoid(10);;|
  !gapprompt@gap>| !gapinput@f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );|
  [3,7][8,1,2,6,9][10,5]
  !gapprompt@gap>| !gapinput@Factorization(S, f);|
  [ -2, -2, -2, -2, -3, -4, -3, -2, -2, -2, -2, -3, -2, 2, 2, 2, 2, 4, 
    4, 4, 4, 2, 2, 2, 2, 2, 3, 4, -3, -2, -3, -2, -3, -2, 2, 2, 2, 2, 
    2, 3, 4, -3, -2, -3, -2, -3, -2, 2, 2, 2, 2, 2, 3, 4, -3, -2, -3, 
    -2, -3, -2, 2, 2, 2, 2, 2, 3, 4, -3, -2, -3, -2, -3, -2, 2, 2, 2, 
    2, 2, 3, 4, -3, -2, -3, -2, -3, -2, 3, 2, 2, 2, 2, 2, 3, 4, -3, -2, 
    -3, -2, -3, -2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2 ]
  !gapprompt@gap>| !gapinput@EvaluateWord(GeneratorsOfSemigroup(S), last); |
  [3,7][8,1,2,6,9][10,5]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Factorization}}
\logpage{[ 4, 1, 2 ]}\nobreak
\hyperdef{L}{X8357294D7B164106}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Factorization({\mdseries\slshape S, f})\index{Factorization@\texttt{Factorization}}
\label{Factorization}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
A word in the generators.



 
\begin{description}
\item[{for semigroups}]  When \mbox{\texttt{\mdseries\slshape S}} is a semigroup and \mbox{\texttt{\mdseries\slshape f}} belongs to \mbox{\texttt{\mdseries\slshape S}}, \texttt{Factorization} return a word in the generators of \mbox{\texttt{\mdseries\slshape S}} that is equal to \mbox{\texttt{\mdseries\slshape f}}. In this case, a word is a list of positive integers where \texttt{i} corresponds to \texttt{GeneratorsOfSemigroups(S)[i]}. More specifically, 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  EvaluateWord(GeneratorsOfSemigroup(S), Factorization(S, f))=f;
\end{Verbatim}
 
\item[{for inverse semigroups}]  When \mbox{\texttt{\mdseries\slshape S}} is a inverse semigroup and \mbox{\texttt{\mdseries\slshape f}} belongs to \mbox{\texttt{\mdseries\slshape S}}, \texttt{Factorization} return a word in the generators of \mbox{\texttt{\mdseries\slshape S}} that is equal to \mbox{\texttt{\mdseries\slshape f}}. In this case, a word is a list of non-zero integers where \texttt{i} corresponds to \texttt{GeneratorsOfSemigroup(S)[i]} and \texttt{-i} corresponds to \texttt{GeneratorsOfSemigroup(S)[i]\texttt{\symbol{94}}-1}. As in the previous case, 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  EvaluateWord(GeneratorsOfSemigroup(S), Factorization(S, f))=f;
\end{Verbatim}
 
\end{description}
 Note that \texttt{Factorization} does not return a word of minimum length. 

 See also \texttt{EvaluateWord} (\ref{EvaluateWord}) and \texttt{GeneratorsOfSemigroup} (\textbf{Reference: GeneratorsOfSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 2, 9, 7, 4, 9, 5, 5, 4, 8 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 4, 10, 5, 6, 4, 1, 2, 7, 1, 2 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 1, 10, 2, 10, 1, 2, 7, 10, 2, 7 ] );;|
  !gapprompt@gap>| !gapinput@Factorization(S, f);|
  [ 2, 2, 1, 2 ]
  !gapprompt@gap>| !gapinput@EvaluateWord(gens, last);|
  Transformation( [ 1, 10, 2, 10, 1, 2, 7, 10, 2, 7 ] )
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseMonoid(8);|
  <symmetric inverse semigroup on 8 pts>
  !gapprompt@gap>| !gapinput@f:=PartialPerm( [ 1, 2, 3, 4, 5, 8 ], [ 7, 1, 4, 3, 2, 6 ] );|
  [5,2,1,7][8,6](3,4)
  !gapprompt@gap>| !gapinput@Factorization(S, f);|
  [ -2, -2, -2, -2, -2, -2, -2, 2, 2, 4, 4, 2, 3, 2, 3, -2, -2, -2, 2, 
    3, 2, 3, -2, -2, -2, 2, 3, 2, 3, -2, -2, -2, 3, 2, 3, 2, 3, -2, -2, 
    -2, 3, 2, 3, 2, 3, -2, -2, -2, 2, 3, 2, 3, -2, -2, -2, 2, 3, 2, 3, 
    -2, -2, -2, 2, 3, 2, 3, -2, -2, -2, 2, 3, 2, 3, -2, -2, -2, 3, 2, 
    3, 2, 3, -2, -2, -2, 2, 3, 2, 3, -2, -2, -2, 2, 3, 2, 3, -2, -2, 
    -2, 2, 3, 2, 3, -2, -2, -2, 2, 3, 2, 2, 3, 2, 2, 2, 2 ]
  !gapprompt@gap>| !gapinput@EvaluateWord(GeneratorsOfSemigroup(S), last);|
  [5,2,1,7][8,6](3,4)
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(6);;|
  !gapprompt@gap>| !gapinput@f:=S.1*S.2*S.3*S.2*S.1;|
  <block bijection: [ 1, 6, -4 ], [ 2, -2, -3 ], [ 3, -5 ], [ 4, -6 ], 
   [ 5, -1 ]>
  !gapprompt@gap>| !gapinput@Factorization(S, f);|
  [ -2, -2, -2, -2, -2, 4, 2 ]
  !gapprompt@gap>| !gapinput@EvaluateWord(GeneratorsOfSemigroup(S), last);|
  <block bijection: [ 1, 6, -4 ], [ 2, -2, -3 ], [ 3, -5 ], [ 4, -6 ], 
   [ 5, -1 ]>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Creating Green's classes}}\logpage{[ 4, 2, 0 ]}
\hyperdef{L}{X7D14B6A080BC189E}{}
{
  
\subsection{\textcolor{Chapter }{XClassOfYClass}}\logpage{[ 4, 2, 1 ]}
\hyperdef{L}{X87558FEF805D24E1}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DClassOfHClass({\mdseries\slshape class})\index{DClassOfHClass@\texttt{DClassOfHClass}}
\label{DClassOfHClass}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DClassOfLClass({\mdseries\slshape class})\index{DClassOfLClass@\texttt{DClassOfLClass}}
\label{DClassOfLClass}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DClassOfRClass({\mdseries\slshape class})\index{DClassOfRClass@\texttt{DClassOfRClass}}
\label{DClassOfRClass}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LClassOfHClass({\mdseries\slshape class})\index{LClassOfHClass@\texttt{LClassOfHClass}}
\label{LClassOfHClass}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RClassOfHClass({\mdseries\slshape class})\index{RClassOfHClass@\texttt{RClassOfHClass}}
\label{RClassOfHClass}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
A Green's class.



 \texttt{XClassOfYClass} returns the \texttt{X}-class containing the \texttt{Y}-class \mbox{\texttt{\mdseries\slshape class}} where \texttt{X} and \texttt{Y} should be replaced by an appropriate choice of \texttt{D, H, L,} and \texttt{R}.

 Note that if it is not known to \textsf{GAP} whether or not the representative of \mbox{\texttt{\mdseries\slshape class}} is an element of the semigroup containing \mbox{\texttt{\mdseries\slshape class}}, then no attempt is made to check this.

 The same result can be produced using: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  First(GreensXClasses(S), x-> Representative(x) in class);
\end{Verbatim}
 but this might be substantially slower. Note that \texttt{XClassOfYClass} is also likely to be faster than 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  GreensXClassOfElement(S, Representative(class));
\end{Verbatim}
 

 \texttt{DClass} can also be used as a synonym for \texttt{DClassOfHClass}, \texttt{DClassOfLClass}, and \texttt{DClassOfRClass}; \texttt{LClass} as a synonym for \texttt{LClassOfHClass}; and \texttt{RClass} as a synonym for \texttt{RClassOfHClass}. See also \texttt{GreensDClassOfElement} (\textbf{Reference: GreensDClassOfElement}) and \texttt{GreensDClassOfElementNC} (\ref{GreensDClassOfElementNC}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 1, 3, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 2, 1, 3 ] ), Transformation( [ 3, 2, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 3, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@R:=GreensRClassOfElement(S, Transformation( [ 3, 2, 1 ] ));|
  {Transformation( [ 3, 2, 1 ] )}
  !gapprompt@gap>| !gapinput@DClassOfRClass(R);|
  {Transformation( [ 3, 2, 1 ] )}
  !gapprompt@gap>| !gapinput@IsGreensDClass(DClassOfRClass(R));|
  true
  !gapprompt@gap>| !gapinput@S := InverseSemigroup(|
  !gapprompt@>| !gapinput@PartialPerm([ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ]), |
  !gapprompt@>| !gapinput@PartialPerm([ 1, 2, 3, 4, 6, 7, 8, 10 ],|
  !gapprompt@>| !gapinput@[ 3, 8, 1, 9, 4, 10, 5, 6 ]));|
  <inverse partial perm semigroup on 10 pts with 2 generators>
  !gapprompt@gap>| !gapinput@x := S.1;|
  [3,7][8,1,2,6,9][10,5]
  !gapprompt@gap>| !gapinput@H := HClass(S, x);|
  {PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] )}
  !gapprompt@gap>| !gapinput@R := RClassOfHClass(H);|
  {PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] )}
  !gapprompt@gap>| !gapinput@L := LClass(H);|
  {PartialPerm( [ 1, 2, 5, 6, 7, 9 ], [ 1, 2, 5, 6, 7, 9 ] )}
  !gapprompt@gap>| !gapinput@DClass(R)=DClass(L);|
  true
  !gapprompt@gap>| !gapinput@DClass(H)=DClass(L);|
  true
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{GreensXClassOfElement}}\logpage{[ 4, 2, 2 ]}
\hyperdef{L}{X81B7AD4C7C552867}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensDClassOfElement({\mdseries\slshape X, f})\index{GreensDClassOfElement@\texttt{GreensDClassOfElement}}
\label{GreensDClassOfElement}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DClass({\mdseries\slshape X, f})\index{DClass@\texttt{DClass}}
\label{DClass}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensHClassOfElement({\mdseries\slshape X, f})\index{GreensHClassOfElement@\texttt{GreensHClassOfElement}}
\label{GreensHClassOfElement}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensHClassOfElement({\mdseries\slshape R, i, j})\index{GreensHClassOfElement@\texttt{GreensHClassOfElement}!for a Rees matrix semigroup}
\label{GreensHClassOfElement:for a Rees matrix semigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{HClass({\mdseries\slshape X, f})\index{HClass@\texttt{HClass}}
\label{HClass}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{HClass({\mdseries\slshape R, i, j})\index{HClass@\texttt{HClass}!for a Rees matrix semigroup}
\label{HClass:for a Rees matrix semigroup}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensLClassOfElement({\mdseries\slshape X, f})\index{GreensLClassOfElement@\texttt{GreensLClassOfElement}}
\label{GreensLClassOfElement}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LClass({\mdseries\slshape X, f})\index{LClass@\texttt{LClass}}
\label{LClass}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensRClassOfElement({\mdseries\slshape X, f})\index{GreensRClassOfElement@\texttt{GreensRClassOfElement}}
\label{GreensRClassOfElement}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RClass({\mdseries\slshape X, f})\index{RClass@\texttt{RClass}}
\label{RClass}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A Green's class.



 These functions produce essentially the same output as the \textsf{GAP} library functions with the same names; see \texttt{GreensDClassOfElement} (\textbf{Reference: GreensDClassOfElement}). The main difference is that these functions can be applied to a wider class
of objects: 
\begin{description}
\item[{\texttt{GreensDClassOfElement} and \texttt{DClass}}]  \mbox{\texttt{\mdseries\slshape X}} must be a semigroup. 
\item[{\texttt{GreensHClassOfElement} and \texttt{HClass}}]  \mbox{\texttt{\mdseries\slshape X}} can be a semigroup, $\mathcal{R}$-class, $\mathcal{L}$-class, or $\mathcal{D}$-class.  If \mbox{\texttt{\mdseries\slshape R}} is a \mbox{\texttt{\mdseries\slshape IxJ}} Rees matrix semigroup or a Rees 0-matrix semigroup, and \mbox{\texttt{\mdseries\slshape i}} and \mbox{\texttt{\mdseries\slshape j}} are integers of the corresponding index sets, then \texttt{GreensHClassOfElement} returns the $\mathcal{H}$-class in row \mbox{\texttt{\mdseries\slshape i}} and column \mbox{\texttt{\mdseries\slshape j}}. 
\item[{\texttt{GreensLClassOfElement} and \texttt{LClass}}]  \mbox{\texttt{\mdseries\slshape X}} can be a semigroup or $\mathcal{D}$-class. 
\item[{\texttt{GreensRClassOfElement} and \texttt{RClass}}]  \mbox{\texttt{\mdseries\slshape X}} can be a semigroup or $\mathcal{D}$-class. 
\end{description}
 Note that \texttt{GreensXClassOfElement} and \texttt{XClass} are synonyms and have identical output. The shorter command is provided for
the sake of convenience.

 }

 
\subsection{\textcolor{Chapter }{GreensXClassOfElementNC}}\logpage{[ 4, 2, 3 ]}
\hyperdef{L}{X7B44317786571F8B}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensDClassOfElementNC({\mdseries\slshape X, f})\index{GreensDClassOfElementNC@\texttt{GreensDClassOfElementNC}}
\label{GreensDClassOfElementNC}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DClassNC({\mdseries\slshape X, f})\index{DClassNC@\texttt{DClassNC}}
\label{DClassNC}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensHClassOfElementNC({\mdseries\slshape X, f})\index{GreensHClassOfElementNC@\texttt{GreensHClassOfElementNC}}
\label{GreensHClassOfElementNC}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{HClassNC({\mdseries\slshape X, f})\index{HClassNC@\texttt{HClassNC}}
\label{HClassNC}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensLClassOfElementNC({\mdseries\slshape X, f})\index{GreensLClassOfElementNC@\texttt{GreensLClassOfElementNC}}
\label{GreensLClassOfElementNC}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LClassNC({\mdseries\slshape X, f})\index{LClassNC@\texttt{LClassNC}}
\label{LClassNC}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensRClassOfElementNC({\mdseries\slshape X, f})\index{GreensRClassOfElementNC@\texttt{GreensRClassOfElementNC}}
\label{GreensRClassOfElementNC}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RClassNC({\mdseries\slshape X, f})\index{RClassNC@\texttt{RClassNC}}
\label{RClassNC}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A Green's class.



 These functions are essentially the same as \texttt{GreensDClassOfElement} (\ref{GreensDClassOfElement}) except that no effort is made to verify if \mbox{\texttt{\mdseries\slshape f}} is an element of \mbox{\texttt{\mdseries\slshape X}}. More precisely, \texttt{GreensXClassOfElementNC} and \texttt{XClassNC} first check if \mbox{\texttt{\mdseries\slshape f}} has already been shown to be an element of \mbox{\texttt{\mdseries\slshape X}}. If it is not known to \textsf{GAP} if \mbox{\texttt{\mdseries\slshape f}} is an element of \mbox{\texttt{\mdseries\slshape X}}, then no further attempt to verify this is made. 

 Note that \texttt{GreensXClassOfElementNC} and \texttt{XClassNC} are synonyms and have identical output. The shorter command is provided for
the sake of convenience. 

 It can be quicker to compute the class of an element using \texttt{GreensRClassOfElementNC}, say, than using \texttt{GreensRClassOfElement} if it is known \emph{a priori} that \mbox{\texttt{\mdseries\slshape f}} is an element of \mbox{\texttt{\mdseries\slshape X}}. On the other hand, if \mbox{\texttt{\mdseries\slshape f}} is not an element of \mbox{\texttt{\mdseries\slshape X}}, then the results of this computation are unpredictable.

 For example, if 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  f:=Transformation( [ 15, 18, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ] );
\end{Verbatim}
 in the semigroup \mbox{\texttt{\mdseries\slshape X}} of order-preserving mappings on 20 points, then 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  GreensRClassOfElementNC(X, f);;
\end{Verbatim}
 returns an answer relatively quickly, whereas \texttt{GreensRClassOfElement} can take a signficant amount of time to return a value.

 See also \texttt{GreensRClassOfElement} (\textbf{Reference: GreensRClassOfElement}) and \texttt{RClassOfHClass} (\ref{RClassOfHClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=RandomTransformationSemigroup(2,1000);;|
  !gapprompt@gap>| !gapinput@f:=[ 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1 ];;|
  !gapprompt@gap>| !gapinput@f:=EvaluateWord(Generators(S), f);;                            |
  !gapprompt@gap>| !gapinput@R:=GreensRClassOfElementNC(S, f);;|
  !gapprompt@gap>| !gapinput@Size(R);|
  1
  !gapprompt@gap>| !gapinput@L:=GreensLClassOfElementNC(S, f);;|
  !gapprompt@gap>| !gapinput@Size(L);|
  1
  !gapprompt@gap>| !gapinput@f:=PartialPerm([ 1, 2, 3, 4, 7, 8, 9, 10 ],|
  !gapprompt@>| !gapinput@[ 2, 3, 4, 5, 6, 8, 10, 11 ]);;|
  !gapprompt@gap>| !gapinput@L:=LClass(POI(13), f);|
  {PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 8 ], [ 2, 3, 4, 5, 6, 8, 10, 11 ]
   )}
  !gapprompt@gap>| !gapinput@Size(L);|
  1287
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{GroupHClass}}
\logpage{[ 4, 2, 4 ]}\nobreak
\hyperdef{L}{X8723756387DD4C0F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GroupHClass({\mdseries\slshape class})\index{GroupHClass@\texttt{GroupHClass}}
\label{GroupHClass}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A group $\mathcal{H}$-class of the $\mathcal{D}$-class \mbox{\texttt{\mdseries\slshape class}} if it is regular and \texttt{fail} if it is not. 



 \texttt{GroupHClass} is a synonym for \texttt{GroupHClassOfGreensDClass} (\textbf{Reference: GroupHClassOfGreensDClass}). 

 See also \texttt{IsGroupHClass} (\textbf{Reference: IsGroupHClass}), \texttt{IsRegularDClass} (\textbf{Reference: IsRegularDClass}), \texttt{IsRegularClass} (\ref{IsRegularClass}), and \texttt{IsRegularSemigroup} (\ref{IsRegularSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 2, 6, 7, 2, 6, 1, 1, 5 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 8, 1, 4, 5, 6, 7, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@IsRegularSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@iter:=IteratorOfDClasses(S);;|
  !gapprompt@gap>| !gapinput@repeat D:=NextIterator(iter); until IsRegularDClass(D);   |
  !gapprompt@gap>| !gapinput@D;|
  {Transformation( [ 6, 1, 1, 6, 1, 2, 2, 6 ] )}
  !gapprompt@gap>| !gapinput@NrIdempotents(D);|
  12
  !gapprompt@gap>| !gapinput@NrRClasses(D);|
  8
  !gapprompt@gap>| !gapinput@NrLClasses(D);|
  4
  !gapprompt@gap>| !gapinput@GroupHClass(D);|
  {Transformation( [ 1, 2, 2, 1, 2, 6, 6, 1 ] )}
  !gapprompt@gap>| !gapinput@GroupHClassOfGreensDClass(D);|
  {Transformation( [ 1, 2, 2, 1, 2, 6, 6, 1 ] )}
  !gapprompt@gap>| !gapinput@StructureDescription(GroupHClass(D));|
  "S3"
  !gapprompt@gap>| !gapinput@repeat D:=NextIterator(iter); until not IsRegularDClass(D);|
  !gapprompt@gap>| !gapinput@D;|
  {Transformation( [ 7, 5, 2, 2, 6, 1, 1, 2 ] )}
  !gapprompt@gap>| !gapinput@IsRegularDClass(D);|
  false
  !gapprompt@gap>| !gapinput@GroupHClass(D);|
  fail
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( [ PartialPerm( [ 1, 2, 3, 5 ], [ 2, 1, 6, 3 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 6 ], [ 3, 5, 2, 6 ] ) ]);;|
  !gapprompt@gap>| !gapinput@f:=PartialPerm([ 1 .. 3 ], [ 6, 3, 1 ]);;|
  !gapprompt@gap>| !gapinput@First(DClasses(S), x-> not IsTrivial(GroupHClass(x)));|
  {PartialPerm( [ 1, 2 ], [ 1, 2 ] )}
  !gapprompt@gap>| !gapinput@StructureDescription(GroupHClass(last));|
  "C2"
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Iterators and enumerators of classes and representatives  }}\logpage{[ 4, 3, 0 ]}
\hyperdef{L}{X819CCBD67FD27115}{}
{
 
\subsection{\textcolor{Chapter }{GreensXClasses}}\label{GreensXClasses}
\logpage{[ 4, 3, 1 ]}
\hyperdef{L}{X7D51218A80234DE5}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensDClasses({\mdseries\slshape obj})\index{GreensDClasses@\texttt{GreensDClasses}}
\label{GreensDClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DClasses({\mdseries\slshape obj})\index{DClasses@\texttt{DClasses}}
\label{DClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensHClasses({\mdseries\slshape obj})\index{GreensHClasses@\texttt{GreensHClasses}}
\label{GreensHClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{HClasses({\mdseries\slshape obj})\index{HClasses@\texttt{HClasses}}
\label{HClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensJClasses({\mdseries\slshape obj})\index{GreensJClasses@\texttt{GreensJClasses}}
\label{GreensJClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{JClasses({\mdseries\slshape obj})\index{JClasses@\texttt{JClasses}}
\label{JClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensLClasses({\mdseries\slshape obj})\index{GreensLClasses@\texttt{GreensLClasses}}
\label{GreensLClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LClasses({\mdseries\slshape obj})\index{LClasses@\texttt{LClasses}}
\label{LClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensRClasses({\mdseries\slshape obj})\index{GreensRClasses@\texttt{GreensRClasses}}
\label{GreensRClasses}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RClasses({\mdseries\slshape obj})\index{RClasses@\texttt{RClasses}}
\label{RClasses}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
A list of Green's classes. 



 These functions produce essentially the same output as the \textsf{GAP} library functions with the same names; see \texttt{GreensDClasses} (\textbf{Reference: GreensDClasses}). The main difference is that these functions can be applied to a wider class
of objects: 
\begin{description}
\item[{\texttt{GreensDClasses} and \texttt{DClasses}}]  \mbox{\texttt{\mdseries\slshape X}} should be a semigroup. 
\item[{\texttt{GreensHClasses} and \texttt{HClasses}}]  \mbox{\texttt{\mdseries\slshape X}} can be a semigroup, $\mathcal{R}$-class, $\mathcal{L}$-class, or $\mathcal{D}$-class. 
\item[{\texttt{GreensLClasses} and \texttt{LClasses}}]  \mbox{\texttt{\mdseries\slshape X}} can be a semigroup or $\mathcal{D}$-class. 
\item[{\texttt{GreensRClasses} and \texttt{RClasses}}]  \mbox{\texttt{\mdseries\slshape X}} can be a semigroup or $\mathcal{D}$-class. 
\end{description}
 Note that \texttt{GreensXClasses} and \texttt{XClasses} are synonyms and have identical output. The shorter command is provided for
the sake of convenience.

 See also \texttt{DClassReps} (\ref{DClassReps}), \texttt{IteratorOfDClassReps} (\ref{IteratorOfDClassReps}), \texttt{IteratorOfDClasses} (\ref{IteratorOfDClasses}), and \texttt{NrDClasses} (\ref{NrDClasses}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 3, 4, 4, 4 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 4, 3, 1, 2 ] ));;|
  !gapprompt@gap>| !gapinput@GreensDClasses(S);|
  [ {Transformation( [ 3, 4, 4, 4 ] )}, 
    {Transformation( [ 4, 3, 1, 2 ] )}, 
    {Transformation( [ 4, 4, 4, 4 ] )} ]
  !gapprompt@gap>| !gapinput@GreensRClasses(S);|
  [ {Transformation( [ 3, 4, 4, 4 ] )}, 
    {Transformation( [ 4, 3, 1, 2 ] )}, 
    {Transformation( [ 4, 4, 4, 4 ] )}, 
    {Transformation( [ 4, 4, 3, 4 ] )}, 
    {Transformation( [ 4, 3, 4, 4 ] )}, 
    {Transformation( [ 4, 4, 4, 3 ] )} ]
  !gapprompt@gap>| !gapinput@D:=GreensDClasses(S)[1];|
  {Transformation( [ 3, 4, 4, 4 ] )}
  !gapprompt@gap>| !gapinput@GreensLClasses(D);|
  [ {Transformation( [ 3, 4, 4, 4 ] )}, 
    {Transformation( [ 1, 2, 2, 2 ] )} ]
  !gapprompt@gap>| !gapinput@GreensRClasses(D);|
  [ {Transformation( [ 3, 4, 4, 4 ] )}, 
    {Transformation( [ 4, 4, 3, 4 ] )}, 
    {Transformation( [ 4, 3, 4, 4 ] )}, 
    {Transformation( [ 4, 4, 4, 3 ] )} ]
  !gapprompt@gap>| !gapinput@R:=GreensRClasses(D)[1];|
  {Transformation( [ 3, 4, 4, 4 ] )}
  !gapprompt@gap>| !gapinput@GreensHClasses(R);|
  [ {Transformation( [ 3, 4, 4, 4 ] )}, 
    {Transformation( [ 1, 2, 2, 2 ] )} ]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( PartialPerm( [ 1, 2, 3 ], [ 2, 4, 1 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 4 ], [ 3, 4, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@GreensDClasses(S);|
  [ {PartialPerm( [ 1, 2, 4 ], [ 1, 2, 4 ] )}, 
    {PartialPerm( [ 1, 3, 4 ], [ 1, 3, 4 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 2, 4 ] )}, {PartialPerm( [ 4 ], [ 4 ] )}, 
    {PartialPerm( [  ], [  ] )} ]
  !gapprompt@gap>| !gapinput@GreensLClasses(S);|
  [ {PartialPerm( [ 1, 2, 4 ], [ 1, 2, 4 ] )}, 
    {PartialPerm( [ 1, 2, 4 ], [ 3, 1, 2 ] )}, 
    {PartialPerm( [ 1, 3, 4 ], [ 1, 3, 4 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 2, 4 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 3, 1 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 1, 2 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 3, 2 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 4, 3 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 1, 4 ] )}, {PartialPerm( [ 4 ], [ 4 ] )}, 
    {PartialPerm( [ 4 ], [ 1 ] )}, {PartialPerm( [ 4 ], [ 3 ] )}, 
    {PartialPerm( [ 4 ], [ 2 ] )}, {PartialPerm( [  ], [  ] )} ]
  !gapprompt@gap>| !gapinput@D:=GreensDClasses(S)[3];|
  {PartialPerm( [ 2, 4 ], [ 2, 4 ] )}
  !gapprompt@gap>| !gapinput@GreensLClasses(D);|
  [ {PartialPerm( [ 2, 4 ], [ 2, 4 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 3, 1 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 1, 2 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 3, 2 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 4, 3 ] )}, 
    {PartialPerm( [ 2, 4 ], [ 1, 4 ] )} ]
  !gapprompt@gap>| !gapinput@GreensRClasses(D);|
  [ {PartialPerm( [ 2, 4 ], [ 2, 4 ] )}, 
    {PartialPerm( [ 1, 3 ], [ 4, 2 ] )}, 
    {PartialPerm( [ 1, 2 ], [ 2, 4 ] )}, 
    {PartialPerm( [ 2, 3 ], [ 4, 2 ] )}, 
    {PartialPerm( [ 3, 4 ], [ 4, 2 ] )}, 
    {PartialPerm( [ 1, 4 ], [ 2, 4 ] )} ]
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{IteratorOfXClassReps}}\logpage{[ 4, 3, 2 ]}
\hyperdef{L}{X8566F84A7F6D4193}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfDClassReps({\mdseries\slshape S})\index{IteratorOfDClassReps@\texttt{IteratorOfDClassReps}}
\label{IteratorOfDClassReps}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfHClassReps({\mdseries\slshape S})\index{IteratorOfHClassReps@\texttt{IteratorOfHClassReps}}
\label{IteratorOfHClassReps}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfLClassReps({\mdseries\slshape S})\index{IteratorOfLClassReps@\texttt{IteratorOfLClassReps}}
\label{IteratorOfLClassReps}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfRClassReps({\mdseries\slshape S})\index{IteratorOfRClassReps@\texttt{IteratorOfRClassReps}}
\label{IteratorOfRClassReps}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 An iterator. 



 Returns an iterator of the representatives of the Green's classes contained in
the semigroup \mbox{\texttt{\mdseries\slshape S}}. See  (\textbf{Reference: Iterators}) for more information on iterators.

 See also \texttt{GreensRClasses} (\textbf{Reference: GreensRClasses}), \texttt{GreensRClasses} (\ref{GreensRClasses}), and \texttt{IteratorOfRClasses} (\ref{IteratorOfRClasses}).

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 3, 2, 1, 5, 4 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 4, 3, 2, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 4, 3, 2, 1 ] ), Transformation( [ 5, 5, 4, 5, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 4, 5, 4, 3, 3 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@iter:=IteratorOfRClassReps(S);|
  <iterator of R-class reps>
  !gapprompt@gap>| !gapinput@NextIterator(iter);|
  Transformation( [ 3, 2, 1, 5, 4 ] )
  !gapprompt@gap>| !gapinput@NextIterator(iter);|
  Transformation( [ 5, 5, 4, 5, 1 ] )
  !gapprompt@gap>| !gapinput@iter;|
  <iterator of R-class reps>
  !gapprompt@gap>| !gapinput@file:=Concatenation(SemigroupsDir(), "/tst/test.gz");;|
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(ReadGenerators(file, 1377));|
  <inverse partial perm semigroup on 983 pts with 2 generators>
  !gapprompt@gap>| !gapinput@NrMovedPoints(S);|
  983
  !gapprompt@gap>| !gapinput@iter:=IteratorOfLClassReps(S);|
  <iterator of L-class reps>
  !gapprompt@gap>| !gapinput@NextIterator(iter);|
  <partial perm on 634 pts with degree 1000, codegree 1000>
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{IteratorOfXClasses}}\logpage{[ 4, 3, 3 ]}
\hyperdef{L}{X867D7B8982915960}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfDClasses({\mdseries\slshape S})\index{IteratorOfDClasses@\texttt{IteratorOfDClasses}}
\label{IteratorOfDClasses}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfHClasses({\mdseries\slshape S})\index{IteratorOfHClasses@\texttt{IteratorOfHClasses}}
\label{IteratorOfHClasses}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfLClasses({\mdseries\slshape S})\index{IteratorOfLClasses@\texttt{IteratorOfLClasses}}
\label{IteratorOfLClasses}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IteratorOfRClasses({\mdseries\slshape S})\index{IteratorOfRClasses@\texttt{IteratorOfRClasses}}
\label{IteratorOfRClasses}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 An iterator. 



 Returns an iterator of the Green's classes in the semigroup \mbox{\texttt{\mdseries\slshape S}}. See  (\textbf{Reference: Iterators}) for more information on iterators.

 This function is useful if you are, for example, looking for an $\mathcal{R}$-class of a semigroup with a particular property but do not necessarily want
to compute all of the $\mathcal{R}$-classes.

 See also \texttt{GreensRClasses} (\ref{GreensRClasses}), \texttt{GreensRClasses} (\textbf{Reference: GreensRClasses}), \texttt{NrRClasses} (\ref{NrRClasses}), and \texttt{IteratorOfRClassReps} (\ref{IteratorOfRClassReps}).

 The transformation semigroup in the example below has 25147892 elements but it
only takes a fraction of a second to find a non-trivial $\mathcal{R}$-class. The inverse semigroup of partial permutations in the example below has
size 158122047816 but it only takes a fraction of a second to find an $\mathcal{R}$-class with more than 1000 elements. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 4, 1, 5, 4, 4, 7, 3, 8, 1 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 3, 2, 8, 8, 4, 4, 8, 6, 5, 7 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 4, 10, 6, 6, 1, 2, 4, 10, 9, 7 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 6, 2, 2, 4, 9, 9, 5, 10, 1, 8 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 6, 4, 1, 6, 6, 8, 9, 6, 2, 2 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 6, 8, 1, 10, 6, 4, 9, 1, 9, 4 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 8, 6, 2, 3, 3, 4, 8, 6, 2, 9 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 9, 1, 2, 8, 1, 5, 9, 9, 9, 5 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 9, 3, 1, 5, 10, 3, 4, 6, 10, 2 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 10, 7, 3, 7, 1, 9, 8, 8, 4, 10 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@iter:=IteratorOfRClasses(S);|
  <iterator of R-classes>
  !gapprompt@gap>| !gapinput@for R in iter do|
  !gapprompt@>| !gapinput@if Size(R)>1 then break; fi;|
  !gapprompt@>| !gapinput@od;|
  !gapprompt@gap>| !gapinput@R;|
  {Transformation( [ 6, 4, 1, 6, 6, 8, 9, 6, 2, 2 ] )}
  !gapprompt@gap>| !gapinput@Size(R);|
  21600
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@[ PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 10, 11, 19, 20 ], |
  !gapprompt@>| !gapinput@[ 19, 4, 11, 15, 3, 20, 1, 14, 8, 13, 17 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 6, 7, 8, 14, 15, 16, 17 ], |
  !gapprompt@>| !gapinput@[ 15, 14, 20, 19, 4, 5, 1, 13, 11, 10, 3 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 4, 6, 7, 8, 9, 10, 14, 15, 18 ], |
  !gapprompt@>| !gapinput@[ 7, 2, 17, 10, 1, 19, 9, 3, 11, 16, 18 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 16 ], |
  !gapprompt@>| !gapinput@[ 8, 3, 18, 1, 4, 13, 12, 7, 19, 20, 2, 11 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 9, 11, 15, 16, 17, 20 ], |
  !gapprompt@>| !gapinput@[ 7, 17, 13, 4, 6, 9, 18, 10, 11, 19, 5, 2, 8 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 18 ], |
  !gapprompt@>| !gapinput@[ 10, 20, 11, 7, 13, 8, 4, 9, 2, 18, 17, 6, 15 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 17, 18 ], |
  !gapprompt@>| !gapinput@[ 10, 20, 18, 1, 14, 16, 9, 5, 15, 4, 8, 12, 19, 11 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 15, 16, 19, 20 ], |
  !gapprompt@>| !gapinput@[ 13, 6, 1, 2, 11, 7, 16, 18, 9, 10, 4, 14, 15, 5, 17 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 20 ], |
  !gapprompt@>| !gapinput@[ 5, 3, 12, 9, 20, 15, 8, 16, 13, 1, 17, 11, 14, 10, 2 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 13, 17, 18, 19, 20 ], |
  !gapprompt@>| !gapinput@[ 8, 3, 9, 20, 2, 12, 14, 15, 4, 18, 13, 1, 17, 19, 5 ] ) ]);;|
  !gapprompt@gap>| !gapinput@iter:=IteratorOfRClasses(S);|
  <iterator of R-classes>
  !gapprompt@gap>| !gapinput@repeat r:=NextIterator(iter); until Size(r)>1000;|
  !gapprompt@gap>| !gapinput@r;|
  {PartialPerm( [ 8, 11, 13, 15, 17, 19 ], [ 3, 5, 1, 2, 6, 7 ] )}
  !gapprompt@gap>| !gapinput@Size(r);|
  10020240
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{XClassReps}}\logpage{[ 4, 3, 4 ]}
\hyperdef{L}{X865387A87FAAC395}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DClassReps({\mdseries\slshape obj})\index{DClassReps@\texttt{DClassReps}}
\label{DClassReps}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{HClassReps({\mdseries\slshape obj})\index{HClassReps@\texttt{HClassReps}}
\label{HClassReps}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LClassReps({\mdseries\slshape obj})\index{LClassReps@\texttt{LClassReps}}
\label{LClassReps}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RClassReps({\mdseries\slshape obj})\index{RClassReps@\texttt{RClassReps}}
\label{RClassReps}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A list of representatives.



 \texttt{XClassReps} returns a list of the representatives of the Green's classes of \mbox{\texttt{\mdseries\slshape obj}}, which can be a semigroup, $\mathcal{D}$-, $\mathcal{L}$-, or $\mathcal{R}$-class where appropriate.

 The same output can be obtained by calling, for example: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  List(GreensXClasses(obj), Representative);
\end{Verbatim}
 Note that if the Green's classes themselves are not required, then \texttt{XClassReps} will return an answer more quickly than the above, since the Green's class
objects are not created.

 See also \texttt{GreensDClasses} (\ref{GreensDClasses}), \texttt{IteratorOfDClassReps} (\ref{IteratorOfDClassReps}), \texttt{IteratorOfDClasses} (\ref{IteratorOfDClasses}), and \texttt{NrDClasses} (\ref{NrDClasses}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 3, 4, 4, 4 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 4, 3, 1, 2 ] ));;|
  !gapprompt@gap>| !gapinput@DClassReps(S);|
  [ Transformation( [ 3, 4, 4, 4 ] ), Transformation( [ 4, 3, 1, 2 ] ), 
    Transformation( [ 4, 4, 4, 4 ] ) ]
  !gapprompt@gap>| !gapinput@LClassReps(S);|
  [ Transformation( [ 3, 4, 4, 4 ] ), Transformation( [ 1, 2, 2, 2 ] ), 
    Transformation( [ 4, 3, 1, 2 ] ), Transformation( [ 4, 4, 4, 4 ] ), 
    Transformation( [ 2, 2, 2, 2 ] ), Transformation( [ 3, 3, 3, 3 ] ), 
    Transformation( [ 1, 1, 1, 1 ] ) ]
  !gapprompt@gap>| !gapinput@D:=GreensDClasses(S)[1];|
  {Transformation( [ 3, 4, 4, 4 ] )}
  !gapprompt@gap>| !gapinput@LClassReps(D);|
  [ Transformation( [ 3, 4, 4, 4 ] ), Transformation( [ 1, 2, 2, 2 ] ) ]
  !gapprompt@gap>| !gapinput@RClassReps(D);|
  [ Transformation( [ 3, 4, 4, 4 ] ), Transformation( [ 4, 4, 3, 4 ] ), 
    Transformation( [ 4, 3, 4, 4 ] ), Transformation( [ 4, 4, 4, 3 ] ) ]
  !gapprompt@gap>| !gapinput@R:=GreensRClasses(D)[1];;|
  !gapprompt@gap>| !gapinput@HClassReps(R);|
  [ Transformation( [ 3, 4, 4, 4 ] ), Transformation( [ 1, 2, 2, 2 ] ) ]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(6);;|
  !gapprompt@gap>| !gapinput@e:=InverseSemigroup(Idempotents(S));;|
  !gapprompt@gap>| !gapinput@M:=MunnSemigroup(e);;|
  !gapprompt@gap>| !gapinput@DClassReps(M);|
  [ <identity partial perm on [ 51 ]>, 
    <identity partial perm on [ 27, 51 ]>, 
    <identity partial perm on [ 15, 27, 50, 51 ]>, 
    <identity partial perm on [ 8, 15, 26, 27, 49, 50, 51, 64 ]>, 
    <identity partial perm on 
      [ 4, 8, 14, 15, 25, 26, 27, 48, 49, 50, 51, 60, 61, 62, 63, 64 ]>,
    <identity partial perm on 
      [ 2, 4, 7, 8, 13, 14, 15, 21, 25, 26, 27, 29, 34, 39, 44, 48, 49, \
  50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 ]>, 
    <identity partial perm on 
      [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1\
  9, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,\
   37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 5\
  4, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 ]> ]
  !gapprompt@gap>| !gapinput@L:=LClassNC(M, PartialPerm( [ 51, 63 ] , [ 51, 47 ] ));;|
  !gapprompt@gap>| !gapinput@HClassReps(L);|
  [ <identity partial perm on [ 47, 51 ]>, [27,47](51), [50,47](51), 
    [59,47](51), [63,47](51), [64,47](51) ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Attributes and properties directly related to Green's classes}}\logpage{[ 4, 4, 0 ]}
\hyperdef{L}{X798C0DF184E51D7F}{}
{
  
\subsection{\textcolor{Chapter }{Less than for Green's classes}}\logpage{[ 4, 4, 1 ]}
\hyperdef{L}{X85F30ACF86C3A733}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{\texttt{\symbol{92}}{\textless}({\mdseries\slshape left-expr, right-expr})\index{<@\texttt{\texttt{\symbol{92}}{\textless}}!for Green's classes}
\label{<:for Green's classes}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 The Green's class \mbox{\texttt{\mdseries\slshape left-expr}} is less than or equal to \mbox{\texttt{\mdseries\slshape right-expr}} if they belong to the same semigroup and the representative of \mbox{\texttt{\mdseries\slshape left-expr}} is less than the representative of \mbox{\texttt{\mdseries\slshape right-expr}} under \texttt{{\textless}}; see also \texttt{Representative} (\textbf{Reference: Representative}).

 Please note that this is not the usual order on the Green's classes of a
semigroup as defined in  (\textbf{Reference: Green's Relations}). See also \texttt{IsGreensLessThanOrEqual} (\textbf{Reference: IsGreensLessThanOrEqual}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=FullTransformationSemigroup(4);;|
  !gapprompt@gap>| !gapinput@A:=GreensRClassOfElement(S, Transformation( [ 2, 1, 3, 1 ] ));|
  {Transformation( [ 2, 1, 3, 1 ] )}
  !gapprompt@gap>| !gapinput@B:=GreensRClassOfElement(S, Transformation( [ 1, 2, 3, 4 ] ));|
  {IdentityTransformation}
  !gapprompt@gap>| !gapinput@A<B;|
  false
  !gapprompt@gap>| !gapinput@B<A;|
  true
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(A,B);|
  true
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(B,A);|
  false
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(4);;|
  !gapprompt@gap>| !gapinput@A:=GreensJClassOfElement(S, PartialPerm([ 1 .. 3 ], [ 1, 3, 4 ]) );|
  {PartialPerm( [ 1, 2, 3 ], [ 1, 2, 3 ] )}
  !gapprompt@gap>| !gapinput@B:=GreensJClassOfElement(S, PartialPerm([ 1, 2 ], [ 3, 1 ]) );|
  {PartialPerm( [ 1, 2 ], [ 1, 2 ] )}
  !gapprompt@gap>| !gapinput@A<B;|
  false
  !gapprompt@gap>| !gapinput@B<A;|
  true
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(A, B);|
  false
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(B, A);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{InjectionPrincipalFactor}}
\logpage{[ 4, 4, 2 ]}\nobreak
\hyperdef{L}{X7EBB4F1981CC2AE9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{InjectionPrincipalFactor({\mdseries\slshape D})\index{InjectionPrincipalFactor@\texttt{InjectionPrincipalFactor}}
\label{InjectionPrincipalFactor}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsomorphismReesMatrixSemigroup({\mdseries\slshape D})\index{IsomorphismReesMatrixSemigroup@\texttt{IsomorphismReesMatrixSemigroup}}
\label{IsomorphismReesMatrixSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A injective mapping.



 If the $\mathcal{D}$-class \mbox{\texttt{\mdseries\slshape D}} is a subsemigroup of a semigroup \texttt{S}, then the \emph{principal factor} of \mbox{\texttt{\mdseries\slshape D}} is just \mbox{\texttt{\mdseries\slshape D}} itself. If \mbox{\texttt{\mdseries\slshape D}} is not a subsemigroup of \texttt{S}, then the principal factor of \mbox{\texttt{\mdseries\slshape D}} is the semigroup with elements \mbox{\texttt{\mdseries\slshape D}} and a new element \texttt{0} with multiplication of $x,y\in D$ defined by:  
\[ xy=\left\{\begin{array}{ll} x*y\ (\textrm{in }S)&\textrm{if }x*y\in D\\
0&\textrm{if }xy\not\in D. \end{array}\right. \]
   \texttt{InjectionPrincipalFactor} returns an injective function from the $\mathcal{D}$-class \mbox{\texttt{\mdseries\slshape D}} to a Rees matrix semigroup, which contains the principal factor of \mbox{\texttt{\mdseries\slshape D}} as a subsemigroup. 

 If \mbox{\texttt{\mdseries\slshape D}} is a subsemigroup of its parent semigroup, then the function returned by \texttt{InjectionPrincipalFactor} or \texttt{IsomorphismReesMatrixSemigroup} is an isomorphism from \mbox{\texttt{\mdseries\slshape D}} to a Rees matrix semigroup; see \texttt{ReesMatrixSemigroup} (\textbf{Reference: ReesMatrixSemigroup}).

 If \mbox{\texttt{\mdseries\slshape D}} is not a semigroup, then the function returned by \texttt{InjectionPrincipalFactor} is an injective function from \mbox{\texttt{\mdseries\slshape D}} to a Rees 0-matrix semigroup isomorphic to the principal factor of \mbox{\texttt{\mdseries\slshape D}}; see \texttt{ReesZeroMatrixSemigroup} (\textbf{Reference: ReesZeroMatrixSemigroup}). In this case, \texttt{IsomorphismReesMatrixSemigroup} returns an error.

 See also \texttt{PrincipalFactor} (\ref{PrincipalFactor}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 6, 7, 8, 10 ], |
  !gapprompt@>| !gapinput@[ 3, 8, 1, 9, 4, 10, 5, 6 ] ) );;|
  !gapprompt@gap>| !gapinput@f:=PartialPerm([ 1, 2, 5, 6, 7, 9 ], [ 1, 2, 5, 6, 7, 9 ]);;|
  !gapprompt@gap>| !gapinput@d:=GreensDClassOfElement(S, f);|
  {PartialPerm( [ 1, 2, 5, 6, 7, 9 ], [ 1, 2, 5, 6, 7, 9 ] )}
  !gapprompt@gap>| !gapinput@InjectionPrincipalFactor(d);;|
  !gapprompt@gap>| !gapinput@rms:=Range(last);|
  <Rees 0-matrix semigroup 3x3 over Group(())>
  !gapprompt@gap>| !gapinput@MatrixOfReesZeroMatrixSemigroup(rms);|
  [ [ (), 0, 0 ], [ 0, (), 0 ], [ 0, 0, () ] ]
  !gapprompt@gap>| !gapinput@Size(rms);|
  10
  !gapprompt@gap>| !gapinput@Size(d);|
  9
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, -3, -5 ], [ 4 ], [ 5, -2 ], [ -1, -4 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 3, 5 ], [ 2, 4, -3 ], [ -1, -2, -4, -5 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 5, -2, -4 ], [ 2, 3, 4, -1, -5 ], [ -3 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 5, -1, -2, -3 ], [ 2, 4, -4 ], [ 3, -5 ] ] ) );;|
  !gapprompt@gap>| !gapinput@D:=DClasses(S)[3];|
  {Bipartition( [ [ 1, 5, -2, -4 ], [ 2, 3, 4, -1, -5 ], [ -3 ] ] )}
  !gapprompt@gap>| !gapinput@inj:=InjectionPrincipalFactor(D);|
  MappingByFunction( {Bipartition( [ [ 1, 5, -2, -4 ], 
   [ 2, 3, 4, -1, -5 ], [ -3 ] ] )}, <Rees matrix semigroup 1x1 over 
    Group([ (1,2) ])>, function( f ) ... end, function( x ) ... end )
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{PrincipalFactor}}
\logpage{[ 4, 4, 3 ]}\nobreak
\hyperdef{L}{X86C6D777847AAEC7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PrincipalFactor({\mdseries\slshape D})\index{PrincipalFactor@\texttt{PrincipalFactor}}
\label{PrincipalFactor}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A Rees matrix semigroup.



 \texttt{PrincipalFactor(\mbox{\texttt{\mdseries\slshape D}})} is just shorthand for \texttt{Range(InjectionPrincipalFactor(\mbox{\texttt{\mdseries\slshape D}}))}, where \mbox{\texttt{\mdseries\slshape D}} is a $\mathcal{D}$-class of semigroup; see \texttt{InjectionPrincipalFactor} (\ref{InjectionPrincipalFactor}) for more details. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup([ PartialPerm( [ 1, 2, 3 ], [ 1, 3, 4 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3 ], [ 2, 5, 3 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4 ], [ 2, 4, 1, 5 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 3, 5 ], [ 5, 1, 3 ] ) ] );;|
  !gapprompt@gap>| !gapinput@PrincipalFactor(MinimalDClass(S));|
  <Rees matrix semigroup 1x1 over Group(())>
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  <empty partial perm>
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, 4, 5, -1, -3 ], [ -2, -5 ], [ -4 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -5 ], [ 2, 3, 4, 5, -1, -3 ], [ -2, -4 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 5, -4 ], [ 2, 4, -1, -5 ], [ 3, -2, -3 ] ] ) );;|
  !gapprompt@gap>| !gapinput@d:=MinimalDClass(S);    |
  {Bipartition( [ [ 1, 2, 3, 4, 5, -1, -3 ], [ -2, -5 ], [ -4 ] ] )}
  !gapprompt@gap>| !gapinput@PrincipalFactor(d);|
  <Rees matrix semigroup 1x5 over Group(())>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsRegularClass}}
\logpage{[ 4, 4, 4 ]}\nobreak
\hyperdef{L}{X813A259E8463B3A9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRegularClass({\mdseries\slshape class})\index{IsRegularClass@\texttt{IsRegularClass}}
\label{IsRegularClass}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} or \texttt{false}. 



 This function returns \texttt{true} if \mbox{\texttt{\mdseries\slshape class}} is a regular Green's class and \texttt{false} if it is not. See also \texttt{IsRegularDClass} (\textbf{Reference: IsRegularDClass}), \texttt{IsGroupHClass} (\textbf{Reference: IsGroupHClass}), \texttt{GroupHClassOfGreensDClass} (\textbf{Reference: GroupHClassOfGreensDClass}), \texttt{GroupHClass} (\ref{GroupHClass}), \texttt{NrIdempotents} (\ref{NrIdempotents}), \texttt{Idempotents} (\ref{Idempotents}), and \texttt{IsRegularSemigroupElement} (\textbf{Reference: IsRegularSemigroupElement}). 

 The function \texttt{IsRegularDClass} produces the same output as the \textsf{GAP} library functions with the same name; see \texttt{IsRegularDClass} (\textbf{Reference: IsRegularDClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Monoid(Transformation( [ 10, 8, 7, 4, 1, 4, 10, 10, 7, 2 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 5, 2, 5, 5, 9, 10, 8, 3, 8, 10 ] ));;|
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 1, 1, 10, 8, 8, 8, 1, 1, 10, 8 ] );;|
  !gapprompt@gap>| !gapinput@R:=RClass(S, f);;|
  !gapprompt@gap>| !gapinput@IsRegularClass(R);|
  true
  !gapprompt@gap>| !gapinput@S:=Monoid(Transformation([2,3,4,5,1,8,7,6,2,7]), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 8, 7, 4, 1, 4, 3, 3, 7, 2 ] ));;|
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 3, 8, 7, 4, 1, 4, 3, 3, 7, 2 ] );;|
  !gapprompt@gap>| !gapinput@R:=RClass(S, f);;|
  !gapprompt@gap>| !gapinput@IsRegularClass(R);|
  false
  !gapprompt@gap>| !gapinput@NrIdempotents(R);|
  0
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 1, 3, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 1, 2, 1 ] ), Transformation( [ 4, 2, 3, 3 ] ));;|
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 4, 2, 3, 3 ] );;|
  !gapprompt@gap>| !gapinput@L:=GreensLClassOfElement(S, f);;|
  !gapprompt@gap>| !gapinput@IsRegularClass(L);|
  false
  !gapprompt@gap>| !gapinput@R:=GreensRClassOfElement(S, f);;|
  !gapprompt@gap>| !gapinput@IsRegularClass(R);|
  false
  !gapprompt@gap>| !gapinput@g:=Transformation( [ 4, 4, 4, 4 ] );;|
  !gapprompt@gap>| !gapinput@IsRegularSemigroupElement(S, g);|
  true
  !gapprompt@gap>| !gapinput@IsRegularClass(LClass(S, g));|
  true
  !gapprompt@gap>| !gapinput@IsRegularClass(RClass(S, g));|
  true
  !gapprompt@gap>| !gapinput@IsRegularDClass(DClass(S, g));|
  true
  !gapprompt@gap>| !gapinput@DClass(S, g)=RClass(S, g);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NrRegularDClasses}}
\logpage{[ 4, 4, 5 ]}\nobreak
\hyperdef{L}{X7AA3F0A77D0043FB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrRegularDClasses({\mdseries\slshape S})\index{NrRegularDClasses@\texttt{NrRegularDClasses}}
\label{NrRegularDClasses}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RegularDClasses({\mdseries\slshape S})\index{RegularDClasses@\texttt{RegularDClasses}}
\label{RegularDClasses}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A positive integer, or a list. 



 \texttt{NrRegularDClasses} returns the number of regular $\mathcal{D}$-classes of the semigroup \mbox{\texttt{\mdseries\slshape S}}.

 \texttt{RegularDClasses} returns a list of the regular $\mathcal{D}$-classes of the semigroup \mbox{\texttt{\mdseries\slshape S}}. 

 See also \texttt{IsRegularClass} (\ref{IsRegularClass}) and \texttt{IsRegularDClass} (\textbf{Reference: IsRegularDClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( [ Transformation( [ 1, 3, 4, 1, 3, 5 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 1, 6, 1, 6, 3 ] ) ]);;|
  !gapprompt@gap>| !gapinput@NrRegularDClasses(S); |
  3
  !gapprompt@gap>| !gapinput@NrDClasses(S); |
  7
  !gapprompt@gap>| !gapinput@RegularDClasses(S);|
  [ {Transformation( [ 1, 4, 1, 1, 4, 3 ] )}, 
    {Transformation( [ 1, 1, 1, 1, 1, 4 ] )}, 
    {Transformation( [ 1, 1, 1, 1, 1, 1 ] )} ]
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{NrXClasses}}\logpage{[ 4, 4, 6 ]}
\hyperdef{L}{X7E45FD9F7BADDFBD}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrDClasses({\mdseries\slshape obj})\index{NrDClasses@\texttt{NrDClasses}}
\label{NrDClasses}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrHClasses({\mdseries\slshape obj})\index{NrHClasses@\texttt{NrHClasses}}
\label{NrHClasses}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrLClasses({\mdseries\slshape obj})\index{NrLClasses@\texttt{NrLClasses}}
\label{NrLClasses}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrRClasses({\mdseries\slshape obj})\index{NrRClasses@\texttt{NrRClasses}}
\label{NrRClasses}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A positive integer. 



 \texttt{NrXClasses} returns the number of Green's classes in \mbox{\texttt{\mdseries\slshape obj}} where \mbox{\texttt{\mdseries\slshape obj}} can be a semigroup, $\mathcal{D}$-, $\mathcal{L}$-, or $\mathcal{R}$-class where appropriate. If the actual Green's classes are not required, then
it is more efficient to use 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  NrHClasses(obj)
\end{Verbatim}
 than 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  Length(HClasses(obj))
\end{Verbatim}
 since the Green's classes themselves are not created when \texttt{NrXClasses} is called. 

 See also \texttt{GreensRClasses} (\ref{GreensRClasses}), \texttt{GreensRClasses} (\textbf{Reference: GreensRClasses}), \texttt{IteratorOfRClasses} (\ref{IteratorOfRClasses}), and \texttt{IteratorOfRClassReps} (\ref{IteratorOfRClassReps}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 1, 2, 5, 4, 3, 8, 7, 6 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 1, 6, 3, 4, 7, 2, 5, 8 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 2, 1, 6, 7, 8, 3, 4, 5 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 3, 2, 3, 6, 1, 6, 1, 2 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 5, 2, 3, 6, 3, 4, 7, 4 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 2, 5, 4, 7, 4, 3, 6, 3 ] );;|
  !gapprompt@gap>| !gapinput@R:=RClass(S, f);|
  {Transformation( [ 2, 5, 4, 7, 4, 3, 6, 3 ] )}
  !gapprompt@gap>| !gapinput@NrHClasses(R);|
  12
  !gapprompt@gap>| !gapinput@D:=DClass(R);|
  {Transformation( [ 2, 5, 4, 7, 4, 3, 6, 3 ] )}
  !gapprompt@gap>| !gapinput@NrHClasses(D);|
  72
  !gapprompt@gap>| !gapinput@L:=LClass(S, f);|
  {Transformation( [ 2, 5, 4, 7, 4, 3, 6, 3 ] )}
  !gapprompt@gap>| !gapinput@NrHClasses(L);|
  6
  !gapprompt@gap>| !gapinput@NrHClasses(S);|
  1555
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 4, 6, 5, 2, 1, 3 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 6, 3, 2, 5, 4, 1 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 1, 2, 4, 3, 5, 6 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 3, 5, 6, 1, 2, 3 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 5, 3, 6, 6, 6, 2 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 2, 3, 2, 6, 4, 6 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 2, 1, 2, 2, 2, 4 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 4, 4, 1, 2, 1, 2 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@NrRClasses(S);|
  150
  !gapprompt@gap>| !gapinput@Size(S);|
  6342
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 1, 3, 3, 1, 3, 5 ] );;|
  !gapprompt@gap>| !gapinput@D:=DClass(S, f);|
  {Transformation( [ 2, 4, 2, 2, 2, 1 ] )}
  !gapprompt@gap>| !gapinput@NrRClasses(D);|
  87
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(10);;|
  !gapprompt@gap>| !gapinput@NrDClasses(S); NrRClasses(S); NrHClasses(S); NrLClasses(S);|
  11
  1024
  184756
  1024
  !gapprompt@gap>| !gapinput@S:=POPI(10);;|
  !gapprompt@gap>| !gapinput@NrDClasses(S);|
  11
  !gapprompt@gap>| !gapinput@NrRClasses(S);|
  1024
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{PartialOrderOfDClasses}}
\logpage{[ 4, 4, 7 ]}\nobreak
\hyperdef{L}{X83F1C306846DF26B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PartialOrderOfDClasses({\mdseries\slshape S})\index{PartialOrderOfDClasses@\texttt{PartialOrderOfDClasses}}
\label{PartialOrderOfDClasses}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The partial order of the $\mathcal{D}$-classes of \mbox{\texttt{\mdseries\slshape S}}. 



 Returns a list \texttt{list} where \texttt{list[i]} contains every \texttt{j} such that \texttt{GreensDClasses(S)[j]} is immediately less than \texttt{GreensDClasses(S)[i]} in the partial order of $\mathcal{D}$- classes of \mbox{\texttt{\mdseries\slshape S}}. There might be other indices in \texttt{list}, and it may or may not include \texttt{i}. The reflexive transitive closure of the relation defined by \texttt{list} is the partial order of $\mathcal{D}$-classes of \mbox{\texttt{\mdseries\slshape S}}. 

 The partial order on the $\mathcal{D}$-classes is defined by $x\leq y$ if and only if $S^1xS^1$ is a subset of $S^1yS^1$. 

 See also \texttt{GreensDClasses} (\ref{GreensDClasses}), \texttt{GreensDClasses} (\textbf{Reference: GreensDClasses}), \texttt{IsGreensLessThanOrEqual} (\textbf{Reference: IsGreensLessThanOrEqual}), and \texttt{\texttt{\symbol{92}}{\textless}} (\ref{<:for Green's classes}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 2, 4, 1, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 4, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@PartialOrderOfDClasses(S);|
  [ [ 3 ], [ 2, 3 ], [ 3, 4 ], [ 4 ] ]
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(GreensDClasses(S)[1], GreensDClasses(S)[2]);|
  false
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(GreensDClasses(S)[2], GreensDClasses(S)[1]);|
  false
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(GreensDClasses(S)[3], GreensDClasses(S)[1]);|
  true
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( PartialPerm( [ 1, 2, 3 ], [ 1, 3, 4 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 5 ], [ 5, 1, 3 ] ) );;|
  !gapprompt@gap>| !gapinput@Size(S);|
  58
  !gapprompt@gap>| !gapinput@PartialOrderOfDClasses(S);              |
  [ [ 1, 3 ], [ 2, 3 ], [ 3, 4 ], [ 4, 5 ], [ 5 ] ]
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(GreensDClasses(S)[1], GreensDClasses(S)[2]);|
  false
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(GreensDClasses(S)[5], GreensDClasses(S)[2]);|
  true
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(GreensDClasses(S)[3], GreensDClasses(S)[4]);|
  false
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(GreensDClasses(S)[4], GreensDClasses(S)[3]);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SchutzenbergerGroup}}
\logpage{[ 4, 4, 8 ]}\nobreak
\hyperdef{L}{X84F1321E8217D2A8}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SchutzenbergerGroup({\mdseries\slshape class})\index{SchutzenbergerGroup@\texttt{SchutzenbergerGroup}}
\label{SchutzenbergerGroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A permutation group. 



 \texttt{SchutzenbergerGroup} returns the generalized Schutzenberger group (defined below) of the $\mathcal{R}$-, $\mathcal{D}$-, $\mathcal{L}$-, or $\mathcal{H}$-class \mbox{\texttt{\mdseries\slshape class}}. 

 If \texttt{f} is an element of a semigroup of transformations or partial permutations and \texttt{im(f)} denotes the image of \texttt{f}, then the \emph{generalized Schutzenberger group} of \texttt{im(f)} is the permutation group  
\[ \{\:g|_{\textrm{im}(f)}\::\:\textrm{im}(f*g)=\textrm{im}(f)\:\}. \]
  

 The generalized Schutzenberger group of the kernel \texttt{ker(f)} of a transformation \texttt{f} or the domain \texttt{dom(f)} of a partial permutation \texttt{f} is defined analogously. 

 The generalized Schutzenberger group of a Green's class is then defined as
follows. 
\begin{description}
\item[{$\mathcal{R}$-class}] The generalized Schutzenberger group of the image or range of the
representative of the $\mathcal{R}$-class. 
\item[{$\mathcal{L}$-class}] The generalized Schutzenberger group of the kernel or domain of the
representative of the $\mathcal{L}$-class. 
\item[{$\mathcal{H}$-class}] The intersection of the generalized Schutzenberger groups of the $\mathcal{R}$- and $\mathcal{L}$-class containing the $\mathcal{H}$-class. 
\item[{$\mathcal{D}$-class}] The intersection of the generalized Schutzenberger groups of the $\mathcal{R}$- and $\mathcal{L}$-class containing the representative of the $\mathcal{D}$-class. 
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 4, 4, 3, 5, 3 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 1, 1, 4, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 5, 4, 4, 5 ] ) );;|
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 5, 5, 4, 4, 5 ] );;|
  !gapprompt@gap>| !gapinput@SchutzenbergerGroup(RClass(S, f));|
  Group([ (4,5) ])
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@[ PartialPerm([ 1, 2, 3, 7 ], [ 9, 2, 4, 8 ]),|
  !gapprompt@>| !gapinput@PartialPerm([ 1, 2, 6, 7, 8, 9, 10 ], [ 6, 8, 4, 5, 9, 1, 3 ]),|
  !gapprompt@>| !gapinput@PartialPerm([ 1, 2, 3, 5, 6, 7, 8, 9 ], [ 7, 4, 1, 6, 9, 5, 2, 3 ]) ] );;|
  !gapprompt@gap>| !gapinput@List(DClasses(S), SchutzenbergerGroup);|
  [ Group(()), Group(()), Group(()), Group(()), Group([ (1,9,8), (8,
     9) ]), Group([ (4,9) ]), Group(()), Group(()), Group(()), 
    Group(()), Group(()), Group(()), Group(()), Group(()), Group(()), 
    Group(()), Group([ (2,5)(3,7) ]), Group([ (1,7,5,6,9,3) ]), 
    Group(()), Group(()), Group(()), Group(()), Group(()) ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalDClass}}
\logpage{[ 4, 4, 9 ]}\nobreak
\hyperdef{L}{X81E5A04F7DA3A1E1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MinimalDClass({\mdseries\slshape S})\index{MinimalDClass@\texttt{MinimalDClass}}
\label{MinimalDClass}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The minimal $\mathcal{D}$-class of a semigroup.



 The minimal ideal of a semigroup is the least ideal with respect to
containment. \texttt{MinimalDClass} returns the $\mathcal{D}$-class corresponding to the minimal ideal of the semigroup \mbox{\texttt{\mdseries\slshape S}}. Equivalently, \texttt{MinimalDClass} returns the minimal $\mathcal{D}$-class with respect to the partial order of $\mathcal{D}$-classes.

 It is significantly easier to find the minimal $\mathcal{D}$-class of a semigroup, than to find its $\mathcal{D}$-classes. 

 See also \texttt{PartialOrderOfDClasses} (\ref{PartialOrderOfDClasses}), \texttt{IsGreensLessThanOrEqual} (\textbf{Reference: IsGreensLessThanOrEqual}), \texttt{MinimalIdeal} (\ref{MinimalIdeal}) and \texttt{RepresentativeOfMinimalIdeal} (\ref{RepresentativeOfMinimalIdeal}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@D:=MinimalDClass(JonesMonoid(8));|
  {Bipartition( [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 7, 8 ], [ -1, -2 ], 
   [ -3, -4 ], [ -5, -6 ], [ -7, -8 ] ] )}
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5, 7, 8, 9 ], [ 2, 6, 9, 1, 5, 3, 8 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 4, 5, 7, 8, 9 ], [ 9, 4, 10, 5, 6, 7, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@MinimalDClass(S);|
  {PartialPerm( [  ], [  ] )}
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MaximalDClasses}}
\logpage{[ 4, 4, 10 ]}\nobreak
\hyperdef{L}{X81F030B27ACB141D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MaximalDClasses({\mdseries\slshape S})\index{MaximalDClasses@\texttt{MaximalDClasses}}
\label{MaximalDClasses}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The maximal $\mathcal{D}$-classes of a semigroup.



 \texttt{MaximalDClasses} returns the maximal $\mathcal{D}$-classes with respect to the partial order of $\mathcal{D}$-classes. 

 See also \texttt{PartialOrderOfDClasses} (\ref{PartialOrderOfDClasses}), \texttt{IsGreensLessThanOrEqual} (\textbf{Reference: IsGreensLessThanOrEqual}), and \texttt{MinimalDClass} (\ref{MinimalDClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@MaximalDClasses(BrauerMonoid(8));|
  [ {Bipartition( [ [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ], 
       [ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ] ] )} ]
  !gapprompt@gap>| !gapinput@MaximalDClasses(FullTransformationMonoid(5));|
  [ {IdentityTransformation} ]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 5, 6, 7 ], [ 3, 8, 1, 4, 5, 6, 7 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 6, 8 ], [ 2, 6, 7, 1, 5 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 6, 8 ], [ 4, 3, 2, 7, 6, 5 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 4, 5, 6, 7, 8 ], [ 7, 1, 4, 2, 5, 6, 3 ] ) );;|
  !gapprompt@gap>| !gapinput@MaximalDClasses(S);|
  [ {PartialPerm( [ 1, 2, 3, 4, 5, 6, 7 ], [ 3, 8, 1, 4, 5, 6, 7 ] )}, 
    {PartialPerm( [ 1, 2, 4, 5, 6, 7, 8 ], [ 7, 1, 4, 2, 5, 6, 3 ] )} ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{StructureDescriptionSchutzenbergerGroups}}
\logpage{[ 4, 4, 11 ]}\nobreak
\hyperdef{L}{X81202126806443F9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{StructureDescriptionSchutzenbergerGroups({\mdseries\slshape S})\index{StructureDescriptionSchutzenbergerGroups@\texttt{Structure}\-\texttt{Description}\-\texttt{Schutzenberger}\-\texttt{Groups}}
\label{StructureDescriptionSchutzenbergerGroups}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
Distinct structure descriptions of the Schutzenberger groups of a semigroup.



 \texttt{StructureDescriptionSchutzenbergerGroups} returns the distinct values of \texttt{StructureDescription} (\textbf{Reference: StructureDescription}) when it is applied to the Schutzenberger groups of the $\mathcal{R}$-classes of the semigroup \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( PartialPerm( [ 1, 2, 3 ], [ 2, 5, 4 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3 ], [ 4, 1, 2 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3 ], [ 5, 2, 3 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 4, 5 ], [ 2, 1, 4, 3 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 5 ], [ 2, 3, 5 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 5 ], [ 2, 3, 5, 4 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 5 ], [ 4, 2, 5, 1 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 5 ], [ 5, 2, 4, 3 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 5 ], [ 5, 4, 3 ] ) );;|
  !gapprompt@gap>| !gapinput@StructureDescriptionSchutzenbergerGroups(S);            |
  [ "1", "C2", "S3" ]
  !gapprompt@gap>| !gapinput@S:=Monoid( |
  !gapprompt@>| !gapinput@Bipartition([[ 1, 2, 5, -1, -2 ], [ 3, 4, -3, -5 ], [ -4 ]]), |
  !gapprompt@>| !gapinput@Bipartition([[ 1, 2, -2 ], [ 3, -1 ], [ 4 ], [ 5 ], [ -3, -4 ], [ -5 ]]),|
  !gapprompt@>| !gapinput@Bipartition([[ 1 ], [ 2, 3, -5 ], [ 4, -3 ], [ 5, -2 ], [ -1, -4 ]]));|
  <bipartition monoid on 5 pts with 3 generators>
  !gapprompt@gap>| !gapinput@StructureDescriptionSchutzenbergerGroups(S);|
  [ "1", "C2" ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{StructureDescriptionMaximalSubgroups}}
\logpage{[ 4, 4, 12 ]}\nobreak
\hyperdef{L}{X838F43FE79A8C678}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{StructureDescriptionMaximalSubgroups({\mdseries\slshape S})\index{StructureDescriptionMaximalSubgroups@\texttt{Structure}\-\texttt{Description}\-\texttt{Maximal}\-\texttt{Subgroups}}
\label{StructureDescriptionMaximalSubgroups}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
Distinct structure descriptions of the maximal subgroups of a semigroup.



 \texttt{StructureDescriptionMaximalSubgroups} returns the distinct values of \texttt{StructureDescription} (\textbf{Reference: StructureDescription}) when it is applied to the maximal subgroups of the semigroup \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseSemigroup(6);|
  <inverse bipartition monoid on 6 pts with 3 generators>
  !gapprompt@gap>| !gapinput@StructureDescriptionMaximalSubgroups(S);|
  [ "1", "C2", "S3", "S4", "S5", "S6" ]
  !gapprompt@gap>| !gapinput@S:=Semigroup( PartialPerm( [ 1, 3, 4, 5, 8 ], [ 8, 3, 9, 4, 5 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 8 ], [ 10, 4, 1, 9, 6 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 10 ], [ 4, 1, 6, 7, 5, 3, 2, 10 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 6, 8, 10 ], [ 4, 9, 10, 3, 1, 5, 2 ] ) );;|
  !gapprompt@gap>| !gapinput@StructureDescriptionMaximalSubgroups(S);|
  [ "1", "C2", "C3", "C4" ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MultiplicativeNeutralElement (for an H-class)}}
\logpage{[ 4, 4, 13 ]}\nobreak
\hyperdef{L}{X8459E4067C5773AD}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MultiplicativeNeutralElement({\mdseries\slshape H})\index{MultiplicativeNeutralElement@\texttt{MultiplicativeNeutralElement}!for an H-class}
\label{MultiplicativeNeutralElement:for an H-class}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
A semigroup element or \texttt{fail}.



 If the $\mathcal{H}$-class \mbox{\texttt{\mdseries\slshape H}} of a semigroup \texttt{S} is a subgroup of \texttt{S}, then \texttt{MultiplicativeNeutralElement} returns the identity of \mbox{\texttt{\mdseries\slshape H}}. If \mbox{\texttt{\mdseries\slshape H}} is not a subgroup of \texttt{S}, then \texttt{fail} is returned. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3 ], [ 1, 5, 2 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 3 ], [ 2, 4 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3 ], [ 4, 1, 5 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 3, 5 ], [ 1, 3, 4 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 4, 5 ], [ 1, 2, 3, 5 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 5 ], [ 1, 3, 2, 5 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 4, 5 ], [ 5, 4, 3 ] ) );;|
  !gapprompt@gap>| !gapinput@H:=HClass(S, PartialPerm( [ 1, 2 ], [ 1, 2 ] ));;|
  !gapprompt@gap>| !gapinput@MultiplicativeNeutralElement(H);|
  <identity partial perm on [ 1, 2 ]>
  !gapprompt@gap>| !gapinput@H:=HClass(S, PartialPerm( [ 1, 2 ], [ 1, 4 ] ));;|
  !gapprompt@gap>| !gapinput@MultiplicativeNeutralElement(H);|
  fail
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsGreensClassNC}}
\logpage{[ 4, 4, 14 ]}\nobreak
\hyperdef{L}{X7E9BD34B8021045A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsGreensClassNC({\mdseries\slshape class})\index{IsGreensClassNC@\texttt{IsGreensClassNC}}
\label{IsGreensClassNC}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A Green's class \mbox{\texttt{\mdseries\slshape class}} of a semigroup \texttt{S} satisfies \texttt{IsGreensClassNC} if it was not known to \textsf{GAP} that the representative of \mbox{\texttt{\mdseries\slshape class}} was an element of \texttt{S} at the point that \mbox{\texttt{\mdseries\slshape class}} was created. }

 

\subsection{\textcolor{Chapter }{IsTransformationSemigroupGreensClass}}
\logpage{[ 4, 4, 15 ]}\nobreak
\hyperdef{L}{X82EF429D862932BD}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsTransformationSemigroupGreensClass({\mdseries\slshape class})\index{IsTransformationSemigroupGreensClass@\texttt{IsTransformation}\-\texttt{Semigroup}\-\texttt{Greens}\-\texttt{Class}}
\label{IsTransformationSemigroupGreensClass}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A Green's class \mbox{\texttt{\mdseries\slshape class}} of a semigroup \texttt{S} satisfies the property \texttt{IsTransformationSemigroupGreensClass} if and only if \texttt{S} is a semigroup of transformations. }

 

\subsection{\textcolor{Chapter }{IsBipartitionSemigroupGreensClass}}
\logpage{[ 4, 4, 16 ]}\nobreak
\hyperdef{L}{X7CB7E35E796A40EB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBipartitionSemigroupGreensClass({\mdseries\slshape class})\index{IsBipartitionSemigroupGreensClass@\texttt{IsBipartitionSemigroupGreensClass}}
\label{IsBipartitionSemigroupGreensClass}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A Green's class \mbox{\texttt{\mdseries\slshape class}} of a semigroup \texttt{S} satisfies the property \texttt{IsBipartitionSemigroupGreensClass} if and only if \texttt{S} is a semigroup of bipartitions. }

 

\subsection{\textcolor{Chapter }{IsPartialPermSemigroupGreensClass}}
\logpage{[ 4, 4, 17 ]}\nobreak
\hyperdef{L}{X785C499F852F0915}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsPartialPermSemigroupGreensClass({\mdseries\slshape class})\index{IsPartialPermSemigroupGreensClass@\texttt{IsPartialPermSemigroupGreensClass}}
\label{IsPartialPermSemigroupGreensClass}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A Green's class \mbox{\texttt{\mdseries\slshape class}} of a semigroup \texttt{S} satisfies the property \texttt{IsPartialPermSemigroupGreensClass} if and only if \texttt{S} is a semigroup of partial perms. }

 

\subsection{\textcolor{Chapter }{StructureDescription (for an H-class)}}
\logpage{[ 4, 4, 18 ]}\nobreak
\hyperdef{L}{X85B34FFB82C83127}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{StructureDescription({\mdseries\slshape class})\index{StructureDescription@\texttt{StructureDescription}!for an H-class}
\label{StructureDescription:for an H-class}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A string or \texttt{fail}.



 \texttt{StructureDescription} returns the value of \texttt{StructureDescription} (\textbf{Reference: StructureDescription}) when it is applied to a group isomorphic to the group $\mathcal{H}$-class \mbox{\texttt{\mdseries\slshape class}}. If \mbox{\texttt{\mdseries\slshape class}} is not a group $\mathcal{H}$-class, then \texttt{fail} is returned. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 6, 7, 8, 9 ], [ 1, 9, 4, 3, 5, 2, 10, 7 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 4, 7, 8, 9 ], [ 6, 2, 4, 9, 1, 3 ] ) );;|
  !gapprompt@gap>| !gapinput@H:=HClass(S, |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 7, 9 ], [ 1, 7, 3, 4, 9, 2 ] ));;|
  !gapprompt@gap>| !gapinput@StructureDescription(H);|
  "C6"
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsGreensDLeq}}
\logpage{[ 4, 4, 19 ]}\nobreak
\hyperdef{L}{X8693E8B184934EA0}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsGreensDLeq({\mdseries\slshape S})\index{IsGreensDLeq@\texttt{IsGreensDLeq}}
\label{IsGreensDLeq}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A function.



 \texttt{IsGreensDLeq(\mbox{\texttt{\mdseries\slshape S}})} returns a function \texttt{func} such that for any two elements \texttt{x} and \texttt{y} of \mbox{\texttt{\mdseries\slshape S}}, \texttt{func(x, y)} return \texttt{true} if the $\mathcal{D}$-class of \texttt{x} in \mbox{\texttt{\mdseries\slshape S}} is greater than or equal to the $\mathcal{D}$-class of \texttt{y} in \mbox{\texttt{\mdseries\slshape S}} under the usual ordering of Green's $\mathcal{D}$-classes of a semigroup. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( [ Transformation( [ 1, 3, 4, 1, 3 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 2, 4, 1, 5, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 2, 5, 3, 5, 3 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 5, 5, 1, 1, 3 ] ) ] );;|
  !gapprompt@gap>| !gapinput@reps:=ShallowCopy(DClassReps(S));|
  [ Transformation( [ 1, 3, 4, 1, 3 ] ), 
    Transformation( [ 2, 4, 1, 5, 5 ] ), 
    Transformation( [ 1, 4, 1, 1, 4 ] ), 
    Transformation( [ 1, 1, 1, 1, 1 ] ) ]
  !gapprompt@gap>| !gapinput@Sort(reps, IsGreensDLeq(S));|
  !gapprompt@gap>| !gapinput@reps;|
  [ Transformation( [ 2, 4, 1, 5, 5 ] ), 
    Transformation( [ 1, 3, 4, 1, 3 ] ), 
    Transformation( [ 1, 4, 1, 1, 4 ] ), 
    Transformation( [ 1, 1, 1, 1, 1 ] ) ]
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(DClass(S, reps[2]), DClass(S, reps[1]));|
  true
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(4);;|
  !gapprompt@gap>| !gapinput@IsGreensDLeq(S)(S.1, S.3);                      |
  true
  !gapprompt@gap>| !gapinput@IsGreensDLeq(S)(S.3, S.1);|
  false
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(DClass(S, S.3), DClass(S, S.1));|
  true
  !gapprompt@gap>| !gapinput@IsGreensLessThanOrEqual(DClass(S, S.1), DClass(S, S.3));|
  false
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Further attributes of semigroups}}\logpage{[ 4, 5, 0 ]}
\hyperdef{L}{X83802FC67CEB6C14}{}
{
  In this section we describe the attributes of a semigroup that can be found
using the \textsf{Semigroups} package. 

 

\subsection{\textcolor{Chapter }{Generators}}
\logpage{[ 4, 5, 1 ]}\nobreak
\hyperdef{L}{X7BD5B55C802805B4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Generators({\mdseries\slshape S})\index{Generators@\texttt{Generators}}
\label{Generators}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A list of generators.



 \texttt{Generators} returns a generating set that can be used to define the semigroup \mbox{\texttt{\mdseries\slshape S}}. The generators of a monoid or inverse semigroup \mbox{\texttt{\mdseries\slshape S}}, say, can be defined in several ways, for example, including or excluding the
identity element, including or not the inverses of the generators. \texttt{Generators} uses the definition that returns the least number of generators. If no
generating set for \mbox{\texttt{\mdseries\slshape S}} is known, then \texttt{GeneratorsOfSemigroup} is used by default.

 
\begin{description}
\item[{for a group}] \texttt{Generators(\mbox{\texttt{\mdseries\slshape S}})} is a synonym for \texttt{GeneratorsOfGroup} (\textbf{Reference: GeneratorsOfGroup}). 
\item[{for an ideal of semigroup}] \texttt{Generators(\mbox{\texttt{\mdseries\slshape S}})} is a synonym for \texttt{GeneratorsOfSemigroupIdeal} (\ref{GeneratorsOfSemigroupIdeal}). 
\item[{for a semigroup}] \texttt{Generators(\mbox{\texttt{\mdseries\slshape S}})} is a synonym for \texttt{GeneratorsOfSemigroup} (\textbf{Reference: GeneratorsOfSemigroup}). 
\item[{for a monoid}] \texttt{Generators(\mbox{\texttt{\mdseries\slshape S}})} is a synonym for \texttt{GeneratorsOfMonoid} (\textbf{Reference: GeneratorsOfMonoid}). 
\item[{for an inverse semigroup}] \texttt{Generators(\mbox{\texttt{\mdseries\slshape S}})} is a synonym for \texttt{GeneratorsOfInverseSemigroup} (\textbf{Reference: GeneratorsOfInverseSemigroup}). 
\item[{for an inverse monoid}] \texttt{Generators(\mbox{\texttt{\mdseries\slshape S}})} is a synonym for \texttt{GeneratorsOfInverseMonoid} (\textbf{Reference: GeneratorsOfInverseMonoid}). 
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@M:=Monoid(Transformation( [ 1, 4, 6, 2, 5, 3, 7, 8, 9, 9 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 6, 3, 2, 7, 5, 1, 8, 8, 9, 9 ] ) );;|
  !gapprompt@gap>| !gapinput@GeneratorsOfSemigroup(M);|
  [ IdentityTransformation, 
    Transformation( [ 1, 4, 6, 2, 5, 3, 7, 8, 9, 9 ] ), 
    Transformation( [ 6, 3, 2, 7, 5, 1, 8, 8, 9, 9 ] ) ]
  !gapprompt@gap>| !gapinput@GeneratorsOfMonoid(M);|
  [ Transformation( [ 1, 4, 6, 2, 5, 3, 7, 8, 9, 9 ] ), 
    Transformation( [ 6, 3, 2, 7, 5, 1, 8, 8, 9, 9 ] ) ]
  !gapprompt@gap>| !gapinput@Generators(M);|
  [ Transformation( [ 1, 4, 6, 2, 5, 3, 7, 8, 9, 9 ] ), 
    Transformation( [ 6, 3, 2, 7, 5, 1, 8, 8, 9, 9 ] ) ]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Generators(M));;|
  !gapprompt@gap>| !gapinput@Generators(S);|
  [ Transformation( [ 1, 4, 6, 2, 5, 3, 7, 8, 9, 9 ] ), 
    Transformation( [ 6, 3, 2, 7, 5, 1, 8, 8, 9, 9 ] ) ]
  !gapprompt@gap>| !gapinput@GeneratorsOfSemigroup(S);|
  [ Transformation( [ 1, 4, 6, 2, 5, 3, 7, 8, 9, 9 ] ), 
    Transformation( [ 6, 3, 2, 7, 5, 1, 8, 8, 9, 9 ] ) ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{GroupOfUnits}}
\logpage{[ 4, 5, 2 ]}\nobreak
\hyperdef{L}{X811AEDD88280C277}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GroupOfUnits({\mdseries\slshape S})\index{GroupOfUnits@\texttt{GroupOfUnits}}
\label{GroupOfUnits}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The group of units of a semigroup.



 \texttt{GroupOfUnits} returns the group of units of the semigroup \mbox{\texttt{\mdseries\slshape S}} as a subsemigroup of \mbox{\texttt{\mdseries\slshape S}} if it exists and returns \texttt{fail} if it does not. Use \texttt{IsomorphismPermGroup} (\ref{IsomorphismPermGroup}) if you require a permutation representation of the group of units.

 If a semigroup \mbox{\texttt{\mdseries\slshape S}} has an identity \texttt{e}, then the \emph{group of units} of \mbox{\texttt{\mdseries\slshape S}} is the set of those \texttt{s} in \mbox{\texttt{\mdseries\slshape S}} such that there exists \texttt{t} in \mbox{\texttt{\mdseries\slshape S}} where \texttt{s*t=t*s=e}. Equivalently, the group of units is the $\mathcal{H}$-class of the identity of \mbox{\texttt{\mdseries\slshape S}}.

 See also \texttt{GreensHClassOfElement} (\textbf{Reference: GreensHClassOfElement}), \texttt{IsMonoidAsSemigroup} (\ref{IsMonoidAsSemigroup}), and \texttt{MultiplicativeNeutralElement} (\textbf{Reference: MultiplicativeNeutralElement}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 1, 2, 5, 4, 3, 8, 7, 6 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 1, 6, 3, 4, 7, 2, 5, 8 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 2, 1, 6, 7, 8, 3, 4, 5 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 3, 2, 3, 6, 1, 6, 1, 2 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 5, 2, 3, 6, 3, 4, 7, 4 ] ) );;|
  !gapprompt@gap>| !gapinput@Size(S);|
  5304
  !gapprompt@gap>| !gapinput@StructureDescription(GroupOfUnits(S));|
  "C2 x S4"
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], |
  !gapprompt@>| !gapinput@[ 2, 4, 5, 3, 6, 7, 10, 9, 8, 1 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 8, 10 ], |
  !gapprompt@>| !gapinput@[ 8, 2, 3, 1, 4, 5, 10, 6, 9 ] ) );;|
  !gapprompt@gap>| !gapinput@StructureDescription(GroupOfUnits(S));|
  "C8"
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( PartialPerm( [ 1, 3, 4 ], [ 4, 3, 5 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5 ], [ 3, 1, 5, 2 ] ) );;|
  !gapprompt@gap>| !gapinput@GroupOfUnits(S);|
  fail
  !gapprompt@gap>| !gapinput@S:=Semigroup( Bipartition( [ [ 1, 2, 3, -1, -3 ], [ -2 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -1 ], [ 2, 3, -2, -3 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -2 ], [ 2, -3 ], [ 3, -1 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1 ], [ 2, 3, -2 ], [ -1, -3 ] ] ) );;|
  !gapprompt@gap>| !gapinput@StructureDescription(GroupOfUnits(S));|
  "C3"
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Idempotents}}
\logpage{[ 4, 5, 3 ]}\nobreak
\hyperdef{L}{X7C651C9C78398FFF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Idempotents({\mdseries\slshape obj[, n]})\index{Idempotents@\texttt{Idempotents}}
\label{Idempotents}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A list of idempotents.



 The argument \mbox{\texttt{\mdseries\slshape obj}} should be a semigroup, $\mathcal{D}$-class, $\mathcal{H}$-class, $\mathcal{L}$-class, or $\mathcal{R}$-class.

 If the optional second argument \mbox{\texttt{\mdseries\slshape n}} is present and \mbox{\texttt{\mdseries\slshape obj}} is a semigroup, then a list of the idempotents in \mbox{\texttt{\mdseries\slshape obj}} of rank \mbox{\texttt{\mdseries\slshape n}} is returned. If you are only interested in the idempotents of a given rank,
then the second version of the function will probably be faster. However, if
the optional second argument is present, then nothing is stored in \mbox{\texttt{\mdseries\slshape obj}} and so every time the function is called the computation must be repeated.

 This functions produce essentially the same output as the \textsf{GAP} library function with the same name; see \texttt{Idempotents} (\textbf{Reference: Idempotents}). The main difference is that this function can be applied to a wider class of
objects as described above.

 See also \texttt{IsRegularDClass} (\textbf{Reference: IsRegularDClass}), \texttt{IsRegularClass} (\ref{IsRegularClass}) \texttt{IsGroupHClass} (\textbf{Reference: IsGroupHClass}), \texttt{NrIdempotents} (\ref{NrIdempotents}), and \texttt{GroupHClass} (\ref{GroupHClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup([ Transformation( [ 2, 3, 4, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 1, 1 ] ) ]);;|
  !gapprompt@gap>| !gapinput@Idempotents(S, 1);|
  [  ]
  !gapprompt@gap>| !gapinput@Idempotents(S, 2);|
  [ Transformation( [ 1, 1, 3, 3 ] ), Transformation( [ 1, 3, 3, 1 ] ), 
    Transformation( [ 2, 2, 4, 4 ] ), Transformation( [ 4, 2, 2, 4 ] ) ]
  !gapprompt@gap>| !gapinput@Idempotents(S);|
  [ IdentityTransformation, Transformation( [ 1, 1, 3, 3 ] ), 
    Transformation( [ 1, 3, 3, 1 ] ), Transformation( [ 2, 2, 4, 4 ] ), 
    Transformation( [ 4, 2, 2, 4 ] ) ]
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 2, 2, 4, 4 ] );;|
  !gapprompt@gap>| !gapinput@R:=GreensRClassOfElement(S, f);|
  {Transformation( [ 3, 3, 1, 1 ] )}
  !gapprompt@gap>| !gapinput@Idempotents(R);|
  [ Transformation( [ 1, 1, 3, 3 ] ), Transformation( [ 2, 2, 4, 4 ] ) ]
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 4, 2, 2, 4 ] );;|
  !gapprompt@gap>| !gapinput@L:=GreensLClassOfElement(S, f);;|
  !gapprompt@gap>| !gapinput@Idempotents(L);|
  [ Transformation( [ 2, 2, 4, 4 ] ), Transformation( [ 4, 2, 2, 4 ] ) ]
  !gapprompt@gap>| !gapinput@D:=DClassOfLClass(L);|
  {Transformation( [ 1, 1, 3, 3 ] )}
  !gapprompt@gap>| !gapinput@Idempotents(D);|
  [ Transformation( [ 1, 1, 3, 3 ] ), Transformation( [ 2, 2, 4, 4 ] ), 
    Transformation( [ 1, 3, 3, 1 ] ), Transformation( [ 4, 2, 2, 4 ] ) ]
  !gapprompt@gap>| !gapinput@L:=GreensLClassOfElement(S, Transformation( [ 3, 1, 1, 3 ] ));;|
  !gapprompt@gap>| !gapinput@Idempotents(L);|
  [ Transformation( [ 1, 1, 3, 3 ] ), Transformation( [ 1, 3, 3, 1 ] ) ]
  !gapprompt@gap>| !gapinput@H:=GroupHClass(D);|
  {Transformation( [ 1, 1, 3, 3 ] )}
  !gapprompt@gap>| !gapinput@Idempotents(H);|
  [ Transformation( [ 1, 1, 3, 3 ] ) ]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@[ PartialPerm( [ 1, 2, 3, 4, 5, 7 ], [ 10, 6, 3, 4, 9, 1 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 5, 6, 7, 8 ], |
  !gapprompt@>| !gapinput@[ 6, 10, 7, 4, 8, 2, 9, 1 ] ) ]);;|
  !gapprompt@gap>| !gapinput@Idempotents(S, 1);|
  [ <identity partial perm on [ 4 ]> ]
  !gapprompt@gap>| !gapinput@Idempotents(S, 0);|
  [  ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NrIdempotents}}
\logpage{[ 4, 5, 4 ]}\nobreak
\hyperdef{L}{X7CFC4DB387452320}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrIdempotents({\mdseries\slshape obj})\index{NrIdempotents@\texttt{NrIdempotents}}
\label{NrIdempotents}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A positive integer. 



 This function returns the number of idempotents in \mbox{\texttt{\mdseries\slshape obj}} where \mbox{\texttt{\mdseries\slshape obj}} can be a semigroup, $\mathcal{D}$-, $\mathcal{L}$-, $\mathcal{H}$-, or $\mathcal{R}$-class. If the actual idempotents are not required, then it is more efficient
to use \texttt{NrIdempotents(obj)} than \texttt{Length(Idempotents(obj))} since the idempotents themselves are not created when \texttt{NrIdempotents} is called.

 See also \texttt{Idempotents} (\textbf{Reference: Idempotents}) and \texttt{Idempotents} (\ref{Idempotents}), \texttt{IsRegularDClass} (\textbf{Reference: IsRegularDClass}), \texttt{IsRegularClass} (\ref{IsRegularClass}) \texttt{IsGroupHClass} (\textbf{Reference: IsGroupHClass}), and \texttt{GroupHClass} (\ref{GroupHClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup([ Transformation( [ 2, 3, 4, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 1, 1 ] ) ]);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(S);   |
  5
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 2, 2, 4, 4 ] );;|
  !gapprompt@gap>| !gapinput@R:=GreensRClassOfElement(S, f);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(R);|
  2
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 4, 2, 2, 4 ] );;|
  !gapprompt@gap>| !gapinput@L:=GreensLClassOfElement(S, f);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(L);|
  2
  !gapprompt@gap>| !gapinput@D:=DClassOfLClass(L);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(D);|
  4
  !gapprompt@gap>| !gapinput@L:=GreensLClassOfElement(S, Transformation( [ 3, 1, 1, 3 ] ));;|
  !gapprompt@gap>| !gapinput@NrIdempotents(L);|
  2
  !gapprompt@gap>| !gapinput@H:=GroupHClass(D);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(H);|
  1
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@[ PartialPerm( [ 1, 2, 3, 5, 7, 9, 10 ], [ 6, 7, 2, 9, 1, 5, 3 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5, 6, 7, 9, 10 ], |
  !gapprompt@>| !gapinput@[ 8, 1, 9, 4, 10, 5, 6, 7 ] ) ]);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(S);|
  236
  !gapprompt@gap>| !gapinput@f:=PartialPerm([ 2, 3, 7, 9, 10 ], [ 7, 2, 1, 5, 3 ]);;|
  !gapprompt@gap>| !gapinput@d:=DClassNC(S, f);;|
  !gapprompt@gap>| !gapinput@NrIdempotents(d);|
  13
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IdempotentGeneratedSubsemigroup}}
\logpage{[ 4, 5, 5 ]}\nobreak
\hyperdef{L}{X83970D028143B79B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IdempotentGeneratedSubsemigroup({\mdseries\slshape S})\index{IdempotentGeneratedSubsemigroup@\texttt{IdempotentGeneratedSubsemigroup}}
\label{IdempotentGeneratedSubsemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A semigroup. 



 \texttt{IdempotentGeneratedSubsemigroup} returns the subsemigroup of the semigroup \mbox{\texttt{\mdseries\slshape S}} generated by the idempotents of \mbox{\texttt{\mdseries\slshape S}}.

 See also \texttt{Idempotents} (\ref{Idempotents}) and \texttt{SmallGeneratingSet} (\ref{SmallGeneratingSet}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( [ Transformation( [ 1, 1 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 2, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 2, 2 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 3, 4, 5, 1 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 3, 4, 5, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 3, 4, 6, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 3, 5, 4 ] ),|
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 3, 7, 4, 5, 7 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 4, 8, 8, 3, 8, 7 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 8, 4, 5, 6, 7, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 7, 7, 7, 4, 5, 6, 1 ] ) ] );;|
  !gapprompt@gap>| !gapinput@IdempotentGeneratedSubsemigroup(S);|
  <transformation monoid on 8 pts with 18 generators>
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(5);|
  <symmetric inverse semigroup on 5 pts>
  !gapprompt@gap>| !gapinput@IdempotentGeneratedSubsemigroup(S);|
  <inverse partial perm monoid on 5 pts with 5 generators>
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseSemigroup(5); |
  <inverse bipartition monoid on 5 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IdempotentGeneratedSubsemigroup(S);|
  <inverse bipartition monoid on 5 pts with 10 generators>
  !gapprompt@gap>| !gapinput@IsSemilatticeAsSemigroup(last);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IrredundantGeneratingSubset}}
\logpage{[ 4, 5, 6 ]}\nobreak
\hyperdef{L}{X7F88DA9487720D2B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IrredundantGeneratingSubset({\mdseries\slshape coll})\index{IrredundantGeneratingSubset@\texttt{IrredundantGeneratingSubset}}
\label{IrredundantGeneratingSubset}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A list of irredundant generators. 



 If \mbox{\texttt{\mdseries\slshape coll}} is a collection of elements of a semigroup, then this function returns a
subset \texttt{U} of \mbox{\texttt{\mdseries\slshape coll}} such that no element of \texttt{U} is generated by the other elements of \texttt{U}.

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 5, 1, 4, 6, 2, 3 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 1, 2, 3, 4, 5, 6 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 4, 6, 3, 4, 2, 5 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 5, 4, 6, 3, 1, 3 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 2, 2, 6, 5, 4, 3 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 3, 5, 5, 1, 2, 4 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 6, 5, 1, 3, 3, 4 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 1, 3, 4, 3, 2, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@IrredundantGeneratingSubset(S);|
  [ Transformation( [ 1, 3, 4, 3, 2, 1 ] ), 
    Transformation( [ 2, 2, 6, 5, 4, 3 ] ), 
    Transformation( [ 3, 5, 5, 1, 2, 4 ] ), 
    Transformation( [ 5, 1, 4, 6, 2, 3 ] ), 
    Transformation( [ 5, 4, 6, 3, 1, 3 ] ), 
    Transformation( [ 6, 5, 1, 3, 3, 4 ] ) ]
  !gapprompt@gap>| !gapinput@S:=RandomInverseMonoid(1000,10);|
  <inverse partial perm monoid on 10 pts with 1000 generators>
  !gapprompt@gap>| !gapinput@SmallGeneratingSet(S);|
  [ [ 1 .. 10 ] -> [ 6, 5, 1, 9, 8, 3, 10, 4, 7, 2 ], 
    [ 1 .. 10 ] -> [ 1, 4, 6, 2, 8, 5, 7, 10, 3, 9 ], 
    [ 1, 2, 3, 4, 6, 7, 8, 9 ] -> [ 7, 5, 10, 1, 8, 4, 9, 6 ]
    [ 1 .. 9 ] -> [ 4, 3, 5, 7, 10, 9, 1, 6, 8 ] ]
  !gapprompt@gap>| !gapinput@IrredundantGeneratingSubset(last);|
  [ [ 1 .. 9 ] -> [ 4, 3, 5, 7, 10, 9, 1, 6, 8 ], 
    [ 1 .. 10 ] -> [ 1, 4, 6, 2, 8, 5, 7, 10, 3, 9 ], 
    [ 1 .. 10 ] -> [ 6, 5, 1, 9, 8, 3, 10, 4, 7, 2 ] ]
  !gapprompt@gap>| !gapinput@S:=RandomBipartitionSemigroup(1000,4);|
  <bipartition semigroup on 4 pts with 749 generators>
  !gapprompt@gap>| !gapinput@SmallGeneratingSet(S);|
  [ <bipartition: [ 1, -3 ], [ 2, -2 ], [ 3, -1 ], [ 4, -4 ]>, 
    <bipartition: [ 1, 3, -2 ], [ 2, -1, -3 ], [ 4, -4 ]>, 
    <bipartition: [ 1, -4 ], [ 2, 4, -1, -3 ], [ 3, -2 ]>, 
    <bipartition: [ 1, -1, -3 ], [ 2, -4 ], [ 3, 4, -2 ]>, 
    <bipartition: [ 1, -2, -4 ], [ 2 ], [ 3, -3 ], [ 4, -1 ]>, 
    <bipartition: [ 1, -2 ], [ 2, -1, -3 ], [ 3, 4, -4 ]>, 
    <bipartition: [ 1, 3, -1 ], [ 2, -3 ], [ 4, -2, -4 ]>, 
    <bipartition: [ 1, -1 ], [ 2, 4, -4 ], [ 3, -2, -3 ]>, 
    <bipartition: [ 1, 3, -1 ], [ 2, -2 ], [ 4, -3, -4 ]>, 
    <bipartition: [ 1, 2, -2 ], [ 3, -1, -4 ], [ 4, -3 ]>, 
    <bipartition: [ 1, -2, -3 ], [ 2, -4 ], [ 3 ], [ 4, -1 ]>, 
    <bipartition: [ 1, -1 ], [ 2, 4, -3 ], [ 3, -2 ], [ -4 ]>, 
    <bipartition: [ 1, -3 ], [ 2, -1 ], [ 3, 4, -4 ], [ -2 ]>, 
    <bipartition: [ 1, 2, -4 ], [ 3, -1 ], [ 4, -2 ], [ -3 ]>, 
    <bipartition: [ 1, -3 ], [ 2, -4 ], [ 3, -1, -2 ], [ 4 ]> ]
  !gapprompt@gap>| !gapinput@IrredundantGeneratingSubset(last);|
  [ <bipartition: [ 1, 2, -4 ], [ 3, -1 ], [ 4, -2 ], [ -3 ]>, 
    <bipartition: [ 1, 3, -1 ], [ 2, -2 ], [ 4, -3, -4 ]>, 
    <bipartition: [ 1, 3, -2 ], [ 2, -1, -3 ], [ 4, -4 ]>, 
    <bipartition: [ 1, -1 ], [ 2, 4, -3 ], [ 3, -2 ], [ -4 ]>, 
    <bipartition: [ 1, -3 ], [ 2, -1 ], [ 3, 4, -4 ], [ -2 ]>, 
    <bipartition: [ 1, -3 ], [ 2, -2 ], [ 3, -1 ], [ 4, -4 ]>, 
    <bipartition: [ 1, -3 ], [ 2, -4 ], [ 3, -1, -2 ], [ 4 ]>, 
    <bipartition: [ 1, -2, -3 ], [ 2, -4 ], [ 3 ], [ 4, -1 ]>, 
    <bipartition: [ 1, -2, -4 ], [ 2 ], [ 3, -3 ], [ 4, -1 ]> ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MaximalSubsemigroups (for an acting semigroup)}}
\logpage{[ 4, 5, 7 ]}\nobreak
\hyperdef{L}{X8137E2737C79C07B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MaximalSubsemigroups({\mdseries\slshape S})\index{MaximalSubsemigroups@\texttt{MaximalSubsemigroups}!for an acting semigroup}
\label{MaximalSubsemigroups:for an acting semigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The maximal subsemigroups of \mbox{\texttt{\mdseries\slshape S}}.



 If \mbox{\texttt{\mdseries\slshape S}} is a semigroup, then \texttt{MaximalSubsemigroups} returns a list of the maximal subsemigroups of \mbox{\texttt{\mdseries\slshape S}}. 

 A \emph{maximal subsemigroup} of \mbox{\texttt{\mdseries\slshape S}} is a proper subsemigroup of \mbox{\texttt{\mdseries\slshape S}} which is contained in no other proper subsemigroups of \mbox{\texttt{\mdseries\slshape S}}. 

 The method for this function are based on \cite{Graham1968aa}. 

 \textsc{Please note:} the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package version 4.5 or higher must be available and compiled for this function
to work. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := FullTransformationSemigroup(4);|
  <full transformation semigroup on 4 pts>
  !gapprompt@gap>| !gapinput@MaximalSubsemigroups(S);|
  [ <transformation semigroup on 4 pts with 3 generators>, 
    <transformation semigroup on 4 pts with 5 generators>, 
    <transformation semigroup on 4 pts with 4 generators>, 
    <transformation semigroup on 4 pts with 4 generators>, 
    <transformation semigroup on 4 pts with 5 generators>, 
    <transformation semigroup on 4 pts with 4 generators>, 
    <transformation semigroup on 4 pts with 5 generators>, 
    <transformation semigroup on 4 pts with 5 generators>, 
    <transformation semigroup on 4 pts with 4 generators> ]
  !gapprompt@gap>| !gapinput@D:=DClass(S, Transformation([ 2, 2 ]));|
  {Transformation( [ 2, 3, 1, 2 ] )}
  !gapprompt@gap>| !gapinput@R := PrincipalFactor(D);|
  <Rees 0-matrix semigroup 6x4 over Group([ (1,2,3), (1,2) ])>
  !gapprompt@gap>| !gapinput@MaximalSubsemigroups(R);                                       |
  [ <Rees 0-matrix semigroup 6x3 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 6x3 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 6x3 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 6x3 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 5x4 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 5x4 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 5x4 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 5x4 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 5x4 over Group([ (1,2,3), (1,2) ])>, 
    <Rees 0-matrix semigroup 5x4 over Group([ (1,2,3), (1,2) ])>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 23 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 23 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 21 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 23 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 21 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 21 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 23 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 21 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 21 generators>, 
    <subsemigroup of 6x4 Rees 0-matrix semigroup with 21 generators> ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MaximalSubsemigroups (for a Rees (0-)matrix semigroup, and a group)}}
\logpage{[ 4, 5, 8 ]}\nobreak
\hyperdef{L}{X7C39DC3C85462681}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MaximalSubsemigroups({\mdseries\slshape R, H})\index{MaximalSubsemigroups@\texttt{MaximalSubsemigroups}!for a Rees (0-)matrix semigroup, and a group}
\label{MaximalSubsemigroups:for a Rees (0-)matrix semigroup, and a group}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
The maximal subsemigroups of a Rees (0)-matrix semigroup corresponding to a
maximal subgroup of the underlying group.



 Suppose that \mbox{\texttt{\mdseries\slshape R}} is a regular Rees (0-)matrix semigroup of the form $\mathcal{M}[G; I, J; P]$  where $G$ is a group and $P$ is a $|J|$ by $|I|$ matrix with entries in $G\cup\{0\}$ . If \mbox{\texttt{\mdseries\slshape H}} is a maximal subgroup of $G$, then this function returns the maximal subsemigroups of \mbox{\texttt{\mdseries\slshape R}} which are isomorphic to $\mathcal{M}[H; I, J; P]$.  

 The method used in this function is based on Remark 1 of \cite{Graham1968aa}. 

 \textsc{Please note:} the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package version 4.5 or higher must be available and compiled for this function
to work, when the argument \mbox{\texttt{\mdseries\slshape R}} is a Rees 0-matrix semigroup. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@R := ReesZeroMatrixSemigroup(Group([ (1,2), (3,4) ]), |
  !gapprompt@>| !gapinput@[ [ (), (1,2) ], [ (), (1,2) ] ]);|
  <Rees 0-matrix semigroup 2x2 over Group([ (1,2), (3,4) ])>
  !gapprompt@gap>| !gapinput@G := UnderlyingSemigroup(R);|
  Group([ (1,2), (3,4) ])
  !gapprompt@gap>| !gapinput@H := Group((1,2));  |
  Group([ (1,2) ])
  !gapprompt@gap>| !gapinput@max := MaximalSubsemigroups(R, H);|
  [ <subsemigroup of 2x2 Rees 0-matrix semigroup with 6 generators> ]
  !gapprompt@gap>| !gapinput@IsMaximalSubsemigroup(R, max[1]);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsMaximalSubsemigroup}}
\logpage{[ 4, 5, 9 ]}\nobreak
\hyperdef{L}{X82D74C2478A49FD5}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMaximalSubsemigroup({\mdseries\slshape S, T})\index{IsMaximalSubsemigroup@\texttt{IsMaximalSubsemigroup}}
\label{IsMaximalSubsemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
true or false



 If \mbox{\texttt{\mdseries\slshape S}} and \mbox{\texttt{\mdseries\slshape T}} are semigroups, then \texttt{IsMaximalSubsemigroup} returns true if and only if \mbox{\texttt{\mdseries\slshape T}} is a maximal subsemigroup of \mbox{\texttt{\mdseries\slshape S}}. 

 A proper subsemigroup \mbox{\texttt{\mdseries\slshape T}} of a semigroup \mbox{\texttt{\mdseries\slshape S}} is a \emph{maximal} if \mbox{\texttt{\mdseries\slshape T}} is not contained in any other proper subsemigroups of \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := FullTransformationSemigroup(4);                              |
  <full transformation semigroup on 4 pts>
  !gapprompt@gap>| !gapinput@T := Semigroup([ Transformation( [ 3, 4, 1, 2 ] ),|
  !gapprompt@>| !gapinput@ Transformation( [ 1, 4, 2, 3 ] ),|
  !gapprompt@>| !gapinput@ Transformation( [ 2, 1, 1, 3 ] ) ]);|
  <transformation semigroup on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsMaximalSubsemigroup(S, T);|
  true
  !gapprompt@gap>| !gapinput@R:=Semigroup([ Transformation( [ 3, 4, 1, 2 ] ),|
  !gapprompt@>| !gapinput@ Transformation( [ 1, 4, 2, 2 ] ),|
  !gapprompt@>| !gapinput@ Transformation( [ 2, 1, 1, 3 ] ) ]);|
  <transformation semigroup on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsMaximalSubsemigroup(S, R); |
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalIdeal}}
\logpage{[ 4, 5, 10 ]}\nobreak
\hyperdef{L}{X7BC68589879C3BE9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MinimalIdeal({\mdseries\slshape S})\index{MinimalIdeal@\texttt{MinimalIdeal}}
\label{MinimalIdeal}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 The minimal ideal of a semigroup. 



 The minimal ideal of a semigroup is the least ideal with respect to
containment. 

 It is significantly easier to find the minimal $\mathcal{D}$-class of a semigroup, than to find its $\mathcal{D}$-classes. 

 See also \texttt{RepresentativeOfMinimalIdeal} (\ref{RepresentativeOfMinimalIdeal}), \texttt{PartialOrderOfDClasses} (\ref{PartialOrderOfDClasses}), \texttt{IsGreensLessThanOrEqual} (\textbf{Reference: IsGreensLessThanOrEqual}), and \texttt{MinimalDClass} (\ref{MinimalDClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 3, 4, 1, 3, 6, 3, 4, 6, 10, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 8, 2, 3, 8, 4, 1, 3, 4, 9, 7 ] ));;|
  !gapprompt@gap>| !gapinput@MinimalIdeal(S);|
  <simple transformation semigroup ideal on 10 pts with 1 generator>
  !gapprompt@gap>| !gapinput@Elements(MinimalIdeal(S));|
  [ Transformation( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ), 
    Transformation( [ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ] ), 
    Transformation( [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ] ), 
    Transformation( [ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 ] ), 
    Transformation( [ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ] ) ]
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ] );;|
  !gapprompt@gap>| !gapinput@D:=DClass(S, f);|
  {Transformation( [ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ] )}
  !gapprompt@gap>| !gapinput@ForAll(GreensDClasses(S), x-> IsGreensLessThanOrEqual(D, x));|
  true
  !gapprompt@gap>| !gapinput@MinimalIdeal(POI(10));|
  <partial perm group on 10 pts with 1 generator>
  !gapprompt@gap>| !gapinput@MinimalIdeal(BrauerMonoid(6));|
  <simple bipartition semigroup ideal on 6 pts with 1 generator>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RepresentativeOfMinimalIdeal}}
\logpage{[ 4, 5, 11 ]}\nobreak
\hyperdef{L}{X7CA6744182D07C5B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RepresentativeOfMinimalIdeal({\mdseries\slshape S})\index{RepresentativeOfMinimalIdeal@\texttt{RepresentativeOfMinimalIdeal}}
\label{RepresentativeOfMinimalIdeal}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RepresentativeOfMinimalDClass({\mdseries\slshape S})\index{RepresentativeOfMinimalDClass@\texttt{RepresentativeOfMinimalDClass}}
\label{RepresentativeOfMinimalDClass}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 An element of the minimal ideal of a semigroup. 



 The minimal ideal of a semigroup is the least ideal with respect to
containment.

 This method returns a representative element of the minimal ideal of \mbox{\texttt{\mdseries\slshape S}} without having to create the minimal ideal itself. In general, beyond being a
member of the minimal ideal, the returned element is not guaranteed to have
any special properties. However, the element will coincide with the zero
element of \mbox{\texttt{\mdseries\slshape S}} if one exists. 

 This method works particularly well if \mbox{\texttt{\mdseries\slshape S}} is a semigroup of transformations or partial permutations.

 See also \texttt{MinimalIdeal} (\ref{MinimalIdeal}) and \texttt{MinimalDClass} (\ref{MinimalDClass}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := SymmetricInverseSemigroup(10);;|
  !gapprompt@gap>| !gapinput@RepresentativeOfMinimalIdeal(S);|
  <empty partial perm>
  !gapprompt@gap>| !gapinput@B := Semigroup([|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2 ], [ 3, 6, -2 ], [ 4, 5, -3, -4 ],|
  !gapprompt@>| !gapinput@ [ -1, -6 ], [ -5 ] ] ),|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -1 ], [ 2 ], [ 3 ], [ 4, -3 ], |
  !gapprompt@>| !gapinput@ [ 5, 6, -5, -6 ], [ -2, -4 ] ] ) ]);;|
  !gapprompt@gap>| !gapinput@RepresentativeOfMinimalIdeal(B);|
  <bipartition: [ 1, 2 ], [ 3, 6 ], [ 4, 5 ], [ -1, -5, -6 ], 
   [ -2, -4 ], [ -3 ]>
  !gapprompt@gap>| !gapinput@S := Semigroup([ Transformation( [ 5, 1, 6, 2, 2, 4 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 3, 5, 5, 1, 6, 2 ] ) ]);;|
  !gapprompt@gap>| !gapinput@RepresentativeOfMinimalDClass(S);|
  Transformation( [ 1, 2, 2, 5, 5, 1 ] )
  !gapprompt@gap>| !gapinput@MinimalDClass(S);|
  {Transformation( [ 1, 2, 2, 5, 5, 1 ] )}
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MultiplicativeZero}}
\logpage{[ 4, 5, 12 ]}\nobreak
\hyperdef{L}{X7B39F93C8136D642}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MultiplicativeZero({\mdseries\slshape S})\index{MultiplicativeZero@\texttt{MultiplicativeZero}}
\label{MultiplicativeZero}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 The zero element of a semigroup. 



 \texttt{MultiplicativeZero} returns the zero element of the semigroup \mbox{\texttt{\mdseries\slshape S}} if it exists and \texttt{fail} if it does not. See also \texttt{MultiplicativeZero} (\textbf{Reference: MultiplicativeZero}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 1, 4, 2, 6, 6, 5, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 6, 3, 6, 2, 1, 6 ] ));;|
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  Transformation( [ 1, 1, 1, 1, 1, 1, 1 ] )
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 8, 3, 7, 1, 5, 2, 6 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 5, 7, 2, 5, 6, 3, 8 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 6, 7, 4, 1, 4, 1, 6, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 8, 8, 5, 1, 7, 5, 2, 8 ] ));;|
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  fail
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( PartialPerm( [ 1, 3, 4 ], [ 5, 3, 1 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4 ], [ 4, 3, 1, 2 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 4, 5 ], [ 2, 4, 5, 3 ] ) );;|
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  <empty partial perm>
  !gapprompt@gap>| !gapinput@S:=PartitionMonoid(6); |
  <regular bipartition monoid on 6 pts with 4 generators>
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  fail
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(6);|
  <inverse bipartition monoid on 6 pts with 3 generators>
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  <block bijection: [ 1, 2, 3, 4, 5, 6, -1, -2, -3, -4, -5, -6 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Random (for a semigroup)}}
\logpage{[ 4, 5, 13 ]}\nobreak
\hyperdef{L}{X7BB7FDFE7AFFD672}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Random({\mdseries\slshape S})\index{Random@\texttt{Random}!for a semigroup}
\label{Random:for a semigroup}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
A random element.



 This function returns a random element of the semigroup \mbox{\texttt{\mdseries\slshape S}}. If the elements of \mbox{\texttt{\mdseries\slshape S}} have been calculated, then one of these is chosen randomly. Otherwise, if the
data structure for \mbox{\texttt{\mdseries\slshape S}} is known, then a random element of a randomly chosen $\mathcal{R}$-class is returned. If the data structure for \mbox{\texttt{\mdseries\slshape S}} has not been calculated, then a short product (at most \texttt{2*Length(GeneratorsOfSemigroup(\mbox{\texttt{\mdseries\slshape S}}))}) of generators is returned. }

 

\subsection{\textcolor{Chapter }{SmallGeneratingSet}}
\logpage{[ 4, 5, 14 ]}\nobreak
\hyperdef{L}{X814DBABC878D5232}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallGeneratingSet({\mdseries\slshape coll})\index{SmallGeneratingSet@\texttt{SmallGeneratingSet}}
\label{SmallGeneratingSet}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallSemigroupGeneratingSet({\mdseries\slshape coll})\index{SmallSemigroupGeneratingSet@\texttt{SmallSemigroupGeneratingSet}}
\label{SmallSemigroupGeneratingSet}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallMonoidGeneratingSet({\mdseries\slshape coll})\index{SmallMonoidGeneratingSet@\texttt{SmallMonoidGeneratingSet}}
\label{SmallMonoidGeneratingSet}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallInverseSemigroupGeneratingSet({\mdseries\slshape coll})\index{SmallInverseSemigroupGeneratingSet@\texttt{SmallInverseSemigroupGeneratingSet}}
\label{SmallInverseSemigroupGeneratingSet}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallInverseMonoidGeneratingSet({\mdseries\slshape coll})\index{SmallInverseMonoidGeneratingSet@\texttt{SmallInverseMonoidGeneratingSet}}
\label{SmallInverseMonoidGeneratingSet}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A small generating set for a semigroup.



 The attributes \texttt{SmallXGeneratingSet} return a relatively small generating subset of the collection of elements \mbox{\texttt{\mdseries\slshape coll}}, which can also be a semigroup. The returned value of \texttt{SmallXGeneratingSet}, where applicable, has the property that 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
        X(SmallXGeneratingSet(coll))=X(coll);
      
\end{Verbatim}
 where \texttt{X} is any of \texttt{Semigroup} (\textbf{Reference: Semigroup}), \texttt{Monoid} (\textbf{Reference: Monoid}), \texttt{InverseSemigroup} (\textbf{Reference: InverseSemigroup}), or \texttt{InverseMonoid} (\textbf{Reference: InverseMonoid}).

 If the number of generators for \mbox{\texttt{\mdseries\slshape S}} is already relatively small, then these functions will often return the
original generating set. These functions may return different results in
different \textsf{GAP} sessions.

 \texttt{SmallGeneratingSet} returns the smallest of the returned values of \texttt{SmallXGeneratingSet} which is applicable to \mbox{\texttt{\mdseries\slshape coll}}; see \texttt{Generators} (\ref{Generators}).

 As neither irredundancy, nor minimal length are proven, these functions
usually return an answer much more quickly than \texttt{IrredundantGeneratingSubset} (\ref{IrredundantGeneratingSubset}). These functions can be used whenever a small generating set is desired which
does not necessarily needs to be minimal. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 1, 2, 3, 2, 4 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 5, 4, 3, 2 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 2, 1, 4, 2, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 2, 4, 4, 2, 1 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 3, 1, 4, 3, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 2, 3, 4, 1 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 4, 4, 3, 3, 5 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 1, 5, 5, 3 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 5, 4, 3, 5, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 5, 4, 5, 5 ] ) );;|
  !gapprompt@gap>| !gapinput@SmallGeneratingSet(S);                  |
  [ Transformation( [ 1, 5, 4, 3, 2 ] ), Transformation( [ 3, 2, 3, 4, 1 ] ), 
    Transformation( [ 5, 4, 3, 5, 2 ] ), Transformation( [ 1, 2, 3, 2, 4 ] ), 
    Transformation( [ 4, 4, 3, 3, 5 ] ) ]
  !gapprompt@gap>| !gapinput@S:=RandomInverseMonoid(10000,10);;|
  !gapprompt@gap>| !gapinput@SmallGeneratingSet(S);|
  [ [ 1 .. 10 ] -> [ 3, 2, 4, 5, 6, 1, 7, 10, 9, 8 ], 
    [ 1 .. 10 ] -> [ 5, 10, 8, 9, 3, 2, 4, 7, 6, 1 ], 
    [ 1, 3, 4, 5, 6, 7, 8, 9, 10 ] -> [ 1, 6, 4, 8, 2, 10, 7, 3, 9 ] ]
  !gapprompt@gap>| !gapinput@M:=MathieuGroup(24);;|
  !gapprompt@gap>| !gapinput@mat:=List([1..1000], x-> Random(G));;|
  !gapprompt@gap>| !gapinput@Append(mat, [1..1000]*0);|
  !gapprompt@gap>| !gapinput@mat:=List([1..138], x-> List([1..57], x-> Random(mat)));;|
  !gapprompt@gap>| !gapinput@R:=ReesZeroMatrixSemigroup(G, mat);;|
  !gapprompt@gap>| !gapinput@U:=Semigroup(List([1..200], x-> Random(R)));|
  <subsemigroup of 57x138 Rees 0-matrix semigroup with 100 generators>
  !gapprompt@gap>| !gapinput@Length(SmallGeneratingSet(U));|
  84
  !gapprompt@gap>| !gapinput@S:=RandomBipartitionSemigroup(100,4);|
  <bipartition semigroup on 4 pts with 96 generators>
  !gapprompt@gap>| !gapinput@Length(SmallGeneratingSet(S));       |
  13
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ComponentRepsOfTransformationSemigroup}}
\logpage{[ 4, 5, 15 ]}\nobreak
\hyperdef{L}{X8065DBC48722B085}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ComponentRepsOfTransformationSemigroup({\mdseries\slshape S})\index{ComponentRepsOfTransformationSemigroup@\texttt{Component}\-\texttt{Reps}\-\texttt{Of}\-\texttt{Transformation}\-\texttt{Semigroup}}
\label{ComponentRepsOfTransformationSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The representatives of components of a transformation semigroup.



 This function returns the representatives of the components of the action of
the transformation semigroup \mbox{\texttt{\mdseries\slshape S}} on the set of positive integers not greater than the degree of \mbox{\texttt{\mdseries\slshape S}}. 

 The representatives are the least set of points such that every point can be
reached from some representative under the action of \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@Transformation( [ 11, 11, 9, 6, 4, 1, 4, 1, 6, 7, 12, 5 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 12, 10, 7, 10, 4, 1, 12, 9, 11, 9, 1, 12 ] ) );;|
  !gapprompt@gap>| !gapinput@ComponentRepsOfTransformationSemigroup(S);|
  [ 2, 3, 8 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ComponentsOfTransformationSemigroup}}
\logpage{[ 4, 5, 16 ]}\nobreak
\hyperdef{L}{X8706A72A7F3EE532}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ComponentsOfTransformationSemigroup({\mdseries\slshape S})\index{ComponentsOfTransformationSemigroup@\texttt{ComponentsOfTransformationSemigroup}}
\label{ComponentsOfTransformationSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The components of a transformation semigroup.



 This function returns the components of the action of the transformation
semigroup \mbox{\texttt{\mdseries\slshape S}} on the set of positive integers not greater than the degree of \mbox{\texttt{\mdseries\slshape S}}; the components of \mbox{\texttt{\mdseries\slshape S}} partition this set. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@Transformation( [ 11, 11, 9, 6, 4, 1, 4, 1, 6, 7, 12, 5 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 12, 10, 7, 10, 4, 1, 12, 9, 11, 9, 1, 12 ] ) );;|
  !gapprompt@gap>| !gapinput@ComponentsOfTransformationSemigroup(S);|
  [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{CyclesOfTransformationSemigroup}}
\logpage{[ 4, 5, 17 ]}\nobreak
\hyperdef{L}{X7AA697B186301F54}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CyclesOfTransformationSemigroup({\mdseries\slshape S})\index{CyclesOfTransformationSemigroup@\texttt{CyclesOfTransformationSemigroup}}
\label{CyclesOfTransformationSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The cycles of a transformation semigroup.



 This function returns the cycles, or strongly connected components, of the
action of the transformation semigroup \mbox{\texttt{\mdseries\slshape S}} on the set of positive integers not greater than the degree of \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@Transformation( [ 11, 11, 9, 6, 4, 1, 4, 1, 6, 7, 12, 5 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 12, 10, 7, 10, 4, 1, 12, 9, 11, 9, 1, 12 ] ) );;|
  !gapprompt@gap>| !gapinput@CyclesOfTransformationSemigroup(S);|
  [ [ 1, 11, 12, 5, 4, 6, 10, 7, 9 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsTransitive (for a transformation
    semigroup and a set)}}
\logpage{[ 4, 5, 18 ]}\nobreak
\hyperdef{L}{X83DA161F875F63B1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsTransitive({\mdseries\slshape S[, X]})\index{IsTransitive@\texttt{IsTransitive}!for a transformation
    semigroup and a set}
\label{IsTransitive:for a transformation
    semigroup and a set}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsTransitive({\mdseries\slshape S[, n]})\index{IsTransitive@\texttt{IsTransitive}!for a transformation
    semigroup and a pos int}
\label{IsTransitive:for a transformation
    semigroup and a pos int}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A transformation semigroup \mbox{\texttt{\mdseries\slshape S}} is \emph{transitive} or \emph{strongly connected} on the set \mbox{\texttt{\mdseries\slshape X}} if for every \texttt{i,j} in \mbox{\texttt{\mdseries\slshape X}} there is an element \texttt{s} in \mbox{\texttt{\mdseries\slshape S}} such that \texttt{i\texttt{\symbol{94}}s=j}. 

 If the optional second argument is a positive integer \mbox{\texttt{\mdseries\slshape n}}, then \texttt{IsTransitive} returns \texttt{true} if \mbox{\texttt{\mdseries\slshape S}} is transitive on \texttt{[1..\mbox{\texttt{\mdseries\slshape n}}]}, and \texttt{false} if it is not. 

 If the optional second argument is not provided, then the degree of \mbox{\texttt{\mdseries\slshape S}} is used by default; see \texttt{DegreeOfTransformationSemigroup} (\textbf{Reference: DegreeOfTransformationSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( [ Bipartition( [ [ 1, 2 ], [ 3, 6, -2 ], |
  !gapprompt@>| !gapinput@[ 4, 5, -3, -4 ], [ -1, -6 ], [ -5 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -4 ], [ 2, 3, 4, 5 ], [ 6 ], [ -1, -6 ], |
  !gapprompt@>| !gapinput@[ -2, -3 ], [ -5 ] ] ) ] );|
  <bipartition semigroup on 6 pts with 2 generators>
  !gapprompt@gap>| !gapinput@AsTransformationSemigroup(S);|
  <transformation semigroup on 12 pts with 2 generators>
  !gapprompt@gap>| !gapinput@IsTransitive(last);|
  false
  !gapprompt@gap>| !gapinput@IsTransitive(AsSemigroup(Group((1,2,3))));|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ComponentRepsOfPartialPermSemigroup}}
\logpage{[ 4, 5, 19 ]}\nobreak
\hyperdef{L}{X7BC22CB47C7B5EBB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ComponentRepsOfPartialPermSemigroup({\mdseries\slshape S})\index{ComponentRepsOfPartialPermSemigroup@\texttt{ComponentRepsOfPartialPermSemigroup}}
\label{ComponentRepsOfPartialPermSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The representatives of components of a partial perm semigroup.



 This function returns the representatives of the components of the action of
the partial perm semigroup \mbox{\texttt{\mdseries\slshape S}} on the set of positive integers where it is defined. 

 The representatives are the least set of points such that every point can be
reached from some representative under the action of \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5, 6, 7, 8, 11, 12, 16, 19 ], |
  !gapprompt@>| !gapinput@    [ 9, 18, 20, 11, 5, 16, 8, 19, 14, 13, 1 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 14, 16, 18, 19, 20 ], |
  !gapprompt@>| !gapinput@    [ 13, 1, 8, 5, 4, 14, 11, 12, 9, 20, 2, 18, 7, 3, 19 ] ) );;|
  !gapprompt@gap>| !gapinput@ComponentRepsOfPartialPermSemigroup(S);|
  [ 1, 4, 6, 10, 15, 17 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ComponentsOfPartialPermSemigroup}}
\logpage{[ 4, 5, 20 ]}\nobreak
\hyperdef{L}{X8464BC397ACBF2F1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ComponentsOfPartialPermSemigroup({\mdseries\slshape S})\index{ComponentsOfPartialPermSemigroup@\texttt{ComponentsOfPartialPermSemigroup}}
\label{ComponentsOfPartialPermSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The components of a partial perm semigroup.



 This function returns the components of the action of the partial perm
semigroup \mbox{\texttt{\mdseries\slshape S}} on the set of positive integers where it is defined; the components of \mbox{\texttt{\mdseries\slshape S}} partition this set. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5, 6, 7, 8, 11, 12, 16, 19 ], |
  !gapprompt@>| !gapinput@    [ 9, 18, 20, 11, 5, 16, 8, 19, 14, 13, 1 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 14, 16, 18, 19, 20 ], |
  !gapprompt@>| !gapinput@    [ 13, 1, 8, 5, 4, 14, 11, 12, 9, 20, 2, 18, 7, 3, 19 ] ) );;|
  !gapprompt@gap>| !gapinput@ComponentsOfPartialPermSemigroup(S);|
  [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 19, 20 ], 
    [ 15 ], [ 17 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{CyclesOfPartialPerm}}
\logpage{[ 4, 5, 21 ]}\nobreak
\hyperdef{L}{X832937BB87EB4349}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CyclesOfPartialPerm({\mdseries\slshape x})\index{CyclesOfPartialPerm@\texttt{CyclesOfPartialPerm}}
\label{CyclesOfPartialPerm}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The cycles of a partial perm.



 This function returns the cycles, or strongly connected components, of the
action of the partial perm \mbox{\texttt{\mdseries\slshape x}} on the set of positive integers where it is defined. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@x := PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ], [ 3, 1, 4, 2, 5, 6, 7 ] );|
  [8,6][10,7](1,3,4,2)(5)
  !gapprompt@gap>| !gapinput@CyclesOfPartialPerm(x);|
  [ [ 3, 4, 2, 1 ], [ 5 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{CyclesOfPartialPermSemigroup}}
\logpage{[ 4, 5, 22 ]}\nobreak
\hyperdef{L}{X7F7A5E5E8355E230}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CyclesOfPartialPermSemigroup({\mdseries\slshape S})\index{CyclesOfPartialPermSemigroup@\texttt{CyclesOfPartialPermSemigroup}}
\label{CyclesOfPartialPermSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The cycles of a partial perm semigroup.



 This function returns the cycles, or strongly connected components, of the
action of the partial perm semigroup \mbox{\texttt{\mdseries\slshape S}} on the set of positive integers where it is defined. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5, 6, 7, 8, 11, 12, 16, 19 ], |
  !gapprompt@>| !gapinput@    [ 9, 18, 20, 11, 5, 16, 8, 19, 14, 13, 1 ] ), |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 14, 16, 18, 19, 20 ], |
  !gapprompt@>| !gapinput@    [ 13, 1, 8, 5, 4, 14, 11, 12, 9, 20, 2, 18, 7, 3, 19 ] ) );;|
  !gapprompt@gap>| !gapinput@CyclesOfPartialPermSemigroup(S);|
  [ [ 1, 9, 12, 14, 20, 2, 19, 3, 8, 11 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Normalizer (for a perm group, semigroup, record)}}
\logpage{[ 4, 5, 23 ]}\nobreak
\hyperdef{L}{X87C024AE814BC9D8}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Normalizer({\mdseries\slshape G, S[, opts]})\index{Normalizer@\texttt{Normalizer}!for a perm group, semigroup, record}
\label{Normalizer:for a perm group, semigroup, record}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Normalizer({\mdseries\slshape S[, opts]})\index{Normalizer@\texttt{Normalizer}!for a semigroup, record}
\label{Normalizer:for a semigroup, record}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A permutation group.



 In its first form, this function returns the normalizer of the transformation,
partial perm, or bipartition semigroup \mbox{\texttt{\mdseries\slshape S}} in the permutation group \mbox{\texttt{\mdseries\slshape G}}. In its second form, the normalizer of \mbox{\texttt{\mdseries\slshape S}} in the symmetric group on \texttt{[1..n]} where \texttt{n} is the degree of \mbox{\texttt{\mdseries\slshape S}} is returned.

 The \textsc{normalizer} of a transformation semigroup \mbox{\texttt{\mdseries\slshape S}} in a permutation group \mbox{\texttt{\mdseries\slshape G}} in the subgroup \texttt{H} of \mbox{\texttt{\mdseries\slshape G}} consisting of those elements in \texttt{g} in \mbox{\texttt{\mdseries\slshape G}} conjugating \mbox{\texttt{\mdseries\slshape S}} to \mbox{\texttt{\mdseries\slshape S}}, i.e. \texttt{\mbox{\texttt{\mdseries\slshape S}}\texttt{\symbol{94}}g=\mbox{\texttt{\mdseries\slshape S}}}. 

 Analogous definitions can be given for a partial perm and bipartition
semigroups.

 The method used by this operation is based on Section 3 in \cite{Araujo2010aa}.

 The optional final argument \mbox{\texttt{\mdseries\slshape opts}} allows you to specify various options, which determine how the normalizer is
calculated. The values of these options can dramatically change the time it
takes for this operation to complete. In different situations, different
options give the best performance. 

 The argument \mbox{\texttt{\mdseries\slshape opts}} should be a record, and the available options are: 
\begin{description}
\item[{random}]  If this option has the value \texttt{true} and the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/genss.html } {genss} package is loaded, then the non-deterministic algorithms in \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/genss.html } {genss} are used in \texttt{Normalizer}. So, there is some chance that \texttt{Normalizer} will return an incorrect result in this case, but these methods can also be
much faster than the deterministic algorithms which are used if this option is \texttt{false}. 

 If \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/genss.html } {genss} is not loaded, then this option is ignored. 

 The default value for this option is \texttt{false}. 
\item[{lambdastab}]  If this option has the value \texttt{true}, then \texttt{Normalizer} initially finds the setwise stabilizer of the images or right blocks of the
semigroup \mbox{\texttt{\mdseries\slshape S}}. Sometimes this improves the performance of \texttt{Normalizer} and sometimes it does not. If this option in \texttt{false}, then this setwise stabilizer is not found. 

 The default value for this option is \texttt{true}. 
\item[{rhostab}]  If this option has the value \texttt{true}, then \texttt{Normalizer} initially finds the setwise stabilizer of the kernels, domains, or left blocks
of the semigroup \mbox{\texttt{\mdseries\slshape S}}. Sometimes this improves the performance of \texttt{Normalizer} and sometimes it does not. If this option is \texttt{false}, the this setwise stabilizer is not found. 

 If \mbox{\texttt{\mdseries\slshape S}} is an inverse semigroup, then this option is ignored.

 The default value for this option is \texttt{true}. 
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=BrauerMonoid(8);|
  <regular bipartition monoid on 8 pts with 3 generators>
  !gapprompt@gap>| !gapinput@StructureDescription(Normalizer(S));|
  "S8"
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 5 ], [ 2, 5, 6, 3, 8 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 4, 7, 8 ], [ 3, 6, 2, 5, 7 ] ) );;|
  !gapprompt@gap>| !gapinput@Normalizer(S, rec(random:=true, lambdastab:=false));|
  #I  Have 33389 points.
  #I  Have 40136 points in new orbit.
  Group(())
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SmallestElementSemigroup}}
\logpage{[ 4, 5, 24 ]}\nobreak
\hyperdef{L}{X7C65202187A9C9F5}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallestElementSemigroup({\mdseries\slshape S})\index{SmallestElementSemigroup@\texttt{SmallestElementSemigroup}}
\label{SmallestElementSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LargestElementSemigroup({\mdseries\slshape S})\index{LargestElementSemigroup@\texttt{LargestElementSemigroup}}
\label{LargestElementSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A transformation.



 These attributes return the smallest and largest element of the transformation
semigroup \mbox{\texttt{\mdseries\slshape S}}, respectively. Smallest means the first element in the sorted set of elements
of \mbox{\texttt{\mdseries\slshape S}} and largest means the last element in the set of elements. 

 It is not necessary to find the elements of the semigroup to determine the
smallest or largest element, and this function has considerable better
performance than the equivalent \texttt{Elements(\mbox{\texttt{\mdseries\slshape S}})[1]} and \texttt{Elements(\mbox{\texttt{\mdseries\slshape S}})[Size(\mbox{\texttt{\mdseries\slshape S}})]}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := Monoid( |
  !gapprompt@>| !gapinput@[ Transformation( [ 1, 4, 11, 11, 7, 2, 6, 2, 5, 5, 10 ] ), |
  !gapprompt@>| !gapinput@  Transformation( [ 2, 4, 4, 2, 10, 5, 11, 11, 11, 6, 7 ] ) ] );|
  <transformation monoid on 11 pts with 2 generators>
  !gapprompt@gap>| !gapinput@SmallestElementSemigroup(S);|
  IdentityTransformation
  !gapprompt@gap>| !gapinput@LargestElementSemigroup(S);|
  Transformation( [ 11, 11, 10, 10, 7, 6, 5, 6, 2, 2, 4 ] )
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{GeneratorsSmallest (for a transformation
    semigroup)}}
\logpage{[ 4, 5, 25 ]}\nobreak
\hyperdef{L}{X83B3BBCD783B3408}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GeneratorsSmallest({\mdseries\slshape S})\index{GeneratorsSmallest@\texttt{GeneratorsSmallest}!for a transformation
    semigroup}
\label{GeneratorsSmallest:for a transformation
    semigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A generating set of transformations.



 \texttt{GeneratorsSmallest} returns the lexicographically least collection \texttt{X} of transformations such that \mbox{\texttt{\mdseries\slshape S}} is generated by \texttt{X} and each \texttt{X[i]} is not generated by \texttt{X[1], X[2], ..., X[i-1]}. 

 Note that it can be difficult to find this set of generators, and that it
might contain a substantial proportion of the elements of the semigroup. 

 The comparison of two transformation semigroups via the lexicographic
comparison of their sets of elements is the same relation as the lexicographic
comparison of their \texttt{GeneratorsSmallest}. However, due to the complexity of determining the \texttt{GeneratorsSmallest}, this is not the method used by the \textsf{Semigroups} package when comparing transformation semigroups. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := Monoid( |
  !gapprompt@>| !gapinput@Transformation( [ 1, 3, 4, 1 ] ), Transformation( [ 2, 4, 1, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 1, 1, 3 ] ), Transformation( [ 3, 3, 4, 1 ] ) );|
  <transformation monoid on 4 pts with 4 generators>
  !gapprompt@gap>| !gapinput@GeneratorsSmallest(S);|
  [ Transformation( [ 1, 1, 1, 1 ] ), Transformation( [ 1, 1, 1, 2 ] ), 
    Transformation( [ 1, 1, 1, 3 ] ), Transformation( [ 1, 1, 1 ] ), 
    Transformation( [ 1, 1, 2, 1 ] ), Transformation( [ 1, 1, 2, 2 ] ), 
    Transformation( [ 1, 1, 3, 1 ] ), Transformation( [ 1, 1, 3, 3 ] ), 
    Transformation( [ 1, 1 ] ), Transformation( [ 1, 1, 4, 1 ] ), 
    Transformation( [ 1, 2, 1, 1 ] ), Transformation( [ 1, 2, 2, 1 ] ), 
    IdentityTransformation, Transformation( [ 1, 3, 1, 1 ] ), 
    Transformation( [ 1, 3, 4, 1 ] ), Transformation( [ 2, 1, 1, 2 ] ), 
    Transformation( [ 2, 2, 2 ] ), Transformation( [ 2, 4, 1, 2 ] ), 
    Transformation( [ 3, 3, 3 ] ), Transformation( [ 3, 3, 4, 1 ] ) ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Further properties of semigroups}}\logpage{[ 4, 6, 0 ]}
\hyperdef{L}{X7CC47DE17B361189}{}
{
  In this section we describe the properties of a semigroup that can be
determined using the \textsf{Semigroups} package. 

 

\subsection{\textcolor{Chapter }{IsBand}}
\logpage{[ 4, 6, 1 ]}\nobreak
\hyperdef{L}{X7C8DB14587D1B55A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBand({\mdseries\slshape S})\index{IsBand@\texttt{IsBand}}
\label{IsBand}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 \texttt{IsBand} returns \texttt{true} if every element of the semigroup \mbox{\texttt{\mdseries\slshape S}} is an idempotent and \texttt{false} if it is not. An inverse semigroup is band if and only if it is a semilattice;
see \texttt{IsSemilatticeAsSemigroup} (\ref{IsSemilatticeAsSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 1, 1, 1, 4, 4, 4, 7, 7, 7, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 2, 2, 2, 5, 5, 5, 8, 8, 8, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 3, 6, 6, 6, 9, 9, 9, 3 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 1, 1, 4, 4, 4, 7, 7, 7, 4 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 1, 1, 4, 4, 4, 7, 7, 7, 7 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsBand(S);|
  true
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4, 8, 9 ], [ 5, 8, 7, 6, 9, 1 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 4, 7, 8, 9, 10 ], [ 2, 3, 8, 7, 10, 6, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@IsBand(S);|
  false
  !gapprompt@gap>| !gapinput@IsBand(IdempotentGeneratedSubsemigroup(S));|
  true
  !gapprompt@gap>| !gapinput@S:=PartitionMonoid(4);|
  <regular bipartition monoid on 4 pts with 4 generators>
  !gapprompt@gap>| !gapinput@M:=MinimalIdeal(S);|
  <simple bipartition semigroup ideal on 4 pts with 1 generator>
  !gapprompt@gap>| !gapinput@IsBand(M);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsBlockGroup}}
\logpage{[ 4, 6, 2 ]}\nobreak
\hyperdef{L}{X79659C467C8A7EBD}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBlockGroup({\mdseries\slshape S})\index{IsBlockGroup@\texttt{IsBlockGroup}}
\label{IsBlockGroup}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsSemigroupWithCommutingIdempotents({\mdseries\slshape S})\index{IsSemigroupWithCommutingIdempotents@\texttt{IsSemigroupWithCommutingIdempotents}}
\label{IsSemigroupWithCommutingIdempotents}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsBlockGroup} and \texttt{IsSemigroupWithCommutingIdempotents} return \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a block group and \texttt{false} if it is not.

 A semigroup \mbox{\texttt{\mdseries\slshape S}} is a \emph{block group} if every $\mathcal{L}$-class and every $\mathcal{R}$-class of \mbox{\texttt{\mdseries\slshape S}} contains at most one idempotent. Every semigroup of partial permutations is a
block group. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 5, 6, 7, 3, 1, 4, 2, 8 ] ),|
  !gapprompt@>| !gapinput@  Transformation( [ 3, 6, 8, 5, 7, 4, 2, 8 ] ));;|
  !gapprompt@gap>| !gapinput@IsBlockGroup(S);|
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 1, 10, 4, 5, 9, 7, 4, 8, 4 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 10, 7, 5, 6, 1, 3, 9, 7, 10, 2 ] ));;|
  !gapprompt@gap>| !gapinput@IsBlockGroup(S);|
  false
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2 ], [ 5, 4 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3 ], [ 1, 2, 5 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3 ], [ 2, 1, 5 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 4 ], [ 3, 1, 2 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 4, 5 ], [ 5, 4, 3, 2 ] ) );;|
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismBlockBijectionSemigroup(S));|
  <bipartition semigroup on 6 pts with 5 generators>
  !gapprompt@gap>| !gapinput@IsBlockGroup(T);|
  true
  !gapprompt@gap>| !gapinput@IsBlockGroup(Range(IsomorphismBipartitionSemigroup(S)));|
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -2 ], [ 2, -3 ], [ 3, -4 ], [ 4, -1 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -2 ], [ 2, -1 ], [ 3, -3 ], [ 4, -4 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, -3 ], [ 3, -1, -2 ], [ 4, -4 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ] ] ) );;|
  !gapprompt@gap>| !gapinput@IsBlockGroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsCommutativeSemigroup}}
\logpage{[ 4, 6, 3 ]}\nobreak
\hyperdef{L}{X843EFDA4807FDC31}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCommutativeSemigroup({\mdseries\slshape S})\index{IsCommutativeSemigroup@\texttt{IsCommutativeSemigroup}}
\label{IsCommutativeSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsCommutativeSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is commutative and \texttt{false} if it is not. The function \texttt{IsCommutative} (\textbf{Reference: IsCommutative}) can also be used to test if a semigroup is commutative. 

 A semigroup \mbox{\texttt{\mdseries\slshape S}} is \emph{commutative} if \texttt{x*y=y*x} for all \texttt{x,y} in \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 4, 5, 3, 7, 8, 6, 9, 1 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 3, 5, 6, 7, 8, 1, 9, 2, 4 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsCommutativeSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@IsCommutative(S);|
  true
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5, 6 ], [ 2, 5, 1, 3, 9, 6 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 6, 8 ], [ 8, 5, 7, 6, 2, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@IsCommutativeSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, 6, 7, -1, -4, -6 ], |
  !gapprompt@>| !gapinput@     [ 4, 5, 8, -2, -3, -5, -7, -8 ] ] ), |
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, 2, -3, -4 ], [ 3, -5 ], [ 4, -6 ], [ 5, -7 ], |
  !gapprompt@>| !gapinput@     [ 6, -8 ], [ 7, -1 ], [ 8, -2 ] ] ) );;|
  !gapprompt@gap>| !gapinput@IsCommutativeSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsCompletelyRegularSemigroup}}
\logpage{[ 4, 6, 4 ]}\nobreak
\hyperdef{L}{X7AFA23AF819FBF3D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCompletelyRegularSemigroup({\mdseries\slshape S})\index{IsCompletelyRegularSemigroup@\texttt{IsCompletelyRegularSemigroup}}
\label{IsCompletelyRegularSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsCompletelyRegularSemigroup} returns \texttt{true} if every element of the semigroup \mbox{\texttt{\mdseries\slshape S}} is contained in a subgroup of \mbox{\texttt{\mdseries\slshape S}}.

 An inverse semigroup is completely regular if and only if it is a Clifford
semigroup; see \texttt{IsCliffordSemigroup} (\ref{IsCliffordSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 1, 2, 4, 3, 6, 5, 4 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 5, 6, 3, 4, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 2, 1, 2, 2, 2, 2, 2 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsCompletelyRegularSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@IsInverseSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismPartialPermSemigroup(S));;|
  !gapprompt@gap>| !gapinput@IsCompletelyRegularSemigroup(T);|
  true
  !gapprompt@gap>| !gapinput@IsCliffordSemigroup(T);         |
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 3, -4 ], [ 2, 4, -1, -2 ], [ -3 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -1 ], [ 2, 3, 4, -3 ], [ -2, -4 ] ] ) );;|
  !gapprompt@gap>| !gapinput@IsCompletelyRegularSemigroup(S);|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsCongruenceFreeSemigroup}}
\logpage{[ 4, 6, 5 ]}\nobreak
\hyperdef{L}{X855088F378D8F5E1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCongruenceFreeSemigroup({\mdseries\slshape S})\index{IsCongruenceFreeSemigroup@\texttt{IsCongruenceFreeSemigroup}}
\label{IsCongruenceFreeSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsCongruenceFreeSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a congruence-free semigroup and \texttt{false} if it is not.

 A semigroup \mbox{\texttt{\mdseries\slshape S}} is \emph{congruence-free} if it has no non-trivial proper congruences.

 A semigroup with zero is congruence-free if and only if it is isomorphic to a
regular Rees 0-matrix semigroup \texttt{R} whose underlying semigroup is the trivial group, no two rows of the matrix of \texttt{R} are identical, and no two columns are identical; see Theorem 3.7.1 in \cite{howie}.

 A semigroup without zero is congruence-free if and only if it is a simple
group or has order 2; see Theorem 3.7.2 in \cite{howie}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := Semigroup( Transformation( [ 4, 2, 3, 3, 4 ] ) );;|
  !gapprompt@gap>| !gapinput@IsCongruenceFreeSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@S := Semigroup( Transformation( [ 2, 2, 4, 4 ] ),|
  !gapprompt@>| !gapinput@ Transformation( [ 5, 3, 4, 4, 6, 6 ] ) );;|
  !gapprompt@gap>| !gapinput@IsCongruenceFreeSemigroup(S);|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsGroupAsSemigroup}}
\logpage{[ 4, 6, 6 ]}\nobreak
\hyperdef{L}{X852F29E8795FA489}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsGroupAsSemigroup({\mdseries\slshape S})\index{IsGroupAsSemigroup@\texttt{IsGroupAsSemigroup}}
\label{IsGroupAsSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If the semigroup \mbox{\texttt{\mdseries\slshape S}} is actually a group, then \texttt{IsGroupAsSemigroup} returns \texttt{true}. If it is not a group, then \texttt{false} is returned. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 4, 5, 3, 7, 8, 6, 9, 1 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 3, 5, 6, 7, 8, 1, 9, 2, 4 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsGroupAsSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@G:=SymmetricGroup(5);;|
  !gapprompt@gap>| !gapinput@S:=Range(IsomorphismPartialPermSemigroup(G));|
  <inverse partial perm semigroup on 5 pts with 2 generators>
  !gapprompt@gap>| !gapinput@IsGroupAsSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@S:=SymmetricGroup([1,2,10]);;|
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismBlockBijectionSemigroup(|
  !gapprompt@>| !gapinput@Range(IsomorphismPartialPermSemigroup(S))));|
  <inverse bipartition semigroup on 11 pts with 2 generators>
  !gapprompt@gap>| !gapinput@IsGroupAsSemigroup(T);|
  true
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{IsIdempotentGenerated}}\logpage{[ 4, 6, 7 ]}
\hyperdef{L}{X835484C481CF3DDD}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsIdempotentGenerated({\mdseries\slshape S})\index{IsIdempotentGenerated@\texttt{IsIdempotentGenerated}}
\label{IsIdempotentGenerated}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsSemiBand({\mdseries\slshape S})\index{IsSemiBand@\texttt{IsSemiBand}}
\label{IsSemiBand}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsIdempotentGenerated} and \texttt{IsSemiBand} return \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is generated by its idempotents and \texttt{false} if it is not. See also \texttt{Idempotents} (\ref{Idempotents}) and \texttt{IdempotentGeneratedSubsemigroup} (\ref{IdempotentGeneratedSubsemigroup}). 

 An inverse semigroup is idempotent-generated if and only if it is a
semilattice; see \texttt{IsSemilatticeAsSemigroup} (\ref{IsSemilatticeAsSemigroup}).

 Semiband and idempotent-generated are synonymous in this context. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SingularTransformationSemigroup(4);|
  <regular transformation semigroup ideal on 4 pts with 1 generator>
  !gapprompt@gap>| !gapinput@IsIdempotentGenerated(S);|
  true
  !gapprompt@gap>| !gapinput@S:=SingularBrauerMonoid(5);|
  <regular bipartition semigroup ideal on 5 pts with 1 generator>
  !gapprompt@gap>| !gapinput@IsIdempotentGenerated(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsLeftSimple}}
\logpage{[ 4, 6, 8 ]}\nobreak
\hyperdef{L}{X8206D2B0809952EF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsLeftSimple({\mdseries\slshape S})\index{IsLeftSimple@\texttt{IsLeftSimple}}
\label{IsLeftSimple}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRightSimple({\mdseries\slshape S})\index{IsRightSimple@\texttt{IsRightSimple}}
\label{IsRightSimple}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsLeftSimple} and \texttt{IsRightSimple} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} has only one $\mathcal{L}$-class or one $\mathcal{R}$-class, respectively, and returns \texttt{false} if it has more than one. 

 An inverse semigroup is left simple if and only if it is right simple if and
only if it is a group; see \texttt{IsGroupAsSemigroup} (\ref{IsGroupAsSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 6, 7, 9, 6, 8, 9, 8, 7, 6 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 6, 8, 9, 6, 8, 8, 7, 9, 6 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 6, 8, 9, 7, 8, 8, 7, 9, 6 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 6, 9, 8, 6, 7, 9, 7, 8, 6 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 6, 9, 9, 6, 8, 8, 7, 9, 6 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 6, 9, 9, 7, 8, 8, 6, 9, 7 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 7, 8, 8, 7, 9, 9, 7, 8, 6 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 7, 9, 9, 7, 6, 9, 6, 8, 7 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 8, 7, 6, 9, 8, 6, 8, 7, 9 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 9, 6, 6, 7, 8, 8, 7, 6, 9 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 9, 6, 6, 7, 9, 6, 9, 8, 7 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 9, 6, 7, 9, 6, 6, 9, 7, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 9, 6, 8, 7, 9, 6, 9, 8, 7 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 9, 7, 6, 8, 7, 7, 9, 6, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 9, 7, 7, 8, 9, 6, 9, 7, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 9, 8, 8, 9, 6, 7, 6, 8, 9 ] ) );;|
  !gapprompt@gap>| !gapinput@IsRightSimple(S);|
  false
  !gapprompt@gap>| !gapinput@IsLeftSimple(S);|
  true
  !gapprompt@gap>| !gapinput@IsGroupAsSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@NrRClasses(S);|
  16
  !gapprompt@gap>| !gapinput@S:=BrauerMonoid(6);;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(RClass(S, Random(MinimalDClass(S))));;|
  !gapprompt@gap>| !gapinput@IsLeftSimple(S);|
  false
  !gapprompt@gap>| !gapinput@IsRightSimple(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsLeftZeroSemigroup}}
\logpage{[ 4, 6, 9 ]}\nobreak
\hyperdef{L}{X7E9261367C8C52C0}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsLeftZeroSemigroup({\mdseries\slshape S})\index{IsLeftZeroSemigroup@\texttt{IsLeftZeroSemigroup}}
\label{IsLeftZeroSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsLeftZeroSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a left zero semigroup and \texttt{false} if it is not. 

 A semigroup is a \emph{left zero semigroup} if \texttt{x*y=x} for all \texttt{x,y}. An inverse semigroup is a left zero semigroup if and only if it is trivial. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 1, 4, 3, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 3, 2, 3, 1, 1 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsRightZeroSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@gens:=[Transformation( [ 1, 2, 3, 3, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 2, 3, 3, 3 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsLeftZeroSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsMonogenicSemigroup}}
\logpage{[ 4, 6, 10 ]}\nobreak
\hyperdef{L}{X79D46BAB7E327AD1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMonogenicSemigroup({\mdseries\slshape S})\index{IsMonogenicSemigroup@\texttt{IsMonogenicSemigroup}}
\label{IsMonogenicSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsMonogenicSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is monogenic and it returns \texttt{false} if it is not. 

 A semigroup is \emph{monogenic} if it is generated by a single element. See also \texttt{IsMonogenicInverseSemigroup} (\ref{IsMonogenicInverseSemigroup}) and \texttt{IndexPeriodOfTransformation} (\textbf{Reference: IndexPeriodOfTransformation}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Transformation([ 2, 2, 2, 11, 10, 8, 10, 11, 2, 11, 10, 2, 11, 11, 10 ]),|
  !gapprompt@>| !gapinput@Transformation([ 2, 2, 2, 8, 11, 15, 11, 10, 2, 10, 11, 2, 10, 4, 7 ]), |
  !gapprompt@>| !gapinput@Transformation([ 2, 2, 2, 11, 10, 8, 10, 11, 2, 11, 10, 2, 11, 11, 10 ]),|
  !gapprompt@>| !gapinput@Transformation([ 2, 2, 12, 7, 8, 14, 8, 11, 2, 11, 10, 2, 11, 15, 4 ]));;|
  !gapprompt@gap>| !gapinput@IsMonogenicSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -2, -5, -7, -9 ], |
  !gapprompt@>| !gapinput@     [ -1, -10 ], [ -3, -4, -6, -8 ] ] ), |
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, 4, 7, 8, -2 ], [ 2, 3, 5, 10, -5 ], |
  !gapprompt@>| !gapinput@     [ 6, 9, -7, -9 ], [ -1, -10 ], [ -3, -4, -6, -8 ] ] ) );;|
  !gapprompt@gap>| !gapinput@IsMonogenicSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsMonoidAsSemigroup}}
\logpage{[ 4, 6, 11 ]}\nobreak
\hyperdef{L}{X7E4DEECD7CD9886D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMonoidAsSemigroup({\mdseries\slshape S})\index{IsMonoidAsSemigroup@\texttt{IsMonoidAsSemigroup}}
\label{IsMonoidAsSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsMonoidAsSemigroup} returns \texttt{true} if and only if the semigroup \mbox{\texttt{\mdseries\slshape S}} is mathematically a monoid but does belong to the category of monoids \texttt{IsMonoid} (\textbf{Reference: IsMonoid}) in \textsf{GAP} This is possible if the \texttt{MultiplicativeNeutralElement} (\textbf{Reference: MultiplicativeNeutralElement}) of \mbox{\texttt{\mdseries\slshape S}} is not equal to the \texttt{One} (\textbf{Reference: One}) of any element in \mbox{\texttt{\mdseries\slshape S}}. 

 A semigroup satisfying \texttt{IsMonoidAsSemigroup} does not possess the attributes of a monoid (such as, \texttt{GeneratorsOfMonoid} (\textbf{Reference: GeneratorsOfMonoid})).

 See also \texttt{One} (\textbf{Reference: One}), \texttt{IsInverseMonoid} (\textbf{Reference: IsInverseMonoid}) and \texttt{IsomorphismTransformationMonoid} (\textbf{Reference: IsomorphismTransformationMonoid}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 1, 4, 6, 2, 5, 3, 7, 8, 9, 9 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 6, 3, 2, 7, 5, 1, 8, 8, 9, 9 ] ) );;|
  !gapprompt@gap>| !gapinput@IsMonoidAsSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@IsMonoid(S);|
  false
  !gapprompt@gap>| !gapinput@MultiplicativeNeutralElement(S);|
  Transformation( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 9 ] )
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismBipartitionSemigroup(S));;|
  !gapprompt@gap>| !gapinput@IsMonoidAsSemigroup(T);|
  true
  !gapprompt@gap>| !gapinput@IsMonoid(T);|
  false
  !gapprompt@gap>| !gapinput@One(T);|
  fail
  !gapprompt@gap>| !gapinput@S:=Monoid(Transformation( [ 8, 2, 8, 9, 10, 6, 2, 8, 7, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 9, 2, 6, 3, 6, 4, 5, 5, 3, 2 ] ));;|
  !gapprompt@gap>| !gapinput@IsMonoidAsSemigroup(S);|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsOrthodoxSemigroup}}
\logpage{[ 4, 6, 12 ]}\nobreak
\hyperdef{L}{X7935C476808C8773}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsOrthodoxSemigroup({\mdseries\slshape S})\index{IsOrthodoxSemigroup@\texttt{IsOrthodoxSemigroup}}
\label{IsOrthodoxSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsOrthodoxSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is orthodox and \texttt{false} if it is not.

 A semigroup is \emph{orthodox} if it is regular and its idempotent elements form a subsemigroup. Every
inverse semigroup is also an orthodox semigroup. 

 See also \texttt{IsRegularSemigroup} (\ref{IsRegularSemigroup}) and \texttt{IsRegularSemigroup} (\textbf{Reference: IsRegularSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 1, 1, 1, 4, 5, 4 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 3, 1, 1, 2 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 3, 1, 1, 3 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 5, 5, 5, 5, 5, 5 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsOrthodoxSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup(GeneratorsOfSemigroup(DualSymmetricInverseMonoid(5)));;|
  !gapprompt@gap>| !gapinput@IsOrthodoxSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsRectangularBand}}
\logpage{[ 4, 6, 13 ]}\nobreak
\hyperdef{L}{X7E9B674D781B072C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRectangularBand({\mdseries\slshape S})\index{IsRectangularBand@\texttt{IsRectangularBand}}
\label{IsRectangularBand}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsRectangularBand} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a rectangular band and \texttt{false} if it is not.

 A semigroup \mbox{\texttt{\mdseries\slshape S}} is a \emph{rectangular band} if for all $x, y, z$ in \mbox{\texttt{\mdseries\slshape S}} we have that $x^2 = x$ and $xyz = xz$.

 Equivalently, \mbox{\texttt{\mdseries\slshape S}} is a \emph{rectangular band} if \mbox{\texttt{\mdseries\slshape S}} is isomorphic to a semigroup of the form $I \times \Lambda$ with multiplication $(i,\lambda)(j,\mu) = (i,\mu)$. In this case, \mbox{\texttt{\mdseries\slshape S}} is called an $|I| \times |\Lambda|$ \emph{rectangular band}.

 An inverse semigroup is a rectangular band if and only if it is a group. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 1, 1, 1, 4, 4, 4, 7, 7, 7, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 2, 2, 2, 5, 5, 5, 8, 8, 8, 2 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 3, 6, 6, 6, 9, 9, 9, 3 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 1, 1, 4, 4, 4, 7, 7, 7, 4 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 1, 1, 4, 4, 4, 7, 7, 7, 7 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsRectangularBand(S);|
  true
  !gapprompt@gap>| !gapinput@IsRectangularBand(MinimalIdeal(PartitionMonoid(4)));|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsRegularSemigroup}}
\logpage{[ 4, 6, 14 ]}\nobreak
\hyperdef{L}{X7C4663827C5ACEF1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRegularSemigroup({\mdseries\slshape S})\index{IsRegularSemigroup@\texttt{IsRegularSemigroup}}
\label{IsRegularSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsRegularSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is regular and \texttt{false} if it is not. 

 A semigroup \texttt{S} is \emph{regular} if for all \texttt{x} in \texttt{S} there exists \texttt{y} in \texttt{S} such that \texttt{x*y*x=x}. Every inverse semigroup is regular, and a semigroup of partial permutations
is regular if and only if it is an inverse semigroup.

 See also \texttt{IsRegularDClass} (\textbf{Reference: IsRegularDClass}), \texttt{IsRegularClass} (\ref{IsRegularClass}), and \texttt{IsRegularSemigroupElement} (\textbf{Reference: IsRegularSemigroupElement}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@IsRegularSemigroup(FullTransformationSemigroup(5));|
  true
  !gapprompt@gap>| !gapinput@IsRegularSemigroup(JonesMonoid(5));|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsRightZeroSemigroup}}
\logpage{[ 4, 6, 15 ]}\nobreak
\hyperdef{L}{X7CB099958658F979}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRightZeroSemigroup({\mdseries\slshape S})\index{IsRightZeroSemigroup@\texttt{IsRightZeroSemigroup}}
\label{IsRightZeroSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsRightZeroSemigroup} returns \texttt{true} if the \mbox{\texttt{\mdseries\slshape S}} is a right zero semigroup and \texttt{false} if it is not.

 A semigroup \texttt{S} is a \emph{right zero semigroup} if \texttt{x*y=y} for all \texttt{x,y} in \texttt{S}. An inverse semigroup is a right zero semigroup if and only if it is trivial. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@gens:=[ Transformation( [ 2, 1, 4, 3, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 3, 2, 3, 1, 1 ] ) ];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsRightZeroSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@gens:=[Transformation( [ 1, 2, 3, 3, 1 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 2, 4, 4, 1 ] )];;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(gens);;|
  !gapprompt@gap>| !gapinput@IsRightZeroSemigroup(S);|
  true
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{IsXTrivial}}\logpage{[ 4, 6, 16 ]}
\hyperdef{L}{X8752642C7F7E512B}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRTrivial({\mdseries\slshape S})\index{IsRTrivial@\texttt{IsRTrivial}}
\label{IsRTrivial}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsLTrivial({\mdseries\slshape S})\index{IsLTrivial@\texttt{IsLTrivial}}
\label{IsLTrivial}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsHTrivial({\mdseries\slshape S})\index{IsHTrivial@\texttt{IsHTrivial}}
\label{IsHTrivial}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsDTrivial({\mdseries\slshape S})\index{IsDTrivial@\texttt{IsDTrivial}}
\label{IsDTrivial}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsAperiodicSemigroup({\mdseries\slshape S})\index{IsAperiodicSemigroup@\texttt{IsAperiodicSemigroup}}
\label{IsAperiodicSemigroup}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCombinatorialSemigroup({\mdseries\slshape S})\index{IsCombinatorialSemigroup@\texttt{IsCombinatorialSemigroup}}
\label{IsCombinatorialSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsXTrivial} returns \texttt{true} if Green's $\mathcal{R}$-relation, $\mathcal{L}$-relation, $\mathcal{H}$-relation, $\mathcal{D}$-relation, respectively, on the semigroup \mbox{\texttt{\mdseries\slshape S}} is trivial and \texttt{false} if it is not. These properties can also be applied to a Green's class instead
of a semigroup where applicable. 

 For inverse semigroups, the properties of being $\mathcal{R}$-trivial, $\mathcal{L}$-trivial, $\mathcal{D}$-trivial, and a semilattice are equivalent; see \texttt{IsSemilatticeAsSemigroup} (\ref{IsSemilatticeAsSemigroup}). 

 A semigroup is \emph{aperiodic} if its contains no non-trivial subgroups (equivalently, all of its group $\mathcal{H}$-classes are trivial). A finite semigroup is aperiodic if and only if it is $\mathcal{H}$-trivial. 

 \emph{Combinatorial} is a synonym for aperiodic in this context. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 1, 5, 1, 3, 7, 10, 6, 2, 7, 10 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 4, 4, 5, 6, 7, 7, 7, 4, 3, 10 ] ) );;|
  !gapprompt@gap>| !gapinput@IsHTrivial(S);|
  true
  !gapprompt@gap>| !gapinput@Size(S);|
  108
  !gapprompt@gap>| !gapinput@IsRTrivial(S);|
  false
  !gapprompt@gap>| !gapinput@IsLTrivial(S);|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsSemilatticeAsSemigroup}}
\logpage{[ 4, 6, 17 ]}\nobreak
\hyperdef{L}{X7BF9F1BE87F0636D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsSemilatticeAsSemigroup({\mdseries\slshape S})\index{IsSemilatticeAsSemigroup@\texttt{IsSemilatticeAsSemigroup}}
\label{IsSemilatticeAsSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsSemilatticeAsSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a semilattice and \texttt{false} if it is not. 

 A semigroup is a \emph{semilattice} if it is commutative and every element is an idempotent. The idempotents of an
inverse semigroup form a semilattice. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 5, 1, 7, 3, 7, 7 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 6, 5, 7, 2, 1, 7 ] ) );;                    |
  !gapprompt@gap>| !gapinput@Size(S);|
  631
  !gapprompt@gap>| !gapinput@IsInverseSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@A:=Semigroup(Idempotents(S)); |
  <transformation semigroup on 7 pts with 32 generators>
  !gapprompt@gap>| !gapinput@IsSemilatticeAsSemigroup(A);|
  true
  !gapprompt@gap>| !gapinput@S:=FactorisableDualSymmetricInverseSemigroup(5);;|
  !gapprompt@gap>| !gapinput@S:=IdempotentGeneratedSubsemigroup(S);;|
  !gapprompt@gap>| !gapinput@IsSemilatticeAsSemigroup(S);|
  true
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{IsSimpleSemigroup}}\logpage{[ 4, 6, 18 ]}
\hyperdef{L}{X836F4692839F4874}{}
{
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsSimpleSemigroup({\mdseries\slshape S})\index{IsSimpleSemigroup@\texttt{IsSimpleSemigroup}}
\label{IsSimpleSemigroup}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCompletelySimpleSemigroup({\mdseries\slshape S})\index{IsCompletelySimpleSemigroup@\texttt{IsCompletelySimpleSemigroup}}
\label{IsCompletelySimpleSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsSimpleSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is simple and \texttt{false} if it is not.

 A semigroup is \emph{simple} if it has no proper 2-sided ideals. A semigroup is \emph{completely simple} if it is simple and possesses minimal left and right ideals. A finite
semigroup is simple if and only if it is completely simple. An inverse
semigroup is simple if and only if it is a group. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@ Transformation( [ 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 2 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 3 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 7, 3, 9, 5, 11, 7, 1, 9, 3, 11, 5, 5 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 7, 7, 9, 9, 11, 11, 1, 1, 3, 3, 5, 5, 7 ] ) );;|
  !gapprompt@gap>| !gapinput@IsSimpleSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@IsCompletelySimpleSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@IsSimpleSemigroup(MinimalIdeal(BrauerMonoid(6)));|
  true
  !gapprompt@gap>| !gapinput@R:=Range(IsomorphismReesMatrixSemigroup(|
  !gapprompt@>| !gapinput@MinimalIdeal(BrauerMonoid(6))));|
  <Rees matrix semigroup 15x15 over Group(())>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsSynchronizingSemigroup}}
\logpage{[ 4, 6, 19 ]}\nobreak
\hyperdef{L}{X84A1B84180811785}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsSynchronizingSemigroup({\mdseries\slshape S[, n]})\index{IsSynchronizingSemigroup@\texttt{IsSynchronizingSemigroup}}
\label{IsSynchronizingSemigroup}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsSynchronizingTransformationCollection({\mdseries\slshape coll[, n]})\index{IsSynchronizingTransformationCollection@\texttt{IsSynchronizing}\-\texttt{Transformation}\-\texttt{Collection}}
\label{IsSynchronizingTransformationCollection}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 For a positive integer \mbox{\texttt{\mdseries\slshape n}}, \texttt{IsSynchronizingSemigroup} returns \texttt{true} if the semigroup of transformations \mbox{\texttt{\mdseries\slshape S}} contains a transformation with constant value on \texttt{[1..\mbox{\texttt{\mdseries\slshape n}}]}. Note that this function will return true whenever \texttt{\mbox{\texttt{\mdseries\slshape n}} = 1}. See also \texttt{ConstantTransformation} (\textbf{Reference: ConstantTransformation}). 

 If the optional second argument is not specified, then \mbox{\texttt{\mdseries\slshape n}} will be taken to be the value of \texttt{DegreeOfTransformationSemigroup} (\textbf{Reference: DegreeOfTransformationSemigroup}) for \mbox{\texttt{\mdseries\slshape S}}. 

 The operation \texttt{IsSynchronizingTransformationCollection} behaves in the same way as \texttt{IsSynchronizingSemigroup} but can be applied to any collection of transformations and not only
semigroups. 

 Note that the semigroup consisting of the identity transformation has degree \texttt{0}, and for this special case the function \texttt{IsSynchronizingSemigroup} will return \texttt{false}.

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 1, 1, 8, 7, 6, 6, 4, 1, 8, 9 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 5, 8, 7, 6, 10, 8, 7, 6, 9, 7 ] ) );;|
  !gapprompt@gap>| !gapinput@IsSynchronizingSemigroup(S, 10);|
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 3, 8, 1, 1, 9, 9, 8, 7, 9, 6 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 7, 6, 8, 7, 5, 6, 8, 7, 8, 9 ] ) );;|
  !gapprompt@gap>| !gapinput@IsSynchronizingSemigroup(S, 10);|
  false
  !gapprompt@gap>| !gapinput@Representative(MinimalIdeal(S));|
  Transformation( [ 7, 8, 8, 7, 8, 8, 8, 7, 8, 8 ] )
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsZeroGroup}}
\logpage{[ 4, 6, 20 ]}\nobreak
\hyperdef{L}{X85F7E5CD86F0643B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsZeroGroup({\mdseries\slshape S})\index{IsZeroGroup@\texttt{IsZeroGroup}}
\label{IsZeroGroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsZeroGroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a zero group and \texttt{false} if it is not.

 A semigroup \texttt{S} is a \emph{zero group} if there exists an element \texttt{z} in \texttt{S} such that \texttt{S} without \texttt{z} is a group and \texttt{x*z=z*x=z} for all \texttt{x} in \texttt{S}. Every zero group is an inverse semigroup. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 2, 3, 4, 6, 8, 5, 5, 9 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 8, 2, 5, 6, 4, 4, 9 ] ),|
  !gapprompt@>| !gapinput@ConstantTransformation(9, 9));;|
  !gapprompt@gap>| !gapinput@IsZeroGroup(S);|
  true
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismPartialPermSemigroup(S));;|
  !gapprompt@gap>| !gapinput@IsZeroGroup(T);|
  true
  !gapprompt@gap>| !gapinput@IsZeroGroup(JonesMonoid(2));|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsZeroRectangularBand}}
\logpage{[ 4, 6, 21 ]}\nobreak
\hyperdef{L}{X7C6787D07B95B450}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsZeroRectangularBand({\mdseries\slshape S})\index{IsZeroRectangularBand@\texttt{IsZeroRectangularBand}}
\label{IsZeroRectangularBand}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsZeroRectangularBand} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a zero rectangular band and \texttt{false} if it is not.

 A semigroup is a \emph{0-rectangular band} if it is 0-simple and $\mathcal{H}$-trivial; see also \texttt{IsZeroSimpleSemigroup} (\ref{IsZeroSimpleSemigroup}) and \texttt{IsHTrivial} (\ref{IsHTrivial}). An inverse semigroup is a 0-rectangular band if and only if it is a 0-group;
see \texttt{IsZeroGroup} (\ref{IsZeroGroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 3, 7, 9, 1, 12, 13, 1, 15, 9, 1, 18, 1, 1, 13, |
  !gapprompt@>| !gapinput@     1, 1, 21, 1, 1, 1, 1, 1, 25, 26, 1 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 1, 5, 1, 5, 11, 1, 1, 14, 1, 16, 17, 1, 1, 19, 1, |
  !gapprompt@>| !gapinput@     11, 1, 1, 1, 23, 1, 16, 19, 1, 1, 1 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 1, 4, 8, 1, 10, 1, 8, 1, 1, 1, 10, 1, 8, 10, 1, 1, |
  !gapprompt@>| !gapinput@     20, 1, 22, 1, 8, 1, 1, 1, 1, 1 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 1, 6, 6, 1, 1, 1, 6, 1, 1, 1, 1, 1, 6, 1, 6, 1, 1, |
  !gapprompt@>| !gapinput@     6, 1, 1, 24, 1, 1, 1, 1, 6 ] ) );;|
  !gapprompt@gap>| !gapinput@IsZeroRectangularBand(Semigroup(Elements(GreensDClasses(S)[7]))); |
  true
  !gapprompt@gap>| !gapinput@IsZeroRectangularBand(Semigroup(Elements(GreensDClasses(S)[1])));|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsZeroSemigroup}}
\logpage{[ 4, 6, 22 ]}\nobreak
\hyperdef{L}{X81A1882181B75CC9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsZeroSemigroup({\mdseries\slshape S})\index{IsZeroSemigroup@\texttt{IsZeroSemigroup}}
\label{IsZeroSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsZeroSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a zero semigroup and \texttt{false} if it is not.

 A semigroup \texttt{S} is a \emph{zero semigroup} if there exists an element \texttt{z} in \texttt{S} such that \texttt{x*y=z} for all \texttt{x,y} in \texttt{S}. An inverse semigroup is a zero semigroup if and only if it is trivial. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 4, 7, 6, 3, 1, 5, 3, 6, 5, 9 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 5, 3, 5, 1, 9, 3, 8, 7, 4, 3 ] ) );;|
  !gapprompt@gap>| !gapinput@IsZeroSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 7, 8, 8, 8, 5, 8, 8, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 8, 8, 8, 8, 5, 7, 8, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 8, 7, 8, 8, 5, 8, 8, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 8, 8, 8, 7, 5, 8, 8, 8 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 8, 8, 7, 8, 5, 8, 8, 8 ] ) );;|
  !gapprompt@gap>| !gapinput@IsZeroSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  Transformation( [ 8, 8, 8, 8, 5, 8, 8, 8 ] )
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsZeroSimpleSemigroup}}
\logpage{[ 4, 6, 23 ]}\nobreak
\hyperdef{L}{X8193A60F839C064E}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsZeroSimpleSemigroup({\mdseries\slshape S})\index{IsZeroSimpleSemigroup@\texttt{IsZeroSimpleSemigroup}}
\label{IsZeroSimpleSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsZeroSimpleSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is 0-simple and \texttt{false} if it is not.

 A semigroup is a \emph{0-simple} if it has no two-sided ideals other than itself and the set containing the
zero element; see also \texttt{MultiplicativeZero} (\ref{MultiplicativeZero}). An inverse semigroup is 0-simple if and only if it is a Brandt semigroup;
see \texttt{IsBrandtSemigroup} (\ref{IsBrandtSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 17, |
  !gapprompt@>| !gapinput@ 17, 17, 17, 17, 17 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 17, 17, 17, 11, 17, 17, 17, 17, 17, 17, 17, |
  !gapprompt@>| !gapinput@ 17, 17, 17, 17, 17 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 17, 17, 17, 17, 17, 17, 17, 17, 17, 4, 17, |
  !gapprompt@>| !gapinput@ 17, 17, 17, 17, 17 ] ), |
  !gapprompt@>| !gapinput@ Transformation( [ 1, 17, 17, 5, 17, 17, 17, 17, 17, 17, 17, 17, |
  !gapprompt@>| !gapinput@ 17, 17, 17, 17, 17 ] ));;|
  !gapprompt@gap>| !gapinput@IsZeroSimpleSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Transformation( [ 2, 3, 4, 5, 1, 8, 7, 6, 2, 7 ] ),|
  !gapprompt@>| !gapinput@Transformation([ 2, 3, 4, 5, 6, 8, 7, 1, 2, 2 ] ));;|
  !gapprompt@gap>| !gapinput@IsZeroSimpleSemigroup(S);|
  false
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Properties and attributes of inverse semigroups}}\logpage{[ 4, 7, 0 ]}
\hyperdef{L}{X807F8A477A929076}{}
{
  In this section we describe properties and attributes specific to inverse
semigroups that can be determined using \textsf{Semigroups}.

 The functions 
\begin{itemize}
\item \texttt{IsJoinIrreducible} (\ref{IsJoinIrreducible})
\item \texttt{IsMajorantlyClosed} (\ref{IsMajorantlyClosed})
\item \texttt{JoinIrreducibleDClasses} (\ref{JoinIrreducibleDClasses})
\item \texttt{MajorantClosure} (\ref{MajorantClosure})
\item \texttt{Minorants} (\ref{Minorants})
\item \texttt{RightCosetsOfInverseSemigroup} (\ref{RightCosetsOfInverseSemigroup})
\item \texttt{SmallerDegreePartialPermRepresentation} (\ref{SmallerDegreePartialPermRepresentation})
\item \texttt{VagnerPrestonRepresentation} (\ref{VagnerPrestonRepresentation})
\end{itemize}
 were written by Wilf Wilson and Robert Hancock. 

 The function \texttt{CharacterTableOfInverseSemigroup} (\ref{CharacterTableOfInverseSemigroup}) was written by Jhevon Smith and Ben Steinberg. 

\subsection{\textcolor{Chapter }{IsCliffordSemigroup}}
\logpage{[ 4, 7, 1 ]}\nobreak
\hyperdef{L}{X81DE11987BB81017}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsCliffordSemigroup({\mdseries\slshape S})\index{IsCliffordSemigroup@\texttt{IsCliffordSemigroup}}
\label{IsCliffordSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsCliffordSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is regular and its idempotents are central, and \texttt{false} if it is not. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( Transformation( [ 1, 2, 4, 5, 6, 3, 7, 8 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 4, 5, 6, 2, 7, 8 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 1, 2, 5, 3, 6, 8, 4, 4 ] ) );;|
  !gapprompt@gap>| !gapinput@IsCliffordSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismPartialPermSemigroup(S));;|
  !gapprompt@gap>| !gapinput@IsCliffordSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(5);;|
  !gapprompt@gap>| !gapinput@T:=IdempotentGeneratedSubsemigroup(S);;|
  !gapprompt@gap>| !gapinput@IsCliffordSemigroup(T);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsBrandtSemigroup}}
\logpage{[ 4, 7, 2 ]}\nobreak
\hyperdef{L}{X7EFDBA687DCDA6FA}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBrandtSemigroup({\mdseries\slshape S})\index{IsBrandtSemigroup@\texttt{IsBrandtSemigroup}}
\label{IsBrandtSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsBrandtSemigroup} return \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is a 0-simple inverse semigroup, and \texttt{false} if it is not. See also \texttt{IsZeroSimpleSemigroup} (\ref{IsZeroSimpleSemigroup}) and \texttt{IsInverseSemigroup} (\textbf{Reference: IsInverseSemigroup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 8, 8, 8, 8, 8, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 5, 8, 8, 8, 8, 8, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 8, 3, 8, 8, 8, 8, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 8, 6, 8, 8, 8, 8, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 8, 8, 1, 8, 8, 8, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 8, 8, 8, 1, 8, 8, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 8, 8, 8, 8, 4, 8, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 8, 8, 8, 8, 8, 7, 8, 8 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 8, 8, 8, 8, 8, 8, 2, 8 ] ));;|
  !gapprompt@gap>| !gapinput@IsBrandtSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismPartialPermSemigroup(S));;|
  !gapprompt@gap>| !gapinput@IsBrandtSemigroup(T);|
  true
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(4);;|
  !gapprompt@gap>| !gapinput@D:=DClasses(S)[3];|
  {Bipartition( [ [ 1, 2, 3, -1, -2, -3 ], [ 4, -4 ] ] )}
  !gapprompt@gap>| !gapinput@R:=InjectionPrincipalFactor(D);;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(PreImages(R, GeneratorsOfSemigroup(Range(R))));;|
  !gapprompt@gap>| !gapinput@IsBrandtSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsEUnitaryInverseSemigroup}}
\logpage{[ 4, 7, 3 ]}\nobreak
\hyperdef{L}{X843EA0E37C968BBF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsEUnitaryInverseSemigroup({\mdseries\slshape S})\index{IsEUnitaryInverseSemigroup@\texttt{IsEUnitaryInverseSemigroup}}
\label{IsEUnitaryInverseSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 As described in Section 5.9 of \cite{howie}, an inverse semigroup \mbox{\texttt{\mdseries\slshape S}} with semilattice of idempotents \mbox{\texttt{\mdseries\slshape E}} is \emph{E-unitary} if for  
\[ s \in S\textrm{ and }e \in E\textrm{: }es \in E \Rightarrow s \in E. \]
  

 Equivalently, \mbox{\texttt{\mdseries\slshape S}} is \emph{E-unitary} if \mbox{\texttt{\mdseries\slshape E}} is closed in the natural partial order (see Proposition 5.9.1 in \cite{howie}):  
\[ \textrm{for } s \in S\textrm{ and }e \in E\textrm{: }e \le s \Rightarrow s \in
E. \]
  

 This condition is equivalent to \mbox{\texttt{\mdseries\slshape E}} being majorantly closed in \mbox{\texttt{\mdseries\slshape S}}. See \texttt{IdempotentGeneratedSubsemigroup} (\ref{IdempotentGeneratedSubsemigroup}) and \texttt{IsMajorantlyClosed} (\ref{IsMajorantlyClosed}). Hence an inverse semigroup of partial permutations, block bijections or
partial permutation bipartitions is \emph{E-unitary} if and only if the idempotent semilattice is majorantly closed. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( [ PartialPerm( [ 1, 2, 3, 4 ], [ 2, 3, 1, 6 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 5 ], [ 3, 2, 1, 6 ] ) ]);;|
  !gapprompt@gap>| !gapinput@IsEUnitaryInverseSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@e:=IdempotentGeneratedSubsemigroup(S);;|
  !gapprompt@gap>| !gapinput@ForAll(Difference(S,e), x->not ForAny(e, y->y*x in e));|
  true
  !gapprompt@gap>| !gapinput@T:=InverseSemigroup( [ |
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 3, 4, 6, 8 ], [ 2, 5, 10, 7, 9 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 5, 6, 7, 8 ], [ 5, 8, 9, 2, 10, 1, 3 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 5, 6, 7, 9 ], [ 9, 8, 4, 1, 6, 7, 2 ] ) ]);;|
  !gapprompt@gap>| !gapinput@IsEUnitaryInverseSemigroup(T);|
  false
  !gapprompt@gap>| !gapinput@U:=InverseSemigroup( [|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5 ], [ 2, 3, 4, 5, 1 ] ),|
  !gapprompt@>| !gapinput@ PartialPerm( [ 1, 2, 3, 4, 5 ], [ 2, 1, 3, 4, 5 ] ) ]);;|
  !gapprompt@gap>| !gapinput@IsEUnitaryInverseSemigroup(U);|
  true
  !gapprompt@gap>| !gapinput@IsGroupAsSemigroup(U);|
  true
  !gapprompt@gap>| !gapinput@StructureDescription(U);|
  "S5"
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsFactorisableSemigroup}}
\logpage{[ 4, 7, 4 ]}\nobreak
\hyperdef{L}{X862158348720781D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFactorisableSemigroup({\mdseries\slshape S})\index{IsFactorisableSemigroup@\texttt{IsFactorisableSemigroup}}
\label{IsFactorisableSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 An inverse monoid is \emph{factorisable} if every element is the product of an element of the group of units and an
idempotent; see also \texttt{GroupOfUnits} (\ref{GroupOfUnits}) and \texttt{Idempotents} (\ref{Idempotents}). Hence an inverse semigroup of partial permutations is factorisable if and
only if each of its generators is the restriction of some element in the group
of units. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup( PartialPerm( [ 1, 2, 4 ], [ 3, 1, 4 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 5 ], [ 4, 1, 5, 2 ] ) );;|
  !gapprompt@gap>| !gapinput@IsFactorisableSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@IsFactorisableSemigroup(SymmetricInverseSemigroup(5)); |
  true
  !gapprompt@gap>| !gapinput@IsFactorisableSemigroup(DualSymmetricInverseMonoid(5));|
  false
  !gapprompt@gap>| !gapinput@IsFactorisableSemigroup(FactorisableDualSymmetricInverseSemigroup(5));|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsJoinIrreducible}}
\logpage{[ 4, 7, 5 ]}\nobreak
\hyperdef{L}{X817F9F3984FC842C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsJoinIrreducible({\mdseries\slshape S, x})\index{IsJoinIrreducible@\texttt{IsJoinIrreducible}}
\label{IsJoinIrreducible}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} or \texttt{false}. 



 \texttt{IsJoinIrreducible} determines whether an element \mbox{\texttt{\mdseries\slshape x}} of an inverse semigroup \mbox{\texttt{\mdseries\slshape S}} of partial permutations, block bijections or partial permutation bipartitions
is join irreducible.

 An element \mbox{\texttt{\mdseries\slshape x}} is \emph{join irreducible} when it is not the least upper bound (with respect to the natural partial
order \texttt{NaturalLeqPartialPerm} (\textbf{Reference: NaturalLeqPartialPerm})) of any subset of \mbox{\texttt{\mdseries\slshape S}} not containing \mbox{\texttt{\mdseries\slshape x}}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(3);|
  <symmetric inverse semigroup on 3 pts>
  !gapprompt@gap>| !gapinput@x:=PartialPerm([1,2,3]);|
  <identity partial perm on [ 1, 2, 3 ]>
  !gapprompt@gap>| !gapinput@IsJoinIrreducible(S, x);|
  false
  !gapprompt@gap>| !gapinput@T:=InverseSemigroup(PartialPerm([1,2,4,3]), PartialPerm([1]),|
  !gapprompt@>| !gapinput@PartialPerm([0,2]));|
  <inverse partial perm semigroup on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@y:=PartialPerm([1,2,3,4]);|
  <identity partial perm on [ 1, 2, 3, 4 ]>
  !gapprompt@gap>| !gapinput@IsJoinIrreducible(T, y);|
  true
  !gapprompt@gap>| !gapinput@B:=InverseSemigroup([|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -5 ], [ 2, -2 ], |
  !gapprompt@>| !gapinput@   [ 3, 5, 6, 7, -1, -4, -6, -7 ], [ 4, -3 ] ] ),|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -1 ], [ 2, -3 ], [ 3, -4 ], |
  !gapprompt@>| !gapinput@   [ 4, 5, 7, -2, -6, -7 ], [ 6, -5 ] ] ),|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -2 ], [ 2, -4 ], [ 3, -6 ], |
  !gapprompt@>| !gapinput@   [ 4, -1 ], [ 5, 7, -3, -7 ], [ 6, -5 ] ] ),|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -5 ], [ 2, -1 ], [ 3, -6 ], |
  !gapprompt@>| !gapinput@   [ 4, 5, 7, -2, -4, -7 ], [ 6, -3 ] ] )]);|
  <inverse bipartition semigroup on 7 pts with 4 generators>
  !gapprompt@gap>| !gapinput@x:=Bipartition( [ [ 1, 2, 3, 5, 6, 7, -2, -3, -4, -5, -6, -7 ], |
  !gapprompt@>| !gapinput@[ 4, -1 ] ] );|
  <block bijection: [ 1, 2, 3, 5, 6, 7, -2, -3, -4, -5, -6, -7 ], 
   [ 4, -1 ]>
  !gapprompt@gap>| !gapinput@IsJoinIrreducible(B, x);|
  true
  !gapprompt@gap>| !gapinput@IsJoinIrreducible(B, B.1);|
  false
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{IsMajorantlyClosed}}
\logpage{[ 4, 7, 6 ]}\nobreak
\hyperdef{L}{X81E6D24F852A7937}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMajorantlyClosed({\mdseries\slshape S, T})\index{IsMajorantlyClosed@\texttt{IsMajorantlyClosed}}
\label{IsMajorantlyClosed}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} or \texttt{false}. 



 \texttt{IsMajorantlyClosed} determines whether the subset \mbox{\texttt{\mdseries\slshape T}} of the inverse semigroup of partial permutations, block bijections or partial
permutation bipartitions \mbox{\texttt{\mdseries\slshape S}} is majorantly closed in \mbox{\texttt{\mdseries\slshape S}}. See also \texttt{MajorantClosure} (\ref{MajorantClosure}).

 We say that \mbox{\texttt{\mdseries\slshape T}} is \emph{majorantly closed} in \mbox{\texttt{\mdseries\slshape S}} if it contains all elements of \mbox{\texttt{\mdseries\slshape S}} which are greater than or equal to any element of \mbox{\texttt{\mdseries\slshape T}}, with respect to the natural partial order. See \texttt{NaturalLeqPartialPerm} (\textbf{Reference: NaturalLeqPartialPerm}).

 Note that \mbox{\texttt{\mdseries\slshape T}} can be a subset of \mbox{\texttt{\mdseries\slshape S}} or a subsemigroup of \mbox{\texttt{\mdseries\slshape S}}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(2);|
  <symmetric inverse semigroup on 2 pts>
  !gapprompt@gap>| !gapinput@T:=[Elements(S)[2]];|
  [ <identity partial perm on [ 1 ]> ]
  !gapprompt@gap>| !gapinput@IsMajorantlyClosed(S,T);|
  false
  !gapprompt@gap>| !gapinput@U:=[Elements(S)[2],Elements(S)[6]];|
  [ <identity partial perm on [ 1 ]>, <identity partial perm on [ 1, 2 ]
      > ]
  !gapprompt@gap>| !gapinput@IsMajorantlyClosed(S,U);|
  true
  !gapprompt@gap>| !gapinput@D:=DualSymmetricInverseSemigroup(3);|
  <inverse bipartition monoid on 3 pts with 3 generators>
  !gapprompt@gap>| !gapinput@x:=Bipartition( [ [ 1, -2 ], [ 2, -3 ], [ 3, -1 ] ] );;|
  !gapprompt@gap>| !gapinput@IsMajorantlyClosed(D, [x]);|
  true
  !gapprompt@gap>| !gapinput@y:=Bipartition( [ [ 1, 2, -1, -2 ], [ 3, -3 ] ] );;|
  !gapprompt@gap>| !gapinput@IsMajorantlyClosed(D, [x,y]);|
  false
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{IsMonogenicInverseSemigroup}}
\logpage{[ 4, 7, 7 ]}\nobreak
\hyperdef{L}{X7D2641AD830DEC1C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsMonogenicInverseSemigroup({\mdseries\slshape S})\index{IsMonogenicInverseSemigroup@\texttt{IsMonogenicInverseSemigroup}}
\label{IsMonogenicInverseSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}. 



 \texttt{IsMonogenicInverseSemigroup} returns \texttt{true} if the semigroup \mbox{\texttt{\mdseries\slshape S}} is an inverse monogenic semigroup and it returns \texttt{false} if it is not. 

 A inverse semigroup is \emph{monogenic} if it is generated as an inverse semigroup by a single element. See also \texttt{IsMonogenicSemigroup} (\ref{IsMonogenicSemigroup}) and \texttt{IndexPeriodOfTransformation} (\textbf{Reference: IndexPeriodOfTransformation}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );;|
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(f, f^2, f^3);;|
  !gapprompt@gap>| !gapinput@IsMonogenicSemigroup(S);|
  false
  !gapprompt@gap>| !gapinput@IsMonogenicInverseSemigroup(S);|
  true
  !gapprompt@gap>| !gapinput@x:=Random(DualSymmetricInverseMonoid(100));;|
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(x, x^2, x^20);;|
  !gapprompt@gap>| !gapinput@IsMonogenicInverseSemigroup(S);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{JoinIrreducibleDClasses}}
\logpage{[ 4, 7, 8 ]}\nobreak
\hyperdef{L}{X85CDF93C805AF82A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{JoinIrreducibleDClasses({\mdseries\slshape S})\index{JoinIrreducibleDClasses@\texttt{JoinIrreducibleDClasses}}
\label{JoinIrreducibleDClasses}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A list of $\mathcal{D}$-classes. 



 \texttt{JoinIrreducibleDClasses} returns a list of the join irreducible $\mathcal{D}$-classes of the inverse semigroup of partial permutations, block bijections or
partial permutation bipartitions \mbox{\texttt{\mdseries\slshape S}}.

 A \emph{join irreducible $\mathcal{D}$-class} is a $\mathcal{D}$-class containing only join irreducible elements. See \texttt{IsJoinIrreducible} (\ref{IsJoinIrreducible}). If a $\mathcal{D}$-class contains one join irreducible element, then all of the elements in the $\mathcal{D}$-class are join irreducible. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(3);|
  <symmetric inverse semigroup on 3 pts>
  !gapprompt@gap>| !gapinput@JoinIrreducibleDClasses(S);|
  [ {PartialPerm( [ 1 ], [ 1 ] )} ]
  !gapprompt@gap>| !gapinput@T:=InverseSemigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4 ], [ 1, 2, 4, 3 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1 ], [ 1 ] ), PartialPerm( [ 2 ], [ 2 ] ) );|
  <inverse partial perm semigroup on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@JoinIrreducibleDClasses(T);|
  [ {PartialPerm( [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ] )}, 
    {PartialPerm( [ 1 ], [ 1 ] )}, {PartialPerm( [ 2 ], [ 2 ] )} ]
  !gapprompt@gap>| !gapinput@D:=DualSymmetricInverseSemigroup(3);|
  <inverse bipartition monoid on 3 pts with 3 generators>
  !gapprompt@gap>| !gapinput@JoinIrreducibleDClasses(D);|
  [ {Bipartition( [ [ 1, 2, -1, -2 ], [ 3, -3 ] ] )} ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MajorantClosure}}
\logpage{[ 4, 7, 9 ]}\nobreak
\hyperdef{L}{X801CC67E80898608}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MajorantClosure({\mdseries\slshape S, T})\index{MajorantClosure@\texttt{MajorantClosure}}
\label{MajorantClosure}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A majorantly closed list of elements. 



 \texttt{MajorantClosure} returns a majorantly closed subset of an inverse semigroup of partial
permutations, block bijections or partial permutation bipartitions, \mbox{\texttt{\mdseries\slshape S}}, as a list. See \texttt{IsMajorantlyClosed} (\ref{IsMajorantlyClosed}).

 The result contains all elements of \mbox{\texttt{\mdseries\slshape S}} which are greater than or equal to any element of \mbox{\texttt{\mdseries\slshape T}} (with respect to the natural partial order \texttt{NaturalLeqPartialPerm} (\textbf{Reference: NaturalLeqPartialPerm})). In particular, the result is a superset of \mbox{\texttt{\mdseries\slshape T}}.

 Note that \mbox{\texttt{\mdseries\slshape T}} can be a subset of \mbox{\texttt{\mdseries\slshape S}} or a subsemigroup of \mbox{\texttt{\mdseries\slshape S}}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(4);|
  <symmetric inverse semigroup on 4 pts>
  !gapprompt@gap>| !gapinput@T:=[PartialPerm([1,0,3,0])];|
  [ <identity partial perm on [ 1, 3 ]> ]
  !gapprompt@gap>| !gapinput@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) ]
  !gapprompt@gap>| !gapinput@B:=InverseSemigroup([|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -2 ], [ 2, -1 ], [ 3, -3 ], [ 4, 5, -4, -5 ] ] ),|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -3 ], [ 2, -4 ], [ 3, -2 ], |
  !gapprompt@>| !gapinput@   [ 4, -1 ], [ 5, -5 ] ] ) ]);;|
  !gapprompt@gap>| !gapinput@T:=[|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -2 ], [ 2, 3, 5, -1, -3, -5 ], [ 4, -4 ] ] ),|
  !gapprompt@>| !gapinput@ Bipartition( [ [ 1, -4 ], [ 2, 3, 5, -1, -3, -5 ], [ 4, -2 ] ] ) ];;|
  !gapprompt@gap>| !gapinput@IsMajorantlyClosed(B,T);|
  false
  !gapprompt@gap>| !gapinput@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 ]> ]
  !gapprompt@gap>| !gapinput@IsMajorantlyClosed(B, last);|
  true
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{Minorants}}
\logpage{[ 4, 7, 10 ]}\nobreak
\hyperdef{L}{X84A3DB79816374DB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Minorants({\mdseries\slshape S, f})\index{Minorants@\texttt{Minorants}}
\label{Minorants}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A list of elements. 



 \texttt{Minorants} takes an element \mbox{\texttt{\mdseries\slshape f}} from an inverse semigroup of partial permutations, block bijections or partial
permutation bipartitions \mbox{\texttt{\mdseries\slshape S}}, and returns a list of the minorants of \mbox{\texttt{\mdseries\slshape f}} in \mbox{\texttt{\mdseries\slshape S}}. 

 A \emph{minorant} of \mbox{\texttt{\mdseries\slshape f}} is an element of \mbox{\texttt{\mdseries\slshape S}} which is strictly less than \mbox{\texttt{\mdseries\slshape f}} in the natural partial order of \mbox{\texttt{\mdseries\slshape S}}. See \texttt{NaturalLeqPartialPerm} (\textbf{Reference: NaturalLeqPartialPerm}). }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@s:=SymmetricInverseSemigroup(3);|
  <symmetric inverse semigroup on 3 pts>
  !gapprompt@gap>| !gapinput@f:=Elements(s)[13];|
  [1,3](2)
  !gapprompt@gap>| !gapinput@Minorants(s,f);|
  [ <empty partial perm>, [1,3], <identity partial perm on [ 2 ]> ]
  !gapprompt@gap>| !gapinput@f:=PartialPerm([3,2,4,0]);|
  [1,3,4](2)
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(f);|
  <inverse partial perm semigroup on 4 pts with 1 generator>
  !gapprompt@gap>| !gapinput@Minorants(S,f);|
  [ <identity partial perm on [ 2 ]>, [1,3](2), [3,4](2) ]
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{PrimitiveIdempotents}}
\logpage{[ 4, 7, 11 ]}\nobreak
\hyperdef{L}{X80C0C6C37C4A2ABD}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PrimitiveIdempotents({\mdseries\slshape S})\index{PrimitiveIdempotents@\texttt{PrimitiveIdempotents}}
\label{PrimitiveIdempotents}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A list of idempotent partial permutations.



 An idempotent in an inverse semigroup \mbox{\texttt{\mdseries\slshape S}} is \emph{primitive} if it is non-zero and minimal with respect to the \texttt{NaturalPartialOrder} (\textbf{Reference: NaturalPartialOrder}) on \mbox{\texttt{\mdseries\slshape S}}. \texttt{PrimitiveIdempotents} returns the list of primitive idempotents in the inverse semigroup of partial
permutations \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:= InverseMonoid(|
  !gapprompt@>| !gapinput@PartialPerm( [ 1 ], [ 4 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3 ], [ 2, 1, 3 ] ),|
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3 ], [ 3, 1, 2 ] ) );;|
  !gapprompt@gap>| !gapinput@MultiplicativeZero(S);|
  <empty partial perm>
  !gapprompt@gap>| !gapinput@PrimitiveIdempotents(S);|
  [ <identity partial perm on [ 4 ]>, <identity partial perm on [ 1 ]>, 
    <identity partial perm on [ 2 ]>, <identity partial perm on [ 3 ]> ]
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(4);|
  <inverse bipartition monoid on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@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, -1 ], [ 2, 3, 4, -2, -3, -4 ]>, 
    <block bijection: [ 1, 2, -1, -2 ], [ 3, 4, -3, -4 ]>, 
    <block bijection: [ 1, 3, 4, -1, -3, -4 ], [ 2, -2 ]>, 
    <block bijection: [ 1, 4, -1, -4 ], [ 2, 3, -2, -3 ]>, 
    <block bijection: [ 1, 3, -1, -3 ], [ 2, 4, -2, -4 ]> ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RightCosetsOfInverseSemigroup}}
\logpage{[ 4, 7, 12 ]}\nobreak
\hyperdef{L}{X7B5D89A585F8B5EA}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RightCosetsOfInverseSemigroup({\mdseries\slshape S, T})\index{RightCosetsOfInverseSemigroup@\texttt{RightCosetsOfInverseSemigroup}}
\label{RightCosetsOfInverseSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A list of lists of elements. 



 \texttt{RightCosetsOfInverseSemigroup} takes a majorantly closed inverse subsemigroup \mbox{\texttt{\mdseries\slshape T}} of an inverse semigroup of partial permutations, block bijections or partial
permutation bipartitions \mbox{\texttt{\mdseries\slshape S}}. See \texttt{IsMajorantlyClosed} (\ref{IsMajorantlyClosed}). The result is a list of the right cosets of \mbox{\texttt{\mdseries\slshape T}} in \mbox{\texttt{\mdseries\slshape S}}.

 For $s \in S$, the right coset $\overline{Ts}$ is defined if and only if $ss^{-1} \in T$, in which case it is defined to be the majorant closure of the set $Ts$. See \texttt{MajorantClosure} (\ref{MajorantClosure}). Distinct cosets are disjoint but do not necessarily partition \mbox{\texttt{\mdseries\slshape S}}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(3);|
  <symmetric inverse semigroup on 3 pts>
  !gapprompt@gap>| !gapinput@T:=InverseSemigroup(MajorantClosure(S,[PartialPerm([1])]));|
  <inverse partial perm monoid on 3 pts with 6 generators>
  !gapprompt@gap>| !gapinput@IsMajorantlyClosed(S,T);|
  true
  !gapprompt@gap>| !gapinput@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) ] ]
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{SameMinorantsSubgroup}}
\logpage{[ 4, 7, 13 ]}\nobreak
\hyperdef{L}{X83298E9E86A343FF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SameMinorantsSubgroup({\mdseries\slshape H})\index{SameMinorantsSubgroup@\texttt{SameMinorantsSubgroup}}
\label{SameMinorantsSubgroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A list of elements of the group $\mathcal{H}$-class \mbox{\texttt{\mdseries\slshape H}}. 



 Given a group $\mathcal{H}$-class \mbox{\texttt{\mdseries\slshape H}} in an inverse semigroup of partial permutations, block bijections or partial
permutation bipartitions \texttt{S}, \texttt{SameMinorantsSubgroup} returns a list of the elements of \mbox{\texttt{\mdseries\slshape H}} which have the same strict minorants as the identity element of \mbox{\texttt{\mdseries\slshape H}}. A \emph{strict minorant} of \texttt{x} in \mbox{\texttt{\mdseries\slshape H}} is an element of \texttt{S} which is less than \texttt{x} (with respect to the natural partial order), but is not equal to \texttt{x}.

 The returned list of elements of \mbox{\texttt{\mdseries\slshape H}} describe a subgroup of \mbox{\texttt{\mdseries\slshape H}}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(3);|
  <symmetric inverse semigroup on 3 pts>
  !gapprompt@gap>| !gapinput@h:=GroupHClass(GreensDClasses(S)[1]);|
  {PartialPerm( [ 1, 2, 3 ], [ 1, 2, 3 ] )}
  !gapprompt@gap>| !gapinput@Elements(h);|
  [ <identity partial perm on [ 1, 2, 3 ]>, (1)(2,3), (1,2)(3), 
    (1,2,3), (1,3,2), (1,3)(2) ]
  !gapprompt@gap>| !gapinput@SameMinorantsSubgroup(h);|
  [ <identity partial perm on [ 1, 2, 3 ]> ]
  !gapprompt@gap>| !gapinput@T:=InverseSemigroup( |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3, 4 ], [ 1, 2, 4, 3 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1 ], [ 1 ] ), PartialPerm( [ 2 ], [ 2 ] ) );|
  <inverse partial perm semigroup on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@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) ]
  !gapprompt@gap>| !gapinput@f:=GroupHClass(GreensDClasses(T)[1]);|
  {PartialPerm( [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ] )}
  !gapprompt@gap>| !gapinput@Elements(f);|
  [ <identity partial perm on [ 1, 2, 3, 4 ]>, (1)(2)(3,4) ]
  !gapprompt@gap>| !gapinput@SameMinorantsSubgroup(f);|
  [ <identity partial perm on [ 1, 2, 3, 4 ]>, (1)(2)(3,4) ]
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{SmallerDegreePartialPermRepresentation}}
\logpage{[ 4, 7, 14 ]}\nobreak
\hyperdef{L}{X786D4E397EA4445D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallerDegreePartialPermRepresentation({\mdseries\slshape S})\index{SmallerDegreePartialPermRepresentation@\texttt{Smaller}\-\texttt{Degree}\-\texttt{Partial}\-\texttt{Perm}\-\texttt{Representation}}
\label{SmallerDegreePartialPermRepresentation}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 An isomorphism. 



 \texttt{SmallerDegreePartialPermRepresentation} attempts to find an isomorphism from the inverse semigroup \mbox{\texttt{\mdseries\slshape S}} of partial permutations to another inverse semigroup of partial permutations
with smaller degree. If the function cannot reduce the degree, the identity
mapping is returned. 

 There is no guarantee that the smallest possible degree representation is
returned. For more information see \cite{Schein1992aa}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseSemigroup(PartialPerm([2,1,4,3,6,5,8,7]));|
  <commutative inverse partial perm semigroup on 8 pts with 1 generator>
  !gapprompt@gap>| !gapinput@Elements(S);|
  [ <identity partial perm on [ 1, 2, 3, 4, 5, 6, 7, 8 ]>, 
    (1,2)(3,4)(5,6)(7,8) ]
  !gapprompt@gap>| !gapinput@T:=SmallerDegreePartialPermRepresentation(S);|
  MappingByFunction( <partial perm group of size 2, 
   on 8 pts with 1 generator>
   , <commutative inverse partial perm semigroup on 2 pts
   with 1 generator>, function( x ) ... end, function( x ) ... end )
  !gapprompt@gap>| !gapinput@R:=Range(T);|
  <commutative inverse partial perm semigroup on 2 pts with 1 generator>
  !gapprompt@gap>| !gapinput@Elements(R);|
  [ <identity partial perm on [ 1, 2 ]>, (1,2) ]
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(5);;|
  !gapprompt@gap>| !gapinput@T:=Range(IsomorphismPartialPermSemigroup(S));|
  <inverse partial perm monoid on 6721 pts with 3 generators>
  !gapprompt@gap>| !gapinput@SmallerDegreePartialPermRepresentation(T);|
  MappingByFunction( <inverse partial perm monoid on 6721 pts
   with 3 generators>, <inverse partial perm semigroup on 30 pts
   with 3 generators>, function( x ) ... end, function( x ) ... end )
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{VagnerPrestonRepresentation}}
\logpage{[ 4, 7, 15 ]}\nobreak
\hyperdef{L}{X7BC49C3487384364}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{VagnerPrestonRepresentation({\mdseries\slshape S})\index{VagnerPrestonRepresentation@\texttt{VagnerPrestonRepresentation}}
\label{VagnerPrestonRepresentation}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 An isomorphism to an inverse semigroup of partial permutations. 



 \texttt{VagnerPrestonRepresentation} returns an isomorphism from an inverse semigroup \mbox{\texttt{\mdseries\slshape S}} where the elements of \mbox{\texttt{\mdseries\slshape S}} have a unique semigroup inverse accessible via \texttt{Inverse} (\textbf{Reference: Inverse}), to the inverse semigroup of partial permutations \mbox{\texttt{\mdseries\slshape T}} of degree equal to the size of \mbox{\texttt{\mdseries\slshape S}}, which is obtained using the Vagner-Preston Representation Theorem. 

 More precisely, if $f:S\to T$ is the isomorphism returned by \texttt{VagnerPrestonRepresentation(\mbox{\texttt{\mdseries\slshape S}})} and $x$ is in \mbox{\texttt{\mdseries\slshape S}}, then $f(x)$ is the partial permutation with domain $Sx^{-1}$ and range $Sx^{-1}x$ defined by $f(x): sx^{-1}\mapsto sx^{-1}x$. 

 In many cases, it is possible to find a smaller degree representation than
that provided by \texttt{VagnerPrestonRepresentation} using \texttt{IsomorphismPartialPermSemigroup} (\textbf{Reference: IsomorphismPartialPermSemigroup}) or \texttt{SmallerDegreePartialPermRepresentation} (\ref{SmallerDegreePartialPermRepresentation}). }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseSemigroup(2);|
  <symmetric inverse semigroup on 2 pts>
  !gapprompt@gap>| !gapinput@Size(S);|
  7
  !gapprompt@gap>| !gapinput@iso:=VagnerPrestonRepresentation(S);|
  MappingByFunction( <symmetric inverse semigroup on 2 pts>, <inverse pa\
  rtial perm monoid on 7 pts
   with 2 generators>, function( x ) ... end, function( x ) ... end )
  !gapprompt@gap>| !gapinput@RespectsMultiplication(iso);|
  true
  !gapprompt@gap>| !gapinput@inv:=InverseGeneralMapping(iso);;|
  !gapprompt@gap>| !gapinput@ForAll(S, x-> (x^iso)^inv=x);|
  true
  !gapprompt@gap>| !gapinput@V:=InverseSemigroup([|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -4 ], [ 2, -1 ], [ 3, -5 ], |
  !gapprompt@>| !gapinput@[ 4 ], [ 5 ], [ -2 ], [ -3 ] ] ),|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -5 ], [ 2, -1 ], [ 3, -3 ], |
  !gapprompt@>| !gapinput@[ 4 ], [ 5 ], [ -2 ], [ -4 ] ] ),|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -2 ], [ 2, -4 ], [ 3, -5 ], |
  !gapprompt@>| !gapinput@[ 4, -1 ], [ 5, -3 ] ] ) ]);|
  <inverse bipartition semigroup on 5 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsInverseSemigroup(V);|
  true
  !gapprompt@gap>| !gapinput@VagnerPrestonRepresentation(V);|
  MappingByFunction( <inverse bipartition semigroup of size 394, 
   on 5 pts with 3 generators>, <inverse partial perm semigroup 
  on 394 pts
   with 5 generators>, function( x ) ... end, function( x ) ... end )
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{CharacterTableOfInverseSemigroup}}
\logpage{[ 4, 7, 16 ]}\nobreak
\hyperdef{L}{X7C83DF9A7973AF6D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CharacterTableOfInverseSemigroup({\mdseries\slshape S})\index{CharacterTableOfInverseSemigroup@\texttt{CharacterTableOfInverseSemigroup}}
\label{CharacterTableOfInverseSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 The character table of the inverse semigroup \mbox{\texttt{\mdseries\slshape S}} and a list of conjugacy class representatives of \mbox{\texttt{\mdseries\slshape S}}. 



 Returns a list with two entries: the first entry being the character table of
the inverse semigroup \mbox{\texttt{\mdseries\slshape S}} as a matrix, while the second entry is a list of conjugacy class
representatives of \mbox{\texttt{\mdseries\slshape S}}. 

 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 $\mathcal{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. 

 This function was contributed by Jhevon Smith and Ben Steinberg. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=InverseMonoid( [ PartialPerm( [ 1, 2 ], [ 3, 1 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3 ], [ 1, 3, 4 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 2, 3 ], [ 2, 4, 1 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 4 ], [ 3, 4, 1 ] ) ] );;|
  !gapprompt@gap>| !gapinput@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> ] ]
  !gapprompt@gap>| !gapinput@S:=SymmetricInverseMonoid(4);;|
  !gapprompt@gap>| !gapinput@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 [ 1, 2 ]>, (1,2), 
        <identity partial perm on [ 1 ]>, <empty partial perm> ] ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Visualising the structure of a semigroup}}\logpage{[ 4, 8, 0 ]}
\hyperdef{L}{X78476D2B82CE400D}{}
{
 In this section, we describe some functions for creating pictures of various
structures related to a semigroup of transformations, partial permutations, or
bipartitions; or a subsemigroup of a Rees 0-matrix semigroup.

 Several of the functions described in this section return a string, which can
be written to a file using the function \texttt{FileString} (\textbf{GAPDoc: FileString}) or viewed using \texttt{Splash} (\ref{Splash}). 

\subsection{\textcolor{Chapter }{Splash}}
\logpage{[ 4, 8, 1 ]}\nobreak
\hyperdef{L}{X83B3318784E78415}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Splash({\mdseries\slshape str[, opts]})\index{Splash@\texttt{Splash}}
\label{Splash}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
Nothing.



 This function attempts to convert the string \mbox{\texttt{\mdseries\slshape str}} into a pdf document and open this document, i.e. to splash it all over your
monitor.

 The string \mbox{\texttt{\mdseries\slshape str}} must correspond to a valid \texttt{dot} or \texttt{LaTeX} text file and you must have have \texttt{GraphViz} and \texttt{pdflatex} installed on your computer. For details about these file formats, see \href{http://www.latex-project.org} {\texttt{http://www.latex-project.org}} and \href{http://www.graphviz.org} {\texttt{http://www.graphviz.org}}.

 This function is provided to allow convenient, immediate viewing of the
pictures produced by the functions: \texttt{TikzBlocks} (\ref{TikzBlocks}), \texttt{TikzBipartition} (\ref{TikzBipartition}), \texttt{DotSemilatticeOfIdempotents} (\ref{DotSemilatticeOfIdempotents}), and \texttt{DotDClasses} (\ref{DotDClasses}).

 The optional second argument \mbox{\texttt{\mdseries\slshape opts}} should be a record with components corresponding to various options, given
below. 
\begin{description}
\item[{path}]  this should be a string representing the path to the directory where you want \texttt{Splash} to do its work. The default value of this option is \texttt{"\texttt{\symbol{126}}/"}. 
\item[{directory}]  this should be a string representing the name of the directory in \texttt{path} where you want \texttt{Splash} to do its work. This function will create this directory if does not already
exist. 

 The default value of this option is \texttt{"tmp.viz"} if the option \texttt{path} is present, and the result of \texttt{DirectoryTemporary} (\textbf{Reference: DirectoryTemporary}) is used otherwise. 
\item[{filename}]  this should be a string representing the name of the file where \mbox{\texttt{\mdseries\slshape str}} will be written. The default value of this option is \texttt{"vizpicture"}. 
\item[{viewer}]  this should be a string representing the name of the program which should open
the files produced by \texttt{GraphViz} or \texttt{pdflatex}. 
\item[{type}]  this option can be used to specify that the string \mbox{\texttt{\mdseries\slshape str}} contains a {\LaTeX} or \texttt{dot} document. You can specify this option in \mbox{\texttt{\mdseries\slshape str}} directly by making the first line \texttt{"\%latex"} or \texttt{"//dot"}. There is no default value for this option, this option must be specified in \mbox{\texttt{\mdseries\slshape str}} or in \mbox{\texttt{\mdseries\slshape opt.type}}. 
\item[{filetype}]  this should be a string representing the type of file which \texttt{Splash} should produce. For {\LaTeX} files, this option is ignored and the default value \texttt{"pdf"} is used. 
\end{description}
 This function was written by Attila Egri-Nagy and Manuel Delgado with some
minor changes by J. D. Mitchell.

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
          gap> Splash(DotDClasses(FullTransformationMonoid(4)));
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{DotDClasses (for a semigroup)}}
\logpage{[ 4, 8, 2 ]}\nobreak
\hyperdef{L}{X7EDE2122810063D7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DotDClasses({\mdseries\slshape S})\index{DotDClasses@\texttt{DotDClasses}!for a semigroup}
\label{DotDClasses:for a semigroup}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DotDClasses({\mdseries\slshape S, record})\index{DotDClasses@\texttt{DotDClasses}}
\label{DotDClasses}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A string.



 This function produces a graphical representation of the partial order of the $\mathcal{D}$-classes of the semigroup \mbox{\texttt{\mdseries\slshape S}} together with the eggbox diagram of each $\mathcal{D}$-class. The output is in \texttt{dot} format (also known as \texttt{GraphViz}) format. For details about this file format, and information about how to
display or edit this format see \href{http://www.graphviz.org} {\texttt{http://www.graphviz.org}}. 

 The string returned by \texttt{DotDClasses} can be written to a file using the command \texttt{FileString} (\textbf{GAPDoc: FileString}).

 The $\mathcal{D}$-classes are shown as eggbox diagrams with $\mathcal{L}$-classes as rows and $\mathcal{R}$-classes as columns; group $\mathcal{H}$-classes are shaded gray and contain an asterisk. The $\mathcal{D}$-classes are numbered according to their index in \texttt{GreensDClasses(\mbox{\texttt{\mdseries\slshape S}})}, so that an \texttt{i} appears next to the eggbox diagram of \texttt{GreensDClasses(\mbox{\texttt{\mdseries\slshape S}})[i]}. A red line from one $\mathcal{D}$-class to another indicates that the higher $\mathcal{D}$-class is greater than the lower one in the $\mathcal{D}$-order on \mbox{\texttt{\mdseries\slshape S}}. 

 If the optional second argument \mbox{\texttt{\mdseries\slshape record}} is present, it can be used to specify some options for output. 
\begin{description}
\item[{number}]  if \texttt{\mbox{\texttt{\mdseries\slshape record}}.number} is \texttt{false}, then the $\mathcal{D}$-classes in the diagram are not numbered according to their index in the list
of $\mathcal{D}$-classes of \mbox{\texttt{\mdseries\slshape S}}. The default value for this option is \texttt{true}. 
\item[{maximal}]  if \texttt{\mbox{\texttt{\mdseries\slshape record}}.maximal} is \texttt{true}, then the structure description of the group $\mathcal{H}$-classes is displayed; see \texttt{StructureDescription} (\textbf{Reference: StructureDescription}). Setting this attribute to \texttt{true} can adversely affect the performance of \texttt{DotDClasses}. The default value for this option is \texttt{false}. 
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=FullTransformationSemigroup(3);|
  <full transformation semigroup on 3 pts>
  !gapprompt@gap>| !gapinput@DotDClasses(S);        |
  "digraph  DClasses {\nnode [shape=plaintext]\nedge [color=red,arrowhe\
  ad=none]\n1 [shape=box style=dotted label=<\n<TABLE BORDER=\"0\" CELL\
  BORDER=\"1\" CELLPADDING=\"10\" CELLSPACING=\"0\" PORT=\"1\">\n<TR BO\
  RDER=\"0\"><TD COLSPAN=\"1\" BORDER=\"0\" >1</TD></TR><TR><TD BGCOLOR\
  =\"grey\">*</TD></TR>\n</TABLE>>];\n2 [shape=box style=dotted label=<\
  \n<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLPADDING=\"10\" CELLSPACING\
  =\"0\" PORT=\"2\">\n<TR BORDER=\"0\"><TD COLSPAN=\"3\" BORDER=\"0\" >\
  2</TD></TR><TR><TD BGCOLOR=\"grey\">*</TD><TD BGCOLOR=\"grey\">*</TD>\
  <TD></TD></TR>\n<TR><TD BGCOLOR=\"grey\">*</TD><TD></TD><TD BGCOLOR=\
  \"grey\">*</TD></TR>\n<TR><TD></TD><TD BGCOLOR=\"grey\">*</TD><TD BGC\
  OLOR=\"grey\">*</TD></TR>\n</TABLE>>];\n3 [shape=box style=dotted lab\
  el=<\n<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLPADDING=\"10\" CELLSPA\
  CING=\"0\" PORT=\"3\">\n<TR BORDER=\"0\"><TD COLSPAN=\"1\" BORDER=\"0\
  \" >3</TD></TR><TR><TD BGCOLOR=\"grey\">*</TD></TR>\n<TR><TD BGCOLOR=\
  \"grey\">*</TD></TR>\n<TR><TD BGCOLOR=\"grey\">*</TD></TR>\n</TABLE>>\
  ];\n1 -> 2\n2 -> 3\n }"
  !gapprompt@gap>| !gapinput@FileString(DotDClasses(S), "t3.dot");|
  fail
  !gapprompt@gap>| !gapinput@FileString("t3.dot", DotDClasses(S));|
  966
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{DotSemilatticeOfIdempotents}}
\logpage{[ 4, 8, 3 ]}\nobreak
\hyperdef{L}{X7C22E8D17D6C23EA}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DotSemilatticeOfIdempotents({\mdseries\slshape S})\index{DotSemilatticeOfIdempotents@\texttt{DotSemilatticeOfIdempotents}}
\label{DotSemilatticeOfIdempotents}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A string.



 This function produces a graphical representation of the semilattice of the
idempotents of an inverse semigroup \mbox{\texttt{\mdseries\slshape S}} where the elements of \mbox{\texttt{\mdseries\slshape S}} have a unique semigroup inverse accessible via \texttt{Inverse} (\textbf{Reference: Inverse}). The idempotents are grouped by the $\mathcal{D}$-class they belong to.

 The output is in \texttt{dot} format (also known as \texttt{GraphViz}) format. For details about this file format, and information about how to
display or edit this format see \href{http://www.graphviz.org} {\texttt{http://www.graphviz.org}}. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=DualSymmetricInverseMonoid(4);|
  <inverse bipartition monoid on 4 pts with 3 generators>
  !gapprompt@gap>| !gapinput@DotSemilatticeOfIdempotents(S);|
  "graph graphname {\n  node [shape=point]\nranksep=2;\nsubgraph cluste\
  r_1{\n15 \n}\nsubgraph cluster_2{\n5 11 14 8 12 13 \n}\nsubgraph clus\
  ter_3{\n2 3 10 4 6 9 7 \n}\nsubgraph cluster_4{\n1 \n}\n2 -- 1\n3 -- \
  1\n4 -- 1\n5 -- 2\n5 -- 3\n5 -- 4\n6 -- 1\n7 -- 1\n8 -- 2\n8 -- 6\n8 \
  -- 7\n9 -- 1\n10 -- 1\n11 -- 2\n11 -- 9\n11 -- 10\n12 -- 3\n12 -- 6\n\
  12 -- 9\n13 -- 3\n13 -- 7\n13 -- 10\n14 -- 4\n14 -- 6\n14 -- 10\n15 -\
  - 5\n15 -- 8\n15 -- 11\n15 -- 12\n15 -- 13\n15 -- 14\n }"
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{ Bipartitions and blocks }}\label{bipartition}
\logpage{[ 5, 0, 0 ]}
\hyperdef{L}{X7C18DB427C9C0917}{}
{
  In this chapter we describe the functions in \textsf{Semigroups} for creating and manipulating bipartitions and semigroups of bipartitions. We
begin by describing what these objects are. 

 A \emph{partition} of a set $X$ is a set of pairwise disjoint non-empty subsets of $X$ whose union is $X$. 

 Let $n\in$$\mathbb{N}$, let $\mathbf{n}$$=\{1,2,\ldots,n\}$, and let $-$$\mathbf{n}$$=\{-1,-2,\ldots,-n\}$. 

 The \emph{partition monoid} of degree $n$ is the set of all partitions of $\mathbf{n}$$\cup$-$\mathbf{n}$ with a multiplication we describe below. To avoid conflict with other uses of
the word "partition" in \textsf{GAP}, and to reflect their definition, we have opted to refer to the elements of
the partition monoid as \emph{bipartitions} of degree $n$; we will do so from this point on. 

 Let $x$ be any bipartition of degree $n$. Then $x$ is a set of pairwise disjoint non-empty subsets of $\mathbf{n}$$\cup$-$\mathbf{n}$ whose union is $\mathbf{n}$$\cup$-$\mathbf{n}$; these subsets are called the \emph{blocks} of $x$. A block containing elements of both $\mathbf{n}$ and -$\mathbf{n}$ is called a \emph{transverse block}. If $i$,$j$$\in$$\mathbf{n}$$\cup$-$\mathbf{n}$ belong to the same block of a bipartition $x$, then we write ($i$,$j$)$\in$$x$. 

   Let $x$ and $y$ be bipartitions of equal degree. Then $x$$y$ is the bipartition where $i$,$j$$\in$$\mathbf{n}$$\cup$-$\mathbf{n}$ belong to the same block of $x$$y$ if there exist $k(1), k(2),\ldots, k(r)\in \mathbf{n}$ ; and one of the following holds: 
\begin{itemize}
\item  $r$$=0$ and either $($$i$,$j$$)\in$$x$ or $($-$i$,-$j$$)\in$$y$; 
\item   $r=2s-1$ for some $s\geq 1$ and 
\[(i,-k(1))\in x,\ (k(1),k(2))\in y,\ (-k(2),-k(3))\in x,\ \ldots,\
(-k(2s-2),-k(2s-1))\in x,\ (k(2s-1),-j)\in y\]
   
\item   $r=2s$ for some $s\geq 1$ and either: 
\[(i,-k(1))\in x,\ (k(1),k(2))\in y,\ (-k(2),-k(3))\in x,\ \ldots, (k(2s-1),
k(2s))\in y,\ (-k(2s), j)\in x\]
 or 
\[(-i,k(1))\in y,\ (-k(1),-k(2))\in x,\ (k(2),k(3))\in y,\ \ldots, (-k(2s-1),
-k(2s))\in x,\ (k(2s), -j)\in y.\]
   
\end{itemize}
 This product can be shown to be associative, and so the collection of
bipartitions of any particular degree is a monoid; the identity element is the
partition $\left\{\{i,-i\}:i\in\mathbf{n}\right\}$.  A bipartition is a unit if and only if each block is of the form $\{$$i$,-$j$$\}$ for some $i$, $j$$\in$$\mathbf{n}$. Hence the group of units is isomorphic to the symmetric group on $\mathbf{n}$. 

 Let $x$ be a bipartition of degree $n$. Then we define $x$$^*$ to be the bipartition obtained from $x$ by replacing $i$ by -$i$ and -$i$ by -$i$ in every block of $x$ for all $i$$\in$$\mathbf{n}$. It is routine to verify that if $x$ and $y$ are arbitrary bipartitions of equal degree, then  
\[ (x^*)^*=x,\quad xx^*x=x,\quad x^*xx^*=x^*,\quad (xy)^*=y^*x^*. \]
   In this way, the partition monoid is a \emph{regular *-semigroup}. 
\section{\textcolor{Chapter }{The family and categories of bipartitions}}\logpage{[ 5, 1, 0 ]}
\hyperdef{L}{X7850845886902FBF}{}
{
 

\subsection{\textcolor{Chapter }{IsBipartition}}
\logpage{[ 5, 1, 1 ]}\nobreak
\hyperdef{L}{X80F11BEF856E7902}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBipartition({\mdseries\slshape obj})\index{IsBipartition@\texttt{IsBipartition}}
\label{IsBipartition}
}\hfill{\scriptsize (Category)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 Every bipartition in \textsf{GAP} belongs to the category \texttt{IsBipartition}. Basic operations for bipartitions are \texttt{RightBlocks} (\ref{RightBlocks}), \texttt{LeftBlocks} (\ref{LeftBlocks}), \texttt{ExtRepOfBipartition} (\ref{ExtRepOfBipartition}), \texttt{LeftProjection} (\ref{LeftProjection}), \texttt{RightProjection} (\ref{RightProjection}), \texttt{StarOp} (\ref{StarOp}), \texttt{DegreeOfBipartition} (\ref{DegreeOfBipartition}), \texttt{RankOfBipartition} (\ref{RankOfBipartition}), multiplication of two bipartitions of equal degree is via \texttt{*}. }

 

\subsection{\textcolor{Chapter }{IsBipartitionCollection}}
\logpage{[ 5, 1, 2 ]}\nobreak
\hyperdef{L}{X82F5D10C85489832}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBipartitionCollection({\mdseries\slshape obj})\index{IsBipartitionCollection@\texttt{IsBipartitionCollection}}
\label{IsBipartitionCollection}
}\hfill{\scriptsize (Category)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 Every collection of bipartitions belongs to the category \texttt{IsBipartitionCollection}. For example, bipartition semigroups belong to \texttt{IsBipartitionCollection}. }

 

\subsection{\textcolor{Chapter }{BipartitionFamily}}
\logpage{[ 5, 1, 3 ]}\nobreak
\hyperdef{L}{X7937F20C86F98F88}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{BipartitionFamily\index{BipartitionFamily@\texttt{BipartitionFamily}}
\label{BipartitionFamily}
}\hfill{\scriptsize (family)}}\\


 The family of all bipartitions is \texttt{BipartitionFamily}. }

 }

 
\section{\textcolor{Chapter }{Creating bipartitions}}\label{creating-bipartitions}
\logpage{[ 5, 2, 0 ]}
\hyperdef{L}{X85D77073820C7E72}{}
{
  There are several ways of creating bipartitions in \textsf{GAP}, which are described in this section. 

\subsection{\textcolor{Chapter }{Bipartition}}
\logpage{[ 5, 2, 1 ]}\nobreak
\hyperdef{L}{X7E052E6378A5B758}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Bipartition({\mdseries\slshape blocks})\index{Bipartition@\texttt{Bipartition}}
\label{Bipartition}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 \texttt{Bipartition} returns the bipartition \texttt{f} with equivalence classes \mbox{\texttt{\mdseries\slshape blocks}}, which should be a list of duplicate-free lists whose union is \texttt{[-n..-1]} union \texttt{[1..n]} for some positive integer \texttt{n}. 

 \texttt{Bipartition} returns an error if the argument does not define a bipartition. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -1 ],[ 2, 3, -3 ], [ -2 ] ] );|
  <bipartition: [ 1, -1 ], [ 2, 3, -3 ], [ -2 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{BipartitionByIntRep}}
\logpage{[ 5, 2, 2 ]}\nobreak
\hyperdef{L}{X846AA7568435D2CE}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{BipartitionByIntRep({\mdseries\slshape list})\index{BipartitionByIntRep@\texttt{BipartitionByIntRep}}
\label{BipartitionByIntRep}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 It is possible to create a bipartition using its internal representation. The
argument \mbox{\texttt{\mdseries\slshape list}} must be a list of positive integers not greater than \texttt{n}, of length \texttt{2*n}, and where \texttt{i} appears in the list only if \texttt{i-1} occurs earlier in the list. 

 For example, the internal representation of the bipartition with blocks 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  [ 1, -1 ], [ 2, 3, -2 ], [ -3 ]
\end{Verbatim}
 has internal representation 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  [ 1, 2, 2, 1, 2, 3 ]
\end{Verbatim}
 The internal representation indicates that the number \texttt{1} is in class \texttt{1}, the number \texttt{2} is in class \texttt{2}, the number \texttt{3} is in class \texttt{2}, the number \texttt{-1} is in class \texttt{1}, the number \texttt{-2} is in class \texttt{2}, and \texttt{-3} is in class \texttt{3}. As another example, \texttt{[ 1, 3, 2, 1 ]} is not the internal representation of any bipartition since there is no \texttt{2} before the \texttt{3} in the second position.

 In its first form \texttt{BipartitionByIntRep} verifies that the argument \mbox{\texttt{\mdseries\slshape list}} is the internal representation of a bipartition. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@BipartitionByIntRep([ 1, 2, 2, 1, 3, 4 ]);                         |
  <bipartition: [ 1, -1 ], [ 2, 3 ], [ -2 ], [ -3 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IdentityBipartition}}
\logpage{[ 5, 2, 3 ]}\nobreak
\hyperdef{L}{X8379B0538101FBC8}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IdentityBipartition({\mdseries\slshape n})\index{IdentityBipartition@\texttt{IdentityBipartition}}
\label{IdentityBipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
The identity bipartition.



 Returns the identity bipartition with degree \mbox{\texttt{\mdseries\slshape n}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@IdentityBipartition(10);|
  <block bijection: [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ], 
   [ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], [ 10, -10 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{LeftOne (for a bipartition)}}
\logpage{[ 5, 2, 4 ]}\nobreak
\hyperdef{L}{X824EDD4582AAA8C7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LeftOne({\mdseries\slshape f})\index{LeftOne@\texttt{LeftOne}!for a bipartition}
\label{LeftOne:for a bipartition}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LeftProjection({\mdseries\slshape f})\index{LeftProjection@\texttt{LeftProjection}}
\label{LeftProjection}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 The \texttt{LeftProjection} of a bipartition \mbox{\texttt{\mdseries\slshape f}} is the bipartition \texttt{\mbox{\texttt{\mdseries\slshape f}}*Star(\mbox{\texttt{\mdseries\slshape f}})}. It is so-named, since the left and right blocks of the left projection equal
the left blocks of \mbox{\texttt{\mdseries\slshape f}}. 

 The left projection \texttt{e} of \mbox{\texttt{\mdseries\slshape f}} is also a bipartition with the property that \texttt{e*\mbox{\texttt{\mdseries\slshape f}}=\mbox{\texttt{\mdseries\slshape f}}}. \texttt{LeftOne} and \texttt{LeftProjection} are synonymous. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -1, -2, -6 ], [ 2, 3, 5, -4 ], |
  !gapprompt@>| !gapinput@[ 6, -3 ], [ -5 ] ] );;|
  !gapprompt@gap>| !gapinput@LeftOne(f);|
  <block bijection: [ 1, 4, -1, -4 ], [ 2, 3, 5, -2, -3, -5 ], 
   [ 6, -6 ]>
  !gapprompt@gap>| !gapinput@LeftBlocks(f);|
  <blocks: [ 1, 4 ], [ 2, 3, 5 ], [ 6 ]>
  !gapprompt@gap>| !gapinput@RightBlocks(LeftOne(f));|
  <blocks: [ 1, 4 ], [ 2, 3, 5 ], [ 6 ]>
  !gapprompt@gap>| !gapinput@LeftBlocks(LeftOne(f)); |
  <blocks: [ 1, 4 ], [ 2, 3, 5 ], [ 6 ]>
  !gapprompt@gap>| !gapinput@LeftOne(f)*f=f;|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RightOne (for a bipartition)}}
\logpage{[ 5, 2, 5 ]}\nobreak
\hyperdef{L}{X790B71108070FAC2}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RightOne({\mdseries\slshape f})\index{RightOne@\texttt{RightOne}!for a bipartition}
\label{RightOne:for a bipartition}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RightProjection({\mdseries\slshape f})\index{RightProjection@\texttt{RightProjection}}
\label{RightProjection}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 The \texttt{RightProjection} of a bipartition \mbox{\texttt{\mdseries\slshape f}} is the bipartition \texttt{Star(\mbox{\texttt{\mdseries\slshape f}})*\mbox{\texttt{\mdseries\slshape f}}}. It is so-named, since the left and right blocks of the right projection
equal the right blocks of \mbox{\texttt{\mdseries\slshape f}}. 

 The right projection \texttt{e} of \mbox{\texttt{\mdseries\slshape f}} is also a bipartition with the property that \texttt{\mbox{\texttt{\mdseries\slshape f}}*e=\mbox{\texttt{\mdseries\slshape f}}}. \texttt{RightOne} and \texttt{RightProjection} are synonymous. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -1, -4 ], [ 2, -2, -3 ], [ 3, 4 ], |
  !gapprompt@>| !gapinput@[ 5, -5 ] ] );;|
  !gapprompt@gap>| !gapinput@RightOne(f);|
  <block bijection: [ 1, 4, -1, -4 ], [ 2, 3, -2, -3 ], [ 5, -5 ]>
  !gapprompt@gap>| !gapinput@RightBlocks(RightOne(f));|
  <blocks: [ 1, 4 ], [ 2, 3 ], [ 5 ]>
  !gapprompt@gap>| !gapinput@LeftBlocks(RightOne(f));        |
  <blocks: [ 1, 4 ], [ 2, 3 ], [ 5 ]>
  !gapprompt@gap>| !gapinput@RightBlocks(f);|
  <blocks: [ 1, 4 ], [ 2, 3 ], [ 5 ]>
  !gapprompt@gap>| !gapinput@f*RightOne(f)=f;|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{StarOp}}
\logpage{[ 5, 2, 6 ]}\nobreak
\hyperdef{L}{X7D7A2BE482AF5150}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{StarOp({\mdseries\slshape f})\index{StarOp@\texttt{StarOp}}
\label{StarOp}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Star({\mdseries\slshape f})\index{Star@\texttt{Star}}
\label{Star}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 \texttt{StarOp} returns the unique bipartition \texttt{g} with the property that: \texttt{\mbox{\texttt{\mdseries\slshape f}}*g*\mbox{\texttt{\mdseries\slshape f}}=\mbox{\texttt{\mdseries\slshape f}}}, \texttt{RightBlocks(\mbox{\texttt{\mdseries\slshape f}})=LeftBlocks(g)}, and \texttt{LeftBlocks(\mbox{\texttt{\mdseries\slshape f}})=RightBlocks(g)}. The star \texttt{g} can be obtained from \mbox{\texttt{\mdseries\slshape f}} by changing the sign of every integer in the external representation of \mbox{\texttt{\mdseries\slshape f}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -4 ], [ 2, 3, 4 ], [ 5 ], [ -1 ], |
  !gapprompt@>| !gapinput@[ -2, -3 ], [ -5 ] ] );|
  <bipartition: [ 1, -4 ], [ 2, 3, 4 ], [ 5 ], [ -1 ], [ -2, -3 ], 
   [ -5 ]>
  !gapprompt@gap>| !gapinput@g:=Star(f);|
  <bipartition: [ 1 ], [ 2, 3 ], [ 4, -1 ], [ 5 ], [ -2, -3, -4 ], 
   [ -5 ]>
  !gapprompt@gap>| !gapinput@f*g*f=f;|
  true
  !gapprompt@gap>| !gapinput@LeftBlocks(f)=RightBlocks(g);|
  true
  !gapprompt@gap>| !gapinput@RightBlocks(f)=LeftBlocks(g); |
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomBipartition}}
\logpage{[ 5, 2, 7 ]}\nobreak
\hyperdef{L}{X8077265981409CCB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RandomBipartition({\mdseries\slshape n})\index{RandomBipartition@\texttt{RandomBipartition}}
\label{RandomBipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 If \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then \texttt{RandomBipartition} returns a random bipartition of degree \mbox{\texttt{\mdseries\slshape n}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=RandomBipartition(6); |
  <bipartition: [ 1, 2, 3, 4 ], [ 5 ], [ 6, -2, -3, -4 ], [ -1, -5 ], [ -6 ]>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Changing the representation of a bipartition}}\label{changing-rep-bipartitions}
\logpage{[ 5, 3, 0 ]}
\hyperdef{L}{X7C2C44D281A0D2C9}{}
{
  It is possible that a bipartition can be represented as another type of
object, or that another type of \textsf{GAP} object can be represented as a bipartition. In this section, we describe the
functions in the \textsf{Semigroups} package for changing the representation of bipartition, or for changing the
representation of another type of object to that of a bipartition.

 The operations \texttt{AsPermutation} (\ref{AsPermutation:for a bipartition}), \texttt{AsPartialPerm} (\ref{AsPartialPerm:for a bipartition}), \texttt{AsTransformation} (\ref{AsTransformation:for a bipartition}) can be used to convert bipartitions into permutations, partial permutations,
or transformations where appropriate. 

\subsection{\textcolor{Chapter }{AsBipartition}}
\logpage{[ 5, 3, 1 ]}\nobreak
\hyperdef{L}{X855126D98583C181}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsBipartition({\mdseries\slshape f[, n]})\index{AsBipartition@\texttt{AsBipartition}}
\label{AsBipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 \texttt{AsBipartition} returns the bipartition, permutation, transformation, or partial permutation \mbox{\texttt{\mdseries\slshape f}}, as a bipartition of degree \mbox{\texttt{\mdseries\slshape n}}. There are several possible arguments for \texttt{AsBipartition}: 
\begin{description}
\item[{permutations}]  If \mbox{\texttt{\mdseries\slshape f}} is a permutation and \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then \texttt{AsBipartition(\mbox{\texttt{\mdseries\slshape f}}, \mbox{\texttt{\mdseries\slshape n}})} returns the bipartition on \texttt{[1..\mbox{\texttt{\mdseries\slshape n}}]} with classes \texttt{[i, i\texttt{\symbol{94}}\mbox{\texttt{\mdseries\slshape f}}]} for all \texttt{i=1..n}.

 If no positive integer \mbox{\texttt{\mdseries\slshape n}} is specified, then the largest moved point of \mbox{\texttt{\mdseries\slshape f}} is used as the value for \mbox{\texttt{\mdseries\slshape n}}; see \texttt{LargestMovedPoint} (\textbf{Reference: LargestMovedPoint (for a permutation)}). 
\item[{transformations}]  If \mbox{\texttt{\mdseries\slshape f}} is a transformation and \mbox{\texttt{\mdseries\slshape n}} is a positive integer such that \mbox{\texttt{\mdseries\slshape f}} is a transformation of \texttt{[1..\mbox{\texttt{\mdseries\slshape n}}]}, then \texttt{AsTransformation} returns the bipartition with classes $(i)f^{-1}\cup \{i\}$ for all \texttt{i} in the image of \mbox{\texttt{\mdseries\slshape f}}.

 If the positive integer \mbox{\texttt{\mdseries\slshape n}} is not specified, then the internal degree of \mbox{\texttt{\mdseries\slshape f}} is used as the value for \mbox{\texttt{\mdseries\slshape n}}. 
\item[{partial permutations}]  If \mbox{\texttt{\mdseries\slshape f}} is a partial permutation \mbox{\texttt{\mdseries\slshape f}} and \mbox{\texttt{\mdseries\slshape n}} is a positive integer, then \texttt{AsBipartition} returns the bipartition with classes \texttt{[i, i\texttt{\symbol{94}}\mbox{\texttt{\mdseries\slshape f}}]} for \texttt{i} in \texttt{[1..\mbox{\texttt{\mdseries\slshape n}}]}. Thus the degree of the returned bipartition is the maximum of \mbox{\texttt{\mdseries\slshape n}} and the values \texttt{i\texttt{\symbol{94}}\mbox{\texttt{\mdseries\slshape f}}} where \texttt{i} in \texttt{[1..\mbox{\texttt{\mdseries\slshape n}}]}.

 If the optional argument \mbox{\texttt{\mdseries\slshape n}} is not present, then the default value of the maximum of the largest moved
point and the largest image of a moved point of \mbox{\texttt{\mdseries\slshape f}} plus \texttt{1} is used. 
\item[{bipartitions}]  If \mbox{\texttt{\mdseries\slshape f}} is a bipartition and \mbox{\texttt{\mdseries\slshape n}} is a non-negative integer, then \texttt{AsBipartition} returns a bipartition corresponding to \mbox{\texttt{\mdseries\slshape f}} with degree \mbox{\texttt{\mdseries\slshape n}}. 

 If \mbox{\texttt{\mdseries\slshape n}} equals the degree of \mbox{\texttt{\mdseries\slshape f}}, then \mbox{\texttt{\mdseries\slshape f}} is returned. If \mbox{\texttt{\mdseries\slshape n}} is less than the degree of \mbox{\texttt{\mdseries\slshape f}}, then this function returns the bipartition obtained from \mbox{\texttt{\mdseries\slshape f}} by removing the values exceeding \mbox{\texttt{\mdseries\slshape n}} or less than \mbox{\texttt{\mdseries\slshape -n}} from the blocks of \mbox{\texttt{\mdseries\slshape f}}. If \mbox{\texttt{\mdseries\slshape n}} is greater than the degree of \mbox{\texttt{\mdseries\slshape f}}, then this function returns the bipartition with the same blocks as \mbox{\texttt{\mdseries\slshape f}} and the singleton blocks \texttt{i} and \texttt{-i} for all \texttt{i} greater than the degree of \mbox{\texttt{\mdseries\slshape f}} 
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Transformation( [ 3, 5, 3, 4, 1, 2 ] );;|
  !gapprompt@gap>| !gapinput@AsBipartition(f, 5);|
  <bipartition: [ 1, 3, -3 ], [ 2, -5 ], [ 4, -4 ], [ 5, -1 ], [ -2 ]>
  !gapprompt@gap>| !gapinput@AsBipartition(f);  |
  <bipartition: [ 1, 3, -3 ], [ 2, -5 ], [ 4, -4 ], [ 5, -1 ], 
   [ 6, -2 ], [ -6 ]>
  !gapprompt@gap>| !gapinput@AsBipartition(f, 10);|
  <bipartition: [ 1, 3, -3 ], [ 2, -5 ], [ 4, -4 ], [ 5, -1 ], 
   [ 6, -2 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], [ 10, -10 ], [ -6 ]>
  !gapprompt@gap>| !gapinput@AsBipartition((1, 3)(2, 4));|
  <block bijection: [ 1, -3 ], [ 2, -4 ], [ 3, -1 ], [ 4, -2 ]>
  !gapprompt@gap>| !gapinput@AsBipartition((1, 3)(2, 4), 10);|
  <block bijection: [ 1, -3 ], [ 2, -4 ], [ 3, -1 ], [ 4, -2 ], 
   [ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], [ 10, -10 ]>
  !gapprompt@gap>| !gapinput@f:=PartialPerm( [ 1, 2, 3, 4, 5, 6 ], [ 6, 7, 1, 4, 3, 2 ] );;|
  !gapprompt@gap>| !gapinput@AsBipartition(f, 11);            |
  <bipartition: [ 1, -6 ], [ 2, -7 ], [ 3, -1 ], [ 4, -4 ], [ 5, -3 ], 
   [ 6, -2 ], [ 7 ], [ 8 ], [ 9 ], [ 10 ], [ 11 ], [ -5 ], [ -8 ], 
   [ -9 ], [ -10 ], [ -11 ]>
  !gapprompt@gap>| !gapinput@AsBipartition(f);|
  <bipartition: [ 1, -6 ], [ 2, -7 ], [ 3, -1 ], [ 4, -4 ], [ 5, -3 ], 
   [ 6, -2 ], [ 7 ], [ -5 ]>
  !gapprompt@gap>| !gapinput@AsBipartition(Transformation( [ 1, 1, 2 ] ), 1);|
  <block bijection: [ 1, -1 ]>
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 2, -2 ], [ 3 ], [ 4, 5, 6, -1 ], |
  !gapprompt@>| !gapinput@[ -3, -4, -5, -6 ] ] );;|
  !gapprompt@gap>| !gapinput@AsBipartition(f, 0);|
  <empty bipartition>
  !gapprompt@gap>| !gapinput@AsBipartition(f, 2);|
  <bipartition: [ 1, 2, -2 ], [ -1 ]>
  !gapprompt@gap>| !gapinput@AsBipartition(f, 8);|
  <bipartition: [ 1, 2, -2 ], [ 3 ], [ 4, 5, 6, -1 ], [ 7 ], [ 8 ], 
   [ -3, -4, -5, -6 ], [ -7 ], [ -8 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AsBlockBijection}}
\logpage{[ 5, 3, 2 ]}\nobreak
\hyperdef{L}{X85A5AD2B7F3B776F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsBlockBijection({\mdseries\slshape f[, n]})\index{AsBlockBijection@\texttt{AsBlockBijection}}
\label{AsBlockBijection}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A block bijection or \texttt{fail}.



 When the argument \mbox{\texttt{\mdseries\slshape f}} is a partial perm and \mbox{\texttt{\mdseries\slshape n}} is a positive integer which is greater than the maximum of the degree and
codegree of \mbox{\texttt{\mdseries\slshape f}}, this function returns a block bijection corresponding to \mbox{\texttt{\mdseries\slshape f}}. This block bijection has the same non-singleton classes as \texttt{g:=AsBipartition(\mbox{\texttt{\mdseries\slshape f}}, \mbox{\texttt{\mdseries\slshape n}})} and one additional class which is the union the singleton classes of \texttt{g}.

 If the optional second argument \mbox{\texttt{\mdseries\slshape n}} is not present, then the maximum of the degree and codegree of \mbox{\texttt{\mdseries\slshape f}} plus 1 is used by default. If the second argument \mbox{\texttt{\mdseries\slshape n}} is not greater than this maximum, then \texttt{fail} is returned. 

 This is the value at \mbox{\texttt{\mdseries\slshape f}} of the embedding of the symmetric inverse monoid into the dual symmetric
inverse monoid given in the FitzGerald-Leech Theorem \cite{Fitzgerald1998aa}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=PartialPerm( [ 1, 2, 3, 6, 7, 10 ], [ 9, 5, 6, 1, 7, 8 ] ) ;  |
  [2,5][3,6,1,9][10,8](7)
  !gapprompt@gap>| !gapinput@AsBipartition(f, 11);|
  <bipartition: [ 1, -9 ], [ 2, -5 ], [ 3, -6 ], [ 4 ], [ 5 ], 
   [ 6, -1 ], [ 7, -7 ], [ 8 ], [ 9 ], [ 10, -8 ], [ 11 ], [ -2 ], 
   [ -3 ], [ -4 ], [ -10 ], [ -11 ]>
  !gapprompt@gap>| !gapinput@AsBlockBijection(f, 10);|
  fail
  !gapprompt@gap>| !gapinput@AsBlockBijection(f, 11);|
  <block bijection: [ 1, -9 ], [ 2, -5 ], [ 3, -6 ], 
   [ 4, 5, 8, 9, 11, -2, -3, -4, -10, -11 ], [ 6, -1 ], [ 7, -7 ], 
   [ 10, -8 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AsTransformation (for a bipartition)}}
\logpage{[ 5, 3, 3 ]}\nobreak
\hyperdef{L}{X7CE91D0C83865214}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsTransformation({\mdseries\slshape f})\index{AsTransformation@\texttt{AsTransformation}!for a bipartition}
\label{AsTransformation:for a bipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A transformation or \texttt{fail}.



 When the argument \mbox{\texttt{\mdseries\slshape f}} is a bipartition, that mathematically defines a transformation, this function
returns that transformation. A bipartition \mbox{\texttt{\mdseries\slshape f}} defines a transformation if and only if its right blocks are the image list of
a permutation of \texttt{[1..n]} where \texttt{n} is the degree of \mbox{\texttt{\mdseries\slshape f}}. 

 See \texttt{IsTransBipartition} (\ref{IsTransBipartition}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition([[ 1, -3 ], [ 2, -2 ], [ 3, 5, 10, -7 ], [ 4, -12 ], |
  !gapprompt@>| !gapinput@[ 6, 7, -6 ], [ 8, -5 ], [ 9, -11 ], [ 11, 12, -10 ], [ -1 ], [ -4 ], |
  !gapprompt@>| !gapinput@[ -8 ], [ -9 ]]);;|
  !gapprompt@gap>| !gapinput@AsTransformation(f);|
  Transformation( [ 3, 2, 7, 12, 7, 6, 6, 5, 11, 7, 10, 10 ] )
  !gapprompt@gap>| !gapinput@IsTransBipartition(f);|
  true
  !gapprompt@gap>| !gapinput@f:=Bipartition([[ 1, 5 ], [ 2, 4, 8, 10 ], [ 3, 6, 7, -1, -2 ], |
  !gapprompt@>| !gapinput@[ 9, -4, -6, -9 ], [ -3, -5 ], [ -7, -8 ], [ -10 ]]);;|
  !gapprompt@gap>| !gapinput@AsTransformation(f);|
  fail
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AsPartialPerm (for a bipartition)}}
\logpage{[ 5, 3, 4 ]}\nobreak
\hyperdef{L}{X7C5212EF7A200E63}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsPartialPerm({\mdseries\slshape f})\index{AsPartialPerm@\texttt{AsPartialPerm}!for a bipartition}
\label{AsPartialPerm:for a bipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A partial perm or \texttt{fail}.



 When the argument \mbox{\texttt{\mdseries\slshape f}} is a bipartition that mathematically defines a partial perm, this function
returns that partial perm. 

 A bipartition \mbox{\texttt{\mdseries\slshape f}} defines a partial perm if and only if its numbers of left and right blocks
both equal its degree.

 See \texttt{IsPartialPermBipartition} (\ref{IsPartialPermBipartition}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -4 ], [ 2, -2 ], [ 3, -10 ], [ 4, -5 ], |
  !gapprompt@>| !gapinput@[ 5, -9 ], [ 6 ], [ 7 ], [ 8, -6 ], [ 9, -3 ], [ 10, -8 ], |
  !gapprompt@>| !gapinput@[ -1 ], [ -7 ] ] );;|
  !gapprompt@gap>| !gapinput@IsPartialPermBipartition(f);|
  true
  !gapprompt@gap>| !gapinput@AsPartialPerm(f);|
  [1,4,5,9,3,10,8,6](2)
  !gapprompt@gap>| !gapinput@f:=Bipartition([[ 1, -2, -4 ], [ 2, 3, 4, -3 ], [ -1 ]]);;|
  !gapprompt@gap>| !gapinput@IsPartialPermBipartition(f);|
  false
  !gapprompt@gap>| !gapinput@AsPartialPerm(f);|
  fail
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AsPermutation (for a bipartition)}}
\logpage{[ 5, 3, 5 ]}\nobreak
\hyperdef{L}{X7C684CD38405DBEF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsPermutation({\mdseries\slshape f})\index{AsPermutation@\texttt{AsPermutation}!for a bipartition}
\label{AsPermutation:for a bipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A permutation or \texttt{fail}.



 When the argument \mbox{\texttt{\mdseries\slshape f}} is a bipartition that mathematically defines a permutation, this function
returns that permutation. 

 A bipartition \mbox{\texttt{\mdseries\slshape f}} defines a permutation if and only if its numbers of left, right, and
transverse blocks all equal its degree.

 See \texttt{IsPermBipartition} (\ref{IsPermBipartition}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -6 ], [ 2, -4 ], [ 3, -2 ], [ 4, -5 ], |
  !gapprompt@>| !gapinput@[ 5, -3 ], [ 6, -1 ] ] );;|
  !gapprompt@gap>| !gapinput@IsPermBipartition(f);|
  true
  !gapprompt@gap>| !gapinput@AsPermutation(f);|
  (1,6)(2,4,5,3)
  !gapprompt@gap>| !gapinput@AsBipartition(last)=f;|
  true
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Operators for bipartitions}}\label{operators-bipartitions}
\logpage{[ 5, 4, 0 ]}
\hyperdef{L}{X83F2C3C97E8FFA49}{}
{
  
\begin{description}
\item[{\texttt{\mbox{\texttt{\mdseries\slshape f}} * \mbox{\texttt{\mdseries\slshape g}}}}]  \index{*@\texttt{*} (for bipartitions)} returns the composition of \mbox{\texttt{\mdseries\slshape f}} and \mbox{\texttt{\mdseries\slshape g}} when \mbox{\texttt{\mdseries\slshape f}} and \mbox{\texttt{\mdseries\slshape g}} are bipartitions. 
\item[{\texttt{\mbox{\texttt{\mdseries\slshape f}} {\textless} \mbox{\texttt{\mdseries\slshape g}}}}]  \index{<@\texttt{{\textless}} (for bipartitions)} returns \texttt{true} if the internal representation of \mbox{\texttt{\mdseries\slshape f}} is lexicographically less than the internal representation of \mbox{\texttt{\mdseries\slshape g}} and \texttt{false} if it is not. 
\item[{\texttt{\mbox{\texttt{\mdseries\slshape f}} = \mbox{\texttt{\mdseries\slshape g}}}}]  \index{=@\texttt{=} (for bipartitions)} returns \texttt{true} if the bipartition \mbox{\texttt{\mdseries\slshape f}} equals the bipartition \mbox{\texttt{\mdseries\slshape g}} and returns \texttt{false} if it does not. 
\end{description}
 

\subsection{\textcolor{Chapter }{PartialPermLeqBipartition}}
\logpage{[ 5, 4, 1 ]}\nobreak
\hyperdef{L}{X7A39D36086647536}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PartialPermLeqBipartition({\mdseries\slshape x, y})\index{PartialPermLeqBipartition@\texttt{PartialPermLeqBipartition}}
\label{PartialPermLeqBipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If \mbox{\texttt{\mdseries\slshape x}} and \mbox{\texttt{\mdseries\slshape y}} are partial perm bipartitions, i.e. they satisfy \texttt{IsPartialPermBipartition} (\ref{IsPartialPermBipartition}), then this function returns \texttt{AsPartialPerm(\mbox{\texttt{\mdseries\slshape x}}){\textless}AsPartialPerm(\mbox{\texttt{\mdseries\slshape y}})}. }

 

\subsection{\textcolor{Chapter }{NaturalLeqPartialPermBipartition}}
\logpage{[ 5, 4, 2 ]}\nobreak
\hyperdef{L}{X8608D78F83D55108}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NaturalLeqPartialPermBipartition({\mdseries\slshape x, y})\index{NaturalLeqPartialPermBipartition@\texttt{NaturalLeqPartialPermBipartition}}
\label{NaturalLeqPartialPermBipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 The \emph{natural partial order} $\leq$ on an inverse semigroup \texttt{S} is defined by \texttt{s}$\leq$\texttt{t} if there exists an idempotent \texttt{e} in \texttt{S} such that \texttt{s=et}. Hence if \mbox{\texttt{\mdseries\slshape x}} and \mbox{\texttt{\mdseries\slshape y}} are partial perm bipartitions, then \mbox{\texttt{\mdseries\slshape x}}$\leq$\mbox{\texttt{\mdseries\slshape y}} if and only if \texttt{AsPartialPerm(\mbox{\texttt{\mdseries\slshape x}})} is a restriction of \texttt{AsPartialPerm(\mbox{\texttt{\mdseries\slshape y}})}. 

 \texttt{NaturalLeqPartialPermBipartition} returns \texttt{true} if \texttt{AsPartialPerm(\mbox{\texttt{\mdseries\slshape x}})} is a restriction of \texttt{AsPartialPerm(\mbox{\texttt{\mdseries\slshape y}})} and \texttt{false} if it is not. Note that since this is a partial order and not a total order,
it is possible that \mbox{\texttt{\mdseries\slshape x}} and \mbox{\texttt{\mdseries\slshape y}} are incomparable with respect to the natural partial order. }

 

\subsection{\textcolor{Chapter }{NaturalLeqBlockBijection}}
\logpage{[ 5, 4, 3 ]}\nobreak
\hyperdef{L}{X79E8FA077E24C1F4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NaturalLeqBlockBijection({\mdseries\slshape x, y})\index{NaturalLeqBlockBijection@\texttt{NaturalLeqBlockBijection}}
\label{NaturalLeqBlockBijection}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 The \emph{natural partial order} $\leq$ on an inverse semigroup \texttt{S} is defined by \texttt{s}$\leq$\texttt{t} if there exists an idempotent \texttt{e} in \texttt{S} such that \texttt{s=et}. Hence if \mbox{\texttt{\mdseries\slshape x}} and \mbox{\texttt{\mdseries\slshape y}} are block bijections, then \mbox{\texttt{\mdseries\slshape x}}$\leq$\mbox{\texttt{\mdseries\slshape y}} if and only if \mbox{\texttt{\mdseries\slshape x}} contains \mbox{\texttt{\mdseries\slshape y}}. 

 \texttt{NaturalLeqBlockBijection} returns \texttt{true} if \mbox{\texttt{\mdseries\slshape x}} is contained in \mbox{\texttt{\mdseries\slshape y}} and \texttt{false} if it is not. Note that since this is a partial order and not a total order,
it is possible that \mbox{\texttt{\mdseries\slshape x}} and \mbox{\texttt{\mdseries\slshape y}} are incomparable with respect to the natural partial order. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@x:=Bipartition( [ [ 1, 2, -3 ], [ 3, -1, -2 ], [ 4, -4 ], |
  !gapprompt@>| !gapinput@[ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], |
  !gapprompt@>| !gapinput@[ 10, -10 ] ] );;|
  !gapprompt@gap>| !gapinput@y:=Bipartition( [ [ 1, -2 ], [ 2, -1 ], [ 3, -3 ], [ 4, -4 ], |
  !gapprompt@>| !gapinput@[ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, -9 ], [ 10, -10 ] ] );;|
  !gapprompt@gap>| !gapinput@z:=Bipartition([Union([1..10],[-10..-1])]);;|
  !gapprompt@gap>| !gapinput@NaturalLeqBlockBijection(x, y);|
  false
  !gapprompt@gap>| !gapinput@NaturalLeqBlockBijection(y, x);|
  false
  !gapprompt@gap>| !gapinput@NaturalLeqBlockBijection(z, x);|
  true
  !gapprompt@gap>| !gapinput@NaturalLeqBlockBijection(z, y);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{PermLeftQuoBipartition}}
\logpage{[ 5, 4, 4 ]}\nobreak
\hyperdef{L}{X7D9F5A248028FF52}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PermLeftQuoBipartition({\mdseries\slshape f, g})\index{PermLeftQuoBipartition@\texttt{PermLeftQuoBipartition}}
\label{PermLeftQuoBipartition}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A permutation.



 If \mbox{\texttt{\mdseries\slshape f}} and \mbox{\texttt{\mdseries\slshape g}} are bipartitions with equal left and right blocks, then \texttt{PermLeftQuoBipartition} returns the permutation of the indices of the right blocks of \mbox{\texttt{\mdseries\slshape f}} (and \mbox{\texttt{\mdseries\slshape g}}) induced by \texttt{Star(\mbox{\texttt{\mdseries\slshape f}})*\mbox{\texttt{\mdseries\slshape g}}}. 

 \texttt{PermLeftQuoBipartition} verifies that \mbox{\texttt{\mdseries\slshape f}} and \mbox{\texttt{\mdseries\slshape g}} have equal left and right blocks, and returns an error if they do not. The
value returned by \texttt{PermLeftQuoBipartition(\mbox{\texttt{\mdseries\slshape f}},\mbox{\texttt{\mdseries\slshape g}})} is the same as that returned by \texttt{PermRightBlocks(RightBlocks(\mbox{\texttt{\mdseries\slshape f}}), Star(\mbox{\texttt{\mdseries\slshape f}})*\mbox{\texttt{\mdseries\slshape g}})}. See also \texttt{PermRightBlocks} (\ref{PermRightBlocks}) and \texttt{OnRightBlocksBipartitionByPerm} (\ref{OnRightBlocksBipartitionByPerm}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 6, 7, 8, 10 ], [ 2, 5, -1, -2, -8 ], |
  !gapprompt@>| !gapinput@[ 3, -3, -6, -7, -9 ], [ 9, -4, -5 ], [ -10 ] ] );;|
  !gapprompt@gap>| !gapinput@g:=Bipartition( [ [ 1, 4, 6, 7, 8, 10 ], [ 2, 5, -3, -6, -7, -9 ], |
  !gapprompt@>| !gapinput@[ 3, -4, -5 ], [ 9, -1, -2, -8 ], [ -10 ] ] );;|
  !gapprompt@gap>| !gapinput@PermLeftQuoBipartition(f, g);|
  (1,2,3)
  !gapprompt@gap>| !gapinput@Star(f)*g;|
  <bipartition: [ 1, 2, 8, -3, -6, -7, -9 ], [ 3, 6, 7, 9, -4, -5 ], 
   [ 4, 5, -1, -2, -8 ], [ 10 ], [ -10 ]>
  !gapprompt@gap>| !gapinput@PermRightBlocks(RightBlocks(f), last);|
  (1,2,3)
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{OnRightBlocksBipartitionByPerm}}
\logpage{[ 5, 4, 5 ]}\nobreak
\hyperdef{L}{X7FD1BC557DAAE665}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{OnRightBlocksBipartitionByPerm({\mdseries\slshape f, p})\index{OnRightBlocksBipartitionByPerm@\texttt{OnRightBlocksBipartitionByPerm}}
\label{OnRightBlocksBipartitionByPerm}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 If \mbox{\texttt{\mdseries\slshape f}} is a bipartition and \mbox{\texttt{\mdseries\slshape p}} is a permutation of the indices of the right blocks of \mbox{\texttt{\mdseries\slshape f}}, then \texttt{OnRightBlocksBipartitionByPerm} returns the bipartition obtained from \mbox{\texttt{\mdseries\slshape f}} by rearranging the right blocks of \mbox{\texttt{\mdseries\slshape f}} according to \mbox{\texttt{\mdseries\slshape p}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 6, 7, 8, 10 ], [ 2, 5, -1, -2, -8 ],|
  !gapprompt@>| !gapinput@[ 3, -3, -6, -7, -9 ], [ 9, -4, -5 ], [ -10 ] ] );;|
  !gapprompt@gap>| !gapinput@OnRightBlocksBipartitionByPerm(f, (1,2,3));|
  <bipartition: [ 1, 4, 6, 7, 8, 10 ], [ 2, 5, -3, -6, -7, -9 ], 
   [ 3, -4, -5 ], [ 9, -1, -2, -8 ], [ -10 ]>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Attributes for bipartitons}}\label{attributes-bipartitions}
\logpage{[ 5, 5, 0 ]}
\hyperdef{L}{X87F3A304814797CE}{}
{
  In this section we describe various attributes that a bipartition can possess. 

\subsection{\textcolor{Chapter }{DegreeOfBipartition}}
\logpage{[ 5, 5, 1 ]}\nobreak
\hyperdef{L}{X780F5E00784FE58C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DegreeOfBipartition({\mdseries\slshape f})\index{DegreeOfBipartition@\texttt{DegreeOfBipartition}}
\label{DegreeOfBipartition}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DegreeOfBipartitionCollection({\mdseries\slshape f})\index{DegreeOfBipartitionCollection@\texttt{DegreeOfBipartitionCollection}}
\label{DegreeOfBipartitionCollection}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A positive integer.



 The degree of a bipartition is, roughly speaking, the number of points where
it is defined. More precisely, if \mbox{\texttt{\mdseries\slshape f}} is a bipartition defined on \texttt{2*n} points, then the degree of \mbox{\texttt{\mdseries\slshape f}} is \texttt{n}. 

 The degree of a collection \mbox{\texttt{\mdseries\slshape coll}} of bipartitions of equal degree is just the degree of any (and every)
bipartition in \mbox{\texttt{\mdseries\slshape coll}}. The degree of collection of bipartitions of unequal degrees is not defined. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 7, -3, -8 ], [ 2, 6 ], [ 3 ], [ 4, -7, -9 ], |
  !gapprompt@>| !gapinput@[ 5, 9, -2 ], [ 8, -1, -4, -6 ], [ -5 ] ] );;|
  !gapprompt@gap>| !gapinput@DegreeOfBipartition(f);|
  9
  !gapprompt@gap>| !gapinput@s:=BrauerMonoid(5);|
  <regular bipartition monoid on 5 pts with 3 generators>
  !gapprompt@gap>| !gapinput@IsBipartitionCollection(s);|
  true
  !gapprompt@gap>| !gapinput@DegreeOfBipartitionCollection(s);|
  5
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RankOfBipartition}}
\logpage{[ 5, 5, 2 ]}\nobreak
\hyperdef{L}{X82074756826AD2C2}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RankOfBipartition({\mdseries\slshape f})\index{RankOfBipartition@\texttt{RankOfBipartition}}
\label{RankOfBipartition}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrTransverseBlocks({\mdseries\slshape f})\index{NrTransverseBlocks@\texttt{NrTransverseBlocks}!for a bipartition}
\label{NrTransverseBlocks:for a bipartition}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The rank of a bipartition.



 When the argument is a bipartition \mbox{\texttt{\mdseries\slshape f}}, \texttt{RankOfBipartition} returns the number of blocks of \mbox{\texttt{\mdseries\slshape f}} containing both positive and negative entries, i.e. the number of transverse
blocks of \mbox{\texttt{\mdseries\slshape f}}.

 \texttt{NrTransverseBlocks} is just a synonym for \texttt{RankOfBipartition}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 2, 6, 7, -4, -5, -7 ], [ 3, 4, 5, -1, -3 ], |
  !gapprompt@>| !gapinput@[ 8, -9 ], [ 9, -2 ], [ -6 ], [ -8 ] ] );|
  <bipartition: [ 1, 2, 6, 7, -4, -5, -7 ], [ 3, 4, 5, -1, -3 ], 
   [ 8, -9 ], [ 9, -2 ], [ -6 ], [ -8 ]>
  !gapprompt@gap>| !gapinput@RankOfBipartition(f);|
  4
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ExtRepOfBipartition}}
\logpage{[ 5, 5, 3 ]}\nobreak
\hyperdef{L}{X82CC5635841EE8A4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ExtRepOfBipartition({\mdseries\slshape f})\index{ExtRepOfBipartition@\texttt{ExtRepOfBipartition}}
\label{ExtRepOfBipartition}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A partition of \texttt{[1..2*n]}.



 If \texttt{n} is the degree of the bipartition \mbox{\texttt{\mdseries\slshape f}}, then \texttt{ExtRepOfBipartition} returns the partition of \texttt{[-n..-1]} union \texttt{[1..n]} corresponding to \mbox{\texttt{\mdseries\slshape f}} as a sorted list of duplicate-free lists. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 5, -3 ], [ 2, 4, -2, -4 ], [ 3, -1, -5 ] ] );|
  <block bijection: [ 1, 5, -3 ], [ 2, 4, -2, -4 ], [ 3, -1, -5 ]>
  !gapprompt@gap>| !gapinput@ExtRepOfBipartition(f);|
  [ [ 1, 5, -3 ], [ 2, 4, -2, -4 ], [ 3, -1, -5 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RightBlocks}}
\logpage{[ 5, 5, 4 ]}\nobreak
\hyperdef{L}{X86A10B138230C2A4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RightBlocks({\mdseries\slshape f})\index{RightBlocks@\texttt{RightBlocks}}
\label{RightBlocks}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The right blocks of a bipartition.



 \texttt{RightBlocks} returns the right blocks of the bipartition \mbox{\texttt{\mdseries\slshape f}}. 

 The \emph{right blocks} of a bipartition \mbox{\texttt{\mdseries\slshape f}} are just the intersections of the blocks of \mbox{\texttt{\mdseries\slshape f}} with \texttt{[-n..-1]} where \texttt{n} is the degree of \mbox{\texttt{\mdseries\slshape f}}, the values in transverse blocks are positive, and the values in
non-transverse blocks are negative. 

 The right blocks of bipartition are \textsf{GAP} objects in their own right, and are not simply a list of blocks of \mbox{\texttt{\mdseries\slshape f}}; see \ref{section-blocks} for more information. 

 The significance of this notion lies in the fact that bipartitions \texttt{x} and \texttt{y} are $\mathcal{L}$-related in the partition monoid if and only if they have equal right blocks. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 7, 8, -4 ], [ 2, 3, 5, -2, -7 ], |
  !gapprompt@>| !gapinput@[ 6, -1 ], [ -3 ], [ -5, -6, -8 ] ] );;|
  !gapprompt@gap>| !gapinput@RightBlocks(f);|
  <blocks: [ 1 ], [ 2, 7 ], [ -3 ], [ 4 ], [ -5, -6, -8 ]>
  !gapprompt@gap>| !gapinput@LeftBlocks(f);|
  <blocks: [ 1, 4, 7, 8 ], [ 2, 3, 5 ], [ 6 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{LeftBlocks}}
\logpage{[ 5, 5, 5 ]}\nobreak
\hyperdef{L}{X7B9B364379D8F4E8}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LeftBlocks({\mdseries\slshape f})\index{LeftBlocks@\texttt{LeftBlocks}}
\label{LeftBlocks}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The left blocks of a bipartition.



 \texttt{LeftBlocks} returns the left blocks of the bipartition \mbox{\texttt{\mdseries\slshape f}}. 

 The \emph{left blocks} of a bipartition \mbox{\texttt{\mdseries\slshape f}} are just the intersections of the blocks of \mbox{\texttt{\mdseries\slshape f}} with \texttt{[1..n]} where \texttt{n} is the degree of \mbox{\texttt{\mdseries\slshape f}}, the values in transverse blocks are positive, and the values in
non-transverse blocks are negative. 

 The left blocks of bipartition are \textsf{GAP} objects in their own right, and are not simply a list of blocks of \mbox{\texttt{\mdseries\slshape f}}; see \ref{section-blocks} for more information. 

 The significance of this notion lies in the fact that bipartitions \texttt{x} and \texttt{y} are $\mathcal{R}$-related in the partition monoid if and only if they have equal left blocks. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 7, 8, -4 ], [ 2, 3, 5, -2, -7 ], |
  !gapprompt@>| !gapinput@[ 6, -1 ], [ -3 ], [ -5, -6, -8 ] ] );;|
  !gapprompt@gap>| !gapinput@RightBlocks(f);|
  <blocks: [ 1 ], [ 2, 7 ], [ -3 ], [ 4 ], [ -5, -6, -8 ]>
  !gapprompt@gap>| !gapinput@LeftBlocks(f);|
  <blocks: [ 1, 4, 7, 8 ], [ 2, 3, 5 ], [ 6 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NrLeftBlocks}}
\logpage{[ 5, 5, 6 ]}\nobreak
\hyperdef{L}{X79AEDB5382FD25CF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrLeftBlocks({\mdseries\slshape f})\index{NrLeftBlocks@\texttt{NrLeftBlocks}}
\label{NrLeftBlocks}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A non-negative integer.



 When the argument is a bipartition \mbox{\texttt{\mdseries\slshape f}}, \texttt{NrLeftBlocks} returns the number of left blocks of \mbox{\texttt{\mdseries\slshape f}}, i.e. the number of blocks of \mbox{\texttt{\mdseries\slshape f}} intersecting \texttt{[1..n]} non-trivially. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 2, 3, 4, 5, 6, 8 ], [ 7, -2, -3 ], |
  !gapprompt@>| !gapinput@[ -1, -4, -7, -8 ], [ -5, -6 ] ] );;|
  !gapprompt@gap>| !gapinput@NrLeftBlocks(f);|
  2
  !gapprompt@gap>| !gapinput@LeftBlocks(f);|
  <blocks: [ -1, -2, -3, -4, -5, -6, -8 ], [ 7 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NrRightBlocks}}
\logpage{[ 5, 5, 7 ]}\nobreak
\hyperdef{L}{X86385A3C8662E1A7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrRightBlocks({\mdseries\slshape f})\index{NrRightBlocks@\texttt{NrRightBlocks}}
\label{NrRightBlocks}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A non-negative integer.



 When the argument is a bipartition \mbox{\texttt{\mdseries\slshape f}}, \texttt{NrRightBlocks} returns the number of right blocks of \mbox{\texttt{\mdseries\slshape f}}, i.e. the number of blocks of \mbox{\texttt{\mdseries\slshape f}} intersecting \texttt{[-n..-1]} non-trivially. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 2, 3, 4, 6, -2, -7 ], [ 5, -1, -3, -8 ], |
  !gapprompt@>| !gapinput@[ 7, -4, -6 ], [ 8 ], [ -5 ] ] );;|
  !gapprompt@gap>| !gapinput@RightBlocks(f);|
  <blocks: [ 1, 3, 8 ], [ 2, 7 ], [ 4, 6 ], [ -5 ]>
  !gapprompt@gap>| !gapinput@NrRightBlocks(f);|
  4
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NrBlocks (for blocks)}}
\logpage{[ 5, 5, 8 ]}\nobreak
\hyperdef{L}{X8110B6557A98FB5C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrBlocks({\mdseries\slshape blocks})\index{NrBlocks@\texttt{NrBlocks}!for blocks}
\label{NrBlocks:for blocks}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrBlocks({\mdseries\slshape f})\index{NrBlocks@\texttt{NrBlocks}!for a bipartition}
\label{NrBlocks:for a bipartition}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A positive integer.



 If \mbox{\texttt{\mdseries\slshape blocks}} is some blocks or \mbox{\texttt{\mdseries\slshape f}} is a bipartition, then \texttt{NrBlocks} returns the number of blocks in \mbox{\texttt{\mdseries\slshape blocks}} or \mbox{\texttt{\mdseries\slshape f}}, respectively. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@blocks:=BlocksNC([[ -1, -2, -3, -4 ], [ -5 ], [ 6 ]]);|
  <blocks: [ -1, -2, -3, -4 ], [ -5 ], [ 6 ]>
  !gapprompt@gap>| !gapinput@NrBlocks(blocks);|
  3
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 5 ], [ 2, 4, -2, -4 ], [ 3, 6, -1, -5, -6 ], |
  !gapprompt@>| !gapinput@[ -3 ] ] );|
  <bipartition: [ 1, 5 ], [ 2, 4, -2, -4 ], [ 3, 6, -1, -5, -6 ], 
   [ -3 ]>
  !gapprompt@gap>| !gapinput@NrBlocks(f);|
  4
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsTransBipartition}}
\logpage{[ 5, 5, 9 ]}\nobreak
\hyperdef{L}{X79C556827A578509}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsTransBipartition({\mdseries\slshape f})\index{IsTransBipartition@\texttt{IsTransBipartition}}
\label{IsTransBipartition}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If the bipartition \mbox{\texttt{\mdseries\slshape f}} defines a transformation, then \texttt{IsTransBipartition} returns \texttt{true}, and if not, then \texttt{false} is returned.

 A bipartition \mbox{\texttt{\mdseries\slshape f}} defines a transformation if and only if the number of left blocks equals the
number of transverse blocks and the number of right blocks equals the degree. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -2 ], [ 2, 5, -6 ], [ 3, -7 ], [ 6, 7, -9 ], |
  !gapprompt@>| !gapinput@[ 8, 9, -1 ], [ 10, -5 ], [ -3 ], [ -4 ], [ -8 ], [ -10 ] ] );;|
  !gapprompt@gap>| !gapinput@IsTransBipartition(f);|
  true
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -3, -6 ], [ 2, 5, -4, -5 ], [ 3, 6, -1 ], |
  !gapprompt@>| !gapinput@[ -2 ] ] );;|
  !gapprompt@gap>| !gapinput@IsTransBipartition(f);|
  false
  !gapprompt@gap>| !gapinput@Number(PartitionMonoid(3), IsTransBipartition);|
  27
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsDualTransBipartition}}
\logpage{[ 5, 5, 10 ]}\nobreak
\hyperdef{L}{X7F0B8ACC7C9A937F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsDualTransBipartition({\mdseries\slshape f})\index{IsDualTransBipartition@\texttt{IsDualTransBipartition}}
\label{IsDualTransBipartition}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If the star of the bipartition \mbox{\texttt{\mdseries\slshape f}} defines a transformation, then \texttt{IsDualTransBipartition} returns \texttt{true}, and if not, then \texttt{false} is returned.

 A bipartition is the dual of a transformation if and only if its number of
right blocks equals its number of transverse blocks and its number of left
blocks equals its degree. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -8, -9 ], [ 2, -1, -4 ], [ 3 ], [ 4 ], |
  !gapprompt@>| !gapinput@[ 5, -10 ], [ 6, -2, -5 ], [ 7, -3 ], [ 8 ], [ 9, -6, -7 ], [ 10 ] ] );;|
  !gapprompt@gap>| !gapinput@IsDualTransBipartition(f);|
  true
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -3, -6 ], [ 2, 5, -4, -5 ], [ 3, 6, -1 ], |
  !gapprompt@>| !gapinput@[ -2 ] ] );;|
  !gapprompt@gap>| !gapinput@IsTransBipartition(f);|
  false
  !gapprompt@gap>| !gapinput@Number(PartitionMonoid(3), IsDualTransBipartition);|
  27
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsPermBipartition}}
\logpage{[ 5, 5, 11 ]}\nobreak
\hyperdef{L}{X8031B53E7D0ECCFA}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsPermBipartition({\mdseries\slshape f})\index{IsPermBipartition@\texttt{IsPermBipartition}}
\label{IsPermBipartition}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If the bipartition \mbox{\texttt{\mdseries\slshape f}} defines a permutation, then \texttt{IsPermBipartition} returns \texttt{true}, and if not, then \texttt{false} is returned.

 A bipartition is a permutation if its numbers of left, right, and transverse
blocks all equal its degree. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -1 ], [ 2, -3 ], [ 3, 6, -5 ], |
  !gapprompt@>| !gapinput@[ 5, -2, -4, -6 ] ] );;|
  !gapprompt@gap>| !gapinput@IsPermBipartition(f);|
  false
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -3 ], [ 2, -4 ], [ 3, -6 ], |
  !gapprompt@>| !gapinput@[ 4, -1 ], [ 5, -5 ], [ 6, -2 ], [ 7, -8 ], [ 8, -7 ] ] );;|
  !gapprompt@gap>| !gapinput@IsPermBipartition(f);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsPartialPermBipartition}}
\logpage{[ 5, 5, 12 ]}\nobreak
\hyperdef{L}{X87C771D37B1FE95C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsPartialPermBipartition({\mdseries\slshape f})\index{IsPartialPermBipartition@\texttt{IsPartialPermBipartition}}
\label{IsPartialPermBipartition}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If the bipartition \mbox{\texttt{\mdseries\slshape f}} defines a partial permutation, then \texttt{IsPartialPermBipartition} returns \texttt{true}, and if not, then \texttt{false} is returned.

 A bipartition \mbox{\texttt{\mdseries\slshape f}} defines a partial permutation if and only if the numbers of left and right
blocks of \mbox{\texttt{\mdseries\slshape f}} equal the degree of \mbox{\texttt{\mdseries\slshape f}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -1 ], [ 2, -3 ], [ 3, 6, -5 ], |
  !gapprompt@>| !gapinput@[ 5, -2, -4, -6 ] ] );;|
  !gapprompt@gap>| !gapinput@IsPartialPermBipartition(f);|
  false
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, -3 ], [ 2 ], [ -4 ], [ 3, -6 ], [ 4, -1 ], |
  !gapprompt@>| !gapinput@[ 5, -5 ], [ 6, -2 ], [ 7, -8 ], [ 8, -7 ] ] );;|
  !gapprompt@gap>| !gapinput@IsPermBipartition(f);|
  false
  !gapprompt@gap>| !gapinput@IsPartialPermBipartition(f); |
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsBlockBijection}}
\logpage{[ 5, 5, 13 ]}\nobreak
\hyperdef{L}{X829494DF7FD6CFEC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBlockBijection({\mdseries\slshape f})\index{IsBlockBijection@\texttt{IsBlockBijection}}
\label{IsBlockBijection}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If the bipartition \mbox{\texttt{\mdseries\slshape f}} induces a bijection from the quotient of \texttt{[1..n]} by the blocks of \mbox{\texttt{\mdseries\slshape f}} to the quotient of \texttt{[-n..-1]} by the blocks of \mbox{\texttt{\mdseries\slshape f}}, then \texttt{IsBlockBijection} return \texttt{true}, and if not, then it returns \texttt{false}. 

 A bipartition is a block bijection if and only if its number of blocks, left
blocks and right blocks are equal. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 5, -2 ], [ 2, 3, -1 ], |
  !gapprompt@>| !gapinput@[ 6, -5, -6 ], [ -3, -4 ] ] );;|
  !gapprompt@gap>| !gapinput@IsBlockBijection(f);|
  false
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 2, -3 ], [ 3, -1, -2 ], [ 4, -4 ], |
  !gapprompt@>| !gapinput@[ 5, -5 ] ] );;|
  !gapprompt@gap>| !gapinput@IsBlockBijection(f);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsUniformBlockBijection}}
\logpage{[ 5, 5, 14 ]}\nobreak
\hyperdef{L}{X79D54AD8833B9551}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsUniformBlockBijection({\mdseries\slshape x})\index{IsUniformBlockBijection@\texttt{IsUniformBlockBijection}}
\label{IsUniformBlockBijection}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 If the bipartition \mbox{\texttt{\mdseries\slshape x}} is a block bijection where every block contains an equal number of positive
and negative entries, then \texttt{IsUniformBlockBijection} returns \texttt{true}, and otherwise it returns \texttt{false}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@x:=Bipartition( [ [ 1, 2, -3, -4 ], [ 3, -5 ], [ 4, -6 ], |
  !gapprompt@>| !gapinput@[ 5, -7 ], [ 6, -8 ], [ 7, -9 ], [ 8, -1 ], [ 9, -2 ] ] );;|
  !gapprompt@gap>| !gapinput@IsBlockBijection(x); |
  true
  !gapprompt@gap>| !gapinput@x:=Bipartition( [ [ 1, 2, -3 ], [ 3, -1, -2 ], [ 4, -4 ], |
  !gapprompt@>| !gapinput@[ 5, -5 ] ] );;|
  !gapprompt@gap>| !gapinput@IsUniformBlockBijection(x);|
  false
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Creating blocks and their attributes}}\label{section-blocks}
\logpage{[ 5, 6, 0 ]}
\hyperdef{L}{X87684C148592F831}{}
{
  As described above the left and right blocks of a bipartition characterise
Green's $\mathcal{R}$- and $\mathcal{L}$-relation on the partition monoid; see \texttt{LeftBlocks} (\ref{LeftBlocks}) and \texttt{RightBlocks} (\ref{RightBlocks}). The left or right blocks of a bipartition are \textsf{GAP} objects in their own right. 

 In this section, we describe the functions in the \textsf{Semigroups} package for creating and manipulating the left or right blocks of a
bipartition. 

\subsection{\textcolor{Chapter }{BlocksNC}}
\logpage{[ 5, 6, 1 ]}\nobreak
\hyperdef{L}{X7D6C636785C2E8E0}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{BlocksNC({\mdseries\slshape classes})\index{BlocksNC@\texttt{BlocksNC}}
\label{BlocksNC}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A blocks.



 This function makes it possible to create a \textsf{GAP} object corresponding to the left or right blocks of a bipartition without
reference to any bipartitions. 

 \texttt{BlocksNC} returns the blocks with equivalence classes \mbox{\texttt{\mdseries\slshape classes}}, which should be a list of duplicate-free lists consisting solely of positive
or negative integers, where the union of the absolute values of the lists is \texttt{[1..n]} for some \texttt{n}. The blocks with positive entries correspond to transverse blocks and the
classes with negative entries correspond to non-transverse blocks. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@BlocksNC([[ 1 ], [ 2 ], [ -3, -6 ], [ -4, -5 ]]);|
  <blocks: [ 1 ], [ 2 ], [ -3, -6 ], [ -4, -5 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ExtRepOfBlocks}}
\logpage{[ 5, 6, 2 ]}\nobreak
\hyperdef{L}{X7A188D947B20CF96}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ExtRepOfBlocks({\mdseries\slshape blocks})\index{ExtRepOfBlocks@\texttt{ExtRepOfBlocks}}
\label{ExtRepOfBlocks}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A list of integers.



 If \texttt{n} is the degree of a bipartition with left or right blocks \mbox{\texttt{\mdseries\slshape blocks}}, then \texttt{ExtRepOfBlocks} returns the partition corresponding to \mbox{\texttt{\mdseries\slshape blocks}} as a sorted list of duplicate-free lists. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@blocks:=BlocksNC([[ 1, 6 ], [ 2, 3, 7 ], [ 4, 5 ], [ -8 ] ]);;|
  !gapprompt@gap>| !gapinput@ExtRepOfBlocks(blocks);|
  [ [ 1, 6 ], [ 2, 3, 7 ], [ 4, 5 ], [ -8 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RankOfBlocks}}
\logpage{[ 5, 6, 3 ]}\nobreak
\hyperdef{L}{X787D22AE7FA69239}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RankOfBlocks({\mdseries\slshape blocks})\index{RankOfBlocks@\texttt{RankOfBlocks}}
\label{RankOfBlocks}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrTransverseBlocks({\mdseries\slshape blocks})\index{NrTransverseBlocks@\texttt{NrTransverseBlocks}!for blocks}
\label{NrTransverseBlocks:for blocks}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A non-negative integer.



 When the argument \mbox{\texttt{\mdseries\slshape blocks}} is the left or right blocks of a bipartition, \texttt{RankOfBlocks} returns the number of blocks of \mbox{\texttt{\mdseries\slshape blocks}} containing only positive entries, i.e. the number of transverse blocks in \mbox{\texttt{\mdseries\slshape blocks}}. 

 \texttt{NrTransverseBlocks} is a synonym of \texttt{RankOfBlocks} in this context. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@blocks:=BlocksNC([ [ -1, -2, -4, -6 ], [ 3, 10, 12 ], [ 5, 7 ], |
  !gapprompt@>| !gapinput@[ 8 ], [ 9 ], [ -11 ] ]);;|
  !gapprompt@gap>| !gapinput@RankOfBlocks(blocks);|
  4
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{DegreeOfBlocks}}
\logpage{[ 5, 6, 4 ]}\nobreak
\hyperdef{L}{X8527DC6A8771C2BE}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DegreeOfBlocks({\mdseries\slshape blocks})\index{DegreeOfBlocks@\texttt{DegreeOfBlocks}}
\label{DegreeOfBlocks}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A non-negative integer.



 The degree of \mbox{\texttt{\mdseries\slshape blocks}} is the number of points \texttt{n} where it is defined, i.e. the union of the blocks in \mbox{\texttt{\mdseries\slshape blocks}} will be \texttt{[1..n]} after taking the absolute value of every element. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@blocks:=BlocksNC([ [ -1, -11 ], [ 2 ], [ 3, 5, 6, 7 ], [ 4, 8 ], |
  !gapprompt@>| !gapinput@[ 9, 10 ], [ 12 ] ]);;|
  !gapprompt@gap>| !gapinput@DegreeOfBlocks(blocks);|
  12
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Actions on blocks}}\logpage{[ 5, 7, 0 ]}
\hyperdef{L}{X7A45E0067F344683}{}
{
 Bipartitions act on left and right blocks in several ways, which are described
in this section. 

\subsection{\textcolor{Chapter }{OnRightBlocks}}
\logpage{[ 5, 7, 1 ]}\nobreak
\hyperdef{L}{X7B701DA37F75E77B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{OnRightBlocks({\mdseries\slshape blocks, f})\index{OnRightBlocks@\texttt{OnRightBlocks}}
\label{OnRightBlocks}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
The blocks of a bipartition.



 \texttt{OnRightBlocks} returns the right blocks of the product \texttt{g*\mbox{\texttt{\mdseries\slshape f}}} where \texttt{g} is any bipartition whose right blocks are equal to \mbox{\texttt{\mdseries\slshape blocks}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 5, 8 ], [ 2, 3, 7 ], [ 6, -3, -4, -5 ], |
  !gapprompt@>| !gapinput@ [ -1, -2, -6 ], [ -7, -8 ] ] );;|
  !gapprompt@gap>| !gapinput@g:=Bipartition( [ [ 1, 5 ], [ 2, 4, 8, -2 ], [ 3, 6, 7, -3, -4 ], |
  !gapprompt@>| !gapinput@ [ -1, -6, -8 ], [ -5, -7 ] ] );;|
  !gapprompt@gap>| !gapinput@RightBlocks(g*f);|
  <blocks: [ -1, -2, -6 ], [ 3, 4, 5 ], [ -7, -8 ]>
  !gapprompt@gap>| !gapinput@OnRightBlocks(RightBlocks(g), f); |
  <blocks: [ -1, -2, -6 ], [ 3, 4, 5 ], [ -7, -8 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{OnLeftBlocks}}
\logpage{[ 5, 7, 2 ]}\nobreak
\hyperdef{L}{X7A5A4AF57BEA2313}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{OnLeftBlocks({\mdseries\slshape blocks, f})\index{OnLeftBlocks@\texttt{OnLeftBlocks}}
\label{OnLeftBlocks}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
The blocks of a bipartition.



 \texttt{OnLeftBlocks} returns the left blocks of the product \texttt{\mbox{\texttt{\mdseries\slshape f}}*g} where \texttt{g} is any bipartition whose left blocks are equal to \mbox{\texttt{\mdseries\slshape blocks}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 5, 7, -1, -3, -4, -6 ], [ 2, 3, 6, 8 ], |
  !gapprompt@>| !gapinput@[ 4, -2, -5, -8 ], [ -7 ] ] );;|
  !gapprompt@gap>| !gapinput@g:=Bipartition( [ [ 1, 3, -4, -5 ], [ 2, 4, 5, 8 ], [ 6, -1, -3 ], |
  !gapprompt@>| !gapinput@[ 7, -2, -6, -7, -8 ] ] );;|
  !gapprompt@gap>| !gapinput@LeftBlocks(f*g);|
  <blocks: [ 1, 4, 5, 7 ], [ -2, -3, -6, -8 ]>
  !gapprompt@gap>| !gapinput@OnLeftBlocks(LeftBlocks(g), f);|
  <blocks: [ 1, 4, 5, 7 ], [ -2, -3, -6, -8 ]>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{PermRightBlocks}}
\logpage{[ 5, 7, 3 ]}\nobreak
\hyperdef{L}{X78430AE181917382}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PermRightBlocks({\mdseries\slshape blocks, f})\index{PermRightBlocks@\texttt{PermRightBlocks}}
\label{PermRightBlocks}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PermLeftBlocks({\mdseries\slshape blocks, f})\index{PermLeftBlocks@\texttt{PermLeftBlocks}}
\label{PermLeftBlocks}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A permutation.



 If \mbox{\texttt{\mdseries\slshape f}} is a bipartition that stabilises \mbox{\texttt{\mdseries\slshape blocks}}, i.e. \texttt{OnRightBlocks(\mbox{\texttt{\mdseries\slshape blocks}}, \mbox{\texttt{\mdseries\slshape f}})=\mbox{\texttt{\mdseries\slshape blocks}}}, then \texttt{PermRightBlocks} returns the permutation of the indices of the transverse blocks of \mbox{\texttt{\mdseries\slshape blocks}} under the action of \mbox{\texttt{\mdseries\slshape f}}.

 \texttt{PermLeftBlocks} is the analogue of \texttt{PermRightBlocks} with respect to \texttt{OnLeftBlocks} (\ref{OnLeftBlocks}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 10 ], [ 2, -7, -9 ], [ 3, 4, 6, 8 ], [ 5, -5 ], |
  !gapprompt@>| !gapinput@[ 7, 9, -2 ], [ -1, -10 ], [ -3, -4, -6, -8 ] ] );;|
  !gapprompt@gap>| !gapinput@blocks:=BlocksNC([[ -1, -10 ], [ 2 ], [ -3, -4, -6, -8 ], [ 5 ], |
  !gapprompt@>| !gapinput@[ 7, 9 ]]);;|
  !gapprompt@gap>| !gapinput@OnRightBlocks(blocks, f)=blocks;|
  true
  !gapprompt@gap>| !gapinput@PermRightBlocks(blocks, f);|
  (2,5)
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{InverseRightBlocks}}
\logpage{[ 5, 7, 4 ]}\nobreak
\hyperdef{L}{X841E627787585C23}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{InverseRightBlocks({\mdseries\slshape blocks, f})\index{InverseRightBlocks@\texttt{InverseRightBlocks}}
\label{InverseRightBlocks}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 If \texttt{OnRightBlocks(\mbox{\texttt{\mdseries\slshape blocks}}, \mbox{\texttt{\mdseries\slshape f}})} has rank equal to the rank of \mbox{\texttt{\mdseries\slshape blocks}}, then \texttt{InverseRightBlocks} returns a bipartition \texttt{g} such that \texttt{OnRightBlocks(\mbox{\texttt{\mdseries\slshape blocks}}, \mbox{\texttt{\mdseries\slshape f}}*g)=\mbox{\texttt{\mdseries\slshape blocks}}} and where \texttt{PermRightBlocks(\mbox{\texttt{\mdseries\slshape blocks}}, \mbox{\texttt{\mdseries\slshape f}}*g)} is the identity permutation.

 See \texttt{PermRightBlocks} (\ref{PermRightBlocks}) and \texttt{OnRightBlocks} (\ref{OnRightBlocks}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 7, 8, -4 ], [ 2, 3, 5, -2, -7 ], |
  !gapprompt@>| !gapinput@[ 6, -1 ], [ -3 ], [ -5, -6, -8 ] ] );;|
  !gapprompt@gap>| !gapinput@blocks:=BlocksNC([[ -1, -4, -5, -8 ], [ -2, -3, -7 ], [ 6 ]]);;|
  !gapprompt@gap>| !gapinput@RankOfBlocks(blocks);|
  1
  !gapprompt@gap>| !gapinput@RankOfBlocks(OnRightBlocks(blocks, f));|
  1
  !gapprompt@gap>| !gapinput@g:=InverseRightBlocks(blocks, f);|
  <bipartition: [ 1, -6 ], [ 2, 3, 4, 5, 6, 7, 8 ], [ -1, -4, -5, -8 ], 
   [ -2, -3, -7 ]>
  !gapprompt@gap>| !gapinput@blocks;|
  <blocks: [ -1, -4, -5, -8 ], [ -2, -3, -7 ], [ 6 ]>
  !gapprompt@gap>| !gapinput@OnRightBlocks(blocks, f*g);|
  <blocks: [ -1, -4, -5, -8 ], [ -2, -3, -7 ], [ 6 ]>
  !gapprompt@gap>| !gapinput@PermRightBlocks(blocks, f*g);|
  ()
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{InverseLeftBlocks}}
\logpage{[ 5, 7, 5 ]}\nobreak
\hyperdef{L}{X7FB7FB28812F9AD7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{InverseLeftBlocks({\mdseries\slshape blocks, f})\index{InverseLeftBlocks@\texttt{InverseLeftBlocks}}
\label{InverseLeftBlocks}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A bipartition.



 If \texttt{OnLeftBlocks(\mbox{\texttt{\mdseries\slshape blocks}}, \mbox{\texttt{\mdseries\slshape f}})} has rank equal to the rank of \mbox{\texttt{\mdseries\slshape blocks}}, then \texttt{InverseLeftBlocks} returns a bipartition \texttt{g} such that \texttt{OnLeftBlocks(\mbox{\texttt{\mdseries\slshape blocks}}, g*\mbox{\texttt{\mdseries\slshape f}})=\mbox{\texttt{\mdseries\slshape blocks}}} and where \texttt{PermLeftBlocks(\mbox{\texttt{\mdseries\slshape blocks}}, g*\mbox{\texttt{\mdseries\slshape f}})} is the identity permutation.

 See \texttt{PermLeftBlocks} (\ref{PermLeftBlocks}) and \texttt{OnLeftBlocks} (\ref{OnLeftBlocks}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, 7, 8, -4 ], [ 2, 3, 5, -2, -7 ], |
  !gapprompt@>| !gapinput@[ 6, -1 ], [ -3 ], [ -5, -6, -8 ] ] );;|
  !gapprompt@gap>| !gapinput@blocks:=BlocksNC([[ -1, -2, -6 ], [ 3, 4, 5 ], [ -7, -8 ]]);;|
  !gapprompt@gap>| !gapinput@RankOfBlocks(OnLeftBlocks(blocks, f));|
  1
  !gapprompt@gap>| !gapinput@g:=InverseLeftBlocks(blocks, f);|
  <bipartition: [ 1, 2, 6 ], [ 3, 4, 5, -1, -2, -3, -4, -5, -6, -7, -8 ]
    , [ 7, 8 ]>
  !gapprompt@gap>| !gapinput@OnLeftBlocks(blocks, g*f);|
  <blocks: [ -1, -2, -6 ], [ 3, 4, 5 ], [ -7, -8 ]>
  !gapprompt@gap>| !gapinput@PermLeftBlocks(blocks, g*f);          |
  ()
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Visualising blocks and bipartitions}}\logpage{[ 5, 8, 0 ]}
\hyperdef{L}{X7FF53DBA7C20AD43}{}
{
 There are some functions in \textsf{Semigroups} for creating {\LaTeX} pictures of bipartitions and blocks. Descriptions of these methods can be
found in this section. 

 The functions described in this section return a string, which can be written
to a file using the function \texttt{FileString} (\textbf{GAPDoc: FileString}) or viewed using \texttt{Splash} (\ref{Splash}). 

\subsection{\textcolor{Chapter }{TikzBipartition}}
\logpage{[ 5, 8, 1 ]}\nobreak
\hyperdef{L}{X7E5E9A5187FC803E}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TikzBipartition({\mdseries\slshape f[, opts]})\index{TikzBipartition@\texttt{TikzBipartition}}
\label{TikzBipartition}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A string.



 This function produces a graphical representation of the bipartition \mbox{\texttt{\mdseries\slshape f}} using the \texttt{tikz} package for {\LaTeX}. More precisely, this function outputs a string containing a minimal {\LaTeX} document which can be compiled using {\LaTeX} to produce a picture of \mbox{\texttt{\mdseries\slshape f}}. 

 If the optional second argument \mbox{\texttt{\mdseries\slshape opts}} is a record with the component \texttt{colors} set to \texttt{true}, then the blocks of \mbox{\texttt{\mdseries\slshape f}} will be colored using the standard \texttt{tikz} colors. Due to the limited number of colors available in \texttt{tikz} this option only works when the degree of \mbox{\texttt{\mdseries\slshape f}} is less than 20. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 5 ], [ 2, 4, -3, -5 ], [ 3, -1, -2 ], |
  !gapprompt@>| !gapinput@[ -4 ] ] );;|
  !gapprompt@gap>| !gapinput@TikzBipartition(f);|
  "%tikz\n\\documentclass{minimal}\n\\usepackage{tikz}\n\\begin{documen\
  t}\n\\begin{tikzpicture}\n\n  %block #1\n  %vertices and labels\n  \\\
  fill(1,2)circle(.125);\n  \\draw(0.95, 2.2) node [above] {{ $1$}};\n \
   \\fill(5,2)circle(.125);\n  \\draw(4.95, 2.2) node [above] {{ $5$}};\
  \n\n  %lines\n  \\draw(1,1.875) .. controls (1,1.1) and (5,1.1) .. (5\
  ,1.875);\n\n  %block #2\n  %vertices and labels\n  \\fill(2,2)circle(\
  .125);\n  \\draw(1.95, 2.2) node [above] {{ $2$}};\n  \\fill(4,2)circ\
  le(.125);\n  \\draw(3.95, 2.2) node [above] {{ $4$}};\n  \\fill(3,0)c\
  ircle(.125);\n  \\draw(3, -0.2) node [below] {{ $-3$}};\n  \\fill(5,0\
  )circle(.125);\n  \\draw(5, -0.2) node [below] {{ $-5$}};\n\n  %lines\
  \n  \\draw(2,1.875) .. controls (2,1.3) and (4,1.3) .. (4,1.875);\n  \
  \\draw(3,0.125) .. controls (3,0.7) and (5,0.7) .. (5,0.125);\n  \\dr\
  aw(2,2)--(3,0);\n\n  %block #3\n  %vertices and labels\n  \\fill(3,2)\
  circle(.125);\n  \\draw(2.95, 2.2) node [above] {{ $3$}};\n  \\fill(1\
  ,0)circle(.125);\n  \\draw(1, -0.2) node [below] {{ $-1$}};\n  \\fill\
  (2,0)circle(.125);\n  \\draw(2, -0.2) node [below] {{ $-2$}};\n\n  %l\
  ines\n  \\draw(1,0.125) .. controls (1,0.6) and (2,0.6) .. (2,0.125);\
  \n  \\draw(3,2)--(2,0);\n\n  %block #4\n  %vertices and labels\n  \\f\
  ill(4,0)circle(.125);\n  \\draw(4, -0.2) node [below] {{ $-4$}};\n\n \
   %lines\n\\end{tikzpicture}\n\n\\end{document}"
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{TikzBlocks}}
\logpage{[ 5, 8, 2 ]}\nobreak
\hyperdef{L}{X7A0C438B7CA517DB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TikzBlocks({\mdseries\slshape blocks})\index{TikzBlocks@\texttt{TikzBlocks}}
\label{TikzBlocks}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A string.



 This function produces a graphical representation of the blocks \mbox{\texttt{\mdseries\slshape blocks}} of a bipartition using the \texttt{tikz} package for {\LaTeX}. More precisely, this function outputs a string containing a minimal {\LaTeX} document which can be compiled using {\LaTeX} to produce a picture of \mbox{\texttt{\mdseries\slshape blocks}}. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -2, -3 ], [ 2, 3, 5, -5 ], [ -1, -4 ] ] );;|
  !gapprompt@gap>| !gapinput@TikzBlocks(RightBlocks(f));|
  "%tikz\n\\documentclass{minimal}\n\\usepackage{tikz}\n\\begin{documen\
  t}\n\\begin{tikzpicture}\n  \\draw[ultra thick](5,2)circle(.115);\n  \
  \\draw(1.8,5) node [top] {{$1$}};\n  \\fill(4,2)circle(.125);\n  \\dr\
  aw(1.8,4) node [top] {{$2$}};\n  \\fill(3,2)circle(.125);\n  \\draw(1\
  .8,3) node [top] {{$3$}};\n  \\draw[ultra thick](2,2)circle(.115);\n \
   \\draw(1.8,2) node [top] {{$4$}};\n  \\fill(1,2)circle(.125);\n  \\d\
  raw(1.8,1) node [top] {{$5$}};\n\n  \\draw (5,2.125) .. controls (5,2\
  .8) and (2,2.8) .. (2,2.125);\n  \\draw (4,2.125) .. controls (4,2.6)\
   and (3,2.6) .. (3,2.125);\n\\end{tikzpicture}\n\n\\end{document}"
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Semigroups of bipartitions}}\logpage{[ 5, 9, 0 ]}
\hyperdef{L}{X876C963F830719E2}{}
{
 Semigroups and monoids of bipartitions can be created in the usual way in \textsf{GAP} using the functions \texttt{Semigroup} (\textbf{Reference: Semigroup}) and \texttt{Monoid} (\textbf{Reference: Monoid}). 

 It is possible to create inverse semigroups and monoids of bipartitions using \texttt{InverseSemigroup} (\textbf{Reference: InverseSemigroup}) and \texttt{InverseMonoid} (\textbf{Reference: InverseMonoid}) when the argument is a collection of block bijections or partial perm
bipartions; see \texttt{IsBlockBijection} (\ref{IsBlockBijection}) and \texttt{IsPartialPermBipartition} (\ref{IsPartialPermBipartition}). 

\subsection{\textcolor{Chapter }{IsBipartitionSemigroup}}
\logpage{[ 5, 9, 1 ]}\nobreak
\hyperdef{L}{X810BFF647C4E191E}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBipartitionSemigroup({\mdseries\slshape S})\index{IsBipartitionSemigroup@\texttt{IsBipartitionSemigroup}}
\label{IsBipartitionSemigroup}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBipartitionMonoid({\mdseries\slshape S})\index{IsBipartitionMonoid@\texttt{IsBipartitionMonoid}}
\label{IsBipartitionMonoid}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A \emph{bipartition semigroup} is simply a semigroup consisting of bipartitions. An object \mbox{\texttt{\mdseries\slshape obj}} is a bipartition semigroup in \textsf{GAP} if it satisfies \texttt{IsSemigroup} (\textbf{Reference: IsSemigroup}) and \texttt{IsBipartitionCollection} (\ref{IsBipartitionCollection}).

 A \emph{bipartition monoid} is a monoid consisting of bipartitions. An object \mbox{\texttt{\mdseries\slshape obj}} is a bipartition monoid in \textsf{GAP} if it satisfies \texttt{IsMonoid} (\textbf{Reference: IsMonoid}) and \texttt{IsBipartitionCollection} (\ref{IsBipartitionCollection}).

 Note that it is possible for a bipartition semigroup to have a multiplicative
neutral element (i.e. an identity element) but not to satisfy \texttt{IsBipartitionMonoid}. For example, 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@f:=Bipartition( [ [ 1, 4, -2 ], [ 2, 5, -6 ], [ 3, -7 ], |
  !gapprompt@>| !gapinput@[ 6, 7, -9 ], [ 8, 9, -1 ], [ 10, -5 ], [ -3 ], [ -4 ], |
  !gapprompt@>| !gapinput@[ -8 ], [ -10 ] ] );;|
  !gapprompt@gap>| !gapinput@S:=Semigroup(f, One(f));|
  <commutative bipartition monoid on 10 pts with 1 generator>
  !gapprompt@gap>| !gapinput@IsMonoid(S);|
  true
  !gapprompt@gap>| !gapinput@IsBipartitionMonoid(S);|
  true
  !gapprompt@gap>| !gapinput@S:=Semigroup( Bipartition( [ [ 1, -3 ], [ 2, -8 ], [ 3, 8, -1 ], |
  !gapprompt@>| !gapinput@[ 4, -4 ], [ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 9, 10, -10 ], |
  !gapprompt@>| !gapinput@[ -2 ], [ -9 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ], |
  !gapprompt@>| !gapinput@[ 5, -5 ], [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, 10, -10 ], |
  !gapprompt@>| !gapinput@[ -9 ] ] ) );;|
  !gapprompt@gap>| !gapinput@One(S);|
  fail
  !gapprompt@gap>| !gapinput@MultiplicativeNeutralElement(S);|
  <bipartition: [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 4, -4 ], [ 5, -5 ], 
   [ 6, -6 ], [ 7, -7 ], [ 8, -8 ], [ 9, 10, -10 ], [ -9 ]>
  !gapprompt@gap>| !gapinput@IsMonoid(S);|
  false
\end{Verbatim}
 In this example \texttt{S} cannot be converted into a monoid using \texttt{AsMonoid} (\textbf{Reference: AsMonoid}) since the \texttt{One} (\textbf{Reference: One}) of any element in \texttt{S} differs from the multiplicative neutral element. 

 For more details see \texttt{IsMagmaWithOne} (\textbf{Reference: IsMagmaWithOne}). }

 

\subsection{\textcolor{Chapter }{IsBlockBijectionSemigroup}}
\logpage{[ 5, 9, 2 ]}\nobreak
\hyperdef{L}{X80C37124794636F3}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBlockBijectionSemigroup({\mdseries\slshape S})\index{IsBlockBijectionSemigroup@\texttt{IsBlockBijectionSemigroup}}
\label{IsBlockBijectionSemigroup}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsBlockBijectionMonoid({\mdseries\slshape S})\index{IsBlockBijectionMonoid@\texttt{IsBlockBijectionMonoid}}
\label{IsBlockBijectionMonoid}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A \emph{block bijection semigroup} is simply a semigroup consisting of block bijections. A \emph{block bijection monoid} is a monoid consisting of block bijections.

 An object in \textsf{GAP} is a block bijection monoid if it satisfies \texttt{IsMonoid} (\textbf{Reference: IsMonoid}) and \texttt{IsBlockBijectionSemigroup}.

 See \texttt{IsBlockBijection} (\ref{IsBlockBijection}). }

 

\subsection{\textcolor{Chapter }{IsPartialPermBipartitionSemigroup}}
\logpage{[ 5, 9, 3 ]}\nobreak
\hyperdef{L}{X79A706A582ABE558}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsPartialPermBipartitionSemigroup({\mdseries\slshape S})\index{IsPartialPermBipartitionSemigroup@\texttt{IsPartialPermBipartitionSemigroup}}
\label{IsPartialPermBipartitionSemigroup}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsPartialPermBipartitionMonoid({\mdseries\slshape S})\index{IsPartialPermBipartitionMonoid@\texttt{IsPartialPermBipartitionMonoid}}
\label{IsPartialPermBipartitionMonoid}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A \emph{partial perm bipartition semigroup} is simply a semigroup consisting of partial perm bipartitions. A \emph{partial perm bipartition monoid} is a monoid consisting of partial perm bipartitions.

 An object in \textsf{GAP} is a partial perm bipartition monoid if it satisfies \texttt{IsMonoid} (\textbf{Reference: IsMonoid}) and \texttt{IsPartialPermBipartitionSemigroup}.

 See \texttt{IsPartialPermBipartition} (\ref{IsPartialPermBipartition}). }

 

\subsection{\textcolor{Chapter }{IsPermBipartitionGroup}}
\logpage{[ 5, 9, 4 ]}\nobreak
\hyperdef{L}{X7DEE07577D7379AC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsPermBipartitionGroup({\mdseries\slshape S})\index{IsPermBipartitionGroup@\texttt{IsPermBipartitionGroup}}
\label{IsPermBipartitionGroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 A \emph{perm bipartition group} is simply a semigroup consisting of perm bipartitions.

 See \texttt{IsPermBipartition} (\ref{IsPermBipartition}).

 }

 

\subsection{\textcolor{Chapter }{DegreeOfBipartitionSemigroup}}
\logpage{[ 5, 9, 5 ]}\nobreak
\hyperdef{L}{X8162E2BB7CF144F5}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DegreeOfBipartitionSemigroup({\mdseries\slshape S})\index{DegreeOfBipartitionSemigroup@\texttt{DegreeOfBipartitionSemigroup}}
\label{DegreeOfBipartitionSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A non-negative integer.



 The \emph{degree} of a bipartition semigroup \mbox{\texttt{\mdseries\slshape S}} is just the degree of any (and every) element of \mbox{\texttt{\mdseries\slshape S}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@DegreeOfBipartitionSemigroup(JonesMonoid(8));|
  8
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{Free inverse semigroups and free bands}}\label{Free inverse semigroups}
\logpage{[ 6, 0, 0 ]}
\hyperdef{L}{X816435C881A89264}{}
{
  This chapter describes the functions in \textsf{Semigroups} for dealing with free inverse semigroups and free bands. This part of the
manual and the functions described herein were written by Julius Jonu{\v s}as.

 
\section{\textcolor{Chapter }{ Free inverse semigroups }}\label{sect:Free inverse semigroups}
\logpage{[ 6, 1, 0 ]}
\hyperdef{L}{X7E51292C8755DCF2}{}
{
  $F$ is a \emph{free inverse semigroup} on a non-empty set $X$ if $F$ is an inverse semigroup with a map $f$ from $F$ to $X$ such that for every inverse semigroup $S$ and a map $g$ from $X$ to $S$ there exists a unique homomorphism $g'$ from $F$ to $S$ such that $fg' = g$. Moreover, by the universal property, every inverse semigroup can be
expressed as a quotient of a free inverse semigroup.

 The internal representation of an element of a free inverse semigroup uses a
Munn tree. A \emph{Munn tree} is a directed tree with distinguished start and terminal vertices and where
the edges are labeled by generators so that two edges labeled by the same
generator are only incident to the same vertex if one of the edges is coming
in and the other is leaving the vertex. For more information regarding free
inverse semigroups and the Munn representations see Section 5.10 of \cite{howie}. See also  (\textbf{Reference: Inverse semigroups and monoids}),  (\textbf{Reference: Partial permutations}) and  (\textbf{Reference: Free Groups, Monoids and Semigroups}).

 An element of a free inverse semigroup in \textsf{Semigroups} is be displayed, by default, as a shortest word corresponding to the element.
However, there might be more than one word of the minimum length. For example,
if $x$ and $y$ are generators of a free inverse semigroups, then 
\[xyy^{-1}xx^{-1}x^{-1} = xxx^{-1}yy^{-1}x^{-1}.\]
 See \texttt{MinimalWord} (\ref{MinimalWord:for free inverse semigroup element}) Therefore we provide a another method for printing elements of a free inverse
semigroup: a unique canonical form. Suppose an element of a free inverse
semigroup is given as a Munn tree. Let $L$ be the set of words corresponding to the shortest paths from the start vertex
to the leaves of the tree. Also let $w$ be a word corresponding to the shortest path from start to terminal vertices.
The word $vv^{-1}$ is an idempotent for every $v$ in $L$. The canonical form is given by multiplying these idempotents, in shortlex
order, and then postmultiplying by $w$. For example, consider the word $xyy^{-1}xx^{-1}x^{-1}$ again. The words corresponding to the paths to the leaves are in this case $xx$ and $xy$. And $w$ is an empty word since start and terminal vertices are the same. Therefore,
the canonical form is 
\[xxx^{-1}x^{-1}xyy^{-1}x^{-1}.\]
 See \texttt{CanonicalForm} (\ref{CanonicalForm:for a free inverse semigroup element}). 

\subsection{\textcolor{Chapter }{FreeInverseSemigroup (for a given rank)}}
\logpage{[ 6, 1, 1 ]}\nobreak
\hyperdef{L}{X7F3F9DED8003CBD0}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FreeInverseSemigroup({\mdseries\slshape rank[, name]})\index{FreeInverseSemigroup@\texttt{FreeInverseSemigroup}!for a given rank}
\label{FreeInverseSemigroup:for a given rank}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FreeInverseSemigroup({\mdseries\slshape name1, name2, ...})\index{FreeInverseSemigroup@\texttt{FreeInverseSemigroup}!for a list of names}
\label{FreeInverseSemigroup:for a list of names}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FreeInverseSemigroup({\mdseries\slshape names})\index{FreeInverseSemigroup@\texttt{FreeInverseSemigroup}!for various names}
\label{FreeInverseSemigroup:for various names}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 A free inverse semigroup. 



 Returns a free inverse semigroup on \mbox{\texttt{\mdseries\slshape rank}} generators, where \mbox{\texttt{\mdseries\slshape rank}} is a positive integer. If \mbox{\texttt{\mdseries\slshape rank}} is not specified, the number of \mbox{\texttt{\mdseries\slshape names}} is used. If \texttt{S} is a free inverse semigroup, then the generators can be accessed by \texttt{S.1}, \texttt{S.2} and so on. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := FreeInverseSemigroup(7);|
  <free inverse semigroup on the generators 
  [ x1, x2, x3, x4, x5, x6, x7 ]>
  !gapprompt@gap>| !gapinput@S := FreeInverseSemigroup(7,"s");|
  <free inverse semigroup on the generators 
  [ s1, s2, s3, s4, s5, s6, s7 ]>
  !gapprompt@gap>| !gapinput@S := FreeInverseSemigroup("a", "b", "c");|
  <free inverse semigroup on the generators [ a, b, c ]>
  !gapprompt@gap>| !gapinput@S := FreeInverseSemigroup(["a", "b", "c"]);|
  <free inverse semigroup on the generators [ a, b, c ]>
  !gapprompt@gap>| !gapinput@S.1;|
  a
  !gapprompt@gap>| !gapinput@S.2;|
  b
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsFreeInverseSemigroupCategory}}
\logpage{[ 6, 1, 2 ]}\nobreak
\hyperdef{L}{X7CE4CFD886220179}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFreeInverseSemigroupCategory({\mdseries\slshape obj})\index{IsFreeInverseSemigroupCategory@\texttt{IsFreeInverseSemigroupCategory}}
\label{IsFreeInverseSemigroupCategory}
}\hfill{\scriptsize (Category)}}\\


 Every free inverse semigroup in \textsf{GAP} created by \texttt{FreeInverseSemigroup} (\ref{FreeInverseSemigroup:for a given rank}) belongs to the category \texttt{IsFreeInverseSemigroup}. Basic operations for a free inverse semigroup are: \texttt{GeneratorsOfInverseSemigroup} (\textbf{Reference: GeneratorsOfInverseSemigroup}) and \texttt{GeneratorsOfSemigroup} (\textbf{Reference: GeneratorsOfSemigroup}). Elements of a free inverse semigroup belong to the category \texttt{IsFreeInverseSemigroupElement} (\ref{IsFreeInverseSemigroupElement}). }

 

\subsection{\textcolor{Chapter }{IsFreeInverseSemigroup}}
\logpage{[ 6, 1, 3 ]}\nobreak
\hyperdef{L}{X7B91643B827DA6DB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFreeInverseSemigroup({\mdseries\slshape S})\index{IsFreeInverseSemigroup@\texttt{IsFreeInverseSemigroup}}
\label{IsFreeInverseSemigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} or \texttt{false} 



 Attempts to determine whether the given semigroup \mbox{\texttt{\mdseries\slshape  S }} is a free inverse semigroup. }

 

\subsection{\textcolor{Chapter }{IsFreeInverseSemigroupElement}}
\logpage{[ 6, 1, 4 ]}\nobreak
\hyperdef{L}{X7999FE0286283CC2}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFreeInverseSemigroupElement\index{IsFreeInverseSemigroupElement@\texttt{IsFreeInverseSemigroupElement}}
\label{IsFreeInverseSemigroupElement}
}\hfill{\scriptsize (Category)}}\\


 Every element of a free inverse semigroup belongs to the category \texttt{IsFreeInverseSemigroupElement}. }

 }

 
\section{\textcolor{Chapter }{ Displaying free inverse semigroup elements }}\logpage{[ 6, 2, 0 ]}
\hyperdef{L}{X8073A2387A42B52D}{}
{
  There is a way to change how \textsf{GAP} displays free inverse semigroup elements using the user preference \texttt{FreeInverseSemigroupElementDisplay}. See \texttt{UserPreference} (\textbf{Reference: UserPreference}) for more information about user preferences.

 There are two possible values for \texttt{FreeInverseSemigroupElementDisplay}: 
\begin{description}
\item[{minimal }]  With this option selected, \textsf{GAP} will display a shortest word corresponding to the free inverse semigroup
element. However, this shortest word is not unique. This is a default setting. 
\item[{canonical}]  With this option selected, \textsf{GAP} will display a free inverse semigroup element in the canonical form. 
\end{description}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@SetUserPreference("semigroups", "FreeInverseSemigroupElementDisplay", "minimal");|
  !gapprompt@gap>| !gapinput@S:=FreeInverseSemigroup(2);|
  <free inverse semigroup on the generators [ x1, x2 ]>
  !gapprompt@gap>| !gapinput@S.1 * S.2;|
  x1*x2
  !gapprompt@gap>| !gapinput@SetUserPreference("semigroups", "FreeInverseSemigroupElementDisplay", "canonical");|
  !gapprompt@gap>| !gapinput@S.1 * S.2;|
  x1x2x2^-1x1^-1x1x2
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Operators and operations for free inverse semigroup elements }}\logpage{[ 6, 3, 0 ]}
\hyperdef{L}{X7E93822179CD7602}{}
{
  
\begin{description}
\item[{\texttt{\mbox{\texttt{\mdseries\slshape w}} \texttt{\symbol{94}} -1}}]  returns the semigroup inverse of the free inverse semigroup element \mbox{\texttt{\mdseries\slshape w}}. 
\item[{\texttt{\mbox{\texttt{\mdseries\slshape u}} * \mbox{\texttt{\mdseries\slshape v}}}}]  returns the product of two free inverse semigroup elements \mbox{\texttt{\mdseries\slshape u}} and \mbox{\texttt{\mdseries\slshape v}}. 
\item[{\texttt{\mbox{\texttt{\mdseries\slshape u}} = \mbox{\texttt{\mdseries\slshape v}} }}]  checks if two free inverse semigroup elements are equal, by comparing their
canonical forms. 
\end{description}
 

\subsection{\textcolor{Chapter }{CanonicalForm (for a free inverse semigroup element)}}
\logpage{[ 6, 3, 1 ]}\nobreak
\hyperdef{L}{X7DB7DCEC7E0FE9A3}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CanonicalForm({\mdseries\slshape w})\index{CanonicalForm@\texttt{CanonicalForm}!for a free inverse semigroup element}
\label{CanonicalForm:for a free inverse semigroup element}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A string. 



 Every element of a free inverse semigroup has a unique canonical form. If \mbox{\texttt{\mdseries\slshape w}} is such an element, then \texttt{CanonicalForm} returns the canonical form of \mbox{\texttt{\mdseries\slshape w}} as a string. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := FreeInverseSemigroup(3);|
  <free inverse semigroup on the generators [ x1, x2, x3 ]>
  !gapprompt@gap>| !gapinput@x := S.1; y := S.2;|
  x1
  x2
  !gapprompt@gap>| !gapinput@CanonicalForm(x^3*y^3);|
  "x1x1x1x2x2x2x2^-1x2^-1x2^-1x1^-1x1^-1x1^-1x1x1x1x2x2x2"
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalWord (for free inverse semigroup element)}}
\logpage{[ 6, 3, 2 ]}\nobreak
\hyperdef{L}{X87BB5D047EB7C2BF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MinimalWord({\mdseries\slshape w})\index{MinimalWord@\texttt{MinimalWord}!for free inverse semigroup element}
\label{MinimalWord:for free inverse semigroup element}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 A string. 



 For an element \mbox{\texttt{\mdseries\slshape w}} of a free inverse semigroup \texttt{S}, \texttt{MinimalWord} returns a word of minimal length equal to \mbox{\texttt{\mdseries\slshape w}} in \texttt{S} as a string.

 Note that there maybe more than one word of minimal length which is equal to \mbox{\texttt{\mdseries\slshape w}} in \texttt{S}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := FreeInverseSemigroup(3);|
  <free inverse semigroup on the generators [ x1, x2, x3 ]>
  !gapprompt@gap>| !gapinput@x := S.1;|
  x1
  !gapprompt@gap>| !gapinput@y := S.2;|
  x2
  !gapprompt@gap>| !gapinput@MinimalWord(x^3 * y^3);|
  "x1*x1*x1*x2*x2*x2"
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{ Free bands }}\label{sect:FreeBand}
\logpage{[ 6, 4, 0 ]}
\hyperdef{L}{X7BB29A6779E8066A}{}
{
  A semigroup $B$ is a \emph{free band} on a non-empty set $X$ if $B$ is a band with a map $ f $ from $ B $ to $X$ such that for every band $ S $ and every map $ g $ from $X$ to $ B $ there exists a unique homomorphism $ g'$ from $B$ to $S$ such that $fg' = g$. The free band on a set $X$ is unique up to isomorphism. Moreover, by the universal property, every band
can be expressed as a quotient of a free band.

 For an alternative description of a free band. Suppose that $ X $ is a non-empty set and $ X^+ $ a free semigroup on $ X $. Also suppose that $ b $ is the smallest congurance on $ X^+ $ containing the set 
\[ \{ (w^2, w) : w \in X^+ \}. \]
 Then the free band on $ X $ is isomorphic to the quotient of $ X^+ $ by $ b $. See Section 4.5 of \cite{howie} for more information on free bands. 

\subsection{\textcolor{Chapter }{FreeBand (for a given rank)}}
\logpage{[ 6, 4, 1 ]}\nobreak
\hyperdef{L}{X7B2A65F382DB36EC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FreeBand({\mdseries\slshape rank[, name]})\index{FreeBand@\texttt{FreeBand}!for a given rank}
\label{FreeBand:for a given rank}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FreeBand({\mdseries\slshape name1, name2, ...})\index{FreeBand@\texttt{FreeBand}!for a list of names}
\label{FreeBand:for a list of names}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{FreeBand({\mdseries\slshape names})\index{FreeBand@\texttt{FreeBand}!for various names}
\label{FreeBand:for various names}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 A free band. 



 Returns a free band on \mbox{\texttt{\mdseries\slshape rank}} generators, for a positive integer \mbox{\texttt{\mdseries\slshape rank}}. If \mbox{\texttt{\mdseries\slshape rank}} is not specified, the number of \mbox{\texttt{\mdseries\slshape names}} is used. The resulting semigroup is always finite. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@FreeBand(6);|
  <free band on the generators [ x1, x2, x3, x4, x5, x6 ]>
  !gapprompt@gap>| !gapinput@FreeBand(6, "b");|
  <free band on the generators [ b1, b2, b3, b4, b5, b6 ]>
  !gapprompt@gap>| !gapinput@FreeBand("a", "b", "c");|
  <free band on the generators [ a, b, c ]>
  !gapprompt@gap>| !gapinput@FreeBand("a", "b", "c");|
  <free band on the generators [ a, b, c ]>
  !gapprompt@gap>| !gapinput@s := FreeBand(["a", "b", "c"]);|
  <free band on the generators [ a, b, c ]>
  !gapprompt@gap>| !gapinput@Size(s);|
  159
  !gapprompt@gap>| !gapinput@gens := Generators(s);|
  [ a, b, c ]
  !gapprompt@gap>| !gapinput@a := gens[1];; b := gens[2];;|
  !gapprompt@gap>| !gapinput@a * b;|
  ab
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsFreeBandCategory}}
\logpage{[ 6, 4, 2 ]}\nobreak
\hyperdef{L}{X7F5658DC7E56C4A6}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFreeBandCategory\index{IsFreeBandCategory@\texttt{IsFreeBandCategory}}
\label{IsFreeBandCategory}
}\hfill{\scriptsize (Category)}}\\


 \texttt{IsFreeBandCategory} is the category of semigroups created using \texttt{FreeBand} (\ref{FreeBand:for a given rank}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@IsFreeBandCategory(FreeBand(3));|
  true
  !gapprompt@gap>| !gapinput@IsFreeBand(SymmetricGroup(6));|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsFreeBand (for a given semigroup)}}
\logpage{[ 6, 4, 3 ]}\nobreak
\hyperdef{L}{X7B1CD5FC7E034B88}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFreeBand({\mdseries\slshape S})\index{IsFreeBand@\texttt{IsFreeBand}!for a given semigroup}
\label{IsFreeBand:for a given semigroup}
}\hfill{\scriptsize (property)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} or \texttt{false} 



 \texttt{IsFreeBand} returns \texttt{true} if the given semigroup \mbox{\texttt{\mdseries\slshape S}} is a free band. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@IsFreeBand(FreeBand(3));|
  true
  !gapprompt@gap>| !gapinput@IsFreeBand(SymmetricGroup(6));|
  false
  !gapprompt@gap>| !gapinput@IsFreeBand(FullTransformationMonoid(7));|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsFreeBandElement}}
\logpage{[ 6, 4, 4 ]}\nobreak
\hyperdef{L}{X7DECF69087BB3B16}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFreeBandElement\index{IsFreeBandElement@\texttt{IsFreeBandElement}}
\label{IsFreeBandElement}
}\hfill{\scriptsize (Category)}}\\


 \texttt{IsFreeBandElement} is a \texttt{Category} containing the elements of a free band. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@IsFreeBandElement(Generators(FreeBand(4))[1]);|
  true
  !gapprompt@gap>| !gapinput@IsFreeBandElement(Transformation([1,3,4,1]));|
  false
  !gapprompt@gap>| !gapinput@IsFreeBandElement((1,2,3,4));|
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsFreeBandSubsemigroup}}
\logpage{[ 6, 4, 5 ]}\nobreak
\hyperdef{L}{X7AEF4CD1857E7DCC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsFreeBandSubsemigroup\index{IsFreeBandSubsemigroup@\texttt{IsFreeBandSubsemigroup}}
\label{IsFreeBandSubsemigroup}
}\hfill{\scriptsize (filter)}}\\


 \texttt{IsFreeBandSubsemigroup} is a synonym for \texttt{IsSemigroup} and \texttt{IsFreeBandElementCollection}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := FreeBand(2);|
  <free band on the generators [ x1, x2 ]>
  !gapprompt@gap>| !gapinput@x := Generators(S)[1];|
  x1
  !gapprompt@gap>| !gapinput@y := Generators(S)[2];|
  x2
  !gapprompt@gap>| !gapinput@new := Semigroup([x*y, x]);|
  <semigroup with 2 generators>
  !gapprompt@gap>| !gapinput@IsFreeBand(new);|
  false
  !gapprompt@gap>| !gapinput@IsFreeBandSubsemigroup(new);|
  true
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Operators and operations for free band elements }}\logpage{[ 6, 5, 0 ]}
\hyperdef{L}{X86221BAE7CD5CF4D}{}
{
  
\begin{description}
\item[{\texttt{\mbox{\texttt{\mdseries\slshape u}} * \mbox{\texttt{\mdseries\slshape v}}}}]  returns the product of two free band elements \mbox{\texttt{\mdseries\slshape u}} and \mbox{\texttt{\mdseries\slshape v}}. 
\item[{\texttt{\mbox{\texttt{\mdseries\slshape u}} = \mbox{\texttt{\mdseries\slshape v}} }}]  checks if two free band elements are equal. 
\item[{\texttt{\mbox{\texttt{\mdseries\slshape u}} {\textless} \mbox{\texttt{\mdseries\slshape v}} }}]  compares the sizes of the internal representations of two free band elements. 
\end{description}
 

\subsection{\textcolor{Chapter }{GreensDClassOfElement (for a free band and a free band element)}}
\logpage{[ 6, 5, 1 ]}\nobreak
\hyperdef{L}{X85D9F64F7BB64512}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{GreensDClassOfElement({\mdseries\slshape s, x})\index{GreensDClassOfElement@\texttt{GreensDClassOfElement}!for a free band and a free band element}
\label{GreensDClassOfElement:for a free band and a free band element}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A Green's D-class



 Let \mbox{\texttt{\mdseries\slshape  S }} be a free band. Two elements of \mbox{\texttt{\mdseries\slshape  S }} are $\mathcal{D}$-related if and only if they have the same content i.e. the set of generators
appearing in any factorization of the elements. Therefore, a $\mathcal{D}$-class of a free band element \mbox{\texttt{\mdseries\slshape  x }} is the set of elements of \mbox{\texttt{\mdseries\slshape  S }} which have the same content as \mbox{\texttt{\mdseries\slshape  x }}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := FreeBand(3, "b");|
  <free band on the generators [ b1, b2, b3 ]>
  !gapprompt@gap>| !gapinput@x := Generators(S)[1] * Generators(S)[2];|
  b1b2
  !gapprompt@gap>| !gapinput@D := GreensDClassOfElement(S, x);|
  {b1b2}
  !gapprompt@gap>| !gapinput@IsGreensDClass(D);|
  true
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{Congruences}}\label{chapter-congruence}
\logpage{[ 7, 0, 0 ]}
\hyperdef{L}{X82BD951079E3C349}{}
{
  Congruences in \textsf{Semigroups} can be described in several different ways:

 
\begin{itemize}
\item  Generating pairs -- the minimal congruence which contains these pairs 
\item  Rees congruences -- the congruence specified by a given ideal 
\item  Universal congruences -- the unique congruence with only one class 
\item  Linked triples -- only for simple or 0-simple semigroups (see below) 
\item  Kernel and trace -- only for inverse semigroups 
\end{itemize}
 The operation \texttt{SemigroupCongruence} (\ref{SemigroupCongruence}) can be used to create any of these, interpreting the arguments in a smart way.
The usual way of specifying a congruence will be by giving a set of generating
pairs, but a user with an ideal could instead create a Rees congruence or
universal congruence.

 If a congruence is specified by generating pairs on a simple, 0-simple, or
inverse semigroup, then the congruence will be converted automatically to one
of the last two items in the above list, to reduce the complexity of any
calculations to be performed. The user need not manually specify, or even be
aware of, the congruence's linked triple or kernel and trace. 
\section{\textcolor{Chapter }{Creating congruences}}\logpage{[ 7, 1, 0 ]}
\hyperdef{L}{X7D49787B7B2589B2}{}
{
 

\subsection{\textcolor{Chapter }{SemigroupCongruence}}
\logpage{[ 7, 1, 1 ]}\nobreak
\hyperdef{L}{X85CE56AC84FA5D33}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SemigroupCongruence({\mdseries\slshape S, pairs})\index{SemigroupCongruence@\texttt{SemigroupCongruence}}
\label{SemigroupCongruence}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A semigroup congruence.



 This function returns a semigroup congruence over the semigroup \mbox{\texttt{\mdseries\slshape S}}.

 If \mbox{\texttt{\mdseries\slshape pairs}} is a list of lists of size 2 with elements from \mbox{\texttt{\mdseries\slshape S}}, then this function will return the semigroup congruence defined by these
generating pairs. The individual pairs may instead be given as separate
arguments.

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 1, 1, 2, 1 ] ), |
  !gapprompt@>| !gapinput@                Transformation( [ 3, 4, 3, 4, 4 ] ), |
  !gapprompt@>| !gapinput@                Transformation( [ 3, 4, 3, 4, 3 ] ),  |
  !gapprompt@>| !gapinput@                Transformation( [ 4, 3, 3, 4, 4 ] ));;|
  !gapprompt@gap>| !gapinput@pair1 := [ Transformation( [ 3, 4, 3, 4, 3 ] ),|
  !gapprompt@>| !gapinput@              Transformation( [ 1, 2, 1, 2, 1 ] ) ];;|
  !gapprompt@gap>| !gapinput@pair2 := [ Transformation( [ 4, 3, 4, 3, 4 ] ),|
  !gapprompt@>| !gapinput@              Transformation( [ 3, 4, 3, 4, 3 ] ) ];;|
  !gapprompt@gap>| !gapinput@SemigroupCongruence(S, [pair1, pair2]);|
  <semigroup congruence over <simple transformation semigroup 
   on 5 pts with 4 generators> with linked triple (2,4,1)>
  !gapprompt@gap>| !gapinput@SemigroupCongruence(S, pair1, pair2);|
  <semigroup congruence over <simple transformation semigroup 
   on 5 pts with 4 generators> with linked triple (2,4,1)>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Congruence classes}}\logpage{[ 7, 2, 0 ]}
\hyperdef{L}{X7D65BB067A762CD6}{}
{
 

\subsection{\textcolor{Chapter }{CongruenceClassOfElement}}
\logpage{[ 7, 2, 1 ]}\nobreak
\hyperdef{L}{X7CB27F237B59C8C9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CongruenceClassOfElement({\mdseries\slshape cong, elm})\index{CongruenceClassOfElement@\texttt{CongruenceClassOfElement}}
\label{CongruenceClassOfElement}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A congruence class.



 This operation is a synonym of \texttt{EquivalenceClassOfElement} in the case that the argument \mbox{\texttt{\mdseries\slshape cong}} is a congruence of a semigroup.

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@cong := CongruencesOfSemigroup(S)[3];;|
  !gapprompt@gap>| !gapinput@elm := ReesZeroMatrixSemigroupElement(S, 1, (1,3,2), 1);;|
  !gapprompt@gap>| !gapinput@CongruenceClassOfElement(cong, elm);|
  {(1,(1,3,2),1)}
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{CongruenceClasses}}
\logpage{[ 7, 2, 2 ]}\nobreak
\hyperdef{L}{X7E36A01C85E2DCF0}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CongruenceClasses({\mdseries\slshape cong})\index{CongruenceClasses@\texttt{CongruenceClasses}}
\label{CongruenceClasses}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The classes of congruence.



 When \mbox{\texttt{\mdseries\slshape cong}} is a congruence of semigroup, this attribute is synonymous with \texttt{EquivalenceClasses}.

 The return value is a list containing all the equivalence classes of the
semigroup congruence \mbox{\texttt{\mdseries\slshape cong}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@cong := CongruencesOfSemigroup(S)[3];;|
  !gapprompt@gap>| !gapinput@classes := CongruenceClasses(cong);;|
  !gapprompt@gap>| !gapinput@Size(classes);|
  9
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NrCongruenceClasses}}
\logpage{[ 7, 2, 3 ]}\nobreak
\hyperdef{L}{X7C80CD547A5C3E76}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NrCongruenceClasses({\mdseries\slshape cong})\index{NrCongruenceClasses@\texttt{NrCongruenceClasses}}
\label{NrCongruenceClasses}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A positive integer.



 This attribute describes the number of congruence classes in the semigroup
congruence \mbox{\texttt{\mdseries\slshape cong}}. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@cong := CongruencesOfSemigroup(S)[3];;|
  !gapprompt@gap>| !gapinput@NrCongruenceClasses(cong);|
  9
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{CongruencesOfSemigroup}}
\logpage{[ 7, 2, 4 ]}\nobreak
\hyperdef{L}{X7AB683CB7CD1B18D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CongruencesOfSemigroup({\mdseries\slshape S})\index{CongruencesOfSemigroup@\texttt{CongruencesOfSemigroup}}
\label{CongruencesOfSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The congruences of a semigroup.



 This attribute gives a list of the congruences of the semigroup \mbox{\texttt{\mdseries\slshape S}}. 

 At present this only works for simple and 0-simple semigroups. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@s := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@congs := CongruencesOfSemigroup(s);|
  [ <universal semigroup congruence over 
      <Rees 0-matrix semigroup 2x2 over Sym( [ 1 .. 3 ] )>>, 
    <semigroup congruence over <Rees 0-matrix semigroup 2x2 over 
        Sym( [ 1 .. 3 ] )> with linked triple (1,2,2)>, 
    <semigroup congruence over <Rees 0-matrix semigroup 2x2 over 
        Sym( [ 1 .. 3 ] )> with linked triple (3,2,2)>, 
    <semigroup congruence over <Rees 0-matrix semigroup 2x2 over 
        Sym( [ 1 .. 3 ] )> with linked triple (S3,2,2)> ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AsLookupTable}}
\logpage{[ 7, 2, 5 ]}\nobreak
\hyperdef{L}{X7F9E84A185A717C1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsLookupTable({\mdseries\slshape cong})\index{AsLookupTable@\texttt{AsLookupTable}}
\label{AsLookupTable}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A list.



 This attribute describes the semigroup congruence \mbox{\texttt{\mdseries\slshape cong}} as a list of positive integers with length the size of the semigroup over
which \mbox{\texttt{\mdseries\slshape cong}} is defined.

 Each position in the list corresponds to an element of the semigroup (in the
order defined by \texttt{SSortedList}) and the integer at that position is a unique identifier for that element's
congruence class under \mbox{\texttt{\mdseries\slshape cong}}. Hence, two elements are congruent if and only if they have the same number
at their two positions in the list.

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@s := Monoid( [ Transformation( [ 1, 2, 2 ] ),|
  !gapprompt@>| !gapinput@                  Transformation( [ 3, 1, 3 ] ) ] );;|
  !gapprompt@gap>| !gapinput@cong := SemigroupCongruence( s,|
  !gapprompt@>| !gapinput@      [Transformation([1,2,1]),Transformation([2,1,2])] );;|
  !gapprompt@gap>| !gapinput@AsLookupTable(cong);|
  [ 1, 2, 3, 4, 5, 6, 3, 2, 1, 6, 5, 1 ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Congruences on Rees matrix semigroups}}\logpage{[ 7, 3, 0 ]}
\hyperdef{L}{X7A6478D1831DD787}{}
{
  This section describes the implementation of congruences of simple and
0-simple semigroups in the \textsf{Semigroups} package, and the functions associated with them. This code and this part of
the manual were written by Michael Torpey. Most of the theorems used in this
chapter are from Section 3.5 of \cite{howie}.

 By the Rees Theorem, any 0-simple semigroup $S$ is isomorphic to a \emph{Rees 0-matrix semigroup} (see  (\textbf{Reference: Rees Matrix Semigroups})) over a group, with a regular sandwich matrix.  That is, 
\[S \cong \mathcal{M}^0[G; I,\Lambda; P], \]
 where $G$ is a group, $\Lambda$ and $I$ are non-empty sets, and $P$ is regular in the sense that it has no rows or columns consisting soley of
zeroes.  

 The congruences of a Rees 0-matrix semigroup are in 1-1 correspondence with
the \emph{linked triple}, which is a triple of the form \texttt{[N,S,T]} where: 
\begin{itemize}
\item  \texttt{N} is a normal subgroup of the underlying group \texttt{G}, 
\item  \texttt{S} is an equivalence relation on the columns of \texttt{P}, 
\item  \texttt{T} is an equivalence relation on the rows of \texttt{P}, 
\end{itemize}
 satisfying the following conditions: 
\begin{itemize}
\item  a pair of \texttt{S}-related columns must contain zeroes in precisely the same rows, 
\item  a pair of \texttt{T}-related rows must contain zeroes in precisely the same columns, 
\item  if \texttt{i} and \texttt{j} are \texttt{S}-related, \texttt{k} and \texttt{l} are \texttt{T}-related and the matrix entries $p_{k, i}, p_{k, j}, p_{l, i}, p_{l, j} \neq 0$, then $q_{k, l, i, j} \in N$, where 
\[q_{k, l, i, j} = p_{k, i} p_{l, i}^{-1} p_{l, j} p_{k, j}^{-1}.\]
 
\end{itemize}
 By Theorem 3.5.9 in \cite{howie}, for any finite 0-simple Rees 0-matrix semigroup, there is a bijection
between its non-universal congruences and its linked triples. In this way, we
can internally represent any congruence of such a semigroup by storing its
associated linked triple instead of a set of generating pairs, and thus
perform many calculations on it more efficiently.

 If a congruence is defined by a linked triple \texttt{(N,S,T)}, then a single class of that congruence can be defined by a triple \texttt{(Nx,i/S,k/S)}, where \texttt{Nx} is a right coset of \texttt{N}, \texttt{i/S} is the equivalence class of \texttt{i} in \texttt{S}, and \texttt{k/S} is the equivalence class of \texttt{k} in \texttt{T}. Thus we can internally represent any class of such a congruence as a triple
simply consisting of a right coset and two positive integers.

 An analogous condition exists for finite simple Rees matrix semigroups without
zero.

 

\subsection{\textcolor{Chapter }{IsRMSCongruenceByLinkedTriple}}
\logpage{[ 7, 3, 1 ]}\nobreak
\hyperdef{L}{X7F4AFD7F7E163022}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRMSCongruenceByLinkedTriple({\mdseries\slshape obj})\index{IsRMSCongruenceByLinkedTriple@\texttt{IsRMSCongruenceByLinkedTriple}}
\label{IsRMSCongruenceByLinkedTriple}
}\hfill{\scriptsize (category)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsRZMSCongruenceByLinkedTriple({\mdseries\slshape obj})\index{IsRZMSCongruenceByLinkedTriple@\texttt{IsRZMSCongruenceByLinkedTriple}}
\label{IsRZMSCongruenceByLinkedTriple}
}\hfill{\scriptsize (category)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 These categories describe a type of semigroup congruence over a Rees matrix or
0-matrix semigroup. Externally, an object of this type may be used in the same
way as any other object in the category \texttt{IsSemigroupCongruence} (\textbf{Reference: IsSemigroupCongruence}) but it is represented internally by its \emph{linked triple}, and certain functions may take advantage of this information to reduce
computation times.

 An object of this type may be constructed with \texttt{RMSCongruenceByLinkedTriple} or \texttt{RZMSCongruenceByLinkedTriple}, or this representation may be selected automatically by \texttt{SemigroupCongruence} (\ref{SemigroupCongruence}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G := Group( [ (1,4,5), (1,5,3,4) ] );;|
  !gapprompt@gap>| !gapinput@mat := [ [  0,  0, (1,4,5),     0,     0, (1,4,3,5) ],|
  !gapprompt@>| !gapinput@            [  0, (),       0,     0, (3,5),         0 ],|
  !gapprompt@>| !gapinput@            [ (),  0,       0, (3,5),     0,         0 ] ];;|
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(G, mat);;|
  !gapprompt@gap>| !gapinput@N := Group([ (1,4)(3,5), (1,5)(3,4) ]);;|
  !gapprompt@gap>| !gapinput@colBlocks := [ [ 1 ], [ 2, 5 ], [ 3, 6 ], [ 4 ] ];;|
  !gapprompt@gap>| !gapinput@rowBlocks := [ [ 1 ], [ 2 ], [ 3 ] ];;|
  !gapprompt@gap>| !gapinput@cong := RZMSCongruenceByLinkedTriple(S, N, colBlocks, rowBlocks);;|
  !gapprompt@gap>| !gapinput@IsRZMSCongruenceByLinkedTriple(cong);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RMSCongruenceByLinkedTriple}}
\logpage{[ 7, 3, 2 ]}\nobreak
\hyperdef{L}{X87A475E4847D3C96}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RMSCongruenceByLinkedTriple({\mdseries\slshape S, N, colBlocks, rowBlocks})\index{RMSCongruenceByLinkedTriple@\texttt{RMSCongruenceByLinkedTriple}}
\label{RMSCongruenceByLinkedTriple}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RZMSCongruenceByLinkedTriple({\mdseries\slshape S, N, colBlocks, rowBlocks})\index{RZMSCongruenceByLinkedTriple@\texttt{RZMSCongruenceByLinkedTriple}}
\label{RZMSCongruenceByLinkedTriple}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A Rees matrix or 0-matrix semigroup congruence by linked triple.



 This function returns a semigroup congruence over the Rees matrix or 0-matrix
semigroup \mbox{\texttt{\mdseries\slshape S}} corresponding to the linked triple (\mbox{\texttt{\mdseries\slshape N}}, \mbox{\texttt{\mdseries\slshape colBlocks}}, \mbox{\texttt{\mdseries\slshape rowBlocks}}). The argument \mbox{\texttt{\mdseries\slshape N}} should be a normal subgroup of the underlying semigroup of \mbox{\texttt{\mdseries\slshape S}}; \mbox{\texttt{\mdseries\slshape colBlocks}} should be a partition of the columns of the matrix of \mbox{\texttt{\mdseries\slshape S}}; and \mbox{\texttt{\mdseries\slshape rowBlocks}} should be a partition of the rows of the matrix of \mbox{\texttt{\mdseries\slshape S}}. For example, if the matrix has 5 rows, then a possibility for \mbox{\texttt{\mdseries\slshape rowBlocks}} might be \texttt{[ [1,3], [2,5], [4] ]}.

 If the arguments describe a valid linked triple on \mbox{\texttt{\mdseries\slshape S}}, then an object in the category \texttt{IsRZMSCongruenceByLinkedTriple} is returned. This object can be used like any other semigroup congruence in \textsf{GAP}.

 If the arguments describe a triple which is not \emph{linked} in the sense described above, then this function returns an error. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G := Group( [ (1,4,5), (1,5,3,4) ] );;|
  !gapprompt@gap>| !gapinput@mat := [ [  0,  0, (1,4,5),     0,     0, (1,4,3,5) ],|
  !gapprompt@>| !gapinput@            [  0, (),       0,     0, (3,5),         0 ],|
  !gapprompt@>| !gapinput@            [ (),  0,       0, (3,5),     0,         0 ] ];;|
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(G, mat);;|
  !gapprompt@gap>| !gapinput@N := Group([ (1,4)(3,5), (1,5)(3,4) ]);;|
  !gapprompt@gap>| !gapinput@colBlocks := [ [ 1 ], [ 2, 5 ], [ 3, 6 ], [ 4 ] ];;|
  !gapprompt@gap>| !gapinput@rowBlocks := [ [ 1 ], [ 2 ], [ 3 ] ];;|
  !gapprompt@gap>| !gapinput@cong := RZMSCongruenceByLinkedTriple(S, N, colBlocks, rowBlocks);|
  <semigroup congruence over <Rees 0-matrix semigroup 6x3 over 
    Group([ (1,4,5), (1,5,3,4) ])> with linked triple (2^2,4,3)>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RMSCongruenceClassByLinkedTriple}}
\logpage{[ 7, 3, 3 ]}\nobreak
\hyperdef{L}{X7E9AB940868FCC9D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RMSCongruenceClassByLinkedTriple({\mdseries\slshape cong, nCoset, colClass, rowClass})\index{RMSCongruenceClassByLinkedTriple@\texttt{RMSCongruenceClassByLinkedTriple}}
\label{RMSCongruenceClassByLinkedTriple}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RZMSCongruenceClassByLinkedTriple({\mdseries\slshape cong, nCoset, colClass, rowClass})\index{RZMSCongruenceClassByLinkedTriple@\texttt{RZMSCongruenceClassByLinkedTriple}}
\label{RZMSCongruenceClassByLinkedTriple}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A Rees matrix or 0-matrix semigroup congruence class by linked triple.



 This operation returns one congruence class of the congruence \mbox{\texttt{\mdseries\slshape cong}}, as defined by the other three parameters.

 The argument \mbox{\texttt{\mdseries\slshape cong}} must be a Rees matrix or 0-matrix semigroup congruence by linked triple. If
the linked triple consists of the three parameters \texttt{N}, \texttt{colBlocks} and \texttt{rowBlocks}, then \mbox{\texttt{\mdseries\slshape nCoset}} must be a right coset of \texttt{N}, \mbox{\texttt{\mdseries\slshape colClass}} must be a positive integer corresponding to a position in the list \texttt{colBlocks}, and \mbox{\texttt{\mdseries\slshape rowClass}} must be a positive integer corresponding to a position in the list \texttt{rowBlocks}.

 If the arguments are valid, an \texttt{IsRMSCongruenceClassByLinkedTriple} or \texttt{IsRZMSCongruenceClassByLinkedTriple} object is returned, which can be used like any other equivalence class in \textsf{GAP}. Otherwise, an error is returned. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@g := Group( [ (1,4,5), (1,5,3,4) ] );;|
  !gapprompt@gap>| !gapinput@mat := [ [  0,  0, (1,4,5),     0,     0, (1,4,3,5) ],|
  !gapprompt@>| !gapinput@            [  0, (),       0,     0, (3,5),         0 ],|
  !gapprompt@>| !gapinput@            [ (),  0,       0, (3,5),     0,         0 ] ];;|
  !gapprompt@gap>| !gapinput@s := ReesZeroMatrixSemigroup(g, mat);;|
  !gapprompt@gap>| !gapinput@n := Group([ (1,4)(3,5), (1,5)(3,4) ]);;|
  !gapprompt@gap>| !gapinput@colBlocks := [ [ 1 ], [ 2, 5 ], [ 3, 6 ], [ 4 ] ];;|
  !gapprompt@gap>| !gapinput@rowBlocks := [ [ 1 ], [ 2 ], [ 3 ] ];;|
  !gapprompt@gap>| !gapinput@cong := RZMSCongruenceByLinkedTriple(s, n, colBlocks, rowBlocks);;|
  !gapprompt@gap>| !gapinput@class := RZMSCongruenceClassByLinkedTriple(cong, |
  !gapprompt@>| !gapinput@RightCoset(n,(1,5)),2,3);|
  {(2,(3,4),3)}
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsLinkedTriple}}
\logpage{[ 7, 3, 4 ]}\nobreak
\hyperdef{L}{X7B19CACF7A37ADBC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsLinkedTriple({\mdseries\slshape S, N, colBlocks, rowBlocks})\index{IsLinkedTriple@\texttt{IsLinkedTriple}}
\label{IsLinkedTriple}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 This operation returns true if and only if the arguments (\mbox{\texttt{\mdseries\slshape N}}, \mbox{\texttt{\mdseries\slshape colBlocks}}, \mbox{\texttt{\mdseries\slshape rowBlocks}}) describe a linked triple of the Rees matrix or 0-matrix semigroup \mbox{\texttt{\mdseries\slshape S}}, as described above. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@G := Group( [ (1,4,5), (1,5,3,4) ] );;|
  !gapprompt@gap>| !gapinput@mat := [ [  0,  0, (1,4,5),     0,     0, (1,4,3,5) ],|
  !gapprompt@>| !gapinput@            [  0, (),       0,     0, (3,5),         0 ],|
  !gapprompt@>| !gapinput@            [ (),  0,       0, (3,5),     0,         0 ] ];;|
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(G, mat);;|
  !gapprompt@gap>| !gapinput@N := Group([ (1,4)(3,5), (1,5)(3,4) ]);;|
  !gapprompt@gap>| !gapinput@colBlocks := [ [ 1 ], [ 2, 5 ], [ 3, 6 ], [ 4 ] ];;|
  !gapprompt@gap>| !gapinput@rowBlocks := [ [ 1 ], [ 2 ], [ 3 ] ];;|
  !gapprompt@gap>| !gapinput@IsLinkedTriple(S, N, colBlocks, rowBlocks);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{CanonicalRepresentative}}
\logpage{[ 7, 3, 5 ]}\nobreak
\hyperdef{L}{X79027F0580F9D081}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{CanonicalRepresentative({\mdseries\slshape class})\index{CanonicalRepresentative@\texttt{CanonicalRepresentative}}
\label{CanonicalRepresentative}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
A congruence class.



 This attribute gives a canonical representative for the semigroup congruence
class \mbox{\texttt{\mdseries\slshape class}}. This representative can be used to identify a class uniquely. 

 At present this only works for simple and 0-simple semigroups. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@cong := CongruencesOfSemigroup(S)[3];;|
  !gapprompt@gap>| !gapinput@class := CongruenceClasses(cong)[3];;|
  !gapprompt@gap>| !gapinput@CanonicalRepresentative(class);|
  (1,(1,2,3),2)
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AsSemigroupCongruenceByGeneratingPairs}}
\logpage{[ 7, 3, 6 ]}\nobreak
\hyperdef{L}{X7DB7E32E865AD95D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsSemigroupCongruenceByGeneratingPairs({\mdseries\slshape cong})\index{AsSemigroupCongruenceByGeneratingPairs@\texttt{AsSemigroup}\-\texttt{Congruence}\-\texttt{By}\-\texttt{Generating}\-\texttt{Pairs}}
\label{AsSemigroupCongruenceByGeneratingPairs}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup congruence.



 This operation takes \mbox{\texttt{\mdseries\slshape cong}}, a semigroup congruence, and returns the same congruence relation, but
described by \textsf{GAP}'s default method of defining semigroup congruences: a set of generating pairs
for the congruence. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@cong := CongruencesOfSemigroup(S)[3];;|
  !gapprompt@gap>| !gapinput@AsSemigroupCongruenceByGeneratingPairs(cong);|
  <semigroup congruence over <Rees 0-matrix semigroup 2x2 over 
    Sym( [ 1 .. 3 ] )> with 3 generating pairs>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AsRMSCongruenceByLinkedTriple}}
\logpage{[ 7, 3, 7 ]}\nobreak
\hyperdef{L}{X85A731257EFB88A1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsRMSCongruenceByLinkedTriple({\mdseries\slshape cong})\index{AsRMSCongruenceByLinkedTriple@\texttt{AsRMSCongruenceByLinkedTriple}}
\label{AsRMSCongruenceByLinkedTriple}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{AsRZMSCongruenceByLinkedTriple({\mdseries\slshape cong})\index{AsRZMSCongruenceByLinkedTriple@\texttt{AsRZMSCongruenceByLinkedTriple}}
\label{AsRZMSCongruenceByLinkedTriple}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A Rees matrix or 0-matrix semigroup congruence by linked triple.



 This operation takes a semigroup congruence \mbox{\texttt{\mdseries\slshape cong}} over a finite simple or 0-simple Rees 0-matrix semigroup, and returns that
congruence relation in a new form: as either a congruence by linked triple, or
a universal congruence.

 If the congruence is not defined over an appropriate type of semigroup, then
this function returns an error. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@x := ReesZeroMatrixSemigroupElement(S, 1, (1,3,2), 1);;|
  !gapprompt@gap>| !gapinput@y := ReesZeroMatrixSemigroupElement(S, 1, (), 1);;|
  !gapprompt@gap>| !gapinput@cong := SemigroupCongruenceByGeneratingPairs(S, [ [x,y] ]);;|
  !gapprompt@gap>| !gapinput@AsRZMSCongruenceByLinkedTriple(cong);|
  <semigroup congruence over <Rees 0-matrix semigroup 2x2 over 
    Sym( [ 1 .. 3 ] )> with linked triple (3,2,2)>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MeetSemigroupCongruences}}
\logpage{[ 7, 3, 8 ]}\nobreak
\hyperdef{L}{X7952A5A5789C6F60}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{MeetSemigroupCongruences({\mdseries\slshape c1, c2})\index{MeetSemigroupCongruences@\texttt{MeetSemigroupCongruences}}
\label{MeetSemigroupCongruences}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup congruence.



 This operation returns the \emph{meet} of the two semigroup congruences \mbox{\texttt{\mdseries\slshape c1}} and \mbox{\texttt{\mdseries\slshape c2}} -- that is, the largest semigroup congruence contained in both \mbox{\texttt{\mdseries\slshape c1}} and \mbox{\texttt{\mdseries\slshape c2}}.

 At present this only works for simple and 0-simple semigroups. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@congs := CongruencesOfSemigroup(S);;|
  !gapprompt@gap>| !gapinput@MeetSemigroupCongruences(congs[2], congs[3]);|
  <semigroup congruence over <Rees 0-matrix semigroup 2x2 over 
    Sym( [ 1 .. 3 ] )> with linked triple (1,2,2)>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{JoinSemigroupCongruences}}
\logpage{[ 7, 3, 9 ]}\nobreak
\hyperdef{L}{X8262D5207DBF3C5B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{JoinSemigroupCongruences({\mdseries\slshape c1, c2})\index{JoinSemigroupCongruences@\texttt{JoinSemigroupCongruences}}
\label{JoinSemigroupCongruences}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A semigroup congruence.



 This operation returns the \emph{join} of the two semigroup congruences \mbox{\texttt{\mdseries\slshape c1}} and \mbox{\texttt{\mdseries\slshape c2}} -- that is, the smallest semigroup congruence containing all the relations in
both \mbox{\texttt{\mdseries\slshape c1}} and \mbox{\texttt{\mdseries\slshape c2}}.

 At present this only works for simple and 0-simple semigroups. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@congs := CongruencesOfSemigroup(S);;|
  !gapprompt@gap>| !gapinput@JoinSemigroupCongruences(congs[2], congs[3]);|
  <semigroup congruence over <Rees 0-matrix semigroup 2x2 over 
    Sym( [ 1 .. 3 ] )> with linked triple (3,2,2)>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Universal congruences}}\logpage{[ 7, 4, 0 ]}
\hyperdef{L}{X789450398397141D}{}
{
  The linked triples of a completely 0-simple Rees 0-matrix semigroup describe
only its non-universal congruences. In any one of these, the zero element of
the semigroup is related only to itself. However, for any semigroup $S$ the universal relation $S \times S$ is a congruence; called the \emph{universal congruence}. The universal congruence on a semigroup has its own unique representation.

 Since many things we want to calculate about congruences are trivial in the
case of the universal congruence, this package contains a category
specifically designed for it, \texttt{IsUniversalSemigroupCongruence}. We also define \texttt{IsUniversalSemigroupCongruenceClass}, which represents the single congruence class of the universal congruence.

 

\subsection{\textcolor{Chapter }{IsUniversalSemigroupCongruence}}
\logpage{[ 7, 4, 1 ]}\nobreak
\hyperdef{L}{X8751EF557A81A2B1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsUniversalSemigroupCongruence({\mdseries\slshape obj})\index{IsUniversalSemigroupCongruence@\texttt{IsUniversalSemigroupCongruence}}
\label{IsUniversalSemigroupCongruence}
}\hfill{\scriptsize (category)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 This category describes a type of semigroup congruence, which must refer to
the \emph{universal semigroup congruence} $S \times S$. Externally, an object of this type may be used in the same way as any other
object in the category \texttt{IsSemigroupCongruence} (\textbf{Reference: IsSemigroupCongruence}).

 An object of this type may be constructed with \texttt{UniversalSemigroupCongruence} or this representation may be selected automatically as an alternative to an \texttt{IsRZMSCongruenceByLinkedTriple} object (since the universal congruence cannot be represented by a linked
triple). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := Semigroup([ Transformation([ 3, 2, 3 ]) ]);;|
  !gapprompt@gap>| !gapinput@U := UniversalSemigroupCongruence(S);;|
  !gapprompt@gap>| !gapinput@IsUniversalSemigroupCongruence(U);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{UniversalSemigroupCongruence}}
\logpage{[ 7, 4, 2 ]}\nobreak
\hyperdef{L}{X7B99C6A47F3D375F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{UniversalSemigroupCongruence({\mdseries\slshape S})\index{UniversalSemigroupCongruence@\texttt{UniversalSemigroupCongruence}}
\label{UniversalSemigroupCongruence}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A universal semigroup congruence.



 This operation returns the universal semigroup congruence for the semigroup \mbox{\texttt{\mdseries\slshape S}}. It can be used in the same way as any other semigroup congruence object. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S := ReesZeroMatrixSemigroup(SymmetricGroup(3), |
  !gapprompt@>| !gapinput@[[(),(1,3,2)],[(1,2),0]]);;|
  !gapprompt@gap>| !gapinput@UniversalSemigroupCongruence(S);|
  <universal semigroup congruence over 
  <Rees 0-matrix semigroup 2x2 over Sym( [ 1 .. 3 ] )>>
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{Homomorphisms}}\label{Homomorphisms}
\logpage{[ 8, 0, 0 ]}
\hyperdef{L}{X84975388859F203D}{}
{
 In this chapter we describe the various ways to define a homomorphism from a
semigroup to another semigroup. 

 Support for homomorphisms in \textsf{Semigroups} is currently rather limited but there are plans to improve this in the future. 
\section{\textcolor{Chapter }{Isomorphisms}}\logpage{[ 8, 1, 0 ]}
\hyperdef{L}{X7D702EA087C1C5EF}{}
{
 

\subsection{\textcolor{Chapter }{IsIsomorphicSemigroup}}
\logpage{[ 8, 1, 1 ]}\nobreak
\hyperdef{L}{X7A6D59247F15935E}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsIsomorphicSemigroup({\mdseries\slshape S, T})\index{IsIsomorphicSemigroup@\texttt{IsIsomorphicSemigroup}}
\label{IsIsomorphicSemigroup}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false}.



 This operation attempts to determine if the semigroups \mbox{\texttt{\mdseries\slshape S}} and \mbox{\texttt{\mdseries\slshape T}} are isomorphic, it returns \texttt{true} if they are and \texttt{false} if they are not. 

 At present this only works for rather small semigroups, with approximately 50
elements or less. 

 \textsc{Please note:} the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package version 4.5 or higher must be available and compiled installed for
this function to work. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup( [ PartialPerm( [ 1, 2, 4 ], [ 3, 5, 1 ] ), |
  !gapprompt@>| !gapinput@PartialPerm( [ 1, 3, 5 ], [ 4, 3, 2 ] ) ] );;|
  !gapprompt@gap>| !gapinput@Size(S);|
  11
  !gapprompt@gap>| !gapinput@T:=SemigroupByMultiplicationTable(SmallestMultiplicationTable(S));;|
  !gapprompt@gap>| !gapinput@IsIsomorphicSemigroup(S, T);|
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SmallestMultiplicationTable}}
\logpage{[ 8, 1, 2 ]}\nobreak
\hyperdef{L}{X7DE212DF7DF0A4E9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SmallestMultiplicationTable({\mdseries\slshape S})\index{SmallestMultiplicationTable@\texttt{SmallestMultiplicationTable}}
\label{SmallestMultiplicationTable}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
The lex-least multiplication table of a semigroup.



 This function returns the lex-least multiplication table of a semigroup
isomorphic to the semigroup \mbox{\texttt{\mdseries\slshape S}}. \texttt{SmallestMultiplicationTable} is an isomorphism invariant of semigroups, and so it can, for example, be used
to check if two semigroups are isomorphic. 

 Due to the high complexity of computing the smallest multiplication table of a
semigroup, this function only performs well for semigroups with at most
approximately 50 elements.

 \texttt{SmallestMultiplicationTable} is based on the function \texttt{IdSmallSemigroup} (\textbf{Smallsemi: IdSmallSemigroup}) by Andreas Distler.

 \textsc{Please note:} the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package version 4.5 or higher must be loaded for this function to work. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(|
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, -1, -3 ], [ -2 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3, -1 ], [ -2 ], [ -3 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, 3 ], [ -1 ], [ -2, -3 ] ] ), |
  !gapprompt@>| !gapinput@Bipartition( [ [ 1, 2, -1 ], [ 3, -2 ], [ -3 ] ] ) );;|
  !gapprompt@gap>| !gapinput@Size(S);|
  8
  !gapprompt@gap>| !gapinput@SmallestMultiplicationTable(S);|
  [ [ 1, 1, 3, 4, 5, 6, 7, 8 ], [ 1, 1, 3, 4, 5, 6, 7, 8 ], 
    [ 1, 1, 3, 4, 5, 6, 7, 8 ], [ 1, 3, 3, 4, 5, 6, 7, 8 ], 
    [ 5, 5, 6, 7, 5, 6, 7, 8 ], [ 5, 5, 6, 7, 5, 6, 7, 8 ], 
    [ 5, 6, 6, 7, 5, 6, 7, 8 ], [ 5, 6, 6, 7, 5, 6, 7, 8 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsomorphismSemigroups}}
\logpage{[ 8, 1, 3 ]}\nobreak
\hyperdef{L}{X8248C522825E2684}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsomorphismSemigroups({\mdseries\slshape S, T})\index{IsomorphismSemigroups@\texttt{IsomorphismSemigroups}}
\label{IsomorphismSemigroups}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
An isomorphism or \texttt{fail}.



 This operation returns an isomorphism from the semigroup \mbox{\texttt{\mdseries\slshape S}} and to the semigroup \mbox{\texttt{\mdseries\slshape T}} if it exists, and it returns \texttt{fail} if it does not.

 At present this only works for Rees matrix semigroups and Rees 0-matrix
semigroups.

 \textsc{Please note:} the \href{http://www.maths.qmul.ac.uk/~leonard/grape/} {Grape} package version 4.5 or higher must be available and compiled for this function
to work, when the argument \mbox{\texttt{\mdseries\slshape R}} is a Rees 0-matrix semigroup. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=PrincipalFactor(DClasses(FullTransformationMonoid(5))[2]);|
  <Rees 0-matrix semigroup 10x5 over Group([ (1,2,3,4), (1,2) ])>
  !gapprompt@gap>| !gapinput@T:=PrincipalFactor(DClasses(PartitionMonoid(5))[2]);|
  <Rees 0-matrix semigroup 15x15 over Group([ (2,3,4,5), (4,5) ])>
  !gapprompt@gap>| !gapinput@IsomorphismSemigroups(S, T);|
  fail
  !gapprompt@gap>| !gapinput@I:=SemigroupIdeal(FullTransformationMonoid(5), |
  !gapprompt@>| !gapinput@Transformation([1,1,2,3,4]));|
  <regular transformation semigroup ideal on 5 pts with 1 generator>
  !gapprompt@gap>| !gapinput@T:=PrincipalFactor(DClass(I, I.1));|
  <Rees 0-matrix semigroup 10x5 over Group([ (2,3,4,5), (2,5) ])>
  !gapprompt@gap>| !gapinput@IsomorphismSemigroups(S, T);|
  (( 2, 4, 3, 7, 9,10, 6, 5)
  (11,13,14,15), GroupHomomorphismByImages( Group( [ (1,2,3,4), (1,2) 
   ] ), Group( [ (2,3,4,5), (2,5) ] ), [ (1,2,3,4), (1,2) ], 
  [ (2,4,5,3), (2,4) ] ), fail)
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{ Orbits }}\label{orbits}
\logpage{[ 9, 0, 0 ]}
\hyperdef{L}{X81E0FF0587C54543}{}
{
  
\section{\textcolor{Chapter }{Looking for something in an orbit}}\logpage{[ 9, 1, 0 ]}
\hyperdef{L}{X7B4CFC5380ACB95F}{}
{
 The functions described in this section supplement the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/orb.html } {Orb} package by providing methods for finding something in an orbit, with the
possibility of continuing the orbit enumeration at some later point. 

\subsection{\textcolor{Chapter }{EnumeratePosition}}
\logpage{[ 9, 1, 1 ]}\nobreak
\hyperdef{L}{X7C8B0A2A82C9E4D8}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{EnumeratePosition({\mdseries\slshape o, val[, onlynew]})\index{EnumeratePosition@\texttt{EnumeratePosition}}
\label{EnumeratePosition}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A positive integer or \texttt{fail}.



 This function returns the position of the value \mbox{\texttt{\mdseries\slshape val}} in the orbit \mbox{\texttt{\mdseries\slshape o}}. If \mbox{\texttt{\mdseries\slshape o}} is closed, then this is equivalent to doing \texttt{Position(\mbox{\texttt{\mdseries\slshape o}}, \mbox{\texttt{\mdseries\slshape val}})}. However, if \mbox{\texttt{\mdseries\slshape o}} is open, then the orbit is enumerated until \mbox{\texttt{\mdseries\slshape val}} is found, in which case the position of \mbox{\texttt{\mdseries\slshape val}} is returned, or the enumeration ends, in which case \texttt{fail} is returned. 

 If the optional argument \mbox{\texttt{\mdseries\slshape onlynew}} is present, it should be \texttt{true} or \texttt{false}. If \mbox{\texttt{\mdseries\slshape onlynew}} is \texttt{true}, then \mbox{\texttt{\mdseries\slshape val}} will only be checked against new points in \mbox{\texttt{\mdseries\slshape o}}. Otherwise, every point in the \mbox{\texttt{\mdseries\slshape o}}, not only the new ones, is considered. }

 

\subsection{\textcolor{Chapter }{LookForInOrb}}
\logpage{[ 9, 1, 2 ]}\nobreak
\hyperdef{L}{X7DEB890C7D547574}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{LookForInOrb({\mdseries\slshape o, func, start})\index{LookForInOrb@\texttt{LookForInOrb}}
\label{LookForInOrb}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{false} or a positive integer.



 The arguments of this function should be an orbit \mbox{\texttt{\mdseries\slshape o}}, a function \mbox{\texttt{\mdseries\slshape func}} which gets the orbit object and a point in the orbit as arguments, and a
positive integer \mbox{\texttt{\mdseries\slshape start}}. The function \mbox{\texttt{\mdseries\slshape func}} will be called for every point in \mbox{\texttt{\mdseries\slshape o}} starting from \mbox{\texttt{\mdseries\slshape start}} (inclusive) and the orbit will be enumerated until \mbox{\texttt{\mdseries\slshape func}} returns \texttt{true} or the enumeration ends. In the former case, the position of the first point
in \mbox{\texttt{\mdseries\slshape o}} for which \mbox{\texttt{\mdseries\slshape func}} returns \texttt{true} is returned, and in the latter \texttt{false} is returned. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@o:=Orb(SymmetricGroup(100), 1, OnPoints);|
  <open Int-orbit, 1 points>
  !gapprompt@gap>| !gapinput@func:=function(o, x) return x=42; end;|
  function( o, x ) ... end
  !gapprompt@gap>| !gapinput@LookForInOrb(o, func, 1);|
  42
  !gapprompt@gap>| !gapinput@o;|
  <open Int-orbit, 42 points>
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Strongly connected components of orbits}}\logpage{[ 9, 2, 0 ]}
\hyperdef{L}{X80B19F9E8631D88B}{}
{
  The functions described in this section supplement the \href{ http://www-groups.mcs.st-and.ac.uk/~neunhoef/Computer/Software/Gap/orb.html } {Orb} package by providing methods for operations related to strongly connected
components of orbits.

 If any of the functions is applied to an open orbit, then the orbit is
completely enumerated before any further calculation is performed. It is not
possible to calculate the strongly connected components of an orbit of a
semigroup acting on a set until the entire orbit has been found. 

\subsection{\textcolor{Chapter }{OrbSCC}}
\logpage{[ 9, 2, 1 ]}\nobreak
\hyperdef{L}{X8178A420792E6AAC}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{OrbSCC({\mdseries\slshape o})\index{OrbSCC@\texttt{OrbSCC}}
\label{OrbSCC}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
The strongly connected components of an orbit.



 If \mbox{\texttt{\mdseries\slshape o}} is an orbit created by the \textsf{Orb} package with the option \texttt{orbitgraph=true}, then \texttt{OrbSCC} returns a set of sets of positions in \mbox{\texttt{\mdseries\slshape o}} corresponding to its strongly connected components. 

 See also \texttt{OrbSCCLookup} (\ref{OrbSCCLookup}) and \texttt{OrbSCCTruthTable} (\ref{OrbSCCTruthTable}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=FullTransformationSemigroup(4);;|
  !gapprompt@gap>| !gapinput@o:=LambdaOrb(S);|
  <open orbit, 1 points with Schreier tree with log>
  !gapprompt@gap>| !gapinput@OrbSCC(o);|
  [ [ 1 ], [ 2 ], [ 3, 4, 5, 6 ], [ 7, 8, 9, 10, 11, 12 ], 
    [ 13, 14, 15, 16 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{OrbSCCLookup}}
\logpage{[ 9, 2, 2 ]}\nobreak
\hyperdef{L}{X814337A47B773F50}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{OrbSCCLookup({\mdseries\slshape o})\index{OrbSCCLookup@\texttt{OrbSCCLookup}}
\label{OrbSCCLookup}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A lookup table for the strongly connected components of an orbit. 



 If \mbox{\texttt{\mdseries\slshape o}} is an orbit created by the \textsf{Orb} package with the option \texttt{orbitgraph=true}, then \texttt{OrbSCCLookup} returns a lookup table for its strongly connected components. More precisely, \texttt{OrbSCCLookup(o)[i]} equals the index of the strongly connected component containing \texttt{o[i]}. 

 See also \texttt{OrbSCC} (\ref{OrbSCC}) and \texttt{OrbSCCTruthTable} (\ref{OrbSCCTruthTable}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=FullTransformationSemigroup(4);;|
  !gapprompt@gap>| !gapinput@o:=LambdaOrb(S);;|
  !gapprompt@gap>| !gapinput@OrbSCC(o);|
  [ [ 1 ], [ 2 ], [ 3, 4, 5, 6 ], [ 7, 8, 9, 10, 11, 12 ], 
    [ 13, 14, 15, 16 ] ]
  !gapprompt@gap>| !gapinput@OrbSCCLookup(o);|
  [ 1, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 ]
  !gapprompt@gap>| !gapinput@OrbSCCLookup(o)[1]; OrbSCCLookup(o)[4]; OrbSCCLookup(o)[7]; |
  1
  3
  4
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{OrbSCCTruthTable}}
\logpage{[ 9, 2, 3 ]}\nobreak
\hyperdef{L}{X78AFD003840823BD}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{OrbSCCTruthTable({\mdseries\slshape o})\index{OrbSCCTruthTable@\texttt{OrbSCCTruthTable}}
\label{OrbSCCTruthTable}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
Truth tables for strongly connected components of an orbit. 



 If \mbox{\texttt{\mdseries\slshape o}} is an orbit created by the \textsf{Orb} package with the option \texttt{orbitgraph=true}, then \texttt{OrbSCCTruthTable} returns a list of boolean lists such that \texttt{OrbSCCTruthTable(o)[i][j]} is \texttt{true} if \texttt{j} belongs to \texttt{OrbSCC(o)[i]}.

 See also \texttt{OrbSCC} (\ref{OrbSCC}) and \texttt{OrbSCCLookup} (\ref{OrbSCCLookup}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=FullTransformationSemigroup(4);;|
  !gapprompt@gap>| !gapinput@o:=LambdaOrb(S);;|
  !gapprompt@gap>| !gapinput@OrbSCC(o);|
  [ [ 1 ], [ 2 ], [ 3, 4, 5, 6 ], [ 7, 8, 9, 10, 11, 12 ], 
    [ 13, 14, 15, 16 ] ]
  !gapprompt@gap>| !gapinput@OrbSCCTruthTable(o);|
  [ [ true, false, false, false, false, false, false, false, false, 
        false, false, false, false, false, false, false ], 
    [ false, true, false, false, false, false, false, false, false, 
        false, false, false, false, false, false, false ], 
    [ false, false, true, true, true, true, false, false, false, false, 
        false, false, false, false, false, false ], 
    [ false, false, false, false, false, false, true, true, true, true, 
        true, true, false, false, false, false ], 
    [ false, false, false, false, false, false, false, false, false, 
        false, false, false, true, true, true, true ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ReverseSchreierTreeOfSCC}}
\logpage{[ 9, 2, 4 ]}\nobreak
\hyperdef{L}{X7D9A29B47D743213}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ReverseSchreierTreeOfSCC({\mdseries\slshape o, i})\index{ReverseSchreierTreeOfSCC@\texttt{ReverseSchreierTreeOfSCC}}
\label{ReverseSchreierTreeOfSCC}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
The reverse Schreier tree corresponding to the \mbox{\texttt{\mdseries\slshape i}}th strongly connected component of an orbit. 



 If \mbox{\texttt{\mdseries\slshape o}} is an orbit created by the \textsf{Orb} package with the option \texttt{orbitgraph=true} and action \texttt{act}, and \mbox{\texttt{\mdseries\slshape i}} is a positive integer, then \texttt{ReverseSchreierTreeOfSCC(\mbox{\texttt{\mdseries\slshape o}}, \mbox{\texttt{\mdseries\slshape i}})} returns a pair \texttt{[ gen, pos ]} of lists with \texttt{Length(o)} entries such that 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  act(o[j], o!.gens[gen[j]])=o[pos[j]].
\end{Verbatim}
 The pair \texttt{[ gen, pos ]} corresponds to a tree with root \texttt{OrbSCC(o)[i][1]} and a path from every element of \texttt{OrbSCC(o)[i]} to the root. 

 See also \texttt{OrbSCC} (\ref{OrbSCC}), \texttt{TraceSchreierTreeOfSCCBack} (\ref{TraceSchreierTreeOfSCCBack}), \texttt{SchreierTreeOfSCC} (\ref{SchreierTreeOfSCC}), and \texttt{TraceSchreierTreeOfSCCForward} (\ref{TraceSchreierTreeOfSCCForward}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 2, 1, 4, 4 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 3, 4, 5 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 5, 1, 4, 5, 5 ] ) );;|
  !gapprompt@gap>| !gapinput@o:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;|
  !gapprompt@gap>| !gapinput@OrbSCC(o);|
  [ [ 1 ], [ 2 ], [ 3, 5, 6, 7, 11 ], [ 4 ], [ 8 ], [ 9 ], [ 10, 12 ] ]
  !gapprompt@gap>| !gapinput@ReverseSchreierTreeOfSCC(o, 3);|
  [ [ ,, fail,, 2, 1, 2,,,, 1 ], [ ,, fail,, 3, 5, 3,,,, 7 ] ]
  !gapprompt@gap>| !gapinput@ReverseSchreierTreeOfSCC(o, 7);|
  [ [ ,,,,,,,,, fail,, 3 ], [ ,,,,,,,,, fail,, 10 ] ]
  !gapprompt@gap>| !gapinput@OnSets(o[11], Generators(S)[1]);|
  [ 1, 4 ]
  !gapprompt@gap>| !gapinput@Position(o, last);|
  7
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SchreierTreeOfSCC}}
\logpage{[ 9, 2, 5 ]}\nobreak
\hyperdef{L}{X8071C7148255D0DB}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{SchreierTreeOfSCC({\mdseries\slshape o, i})\index{SchreierTreeOfSCC@\texttt{SchreierTreeOfSCC}}
\label{SchreierTreeOfSCC}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
The Schreier tree corresponding to the \mbox{\texttt{\mdseries\slshape i}}th strongly connected component of an orbit. 



 If \mbox{\texttt{\mdseries\slshape o}} is an orbit created by the \textsf{Orb} package with the option \texttt{orbitgraph=true} and action \texttt{act}, and \mbox{\texttt{\mdseries\slshape i}} is a positive integer, then \texttt{SchreierTreeOfSCC(\mbox{\texttt{\mdseries\slshape o}}, \mbox{\texttt{\mdseries\slshape i}})} returns a pair \texttt{[ gen, pos ]} of lists with \texttt{Length(o)} entries such that 
\begin{Verbatim}[commandchars=@|A,fontsize=\small,frame=single,label=Example]
  act(o[pos[j]], o!.gens[gen[j]])=o[j].
\end{Verbatim}
 The pair \texttt{[ gen, pos ]} corresponds to a tree with root \texttt{OrbSCC(o)[i][1]} and a path from the root to every element of \texttt{OrbSCC(o)[i]}. 

 See also \texttt{OrbSCC} (\ref{OrbSCC}), \texttt{TraceSchreierTreeOfSCCBack} (\ref{TraceSchreierTreeOfSCCBack}), \texttt{ReverseSchreierTreeOfSCC} (\ref{ReverseSchreierTreeOfSCC}), and \texttt{TraceSchreierTreeOfSCCForward} (\ref{TraceSchreierTreeOfSCCForward}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 2, 2, 1, 4, 4 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 3, 4, 5 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 5, 1, 4, 5, 5 ] ) );;|
  !gapprompt@gap>| !gapinput@o:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;|
  !gapprompt@gap>| !gapinput@OrbSCC(o);|
  [ [ 1 ], [ 2 ], [ 3, 5, 6, 7, 11 ], [ 4 ], [ 8 ], [ 9 ], [ 10, 12 ] ]
  !gapprompt@gap>| !gapinput@SchreierTreeOfSCC(o, 3);|
  [ [ ,, fail,, 1, 3, 1,,,, 2 ], [ ,, fail,, 7, 5, 3,,,, 6 ] ]
  !gapprompt@gap>| !gapinput@SchreierTreeOfSCC(o, 7);|
  [ [ ,,,,,,,,, fail,, 1 ], [ ,,,,,,,,, fail,, 10 ] ]
  !gapprompt@gap>| !gapinput@OnSets(o[6], Generators(S)[2]);|
  [ 3, 5 ]
  !gapprompt@gap>| !gapinput@Position(o, last);|
  11
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{TraceSchreierTreeOfSCCBack}}
\logpage{[ 9, 2, 6 ]}\nobreak
\hyperdef{L}{X7853DC817C3102A4}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TraceSchreierTreeOfSCCBack({\mdseries\slshape orb, m, nr})\index{TraceSchreierTreeOfSCCBack@\texttt{TraceSchreierTreeOfSCCBack}}
\label{TraceSchreierTreeOfSCCBack}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A word in the generators.



 \mbox{\texttt{\mdseries\slshape orb}} must be an orbit object with a Schreier tree and orbit graph, that is, the
options \texttt{schreier} and \texttt{orbitgraph} must have been set to \texttt{true} during the creation of the orbit, \mbox{\texttt{\mdseries\slshape m}} must be the number of a strongly connected component of \mbox{\texttt{\mdseries\slshape orb}}, and \texttt{nr} must be the number of a point in the \mbox{\texttt{\mdseries\slshape m}}th strongly connect component of \mbox{\texttt{\mdseries\slshape orb}}. 

 This operation traces the result of \texttt{ReverseSchreierTreeOfSCC} (\ref{ReverseSchreierTreeOfSCC}) and with arguments \mbox{\texttt{\mdseries\slshape orb}} and \mbox{\texttt{\mdseries\slshape m}} and returns a word in the generators that maps the point with number \mbox{\texttt{\mdseries\slshape nr}} to the first point in the \mbox{\texttt{\mdseries\slshape m}}th strongly connected component of \mbox{\texttt{\mdseries\slshape orb}}. Here, a word is a list of integers, where positive integers are numbers of
generators. See also \texttt{OrbSCC} (\ref{OrbSCC}), \texttt{ReverseSchreierTreeOfSCC} (\ref{ReverseSchreierTreeOfSCC}), \texttt{SchreierTreeOfSCC} (\ref{SchreierTreeOfSCC}), and \texttt{TraceSchreierTreeOfSCCForward} (\ref{TraceSchreierTreeOfSCCForward}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 1, 3, 4, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 2, 4, 1, 2 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 3, 1, 1, 3 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 4, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@o:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;|
  !gapprompt@gap>| !gapinput@OrbSCC(o);|
  [ [ 1 ], [ 2 ], [ 3 ], [ 4, 5, 6, 7, 8 ], [ 9, 10, 11, 12 ] ]
  !gapprompt@gap>| !gapinput@ReverseSchreierTreeOfSCC(o, 4);               |
  [ [ ,,, fail, 4, 1, 1, 3 ], [ ,,, fail, 4, 4, 4, 4 ] ]
  !gapprompt@gap>| !gapinput@TraceSchreierTreeOfSCCBack(o, 4, 7);|
  [ 1 ]
  !gapprompt@gap>| !gapinput@TraceSchreierTreeOfSCCBack(o, 4, 8);|
  [ 3 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{TraceSchreierTreeOfSCCForward}}
\logpage{[ 9, 2, 7 ]}\nobreak
\hyperdef{L}{X7D2E200A7B2D5946}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{TraceSchreierTreeOfSCCForward({\mdseries\slshape orb, m, nr})\index{TraceSchreierTreeOfSCCForward@\texttt{TraceSchreierTreeOfSCCForward}}
\label{TraceSchreierTreeOfSCCForward}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
A word in the generators.



 \mbox{\texttt{\mdseries\slshape orb}} must be an orbit object with a Schreier tree and orbit graph, that is, the
options \texttt{schreier} and \texttt{orbitgraph} must have been set to \texttt{true} during the creation of the orbit, \mbox{\texttt{\mdseries\slshape m}} must be the number of a strongly connected component of \mbox{\texttt{\mdseries\slshape orb}}, and \texttt{nr} must be the number of a point in the \mbox{\texttt{\mdseries\slshape m}}th strongly connect component of \mbox{\texttt{\mdseries\slshape orb}}. 

 This operation traces the result of \texttt{SchreierTreeOfSCC} (\ref{SchreierTreeOfSCC}) and with arguments \mbox{\texttt{\mdseries\slshape orb}} and \mbox{\texttt{\mdseries\slshape m}} and returns a word in the generators that maps the first point in the \mbox{\texttt{\mdseries\slshape m}}th strongly connected component of \mbox{\texttt{\mdseries\slshape orb}} to the point with number \mbox{\texttt{\mdseries\slshape nr}}. Here, a word is a list of integers, where positive integers are numbers of
generators. See also \texttt{OrbSCC} (\ref{OrbSCC}), \texttt{ReverseSchreierTreeOfSCC} (\ref{ReverseSchreierTreeOfSCC}), \texttt{SchreierTreeOfSCC} (\ref{SchreierTreeOfSCC}), and \texttt{TraceSchreierTreeOfSCCBack} (\ref{TraceSchreierTreeOfSCCBack}). 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  !gapprompt@gap>| !gapinput@S:=Semigroup(Transformation( [ 1, 3, 4, 1 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 2, 4, 1, 2 ] ),|
  !gapprompt@>| !gapinput@Transformation( [ 3, 1, 1, 3 ] ), |
  !gapprompt@>| !gapinput@Transformation( [ 3, 3, 4, 1 ] ) );;|
  !gapprompt@gap>| !gapinput@o:=Orb(S, [1..4], OnSets, rec(orbitgraph:=true, schreier:=true));;|
  !gapprompt@gap>| !gapinput@OrbSCC(o);|
  [ [ 1 ], [ 2 ], [ 3 ], [ 4, 5, 6, 7, 8 ], [ 9, 10, 11, 12 ] ]
  !gapprompt@gap>| !gapinput@SchreierTreeOfSCC(o, 4);|
  [ [ ,,, fail, 1, 2, 2, 4 ], [ ,,, fail, 4, 4, 6, 4 ] ]
  !gapprompt@gap>| !gapinput@TraceSchreierTreeOfSCCForward(o, 4, 8);|
  [ 4 ]
  !gapprompt@gap>| !gapinput@TraceSchreierTreeOfSCCForward(o, 4, 7);|
  [ 2, 2 ]
\end{Verbatim}
 }

 }

 }

  \def\bibname{References\logpage{[ "Bib", 0, 0 ]}
\hyperdef{L}{X7A6F98FD85F02BFE}{}
}

\bibliographystyle{alpha}
\bibliography{semigroups}

\addcontentsline{toc}{chapter}{References}

\def\indexname{Index\logpage{[ "Ind", 0, 0 ]}
\hyperdef{L}{X83A0356F839C696F}{}
}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
