Prove that the following sequence is a binary splittting A binary splitting is a sequence of random variables  $(X_n )$ such that for each $n \ge 1$ there exists a Borel measurable random variable $f_n: \ \mathbb {R } ^{n-1 } \times \{-1, 1 \}  \to \mathbb R$, and a $\{-1 , 1 \} $- valued random variable $D_n $ such that 
$$X_n = f(X_1, \dots , X_{n-1 } , D_n )$$

I want to prove that given a random variable $X$, the sequence $(X_n)$ of random variables defined by 
$$D_1 = \begin{cases}
    1, & \text {if } X \ge E[X] \\
    -1 & \text {otherwise } 
    \end{cases}
$$
$\mathcal{F}_1 = \sigma(D_1) $,  $X_1 = E[X| \mathcal{F}_1 ] $. And for $n \ge 2 $,
$$
D_n = \begin{cases}
    1, & \text {if }  X \ge X_{n-1 } \\ 
    -1, & \text {otherwise}
        \end {cases}$$
$\mathcal{F}_n = \sigma(D_1, \dots , D_n ) $  and $X_n = E[X| \mathcal{F}_n ]$
Is a binary splitting.

My first fist question would be: Is the definition of a binary splitting equivalent to: for each $n$ there exits a $\{-1, 1 \} $-valued random variable $D_n $ such that $X_n $ is $\sigma(X_1, \dots , X_{n-1 } , D_n )$ measurable?
I have seen a proof that $(X_n )$ is a binary splitting, but a couple of things remains impenetrable for me. The proof proceeds as follows: 
Since $X_n := E[X|\sigma(D_1, \dots , D_n)]$ it is the case that $X_n$ is $\sigma(D_1, \dots , D_n)$-measurable and thus may be written as $X_n = g_n(D_1, \dots, D_n)$ for some $g_n : \ \{-1,1 \} ^n \to \mathbb{R}$.
We now prove that for each $n $: $D_n $ is a function of $X_1, \dots X_n$. This is done by induction. 
For $n=1 $ the function $h_1$ such that  $D_1 = h_1(X_1)$ may be defined explicitly as the map that sends the value of $X_1 $ on $\{D_1 = 1 \} $ to $1$, and ditto on $\{D_1 =-1 \} $ to -1.
For the case $n>1$, assume that for $ k \le n-1 $ it is the case that there exists a functions $h_{k } $ such that $D_k = h_k(X_1 , \dots , X_k)$. 
Since $X_n := E[X|\mathcal{F}_n ]$ and $\mathcal{F}_n$ is generated by finite unions of sets $\{D_k = i_k$ for $i_k \in \{-1, 1 \} $ and $1 \le k \le n$, we may write
$$X_n = \sum_{i_1, \dots , i_n \in \{-1, 1 \}} c_{i_1, \dots , i_n } 1_{\{D_i = i_1, \dots , D_n = i_n \} }  $$ 
We may then define a function $\xi_1$ that maps 
$$\{D_i = i_1, \dots , D_{n-1 }  = i_{n-1 }  \}$$
to  $c_{i_1, \dots , i_n }$ for every $ c_{i_1, \dots , i_n }$ with $i_n = 1$. And similarly define a function $\xi_2$ for $\{D_n = -1 \} $.
Thus we may write 
$$X_n = \xi_1 1_{\{D_n = 1 \} } + \xi_2 1_{\{D_n = -1 \} } $$
If we inductively assume that $D_1, \dots D_{n-1 } $ are functions of $X_1, \dots , X_{n-1 } $ then this last expression gives us
$$X_n = f^{(1)} _{n-1 } (X_1, \dots, X_{n-1 } )1_{\{D_n = 1 \} } + f^{(2)} _{n-1 } (X_1, \dots, X_{n-1 } )1_{\{D_n = -1 \} }$$
for some $f^{(1)} _{n-1 }, \, f^{(2)} _{n-1 } \, ,\{-1, 1 \} \to \mathbb R $.
The two things that remains unclear to me is: 

Does the last equation above imply that $D_n $ is a function of $X_1, \dots , X_n$?
How do we go from knowing that each $n $, $D_n $ is a function of $X_1, \dots X_n$ to that $X_n = f_n(X_1, \dots , X_{n-1 } , D_n)$?

Most grateful for any help provided!
 A: The last equation implies
$$ D_n = \begin{cases}
1 & \text{if } X_n = f^{(1)}_{n-1}(X_1,\ldots,X_{n-1}), \\
-1 & \text{if } X_n = f^{(2)}_{n-1}(X_1,\ldots,X_{n-1}).
\end{cases}$$
Clearly, the only potential issue is if $f^{(1)}_{n-1}(X_1,\ldots,X_{n-1}) = f^{(2)}_{n-1}(X_1,\ldots,X_{n-1})$. Let us show that cannot be the case. Since $\{D_n=1\} = \{X \ge X_{n-1}\}$, one has
$$ X_n1_{\{D_n=1\}} = E[X1_{\{D_n=1\}}|\mathcal F_n] \ge X_{n-1}1_{\{D_n=1\}},$$
and similarly $X_n1_{\{D_n=-1\}} \le X_{n-1}1_{\{D_n=-1\}}$; in this latter case, the inequality is strict on $\{D_n=-1\}$. It follows that
$$f^{(1)}_{n-1} (X_1,\ldots,X_{n-1}) > f^{(2)}_{n-1} (X_1,\ldots,X_{n-1})$$
with probability one. Thus, one can indeed write $D_n$ as a Borel measurable function of $X_1,\ldots,X_n$. Let us call that function $h_n$. Then
$$ X_n = g_n(D_1,D_2,\ldots,D_{n-1},D_n) = g_n\Big( h_1(X_1), h_2(X_1,X_2),\ldots,h_{n-1}(X_1,\ldots,X_{n-1}),D_n\Big),$$
which is obviously a Borel measurable function of $X_1,\ldots,X_{n-1},D_n$.
A: (1) Yes. Clearly if $X_n = f(X_1,\dots,X_{n-1},D_n)$, then $X_n$ is $\sigma(X_1,\dots,X_{n-1},D_n)$-measurable. So suppose $X_n$ is $\sigma(X_1,\dots,X_{n-1},D_n)$-measurable but that, for some $\omega,\omega' \in \Omega$, $(X_1(\omega),\dots,D_n(\omega)) = (X_1(\omega'),\dots,D_n(\omega'))$ but $X_n(\omega) \not = X_n(\omega')$ (if there are no such $\omega,\omega'$, then defining $f(x_1,\dots,x_{n-1},d_n)$ to be $0$ when there is no $\omega$ with $X_1(\omega)=x_1,\dots,X_{n-1}(\omega)=x_n,D_n(\omega) = d_n$ and to be $X_n(\omega)$ otherwise, we see $f(X_1,\dots,X_{n-1},D_n) = X_n$ and thus $f$ is Borel, since $f^{-1}(U) = X_1^{-1}(U)\cap \dots \cap X_{n-1}^{-1}(U)\cap D_n^{-1}(U)\cap X_n^{-1}(U)$). Let $a = X_n(\omega), b = X_n(\omega')$. Then $X_n^{-1}(a) \not \in \sigma(X_1,\dots,X_{n-1},D_n)$, since $\omega \in X_n^{-1}(a)$ but $\omega' \not \in X_n^{-1}(a)$, and any set in $\sigma(X_1,\dots,X_{n-1},D_n)$ containing $\omega$ also contains $\omega'$ since $X_1,\dots,D_n$ agree on $\omega$ and $\omega'$.
I don't see why $D_1$ is a function of $X_1$, so I can't help further. 
