The question is as follows: $\DeclareMathOperator{\rank}{rank}$
Is the set $S_r = \{A \in \Bbb R^{n \times n}: \rank(A) \leq r\}$ closed in $\Bbb R^{n \times n}$ in the Euclidean topology?
I have a feeling that this is true, but I got stuck looking for a convincing argument. Certainly this is true for $r = n-1$. Perhaps it can be shown that $S_{r-1}$ is a closed subset of $S_r$?
No neat tricks are coming to mind, but I would think that there must be one. This seems like the kind of thing that has a canonical answer, so links are welcome.