Prove that the set $H =\{1, x, y, xy\}$ is a subgroup of $G$, and that it has order 4.

abstract-algebragroup-theory

The question is from Michael Artin – Algebra (2nd Edition), Chapter 2, exercise 4.7.

Let $x$ and $y$ be elements of a group $G$. Assume that each of the elements $x, y$, and $xy$ has order 2. Prove that the set $H = \{1, x, y, xy\}$ is a subgroup of $G$, and that it has order 4.

My approach is simply to write out the multiplication table of $H$:

$$\begin{array}{ l | c c c r }
~ & 1 & x & y & xy \\
\hline
1 & 1 & x & y & xy\\
x & x & 1 & xy & y\\
y & y & xy & 1 & x\\
xy & xy & y & x & 1\\
\end{array}$$

which shows that multiplication within $H$ is totally defined using the four elements listed. Hence the criteria for a subgroup (closure, identity and inverse) are satisfied, and $H$ has order 4.

I'd like to know if the proof is acceptable and whether there are other approaches.

Edit:
Sorry for the missing justification, it should have gone as follows(in the sequence$xxy,yx,yxy,xy,xyx,xyxy$):
$$xxy=(xx)y=y$$
$$yxxy=y(xx)y=y1y=1 $$
hence
$$yx=(xy)^{-1} $$
and we know that $o(xy)=2$, so
$$yx=xy$$
Also, since
$$yxyx=xyxy=1, yxy=x^{-1}=x $$
(for o(x)=2)
Likewise$$xyx=y^{-1}=y$$
and finally
$$xyxy=(xy)(xy)=1$$

Best Answer

Here's one approach:

$$\begin{align} xy&=x1y\\ &=x((xy)(xy))y\\ &=(xx)(yx)(yy)\\ &=1yx1\\ &=yx, \end{align}$$

so $x$ and $y$ commute.
So, any word in $x$ and $y$ can be written in the form $x^ry^s$, $r=0$ or $1$, $s=0$ or $1$.
So the group generated by $x$ and $y$ has only the four elements $1,x,y,xy$.