Goto Chapter: Top 1 2 3 4 Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

3 Creating semigroups and monoids
 3.1 Semigroups defined by a generating set
 3.2 New semigroups from old
 3.3 Options when creating semigroups
 3.4 Standard examples
 3.5 The examples directory

3 Creating semigroups and monoids

In this chapter we describe the various ways that semigroups and monoids can be created in Citrus, the options that are available at the time of creation, and describe some standard examples availabl in Citrus.

Any transformation semigroup created before Citrus has been loaded must be recreated after Citrus is loaded so that the options record (described in Section 3.3) is defined. Almost all of the functions and methods provided by Citrus, including those methods for existing GAP library functions, will return an error when applied to a transformation semigroup created before Citrus is loaded.

3.1 Semigroups defined by a generating set

In this section we give details of how to create semigroups and monoids from a set of generators. Much of what is described here is syntactic sugar.

3.1-1 InverseMonoid
‣ InverseMonoid( obj1, obj2, ...[, opts] )( function )
‣ InverseSemigroup( obj1, obj2, ...[, opts] )( function )

Returns: An inverse semigroup or monoid.

If obj1, obj2, ... are (any combination) of partial permutations, partial permutation semigroup, or lists of partial permutations, then InverseMonoid or InverseSemigroup returns the inverse monoid or semigroup generated by the union of obj1, obj2, ... which equals the semigroup or monoid generated by the union of obj1, obj2, ... and their inverses.

If present, the optional final argument opts should be a record containing the values of the options for the inverse semigroup being created, as described in Section 3.3.

As an example of how the syntax provided by Citrus can be convenient: U:=Semigroup(S, f, Idempotents(T));, in the example below, returns the same value as: U:=Semigroup(Concatenation(Generators(S), [f], Idempotents(T)));.

gap> S:=InverseSemigroup(
> PartialPermNC( [ 1, 2, 3, 4, 6, 8, 9, 10, 11, 13, 14, 16, 17, 18, 20 ], 
> [ 2, 14, 5, 8, 11, 12, 16, 17, 18, 9, 13, 15, 20, 6, 4 ] ),
> PartialPermNC( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 17 ], 
> [ 2, 14, 8, 19, 5, 1, 3, 16, 6, 9, 10, 17, 12, 20 ] ));;
gap> f:=PartialPermNC( 
> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 
>  18, 20, 22, 23, 25, 26, 30, 31, 32, 33, 34, 39, 40, 42, 43, 45 ], 
> [ 4, 47, 34, 19, 32, 22, 12, 15, 16, 45, 49, 8, 24, 40, 17, 
>  46, 14, 6, 44, 2, 48, 41, 10, 31, 18, 50, 23, 5, 37, 11, 38, 30, 21 ] );;
gap> S:=InverseSemigroup(S, f, Idempotents(SymmetricInverseSemigp(10)));
<inverse semigroup with 1027 generators>
gap> S:=InverseSemigroup(S, f, Idempotents(SymmetricInverseSemigp(10)),
> rec(small:=true));
<inverse semigroup with 13 generators>
gap> Size(S);
17147970
gap> S:=InverseMonoid(Generators(S));
<inverse monoid with 13 generators>
gap> Size(S);
17147971

3.1-2 InverseMonoidByGenerators
‣ InverseMonoidByGenerators( coll[, opts] )( function )
‣ InverseSemigroupByGenerators( coll[, opts] )( function )

Returns: An inverse monoid or semigroup.

If coll is a partial permutation collection, then InverseMonoidByGenerators and InverseSemigroupByGenerators return the inverse monoid and semigroup generated by coll, respectively.

If present, the optional second argument opts should be a record containing the values of the options for the semigroup being created, as described in Section 3.3.

3.1-3 Monoid
‣ Monoid( obj1, obj2, ...[, opts] )( function )
‣ Semigroup( obj1, obj2, ...[, opts] )( function )

Returns: A monoid or semigroup.

If obj1, obj2, ... are (any combination) of transformations, transformation semigroups, or lists of transformations, then Monoid or Semigroup returns the monoid or semigroup generated by the union of obj1, obj2, ....

If present, the optional final argument opts should be a record containing the values of the options for the semigroup being created, as described in Section 3.3.

When applied to arguments other than transformations or transformation collections these functions behave precisely as described in the reference manual. Please consult Monoid (Reference: Monoid) and Semigroup (Reference: Semigroup) for further details.

