Merging the two concepts of conditional probability/expectation One can condition the probability of an event or the expectation of a random variable on an event that has positive probability or on a $\sigma$-Algebra. While I think that I understand both concepts on their own I have trouble making sense of a combined version. So let $X,Y$ be random variables and f be a measurable function. If A is an event with $\mathbb{P}(A)>0$, how can I interpret
$$\mathbb{E}[f(X,Y) \mid\, A \mid\, Y]$$
or maybe it would be written as
$$\mathbb{E}[f(X,Y) \mid\, A, Y]?$$
I am having trouble translating even the simple rules of conditional expectation on a sigma Algebra to this. For example if $X$ is $\sigma(Y)$ measurable how would I pull $f(X,Y)$ out of the expectation?
 A: If $A$ is an event or a random variable then the notation $\operatorname{E}[X|A]$ have different meanings. Suppose that $X:\Omega \to \mathbb{R}$ where $(\Omega ,\mathcal{F},P)$ is a probability space, then when $A$ is an event with positive probability then $\operatorname{E}[X|A]$ represents the mean value of $X|_A$ in the probability space $(A,\mathcal{F}|_A,P[\,\cdot\, |A])$, where $\mathcal{F}|_A:=\{B\cap A:B\in \mathcal{F}\}$ is a trace $\sigma $-algebra (the trace generated by $A$).
When $A$ is a random variable then $\operatorname{E}[X|A]:=\operatorname{E}[X|\sigma (A)]$ where $\sigma (A):=\{A^{-1}(D):D\in \mathcal{B}(\mathbb{R})\}$ is the $\sigma $-algebra generated by $A$, and where (as you surely knows) $\operatorname{E}[X|A]$ is a random variable defined by the relation
$$
\int_{F}\operatorname{E}[X|A]dP=\int_{F}X dP,\text{ for every }F\in \sigma (A)
$$
Notice that, with the definitions given above, there is a slight difference between $\operatorname{E}[X|A]$ and $\operatorname{E}[X|\mathbf{1}_{A}]$ when $A$ is an event of positive probability, as the first is just a number and the second is a random variable that is $\sigma (\mathbf{1}_{A})$-measurable.
By the other hand something like $\operatorname{E}[X|A|B]$ is undefined as far as someone defines explicitly what this notation means. By the other I never had seen something like $\operatorname{E}[X|A,Y]$ where $A$ is an event and $Y$ a random variable, so it meaning must be defined previously to make sense.
