I'm working through the proof of the spectral theorem (for bounded self-adjoint operators) presented in the book "Introduction to Hilbert Space and the Theory of Spectral Multiplicity" by Paul Halmos. The full proof can be found at the end.
Theorem
If $A$ is a self-adjoint operator, then there exists a (necessarily real and necessarily unique) compact, complex spectral measure $E$, called the spectral measure of $A$, such that $A=\int \lambda d E (\lambda)$.
My problem is the last part of the proof, where it's proven that $E$ is multiplicative, i.e. $E(M \cap N)=E(M)E(N)$.
[... ]For any fixed pair of vectors $x$ and $y$ and for any real polynomial $q$, we introduce the auxiliary complex measure $v$ defined for every Borel set $M$ by $\nu(M)=\int_M q(\lambda) d \langle E(\lambda) x, y \rangle$. If $p$ is any real polynomial, then $$ \int p(\lambda) d \nu(\lambda) = \int p(\lambda) q(\lambda) d \langle E(\lambda) x, y \rangle = \langle p(A) q(A) x, y\rangle = \langle p(A) x, q(A) y) =\int p(\lambda) d \langle E(\lambda) x, q(A) y \rangle $$ and therefore $$ \nu(M) = \int q(\lambda) \chi_M(\lambda) d \langle E(\lambda) x, y\rangle = \langle E(M) x, q(A) y\rangle = \langle q(A) E(M) x, y \rangle = \int q(\lambda) d \langle E(\lambda) E(M) x, y \rangle $$
for every Borel set $M$. Since $q$ is arbitrary, it follows that $$ \langle E (M \cap N) x, y \rangle = \int_{M \cap N} d \langle E(\lambda) x, y \rangle = \int_N \chi_M(\lambda) d \langle E(\lambda) x, y \rangle = \langle E(N) E(M) x, y \rangle $$ for every Borel set, $N$, and hence that $E(M \cap N)=E(M) E(N)$.
Question: How do we conclude that? $$ \int_N \chi_M(\lambda) d \langle E(\lambda) x, y\rangle = \langle E(N) E(M) x, y \rangle $$ I assume that this should follow from the previous two equations, probably by some smart choice of $q$, but I don't see how.
Update:
According to the following reference (top of page 9), this follows by Stone-Weierstrass and the fact that $C_c$ is dense in $L^1$. Unfortunately I still don‘t understand how exactly this should follow.
Proof
Let $x$ and $y$ be any two fixed vectors and write
$$
L(p)=(p(A) x, y)
$$
for every real polynomial $p$.
It follows from 34.3 that
$$
\vert L(p) \vert \leq \mathbf{N}_{A}(p) \| x \| \| y \|
$$
and hence that, with respect to the norm $\mathbf{N}_A$, $L$ is a bounded linear functional of its argument.
There exists consequently a unique complex measure $\mu$ in the compact set $\Lambda(A)$ such that $(p(A) x, y)=\int(p(\lambda) d \mu(\lambda)$ every Borel set $M$ (Riesz-Markov-Kakutani).
We shall find it convenient to indicate the dependence of $\mu$ on $x$ and $y$ by writing $\mu_M(x, y)$ instead of $\mu(M)$.
Using the uniqueness of $\mu$, we may proceed by straightforward computations to prove that $\mu_M$ is a symmetric, bilinear functional for each Borel set $M$.
The proof of the fact that $\mu_y$ is additive in its first argument runs, for instance, as follows:
\begin{align}
\int p(\lambda) d \mu_\lambda\left(x_1+x_2, y\right)
&=
\left(p(A)\left(x_1+x_2\right), y\right)\\
&=\left(p(A) x_1, y\right)+\left(p(A) x_2, y\right) \\
&=\int p(\lambda) d \mu_\lambda\left(x_1, y\right)+\int p(\lambda) d \mu_\lambda\left(x_2, y\right) .
\end{align}
Since, in virtue of the relation $\left.\mid \mu_M(x, y)\right\} \leq\|x\| \cdot\|y\|$, valid for all $M, x$, and $y$, the bilinear functionals $\mu_{M}$ are bounded, it follows that for each $M$ there exists a unique Hermitian operator $E(I)$ such that $\mu_M(x, y)=(E(M) x, y)$ for all $x$ and $y$.
Consideration of the polynomials $p_0$ and $p_1$, defined by $p_0(\lambda)=1$ and $p_1(\lambda)=\lambda$, implies that
$$
\int d(E(\lambda) x, y)=(E(X) x, y)=(x, y)
$$
and
$$
\int \lambda d(E(\lambda) x, y)=(A x, y)
$$
for all $x$ and $y$.
In view of 36.3, all that remains in order to complete the proof of the theorem is to establish that the function $E$ is projection-valued; we shall do this by proving that $E$ is multiplicative.
For any fixed pair of vectors $x$ and $y$ and for any real polynomial $q$, we introduce the auxiliary complex measure $v$ defined for every Borel set $M$ by $\nu(M)=\int_M q(\lambda) d(E(\lambda) x, y)$. If $p$ is any real polynomial, then \begin{align} \int p(\lambda) d \nu (\lambda) &= \int p(\lambda) q(\lambda) d(E(\lambda) x, y)\\ &= (p(A) q(A) x, y) \\ &= (p(A) x, q(A) y)\\ &=\int p(\lambda) d\left(E(\lambda) x, q(A) y\right) \end{align} and therefore \begin{align} \nu(M) &= \int q(\lambda) \chi_M(\lambda) d(E(\lambda) x, y)\\ &= (E(M) x, q(A) y) \\ &= (q(A) E(M) x, y)\\ &= \int q(\lambda) d(E(\lambda) E(M) x, y) \end{align} for every Borel set $M$. Since $q$ is arbitrary, it follows that \begin{align} \left( E (M \cap N) x, y\right) &= \int_{M \cap N} d(E(\lambda) x, y) \\ &= \int_N \chi_M(\lambda) d(E(\lambda) x, y)\\ &= (E(N) E(M) x, y) \end{align} for every Borel set, $N$, and hence that $E(M \cap N)=E(M) E(N)$. The proof of the spectral theorem for self-adjoint operators is thereby complete.