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
31 changes: 23 additions & 8 deletions gap/attributes/homomorph.gi
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ InstallMethod(AsSemigroupIsomorphismByFunction,
hom -> SemigroupIsomorphismByFunctionNC(Source(hom),
Range(hom),
x -> ImageElm(hom, x),
y -> PreImages(hom, y)));
y ->
PreImagesRepresentativeNC(hom, y)));

# Methods for SHBI/SIBI/SHBF
InstallMethod(IsSurjective, "for a semigroup homomorphism",
Expand Down Expand Up @@ -364,6 +365,17 @@ InstallMethod(ImagesSource, "for SHBI",
[IsSemigroupHomomorphismByImages],
hom -> Semigroup(MappingGeneratorsImages(hom)[2]));

# <x> must lie in ImagesSource(hom).
SEMIGROUPS.PreImagesRepresentativeSHBI := function(hom, x)
# Use MinimalFactorization rather than Factorization because
# MinimalFactorization is guaranteed to return a list of positive integers,
# but Factorization is not (i.e. if S is an inverse acting semigroup.
# Also since we require an IsomorphismFpSemigroup, there's no additional
# cost to using MinimalFactorization instead of Factorization.
return EvaluateWord(MappingGeneratorsImages(hom)[1],
MinimalFactorization(ImagesSource(hom), x));
end;

InstallMethod(PreImagesRepresentative,
"for a semigroup homom. by images and an element in the range",
[IsSemigroupHomomorphismByImages, IsMultiplicativeElement],
Expand All @@ -374,15 +386,18 @@ function(hom, x)
elif not x in ImagesSource(hom) then
return fail;
fi;
# Use MinimalFactorization rather than Factorization because
# MinimalFactorization is guaranteed to return a list of positive integers,
# but Factorization is not (i.e. if S is an inverse acting semigroup.
# Also since we require an IsomorphismFpSemigroup, there's no additional
# cost to using MinimalFactorization instead of Factorization.
return EvaluateWord(MappingGeneratorsImages(hom)[1],
MinimalFactorization(ImagesSource(hom), x));
return SEMIGROUPS.PreImagesRepresentativeSHBI(hom, x);
end);

# GAP >= 4.17 calls PreImagesRepresentativeNC internally; in older versions it
# is the same operation as PreImagesRepresentative, see init.g.
if not IsIdenticalObj(PreImagesRepresentative, PreImagesRepresentativeNC) then
InstallMethod(PreImagesRepresentativeNC,
"for a semigroup homom. by images and an element in the image",
[IsSemigroupHomomorphismByImages, IsMultiplicativeElement],
SEMIGROUPS.PreImagesRepresentativeSHBI);
fi;

InstallMethod(ImagesRepresentative,
"for a semigroup homom. by images and an element in the source",
[IsSemigroupHomomorphismByImages, IsMultiplicativeElement],
Expand Down
4 changes: 2 additions & 2 deletions gap/attributes/isorms.gi
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function(R)

tester := function(x)
local y, found, g, i, tmp, map;
y := PreImagesRepresentative(hom, x ^ Projection(V, 2));
y := PreImagesRepresentativeNC(hom, x ^ Projection(V, 2));
x := x ^ Projection(V, 1);
tmp := [];
found := false;
Expand Down Expand Up @@ -514,7 +514,7 @@ function(R)

tester := function(x)
local y, map, g;
y := PreImagesRepresentative(hom, x ^ Projection(V, 2));
y := PreImagesRepresentativeNC(hom, x ^ Projection(V, 2));
x := x ^ Projection(V, 1);
for g in T do
map := RMSInducedFunction(R, R, x, y, g);
Expand Down
5 changes: 5 additions & 0 deletions tst/standard/attributes/homomorph.tst
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ gap> x := ConstantTransformation(2, 1);
Transformation( [ 1, 1 ] )
gap> x ^ map;
Transformation( [ 1, 1 ] )
gap> iso := AsSemigroupIsomorphismByFunction(hom2);;
gap> x ^ InverseGeneralMapping(iso);
Transformation( [ 1, 1 ] )
gap> PreImagesRepresentativeNC(hom2, x);
Transformation( [ 1, 1 ] )
gap> imgs2 := [gens[2], gens[2], gens[1], gens[3]];;
gap> hom3 := SemigroupHomomorphismByImages(S, S, gens, imgs2);
fail
Expand Down
Loading