From 0b89ac32f73a696ead15acfcf71011afb8a12000 Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Mon, 29 Jan 2018 10:14:18 +0000 Subject: [PATCH] gren: add methods for partial order of L/R-classes --- doc/attr.xml | 12 ++++++++---- doc/gree.xml | 43 +++++++++++++++++++++++++++++++----------- doc/z-chap13.xml | 4 ++-- gap/attributes/attr.gd | 2 ++ gap/attributes/attr.gi | 26 +++++++++++++++++++++++++ gap/greens/gree.gd | 2 ++ gap/greens/gren.gi | 42 +++++++++++++++++++++++++++++++++++++++++ tst/standard/attr.tst | 24 +++++++++++++++++++++++ tst/standard/gren.tst | 26 +++++++++++++++++++++++++ 9 files changed, 164 insertions(+), 17 deletions(-) diff --git a/doc/attr.xml b/doc/attr.xml index 4fc22db4a8..8e7a49f327 100644 --- a/doc/attr.xml +++ b/doc/attr.xml @@ -187,13 +187,17 @@ gap> MinimalDClass(S); <#/GAPDoc> -<#GAPDoc Label="MaximalDClasses"> +<#GAPDoc Label="MaximalXClasses"> + MaximalXClasses - The maximal &D;-classes of a semigroup. + + + The maximal &D;, &L;, or &R;-classes of a semigroup. - MaximalDClasses returns the maximal &D;-classes with respect to - the partial order of &D;-classes.

+ Let X be one of Green's &D;-, &L;-, or &R;-relations. Then + MaximalXClasses returns the maximal Green's X-classes with + respect to the partial order of X-classes.

See also , , and diff --git a/doc/gree.xml b/doc/gree.xml index 8c25521d67..aea34a2057 100644 --- a/doc/gree.xml +++ b/doc/gree.xml @@ -922,21 +922,42 @@ gap> AsSet(RegularDClasses(S)); <#/GAPDoc> -<#GAPDoc Label="PartialOrderOfDClasses"> +<#GAPDoc Label="PartialOrderOfXClasses"> + PartialOrderOfXClasses - The partial order of the &D;-classes of S. + + + The partial order of the &D;, &L;, or &R;-classes of S. - Returns a list list where list[i] contains every j such - that GreensDClasses(S)[j] is immediately less than - GreensDClasses(S)[i] in the partial order of &D;- classes of - S. There might be other indices in list, and it may or may not - include i. The reflexive transitive closure of the relation defined - by list is the partial order of &D;-classes of S.

- - The partial order on the &D;-classes is defined by x\leq y if and only - if S ^ 1xS ^ 1 is a subset of S ^ 1yS ^ 1.

+ Let X be one of Green's &D;-, &L;-, or &R;-relations. Then + PartialOrderOfXClasses returns a list list where + list[i] contains every j such that GreensXClasses(S)[j] + is immediately less than GreensXClasses(S)[i] in the partial order of + X-classes of S. There might be other indices in list, + and it may or may not include i. The reflexive transitive closure of + the relation defined by list is the partial order of X-classes + of S.

