Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/semigroups/tst/standard/semigroups/   (GAP Algebra Version 4.15.1©)  Datei vom 29.7.2025 mit Größe 86 kB image not shown  

Quelle  semitrans.tst   Sprache: unbekannt

 
Spracherkennung für: .tst vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

############################################################################
##
#W  standard/semigroups/semitrans.tst
#Y  Copyright (C) 2015-2022                                 Wilf A. Wilson
##
##  Licensing information can be found in the README file of this package.
##
#############################################################################
##

#@local B, BruteForceInverseCheck, BruteForceIsoCheck, C, CC, D, DP, F
#@local LoopIterator, M, Noop, R, S, S1, S2, T, TC, TestIterator, W, WW, acting
#@local coll, gr, inv, iso, iter1, iter2, len, list, map, n, rels, valid, x, y
gap> START_TEST("Semigroups package: standard/semigroups/semitrans.tst");
gap> LoadPackage("semigroups", false);;

#
gap> SEMIGROUPS.StartTest();;
gap> Noop := 0;;
gap> TestIterator := function(S, it)
> local LoopIterator;
> LoopIterator := function(it)
>   local valid, len, x;
>   valid := true;;
>   len := 0;
>   for x in it do
>     len := len + 1;
>     if not x in S then
>       valid := false;
>       break;
>     fi;
>   od;
>   return valid and IsDoneIterator(it) and len = Size(S);
> end;
> return LoopIterator(it) and LoopIterator(ShallowCopy(it));
> end;;

# SemiTransTest1
# RepresentativeOfMinimalIdeal and IsSynchronizingSemigroup for T_n
gap> S := Semigroup(Transformation([1]));;
gap> RepresentativeOfMinimalIdeal(S);
IdentityTransformation
gap> IsSynchronizingSemigroup(S);
false
gap> ForAll([2 .. 10], x ->
> IsSynchronizingSemigroup(FullTransformationMonoid(x)));
true
gap> for n in [2 .. 10] do
>   Print(RepresentativeOfMinimalIdeal(FullTransformationMonoid(n)), "\n");
> od;
Transformation( [ 11 ] )
Transformation( [ 111 ] )
Transformation( [ 1111 ] )
Transformation( [ 11111 ] )
Transformation( [ 111111 ] )
Transformation( [ 1111111 ] )
Transformation( [ 11111111 ] )
Transformation( [ 111111111 ] )
Transformation( [ 1111111111 ] )
gap> IsSynchronizingSemigroup(MinimalIdeal(FullTransformationMonoid(3)));
true

# SemiTransTest2
# IsSynchronizingSemigroup
gap> S := Semigroup([
> Transformation([11431]),
> Transformation([21342])]);
<transformation semigroup of degree 5 with 2 generators>
gap> IsSynchronizingSemigroup(S);
false
gap> S := Semigroup(S);;
gap> RepresentativeOfMinimalIdeal(S);
Transformation( [ 22432 ] )
gap> IsSynchronizingSemigroup(S);
false
gap> S := Semigroup([
> Transformation([2672699115]),
> Transformation([381994105106]),
> Transformation([7143277665])]);
<transformation semigroup of degree 10 with 3 generators>
gap> IsSynchronizingSemigroup(S);
true
gap> S := Semigroup(S);;
gap> RepresentativeOfMinimalIdeal(S);
Transformation( [ 7777777777 ] )
gap> IsSynchronizingSemigroup(S);
true
gap> S := Semigroup(S);;
gap> MultiplicativeZero(S);
fail
gap> IsSynchronizingSemigroup(S);
true
gap> S := Semigroup([
> Transformation([46543910229]),
> Transformation([57104674113]),
> Transformation([6794247597])]);
<transformation semigroup of degree 10 with 3 generators>
gap> IsSynchronizingSemigroup(S);
true
gap> S := Semigroup(S);;
gap> RepresentativeOfMinimalIdeal(S);
Transformation( [ 4444444444 ] )
gap> IsSynchronizingSemigroup(S);
true
gap> HasMultiplicativeZero(S);
false
gap> S := Semigroup(S);;
gap> MultiplicativeZero(S);
Transformation( [ 4444444444 ] )
gap> IsSynchronizingSemigroup(S);
true
gap> S := Semigroup(Transformation([1223]));
<commutative transformation semigroup of degree 4 with 1 generator>
gap> MultiplicativeZero(S);
Transformation( [ 1222 ] )
gap> IsSynchronizingSemigroup(S);
false

# SemiTransTest3
# FixedPointsOfTransformationSemigroup for a transformation semigroup with
# generators
gap> S := FullTransformationMonoid(3);;
gap> FixedPointsOfTransformationSemigroup(S);
[  ]
gap> S := Semigroup([
> Transformation([124456]),
> Transformation([113466]),
> Transformation([113456])]);;
gap> FixedPointsOfTransformationSemigroup(S);
146 ]

# SemiTransTest4
# MovedPoints for a transformation semigroup with generators
gap> S := FullTransformationMonoid(4);;
gap> MovedPoints(S);
1 .. 4 ]
gap> S := Semigroup([
> Transformation([123456]),
> Transformation([113466]),
> Transformation([114456])]);;
gap> MovedPoints(S);
235 ]

# SemiTransTest5
# \^ for a transformation semigroup and a transformation or a permutation
gap> S := FullTransformationMonoid(4);;
gap> S ^ () = S;
true
gap> S ^ (13) = S;
true
gap> S := S ^ (15)(246)(37);
<transformation monoid of degree 7 with 3 generators>
gap> Size(S) = 4 ^ 4;
true
gap> GeneratorsOfSemigroup(S);
[ IdentityTransformation, Transformation( [ 1237456 ] ), 
  Transformation( [ 12354 ] ), Transformation( [ 123455 ] ) 
 ]
gap> S := Semigroup([
> Transformation([26726115]),
>  Transformation([38145671]),
>  Transformation([43277665])]);;
gap> GeneratorsOfSemigroup(S ^ (178610)(3954));
[ Transformation( [ 110210542787 ] ), 
  Transformation( [ 163457987 ] ), 
  Transformation( [ 198854310210 ] ) ]

# SemiTransTest6
# DigraphOfActionOnPoints for a transformation semigroup (and a pos int)
gap> gr := DigraphOfActionOnPoints(FullTransformationSemigroup(4));
<immutable digraph with 4 vertices, 9 edges>
gap> OutNeighbours(gr);
[ [ 12 ], [ 231 ], [ 34 ], [ 41 ] ]
gap> S := Semigroup([
> Transformation([26726115]),
>  Transformation([43277665]),
>  Transformation([38145671])]);;
gap> DigraphOfActionOnPoints(S, -1);
Error, the 2nd argument (an integer) must be non-negative
gap> DigraphOfActionOnPoints(S, 5);
<immutable digraph with 5 vertices, 9 edges>
gap> gr := DigraphOfActionOnPoints(S);
<immutable digraph with 8 vertices, 22 edges>
gap> DigraphOfActionOnPoints(S, 0) = EmptyDigraph(0);
true
gap> DigraphOfActionOnPoints(S, 8) = gr;
true
gap> OutNeighbours(gr);
[ [ 243 ], [ 638 ], [ 721 ], [ 274 ], [ 675 ], [ 16 ], 
  [ 167 ], [ 51 ] ]
