Q: number of distinct ways of writing each element of the set $HK$ in the form $hk$ Let $H$ and $K$ be subgroups of the group $G$. The number of distinct 
ways of writing each element of the set $HK$ in the form $hk$, for some $h \in H$ and $k \in K$ is $|H \cap K|$. 
My thoughts:-
Let $|H \cap K|=n$.  Let $h_i=k_i$ where $i=1,2,3,....,n$.then if $\alpha \in HK$ then $\alpha = hk$ and also $\alpha = (hh_i)(h_i^{-1}k)$.
but how can I able to show these are the only representation toprove the problem.  

A: Suppose $x = h_1k_1 = h_2k_2$. Then $k_1k_2^{-1} = h_1^{-1}h_2 = r \in H \cap K$. So $h_1k_1 = h_2r^{-1} \cdot rk_2$. On the other hand, suppose $x = hk$. Then for every $r \in H \cap K$ we can write $x= hr^{-1} \cdot rk \in HK$. Thus every representation of $x$ in $HK$ corresponds to a unique element in $H \cap K$, so there are $|H \cap K|$ ways to write $x$ in the form $x = hk \in HK$.

A: If $hk=h'k'$ then $kk'^{-1}=h^{-1}h'\in H\cap K$ and...?

A: This comes down to the number of distinct left cosets of K. We know that |HK| = |H||K|/|H $\cap$ K|. The result follows from this when we see that  |H $\cap$ K|= |H||K|/|HK| will yield the number of distinct ways to write an element of HK.
