I look at monoid algebra of finite monoids with GAP and want to force GAP to view them as algebras with one. But it seems it does not work:
LoadPackage("smallsemi");
n:=6;
W:=AllSmallSemigroups(n,IsMonoidAsSemigroup,true);
U:=W[2];
T:=FreeMagmaRing(Rationals,U);
TT:=AsAlgebraWithOne(Rationals,T);
HasIdentity(TT);
$T$ is the the free magma ring of the finite monoid $U$ and GAP does not seem to know that it has an identity. So I use the command AsAlgebraWithOne to make GAP realise that this algebra has an identity but I still get the output "fail".
Question: Is there an easy fix to make GAP view the algebra $T$ as an algebra with identity?
More generally, I want to use this command also to check whether a given finite semigroup algebra has an identity and then view the semigroup algebra as an algebra with identity.
Actually already
AsAlgebraWithOnereturnsfailhere. This is a fundamental misunderstanding about what this command does.Anyway, since your examples are tiny, one can simply achieve what you want by constructing an actual monoid (in the category of monoids, instead of the category of semigroups) as in this example.
Note that
HasIdentityat first still returnsfalse. This is because this function does not test whether an identity elements exists. Rather, it tests if a value for theIdentityattribute of the algebraTexists (this attribute in turn is an alias for theOneattribute). Thus after asking forOne(T), the return value ofHasOnechanges totrue-- because the explicit request forOne(T)computed an identity element, which was cached.Here is the example code