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

FIX: Add IsBiCoset #2666

Merged
merged 2 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/ref/groups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ free generators, that will map on this element again.
<#Include Label="RightCosets">
<#Include Label="CanonicalRightCosetElement">
<#Include Label="IsRightCoset">
<#Include Label="IsBiCoset">
<#Include Label="CosetDecomposition">

</Section>
Expand Down
20 changes: 20 additions & 0 deletions lib/csetgrp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,24 @@ DeclareAttribute( "RepresentativesContainedRightCosets", IsDoubleCoset );
DeclareCategory("IsRightCoset", IsDomain and IsExternalOrbit and
IsMultiplicativeElementWithInverse);

#############################################################################
##
#P IsBiCoset( <C> )
##
## <#GAPDoc Label="IsBiCoset">
## <ManSection>
## <Prop Name="IsBiCoset" Arg='C'/>
##
## <Description>
## A (right) cose is considered a <E>bicoset</E> if its set of elements simultaneously forms a left
Copy link
Member

Choose a reason for hiding this comment

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

Typo: coset

## coset for the same subgroup. This is the case, for example, if the coset representative normalizes
Copy link
Member

Choose a reason for hiding this comment

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

Why "for example"? This is an equivalence, isn't it?

## the subgroup.
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareProperty( "IsBiCoset", IsRightCoset );

#############################################################################
##
#O RightCoset( <U>, <g> )
Expand Down Expand Up @@ -353,6 +371,8 @@ DeclareCategory("IsRightCoset", IsDomain and IsExternalOrbit and
## 6
## gap> AsList(c);
## [ (2,3,4), (1,4,2), (1,3,4,2), (1,3)(2,4), (2,4), (1,4,2,3) ]
## gap> IsBiCoset(c);
## false
## ]]></Example>
## </Description>
## </ManSection>
Expand Down
27 changes: 22 additions & 5 deletions lib/csetgrp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,14 @@ function(d)
Print(ViewString(d));
end);

InstallMethod(IsBiCoset,"test property",true,[IsRightCoset],0,
function(c)
local s,r;
s:=ActingDomain(c);
r:=Representative(c);
return ForAll(GeneratorsOfGroup(s),x->r*x/r in s);
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps test for x^r in s instead, as that will be a bit more efficient in some cases (e.g. for permutations)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, if this ever could be time-critical this has the potential to be faster. I decided on the inverse-conjugation as it translated directly to the condition as I had written it doen on paper.

end);

InstallMethodWithRandomSource(Random,
"for a random source and a RightCoset",
[IsRandomSource, IsRightCoset],0,
Expand Down Expand Up @@ -656,10 +664,17 @@ end);
InstallOtherMethod(\*,"RightCosets",IsIdenticalObj,
[IsRightCoset,IsRightCoset],0,
function(a,b)
if ActingDomain(a)<>ActingDomain(b) then
Error("no multiplication defined for cosets of different subgroups");
local c;
if ActingDomain(a)<>ActingDomain(b) then TryNextMethod();fi;
if not IsBiCoset(a) then # product does not require b to be bicoset
TryNextMethod();
fi;
c:=RightCoset(ActingDomain(a), Representative(a) * Representative(b) );
if IsBiCoset(b) then
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps first check HasIsBicoset to avoid a computation?

SetIsBiCoset(c,true);
fi;
return RightCoset(ActingDomain(a), Representative(a) * Representative(b) );

return c;
end);

InstallOtherMethod(InverseOp,"Right cosets",true,
Expand All @@ -668,10 +683,12 @@ function(a)
local s,r;
s:=ActingDomain(a);
r:=Representative(a);
if ForAny(GeneratorsOfGroup(s),x->not x^r in s) then
if not IsBiCoset(a) then
Error("Inversion only works for cosets of normal subgroups");
Copy link
Member

Choose a reason for hiding this comment

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

That error message is wrong (though of course it was before, too)

fi;
return RightCoset(s,Inverse(r));
r:=RightCoset(s,Inverse(r));
SetIsBiCoset(r,true);
return r;
end);

InstallOtherMethod(OneOp,"Right cosets",true,
Expand Down