Doob's decomposition of a submartingale I am trying to compute, given the following recursive stocastic process (which I proved to be a submartingale wrt the filtration $\mathcal{F}_n = \sigma(Y_1,\ldots,Y_n)$) :
$$X_0=0, X_{n+1}=|X_n+Y_{n+1}|$$ 
where $Y_n$ are iid r.v. s.t. $P(Y_n=1)=P(Y_n=-1)=1/2$
the terms of its Doob's decomposition.
I tried to compute the predictible (increasing) process $Z_n$ in the following way:
$$Z_{n+1} = Z_n + E(X_{n+1} \mid \mathcal{F}_n) - X_n $$ 
I found out that $$E(X_{n+1} \mid \mathcal{F}_n)=E(|X_n+Y_{n+1}| \mid \mathcal{F}_n) =\frac{| X_n+1|}{2}+\frac{|X_n-1|}{2}$$
And, according to this and from the assumption that $Z_0=0$ I found that 
$$Z_1 = E(X_1|\mathcal{F}_0) = E(|X_0|)= 1 a.s.$$
And also that 
$$\begin{align*} Z_2 &= 1 + E(X_2 \mid \mathcal{F}_1)- X_1 \\ &= 1 + E(|X_1 + Y_0| \mid \mathcal{F}_1) - X_1\\ &= 1+ \frac{|X_1+1|+|X_1-1|}{2} - X_1 \\&= 1+ \frac{||X_0+Y_1|+1|+||X_0+Y_1|-1|}{2} - |X_0+Y_1| \\ &= 1+ \frac{||Y_1|+1|+||Y_1|-1|}{2} - |Y_1| = 1+1-1 = 1 \end{align*}$$
almost surely. But I am not sure of this passage and I did not manage to compute any other $Z_i$ to generalize the result, as I get stuck in computations of the type: $$1+1/2\cdot (|1+|X_1+Y_2||+|-1+|X_1+Y_2||) - |X_1+Y_2|$$ and even getting to the very first value of $X$ I get things I do not know how to simplify. 
I also tried to give a closed form for $X$ but I get something of the shape:
$$ X_5 = |||1+X_2|+X_3|+X_4| $$ and found out that, for instance $X_1 = 1$ a.s. and $M_2 = 0$ wp $1/2, 2$ wp $1/2$ but I didn't find a pattern to exploit.
Any hint will be appreciated!
 A: The (standard) proof of the Doob decomposition shows a way to compute the Doob decomposition.

Theorem (Doob decomposition): Let $(X_n,\mathcal{F}_n)_{n \in \mathbb{N}}$ be a submartingale. Then the Doob decomposition of $X_n$ is given by $$X_n = X_0+M_n+A_n \tag{1}$$ where $$A_n := \sum_{k=1}^n \mathbb{E}(X_k-X_{k-1} \mid \mathcal{F}_{k-1})$$ is an increasing predictable process and $$M_n := X_n-X_0-A_n$$ is a martingale.

This means that we have to study the differences $X_k-X_{k-1}$ in order to compute the process $(A_n)_{n \in \mathbb{N}}$, and then we will get automatically the Doob decomposition. To this end, we consider two cases separately:


*

*$X_{k-1}(\omega)=0$: Then $X_{k}(\omega)= |Y_{k}(\omega)|=1$ and so $$X_k(\omega)-X_{k-1}(\omega)=1.$$

*$X_{k-1}(\omega)>0$: As $|Y_k(\omega)|=1$ this implies $X_{k-1}(\omega)+Y_k(\omega) \geq 0$ and so $$X_k(\omega)-X_{k-1}(\omega) = (X_{k-1}(\omega)+Y_k(\omega)) -X_{k-1}(\omega) = Y_k(\omega).$$
Thus,
$$X_k(\omega) -X_{k-1}(\omega) = 1_{\{X_{k-1}=0\}}(\omega) + Y_k(\omega) 1_{\{X_{k-1} >0\}}(\omega) \tag{2}$$
for all $\omega \in \Omega$. Taking the conditional expectation we get
$$\mathbb{E}(X_k-X_{k-1} \mid \mathcal{F}_{k-1}) = 1_{\{X_{k-1}=0\}} + 1_{\{X_{k-1}>0\}} \underbrace{\mathbb{E}(Y_k \mid \mathcal{F}_{k-1})}_{=\mathbb{E}(Y_k)=0} = 1_{\{X_{k-1}=0\}}.$$
Hence,
$$A_n = \sum_{k=1}^n 1_{\{X_{k-1}=0\}}= \sharp\{0 \leq k \leq n-1; X_k=0\}$$
is the predictable increasing process in the Doob decomposition $(1)$ and
$$M_n = X_n-A_n= X_n-  \sum_{k=1}^n 1_{\{X_{k-1}=0\}} $$
is the martingale part.
