Decomposing $Y=U_1+U_2$ so that $\operatorname{Cov}(U_1,X\mid Z)=0$ and $\operatorname{Cov}(U_2,X\mid Z)=\operatorname{Cov}(U_2,X)$ Let $X$, $Y$ and $Z$ be random variables.


*

*Is it always possible to decompose $Y=U_1+U_2$ such that $\operatorname{Cov}(U_1,X\mid Z)=0$ and $\operatorname{Cov}(U_2,X\mid Z)=\operatorname{Cov}(U_2,X)$ i.e. the first term and $X$ are uncorrelated conditional on $Z$ and the second term and $X$ can be correlated independently of $Z$? I don't need explicit expressions for $U_1$ or $U_2$.  

*Can the covariances be replaced with independence (i.e. $U_1 \perp X\mid Z$ and $(U_2,X) \perp Z$)? 

*Are there any similar results? 

*What if $Y$ were replaced with $g(Y)=U_1+U_2$ for some function $g$?
I am interested in methods of how to go about solving such a problem and references. Thanks.
 A: (This CW is a slight simplification and extension of Michael's answer.) 
Claim 
$Y$ has a decomposition of the required form iff $\text{Cov}(X,Y|Z)$ is constant.
Proof
If: 
Let $U_1=\mathbb{E}[Y|Z]$ and $U_2=Y-U_1$. Then $\text{Cov}(U_1, X|Z)=0$.
$$
\begin{align}
\text{Cov}(U_2, X) &= \text{Cov}(Y-\mathbb{E}[Y|Z], X)\\
                  &= \mathbb{E}[X(Y-\mathbb{E}[Y|Z])]\\
                  &= \mathbb{E}[XY-X\mathbb{E}[Y|Z]]\\
                  &= \mathbb{E}[\mathbb{E}[XY|Z] - \mathbb{E}[X|Z]\mathbb{E}[Y|Z]]\\
&= \mathbb{E}[\text{Cov}(X,Y|Z)]]\\
&=\text{Cov}(X,Y|Z)\\
&=\text{Cov}(X, U_1+U_2|Z)\\
&=\text{Cov}(X, U_2|Z)
\end{align}
$$
Onlf if: 
Suppose we have a decomposition $Y=U_1+U_2$ satisfying the required conditions. 
$$\begin{align}
\text{Cov}(U_2, X) &= \text{Cov}(U_2, X|Z)\\
 &= \text{Cov}(Y - U_1, X|Z)\\
                     &= \text{Cov}(X, Y|Z) - \text{Cov}(U_1, X|Z)\\
                     &= \text{Cov}(X, Y|Z),
\end{align}
$$
so $\text{Cov}(X, Y|Z)$ is constant.
Example
Suppose $X\sim U(\{-1,0,1\})$, $Y=\mathbf{1}(X=1)$ and $Z=\mathbf{1}(X\neq 0)$, where $\mathbf{1}$ denotes the indicator function. This example doesn't satisfy the necessary condition, since $\text{Cov}(X,Y|Z)$ depends on $Z$.
A: Ben Derrett solves this question (he shows it is generally impossible).  Here is a necessary condition for doing what you want: 
Claim: A necessary condition is that $Cov(X,Y|Z)$ has no dependence on $Z$.
Proof: Suppose we have $U_1,U_2$ such that $U_1+U_2=Y$ and $Cov(U_1,X|Z)=0$ for all $Z$.  Then $E[U_1X|Z] =E[U_1|Z]E[X|Z]$ and so: 
\begin{align} 
Cov(U_2, X|Z) &=Cov(Y-U_1,X|Z) \\
&=E[(Y-U_1)X|Z] - E[Y-U_1|Z]E[X|Z]\\
&=E[YX|Z] - E[U_1X|Z] - E[Y|Z]E[X|Z]+E[U_1|Z]E[X|Z]\\
&=E[YX|Z] - E[Y|Z]E[X|Z]\\
&= Cov(X,Y|Z)
\end{align} 
and hence we require $Cov(X,Y|Z)$ to have no dependence on $Z$.

Here is positive result about what can be done in this direction: 
Given a random vector $(X,Y,Z)$, define $U_1= f(Z)$ for some real-valued function $f(z)$.   Then: 
\begin{align}
XU_1 &= Xf(Z) \\
E[XU_1|Z] &= E[X f(Z)|Z] \\
&= f(Z)E[X|Z]\\
&= E[f(Z)|Z] E[X|Z]\\
&= E[U_1|Z]E[X|Z]
\end{align}  
and so indeed $Cov(U_1,X|Z) = 0$ for all $Z$. Hence, by the proof of the first claim, it also holds that $Cov(U_2, X|Z) = Cov(X,Y|Z)$. 
This holds for all functions $f(z)$.  If $Cov(X,Y|Z)$ does not depend on $Z$, sometimes we can choose $f(z)$ so that $Cov(X,Y|Z)=Cov(U_2, X)$, in which case all of your desired properties hold. 
For example, suppose $Cov(X,Y|Z)=b$ for all $Z$. Let $f(z)=az$ for some real number $a$. Thus, $U_1=aZ$, $U_2=Y-aZ$, and we have: 
\begin{align} 
Cov(U_2,X) &= E[X(Y-aZ)] - E[X]E[Y-aZ]\\
&= E[XY] - aE[XZ] - E[X]E[Y]+aE[X]E[Z]\\
&= Cov(X,Y) - aCov(X,Z)
\end{align} 
If $Cov(X,Z) \neq 0$ we can choose $a$ so that the above is equal to $b$, namely: 
$$ a = \frac{Cov(X,Y)-b}{Cov(X,Z)} $$
and all of your desired properties hold.  So a sufficient condition is that $Cov(X,Y|Z)$ does not depend on $Z$, and $Cov(X,Z)\neq 0$.
