# My output of a group and inverse-closed subset in MAGMA is no longer inverse-closed when entered as input to GAP.

In MAGMA, I input the following:
G:=SmallGroup(20,3); G;
E:=[xx:xx in G]; S:=[E[6],E[7],E[13],E[20]]; S;
S[1]^2;
S[2]^2;
S[3]*S[4];

This gives the output:
GrpPC : G of order 20 = 2^2 * 5
PC-Relations: G.1^2 = G.2, G.2^2 = Id(G), G.3^5 = Id(G), G.3^G.1 = G.3^2, G.3^G.2 = G.3^4
[ G.2, G.2 * G.3, G.1 * G.3^2, G.1 * G.2 * G.3^4 ]
Id(G)
Id(G)
Id(G)

I input this group G and set S to GAP:
gap> F:=FreeGroup( 3 ,"G"); gap> rels:=[F.1^2*F.2^(-1),F.2^2,F.3^5,F.1*F.3*F.1^(-1)*F.3^(-2),F.2*F.3*F.2^(-1)*F.3^(-4)];;
gap> G:=F/rels;; S:=[G.2,G.2*G.3,G.1*G.3^2,G.1*G.2*G.3^4];;
gap> S[1]^2=Identity(G);
true
gap> S[2]^2=Identity(G);
true
gap> S[3]*S[4]=Identity(G);
false

The last statement indicates that S is somehow no longer inverse-closed. Can someone help me understand what's going on here? I would like to have a form of G in terms of the generators and relators, and S in terms of the elements of G; such that I can reproduce (G,S) somewhere other than MAGMA.

-

The point is that in GAP, a^b means b^-1*a*b rather than b*a*b^-1. If you adjust your relations accordingly, you get what you expect:

gap> rels:=[F.1^2*F.2^(-1),F.2^2,F.3^5,F.1^-1*F.3*F.1*F.3^(-2),
>           F.2^-1*F.3*F.2*F.3^(-4)];;
gap> G:=F/rels;; S:=[G.2,G.2*G.3,G.1*G.3^2,G.1*G.2*G.3^4];;
gap> S[1]^2 = One(G);
true
gap> S[2]^2 = One(G);
true
gap> S[3]*S[4] = One(G);
true

-

(I meant to post this as a comment, but that doesn't seem to allow me to format code, so I'll post it as an answer instead)

Note that GAP also has the database of small groups built in, so you can also directly access the group in question and obtain a presentation for it:

gap> G:=SmallGroup(20,3);
<pc group of size 20 with 3 generators>
gap> F:=Image(IsomorphismFpGroup(G));
<fp group of size 20 on the generators [ F1, F2, F3 ]>
gap> RelatorsOfFpGroup(F);
[ F1^2*F2^-1, F2^-1*F1^-1*F2*F1, F3^-1*F1^-1*F3*F1*F3^-1, F2^2, F3^-1*F2^-1*F3*F2*F3^-3, F3^5 ]

-