GAP (smallsemi) - Chapter 4: Functionality

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

4 Functionality
4.1 Individual Semigroups
4.1-1 SmallSemigroup
4.1-2 IsSmallSemigroup
4.1-3 IsSmallSemigroupElt
4.1-4 RecoverMultiplicationTable
4.1-5 SemigroupByMultiplicationTableNC
4.1-6 IdSmallSemigroup
4.1-7 EquivalenceSmallSemigroup
4.1-8 InfoSmallsemi
4.1-9 UnloadSmallsemiData
4.2 Properties of Semigroups
4.2-1 Annihilators
4.2-2 DiagonalOfMultiplicationTable
4.2-3 DisplaySmallSemigroup
4.2-4 IndexPeriod
4.2-5 IsBand
4.2-6 IsBrandtSemigroup
4.2-7 IsCliffordSemigroup
4.2-8 IsCommutativeSemigroup
4.2-9 IsCompletelyRegularSemigroup
4.2-10 IsFullTransformationSemigroupCopy
4.2-11 IsGroupAsSemigroup
4.2-12 IsIdempotentGenerated
4.2-13 IsInverseSemigroup
4.2-14 IsLeftZeroSemigroup
4.2-15 IsMonogenicSemigroup
4.2-16 IsMonoidAsSemigroup
4.2-17 IsMultSemigroupOfNearRing
4.2-18 IsNGeneratedSemigroup
4.2-19 IsNIdempotentSemigroup
4.2-20 IsNilpotentSemigroup
4.2-21 IsOrthodoxSemigroup
4.2-22 IsRectangularBand
4.2-23 IsRegularSemigroup
4.2-24 IsRightZeroSemigroup
4.2-25 IsSelfDualSemigroup
4.2-26 IsSemigroupWithClosedIdempotents
4.2-27 IsSemigroupWithZero
4.2-28 IsSimpleSemigroup
4.2-29 IsSingularSemigroupCopy
4.2-30 IsZeroGroup
4.2-31 IsZeroSemigroup
4.2-32 IsZeroSimpleSemigroup
4.2-33 MinimalGeneratingSet
4.2-34 NilpotencyDegree
4.3 Nilpotent semigroups by coclass
4.3-1 NilpotentSemigroupsByCoclass
4.4 Starred Green's relations
4.4-1 IsStarRelation
4.4-2 RStarRelation
4.4-3 RStarClass
4.4-4 RStarClass
4.4-5 IsStarClass
4.4-6 RStarClasses
4.5 Families of Semigroups
4.5-1 AllSmallSemigroups
4.5-2 EnumeratorOfSmallSemigroups
4.5-3 EnumeratorOfSmallSemigroupsByIds
4.5-4 EnumeratorSortedOfSmallSemigroups
4.5-5 FuncsOfSmallSemisInEnum
4.5-6 FuncsOfSmallSemisInIter
4.5-7 IdsOfSmallSemigroups
4.5-8 IsEnumeratorOfSmallSemigroups
4.5-9 IsIdSmallSemigroup
4.5-10 IsIteratorOfSmallSemigroups
4.5-11 IteratorOfSmallSemigroups
4.5-12 NamesFuncsSmallSemisInEnum
4.5-13 NamesFuncsSmallSemisInIter
4.5-14 Nr3NilpotentSemigroups
4.5-15 NrSmallSemigroups
4.5-16 OneSmallSemigroup
4.5-17 PositionsOfSmallSemigroups
4.5-18 PositionsOfSmallSemisInEnum
4.5-19 PrecomputedSmallSemisInfo
4.5-20 RandomSmallSemigroup
4.5-21 SizesOfSmallSemisInEnum
4.5-22 SizesOfSmallSemisInIter
4.5-23 UpToIsomorphism

### 4 Functionality

#### 4.1 Individual Semigroups

The semigroups of sizes 1 to 8 are available up to isomorphism and anti-isomorphism in Smallsemi. Every semigroup in the library is identified by its size m and a number n lying between 1 and the number of semigroups of size m (see Table 1.). We call the pair (m,n) the ID of the semigroup.

In this section we give details about the functions relating to individual semigroups in Smallsemi. This includes how to access semigroups in the library and how to identify the semigroup in the library equivalent to an arbitrary semigroup (of size 1 to 8).

If you are interested in the properties of a semigroup in the library or would like to find all the semigroups satisfying a given set of properties please see Section 4.2 or Section 4.5 respectively.

##### 4.1-1 SmallSemigroup

`‣ SmallSemigroup`( m, n ) | ( function )

`‣ SmallSemigroupNC`( m, n ) | ( function )

returns the semigroup with ID (m,n) from the library, that is the nth semigroup with m elements.

In `SmallSemigroupNC` no check is performed to verify that m and n are valid arguments.

In `SmallSemigroup` an error is signalled if the semigroups of size m are not classified or if n is greater than the number of semigroups with m elements.

    gap> SmallSemigroup(8,1353452);
    <small semigroup of size 8>
    gap> SmallSemigroupNC(5,1);
    <small semigroup of size 5>
    gap> SmallSemigroupNC(5,1)=SmallSemigroup(5,1);
    true

##### 4.1-2 IsSmallSemigroup

`‣ IsSmallSemigroup`( sgrp ) | ( filter )

returns `true` if sgrp is a semigroup from the library, that is if it was created using `SmallSemigroup` (4.1-1). Otherwise `false` is returned.

    gap> sgrp:=RandomSmallSemigroup(5);
    <small semigroup of size 5>
    gap> IsSmallSemigroup(sgrp);
    true
    gap> sgrp:=Semigroup(Transformation([1]));;
    gap> IsSmallSemigroup(sgrp);
    false

##### 4.1-3 IsSmallSemigroupElt

`‣ IsSmallSemigroupElt`( x ) | ( filter )

returns `true` if x is an element of a semigroup from the library, and `false` otherwise.

IsSmallSemigroupElt is a representation satisfying IsPositionalObjectRep and `IsMultiplicativeElement` (Reference: IsMultiplicativeElement) and IsAttributeStoringRep.

    gap> IsSmallSemigroupElt(Transformation([1]));
    false
    gap> sgrp:=RandomSmallSemigroup(5);;
    gap> IsSmallSemigroupElt(Random(sgrp));
    true

##### 4.1-4 RecoverMultiplicationTable

`‣ RecoverMultiplicationTable`( m, n ) | ( function )

`‣ RecoverMultiplicationTableNC`( m, n ) | ( function )

return the multiplication table of the n-th semigroup with m elements from the library.

If m is greater than 8 or n greater than the number of semigroups of size m, then `fail` is returned. The NC version does not perform any tests on the input and will most likely run into an error in such a case.

    gap> RecoverMultiplicationTable(10,2);
    fail
    gap> RecoverMultiplicationTable(1,2);
    fail
    gap> RecoverMultiplicationTable(2,1);
    [ [ 1, 1 ], [ 1, 1 ] ]
    gap> RecoverMultiplicationTable(8,11111111);
    [ [ 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 3 ],
      [ 3, 3, 3, 3, 3, 3, 3, 3 ], [ 1, 1, 1, 4, 4, 4, 4, 1 ],
      [ 1, 2, 3, 4, 5, 6, 7, 1 ], [ 1, 2, 3, 4, 5, 6, 7, 1 ],
      [ 1, 2, 3, 4, 5, 6, 7, 1 ], [ 8, 8, 8, 8, 8, 8, 8, 8 ] ]
    gap> RecoverMultiplicationTable(2,11111111);
    fail

Note that no semigroup is created calling this function but just the table is created. This makes it useful if one wants to perform very simple (i.e. quick in GAP) tests on a large number of semigroups which can be performed on the multiplication table.

To create a semigroup with the multiplication table obtained by `RecoverMultiplicationTable(m,n)` use the function `SmallSemigroup` (4.1-1) with arguments m,n.

##### 4.1-5 SemigroupByMultiplicationTableNC

`‣ SemigroupByMultiplicationTableNC`( table ) | ( function )

returns an object with `IsSemigroup` (Reference: IsSemigroup) and multiplication table table without checking if the multiplication defined by the table is associative.

If table is not associative, this can lead to errors and wrong results or might even crash GAP.

    gap> s:=SemigroupByMultiplicationTableNC([[1,2],[2,1]]);
    <semigroup of size 2, with 2 generators>
    gap> IsSmallSemigroup(s);
    false

Note that this function is not used to create semigroups when `SmallSemigroup` (4.1-1) is called. It can be useful in combination with `RecoverMultiplicationTable` (4.1-4) if one wants to avoid that a semigroup knows it comes from the library.

##### 4.1-6 IdSmallSemigroup

`‣ IdSmallSemigroup`( sgrp ) | ( attribute )

returns a pair `[m, n]` such that (m,n) is the ID of a semigroup in Smallsemi equivalent to sgrp. The argument sgrp has to be a semigroup of size 8 or less, otherwise an error is signalled.

    gap> sgrp:=Semigroup(Transformation( [ 1, 2, 2 ] ), Transformation( [ 1, 2, 3 ] ));;
    gap> IdSmallSemigroup(sgrp);
    [ 2, 3 ]

##### 4.1-7 EquivalenceSmallSemigroup

`‣ EquivalenceSmallSemigroup`( sgrp ) | ( attribute )

returns a mapping `map` from sgrp to the semigroup in Smallsemi equivalent to sgrp. The mapping is an isomorphism if such exists and an anti-isomorphism otherwise. The argument sgrp has to be a semigroup of size 8 or less, otherwise an error is signalled.

    gap> sgrp:=Semigroup(Transformation( [ 1, 2, 2 ] ),
    > Transformation( [ 1, 2, 3 ] ));;
    gap> EquivalenceSmallSemigroup(sgrp);
    SemigroupHomomorphismByImages ( Monoid(
    [ Transformation( [ 1, 2, 2 ] ) ] )-><small semigroup of size 2>)

##### 4.1-8 InfoSmallsemi

`‣ InfoSmallsemi` | ( info class )

is the info class (see Reference: Info Functions) of Smallsemi. The info level is initially set to 1 which triggers a message whenever data is loaded into GAP.

##### 4.1-9 UnloadSmallsemiData

`‣ UnloadSmallsemiData`( use_later ) | ( function )

deletes most or all of the data from the GAP workspace that was loaded by Smallsemi.

If the boolean use_later is `false` all data loaded by Smallsemi is deleted from the workspace, in which case Smallsemi is not guaranteed to work properly without restarting your GAP session.

If the boolean use_later is `true` only the recoverable data is deleted. This leaves roughly 10 MB of data in the workspace.

#### 4.2 Properties of Semigroups

In this section we detail the GAP functions that can be used to determine whether a small semigroup satisfies a certain property. Let S be a semigroup. Then

- S is a left zero semigroup if xy=x for all x,y in S.

- S is a right zero semigroup if xy=y for all x,y in S.

- S is commutative if xy=yx for all x,y in S.

- S is simple if it has no proper two-sided ideals.

- S is zero simple if the only 2-sided ideals are {0} and S.

- S is regular if for all x in S there exists y in S such that xyx=x.

- S is completely regular if every element of S lies in a subgroup.

- S is an inverse semigroup if every element x in S has a unique semigroup inverse, that is, a unique element y such that xyx=x and yxy=y.

- S is a Clifford semigroup if it is a regular semigroup whose idempotents are central, that is, for all e,x in S where e^2=e we have that ex=xe.

- S is a band if every element is an idempotent, that is, x^2=x for all x in S.

- S is a Brandt semigroup if it is inverse and zero simple.

- S is a rectangular band if for all x,y,z in S we have that x^2=x and xyz=xz.

- S is a semiband if it is generated by its idempotent elements, that is, elements satisfying x^2=x.

- S is an orthodox semigroup if it is regular and its idempotents (elements satisfying x^2=x) form a subsemigroup.

- S is a zero semigroup if there exists an element 0 in S such that xy=0 for all x,y in S.

- S is a zero group if there exists an element 0 in S such that S without 0 is a group and for all x in S we have that x0=0x=0.

The MONOID package was used to determined which semigroups in the library satisfy the properties above. All of the resulting information is stored in the library.

##### 4.2-1 Annihilators

`‣ Annihilators`( sgrp ) | ( attribute )

returns the set of annihilators of sgrp if sgrp contains a zero element and `fail` otherwise.

An element x in a semigroup with zero z is an annihilator if xy=yx=z for every element y in the semigroup.

    gap> s := SmallSemigroup(5,6);
    <small semigroup of size 5>
    gap> Annihilators(s);
    [ s1, s2 ]

##### 4.2-2 DiagonalOfMultiplicationTable

`‣ DiagonalOfMultiplicationTable`( sgrp ) | ( attribute )

returns the diagonal of the multiplication table of the semigroup sgrp.

    gap> s:=SmallSemigroup(8,10101);;
    gap> DiagonalOfMultiplicationTable(s);
    [ 1, 1, 1, 1, 1, 1, 1, 1 ]
    gap> s:=SmallSemigroup(7,10101);;
    gap> DiagonalOfMultiplicationTable(s);
    [ 1, 1, 1, 1, 1, 1, 1 ]

##### 4.2-3 DisplaySmallSemigroup

`‣ DisplaySmallSemigroup`( sgrp ) | ( function )

displays all the information about the small semigroup sgrp that is stored in the library and its Green's classes and idempotents.

    gap> s:=SmallSemigroup(6, 3838);;
    gap> DisplaySmallSemigroup(s);
    IsBand:                              false
    IsBrandtSemigroup:                   false
    IsCommutative:                       false
    IsCompletelyRegularSemigroup:        false
    IsFullTransformationSemigroupCopy:   false
    IsGroupAsSemigroup:                  false
    IsIdempotentGenerated:               false
    IsInverseSemigroup:                  false
    IsMonogenicSemigroup:                false
    IsMonoidAsSemigroup:                 false
    IsMultSemigroupOfNearRing:           false
    IsOrthodoxSemigroup:                 false
    IsRectangularBand:                   false
    IsRegularSemigroup:                  false
    IsSelfDualSemigroup:                 false
    IsSemigroupWithClosedIdempotents:    true
    IsSimpleSemigroup:                   false
    IsSingularSemigroupCopy:             false
    IsZeroSemigroup:                     false
    IsZeroSimpleSemigroup:               false
    MinimalGeneratingSet:                [ s3, s4, s5, s6 ]
    Idempotents:                         [ s1, s5, s6 ]
    GreensRClasses:                      [ {s1}, {s2}, {s3}, {s4}, {s5}, {\
    s6} ]
    GreensLClasses:                      [ {s1}, {s2}, {s3}, {s4}, {s6} ]
    GreensHClasses:                      [ {s1}, {s2}, {s3}, {s4}, {s5}, {\
    s6} ]
    GreensDClasses:                      [ {s1}, {s2}, {s3}, {s4}, {s6} ]

##### 4.2-4 IndexPeriod

`‣ IndexPeriod`( x ) | ( attribute )

returns the minimum numbers m, r such that x^{m+r}=x^m; known as the index and period of the small semigroup element x.

    gap> s:=SmallSemigroup(5,116);
    <small semigroup of size 5>
    gap> x:=Elements(s)[3];
    s3
    gap> IndexPeriod(x);
    [ 2, 1 ]
    gap> x^3=x^2;
    true
    gap> x^2=x^1;
    false
    gap> x^3=x^1;
    false

##### 4.2-5 IsBand

`‣ IsBand`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is a band and `false` otherwise.

A semigroup sgrp is a band if every element is an idempotent, that is, x^2=x for all x in sgrp.

    gap> s:=SmallSemigroup(5,519);;
    gap> IsBand(s);
    false
    gap> s:=OneSmallSemigroup(5, IsBand, true);
    <small semigroup of size 5>
    gap> IsBand(s);
    true
    gap> IdSmallSemigroup(s);
    [ 5, 1010 ]

##### 4.2-6 IsBrandtSemigroup

`‣ IsBrandtSemigroup`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is a Brandt semigroup and `false` otherwise.

A finite semigroup sgrp is a Brandt semigroup if it is inverse and zero simple.

    gap> s:=SmallSemigroup(5,519);;
    gap> IsBrandtSemigroup(s);
    false
    gap> s:=OneSmallSemigroup(5, IsBrandtSemigroup, true);
    <small semigroup of size 5>
    gap> IsBrandtSemigroup(s);
    true
    gap> IdSmallSemigroup(s);
    [ 5, 149 ]

##### 4.2-7 IsCliffordSemigroup

`‣ IsCliffordSemigroup`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is a Clifford semigroup and `false` otherwise.

A semigroup sgrp is a Clifford semigroup if it is a regular semigroup whose idempotents are central, that is, for all e,x in sgrp where e^2=e we have that ex=xe.

    gap> s:=SmallSemigroup(5,519);;
    gap> IsBand(s);
    false
    gap> s:=OneSmallSemigroup(5, IsBand, true);
    <small semigroup of size 5>
    gap> IsBand(s);
    true
    gap> IdSmallSemigroup(s);
    [ 5, 1010 ]
    gap> s:=SmallSemigroup(5,519);;
    gap> IsCliffordSemigroup(s);
    false
    gap> s:=OneSmallSemigroup(5, IsCliffordSemigroup, true);
    <small semigroup of size 5>
    gap> IsCliffordSemigroup(s);
    true
    gap> IdSmallSemigroup(s);
    [ 5, 148 ]

