Skip to content

Commit

Permalink
reesmat: add IsSimpleSemigroup method in reesmat
Browse files Browse the repository at this point in the history
The method installed in `lib/reesmat.gi` for `IsSimpleSemigroup` for
`IsReesMatrixSubsemigroup and HasUnderlyingSemigroup` is definitely the
best method for this type of argument. However, depending on the rank of
`RankFilter(IsFinite)`, this method is sometimes beaten by the
Semigroups package method for `IsSimpleSemigroup` for `IsSemigroup and
IsFinite`. This was causing a test in `tst/teststandard/reesmat.tst` to
run out of memory when all packages were loaded, since the Semigroups
package was being used when it shouldn't have been used.

This issue is resolved by adding an identical method for
`IsSimpleSemigroup` that additionally requires the filter `IsFinite`.
  • Loading branch information
wilfwilson authored and fingolfin committed Nov 15, 2018
1 parent 41cf327 commit 243b796
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/reesmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ InstallMethod(IsSimpleSemigroup,
[IsReesMatrixSubsemigroup and HasUnderlyingSemigroup],
R-> IsSimpleSemigroup(UnderlyingSemigroup(R)));

# This next method for `IsSimpleSemigroup` additionally requires the filter
# `IsFinite`, but is otherwise identical. In the Semigroups package, there are
# some more general methods installed for `IsSimpleSemigroup` which include the
# filter `IsFinite`. When the rank of `IsFinite` is sufficiently large, these
# methods can beat the above method. The above method is a more specific method
# and should always be the one chosen for Rees matrix subsemigroups with known
# underlying semigroup, whether finite or infinite.

InstallMethod(IsSimpleSemigroup,
"for finite subsemigroup of a Rees matrix semigroup with underlying semigroup",
[IsReesMatrixSubsemigroup and HasUnderlyingSemigroup and IsFinite],
R -> IsSimpleSemigroup(UnderlyingSemigroup(R)));

# check that the matrix has no rows or columns consisting entirely of 0s
# and that the underlying semigroup is simple

Expand Down
8 changes: 8 additions & 0 deletions tst/testinstall/reesmat.tst
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ gap> T := Semigroup(RMSElement(R, 2, S.1, 1));
<subsemigroup of 2x1 Rees matrix semigroup with 1 generator>
gap> IsSimpleSemigroup(T);
true
gap> S := FreeSemigroup(1);
<free semigroup on the generators [ s1 ]>
gap> S := S / [[S.1, S.1 ^ 4]];
<fp semigroup on the generators [ s1 ]>
gap> R := ReesMatrixSemigroup(S, [[S.1, S.1 ^ 2], [S.1, S.1 ^ 3]]);
<Rees matrix semigroup 2x2 over <fp semigroup on the generators [ s1 ]>>
gap> IsSimpleSemigroup(R);
true

# IsZeroSimpleSemigroup: for a Rees 0-matrix semigroup
gap> S := Semigroup([Transformation([1, 1]), Transformation([2, 2])]);
Expand Down

0 comments on commit 243b796

Please sign in to comment.