diff --git a/init.g b/init.g index 9c29e78..0fefe8c 100644 --- a/init.g +++ b/init.g @@ -14,3 +14,4 @@ ReadPackage("SgpDec","/lib/cascadegroup.gd"); ReadPackage("SgpDec","/lib/fl.gd"); ReadPackage("SgpDec","/lib/coords.gd"); ReadPackage("SgpDec","/lib/holonomy.gd"); +ReadPackage("SgpDec","/lib/lowerbound.gd"); diff --git a/lib/lowerbound.gd b/lib/lowerbound.gd new file mode 100644 index 0000000..27f6df1 --- /dev/null +++ b/lib/lowerbound.gd @@ -0,0 +1,13 @@ +############################################################################# +## +## lowerbound.gd SgpDec package +## +## Copyright (C) 2023 +## +## Thomas Gao, Chrystopher L. Nehaniv +## +## Checks essential dependency for Rhodes–Tilson complexity lower bound. +## + +DeclareGlobalFunction("IdempotentsForSubset"); +DeclareGlobalFunction("CheckEssentialDependency"); diff --git a/lib/lowerbound.gi b/lib/lowerbound.gi new file mode 100644 index 0000000..f743e14 --- /dev/null +++ b/lib/lowerbound.gi @@ -0,0 +1,67 @@ +############################################################################# +## +## lowerbound.gd SgpDec package +## +## Copyright (C) 2023 +## +## Thomas Gao, Chrystopher L. Nehaniv +## +## Checks essential dependency for Rhodes–Tilson complexity lower bound. +## + +InstallGlobalFunction(IdempotentsForSubset, +function(S, sk, set) +local e, IdempotentSet, ssize; + ssize := Size(BaseSet(sk)); + IdempotentSet := []; + for e in Idempotents(S) do + # check whether the image of e is set + if OnFiniteSet(BaseSet(sk), e) = set then + Add(IdempotentSet, e); + fi; + od; + return IdempotentSet; +end); + +InstallGlobalFunction(CheckEssentialDependency, function(S, sk, d1, d2) + # d1 is lower than d2 so larger set + local G1, CalX2, CalI2, skJ, J, x1, x2, e1, Xt, JGroup; + + for x1 in Concatenation(SubductionClassesOnDepth(sk, d1)) do + for x2 in Concatenation(SubductionClassesOnDepth(sk, d2)) do + if IsSubsetBlist(x1, x2) then + + for e1 in IdempotentsForSubset(S, sk, x1) do + G1 := SchutzenbergerGroup(HClass(S, e1)); + + CalX2 := Enumerate(Orb(G1, x2, OnFiniteSet, rec(schreier := true, orbitgraph := true))); + CalI2 := []; #Cal_I2 = all idempotents with images that are members of CalX2; + for Xt in CalX2 do + CalI2 := Concatenation(CalI2, IdempotentsForSubset(S, sk, Xt)); + od; + + if IsEmpty(CalI2) then + continue; + fi; + + J := Semigroup(CalI2); + skJ := Skeleton(J); + + if ContainsSet( skJ, x2 ) then + JGroup := PermutatorGroup(skJ, x2); + + if Size(JGroup) > 1 then # the stricter test is PermutatorGroup(sk, x2) = JGroup + Assert( 1, PermutatorGroup(sk, x2) = JGroup, + Concatenation("PermutatorGroup(sk, x2) <> JGroup\nx2 = ", + TrueValuePositionsBlistString(x2), "\nx1 = ", + TrueValuePositionsBlistString(x1), "\n") ); + return JGroup; + fi; + fi; + od; + + fi; + od; + od; + return Group(()); +end); diff --git a/read.g b/read.g index 31df076..11a3ea2 100644 --- a/read.g +++ b/read.g @@ -16,5 +16,6 @@ ReadPackage("SgpDec","/lib/cascadesemigroup.gi"); ReadPackage("SgpDec","/lib/cascadegroup.gi"); ReadPackage("SgpDec","/lib/fl.gi"); ReadPackage("SgpDec","/lib/holonomy.gi"); +ReadPackage("SgpDec","/lib/lowerbound.gi"); #just the test calling functions ReadPackage("SgpDec","/tst/testfunctions.g"); diff --git a/tst/lowerbound.tst b/tst/lowerbound.tst new file mode 100644 index 0000000..d9f3822 --- /dev/null +++ b/tst/lowerbound.tst @@ -0,0 +1,14 @@ +# testing lowerbound +gap> START_TEST("Sgpdec package: lowerbound.tst"); +gap> LoadPackage("sgpdec", false);; +gap> SgpDecFiniteSetDisplayOn();; +gap> S := FullTransformationSemigroup(4);; +gap> sk := Skeleton(S);; +gap> CheckEssentialDependency(S, sk, 1,2); +Group([ (2,3), (1,2), (1,3) ]) +gap> CheckEssentialDependency(S, sk, 2,3); +Group([ (1,2) ]) +gap> SgpDecFiniteSetDisplayOff();; + +# +gap> STOP_TEST( "Sgpdec package: lowerbound.tst", 10000); diff --git a/tst/testfunctions.g b/tst/testfunctions.g index 0e0a7fe..ffaba4e 100644 --- a/tst/testfunctions.g +++ b/tst/testfunctions.g @@ -1,6 +1,7 @@ SgpDecTestInstall := function() local test; for test in [ + "lowerbound", "disjointuniongroup", "WeakControlWords", "wreath",