I have defined $S\_4$ (Symmetric group of order 4), and with the base field $Z\_5$, groupring $Z\_5S\_4$ is constructed. Then I have taken two elements of this group ring and I want to multiply them to get the simplest result.



```
gap> f := FreeGroup( "a", "b","c" );;
gap> G := f / [ f.1^2, f.2^3,f.3^4, f.1*f.2*f.3 ];
<fp group on the generators [ a, b, c ]>
gap> AsList(G);
    [ <identity ...>, a, b, b^-1, c, c^-1, a*b^-1, a*c, b*a, b*c^-1, b^-1*c^-1, c*b^-1, c^2,
  c^-1*a, a*b^-1*c^-1, a*c*b^-1, b*a*b^-1, b*a*c, b^-1*c^-1*a, c*b^-1*c^-1, c^-1*a*c,
  a*b^-1*c^-1*a, b*a*b^-1*c^-1, b^-1*c^-1*a*c ]
gap> a:=G.1;;
gap> a^2;
a^2
gap> a^2=One(G);
true

```

**Question**
Why I am not getting simplified form of the group elements? E.g. `a^2` is the identity, but is displayed as `a^2`.



Problem while multiplying under a set of relators
Algorithms for finitely presented groups are hard -- generically problems, such as testing whether a word represents the identity (or finding a shortest word expression) do not have (they cannot exist as they are equivalent to the Halteproblem for Turing machines) general algorithmic solutions.
Therefore GAP will by default not reduce word expressions in finitely presented groups.


If you know that your group `G` is finite and small, you can force a reduction by issuing the following two commands **immediately** after creating the group:



```
Size(G);
SetReducedMultiplication(G);

```

Then, when the first product of generators is formed, GAP will calculate a confluent rewriting system using a Knuth-Bendix algorithm, and use it to bring elements in a lenlex-minimal representation. In your example you then will get:



```
gap> List(G);
[ <identity ...>, a, b, b^-1, c, c^-1, c^-1*b, a*c, b*a, b*c^-1, c*b, c*b^-1,
  c^2, c^-1*a, a*c*b, b*c^-1*a, b*c^-1*b, b*a*c, c*b*a, c^2*b, a^c, a*c*b*a,  b*a*c*b, c^-1*a*c*b ]
gap> a:=G.1;;
gap> a^2;
<identity ...>

```

This however costs time and memory (and for large groups might not be able to succeed), and is not always necessary, thus it is not done by default.


