How many connected components for the intersection $S \cap GL_n(\mathbb R)$ where $S \subset M_n(\mathbb R)$ is a linear subspace?

Let $S \subset M_n(\mathbb R^n)$ be a linear subspace. Is there a way to determine how many connected components there are for $S \cap GL_n(\mathbb R)$? Let us assume the intersection is nonempty. $GL_n(\mathbb R)$ has two connected components. Does this intersection have two connected components or possibly more?

• Maybe with homology?..
– user403337
Jul 21, 2018 at 6:13
• Not really sure (that's why the question mark). Isn't the zeroth homology group the one whose rank is the number of connected components.
– user403337
Jul 21, 2018 at 6:35
• May be $2^n$ is the maximum? Consider the space $D$ of diagonal matrices. In any path component of $D\cap GL_n$ no diagonal entry can go to zero, so in a path component the signs of the $n$ entries are fixed. Jul 30, 2018 at 21:33

It may have more. Consider $S\subseteq M_2(\newcommand{\RR}{\mathbb{R}}\RR)=\newcommand{\set}[1]{\left\{{#1}\right\}}\set{\newcommand{\bmat}{\begin{pmatrix}}\newcommand{\emat}{\end{pmatrix}}\bmat a & b\\c&d\emat : a,b,c,d\in\RR}$ defined by the equations $a=d$, $b=c$. This gives a two dimensional subspace. $\det$ restricted to this subspace has the form $a^2-b^2$, so the intersection of the complement of $GL_2(\RR)$ with $S$ is two intersecting lines ($a=b$ and $a=-b$), which divides the plane into four pieces. Hence $S\cap GL_2(\RR)$ has four connected components in this case.