Are these subspaces connected or not? This question was asked in a masters entance exam of an institute for which I am preparing and I was unable to solve it .

Which of the following spaces are connected ?


*

*The set of upper triangular matrices as a subspace of $M_{n}(\mathbb{R})$ .

2.The set of invertible diagonal as a subspace of $M_{n}(\mathbb{R})$ .
Although I have studied topology from Wayne Patty but this type of questions were not there and our instructer was very unprofessional . So , I was a bit stumped upon seeing connectedness of matrices and would really appreciate a detailed answer.
 A: HINT: I’m assuming that the topology on $M_n(\Bbb R)$ is the one that makes it homeomorphic to $\Bbb R^{n^2}$.
Since there are $n(n-1)/2$ entries below the diagonal of an $n\times n$ matrix, the first question is like asking whether
$$A=\left\{\langle x_1,\ldots,x_{n^2}\rangle:x_1=\ldots=x_{n(n-1)/2}=0\right\}$$
is connected in $\Bbb R^{n^2}$. That’s rather like looking at the $yz$-plane or the $z$-axis in $\Bbb R^3$, and if you think about it, you should see that $A$ is homeomorphic to $\Bbb R^m$ for an $m$ that you can compute in terms of $n$.
For the second one, try showing that the set of diagonal matrices whose diagonal entries are all positive is both closed and open in the set of invertible diagonal matrices.
A: For the first one, see  Marso's answer in this thread, where it is shown that the first space is path-connected.
For the second one, see Alex's answer in this thread. As Brian pointed out in the comments below, the answer has been written over $\mathbb{C}$, and unfortunately, it does not work over $\mathbb{R}$.
