Skip to content
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

Make McAlister triple semigroups acting #507

Merged
merged 8 commits into from
Nov 23, 2018

Conversation

ChristopherRussell
Copy link
Collaborator

@ChristopherRussell ChristopherRussell commented Sep 5, 2018

This PR integrates McAlister triple semigroups with the acting semigroups framework. It also includes various fixes, and improvements to:

  • IsomorphismSemigroup when used to find an isomorphism from an E-unitary inverse semigroup to a McAlisterTripleSemigroup.
  • McAlisterTripleSemigroup - replaced a check involving IsSubgroup and AutomorphismGroup by one which checks if generators are automorphisms.
  • EUnitaryInverse cover - now uses DirectProduct functionality which has recently been added to Semigroups.

It also adds various attributes of the form MTSX which are synonyms for McAlsiterTripleSemigroupX. FInally there is now a McAlisterTripleSubsemigroup attribute and functionality for these objects.

@ChristopherRussell ChristopherRussell force-pushed the temp-eunitary branch 2 times, most recently from 97479ac to cb3ee2c Compare September 6, 2018 11:14
@wilfwilson
Copy link
Collaborator

wilfwilson commented Sep 6, 2018

Travis seems to be failing now because of some manual examples displaying differently, and because of the code coverage of setup.gi being only 80%.

@james-d-mitchell
Copy link
Collaborator

@ChristopherRussell can you attempt to fix this?

@james-d-mitchell james-d-mitchell added major A label for issues or PRs that require a major amount of work or big changes. 3.1 enhancement A label for issues or PRs that offer an enhancement to existing functionality labels Sep 6, 2018
@ChristopherRussell
Copy link
Collaborator Author

I don’t understand why the manual examples are failing. They fail when I run SEMIFROUPS.TestManualExamples() however they work when I run through them manually in gap. I also thought I covered all the code relating to McAlister triples in setup.gi except a 3-4 lines inside the function IdempotentCreator. I am not sure what this function is meant to do and I don’t understand the code so I’m wondering if it’s wrong.

@wilfwilson
Copy link
Collaborator

For the point about code coverage, the tests which give code coverage of setup.gi should be contained in the test file setup.tst: the coverage of setup.gi is determined solely by running the setup.tst file; tests in other files don't count. (It's not the only way that things could be arranged, but it's how we've got it and I think it's sensible). Since all of your tests are in semieunit.tst, they won't contribute to how Travis calculates the score for setup.gi.

@ChristopherRussell
Copy link
Collaborator Author

Oh okay, I will be able to get the setup.gi test coverage up then.

@wilfwilson
Copy link
Collaborator

Like you, on my computer I get the same diffs in the manual examples as Travis does, when running SEMIGROUPS.TestManualExamples();. There is probably therefore some randomness involved in your methods, and since GAP is in a different state when you run them separately as opposed to when you run everything together as part of SEMIGROUPS.TestManualExamples();, then you're getting different results.

I suggest that either you simply use the output that you get from SEMIGROUPS.TestManualExamples();, which would fix the problem, or perhaps more appropriate would be to suppress the output or even remove the two steps that fail; since they're not guaranteed to give consistent answers then, perhaps it could be slightly misleading or confusing to a user if they get different results.

Or you could redesign the manual example somehow so that you get consistent results.

@ChristopherRussell
Copy link
Collaborator Author

ChristopherRussell commented Sep 6, 2018

So I deleted the manual examples because they didn't seem important. I have now increased the test coverage for setup.gi and I'm no longer worried about the function IdempotentCreator. However I'm having trouble testing SchutzGpMembership (in setup.tst).

gap> M := McAlisterTripleSemigroup(SymmetricGroup([2, 3, 4]), Digraph([[1], [1, 2], [1, 3], [1, 4]]), [1, 2, 3]);;
gap> M := Semigroup(Elements(M));;
gap> o := LambdaOrb(M);; Enumerate(o);;
gap> schutz := LambdaOrbStabChain(o, 2);;
gap> SchutzGpMembership(M)(schutz, ());
Error, IsBound: <rec> must be a record (not a boolean or fail) in
  while IsBound( S.stabilizer ) and g <> S.identity do
    bpt := S.orbit[1];
    img := bpt ^ g;
    if IsBound( S.transversal[img] ) then
        while img <> bpt do
            g := g * S.transversal[img];
            img := bpt ^ g;
        od;
        S := S.stabilizer;
    else
        return g;
    fi;
