suppose hk = h'k', where h ≠ h'. clearly k cannot be k' in this case, either, or we would have h = h', by the cancellation law.
well then h'^-1h = k'k^-1. this tells us that if we have a duplication, we also have an element in H∩K, namely h'^-1h.
so for each duplication, we have an element in the intersection. the question is, for a given hk in HK, how many possible ways
is there to write it as some other product h'k'? that is, does every element of H∩K gives a duplication in HK of hk, for a given hk?
well, if x is in H∩K, then x^-1 is in H∩K (since H∩K is a subgroup). so:
hk = h(xx^-1)k = (hx)(x^-1k). but hx is in H, since h is in H and x is in H∩K, and thus in H.
similarly, x^-1K is in K, since x^-1 is in H∩K, and thus in K, and k is in K.
taking h' = hx, and k' = x^-1k, we have hk = h'k'. so we see we get |H∩K| products h'k' all equal to hk,
one for each different x in H∩K (the identity e gives us the original hk).