diff --git a/lib/fieldfin.gi b/lib/fieldfin.gi index bcae34fc13..512f730fe4 100644 --- a/lib/fieldfin.gi +++ b/lib/fieldfin.gi @@ -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 ); ############################################################################# diff --git a/lib/grp.gd b/lib/grp.gd index 5134ca73e7..35b00f6173 100644 --- a/lib/grp.gd +++ b/lib/grp.gd @@ -253,9 +253,10 @@ InstallSubsetMaintenance( IsSubsetLocallyFiniteGroup, ############################################################################# ## -#M IsSubsetLocallyFiniteGroup( ) . . . . . . . . . . for magmas of FFEs +#M IsSubsetLocallyFiniteGroup( ) . . . for magmas with inverses of FFEs ## -InstallTrueMethod( IsSubsetLocallyFiniteGroup, IsFFECollection and IsMagma ); +InstallTrueMethod( IsSubsetLocallyFiniteGroup, + IsFFECollection and IsMagmaWithInverses ); ############################################################################# diff --git a/lib/grpffmat.gd b/lib/grpffmat.gd index 76162043dd..518b5faed4 100644 --- a/lib/grpffmat.gd +++ b/lib/grpffmat.gd @@ -30,13 +30,15 @@ DeclareSynonym( "IsFFEMatrixGroup", IsFFECollCollColl and IsMatrixGroup ); ############################################################################# ## -#M IsFinite( ) +#M IsSubsetLocallyFiniteGroup( ) +## +## 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 ); ############################################################################# diff --git a/lib/ring.gd b/lib/ring.gd index 31fd27bd1a..530d790c54 100644 --- a/lib/ring.gd +++ b/lib/ring.gd @@ -748,7 +748,7 @@ InstallFactorMaintenance( IsZeroMultiplicationRing, ## gap> Units( GaussianIntegers ); ## [ -1, 1, -E(4), E(4) ] ## gap> Units( GF( 16 ) ); -## +## ## ]]> ## ## diff --git a/tst/testbugfix/2018-02-28-IsSubsetLocallyFiniteGroup.tst b/tst/testbugfix/2018-02-28-IsSubsetLocallyFiniteGroup.tst new file mode 100644 index 0000000000..0527d2a1c1 --- /dev/null +++ b/tst/testbugfix/2018-02-28-IsSubsetLocallyFiniteGroup.tst @@ -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