SmallGenerating set returns incorrect output for trivial monoid
gap> gens := SmallGeneratingSet(Semigroup(IdentityTransformation)); [ ] gap> Semigroup(gens); Error, usage: cannot create a semigroup with no generators, called from <function "Semigroup">( <arguments> ) called from readeval loop at line 2 of *stdin* you can 'quit;' to quit to outer loop, or you can 'return;' to continue brk>
Comments (7)


If I knew nothing about implementational details, I would ask for mathematical correctness over efficiency. The problem here is that a set is returned as a generating set, but it is not.
Probably, one solution would be to have
SmallSemigroupGeneratingSet
andSmallMonoidGeneratingSet
, since you already distinguish between these generating sets.Monoid([])
also does not work.I bump into this problem when processing a set of millions of semigroups that may contain the trivial monoid. Now I have to search for the trivial monoid beforehand.

Bit offtopic, but speaking of mathematical consistency, I would very much like to have the empty semigroup as a completely valid semigroup, since the empty set is a semigroup. Though I can imagine this would mess up the code with checks for emptiness everywhere...

Ok, I will make a new function
SmallSemigroupGeneratingSet
which always returnsGeneratorsOfSemigroup
. Will that suffice for your purposes? 
Yes, if
S = Semigroup(SmallSemigroupGeneratingSet(S))
is always true, and in most casesSmallSemigroupGeneratingSet(S)
< S, as the semigroups I need to process are often generated by the whole set of elements. 
 changed status to resolved
resolve issue
#64.→ <<cset d1b1c534dc39>>

 changed status to duplicate
Duplicate of
#36.  Log in to comment
This isn't a bug, but I might be willing to consider it as a feature request.
Here's why:
SmallGeneratingSet
returns the value ofGenerators
when applied to a semigroup created using a set of generators (found from the generators of the original semigroup). In this case what happens is that you are getting the result ofGenerators(Semigroup(IdentityTransformation))
. SinceSemigroup(IdentityTransformation)
is a monoid,Generators
returnsGeneratorsOfMonoid
for it, which in this case is empty.Note that you can happily do:
It could be that
SmallGeneratingSet
always returns the value ofGeneratorsOfSemigroup
but then in some cases, like inverse semigroups, this would return more generators thanGeneratorsOfInverseSemigroup
. I'm not really sure how to proceed.