gap> DigraphOfActionOnPoints(FullTransformationMonoid(1));
<immutable empty digraph with 0 vertices>
gap> DigraphOfActionOnPoints(FullTransformationMonoid(2), 1);
<immutable digraph with 1 vertex, 1 edge>

# SemiTransTest9
# Idempotents for a transformation semigroup and a pos int
gap> Idempotents(FullTransformationMonoid(3), 4);
[  ]
gap> Idempotents(FullTransformationMonoid(3), 3);
[ IdentityTransformation ]
gap> Idempotents(FullTransformationMonoid(3), 2);
[ Transformation( [ 121 ] ), Transformation( [ 122 ] ), 
  Transformation( [ 323 ] ), Transformation( [ 22 ] ), 
  Transformation( [ 133 ] ), Transformation( [ 11 ] ) ]
gap> Idempotents(FullTransformationMonoid(3), 1);
[ Transformation( [ 111 ] ), Transformation( [ 222 ] ), 
  Transformation( [ 333 ] ) ]
gap> S := Semigroup([
> Transformation([51314252]),
>  Transformation([71742563]),
>  Transformation([84657887])]);;
gap> Idempotents(S, 9);
[  ]
gap> Length(Idempotents(S, 3));
988
gap> AsSet(Idempotents(S, 1));
[ Transformation( [ 11111111 ] ), 
  Transformation( [ 22222222 ] ), 
  Transformation( [ 33333333 ] ), 
  Transformation( [ 44444444 ] ), 
  Transformation( [ 55555555 ] ), 
  Transformation( [ 66666666 ] ), 
  Transformation( [ 77777777 ] ), 
  Transformation( [ 88888888 ] ) ]

# SemiTransTest12
gap> S := Semigroup(PartialPerm([23], [14]));;
gap> R := RClass(S, RepresentativeOfMinimalIdeal(S));
<Green's R-class: <empty partial perm>>
gap> S := Semigroup([
> Transformation([134135]),
>  Transformation([516163])]);;
gap> R := HClass(S, Transformation([453455]));
<Green's H-class: Transformation( [ 453455 ] )>

# SemiTransTest13
# EndomorphismMonoid
gap> gr := Digraph([[12], [12]]);;
gap> GeneratorsOfEndomorphismMonoidAttr(gr);
[ Transformation( [ 21 ] ), IdentityTransformation, 
  Transformation( [ 11 ] ) ]
gap> S := EndomorphismMonoid(gr);
<transformation monoid of degree 2 with 2 generators>
gap> Elements(S);
[ Transformation( [ 11 ] ), IdentityTransformation, 
  Transformation( [ 21 ] ), Transformation( [ 22 ] ) ]
gap> S := EndomorphismMonoid(Digraph([[12], [12]]), [11]);
<transformation monoid of degree 2 with 2 generators>
gap> Elements(S);
[ Transformation( [ 11 ] ), IdentityTransformation, 
  Transformation( [ 21 ] ), Transformation( [ 22 ] ) ]
gap> S := EndomorphismMonoid(Digraph([[12], [12]]));
<transformation monoid of degree 2 with 2 generators>
gap> Elements(S);
[ Transformation( [ 11 ] ), IdentityTransformation, 
  Transformation( [ 21 ] ), Transformation( [ 22 ] ) ]
gap> IsFullTransformationMonoid(S);
true
gap> S := EndomorphismMonoid(Digraph([[2], [2]]));
<commutative transformation monoid of degree 2 with 1 generator>
gap> Elements(S);
[ IdentityTransformation, Transformation( [ 22 ] ) ]
gap> S := EndomorphismMonoid(Digraph([[2], [2]]), [11]);
<commutative transformation monoid of degree 2 with 1 generator>
gap> Elements(S);
[ IdentityTransformation, Transformation( [ 22 ] ) ]
gap> S := EndomorphismMonoid(Digraph([[2], [2]]), [12]);
<trivial transformation group of degree 0 with 1 generator>

# BruteForceIsoCheck helper functions
gap> BruteForceIsoCheck := function(iso)
>   local x, y;
>   if not IsInjective(iso) or not IsSurjective(iso) then
>     return false;
>   fi;
>   for x in Generators(Source(iso)) do
>     for y in Generators(Source(iso)) do
>       if x ^ iso * y ^ iso <> (x * y) ^ iso then
>         return false;
>       fi;
>     od;
>   od;
>   return true;
> end;;
gap> BruteForceInverseCheck := function(map)
> local inv;
>   inv := InverseGeneralMapping(map);
>   return ForAll(Source(map), x -> x = (x ^ map) ^ inv)
>     and ForAll(Range(map), x -> x = (x ^ inv) ^ map);
> end;;

# isomorphism from RMS to transformation semigroup
gap> S := RectangularBand(IsReesMatrixSemigroup, 55);;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<Rees matrix semigroup 5x5 over Group(())> -> 
<transformation semigroup of size 25, degree 26 with 5 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from RZMS to transformation semigroup
gap> S := ZeroSemigroup(IsReesZeroMatrixSemigroup, 10);;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<Rees 0-matrix semigroup 9x1 over Group(())> -> 
<commutative transformation semigroup of size 10, degree 11 with 9 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from fp semigroup to transformation semigroup
gap> S := AsSemigroup(IsFpSemigroup, JonesMonoid(5));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<fp semigroup with 5 generators and 28 relations of length 120> -> 
<transformation monoid of size 42, degree 42 with 4 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from pbr semigroup to transformation semigroup
gap> S := FullPBRMonoid(1);;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<pbr monoid of size 16, degree 1 with 4 generators> -> 
<transformation monoid of size 16, degree 16 with 4 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from bipartition semigroup to transformation semigroup
gap> S := Semigroup(
> Bipartition([[1467810], [25, -1, -2, -8],
>              [3, -3, -6, -7, -9], [9, -4, -5], [-10]]),
> Bipartition([[1267, -3, -4, -6], [34510, -2, -10],
>              [8, -8], [9, -1], [-5], [-7, -9]]));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<bipartition semigroup of size 7, degree 10 with 2 generators> -> 
<transformation semigroup of size 7, degree 8 with 2 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from block bijection semigroup to transformation semigroup
gap> S := Semigroup([
> Bipartition([[13, -2, -5], [24, -1], [5, -3, -4]]),
>  Bipartition([[13, -1], [24, -2, -3], [5, -4, -5]]),
>  Bipartition([[145, -2], [23, -1, -3, -4, -5]]),
>  Bipartition([[1, -5], [23, -1, -2], [4, -4], [5, -3]]),
>  Bipartition([[12, -2], [3, -3, -4, -5], [45, -1]])]);
<block bijection semigroup of degree 5 with 5 generators>
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<block bijection semigroup of size 54, degree 5 with 5 generators> -> 
<transformation semigroup of size 54, degree 55 with 5 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from transformation semigroup to transformation semigroup
gap> S := Semigroup(Transformation([52232]),
>                   Transformation([14234]));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> map = IdentityMapping(S);
true
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from partial perm semigroup to transformation semigroup
gap> S := Semigroup(PartialPerm([1234], [4512]),
>                   PartialPerm([124], [135]));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<partial perm semigroup of rank 4 with 2 generators> -> 
<transformation semigroup of degree 6 with 2 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from boolean mat semigroup to transformation semigroup
gap> S := Monoid(Matrix(IsBooleanMat,
>        [[01], [10]]),
>                Matrix(IsBooleanMat,
>        [[01], [10]]),
>                Matrix(IsBooleanMat,
>        [[10], [11]]),
>                Matrix(IsBooleanMat,
>        [[10], [00]]));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<monoid of 2x2 boolean matrices with 4 generators> -> 
<transformation monoid of degree 4 with 4 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from max plus mat semigroup to transformation semigroup
gap> S := Semigroup(Matrix(IsMaxPlusMatrix,
>        [[0, -4], [-4, -1]]),
>                   Matrix(IsMaxPlusMatrix,
>        [[0, -3], [-3, -1]]));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<semigroup of size 262x2 max-plus matrices with 2 generators> -> 
<transformation semigroup of size 26, degree 27 with 2 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from min plus mat semigroup to transformation semigroup
gap> S := Semigroup(Matrix(IsMinPlusMatrix,
>        [[04], [41]]),
>                   Matrix(IsMinPlusMatrix,
>        [[03], [31]]));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<semigroup of size 262x2 min-plus matrices with 2 generators> -> 
<transformation semigroup of size 26, degree 27 with 2 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from tropical max plus mat semigroup to transformation
#   semigroup
gap> S := Semigroup(Matrix(IsTropicalMaxPlusMatrix,
>        [[04], [41]], 10),
>                   Matrix(IsTropicalMaxPlusMatrix,
>        [[03], [31]], 10));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<semigroup of size 132x2 tropical max-plus matrices with 2 generators> -> 
<transformation semigroup of size 13, degree 14 with 2 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from tropical min plus mat semigroup to transformation
#   semigroup
gap> S := Semigroup(Matrix(IsTropicalMinPlusMatrix,
>        [[04], [41]], 5),
>                   Matrix(IsTropicalMinPlusMatrix,
>        [[03], [31]], 5));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<semigroup of size 182x2 tropical min-plus matrices with 2 generators> -> 
<transformation semigroup of size 18, degree 19 with 2 generators>
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# isomorphism from ntp mat semigroup to transformation
#   semigroup. This is the general linear semigroup over the field with 3
#   elements
gap> S := Monoid(
> Matrix(IsNTPMatrix,
>        [[100],
>         [020],
>         [002]],
>        03),
> Matrix(IsNTPMatrix,
>        [[102],
>         [100],
>         [010]],
>        03),
> Matrix(IsNTPMatrix,
>        [[200],
>         [020],
>         [000]],
>        03));
<monoid of 3x3 ntp matrices with 3 generators>
gap> IsomorphismSemigroup(IsTransformationSemigroup, S);
<monoid of size 196833x3 ntp matrices with 3 generators> -> 
<transformation monoid of size 19683, degree 19683 with 3 generators>

# isomorphism from ntp mat semigroup to transformation
#   semigroup. This is the general linear semigroup over the field with 2
#   elements
gap> S := Monoid(
> Matrix(IsNTPMatrix,
>        [[11], [01]], 02),
> Matrix(IsNTPMatrix,
>        [[01], [10]], 02),
> Matrix(IsNTPMatrix,
>        [[10], [00]], 02));
<monoid of 2x2 ntp matrices with 3 generators>
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<monoid of size 162x2 ntp matrices with 3 generators> -> 
<transformation monoid of size 16, degree 16 with 3 generators>
gap> BruteForceInverseCheck(map);
true
gap> BruteForceIsoCheck(map);
true

# isomorphism from an integer mat semigroup to transformation semigroup
gap> S := Semigroup(
>  Matrix(Integers,
>     [[00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00000000000100000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [10000000000000000]]),
>  Matrix(Integers,
>     [[00001000000000000],
>      [00000010000000000],
>      [00000000100000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00000010000000000],
>      [00001000000000000],
>      [00000000100000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [01000000000000000]]),
>  Matrix(Integers,
>     [[10000000000000000],
>      [00000001000000000],
>      [00000000010000000],
>      [00000000000010000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00000001000000000],
>      [00001000000000000],
>      [00000000010000000],
>      [00001000000000000],
>      [00000000000100000],
>      [00001000000000000],
>      [00000000000000010],
>      [00001000000000000],
>      [00001000000000000],
>      [00100000000000000]]),
>  Matrix(Integers,
>     [[00000100000000000],
>      [00001000000000000],
>      [00000000001000000],
>      [00000000000001000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00000000001000000],
>      [00001000000000000],
>      [00000000000000100],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00001000000000000],
>      [00010000000000000]]));;
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);
<semigroup of size 1617x17 integer matrices with 4 generators> -> 
<transformation semigroup of size 16, degree 17 with 4 generators>
gap> BruteForceInverseCheck(map);
true
gap> BruteForceIsoCheck(map);
true

# AsSemigroup:
#   convert from IsPBRSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> PBR([[-2], [-1], [-2], [-2]], [[2], [134], [], []]),
> PBR([[-3], [-3], [-3], [-3]], [[], [], [1234], []])]);
<pbr semigroup of degree 4 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsFpSemigroup to IsTransformationSemigroup
gap> F := FreeSemigroup(2);; AssignGeneratorVariables(F);;
gap> rels := [[s1 * s2, s2], [s2 ^ 2, s2], [s1 ^ 3, s1]];;
gap> S := F / rels;
<fp semigroup with 2 generators and 3 relations of length 12>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsBipartitionSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Bipartition([[134, -2], [2, -1], [-3], [-4]]),
> Bipartition([[1234, -3], [-1], [-2], [-4]])]);
<bipartition semigroup of degree 4 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of degree 4 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsTransformationSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Transformation([2122]), Transformation([3333])]);
<transformation semigroup of degree 4 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of degree 4 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsBooleanMatSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(IsBooleanMat,
>        [[false, true, false, false],
>         [true, false, false, false],
>         [false, true, false, false],
>         [false, true, false, false]]),
> Matrix(IsBooleanMat,
>        [[false, false, true, false],
>         [false, false, true, false],
>         [false, false, true, false],
>         [false, false, true, false]])]);
<semigroup of 4x4 boolean matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of degree 4 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsMaxPlusMatrixSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(IsMaxPlusMatrix,
>        [[-infinity, 0, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity]]),
> Matrix(IsMaxPlusMatrix,
>        [[-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity]])]);
<semigroup of 4x4 max-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsMinPlusMatrixSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(IsMinPlusMatrix,
>        [[infinity, 0, infinity, infinity],
>         [0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity],
>         [infinity, 0, infinity, infinity]]),
> Matrix(IsMinPlusMatrix,
>        [[infinity, infinity, 0, infinity],
>         [infinity, infinity, 0, infinity],
>         [infinity, infinity, 0, infinity],
>         [infinity, infinity, 0, infinity]])]);
<semigroup of 4x4 min-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsProjectiveMaxPlusMatrixSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[-infinity, 0, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity]]),
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity]])]);
<semigroup of 4x4 projective max-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsIntegerMatrixSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(Integers,
>        [[0100],
>         [1000],
>         [0100],
>         [0100]]),
> Matrix(Integers,
>        [[0010],
>         [0010],
>         [0010],
>         [0010]])]);
<semigroup of 4x4 integer matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsTropicalMaxPlusMatrixSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(IsTropicalMaxPlusMatrix,
>        [[-infinity, 0, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity]], 3),
> Matrix(IsTropicalMaxPlusMatrix,
>        [[-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity],
>         [-infinity, -infinity, 0, -infinity]], 3)]);
<semigroup of 4x4 tropical max-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsTropicalMinPlusMatrixSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(IsTropicalMinPlusMatrix,
>        [[infinity, 0, infinity, infinity],
>         [0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity],
>         [infinity, 0, infinity, infinity]], 5),
> Matrix(IsTropicalMinPlusMatrix,
>        [[infinity, infinity, 0, infinity],
>         [infinity, infinity, 0, infinity],
>         [infinity, infinity, 0, infinity],
>         [infinity, infinity, 0, infinity]], 5)]);
<semigroup of 4x4 tropical min-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsNTPMatrixSemigroup to IsTransformationSemigroup
gap> S := Semigroup([
> Matrix(IsNTPMatrix,
>        [[0100],
>         [1000],
>         [0100],
>         [0100]], 51),
> Matrix(IsNTPMatrix,
>        [[0010],
>         [0010],
>         [0010],
>         [0010]], 51)]);
<semigroup of 4x4 ntp matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsReesZeroMatrixSemigroup to IsTransformationSemigroup
gap> S := ReesZeroMatrixSemigroup(Group([(12)]), [[()], [()]]);
<Rees 0-matrix semigroup 1x2 over Group([ (1,2) ])>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 3 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsReesZeroMatrixSemigroup to IsTransformationMonoid
gap> S := ReesZeroMatrixSemigroup(Group([(12)]), [[()]]);
<Rees 0-matrix semigroup 1x1 over Group([ (1,2) ])>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 3, degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsReesMatrixSemigroup to IsTransformationSemigroup
gap> S := ReesMatrixSemigroup(Group([(12)]), [[()], [()]]);
<Rees matrix semigroup 1x2 over Group([ (1,2) ])>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 4, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsReesMatrixSemigroup to IsTransformationMonoid
gap> S := ReesMatrixSemigroup(Group([(12)]), [[()]]);
<Rees matrix semigroup 1x1 over Group([ (1,2) ])>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsReesZeroMatrixSemigroup to IsTransformationSemigroup
gap> S := ReesZeroMatrixSemigroup(Group([(12)]), [[()], [0]]);
<Rees 0-matrix semigroup 1x2 over Group([ (1,2) ])>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 4 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsPBRMonoid to IsTransformationSemigroup
gap> S := Monoid([
> PBR([[-2], [-3], [-2]], [[], [13], [2]]),
> PBR([[-2], [-2], [-2]], [[], [123], []])]);
<pbr monoid of degree 3 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsFpMonoid to IsTransformationSemigroup
gap> F := FreeMonoid(2);; AssignGeneratorVariables(F);;
gap> rels := [[m1 * m2, m2], [m2 ^ 2, m2], [m1 ^ 3, m1], [m2 * m1 ^ 2, m2]];;
gap> S := F / rels;
<fp monoid with 2 generators and 4 relations of length 16>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsBipartitionMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Bipartition([[13, -2], [2, -3], [-1]]),
> Bipartition([[123, -2], [-1], [-3]])]);
<bipartition monoid of degree 3 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsTransformationMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Transformation([232]), Transformation([222])]);
<transformation monoid of degree 3 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsBooleanMatMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(IsBooleanMat,
>        [[false, true, false],
>         [false, false, true],
>         [false, true, false]]),
> Matrix(IsBooleanMat,
>        [[false, true, false],
>         [false, true, false],
>         [false, true, false]])]);
<monoid of 3x3 boolean matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsMaxPlusMatrixMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(IsMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, -infinity, 0],
>         [-infinity, 0, -infinity]]),
> Matrix(IsMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, 0, -infinity],
>         [-infinity, 0, -infinity]])]);
<monoid of 3x3 max-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsMinPlusMatrixMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(IsMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, infinity, 0],
>         [infinity, 0, infinity]]),
> Matrix(IsMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, 0, infinity],
>         [infinity, 0, infinity]])]);
<monoid of 3x3 min-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsProjectiveMaxPlusMatrixMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, -infinity, 0],
>         [-infinity, 0, -infinity]]),
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, 0, -infinity],
>         [-infinity, 0, -infinity]])]);
<monoid of 3x3 projective max-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsIntegerMatrixMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(Integers,
>        [[010],
>         [001],
>         [010]]),
> Matrix(Integers,
>        [[010],
>         [010],
>         [010]])]);
<monoid of 3x3 integer matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsTropicalMaxPlusMatrixMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(IsTropicalMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, -infinity, 0],
>         [-infinity, 0, -infinity]], 5),
> Matrix(IsTropicalMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, 0, -infinity],
>         [-infinity, 0, -infinity]], 5)]);
<monoid of 3x3 tropical max-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsTropicalMinPlusMatrixMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(IsTropicalMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, infinity, 0],
>         [infinity, 0, infinity]], 1),
> Matrix(IsTropicalMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, 0, infinity],
>         [infinity, 0, infinity]], 1)]);
<monoid of 3x3 tropical min-plus matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsNTPMatrixMonoid to IsTransformationSemigroup
gap> S := Monoid([
> Matrix(IsNTPMatrix,
>        [[010],
>         [001],
>         [010]], 13),
> Matrix(IsNTPMatrix,
>        [[010],
>         [010],
>         [010]], 13)]);
<monoid of 3x3 ntp matrices with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsPBRMonoid to IsTransformationMonoid
gap> S := Monoid([
> PBR([[-2], [-3], [-2]], [[], [13], [2]]),
> PBR([[-2], [-2], [-2]], [[], [123], []])]);
<pbr monoid of degree 3 with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsFpMonoid to IsTransformationMonoid
gap> F := FreeMonoid(2);; AssignGeneratorVariables(F);;
gap> rels := [[m1 * m2, m2], [m2 ^ 2, m2], [m1 ^ 3, m1], [m2 * m1 ^ 2, m2]];;
gap> S := F / rels;
<fp monoid with 2 generators and 4 relations of length 16>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsBipartitionMonoid to IsTransformationMonoid
gap> S := Monoid([
> Bipartition([[13, -2], [2, -3], [-1]]),
> Bipartition([[123, -2], [-1], [-3]])]);
<bipartition monoid of degree 3 with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsTransformationMonoid to IsTransformationMonoid
gap> S := Monoid([
> Transformation([232]), Transformation([222])]);
<transformation monoid of degree 3 with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsBooleanMatMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(IsBooleanMat,
>        [[false, true, false],
>         [false, false, true],
>         [false, true, false]]),
> Matrix(IsBooleanMat,
>        [[false, true, false],
>         [false, true, false],
>         [false, true, false]])]);
<monoid of 3x3 boolean matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsMaxPlusMatrixMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(IsMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, -infinity, 0],
>         [-infinity, 0, -infinity]]),
> Matrix(IsMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, 0, -infinity],
>         [-infinity, 0, -infinity]])]);
<monoid of 3x3 max-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsMinPlusMatrixMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(IsMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, infinity, 0],
>         [infinity, 0, infinity]]),
> Matrix(IsMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, 0, infinity],
>         [infinity, 0, infinity]])]);
<monoid of 3x3 min-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsProjectiveMaxPlusMatrixMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, -infinity, 0],
>         [-infinity, 0, -infinity]]),
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, 0, -infinity],
>         [-infinity, 0, -infinity]])]);
<monoid of 3x3 projective max-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsIntegerMatrixMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(Integers,
>        [[010],
>         [001],
>         [010]]),
> Matrix(Integers,
>        [[010],
>         [010],
>         [010]])]);
<monoid of 3x3 integer matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsTropicalMaxPlusMatrixMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(IsTropicalMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, -infinity, 0],
>         [-infinity, 0, -infinity]], 4),
> Matrix(IsTropicalMaxPlusMatrix,
>        [[-infinity, 0, -infinity],
>         [-infinity, 0, -infinity],
>         [-infinity, 0, -infinity]], 4)]);
<monoid of 3x3 tropical max-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsTropicalMinPlusMatrixMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(IsTropicalMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, infinity, 0],
>         [infinity, 0, infinity]], 5),
> Matrix(IsTropicalMinPlusMatrix,
>        [[infinity, 0, infinity],
>         [infinity, 0, infinity],
>         [infinity, 0, infinity]], 5)]);
<monoid of 3x3 tropical min-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsNTPMatrixMonoid to IsTransformationMonoid
gap> S := Monoid([
> Matrix(IsNTPMatrix,
>        [[010],
>         [001],
>         [010]], 51),
> Matrix(IsNTPMatrix,
>        [[010],
>         [010],
>         [010]], 51)]);
<monoid of 3x3 ntp matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 5, degree 5 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsPBRSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> PBR([[-1], [-2], [-2], [-2], [-2]], [[1], [2345], [], [], []]),
> PBR([[-2], [-1], [-1], [-1], [-1]], [[2345], [1], [], [], []])]);
<pbr semigroup of degree 5 with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsFpSemigroup to IsTransformationMonoid
gap> F := FreeSemigroup(2);; AssignGeneratorVariables(F);;
gap> rels := [[s1 ^ 2, s1], [s1 * s2, s2], [s2 * s1, s2], [s2 ^ 2, s1]];;
gap> S := F / rels;
<fp semigroup with 2 generators and 4 relations of length 14>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsBipartitionSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Bipartition([[1, -1], [2345, -2], [-3], [-4], [-5]]),
> Bipartition([[1, -2], [2345, -1], [-3], [-4], [-5]])]);
<bipartition semigroup of degree 5 with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);;
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsTransformationSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Transformation([12222]), Transformation([21111])]);
<transformation semigroup of degree 5 with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);;
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsBooleanMatSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(IsBooleanMat,
>        [[true, false, false, false, false],
>         [false, true, false, false, false],
>         [false, true, false, false, false],
>         [false, true, false, false, false],
>         [false, true, false, false, false]]),
> Matrix(IsBooleanMat,
>        [[false, true, false, false, false],
>         [true, false, false, false, false],
>         [true, false, false, false, false],
>         [true, false, false, false, false],
>         [true, false, false, false, false]])]);
<semigroup of 5x5 boolean matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsMaxPlusMatrixSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(IsMaxPlusMatrix,
>        [[0, -infinity, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity]]),
> Matrix(IsMaxPlusMatrix,
>        [[-infinity, 0, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity]])]);
<semigroup of 5x5 max-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsMinPlusMatrixSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(IsMinPlusMatrix,
>        [[0, infinity, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity]]),
> Matrix(IsMinPlusMatrix,
>        [[infinity, 0, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity]])]);
<semigroup of 5x5 min-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsProjectiveMaxPlusMatrixSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[0, -infinity, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity]]),
> Matrix(IsProjectiveMaxPlusMatrix,
>        [[-infinity, 0, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity]])]);
<semigroup of 5x5 projective max-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsIntegerMatrixSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(Integers,
>        [[10000],
>         [01000],
>         [01000],
>         [01000],
>         [01000]]),
> Matrix(Integers,
>        [[01000],
>         [10000],
>         [10000],
>         [10000],
>         [10000]])]);
<semigroup of 5x5 integer matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsTropicalMaxPlusMatrixSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(IsTropicalMaxPlusMatrix,
>        [[0, -infinity, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity],
>         [-infinity, 0, -infinity, -infinity, -infinity]], 4),
> Matrix(IsTropicalMaxPlusMatrix,
>        [[-infinity, 0, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity],
>         [0, -infinity, -infinity, -infinity, -infinity]], 4)]);
<semigroup of 5x5 tropical max-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsTropicalMinPlusMatrixSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(IsTropicalMinPlusMatrix,
>        [[0, infinity, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity],
>         [infinity, 0, infinity, infinity, infinity]], 1),
> Matrix(IsTropicalMinPlusMatrix,
>        [[infinity, 0, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity],
>         [0, infinity, infinity, infinity, infinity]], 1)]);
<semigroup of 5x5 tropical min-plus matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsMonoid:
#   convert from IsNTPMatrixSemigroup to IsTransformationMonoid
gap> S := Semigroup([
> Matrix(IsNTPMatrix,
>        [[10000],
>         [01000],
>         [01000],
>         [01000],
>         [01000]], 35),
> Matrix(IsNTPMatrix,
>        [[01000],
>         [10000],
>         [10000],
>         [10000],
>         [10000]], 35)]);
<semigroup of 5x5 ntp matrices with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<commutative transformation monoid of size 2, degree 2 with 1 generator>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from free band to IsTransformationSemigroup
gap> S := FreeBand(2);;
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 6, degree 7 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from perm group  to IsTransformationSemigroup
gap> S := DihedralGroup(IsPermGroup, 6);;
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation group of degree 3 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from non-perm group  to IsTransformationSemigroup
gap> S := DihedralGroup(6);;
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 6, degree 6 with 5 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsBlockBijectionSemigroup to IsTransformationSemigroup
gap> S := InverseSemigroup(Bipartition([[1, -1, -3],
>         [23, -2]]));;
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of size 5, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsBlockBijectionMonoid to IsTransformationMonoid
gap> S := InverseMonoid([
> Bipartition([[1, -1, -3], [23, -2]])]);;
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of size 6, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsBlockBijectionMonoid to IsTransformationSemigroup
gap> S := InverseMonoid([
> Bipartition([[1, -1, -3], [23, -2]])]);;
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of size 6, degree 6 with 2 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsPartialPermSemigroup to IsTransformationSemigroup
gap> S := InverseSemigroup(PartialPerm([12], [21]),
>                          PartialPerm([12], [31]));
<inverse partial perm semigroup of rank 3 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation semigroup of degree 4 with 3 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsPartialPermMonoid to IsTransformationMonoid
gap> S := InverseMonoid(PartialPerm([12], [21]),
>                       PartialPerm([12], [31]));
<inverse partial perm monoid of rank 3 with 2 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of degree 4 with 3 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismMonoid(IsTransformationMonoid, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# AsSemigroup:
#   convert from IsPartialPermMonoid to IsTransformationSemigroup
gap> S := InverseMonoid(PartialPerm([12], [21]),
>                       PartialPerm([12], [31]));
<inverse partial perm monoid of rank 3 with 2 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of degree 4 with 3 generators>
gap> Size(S) = Size(T);
true
gap> NrDClasses(S) = NrDClasses(T);
true
gap> NrRClasses(S) = NrRClasses(T);
true
gap> NrLClasses(S) = NrLClasses(T);
true
gap> NrIdempotents(S) = NrIdempotents(T);
true
gap> map := IsomorphismSemigroup(IsTransformationSemigroup, S);;
gap> BruteForceIsoCheck(map);
true
gap> BruteForceInverseCheck(map);
true

# Size: for a monogenic transformation semigroup, 1
gap> S := MonogenicSemigroup(11);;
gap> Size(S);
1
gap> S := Semigroup(S);;
gap> IsMonogenicSemigroup(S);
true
gap> Size(S);
1

# Size: for a monogenic transformation semigroup, 2
gap> S := MonogenicSemigroup(51);;
gap> Size(S);
5
gap> S := Semigroup(S);;
gap> IsMonogenicSemigroup(S);
true
gap> Size(S);
5

# Size: for a monogenic transformation semigroup, 3
gap> S := MonogenicSemigroup(110);;
gap> Size(S);
10
gap> S := Semigroup(S);;
gap> IsMonogenicSemigroup(S);
true
gap> Size(S);
10

# Size: for a monogenic transformation semigroup, 4
gap> S := MonogenicSemigroup(711);;
gap> Size(S);
17
gap> S := Semigroup(S);;
gap> IsMonogenicSemigroup(S);
true
gap> Size(S);
17

# Size: for a monogenic transformation monoid, 1
gap> S := MonogenicSemigroup(11);;
gap> S := Monoid(S);;
gap> IsMonogenicMonoid(S);
true
gap> Size(S);
1

# Size: for a monogenic transformation monoid, 2
gap> S := MonogenicSemigroup(51);;
gap> S := Monoid(S);;
gap> IsMonogenicMonoid(S);
true
gap> Size(S);
6

# Size: for a monogenic transformation semigroup, 3
gap> S := MonogenicSemigroup(110);;
gap> S := Monoid(S);;
gap> IsMonogenicMonoid(S);
true
gap> Size(S);
10

# Size: for a monogenic transformation semigroup, 4
gap> S := MonogenicSemigroup(711);;
gap> S := Monoid(S);;
gap> IsMonogenicMonoid(S);
true
gap> Size(S);
18

# Size: for a monogenic transformation semigroup, 4
gap> S := Monoid(Transformation([231]));;
gap> IsMonogenicMonoid(S);
true
gap> Size(S);
3
gap> S := Monoid(Transformation([2311]));;
gap> IsMonogenicMonoid(S);
true
gap> Size(S);
4

# Test LargestElementSemigroup
gap> gr := Digraph([[234578910], [356710189],
> [145627810], [1389], [37812],
> [372810], [23610158], [1235671049],
> [128410], [1368927]]);;
gap> S := EndomorphismMonoid(gr);;
gap> LargestElementSemigroup(S) = Maximum(AsSet(S));
true
gap> LargestElementSemigroup(S);
Transformation( [ 108786103291 ] )

# RepresentativeOfMinimalIdeal: for a transformation semigroup on many points
gap> x := ListWithIdenticalEntries(499991);;
gap> Add(x, 2);
gap> x := Transformation(x);;
gap> S := Semigroup(x);
<commutative transformation semigroup of degree 50000 with 1 generator>
gap> RepresentativeOfMinimalIdeal(S);
<transformation on 50000 pts with rank 1>
gap> x := ListWithIdenticalEntries(991);;
gap> Add(x, 2);
gap> x := Transformation(x);;
gap> S := Semigroup(x);
<commutative transformation semigroup of degree 100 with 1 generator>
gap> Size(S);
2
gap> RepresentativeOfMinimalIdeal(S);
<transformation on 100 pts with rank 1>

# RepresentativeOfMinimalIdeal: for a transformation group
gap> S := Semigroup([
> Transformation([14141]),
> Transformation([41414])]);;
gap> RepresentativeOfMinimalIdeal(S);
Transformation( [ 41414 ] )
gap> S := Semigroup([
> Transformation([23451]),
> Transformation([21])]);;
gap> RepresentativeOfMinimalIdeal(S);
Transformation( [ 13452 ] )

# Test RandomSemigroup
gap> RandomSemigroup(IsTransformationSemigroup);;
gap> RandomSemigroup(IsTransformationSemigroup, 2);;
gap> RandomSemigroup(IsTransformationSemigroup, 22);;
gap> RandomSemigroup(IsTransformationSemigroup, "a");;
Error, the 2nd argument (number of generators) must be a pos int
gap> RandomSemigroup(IsTransformationSemigroup, 2, "a");;
Error, the 3rd argument (degree or dimension) must be a pos int
gap> RandomMonoid(IsTransformationMonoid);;
gap> RandomMonoid(IsTransformationMonoid, 2);;
gap> RandomMonoid(IsTransformationMonoid, 22);;
gap> RandomMonoid(IsTransformationMonoid, "a");;
Error, the 2nd argument (number of generators) must be a pos int
gap> RandomMonoid(IsTransformationMonoid, 2, "a");;
Error, the 3rd argument (degree or dimension) must be a pos int

# Test IsConnectedTransformationSemigroup
gap> S := Semigroup(Transformation([12333]),
> Transformation([11333]));;
gap> IsConnectedTransformationSemigroup(S);
false
gap> S := DirectProduct(S, S);;
gap> IsConnectedTransformationSemigroup(S);
false
gap> S := FullTransformationMonoid(3);;
gap> IsConnectedTransformationSemigroup(S);
true

#
gap> S := Semigroup(Transformation([12333]),
>                   Transformation([11333]));;
gap> IsTransitive(S);
false
gap> IsTransitive(S, 1);
true
gap> IsTransitive(S, 2);
false
gap> S := FullTransformationMonoid(3);;
gap> IsTransitive(S, 1);
true
gap> IsTransitive(S, 2);
true
gap> IsTransitive(S, 3);
true
gap> IsTransitive(S, 4);
false
gap> IsTransitive(S, [1 .. 3]);
true
gap> IsTransitive(S, [1 .. 5]);
false
gap> IsTransitive(S, [13]);
false
gap> IsTransitive(S, [31]);
Error, the 2nd argument (a list) must be a set of positive integers

# Test Idempotents with specified ranks
gap> S := Semigroup(FullTransformationMonoid(3), rec(acting := false));;
gap> Set(Idempotents(S, 0));
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `Idempotents' on 2 arguments
gap> Set(Idempotents(S, 1));
[ Transformation( [ 111 ] ), Transformation( [ 222 ] ), 
  Transformation( [ 333 ] ) ]
gap> Set(Idempotents(S, 2));
[ Transformation( [ 11 ] ), Transformation( [ 121 ] ), 
  Transformation( [ 122 ] ), Transformation( [ 133 ] ), 
  Transformation( [ 22 ] ), Transformation( [ 323 ] ) ]
gap> Set(Idempotents(S, 3));
[ IdentityTransformation ]
gap> Set(Idempotents(S, 4));
[  ]

# Test IteratorSorted
gap> S1 := Semigroup(FullTransformationMonoid(3), rec(acting := false));;
gap> S2 := Semigroup(FullTransformationMonoid(3), rec(acting := true));;
gap> iter1 := IteratorSorted(S1);;
gap> iter2 := IteratorSorted(S2);;
gap> for x in iter1 do
> if x <> NextIterator(iter2) then
> Print("Problem in IteratorSorted\n");
> fi;
> od;
gap> S1 := Semigroup(FullTransformationMonoid(3), rec(acting := false));;
gap> S2 := Semigroup(FullTransformationMonoid(3), rec(acting := true));;
gap> AsSet(S2);;
gap> iter1 := IteratorSorted(S1);;
gap> iter2 := IteratorSorted(S2);;
gap> for x in iter1 do
> if x <> NextIterator(iter2) then
> Print("Problem in IteratorSorted\n");
> fi;
> od;

# Test \< for transformation semigroups
gap> coll := [Semigroup([
>      Transformation([22243]),
>      Transformation([52215])]),
>  Semigroup([
>      Transformation([44312]),
>      Transformation([41424])]),
>  Semigroup([
>      Transformation([35151]),
>      Transformation([45553])])];;
gap> IsSet(coll);
false
gap> Sort(coll);
gap> coll[1] < coll[1];
false
gap> S := Semigroup(coll[1], Transformation([666666]));;
gap> coll[1] < S;
true
gap> S < coll[1];
false
gap> S := Semigroup(AsTransformation((234)));;
gap> T := Semigroup(S, Transformation([2222]));;
gap> S < T;
true
gap> T < S;
false

# Test Smallest/LargestElementSemigroup
gap> S := Semigroup(AsTransformation((234)),
>                   Transformation([2222]));;
gap> SmallestElementSemigroup(S);
IdentityTransformation
gap> LargestElementSemigroup(S);
Transformation( [ 4444 ] )
gap> S := Semigroup(IdentityTransformation);;
gap> SmallestElementSemigroup(S);
IdentityTransformation
gap> LargestElementSemigroup(S);
IdentityTransformation
gap> S := Semigroup(FullTransformationMonoid(3));;
gap> SmallestElementSemigroup(S);
Transformation( [ 111 ] )
gap> LargestElementSemigroup(S);
Transformation( [ 333 ] )
gap> S := Semigroup(AsTransformation((234)),
>                   Transformation([2222]));;
gap> AsSet(S);;
gap> SmallestElementSemigroup(S);
IdentityTransformation
gap> LargestElementSemigroup(S);
Transformation( [ 4444 ] )
gap> S := Semigroup(AsTransformation((234)),
>                   Transformation([2222]));;
gap> EnumeratorSorted(S);;
gap> SmallestElementSemigroup(S);
IdentityTransformation
gap> LargestElementSemigroup(S);
Transformation( [ 4444 ] )

# Test IsomorphismTransformationSemigroup for an ideal
gap> S := FullTransformationMonoid(3);
<full transformation monoid of degree 3>
gap> x := MinimalIdeal(S);
<simple transformation semigroup ideal of degree 3 with 1 generator>
gap> map := IsomorphismTransformationSemigroup(x);;
gap> x := Range(map);;
gap> IsSimpleSemigroup(x);
true
gap> Size(x) = 3;
true
gap> x;
<simple transformation semigroup ideal of size 3, degree 3 with 1 generator>
gap> BruteForceInverseCheck(map);
true
gap> BruteForceIsoCheck(map);
true

# Test GroupOfUnits
gap> S := FullTransformationMonoid(3);;
gap> GroupOfUnits(S);
<transformation group of degree 3 with 2 generators>
gap> S := SingularTransformationMonoid(3);;
gap> GroupOfUnits(S);
fail

# Test ComponentRepsOfTransformationSemigroup
gap> S := FullTransformationMonoid(3);;
gap> S := DirectProduct(S, S, S, S);;
gap> ComponentRepsOfTransformationSemigroup(S);
14710 ]
gap> ComponentsOfTransformationSemigroup(S);
[ [ 123 ], [ 456 ], [ 789 ], [ 101112 ] ]
gap> CyclesOfTransformationSemigroup(S);
[ [ 123 ], [ 456 ], [ 789 ], [ 101112 ] ]
gap> S := SemigroupIdeal(S, S.1);;
gap> ComponentsOfTransformationSemigroup(S);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `DigraphOfActionOnPoints' on 1 arguments
gap> CyclesOfTransformationSemigroup(S);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `DigraphOfActionOnPoints' on 1 arguments

# Test IsomorphismSemigroup for a semigroup of binary relations on points
gap> B := Monoid(BinaryRelationOnPoints([[2], [12], [13]]),
>                BinaryRelationOnPoints([[3], [12], [13]]),
>                BinaryRelationOnPoints([[123], [12], [3]]));;
gap> Size(B);
16
gap> IsMonoid(B);
true
gap> iso := IsomorphismTransformationSemigroup(B);;
gap> T := Range(iso);
<transformation monoid of degree 6 with 3 generators>
gap> Size(T);
16
gap> IsMonoid(T);
true
gap> BruteForceIsoCheck(iso);
true
gap> BruteForceInverseCheck(iso);
true

# IsomorphismTransformationSemigroup for an fp monoid
gap> F := FreeMonoid(2);;
gap> M := F / [[F.1 * F.2 ^ 2, F.2 ^ 2],
>              [F.2 ^ 3, F.2 ^ 2],
>              [F.1 ^ 4, F.1],
>              [F.2 * F.1 ^ 2 * F.2, F.2 ^ 2],
>              [F.2 * F.1 ^ 3 * F.2, F.2],
>              [(F.2 * F.1) ^ 2 * F.2, F.2],
>              [F.2 ^ 2 * F.1 ^ 3, F.2 ^ 2],
>              [F.2 * (F.2 * F.1) ^ 2, F.2 ^ 2 * F.1 ^ 2]];;
gap> Size(M);
40
gap> iso := IsomorphismTransformationSemigroup(M);;
gap> T := Range(iso);;
gap> IsTransformationSemigroup(T);
true
gap> IsMonoid(T);
true
gap> Size(T);
40
gap> Size(M);
40

# Test DigraphOfAction
gap> D := DigraphOfAction(FullTransformationMonoid(1), [[1]], OnSets);
<immutable digraph with 1 vertex, 1 edge>
gap> D := DigraphOfAction(FullTransformationMonoid(1), [1], OnPoints);
<immutable digraph with 1 vertex, 1 edge>
gap> D := DigraphOfAction(FullTransformationMonoid(1), [1 .. 3], OnPoints);
<immutable digraph with 3 vertices, 3 edges>
gap> D := DigraphOfAction(FullTransformationMonoid(1), [1 .. 2], OnPoints);
<immutable digraph with 2 vertices, 2 edges>
gap> D := DigraphOfAction(FullTransformationMonoid(1), [], OnRight);
<immutable empty digraph with 0 vertices>
gap> IsEmptyDigraph(D);
true
gap> S := FullTransformationMonoid(4);
<full transformation monoid of degree 4>
gap> list := Concatenation(List([1 .. 4], x -> [x]),
>                          Combinations([1 .. 4], 2));
[ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 12 ], [ 13 ], [ 14 ], [ 23 ], 
  [ 24 ], [ 34 ] ]
gap> D := DigraphOfAction(S, list, OnSets);
<immutable digraph with 10 vertices, 28 edges>
gap> OutNeighbours(D);
[ [ 12 ], [ 231 ], [ 34 ], [ 41 ], [ 58 ], [ 698 ], 
  [ 7591 ], [ 8106 ], [ 9675 ], [ 1076 ] ]
gap> DigraphVertexLabels(D);
[ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 12 ], [ 13 ], [ 14 ], [ 23 ], 
  [ 24 ], [ 34 ] ]
gap> DigraphEdgeLabels(D);
[ [ 12 ], [ 123 ], [ 12 ], [ 12 ], [ 12 ], [ 123 ], 
  [ 1234 ], [ 123 ], [ 1234 ], [ 124 ] ]

# Iterator, for a full transformation monoid
gap> S := FullTransformationMonoid(4);;
gap> y := Iterator(S);
<iterator of semigroup>
gap> for x in y do od;
gap> S := FullTransformationMonoid(4);; Elements(S);;
gap> y := Iterator(S);
<iterator>
gap> for x in y do od;
gap> S := FullTransformationMonoid(3);;
gap> TestIterator(S, Iterator(S));
true

# Tests wreath product of transf. semgp. and perm. group
gap> T := FullTransformationMonoid(3);;
gap> C := Group((13));;
gap> TC := WreathProduct(T, C);;
gap> Size(TC) = 39366;
true
gap> CC := AsMonoid(IsTransformationMonoid, C);;
gap> DP := DirectProduct(T, CC);;
gap> IsSubsemigroup(TC, DP);
true
gap> C := Group((12));;
gap> TC := WreathProduct(T, C);;
gap> CC := AsMonoid(IsTransformationMonoid, C);;
gap> DP := DirectProduct(T, CC);;
gap> IsSubsemigroup(TC, DP);
true

# Test wreath product of perm. group and transf. semgp.
gap> W := WreathProduct(Group((12)), FullTransformationMonoid(3));;
gap> Size(W);
216
gap> Transformation([561234]) in W;
true
gap> Transformation([551234]) in W;
false

# Tests wreath product of a monoid not satisfying IsTransformationMonoid
gap> S := Semigroup(Transformation([12333]));;
gap> C := Group((12));;
gap> WW := WreathProduct(C, S);;
gap> Size(WW);
32
gap> Transformation([2143656565]) in WW;
true
gap> Transformation([2143656578]) in WW;
false

# WreathProduct bad input
gap> WreathProduct(FullTransformationMonoid(2),
> SingularTransformationMonoid(2));
Error, the 2nd argument (a transformation semigroup) should be a monoid (as se\
migroup)

# DigraphCore
gap> D := CompleteBipartiteDigraph(44);;
gap> GeneratorsOfEndomorphismMonoid(D);;
gap> IsIsomorphicDigraph(CompleteDigraph(2),
>    InducedSubdigraph(D, DigraphCore(D)));
true
gap> D := CycleDigraph(10);
<immutable cycle digraph with 10 vertices>
gap> GeneratorsOfEndomorphismMonoid(D);;
gap> DigraphCore(D);
12345678910 ]

# IsomorphismTransformationSemigroup
gap> S := FullTransformationMonoid(2);
<full transformation monoid of degree 2>
gap> map := IsomorphismTransformationSemigroup(S);;
gap> ForAll(S, x -> x ^ map = x);
true
gap> IsomorphismTransformationSemigroup(GraphInverseSemigroup(CycleDigraph(2)));
Error, the argument (a semigroup) is not finite
gap> F := FreeMonoid(2);
<free monoid on the generators [ m1, m2 ]>
gap> R := [[F.1 ^ 2, F.1]];
[ [ m1^2, m1 ] ]
gap> IsomorphismTransformationSemigroup(F / R);
Error, the argument (a semigroup) is not finite
gap> IsomorphismTransformationSemigroup(MinimalIdeal(FreeBand(2)));
<simple semigroup ideal of size 4, with 1 generator> -> 
<transformation semigroup of size 4, degree 5 with 3 generators>

#
gap> SEMIGROUPS.StopTest();
gap> STOP_TEST("Semigroups package: standard/semigroups/semitrans.tst");

[Dauer der Verarbeitung: 0.26 Sekunden, vorverarbeitet 2026-06-17]