##### 4.2-8 IsCommutativeSemigroup

`‣ IsCommutativeSemigroup`( sgrp ) | ( property )

`‣ IsCommutative`( sgrp ) | ( property )

return `true` if the small semigroup sgrp is commutative and `false` otherwise.

A semigroup sgrp is commutative if xy=yx for all x,y in sgrp.

    gap> s:=SmallSemigroup(6,871);;
    gap> IsCommutativeSemigroup(s);
    false
    gap> s:=OneSmallSemigroup(5, IsCommutative, true);
    <small semigroup of size 5>
    gap> IsCommutativeSemigroup(s);
    true
    gap> IsCommutative(s);
    true
    gap> IdSmallSemigroup(s);
    [ 5, 1 ]
    gap> s:=OneSmallSemigroup(5, IsCommutativeSemigroup, true);
    <small semigroup of size 5>
    gap> IsCommutativeSemigroup(s);
    true
    gap> IsCommutative(s);
    true

##### 4.2-9 IsCompletelyRegularSemigroup

`‣ IsCompletelyRegularSemigroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is completely regular and `false` otherwise.

A semigroup is completely regular if every element is contained in a subgroup.

    gap> s:=SmallSemigroup(6,13131);
    <small semigroup of size 6>
    gap> IsCompletelyRegularSemigroup(s);
    false
    gap> s:=OneSmallSemigroup(6, IsCompletelyRegularSemigroup, true);
    <small semigroup of size 6>
    gap> IsCompletelyRegularSemigroup(s);
    true
    gap> IdSmallSemigroup(s);
    [ 6, 3164 ]

##### 4.2-10 IsFullTransformationSemigroupCopy

`‣ IsFullTransformationSemigroupCopy`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is isomorphic to a full transformation semigroup and `false` otherwise.

The size of the full transformation semigroup on an n element set is n^n and so there are only two semigroup in the library that have this property.

    gap> s:=SmallSemigroup(1,1);
    <small semigroup of size 1>
    gap> IsFullTransformationSemigroupCopy(s);
    true
    gap> s:=OneSmallSemigroup(4, IsFullTransformationSemigroupCopy, true);
    <small semigroup of size 4>
    gap> IsFullTransformationSemigroupCopy(s);
    true
    gap> IdSmallSemigroup(s);
    [ 4, 96 ]
    gap> s:=OneSmallSemigroup(6, IsFullTransformationSemigroupCopy, true);
    fail

##### 4.2-11 IsGroupAsSemigroup

`‣ IsGroupAsSemigroup`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is mathematically a group, and returns `false` otherwise. Note that no small semigroup can lie in the category `IsGroup` (Reference: IsGroup).

    gap> s:=SmallSemigroup(7,7);
    <small semigroup of size 7>
    gap> IsGroupAsSemigroup(s);
    false
    gap> s:=SmallSemigroup(4,37);;
    gap> IsGroupAsSemigroup(s);
    true

##### 4.2-12 IsIdempotentGenerated

`‣ IsIdempotentGenerated`( sgrp ) | ( property )

`‣ IsSemiband`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is a semiband and `false` otherwise.

A semigroup sgrp is idempotent generated or equivalently a semiband if it is generated by its idempotent elements, i.e elements satisfying x^2=x.

    gap> s:=SmallSemigroup(3, 13);
    <small semigroup of size 3>
    gap> IsIdempotentGenerated(s);
    true
    gap> s:=OneSmallSemigroup(3, IsIdempotentGenerated, false);
    <small semigroup of size 3>
    gap> IsIdempotentGenerated(s);
    false
    gap> IdSmallSemigroup(s);
    [ 3, 1 ]
    gap> s:=OneSmallSemigroup(4, IsIdempotentGenerated, true,
    > IsSingularSemigroupCopy, true);
    fail
    gap> s:=OneSmallSemigroup(2, IsIdempotentGenerated, true,
    > IsSingularSemigroupCopy, true);
    <small semigroup of size 2>

##### 4.2-13 IsInverseSemigroup

`‣ IsInverseSemigroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is an inverse semigroup and `false` otherwise.

A semigroup sgrp is an inverse semigroup if every element x in sgrp has a unique semigroup inverse, that is, a unique element y such that xyx=x and yxy=y.

    gap> s:=OneSmallSemigroup(7, IsInverseSemigroup, true);
    <small semigroup of size 7>
    gap> IsInverseSemigroup(s);
    true
    gap> s:=SmallSemigroup(7, 101324);
    <small semigroup of size 7>
    gap> IsInverseSemigroup(s);
    false

##### 4.2-14 IsLeftZeroSemigroup

`‣ IsLeftZeroSemigroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is a left zero semigroup and `false` otherwise.

A semigroup sgrp is a left zero semigroup if xy=x for all x,y in sgrp.

    gap> s:=SmallSemigroup(5, 438);
    <small semigroup of size 5>
    gap> IsLeftZeroSemigroup(s);
    false
    gap> s:=SmallSemigroup(5, 1141);
    <small semigroup of size 5>
    gap> IsLeftZeroSemigroup(s);
    true

##### 4.2-15 IsMonogenicSemigroup

`‣ IsMonogenicSemigroup`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is generated by a single element and `false` otherwise.

    gap> s:=RandomSmallSemigroup(7);
    <small semigroup of size 7>
    gap> IsMonogenicSemigroup(s);
    false
    gap> s:=OneSmallSemigroup(7, IsMonogenicSemigroup, true);
    <small semigroup of size 7>
    gap> IsMonogenicSemigroup(s);
    true
    gap> MinimalGeneratingSet(s);
    [ s7 ]
    gap> s:=SmallSemigroup( 7, 406945);
    <small semigroup of size 7>
    gap> IsMonogenicSemigroup(s);
    false

##### 4.2-16 IsMonoidAsSemigroup

`‣ IsMonoidAsSemigroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is a monoid (i.e. has an identity element) and `false` otherwise.

    gap> s:=SmallSemigroup(4, 126);
    <small semigroup of size 4>
    gap> IsMonoidAsSemigroup(s);
    false
    gap> s:=OneSmallSemigroup(4, IsMonoidAsSemigroup, true);
    <small semigroup of size 4>
    gap> IsMonoidAsSemigroup(s);
    true
    gap> One(s);
    s1
    gap> IdSmallSemigroup(s);
    [ 4, 7 ]

##### 4.2-17 IsMultSemigroupOfNearRing

`‣ IsMultSemigroupOfNearRing`( sgrp ) | ( property )

returns `true` if sgrp is isomorphic (or anti-isomorphic?) to the multiplicative semigroup of a near-ring and `false` otherwise.

Those semigroups in the library that have this property were identified using the Sonata package.

    gap> s:=OneSmallSemigroup(7, IsMultSemigroupOfNearRing, true);
    <small semigroup of size 7>
    gap> IdSmallSemigroup(s);
    [ 7, 1 ]
    gap> IsMultSemigroupOfNearRing(s);
    true
    gap> s:=SmallSemigroup(2,2);
    <small semigroup of size 2>
    gap> IsMultSemigroupOfNearRing(s);
    false

##### 4.2-18 IsNGeneratedSemigroup

`‣ IsNGeneratedSemigroup`( sgrp, n ) | ( operation )

returns `true` if the least size of a generating set for the small semigroup sgrp is n and `false` otherwise.

    gap> s:=SmallSemigroup(7, 760041);
    <small semigroup of size 7>
    gap> IsNGeneratedSemigroup(s, 4);
    false
    gap> IsNGeneratedSemigroup(s, 3);
    true
    gap> MinimalGeneratingSet(s);
    [ s3, s5, s7 ]
    gap> s:=OneSmallSemigroup(4, x-> Length(MinimalGeneratingSet(x)), 4);
    <small semigroup of size 4>
    gap> IsNGeneratedSemigroup(s, 4);
    true

##### 4.2-19 IsNIdempotentSemigroup

`‣ IsNIdempotentSemigroup`( sgrp, n ) | ( operation )

returns `true` if the small semigroup sgrp has n idempotents and `false` otherwise.

    gap> s:=SmallSemigroup(4, 75);;
    gap> IsNIdempotentSemigroup(s, 1);
    false
    gap> IsNIdempotentSemigroup(s, 2);
    false
    gap> IsNIdempotentSemigroup(s, 3);
    true

##### 4.2-20 IsNilpotentSemigroup

`‣ IsNilpotentSemigroup`( sgrp ) | ( property )

`‣ IsNilpotent`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is nilpotent and `false` otherwise.

A semigroup is nilpotent if it has a zero element and every element to some power equals this zero.

    gap> s:=SmallSemigroup(5,116);
    <small semigroup of size 5>
    gap> IsNilpotentSemigroup(s);
    false
    gap> s:=SmallSemigroup(7, 673768);;
    gap> IsNilpotentSemigroup(s);
    true
    gap> s:=SmallSemigroup(7, 657867);;
    gap> IsNilpotent(s);
    true

##### 4.2-21 IsOrthodoxSemigroup

`‣ IsOrthodoxSemigroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is orthodox and `false` otherwise.

A semigroup is orthodox if it is regular and its idempotents form a subsemigroup.

    gap> s:=SmallSemigroup(6, 15858);;
    gap> IsSemigroupWithClosedIdempotents(s);
    true
    gap> IsRegularSemigroup(s);
    true
    gap> IsOrthodoxSemigroup(s);
    true

##### 4.2-22 IsRectangularBand

`‣ IsRectangularBand`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is a rectangular band and `false` otherwise.

A semigroup sgrp is a rectangular band if for all x,y,z in sgrp we have that x^2=x and xyz=xz.

    gap> s:=SmallSemigroup(5, 216);;
    gap> IsRectangularBand(s);
    false
    gap> s:=SmallSemigroup(6, 15854);;
    gap> IsRectangularBand(s);
    true

##### 4.2-23 IsRegularSemigroup

`‣ IsRegularSemigroup`( sgrp ) | ( property )

returns `true` if the small semigroup sgrp is a regular semigroup and `false` otherwise.

A semigroup sgrp is regular if for all x in sgrp there exists y in sgrp such that xyx=x.

    gap> s:=SmallSemigroup(3, 10);;
    gap> IsRegularSemigroup(s);
    true
    gap> s:=SmallSemigroup(3, 1);;
    gap> IsRegularSemigroup(s);
    false
    gap> s:=OneSmallSemigroup(4, IsFullTransformationSemigroupCopy, true);
    <small semigroup of size 4>
    gap> IsRegularSemigroup(s);
    true

##### 4.2-24 IsRightZeroSemigroup

`‣ IsRightZeroSemigroup`( sgrp ) | ( property )

returns `false` for any small semigroup sgrp since the library contains only left zero semigroups.

A semigroup sgrp is a right zero semigroup if xy=y for all x,y in sgrp.

    gap> s:=SmallSemigroup(5, 438);
    <small semigroup of size 5>
    gap> IsRightZeroSemigroup(s);
    false

##### 4.2-25 IsSelfDualSemigroup

`‣ IsSelfDualSemigroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is self dual and `false` otherwise.

A semigroup is self dual if it is isomorphic to its dual, that is, the semigroup t with multiplication * defined by x*y=yx where yx denotes the product in sgrp.

    gap> s:=SmallSemigroup(5,116);
    <small semigroup of size 5>
    gap> IsSelfDualSemigroup(s);
    false
    gap> s:=RandomSmallSemigroup(5, IsSelfDualSemigroup, true);
    <small semigroup of size 5>
    gap> IsSelfDualSemigroup(s);
    true

##### 4.2-26 IsSemigroupWithClosedIdempotents

`‣ IsSemigroupWithClosedIdempotents`( sgrp ) | ( property )

returns `true` if the idempotent elements of the semigroup sgrp form a subsemigroup and `false` otherwise.

    gap> s:=SmallSemigroup(5, 677);;
    gap> IsSemigroupWithClosedIdempotents(s);
    true
    gap> s:=SmallSemigroup(5, 659);;
    gap> IsSemigroupWithClosedIdempotents(s);
    true
    gap> s:=SmallSemigroup(5, 327);;
    gap> IsSemigroupWithClosedIdempotents(s);
    false

##### 4.2-27 IsSemigroupWithZero

`‣ IsSemigroupWithZero`( sgrp ) | ( property )

returns `true` if the semigroup sgrp has a zero element and false otherwise.

An element z is a zero if z*x=x*z=z for all x in the semigroup.

    gap> s:=SmallSemigroup(5,1);
    <small semigroup of size 5>
    gap> IsSemigroupWithZero(s);
    true
    gap> s:=SmallSemigroup(4,26);
    <small semigroup of size 4>
    gap> IsSemigroupWithZero(s);
    false

##### 4.2-28 IsSimpleSemigroup

`‣ IsSimpleSemigroup`( sgrp ) | ( property )

`‣ IsCompletelySimpleSemigroup`( sgrp ) | ( property )

return `true` if the semigroup sgrp is simple or completely simple and `false` otherwise.

A semigroup is simple if it has no proper 2-sided ideals. A semigroup is 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.

    gap> s:=SmallSemigroup(7, 835080);;
    gap> IsSimpleSemigroup(s);
    true
    gap> IsCompletelySimpleSemigroup(s);
    true
    gap> s:=SmallSemigroup(7, 208242);;
    gap> IsSimpleSemigroup(s);
    false

##### 4.2-29 IsSingularSemigroupCopy

`‣ IsSingularSemigroupCopy`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is isomorphic to a semigroup of singular (i.e. non-invertible) mappings on a finite set and `false` otherwise.

The size of this semigroup on an n element set is n^n-n! and so there is only one semigroup in the library that has this property.

    gap> s:=SmallSemigroup(1,1);
    <small semigroup of size 1>
    gap> IsSingularSemigroupCopy(s);
    false
    gap> s:=OneSmallSemigroup(2, IsSingularSemigroupCopy, true);
    <small semigroup of size 2>
    gap> IsSingularSemigroupCopy(s);
    true
    gap> IdSmallSemigroup(s);
    [ 2, 4 ]
    gap> s:=OneSmallSemigroup(4, IsSingularSemigroupCopy, true);
    fail

##### 4.2-30 IsZeroGroup