As an example of how the syntax provided by Citrus can be convenient: U:=Semigroup(S, f, Idempotents(T));, in the example below, returns the same value as: U:=Semigroup(Concatenation(Generators(S), [f], Idempotents(T)));.

gap> S:=Semigroup(Transformation( [ 1, 3, 4, 1, 3, 5 ] ), 
> Transformation( [ 5, 1, 6, 1, 6, 3 ] ) );;
gap> f:=Transformation( [ 2, 4, 6, 1, 6, 5 ] );;
gap> T:=Monoid(Transformation( [ 4, 1, 2, 6, 2, 1 ] ),
> Transformation( [ 5, 2, 5, 3, 5, 3 ] ) );;
gap> U:=Semigroup(S, f, Idempotents(T));
<semigroup with 14 generators>
gap> Size(U);
2182
gap> NrRClasses(U);
53

3.1-4 MonoidByGenerators
‣ MonoidByGenerators( coll[, opts] )( method )
‣ SemigroupByGenerators( coll[, opts] )( method )

Returns: A monoid or semigroup.

If coll is a transformation collection, then MonoidByGenerators and SemigroupByGenerators return the monoid and semigroup generated by coll, respectively.

If present, the optional second argument opts should be a record containing the values of the options for the semigroup being created, as described in Section 3.3.

When applied to arguments other than transformations or transformation collections these functions behave precisely as described in the reference manual. Please consult MonoidByGenerators (Reference: MonoidByGenerators) and SemigroupByGenerators (Reference: SemigroupByGenerators) for further details.

3.1-5 RandomInverseMonoid
‣ RandomInverseMonoid( m, n )( function )
‣ RandomInverseSemigroup( m, n )( function )

Returns: An inverse monoid or semigroup.

Returns a random inverse monoid or semigroup of partial permutations with degree at most n with m generators.

gap> S:=RandomInverseSemigroup(10,10);                                
<inverse semigroup with 10 generators>
gap> S:=RandomInverseMonoid(10,10);   
<inverse monoid with 10 generators>

3.1-6 RandomTransformationMonoid
‣ RandomTransformationMonoid( m, n )( function )
‣ RandomTransformationSemigroup( m, n )( function )

Returns: A transformation semigroup.

Returns a random transformation monoid or semigroup of degree n with m generators.

gap> S:=RandomTransformationMonoid(5,5);
<monoid with 5 generators>
gap> S:=RandomTransformationSemigroup(5,5);
<semigroup with 5 generators>

3.2 New semigroups from old

3.2-1 ClosureInverseSemigroup
‣ ClosureInverseSemigroup( S, coll[, opts] )( function )

Returns: An inverse semigroup or monoid.

This function returns the inverse semigroup or monoid generated by the inverse semigroup of partial permutations S and the partial permutation collection or partial permutation coll after first removing duplicates and partial permutations in coll that are already in S. In most cases, the new semigroups knows at least as much information about its structure as was already known about that of S.

If present, the optional third argument opts should be a record contiaing the values of the options for the inverse semigroup being created; these options are described in Section 3.3.

Unlike ClosureSemigroup (3.2-2), ClosureInverseSemigroup is always at least as efficient as (and often much more than) simply creating an inverse semigroup from scratch using InverseSemigroup (3.1-1).

gap> S:=InverseMonoid(
> PartialPermNC( [ 1, 2, 3, 5, 6, 7, 8 ], [ 5, 9, 10, 6, 3, 8, 4 ] ),
> PartialPermNC( [ 1, 2, 4, 7, 8, 9 ], [ 10, 7, 8, 5, 9, 1 ] ) );;
gap> f:=PartialPermNC(
> [ 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 18, 19, 20 ],
> [ 5, 1, 7, 3, 10, 2, 12, 14, 11, 16, 6, 9, 15 ]);;
gap> S:=ClosureInverseSemigroup(S, f);
<inverse semigroup with 3 generators>
gap> Size(S);
9726
gap> T:=Idempotents(SymmetricInverseSemigp(10));;
gap> S:=ClosureInverseSemigroup(S, T);
<inverse semigroup with 858 generators>
gap> S:=InverseSemigroup(SmallGeneratingSet(S));
<inverse semigroup with 14 generators>

3.2-2 ClosureSemigroup
‣ ClosureSemigroup( S, coll[, opts] )( function )

Returns: A transformation semigroup or monoid.

