Why is $\int_{\mathbb{R}^3} |p\rangle \langle p| d\lambda(p)=id$? As I have written in the headline, I am curious how the relation $\int_{\mathbb{R}^3} |p \rangle \langle p| d\lambda(p)=id$ that physicists use, where $|p\rangle$ is the eigenfunction to the eigenvalue $p$ of the momentum operator can be mathematically understood? How is this integral defined and is there a better way to write this operator more rigorously?
 A: A projection-valued measure on $\mathbb{R}$ is an assignment $\Pi$ that maps a Borel measurable subset $U$ of $\mathbb{R}$ (e.g., an interval) to an orthogonal projection $\Pi(U)$, such that


*

*$\Pi(\emptyset) = 0$ and $\Pi(\mathbb{R}) = I$,

*if $\{U_k\}$ is a countable collection of Borel measurable subsets such that $U_i \cap U_j = \emptyset$ for $i \neq j$, then $\Pi_{\cup_k U_k} = \sum_k \Pi_{U_k}$, where the sum on the right converges strongly, i.e., $\Pi_{\cup_k U_k}\xi = \sum_k \Pi_{U_k}\xi$ for all vectors $\xi$ in your Hilbert space $H$,


or equivalently, such that for any $\xi$, $\eta \in H$, $\mu_{\xi,\eta} : U \mapsto \langle \xi \lvert \Pi(U) \rvert \eta \rangle$ defines a complex measure on $\mathbb{R}$. In particular, for any unit vector (i.e., pure state) $\xi \in H$, $\mu_{\xi,\xi} : U \mapsto \langle \xi \lvert \Pi(U) \rvert \xi \rangle$ defines a probability measure on $\mathbb{R}$. Hence, for any Borel measurable function $f : \mathbb{R} \to \mathbb{C}$, one can define an unbounded operator $\int_{-\infty}^\infty f(x) d\Pi(x)$ on $H$ with dense domain $D_f := \{\xi \in H \mid \int_{-\infty}^\infty \lvert f(x) \rvert^2 d\mu_{\xi,\xi}(x) < \infty \}$ by setting
$$
 \forall \xi,\; \eta \in D_f, \quad \left\langle \xi \left\lvert \int_{-\infty}^\infty f(x) d\Pi(x) \right\rvert \eta \right\rangle := \int_{-\infty}^\infty f(x) d\mu_{\xi,\eta}.
$$
Now, what does all this have to do with observables? Let $A$ be a quantum observable, i.e., a possibly unbounded self-adjoint operator. The spectral theorem then tells you that there exists a unique spectral valued measure $\Pi$ on $\mathbb{R}$ such that $A = \int_{-\infty}^\infty a d\Pi(a)$; for example, in the case of momentum $\hat{p} = i\tfrac{d}{dx}$, $\Pi(U) = \int_U \lvert p \rangle\langle p \rvert dp$ in physics notation, so that $\lvert p \rangle\langle p \rvert dp$ can really be interpreted as physics notation for $d\Pi(p)$ wherever it appears. In particular, for any Borel subset $U$ of $\mathbb{R}$,
$$
 \Pi(U) = \int_{-\infty}^\infty \chi_U(a)d\Pi(a) = ``\int_U d\Pi(a)"
$$
is the orthogonal projection onto the subspace of pure states where $A$ is observed to take its value in $U$, and if $\xi \in H$ is a unit vector, and thus a pure state, then $\langle \xi \lvert \Pi(U) \rvert \eta \rangle = \int_U d\mu_{\xi,\xi}$ is the probability that the observed value of $A$ in the pure state $\xi$ lies in $U$. Still more is true: if $a$ denotes, by abuse of notation, the classical observable corresponding to $A = \hat{a}$, then for any measurable function $f : \mathbb{R} \to \mathbb{R}$, $f(A) = \int_{-\infty}^\infty f(a) d\Pi(a)$ is the quantum observable corresponding to the classical observable $f(a)$, and its expectation value in any pure state (unit vector) $\xi \in H$ is $\langle \xi \lvert f(A) \rvert \xi \rangle = \int_{-\infty}^\infty f(a) d\mu_{\xi,\xi}$.
Finally, suppose that $A$ is a self-adjoint operator with discrete spectrum $\{a_k\}$, let $H_k := \ker(A - a_k I)$ be the eigenspace corresponding to the eigenvalue $a_k$, and let $P_k$ denote the orthogonal projection onto $H_k$. Then the corresponding projection-valued measure $\Pi$ is given by
$
 \Pi(U) := \sum_{a_k \in U} P_k,
$
where the right hand side converges strongly, i.e., $\Pi(U)\xi = \sum_{a_k \in U} P_k\xi$ for all $\xi \in H$, so that for any measurable function $f : \mathbb{R} \to \mathbb{C}$, 
$$
 f(A) = \int_{-\infty}^\infty f(a) d\Pi(a) = \sum_k f(a_k) P_k,
$$
where the sum on the right hand side, again, converges strongly on the domain of $A$; in particular, the spectral theorem reads
$$
 A = \int_{-\infty}^\infty a d\Pi(a) = \sum_k a_k P_k,
$$
which, up to convergence issues, is precisely the spectral theorem of finite-dimensional linear algebra. From a symbolic standpoint, you can symbolically write
$$
 d\Pi(a) = \sum_k P_k \delta(a-a_k)da,
$$
where $\delta(a-a_k)da$ is the Dirac delta supported at $a_k$.
