Let (\Omega, F, P) be a probability space, which may have atoms (important), S be a set of measure-preserving transformations T:\Omega\to\Omega, that is, such that preimage T^{-1}(A) is measurable whenever A is measurable, and P(A)=P(T^{-1}(A)). Then, obviously, random variables X and Y given by Y(\omega)=X(T(\omega)), T\in S, have the same distribution. I need the fact that the converse also true: if X and Y have the same distribution, then Y(\omega)=X(T(\omega)), for some T\in S. I am sure that this fact should be known, therefore do not want to reprove it. In the worst case, it should be a corollary from some known theorems, with 2-3 line proof. The question is: is it indeed known, and if so, where to refer?
Update: It should be "if X and Y have the same distribution, then, for any e>0 |Y(\omega)-X(T(\omega))| < e (with probability 1), for some T(e)\in S".