# Martingale: why $\mathbb E[S_{n+1}\mid R_0,…,R_n]=\frac{1}{m-1}\sum_{i=1}^{m-1}\mathbb E[X_i\mid Z_m,X_{m+1},…,X_N]$

Let $(X_k)$ a sequence i.i.d. of random variables such that $\mathbb E[|X_1|]<\infty$ and let fix $N\in\mathbb N$. We set, \begin{cases}Z_n=X_1+...+X_n\\ Y_n=\frac{1}{n}Z_n\\ R_n=Z_{N-n}\\ S_n=Y_{N-n}\end{cases} with $n\in\{0,...,N-1\}$. Show that $(S_n)$ is a martingale refer to $(R_n)$.

I have to prove that $$\mathbb E[S_{n+1}\mid R_0,...,R_n]=S_n.$$ I have that $$\mathbb E[S_{n+1}\mid R_0,...,R_n]=\mathbb E[Y_{N-n}\mid Z_N,...,Z_{N-n}]=\frac{1}{N-n-1}\mathbb E[Z_{N-n-1}\mid Z_N,...,Z_{N-n}]\underset{m=N-n}{=}\frac{1}{m-1}\mathbb E[Z_{m-1}\mid Z_m,...,Z_N]=\frac{1}{m-1}\sum_{i=1}^{m-1}\mathbb E[X_i\mid Z_m,X_{m+1},...,X_N].$$

This is what I don't understand:

Why do we get $\mathbb E[X_i\mid Z_m,X_{m+1},...,X_N]$ ? to me we should get $\mathbb E[X_i\mid X_1,...,X_m,...,X_{N}]$ (because $Z_m$ depend of $X_1,...,X_m$ and all $Z_i$ depend of $(X_1,...,X_i)$).

Finally, like $(X_n)$ is a sequence of i.i.d. shouldn't we have that $$\mathbb E[X_i\mid X_1,...,X_m,...,X_{N}]=E[X_i]$$

and if we really have $$\mathbb E[X_i\mid Z_m,X_{m+1},...,X_{N}]$$ that $$\mathbb E[X_i\mid Z_m,X_{m+1},...,X_{N}]=\mathbb E[X_i\mid Z_m]\ \ ?$$

Why do we get $\mathbb E[X_i\mid Z_m,X_{m+1},...,X_N]$ ?
This is due to the fact that the $\sigma$-algebra generated by the random variables $Z_m,Z_{m +1},\dots,Z_N$ is the same as the $\sigma$-algebra generated by $Z_m,X_{m+1},\dots,X_N$. To see this, note that $(Z_m,X_{m+1},\dots,X_N)=L(Z_m,Z_{m +1},\dots,Z_N)$ where $L$ is a bijective bi-continuous function given by $(x_m,\dots,x_N)\mapsto (x_m,x_{m+1}-x_m,\dots,x_N-x_{N-1})$.
The next step is to show that for each $i\in\{1,\dots,m-1\}$, $$\mathbb E\left[X_i\mid Z_m,X_{m +1},\dots,X_N\right]=\frac 1mZ_m.$$