This function returns the semigroup or monoid generated by the transformation semigroup S and the transformation collection or transformation coll after removing duplicates and transformations in coll that are already in S. In some cases, the new semigroup knows at least as much information about its structure as was already known about that of S.

If present, the optional third argument opts should be a record containing the values of the options for the semigroup being created as described in Section 3.3. For technical reasons if the option schreier is false, then ClosureSemigroup(S, coll) does exactly the same as Semigroup (3.1-3) or Monoid (3.1-3), in that the new semigroup does not know any information about its structure even if the old semigroup had been completely determined.

More specifically, if the option schreier is false, then the new semigroup knows the Green's class of any representative of a Green's classes of S that was known at the time that ClosureSemigroup was called. Consequently, if, for example, the number of \(\mathcal{R}\)-classes of S is greater than the number of elements required to find the \(\mathcal{R}\)-classes of the new semigroup, then ClosureSemigroup might be less efficient than creating the new semigroup using the command Semigroup (3.1-3) or Monoid (3.1-3). It is unlikely that you will be able to determine which of ClosureSemigroup and Semigroup (3.1-3) will be better before calling these functions, except in the following case. If the rank of the transformations in coll are lower than the ranks of the Green's classes containing the majority of the known elements of S, then ClosureSemigroup should be superior to Semigroup (3.1-3).

gap> gens:=[ Transformation( [ 2, 6, 7, 2, 6, 1, 1, 5 ] ), 
>  Transformation( [ 3, 8, 1, 4, 5, 6, 7, 1 ] ), 
>  Transformation( [ 4, 3, 2, 7, 7, 6, 6, 5 ] ), 
>  Transformation( [ 7, 1, 7, 4, 2, 5, 6, 3 ] ) ];;
gap> S:=Monoid(gens[1], rec(schreier:=false));;
gap> for i in [2..4] do S:=ClosureSemigroup(S, gens[i]); od;
gap> S;
<monoid with 4 generators>
gap> Size(S);
233606

3.2-3 SubsemigroupByProperty
‣ SubsemigroupByProperty( S, func )( operation )
‣ SubsemigroupByProperty( S, func, limit )( operation )

Returns: A semigroup.

SubsemigroupByProperty creates a subsemigroup of the semigroup S of transformations or partial permutations consisting of those elements fulfilling func (which should be a function returning true or false). No test is done to check if the property actually defines a subsemigroup.

If the optional third argument limit is present and a positive integer, then once the subsemigroup has at least limit elements the computation stops.

3.3 Options when creating semigroups

When using any of InverseSemigroup (3.1-1), InverseMonoid (3.1-1), Semigroup (3.1-3), Monoid (3.1-3), SemigroupByGenerators (3.1-4), MonoidByGenerators (3.1-4), ClosureInverseSemigroup (3.2-1) or ClosureSemigroup (3.2-2) 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 S is the semigroup created by one of the functions given above and that S is generated by the list of transformations gens.

hashlen

this component should be a positive integer, which roughly specifies the lengths of the hash tables used internally by Citrus. Citrus 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 GAP runs out of memory unexpectedly or that the performance of Citrus is poorer than expected. If you find that 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 hashlen to be less than the default value of 25013 for each of these semigroups. If you find that the performance of Citrus 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 hashlen to be greater than the default value of 25013.

You might find it useful to set the info level of the info class InfoOrb to 2 or higher since this will indicate when hash tables used by Citrus are being grown; see SetInfoLevel (Reference: SetInfoLevel).

schreier

if this component is set to true, then Citrus will keep track of various pieces of information so that it is possible to factorize elements of S using Factorization (4.1-2). This will cause a slight decrease in performance and an increase in memory usage. If this component is set to false, then it will not be possible to factorize the elements of S using Factorization (4.1-2). The default value for this component is true.

small

if this component is set to true, then Citrus will compute a small subset of gens that generates S at the time that S is created. This will increase the amount of time required to create S substantially, but may decrease the amount of time required for subsequent calculations with S. If this component is set to false, then Citrus will return the semigroup generated by gens without modifying gens. The default value for this component is false.

The default values of the options described above are stored in a global variable named CitrusOptionsRec (3.3-1). If you want to change the default values of these options for a single GAP session, then you can simply redefine the value in GAP. For example, to change the option small from the default value of false use:

gap> CitrusOptionsRec.small:=true;
true

