Prove that $H(\mathbb{R})/\sim$ is a compact manifold I tried to solve the following question which is the past exam question of graduated school.
Question:Let $H(A)$ be 
$$ H(A)=\left\{ \left( \begin{array}{ccc}
1 & x & z \\ 0 & 1 & y \\ 0 & 0 & 1 \end{array}\right):x,y,z\in A\right\} $$
where $A$ is $\mathbb{R}$ or $\mathbb{Z}$. When there exists $A\in H(\mathbb{Z})$ such that $X=AY$, we define $X\sim Y$ ($X,Y\in H(\mathbb{R})$). Then prove $H(\mathbb{R})~/\sim$ is a compact manifold.
$H(\mathbb{R})$ is identified $\mathbb{R}^3$. By easy calculation, $(x,y,z)\sim (x',y',z')\in \mathbb{R}^3$ if and only if there are integers $p,q,r$ such that $x'=x+p, y'=y+p, z=py+q+r$. The first entry is $\mathbb{R}~/\mathbb{Z}$, so I think $H(\mathbb{R})$ is homeomorphic to $S^1\times K$ where $K$ is a compact manifold. But what is $K$? Of course $K$ is a torus $T^2$ if $p=0$. "$py$" in the third entry bother me. Is there someone who give me advice?
 A: Let's denote the typical matrix in $H(\mathbb{R})$
$$\begin{pmatrix}
1 & x & z \\ 0 & 1 & y \\ 0 & 0 & 1 \end{pmatrix}$$
by $M(x,y,z)$.
Observe that 


*

*acting by $M(\pm1,0,0)$ successively (this is just a row operation) on $M(x,y,z)$, we get $M(x,y,z) \sim M(x',y,z')$, where $x \in[0,1]$.

*Similarly using the action by $M(0,\pm1,0)$ we get $M(x',y,z') \sim M(x',y',z')$ , where $y' \in [0,1]$ 

*Finally, acting by $M(0,0,\pm)$, we obtain $M(x',y',z') \sim M(x',y',z'')$, where $z'' \in [0,1]$


So, the continuous map $H([0,1]) \hookrightarrow H(\mathbb{R}) \rightarrow H(\mathbb{R}) \big/ \sim$, is surjective. Hence $H(\mathbb{R}) \big/ \sim$ is compact.

Note that this shows only that the given space is compact (it doesn't show it is a manifold). Proving the latter is not difficult. As $H(\mathbb{Z})$ is discrete, we need only to prove:


*

*The the action is free, indeed $ \ AX = X \implies A = I$

*The action is properly discontinuous. 


Clearly, $M(n,m,l) \cdot M(x,y,z) = M(x+n,z+ny+l+m,y+l)$. Now by taking a small enough neighborhood about $(a,b,c)$, say $$U = (a-1/4,a+1/4) \times (b-1/4,b+1/4) \times (c-1/4,c+1/4) $$
we see easily $H(\mathbb{Z})\cdot U \cap U = \emptyset$. Easily one can show that if $X,Y \in H(\mathbb{R})$ are not in the same orbit, then we can find neighborhoods $U$ and $V$ of $X$ and $Y$ respectively, such that $H(\mathbb{Z})\cdot U \cap V = \emptyset$.
