Eigenvalues of the linear system $XA +A^T X = 0$ I am following a proof of the next theorem, rephrased from Theorem 8.5 of the book "Introduction to the theory of differential inclusions" by Georgi V. Smirnov.

Let $\{\lambda_1,\dots,\lambda_n\}$ be eigenvalues of a constant matrix $A \in \mathbb{R}^{n\times n}$ and $X \in \mathbb{R}^{n\times n}$ be a variable in the set of symmetric matrices. Consider a linear system $XA + A^TX = 0$. It is equivalent to $Bx = 0$ where $x = (X_{11},X_{12},X_{22},\dots,X_{1n},\dots,X_{nn}) \in \mathbb{R}^{n(n+1)/2}$. Define
  \begin{align}
C &= \{\text{all eigenvalues of $B$}\}, \\
D &= \{m_1\lambda_1 + \cdots + m_n\lambda_n \mid m_i \in \{0,1,2\},\,m_1 + \cdots + m_n = 2\}.
\end{align}
  Then, C = D.

I understood the part $D \subset C$ but I am stuck in the part $C\subset D$. If $|D| = n(n+1)/2$, then it is obvious but in the case $|D| < n(n+1)/2$ the book says only "In the general case the result can be obtained taking the limit". Would you give me any hint or reference how to use the limit?
Edit
I hope this is a correct proof of the part $C \subset D$ that uses the limit.

Since $D\subset C$ and $|C|$ is at most $n(n+1)/2$, if $|D| = n(n+1)/2$, then $D = C$. Suppose $|D| < n(n+1)/2$. Consider a linear system $X(A + dA) + (A + dA)^TX = 0$ where $dA \in \mathbb{R}^{n\times n}$. It is equivalent to $(B + dB)x = 0$ and $\|dA\| \to 0 \Leftrightarrow \|dB\| \to 0$. Let $\{\lambda_1'(dA),\dots,\lambda_n'(dA)\}$ and $C = \{\rho_1,\dots,\rho_{n(n+1)/2}\}$ be eigenvalues of $A + dA$ and $B$, respectively. Define
  \begin{align}
C' &= \{\rho_1'(dB),\dots,\rho_{n(n+1)/2}'(dB)\} = \{\text{all eigenvalues of $B + dB$}\}, \\
D' &= \{m_1\lambda_1'(dA) + \cdots + m_n\lambda_n'(dA) \mid m_i \in \{0,1,2\},\,m_1 + \cdots + m_n = 2\}.
\end{align}
  Solutions of the characteristic equations $\det(A + dA - \lambda I) = 0$ and $\det(B + dB - \rho I) = 0$ are continuous functions with respect to parameters. So, for all $\varepsilon > 0$, there exists $\delta > 0$ such that $\max_i |\lambda_i'(dA) - \lambda_i| < \varepsilon$ and $\max_i|\rho_i'(dB) - \rho_i| < \varepsilon$ if $\|dA\| < \delta$ and $\|dB\|< \delta$; we assume that eigenvalues are properly listed. Also, there exists $\|dA\| < \delta$ such that all eigenvalues of $A + dA$ are distinct. Furthermore, there exists $\|dA\| < \delta$ satisfying $|D'| = n(n+1)/2$. Let $\rho \in C$. There exists $\rho' = m_1\lambda_1(dA) + \cdots + m_n\lambda_n(dA) \in C'$ such that
  \begin{equation}
|\rho - (m_1\lambda_1 + \cdots + m_n\lambda_n)| \le |\rho - \rho'| + |\rho' - (m_1\lambda_1 + \cdots + m_n\lambda_n)| < (1 + 2n)\varepsilon.
\end{equation}
  Since $\varepsilon$ is arbitrary, $\rho = m_1\lambda_1 + \cdots + m_n\lambda_n \in D$.

 A: Let $A$ be a $n\times n$ matrix. Define $M^A$ the module over $\mathbb{R}[x]$ as $\mathbb{R}^n$ equipped with $x\cdot v = A v$ for any $v\in\mathbb{R}^n$. 
By the structure of finitely generated module over principal ideal domain, we have 
$$
M^A = \oplus \mathbb{R}[x]/(f_i^{r_{i s_i}}) \ \ (*)
$$
with some irreducible polynomials $f_i$ and integers $r_{i s_i}\geq 1$ that satisfy $\sum_{i=1}^r\sum_{j=1}^{s_i} r_{i j}=n$. 
Now, if $\lambda$ is an eigenvalue of $B$, then there is a nonzero matrix $X$ such that 
$$
X(A-\lambda I) + A^T X = 0 \ \ (1)
$$
where $I$ is $n\times n$ identity matrix. 
The solution set for the equation $(1)$ can be described as a group of module homomorphisms
$$
\mathrm{Hom}_{\mathbb{R}[x]} (M^{\lambda I - A}, M^{A^T}). \  \ (2)
$$
It is well-known that $A$ and $A^T$ is similar. Thus, $(2)$ is isomorphic to 
$$
\mathrm{Hom}_{\mathbb{R}[x]} (M^{\lambda I - A}, M^{A }). \  \ (3)
$$
From the structure $(*)$, the group of homomorphism   $(3)$ has a nontrivial element if and only if
$$
\lambda - \lambda_i = \lambda_j
$$
where $\lambda_i, \lambda_j$ are eigenvalues of $A$. Therefore, we have $C=D$. 
