Proof
Recall that
HK={hk:h∈H,k∈K}.​
Certainly, ∣HK∣≤∣H∣⋅∣K∣ since some element in HK could be written as the product of different elements in H and K. It is quite possible that h1​k1​=h2​k2​ for h1​,h2​∈H and k1​,k2​∈K. If this is the case, let
a=(h1​)−1h2​=k1​(k2​)−1.​
Notice that a∈H∩K, since (h1​)−1h2​ is in H and k2​(k1​)−1 is in K; consequently,
h2​k2​​=h1​a−1=ak1​.​
Conversely, let h=h1​b−1 and k=bk1​ for b∈H∩K. Then hk=h1​k1​, where h∈H and k∈K. Hence, any element hk∈HK can be written in the form hi​ki​ for hi​∈H and ki​∈K, as many times as there are elements in H∩K; that is, ∣H∩K∣ times. Therefore, ∣HK∣=(∣H∣⋅∣K∣)/∣H∩K∣.