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

Wreath product #262

Merged
merged 25 commits into from
Jul 19, 2017
Merged

Wreath product #262

merged 25 commits into from
Jul 19, 2017

Conversation

ffloresbrito
Copy link
Contributor

@ffloresbrito ffloresbrito commented Feb 24, 2017

This pull request adds a method for the operationWreathProduct that computes the wreath product of a monoid and a permutation group as its embedding in the full transformation monoid. Documentation and tests are included.

Copy link
Collaborator

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

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

This looks ok, there are a few things to change in the documentation, you consistently say semigroup when I think you mean transformation semigroup or maybe transformation monoid. You also capitalise Wreath Product, which I wouldn't do.

<#GAPDoc Label="WreathProduct">
<ManSection>
<Oper Name = "WreathProduct" Arg = "S, G"/>
<Returns>The Wreath Product of <A>S</A> and <A>G</A>.</Returns>
Copy link
Collaborator

Choose a reason for hiding this comment

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

No capital letters of Wreath or Product

Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment applies in numerous places.

<Description>
For a monoid <A>S</A> and a permutation group <A>G</A>,
<C>WreathProduct(<A>S</A>, <A>G</A>)</C> outputs the semigroup Wreath
product of S and G in terms of its embedding in the full transformation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing <A> tags around S and G here.

For a monoid <A>S</A> and a permutation group <A>G</A>,
<C>WreathProduct(<A>S</A>, <A>G</A>)</C> outputs the semigroup Wreath
product of S and G in terms of its embedding in the full transformation
monoid. For example, the Wreath product of T3, the full transformation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please don't use T3 or C2 (this is not a standard convention in the Semigroups package)

product of S and G in terms of its embedding in the full transformation
monoid. For example, the Wreath product of T3, the full transformation
monoid on three points, and C2, the group generated by the transposition
<C>(1,3)</C>, would be output as its emedding in the full transformation
Copy link
Collaborator

Choose a reason for hiding this comment

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

spelling mistake emedding

function(S, G)
local maps, gensS, next, reps, n, i, g, x, m;
if not IsMonoidAsSemigroup(S) then
ErrorNoReturn("S should be a monoid");
Copy link
Collaborator

Choose a reason for hiding this comment

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

This error should be in the format: Semigroups: WreathProduct: usage..
please see other error messages in the package for the correct format.

m := LargestMovedPoint(G);
maps := []; # the final generating set for the wreath product

gensS := ShallowCopy(GeneratorsOfSemigroup(S));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need to take a ShallowCopy here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do need ShallowCopy because we later modify the list gensS which would otherwise be immutable as GeneratorsOfSemigroup(S) returns an immutable object.

od;
od;
fi;
return Semigroup(maps);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't the return value a monoid? If so, shouldn't we return Monoid(maps) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even though it is a monoid, using Monoid(maps) adds the identity transformation, which may not be in the wreath product. That is why using Semigroup(maps) is the appropiate thing to do.

@@ -735,6 +735,47 @@ function(S)
return t;
end);

InstallMethod(WreathProduct, "for a monoid and a permutation group",
Copy link
Collaborator

Choose a reason for hiding this comment

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

The string here is wrong, it should describe the arguments in the next line. So in this case it should be for a transformation semigroup and a permutation group.

@ffloresbrito ffloresbrito changed the base branch from unstable-3.0 to master March 29, 2017 14:53
@mtorpey mtorpey added the 3.1 label May 29, 2017
@ffloresbrito ffloresbrito force-pushed the wreath-product branch 3 times, most recently from c22d5c6 to e05def6 Compare June 14, 2017 17:27
Copy link
Collaborator

@mtorpey mtorpey left a comment

Choose a reason for hiding this comment

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

I have some comments, mostly about the documentation.

end);

InstallMethod(WreathProduct,
"for a transformation semigroup and a permutation group",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This string should be the other way around: "for a permutation group and a transformation semigroup"

<#GAPDoc Label="WreathProduct">
<ManSection>
<Oper Name = "WreathProduct" Arg = "S, G"/>
<Returns>The wreath product of <A>S</A> and <A>G</A>.</Returns>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The Returns statement should just be the type of object returned: A transformation semigroup.

<Oper Name = "WreathProduct" Arg = "S, G"/>
<Returns>The wreath product of <A>S</A> and <A>G</A>.</Returns>
<Description>
For a transformation monoid <A>S</A> and a permutation group <A>G</A>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't this work for any transformation semigroup?


<#GAPDoc Label="WreathProduct">
<ManSection>
<Oper Name = "WreathProduct" Arg = "S, G"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should also have the version where Arg = "S, G". You can just add the line right below this.

rimage;
if not IsMonoidAsSemigroup(S) then
ErrorNoReturn("Semigroups: WreathProduct: usage,\n",
"the first argument <S> should be a monoid,");
Copy link
Collaborator

Choose a reason for hiding this comment

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

<S> is the second argument.

end);

InstallMethod(WreathProduct,
"for two transformation semigroups",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just one bad string here: you want "for a transformation monoid and a transformation semigroup"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing that out. I have already fixed it!

@mtorpey
Copy link
Collaborator

mtorpey commented Jun 23, 2017

I have one more suggestion: add a method for [IsPermGroup, IsPermGroup]. You have methods for the case where one of the arguments is a permutation group, but not one for both.

@ffloresbrito
Copy link
Contributor Author

Michael, thank you for the suggestion to add the method for two permutation groups. GAP already has a method to do the wreath product of two groups, and if I were to add this method, there would appear the following warning: "method installed for WreathProduct matches more than one declaration". Should I add this method, regardless?

@james-d-mitchell
Copy link
Collaborator

@ffloresbrito no don't add the method for 2 perm groups, since it already exists in GAP there is no need.`

@mtorpey
Copy link
Collaborator

mtorpey commented Jun 23, 2017 via email

Copy link
Collaborator

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

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

Looks good apart from the suggested changes.

<Description>
If <A>M</A> is a transformation monoid or a permutation group, and
<A>S</A> is a transformation semigroup or a permutation group, the
function <C>WreathProduct(<A>M</A>, <A>S</A>)</C> outputs the wreath
Copy link
Collaborator

Choose a reason for hiding this comment

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

the function <C>WreathProduct(<A>M</A>, <A>S</A>)</C> outputs -> the operation <C>WreathProduct</C> returns for consistency with the rest of the manual.

<A>S</A> is a transformation semigroup or a permutation group, the
function <C>WreathProduct(<A>M</A>, <A>S</A>)</C> outputs the wreath
product of <A>M</A> and <A>S</A>, in terms of its embedding in the full
transformation monoid.
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could also be much more specific about what this embedding actually is.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But there is still no information about what the embedding actually is.

doc/z-chap13.xml Outdated
<Section>

<Heading>
The wreath product of a transformation monoid and a permutation group
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be in the same section as the documentation for the direct product, if that exists.

[IsTransformationMonoid, IsPermGroup],
function(M, G)
local S;
S := AsMonoid(IsTransformationMonoid, G);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could just be return WreathProduct(M, AsMonoid(IsTransformationMonoid, G))

function(G, S)
local M;
M := AsMonoid(IsTransformationMonoid, G);
return WreathProduct(M, S);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as previous comment.

rimage;
if not IsMonoidAsSemigroup(S) then
ErrorNoReturn("Semigroups: WreathProduct: usage,\n",
"the second argument <S> should be a monoid,");
Copy link
Collaborator

Choose a reason for hiding this comment

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

"should be a monoid (as semigroup)"

gensM := List(gensM, x -> OnTuples([1 .. m], x));
gensS := GeneratorsOfSemigroup(S);

orbs := List(ComponentsOfTransformationSemigroup(S), x -> Minimum(x));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't lines 779 to 787 be replaced with rimage := DigraphSources(DigraphOfActionOnPoints(S));?

#T# Test wreath product of perm. group and transf. semgp.
gap> W := WreathProduct(Group((1, 2)), FullTransformationMonoid(3));;
gap> Size(W);
216
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you maybe test some more things than just the size too?

rimage;
if not IsMonoidAsSemigroup(S) then
ErrorNoReturn("Semigroups: WreathProduct: usage,\n",
"the second argument <S> should be a monoid (as ",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lines 778 and 779 should be aligned correctly.

rimage;
if not IsMonoidAsSemigroup(S) then
ErrorNoReturn("Semigroups: WreathProduct: usage,\n",
"the second argument <S> should be a monoid (as ",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Align lines 778 and 779 properly.

m := DegreeOfTransformationCollection(M);

gensM := ShallowCopy(GeneratorsOfMonoid(M));
gensM := List(gensM, x -> OnTuples([1 .. m], x));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd replace these 2 lines with

gensM := List(GeneratorsOfMonoid(M), x -> ImageListOfTransformation(x, m));

gensM := List(gensM, x -> OnTuples([1 .. m], x));
gensS := GeneratorsOfSemigroup(S);

orbs := List(ComponentsOfTransformationSemigroup(S), x -> Minimum(x));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be simplified! Replace x -> Minimum(x) with just Minimum


gen1 := gensS[1];
for i in orbs do
newmap := OnTuples([1 .. m * n], maps[1]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

As before, try changing this to newmap := ImageListOfTransformation(maps[1], m * n);

@mtorpey mtorpey merged commit 3e93ef1 into semigroups:master Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants