Showing expectation of a finite sum of a sequence of random variables, squared I am working with Loeve's "On Almost Sure Convergence", specifically on the extension of Kolmogorov's inequality in Lemma 5.1.
As part of the proof, with the assumption $E(X_n|X_{n-1},...,X_0) \equiv 0$, Loeve asserts that:
$E((\sum_{i=0}^n X_i)^2;B_j) = E((\sum_{i=0}^j X_i)^2;B_j) + E((\sum_{i=j+1}^n X_i)^2; B_j)$
$B_j$ here is the set of events wherein the value of $(\sum_{i=0}^j X_i)^2 \geq \epsilon$ for some positive $\epsilon$, and there is no lower value of $j$ where this is true. ($B_i$ and $B_j$ are disjoint if $i \neq j$.)
I am trying to figure out why this works.
I can see that $(\sum_{i=0}^n X_i)^2 = (\sum_{i=0}^j X_i)^2 + (\sum_{i=j+1}^n X_i)^2 - 2 ((\sum_{i=0}^j X_i)(\sum_{i=j+1}^n X_i))$, but cannot see how to make the final term disappear.
Can I simply treat $X_i$ as being $0$ for $i>j$, given the conditional expectation in the assumption? If so, why does that not apply to the $(\sum_{i=0}^n X_i)^2$ term?
 A: For each $j\ge 0$, note the event $B_j\in\mathcal F_j = \sigma(X_0,\dots, X_j)$. Assuming the condition ($\ast$) $E[X_n\mid\mathcal F_{n-1}]=0$ holds for every $n$, we have
\begin{align*}
E[(\sum_{i=0}^n X_i)^2;B_j] = E[(\sum_{i=0}^jX_i)^2;B_j] + E[(\sum_{i=j+1}^nX_i)^2;B_j] +2E[(\sum_{i=0}^jX_i)(\sum_{i=j+1}^nX_i);B_j],
\end{align*}
as you noted in the OP. Now apply the Tower Law of conditional expectation to the cross-term:
\begin{align*}
E[(\sum_0^jX_i)(\sum_{j+1}^n X_i)1_{B_j}] &= E\big[E[(\sum_0^jX_i)(\sum_{j+1}^nX_i)1_{B_j}\mid\mathcal F_j]\big]\\
&= E\big[(\sum_0^jX_i)1_{B_j}\cdot \underbrace{E[(\sum_{j+1}^nX_i)\mid\mathcal F_j]}_{=\ 0,\ \text{by}\ (\ast)}\big] = 0.
\end{align*}
The first equality is the Tower Law, and the second equality holds because $(\sum_0^jX_i)1_{B_j}\in\mathcal F_j$.

The Tower Law we are using here is as follows. For any r.v. $X\in L^1$, and any $\sigma$-algebra $\mathcal F$, $E[X] = E[E[X\mid\mathcal F]]$. Another property we used above is if $Y\in \mathcal F$ is another integrable r.v. such that $XY\in L^1$, then $E[XY\mid\mathcal F] = YE[X\mid\mathcal F]$. These are both fundamental properties of conditional expectation.