od; at /Users/crussell/gap/lib/stbc.gi:1350 called from
SiftedPermutation( stab, x
 ) at /Users/crussell/gap/pkg/semigroups/gap/main/setup.gi:1132 called from
<function "unknown">( <arguments> )
 called from read-eval loop at *stdin*:8
you can replace <rec> via 'return <rec>;'

This seems to be because schutz is equal to true and not a stabiliser chain record. I noticed that the test for RZMS, which I was trying to base mine on, should also fail in this way except there is a typo. It is:

# SchutzGpMembership, for an RZMS
gap> R := ReesZeroMatrixSemigroup(Group((1, 2, 3)), [[()]]);;
gap> R := Semigroup(Elements(R));;
gap> o := LambdaOrb(S);; Enumerate(o);;
gap> schutz := LambdaOrbStabChain(o, 2);;
gap> SchutzGpMembership(R)(schutz, ());
true

and the third line has an S where there should be an R. When the typo is corrected, a similar thing happens:

gap> R := ReesZeroMatrixSemigroup(Group((1, 2, 3)), [[()]]);;
gap> R := Semigroup(Elements(R));;
gap> o := LambdaOrb(R);; Enumerate(o);;
gap> schutz := LambdaOrbStabChain(o, 2);;
gap> SchutzGpMembership(R)(schutz, ());
Error, IsBound: <rec> must be a record (not a boolean or fail) in
  while IsBound( S.stabilizer ) and g <> S.identity do
    bpt := S.orbit[1];
    img := bpt ^ g;
    if IsBound( S.transversal[img] ) then
        while img <> bpt do
            g := g * S.transversal[img];
            img := bpt ^ g;
        od;
        S := S.stabilizer;
    else
        return g;
    fi;
od; at /Users/crussell/gap/lib/stbc.gi:1350 called from
SiftedPermutation( stab, x
 ) at /Users/crussell/gap/pkg/semigroups/gap/main/setup.gi:1124 called from
<function "unknown">( <arguments> )
 called from read-eval loop at *stdin*:32
you can replace <rec> via 'return <rec>;'

@wilfwilson
Copy link
Collaborator

Hmm, well done sorting these things out Chris, I think you should alert @james-d-mitchell to the problems you're having with SchutzGpMembership.

@james-d-mitchell
Copy link
Collaborator

@ChristopherRussell LambdaOrbSchutzGp returns a group except if that group would be the symmetric group or the trivial group. So, when you are seeing the return value of LambdaOrbSchutzGp being true or false this indicates that the corresponding group is the symmetric group or the trivial group, respectively.

I think to do the test you want, you just need to find an example where this group is not the symmetric group nor the trivial group. Please let me know if this does/doesn't make sense.

@ChristopherRussell
Copy link
Collaborator Author

ChristopherRussell commented Sep 10, 2018

I believe I have fixed this now and I am done making all the requested changes. I also fixed the SchutzGpMembership test for Rees zero matrix semigroups which I mentioned had a typo.

@james-d-mitchell james-d-mitchell added new-feature A label for PRs that contain new features and removed new-feature A label for PRs that contain new features labels Sep 12, 2018
@@ -94,6 +103,13 @@ function(x)
return NrMovedPoints(x![2]) + 1;
end);

# TODO correct?
Copy link
Collaborator

@wilfwilson wilfwilson Sep 13, 2018

Choose a reason for hiding this comment

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

I've no idea if this is correct, but I feel like the TODO should be resolved before merging. Same for the rest of your TODOs.

