The next two facts are basic but I've been having trouble understanding them theoretically. Let $X$ and $Y$ be two real-valued random variables, then
first fact: $X\leq Y$ a.s. implies $E[X]\leq E[Y]$;
second fact: $E_{X}[X+Y]=E_{X}[X]+Y$, where $E_{X}$ means the expected values with respect to $X$.
Note that the two facts are very vague. The first one does not indicate where the random variables are defined, i.e., in which probability space. The second one is not clear about de definition of $E_{X}$.
I'm not defining $E_{X}$ because I have never seen a proper definition. Furthermore, $E_{X}$ should work for other transformations, e.g., $E_{X}[XY]=YE_{X}[X]$.
I think that the answer should involve product measure. Let $(S_i,\Sigma_i,\mu_i)$, $i=1,2$, be two probability spaces and $(S,\Sigma,\mu)=(S_2,\Sigma_2,\mu_2)\times (S_2,\Sigma_2,\mu_2)$ with de proper definition of the cartesian product of two measure spaces. Now define $(X,Y)\in(S,\Sigma,\mu)$.
Can I answer the two questions studying objects like \begin{align} Z(s_1) := \int_{S_2}g(X(s_1),Y(s_2))\mu_2(ds_2) \end{align} where I can take $g(x,y)=x$ for the first fact and $g(x,y)=x+y$ for the second? Is there any problem with the mesurability of $Z$?