Topology of "degenerate spectrum submanifold" in the space of hermitian matrices Consider the space $H_n$ of hermitian matrices acting on $\mathbb C^n$. It contains a subset $LC_n$ of matrices with degenerate spectrum. I want to know as much as possible about topology and geometry of this set and its complement. In particular is $LC_n$ a submanifold? I suspect that it could, and its codimension is 3.  Can we calculate the cohomology ring and some homotopy groups of $LC_n$ and $H_n \setminus LC_n$?

*

*$H_n \setminus LC_n$ is an open subset of $H_n$, hence submanifold. Moreover it is dense and connected. All these properties are easily seen by considering decomposition $T=U^{\dagger}DU$ with $D$ - diagonal and $U$ unitary.

*Let $\mathcal E_n$ be the space of increasing $n$-tuples of real numbers and let $\mathcal F_n$ be the complete flag variety, $\mathcal F_n = \frac{U(n)}{U(1)^n}$. Then $H_n \setminus LC_n$ is diffeomorphic to the cartesian product $\mathcal E_n \times \mathcal F_n$. Once again, this is is easy to see using the $U^{\dagger}DU$ decomposition. Elements of $\mathcal E_n$ are the eigenvalues, while elements of $\mathcal F_n$ are the eigenspaces.

*Since $\mathcal E_n \cong \mathbb R^n$, we see that $H^{\bullet}(H_n \setminus LC_n) \cong H^{\bullet} (\mathcal F_n)$. This cohomology group is computed on Wikipedia in the article on generalized flag varieties. I think this description of the topology of $H_n \setminus LC_n$ is pretty complete and satisfying. However I am also interested in $LC_n$ itself.

*Let $\chi_T$ be the characteristic polynomial of $T$. Operator $T$ is in $LC_n$ if and only if $\chi_T$ has a double zero. This is equivalent to vanishing of the discriminant $\Delta$ of $\chi_T$, which is easily seen to be a polynomial in the matrix elements of $T$. Thus $LC_n$ is an algebraic variety in $H_n \cong \mathbb R^{n^2}$.

*For any $n$ there exist points of $LC_n$ on which the first derivative of $\Delta$ vanishes. Thus it's impossible to conclude that $LC_n$ is a submanifold using implicit function theorem.

*My conjecture about codimension $3$ is based on the analysis of oribts of $U(n)$ acting on $H_n$. Namely we need to tune one real number parametrizing $T$ to make it degenerate, but then dimension of the stabilizer of $T$ in $U(n)$ (acting by conjugation) becomes larger at lest by $2$. More precisely, if $T$ has $k$ distinct eigenvalues with dimensions of eigenspaces $g_1,...,g_k$, then $\mathrm{Stab}(T) \cong U(g_1) \times ... \times U(g_k)$.

*$0$ is in $LC_n$ and $\lambda T \in LC_n$ whenever $T \in LC_n$ and $\lambda \in \mathbb R$. In particular $LC_n$ is contractible to a point. Clearly the "correct" way of studying the geometry of $LC_n$ would be to consider it as a projective variety in $\mathbb P \mathbb R^{n^2-1}$. In fact $\Delta$ is a homogeneous polynomial of degree $n(n-1)$.

 A: Question: "Consider the space $H^n$ of hermitian matrices acting on $C^n$. It contains a subset $LC_n$ of matrices with degenerate spectrum. I want to know as much as possible about topology and geometry of this set and its complement. In particular is $LC_n$ a submanifold?"
