A theorem about functions of self-adjoint operators It is very common (see e.g. page 18 of Ballentine's Quantum Mechanics: A Modern Development) for the following development to take place. We couch the discussion in Dirac's bra-ket notation noting that (as I am not really capable of) it is possible to make this precise in the rigged Hilbert space formalism (for operators with continuous spectra etc.).
It is a fact that self-adjoint operator $A$ admits a complete eigenbasis, so that it is a subsequent theorem that we can write $A$ as $$A = \sum a_i |a_i \rangle \langle a_i |.$$ It is then very common to say that this motivates the definition of a function of such an operator, $f(A)$, by $$f(A) = \sum f(a_i)|a_i \rangle \langle a_i |.$$
My question surrounds the definition of the function of an oeprator. My suspicion is that there is a different definition of $f(A)$ from operator theory, and that the definition I have quoted above is equivalent to said definition via some theorem. Is that indeed the case?
 A: There are a number of ways to define functions of operators. A common example is via a power series, e.g.
$$\exp(A) := \sum_{k=0}^\infty \frac{1}{k!} A^k$$
One can show that if the radius of convergence of the series of the original function $f$ is $R$, then the corresponding operator $f(A)$ is well-defined iff the operator norm $\Vert A\Vert_{op} < R$.
The requirement that $A$ be bounded (and that $\Vert A\Vert_{op}$ be within the radius of convergence of the Taylor series) is very limiting.  There are several important alternatives (e.g. the holomorphic functional calculus, the continuous functional calculus, the polynomial functional calculus), but the most important is the Borel functional calculus which works via the spectral theorem. If $A$ is a normal operator, then it can be expressed as
$$A = \int_{\sigma(A)}\lambda \  \ \mathrm dP^A(\lambda) $$
where $\sigma(A)\subseteq \mathbb C$ is the spectrum of $A$ and $P^A$ is its projection-valued measure.  Note that this reduces to the familiar expression
$$A = \sum_{\lambda \in \sigma(A)} \lambda |\lambda \rangle\langle \lambda|$$
if $\sigma(A)$ is purely discrete and its eigenspaces are one-dimensional. In this language, given a Borel-measurable function $f:\mathbb C\rightarrow \mathbb C$, we have that
$$f(A) := \int_{\sigma(A)} f(\lambda) \ \mathrm dP^A(\lambda) \rightsquigarrow \sum_{\lambda\in \sigma(A)} f(\lambda) |\lambda\rangle\langle \lambda|$$
This is the definition of a function of a possibly-unbounded operator which is most commonly used in quantum mechanics (e.g. in Stone's theorem).
