Subgroup of Direct Product is not necessarily Direct Product of Subgroups

Theorem
Let $G$ and $H$ be groups.

Let $G \times H$ denote the direct product of $G$ and $H$.

Let $K$ be a subgroup of $G \times H$.

Then it is not necessarily the case that $K$ is of the form:
 * $G' \times H'$

where:
 * $G'$ is a subgroup of $G$
 * $H'$ is a subgroup of $H$.

Proof
Let $G = H = C_2$, the cyclic group of order $2$.

Let $G = \gen x$ and $H = \gen y$, so that:


 * $G = \set {e_G, x}$
 * $H = \set {e_H, y}$

where $e_G$ and $e_H$ are the identity elements of $G$ and $H$ respectively.

Consider the element $\tuple {x, y} \in G \times H$.

We have that:
 * $\gen {\tuple {x, y} } =\set {\tuple {e_G, e_H}, \tuple {x, y} }$

but this is not the direct product of a subgroup of $G$ with a subgroup of $H$.