I am wondering how to prove the formula $|HK| = \dfrac{|H| \; |K|}{|H \cap K|}$ where $H$ and $K$ are finite groups. Let $|H|$ denote the order of $H$ and so on.
I have seen proofs from these websites: (1) and (2).
But I do not really understand the idea of the proof. Can someone explain the proof to me, please? Thanks so much.
The idea is that every element in $HK$ is a multiplication of $h\in H$ and $k\in K$. But if $k\in H\cap K$ then $hk$ is already an element of $H$ and therefore if we take $h'=hk \in H$ and $k'=e \in K$ you get a different way of getting the element $hk$ and therefore $|H||K|$ is overcounting.
Therefore, to get the actual size, you need to first remove all the elements that cause the overcounting, so every element will be counted only once.