TITLE: $X$ is independent of $\mathcal{G}$, $f(X ,Y)$ is independent of $Y$, $Y$ is $\mathcal{G}$-measurable, then $f(X,Y)$ is independent of $\mathcal{G}$?
QUESTION [5 upvotes]: Let $(\Omega, \mathcal{F}, P)$ be a probability space,  $\mathcal{G}\subset \mathcal{F}$ be a sigma algebra, $X, Y : \Omega \to \mathbb{R}^n$ be random vectors, and $f$ be a measurable function on $\mathbb{R}^{2n}$.
Suppose that $X$ is independent of $\mathcal{G}$, $f(X ,Y)$ is independent of $Y$, and $Y$ is $\mathcal{G}$-measurable. Is it true that $f(X,Y)$ is independent of $\mathcal{G}$?
Motivation: This question arises from a randomized algorithm. In this algorithm, each iteration receives some randomness that is independent of the previous iterations. In my question, $\mathcal{G}$ indeed represents the randomness of the algorithm up to iteration $k$, $Y$ is a vector generated by iteration $k$, $X$ is some new randomness injected into the algorithm at iteration $k+1$, and $f(X,Y)$ is a quantity computed from $X$ and $Y$. It turns out that $f(X,Y)$ is statistically independent of $Y$. I would like to prove that $f(X,Y)$ is independent of the first $k$ iterations, which will be interesting and convenient.
Any comments or criticism will be appreciated. Thank you.
A related question: Uniform distribution on the unit sphere rotated by a random orthogonal matrix.

REPLY [2 votes]: Yes, $f(X,Y)$ is independent of $\mathcal G$. Let $\varphi$ be a bounded Borel function and $G$ a bounded $\mathcal G$-measurable function. Let $F=f(X,Y)$. We need to show that
$$
E[\varphi(F)\cdot G] =E[\varphi(F)]\cdot E[G].
$$
Because $Y$ is $\mathcal G$-measurable and $X$ is independent of $\mathcal G$, you have
$$
E[\varphi(F)\cdot G] = \int E[\varphi(f(x,Y))\cdot G]\mu(dx),
$$
where $\mu$ is the distribution of $X$.
But, for each fixed $x$,
$$
E[\varphi(f(x,Y))\cdot G]=E[\varphi(f(x,Y))\cdot E[G\mid Y]],
$$
and so
$$
\eqalign{
E[\varphi(F)\cdot G]
&=\int E[\varphi(f(x,Y))\cdot E[G\mid Y]]\mu(dx)\cr
&=  E\left[\varphi(f(X,Y))\cdot E[G\mid Y]\right] \cr
&=  E[\varphi(f(X,Y))]\cdot E[E[G\mid Y]] \cr
&=  E[\varphi(F)]\cdot E[E[G\mid Y]] \cr
&=  E[\varphi(F)]\cdot E[G]. \cr
}
$$
(The third in this string of equalities follows because $F$ is independent of $Y$ and therefore independent of $E[G\mid Y]$.)