From 1cfdd6e5ffe74c8bf2ce2eb2098329a5cadedeb2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 18 Oct 2026 11:21:38 +0200 Subject: [PATCH] Use preimages instead of inverse of zero injection `UnderlyingInjectionZeroMagma` is injective but not surjective: the adjoined zero is not in its image. GAP currently marks it bijective by mistake, which makes `x ^ InverseGeneralMapping( inj )` work. Once GAP fixes that (gap-system/gap#6767), the inverse is no longer total and `^` raises an error, breaking `IsomorphismPartialPermSemigroup` for zero groups. Use `PreImagesRepresentative` instead, which works with both old and fixed GAP versions. Assisted-by: Generative AI --- gap/semigroups/semipperm.gi | 5 ++--- tst/standard/semigroups/semicons.tst | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gap/semigroups/semipperm.gi b/gap/semigroups/semipperm.gi index 2f64bb321..daca60314 100644 --- a/gap/semigroups/semipperm.gi +++ b/gap/semigroups/semipperm.gi @@ -170,11 +170,10 @@ InstallMethod(IsomorphismPartialPermSemigroup, "for a group with adjoined zero", [IsMagmaWithZeroAdjoined and IsZeroGroup], function(S) - local zero, inj_zm, inv_zm, grp, one, iso, inv, T, iso_pp, inv_pp; + local zero, inj_zm, grp, one, iso, inv, T, iso_pp, inv_pp; zero := MultiplicativeZero(S); inj_zm := UnderlyingInjectionZeroMagma(S); - inv_zm := InverseGeneralMapping(inj_zm); grp := Source(inj_zm); if IsTrivial(grp) then @@ -206,7 +205,7 @@ function(S) if x = zero then return EmptyPartialPerm(); fi; - return (x ^ inv_zm) ^ iso_pp; + return PreImagesRepresentativeNC(inj_zm, x) ^ iso_pp; end; inv := function(x) diff --git a/tst/standard/semigroups/semicons.tst b/tst/standard/semigroups/semicons.tst index 34986b2d0..5751831bc 100644 --- a/tst/standard/semigroups/semicons.tst +++ b/tst/standard/semigroups/semicons.tst @@ -1133,7 +1133,8 @@ gap> m1 := function(trans) gap> H[2][1] := SemigroupHomomorphismByFunction(L[5], L[2], m1);; gap> m1 := function(magelem) > local p; -> p := magelem ^ InverseGeneralMapping(UnderlyingInjectionZeroMagma(L[2])); +> p := PreImagesRepresentative(UnderlyingInjectionZeroMagma(L[2]), +> magelem); > if p = fail then > return Transformation([1, 1, 1]); > elif p in AlternatingGroup(3) then