`‣ IsZeroGroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is a zero group and `false` otherwise.

The semigroup sgrp is a zero group if there exists an element z in sgrp such that sgrp without z is a group and for all x in sgrp we have that xz=zx=z.

    gap> g:=Group((1,2),(3,4));
    Group([ (1,2), (3,4) ])
    gap> IdSmallSemigroup(g);
    [ 4, 7 ]
    gap> s := Range(InjectionZeroMagma(g));
    <Group([ (1,2), (3,4) ]) with 0 adjoined>
    gap> IdSmallSemigroup(s);
    [ 5, 149 ]
    gap> IsZeroGroup(s);
    true

##### 4.2-31 IsZeroSemigroup

`‣ IsZeroSemigroup`( sgrp ) | ( property )

returns `true` if the semigroup sgrp is a zero semigroup and `false` otherwise.

The semigroup sgrp is a zero semigroup if there exists an element z in sgrp such that xy=z for all x,y in sgrp.

    gap> s:=OneSmallSemigroup(5, IsZeroSemigroup, true);
    <small semigroup of size 5>
    gap> IsZeroSemigroup(s);
    true
    gap> IdSmallSemigroup(s);
    [ 5, 1 ]
    gap> s:=OneSmallSemigroup(5, IsZeroSemigroup, false);
    <small semigroup of size 5>
    gap> IdSmallSemigroup(s);
    [ 5, 2 ]
    gap> IsZeroSemigroup(s);
    false

Note that for each size the unique zero semigroup is always the first semigroup of this size in the library.

    gap> IsZeroSemigroup(SmallSemigroup(6,1));
    true
    gap> IsZeroSemigroup(SmallSemigroup(7,1));
    true
    gap> IsZeroSemigroup(SmallSemigroup(8,1));
    true

##### 4.2-32 IsZeroSimpleSemigroup

`‣ IsZeroSimpleSemigroup`( sgrp ) | ( property )

return `true` if the semigroup sgrp is zero simple and `false` otherwise.

A semigroup sgrp is zero simple if the only 2-sided ideals are the zero {0} and sgrp.

    gap> s:=SmallSemigroup(7, 519799);
    <small semigroup of size 7>
    gap> IsZeroSimpleSemigroup(s);
    false
    gap> s:=RandomSmallSemigroup(7, IsZeroSimpleSemigroup, true);
    <small semigroup of size 7>
    gap> IsZeroSimpleSemigroup(s);
    true

##### 4.2-33 MinimalGeneratingSet

`‣ MinimalGeneratingSet`( sgrp ) | ( attribute )

returns a set of generators for sgrp with minimal size.

    gap> s:=SmallSemigroup(8, 1478885610);;
    gap> MinimalGeneratingSet(s);
    [ s4, s5, s6, s7, s8 ]
    gap> s:=SmallSemigroup(7, 673768);;
    gap> MinimalGeneratingSet(s);
    [ s4, s5, s6, s7 ]
    gap> s:=SmallSemigroup(4, 4);;
    gap> MinimalGeneratingSet(s);
    [ s2, s3, s4 ]

##### 4.2-34 NilpotencyDegree

`‣ NilpotencyDegree`( sgrp ) | ( attribute )

returns the least n such that every product of n elements in the nilpotent semigroup sgrp equals the zero element and returns `fail` if the semigroup sgrp is not nilpotent.

    gap> s := SmallSemigroup(5, 1121);;
    gap> NilpotencyDegree(s);
    fail
    gap> s := SmallSemigroup(7, 393450);;
    gap> NilpotencyDegree(s);
    3

Note that for size 8 a semigroup in the library with ID (8,n) is nilpotent of degree 3 if and only if n is greater than 11433106.

    gap> s := SmallSemigroup(8, 11433106+1231);;
    gap> NilpotencyDegree(s);
    3
    gap> s := SmallSemigroup(8,NrSmallSemigroups(8));;
    gap> NilpotencyDegree(s);
    3

#### 4.3 Nilpotent semigroups by coclass

A useful parameter in the classification of nilpotent semigroups is their coclass. For a finite nilpotent semigroup of order n and nilpotency degree d the coclass is defined as n-d. In [Dis14] lists up to (anti-)isomorphism are provided for nilpotent semigroups of coclass 0, 1, and 2. The semigroups in the lists are given by finite presentations. In this section we describe a function that allows to access such lists in GAP.

A further invariant of a nilpotent semigroup S is the size of its unique minimal generating set Sbackslash S^2. The possible sizes for a particular coclass are restricted. Monogenic nilpotent semigroups are precisely those of coclass 0. For coclass d ≥ 1 the size of the minimal generating set is at least 2 and at most d+1.

##### 4.3-1 NilpotentSemigroupsByCoclass

`‣ NilpotentSemigroupsByCoclass`( n, d[, r] ) | ( function )

returns for a positive integer n and an integer d with value 0, 1, or 2 a list of nilpotent semigroups of order n and coclass d up to (anti-)isomorphism. If the optional third argument r is given then only semigroups of rank r are returned. The semigroups in the list are given by finite presentations.

    gap> NilpotentSemigroupsByCoclass(5,1);
    [ <fp semigroup on the generators [ s1, s2 ]>,
      <fp semigroup on the generators [ s1, s2 ]>,
      <fp semigroup on the generators [ s1, s2 ]>,
      <fp semigroup on the generators [ s1, s2 ]>,
      <fp semigroup on the generators [ s1, s2 ]>,
      <fp semigroup on the generators [ s1, s2 ]>,
      <fp semigroup on the generators [ s1, s2 ]> ]
    gap> NilpotentSemigroupsByCoclass(7,0);
    [ <fp semigroup on the generators [ s1 ]> ]
    gap> NilpotentSemigroupsByCoclass(4,2,3);
    [ <fp semigroup on the generators [ s1, s2, s3 ]> ]

#### 4.4 Starred Green's relations

In this section functionality around the starred Green's relations is described. The five starred Green's relations are R^*, L^*, J^*, H^*, and D^*; two elements a, b from a semigroup S are R^*-related if for all x, y ∈ S^1: xa=ya if and only if xb = yb; and a and b are L^*-related if for all x, y ∈ S^1: ax=ay if and only if bx = by. In parallel to the classical Green's relations Reference: Green's Relations H^*=R^* ∧ L^* and D^*= R^* ∨ L^* (but R^* ∘ L^* = L^* ∘ R^* does not hold in general). To describe J^* is a bit more technical. For a,b ∈ S one can show that b lies in J^*(a), the principal *-ideal of a, if and only if there exist c_0,c_1...,c_n∈ S and x_1,...,x_n,y_1,..., y_n∈ S^1 such that a=c_0, b=c_n and c_iD^*x_ic_i-1y_i for 1≤ i≤ n. Then aJ^*b if and only if both a∈ J^*(b) and b∈ J^*(a)

Note that even for finite semigroups J^* does not always equal D^* (in contrast to the situation for classical Green's relations). Using Smallsemi it was shown that there exist semigroups of order 8 with J^*≠ D^* [DMU13].

##### 4.4-1 IsStarRelation

`‣ IsStarRelation`( bin-relation ) | ( property )

`‣ IsRStarRelation`( equiv-relation ) | ( property )

`‣ IsLStarRelation`( equiv-relation ) | ( property )

`‣ IsJStarRelation`( equiv-relation ) | ( property )

`‣ IsHStarRelation`( equiv-relation ) | ( property )

`‣ IsDStarRelation`( equiv-relation ) | ( property )

These functions return `true` if the argument is the respective type of relation and `false` otherwise.

##### 4.4-2 RStarRelation

`‣ RStarRelation`( semigroup ) | ( attribute )

`‣ LStarRelation`( semigroup ) | ( attribute )

`‣ JStarRelation`( semigroup ) | ( attribute )

`‣ DStarRelation`( semigroup ) | ( attribute )

`‣ HStarRelation`( semigroup ) | ( attribute )

The starred Green's relations (which are equivalence relations) are attributes of the semigroup semigroup.

##### 4.4-3 RStarClass

`‣ RStarClass`( S, a ) | ( operation )

`‣ LStarClass`( S, a ) | ( operation )

`‣ DStarClass`( S, a ) | ( operation )

`‣ JStarClass`( S, a ) | ( operation )

`‣ HStarClass`( S, a ) | ( operation )

Creates the X*-class of the element a in the semigroup S where X is one of L, R, D, J, or H.

    gap> s := SmallSemigroup(7, 280142);
    <small semigroup of size 7>
    gap> elm := AsList(s)[5];;
    gap> jclass := JStarClass(s, elm);
    {s5}
    gap> AsList(jclass);
    [ s2, s3, s4, s5 ]

##### 4.4-4 RStarClass

`‣ RStarClass`( C ) | ( attribute )

`‣ LStarClass`( C ) | ( attribute )

`‣ DStarClass`( C ) | ( attribute )

`‣ JStarClass`( C ) | ( attribute )

are attributes reflecting the natural ordering over the various starred Green's classes. They return the respective class in which the given class C is contained, where C must be a class from a strictly finer relation.

    gap> s := SmallSemigroup(7, 280142);
    <small semigroup of size 7>
    gap> elm := AsList(s)[5];;
    gap> hclass := HStarClass(s, elm);
    {s5}
    gap> AsList(LStarClass(hclass));
    [ s5 ]
    gap> AsList(RStarClass(hclass));
    [ s2, s5 ]
    gap> AsList(DStarClass(hclass));
    [ s2, s3, s4, s5 ]

##### 4.4-5 IsStarClass

`‣ IsStarClass`( equiv-class ) | ( property )

`‣ IsRStarClass`( equiv-class ) | ( property )

`‣ IsLStarClass`( equiv-class ) | ( property )

`‣ IsJStarClass`( equiv-class ) | ( property )

`‣ IsHStarClass`( equiv-class ) | ( property )

`‣ IsDStarClass`( equiv-class ) | ( property )

return `true` if the equivalence class equiv-class is a starred Green's class of any type, or of R, L, J, H, D type, respectively, or `false` otherwise.

##### 4.4-6 RStarClasses

`‣ RStarClasses`( semigroup ) | ( attribute )

`‣ LStarClasses`( semigroup ) | ( attribute )

`‣ JStarClasses`( semigroup ) | ( attribute )

`‣ DStarClasses`( semigroup ) | ( attribute )

`‣ HStarClasses`( semigroup ) | ( attribute )

return the R, L, J, H, or D starred Green's classes, respectively for semigroup semigroup. `EquivalenceClasses` for a Green's relation lead to one of these functions.

    gap> s := SmallSemigroup(6, 54);
    <small semigroup of size 6>
    gap> JStarClasses(s);
    [ {s1}, {s2}, {s4}, {s5}, {s6} ]

#### 4.5 Families of Semigroups

In this section we describe how to find semigroups in the library satisfying a given set of parameters.

The following functions have the same usage but may return different values: `EnumeratorOfSmallSemigroups` (4.5-2), `AllSmallSemigroups` (4.5-1), `EnumeratorSortedOfSmallSemigroups` (4.5-4), `IdsOfSmallSemigroups` (4.5-7), `IteratorOfSmallSemigroups` (4.5-11), `NrSmallSemigroups` (4.5-15), `OneSmallSemigroup` (4.5-16), `PositionsOfSmallSemigroups` (4.5-17), `RandomSmallSemigroup` (4.5-20).

The number of arguments should be odd:

- the first argument `arg[1]` should be a positive integer, a list of positive integers, or an enumerator or iterator of small semigroups satisfying `IsEnumeratorOfSmallSemigroups` (4.5-8) or `IsIteratorOfSmallSemigroups` (4.5-10)

- the even arguments `arg[2i]`, if present, should be a function

- the odd arguments `arg[2i+1]` argument should be a possible value that can be returned by the function `arg[2i]`.

In the case that the function is `AllSmallSemigroups` (4.5-1) and `arg[1]` is a positive integer, then the returned value is a list of all semigroups S with `arg[1]` elements such that `arg[2i](S)=arg[2i+1]`.

For example, to obtain all the commutative semigroups with 3 idempotents of sizes 2 to 5 use one of `EnumeratorOfSmallSemigroups` (4.5-2), `AllSmallSemigroups` (4.5-1), `EnumeratorSortedOfSmallSemigroups` (4.5-4), `IteratorOfSmallSemigroups` (4.5-11) with argument

    [2..5], IsCommutative, true, Is3IdempotentGenerated, true

`AllSmallSemigroups` (4.5-1) returns a list of all such semigroups, `EnumeratorOfSmallSemigroups` (4.5-2), `EnumeratorSortedOfSmallSemigroups` (4.5-4), and `IteratorOfSmallSemigroups` (4.5-11) return an enumerator and an iterator of all such semigroups, respectively. For more information on enumerators and iterators see `Enumerator` (Reference: Enumerator), `EnumeratorSorted` (Reference: EnumeratorSorted), or `Iterator` (Reference: Iterator). The following are rules of thumb regarding the different situations when these functions should be used in order of slowest to fastest and greatest memory use to least:

- `AllSmallSemigroups` (4.5-1) should be used if the number of semigroups is not too large and you want to keep the created semigroups in a list.

- `EnumeratorOfSmallSemigroups` (4.5-2) or `EnumeratorSortedOfSmallSemigroups` (4.5-4) should be used when the functions in even indexed positions are those stored in the library (see `PrecomputedSmallSemisInfo` (4.5-19)) or you want repeatedly search the same set of semigroups and there are too many to store in a list. Note that the enumerator stores the id numbers of its elements but not the semigroups themselves. Hence every time an element of the enumerator is required it must be recreated from the multiplication table data.

- `IteratorOfSmallSemigroups` (4.5-11) should be used if the functions in even indexed positions are not stored in the library (see `PrecomputedSmallSemisInfo` (4.5-19)) or if you just want to run through all the semigroups satisfying the specified parameters once only. Note that each new call of `IteratorOfSmallSemigroups` (4.5-11) requires GAP to recompute its elements which may be slow if the functions are user-defined or not stored in the library.

Further information on the relative virtues of these different commands can be found in Chapter 3.

As a further example, if we want to obtain a single non-simple semigroup with 7 elements and trivial automorphism group, then we would use one of the functions `OneSmallSemigroup` (4.5-16) or `RandomSmallSemigroup` (4.5-20) with argument

    7, IsSimpleSemigroup, false, x-> IsTrivial(AutomorphismGroup(x)), true

`OneSmallSemigroup` (4.5-16) should return an answer more quickly than `RandomSmallSemigroup` (4.5-20). Also note that `OneSmallSemigroup` (4.5-16) will always return the same semigroup, i.e. the first semigroup in the library with the given parameters.

##### 4.5-1 AllSmallSemigroups

`‣ AllSmallSemigroups`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer, an enumerator of small semigroups with `IsEnumeratorOfSmallSemigroups` (4.5-8), or an iterator of small semigroup with `IsIteratorOfSmallSemigroups` (4.5-10).

The even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions.

Please see Section 4.5 or Chapter 3 for more details.

If `arg[1]` is a positive integer, then `AllSmallSemigroups` returns a list of all the small semigroups `S` in the library with `Size(S)=arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is a list of positive integers, then `AllSmallSemigroups` returns a list of all the small semigroups `S` in the library with `Size(S) in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is an enumerator or iterator of small semigroups, then `AllSmallSemigroups` returns a list of all the small semigroups `S` in the library with `S in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

      gap> AllSmallSemigroups(2);
      [ <small semigroup of size 2>, <small semigroup of size 2>,
        <small semigroup of size 2>, <small semigroup of size 2> ]
      gap> AllSmallSemigroups([2,3], IsRegularSemigroup, true,
      > x-> Length(GreensRClasses(x)), 1);
      [ <small semigroup of size 2>, <small semigroup of size 2>,
        <small semigroup of size 3>, <small semigroup of size 3> ]
      gap> enum:=EnumeratorOfSmallSemigroups(8, IsInverseSemigroup, true,
      > IsCommutativeSemigroup, true);;
      gap> AllSmallSemigroups(enum, x-> Length(GreensRClasses(x)), 1);
      [ <small semigroup of size 8>, <small semigroup of size 8>,
        <small semigroup of size 8> ]
      gap> iter:=IteratorOfSmallSemigroups(7, x-> Length(GreensRClasses(x)), 1);;
      gap> AllSmallSemigroups(iter, IsCommutative, true,
      > IsSimpleSemigroup, true);
      [ <small semigroup of size 7> ]

##### 4.5-2 EnumeratorOfSmallSemigroups

`‣ EnumeratorOfSmallSemigroups`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer, an enumerator of small semigroups with `IsEnumeratorOfSmallSemigroups` (4.5-8), or an iterator of small semigroup with `IsIteratorOfSmallSemigroups` (4.5-10).

The even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions.

Please see Section 4.5 or Chapter 3 for more details.

If `arg[1]` is a positive integer, then `EnumeratorOfSmallSemigroups` returns an enumerator of all the small semigroups `S` in the library with `Size(S)=arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is a list of positive integers, then `EnumeratorOfSmallSemigroups` returns an enumerator of all the small semigroups `S` in the library with `Size(S) in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is an enumerator or iterator of small semigroups, then `EnumeratorOfSmallSemigroups` returns an enumerator of all the small semigroups `S` in the library with `S in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

    gap> enum:=EnumeratorOfSmallSemigroups(7);
    <enumerator of semigroups of size 7>
    gap> EnumeratorOfSmallSemigroups([2,3], IsRegularSemigroup, true);
    <enumerator of semigroups of sizes [ 2, 3 ]>
    gap> enum:=EnumeratorOfSmallSemigroups(8, IsInverseSemigroup, true,
    > IsCommutativeSemigroup, true);
    <enumerator of semigroups of size 8>
    gap> EnumeratorOfSmallSemigroups(enum, IsCommutativeSemigroup, true,
    > IsSimpleSemigroup, false);
    <enumerator of semigroups of size 8>
    gap> iter:=IteratorOfSmallSemigroups(8);
    <iterator>
    gap> EnumeratorOfSmallSemigroups(iter, IsCommutativeSemigroup, true,
    > IsSimpleSemigroup, false);
    <enumerator of semigroups of size 8>

##### 4.5-3 EnumeratorOfSmallSemigroupsByIds

`‣ EnumeratorOfSmallSemigroupsByIds`( arg ) | ( operation )

`‣ EnumeratorOfSmallSemigroupsByIdsNC`( arg ) | ( operation )

the argument of this function should be one of the following:

- a positive integer arg[1] and a set of positive integers less than `NrSmallSemigroups` (4.5-15) with argument arg[1]. For example, the argument 3, [1..10] yields the first 10 semigroups with 3 elements.

- a set of positive integers arg[1] and a list of sets of positive integers arg[2] such that x is at most `NrSmallSemigroups` (4.5-15) with argument arg[1][i] for all x in arg[2][i]. For example, [2,3], [[1..2],[1..10]] yields the first 2 semigroups of size 2, and the first 10 semigroups of size 3.

- a list of id numbers, for example, [[7,1], [6,1], [5,1]].

The no check version does not check that the arguments are valid and may return unpredictable results.

    gap> enum:=EnumeratorOfSmallSemigroupsByIds([[7,1],[6,1],[5,1]]);
    <enumerator of semigroups of sizes [ 5, 6, 7 ]>
    gap> enum:=EnumeratorOfSmallSemigroupsByIds(7, [1..1000]);
    <enumerator of semigroups of size 7>
    gap> enum:=EnumeratorOfSmallSemigroupsByIds([2,3], [[1..2],[1..10]]);
    <enumerator of semigroups of sizes [ 2, 3 ]>

##### 4.5-4 EnumeratorSortedOfSmallSemigroups

`‣ EnumeratorSortedOfSmallSemigroups`( arg ) | ( function )

accepts the same arguments and returns the same values as `EnumeratorOfSmallSemigroups` (4.5-2).

##### 4.5-5 FuncsOfSmallSemisInEnum

`‣ FuncsOfSmallSemisInEnum`( enum ) | ( function )

returns a list of the functions and their values that were used to create the enumerator of small semigroups enum. If you only want the names of these functions use `NamesFuncsSmallSemisInEnum` (4.5-12).

    gap> enum:=EnumeratorOfSmallSemigroups([2..4], IsSimpleSemigroup, false,
    > IsRegularSemigroup, true);;
    gap> FuncsOfSmallSemisInEnum(enum);
    [ <Property "IsRegularSemigroup">, true,
      <Property "IsSimpleSemigroup">, false ]

##### 4.5-6 FuncsOfSmallSemisInIter

`‣ FuncsOfSmallSemisInIter`( iter ) | ( function )

returns a list of the functions and their values that were used to create the iterator of small semigroups iter. If you only want the names of these functions use `NamesFuncsSmallSemisInIter` (4.5-13).

    gap> enum:=IteratorOfSmallSemigroups([2..4], IsSimpleSemigroup, false,
    > IsRegularSemigroup, true);;
    gap> FuncsOfSmallSemisInIter(enum);
    [ <Property "IsRegularSemigroup">, true,
      <Property "IsSimpleSemigroup">, false ]

##### 4.5-7 IdsOfSmallSemigroups

`‣ IdsOfSmallSemigroups`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer, an enumerator of small semigroups with `IsEnumeratorOfSmallSemigroups` (4.5-8), or an iterator of small semigroup with `IsIteratorOfSmallSemigroups` (4.5-10).

The even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions.

Please see Section 4.5 or Chapter 3 for more details.

If `arg[1]` is a positive integer, then `IdsOfSmallSemigroups` returns a list of the id numbers of all the small semigroups `S` in the library with `Size(S)=arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is a list of positive integers, then `IdsOfSmallSemigroups` returns a list of the id numbers of all the small semigroups `S` in the library with `Size(S) in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is an enumerator or iterator of small semigroups, then `IdsOfSmallSemigroups` returns a list of the id numbers of all the small semigroups `S` in the library with `S in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

    gap>  enum:=EnumeratorOfSmallSemigroups(5, x-> Length(GreensRClasses(x)), 1);;
    gap> IdsOfSmallSemigroups(enum, IsCommutativeSemigroup, true,
    > IsSimpleSemigroup, false);
    [  ]
    gap> IdsOfSmallSemigroups([2,3], IsRegularSemigroup, true);
    [ [ 2, 2 ], [ 2, 3 ], [ 2, 4 ], [ 3, 10 ], [ 3, 11 ], [ 3, 12 ],
      [ 3, 13 ], [ 3, 14 ], [ 3, 15 ], [ 3, 16 ], [ 3, 17 ], [ 3, 18 ] ]

