Furthermore, assume that $W$ is independent of $Y_1$ and $Y_0$.
I think the answer is yes, because when $W=1$ $Y=Y_1$, and $W=0$ then $Y=Y_0$, so $$\tag{1} E[W\cdot Y] = prob(W=0) E[0] + prob(W=1) E[Y_1] $$ because $W=1\implies Y=Y_1$, and similarly $$\tag{2} E[W\cdot Y_1] = prob(W=0) E[0] + prob(W=1)E[Y_1] $$
Assuming I did not make mistake then because (1)=(2) the answer is YES.
I am wondering how to formally prove this, though? I think the approach is to note that $$W\cdot Y$ is an RV that can take two values, $Y_1, Y_0$, which probability $prob(W=1)$ and $prob(W=0)$ respectively. Then note that the joint distribution of $W,Y$ can be written as the product of marginal and conditional distribution, and use the fact that the conditional distribution of $Y$ on $W$ can be used to simplify things (because there are only two outcomes).
I get a bit confused though because $W\cdot Y$ (and $Y$ are random variables whose values are random variables).
Also, is independence needed for the result to be true (assuming I am right)? I do not think so?
Thanks.
Since $W$ only takes the values $0$ and $1$, it follows that $W^2=W$ and $W(1-W)=0$. Therefore $$ WY=W^2Y_1+W(1-W)Y_0=WY_1 $$ hence $$ \mathbb{E}[WY]=\mathbb{E}[WY_1]$$ Note that $W$ does not need to be independent of $Y_0$ and $Y_1$.