If you want to change the default values of the options stored in CitrusOptionsRec (3.3-1) for all subsequent GAP sessions, then you can edit these values in the file citrus/gap/options.g.

gap> S:=Semigroup(Transformation( [ 1, 2, 3, 3 ] ), rec(schreier:=true,
> hashlen:=100003, small:=false));
<semigroup with 1 generator>

3.3-1 CitrusOptionsRec
‣ CitrusOptionsRec( global variable )

This global variable is a record whose components contain the default values of certain options for transformation semigroups created after Citrus has been loaded. A description of these options is given above in Section 3.3.

The value of CitrusOptionsRec is defined in the file citrus/gap/options.g as:

rec( schreier:=true, small:=false,
         hashlen:=rec(S:=251, M:=6257, L:=25013));

3.4 Standard examples

In this section we describe functions for creating several standard examples of semigroups of transformations and partial permutations.

3.4-1 FullMatrixSemigroup
‣ FullMatrixSemigroup( d, q )( operation )
‣ GeneralLinearSemigroup( d, q )( operation )

Returns: A matrix semigroup.

FullMatrixSemigroup and GeneralLinearSemigroup are synonyms for each other. They both return the full matrix semigroup, or if you prefer the general linear semigroup, of d by d matrices with entries over the field with q elements. This semigroup has q^(d^2) elements.

Please note: there are currently no special methods for computing with matrix semigroups in Citrus and so it might be advisable to use IsomorphismTransformationSemigroup (4.7-4).

gap> S:=FullMatrixSemigroup(3,4);
<full matrix semigroup 3x3 over GF(2^2)>
gap> T:=Range(IsomorphismTransformationSemigroup(S));;
gap> Size(T);
262144

3.4-2 IsFullMatrixSemigroup
‣ IsFullMatrixSemigroup( S )( property )
‣ IsGeneralLinearSemigroup( S )( property )

IsFullMatrixSemigroup and IsGeneralLinearSemigroup return true if the semigroup S was created using either of the commands FullMatrixSemigroup (3.4-1) or GeneralLinearSemigroup (3.4-1) and false otherwise.

gap> S:=RandomTransformationSemigroup(4,4);;
gap> IsFullMatrixSemigroup(S);
false
gap> S:=GeneralLinearSemigroup(3,3);
<full matrix semigroup 3x3 over GF(3)>
gap> IsFullMatrixSemigroup(S);
true

3.4-3 MunnSemigroup
‣ MunnSemigroup( S )( operation )

Returns: The Munn semigroup of a semilattice.

If S is a semilattice, then MunnSemigroup(S); returns the inverse semigroup of partial permutations of isomorphisms of principal ideals of S; called the Munn semigroup of S.

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

Please note: the Grape package version 4.5 or higher should be fully installed for this function to work.

gap> S:=InverseSemigroup(
> PartialPermNC( [ 1, 2, 3, 4, 5, 6, 7, 10 ], [ 4, 6, 7, 3, 8, 2, 9, 5 ] ),
> PartialPermNC( [ 1, 2, 7, 9 ], [ 5, 6, 4, 3 ] ) );
<inverse semigroup with 2 generators>
gap> T:=InverseSemigroup(Idempotents(S), rec(small:=true));;
gap> M:=MunnSemigroup(T);;
gap> NrIdempotents(M);
60
gap> NrIdempotents(S);
60

3.4-4 Monoids of order preserving functions
‣ OrderEndomorphisms( n )( operation )
‣ POI( n )( operation )
‣ POPI( n )( operation )

Returns: A semigroup of transformations or partial permutations related to a linear order.

OrderEndomorphisms(n)

OrderEndomorphisms(n) returns the monoid of transformations that preserve the usual order on {1,2,..., n} where n is a positive integer. OrderEndomorphisms(n) is generated by the 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,...,n-1 and has 2n-1choose n-1 elements.

POI(n)

POI(n) returns the inverse monoid of partial permutations that preserve the usual order on {1,2,..., n} where n is a positive integer. POI(n) is generated by the 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, ..., n-1 and has 2nchoose n elements.

POPI(n)

