Let $H$ be a complex Hilbert space. Suppose $P : \mathbb{R} \to \mathcal{L}(H)$ is a resolution of the identity, meaning:
- Each $P(\lambda)$ is an orthogonal projection.
- $P(\lambda_1) \le P(\lambda_2)$ for $\lambda_1 \le \lambda_2$.
- $P(\lambda_n)$ converges strongly to $P(\lambda)$ whenever $\lambda_n \searrow \lambda$.
- $P(\lambda_n)$ converges strongly to $0$ ($\text{Id}$) as $\lambda_n \searrow -\infty$ ($\lambda_n \nearrow +\infty$).
For each $\psi \in H$, by 1., 2. and 3., we get an increasing right continuous function $$\lambda \mapsto \langle \psi, P(\lambda) \psi \rangle, $$ so there is a unique Borel measure $\mu_\psi$ obeying $$\mu_\psi(\lambda_1, \lambda_2] = \langle \psi, P(\lambda_1, \lambda_2] \psi \rangle$$ where we define $P(\lambda_1, \lambda_2] := P(\lambda_2) - P(\lambda_1)$. By 4., we have $$\mu_\psi(\mathbb{R}) = \lim_{n \to \infty}\mu_\psi(-n,n] = \lim_{n \to \infty}( \langle \psi, P(-n) \psi \rangle - \langle \psi, P(n) \psi \rangle) = \|\psi\|^2 < \infty. $$
Next, for each pair $(\varphi, \psi) \in H \times H$, define the complex measure $$\mu_{\varphi, \psi} := \frac{1}{4}\Big( \mu_{\varphi + \psi} - \mu_{\varphi - \psi} +i(\mu_{\varphi - i\psi} - \mu_{\varphi + i\psi})\Big).$$
A brief calculation shows that, for each $(\varphi, \psi) \in H \times H$ and each interval of the form $(\lambda_1, \lambda_2]$, one has $$\mu_{\varphi, \psi}(\lambda_1, \lambda_2]= \langle \varphi, P(\lambda_1, \lambda_2]\psi \rangle. $$ The left side is sesquilinear in $(\varphi, \psi)$ because the right side is. Since the half-open intervals generate the Borel $\sigma$-algebra on $\mathbb{R}$, this sesquilinearity of the left side continues to hold with $(\lambda_1, \lambda_2]$ replaced by an arbitrary Borel set $\Omega$. Moreover, using Cauchy Schwarz for sesquilinear forms $$|\mu_{\varphi, \psi}(\Omega) | \le \mu_{\varphi, \varphi}(\Omega)^{1/2} \mu_{\psi, \psi}(\Omega)^{1/2} \le \|\varphi\|\|\psi\|.$$ Thus, by the Lax-Milgram lemma, there is a unique bounded operator $P(\Omega)$ on $H$ with $\mu_{\varphi, \psi}(\Omega) = \langle \varphi, P(\Omega)\psi \rangle$ (and incidentally $\|P(\Omega) \|_{H \to H} \le 1$). Moreover, $P(\Omega)$ is self adjoint because $$\langle P(\Omega) \psi, \psi \rangle = \overline{\langle \psi,P(\Omega) \psi\rangle} = \overline{\mu_{\psi,\psi}(\Omega)} = \mu_{\psi,\psi}(\Omega) = \langle \psi,P(\Omega) \psi\rangle. $$
I would now like to show that each $P^2(\Omega) = P(\Omega)$ (i.e., each $P(\Omega)$ is a projection), but I've gotten stuck.
It would suffice to show that for any $\psi$, $\Omega_1$ and $\Omega_2$, $$\langle \psi, P(\Omega_2)P(\Omega_1)\psi \rangle = \langle \psi, P(\Omega_2 \cap\Omega_1)\psi \rangle.$$
Using additivity of measures it's easy to see that $P(\mathbb{R} \setminus \Omega) = \text{Id} - P(\Omega)$ as well as $P(\Omega_2 \cup \Omega_1) + P(\Omega_2 \cap \Omega_1) = P(\Omega_2) + P( \Omega_1)$, though I'm not sure these identities are useful.