The Spectral Decomposition: Let $A$ be a symmetric matrix with distinct eigenvalues $\lambda_1, \ldots, \lambda_k$. Let $V_j=\operatorname{ker}\left(A-\lambda_j \mathrm{I}\right)$ denote the eigenspace corresponding to $\lambda_j$, and let $P_j$ be the orthogonal projection matrix onto $V_j$, as defined in Exercise 4.4.9. (i) Prove that the spectral factorization (8.35) can be rewritten as
$$
A=\lambda_1 P_1+\lambda_2 P_2+\cdots+\lambda_k P_k \text {. }
$$
expressing $A$ as a linear combination of projection matrices. (ii) Write out the spectral decomposition (8.37) for the matrioes in Exercise 8.5.13. (iii) Show that
$$
\mathrm{I}=P_1+P_2+\cdots+P_k, \quad \text { while } \quad P_i^2=P_i, \quad P_i P_j=0 \text { for } i \neq j .
$$
(iv) Show that if $p(t)$ is any polynomial, then
$$
p(A)=p\left(\lambda_1\right) P_1+p\left(\lambda_2\right) P_2+\cdots+p\left(\lambda_k\right) P_k .
$$