this post is saying
linearity of expectation gives following equation $$\mathbb{E} [\sum_{j\neq i} Y_i Y_j] = \sum_{j\neq i} \mathbb{E} [Y_i Y_j]$$
per wiki, Linearity of Expected_value is saying
$$ {\displaystyle {\begin{aligned}\operatorname {E} [X+Y]&=\operatorname {E} [X]+\operatorname {E} [Y],\\[6pt]\operatorname {E} [aX]&=a\operatorname {E} [X],\end{aligned}}}$$
where $X$ and $Y$ are arbitrary random variables, and $a$ is a constant.
is not saying some rules like "expectation of sum is sum of expectation"
this post is saying
expectation of sum of something = sum of expectation of something even when the items involved are not independent.
how to justify this claim?
When $E[X_1], E[X_2], \dots, E[X_n]$ exist $${\displaystyle {\begin{aligned} E [\sum_{i=1}^n X_i] &= E[X_1+X_2+\dotsb+X_n] \\ &= E[X_1]+E[X_2]+\dotsb+ E[X_n] \\ &= \sum_{i=1}^n E [X_i] \end{aligned}}}$$