On the definition of commuting self adjoint operators. I'm reading Mathematical Methods in Quantum Mechanics by Gerald Teschl and I came across the following exercise whose statement is causing me some troubles. It goes like this:

Let $A$ and $B$ two self-adjoints operators. Then $A$ and $B$ commute if and only if the corresponding spectral projections $P_{A}(\Omega)$ and $P_{B}(\Omega)$ commute fore every Borel set $\Omega$.

He defines that two self adjoint operators $A$ and $B$ commute if and only if their resolvents $R_A(z_1):=(A-z_1)^{-1}$ and $R_B(z_2):=(B-z_2)^{-1}$ commute for at least one $z_1$ in the resolvent of $A$ and one $z_2$ in the resolvent of $B$. After this, he proves that this is equivalent to $[f(A),g(B)]=0$ for arbitrary bounded Borel functions (which trivially shows one implication of the exercise).
My main problem is understanding the hypothesis of the problem: does it say that $P_B(\Omega)P_A(\Omega')=P_A(\Omega')P_B(\Omega)$ for arbitrary $\Omega, \Omega'$ or that this is only valid for $\Omega=\Omega'$? In the former case, I can see how to prove both directions (approximating bounded measurable functions by simple ones), but I can't see how to proceed in the latter case.
I've tried to look for definitions in other books, but they don't really solve this ambiguity (they state this in a similar way).
Any help is appreciated. Thanks in advance
 A: From your question, it seems that you already know that if $P_A (M) P_B (M') = P_B (M') P_A (M)$ for all Borel sets $M,M'$, you are done.
I will show that this holds if we assume $P_A (M) P_B (M) = P_B (M) P_A (M)$ for all Borel sets $M$. For brevity, I write $\mu := P_A$ and $\nu := P_B$.

Let us first assume that $M \cap N = \emptyset$. In this case, because of $\mu(M) \mu(N) = \mu(M\cap N) = 0$ (and likewise for $\nu$), we have
\begin{align*}
  &\mu(M) \nu(M) + \mu(M)\nu(N) + \mu(N) \nu (M) + \mu(N) \nu(N) \\
  &= [\mu(M) + \mu(N)] \cdot [\nu(M) + \nu(N)] \\
  &= \mu(M \cup N) \nu(M \cup N)  \\
  &= \nu(M \cup N) \mu(M \cup N)  \\
  &= [\nu(M) + \nu(N)] \cdot [\mu(M) + \mu(N)] \\
  &= \nu(M) \mu(M) + \nu(M)\mu(N) + \nu(N)\mu(M) + \nu(N)\mu(N).
\end{align*}
Using $\mu(N) \nu(N) = \nu(N) \mu(N)$ (and the analogous formula for $M$), we deduce
$$
\mu(M) \nu(N) + \mu(N)\nu(M) = \nu(M) \mu(N) + \nu(N) \mu(M). \qquad (\ast)
$$

Now, multiply this equation from the left by $\mu(N)$. Because of $\mu(N) \mu(M) = \mu(N \cap M) = 0$ and $\mu(N) \mu(N) = \mu(N)$, we get
\begin{align*}
\mu(N) \nu(M) &= \mu(N) \nu(M) \mu(N) + \mu(N) \nu(N) \mu(M) \\
              &= \mu(N) \nu(M) \mu(N) + \nu(N)  \underbrace{\mu(N)\mu(M)}_{=0} \\
              &= \mu(N) \nu(M) \mu(N). \tag{$\dagger$}
\end{align*}
Note that since $\mu(N)$ and $\nu(M)$ are self-adjoint, so is the right-hand side of $(\dagger)$. Hence, so is the left-hand side, i.e.
$$
\mu(N) \nu(M) =[\mu(N) \nu(M)]^\ast = \nu(M) \mu(N).
$$
This establishes what we want, but only under the assumption $N \cap M = \emptyset$.

Now, let $M,N$ be arbitrary Borel sets. Then $M = (M \setminus N) \cup (M\cap N)$, where the union is disjoint. Analogously, $N = (N \setminus M) \cup (M \cap N)$, so that we get
\begin{align*}
&\mu(M) \nu(N) \\
&= [\mu(M \setminus N) + \mu(M \cap N)] \cdot [\nu(N \setminus M) + \nu(M \cap N)] \\
&= \mu(M \setminus N) \nu (N \setminus M) + \mu(M \setminus N) \nu(M \cap N)\\ 
&\quad + \mu(M \cap N)\nu(N \setminus M) + \mu(M \cap N) \nu(M \cap N) \\
&\overset{(\ast)}{=} \nu(N \setminus M) \mu (M \setminus N) + \nu(M \cap N)\mu(M \setminus N) \\
&\quad + \nu(N \setminus M)\mu(M \cap N) + \nu(M \cap N) \mu(M \cap N)  \\
&= \nu(N) \mu(M)
\end{align*}
Here, the step marked with $(\ast)$ used the assumption on the last term and the step from above (for disjoint Borel sets) on all the other terms. Finally, the last step used a similar computation as the first two steps.
