The proof of linearity for expectation given random variables are independent is intuitive. What is the proof given there they are dependent?
Formally, $$ E(X+Y)=E(X)+E(Y)$$ where $X$ and $Y$ are dependent random variables.
The proof below assumes that $X$ and $Y$ belong to the sample space. That is, they map from the sample space to a real number line. Is that also a condition for linearity of expectation?
Proof: $$E\left(X+Y\right) =\sum\limits_{s}\left(X+Y\right)\left(s\right) P\left({s}\right) $$ $$E\left(X+Y\right) =\sum\limits_{s}\left(X\left(s\right)+Y\left(s\right)\right) P\left({s}\right) $$ $$E\left(X+Y\right) =\sum\limits_{s} X\left(s\right)P\left({s}\right) + \sum\limits_{s} Y\left(s\right)P\left({s}\right) $$ $$E\left(X+Y\right) =E\left(X\right)+E\left(Y\right)$$ Here $S$ is the sample space and $s$ is an event in the sample space.
Reference Lecture for proof.
Also, more reasoning for step 2 would be helpful. I don't understand it completely.