Solution (source code)

= Solution

The pair $(M_n,\mathcal F_n)_{n\geq0}$ is a <martingale> when $(\mathcal F_n)$ is a <filtration>, each $M_n$ is $\mathcal F_n$-measurable and integrable, and
$$
\boxed{\ \mathbb E[M_{n+1}\mid\mathcal F_n]=M_n
\quad\text{almost surely for every }n.\ }
$$