Show that $(S_t - M_t) \phi(S_t) = \Phi(S_t) - \int_{0}^{t} \phi(S_s) dM_s$
(This is from Le Gall's book, Brownian Motion, Martingales, and Stochastic Calculus.)
Here, $M$ is a continuous local martingale, $S_t = \sup_{0 \leq s \leq t} M_s$, $\phi$ is a twice continuously differentiable function, and $\Phi(x) = \int_0^x \phi(t)dt$.
In previous parts of this question, I showed that, for a continuous function $m$ and $s(t) = \sup_{0 \leq s \leq t} m(s)$, and for every bounded Borel function $h$, the Riemann-Stieltjes integral
$$\int_0^t (s(r) - m(r)) h(r) ds(r) = 0$$
I also showed (I think)
$$\phi(S_t) = \phi(S_0) + \int_0^t \phi'(S_s)dS_s$$
Unfortunately I can't identify how either of these facts would help with this questions so I've pursued a different course.
My idea is to argue that $(\phi(S) \cdot M)_t$ (where $(H \cdot M)_t = \int_0^t H(s) dM_s$ is a stochastic integral) satisfies
$$\langle \phi(S) \cdot M, N\rangle_t = (\phi(S))_t \cdot \langle M, N \rangle_t$$ $\forall N$ ($N$ is a cont. local m'gale) and that $\left(\Phi(S) - (S - M) \phi(S)\right)_t$ also satisfies this, so by uniqueless, $(\phi(S) \cdot M)_t = \left(\Phi(S) - (S - M) \phi(S)\right)_t$. ($\langle M, N\rangle_t$ is the quadratic variation between the cont. local martingales $M$ and $N$ and $H \cdot \langle M, N \rangle = \int_0^t H(s) d\langle M, N \rangle_s$ is a Riemann-Stieltjes integral.)
The work is in showing that $\left(\Phi(S) - (S - M) \phi(S)\right)_t$ satisfies this relation. Since for a sequence of partitions with mesh tending to zero we have
$$\lim_{n \to \infty} \sum_{i = 0}^{p_n - 1} (M_{t_{i + 1}^n} - M_{t_i^n})(N_{t_{i + 1}^n} - N_{t_i^n}) = \langle M, N \rangle_t$$
I thought I would try to compute this directly. Applying a mean-value theorem we have that:
$$\Phi(S_{t_{i + 1}^n}) - \Phi(S_{t_i^n}) = \phi(S_{t_i^n} + c_i^n S_{t_{i + 1}^n})(S_{t_{i + 1}^n} - S_{t_i^n})$$
($c_i^n \in [0,1]$.)
I write
$$\Phi(S_{t_{i + 1}^n}) - \Phi(S_{t_i^n}) - (\phi(S_{t_{i + 1}^n})S_{t_{i + 1}^n} - \phi(S_{t_{i}^n})S_{t_{i}^n}) + \phi(S_{t_{i + 1}^n}) M_{t_{i + 1}^n} - \phi(S_{t_{i}^n})M_{t_i^n}$$
This will be multiplied with $N_{t_{i + 1}^n} - N_{t_i^n}$ in the sum whose limit is the quadratic variation between the two processes. I notice that
$$\Phi(S_{t_{i + 1}^n}) - \Phi(S_{t_i^n}) - (\phi(S_{t_{i + 1}^n})S_{t_{i + 1}^n} - \phi(S_{t_{i}^n})S_{t_{i}^n}) = \phi(S_{t_i^n} + c_i^n S_{t_{i + 1}^n})(S_{t_{i + 1}^n} - S_{t_i^n}) - (\phi(S_{t_{i + 1}^n})S_{t_{i + 1}^n} - \phi(S_{t_{i}^n})S_{t_{i}^n}) \approx 0$$
This should hold for all $i$ for large $n$ since the mesh of the partition tends to zero. Thus a rewrite simplifies an earlier expression to
$$\phi(S_{t_{i + 1}^n}) M_{t_{i + 1}^n} - \phi(S_{t_{i}^n})M_{t_i^n} \approx \phi(S_{t_i^n}) (M_{t_{i + 1}^n} - M_{t_i^n})$$
So now I consider
$$\lim_{n \to \infty} \sum_{i = 0}^{p_n - 1} \phi(S_{t_i^n}) (M_{t_{i + 1}^n} - M_{t_i^n}) (N_{t_{i + 1}^n} - N_{t_i^n})$$
If I can believe that $(M_{t_{i + 1}^n} - M_{t_i^n}) (N_{t_{i + 1}^n} - N_{t_i^n}) \approx \langle M, N \rangle_{t_{i + 1}^n} - \langle M, N \rangle_{t_i^n}$, then I would have the above some being approximately
$$\lim_{n \to \infty} \sum_{i = 0}^{p_n - 1} \phi(S_{t_i^n}) (\langle M, N \rangle_{t_{i + 1}^n} - \langle M, N \rangle_{t_i^n}) = \int_0^t \phi(S_s) d\langle M, N \rangle_s = (\phi(S))_t \cdot \langle M, N \rangle_t$$
Then I would have established what I want.
For one thing, I use $\approx$ a lot and that's not how one writes a rigorous proof (at least not without a proper definition), and I don't even know if $(M_{t_{i + 1}^n} - M_{t_i^n}) (N_{t_{i + 1}^n} - N_{t_i^n}) \approx \langle M, N \rangle_{t_{i + 1}^n} - \langle M, N \rangle_{t_i^n}$. This also seems way hard, harder than it should be. So, am I doing the right thing? How can I make my argument rigorous, or is there an easier way?