Suppose $B, \{A_i: i \in \omega\}$ are i.i.d. random variables with uniform distributions on $[0,1]$. If $f$ is a map such that $\{f(A_i, B): i \in \omega\}$ are independent, must $\{f(A_i, B): i \in \omega\}$ also be independent of $B$?

1$\begingroup$ I can prove it for discrete uniform distributions. I wonder if that helps for continuous uniform distributions. $\endgroup$ – Brendan McKay Feb 23 '15 at 14:16

$\begingroup$ Do you think there is a counterexample for general (i.e. nonuniform) distributions? $\endgroup$ – usul Feb 23 '15 at 17:22

$\begingroup$ No, I think any distributions at all are ok, even a different one for each of the arguments. See the stuff I added to my answer. $\endgroup$ – Brendan McKay Feb 24 '15 at 1:19
It is true.
Let $\chi_Z(x,y)$ be the indicator function of the set $\lbrace (x,y) \,\, f(x,y)\in Z\rbrace$ for some set $Z$.
The condition that the events $f(A_1,B)\in Z$ and $f(A_2,B)\in Z$ are independent is that $$ \int_{[0,1]^3} \chi_Z(x,y)\chi_Z(x'y)\,dxdx'dy = \int_{[0,1]^2} \chi_Z(x,y) \,dxdy \ \ \int_{[0,1]^2} \chi_Z(x',y') \,dx'dy'.$$ Define $g(y) = \int_0^1 \chi_Z(x,y)\,dx$. Then the above condition can be rearranged into $$ \int_{[0,1]^2} g(y) (g(y)g(y'))\, dy dy' = 0.$$ That's just a change of variables from $$ \int_{[0,1]^2} g(y') (g(y)g(y'))\, dy dy' = 0,$$ so we can subtract the two to get $$ \int_{[0,1]^2} (g(y)g(y'))^2 \,dydy' = 0$$ which by positivity means $g(y)$ is constant a.e.. Harking back to the definition of $\chi_Z$ and noting that the set $Z$ was arbitrary, we see that $f(A_1,B)$ is independent of $B$.
I have only considered pairwise independence, but once you find that $g(y)$ is independent of $y$ it makes the whole lot of them independent. At least, it seems so at 3am...
ADDED after waking up: At the moment I can't see how uniform distributions are needed for this argument. Just consider any vertical measure $\mu$ and horizontal measure $\nu$ and replace $dx$ by $d\mu$, $dy$ by $d\nu$, etc, in the above argument. Still works, doesn't it?
MORE ADDED: Nate's question leads me to note the following, which surely must be wellknown in the theory of exchangeable random variables (but I didn't know it).
Theorem. Let $X,Y$ be random variables such that $(X,Y)$ and $(Y,X)$ have the same distribution. Then $X$ and $Y$ are independent iff for all measurable sets $S$, $P(X\in S \wedge Y\in S)=P(X\in S)^2$.
Proof. Let $S,T$ be measurable sets. First assume $S$ and $T$ are disjoint. Since by the exchangeability assumption $P(X\in T\wedge Y\in S)=P(X\in S\wedge Y\in T)$, we have \begin{align} 2 P(X\in S\wedge Y\in T)&=P(X,Y\in S\cup T)  P(X,Y\in S)  P(X,Y\in T) \\ &= P(X\in S\cup T)^2  P(X\in S)^2  P(X\in T)^2 \\ &= (P(X\in S) + P(X\in T))^2  P(X\in S)^2  P(X\in T)^2 \\ &= 2 P(X\in S) P(X\in T) \\ &= 2 P(X\in S) P(Y\in T). \end{align} If $S$ and $T$ are not disjoint, break $P(X\in S\wedge Y\in T)$ into four disjoint cases like $P(X\in S\wedge Y\in T\setminus S)$ and apply the above to each. It works.

$\begingroup$ In general, to show two random variables are independent, you have to show $P(X \in U, Y \in V) = P(X \in U) P(Y \in V)$ for $U,V$ ranging over an appropriately rich collection of sets. Why does it suffice to prove the special case where $U=V=Z$? Sets of the form $Z \times Z$ don't generate the product $\sigma$algebra, do they? $\endgroup$ – Nate Eldredge Feb 24 '15 at 1:52

$\begingroup$ @Nate : What you say is correct, but I don't think I'm making that mistake. Independence of $X$ and $Y$ implies that the events $X\in Z$ and $Y\in Z$ are independent; the converse is false but I don't use it. Once we know $g(y)$ is a.e. constant, the distributions of $f(A,B)$ conditional on any two nonnull $B$events are the same. But let me know if you still think there's a problem. $\endgroup$ – Brendan McKay Feb 24 '15 at 2:27

$\begingroup$ @Nate : To my surprise, the converse is true in this case, see my addition. $\endgroup$ – Brendan McKay Feb 24 '15 at 4:08