Consider two random variables $X,Y$. $Y$ has support $\mathcal{Y}\equiv \mathcal{Y}_1\cup \mathcal{Y}_2$. $X$ has support $\mathcal{X}$. $\mathcal{X}$ and $\mathcal{Y}$ are finite sets.
Take a function $f(X,Y)$ and a parameter $\beta$. Suppose that $$ E(f(X,y)-\beta)\geq 0 \text{ }\forall y\in \mathcal{Y}_1 $$
The textbook asks me to show that this implies $$ E(f(X,Y)-\beta| Y\in \mathcal{Y}_1)\geq 0 $$
I would like your help to understand
1) What is $E(f(X,Y)| Y\in \mathcal{Y}_1)$? I know that $\forall y \in \mathcal{Y}_1$ $$ E(f(X,Y)| Y=y)\equiv \sum_{x\in \mathcal{X}} f(x,y)P(X=x| Y=y) $$ but I don't understand how $E(f(X,Y)| Y\in \mathcal{Y}_1)$ is defined.
2) How to get that implication.
You can view $E\{f(X,Y)|Y=y\}$ as a special case of conditioning on a set. $E\{f(X,Y)|Y=y\}=E\{f(X,Y)|Y\in\{y\}\}$. In general, \begin{align} E\{f(X,Y)|Y\in\mathcal{Y}_1\} &= \sum_{x\in \mathcal{X}, y\in \mathcal{Y}_1}f(x,y)P(X=x, Y=y|Y\in \mathcal{Y}_1)\\ &=\sum_{x\in \mathcal{X}, y\in \mathcal{Y}_1}f(x,y)P(X=x|Y=y)P(Y=y|Y\in \mathcal{Y}_1)\\ &=\sum_{x\in \mathcal{X}, y\in \mathcal{Y}_1}f(x,y)P(X=x |Y=y)\frac{P(Y=y)}{P(Y\in \mathcal{Y}_1)}\\ &=\sum_{x\in \mathcal{X}, y\in \mathcal{Y}_1}f(x,y)P(X=x|Y=y)\frac{P(Y=y)}{\sum_{y\in\mathcal{Y}_1}P(Y\in \mathcal{Y}_1)}. \end{align} Can you complete the answer now?