How to prove the Lebesgue density theorem using martingales?

(Gerald Edgar has provided references to a generalisation of the Martingale Convergence Theorem from totally ordered filtrations to directed sets. The Lesbegue density property follows from a "Vitali property" of the filtration given by finite partitions of $[0,1]$. I'm just using the ordinary Martingale Convergence Theorem.)

There is a trick due to Morayne and Solecki: Morayne, Michał; Solecki, Sławomir, Martingale proof of the existence of Lebesgue points, Real Anal. Exch. 15(1989/90), No.1, 401-406 (1990). ZBL0701.26009. Available on JSTOR: https://www.jstor.org/stable/44152020

The fact that this paper exists suggests that it's not a completely obvious application. The idea is to use your martingale, then another Doob martingale defined similarly but with the filtration shifted right by $1/3=\sum_{k\geq 1}1/4^k$.

Assume $A\subseteq [1/3,1)$. Using your notation, define

$$\mathcal F'_n = \{[p+1/3,q+1/3)|[p,q)\in\mathcal F_n\}.$$

And define $F'_n(x)$ to be the cell in $\mathcal F'_n$ containing $x$. Note that $F'_n(x)$ is $F_n(x)$ shifted by one of the four numbers $\pm 2^{-n}(1/3), \pm 2^{-n}(2/3)$. This implies that either:

  • $x-2^{-n}/6$ and $x+2^{-n}/6$ are in $F_n(x)$, or
  • $x+2^{-n}/6$ falls outside $F_n(x)$, so $x-2^{-n}/6$ and $x+2^{-n}/6$ are in $F'_n(x)$, or
  • $x-2^{-n}/6$ falls outside $F_n(x)$, so again $x-2^{-n}/6$ and $x+2^{-n}/6$ are in $F'_n(x)$.

In any case $(x-2^{-n}/6, x+2^{-n}/6)$ is contained in $F_n(x)$ or $F'_n(x)$. For a.e. $x$ we know that both martingales converge to $1_A(x)$. If I've got the constants right, this means that for fixed $(x,\epsilon)$ we can pick $N$ such that for $n>N$ we have both $$\frac{P(A \cap F_n(x))}{P(F_n(x))} > 1-\epsilon/12 \textrm{ and } \frac{P(A \cap F'_n(x))}{P(F'_n(x))} > 1-\epsilon/12.$$ which implies $$\frac{|A \cap (x-h, x+h) |}{2h}\geq 1-\epsilon.$$ for $h<2^{-N}$.