Let $E = \{A \in M_n(\mathbb R): \text{rank}(A) = k\}$. I would like to determine the connected components of $E$. There is a similar question asked here, but the underlying field is $\mathbb C$.
For $A \in E$, let $A = U\Sigma V^T$ be the singular value decomposition. If we don't require $U, V$ to be orthogonal, then \begin{align*} A = M \begin{pmatrix} I_{k \times k} & 0 \\ 0 & 0 \end{pmatrix} N =: M\hat{I}N, \end{align*} where $M,N \in GL_n(\mathbb R)$. But $GL_n(\mathbb R)$ has two connected components defined by the sign of determinants, does this mean there are four connected components in $E$ by enumerating all the possibilities of sign of determinants of $M,N$?
If the dimension $n$ is odd, then I think there should be two connected components. Let $\phi: GL_n(\mathbb R) \times GL_n(\mathbb R) \to M_n(\mathbb R)$ be given by $S \times T \mapsto S \hat{I} T$. We can view $E$ as the continuous image of $\phi$. Since $A = M \hat{I} N = (-M) \hat{I} (-N)$ and $\det(-M) = (-1)^{n}\det(M) = -\det(M)$, then the four cases mentioned above should correspond to two connected images.
Let us write $E_k=\{A\in \mathcal M_n(\mathbb R) : \textrm{rank}(A)=k \}$ and and $I_k$ the $k\times k$ identity matrix.