Solution (source code)

= Solution

Both <subgroups> contain the <identity element>, so $H\cap K$ is nonempty. If $x,y\in H\cap K$, then $xy\in H$ and $xy\in K$, so $xy\in H\cap K$. Similarly $x^{-1}$ belongs to both subgroups and hence to their intersection. <Associativity> is inherited from $G$. Thus
$$
\boxed{H\cap K\leq G.}
$$
This verifies the <group axioms>; finiteness is unnecessary.