##### 4.5-8 IsEnumeratorOfSmallSemigroups

`‣ IsEnumeratorOfSmallSemigroups`( enum ) | ( property )

returns `true` if enum is an enumerator of small semigroups created using `EnumeratorOfSmallSemigroups` (4.5-2), `EnumeratorOfSmallSemigroupsByIds` (4.5-3).

    gap> enum:=EnumeratorOfSmallSemigroupsByIds([[2,1], [3,1], [4,1]]);;
    gap> IsEnumeratorOfSmallSemigroups(enum);
    true

##### 4.5-9 IsIdSmallSemigroup

`‣ IsIdSmallSemigroup`( arg ) | ( property )

return `true` if the arg is the id of a small semigroup or [arg[1], arg[2]] is the id of a small semigroup.

    gap> IsIdSmallSemigroup(8,1);
    true
    gap> IsIdSmallSemigroup([1,2]);
    false
    gap> IsIdSmallSemigroup([3,18]);
    true

##### 4.5-10 IsIteratorOfSmallSemigroups

`‣ IsIteratorOfSmallSemigroups`( iter ) | ( property )

returns `true` if iter is an iterator of small semigroups created using `IteratorOfSmallSemigroups` (4.5-11).

    gap> iter:=IteratorOfSmallSemigroups(8);;
    gap> IsIteratorOfSmallSemigroups(iter);
    true

##### 4.5-11 IteratorOfSmallSemigroups

`‣ IteratorOfSmallSemigroups`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer, an enumerator of small semigroups with `IsEnumeratorOfSmallSemigroups` (4.5-8), or an iterator of small semigroup with `IsIteratorOfSmallSemigroups` (4.5-10).

The even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions.

Please see Section 4.5 or Chapter 3 for more details.

If `arg[1]` is a positive integer, then `IteratorOfSmallSemigroups` returns an iterator of all the small semigroups `S` in the library with `Size(S)=arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is a list of positive integers, then `IteratorOfSmallSemigroups` returns an iterator of all the small semigroups `S` in the library with `Size(S) in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is an enumerator or iterator of small semigroups, then `IteratorOfSmallSemigroups` returns an iterator of all the small semigroups `S` in the library with `S in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

    gap> iter:=IteratorOfSmallSemigroups(8);
    <iterator>
    gap> NextIterator(iter);
    <small semigroup of size 8>
    gap> IsDoneIterator(iter);
    false
    gap> iter:=IteratorOfSmallSemigroups([2,3], IsRegularSemigroup, true,
    > x-> Length(Idempotents(x))=1, true);
    <iterator>
    gap> NextIterator(iter);
    <small semigroup of size 2>
    gap> NextIterator(iter);
    <small semigroup of size 3>
    gap> NextIterator(iter);
    fail
    gap> enum:=EnumeratorOfSmallSemigroups(5, x-> Length(Idempotents(x))=1, true);
    <enumerator of semigroups of size 5>
    gap> iter:=IteratorOfSmallSemigroups(enum, x-> Length(GreensRClasses(x))=2, true);
    <iterator>

##### 4.5-12 NamesFuncsSmallSemisInEnum

`‣ NamesFuncsSmallSemisInEnum`( enum ) | ( function )

returns a list of the names of functions and their values that were used to create the enumerator of small semigroups enum. If you only want the actual functions themselves then use `FuncsOfSmallSemisInEnum` (4.5-5).

    gap> enum:=EnumeratorOfSmallSemigroups([2..4], IsSimpleSemigroup, false,
    > IsRegularSemigroup, true);;
    gap> NamesFuncsSmallSemisInEnum(enum);
    [ "IsRegularSemigroup", true, "IsSimpleSemigroup", false ]

##### 4.5-13 NamesFuncsSmallSemisInIter

`‣ NamesFuncsSmallSemisInIter`( iter ) | ( attribute )

returns a list of the names of functions and their values that were used to create the iterator of small semigroups iter. If you only want the actual functions themselves then use `FuncsOfSmallSemisInIter` (4.5-6).

    gap> iter:=IteratorOfSmallSemigroups([2..4], IsSimpleSemigroup, false,
    > IsRegularSemigroup, true);;
    gap> NamesFuncsSmallSemisInIter(iter);
    [ "IsRegularSemigroup", true, "IsSimpleSemigroup", false ]

##### 4.5-14 Nr3NilpotentSemigroups

`‣ Nr3NilpotentSemigroups`( n[, type] ) | ( function )

returns the number of 3-nilpotent semigroups on a set with n elements. If the optional argument type is given it must be one of `"UpToEquivalence", "UpToIsomorphism", "SelfDual", "Commutative", "Labelled", "Labelled-Commutative"`. The number will be returned for the respective type of semigroup. By default type is `"UpToEquivalence"`.

The function implements the formulae calculating the number of 3-nilpotent semigroups developed in [Dis10]

    gap> Nr3NilpotentSemigroups( 4 );
    8
    gap> Nr3NilpotentSemigroups( 9, "UpToIsomorphism" );
    105931872028455
    gap> Nr3NilpotentSemigroups( 9, "Labelled" );
    38430603831264883632
    gap> Nr3NilpotentSemigroups( 16, "SelfDual" );
    4975000837941847814744710290469890455985530
    gap> Nr3NilpotentSemigroups( 19, "Commutative" );
    12094270656160403920767935604624748908993169949317454767617795

##### 4.5-15 NrSmallSemigroups

`‣ NrSmallSemigroups`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer, an enumerator of small semigroups with `IsEnumeratorOfSmallSemigroups` (4.5-8), or an iterator of small semigroup with `IsIteratorOfSmallSemigroups` (4.5-10).

The even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions.

Please see Section 4.5 or Chapter 3 for more details.

If `arg[1]` is a positive integer, then `NrSmallSemigroups` returns the number of small semigroups `S` in the library with `Size(S)=arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is a list of positive integers, then `NrSmallSemigroups` returns the number of small semigroups `S` in the library with `Size(S) in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is an enumerator or iterator of small semigroups, then `NrSmallSemigroups` returns the number of small semigroups `S` in the library with `S in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

    gap> List([1..8], NrSmallSemigroups);
    [ 1, 4, 18, 126, 1160, 15973, 836021, 1843120128 ]
    gap> NrSmallSemigroups(8, IsCommutative, true, IsInverseSemigroup, true);
    4443
    gap> NrSmallSemigroups([1..8], IsCliffordSemigroup, true);
    5610
    gap> NrSmallSemigroups(8, IsRegularSemigroup, true,
    > IsCompletelyRegularSemigroup, false);
    1164
    gap> NrSmallSemigroups(5, NilpotencyDegree, 3);
    84

