Conditional expectation and independence of residual Consider $L^2$ random variables $X$ and $Y$, and consider the projection view of conditional expectation $E[Y|X]$  as the best approximation of $Y$ among functions of $X$. That is, $\hat f (X) := E[Y|X]$ is
$$
\hat f(\cdot) = \arg \min_{g(\cdot)} E[Y - g(X)]^2 
$$
or letting $\widehat Y = \hat f(X)$,
$$
\widehat Y = \arg \min_{Z \in \mathcal L} E[Y - Z]^2 
$$
where $\mathcal L = \{g(X):\; \text{for some function $g$}\}$ is the linear space of $L^2$ measurable functions w.r.t. $X$. We have that $\xi := \widehat Y - Y$ is orthogonal to $\mathcal L$, that is $E[\xi g(X)] = 0$ for any $g$, including the constant functions, showing that $ E \xi=0$. Hence, we have that
$$
E[\xi g(X)] = E(\xi) E[g(X)]
$$
that is, $\xi$ is uncorrelated with $g(X)$ for any $g$. 
All of this is well-known. But now, what is the relation between $\xi$ and $X$, or in other words, what is their joint behavior? It seems to be something stronger than uncorrelatedness but short of independence. Had we had $E[f(\xi) g(X)] = E[f(\xi)] E[g(X)]$ for arbitrary $f$ and $g$, we would get independence. If we only have it for $f,g$ linear we get uncorrelatedness. Now, we have it for $f$ linear and $g$ arbitrary. 
Are there simple assumptions that bump this relation to independence?
EDIT: Let $\mathcal L$ defined above be $\mathcal L_X$, and define $\mathcal L_Y$ similarly. Maybe the answer is in projecting $\widehat Y$ back onto $\mathcal L_Y$, and repeating the process back and forth between $\mathcal L_X$ and $\mathcal L_Y$ and seeing what this process produces?
 A: Consider this simple example:
$X$ can take two values $\mathbb{P}(X=1)=\mathbb{P}(X=\frac13)= \frac12$ 
and $Y$ has an exponential distribution with parameter $X$: $Y\sim \text{Exp}(X)$.
Then 
$$
\mathbb{E}[Y|X]= \frac{1}{X}, \quad \xi=Y-\frac1X,
$$
and also
$$
\mathbb{E}[\xi X]=0.
$$
But clearly $\xi$ and $X$ are not independent:
$$
0= \mathbb{P}(\xi<-2, X=1) \neq \underbrace{\mathbb{P}(\xi<-2)}_{>0} \cdot \underbrace{\mathbb{P}(X=1)}_{=\frac12} >0.
$$
So in general you only get uncorrelated but not independent.
A: Note that when you're talking about $L^2$ here, they're different spaces. Say you have the probability space $L^2(\mathcal{A})$ and $\sigma$-algebre $\mathcal{B}\in\mathcal{A}$ will give sub Hilbert space $L^2(\mathcal{B})$. 
The $L^2$-projection $p_{X}$ in the conditional expectation is to project from $L^2(\mathcal{A})$ to $L^2(\sigma^{-1}(X))$ and the residual 'vector' $\xi = Y-p_{X}(Y)$ is a single vector which is orthogonal to the subspace $L^2(\sigma^{-1}(X))$. The independent property is much more stronger, which mean $L^2(\sigma^{-1}(\xi)) \perp L^2(\sigma^{-1}(X))$ that you cannot have here in general.
