Let $G$ be a finite group and $x, y, z \in G$. A hyperbolic generating triple for $G$ is a triple $(x, y, z) \in G\times G\times G$ such that

  • $\frac{1}{o(x)}+\frac{1}{o(y)}+\frac{1}{o(z)} <1$,
  • $\langle x,y,z \rangle =G$, and
  • $xyz=1$.

The type of a hyperbolic generating triple $(x, y, z)$ is the triple $(o(x), o(y), o(z))$.

My question is, how can I use GAP to determine these triples for a group and therefore their type? Take $PSL(2, 7)$ as an example.

I thought this might work, but I cannot seem to print the triples.

cl:=ConjugacyClasses(G);; n:=Size(cl);;
class:=[];; GenTrips:=[];;
for i in [1..n] do
  Add(class ,AsList(cl[i]));;

for i in [1..n] do
  for j in [i..n] do
    for j2 in [1..Size(class[j])] do
      for k in [j..n] do
        if z in class[k] then
          if not trip in GenTrips then
          if g=Size(Group(x,y)) then
              Add(GenTrips ,trip);; Add(catch ,k);
        if Difference([j..n],catch)=[] then
          catch:=[]; break;


  • $\begingroup$ Well, filter first on the order condition and product condition (which are quicker to check) then on the generation condition. Unless I'm mistaken, you might as well require the first entry to have the highest order. What have you tried? $\endgroup$ Aug 31, 2021 at 7:28
  • $\begingroup$ @RussWoodroofe - I have yet to try anything. $\endgroup$
    – Kris
    Aug 31, 2021 at 7:36
  • $\begingroup$ Instead of if trip in GenTrips then else you can write if not trip in GenTrips then. Also, to see GenTrips after running this code, you can e.g. enter GenTrips; (or Length(GenTrips); if you want to inspect the length first). $\endgroup$ Aug 31, 2021 at 12:57
  • $\begingroup$ Thanks @AlexanderKonovalov. I have now made those changes. Is there a way of being able to then build on this code so that the conditions for hyperbolic generating triples can be identified? $\endgroup$
    – Kris
    Aug 31, 2021 at 13:10
  • 1
    $\begingroup$ After the for j loop you would test if 1/Order(Representative(class[i]))+1/Order(Representative(class[j]))+1/Order(Representative(class[i])*Representative(class[j]))<1 then to check for being a hyperbolic triple. $\endgroup$
    – ahulpke
    Aug 31, 2021 at 14:23

1 Answer 1


First get the possible types:

gap> o:=Set(List(ConjugacyClasses(G),x->Order(Representative(x))));
[ 1, 2, 3, 4, 7 ]
gap> t:=Filtered(UnorderedTuples(o,3),x->1/x[1]+1/x[2]+1/x[3]<1);
[ [ 2, 3, 7 ], [ 2, 4, 7 ], [ 2, 7, 7 ], [ 3, 3, 4 ], [ 3, 3, 7 ],
  [ 3, 4, 4 ], [ 3, 4, 7 ], [ 3, 7, 7 ], [ 4, 4, 4 ], [ 4, 4, 7 ],
  [ 4, 7, 7 ], [ 7, 7, 7 ] ]

Now for each type, the possible generators of these orders are described by epimorphisms from the group $$\langle x,y\mid x^{o(x)},y^{o(y)},(xy)^{o(z)}\rangle $$ We can find these as follows (here done for the first order tuple, one would have to run a loop to get over all):

gap> mytup:=t[1];
[ 2, 3, 7 ]
gap> fp:=f/[f.1^mytup[1],f.2^mytup[2],(f.1*f.2)^mytup[3]];
<fp group on the generators [ x, y ]>
gap> q:=GQuotients(fp,G);
[ [ x, y ] -> [ (1,3)(2,5)(4,7)(6,8), (3,5,7)(4,6,8) ] ]
gap> trip:=List(q,x->List([fp.1,fp.2,(fp.1*fp.2)^-1],
> y->ImagesRepresentative(x,y)));
[ [ (1,3)(2,5)(4,7)(6,8), (3,5,7)(4,6,8) ] ]

Finally we must make sure the element orders are as prescribed (and not smaller)

gap> trip:=Filtered(trip,x->List(x,Order)=mytup);
[ [ (1,3)(2,5)(4,7)(6,8), (3,5,7)(4,6,8), (1,3,4,6,7,2,5) ] ]

These are the triples for the selected type, up to conjugacy in $G$. A loop over t will give you all.

The advantage of this approach over the plain loops is that GQuotients takes care of which classes for which orders, and rund over the second class only up to conjugation by the centralizer of the first element, thus reducing the number of tests required.

  • $\begingroup$ Thank you @ahulpke. In your example above, I can assign generators x, y and z to show that their product is the identity. But not too sure how I would show that these elements generate the group G. Would each mytup from 1 to 12 do this and how can I be sure? I'm obviously missing some theory here. $\endgroup$
    – Kris
    Sep 1, 2021 at 8:56
  • $\begingroup$ @Kris GQuotients will find epimorphisms, that is each homomorphism is onto, and thus the elements generate. If only non-generating triples are found, it returns an empty list. $\endgroup$
    – ahulpke
    Sep 1, 2021 at 14:38
  • $\begingroup$ is it possible to carry out a further filter on t:=Filtered(UnorderedTuples(o,3),x->1/x[1]+1/x[2]+1/x[3]<1); so that we can remove any triples whose orders are not coprime? $\endgroup$
    – Kris
    Sep 11, 2021 at 8:10
  • $\begingroup$ @Kris. Yes. Do you want them pairwise coprime, or just coprime over all? $\endgroup$
    – ahulpke
    Sep 11, 2021 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.