When working with group cosets in MAGMA is there a way of treating the cosets as subsets of the overlying group. Specifically I have a group $G$ and subgroups $H$ and $K$ . I wish to look at the intersection of a pair of cosets $Hh$ and $Kk$ for some $h,k\in G$ , but am unable to perform such operations in MAGMA when they are considered as cosets.



Working with group cosets in MAGMA
As far as I can see, the only way to do that directly with cosets $ C1$ and $C2$ of $G$ is


$\{ x : x\ {\rm in}\ G\ |\ x\ {\rm in}\ C1\ {\rm and}\ x\ {\rm in}\ C2 \}$


which looks very inefficient, because it is iterating over all of $G$.


I would suggest first find a right transversal $T$ of $H \cap K$ in $H$, and then search through $T$ looking for an element $t \in T$ with $thk^{-1} \in K$. If you find such a $t$, then the intersection is the coset $(H \cap K)th$, and otherwise it is empty.


