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

wrong group order of a preimage of a group homomorphism #5704

Closed
ThomasBreuer opened this issue Apr 19, 2024 · 5 comments · Fixed by #5705
Closed

wrong group order of a preimage of a group homomorphism #5704

ThomasBreuer opened this issue Apr 19, 2024 · 5 comments · Fixed by #5705
Labels
kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them topic: library

Comments

@ThomasBreuer
Copy link
Contributor

The following happens in GAP 4.13.0 as well as in the current master branch.

gap> G:= AbelianGroup( IsPcGroup, [ 3, 3, 3 ] );;
gap> Size( G );  
27
gap> H:= AbelianGroup( IsPcGroup, [ 3, 3 ] );;
gap> f:= GroupHomomorphismByImages( G, H, GeneratorsOfGroup( G ),
>         [ GeneratorsOfGroup( H )[1], One(H), One(H) ] );;
gap> ker:= Kernel( f );;
gap> Size( ker );
9
gap> pre:= PreImage( f, H );;
gap> HasSize( pre );
true
gap> Size( pre );
81

When the input line Size( ker ) is left out then the HasSize output is false, and the final Size value is correct.

(I found this problem when working on oscar-system/Oscar.jl/pull/3166.)

@ThomasBreuer ThomasBreuer added kind: bug Issues describing general bugs, and PRs fixing them kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them topic: library labels Apr 19, 2024
@ThomasBreuer
Copy link
Contributor Author

ThomasBreuer commented Apr 20, 2024

The reason for the above wrong result is the following.

gap> G:= AbelianGroup( IsPcGroup, [ 3, 3, 3 ] );;
gap> H:= AbelianGroup( IsPcGroup, [ 3, 3 ] );;
gap> f:= GroupHomomorphismByImages( G, H, GeneratorsOfGroup( G ),
>         [ GeneratorsOfGroup( H )[1], One(H), One(H) ] );;
gap> x:= GeneratorsOfGroup( H )[2];
f2
gap> x in Image( f );
false
gap> x in Range( f );
true
gap> PreImagesRepresentative( f, x );
<identity> of ...

According to the documentation of PreImagesRepresentative, the last result should be fail.

By the way:
If we reduce the example further, we find another bug:

gap> G:= AbelianGroup( IsPcGroup, [ 3, 3 ] );;
gap> H:= AbelianGroup( IsPcGroup, [ 3 ] );;
gap> f:= GroupHomomorphismByImages( G, H, GeneratorsOfGroup( G ),
>         [ One( H ), One(H) ] );;
gap> x:= GeneratorsOfGroup( H )[1];
f1
gap> x in Image( f );
false
gap> x in Range( f );                                                 
true
gap> PreImagesRepresentative( f, x );
Error, List Element: <list>[1] must have an assigned value in
[...]

(In fact two PreImagesRepresentative methods are applicable in the above situaton. Both run into an error.)

@fingolfin
Copy link
Member

See also PR #5073 by @cdwensley who has been trying to improve the situations... We should join forces with him to make a stronger push on this...

@fingolfin
Copy link
Member

And also see your own issue #4809

@fingolfin
Copy link
Member

In this particular case I think the core of the issue is that ExponentsOfPcElement(pcgs,elm) simply returns garbage if elm is not in the group generated by pcgs

@fingolfin
Copy link
Member

Well, that and that this method does not even have the possibility of returning fail.

InstallMethod( PreImagesRepresentative, "method for pcgs hom",
  FamRangeEqFamElm,
  [ IsToPcGroupHomomorphismByImages,IsMultiplicativeElementWithInverse ], 0,
function( hom, elm )
    local  pcgsR, exp, imgs, pre, i;

    # precompute pcgs
    InversePcgs( hom );

    pcgsR := hom!.rangePcgs;
    exp := ExponentsOfPcElement( pcgsR, elm );
    imgs := hom!.rangePcgsPreimages;
    pre := Identity( Source( hom ) );
    for i in [1..Length(exp)] do
      if exp[i]>0 then
        pre := pre * imgs[i]^exp[i];
      fi;
    od;
    return pre;
end);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them topic: library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants