Skip to content
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
2 changes: 1 addition & 1 deletion lib/field.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ InstallMethod( PreImagesElm,
FamRangeEqFamElm,
[ IsFieldHomomorphism, IsObject ],
function ( hom, elm )
if IsInjective( hom ) = 1 then
if IsInjective( hom ) then
return [ PreImagesRepresentative( hom, elm ) ];
elif IsZero( elm ) then
return Source( hom );
Expand Down
9 changes: 9 additions & 0 deletions lib/fieldfin.gi
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,15 @@ InstallMethod( ImagesRepresentative,
return elm ^ aut!.power;
end );

InstallMethod( PreImagesRepresentative,
"for Frobenius automorphism and range element",
FamRangeEqFamElm,
[ IsFrobeniusAutomorphism, IsObject ],
function( aut, elm )
# the inverse is again a Frobenius automorphism (or the identity)
return ImagesRepresentative( InverseGeneralMapping( aut ), elm );
end );

InstallMethod( CompositionMapping2,
"for two Frobenius automorphisms",
IsIdenticalObj,
Expand Down
23 changes: 23 additions & 0 deletions tst/testbugfix/2026-08-28-PreImagesFrobenius.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# `PreImagesElm' for field homomorphisms compared `IsInjective' with 1
# (a GAP3 leftover), so the injective branch was dead and every nonzero
# element got the empty preimage. Fixing that exposed that Frobenius
# automorphisms had no `PreImagesRepresentative' method at all.
gap> frob := FrobeniusAutomorphism(GF(4));;
gap> PreImagesRepresentative(frob, Z(4));
Z(2^2)^2
gap> ImageElm(frob, PreImagesRepresentative(frob, Z(4))) = Z(4);
true
gap> PreImagesElm(frob, Z(4));
[ Z(2^2)^2 ]
gap> PreImagesElm(frob, 0*Z(4));
[ 0*Z(2) ]
gap> PreImagesSet(frob, GF(4)) = GF(4);
true

# a proper power of the Frobenius automorphism over a larger field
gap> aut := FrobeniusAutomorphism(GF(8))^2;;
gap> x := PreImagesRepresentative(aut, Z(8));;
gap> ImageElm(aut, x) = Z(8);
true
gap> PreImagesElm(aut, Z(8)) = [ x ];
true
Loading