Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
affb39b
mitsch order methods
Tianrun-Y Jul 24, 2024
27eb838
fix declaration and method problem and remove ExistsTransversal as a …
Tianrun-Y Jul 26, 2024
3f1f82d
fix formatting for gaplint
Tianrun-Y Jul 26, 2024
790c32a
fix formatting for gaplint
Tianrun-Y Jul 29, 2024
46f97d7
remove redundant filter
Tianrun-Y Jul 31, 2024
c0f5385
add nambooripad method
Tianrun-Y Jul 31, 2024
8a02024
add nambooripad method
Tianrun-Y Jul 31, 2024
653a959
add IsRefinementKernelOfTransformation
Tianrun-Y Aug 7, 2024
1baed0e
fix IsRefinementKernelOfTransformation
Tianrun-Y Aug 7, 2024
6edd905
Update gap/attributes/attr.gi
Tianrun-Y Aug 7, 2024
18edcfd
Update gap/attributes/attr.gi
Tianrun-Y Aug 7, 2024
47a7653
Update gap/attributes/attr.gi
Tianrun-Y Aug 7, 2024
1ec7731
Update gap/attributes/attr.gi
Tianrun-Y Aug 7, 2024
9ff45bb
move the kernerl containment away
Tianrun-Y Aug 7, 2024
185fdde
Merge branch 'mitsch-new' of github.com:/Tianrun-Y/Semigroups into mi…
Tianrun-Y Aug 7, 2024
e679757
add documentation for IsRefinementKernelOfTransformation
Tianrun-Y Aug 14, 2024
3d7bd8c
small changes
Tianrun-Y Aug 14, 2024
5119849
small changes
Tianrun-Y Aug 14, 2024
6fb4a4a
add test
Tianrun-Y Aug 21, 2024
334d361
small edits
Tianrun-Y Aug 21, 2024
49e775b
add two argument version of IsRefinementKernelOfTransformation
Tianrun-Y Aug 21, 2024
dfc6a66
fix test
Tianrun-Y Aug 21, 2024
ae4f45d
small edits
Tianrun-Y Aug 21, 2024
2e17d1b
documentation
Tianrun-Y Aug 21, 2024
fac9442
Merge branch 'main' of http://github.com/semigroups/semigroups into m…
Tianrun-Y Aug 23, 2024
b24f3c7
Update gap/attributes/attr.gi
james-d-mitchell Apr 7, 2025
5ca82f0
Update gap/attributes/attr.gi
james-d-mitchell Apr 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gap/attributes/attr.gd
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ DeclareAttribute("IndecomposableElements", IsSemigroup);
DeclareAttribute("NambooripadLeqRegularSemigroup", IsSemigroup);
DeclareAttribute("NambooripadPartialOrder", IsSemigroup);

DeclareOperation("KernelContainment",
[IsTransformation, IsTransformation, IsPosInt]);
Comment on lines +75 to +76

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation KernelContainment declared but never defined.

DeclareAttribute("RegularLeqTransformationSemigroup", IsTransformationSemigroup);
DeclareAttribute("MitschLeqSemigroup", IsSemigroup);
DeclareAttribute("MitschOrderOfTransformationSemigroup",
IsFinite and IsTransformationSemigroup);
DeclareAttribute("MitschOrderOfSemigroup", IsFinite and IsSemigroup);
DeclareAttribute("DumbMitschOrderOfSemigroup", IsFinite and IsSemigroup);

DeclareOperation("LeftIdentity", [IsSemigroup, IsMultiplicativeElement]);
DeclareOperation("RightIdentity", [IsSemigroup, IsMultiplicativeElement]);

Expand Down
182 changes: 182 additions & 0 deletions gap/attributes/attr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,188 @@ function(S)
end;
end);

