Let $(\Omega,\mathcal{A},P)$ be a probability space.
Let $\Bbb F=(\mathcal{F}_n)_n$ be a filtration wrt this space and $(Z_n)_n$ an $\Bbb F$-martingale.
Now, basic properties of the conditional expectation tell us that $$ X\in\mathcal{L}^1(\Omega,\mathcal{A},P)\Rightarrow E[E[X|\mathcal{F_n}]]=E[X] $$ right?
Why doesn't this work for $X=(Z_{n+1}-Z_n)^2$?
I wrote $$ E[E[(Z_{n+1}-Z_n)^2|\mathcal{F_n}]]=E[(Z_{n+1}-Z_n)^2]\;\;\;\;\;\;\;\;(*) $$ but when I checked I saw it's not correct and I can't see where the mistake is.
LHS is \begin{align*} E[E[Z_{n+1}^2-2Z_nZ_{n+1}+Z_n^2|\mathcal{F_n}]] &=E\{E[Z_{n+1}^2|\mathcal{F_n}]-2E[Z_nZ_{n+1}|\mathcal{F_n}]+ E[Z_n^2|\mathcal{F_n}]\}\\ &=E\{E[Z_{n+1}^2|\mathcal{F_n}]-2Z_nE[Z_{n+1}|\mathcal{F_n}]+ Z_n^2\}\\ &=E\{E[Z_{n+1}^2|\mathcal{F_n}]-2Z_n^2+ Z_n^2\}\\ &=E\{E[Z_{n+1}^2|\mathcal{F_n}]-Z_n^2\}\\ &=E\{E[Z_{n+1}^2|\mathcal{F_n}]\}-E[Z_n^2]\\ &=E[Z_{n+1}^2]-E[Z_n^2]\\ \end{align*}
which is different from RHS (in fact it's $E[Z_{n+1}^2]-2E[Z_{n+1}Z_n]+E[Z_n^2]$). Unless we have $$ E[Z_{n+1}^2]-E[Z_n^2]= E[Z_{n+1}^2]-2E[Z_{n+1}Z_n]+E[Z_n^2] $$ that is $$ E[Z_n^2]= E[Z_{n+1}Z_n] $$ and I can't see why it should be true. Can someone help me please? Thanks a lot!
EDIT: all right! I think I understood: the last one must be true precisely because the rule for the conditional expectation I wrote at the beginning is true. It's a consequence. My problem was that I wanted to see the equality directly. I bump into this problem checking another equality (I didn't wrote it here), and when I came to LHS of (*), first I wrote it as RHS, but precisely because I didn't know how to handle $ E[Z_{n+1}Z_n]$ I got stuck. Then I come back to LHS, I developed it as I wrote above and the equality from which all began (the one I didn't wrote) got fixed.
But the doubt remained: why did in the second way it worked and in the first one not? Hence I wrote this post and I understood where the problem was.
Many thanks guys!
There is no mistake. Assuming $Z$ is integrable enough (sufficient: $E[Z_n^2]<\infty$ for each $n$), then as you just showed $E[(Z_{n+1}-Z_n)^2] = E[Z_{n+1}^2] - Z[Z_n^2]$, an extremely useful fact about martingales.
See, e.g. David Williams: Probability with Martingales, section 12.1 for discussion.
To answer your second question,
$$ E[Z_{n+1}Z_n] = E[E[Z_{n+1} Z_n | \mathcal{F}_n]] = E[E[Z_{n+1}|\mathcal{F}_n]Z_n] = E[Z_nZ_n] = E[Z_n^2] $$ where the properties used are (in order): iterated conditioning, taking out what is known, $Z$ is a martingale, arithmetic.