-
Notifications
You must be signed in to change notification settings - Fork 38
Mitsch Order #1024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Mitsch Order #1024
Changes from all commits
affb39b
27eb838
3f1f82d
790c32a
46f97d7
c0f5385
8a02024
653a959
1baed0e
6edd905
18edcfd
47a7653
1ec7731
9ff45bb
185fdde
e679757
3d7bd8c
5119849
6fb4a4a
334d361
49e775b
dfc6a66
ae4f45d
2e17d1b
fac9442
b24f3c7
5ca82f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1317,6 +1317,41 @@ true]]></Example> | |
| </ManSection> | ||
| <#/GAPDoc> | ||
|
|
||
| <#GAPDoc Label="MitschOrderOfSemigroup"> | ||
| <ManSection> | ||
| <Attr Name="MitschOrderOfSemigroup" Arg="S"/> | ||
| <Returns>The Mitsch partial order on a semigroup.</Returns> | ||
| <Description> | ||
| The <E>Mitsch partial order</E> <M>\leq</M> on a semigroup <A>S</A> | ||
| is defined by <C>a</C><M>\leq</M><C>b</C> if there exists <C>s</C> and | ||
| <C>t</C> in <M>S^1</M> such that | ||
| <C>tb</C><M>=</M><C>ta</C><M>=</M><C>a</C><M>=</M><C>as</C><M>=</M><C>bs</C>. | ||
| <C>MitschOrderOfSemigroup</C> returns the Mitsch partial order on the | ||
| semigroup <A>S</A> as a list of sets of positive integers where | ||
| entry <C>i</C> in <C>MitschOrderOfSemigroup(<A>S</A>)</C> is the set of | ||
| positions in <C>Elements(<A>S</A>)</C> of elements which are less than | ||
| <C>Elements(<A>S</A>)[i]</C>. See also <Ref | ||
| Func="MitschLeqOfSemigroup"/>. | ||
| <Example><![CDATA[ | ||
| gap> S := BrauerMonoid(3); | ||
| <regular bipartition *-monoid of degree 3 with 3 generators> | ||
| gap> IsRegularSemigroup(S); | ||
| true | ||
| gap> Size(S); | ||
| 15 | ||
| gap> NambooripadPartialOrder(S); | ||
| [ [ ], [ ], [ ], [ ], [ ], [ ], [ ], [ ], [ ], | ||
| [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], | ||
| [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], | ||
| [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ] | ||
| gap> NambooripadLeqRegularSemigroup(S)(Elements(S)[3], Elements(S)[9]); | ||
| false | ||
| gap> NambooripadLeqRegularSemigroup(S)(Elements(S)[2], Elements(S)[15]); | ||
|
Comment on lines
+1336
to
+1349
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Example seems to be for |
||
| true]]></Example> | ||
| </Description> | ||
| </ManSection> | ||
| <#/GAPDoc> | ||
|
|
||
| <#GAPDoc Label="SmallerDegreeTransformationRepresentation"> | ||
| <ManSection> | ||
| <Attr Name="SmallerDegreeTransformationRepresentation" Arg="S"/> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,3 +43,40 @@ Transformation( [ 3, 5, 2, 2, 2 ] )]]></Example> | |||||||||
| </Description> | ||||||||||
| </ManSection> | ||||||||||
| <#/GAPDoc> | ||||||||||
|
|
||||||||||
| <#GAPDoc Label="IsRefinementKernelOfTransformation"> | ||||||||||
| <ManSection> | ||||||||||
| <Func Name = "IsRefinementKernelOfTransformation" Arg = "trans1, trans2, n"/> | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 2-parameter version of this function should also be documented. |
||||||||||
| <Returns> | ||||||||||
| True or False. | ||||||||||
| </Returns> | ||||||||||
| <Description> | ||||||||||
| If <A>trans1</A> and <A>trans2</A> are two transformations belonging | ||||||||||
| to a transformation semigroup of degree <C>n</C>, then | ||||||||||
| <C>IsRefinementKernelOfTransformation</C> returns True if the kernel of | ||||||||||
| <A>trans1</A> is a refinement of the kernel of <A>trans2</A> and returns | ||||||||||
| False otherwise. | ||||||||||
| An error message will be raised if <A>trans1</A> or <A>trans2</A> has degree | ||||||||||
| higher than <C>n</C> and hence cannot belong to a semigroup of degree | ||||||||||
| <C>n</C>. | ||||||||||
|
Comment on lines
+60
to
+61
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| <Example><![CDATA[ | ||||||||||
| gap> s := Transformation([2,2,3,2]); | ||||||||||
| Transformation( [ 2, 2, 3, 2 ] ) | ||||||||||
| gap> t := Transformation([2,2,3,3]); | ||||||||||
| Transformation( [ 2, 2, 3, 3 ] ) | ||||||||||
| gap> IsRefinementKernelOfTransformation(s, t, 4); | ||||||||||
| false | ||||||||||
| gap> a := Transformation([2,4,3,2]); | ||||||||||
| Transformation( [ 2, 4, 3, 2 ] ) | ||||||||||
| gap> b := Transformation([3,3,1,3]); | ||||||||||
| Transformation( [ 3, 3, 1, 3 ] ) | ||||||||||
| gap> IsRefinementKernelOfTransformation(a, b, 4); | ||||||||||
| false | ||||||||||
| gap> IsRefinementKernelOfTransformation(b, a, 4); | ||||||||||
| true | ||||||||||
| gap> IsRefinementKernelOfTransformation(b, a, 3); | ||||||||||
| Error, Degree of the first transformation greater than 3. | ||||||||||
| Expecting a degree at most n, found 4 instead.]]></Example> | ||||||||||
| </Description> | ||||||||||
| </ManSection> | ||||||||||
| <#/GAPDoc> | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,16 @@ DeclareAttribute("IndecomposableElements", IsSemigroup); | |
| DeclareAttribute("NambooripadLeqRegularSemigroup", IsSemigroup); | ||
| DeclareAttribute("NambooripadPartialOrder", IsSemigroup); | ||
|
|
||
| DeclareOperation("KernelContainment", | ||
| [IsTransformation, IsTransformation, IsPosInt]); | ||
|
Comment on lines
+75
to
+76
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Operation |
||
| DeclareAttribute("RegularLeqTransformationSemigroupNC", IsTransformationSemigroup); | ||
| DeclareAttribute("MitschLeqSemigroupNC", IsSemigroup); | ||
| 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]); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1045,13 +1045,166 @@ function(S) | |
|
|
||
| return | ||
| function(x, y) | ||
| local R; | ||
| R := RClass(S, x); | ||
| return IsGreensLessThanOrEqual(R, RClass(S, y)) | ||
| and ForAny(Idempotents(R), e -> e * y = x); | ||
| local E; | ||
| E := Idempotents(S); | ||
| return ForAny(E, e -> e * y = x) | ||
| and ForAny(E, f -> y * f = x); | ||
|
Comment on lines
+1048
to
+1051
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to see some benchmarks for this change. I can believe its faster for certain semigroups, but wouldn't this change make it slower for semigroups that have lots of idempotents but small R-classes, e.g. lattices? |
||
| end; | ||
| 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 | ||
| if ForAll(class, x -> x ^ a <> x ^ b) then | ||
| return false; | ||
| fi; | ||
| od; | ||
| return true; | ||
| end; | ||
|
|
||
| InstallMethod(RegularLeqTransformationSemigroupNC, | ||
| #intended for internal use; see MitschLeqSemigroup for public use | ||
| "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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add check that Also what happens if |
||
| return IsRefinementKernelOfTransformation(x, y, deg) | ||
| and SEMIGROUPS.ExistsTransversal(x, y, deg); | ||
| end; | ||
| end); | ||
|
|
||
| InstallMethod(MitschLeqSemigroupNC, | ||
| "for a semigroup", | ||
| [IsSemigroup], | ||
| function(S) | ||
| return | ||
| function(x, y) | ||
| if x = y then | ||
| return true; | ||
| else | ||
| return ForAny(S, s -> x = x * s and x = y * s) and | ||
| ForAny(S, t -> t * y = x and t * x = x); | ||
| fi; | ||
| end; | ||
| end); | ||
|
|
||
| InstallMethod(MitschLeqSemigroup, | ||
| "for a semigroup", | ||
| [IsSemigroup], | ||
| function(S) | ||
| if IsInverseSemigroup(S) then | ||
| return NaturalLeqInverseSemigroup(S); | ||
| elif IsRegularSemigroup(S) and IsTransformationSemigroup(S) then | ||
| return RegularLeqTransformationSemigroupNC(S); | ||
| elif IsRegularSemigroup(S) then | ||
| return NambooripadLeqRegularSemigroup(S); | ||
| else | ||
| return MitschLeqSemigroupNC(S); | ||
| fi; | ||
| end); | ||
|
|
||
| InstallMethod(MitschOrderOfSemigroup, | ||
| "for a finite transformation semigroup", | ||
| [IsTransformationSemigroup], | ||
| function(S) | ||
| local elts, p, func1, func2, out, i, j, regular, D, a; | ||
| elts := ShallowCopy(AsListCanonical(S)); | ||
| p := Sortex(elts, {x, y} -> IsGreensDGreaterThanFunc(S)(y, x)) ^ -1; | ||
| func1 := RegularLeqTransformationSemigroupNC(S); | ||
| func2 := MitschLeqSemigroupNC(S); | ||
| out := List([1 .. Size(S)], x -> []); | ||
| regular := BlistList([1 .. Size(S)], []); | ||
| for D in RegularDClasses(S) do | ||
Tianrun-Y marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| for a in D do | ||
| i := PositionCanonical(S, a) ^ (p ^ -1); | ||
| 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(MitschOrderOfSemigroup, | ||
| "for a finite regular transformation semigroup", | ||
| [IsRegularSemigroup and IsTransformationSemigroup], | ||
| function(S) | ||
| local elts, p, func, out, i, j; | ||
| elts := ShallowCopy(Elements(S)); | ||
| p := Sortex(elts, {x, y} -> IsGreensDGreaterThanFunc(S)(y, x)) ^ -1; | ||
| func := RegularLeqTransformationSemigroupNC(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; | ||
| 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 := MitschOrderOfSemigroup(T); | ||
| MS := []; | ||
| for i in [1 .. Size(S)] do | ||
| MS[i] := AsSet(OnTuples(MT[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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| InstallMethod(LeftIdentity, | ||
| "for semigroup with CanUseFroidurePin and mult. elt.", | ||
| [IsSemigroup and CanUseFroidurePin, IsMultiplicativeElement], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,7 @@ DeclareAttribute("CanonicalTransformation", IsTransformation); | |
| DeclareOperation("CanonicalTransformation", [IsTransformation, IsInt]); | ||
| DeclareOperation("TransformationByImageAndKernel", | ||
| [IsHomogeneousList, IsCyclotomicCollColl]); | ||
| DeclareOperation("IsRefinementKernelOfTransformation", | ||
| [IsTransformation, IsTransformation, IsInt]); | ||
| DeclareOperation("IsRefinementKernelOfTransformation", | ||
| [IsTransformation, IsTransformation]); | ||
|
Comment on lines
+14
to
+17
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest removing the 3-parameter version of |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,3 +48,60 @@ end); | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| InstallMethod(IndexPeriodOfSemigroupElement, "for a transformation", | ||||||||||||||||||||||||||||||||||||
| [IsTransformation], IndexPeriodOfTransformation); | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| InstallMethod(IsRefinementKernelOfTransformation, | ||||||||||||||||||||||||||||||||||||
| "for two transformations in a semigroup of degree n", | ||||||||||||||||||||||||||||||||||||
| [IsTransformation, IsTransformation, IsInt], | ||||||||||||||||||||||||||||||||||||
| function(a, b, n) | ||||||||||||||||||||||||||||||||||||
| local m, i, idx, q, class; | ||||||||||||||||||||||||||||||||||||
| if DegreeOfTransformation(a) > n then | ||||||||||||||||||||||||||||||||||||
| ErrorNoReturn("Degree of the first transformation greater than ", n, | ||||||||||||||||||||||||||||||||||||
| ".\nExpecting a degree at most n, found ", DegreeOfTransformation(a), | ||||||||||||||||||||||||||||||||||||
| " instead."); | ||||||||||||||||||||||||||||||||||||
| fi; | ||||||||||||||||||||||||||||||||||||
| if DegreeOfTransformation(b) > n then | ||||||||||||||||||||||||||||||||||||
| ErrorNoReturn("Degree of the second transformation greater than ", n, | ||||||||||||||||||||||||||||||||||||
| ".\nExpecting a degree at most n, found ", DegreeOfTransformation(b), | ||||||||||||||||||||||||||||||||||||
| " instead."); | ||||||||||||||||||||||||||||||||||||
| 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; | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+67
to
+82
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some code duplication between the two versions of
Suggested change
|
||||||||||||||||||||||||||||||||||||
| end); | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| InstallMethod(IsRefinementKernelOfTransformation, | ||||||||||||||||||||||||||||||||||||
| "for two transformations", | ||||||||||||||||||||||||||||||||||||
| [IsTransformation, IsTransformation], | ||||||||||||||||||||||||||||||||||||
| function(a, b) | ||||||||||||||||||||||||||||||||||||
| local m, i, idx, q, class, n; | ||||||||||||||||||||||||||||||||||||
| n := Maximum(DegreeOfTransformation(a), DegreeOfTransformation(b)); | ||||||||||||||||||||||||||||||||||||
| 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); | ||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing documentation for
MitschLeqOfSemigroup.