# A proof that $\sum_{i=0}^{p_n-1} f(Y_{t_i^n})(X_{t_{i+1}^n}-X_{t_i^n})^2$ converges a.s. to $\int_0^t f(Y_s)\mathrm{d}\langle X, X\rangle_s$

Let $$(\Omega, \mathcal F, \mathbb P)$$ be a probability space. Let $$X = (X_t, t\ge 0)$$ be a continuous square-integrable martingale and $$\langle X, X\rangle$$ its quadratic variation. Let $$Y = (Y_t, t\ge 0)$$ be a process with continuous trajectories. Let $$f:\mathbb R \to \mathbb R$$ be continuous. I'm trying to prove below result used in the proof of Itô's lemma, i.e,

Theorem For each $$t>0$$, there is an increasing sequence $$0=t_0^n<\cdots of subdivisions of $$[0, t]$$ whose mesh tends to $$0$$ and that $$\sum_{i=0}^{p_n-1} f (Y_{t_i^n}) (X_{t_{i+1}^n}-X_{t_i^n})^2 \quad \underset{n \rightarrow \infty}{\longrightarrow} \quad \int_0^t f (Y_s) \mathrm{d}\langle X, X\rangle_s \quad \text{almost surely}.$$

Could you have a check if my below attempt is fine?

Proof Clearly, there is an increasing sequence $$0=t_0^n<\cdots of subdivisions of $$[0, t]$$ whose mesh tends to $$0$$. We note that $$\sum_{i=0}^{p_n-1} f (Y_{t_i^n}) (X_{t_{i+1}^n}-X_{t_i^n})^2 = \int_{[0, t]} f(Y_s) \mathrm d \mu_n (s),$$ where $$\mu_n$$ is the random (discrete) measure on $$[0, t]$$ defined by $$\mu_n := \sum_{i=0}^{p_n-1} (X_{t_{i+1}^n}-X_{t_i^n})^2 \delta_{t_i^n}.$$

Let $$D$$ be the set that consists of all $$t_i^n$$ for $$n \geq 1$$ and $$0 \leq i \leq p_n$$. Then $$D$$ is dense in $$[0, t]$$.

Lemma For every sequence $$0=t_0^n<\cdots of sub-divisions of $$[0, t]$$ whose mesh tends to $$0$$, we have $$\sum_{i=0}^{p_n-1} (X_{t_{i+1}^n} - X_{t_i^n})^2 \underset{n \rightarrow \infty}{\longrightarrow} \langle X, X \rangle_t \quad \text{in probability}.$$

By above Lemma, we get for every $$r \in D$$, $$\mu_n([0, r]) \quad \underset{n \rightarrow \infty}{\longrightarrow} \quad \langle X, X\rangle_r \quad \text{in probability}.$$

So there is a subsequence of values of $$n$$ such that, along this subsequence, we have for every $$r \in D$$, $$\mu_n([0, r]) \quad \underset{n \rightarrow \infty}{\longrightarrow} \quad \langle X, X\rangle_r \quad \text{almost surely}.$$

This implies that the sequence $$(\mu_n, n \in \mathbb N)$$ of random measures converges almost surely to a random measure $$\mu$$ (whose random c.d.f. is $$\langle X, X\rangle_r \mathbf{1}_{[0, t]}(r)$$) in the sense that $$\mu_n (\omega) \quad \underset{n \rightarrow \infty}{\longrightarrow}\quad\mu(\omega) \quad \text{in distribution}$$ for $$\mathbb P$$-a.e. $$\omega \in \Omega$$. On the other hand, convergence in distribution is equivalent to weak convergence. Hence $$\int_0^t f(Y_s ) \mathrm d \mu_n (s) \quad \underset{n \rightarrow \infty}{\longrightarrow} \quad \int_0^t f(Y_s) \mathrm d \mu(s) = \int_0^t f(Y_s) \mathrm{d} \langle X, X\rangle_s \quad \text{almost surely}.$$

This completes the proof.