# MultiplicativeZero for an acting semigroup has bugs

Issue #121 resolved
wilfwilson
created an issue

I've been trying to increase code coverage of MultiplicativeZero and I've found problems. I will try to address these in the morning when I am fresh but I'll put them here for now as a record of this problem.

```gap> gens := [ Transformation( [ 1, 2, 1 ] ), Transformation( [ 1, 2, 2 ] ) ];;
gap> S := Semigroup(gens);;
gap> Elements(S);
[ Transformation( [ 1, 2, 1 ] ), Transformation( [ 1, 2, 2 ] ) ]
gap> IsRectangularBand(S) and not IsTrivial(S);
true
gap> MultiplicativeZero(S);
Transformation( [ 1, 2, 1 ] )
gap> IsMultiplicativeZero(S, last);
true
```

These last two lines are nonsense; this rectangular band has no zero.

Additionally I have already removed an infinite loop which occurred in this case:

```gap> S := Semigroup(Transformation( [ 1 ] ));;
gap> MultiplicativeZero(S);
```

Also perhaps this function could probably benefit from the newer `MinimalIdeal` code for transformations which is in progress.

## Comments (12)

1. reporter

In the ww branch I have fixed this by checking both `Size(GreensRClassOfElement(s, f)) = 1` and `Size(GreensLClassOfElement(s, f)) = 1`.

2. repo owner

There is probably a more efficient way of doing this, so I'm reopening this issue.

3. repo owner

I think the best solution to this is to change the method to the following:

```InstallMethod(MultiplicativeZero, "for an acting semigroup",
[IsActingSemigroup],
function(S)
if Size(MinimalDClass(S)) = 1 then
return Representative(MinimalDClass(S));
else
return fail;
fi;
end);
```

and to make sure that the minimal D-class code is good as possible (i.e. uses the stuff you've been working on recently.

What do you think? Is there some reason you didn't go down this route?

4. reporter

Yes, this is just what I was thinking of doing. I intend to do this.

In my opinion fixing the bug was a separate issue from improving and re-writing it the function. This is why I closed the function after writing a quick fix.

5. repo owner

Good.

Just to note: the reason we didn't do the suggested method above previously is that `MinimalDClass` is a relatively recent addition.

6. reporter

I have decided on something slightly different.

`MinimalDClass` now returns `GreensDClassOfElementNC(S, RepresentativeOfMinimalIdeal(S));` as it should.

However, calculating the size of a D-class can still take some time. So unless we already know that the size of the MinimalDClass, I take this approach in `MultiplicativeZero`:

```rep := RepresentativeOfMinimalIdeal(s);
if ForAll(gens, x -> x * rep = rep and rep * x = rep) then
return rep;
else
return fail;
fi;
```
7. repo owner
• removed milestone

Removing milestone: 2.4 (automated comment)

8. Log in to comment