[step:Derive the stopped parabolic formula by smoothing the time variable]
Let $X^m_s:\Omega\to\mathbb R^2$ denote the stopped time-space semimartingale
\begin{align*}
X^m_s(\omega)=(s\wedge\tau_m(\omega),W_{s\wedge\tau_m(\omega)}(\omega)).
\end{align*}
The first coordinate $s\mapsto s\wedge\tau_m$ has finite variation, so
\begin{align*}
[s\wedge\tau_m,s\wedge\tau_m]_t=0,
\qquad
[s\wedge\tau_m,W^m]_t=0.
\end{align*}
The second coordinate has quadratic variation
\begin{align*}
[W^m,W^m]_t=t\wedge\tau_m,
\end{align*}
because [Quadratic Variation of Brownian Motion](/theorems/3543) gives $[W,W]_t=t$ and stopping preserves quadratic variation up to the stopped time.
We first prove the formula for a function $g:\mathbb R^2\to\mathbb R$ of class $C^2$ whose first and second derivatives are bounded on a neighbourhood of $K_m$. Applying [Itô's Formula](/theorems/2099) to $g$ and $X^m$ is legitimate because $X^m$ is a continuous $\mathbb R^2$-valued semimartingale and $g\in C^2(\mathbb R^2)$. The finite-variation coordinate contributes
\begin{align*}
\int_0^{t\wedge\tau_m}\partial_t g(s,W_s)\,d\mathcal L^1(s),
\end{align*}
the Brownian coordinate contributes
\begin{align*}
\int_0^{t\wedge\tau_m}\partial_x g(s,W_s)\,dW_s,
\end{align*}
and the only non-zero quadratic-variation correction is
\begin{align*}
\frac12\int_0^{t\wedge\tau_m}\partial_{xx}g(s,W_s)\,d\mathcal L^1(s).
\end{align*}
Thus, almost surely for all $t\in[0,T]$,
\begin{align*}
g(t\wedge\tau_m,W_{t\wedge\tau_m})
=g(0,W_0)
&+\int_0^{t\wedge\tau_m}\partial_t g(s,W_s)\,d\mathcal L^1(s)
+\int_0^{t\wedge\tau_m}\partial_x g(s,W_s)\,dW_s\\
&+\frac12\int_0^{t\wedge\tau_m}\partial_{xx}g(s,W_s)\,d\mathcal L^1(s).
\end{align*}
It remains to pass from $C^2$ regularity in both variables to $C^{1,2}$ regularity. Since $f\in C^{1,2}$, after extending $f$ to an open neighbourhood of $K_m$ and convolving with a smooth mollifier, there exist functions $f_\varepsilon\in C^2(\mathbb R^2)$ such that
\begin{align*}
f_\varepsilon\to f,\qquad
\partial_t f_\varepsilon\to\partial_t f,\qquad
\partial_x f_\varepsilon\to\partial_x f,\qquad
\partial_{xx} f_\varepsilon\to\partial_{xx} f
\end{align*}
uniformly on $K_m$ as $\varepsilon\to0$. Applying the previous identity to $f_\varepsilon$, the endpoint and finite-variation terms converge uniformly by the displayed [uniform convergence](/page/Uniform%20Convergence). For the stochastic integral, Itô's isometry gives
\begin{align*}
\mathbb E\left[
\left|
\int_0^{t\wedge\tau_m}
\bigl(\partial_x f_\varepsilon(s,W_s)-\partial_x f(s,W_s)\bigr)\,dW_s
\right|^2
\right]
\le T\sup_{K_m}|\partial_x f_\varepsilon-\partial_x f|^2\to0.
\end{align*}
Therefore the stopped identity holds for $f$ for each fixed $t\in[0,T]$. Applying this argument on the [countable set](/page/Countable%20Set) $\mathbb Q\cap[0,T]$ and using the continuity of all four processes in $t$ gives a single event of probability one on which, for every $t\in[0,T]$,
\begin{align*}
f(t\wedge\tau_m,W_{t\wedge\tau_m})
=f(0,W_0)
&+\int_0^{t\wedge\tau_m}\partial_t f(s,W_s)\,d\mathcal L^1(s)
+\int_0^{t\wedge\tau_m}\partial_x f(s,W_s)\,dW_s\\
&+\frac12\int_0^{t\wedge\tau_m}\partial_{xx}f(s,W_s)\,d\mathcal L^1(s).
\end{align*}
[/step]