Q:

A confusion in the proof of $|HK|=\displaystyle{\frac{|H||K|}{|H\cap K|}}$

I'm trying to understand the proof of $|HK|=\displaystyle{\frac{|H||K|}{|H\cap K|}}$, where $H$ and $K$ are separate groups.  
Let $[k_1],[k_2],\dots,[k_n]$ be the equivalence classes of $\frac{K}{H\cap K}$. The proof says $Hk_1,Hk_2,\dots, Hk_n$ are disjoint.  In other words, $Hk_i\cap Hk_j=\emptyset$ for $i\neq j$. I don't understand why this is the case.  
Let $h_1k_1=h_2k_2$ for $h_1,h_2\in H$. Note that $k_1\neq k_2$. This implies $h_2^{-1}h_1=k_2k_1^{-1}$. We know that $h_2^{-1}h_1\in H$ and $k_2k_1^{-1}\in K$, where one or none of $k_1^{-1},k_2\in H\cap K$. On a little investigation, we find out that both $k_1^{-1},k_2\in K\setminus (H\cap K)$. 
Can't two elements, which belong to $K\setminus (H\cap K)$, multiply to give an element in $H\cap K$? 
Thanks in advance.   

A:

If you don't mind, one can give the following proof.  Consider the map $$\phi:H\times K\to H K$$ given by $$ (h,k)\mapsto hk$$
Note that $|H\times K|=|H|\cdot |K|$. Now, pick $h_1k_1\in HK$. What is $\phi^{-1}(h_1k_1)$?  I claim that it is the set $$A=\{(h_1w^{-1},wk_1):w\in H\cap K\}$$ 
Indeed, it is clear that $\phi(h_1w^{-1},wk_1)=h_1k_1$. Now, suppose that $(h',k')$ is such that $\phi(h',k')=h'k'=h_1k_1$.  Then $$H\ni h_1^{-1}h'=k_1k'^{-1}\in K$$
and we have $(h',k')=(h_1(h_1^{-1} h'),(k'k_1^{-1})k_1)=(h_1w,w^{-1}k_1)\in A$.  It follows that our map is $|H\cap K|$ to $1$. Thus $$|HK|=\frac{|H||K|}{|H\cap K|}$$ 

A:

Suppose $Hk_i \cap Hk_j \ne \varnothing$ for some distinct $k_i, k_j$. Then there exist $h_i, h_j \in H$ such that $h_ik_i=h_jk_j$. Then

$h_j^{-1}h_i = k_jk_i^{-1} \in K$, so in fact $h_j^{-1}h_i \in H \cap K$;
$k_j = (h_j^{-1}h_i)k_i \in (H \cap K)k_i$.

But this second point contradicts $(H \cap K)k_i \cap (H \cap K)k_j = \varnothing$, which holds by definition of $k_i$ and $k_j$.
Conclude that $Hk_i \cap Hk_j = \varnothing$.

