Skip to content

Commit 47fa98a

Browse files
authored
forbid Order for non-endo group homomorphisms (gap-system#6156)
1 parent 2789e82 commit 47fa98a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/morpheus.gi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ MORPHEUSELMS := 50000;
2626
InstallMethod(Order,"for automorphisms",true,[IsGroupHomomorphism],0,
2727
function(hom)
2828
local map,phi,o,lo,i,j,start,img,d,nat,ser,jord,first;
29+
if not IsEndoGeneralMapping( hom ) then
30+
Error( "Source and Range of <hom> must be equal" );
31+
fi;
2932
d:=Source(hom);
3033
if not (HasIsFinite(d) and IsFinite(d)) then
3134
TryNextMethod();

tst/testinstall/mapphomo.tst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ fail
7171
gap> GroupHomomorphismByImages(G, H, [], []);
7272
fail
7373

74+
# Order for homomorphisms
75+
gap> G:= SymmetricGroup( 3 );;
76+
gap> hom:= IdentityMapping( G );;
77+
gap> Order( hom );
78+
1
79+
gap> One( hom ) = hom;
80+
true
81+
gap> H:= Group( (1,2) );;
82+
gap> hom:= RestrictedMapping( hom, H );;
83+
gap> Order( hom );
84+
Error, Source and Range of <hom> must be equal
85+
gap> One( hom );
86+
fail
87+
7488
# Check that group homomorphisms created by a function can compute preimages.
7589
gap> for G in [ SymmetricGroup(5), SmallGroup( 24, 12 ), GL(2,3) ] do
7690
> hom:= GroupHomomorphismByFunction( G, G, x -> x );

0 commit comments

Comments
 (0)