I have the following task to do:
Let $(X_n)$ and $(Y_n)$ be two supermartingales on the probability space $(\Omega, \mathcal{A}, P)$ and $T$ be a stopping time regarding a filtration $(\mathcal{F}_n)$ and $X_T \leq Y_T$ on $\{T< \infty\}$.
Define $Z_n = Y_n$ on $\{n<T\}$ and $Z_n = X_n$ on $\{T \leq n\}$.
Proof that $(Z_n)$ is a supermartingale.
I tried to use $Z_n = Y_nI_{\{n<T\}} + X_nI_{\{T\leq n\}}$ and plug that into $\mathbb{E}[Z_n|\mathcal{F_{n-1}}]$ and use some properties of the conditional expectation, but I don't seem to get to $\leq Z_{n-1}$.
Any help is appreciated.
Note that $X_T \leq Y_T$ implies that
$$\begin{align*} X_n 1_{\{T \leq n\}} = X_n 1_{\{T \leq n-1\}} + X_T 1_{\{T=n\}} &\leq X_n 1_{\{T \leq n-1\}}+ Y_T 1_{\{T =n\}} \\ &= X_n 1_{\{T \leq n-1\}}+ Y_n 1_{\{T =n\}}. \end{align*}$$
Thus,
$$Z_n \leq Y_{n} 1_{\{T \leq n-1\}^c} + X_n 1_{\{T \leq n-1\}}.$$
Now use that $(Y_{n})_{n \in \mathbb{N}}$ and $(X_n)_{n \in \mathbb{N}}$ are supermartingales and the fact that $\{T \leq n-1\} \in \mathcal{F}_{n-1}$ to conclude that
$$\mathbb{E}(Z_n \mid \mathcal{F}_{n-1}) \leq Z_{n-1}.$$