How do you prove that the invariant subspaces of a diagonal matrix are direct sums of eigenspaces? Given $A$ an $n \times n$ diagonal matrix with distinct non-zero values on the diagonal ($A_{ii} = A_{jj} \rightarrow i = j$)
Let $S$ be the set of eigenspaces of $A$.
How do I show that for any subspace $U$ invariant under $A$ there exist some $T \subset S$ such that
$$
U =  \sum_{V \in T} V
$$
(Where by sum I mean the direct sum, not sure which notation makes the most sense here really.)
I think I understand a few ways I could conceptualize the problem, but when I try to write it down I have a hard time keeping it from getting out of control, and it seems like maybe I am overcomplicating it.
One idea I have tried is that for a subspace $U$ with dimension $d$ I can take a basis $f$ for that space. I am not sure how to "state it" but it seems to me that the subspace $U$ is invariant if and only if the basis $f$ can be represented with no more than $d$ of the eigenvectors. I thought I would take a vector $x \in U$ rewrite it with $f$ and again with the $\textbf 1$ unit eigenvectors. Then show that $Ax \in U$ if it can be represented by $f$... I am not quite sure how to "close the loop" on this idea though.
My second idea was to show that for an invariant subspace $U$ with dimension $d$ and any point $x \in U$ then for any positive integer $k$ we have $A^kx \in U$. Then I thought I could show that if there are more than $d$ of the unit eigenvectors in the representation of $x$ then the points $Ax$, $A^2x$ ... $A^{d + 1}x$ would form $d + 1$ linearly independent points in $U$ contradicting the original definition of $d$ as the dimension of $U$. Yet I ended up getting totally lost trying to show that the points are linearly independent.
Is there a simpler approach that I am missing? Is there any easy way to complete one of these that I missed?
 A: Let $e_1,e_2,\dots,e_n$ denote the (column) vectors in the standard basis. You certainly know that these are basic eigenvectors for a diagonal matrix.
Let $d_1,\dots,d_n$ denote the diagonal entries in the matrix, so you have
$$
A(a_1e_1+\dots+a_ne_n)=a_1d_1e_1+\dots+a_nd_ne_n
$$
Suppose $U$ is an invariant subspace of dimension less than $n$ (otherwise the statement is obvious). Then there exists a vector in the standard basis that doesn't belong to $U$. Without loss of generality we can assume it is $e_n$; let $W$ be the subspace generated by $\{e_1,\dots,e_{n-1}\}$.
If $U=W$, then we're done. Otherwise $U\cap W$ has dimension less than $U$, so we can assume by induction that $U\cap W=\langle e_1,\dots,e_k\rangle$ (again without loss of generality).
By Grassmann's formula,
$$n=\dim(U+W)=\dim U+\dim W-\dim(U\cap W)=\dim U+n-1-\dim(U\cap W)$$
and so there is a single vector $v$ such that $U=\langle e_1,\dots,e_k,v\rangle$.  Suppose $v=a_1e_1+\dots+a_ne_n$; without loss of generality, we can assume that $a_{k+1}\ne0$. Then we have
$$
Av=\sum_{i=1}^n a_id_ie_i=b_1e_1+\dots+b_ke_k+bv
$$
Comparing coefficients,
$$
\begin{cases}
a_id_i=b_i+ba_i &i=1,2,\dots,k \\[6px]
a_id_i=ba_i & i=k+1,\dots, n
\end{cases}
$$
Since $a_{k+1}\ne0$, we obtain that $b=d_{k+1}$. Then, for $i>k+1$,
$$
a_id_i=a_id_{k+1}
$$
and this is where the assumption that the diagonal entries are pairwise distinct is needed, because it forces $a_i=0$ for $i=k+2,\dots,n$. This implies that $e_{k+1}\in U$ and so $U=\langle e_1,\dots,e_k,e_{k+1}\rangle$.
A: I will prove more generally: if $\phi$ is a diagonalisable operator on a finite dimensional vector space$~V$ with simple eigenvalues, then any $\phi$-invariant subspace is a sum of some subset of the ($1$-dimensional) eigenspaces. (And of course any such a sum is $\phi$-invariant.)
Let $n=\dim V$ and let $\lambda_1,\ldots,\lambda_n$ be the distinct eigenvalues; let a $\phi$-invariant subspace $W$ be given. Let $S$ be the set of indices$~i$ such that $W$ contains the eigenspace $V_i$ for $\lambda_i$; I will show that $W=\bigoplus_{i\in S}V_i$. Since $W\supseteq\bigoplus_{i\in S}V_i$ is clear, it suffices to show $W\subseteq\bigoplus_{i\in S}V_i$. I will deduce this from that fact that for every$~i\in\{1,\ldots,n\}$ the projection $\pi_i:V\to V_i$ parallel to $\bigoplus_{j\neq i}V_j$ is a polynomial in$~\phi$: then for every $w\in W$ if we decompose $w=w_1+\cdots+w_n$ with $w_i=\pi_i(w)\in V_i$, the $\phi$-invariance of $W$ implies $w_i\in W$, and for those$~i$ with $w_i\neq0$, the fact that $w_i$ is eigenvector implies that $i\in S$, and one concludes that $w\in\bigoplus_{i\in S}V_i$ as desired.
Writing $\pi_i$ as a polynomial in $\phi$ is a case of Lagrange interpolation: we are looking for a a polynomial $P\in K[X]$ such that $P[\phi]$ acts as the scalar $\delta_{i,j}\in\{0,1\}$ on each eigenspace $V_j$, and since in general such a polynomial acts as the scalar $P[\lambda_j]$ on that eigenspace, we wish to have the evaluations $P[\lambda_j]=\delta_{i,j}$ for $j=1,\ldots,n$. As is well known, the fact that the $\lambda_i$ are distinct makes that this problem has a (unique) solution with $\deg(P)<n$, namely
$$
  P=\frac{\prod_{j\neq i}(X-\lambda_j)}{\prod_{j\neq i}(\lambda_i-\lambda_j)}.