POPI(n) returns the inverse monoid of partial permutation that preserve the orientation of {1,2,..., n} where n is a positive integer. POPI(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+fracn22nchoose n elements.

gap> S:=POPI(10);                                            
<inverse monoid with 2 generators>
gap> Size(S);
923781
gap> 1+5*Binomial(20, 10);
923781
gap> S:=POI(10);
<inverse monoid with 10 generators>
gap> Size(S);
184756
gap> Binomial(20,10);
184756
gap> IsSubsemigroup(POPI(10), POI(10));
true
gap> S:=OrderEndomorphisms(5);
<monoid with 5 generators>
gap> IsIdempotentGenerated(S);
true
gap> IsRegularSemigroup(S);
true
gap> Size(S)=Binomial(2*5-1, 5-1);
true

3.4-5 SingularSemigroup
‣ SingularSemigroup( n )( operation )

Returns: The semigroup of non-invertible transformations.

If n is a positive integer, then SingularSemigroup(n) returns the semigroup of non-invertible transformations, which is generated by the n(n-1) idempotents of degree n and rank n-1 and has n^n-n! elements.

gap> S:=SingularSemigroup(5);
<semigroup with 20 generators>
gap> Size(S);
3005

3.4-6 SymmetricInverseSemigp
‣ SymmetricInverseSemigp( n )( operation )

Returns: The symmetric inverse semigroup.

If n is a positive integer, then SymmetricInverseSemigp(n); returns the symmetric inverse semigroup consisting of all partial permutations on the set {1,..., n}. The symmetric inverse semigroup on {1,..., 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), \quad \left(\begin{array}{cccccc} 1&2&3&\cdots&n-1&n\\ 2&1&3&\cdots&n-1&n \end{array}\right), \quad \left(\begin{array}{ccccc} 1&2&\cdots&n-1&n\\ 1&2&\cdots&n-1&- \end{array}\right)

and has ∑_r=0^nnchoose r^2⋅ r! elements.

gap> S:=SymmetricInverseSemigp(15);
<inverse semigroup with 3 generators>
gap> Size(S);
306827170866106

3.5 The examples directory

The examples folder of the Citrus package directory contains catalogues of some naturally occurring semigroups of transformations and partial permutations. These files can be read into GAP using ReadCitrus (1.6-2) and similar files can be created using WriteCitrus (1.6-3).

Further examples can be downloaded from

http://tinyurl.com/jdmitchell/examples.html

A summary of the available files, a desciption of their contents, and how they were created is given below.

Endomorphisms of graphs

the files eulnc.citrus.gz with n=3,...,10; graphnc.citrus.gz with n=3,...,8; and selfcomp.citrus.gz contain small generating sets for the endomorphism monoids of all connected Eulerian graphs, all connected graphs, and all self complimentary graphs with n vertices, respectively. These files were created using the catalogues of such graphs available at:

http://cs.anu.edu.au/~bdm/data/graphs.html

a C program written by Max Neunhoeffer which produces a relatively large list of endomorphisms containing a generating set for the endomorphism monoid, SmallGeneratingSet (4.5-16) and then IrredundantGeneratingSubset (4.5-9) in Citrus. The monoid generated by the transformations output by ReadCitrus("eul7c.citrus.gz", i);, say, is the monoid of endomorphisms of the ith graph in the file:

http://cs.anu.edu.au/~bdm/data/eul7c.g6

Munn semigroups

the file munn.citrus.gz contains generators for all the Munn semigroups of semilattices with 2 to 8 elements. The semilattices were obtained from the Smallsemi package using the command:

AllSmallSemigroups([2..8], IsSemilatticeAsSemigroup, true);

and the generators for the Munn semigroups were calculated using MunnSemigroup (3.4-3). More information is available at:

http://tinyurl.com/jdmitchell/examples.html

Syntactic semigroups

the files syntactic.citrus.gz contain generators for the syntactic semigroups of word acceptors of certain triangle groups, provided by Markus Pfeiffer (St Andrews). A triangle group is a group defined by a presentation of the form

\langle x, y | x^p, y^q, (xy)^r\rangle

for some positive integers p, q, r. The file contains generators of the syntactic semigroups of word acceptors of triangle groups where p ranges from 1 to 94, q=3, and r=2; p=101, q ranges from 3 to 99 and r=2; p=101, q=72, and r ranges from 7 to 71; and some further randomly chosen values of p,q,r.

Endomorphisms of groups

the files nonabelian_groups_n.citrus.gz with n=6,....,64 contains small generating sets for the endomorphism monoids of all non-abelian groups with n elements. These files were created using the Small Groups Library in GAP and the Sonata function Endomorphisms.

 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 Bib Ind

generated by GAPDoc2HTML