Skip to content
Open
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
4 changes: 2 additions & 2 deletions doc/ref/mgmadj.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ gap> x:=Transformation( [ 7, 7, 7, 3, 7, 3, 7 ] );;
gap> x^map;
<monoid with 0 adjoined elt: Transformation( [ 7, 7, 7, 3, 7, 3, 7 ]
)>
gap> PreImage(map, x^map)=x;
gap> PreImagesRepresentative(map, x^map)=x;
true
]]></Example>
</Description>
Expand All @@ -72,7 +72,7 @@ gap> T:=MagmaWithZeroAdjoined(S);
gap> UnderlyingInjectionZeroMagma(T);
MappingByFunction( <transformation monoid of degree 8 with 2
generators>, <<transformation monoid of degree 8 with 2 generators>
with 0 adjoined>, function( elt ) ... end, function( x ) ... end )
with 0 adjoined>, function( elt ) ... end )
]]></Example>
</Description>
</ManSection>
Expand Down
5 changes: 4 additions & 1 deletion lib/mgmadj.gi
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ function(m)
fi;
SetGeneratorsOfMagma(out, gens);

inj:=MappingByFunction(m, out, inj, x-> x!.elt);
# the zero is not in the image, so <inj> is not bijective
inj:=MappingByFunction(m, out, inj, false, x-> x!.elt);
SetIsInjective(inj, true);
SetIsSurjective(inj, false);
SetUnderlyingInjectionZeroMagma(out, inj);

return inj;
Expand Down
28 changes: 17 additions & 11 deletions lib/reesmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ end);

BindGlobal("_InjectionPrincipalFactor",
function(D, constructor)
local map, inv, G, mat, rep, R, L, x, RR, LL, rms, iso, hom, i, j;
local map, inv, G, mat, rep, R, L, x, RR, LL, rms, iso, prefun, hom, i, j;

map := IsomorphismPermGroup(GroupHClassOfGreensDClass(D));
inv := InverseGeneralMapping(map);
Expand Down Expand Up @@ -1366,15 +1366,21 @@ function(D, constructor)
[i, (rep * RR[i] * x * LL[j]) ^ map, j, mat]);
end;

hom := MappingByFunction(D, rms, iso,
function(x)
if x![1] = 0 then
return fail;
fi;
return R[x![1]] * (x![2] ^ inv) * L[x![3]];
end);
SetIsInjective(hom, true);
SetIsTotal(hom, true);
prefun := function(x)
if x![1] = 0 then
return fail;
fi;
return R[x![1]] * (x![2] ^ inv) * L[x![3]];
end;

if IsReesZeroMatrixSemigroup(rms) then
# the zero of <rms> is not in the image
hom := MappingByFunction(D, rms, iso, false, prefun);
SetIsInjective(hom, true);
SetIsSurjective(hom, false);
else
hom := MappingByFunction(D, rms, iso, prefun);
fi;
return hom;
end);

Expand Down Expand Up @@ -1431,7 +1437,7 @@ function(S)
if x = MultiplicativeZero(Range(map)) then
return MultiplicativeZero(S);
fi;
return x ^ InverseGeneralMapping(map);
return PreImagesRepresentativeNC(map, x);
end;

return MagmaIsomorphismByFunctionsNC(S,
Expand Down
16 changes: 16 additions & 0 deletions tst/testbugfix/2026-10-18-InjectionZeroMagma.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# InjectionZeroMagma is injective but not surjective
gap> map := InjectionZeroMagma( SymmetricGroup( 2 ) );;
gap> [ IsInjective( map ), IsSurjective( map ), IsBijective( map ) ];
[ true, false, false ]
gap> x := (1,2) ^ map;;
gap> PreImagesRepresentative( map, x );
(1,2)
gap> PreImagesElm( map, x );
[ (1,2) ]
gap> z := MultiplicativeZero( Range( map ) );;
gap> PreImagesRepresentative( map, z );
fail
gap> PreImagesElm( map, z );
[ ]
gap> PreImage( map, z );
Error, <map> must be an injective and surjective mapping
5 changes: 3 additions & 2 deletions tst/testinstall/reesmat.tst
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,9 @@ gap> ForAll(S, s -> (s ^ iso) ^ inv = s);
true
gap> D := GreensDClassOfElement(S, S.1);;
gap> iso := _InjectionPrincipalFactor(D, ReesZeroMatrixSemigroup);;
gap> inv := InverseGeneralMapping(iso);;
gap> MultiplicativeZero(Range(iso)) ^ inv;
gap> IsSurjective(iso);
false
gap> PreImagesRepresentative(iso, MultiplicativeZero(Range(iso)));
fail

# AssociatedReesMatrixSemigroupOfDClass: for a D-class of a finite semigroup
Expand Down
2 changes: 1 addition & 1 deletion tst/testinstall/semigrp.tst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ gap> g := f/[f.1^4];;
gap> phi := InjectionZeroMagma(g);
MappingByFunction( <fp group on the generators
[ a ]>, <<fp group on the generators
[ a ]> with 0 adjoined>, function( elt ) ... end, function( x ) ... end )
[ a ]> with 0 adjoined>, function( elt ) ... end )
gap> m := Range(phi);
<<fp group on the generators [ a ]> with 0 adjoined>
gap> el := Elements(m);;
Expand Down
Loading