Let $H$ be a Hilbert space over the field $\mathbb{K}$ (e.g. $\mathbb{C}$). Suppose that $H$ has an orthonormal basis consisting of the eigenfunctions of a linear operator $A$ acting on $H$. Denote the ONB by $\{e_j\}_j$ and let $\{l_j\}_j$ be the eigenvalues $Ae_j = l_je_j$. We know that every $v\in H$ can be represented as $v=\sum_{j}\left<v,e_j\right>e_j$, but is it true that $Av=\sum_{j}l_j\left<v,e_j\right>e_j$? If not, what is the least amount of extra assumptions we would have to impose for $A$ for $Av=\sum_{j}l_j\left<v,e_j\right>e_j$ to hold? One lower bound of assumptions is given by the diagonalization theorem which asserts that the equality
$$Av=\sum_{j}l_j\left<v,e_j\right>e_j$$
holds when $A$ is a compact self-adjoint operator.
Assume $A$ is symmetric. Note that the eigenvalues are real, because $A$ is symmetric. $(e_j)$ is an orthonormal basis of $H$, so $$Av = \sum_j\langle Av,e_j \rangle e_j= \sum_j\langle v,Ae_j \rangle e_j= \sum_j\langle v,l_j e_j \rangle e_j= \sum_j l_j\langle v,e_j \rangle e_j$$