@ChristopherRussell ChristopherRussell force-pushed the temp-eunitary branch 2 times, most recently from e640c60 to 5a3bd23 Compare September 19, 2018 15:44
ChristopherRussell added 6 commits September 19, 2018 16:44
Changed method OneImmutable (for McAlisterTripleSemigroups) so that
returns fail instead of an error when the semigroup is not a monoid. As
an example, the error message was causing an issue when
IsomorphismSemigroup(IsTransformationSemigroup, S) was called on a
McAlisterTripleSemigroup.
EUnitaryCover was written before DirectProduct was properly implemented
for the relevant types of semigroups, and used its own method to
construct direct products. This method is less effective and now
obsolete so it has been replaced.
Replaced a check involving IsSubgroup and AutomorphismGroup by one which
checks if generators are automorphism. Checking generators is easier
than checking for a subgroup. Calculating the automorphism group of a
digraph is unnecessary.

Added some attribute synonyms since for attributes of the form
McAlisterTripleX because the names are long. Synonyms are of the form
MTSX.
This commit fits McAlisterTripleSemigroups into the acting semigroups
framework (previously they were classed as enumerable).

Furthermore it implements an improvement to IsomorphismSemigroup when
used to find an isomorphism from an E-unitary inverse semigroup to a
McAlisterTripleSemigroup.

Finally, there is now a McAlisterTripleSubsemigroup attribute and
similar functionallity for these objects as for
McAlisterTripleSemigroups.
@ChristopherRussell
Copy link
Collaborator Author

ChristopherRussell commented Sep 19, 2018

Thanks @wilfwilson, I have now resolved the TODOs in setup.gi.

EDIT: seems like all the tests are failing - I will comment again when I figure it out

Fix two tests which have different (but mathematically correct) output
when acting methods are enabled/disabled. Improve code coverage in main/setup.gi.
Noticed that IdempotentCreator method may need to be fixed.
@ChristopherRussell
Copy link
Collaborator Author

ChristopherRussell commented Sep 19, 2018

There are some recursion depth traps appearing when my tests are run in examples where Print and String are called on McAlister triple semigroups when the GAP version is master. Did something change about how String / Print is being handled recently in the master branch?

@wilfwilson
Copy link
Collaborator

No, however something has changed which means that the ranks of certain filters are different than they were. That explains all but one of your test failures: for a McAlisterTripleSemigroup, you are expecting to use the String method installed on semieunit.gi:218. But the filter of this is IsMcAlisterTripleSubsemigroup, which only has rank 25 in my GAP installation; whereas there is a method in the GAP library which applies to semigroups that are known inverse semigroups and which have known GeneratorsOfSemigroup: this has rank 28, and is getting called instead, and is leading to an infinite recursion. You can fix this by artificially increasing the rank of your special method.

So, after line 219, you could add the line:

RankFilter(IsInverseSemigroup and HasGeneratorsOfSemigroup),

And this should fix the problem.

The other test failure I think is that an isomorphism is now printed a tiny bit correctly. You should just suppress this output with double semicolons, but I recommend that you actually verify that the mapping is a homomorphism (i.e. a bijective homomorphism).

@ChristopherRussell
Copy link
Collaborator Author

Thank you @wilfwilson, I don't think I would have been able to figure out the filter ranks stuff by myself! I have also suppressed the output for the lines in the tests which printed isomorphism functions and added BruteForceIsoCheck and BruteForceInverseCheck to verify that they are isomorphisms.
Tests seem to be passing now.

@@ -763,7 +929,20 @@ InstallMethod(LambdaConjugator, "for a bipartition semigroup",
InstallMethod(LambdaConjugator, "for a Rees 0-matrix subsemigroup",
[IsReesZeroMatrixSubsemigroup], S ->
function(x, y)
return ();
return (); # FIXME is this right???? This is not right!!
Copy link
Collaborator

Choose a reason for hiding this comment

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

This FIXME troubles me a bit, I will play around with this on Monday, and give you some feedback @ChristopherRussell. This PR looks pretty good though, thanks for persevering.

@james-d-mitchell
Copy link
Collaborator

Thanks @ChristopherRussell I'm going to merge this now.

@james-d-mitchell james-d-mitchell merged commit 6cae52c into semigroups:master Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A label for issues or PRs that offer an enhancement to existing functionality major A label for issues or PRs that require a major amount of work or big changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants