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 implication for IsSubsetLocallyFiniteGroup; and teach Units(GF(q)) its size #2220

Merged
merged 3 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 8 additions & 1 deletion lib/fieldfin.gi
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ InstallMethodWithRandomSource( Random,
InstallMethod( Units,
"for a finite field",
[ IsField and IsFinite ],
F -> GroupByGenerators( [ PrimitiveRoot( F ) ] ) );
function ( F )
local G;
G := GroupByGenerators( [ PrimitiveRoot( F ) ] );
if HasSize( F ) then
SetSize( G, Size( F )-1 );
fi;
return G;
end );


#############################################################################
Expand Down
5 changes: 3 additions & 2 deletions lib/grp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ InstallSubsetMaintenance( IsSubsetLocallyFiniteGroup,

#############################################################################
##
#M IsSubsetLocallyFiniteGroup( <G> ) . . . . . . . . . . for magmas of FFEs
#M IsSubsetLocallyFiniteGroup( <G> ) . . . for magmas with inverses of FFEs
##
InstallTrueMethod( IsSubsetLocallyFiniteGroup, IsFFECollection and IsMagma );
InstallTrueMethod( IsSubsetLocallyFiniteGroup,
IsFFECollection and IsMagmaWithInverses );


#############################################################################
Expand Down
8 changes: 5 additions & 3 deletions lib/grpffmat.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ DeclareSynonym( "IsFFEMatrixGroup", IsFFECollCollColl and IsMatrixGroup );

#############################################################################
##
#M IsFinite( <ffe-mat-grp> )
#M IsSubsetLocallyFiniteGroup( <ffe-mat-grp> )
##
## As a consequence, any IsFFEMatrixGroup in IsFinitelyGeneratedGroup
## automatically is also in IsFinite.
##
## *Note:* The following implication only holds if there are no infinite
## dimensional matrices.
##
InstallTrueMethod( IsFinite,
IsFFEMatrixGroup and IsFinitelyGeneratedGroup );
InstallTrueMethod( IsSubsetLocallyFiniteGroup, IsFFEMatrixGroup );


#############################################################################
Expand Down
2 changes: 1 addition & 1 deletion lib/ring.gd
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ InstallFactorMaintenance( IsZeroMultiplicationRing,
## gap> Units( GaussianIntegers );
## [ -1, 1, -E(4), E(4) ]
## gap> Units( GF( 16 ) );
## <group with 1 generators>
## <group of size 15 with 1 generators>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down
29 changes: 29 additions & 0 deletions tst/testbugfix/2018-02-28-IsSubsetLocallyFiniteGroup.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# there used to be a bad implication from IsFFECollection and IsMagma to
# IsSubsetLocallyFiniteGroup, which caused all finite fields to be in filter
# IsSubsetLocallyFiniteGroup -- verify this is not the case anymore.
gap> HasIsSubsetLocallyFiniteGroup(GF(2));
false
gap> HasIsSubsetLocallyFiniteGroup(GF(2^20));
false

# that implication was replaced by one from IsFFECollection and IsMagmaWithInverses
# to IsSubsetLocallyFiniteGroup -- verify that it works
gap> G:=Units(GF(2));;
gap> HasIsSubsetLocallyFiniteGroup(G);
true
gap> HasIsFinite(G);
true

#
gap> G:=Group(Z(2));;
gap> HasIsSubsetLocallyFiniteGroup(G);
true
gap> HasIsFinite(G);
true

#
gap> G:=Group(Z(2^20));;
gap> HasIsSubsetLocallyFiniteGroup(G);
true
gap> HasIsFinite(G);
true