InstallMethod(KernelContainment,
Comment thread
james-d-mitchell marked this conversation as resolved.
Outdated
"for two transformations in a semigroup of degree n",
[IsTransformation, IsTransformation, IsPosInt],
function(a, b, n)
local m, i, idx, q, class;
if DegreeOfTransformation(a) > n or
DegreeOfTransformation(b) > n then
ErrorNoReturn
("Transformation does not belong
to a transformation semigroup of degree n");
fi;
q := [];
for class in KernelOfTransformation(a, n) do
m := Minimum(class);
for i in class do
q[i] := m;
od;
od;
for class in KernelOfTransformation(b, n) do
idx := q[class[1]];
for i in class do
if q[i] <> idx then
return false;
fi;
od;
od;
return true;
end);

SEMIGROUPS.ExistsTransversal := function(a, b, n)
local exists, class, i;
if DegreeOfTransformation(a) > n or
DegreeOfTransformation(b) > n then
ErrorNoReturn("Transformation does not
belong to a transformation semigroup of degree n");
fi;
for class in KernelOfTransformation(a, n) do
exists := false;
for i in [1 .. Size(class)] do
if class[i] ^ a = class[i] ^ b then
exists := true;
break;
fi;
od;
if exists = false then
Comment thread
Tianrun-Y marked this conversation as resolved.
Outdated
return false;
fi;
od;
return true;
end;

InstallMethod(RegularLeqTransformationSemigroup,
"for a transformation semigroup",
[IsTransformationSemigroup],
function(S)
local deg;
deg := DegreeOfTransformationSemigroup(S);
return
function(x, y)
# Only returns the correct answer if y is a regular element

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add check that y is regular.

Also what happens if x or y not in S?

return KernelContainment(x, y, deg)
and SEMIGROUPS.ExistsTransversal(x, y, deg);
end;
end);

InstallMethod(MitschLeqSemigroup,
"for a semigroup",
[IsSemigroup],
function(S)
if IsInverseSemigroup(S) then
return NaturalLeqInverseSemigroup(S);
Comment thread
Tianrun-Y marked this conversation as resolved.
Outdated
fi;

return
function(x, y)
if x = y then
return true;
else
return ForAny(Elements(S), s -> x = x * s and x = y * s) and
ForAny(Elements(S), t -> t * y = x and t * x = x);
Comment thread
james-d-mitchell marked this conversation as resolved.
Outdated
fi;
end;
end);

InstallMethod(MitschOrderOfTransformationSemigroup,
"for a finite transformation semigroup",
[IsFinite and IsTransformationSemigroup],
Comment thread
Tianrun-Y marked this conversation as resolved.
Outdated
function(S)
local elts, p, func1, func2, out, i, j, regular, D, a;
elts := ShallowCopy(Elements(S));
Comment thread
Tianrun-Y marked this conversation as resolved.
Outdated
p := Sortex(elts, {x, y} -> IsGreensDGreaterThanFunc(S)(y, x)) ^ -1;
func1 := RegularLeqTransformationSemigroup(S);
func2 := MitschLeqSemigroup(S);
out := List([1 .. Size(S)], x -> []);
regular := ListWithIdenticalEntries(Size(S), false);
Comment thread
Tianrun-Y marked this conversation as resolved.
Outdated
for D in RegularDClasses(S) do
Comment thread
Tianrun-Y marked this conversation as resolved.
for a in D do
i := Position(elts, a);
Comment thread
Tianrun-Y marked this conversation as resolved.
Outdated
regular[i] := true;
od;
od;
for j in [Size(S), Size(S) - 1 .. 1] do
if regular[j] then
for i in [j - 1, j - 2 .. 1] do
if func1(elts[i], elts[j]) then
AddSet(out[j ^ p], i ^ p);
fi;
od;
else
for i in [j - 1, j - 2 .. 1] do
if func2(elts[i], elts[j]) then
AddSet(out[j ^ p], i ^ p);
fi;
od;
fi;
od;
return out;
end);

InstallMethod(MitschOrderOfTransformationSemigroup,
Comment thread
james-d-mitchell marked this conversation as resolved.
Outdated
"for a finite regular transformation semigroup",
[IsFinite and IsRegularSemigroup and IsTransformationSemigroup],
Comment thread
Tianrun-Y marked this conversation as resolved.
Outdated
function(S)
local elts, p, func, out, i, j;
elts := ShallowCopy(Elements(S));
p := Sortex(elts, {x, y} -> IsGreensDGreaterThanFunc(S)(y, x)) ^ -1;
func := RegularLeqTransformationSemigroup(S);
out := List([1 .. Size(S)], x -> []);
for i in [1 .. Size(S)] do
for j in [i + 1 .. Size(S)] do
if func(elts[i], elts[j]) then
AddSet(out[j ^ p], i ^ p);
fi;
od;
od;
return out;
end);

InstallMethod(MitschOrderOfSemigroup,
"for a finite semigroup",
[IsFinite and IsSemigroup],
function(S)
local i, iso, T, MT, MS, eltsS, eltsT, idx_map, q;
if IsInverseSemigroup(S) then
return NaturalPartialOrder(S);
elif IsTransformationSemigroup(S) then
return MitschOrderOfTransformationSemigroup(S);
fi;
iso := IsomorphismTransformationSemigroup(S);
T := Range(iso);
eltsS := Elements(S);
eltsT := Elements(T);
idx_map := List([1 .. Size(S)], i -> Position(eltsT, eltsS[i] ^ iso));
q := PermList(idx_map);
MT := MitschOrderOfTransformationSemigroup(T);
MS := [];
for i in [1 .. Size(S)] do
MS[i] := AsSet(OnTuples(MoT[i ^ q], q ^ -1));
od;
return MS;
end);

InstallMethod(DumbMitschOrderOfSemigroup,
"for a finite semigroup",
[IsSemigroup and IsFinite],
function(S)
local func, out, i, j, elts;
func := MitschLeqSemigroup(S);
elts := Elements(S);
out := List([1 .. Size(S)], x -> []);
for i in [1 .. Size(S)] do
for j in [1 .. Size(S)] do
if i = j then
continue;
elif func(elts[i], elts[j]) then
AddSet(out[j], i);
fi;
od;
od;
return out;
end);
Comment on lines +1188 to +1206

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably not be a separate method. I would suggest adding an optional flag for MitschOrderOfSemigroup which indicates the method should use the "dumb" algorithm. Also, if the dumb algorithm is always slower then this bit of code can be removed. Needs some benchmarks.


InstallMethod(LeftIdentity,
"for semigroup with CanUseFroidurePin and mult. elt.",
[IsSemigroup and CanUseFroidurePin, IsMultiplicativeElement],
Expand Down