# Finding presentation of a subgroup in GAP

I have a finitely prsented group $G$ and its subgroup $H$. They aren't stored however as fp groups in GAP. I can quite easy obtain some presentation $pr$ of $G$ in. How can I obtain the presentation of $H$ induced by $pr$ in GAP?

• This might help. – Shaun Dec 30 '17 at 0:22

Since you do not tell us anything about $G$ and $H$ and how you got them and represent them the following is rather abstract.

Suppose $G$ is a group in GAP and $H$ a subgroup (such that IsSubset(G,H) returns true).

Now construct separately a finitely presented group $F$ that is isomorphic to $G$, that is you create a free group and factor out the relators. Construct the natural epimorphism by mapping the generators of $F$ to corresponding images in $G$ (which I presume you know, they might in fact be the generators you gave to construct $G$).

hom:=GroupHomomorphismByImages(F,G,GeneratorsOfGroup(F),imagesinG);

You can get the subgroup of $F$ corresponding to $H$ as

U:=PreImage(hom,H);

and then use phi:=IsomorphismFpGroup(H); to construct a new finitely presented group isomorphic to $H$. You might need to pull the free generators back through $\phi$ and then through hom to see what elements of your $H$ they correspond to.

The cost of this operation (and the quality of the presentation) grows with the index of $H$ in $G$, so if this index is several million it is unlikely to perform satisfactory.