+ + The partial order on the X-classes is defined as follows. + + Green's &D;-relation: + + x\leq y if and only if S ^ 1xS ^ 1 is a subset of + S ^ 1yS ^ 1. + + Green's &L;-relation: + + x\leq y if and only if S ^ 1x is a subset of + S ^ 1y. + + Green's &R;-relation: + + x\leq y if and only if xS ^ 1 is a subset of + yS ^ 1. + + See also , , diff --git a/doc/z-chap13.xml b/doc/z-chap13.xml index cd7e6b5d91..081687f91d 100644 --- a/doc/z-chap13.xml +++ b/doc/z-chap13.xml @@ -25,10 +25,10 @@ <#Include Label = "GreensXClasses"> <#Include Label = "XClassReps"> <#Include Label = "MinimalDClass"> - <#Include Label = "MaximalDClasses"> + <#Include Label = "MaximalXClasses"> <#Include Label = "NrRegularDClasses"> <#Include Label = "NrXClasses"> - <#Include Label = "PartialOrderOfDClasses"> + <#Include Label = "PartialOrderOfXClasses"> <#Include Label = "LengthOfLongestDClassChain"> <#Include Label = "IsGreensDGreaterThanFunc"> diff --git a/gap/attributes/attr.gd b/gap/attributes/attr.gd index ca3852c84c..aa3274d828 100644 --- a/gap/attributes/attr.gd +++ b/gap/attributes/attr.gd @@ -54,6 +54,8 @@ DeclareAttribute("StructureDescription", IsGroupAsSemigroup); DeclareAttribute("StructureDescriptionMaximalSubgroups", IsSemigroup); DeclareAttribute("MaximalDClasses", IsSemigroup); +DeclareAttribute("MaximalLClasses", IsSemigroup); +DeclareAttribute("MaximalRClasses", IsSemigroup); DeclareAttribute("MinimalDClass", IsSemigroup); DeclareAttribute("IsGreensDGreaterThanFunc", IsSemigroup); diff --git a/gap/attributes/attr.gi b/gap/attributes/attr.gi index 022409a61f..876973be38 100644 --- a/gap/attributes/attr.gi +++ b/gap/attributes/attr.gi @@ -533,6 +533,32 @@ InstallMethod(MaximalDClasses, "for a finite monoid as semigroup", [IsFinite and IsMonoidAsSemigroup], S -> [DClass(S, MultiplicativeNeutralElement(S))]); +InstallMethod(MaximalLClasses, "for an enumerable semigroup", +[IsEnumerableSemigroupRep], +function(S) + local gr; + + if NrLClasses(S) = 1 then + return LClasses(S); + fi; + + gr := DigraphRemoveLoops(Digraph(PartialOrderOfLClasses(S))); + return LClasses(S){DigraphSources(gr)}; +end); + +InstallMethod(MaximalRClasses, "for an enumerable semigroup", +[IsEnumerableSemigroupRep], +function(S) + local gr; + + if NrRClasses(S) = 1 then + return RClasses(S); + fi; + + gr := DigraphRemoveLoops(Digraph(PartialOrderOfRClasses(S))); + return RClasses(S){DigraphSources(gr)}; +end); + # same method for ideals InstallMethod(StructureDescriptionMaximalSubgroups, diff --git a/gap/greens/gree.gd b/gap/greens/gree.gd index 0394dbd8d1..c1ce9e1f5f 100644 --- a/gap/greens/gree.gd +++ b/gap/greens/gree.gd @@ -27,6 +27,8 @@ DeclareOperation("GreensJClassOfElementNC", DeclareAttribute("RegularDClasses", IsSemigroup); DeclareAttribute("NrRegularDClasses", IsSemigroup); DeclareAttribute("PartialOrderOfDClasses", IsSemigroup); +DeclareAttribute("PartialOrderOfLClasses", IsSemigroup); +DeclareAttribute("PartialOrderOfRClasses", IsSemigroup); DeclareOperation("GreensLClassOfElement", [IsGreensClass, IsMultiplicativeElement]); diff --git a/gap/greens/gren.gi b/gap/greens/gren.gi index a53a4df468..8a0b3092fe 100644 --- a/gap/greens/gren.gi +++ b/gap/greens/gren.gi @@ -538,6 +538,48 @@ function(S) return List(OutNeighbours(gr), Set); end); +InstallMethod(PartialOrderOfLClasses, "for a finite enumerable semigroup", +[IsEnumerableSemigroupRep and IsFinite], +function(S) + local gr, comps, enum, canon, actual, perm; + + gr := LeftCayleyDigraph(S); + comps := DigraphStronglyConnectedComponents(gr).comps; + gr := QuotientDigraph(gr, comps); + if not IsBound(GreensLRelation(S)!.data) then + # Rectify the ordering of the Green's classes, if necessary + enum := EnumeratorCanonical(S); + canon := SortingPerm(List(comps, x -> LClass(S, enum[x[1]]))); + actual := SortingPerm(GreensLClasses(S)); + perm := canon / actual; + if not IsOne(perm) then + gr := OnDigraphs(gr, perm); + fi; + fi; + return List(OutNeighbours(gr), Set); +end); + +InstallMethod(PartialOrderOfRClasses, "for a finite enumerable semigroup", +[IsEnumerableSemigroupRep and IsFinite], +function(S) + local gr, comps, enum, canon, actual, perm; + + gr := RightCayleyDigraph(S); + comps := DigraphStronglyConnectedComponents(gr).comps; + gr := QuotientDigraph(gr, comps); + if not IsBound(GreensRRelation(S)!.data) then + # Rectify the ordering of the Green's classes, if necessary + enum := EnumeratorCanonical(S); + canon := SortingPerm(List(comps, x -> RClass(S, enum[x[1]]))); + actual := SortingPerm(GreensRClasses(S)); + perm := canon / actual; + if not IsOne(perm) then + gr := OnDigraphs(gr, perm); + fi; + fi; + return List(OutNeighbours(gr), Set); +end); + ############################################################################# ## 6. Idempotents . . . ############################################################################# diff --git a/tst/standard/attr.tst b/tst/standard/attr.tst index 31964ded7f..1d2d01f639 100644 --- a/tst/standard/attr.tst +++ b/tst/standard/attr.tst @@ -1966,6 +1966,30 @@ gap> NambooripadLeqRegularSemigroup(S); Error, Semigroups: NambooripadLeqRegularSemigroup: usage, the argument is not a regular semigroup, +#T# MaximalL/RClasses +gap> S := LeftZeroSemigroup(3); + +gap> MaximalLClasses(S); +[ ] +gap> MaximalRClasses(S); +[ , + , + ] +gap> S := RightZeroSemigroup(3); + +gap> MaximalLClasses(S); +[ , + , + ] +gap> MaximalRClasses(S); +[ ] +gap> S := FullPBRMonoid(1); + +gap> MaximalLClasses(S); +[ ] +gap> MaximalRClasses(S); +[ ] + # SEMIGROUPS_UnbindVariables gap> Unbind(D); gap> Unbind(G); diff --git a/tst/standard/gren.tst b/tst/standard/gren.tst index 9604300794..e5e599779a 100644 --- a/tst/standard/gren.tst +++ b/tst/standard/gren.tst @@ -1685,6 +1685,32 @@ gap> GreensJClasses(S); Error, no method found! For debugging hints type ?Recovery from NoMethodFound Error, no 2nd choice method found for `GreensJClasses' on 1 arguments +#T# PartialOrderOfL/RClasses: 1 +gap> S := Semigroup([ +> PBR([[-1], []], [[], [-2, -1, 1, 2]]), +> PBR([[-2, -1, 1, 2], [-2, -1, 2]], [[-2, -1], [-2, 1, 2]]), +> PBR([[-1], [1]], [[-1], [-2]])]); + +gap> PartialOrderOfLClasses(S); +[ [ 1 ], [ 1, 2 ], [ 1, 2 ], [ 1, 3, 4 ], [ 5 ], [ 5, 6 ], [ 5, 6 ], [ 8 ] ] +gap> PartialOrderOfRClasses(S); +[ [ 1 ], [ 1, 2 ], [ 3 ], [ 2, 3, 4 ], [ 5 ], [ 5, 6 ], [ 7 ], [ 6, 7, 8 ], + [ 6, 7, 8 ], [ 10 ] ] + +#T# PartialOrderOfL/RClasses: 1 +gap> S := FullTransformationMonoid(3); + +gap> gr := PartialOrderOfLClasses(S);; +gap> gr := DigraphReflexiveTransitiveReduction(Digraph(gr)); + +gap> IsIsomorphicDigraph(gr, DigraphFromDigraph6String("+F?OGC@OoK?")); +true +gap> gr := PartialOrderOfRClasses(S);; +gap> gr := DigraphReflexiveTransitiveReduction(Digraph(gr)); + +gap> IsIsomorphicDigraph(gr, DigraphFromDigraph6String("+D[CGO?")); +true + # SEMIGROUPS_UnbindVariables gap> Unbind(D); gap> Unbind(DD);