$\exists f$ such that $f(X,Y)$ is independent of $X+Y$? Let $X,Y$ be independent continous random variables. Does there exist a non-constant measurable function $f$ such that $f(X,Y)$ is independent of $X+Y$?
I am only interested in existence (and not the form of $f$). I suppose that it can depend on the distributions of $X,Y$. It would be interesting to see at least an example when $f$ either exists or it can be proven that it does not exist.
My thoughts are that a transformation $(X,Y)\to X+Y$ starts from independent components, so there should be another "perpendicular" transformation that will be independent of $X+Y$.
 A: The following two classes are examples for the two cases.
I guess this can be further refined.

*

*If at least one of the two random variables $X$ and $Y$ is fully supported, then there exists a non-constant measurable function $f:\mathbb R^2\rightarrow\mathbb R$ such that $f(X,Y)$ is independent of $X+Y$.

*If both $X$ and $Y$ have bounded support, then there exists no such function.

For the first part, assume that $Y$ is fully supported.
Let $g_{\mathrm x}(x)$ be the probability density function (pdf) of $X$,
$g_{\mathrm y}(y)$ the pdf of $Y$ and $g(x,y)=g_{\mathrm{x}}(x)g_{\mathrm{y}}(y)$ the pdf of $(X,Y)$.
Let $\mathcal X=g_{\mathrm{x}}^{-1}((0,\infty))$ be the support of $X$, notice that $g_{\mathrm{y}}^{-1}((0,\infty))=\mathbb R$ and that $g^{-1}((0,\infty))=\mathcal X\times\mathbb R$.
In the following we only need that there exists a (non-empty) interval $\mathcal I$ such that $\mathcal I\times\mathbb R\subseteq g^{-1}((0,\infty))$.
Assume without loss of generality that $\mathcal I=(-1,1)$.
Let $h(z)$ be the pdf of a continuous random variable $Z$ with support $(-1,1)$ (say $h(z)=\max(0,1-|z|)$) and $H(z)=\int_{-\infty}^zh(\zeta)\mathrm d\zeta$.
For $s,x\in\mathbb R$ let
$g_s(x)=\frac{g(x,s-x)}{\int_{-\infty}^{\infty}g(z,s-z)\mathrm dz}$ be the pdf of $X|X+Y=s$, so in particular $g_s(x)>0$ for $x\in(-1,1)$.
Let $G_s(x)=\int_{-\infty}^xg_s(\chi)\mathrm d\chi$ and $z_s(x)=H^{-1}(G_s(x))$, where $H^{-1}:[0,1]\rightarrow[-1,1]$ is the inverse of $H$ on $[-1,1]$.
Let $f(x,y)=z_{x+y}(x)$. Using the inverse $G_s^{-1}:[0,1]\rightarrow[\max G_s^{-1}(0),\min G_s^{-1}(1)]$ of $G_s$, we have
$$\mathbb P(f(X,Y)\le c|X+Y=s)=\mathbb P(X\le G_s^{-1}(H(c))|X+Y=s)=G_s(G_s^{-1}(H(c)))=H(c).$$
This shows that $f(X,Y)$ is independent of $X+Y$.
Now, assume that $X$ and $Y$ have bounded support and assume that $f(X,Y)$ is independent of $X+Y$, meaning that $f(X,Y)|X+Y=s$ has the same law as $f(X,Y)$ (without loss of generality, clearly this is a version of the regular conditional distribution). But with $x^+=\sup g_{\mathrm x}^{-1}((0,\infty))$ and $y^+=\sup g_{\mathrm y}^{-1}((0,\infty))$ we notice that $f(X,Y)$ has to be supported on one point because the support of $f(X,Y)|X+Y=s$ collapses to one point for $s\rightarrow x^++y^+$ (no matter the dependencies of $X$ and $Y$). But if $f(X,Y)$ is supported on one point, it is constant.
