# Writing $HK$ as the disjoint union of $xK$

I apologize for what might be a boring technical question, but in reading about double cosets, I want to understand the following idea which may be of use.

If $H$ and $K$ are subgroups of some group, then why can $HK$ be a disjoint union of cosets $xK$ where $x$ ranges over a set of representatives of $H/(H\cap K)$? In particular, why do the representatives range over $H/(H\cap K)$?

Could someone provide an explanation of how this works exactly? The notes I'm reading say this is more or less obvious, but I don't follow.

-

Consider two cosets $xK$ and $yK$ with $x, y \in H$. They are the same iff $x \in yK$, i. e. iff $xy^{-1} \in K$. Since $x,y \in H$ that happens iff $xy^{-1} \in H \cap K$. So $xK = yK$ iff $x(H \cap K) = y(H \cap K)$. So it suffices to take one representative from each element of $H/(H \cap K)$.