Let $\text{GL}_n^+$ be the group of real invertible $n \times n$ matrices with positive determinant. Set $S=\text{GL}_n^+ \cup \{A \, | \, \text{rank} (A) = n-1 \}$.
Does $S$ form a a submanifold with boundary of $M_n$? ($M_n$ is the space of all square real matrices).
I am not really sure. I know that $S \subseteq \{A \in M_n \, | \, \det A \ge 0 \}$, and that every point of $S$ is a regular point of the determinant function $\det:M_n \to \mathbb{R}$. (The derivative of the determinant at a point $A$, which is the cofactor matrix of $A$, does not vanish when the rank is $n-1$).
However, I am not sure this gives us what we want, since the subset $\{A \in M_n \, | \, \det A \ge 0 \}$ containing points outside of $S$, which are critical points of the determinant function. (when the rank is smaller than $n-1$).
In particular, we can't use directly proposition 5.47 in Lee's book on smooth manifolds (second edition), which says $f^{-1}([b,\infty))$ is a submanifold with boundary (in fact a regular domain) when $b$ is a regular value of $f$.
Specifically, for $n=2$, we have $S=\text{GL}_2^+ \cup \{A \, | \, \text{rank} (A) = 1 \}=M_2 \setminus (\text{GL}_2^- \cup \{0\})$. What can be said in this case?
After some more thought, I think that the answer is positive:
Indeed, set $U=\{A \in M_n \, | \, \text{rank} (A) \ge n-1 \}$. $U$ is an open submanifold of $M_n$. The determinant function $\det:U \to \mathbb{R}$ has only regular points (in $U$). In particular $0$, is a regular value of it.
In particular, by proposition 5.47 in Lee's book on smooth manifolds (second edition), $$U \cap \det \ge 0=\text{GL}_n^+ \cup \{A \in M_n \, | \, \text{rank} (A) = n-1 \}=S$$
is a regular domain in $U$.