##### 4.5-16 OneSmallSemigroup

`‣ OneSmallSemigroup`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer, an enumerator of small semigroups with `IsEnumeratorOfSmallSemigroups` (4.5-8), or an iterator of small semigroup with `IsIteratorOfSmallSemigroups` (4.5-10).

The even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions.

Please see Section 4.5 or Chapter 3 for more details.

If `arg[1]` is a positive integer, then `OneSmallSemigroup` returns the first small semigroup `S` in the library with `Size(S)=arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is a list of positive integers, then `OneSmallSemigroup` returns the first small semigroup `S` in the library with `Size(S) in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is an enumerator or iterator of small semigroups, then `OneSmallSemigroup` returns the first small semigroup `S` in the library with `S in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

    gap> OneSmallSemigroup(8, IsCommutative, true, IsInverseSemigroup, true);
    <small semigroup of size 8>
    gap> OneSmallSemigroup([1..8], IsCliffordSemigroup, true);
    <small semigroup of size 1>
    gap> iter:=IteratorOfSmallSemigroups(8, IsCommutative, false);
    <iterator>
    gap> OneSmallSemigroup(iter);
    <small semigroup of size 8>

##### 4.5-17 PositionsOfSmallSemigroups

`‣ PositionsOfSmallSemigroups`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer or an enumerator with `IsEnumeratorOfSmallSemigroups` (4.5-8), the even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions. The argument can be a list `arg` with the same components as given above.

The function returns a list of the second components of the `IdSmallSemigroup` (4.1-6) of all the small semigroups `S` in the library satisfying `Size(S)` in `arg[1]` or `Size(S)` in `SizesOfSmallSemisInEnum(arg[1])` and `arg[2i](S)=arg[2i+1]` for all `i` partitioned by size of the semigroups.

      gap> PositionsOfSmallSemigroups(3);
      [ [ 1 .. 18 ] ]
      gap> PositionsOfSmallSemigroups(3, IsRegularSemigroup, false);
      [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ]
      gap> enum:=EnumeratorOfSmallSemigroups(3, IsRegularSemigroup, false);;
      gap> PositionsOfSmallSemigroups(enum);
      [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ]
      gap> PositionsOfSmallSemigroups([1..4], IsBand, true);
      [ [ 1 ], [ 3, 4 ], [ 12 .. 17 ], [ 98 .. 123 ] ]
      gap> PositionsOfSmallSemigroups(enum, Is1IdempotentSemigroup, true,
      > Is2GeneratedSemigroup, true, IsCliffordSemigroup, false);
      [ [ 1, 2 ], [ 2, 3, 5, 6, 8, 9, 10, 12, 34, 35, 36, 97 ],
        [ 5, 20, 21, 22, 23, 26, 29, 32, 35, 54, 55, 56, 60, 61, 62, 63, 64, 65,
            152, 156, 159, 177, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
            191, 192, 193, 540, 1009, 1157, 1158 ] ]

##### 4.5-18 PositionsOfSmallSemisInEnum

`‣ PositionsOfSmallSemisInEnum`( enum ) | ( function )

returns the second components of the id numbers of the small semigroups in the enumerator of small semigroups enum in a list partitioned according the size of the semigroup. The same value is returned by using `PositionsOfSmallSemigroups` (4.5-17).

    gap> enum := EnumeratorOfSmallSemigroups([2..4],IsSimpleSemigroup,true);;
    gap> PositionsOfSmallSemisInEnum
    > (enum);
    [ [ 2, 4 ], [ 17, 18 ], [ 7, 37, 52, 122, 123 ] ]

##### 4.5-19 PrecomputedSmallSemisInfo

`‣ PrecomputedSmallSemisInfo` | ( global variable )

the global variable `PrecomputedSmallSemisInfo` contains a list of all the names of precomputed properties stored in the library. The `i`th element of the list contains the list of properties that have been precomputed for all semigroups in the library of order `i`.

      gap> PrecomputedSmallSemisInfo[3];
      [ "Is1GeneratedSemigroup", "Is2GeneratedSemigroup", "Is3GeneratedSemigroup",
        "IsBand", "IsCliffordSemigroup", "IsCommutative",
        "IsCompletelyRegularSemigroup", "IsFullTransformationSemigroupCopy",
        "IsGroupAsSemigroup", "IsIdempotentGenerated", "IsInverseSemigroup",
        "IsMonoidAsSemigroup", "IsMultSemigroupOfNearRing", "IsRegularSemigroup",
        "IsSelfDualSemigroup", "IsSemigroupWithoutClosedIdempotents",
        "IsSimpleSemigroup", "IsSingularSemigroupCopy", "IsZeroSemigroup",
        "IsZeroSimpleSemigroup" ]

##### 4.5-20 RandomSmallSemigroup

`‣ RandomSmallSemigroup`( arg ) | ( function )

the number of argument of this function should be odd. The first argument `arg[1]` should be a positive integer, an enumerator of small semigroups with `IsEnumeratorOfSmallSemigroups` (4.5-8), or an iterator of small semigroup with `IsIteratorOfSmallSemigroups` (4.5-10).

The even arguments `arg[2i]`, if present, should be functions, and the odd arguments `arg[2i+1]` should be a value that the preceeding function can have. For example, a typical input might be `3, IsRegularSemigroup, true`. The functions `arg[2i]` can be user defined or existing GAP functions.

Please see Section 4.5 or Chapter 3 for more details.

If `arg[1]` is a positive integer, then `RandomSmallSemigroup` returns a random small semigroup `S` in the library with `Size(S)=arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is a list of positive integers, then `RandomSmallSemigroup` returns the a random small semigroup `S` in the library with `Size(S) in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

If `arg[1]` is an enumerator or iterator of small semigroups, then `RandomSmallSemigroup` returns the a random small semigroup `S` in the library with `S in arg[1]` and `arg[2i](S)=arg[2i+1]` for all `i`.

      gap> RandomSmallSemigroup(8, IsCommutative, true,
      > IsInverseSemigroup, true);
      <small semigroup of size 8>
      gap> RandomSmallSemigroup([1..8], IsCliffordSemigroup, true);
      <small semigroup of size 8>
      gap> iter:=IteratorOfSmallSemigroups([1..7]);
      <iterator of semigroups of size [ 1 .. 7 ]>
      gap> RandomSmallSemigroup(iter);
      <small semigroup of size 7>

##### 4.5-21 SizesOfSmallSemisInEnum

`‣ SizesOfSmallSemisInEnum`( enum ) | ( function )

returns the sizes of the semigroups in the enumerator of small semigroups enum.

    gap> enum:=EnumeratorOfSmallSemigroups([2..4], IsSimpleSemigroup, false);
    <enumerator of semigroups of sizes [ 2, 3, 4 ]>
    gap> SizesOfSmallSemisInEnum(enum);
    [ 2, 3, 4 ]

##### 4.5-22 SizesOfSmallSemisInIter

`‣ SizesOfSmallSemisInIter`( iter ) | ( function )

returns the sizes of the semigroups in the iterator iter of small semigroups.

      gap> iter:=IteratorOfSmallSemigroups(7, IsCommutative, false);
      <iterator of semigroups of size 7>
      gap> SizesOfSmallSemisInIter(iter);
      [ 7 ]

##### 4.5-23 UpToIsomorphism

`‣ UpToIsomorphism`( sgrps ) | ( operation )

takes a list sgrps of non-equivalent semigroups from the library as input and returns a list of non-isomorphic semigroups containing an isomorphic semigroup and an anti-isomorphic semigroup for every semigroup in sgrps.

    gap> UpToIsomorphism([SmallSemigroup(5,126),SmallSemigroup(6,2)]);
    [ <small semigroup of size 5>, <small semigroup of size 6> ]
    gap> UpToIsomorphism([SmallSemigroup(5,126),SmallSemigroup(5,3)]);
    [ <small semigroup of size 5>, <small semigroup of size 5>,
      <semigroup of size 5, with 5 generators> ]

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

generated by GAPDoc2HTML