$$
A: Suppose $U$ is an invariant subspace under $A$ then ...
For any scalar $c$ the subspace $U$ is invariant under the matrix $cI$. Therefore $U$ is invariant under $A - cI$
Let $L_i = A - a_{ii}I$. Then:
$$L_ie_i = Ae_i - a_{ii}Ie_i = a_{ii}e_i - a_{ii}e_i = 0$$
$$i \not = j \rightarrow L_je_i = Ae_i - a_{jj}Ie_i = (a_{ii} - a_{jj})e_i \not = 0$$
Let $P_i = \prod_{j \not = i} L_j$. Then by expanding and replacing each application of an operator $L_j$ we end up with:
$$P_ie_i \not = 0 \;\;\;\;\; i \not = j \rightarrow P_je_i = 0$$
Note that since $U$ is invariant under each $L_i$ we have that $U$ is also invariant under each $P_i$
Further note that whenever $P_iv \not = 0$ we have for some $\lambda$:
$$P_iv = \sum_{j=1}^n \alpha_j P_ie_j = \lambda e_i$$
The above argument also reveals that whenever the $i$th component of a vector $v$ is non-zero, $P_i v \not = 0$
Since $U$ is invariant under $P_i$ we have that if $v \in U$ and $P_i v \not = 0$ then $e_i \in U$
Finally let $S$ be the set of $e_i$ that are in $U$
Suppose $|S|$ is less than the dimension of $U$ then ...
Let $f$ be a vector in $U$ linearly independent from the vectors in $S$. The vector $f$ must have a non-zero component for some $e_j \not \in S$ but then $P_j f_1 \not = 0$ and $e_j \in S$. A contradiction.
Therefore we have that $|S|$ is at least the dimension of $U$
But clearly $|S|$ may not exceed the dimension of $U$ therefore $|S|$ exactly equals the dimension of $U$ and $S$ is a set of eigenvectors that span $U$
All together we have that for any subspace $U$ invariant under $A$ there is a basis of $U$ made up of eigenvectors
A: A nearly correct completion of my second approach.
Suppose $U$ is an invariant subspace under $A$ then ...
Let $d$ be the dimension of $U$.
Suppose also that $U$ is not spanned by a set of $d$ eigenvectors then ...
Let $v \in U$ such that $v$ has the maximum number of non-zero coefficients in it's representation relative to the basis $e$.
If the number of non-zero elements of $v$ is not greater than $d$ we get a contradiction, because either:

*

*All vectors in $U$ have a subset of the same non-zero coefficients, and thus $U$ is actually spanned by $d$ eigenvectors.


*There exists another vector in $U$ with at least one non-zero coefficient that corresponds to a zero coefficient in $v$, but then there is a linear combination of these vectors with more non-zero elements than $v$.
Therefore $v$ has at least $d + 1$ non-zero elements.
$X = \{ v, Av, A^2v \; ... \; A^dv \}$ is a set of $d + 1$ vectors in $U$ because $U$ is an invariant space.
The vectors of $X$ are linearly dependent because the dimension of $U$ is $d$.
Let $\alpha$ be the coeifficients of $v$ relative to $e$ the simple unit vectors. So that $v = \sum \alpha_i e_i$.
Then $A^nv = \sum \alpha_i (\lambda_i)^n e_i$.
Form a new $d + 1 \times d + 1$ matrix $M$ with the non-zero coefficients of $A^nv$ forming each column. That is $M_{ij} = \alpha_{k_i} (\lambda_{k_i})^j$ where $k$ indexes the non-zero elements of $v$.
$$
M = \begin{bmatrix}
\alpha_{k_1} & \alpha_{k_1} \lambda_{k_1} & ... & \alpha_{k_1} (\lambda_{k_1})^{d + 1} \\
\alpha_{k_2} & \alpha_{k_2} \lambda_{k_2} & ... & \alpha_{k_2} (\lambda_{k_2})^{d + 1} \\
. & . & & . \\
. & . & & . \\
. & . & & . \\
\alpha_{k_{d + 1}} & \alpha_{k_{d + 1}} \lambda_{k_{d + 1}} & ... & \alpha_{k_{d + 1}} (\lambda_{k_{d + 1}})^{d + 1} \\
\end{bmatrix}
$$
We can see that M is the product of a Vandermonde matrix and a diagonal matrix, and therefore it has rank $d + 1$. But then the columns are linearly independent and the vectors of $X$ are linearly independent, contradicting the earlier contrary conclusion.
Therefore the supposition that $U$ is not spanned by a set of $d$ eigenvectors is incorrect.
All together we have that any subspace $U$ invariant under $A$ is spanned by a set of $d$ eigenvectors.
