Compactness, connectedness of matrix Lie groups

I'm studying the matrix Lie groups like $GL(n,\mathbb{R}),SL(n,\mathbb{R}),O(n),SO(n),U(n),SU(n)$.

1) compactness

For example, to show the compactness of $O(n)$ one should show that it is i) closed and ii) bounded in $M(n, \mathbb{R})$.

And every proof I can find is exactly the same as this one, which argues that since $O(n)$ is the solution set of $A^TA=I$, that is, $O(n)$ is the inverse image of one point $I$ by the map $A\mapsto A^TA$ which is continuous, so it is closed. and since the rows of $O(n)$ form a orthonormal basis, every element is bounded by $1$.

But I don't understand why the map $A\mapsto A^TA$ is continuous and the row of $O(n)$ form a orthonormal basis.

Anyway from this argument, $O(n),SO(n),U(n),SU(n)$ are all compact, and $GL(n,\mathbb{R}),SL(n,\mathbb{R})$ are not. $SL(n,\mathbb{R})$ is closed by the map $A\mapsto\det A$ but is not bounded, and $GL(n,\mathbb{R})$ is open by the same map.

2) connectedness

by the map $A\mapsto\det A$, $GL(n,\mathbb{R})$ is disconnected and $SL(n,\mathbb{R})$ is connected. and $O(n),SO(n),U(n),SU(n)$ are all connected by the maps $A\mapsto A^TA$ and $A\mapsto A^*A$ provided these maps are continuous.

so the questions are, is my argument correct? and why are the maps $A\mapsto A^TA$ and $A\mapsto A^*A$ continuous? and why do the rows of $O(n)$ form a orthonormal basis(not a orthogonal basis)? and do the rows of $U(n)$ form a orthonormal basis like $O(n)$?

1) The map is continuous beacuse it is polynomial in each entry. For instance, when $n=2$ this is the map$$\begin{pmatrix}a&b\\c&d\end{pmatrix}\mapsto\begin{pmatrix}a^2+c^2&ab+cd\\ab+cd&b^2+dd^2\end{pmatrix}.$$
The rows of $O(n)$ form an orthornormal basis because, given a square matrix $A$, asserting that $A\in O(n)$ (that is, asserting that $A^TA=\operatorname{Id}$) is equivalent to: a) each row has norm $1$; b) any two distinct rows or orthogonal. These two conditions hold together if and only if the rows form an orthonormal basis.
2) Saying that “by the map $A\mapsto\det A$ [...] $SL(n,\mathbb{R})$ is connected” makes no sense. Yes, since $\det\bigl(GL(n,\mathbb{R})\bigr)=\mathbb{R}\setminus\{0\}$ and since this is a disconnected set, it follows that $GL(n,\mathbb{R})$ is disconnected. But the image of $GL(n,\mathbb{R})$ by the map $\det^2$ is connected and you don't deduce from that the $GL(n,\mathbb{R})$ is connected, right? So, your argument is wrong.
• I don't understand 2). you say $\det(GL(n,\mathbb{R}))=\mathbb{R}-{0}$ is disconnected hence $GL(n,\mathbb{R})$ is disconnected and $\det^2(GL(n,\mathbb{R}))=\mathbb{R}^+$ is connected but it doesn't imply $GL(n,\mathbb{R})$ is connected. why is that? Jun 7 '17 at 8:40
• Take any non-empty set $S$, connected or not, and consider the map $f\colon S\longrightarrow\mathbb R$ defined by $f(x)=0$. It is a continuous map and its image is $\{0\}$, which is connected. Therefore, the fact that the image is connected does not imply that the set itself is. Jun 7 '17 at 8:50
• then what conditions do I need? since I saw a lot of argument using the fact the image of $\det$ is disconnected to show that $GL(n,\mathbb{R})$ is disconnected. Jun 7 '17 at 9:02
• since continuous map preserves open sets, the preimages of the sets $\det>0$ and $\det<0$ are open in $GL(n,\mathbb{R})$ and their intersection is empty, and moreover their union is $GL(n,\mathbb{R})$, so $GL(n,\mathbb{R})$ is disconnected. is this right? if it is, I guess this argument is not applicable for the rest of matrix groups. Jun 7 '17 at 9:10