Disallow duplicate named generators when constructing magmas, semigroups, groups, etc#6097
Disallow duplicate named generators when constructing magmas, semigroups, groups, etc#6097wilfwilson wants to merge 1 commit intogap-system:masterfrom
Conversation
6d01a95 to
3e0b8e5
Compare
|
It seems there are manual examples that explicitly use duplicate generators, see for example the part of the manual titled "Comparison of Associative Words" ( gap> f:= FreeGroup( "a", "b", "b" );;
gap> gens:= GeneratorsOfGroup(f);
[ a, b, b ]
gap> gens[2] = gens[3];
false
gap> x:= gens[1]*gens[2];
a*b
gap> y:= gens[2]/gens[2]*gens[1]*gens[2];
a*b
gap> x = y;
true
gap> z:= gens[2]/gens[2]*gens[1]*gens[3];
a*b
gap> x = z;
falseWhich demonstrates that We can also see that gap> G := FreeGroup("a", "b", "b");
<free group on the generators [ a, b, b ]>
gap> AssignGeneratorVariables(G);
#I Global variable `b' is already defined and will be overwritten
#I Assigned the global variables [ a, b, b ] |
|
I am tempted to forbid it, because I find it hard to imagine someone is using this on purpose, and hasn't just made a typo and is confusing themselves. |
|
I agree with @ChrisJefferson. My guess is that the idea of this manual example is to demonstrate that words which look equal need not be equal. |
|
I agree with @ThomasBreuer and @ChrisJefferson |
3e0b8e5 to
e287507
Compare
FreeMagma, FreeGroup, FreeMonoid, etcb113d15 to
d35871e
Compare
d35871e to
04b4fa9
Compare
|
I'd be fine with this as well. |
|
I'll try to get it finished soon. |
|
I agree with @ChrisJefferson, @james-d-mitchell and @fingolfin. |
|
What's the status of this? It is still marked as a draft, and CI had some failures. |
|
I've been busy with my new job, sadly. But I still intend to complete this, at the latest it's one of the things I'll work on a GAP Days Spring 2026, at which I hope to see many of you... |
To me it seems like doing something like
FreeGroup("x", "x");can only possibly lead to potential confusion, I can't see a use case for it and I think it should be disallowed. But I'm open to contrary opinions.To add:
generatorNamesoption for pc groupsFreeMagmaFreeMagmaWithOneFreeSemigroupFreeMonoidFreeGroupFreeAlgebraFreeAlgebraWithOneFreeAssociativeAlgebraFreeAssociativeAlgebraWithOneFreeLieAlgebraFreeBandandFreeInverseSemigroup: Disallow duplicate named generators inFreeBandandFreeInverseSemigroupsemigroups/Semigroups#1118Plus: