[proofplan]
We verify the Hilbert space axioms for $\mathcal{M}^2$ in two stages. The inner product axioms follow directly from those of $L^2(\Omega)$. The main content is completeness: given a Cauchy sequence in $\mathcal{M}^2$, we pass to a rapidly convergent subsequence, apply Doob's $L^2$ maximal inequality to control the supremum of path differences, and use the Borel--Cantelli lemma to establish uniform (in time) almost sure convergence to a limit process. We then verify that the limit inherits the martingale property and belongs to $\mathcal{M}^2$. Finally, we show $\mathcal{M}^2_c$ is closed by observing that the uniform limit of continuous paths is continuous.
[/proofplan]
[step:Verify the inner product axioms]
Define the inner product on $\mathcal{M}^2$ by
\begin{align*}
(M, N)_{\mathcal{M}^2} := \mathbb{E}[M_\infty N_\infty],
\end{align*}
where $M_\infty := \lim_{t \to \infty} M_t$ and $N_\infty := \lim_{t \to \infty} N_t$ are the almost sure limits guaranteed by the martingale convergence theorem (since $M, N \in \mathcal{M}^2$ implies $\sup_t \mathbb{E}[M_t^2] < \infty$).
**Bilinearity.** For $\alpha, \beta \in \mathbb{R}$ and $M, N, P \in \mathcal{M}^2$, the process $\alpha M + \beta N$ is a martingale with $(\alpha M + \beta N)_\infty = \alpha M_\infty + \beta N_\infty$. By linearity of expectation,
\begin{align*}
(\alpha M + \beta N, P)_{\mathcal{M}^2} = \mathbb{E}[(\alpha M_\infty + \beta N_\infty) P_\infty] = \alpha \mathbb{E}[M_\infty P_\infty] + \beta \mathbb{E}[N_\infty P_\infty] = \alpha (M, P)_{\mathcal{M}^2} + \beta (N, P)_{\mathcal{M}^2}.
\end{align*}
**Symmetry.** $(M, N)_{\mathcal{M}^2} = \mathbb{E}[M_\infty N_\infty] = \mathbb{E}[N_\infty M_\infty] = (N, M)_{\mathcal{M}^2}$.
**Positive definiteness.** $(M, M)_{\mathcal{M}^2} = \mathbb{E}[M_\infty^2] \geq 0$, and $\mathbb{E}[M_\infty^2] = 0$ implies $M_\infty = 0$ a.s. Since $M$ is a uniformly integrable martingale (by the $L^2$-boundedness), $M_t = \mathbb{E}[M_\infty \mid \mathcal{F}_t] = 0$ a.s. for all $t$, so $M = 0$ in $\mathcal{M}^2$.
[guided]
We need to check that $(\cdot, \cdot)_{\mathcal{M}^2}$ defines a genuine inner product on $\mathcal{M}^2$. Recall that elements of $\mathcal{M}^2$ are càdlàg $L^2$-bounded martingales, identified up to indistinguishability. The inner product is inherited from $L^2(\Omega)$ via the terminal value $M_\infty$.
Why does $M_\infty$ exist? Since $M \in \mathcal{M}^2$, we have $\sup_t \mathbb{E}[M_t^2] = \|M\|_{\mathcal{M}^2}^2 < \infty$. The $L^2$-bounded martingale convergence theorem guarantees that $M_t \to M_\infty$ both a.s. and in $L^2$, and that $M$ is uniformly integrable.
**Bilinearity** follows directly from linearity of expectation: for $\alpha, \beta \in \mathbb{R}$ and $M, N, P \in \mathcal{M}^2$,
\begin{align*}
(\alpha M + \beta N, P)_{\mathcal{M}^2} &= \mathbb{E}[(\alpha M_\infty + \beta N_\infty) P_\infty] = \alpha \mathbb{E}[M_\infty P_\infty] + \beta \mathbb{E}[N_\infty P_\infty] = \alpha (M, P)_{\mathcal{M}^2} + \beta (N, P)_{\mathcal{M}^2}.
\end{align*}
**Symmetry** is immediate: $(M, N)_{\mathcal{M}^2} = \mathbb{E}[M_\infty N_\infty] = \mathbb{E}[N_\infty M_\infty] = (N, M)_{\mathcal{M}^2}$.
**Positive definiteness** requires care. We have $(M, M)_{\mathcal{M}^2} = \mathbb{E}[M_\infty^2] \geq 0$. If $\mathbb{E}[M_\infty^2] = 0$, then $M_\infty = 0$ a.s. Since $M$ is uniformly integrable, the martingale is closed: $M_t = \mathbb{E}[M_\infty \mid \mathcal{F}_t] = 0$ a.s. for every $t \geq 0$. By right-continuity of paths, this gives $M \equiv 0$ up to indistinguishability.
[/guided]
[/step]
[step:Pass to a rapidly convergent subsequence]
Let $(M^n)_{n \geq 1} \subset \mathcal{M}^2$ be a Cauchy sequence, so $\|M^n - M^m\|_{\mathcal{M}^2} \to 0$ as $n, m \to \infty$. Extract a subsequence (still denoted $(M^n)$) such that
\begin{align*}
\|M^n - M^{n-1}\|_{\mathcal{M}^2} \leq 2^{-n} \quad \text{for all } n \geq 2.
\end{align*}
This is possible because every Cauchy sequence has a subsequence with summable gaps.
[guided]
We want to show that the Cauchy sequence $(M^n)$ converges in $\mathcal{M}^2$. The standard strategy is to find a subsequence that converges in a strong enough sense (uniformly in time, almost surely) to a limit process, then verify that the full original Cauchy sequence converges to the same limit.
Why pass to a subsequence? Because a Cauchy sequence in any metric space converges if and only if some subsequence converges. We choose the subsequence to make the gaps $\|M^n - M^{n-1}\|_{\mathcal{M}^2}$ decrease fast enough (geometrically) so that a telescoping argument works.
Concretely, since $\|M^n - M^m\|_{\mathcal{M}^2} \to 0$, for each $k \geq 1$ there exists $n_k$ such that $\|M^{n_k} - M^{n_{k-1}}\|_{\mathcal{M}^2} \leq 2^{-k}$. Relabel $M^{n_k}$ as $M^k$ to obtain
\begin{align*}
\|M^n - M^{n-1}\|_{\mathcal{M}^2} \leq 2^{-n} \quad \text{for all } n \geq 2.
\end{align*}
[/guided]
[/step]
[step:Apply Doob's $L^2$ maximal inequality to control the supremum of path differences]
For each $n \geq 2$, the process $M^n - M^{n-1}$ is a càdlàg $L^2$-bounded martingale. By [Doob's $L^2$ Maximal Inequality](/theorems/2112), applied to the martingale $M^n - M^{n-1}$,
\begin{align*}
\mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|^2\right] \leq 4 \, \mathbb{E}\!\left[(M^n_\infty - M^{n-1}_\infty)^2\right] = 4 \, \|M^n - M^{n-1}\|_{\mathcal{M}^2}^2 \leq 4 \cdot 2^{-2n}.
\end{align*}
The hypothesis of Doob's inequality is satisfied: $M^n - M^{n-1}$ is a martingale with $\sup_t \mathbb{E}[|M^n_t - M^{n-1}_t|^2] < \infty$, which holds because both $M^n$ and $M^{n-1}$ lie in $\mathcal{M}^2$.
Taking square roots and applying Jensen's inequality ($\mathbb{E}[|Z|] \leq \mathbb{E}[Z^2]^{1/2}$ for any random variable $Z$),
\begin{align*}
\mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|\right] \leq \mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|^2\right]^{1/2} \leq 2 \cdot 2^{-n}.
\end{align*}
Summing over $n \geq 2$,
\begin{align*}
\mathbb{E}\!\left[\sum_{n=2}^{\infty} \sup_{t \geq 0} |M^n_t - M^{n-1}_t|\right] = \sum_{n=2}^{\infty} \mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|\right] \leq 2 \sum_{n=2}^{\infty} 2^{-n} = 2 < \infty,
\end{align*}
where the exchange of sum and expectation is justified by the Monotone Convergence Theorem (applied to the non-negative partial sums).
[guided]
The key idea in proving completeness of $\mathcal{M}^2$ is to upgrade $L^2$-convergence of terminal values to *uniform-in-time* convergence of paths. This is where Doob's maximal inequality is essential: it says that for an $L^2$-bounded martingale $X$,
\begin{align*}
\mathbb{E}\!\left[\sup_{t \geq 0} X_t^2\right] \leq 4 \, \mathbb{E}[X_\infty^2].
\end{align*}
Applied to $X = M^n - M^{n-1}$, this gives
\begin{align*}
\mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|^2\right] \leq 4 \, \|M^n - M^{n-1}\|_{\mathcal{M}^2}^2 \leq 4 \cdot 2^{-2n}.
\end{align*}
Why is this useful? Because it means the random variable $\sup_{t \geq 0} |M^n_t - M^{n-1}_t|$ is small in $L^2$, hence also in $L^1$ by Jensen's inequality:
\begin{align*}
\mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|\right] \leq \mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|^2\right]^{1/2} \leq 2 \cdot 2^{-n}.
\end{align*}
Summing the $L^1$ norms over $n \geq 2$ gives a finite total:
\begin{align*}
\mathbb{E}\!\left[\sum_{n=2}^{\infty} \sup_{t \geq 0} |M^n_t - M^{n-1}_t|\right] = \sum_{n=2}^{\infty} \mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M^{n-1}_t|\right] \leq 2 \sum_{n=2}^{\infty} 2^{-n} = 2 < \infty.
\end{align*}
The exchange of sum and integral uses the Monotone Convergence Theorem applied to the non-negative partial sums $\sum_{n=2}^{N} \sup_{t \geq 0} |M^n_t - M^{n-1}_t| \nearrow \sum_{n=2}^{\infty} \sup_{t \geq 0} |M^n_t - M^{n-1}_t|$.
Since the expectation of the sum is finite, the sum itself must be finite almost surely. This is the crucial conclusion: the telescoping series $\sum_n \sup_t |M^n_t - M^{n-1}_t|$ converges a.s.
[/guided]
[/step]
[step:Construct the limit process via uniform convergence of paths]
Since $\sum_{n=2}^{\infty} \sup_{t \geq 0} |M^n_t - M^{n-1}_t| < \infty$ almost surely, the telescoping series $M^1_t + \sum_{n=2}^{\infty} (M^n_t - M^{n-1}_t)$ converges absolutely and uniformly in $t$ on an event $\Omega_0$ with $\mathbb{P}(\Omega_0) = 1$. Define
\begin{align*}
M_t(\omega) :=
\begin{cases}
\lim_{n \to \infty} M^n_t(\omega) & \text{if } \omega \in \Omega_0, \\
0 & \text{if } \omega \notin \Omega_0.
\end{cases}
\end{align*}
For $\omega \in \Omega_0$, the convergence $M^n(\omega, \cdot) \to M(\omega, \cdot)$ is uniform on $[0, \infty)$. Since each $M^n(\omega, \cdot)$ is a càdlàg function (right-continuous with left limits), and the uniform limit of càdlàg functions is càdlàg, the path $t \mapsto M_t(\omega)$ is càdlàg.
[guided]
On the almost sure event $\Omega_0$ where the telescoping series converges, the partial sums $M^n_t(\omega) = M^1_t(\omega) + \sum_{k=2}^{n}(M^k_t(\omega) - M^{k-1}_t(\omega))$ form a Cauchy sequence in the supremum norm on càdlàg functions:
\begin{align*}
\sup_{t \geq 0} |M^n_t(\omega) - M^m_t(\omega)| \leq \sum_{k=m+1}^{n} \sup_{t \geq 0} |M^k_t(\omega) - M^{k-1}_t(\omega)| \to 0 \quad \text{as } m, n \to \infty.
\end{align*}
The space of càdlàg functions equipped with the supremum norm is complete (the uniform limit of càdlàg functions is càdlàg), so the sequence converges uniformly to a càdlàg limit $M(\omega, \cdot)$.
Why do we need uniform convergence and not just pointwise? Because we need the limit process to have càdlàg paths. Pointwise convergence of càdlàg functions does not in general yield a càdlàg limit, but uniform convergence does.
[/guided]
[/step]
[step:Verify the martingale property and $L^2$-boundedness of the limit]
We check that $M$ is a martingale with $\sup_t \mathbb{E}[M_t^2] < \infty$.
**Adaptedness.** For each $t$, $M_t = \lim_{n \to \infty} M^n_t$ a.s. Since each $M^n_t$ is $\mathcal{F}_t$-measurable and pointwise limits of measurable functions are measurable, $M_t$ is $\mathcal{F}_t$-measurable.
**$L^2$-boundedness.** By Fatou's lemma,
\begin{align*}
\mathbb{E}[M_t^2] = \mathbb{E}\!\left[\liminf_{n \to \infty} (M^n_t)^2\right] \leq \liminf_{n \to \infty} \mathbb{E}[(M^n_t)^2] \leq \liminf_{n \to \infty} \|M^n\|_{\mathcal{M}^2}^2.
\end{align*}
Since $(M^n)$ is Cauchy in $\mathcal{M}^2$, the sequence $(\|M^n\|_{\mathcal{M}^2})$ is bounded, say $\|M^n\|_{\mathcal{M}^2} \leq C$ for all $n$. Therefore $\sup_t \mathbb{E}[M_t^2] \leq C^2 < \infty$, so $M$ is $L^2$-bounded.
**Martingale property.** For $0 \leq s \leq t$ and any bounded $\mathcal{F}_s$-measurable random variable $Z$, we must show $\mathbb{E}[M_t Z] = \mathbb{E}[M_s Z]$. Since $M^n$ is a martingale for each $n$, we have $\mathbb{E}[M^n_t Z] = \mathbb{E}[M^n_s Z]$. By Doob's maximal inequality,
\begin{align*}
\mathbb{E}\!\left[\sup_{t \geq 0} |M^n_t - M_t|^2\right] \leq 4 \, \mathbb{E}[(M^n_\infty - M_\infty)^2] \to 0 \quad \text{as } n \to \infty,
\end{align*}
where $M_\infty = \lim_{t \to \infty} M_t$ exists in $L^2$ by the $L^2$-bounded martingale convergence theorem. In particular, $M^n_t \to M_t$ in $L^2$ for each $t$, and $M^n_s \to M_s$ in $L^2$. Since $Z$ is bounded,
\begin{align*}
|\mathbb{E}[M_t Z] - \mathbb{E}[M^n_t Z]| \leq \|Z\|_\infty \, \mathbb{E}[|M_t - M^n_t|] \leq \|Z\|_\infty \, \|M_t - M^n_t\|_{L^2} \to 0,
\end{align*}
and similarly for $\mathbb{E}[M_s Z]$. Passing to the limit in $\mathbb{E}[M^n_t Z] = \mathbb{E}[M^n_s Z]$ gives $\mathbb{E}[M_t Z] = \mathbb{E}[M_s Z]$.
[guided]
We need to verify three properties: adaptedness, $L^2$-boundedness, and the martingale property.
**Adaptedness** is straightforward. For each $t$, $M_t(\omega) = \lim_{n \to \infty} M^n_t(\omega)$ on $\Omega_0$ (a set of full measure). Each $M^n_t$ is $\mathcal{F}_t$-measurable because $M^n$ is adapted. The pointwise limit of $\mathcal{F}_t$-measurable functions is $\mathcal{F}_t$-measurable.
**$L^2$-boundedness** uses Fatou's lemma. For each fixed $t$,
\begin{align*}
\mathbb{E}[M_t^2] = \mathbb{E}\!\left[\liminf_{n \to \infty} (M^n_t)^2\right] \leq \liminf_{n \to \infty} \mathbb{E}[(M^n_t)^2] \leq \liminf_{n \to \infty} \|M^n\|_{\mathcal{M}^2}^2 \leq C^2,
\end{align*}
where $C = \sup_n \|M^n\|_{\mathcal{M}^2} < \infty$ because every Cauchy sequence in a normed space is bounded. Taking the supremum over $t$ gives $\|M\|_{\mathcal{M}^2} \leq C$.
**The martingale property** is the most delicate verification. We want to show $\mathbb{E}[M_t \mid \mathcal{F}_s] = M_s$ for $s \leq t$. Rather than working with conditional expectations directly, we use the equivalent characterization: $M$ is a martingale if and only if $\mathbb{E}[M_t Z] = \mathbb{E}[M_s Z]$ for every bounded $\mathcal{F}_s$-measurable $Z$. We know $\mathbb{E}[M^n_t Z] = \mathbb{E}[M^n_s Z]$ for each $n$, so it suffices to pass to the limit.
Since $M^n_t \to M_t$ in $L^2$ (and hence in $L^1$), and $Z$ is bounded, Holder's inequality gives
\begin{align*}
|\mathbb{E}[M_t Z] - \mathbb{E}[M^n_t Z]| \leq \|Z\|_\infty \, \|M_t - M^n_t\|_{L^1} \leq \|Z\|_\infty \, \|M_t - M^n_t\|_{L^2} \to 0.
\end{align*}
The same argument applies to $\mathbb{E}[M_s Z]$. Combining: $\mathbb{E}[M_t Z] = \lim_n \mathbb{E}[M^n_t Z] = \lim_n \mathbb{E}[M^n_s Z] = \mathbb{E}[M_s Z]$.
[/guided]
[/step]
[step:Show $\|M^n - M\|_{\mathcal{M}^2} \to 0$ and extend to the original Cauchy sequence]
We have established $M \in \mathcal{M}^2$. To show $M^n \to M$ in $\mathcal{M}^2$, note that
\begin{align*}
\|M^n - M\|_{\mathcal{M}^2}^2 = \mathbb{E}[(M^n_\infty - M_\infty)^2].
\end{align*}
Since $M^n_\infty \to M_\infty$ a.s. (by uniform convergence of paths) and $|M^n_\infty - M_\infty|^2 \leq (\sup_{t \geq 0} |M^n_t - M_t|)^2 \leq \left(\sum_{k=n+1}^{\infty} \sup_t |M^k_t - M^{k-1}_t|\right)^2$, which is dominated by $\left(\sum_{k=2}^{\infty} \sup_t |M^k_t - M^{k-1}_t|\right)^2 \in L^1$ (since its square root is in $L^1$), the Dominated Convergence Theorem gives $\|M^n - M\|_{\mathcal{M}^2} \to 0$.
Now return to the original Cauchy sequence (before passing to a subsequence). Since the subsequence converges to $M$ in $\mathcal{M}^2$, and the original sequence is Cauchy, the full original sequence also converges to $M$ in $\mathcal{M}^2$. This completes the proof that $\mathcal{M}^2$ is a Hilbert space.
[/step]
[step:Show $\mathcal{M}^2_c$ is a closed subspace of $\mathcal{M}^2$]
Let $(M^n)_{n \geq 1} \subset \mathcal{M}^2_c$ be a sequence converging to $M \in \mathcal{M}^2$ in the $\mathcal{M}^2$-norm. We must show $M$ has continuous paths.
By the argument above (passing to a rapidly convergent subsequence), we may assume the convergence is also uniform in time on an event of full probability. For $\omega \in \Omega_0$, the path $t \mapsto M^n_t(\omega)$ is continuous for each $n$, and $M^n(\omega, \cdot) \to M(\omega, \cdot)$ uniformly. The uniform limit of continuous functions is continuous, so $t \mapsto M_t(\omega)$ is continuous.
Since $M$ has continuous paths a.s. and $M \in \mathcal{M}^2$, we conclude $M \in \mathcal{M}^2_c$. Therefore $\mathcal{M}^2_c$ is closed in $\mathcal{M}^2$.
[guided]
Why is $\mathcal{M}^2_c$ closed? A closed subspace of a Hilbert space is itself a Hilbert space, so this will complete the proof that $\mathcal{M}^2_c$ is a Hilbert space.
Take a sequence $(M^n) \subset \mathcal{M}^2_c$ with $M^n \to M$ in $\mathcal{M}^2$. The completeness proof already showed that we can extract a subsequence converging uniformly in $t$, almost surely. On the full-probability event where this uniform convergence holds, each path $M^n(\omega, \cdot)$ is continuous (since $M^n \in \mathcal{M}^2_c$), and the limit path $M(\omega, \cdot)$ is the uniform limit of these continuous functions. A uniform limit of continuous functions is continuous -- this is a standard theorem from real analysis. Therefore $M$ has continuous paths a.s., giving $M \in \mathcal{M}^2_c$.
Note that this argument would fail if we only had pointwise (not uniform) convergence: a pointwise limit of continuous functions need not be continuous. The upgrade from $L^2$-convergence to uniform path convergence, powered by Doob's maximal inequality, is what makes the argument work.
[/guided]
[/step]