Question: I have a group:

```
group = PermutationGroup[{Cycles[{{1, 3, 6}, {2, 4}}], Cycles[{{6, 7}}]}];

```

And I have s subgroup

```
subgroup = PermutationGroup[{Cycles[{{6,7}}],Cycles[{{2,4}}],Cycles[{{1,7}}]}];

```

We can check it:

```
ResourceFunction["SubgroupQ"][subgroup, group]

```

> 
> True
> 
> 
> 

So how to find all left cosets(or just the representative element in all left cosets) about `subgroup` in `group`?

Answer: 
Since two left cosets $g\cdot H$ and $h \cdot H$ satisfies $g\cdot H= h \cdot H$ is equavalent to $ h^{-1}\cdot g\in H$,we set it as the equivalence relationships and use `Gather`.

```
Gather[GroupElements[group],
   GroupElementQ[subgroup, PermutationProduct[InversePermutation[#1], #2]] &]

```

There are 4 cosets.

[![enter image description here](https://i.stack.imgur.com/LN1V1.png)](https://i.stack.imgur.com/LN1V1.png)
Share another elegant method to **list all right cosets**. The only regret is that it cannot be used to find left cosets. Because The inverse of the right coset canonical representative about $p$ is not in the same left coset with $p$:

```
GatherBy[GroupElements[group], RightCosetRepresentative[subgroup, #] &]

```