need a help with group product and isomorphism 
Let H, K be finite groups with $\gcd(|H|,|K|) =1 $. In $H\times K$, let $H_1 = H \times (e_K)$ and $K_1 = (e_H) \times K$. Then $H_1, K_1$ are each normal subgroups of $H \times K$, with $H_1 \cap K_1 = (e)$ and $H_1 K_1 = H \times K$. Let $M$ be any subgroup of $H \times K$, and let $A = M \cap H_1$ and $B = M \cap K_1$. Prove that $M = AB \cong A \times B$.

To prove this I tried as follows:
Put $|H| = s, \ |K| = t$ and suppose $|M| = s_0 t_0$ with $s_0 \mid s,$ and $t_0 \mid t$.
Now $A = |M \cap H_1| = s_0$ and $B = |M \cap K_1| = t_0$. So $|A||B| = |M|$. As $AB = \{(a,b) : (a, e_K) \in A, (e_H,b) \in B\}$, $AB \cong A \times B$. Therefore $|AB| = |A||B| = M$ and this implies $M = AB$.
I think I need to fill gaps for the part $A = s_0$ and for the part $M = AB$.
What should I do to fill these gaps?
 A: It is enough to show that if $(x,y) \in M$, then so is $(x,e_K)$. 
Now, there is a $N > 0$ such that $t|N$ and $s|N-1$. You can see easily that $(x,e_K) =(x,y)^N \in M$. 
A: 
Put $|H| = s, \ |K| = t$ and suppose $|M| = s_0 t_0$ with $s_0 \mid s,$ and $t_0 \mid t$. Now $A = |M \cap H_1| = s_0$ and $B = |M \cap K_1| = t_0$.

How do you know that $|M|=|A||B|$? This is the essence of the proof, as clearly $A\times B\subset M$. You ask

I think I need to fill gaps for the part $A = s_0$ and for the part $M = AB$.
  What should I do to fill these gaps?

But you haven't even defined $s_0$ very clearly. Instead you can start with the order reversed, as follows:

Put $s:=|H|$, $t:=|K|$, $s_0:=|A|$ and $t_0:=|B|$ so that $s_0\mid s$ and $t_0\mid t$.

Now you want to show that $M=s_0t_0$. It is clear that $M\geq s_0t_0$ as $A,B\subset M$ and $\gcd(s_0,t_0)=1$. For the converse, it suffices to show that if $(a,b)\in M$ then $(a,e_K),(e_H,b)\in M$. To show this, use the fact that $\gcd(s_0,t_0)=1$ to find positive integers $m$ and $n$ such that
$$(a,b)^m=(a,e_K)\qquad\text{ and }\qquad (a,b)^n=(e_H,b).$$
