$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}$? 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.
 A: 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]$.)
A: Let $(Q_\omega)_\omega$ denote the conditional distribution of $X$ given $\mathcal{G}$. Since by assumption $X$ is independent of $\mathcal{G}$, we may take $Q_\omega = X(\mathbb{P})$ for all $\omega\in\mathcal{G}$.
The conditional distribution $(P_\omega)_\omega$ of $f(X,Y)$ given $\mathcal{G}$ is then (since $Y$ is $\mathcal{G}$-measurable) by substition given by $P_\omega = f_{Y(\omega)}(Q_\omega) = f_{Y(\omega)}(X(\mathbb{P}))$, where $f_{Y(\omega)}(x) := f(x,Y(\omega))$.
Note that $P_\omega$ only depends on $\omega$ through $Y(\omega)$. This implies that the Markov kernel $(R_y)_y$ given by $R_y = f_y(X(\mathbb{P}))$ corresponds to the conditional distribution of $f(X,Y)$ given $Y$. But $f(X,Y)$ was assumed independent of $Y$, so we may actually take $R_y$ to not depend on $y$. Since $P_\omega = R_{Y(\omega)}$, we may also take $(P_\omega)_\omega$ to not depend on $\omega$, which implies the desired, namely that $f(X,Y)$ is independent of $\mathcal{G}$.
The arguments are typical in the context of conditional distributions and various classic textbook references provide the necessary foundation. The following lecture notes offer an excellent introduction to the topic: http://web.math.ku.dk/noter/filer/beting.pdf. The results used correspond to Theorem 1.4.3, Theorem 2.1.1, and Theorem 2.1.5.
A: The answer is yes.  To see this, I claim that if $A \in \mathcal{G}$ and $M > 0$, then
\begin{equation*}
\mathbb{E}(f(X,Y) : A, |f(X,Y)| \leq M) = \mathbb{E}(f(X,Y) : |f(X,Y)| \leq M) \mathbb{P}(A).
\end{equation*}
First, notice that the independence of $X$ from $\mathcal{G}$ implies that
\begin{equation*}
\mathbb{E}(f(X,Y) 1_{\{|f(X,Y)| \leq M\}} \mid \mathcal{G}) = \mathbb{E}(f(X,Y) 1_{\{|f(X,Y)| \leq M\}} \mid Y).
\end{equation*}
The only way I can see to prove this (in general) is to approximate $f(X,Y) 1_{\{|f(X,Y)| \leq M\}}$ by a sequence of (sums of) random variables of the form $g_{n}(X) h_{n}(Y)$, which is possible since, for instance, continuous functions with compact support can be approximated in this way.  (We can derive $\mathbb{E}(g_{n}(X) h_{n}(Y) \mid \mathcal{G}) = \mathbb{E}(g_{n}(X)) \mathbb{E}(h_{n}(Y) \mid Y)$ immediately by independence and $\mathcal{G}$-measurability.)
Next, notice that since $f(X,Y)$ is independent of $Y$, it follows that $\mathbb{E}(f(X,Y) 1_{\{|f(X,Y)| \leq M\}} \mid Y) = \mathbb{E}(f(X,Y) :|f(X,Y)| \leq M)$ almost surely.
Putting the two insights together, we deduce that $\mathbb{E}(f(X,Y) 1_{\{|f(X,Y)| \leq M\}} \mid \mathcal{G}) = \mathbb{E}(f(X,Y) : |f(X,Y)| \leq M)$ almost surely.  Therefore, by definition of conditional expectation,
\begin{equation*}
\mathbb{E}(f(X,Y) : A, |f(X,Y)| \leq M) = \mathbb{E}(f(X,Y) : |f(X,Y)| \leq M) \mathbb{P}(A).
\end{equation*}
