Let $Z=(X,Y) : \Omega\rightarrow\mathbb{R}^2$ be a Borel-measurable random vector and $U\subset\mathbb{R}$ be open. Suppose that $Z$ is absolutely continuous with Lebesgue density $\zeta$.


I was wondering about the following **question:** If we assume that $\zeta$ factorizes on the square $U\times U$, i.e. that the restriction


$$\tag{1}q:=\left.\zeta\right|\_{U\times U} \quad\text{is such that}\quad q\equiv q(x,y)=q\_1(x)q\_2(y) \quad\text{for some } \ q\_1, q\_2 : U\rightarrow\mathbb{R},$$
does this imply that $X$ and $Y$ are *independent on $U$* in the sense that


$$\tag{2}\mathbb{P}(X^{-1}(A)\cap Y^{-1}(B)) = \mathbb{P}\_X(A)\cdot\mathbb{P}\_Y(B)\quad\forall\, A, B\subseteq U \ (\mathrm{Borel})?$$


Clearly this holds for both the special cases $U=\mathbb{R}$ and $q\_i = \zeta\_i$ ($i=1,2$, with $\zeta\_i$ the marginal densities of $\zeta$), however I couldn't show it in the above generality; do you have a counterexample?



If a joint density factorizes on a square, does this imply that the marginal random variables are locally independent?
The answer is no. E.g., let $U=(0,1)$ and
$$\zeta=\frac12\times 1\_{(0,1)^2}+\frac12\times 1\_{(1,2)^2};$$
that is, the joint distribution of $(X,Y)$ is the half-and-half mixture of the uniform distributions on the the squares $(0,1)^2$ and $(1,2)^2$. Then
$$P\_{X,Y}(U\times U)=\frac12\ne\frac12\times\frac12=P\_X(U)P\_Y(U).$$


