Skip to content

Commit

Permalink
fix PreImagesRepresentative for IsToPcGroupHomomorphismByImages
Browse files Browse the repository at this point in the history
Added a check whether the given element is in the image of the map.
Now the method returns `fail` if not, as is specified in the
documentation of `PreImagesRepresentative`.

Note that `InversePcgs` is called (only) in the
`PreImagesRepresentative` method for a group homomorphism in
`IsToPcGroupHomomorphismByImages`.
It sets the component `rangePcgs`; the value is a pcgs for the *image*
of the homomorphism (in general *not* for the range).
  • Loading branch information
ThomasBreuer committed Apr 24, 2024
1 parent 3963ca0 commit 59190ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ghompcgs.gi
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,11 @@ InstallMethod( PreImagesRepresentative, "method for pcgs hom",
function( hom, elm )
local pcgsR, exp, imgs, pre, i;

# precompute pcgs
if not elm in ImagesSource( hom ) then
return fail;
fi;

# Precompute a pcgs for the *image* of 'hom'.
InversePcgs( hom );

pcgsR := hom!.rangePcgs;
Expand Down
21 changes: 21 additions & 0 deletions tst/testinstall/grppc.tst
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,26 @@ true
gap> IsIdenticalObj( Range( iso ), ImagesSource( iso ) );
true

#
gap> G:= AbelianGroup( IsPcGroup, [ 3, 3, 3 ] );;
gap> S:= AbelianGroup( IsPcGroup, [ 3, 3 ] );;
gap> f:= GroupHomomorphismByImages( G, S, GeneratorsOfGroup( G ),
> [ GeneratorsOfGroup( S )[1], One( S ), One( S ) ] );;
gap> x:= GeneratorsOfGroup( S )[2];;
gap> x in Range( f ) and not x in Image( f );
true
gap> PreImagesRepresentative( f, x );
fail
gap> G:= AbelianGroup( IsPcGroup, [ 3, 3 ] );;
gap> S:= AbelianGroup( IsPcGroup, [ 3 ] );;
gap> f:= GroupHomomorphismByImages( G, S, GeneratorsOfGroup( G ),
> [ One( S ), One( S ) ] );;
gap> x:= GeneratorsOfGroup( S )[1];
f1
gap> x in Range( f ) and not x in Image( f );
true
gap> PreImagesRepresentative( f, x );
fail

# that's all, folks
gap> STOP_TEST( "grppc.tst" );

0 comments on commit 59190ce

Please sign in to comment.