Doob decomposition of $|S_n|$ where $S_n$ is simple random walk. Let $X_n$, $n\geqslant 1$ be iid Rademacher random variables, i.e. $X_1$ takes values $\pm 1$ each with probability $\frac12$. Define $S_0=0$ and $S_n=\sum_{i=0}^n X_i$, and $\mathcal F_n = \sigma(S_0, \ldots, S_n)$. Then it is straightforward to show that $|S_n|$ is a submartingale with respect to $\{F_n\}$, so it has a (unique) Doob decomposition
$$|S_n| = M_n + A_n, $$
where $M_n$ is a martingale and $A_n$ is a nondecreasing predictable process. Explicitly,
\begin{align}
A_n &= \sum_{k=1}^n \mathbb E\left[|S_k|-|S_{k-1}| \mid \mathcal F_{k-1}\right]\\
M_n &= |S_n| - A_n.
\end{align}
I'm trying to find a simpler expression for $M_n$, of the form $M_n = (H\cdot S)_n$ where $H$ is a predictable process and $\cdot$ denotes martingale transform, but I got bogged down in the algebra. Any hints, either as to how to approach this or what $H$ might look like?
 A: We have to consider three cases separately:


*

*$S_{k-1}(\omega)<0$: Then $S_k(\omega) \leq 0$ and therefore $$|S_k(\omega)|-|S_{k-1}(\omega)| = -S_k(\omega)+ S_{k-1}(\omega) = - X_k(\omega).$$

*$S_{k-1}(\omega)=0$: Then $|S_k(\omega)|=1$ and therefore $$|S_k(\omega)|-|S_{k-1}(\omega)|=1.$$

*$S_{k-1}(\omega)>0$: Then $S_k(\omega) \geq 0$ and therefore $$|S_k(\omega)| - |S_{k-1}(\omega)| = S_k(\omega)-S_{k-1}(\omega) =X_k(\omega).$$


This shows
$$|S_k|-|S_{k-1}| = -X_k 1_{\{S_{k-1} <0\}}+ 1_{\{S_{k-1}=0\}}+ X_k 1_{\{S_{k-1}>0\}}. \tag{1}$$
Using this identity and the independence of the random variables, we get
$$\mathbb{E}(|S_k|-|S_{k-1}| \mid \mathcal{F}_{k-1}) = 1_{\{S_{k-1}=0\}}.$$
Consequently,
$$M_n = |S_n| - \sum_{k=1}^n 1_{\{S_{k-1}=0\}} = \sum_{k=1}^n (|S_k|-|S_{k-1}|-1_{\{S_{k-1}=0\}}).$$
By $(1)$, this implies
\begin{align}
M_n &= \sum_{k=1}^n (-X_k 1_{\{S_{k-1}<0\}}+X_k 1_{\{S_{k-1}>0\}})\\
&= \sum_{k=1}^n (- 1_{\{S_{k-1}<0\}}+ 1_{\{S_{k-1}>0\}})X_k\\
&= \sum_{k=1}^n (- 1_{\{S_{k-1}<0\}}+ 1_{\{S_{k-1}>0\}})(S_k-S_{k-1})\\
\\ &= (H \bullet S)_n\end{align}
for
$$H_k := - 1_{\{S_{k-1}<0\}}+ 1_{\{S_{k-1}>0\}}.$$
