Let $X_1,X_2,...$ be iid $\sim$ Exp(1)
$M_n =\frac{n!}{(1+S_n)^{n+1}}e^{S_n}$ is a martingale with respect to the natural filtration $\mathcal F_n=\sigma(X_1,...,X_n)$
$S_n \sim$ Gamma$(n,1)$ and the pdf is $f_{X_n}(x)=\frac1 {(n-1)!}x^{n-1}e^{-x}1_{[0,\infty)}$
I have already proven that it is adapted and the expectation is finite. But I don't know how to proceed with the martingale property:
$$E[M_{n+1}|\mathcal F_n]= E[\frac{(n+1)!}{(1+S_{n+1})^{n+2}}e^{S_{n+1}}|\mathcal F_n]$$ $$=(n+1)!e^{S_n}E[\frac{1}{{(1+S_n+X_{n+1}})^{n+2}}e^{X_{n+1}}|\mathcal F_n]=?$$
I don't think I can use the pdf with that $\mathcal F_n$ on the way. The only conditional expectation that I have seen how to compute explicitly are those of the form $E[X|\sigma(Y)]=E[X|Y]$ in which case I need the conditional pdf: $f_{X|Y=y}(x)$, to find $h(y)=E[X|Y=y]$ and then $E[X|Y]=h(Y)$. But in this more abstract case how should I proceed?
My lecturer did this:
$$\mathbb{E} [ \frac{1}{(1+S_n+X_{n+1})^{n+2}} e^{X_{n+1}} |\mathcal{F}_n ] = f(S_n) $$
with
$$f(s) := \mathbb{E} [ \frac{1}{(1+s+X_{n+1})^{n+2}} e^{X_{n+1}} ], \qquad s \geq 0$$
arguing that the $(X_k), k \in \mathbb{N}$ are independent, so $X_{n+1}$ is independent from $\mathcal{F}_n$ and $S_n$ is $\mathcal{F}_n$-measurable
But I am not convinced of this. If I compute $f(s)$ I think $f(S_n)$ would be just : $$ f(S_n)=\mathbb{E} [ \frac{1}{(1+S_n+X_{n+1})^{n+2}} e^{X_{n+1}} ] $$
so no conditioning which is not the original expression.
I know that I can get rid of the conditioning when there is independence and that measurable function with respect to the conditioning sigma algebra can be taken out of the expectation, but in this case why is it true? Can you provide additional examples of this trick?