I'm trying to figure out a proof for the following statement.
If $X$ and $Y$ are independent, and $X$ and $Z$ are independent,
then $X$ and $f(Y,Z)$ are also independent, for any $f(\cdot, \cdot)$
Is there any counter-example against the above statement?
Let $X$, $Y$ and $Z$ be three binary random variables such that all valuations in which an even number of them are $1$ are equiprobable (and the other valuations don't occur). Then $X$ and $Y$ are independent, and $X$ and $Z$ are independent, but $X=Y\operatorname{XOR} Z$.