Solution (source code)

= Solution

By the <spectral theorem for real symmetric matrices>, choose the normalized <eigenvectors> to form an \b[<orthonormal basis>]. With $P_n=\mathbf e_n\mathbf e_n^{\mathsf T}$, orthonormality gives $P_nP_m=\delta_{nm}P_n$ and $\sum_nP_n=I$. For every vector $\mathbf x$, expand $\mathbf x=\sum_n(\mathbf e_n^{\mathsf T}\mathbf x)\mathbf e_n$ and apply $A$:
$$
A\mathbf x=\sum_n\lambda_n\mathbf e_n(\mathbf e_n^{\mathsf T}\mathbf x).
$$
Since this equality holds for every $\mathbf x$, the <spectral decomposition> is
$$
\boxed{A=\sum_{n=1}^N\lambda_n\mathbf e_n\mathbf e_n^{\mathsf T}.}
$$
Each $P_n$ is the rank-one <orthogonal projection> onto its <eigenvector> direction. In a degenerate <eigenspace>, normalized <eigenvectors> must be chosen mutually orthogonal; normalization alone does not guarantee this resolution of the identity.