So if $X$ and $Y$ are two set then any binary relation between $X$ and $Y$ is a subset of the power set $\mathcal P\big(\mathcal P(X\cup Y)\big)$ of $\mathcal P(X\cup Y)$ so that we can define the set $Y^X$ of all functions from $X$ to $Y$ through the equation $$ Y^X:=\{f\in\mathcal P\big(\mathcal P(X\cup Y)\big):f\,\text{ function}\} $$
So if $\mathfrak X:=\{X_i:i\in I\}$ is an indexed colletion of sets then we can define too the general caresian product $\prod_{i\in I} X_i$ of $\mathfrak X$ through the equation $$ \prod_{i\in I}X_i:=\Biggl\{x\in\biggl(\bigcup_{i\in I}X_i\biggl)^I:x(i)\in X_i\,\forall i\in I\Biggl\} $$
Therefore let be now $\mathfrak X:=\{X_i:i\in I\}$ and $\mathfrak Y:=\{Y_i:i\in I\}$ two indexed collections of sets: so I ask to prove that $$ \prod_{i\in I}X_i\cap\prod_{i\in I}Y_i=\prod_{i\in I}(X_i\cap Y_i) $$
$$ \underline{\text{MY PROOF ATTEMPT}} $$
So first of all we observe that $$ \prod_{i\in I}X_i\cap\prod_{i\in I}Y_i=\Biggl\{x\in\biggr(\bigcup_{i\in I}X_i\biggr)^I:x(i)\in X_i\,\forall i\in I\Biggl\}\cap\Biggl\{x\in\biggr(\bigcup_{i\in I}Y_i\biggr)^I:x(i)\in Y_i\,\forall i\in I\Biggl\}=\\ \Biggl\{x\in\biggr(\bigcup_{i\in I}X_i\biggr)^I\cap\biggr(\bigcup_{i\in I}Y_i\biggr)^I:x(i)\in (X_i\cap Y_i)\,\forall i\in i\Biggl\} $$ so that the equality follows proving that $$ \biggr(\bigcup_{i\in I}X_i\biggr)^I\cap\biggr(\bigcup_{i\in I}Y_i\biggr)^I=\biggr(\bigcup_{i\in I}(X_i\cap Y_i)\biggr)^I $$
So on this purpose we observe that if $x$ is an elemento of $\big(\bigcup_{i\in I} X_i\big)^I\cap\big(\bigcup_{i\in I}Y_i\big)^I$ then $x$ is an element of both $\big(\bigcup_{i\in I} X_i\big)^I$ and $\big(\bigcup_{i\in I}Y_i\big)^I$ and thus $$ \operatorname{ran}x\subseteq\Biggl(\bigcup_{i\in I}X_i\cap\bigcup_{i\in I}Y_i\Biggl)=\bigcup_{i\in I}(X_i\cap Y_i) $$ which impplies that $$ x\subseteq\operatorname{dom}x\times\operatorname{ran}x\subseteq I\times\bigcup_{i\in I}(X_i\cap Y_i) $$ so that being $x$ a function we conclude that $x$ is an element of $\biggr(\bigcup_{i\in I}(X_i\cap Y_i)\biggr)^I$ and this proves that $$ \biggr(\bigcup_{i\in I}X_i\biggr)^I\cap\biggr(\bigcup_{i\in I}Y_i\biggr)^I\subseteq\biggr(\bigcup_{I\in I}(X_i\cap Y_i)\biggr)^I $$
Conversely if $x$ is an element of $\biggr(\bigcup_{i\in I}(X_i\cap Y_i)\biggr)^I$ then necessarly $$ \operatorname{ran}x\subseteq\bigcup_{i\in I}(X_i\cap Y_i)=\Biggl(\bigcup_{i\in I}X_i\cap\bigcup_{i\in I}Y_i\Biggl) $$ and thus $$ x\subseteq\operatorname{dom}x\times\operatorname{ran}x\subseteq I\times\Biggl(\bigcup_{i\in I}X_i\cap\bigcup_{i\in I}Y_i\Biggl)=\Biggl(I\times\bigcup_{i\in I}X_i\Biggl)\cap\Biggl(I\times\bigcup_{i\in I}Y_i\Biggl) $$ so that being $x$ a function necessarly $x$ is an element of both $\biggr(\bigcup_{i\in I}X_i\biggr)^I$ and $\biggr(\bigcup_{i\in I}Y_i\biggr)^I$ and this proves that $$ \biggr(\bigcup_{i\in I}(X_i\cap Y_i)\biggr)^I\subseteq\biggr(\bigcup_{i\in I}X_i\biggr)^I\cap\biggr(\bigcup_{i\in I}Y_i\biggr)^I $$
Therefore first of all I would like to know if the argumentation I gave to prove the statement are correct (I think it is very important to learn by your mistakes) and then I do not dislike to know if it is possible to prove it with other argumentations. So could someone help me, please?