Induced Group Product is Homomorphism iff Commutative

Theorem
Let $\left({G, \circ}\right)$ be a group.

Let $H_1, H_2$ be subgroups of $G$.

Let $\phi: H_1 \times H_2 \to G$ be defined such that $\forall \left({h_1, h_2}\right) \in H_1 \times H_2: \phi \left({\left({h_1, h_2}\right)}\right) = h_1 \circ h_2$.

Then $\phi$ is a homomorphism every element of $H_1$ commutes with every element of $H_2$.

Proof
We have $\left({h_1, h_2}\right) \circ \left({k_1, k_2}\right) = \left({h_1 \circ k_1, h_2 \circ k_2}\right)$ by definition of group direct product.

Necessary Condition
Let $\phi$ be a homomorphism.

Then:

This follows whatever $k_1$ and $h_2$ are.

So in order for $\phi$ to be a homomorphism, every element of $H_1$ must commute with every element of $H_2$.

Sufficient Condition
Let every element of $H_1$ commute with every element of $H_2$.

Let $\left({h_1, h_2}\right), \left({k_1, k_2}\right) \in H_1 \times H_2$.

Then:

Thus $\phi$ is shown to be a homomorphism.