diff --git a/doc/translat.xml b/doc/translat.xml index 4b03d82af..5b4dc1908 100644 --- a/doc/translat.xml +++ b/doc/translat.xml @@ -47,7 +47,7 @@ gap> GeneratorsOfSemigroup(L); canonical list of elements of the underlying semigroup, LeftTranslation and RightTranslation return the corresponding translations. S := RectangularBand(3,4);; +gap> S := RectangularBand(3, 4);; gap> L := LeftTranslationsSemigroup(S);; gap> s := AsList(S)[1];; gap> f := function(x) @@ -57,7 +57,7 @@ gap> map := MappingByFunction(S, S, f);; gap> l := LeftTranslation(L, map); > -gap> s^l; +gap> s ^ l; Transformation( [ 1, 2, 1, 1, 5, 5, 5, 5 ] ) ]]> @@ -103,10 +103,10 @@ gap> Size(H); (l, r) of translations, belonging to the translational hull H. G := SmallGroup(4,2);; +gap> G := SmallGroup(4, 2);; gap> A := AsList(G);; -gap> mat := [ [A[1], 0], -> [A[2], A[2]] ];; +gap> mat := [[A[1], 0], +> [A[2], A[2]]];; gap> S := ReesZeroMatrixSemigroup(G, mat);; gap> L := LeftTranslationsSemigroup(S);; gap> R := RightTranslationsSemigroup(S);; @@ -133,7 +133,7 @@ gap> x := Bitranslation(H, l, r); of IsTranslationsSemigroupElement, which itself is a subcategory of IsAssociativeElement. S := RectangularBand(3,4);; +gap> S := RectangularBand(3, 4);; gap> l := Representative(LeftTranslations(S)); > @@ -156,9 +156,9 @@ false belong to IsBitranslation. This is a subcategory of . G := SmallGroup(4,2);; +gap> G := SmallGroup(4, 2);; gap> A := AsList(G);; -gap> mat := [ [A[1], 0, A[1]], +gap> mat := [[A[1], 0, A[1]], > [A[2], A[2], A[4]]];; gap> S := ReesZeroMatrixSemigroup(G, mat);; gap> L := LeftTranslations(S);; @@ -186,7 +186,7 @@ false IsXTranslationsSemigroupElementCollection and IsSemigroup. S := RectangularBand(3,4);; +gap> S := RectangularBand(3, 4);; gap> L := LeftTranslations(S);; gap> R := RightTranslations(S);; gap> IsLeftTranslationsSemigroup(L); @@ -207,7 +207,7 @@ false IsTranslationalHull is a synonym for IsSemigroup and S := RectangularBand(3,3);; +gap> S := RectangularBand(3, 3);; gap> H := TranslationalHull(S);; gap> L := LeftTranslationsSemigroup(S);; gap> IsTranslationalHull(H); @@ -249,7 +249,7 @@ true XTranslationsSemigroupOfFamily(fam) returns the left or right translations semigroup which contains the objects of family fam S := RectangularBand(3,3);; +gap> S := RectangularBand(3, 3);; gap> L := LeftTranslations(S);; gap> l := Representative(L);; gap> LeftTranslationsSemigroupOfFamily(FamilyObj(l)) = L; @@ -269,7 +269,7 @@ true TranslationalHullOfFamily(fam) returns the translational hull which contains the objects of family fam S := RectangularBand(3,3);; +gap> S := RectangularBand(3, 3);; gap> H := TranslationalHull(S);; gap> h := Representative(H);; gap> TranslationalHullOfFamily(FamilyObj(h)) = H; @@ -293,8 +293,8 @@ true of S. These are the translations defined by right multiplication by a fixed element of S. S := Semigroup([Transformation([2,2,3,1]), -> Transformation([1,4,3,3])]);; +gap> S := Semigroup([Transformation([2, 2, 3, 1]), +> Transformation([1, 4, 3, 3])]);; gap> L := InnerLeftTranslations(S); with 2 generators> @@ -321,8 +321,8 @@ true right translations defined respectively by left multiplication and right multiplication by the same fixed element of S. S := Semigroup([Transformation([2,2,3,1]), -> Transformation([1,4,3,3])]);; +gap> S := Semigroup([Transformation([2, 2, 3, 1]), +> Transformation([1, 4, 3, 3])]);; gap> InnerTranslationalHull(S); > @@ -338,13 +338,13 @@ gap> InnerTranslationalHull(S); The left or right translation component of x. - For a bitranslation b consisting of a linked pair (l, r),i + For a bitranslation b consisting of a linked pair (l, r), LeftPartOfBitranslationb returns the left translation l, and RightPartOfBitranslationb returns the right translation r. S := Semigroup([Transformation([4,2,3,3]), -> Transformation([2,2,3,1])]); +gap> S := Semigroup([Transformation([4, 2, 3, 3]), +> Transformation([2, 2, 3, 1])]); gap> H := TranslationalHull(S);; gap> h := AsList(H)[2];; @@ -400,7 +400,7 @@ gap> S := ReesMatrixSemigroup(G, mat);; gap> R := Range(RMSNormalization(S));; gap> L := LeftTranslations(R);; gap> RT := RightTranslations(R);; -gap> gpfunc := [G.1, G.2*G.1]; +gap> gpfunc := [G.1, G.2 * G.1]; [ f1, f1*f2 ] gap> t := IdentityTransformation;; gap> l := LeftTranslationOfNormalRMS(L, gpfunc, t); @@ -433,10 +433,10 @@ gap> G := UnderlyingSemigroup(R); gap> L := LeftTranslations(R);; gap> RT := RightTranslations(R);; gap> H := TranslationalHull(R);; -gap> lgpfunc := [G.1*G.3*G.3, G.2];; -gap> rgpfunc := [G.1*G.3*G.3, G.3*G.3, G.2];; -gap> lt := Transformation([2,2]);; -gap> rt := Transformation([3,3,3]);; +gap> lgpfunc := [G.1 * G.3 * G.3, G.2];; +gap> rgpfunc := [G.1 * G.3 * G.3, G.3 * G.3, G.2];; +gap> lt := Transformation([2, 2]);; +gap> rt := Transformation([3, 3, 3]);; gap> l := LeftTranslationOfNormalRMS(L, lgpfunc, lt);; gap> r := RightTranslationOfNormalRMS(RT, rgpfunc, rt);; gap> h := BitranslationOfNormalRMS(H, l, r); diff --git a/gap/attributes/rms-translat.gd b/gap/attributes/rms-translat.gd index a0e9afb0d..a9dea2739 100644 --- a/gap/attributes/rms-translat.gd +++ b/gap/attributes/rms-translat.gd @@ -11,10 +11,10 @@ DeclareCategory("IsTranslationOfNormalRMS", IsTranslationsSemigroupElement); DeclareCategory("IsLeftTranslationOfNormalRMS", - IsTranslationOfNormalRMS and + IsTranslationOfNormalRMS and IsLeftTranslationsSemigroupElement); DeclareCategory("IsRightTranslationOfNormalRMS", - IsTranslationOfNormalRMS and + IsTranslationOfNormalRMS and IsRightTranslationsSemigroupElement); DeclareCategory("IsBitranslationOfNormalRMS", IsBitranslation); diff --git a/gap/attributes/rms-translat.gi b/gap/attributes/rms-translat.gi index 6c755d648..e3c7fb9ed 100644 --- a/gap/attributes/rms-translat.gi +++ b/gap/attributes/rms-translat.gi @@ -8,18 +8,18 @@ ############################################################################# ## ############################################################################# -## This file contains special methods for translations semigroups and +## This file contains special methods for translations semigroups and ## translational hulls of completely simple and 0-simple semigroups. -## -## These methods are based on the constructions given in -## Petrich, M. (1968) +## +## These methods are based on the constructions given in +## Petrich, M. (1968) ## ‘The translational hull of a completely 0-simple semigroup’, -## Glasgow Mathematical Journal, 9(01), p. 1. +## Glasgow Mathematical Journal, 9(01), p. 1. ## doi: 10.1017/s0017089500000239 ## -## A.H Clifford, Mario Petrich, (1977) -## Some classes of completely regular semigroups, -## Journal of Algebra, Volume 46, Issue 2, 1977, Pages 462-480, +## A.H Clifford, Mario Petrich, (1977) +## Some classes of completely regular semigroups, +## Journal of Algebra, Volume 46, Issue 2, 1977, Pages 462-480, ## http://dx.doi.org/10.1016/0021-8693(77)90383-0. ############################################################################# # TODO: make sure you can't mix translations of different types in one semigroup @@ -29,12 +29,12 @@ # Just get generators InstallMethod(LeftTranslations, "for a RZMS semigroup", [IsEnumerableSemigroupRep and IsFinite and IsZeroSimpleSemigroup], -function(S) +function(S) local L; - + L := LeftTranslationsSemigroup(S); GeneratorsOfSemigroup(L); - + return L; end); @@ -42,12 +42,12 @@ end); # Just get generators InstallMethod(RightTranslations, "for a RZMS semigroup", [IsEnumerableSemigroupRep and IsFinite and IsZeroSimpleSemigroup], -function(S) +function(S) local R; - + R := RightTranslationsSemigroup(S); GeneratorsOfSemigroup(R); - + return R; end); @@ -55,12 +55,12 @@ end); # Just get generators InstallMethod(LeftTranslations, "for a RMS semigroup", [IsEnumerableSemigroupRep and IsFinite and IsSimpleSemigroup], -function(S) +function(S) local L; - + L := LeftTranslationsSemigroup(S); GeneratorsOfSemigroup(L); - + return L; end); @@ -68,28 +68,29 @@ end); # Just get generators InstallMethod(RightTranslations, "for a RMS semigroup", [IsEnumerableSemigroupRep and IsFinite and IsSimpleSemigroup], -function(S) +function(S) local R; - + R := RightTranslationsSemigroup(S); GeneratorsOfSemigroup(R); - + return R; end); # The generators are generators of partial transformation monoid to act on the # index sets, together with functions to the generators of the group. -InstallMethod(GeneratorsOfSemigroup, "for the semigroup of left/right translations of a finite 0-simple semigroup", +InstallMethod(GeneratorsOfSemigroup, +"for the semigroup of left/right translations of a finite 0-simple semigroup", [IsTranslationsSemigroup and IsWholeFamily], function(T) local S, L, n, iso, inv, reesMatSemi, semiList, gens, t, f, groupGens, - e, a, fa, G, zero; - + a, fa, G, zero; + S := UnderlyingSemigroup(T); if not (IsZeroSimpleSemigroup(S) and IsFinite(S)) then TryNextMethod(); fi; - + semiList := AsList(S); iso := IsomorphismReesZeroMatrixSemigroup(S); inv := InverseGeneralMapping(iso); @@ -101,11 +102,11 @@ function(T) else n := Length(Columns(reesMatSemi)); fi; - + gens := []; G := UnderlyingSemigroup(reesMatSemi); groupGens := GeneratorsOfGroup(G); - + #It would be safer (and more correct) to use GeneratorsOfSemigroup here #but the semigroup generated is the same in either case, #from fewer generators is this case. @@ -115,51 +116,51 @@ function(T) for t in GeneratorsOfMonoid(PartialTransformationMonoid(n)) do if L then f := function(x) - if (x = zero or x[1]^t = n+1) then + if (x = zero or x[1] ^ t = n + 1) then return zero; fi; - return ReesMatrixSemigroupElement(reesMatSemi, x[1]^t, + return ReesMatrixSemigroupElement(reesMatSemi, x[1] ^ t, x[2], x[3]); end; Add(gens, LeftTranslation(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); else f := function(x) - if (x = zero or x[3]^t = n+1) then + if (x = zero or x[3] ^ t = n + 1) then return zero; fi; - return ReesMatrixSemigroupElement(reesMatSemi, x[1], - x[2], x[3]^t); + return ReesMatrixSemigroupElement(reesMatSemi, x[1], + x[2], x[3] ^ t); end; Add(gens, RightTranslation(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); fi; od; - + for a in groupGens do fa := function(x) if x = 1 then return a; - fi; + fi; return MultiplicativeNeutralElement(G); end; if L then f := function(x) - if x = zero then + if x = zero then return zero; fi; - return ReesMatrixSemigroupElement(reesMatSemi, x[1], - fa(x[1])*x[2], x[3]); + return ReesMatrixSemigroupElement(reesMatSemi, x[1], + fa(x[1]) * x[2], x[3]); end; Add(gens, LeftTranslationNC(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); else f := function(x) - if x = zero then + if x = zero then return zero; fi; - return ReesMatrixSemigroupElement(reesMatSemi, x[1], - x[2]*fa(x[3]), x[3]); + return ReesMatrixSemigroupElement(reesMatSemi, x[1], + x[2] * fa(x[3]), x[3]); end; Add(gens, RightTranslationNC(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); @@ -168,20 +169,20 @@ function(T) return gens; end); - # The generators are generators of a full transformation monoid to act on the # index sets, together with functions to the generators of the group. -InstallMethod(GeneratorsOfSemigroup, "for the semigroup of left/right translations of a finite 0-simple semigroup", +InstallMethod(GeneratorsOfSemigroup, +"for the semigroup of left/right translations of a finite 0-simple semigroup", [IsTranslationsSemigroup and IsWholeFamily], function(T) local S, L, n, iso, inv, reesMatSemi, semiList, gens, t, f, groupGens, - e, a, fa, G; - + a, fa, G; + S := UnderlyingSemigroup(T); if not (IsSimpleSemigroup(S) and IsFinite(S)) then TryNextMethod(); fi; - + semiList := AsList(S); iso := IsomorphismReesMatrixSemigroup(S); inv := InverseGeneralMapping(iso); @@ -192,11 +193,11 @@ function(T) else n := Length(Columns(reesMatSemi)); fi; - + gens := []; G := UnderlyingSemigroup(reesMatSemi); groupGens := GeneratorsOfGroup(G); - + #It would be safer (and more correct) to use GeneratorsOfSemigroup here #but the semigroup generated is the same in either case, #from fewer generators is this case. @@ -206,39 +207,39 @@ function(T) for t in GeneratorsOfMonoid(FullTransformationMonoid(n)) do if L then f := function(x) - return ReesMatrixSemigroupElement(reesMatSemi, x[1]^t, + return ReesMatrixSemigroupElement(reesMatSemi, x[1] ^ t, x[2], x[3]); end; Add(gens, LeftTranslation(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); else f := function(x) - return ReesMatrixSemigroupElement(reesMatSemi, x[1], - x[2], x[3]^t); + return ReesMatrixSemigroupElement(reesMatSemi, x[1], + x[2], x[3] ^ t); end; Add(gens, RightTranslation(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); fi; od; - + for a in groupGens do fa := function(x) if x = 1 then return a; - fi; + fi; return MultiplicativeNeutralElement(G); end; if L then f := function(x) - return ReesMatrixSemigroupElement(reesMatSemi, x[1], - fa(x[1])*x[2], x[3]); + return ReesMatrixSemigroupElement(reesMatSemi, x[1], + fa(x[1]) * x[2], x[3]); end; Add(gens, LeftTranslationNC(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); else f := function(x) - return ReesMatrixSemigroupElement(reesMatSemi, x[1], - x[2]*fa(x[3]), x[3]); + return ReesMatrixSemigroupElement(reesMatSemi, x[1], + x[2] * fa(x[3]), x[3]); end; Add(gens, RightTranslationNC(T, CompositionMapping( inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); @@ -247,7 +248,8 @@ function(T) return gens; end); -InstallMethod(Size, "for the semigroup of left or right translations of a completely 0-simple semigroup", +InstallMethod(Size, +"for the semigroup of translations of a completely 0-simple semigroup", [IsTranslationsSemigroup and IsWholeFamily], 1, function(T) local S, G, reesMatSemi, n; @@ -262,10 +264,11 @@ function(T) else n := Length(Columns(reesMatSemi)); fi; - return (n * Size(G) + 1)^n; + return (n * Size(G) + 1) ^ n; end); -InstallMethod(Size, "for the semigroup of left or right translations of a completely 0-simple semigroup", +InstallMethod(Size, +"for the semigroup of translations of a completely simple semigroup", [IsTranslationsSemigroup and IsWholeFamily], 1, function(T) local S, G, reesMatSemi, n; @@ -280,7 +283,7 @@ function(T) else n := Length(Columns(reesMatSemi)); fi; - return n^n * Size(G)^n; + return n ^ n * Size(G) ^ n; end); # Finds the transformations on the indices of a finite 0-simple semigroup @@ -289,7 +292,7 @@ end); # TODO: swap rows/columns if more convenient. SEMIGROUPS.FindTranslationTransformations := function(S) local iso, reesMatSemi, mat, simpleRows, simpleColumns, nrRows, nrCols, - transList, partColumns, partColumn, pc, linkedTransList, col, cols, + transList, partColumns, partColumn, pc, linkedTransList, col, cols, possibleCols, t, q, w, c, x, k, v, f, i, j, isPartialSuccess, extend, reject, bt; iso := IsomorphismReesZeroMatrixSemigroup(S); @@ -299,8 +302,8 @@ SEMIGROUPS.FindTranslationTransformations := function(S) nrRows := Length(simpleRows); nrCols := Length(simpleRows[1]); transList := []; - for i in [1..Length(simpleRows)] do - for j in [1..Length(simpleRows[i])] do + for i in [1 .. Length(simpleRows)] do + for j in [1 .. Length(simpleRows[i])] do if simpleRows[i][j] <> 0 then simpleRows[i][j] := 1; fi; @@ -308,20 +311,20 @@ SEMIGROUPS.FindTranslationTransformations := function(S) od; #TODO: just use transpose simpleColumns := []; - for i in [1..Length(simpleRows[1])] do + for i in [1 .. Length(simpleRows[1])] do c := []; - for j in [1..Length(simpleRows)] do + for j in [1 .. Length(simpleRows)] do c[j] := simpleRows[j][i]; od; Add(simpleColumns, c); od; - + #TODO: keep track of the partial columns in the extend/reject functions isPartialSuccess := function(x) partColumns := []; - for i in [1..Length(simpleRows[1])] do + for i in [1 .. Length(simpleRows[1])] do partColumn := []; - for j in [1..Length(x)] do + for j in [1 .. Length(x)] do if x[j] = nrRows + 1 then #treat rows not in the domain like a row of zeros partColumn[j] := 0; @@ -331,23 +334,24 @@ SEMIGROUPS.FindTranslationTransformations := function(S) od; Add(partColumns, partColumn); od; - + for pc in partColumns do #Only check the columns which contain a 1 since #all-zero column can be made by column not in domain of transformation. #No ones in one partial matrix but not in the other... - if 1 in pc and ForAll(simpleColumns, c -> 1 in c{[1..Length(pc)]} + pc) then + if 1 in pc and + ForAll(simpleColumns, c -> 1 in c{[1 .. Length(pc)]} + pc) then return false; fi; od; return true; end; - + extend := function(w) Add(w, 1); return w; end; - + reject := function(q) q := ShallowCopy(q); k := Length(q); @@ -359,28 +363,28 @@ SEMIGROUPS.FindTranslationTransformations := function(S) fi; return q; end; - + bt := function(x) if x = 0 then return 0; fi; if not isPartialSuccess(x) then - x := reject(x); + x := reject(x); elif Length(x) = nrRows then return x; - else + else x := extend(x); fi; return bt(x); end; - + v := 1; transList := [bt([1])]; while transList[v] <> 0 do v := v + 1; - transList[v] := bt(reject(transList[v-1])); + transList[v] := bt(reject(transList[v - 1])); od; - + linkedTransList := []; # Given each row transformation, look for matching column transformations. # Last element of transList will be 0, ignore. @@ -392,36 +396,37 @@ SEMIGROUPS.FindTranslationTransformations := function(S) for j in [1 .. nrRows] do if t[j] = nrRows + 1 then col[j] := 0; - else + else col[j] := simpleRows[t[j]][i]; fi; od; Add(cols, col); od; possibleCols := []; - for i in [1..nrCols] do + for i in [1 .. nrCols] do possibleCols[i] := []; - for j in [1..nrCols] do + for j in [1 .. nrCols] do if not 1 in cols[i] + simpleColumns[j] then Add(possibleCols[i], j); fi; - if not 1 in cols[i] then - Add(possibleCols[i], nrCols+1); + if not 1 in cols[i] then + Add(possibleCols[i], nrCols + 1); fi; od; od; linkedTransList[k] := IteratorOfCartesianProduct(possibleCols); od; - + return [transList{[1 .. Length(transList) - 1]}, linkedTransList]; end; -# For a pair of transformations on the indices of a completely 0-simple semigroup -# determine the functions to the group associated with the RMS representation -# which will form translations when combined with the transformations. -# Connected components here means points in the domains which are related -# through the linked pair condition given by Petrich. -SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponents) +# For a pair of transformations on the indices of a completely 0-simple +# semigroup, determine the functions to the group associated with the RMS +# representation which will form translations when combined with the +# transformations. Connected components here means points in the domains which +# are related through the linked pair condition given by Petrich. +SEMIGROUPS.FindTranslationFunctionsToGroup := +function(S, t1, t2, failedcomponents) local reesmatsemi, mat, gplist, gpsize, nrrows, nrcols, invmat, rowtransformedmat, zerorow, zerocol, pos, satisfied, rels, edges, rowrels, relpoints, rel, i, j, k, l, x, y, r, n, q, c, @@ -435,22 +440,22 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen nrrows := Length(mat); nrcols := Length(mat[1]); invmat := List(mat, ShallowCopy); - for i in [1..nrrows] do - for j in [1..nrcols] do + for i in [1 .. nrrows] do + for j in [1 .. nrcols] do invmat[i][j] := Inverse(invmat[i][j]); od; - od; + od; rowtransformedmat := []; zerorow := []; zerocol := []; - for i in [1..nrcols] do + for i in [1 .. nrcols] do zerorow[i] := 0; od; - for i in [1..nrrows] do + for i in [1 .. nrrows] do zerocol[i] := 0; od; - for i in [1..nrrows] do - if t1[i] <> nrrows + 1 then + for i in [1 .. nrrows] do + if t1[i] <> nrrows + 1 then rowtransformedmat[i] := mat[t1[i]]; else rowtransformedmat[i] := zerorow; @@ -459,46 +464,46 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen #for ease of checking the constraints, set up lists of linked indices rels := []; - for i in [1..nrrows] do - for j in [1..nrcols] do + for i in [1 .. nrrows] do + for j in [1 .. nrcols] do if rowtransformedmat[i][j] <> 0 then - Add(rels, [i,j]); + Add(rels, [i, j]); fi; od; od; rowrels := []; - for i in [1..nrrows] do + for i in [1 .. nrrows] do rowrels[i] := []; - for j in [1..nrrows] do - for k in [1..nrcols] do - if [i,k] in rels and [j,k] in rels then + for j in [1 .. nrrows] do + for k in [1 .. nrcols] do + if [i, k] in rels and [j, k] in rels then rowrels[i][j] := k; break; fi; od; od; od; - + #get connected components edges := List(rels, r -> [r[1], r[2] + nrrows]); digraph := DigraphByEdges(edges, nrrows + nrcols); cc := DigraphConnectedComponents(digraph); - + #only deal with enough elements to hit each relation relpoints := []; for i in cc.comps do - if Length(i) > 1 then + if Length(i) > 1 then Add(relpoints, i[1]); fi; od; - + # Check whether these connected components have already been found to fail # (on the same values). - for i in [1..Length(failedcomponents)] do - for j in [1..Length(failedcomponents[i][1])] do + for i in [1 .. Length(failedcomponents)] do + for j in [1 .. Length(failedcomponents[i][1])] do c := failedcomponents[i][1][j]; if ForAny(cc.comps, comp -> IsSubset(comp, c)) then - vals := [[],[]]; + vals := [[], []]; for k in c do if k <= nrrows then Add(vals[1], k); @@ -506,14 +511,14 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen Add(vals[2], k - nrrows); fi; od; - if t1{vals[1]} = failedcomponents[i][2]{vals[1]} - and t2{vals[2]} = failedcomponents[i][3]{vals[2]} then + if t1{vals[1]} = failedcomponents[i][2]{vals[1]} and + t2{vals[2]} = failedcomponents[i][3]{vals[2]} then return []; fi; fi; od; od; - + #given a choice of relpoints, fill in everything else possible fillin := function(funcs) x := ShallowCopy(funcs[1]); @@ -521,7 +526,7 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen for r in relpoints do comp := cc.comps[cc.id[r]]; failedtocomplete := false; - for n in [2..Length(comp)] do + for n in [2 .. Length(comp)] do j := comp[n]; if j <= nrrows then for q in comp do @@ -532,9 +537,9 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen break; fi; od; - if not IsBound(x[j]) then - failedtocomplete := true; - fi; + if not IsBound(x[j]) then + failedtocomplete := true; + fi; else j := j - nrrows; if not IsBound(y[j]) then @@ -551,14 +556,14 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen # Might need several passes to fill in everything, since the filling in # propagates through the connected components. if failedtocomplete then - funcs := fillin([x,y]); + funcs := fillin([x, y]); x := funcs[1]; y := funcs[2]; fi; od; - return [x,y]; + return [x, y]; end; - + relssatisfied := function(funcs) failedcomps := []; satisfied := true; @@ -567,7 +572,7 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen for rel in rels do i := rel[1]; j := rel[2]; - if IsBound(x[i]) and IsBound(y[j]) and not + if IsBound(x[i]) and IsBound(y[j]) and not x[i] * rowtransformedmat[i][j] = mat[i][t2[j]] * y[j] then Add(failedcomps, cc.comps[cc.id[i]]); satisfied := false; @@ -575,26 +580,26 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen od; return satisfied; end; - + funcsfromrelpointvals := function(relpointvals) - x := [1..nrrows]; - y := [1..nrcols]; - - for i in [1..nrrows] do + x := [1 .. nrrows]; + y := [1 .. nrcols]; + + for i in [1 .. nrrows] do Unbind(x[i]); od; - for i in [1..nrcols] do + for i in [1 .. nrcols] do Unbind(y[i]); od; - for i in [1..Length(relpoints)] do + for i in [1 .. Length(relpoints)] do x[relpoints[i]] := gplist[relpointvals[i]]; od; - return fillin([x,y]); + return fillin([x, y]); end; - + foundfuncs := []; - iterator := IteratorOfCartesianProduct(List(relpoints, i -> [1..gpsize])); - + iterator := IteratorOfCartesianProduct(List(relpoints, i -> [1 .. gpsize])); + # If S is a commutative group and fails on one choice of relpointvals, # it will fail on all of them. if IsDoneIterator(iterator) then @@ -609,14 +614,14 @@ SEMIGROUPS.FindTranslationFunctionsToGroup := function(S, t1, t2, failedcomponen Add(foundfuncs, funcs); fi; fi; - + while not IsDoneIterator(iterator) do funcs := funcsfromrelpointvals(NextIterator(iterator)); if relssatisfied(funcs) then Add(foundfuncs, funcs); fi; od; - + return foundfuncs; end; @@ -627,7 +632,7 @@ SEMIGROUPS.BitranslationsOfZeroSimple := function(H) L, R, linkedpairs, i, j, c, linkedpairfromfuncs, iso, inv, nrrows, nrcols, reesmatsemi, zero, fl, fr, l, r, t1, t2, funcs, fx, fy, partialfunciterator, funcvals; - + S := UnderlyingSemigroup(H); if not (IsFinite(S) and IsZeroSimpleSemigroup(S)) then TryNextMethod(); @@ -644,7 +649,7 @@ SEMIGROUPS.BitranslationsOfZeroSimple := function(H) tt := SEMIGROUPS.FindTranslationTransformations(S); failedcomponents := []; linkedpairs := []; - + linkedpairfromfuncs := function(t1, t2, fx, fy) fl := function(x) if x = zero then @@ -656,7 +661,7 @@ SEMIGROUPS.BitranslationsOfZeroSimple := function(H) return zero; fi; end; - + fr := function(x) if x = zero then return zero; @@ -667,23 +672,22 @@ SEMIGROUPS.BitranslationsOfZeroSimple := function(H) return zero; fi; end; - + l := LeftTranslationNC(L, CompositionMapping(inv, MappingByFunction( reesmatsemi, reesmatsemi, fl), iso)); - + r := RightTranslationNC(R, CompositionMapping(inv, MappingByFunction( reesmatsemi, reesmatsemi, fr), iso)); - + return BitranslationNC(H, l, r); end; - - - for i in [1..Length(tt[1])] do + + for i in [1 .. Length(tt[1])] do t1 := tt[1][i]; iterator := tt[2][i]; while not IsDoneIterator(iterator) do t2 := NextIterator(iterator); - transfuncs := SEMIGROUPS.FindTranslationFunctionsToGroup(S, t1, t2, + transfuncs := SEMIGROUPS.FindTranslationFunctionsToGroup(S, t1, t2, failedcomponents); if not IsEmpty(transfuncs) then if not transfuncs[1] = 0 then @@ -691,17 +695,18 @@ SEMIGROUPS.BitranslationsOfZeroSimple := function(H) fx := funcs[1]; fy := funcs[2]; unboundpositions := []; - for j in [1..nrcols] do - if not IsBound(fy[j]) then + for j in [1 .. nrcols] do + if not IsBound(fy[j]) then Add(unboundpositions, j); fi; od; if Length(unboundpositions) > 0 then - c := List([1..Length(unboundpositions)], i -> [1..Length(gplist)]); + c := List([1 .. Length(unboundpositions)], + i -> [1 .. Length(gplist)]); partialfunciterator := IteratorOfCartesianProduct(c); while not IsDoneIterator(partialfunciterator) do funcvals := NextIterator(partialfunciterator); - for j in [1..Length(unboundpositions)] do + for j in [1 .. Length(unboundpositions)] do fy[unboundpositions[j]] := gplist[funcvals[j]]; od; Add(linkedpairs, linkedpairfromfuncs(t1, t2, fx, fy)); @@ -711,12 +716,12 @@ SEMIGROUPS.BitranslationsOfZeroSimple := function(H) fi; od; else - Add(failedcomponents, transfuncs{[2,3,4]}); + Add(failedcomponents, transfuncs{[2, 3, 4]}); fi; fi; od; od; - + return Set(linkedpairs); end; @@ -732,8 +737,8 @@ SEMIGROUPS.RMSBitranslations := function(H) lefttrans, righttrans, tripletobitranslation, extendf, extendg, nextf, nextg, partialcheckrow, partialcheckcol, - reject, bt; - + reject, bt; + S := UnderlyingSemigroup(H); L := LeftTranslationsSemigroup(S); R := RightTranslationsSemigroup(S); @@ -758,9 +763,9 @@ SEMIGROUPS.RMSBitranslations := function(H) f[k] := f[k] + 1; return k; end; - + nextg := function(k) - if g[k] = n then + if g[k] = n then return fail; fi; g[k] := g[k] + 1; @@ -768,7 +773,7 @@ SEMIGROUPS.RMSBitranslations := function(H) end; partialcheckrow := function(k) - for j in [1 .. Minimum(k-1, n)] do + for j in [1 .. Minimum(k - 1, n)] do if not P[k][g[j]] * a * P[f[1]][j] = P[k][g[1]] * a * P[f[k]][j] then return false; fi; @@ -804,7 +809,7 @@ SEMIGROUPS.RMSBitranslations := function(H) fi; od; - if not IsBound(g[k]) then + if not IsBound(g[k]) then if nextf(k) = fail then Unbind(f[k]); k := k - 1; @@ -829,8 +834,8 @@ SEMIGROUPS.RMSBitranslations := function(H) bt := function(k) if k = 0 then return 0; - fi; - + fi; + if k > m then if partialcheckcol(k) then if k = n then @@ -860,14 +865,14 @@ SEMIGROUPS.RMSBitranslations := function(H) k := reject(k); return bt(k); fi; - + if partialcheckrow(k) then - + if not IsBound(g[k]) then extendg(k); return bt(k); fi; - + if partialcheckcol(k) then if k = m and k = n then Add(triples, [a, ShallowCopy(f), ShallowCopy(g)]); @@ -875,7 +880,7 @@ SEMIGROUPS.RMSBitranslations := function(H) return bt(k); fi; - if k = m then + if k = m then k := k + 1; extendg(k); return bt(k); @@ -885,11 +890,11 @@ SEMIGROUPS.RMSBitranslations := function(H) extendf(k); return bt(k); fi; - + k := reject(k); return bt(k); fi; - + k := reject(k); return bt(k); end; @@ -900,7 +905,7 @@ SEMIGROUPS.RMSBitranslations := function(H) g := []; bt(k); od; - + # careful with the order! Apply(triples, x -> SEMIGROUPS.BitranslationOfNormalRMSByTripleNC(H, x![1], @@ -931,7 +936,7 @@ end; SEMIGROUPS.FamOfRMSLeftTranslationsByTriple := function() local fam, type; - + fam := NewFamily("LeftTranslationsSemigroupElementsFamily", IsLeftTranslationOfNormalRMS); @@ -942,7 +947,7 @@ end; SEMIGROUPS.FamOfRMSRightTranslationsByTriple := function() local fam, type; - + fam := NewFamily("RightTranslationsSemigroupElementsFamily", IsRightTranslationOfNormalRMS); @@ -953,7 +958,7 @@ end; SEMIGROUPS.FamOfRMSBitranslationsByTriple := function() local fam, type; - + fam := NewFamily("BitranslationsSemigroupElementsFamily", IsBitranslationOfNormalRMS); @@ -962,7 +967,6 @@ SEMIGROUPS.FamOfRMSBitranslationsByTriple := function() return fam; end; - # Create a left translation of an IxJ normalised RMS over a group G. # L should be a left translations semigroup # gpfunc should be a function (represented as a list) from I to G @@ -984,11 +988,11 @@ function(L, gpfunc, t) "must be a normalised RMS ", "semigroup over a group,"); fi; - + G := UnderlyingSemigroup(S); - if not (IsList(gpfunc) and - ForAll(gpfunc, x -> x in G) and + if not (IsList(gpfunc) and + ForAll(gpfunc, x -> x in G) and Size(gpfunc) = Size(Matrix(S)[1])) then ErrorNoReturn("Semigroups: LeftTranslationOfNormalRMS: \n", "the second argument must be a list of group elements ", @@ -996,14 +1000,14 @@ function(L, gpfunc, t) "underlying semigroup of the first argument,"); fi; - if not (IsTransformation(t) and + if not (IsTransformation(t) and DegreeOfTransformation(t) <= Size(Matrix(S)[1])) then ErrorNoReturn("Semigroups: LeftTranslationOfNormalRMS: \n", "the third argument must be a transformation on ", "the number of rows of the ", "underlying semigroup of the first argument,"); fi; - + return LeftTranslationOfNormalRMSNC(L, gpfunc, t); end); @@ -1012,7 +1016,6 @@ function(L, gpfunc, t) return Objectify(TypeLeftTranslationsSemigroupElements(L), [gpfunc, t]); end); - # Create a right translation of an IxJ normalised RMS over a group G. # R should be a right translations semigroup # gpfunc should be a function (represented as a list) from J to G @@ -1034,11 +1037,11 @@ function(R, gpfunc, t) "must be a normalised RMS ", "semigroup over a group,"); fi; - + G := UnderlyingSemigroup(S); - if not (IsList(gpfunc) and - ForAll(gpfunc, x -> x in G) and + if not (IsList(gpfunc) and + ForAll(gpfunc, x -> x in G) and Size(gpfunc) = Size(Matrix(S))) then ErrorNoReturn("Semigroups: RightTranslationOfNormalRMS: \n", "the second argument must be a list of group elements ", @@ -1046,14 +1049,14 @@ function(R, gpfunc, t) "underlying semigroup of the first argument,"); fi; - if not (IsTransformation(t) and + if not (IsTransformation(t) and DegreeOfTransformation(t) <= Size(Matrix(S))) then ErrorNoReturn("Semigroups: RightTranslationOfNormalRMS: \n", "the third argument must be a transformation on ", "the number of columns of the ", "underlying semigroup of the first argument,"); fi; - + return RightTranslationOfNormalRMSNC(R, gpfunc, t); end); @@ -1062,10 +1065,9 @@ function(R, gpfunc, t) return Objectify(TypeRightTranslationsSemigroupElements(R), [gpfunc, t]); end); - SEMIGROUPS.BitranslationOfNormalRMSByTripleNC := function(H, a, transI, transJ) local G, I, J, l, leftgpfunc, L, P, r, rightgpfunc, R, S; - + S := UnderlyingSemigroup(H); G := UnderlyingSemigroup(S); L := LeftTranslationsSemigroup(S); @@ -1074,9 +1076,9 @@ SEMIGROUPS.BitranslationOfNormalRMSByTripleNC := function(H, a, transI, transJ) I := Size(P[1]); J := Size(P); - leftgpfunc := List([1 .. I], i -> a * P[1^transJ][i]); - rightgpfunc := List([1 .. J], j -> P[j][1^transI] * a); - + leftgpfunc := List([1 .. I], i -> a * P[1 ^ transJ][i]); + rightgpfunc := List([1 .. J], j -> P[j][1 ^ transI] * a); + l := LeftTranslationOfNormalRMS(L, leftgpfunc, transI); r := RightTranslationOfNormalRMS(R, rightgpfunc, transJ); @@ -1086,7 +1088,7 @@ end; InstallGlobalFunction(BitranslationOfNormalRMS, function(H, l, r) local i, I, j, J, lf, lt, P, rf, rt, S; - + if not IsBitranslationOfNormalRMSSemigroup(H) then ErrorNoReturn("Semigroups: BitranslationOfNormalRMS: \n", "the first argument must be a semigroup of ", @@ -1105,14 +1107,14 @@ function(H, l, r) for i in [1 .. I] do for j in [1 .. J] do - if not P[j][i^lt] * lf[i] = rf[j] * P[j^rt][i] then + if not P[j][i ^ lt] * lf[i] = rf[j] * P[j ^ rt][i] then ErrorNoReturn("Semigroups: BitranslationOfNormalRMS: \n", "the second and third arguments must be a ", "linked left and right translation, respectively,"); fi; od; od; - + return BitranslationOfNormalRMSNC(H, l, r); end); @@ -1125,17 +1127,18 @@ end); #Technical Methods ############################################################################ -InstallMethod(Representative, "for a semigroup of left or right translations over a normalised RMS", +InstallMethod(Representative, +"for a semigroup of left or right translations over a normalised RMS", [IsTranslationOfNormalRMSSemigroup and IsWholeFamily], function(T) local e, G, S; - + S := UnderlyingSemigroup(T); G := UnderlyingSemigroup(S); e := MultiplicativeNeutralElement(G); - + if IsLeftTranslationOfNormalRMSSemigroup(T) then - return LeftTranslationOfNormalRMS(T, + return LeftTranslationOfNormalRMS(T, List(Rows(S), x -> e), IdentityTransformation); else @@ -1161,8 +1164,8 @@ InstallMethod(\*, "for left translations of a normalised RMS", IsIdenticalObj, [IsLeftTranslationOfNormalRMS, IsLeftTranslationOfNormalRMS], function(x, y) - return Objectify(FamilyObj(x)!.type, - [List([1 .. Size(x![1])], i -> x![1][i^y![2]] * y![1][i]), + return Objectify(FamilyObj(x)!.type, + [List([1 .. Size(x![1])], i -> x![1][i ^ y![2]] * y![1][i]), y![2] * x![2]]); end); @@ -1184,8 +1187,8 @@ InstallMethod(\*, "for right translations of a normalised RMS", IsIdenticalObj, [IsRightTranslationOfNormalRMS, IsRightTranslationOfNormalRMS], function(x, y) - return Objectify(FamilyObj(x)!.type, - [List([1 .. Size(x![1])], j -> x![1][j] * y![1][j^x![2]]), + return Objectify(FamilyObj(x)!.type, + [List([1 .. Size(x![1])], j -> x![1][j] * y![1][j ^ x![2]]), x![2] * y![2]]); end); @@ -1229,13 +1232,13 @@ InstallMethod(\^, "for a semigroup element and a translation", function(x, t) if IsLeftTranslationOfNormalRMS(t) then return RMSElementNC(ReesMatrixSemigroupOfFamily(FamilyObj(x)), - x![1]^t![2], + x![1] ^ t![2], t![1][x![1]] * x![2], x![3]); else return RMSElementNC(ReesMatrixSemigroupOfFamily(FamilyObj(x)), x![1], x![2] * t![1][x![3]], - x![3]^t![2]); + x![3] ^ t![2]); fi; end); diff --git a/gap/attributes/translat.gd b/gap/attributes/translat.gd index 58bc4bbd6..dd212976b 100644 --- a/gap/attributes/translat.gd +++ b/gap/attributes/translat.gd @@ -40,7 +40,7 @@ DeclareSynonym("IsRightTranslationsSemigroup", IsSemigroup and IsRightTranslationsSemigroupElementCollection); DeclareSynonym("IsTranslationsSemigroup", IsSemigroup and IsTranslationsSemigroupElementCollection); -DeclareSynonym("IsTranslationalHull", IsSemigroup and +DeclareSynonym("IsTranslationalHull", IsSemigroup and IsBitranslationCollection); DeclareAttribute("UnderlyingSemigroup", IsTranslationsSemigroup); @@ -52,15 +52,23 @@ DeclareAttribute("TranslationalHullOfFamily", IsFamily); DeclareAttribute("TypeLeftTranslationsSemigroupElements", IsLeftTranslationsSemigroup); -DeclareAttribute("TypeRightTranslationsSemigroupElements", +DeclareAttribute("TypeRightTranslationsSemigroupElements", IsRightTranslationsSemigroup); DeclareAttribute("TypeBitranslations", IsTranslationalHull); -DeclareAttribute("LeftTranslations", IsEnumerableSemigroupRep and IsFinite); -DeclareAttribute("InnerLeftTranslations", IsEnumerableSemigroupRep and IsFinite); -DeclareAttribute("RightTranslations", IsEnumerableSemigroupRep and IsFinite); -DeclareAttribute("InnerRightTranslations", IsEnumerableSemigroupRep and IsFinite); -DeclareAttribute("TranslationalHull", IsEnumerableSemigroupRep and IsFinite); -DeclareAttribute("InnerTranslationalHull", IsEnumerableSemigroupRep and IsFinite); -DeclareAttribute("TranslationalElements", IsTranslationsSemigroup and IsWholeFamily); -DeclareAttribute("TranslationalElements", IsTranslationalHull and IsWholeFamily); +DeclareAttribute("LeftTranslations", + IsEnumerableSemigroupRep and IsFinite); +DeclareAttribute("InnerLeftTranslations", + IsEnumerableSemigroupRep and IsFinite); +DeclareAttribute("RightTranslations", + IsEnumerableSemigroupRep and IsFinite); +DeclareAttribute("InnerRightTranslations", + IsEnumerableSemigroupRep and IsFinite); +DeclareAttribute("TranslationalHull", + IsEnumerableSemigroupRep and IsFinite); +DeclareAttribute("InnerTranslationalHull", + IsEnumerableSemigroupRep and IsFinite); +DeclareAttribute("TranslationalElements", + IsTranslationsSemigroup and IsWholeFamily); +DeclareAttribute("TranslationalElements", + IsTranslationalHull and IsWholeFamily); diff --git a/gap/attributes/translat.gi b/gap/attributes/translat.gi index 383b90d93..2b732281b 100644 --- a/gap/attributes/translat.gi +++ b/gap/attributes/translat.gi @@ -10,22 +10,22 @@ #TODO Translations semigroups can currently forget their generators - maybe?? ############################################################################# ## This file contains methods for dealing with left and right translation -## semigroups, as well as translational hulls. +## semigroups, as well as translational hulls. ## When one of these semigroups is created, the attribute AsList ## is calculated. ## To avoid this calculation at the time of creation, you can call ## XTranslationsSemigroup or TranslationalHullSemigroup ## -## Left/Right translations are stored internally as transformations on the -## indices of the underlying semigroup (determined by AsListCanonical). Hence, +## Left/Right translations are stored internally as transformations on the +## indices of the underlying semigroup (determined by AsListCanonical). Hence, ## only finite semigroups are supported. ## ## Much of the implementation in this file was based on the implementation of ## RMS in reesmatsemi.gi in the GAP library - in particular, the creation of ## the semigroups and their relation to their elements. -## -## The code specific to rectangular bands is based on -## Howie, J.M. (1995) 'Fundamentals of Semigroup theory'. +## +## The code specific to rectangular bands is based on +## Howie, J.M. (1995) 'Fundamentals of Semigroup theory'. ## United Kingdom: Oxford University Press. (p. 116) ## ## This file is organised as follows: @@ -38,7 +38,6 @@ ## ############################################################################# - ############################################################################# # 1. Internal Functions ############################################################################# @@ -58,15 +57,15 @@ end; SEMIGROUPS.TranslationsSemigroupElements := function(T) local S; S := UnderlyingSemigroup(T); - if IsZeroSimpleSemigroup(S) or + if IsZeroSimpleSemigroup(S) or IsRectangularBand(S) or SEMIGROUPS.IsNormalRMSOverGroup(S) then return Semigroup(GeneratorsOfSemigroup(T)); elif HasGeneratorsOfSemigroup(S) then if IsLeftTranslationsSemigroup(T) then return SEMIGROUPS.LeftTranslationsSemigroupElementsByGenerators(T); - else - return SEMIGROUPS.RightTranslationsSemigroupElementsByGenerators(T); + else + return SEMIGROUPS.RightTranslationsSemigroupElementsByGenerators(T); fi; fi; Error("Semigroups: TranslationsSemigroupElements: \n", @@ -92,9 +91,9 @@ end; # right cayley graph SEMIGROUPS.LeftTranslationsSemigroupElementsByGenerators := function(L) local S, digraph, n, nrgens, out, colors, gens, i, j; - + S := UnderlyingSemigroup(L); - + digraph := RightCayleyGraphSemigroup(S); n := Length(digraph); nrgens := Length(digraph[1]); @@ -120,7 +119,7 @@ SEMIGROUPS.RightTranslationsSemigroupElementsByGenerators := function(R) local S, digraph, n, nrgens, out, colors, gens, i, j; S := UnderlyingSemigroup(R); - + digraph := LeftCayleyGraphSemigroup(S); n := Length(digraph); nrgens := Length(digraph[1]); @@ -137,7 +136,7 @@ SEMIGROUPS.RightTranslationsSemigroupElementsByGenerators := function(R) od; od; gens := GeneratorsOfEndomorphismMonoid(Digraph(out), colors); - Apply(gens, x -> RightTranslation(R,RestrictedTransformation(x, [1 .. n]))); + Apply(gens, x -> RightTranslation(R, RestrictedTransformation(x, [1 .. n]))); return Semigroup(gens, rec(small := true)); end; @@ -146,23 +145,23 @@ end; # Given a set A which hits every L class and R class, a linked pair (f, g) of # translations is completely determined by the values on A. Having fixed a_i, # we can restrict the values on a_k, k > i, by the linked pair conditions -# s*a_i f(a_k) = (s*a_i)g a_k and a_k f(a_i * s) = (a_k)g a_i * s, +# s * a_i f(a_k) = (s * a_i)g a_k and a_k f(a_i * s) = (a_k)g a_i * s, # as well as restriction by the translation condition if Sa_i intersect Sa_k is # non-empty or a_i S intersect a_k S is non-empty. SEMIGROUPS.BitranslationsByGenerators := function(H) local d, e, f, g, i, I, j, k, L, m, n, p, q, r, R, s, S, x, y, - flinkedrestrictionatstage, fposrepk, ftransrestrictionatstage, fvalsi, - glinkedrestrictionatstage, gposrepk, gtransrestrictionatstage, gvalsi, - linkedpairs, multtable, multtablepositionsets, + flinkedrestrictionatstage, fposrepk, ftransrestrictionatstage, fvalsi, + glinkedrestrictionatstage, gposrepk, gtransrestrictionatstage, gvalsi, + ipos, linkedpairs, multtable, multtablepossets, pos, posrepsks, posfrepsks, possrepsk, possgrepsk, possibleidempotentfvals, possibleidempotentgvals, possiblefrepvals, possiblegrepvals, possiblefrepvalsfromidempotent, possiblegrepvalsfromidempotent, - reps, repspos, slist, transposepositionsets, whenboundfvals, + reps, repspos, slist, transposepossets, whenboundfvals, whenboundgvals, - bt, extendf, propagatef, propagateg, reject, restrictfromf, + bt, extendf, propagatef, propagateg, reject, restrictfromf, restrictfromg, unrestrict; - + S := UnderlyingSemigroup(H); n := Size(S); slist := AsListCanonical(S); @@ -170,13 +169,13 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) R := RightTranslationsSemigroup(S); #easiest to just recalculate multiplication table with canonical list - multtable := List([1..n], i -> [1..n]); - for i in [1..n] do - for j in [1..n] do + multtable := List([1 .. n], i -> [1 .. n]); + for i in [1 .. n] do + for j in [1 .. n] do multtable[i][j] := Position(slist, slist[i] * slist[j]); od; od; - + reps := GeneratorsOfSemigroup(S); repspos := []; m := Size(reps); @@ -186,15 +185,15 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) #store which elements of the semigroups multiply each given element to form #another given element - #eg., if a * b = a * c = d, with (a,b,c,d) having indices (i,j,k,l) - #in the multiplication table, then we store [j,k] in the cell [i][l] - multtablepositionsets := List([1 .. n], x -> List([1 .. n], y -> [])); - transposepositionsets := List([1 .. n], x -> List([1 .. n], y -> [])); + #eg., if a * b = a * c = d, with (a,b,c,d) having indices (i,j,k,l) + #in the multiplication table, then we store [j,k] in the cell [i][l] + multtablepossets := List([1 .. n], x -> List([1 .. n], y -> [])); + transposepossets := List([1 .. n], x -> List([1 .. n], y -> [])); for i in [1 .. n] do for j in [1 .. n] do pos := multtable[i][j]; - Add(multtablepositionsets[i][pos], j); - Add(transposepositionsets[j][pos], i); + Add(multtablepossets[i][pos], j); + Add(transposepossets[j][pos], i); od; od; @@ -208,13 +207,13 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) possibleidempotentgvals[Position(I, e)] := PositionsProperty(slist, x -> e * x = x); od; - + possiblefrepvals := List([1 .. m], x -> [1 .. n]); possiblegrepvals := List([1 .. m], x -> [1 .. n]); - + #restrict values for f, g based on idemopotents #if e is an idempotent with r_i * s = e - #then f(r_i)*s = f(r_i)*s*r_i * s + #then f(r_i)*s = f(r_i)*s * r_i * s #and f(r_i) satisfies f(r_i) * s = x for some value x such that x * e = e for i in [1 .. m] do for s in S do @@ -225,12 +224,12 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) possiblefrepvalsfromidempotent := []; for y in possibleidempotentfvals[Position(I, reps[i] * s)] do UniteSet(possiblefrepvalsfromidempotent, - transposepositionsets[Position(slist, s)][y]); + transposepossets[Position(slist, s)][y]); od; possiblefrepvals[i] := Intersection(possiblefrepvals[i], possiblefrepvalsfromidempotent); fi; - + if IsIdempotent(s * reps[i]) then possiblegrepvals[i] := Intersection(possiblegrepvals[i], PositionsProperty(slist, @@ -238,19 +237,19 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) possiblegrepvalsfromidempotent := []; for y in possibleidempotentgvals[Position(I, s * reps[i])] do UniteSet(possiblegrepvalsfromidempotent, - multtablepositionsets[Position(slist, s)][y]); + multtablepossets[Position(slist, s)][y]); od; possiblegrepvals[i] := Intersection(possiblegrepvals[i], possiblegrepvalsfromidempotent); fi; od; od; - + extendf := function(k) f[repspos[k + 1]] := possiblefrepvals[k + 1][1]; return k + 1; end; - + propagatef := function(k) for i in [1 .. n] do pos := multtable[repspos[k]][i]; @@ -267,7 +266,7 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) od; return k; end; - + propagateg := function(k) for i in [1 .. n] do pos := multtable[i][repspos[k]]; @@ -282,15 +281,16 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) od; return k; end; - + restrictfromf := function(k) for i in [k + 1 .. m] do + ipos := repspos[i]; for j in [1 .. n] do posrepsks := multtable[repspos[k]][j]; posfrepsks := multtable[f[repspos[k]]][j]; #restrict by the translation condition - for p in multtablepositionsets[repspos[i]][posrepsks] do - fvalsi := transposepositionsets[p][posfrepsks]; + for p in multtablepossets[ipos][posrepsks] do + fvalsi := transposepossets[p][posfrepsks]; UniteSet(ftransrestrictionatstage[i][k], Difference(possiblefrepvals[i], fvalsi)); possiblefrepvals[i] := Intersection(possiblefrepvals[i], fvalsi); @@ -300,7 +300,7 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) od; #deal with the cases reps[i] = reps[k] * slist[j] - if repspos[i] = multtable[k][j] then + if ipos = multtable[k][j] then fvalsi := [posfrepsks]; UniteSet(ftransrestrictionatstage[i][k], Difference(possiblefrepvals[i], fvalsi)); @@ -311,9 +311,9 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) fi; od; #deal with the cases reps[i] * slist[j] = reps[k] - for p in multtablepositionsets[repspos[i]][repspos[k]] do - fvalsi := transposepositionsets[p][f[repspos[k]]]; - UniteSet(ftransrestrictionatstage[i][k], + for p in multtablepossets[ipos][repspos[k]] do + fvalsi := transposepossets[p][f[repspos[k]]]; + UniteSet(ftransrestrictionatstage[i][k], Difference(possiblefrepvals[i], fvalsi)); possiblefrepvals[i] := Intersection(possiblefrepvals[i], fvalsi); if Size(possiblefrepvals[i]) = 0 then @@ -322,55 +322,57 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) od; od; for i in [k .. m] do + ipos := repspos[i]; for j in [1 .. n] do #restrict by the linked pair condition posrepsks := multtable[repspos[k]][j]; - gvalsi := transposepositionsets[posrepsks][multtable[repspos[i]][f[posrepsks]]]; - UniteSet(glinkedrestrictionatstage[i][k], + gvalsi := transposepossets[posrepsks][multtable[ipos][f[posrepsks]]]; + UniteSet(glinkedrestrictionatstage[i][k], Difference(possiblegrepvals[i], gvalsi)); possiblegrepvals[i] := Intersection(possiblegrepvals[i], gvalsi); od; #deal with linked condition on reps[k] - gvalsi := transposepositionsets[repspos[k]][multtable[repspos[i]][f[repspos[k]]]]; + gvalsi := transposepossets[repspos[k]][multtable[ipos][f[repspos[k]]]]; UniteSet(glinkedrestrictionatstage[i][k], Difference(possiblegrepvals[i], gvalsi)); possiblegrepvals[i] := Intersection(possiblegrepvals[i], gvalsi); if Size(possiblegrepvals[i]) = 0 then return fail; - fi; + fi; od; return k; end; - + restrictfromg := function(k) for i in [k + 1 .. m] do + ipos := repspos[i]; for j in [1 .. n] do - possrepsk := multtable[j][repspos[k]]; + possrepsk := multtable[j][repspos[k]]; possgrepsk := multtable[j][g[repspos[k]]]; - for p in transposepositionsets[repspos[i]][possrepsk] do - gvalsi := multtablepositionsets[p][possgrepsk]; + for p in transposepossets[ipos][possrepsk] do + gvalsi := multtablepossets[p][possgrepsk]; UniteSet(gtransrestrictionatstage[i][k], Difference(possiblegrepvals[i], gvalsi)); possiblegrepvals[i] := Intersection(possiblegrepvals[i], gvalsi); od; - + #deal with the cases reps[i] = s * reps[k] and s * reps[i] = reps[k] - if repspos[i] = multtable[j][repspos[k]] then + if ipos = multtable[j][repspos[k]] then gvalsi := [possgrepsk]; UniteSet(gtransrestrictionatstage[i][k], Difference(possiblegrepvals[i], gvalsi)); possiblegrepvals[i] := Intersection(possiblegrepvals[i], gvalsi); fi; - - for p in transposepositionsets[repspos[i]][repspos[k]] do - gvalsi := multtablepositionsets[p][g[repspos[k]]]; + + for p in transposepossets[ipos][repspos[k]] do + gvalsi := multtablepossets[p][g[repspos[k]]]; UniteSet(gtransrestrictionatstage[i][k], Difference(possiblegrepvals[i], gvalsi)); possiblegrepvals[i] := Intersection(possiblegrepvals[i], gvalsi); od; - - fvalsi := multtablepositionsets[possrepsk][multtable[g[possrepsk]][repspos[i]]]; - UniteSet(flinkedrestrictionatstage[i][k], + + fvalsi := multtablepossets[possrepsk][multtable[g[possrepsk]][ipos]]; + UniteSet(flinkedrestrictionatstage[i][k], Difference(possiblefrepvals[i], fvalsi)); possiblefrepvals[i] := Intersection(possiblefrepvals[i], fvalsi); od; @@ -380,7 +382,7 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) od; return k; end; - + unrestrict := function(k, unrestrictf) for i in [1 .. n] do if whenboundgvals[i] = k then @@ -393,8 +395,8 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) UniteSet(possiblefrepvals[i], flinkedrestrictionatstage[i][k]); gtransrestrictionatstage[i][k] := []; flinkedrestrictionatstage[i][k] := []; - od; - + od; + if unrestrictf then for i in [1 .. n] do if whenboundfvals[i] = k then @@ -410,9 +412,9 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) od; fi; end; - + reject := function(k) - if k = 0 then + if k = 0 then return 0; fi; fposrepk := Position(possiblefrepvals[k], f[repspos[k]]); @@ -421,7 +423,7 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) else gposrepk := 0; fi; - + if gposrepk = 0 then if fposrepk < Size(possiblefrepvals[k]) then f[repspos[k]] := possiblefrepvals[k][fposrepk + 1]; @@ -486,30 +488,30 @@ SEMIGROUPS.BitranslationsByGenerators := function(H) return bt(reject(k)); fi; end; - + #The actual search - ftransrestrictionatstage := List([1..m], x -> List([1..m], y -> [])); - flinkedrestrictionatstage := List([1..m], x -> List([1..m], y -> [])); - gtransrestrictionatstage := List([1..m], x -> List([1..m], y -> [])); - glinkedrestrictionatstage := List([1..m], x -> List([1..m], y -> [])); + ftransrestrictionatstage := List([1 .. m], x -> List([1 .. m], y -> [])); + flinkedrestrictionatstage := List([1 .. m], x -> List([1 .. m], y -> [])); + gtransrestrictionatstage := List([1 .. m], x -> List([1 .. m], y -> [])); + glinkedrestrictionatstage := List([1 .. m], x -> List([1 .. m], y -> [])); whenboundfvals := List([1 .. n], x -> 0); whenboundgvals := ShallowCopy(whenboundfvals); linkedpairs := []; - + f := []; g := []; - + k := extendf(0); k := bt(k); while k = m + 1 do Add(linkedpairs, [ShallowCopy(f), ShallowCopy(g)]); k := bt(reject(k - 1)); od; - - Apply(linkedpairs, x -> BitranslationNC(H, + + Apply(linkedpairs, x -> BitranslationNC(H, LeftTranslationNC(L, Transformation(x[1])), RightTranslationNC(R, Transformation(x[2])))); - + return linkedpairs; end; @@ -521,12 +523,11 @@ end; InstallGlobalFunction(LeftTranslationsSemigroup, function(S) local fam, L, type; - if HasLeftTranslations(S) then return LeftTranslations(S); fi; - + if SEMIGROUPS.IsNormalRMSOverGroup(S) then fam := SEMIGROUPS.FamOfRMSLeftTranslationsByTriple(); type := fam!.type; @@ -540,13 +541,13 @@ function(S) #create the semigroup of left translations L := Objectify(NewType(CollectionsFamily(fam), IsLeftTranslationsSemigroup and IsWholeFamily and IsAttributeStoringRep), rec()); - + #store the type of the elements in the semigroup SetTypeLeftTranslationsSemigroupElements(L, type); - SetLeftTranslationsSemigroupOfFamily(fam, L); + SetLeftTranslationsSemigroupOfFamily(fam, L); SetUnderlyingSemigroup(L, S); SetLeftTranslations(S, L); - + return L; end); @@ -554,7 +555,7 @@ end); InstallGlobalFunction(RightTranslationsSemigroup, function(S) local fam, type, R; - + if HasRightTranslations(S) then return RightTranslations(S); fi; @@ -568,17 +569,17 @@ function(S) type := NewType(fam, IsRightTranslationsSemigroupElement); fam!.type := type; fi; - + # create the semigroup of right translations - R := Objectify(NewType(CollectionsFamily(fam), IsRightTranslationsSemigroup + R := Objectify(NewType(CollectionsFamily(fam), IsRightTranslationsSemigroup and IsWholeFamily and IsAttributeStoringRep), rec()); - + # store the type of the elements in the semigroup SetTypeRightTranslationsSemigroupElements(R, type); SetRightTranslationsSemigroupOfFamily(fam, R); SetUnderlyingSemigroup(R, S); SetRightTranslations(S, R); - + return R; end); @@ -586,11 +587,11 @@ end); InstallGlobalFunction(TranslationalHullSemigroup, function(S) local fam, type, H; - + if HasTranslationalHull(S) then return TranslationalHull(S); fi; - + if SEMIGROUPS.IsNormalRMSOverGroup(S) then fam := SEMIGROUPS.FamOfRMSBitranslationsByTriple(); type := fam!.type; @@ -600,29 +601,29 @@ function(S) type := NewType(fam, IsBitranslation); fam!.type := type; fi; - + # create the translational hull H := Objectify(NewType(CollectionsFamily(fam), IsTranslationalHull and IsWholeFamily and IsAttributeStoringRep), rec()); - + # store the type of the elements in the semigroup SetTypeBitranslations(H, type); SetTranslationalHullOfFamily(fam, H); SetUnderlyingSemigroup(H, S); SetTranslationalHull(S, H); - + return H; end); # Create and calculate the semigroup of left translations -InstallMethod(LeftTranslations, "for a semigroup", -[IsEnumerableSemigroupRep and IsFinite], -function(S) +InstallMethod(LeftTranslations, "for a semigroup", +[IsEnumerableSemigroupRep and IsFinite], +function(S) local L; - + L := LeftTranslationsSemigroup(S); AsList(L); - + return L; end); @@ -631,10 +632,10 @@ InstallMethod(InnerLeftTranslations, "for a semigroup", [IsEnumerableSemigroupRep and IsFinite], function(S) local A, I, L, l, s; - + I := []; L := LeftTranslationsSemigroup(S); - + if HasGeneratorsOfSemigroup(S) then A := GeneratorsOfSemigroup(S); else @@ -648,14 +649,14 @@ function(S) end); # Create and calculate the semigroup of right translations -InstallMethod(RightTranslations, "for a semigroup", +InstallMethod(RightTranslations, "for a semigroup", [IsEnumerableSemigroupRep and IsFinite], -function(S) +function(S) local R; - + R := RightTranslationsSemigroup(S); AsList(R); - + return R; end); @@ -664,10 +665,10 @@ InstallMethod(InnerRightTranslations, "for a semigroup", [IsEnumerableSemigroupRep and IsFinite], function(S) local A, I, R, r, s; - + I := []; R := RightTranslationsSemigroup(S); - + if HasGeneratorsOfSemigroup(S) then A := GeneratorsOfSemigroup(S); else @@ -685,16 +686,15 @@ end); # a transformation of its indices (as defined by AsListCanonical) InstallGlobalFunction(LeftTranslation, function(L, x) - local S, semiList, i, reps, R; - + local R, S, reps, semiList; S := UnderlyingSemigroup(L); reps := []; - + if not (IsLeftTranslationsSemigroup(L)) then ErrorNoReturn("Semigroups: LeftTranslation: \n", "the first argument must be a semigroup of left translations,"); fi; - + if HasGeneratorsOfSemigroup(S) then reps := GeneratorsOfSemigroup(S); else @@ -702,14 +702,14 @@ function(L, x) Add(reps, Representative(R)); od; fi; - + if IsGeneralMapping(x) then if not (S = Source(x) and Source(x) = Range(x)) then ErrorNoReturn("Semigroups: LeftTranslation (from Mapping): \n", "the domain and range of the second argument must be ", "the underlying semigroup of the first,"); fi; - if ForAny(reps, s -> ForAny(S, t -> (s^x) * t <> (s * t)^x)) then + if ForAny(reps, s -> ForAny(S, t -> (s ^ x) * t <> (s * t) ^ x)) then ErrorNoReturn("Semigroups: LeftTranslation: \n", "the mapping given must define a left translation,"); fi; @@ -720,10 +720,10 @@ function(L, x) "semigroup of the first argument,"); fi; semiList := AsListCanonical(S); - if ForAny(reps, - s -> ForAny(S, - t -> semiList[Position(semiList, s)^x] * t <> - semiList[Position(semiList, s * t)^x])) then + if ForAny(reps, + s -> ForAny(S, + t -> semiList[Position(semiList, s) ^ x] * t <> + semiList[Position(semiList, s * t) ^ x])) then ErrorNoReturn("Semigroups: LeftTranslation: \n", "the transformation given must define a left translation,"); fi; @@ -746,10 +746,10 @@ function(L, x) # x is a mapping on UnderlyingSemigroup(S) semiList := AsListCanonical(UnderlyingSemigroup(L)); mapAsTransList := []; - for i in [1..Length(semiList)] do - mapAsTransList[i] := Position(semiList, semiList[i]^x); + for i in [1 .. Length(semiList)] do + mapAsTransList[i] := Position(semiList, semiList[i] ^ x); od; - + return Objectify(TypeLeftTranslationsSemigroupElements(L), [Transformation(mapAsTransList)]); end); @@ -757,11 +757,11 @@ end); # Same for right translations. InstallGlobalFunction(RightTranslation, function(R, x) - local S, semiList, i, reps, L; - + local S, semiList, reps, L; + S := UnderlyingSemigroup(R); reps := []; - + if not (IsRightTranslationsSemigroup(R)) then ErrorNoReturn("Semigroups: RightTranslation: \n", "the first argument must be a semigroup of right translations,"); @@ -775,14 +775,14 @@ function(R, x) Add(reps, Representative(L)); od; fi; - + if IsGeneralMapping(x) then if not (S = Source(x) and Source(x) = Range(x)) then ErrorNoReturn("Semigroups: RightTranslation (from Mapping): \n", "the domain and range of the second argument must be ", "the underlying semigroup of the first,"); fi; - if ForAny(reps, s -> ForAny(S, t -> t * (s^x) <> (t * s)^x)) then + if ForAny(reps, s -> ForAny(S, t -> t * (s ^ x) <> (t * s) ^ x)) then ErrorNoReturn("Semigroups: RightTranslation: \n", "the mapping given must define a right translation,"); fi; @@ -793,10 +793,10 @@ function(R, x) "semigroup of the first argument,"); fi; semiList := AsListCanonical(S); - if ForAny(reps, - s -> ForAny(S, - t -> t * semiList[Position(semiList, s)^x] <> - semiList[Position(semiList, t * s)^x])) then + if ForAny(reps, + s -> ForAny(S, t -> + t * semiList[Position(semiList, s) ^ x] + <> semiList[Position(semiList, t * s) ^ x])) then ErrorNoReturn("Semigroups: RightTranslation: \n", "the transformation given must define a right translation,"); fi; @@ -819,10 +819,10 @@ function(R, x) # x is a mapping on UnderlyingSemigroup(S) semiList := AsListCanonical(UnderlyingSemigroup(R)); mapAsTransList := []; - for i in [1..Length(semiList)] do - mapAsTransList[i] := Position(semiList, semiList[i]^x); + for i in [1 .. Length(semiList)] do + mapAsTransList[i] := Position(semiList, semiList[i] ^ x); od; - + return Objectify(TypeRightTranslationsSemigroupElements(R), [Transformation(mapAsTransList)]); end); @@ -832,20 +832,20 @@ InstallMethod(TranslationalHull, "for a semigroup", [IsEnumerableSemigroupRep and IsFinite], function(S) local H; - + H := TranslationalHullSemigroup(S); AsList(H); - + return H; end); -# Creates the ideal of the translational hull consisting of +# Creates the ideal of the translational hull consisting of # all inner bitranslations InstallMethod(InnerTranslationalHull, "for a semigroup", [IsEnumerableSemigroupRep and IsFinite], function(S) local A, I, H, L, R, l, r, s; - + I := []; H := TranslationalHullSemigroup(S); L := LeftTranslationsSemigroup(S); @@ -865,27 +865,27 @@ end); # Creates a linked pair (l, r) from a left translation l and a right # translation r, as an element of a translational hull H. -InstallGlobalFunction(Bitranslation, -function(H, l, r) +InstallGlobalFunction(Bitranslation, +function(H, l, r) local S, L, R, dclasses, lclasses, rclasses, reps, d, i, j, z; - - if not IsTranslationalHull(H) then + + if not IsTranslationalHull(H) then ErrorNoReturn("Semigroups: Bitranslation: \n", "the first argument must be a translational hull,"); fi; - - if not (IsLeftTranslationsSemigroupElement(l) and + + if not (IsLeftTranslationsSemigroupElement(l) and IsRightTranslationsSemigroupElement(r)) then ErrorNoReturn("Semigroups: Bitranslation: \n", "the second argument must be a left translation ", "and the third argument must be a right translation,"); return; fi; - + S := UnderlyingSemigroup(H); L := LeftTranslationsSemigroupOfFamily(FamilyObj(l)); R := RightTranslationsSemigroupOfFamily(FamilyObj(r)); - + if HasGeneratorsOfSemigroup(S) then reps := GeneratorsOfSemigroup(S); else @@ -917,17 +917,17 @@ function(H, l, r) fi; od; fi; - + if not (UnderlyingSemigroup(L) = S and UnderlyingSemigroup(R) = S) then ErrorNoReturn("Semigroups: Bitranslation: \n", "each argument must have the same underlying semigroup,"); fi; - - if ForAny(reps, t -> ForAny(reps, s -> s * (t^l) <> (s^r) * t)) then + + if ForAny(reps, t -> ForAny(reps, s -> s * (t ^ l) <> (s ^ r) * t)) then ErrorNoReturn("Semigroups: Bitranslation: \n", "the translations given must form a linked pair,"); fi; - + return BitranslationNC(H, l, r); end); @@ -937,53 +937,54 @@ function(H, l, r) end); ############################################################################# -# 3. Methods for rectangular bands +# 3. Methods for rectangular bands ############################################################################# -# For rectangular bands, don't calculate AsList for LeftTranslations +# For rectangular bands, don't calculate AsList for LeftTranslations # Just get generators InstallMethod(LeftTranslations, "for a rectangular band", [IsEnumerableSemigroupRep and IsFinite and IsRectangularBand], -function(S) +function(S) local L; - + L := LeftTranslationsSemigroup(S); GeneratorsOfSemigroup(L); - + return L; end); -# For rectangular bands, don't calculate AsList for RightTranslations +# For rectangular bands, don't calculate AsList for RightTranslations # Just get generators InstallMethod(RightTranslations, "for a rectangular band", [IsEnumerableSemigroupRep and IsFinite and IsRectangularBand], -function(S) +function(S) local R; - + R := RightTranslationsSemigroup(S); GeneratorsOfSemigroup(R); - + return R; end); -# For rectangular bands, don't calculate AsList for TranslationalHull +# For rectangular bands, don't calculate AsList for TranslationalHull # Just get generators InstallMethod(TranslationalHull, "for a rectangular band", [IsEnumerableSemigroupRep and IsFinite and IsRectangularBand], function(S) local H; - + H := TranslationalHullSemigroup(S); GeneratorsOfSemigroup(H); - + return H; end); # Every transformation on the relevant index set corresponds to a translation. # The R classes of an I x J rectangular band correspond to (i, J) for i in I. # Dually for L classes. -InstallMethod(Size, "for the semigroup of left or right translations of a rectangular band", -[IsTranslationsSemigroup and IsWholeFamily], 2, +InstallMethod(Size, +"for the semigroup of left or right translations of a rectangular band", +[IsTranslationsSemigroup and IsWholeFamily], 2, function(T) local S, n; S := UnderlyingSemigroup(T); @@ -994,8 +995,8 @@ function(T) n := NrRClasses(S); else n := NrLClasses(S); fi; - - return n^n; + + return n ^ n; end); # The translational hull of a rectangular band is the direct product of the @@ -1013,13 +1014,14 @@ function(H) return Size(L) * Size(R); end); -# Generators of the left/right translations semigroup on the I x J rectangular -# band correspond to the generators of the full transformation monoid on I or J. -InstallMethod(GeneratorsOfSemigroup, "for the semigroup of left or right translations of a rectangular band", +# Generators of the left/right translations semigroup on the I x J rectangular +# band correspond to the generators of the full transformation monoid on I or J. +InstallMethod(GeneratorsOfSemigroup, +"for the semigroup of left or right translations of a rectangular band", [IsTranslationsSemigroup and IsWholeFamily], 2, function(T) - local S, L, n, iso, inv, reesMatSemi, semiList, gens, t, f; + local S, n, iso, inv, reesMatSemi, gens, t, f; S := UnderlyingSemigroup(T); if not IsRectangularBand(S) then TryNextMethod(); @@ -1033,37 +1035,38 @@ function(T) else n := Length(Columns(reesMatSemi)); fi; - + gens := []; for t in GeneratorsOfMonoid(FullTransformationMonoid(n)) do if IsLeftTranslationsSemigroup(T) then f := function(x) - return ReesMatrixSemigroupElement(reesMatSemi, x[1]^t, + return ReesMatrixSemigroupElement(reesMatSemi, x[1] ^ t, (), x[3]); end; - Add(gens, LeftTranslationNC(T, CompositionMapping(inv, + Add(gens, LeftTranslationNC(T, CompositionMapping(inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); - else + else f := function(x) - return ReesMatrixSemigroupElement(reesMatSemi, x[1], - (), x[3]^t); + return ReesMatrixSemigroupElement(reesMatSemi, x[1], + (), x[3] ^ t); end; - Add(gens, RightTranslationNC(T, CompositionMapping(inv, + Add(gens, RightTranslationNC(T, CompositionMapping(inv, MappingByFunction(reesMatSemi, reesMatSemi, f), iso))); fi; od; return gens; -end); +end); -# Generators of translational hull are the direct product of +# Generators of translational hull are the direct product of # generators of left/right translations semigroup for rectangular bands # since they are monoids -InstallMethod(GeneratorsOfSemigroup, "for the translational hull of a rectangular band", +InstallMethod(GeneratorsOfSemigroup, +"for the translational hull of a rectangular band", [IsTranslationalHull], 2, function(H) local S, leftGens, rightGens, l, r, gens; - + S := UnderlyingSemigroup(H); if not IsRectangularBand(S) then TryNextMethod(); @@ -1072,18 +1075,18 @@ function(H) leftGens := GeneratorsOfSemigroup(LeftTranslationsSemigroup(S)); rightGens := GeneratorsOfSemigroup(RightTranslationsSemigroup(S)); gens := []; - + for l in leftGens do for r in rightGens do Add(gens, BitranslationNC(H, l, r)); od; od; - + return gens; end); ############################################################################# -# 4. Methods for monoids +# 4. Methods for monoids ############################################################################# # Translations of a monoid are all inner translations @@ -1093,7 +1096,8 @@ function(S) local L; L := LeftTranslationsSemigroup(S); if not HasGeneratorsOfSemigroup(L) then - SetGeneratorsOfSemigroup(L, GeneratorsOfSemigroup(InnerLeftTranslations(S))); + SetGeneratorsOfSemigroup(L, + GeneratorsOfSemigroup(InnerLeftTranslations(S))); fi; return L; end); @@ -1104,7 +1108,8 @@ function(S) local R; R := RightTranslationsSemigroup(S); if not HasGeneratorsOfSemigroup(R) then - SetGeneratorsOfSemigroup(R, GeneratorsOfSemigroup(InnerRightTranslations(S))); + SetGeneratorsOfSemigroup(R, + GeneratorsOfSemigroup(InnerRightTranslations(S))); fi; return R; end); @@ -1116,7 +1121,8 @@ function(S) local H; H := TranslationalHullSemigroup(S); if not HasGeneratorsOfSemigroup(H) then - SetGeneratorsOfSemigroup(H, GeneratorsOfSemigroup(InnerTranslationalHull(S))); + SetGeneratorsOfSemigroup(H, + GeneratorsOfSemigroup(InnerTranslationalHull(S))); fi; return H; end); @@ -1164,11 +1170,12 @@ InstallMethod(ViewObj, "for a semigroup of left or right translations", function(T) Print(""); end); - -InstallMethod(ViewObj, "for a semigroup of translations", + +InstallMethod(ViewObj, "for a semigroup of translations", [IsTranslationsSemigroup], PrintObj); InstallMethod(PrintObj, "for a semigroup of translations", @@ -1188,26 +1195,26 @@ function(T) return; end); -InstallMethod(ViewObj, "for a translation", +InstallMethod(ViewObj, "for a translation", [IsTranslationsSemigroupElement], PrintObj); InstallMethod(PrintObj, "for a translation", [IsTranslationsSemigroupElement], function(t) local L, S; - L := IsLeftTranslationsSemigroupElement(t); - if L then + L := IsLeftTranslationsSemigroupElement(t); + if L then S := UnderlyingSemigroup(LeftTranslationsSemigroupOfFamily(FamilyObj(t))); Print(""); end); -InstallMethod(ViewObj, "for a translational hull", +InstallMethod(ViewObj, "for a translational hull", [IsTranslationalHull], PrintObj); InstallMethod(PrintObj, "for a translational hull", @@ -1219,10 +1226,11 @@ end); InstallMethod(PrintObj, "for a subsemigroup of a translational hull", [IsTranslationalHull], function(H) - Print(""); + Print(""); end); -InstallMethod(ViewObj, "for a translational hull element", +InstallMethod(ViewObj, "for a translational hull element", [IsBitranslation], PrintObj); InstallMethod(PrintObj, "for a translational hull element", @@ -1230,7 +1238,8 @@ InstallMethod(PrintObj, "for a translational hull element", function(t) local H; H := TranslationalHullOfFamily(FamilyObj(t)); - Print(""); + Print(""); end); # Note the order of multiplication @@ -1238,20 +1247,20 @@ InstallMethod(\*, "for left translations of a semigroup", IsIdenticalObj, [IsLeftTranslationsSemigroupElement, IsLeftTranslationsSemigroupElement], function(x, y) - return Objectify(FamilyObj(x)!.type, [y![1]*x![1]]); + return Objectify(FamilyObj(x)!.type, [y![1] * x![1]]); end); InstallMethod(\=, "for left translations of a semigroup", IsIdenticalObj, [IsLeftTranslationsSemigroupElement, IsLeftTranslationsSemigroupElement], -function(x, y) +function(x, y) return x![1] = y![1]; end); InstallMethod(\<, "for left translations of a semigroup", IsIdenticalObj, [IsLeftTranslationsSemigroupElement, IsLeftTranslationsSemigroupElement], -function(x, y) +function(x, y) return x![1] < y![1]; end); @@ -1260,20 +1269,20 @@ InstallMethod(\*, "for right translations of a semigroup", IsIdenticalObj, [IsRightTranslationsSemigroupElement, IsRightTranslationsSemigroupElement], function(x, y) - return Objectify(FamilyObj(x)!.type, [x![1]*y![1]]); + return Objectify(FamilyObj(x)!.type, [x![1] * y![1]]); end); InstallMethod(\=, "for right translations of a semigroup", IsIdenticalObj, [IsRightTranslationsSemigroupElement, IsRightTranslationsSemigroupElement], -function(x, y) +function(x, y) return x![1] = y![1]; end); InstallMethod(\<, "for right translations of a semigroup", IsIdenticalObj, [IsRightTranslationsSemigroupElement, IsRightTranslationsSemigroupElement], -function(x, y) +function(x, y) return x![1] < y![1]; end); @@ -1282,22 +1291,26 @@ InstallMethod(\^, "for a semigroup element and a translation", function(x, t) local list; if IsLeftTranslationsSemigroupElement(t) then - list := AsListCanonical(UnderlyingSemigroup(LeftTranslationsSemigroupOfFamily(FamilyObj(t)))); + list := AsListCanonical(UnderlyingSemigroup( + LeftTranslationsSemigroupOfFamily( + FamilyObj(t)))); else - list := AsListCanonical(UnderlyingSemigroup(RightTranslationsSemigroupOfFamily(FamilyObj(t)))); + list := AsListCanonical(UnderlyingSemigroup( + RightTranslationsSemigroupOfFamily( + FamilyObj(t)))); fi; if not x in list then ErrorNoReturn("Semigroups: ^ for a semigroup element and translation: \n", "the first argument must be an element of the domain of the second,"); fi; - return list[Position(list, x)^t![1]]; + return list[Position(list, x) ^ t![1]]; end); InstallMethod(\*, "for translation hull elements (linked pairs)", IsIdenticalObj, [IsBitranslation, IsBitranslation], function(x, y) - return Objectify(FamilyObj(x)!.type, [x![1]*y![1], x![2]*y![2]]); + return Objectify(FamilyObj(x)!.type, [x![1] * y![1], x![2] * y![2]]); end); InstallMethod(\=, "for translational hull elements (linked pairs)", @@ -1314,37 +1327,23 @@ function(x, y) return x![1] < y![1] or (x![1] = y![1] and x![2] < y![2]); end); -InstallMethod(IsWholeFamily, "for a semigroup of translations of a rectangular band", -[IsTranslationsSemigroup], -function(T) - if IsLeftTranslationsSemigroup(T) then - return Size(T) = Size(LeftTranslationsSemigroupOfFamily(ElementsFamily( - FamilyObj(T)))); - else - return Size(T) = Size(RightTranslationsSemigroupOfFamily(ElementsFamily( - FamilyObj(T)))); - fi; -end); - -InstallMethod(IsWholeFamily, "for a subsemigroup of the translational hull of a rectangular band", -[IsTranslationalHull], -function(H) - return Size(H) = Size(TranslationalHullOfFamily(ElementsFamily(FamilyObj(H)))); -end); - -InstallMethod(UnderlyingSemigroup, "for a semigroup of left or right translations", +InstallMethod(UnderlyingSemigroup, +"for a semigroup of left or right translations", [IsTranslationsSemigroup], function(T) if IsLeftTranslationsSemigroup(T) then - return UnderlyingSemigroup(LeftTranslationsSemigroupOfFamily(ElementsFamily( + return UnderlyingSemigroup(LeftTranslationsSemigroupOfFamily( + ElementsFamily( FamilyObj(T)))); - else - return UnderlyingSemigroup(RightTranslationsSemigroupOfFamily(ElementsFamily( + else + return UnderlyingSemigroup(RightTranslationsSemigroupOfFamily( + ElementsFamily( FamilyObj(T)))); fi; end); -InstallMethod(UnderlyingSemigroup, "for a subsemigroup of the translational hull", +InstallMethod(UnderlyingSemigroup, +"for a subsemigroup of the translational hull", [IsTranslationalHull], function(H) return UnderlyingSemigroup(TranslationalHullOfFamily(ElementsFamily( @@ -1381,7 +1380,7 @@ end); InstallMethod(OneOp, "for a semigroup of translations", [IsTranslationsSemigroupElement], function(t) - local T, S, l, r; + local S, T; if IsLeftTranslationsSemigroupElement(t) then T := LeftTranslationsSemigroupOfFamily(FamilyObj(t)); S := UnderlyingSemigroup(T); @@ -1402,3 +1401,47 @@ InstallGlobalFunction(RightPartOfBitranslation, "for a bitranslation", function(h) return h![2]; end); + +InstallMethod(IsWholeFamily, "for a collection of translations", +[IsTranslationsSemigroupElementCollection], +function(C) + local L, S, T, t; + + t := Representative(C); + L := IsLeftTranslationsSemigroupElement(t); + + if L then + T := LeftTranslationsSemigroupOfFamily(FamilyObj(t)); + else + T := RightTranslationsSemigroupOfFamily(FamilyObj(t)); + fi; + + S := UnderlyingSemigroup(T); + + if not HasSize(T) or + IsRectangularBand(S) or + IsSimpleSemigroup(S) or + IsZeroSimpleSemigroup(S) or + IsMonoidAsSemigroup(S) then + TryNextMethod(); + fi; + + return Size(T) = Size(C); +end); + +InstallMethod(IsWholeFamily, "for a collection of bitranslations", +[IsBitranslationCollection], +function(C) + local b, H, S; + b := Representative(C); + H := TranslationalHullOfFamily(FamilyObj(b)); + S := UnderlyingSemigroup(H); + + if not HasSize(H) or + IsRectangularBand(S) or + IsMonoidAsSemigroup(S) then + TryNextMethod(); + fi; + + return Size(H) = Size(C); +end); diff --git a/tst/extreme/translat.tst b/tst/extreme/translat.tst index 5e0bb72ca..ef251061f 100644 --- a/tst/extreme/translat.tst +++ b/tst/extreme/translat.tst @@ -12,7 +12,7 @@ gap> LoadPackage("semigroups", false);; gap> SEMIGROUPS.StartTest(); #T# RZMS Translational Hull -gap> G := SmallGroup(12,1);; +gap> G := SmallGroup(12, 1);; gap> mat := [[0, G.2], [G.1, G.1], [G.2, 0]];; gap> S := ReesZeroMatrixSemigroup(G, mat);; gap> Size(TranslationalHull(S)); @@ -22,7 +22,7 @@ gap> for h in TranslationalHull(S) do > r := h![2]; > for s in S do > for t in S do -> if not s * (t^l) = (s ^ r) * t then +> if not s * (t ^ l) = (s ^ r) * t then > Print(s, t, h); > fi; > od; @@ -31,7 +31,8 @@ gap> for h in TranslationalHull(S) do #T# RMS Translational Hull gap> G := SmallGroup(12, 1);; -gap> mat := TransposedMat([[G.1, G.2, G.3*G.2, G.1*G.3], [G.2*G.2, G.3, G.1, G.3*G.3]]);; +gap> mat := TransposedMat([[G.1, G.2, G.3 * G.2, G.1 * G.3], +> [G.2 * G.2, G.3, G.1, G.3 * G.3]]);; gap> S := ReesMatrixSemigroup(G, mat);; gap> Size(TranslationalHull(S)); 444 diff --git a/tst/standard/translat.tst b/tst/standard/translat.tst index 4d3e24734..eedf6552c 100644 --- a/tst/standard/translat.tst +++ b/tst/standard/translat.tst @@ -12,7 +12,7 @@ gap> LoadPackage("semigroups", false);; gap> SEMIGROUPS.StartTest(); #T# Creation of translations semigroups -gap> S := RectangularBand(3,4);; +gap> S := RectangularBand(3, 4);; gap> L := LeftTranslationsSemigroup(S); > @@ -49,7 +49,7 @@ gap> r := RightTranslation(R, IdentityTransformation); #T# With calculation - rectangular bands -gap> S := RectangularBand(3,3); +gap> S := RectangularBand(3, 3); gap> L := LeftTranslations(S); SEMIGROUPS.Bitranslations(H); semigroup of size 9, degree 7 with 3 generators>> #T# small RZMS -gap> G := SmallGroup(4,2);; +gap> G := SmallGroup(4, 2);; gap> H := AsList(G);; -gap> mat := [ [H[1], 0], -> [H[2], H[2]] ];; +gap> mat := [[H[1], 0], +> [H[2], H[2]]];; gap> S := ReesZeroMatrixSemigroup(G, mat);; gap> L := LeftTranslations(S); R := SEMIGROUPS.RightTranslationsSemigroupElementsByGenerators( semigroup of size 4, degree 4 with 3 generators> with 17 generators> #T# Further test translations generation by digraph endomorphisms -gap> S := Semigroup([Transformation([2,4,4,1]), Transformation([2,3,2,1]), -> Transformation([3,3,3])]);; +gap> S := Semigroup([Transformation([2, 4, 4, 1]), Transformation([2, 3, 2, 1]), +> Transformation([3, 3, 3])]);; gap> L := LeftTranslations(S); > @@ -252,13 +252,13 @@ gap> SEMIGROUPS.bruteforcetranshull := function(S) > od; > return linkedpairs; > end;; -gap> G := SmallGroup(4,1);; +gap> G := SmallGroup(4, 1);; gap> H := ShallowCopy(AsList(G));; gap> mat := [[0, H[4]], [H[4], 0]];; gap> S := ReesZeroMatrixSemigroup(G, mat);; gap> Size(TranslationalHull(S)) = Size(SEMIGROUPS.bruteforcetranshull(S)); true -gap> S := RectangularBand(2,3);; +gap> S := RectangularBand(2, 3);; gap> Size(Semigroup(GeneratorsOfSemigroup(TranslationalHull(S)))) > = Size(SEMIGROUPS.bruteforcetranshull(S)); true @@ -267,7 +267,7 @@ true gap> S := ZeroSemigroup(4);; gap> Size(TranslationalHull(S)); 4096 -gap> S := Semigroup([Transformation([1,1,2]), Transformation([3,1,3])]);; +gap> S := Semigroup([Transformation([1, 1, 2]), Transformation([3, 1, 3])]);; gap> H := TranslationalHull(S);; gap> H = Semigroup(H); true @@ -313,7 +313,7 @@ gap> Semigroup(SEMIGROUPS.BitranslationsByGenerators(H)) = H; true #T# TranslationalHull for semigroups which are not IsEnumerableSemigroupRep -gap> S := Semigroup([Transformation([1,4,3,3]), Transformation([3,4,1,1])]);; +gap> S := Semigroup([Transformation([1, 4, 3, 3]), Transformation([3, 4, 1, 1])]);; gap> S := AsSemigroup(IsFpSemigroup, S);; gap> IsEnumerableSemigroupRep(S); false @@ -326,7 +326,7 @@ gap> for h in TranslationalHull(S) do > r := h![2]; > for s in S do > for t in S do -> if not s * (t^l) = (s ^ r) * t then +> if not s * (t ^ l) = (s ^ r) * t then > Print(s, t, h); > fi; > od; @@ -334,7 +334,7 @@ gap> for h in TranslationalHull(S) do > od; #T# Special methods for RMS -gap> G := SmallGroup(12,1);; +gap> G := SmallGroup(12, 1);; gap> mat := [[G.1, G.2], [G.1, G.1], [G.2, G.3]];; gap> S := ReesMatrixSemigroup(G, mat);; gap> T := Range(RMSNormalization(S));; @@ -381,10 +381,10 @@ gap> G := UnderlyingSemigroup(R); gap> L := LeftTranslations(R);; gap> RT := RightTranslations(R);; gap> H := TranslationalHull(R);; -gap> lgpfunc := [G.1*G.3*G.3, G.2];; -gap> rgpfunc := [G.1*G.3*G.3, G.3*G.3, G.2];; -gap> lt := Transformation([2,2]);; -gap> rt := Transformation([3,3,3]);; +gap> lgpfunc := [G.1 * G.3 * G.3, G.2];; +gap> rgpfunc := [G.1 * G.3 * G.3, G.3 * G.3, G.2];; +gap> lt := Transformation([2, 2]);; +gap> rt := Transformation([3, 3, 3]);; gap> l := LeftTranslationOfNormalRMS(L, lgpfunc, lt);; gap> r := RightTranslationOfNormalRMS(RT, rgpfunc, rt);; gap> h := BitranslationOfNormalRMS(H, l, r); @@ -397,7 +397,7 @@ the second and third arguments must be a linked left and right translation, re\ spectively, #T# IsWholeFamily for translations semigroups -gap> S := Semigroup([Transformation([1,1,2,4]), Transformation([3,1,3])]);; +gap> S := Semigroup([Transformation([1, 1, 2, 4]), Transformation([3, 1, 3])]);; gap> L := LeftTranslations(S);; gap> R := RightTranslations(S);; gap> Ll := ShallowCopy(AsList(L));; @@ -412,8 +412,10 @@ gap> IsWholeFamily(Semigroup(r)); false #T# Error Testing - Left Translations -gap> S := Semigroup([Transformation([1,4,3,3]), Transformation([3,4,1,1])]);; -gap> T := Semigroup([Transformation([5,2,3,2,1]), Transformation([2,3,1,1,2])]);; +gap> S := Semigroup([Transformation([1, 4, 3, 3]), +> Transformation([3, 4, 1, 1])]);; +gap> T := Semigroup([Transformation([5, 2, 3, 2, 1]), +> Transformation([2, 3, 1, 1, 2])]);; gap> L := LeftTranslationsSemigroup(S);; gap> R := RightTranslationsSemigroup(S);; gap> f := MappingByFunction(S, S, x -> S.1);; @@ -424,7 +426,7 @@ the mapping given must define a left translation, gap> LeftTranslation(R, f); Error, Semigroups: LeftTranslation: the first argument must be a semigroup of left translations, -gap> LeftTranslation(L, (1,4)(2,3)); +gap> LeftTranslation(L, (1, 4)(2, 3)); Error, Semigroups: LeftTranslation: the first argument should be a left translations semigroup, and the second arg\ ument should be a mapping on the underlying semigroup of the first argument, o\ @@ -433,21 +435,23 @@ gap> LeftTranslation(L, g); Error, Semigroups: LeftTranslation (from Mapping): the domain and range of the second argument must be the underlying semigroup o\ f the first, -gap> x := [2..Size(S)+1];; +gap> x := [2 .. Size(S) + 1];; gap> Add(x, 1);; gap> LeftTranslation(L, Transformation(x)); Error, Semigroups: LeftTranslation (from transformation): the second argument must act on the indices of the underlying semigroup of the\ first argument, -gap> S := RectangularBand(2,3);; +gap> S := RectangularBand(2, 3);; gap> L := LeftTranslationsSemigroup(S);; -gap> l := LeftTranslation(L, Transformation([1,1,1,1,1,1])); +gap> l := LeftTranslation(L, Transformation([1, 1, 1, 1, 1, 1])); Error, Semigroups: LeftTranslation: the transformation given must define a left translation, #T# Error Testing - Right Translations -gap> S := Semigroup([Transformation([1,4,3,3]), Transformation([3,4,1,1])]);; -gap> T := Semigroup([Transformation([5,2,3,2,1]), Transformation([2,3,1,1,2])]);; +gap> S := Semigroup([Transformation([1, 4, 3, 3]), +> Transformation([3, 4, 1, 1])]);; +gap> T := Semigroup([Transformation([5, 2, 3, 2, 1]), +> Transformation([2, 3, 1, 1, 2])]);; gap> L := LeftTranslationsSemigroup(S);; gap> R := RightTranslationsSemigroup(S);; gap> f := MappingByFunction(S, S, x -> S.1);; @@ -458,7 +462,7 @@ the mapping given must define a right translation, gap> RightTranslation(L, f); Error, Semigroups: RightTranslation: the first argument must be a semigroup of right translations, -gap> RightTranslation(R, (1,4)(2,3)); +gap> RightTranslation(R, (1, 4)(2, 3)); Error, Semigroups: RightTranslation: the first argument should be a right translations semigroup, and the second ar\ gument should be a mapping on the underlying semigroup of the first argument, \ @@ -467,35 +471,35 @@ gap> RightTranslation(R, g); Error, Semigroups: RightTranslation (from Mapping): the domain and range of the second argument must be the underlying semigroup o\ f the first, -gap> x := [2..Size(S)+1];; +gap> x := [2 .. Size(S) + 1];; gap> Add(x, 1);; gap> RightTranslation(R, Transformation(x)); Error, Semigroups: RightTranslation (from transformation): the second argument must act on the indices of the underlying semigroup of the\ first argument, -gap> S := RectangularBand(2,3);; +gap> S := RectangularBand(2, 3);; gap> R := RightTranslationsSemigroup(S);; -gap> r := RightTranslation(R, Transformation([1,1,1,1,1,1])); +gap> r := RightTranslation(R, Transformation([1, 1, 1, 1, 1, 1])); Error, Semigroups: RightTranslation: the transformation given must define a right translation, #T# Error Testing - Left Translations Without Generators gap> S := SymmetricGroup(4);; gap> L := LeftTranslationsSemigroup(S);; -gap> LeftTranslation(L, Transformation([1,1,1,1,1,1])); +gap> LeftTranslation(L, Transformation([1, 1, 1, 1, 1, 1])); Error, Semigroups: LeftTranslation: the transformation given must define a left translation, #T# Error Testing - Right Translations Without Generators gap> S := SymmetricGroup(4);; gap> R := RightTranslationsSemigroup(S);; -gap> RightTranslation(R, Transformation([1,1,1,1,1,1])); +gap> RightTranslation(R, Transformation([1, 1, 1, 1, 1, 1])); Error, Semigroups: RightTranslation: the transformation given must define a right translation, #T# Error Testing - Translational Hull Elements -gap> S := Semigroup([Transformation([1,4,3,3]), Transformation([3,4,1,1])]);; -gap> T := RectangularBand(3,4);; +gap> S := Semigroup([Transformation([1, 4, 3, 3]), Transformation([3, 4, 1, 1])]);; +gap> T := RectangularBand(3, 4);; gap> L := LeftTranslationsSemigroup(S);; gap> R := RightTranslationsSemigroup(S);; gap> RT := RightTranslationsSemigroup(T);; @@ -525,13 +529,13 @@ gap> L := LeftTranslationsSemigroup(S);; gap> R := RightTranslationsSemigroup(S);; gap> H := TranslationalHullSemigroup(S);; gap> l := LeftTranslationNC(L, IdentityTransformation);; -gap> r := RightTranslationNC(R, Transformation([2,1,4,3,6,5]));; +gap> r := RightTranslationNC(R, Transformation([2, 1, 4, 3, 6, 5]));; gap> Bitranslation(H, l, r); Error, Semigroups: Bitranslation: the translations given must form a linked pair, #T# Hashing translations -gap> S := Semigroup([Transformation([1,4,3,3]), Transformation([3,4,1,1])]);; +gap> S := Semigroup([Transformation([1, 4, 3, 3]), Transformation([3, 4, 1, 1])]);; gap> L := LeftTranslations(S);; gap> R := RightTranslations(S);; gap> l := Representative(L);; @@ -546,7 +550,7 @@ gap> for r in R do > od; #T# Hashing translational hull elements -gap> S := Semigroup([Transformation([1,4,3,3]), Transformation([3,4,1,1])]);; +gap> S := Semigroup([Transformation([1, 4, 3, 3]), Transformation([3, 4, 1, 1])]);; gap> H := TranslationalHull(S);; gap> ht := HTCreate(Representative(H));; gap> for h in H do