diff --git a/lib/field.gi b/lib/field.gi index f5eadb8ede..c4ee2c4895 100644 --- a/lib/field.gi +++ b/lib/field.gi @@ -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 ); diff --git a/lib/fieldfin.gi b/lib/fieldfin.gi index 89b3d0aa79..612e990f38 100644 --- a/lib/fieldfin.gi +++ b/lib/fieldfin.gi @@ -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, diff --git a/tst/testbugfix/2026-08-28-PreImagesFrobenius.tst b/tst/testbugfix/2026-08-28-PreImagesFrobenius.tst new file mode 100644 index 0000000000..f6bd957556 --- /dev/null +++ b/tst/testbugfix/2026-08-28-PreImagesFrobenius.tst @@ -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