Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some bugs in the Rees (0)-matrix semigroups code #768

Merged
merged 2 commits into from
May 3, 2016
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
27 changes: 23 additions & 4 deletions lib/reesmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,30 @@ function(R)
TryNextMethod();
end);

InstallImmediateMethod(IsFinite, IsReesMatrixSubsemigroup, 0,
function(R)
if IsBound(ElementsFamily(FamilyObj(R))!.IsFinite) then
return ElementsFamily(FamilyObj(R))!.IsFinite;
fi;
TryNextMethod();
end);

InstallMethod(IsFinite, "for a Rees matrix subsemigroup",
[IsReesMatrixSubsemigroup],
function(R)
return IsFinite(ParentAttr(R));
if (not IsIdenticalObj(R, ParentAttr(R))) and HasIsFinite(ParentAttr(R)) then
return IsFinite(ParentAttr(R));
fi;
TryNextMethod();
end);

InstallMethod(IsFinite, "for a Rees 0-matrix subsemigroup",
[IsReesZeroMatrixSubsemigroup],
function(R)
return IsFinite(ParentAttr(R));
if (not IsIdenticalObj(R, ParentAttr(R))) and HasIsFinite(ParentAttr(R)) then
return IsFinite(ParentAttr(R));
fi;
TryNextMethod();
end);

#
Expand Down Expand Up @@ -240,6 +254,10 @@ function(S, mat)
fam := NewFamily( "ReesMatrixSemigroupElementsFamily",
IsReesMatrixSemigroupElement);

if HasIsFinite(S) then
fam!.IsFinite := IsFinite(S);
fi;

# create the Rees matrix semigroup
R := Objectify( NewType( CollectionsFamily( fam ), IsWholeFamily and
IsReesMatrixSubsemigroup and IsAttributeStoringRep ), rec() );
Expand Down Expand Up @@ -316,8 +334,9 @@ function(S, mat)
# cannot set IsZeroSimpleSemigroup to be <true> here since the matrix may
# contain a row or column consisting entirely of 0s!
# WW Also S might not be a simple semigroup (which is necessary)!

GeneratorsOfSemigroup(R);
if IsGroup(S) or (HasIsFinite(S) and IsFinite(S)) then
GeneratorsOfSemigroup(R);
fi;
SetIsSimpleSemigroup(R, false);
return R;
end);
Expand Down
20 changes: 18 additions & 2 deletions tst/teststandard/reesmat.tst
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,11 @@ gap> Length(GreensDClasses(UUU));
4
gap> Size(V);
33
gap> Vt:=Range(IsomorphismTransformationSemigroup(V));
<transformation semigroup of degree 34 with 5 generators>
gap> Vt:=Range(IsomorphismTransformationSemigroup(V));;
gap> Length(GeneratorsOfSemigroup(Vt));
5
gap> DegreeOfTransformationSemigroup(Vt);
34
gap> Size(Vt);
33
gap> Representative(R);
Expand Down Expand Up @@ -1085,6 +1088,19 @@ true
gap> IsFinite(S);
true

# Test bug in IsFinite for RMS or RZMS created over a free group
gap> S := FreeGroup(1);;
gap> R := ReesMatrixSemigroup(S, [[S.1]]);;
gap> IsFinite(R);
false
gap> R := ReesZeroMatrixSemigroup(S, [[S.1]]);;
gap> IsFinite(R);
false

# Test bug in creation of RZMS over a free semigroup
gap> S := FreeSemigroup(1);;
gap> R := ReesZeroMatrixSemigroup(S, [[S.1]]);;

#
gap> STOP_TEST( "reesmat.tst", 54100000);

Expand Down