Comment: If $X:=\mathbb{P}^d_k$ is projective $d$-space over a field and if $X$ parametrize homogeneous polynomials in $x_0,x_1$ over $k$ of degree $d$, it follows the classical discriminant hypersurface $D_d(1)$ parametrizing homogeneous degree $d$ polynomials with "repeated roots" is a singular hypersurface $D_d(1):=Z(f)\subseteq X$. If we write a general homogeneous polynomial of degree $d$ as follows:
$$g:=a_0x_0^d+a_1x_0^{d-1}x_1 + \cdots + a_dx_1^d,$$
it follows $f$ is a homogeneous and irreducible polynomial in the coefficients $a_i$ of $g$. There are "higher discriminants" $D_d(i)$ for $i \geq 1$ and a stratification of closed subvarieties
$$  D_d(i+1) \subseteq D_d(i) \subseteq \cdots \subseteq D_d(1)$$
and in some cases it follows $D_d(i+1)=D_d(i)_{sing}$ is the subvariety of $D_d(i)$ of singular points. Hence $D_d(1)$ is singular in general. Over a field there is a construction using the symmetric product: There is a canonical map of schemes
$$\pi: \mathbb{P}^1_k \times \cdots \times \mathbb{P}^1_k \rightarrow \mathbb{P}^d_k$$
identifying $\mathbb{P}^d_k \cong (\mathbb{P}^1_k)^{\times d}/S_d$ where $S_d$ is the symmetric group on $d$ letters. The image of the "big diagonal" $\Delta$ is the discriminant $D_d(1)$. This construction gives a geometric construction of the discriminant and various types of stratifications in the algebraic setting. In the affine situation you get a map of algebraic varieties
$$\pi: X:=(\mathbb{A}^1_k)^{\times n} \rightarrow \mathbb{A}^n_k$$
defined by
$$\pi(a_1,..,a_n):=(s_1(a_i),..,s_n(a_i))$$
where $s_i$ is the $i$'th symmetric polynomial in the "variables" $a_i$.
If $a_i \neq a_j\in k$ for all $i$ and $y:=\pi(a_i)$ it follows the fiber $\pi^{-1}(y)$ has $n!$ points $\sigma(a_i), \sigma \in S_n$ with $a_i\in k$.
Hence outside of the big diagonal $\Delta \subseteq X$ it follows $\pi$ has "the same number of elements in the fiber". If $x\in \Delta$ and $y:=\pi(x)$ it follows the number of points in $\pi^{-1}(y)$ drops. Here you must take care about the notion "point". If $k$ is not algebraically closed it follows closed points have a residue field that is a finite extension of $k$. Since the map $\pi$ is finite it follows the image of the big diagonal is a closed subvariety  of $\mathbb{A}^n_k$ and it equals the discriminant.
Example 1: Let $S:=(\mathbb{A}^1_k)^{\times 2}$ and consider the map
$$\pi: S\rightarrow \mathbb{A}^2_{s_1,s_2}$$
defined by the map
$$\phi: k[s_1,s_2]\rightarrow k[x,y]$$
with $\phi(s_1):=x+y, \phi(s_2):=xy$. The discriminant $D(1)$ is defined by $D(1):=V(s_1^2-4s_2)\subseteq \mathbb{A}^2_{s_1,s_2}$, and the "inverse image"
is given as follows:
$$\pi^{-1}(D(1)):=V(s_1(x,y)^2-4s_2(x,y))$$
and
$$s_1(x,y)^2-4s_2(x,y)=(x-y)^2,$$
Hence $\Delta:=\pi^{-1}(D(1)):=Spec(k[x,y]/((x-y)^2)$. Hence in this case when you calculate the inverse image $\pi^{-1}(D(1))$ you get a copy of the affine line $\mathbb{A}^1_k$ with a non-reduced structure. Hence you must "worry" about the algebraic structure. The $k$-rational points $\Delta(k)$ is the following set: a map $\phi$ of $k$-algebras
$$\phi: k[x,y]/(x-y)^2 \rightarrow k$$
must fulfill $\phi(x):=a, \phi(y):=b$ and
$$(a-b)^2=a^2-2ab+b^2=0.$$ Since $k$ is a field, this is the set of $(a,b)$ with $a=b$. Hence $\Delta$ is a scheme with the same $k$-rational points as the big diagonal. There is an obvious $S_2$-action on $R:=k[x,y]/(x-y)^2$ which is trivial on the $k$-rational points of $R$. In this case there is an isomorphism
$$R^{S_2} \cong k[s_1,s_2]/(s_1^2-4s_2).$$
Hence the discriminant of degree 2 polynomials is a quotient of a non-reduced scheme $V((x-y)^2)$ by $S_2$. In general you may realize $D_d(1)$ as a quotient of a non-reduced scheme by $S_d$. Hence for the classical discriminant we observe that we need non-reduced schemes in order to realize it as a quotient.
Example 2: In algebra/geometry you are interested a canonical scheme structure on the "discriminant locus" and for this reason you must give a definition that is "intrinsic". When working with real manifolds you end up with singular spaces.
Let $E:=k\{e_1,..,e_n\}$ where $k$ is the field of real numbers and let $K$ be the field of complex numbers. Let $E^*:=k\{y_1,..,y_n\}$ where $y_i:=e_i^*$ is the dual basis. It follows
$$ Sym_k(End_k(E)^*)\cong A:=k[x_{ij}]$$
and $A$ is naturally the polynomial functions on the vector space $End_k(E)$.
We may realize $GL(E):=Spec(B)$ where $B:=A[t]/(tdet(T)-1)$ and
$$ GL(E):=Z(H(t)) \subseteq M(n,k):=Spec(A)$$
is a smooth hypersurface. The complement $D(H(t)):=M(n,k)-GL(E)$ is the "space of singular $n\times n$ matrices" and this complement has several types of
stratifications defined in terms ot the characteristic polynomial $\chi_T(t)$ of a matrix $T$.
You must do something similar for Hermitian matrices, that is: Instead of the group $GL(E)$ you must let $Hrm \subseteq M(n,K)$ be the set of $n \times n$ Hermitian matrices and consider a stratification on $Hrm$. It seems there is an isomorphism
$$Hrm\cong \mathbb{R}^{n^2} \subseteq M(n,\mathbb{C}),$$
hence the hermitian matrices form an affine real space which is an algebraic variety. When you put conditions on the multiplicity of zeros of the characteristis polynomial $\chi_T(t)$ of a matrix $T\in Hrm$ you should get real algebraic subvarieties of $Hrm$. If $LC_n(1)$ is the set of matrices in $Hrm$ with inseparable characteristic polynomial the following holds: Let $T:=(a_{ij})\in Hrm$ be a Hermitian matrix and let
$$\chi_T(t):=u_0+u_1t+\cdots +u_lt^l \in \mathbb{R}[t]$$
be its characteristic polynomial. It follows $LC_n(1)$ is a hypersurface in $Hrm$ defined as the zero set of a hypersurface $f(u_i)$ where $f(u_i)$ is a polynomial in the coeffiencts $u_i$ of $\chi_T$. The coefficients $u_i:=u_i(a_{ij})$ are polynomials in the real numbers $a_{ij}$ defining $T$. Hence $LC_n(1)$ is the zero set of a polynomial in the "variables" $a_{ij}$, hence $LC_n(1)$ is a real algebraic sub variety of $Hrm$.
Algebraically if $R:=\mathbb{Z}[u_0,..,u_d]$ is the polynomial ring over the ring of integers in the variables $u_i$ it follows the discriminant polynomial
$f(u_i)$ is an irreducible polynomial in $R$. In your case it follows the characteristic polynomial $\chi_T(t):=P(a_{ij},t)$ is a polynomial in the $a_{ij},t$ and substuting in $f(u_i)$ you get a polynomial
$$F(a_{ij}):=f(u_0(a_{ij}),..., u_d(a_{ij}))$$
and it may be $F(a_{ij})$ is an irreducible polynomial in the "variables" $a_{ij}$ in some cases. In general it seems that $LC_n(1):=Z(F(a_{ij})) \subseteq \mathbb{R}^{n^2}$ is a singular algebraic hypersurface that is irreducible in some cases.
Question: "In particular is $LC_n$ a submanifold?"
Answer: It seems to me that $LC_n(1)$ is singular in general, hence it is not a "manifold"/smooth variety. Discriminants appear in algebraic geometry, differential geomeary and complex analysis and they are singular spaces in general.
In your case the discriminant $LC_n(1):=Z(F)$ is a real algebraic variety with a non-empty singular subvariety $LC_n(1)_{sing}$ in general.
The polynomial $F$ defining $LC_n(1)$ gives rise to the Jacobi ideal
$J(F)$ which is the ideal generated by $F$ and all its partial derivatives. If $A:= \mathbb{R}[a_{ij}]/(F)$ is the coordinate ring of $LC_n(1)$ it follows the subvariety of singular points $S:=LC_n(1)_{sing}$ is defined by the ideal $J(F)$. To prove that $S$ is nonempty you must verify that a polynomial with a root of multiplicity $\geq 3$ defines a point in $S$.
The open complement $U:=LC_n(1)-LC_n(1)_{sing}$ has the structure of a real smooth manifold and this manifold may be studied using algebraic and analytic techniques. In general if $M$ is a real algebraic manifold and $E$ is a finite rank algebraic vector bundle on $M$ with an algebraic endomorphism $\phi$, you may construct several types of discriminants $D(\phi)$ of $\phi$ and these discriminants are singular algebraic varieties in general. These types of discriminants are much studied in algebra and geometry:
References: Busé, Laurent; Jouanolou, Jean-Pierre
On the discriminant scheme of homogeneous polynomials. Zbl 1302.13028
Math. Comput. Sci. 8, No. 2, 175-234 (2014).
There is another recent paper (the paper may be found online) which may give references to where it is proved that the classical discriminant of degree d polynomials is singular:
Demazure, Michel, Resultant, discriminant. (Résultant, discriminant.) Enseign. Math. (2) 58, No. 3-4, 333-373 (2012).
http://www-users.math.umn.edu/~rober005/publicat/DualVar.p1.html
I believe there is an algebraic proof of this and you may find interesting references in the above papers and links. On page 6 in the above linked paper you will find a discussion of the classical discriminant that may be interesting. Another reference is the following book:
Gelfand, I. M.; Kapranov, M. M.; Zelevinsky, A. V.
Discriminants, resultants, and multidimensional determinants.
Modern Birkhäuser Classics. Boston, MA: Birkhäuser
It contains a discussion of the classical discriminant and many references.
A: A comment which is too long for a comment.
Consider the set ordered partitions $\Pi(n)$ of $n$ given by tuples $\pi = (\pi_1, \ldots, \pi_k) $ such that $\pi_1 + \ldots + \pi_k = n$. There is also a natural order on $\Pi(n)$ generated by relations $(\pi_1, \pi_2, \ldots, \pi_k) > (\pi_1+ \pi_2, \pi_3, \ldots, \pi_k)$ (and similarly you can merge consecutive indices). We use the notation $|\pi| = k$ to denote the length of the partition.
There is a subspace $H_{\pi} \subset H_n$ given by hermitian matrices with spectrum $\lambda_1 < \ldots < \lambda_k$ such that the eignespace of $\lambda_i$ has dimension $\pi_i$. Note that $H_{(1, \ldots, 1) } \simeq H_n \setminus LC_n$ is the space of non degenerate hermitian matrices and it has been studied by the OP.
Let $\mathcal{F}_{\pi}$ the flag variety of flags with prescribed dimension $(\pi_1, \pi_1+\pi_2, \ldots, \pi_1+\ldots+\pi_k = n)$.
First fact. There is a decomposition
$$ H_{\pi} \simeq \mathbb{R} \times \mathbb{R}_{> 0}^{|\pi|-1} \times \mathcal{F}_{\pi}$$
given (in the other direction) by
$$(\lambda, t_1, \ldots, t_{k-1}, U) \mapsto U^{\dagger} \text{diag}(\lambda, \lambda+t_1, \ldots, \lambda+ t_1+ \ldots + t_{k-1} ) U$$
so that we have a homotopy equivalence $H_{\pi} \simeq \mathcal{F}_{\pi}$. As a consequence, we also have that the dimension $d_{\pi}$ of $H_{\pi}$ is $k+ n^2 - (\pi_1^2+ \ldots + \pi_k^2) $.
Second fact. The cohomology of the spaces $\mathcal{F}_{\pi} \simeq U(n) / U(\pi_1) \times \ldots \times U(\pi_k)$ is well known by the same Wikipedia page.
Third fact. The decomposition $\{H_{\pi}\}_{\pi \in \Pi_n}$ is a smooth stratification of $H_n$, and the closure of the strata $H_{\pi}$ is $\cup_{\pi' \le \pi} H_{\pi'}$. Also, the singular locus of the closure $\bar{H}_{\pi}$ is given by $\cup_{\pi' < \pi} H_{\pi'}$.
Sketch. Suppose $M_k = U^{\dagger}_k D_k U^k$ is a sequence of matrices in $H_{\pi}$ that converges to $M = U^{\dagger} D U$. In particular $D_k \to D$. Equalities in $D_k$ between eigenvalues remains so, and inequalities stay inequality or become equality, which is the description of our boundary. Smoothness is a consequence of the first fact. Singularity at the "remaining factors" can be seen in the following way. If we have a $(3,4,1)$ matrix in a $(3,3,1,1)$ strata, the tangent space has 4 different hyperplanes - of dimension $d_{(3,3,1,1) } = 4+121-20 = 105$ - going out of it (depending on which of the four equal eigenvalues I decide to slightly change). This is the kind of singularity you see when you join two lines at a point.
Conclusion. The space $LC_n$ can be studied via this stratification, which in particular gives that $LC_n = \bar{H}_{(2, 1, \ldots, 1)} \cup \ldots \cup \bar{H}_{(1, \ldots, 1, 2)}$ (the bar stands for closure). Each factor has known cohomology away from the intersections, but they glue in a non trivial way. I am not aware of effective ways to compute the cohomology of the union beside mayer vietoris. Also, since the intersection of different factors has strictly less dimension (for example $\bar{H}_{(2,1,1)} \cap \bar{H}_{(1,2,1) } = \bar{H}_{(3,1)}$), this shows $LC_n$ is singular (beside the case $n=2$, in which we have only one factor).
Final thoughts. Let me say I see a pattern I can't formalize. This is very similar to configuration spaces, where one can think of "degenerate tuples" of real numbers $(x_1, \ldots, x_n)$ if two coordinates are equal. There is an analogous stratification of $\mathbb{R}^n$ where the top strata is the configuration space, and its complement are the "degenerate tuples". Here it's easy to "compute"  the space of degenerate tuples, because it is alexander dual to its complement, the configuration space. This happens because the total space is a sphere, once you "projectivize" everything. The present case is harder because the total space are the hermitian matrices and we don't have this machinery available on the nose. I still think there could be a pairing $(H_n \setminus LC_n) \times LC_n ^{\vee}  \to H_n$.  The "configuration-y" pattern comes from the eigenvalues, so that in dimension 1 is really simple. The problem is that the stratification here is "twisted" by the generalized flag varieties, which change depending on the partition of eigenvalues. I suggest that could be worth to study the fibrations $LC_n \to LC_{n-1}$ in which one "forgets" the action of the matrix on the last component. The fiber has various components that depends on the stratification. For example restricting to $H_{(3,2) } \to H_{(3,1)}$ has fiber $U(2)/U(1)$.
Also, let me remark that I found some information on "degenerate" flag varieties (see here and here) that - if I understood well - correspond to the closure of our strata.
