# Rigorous definition of the conditional expectations $E(X|Y=y)$ when $P(Y=y)=0$

Let $X$ be an integrable random variable on $(\Omega, \mathfrak A, P)$.

I've learned that for an event $A$ of non-zero probability, $$E(X|A) = \int X(\omega) \,dP(\omega|A) = \frac{1}{P(A)}\int_A X \,dP,\tag 1$$ where $P(\cdot|A)$ is the probability measure on $\mathfrak A$ given by $B\mapsto P(B \cap A)/P(A).$

Moreover, for a sub-sigma algebra $\mathfrak C \subset \mathfrak A,$ $E(X|\mathfrak C)$ is (a.s. uniquely) defined as an integrable function satisfying

1. $E(X|\mathfrak C)$ is $\mathfrak C$-measurable
2. $\forall C \in \mathfrak C,\, \int_C E(X|\mathfrak C) \,dP = \int_C X \,dP.$

For integrable random variables $X, Y,\,$ $E(X|Y)$ is defined as $E(X|\sigma(Y)).$

But very often I see something like $E(X|Y=y)$ written. If $P(Y=y)>0$ this reduces to $(1)$ but if $Y$ is, for example, continuous w.r.t. Lebesgue-measure, then this doesn't work.

Is there a general definition of $E(X|Y=y)$ which works for discrete and continuous $Y$ and in the case where $Y$ may not have a density?

• I think the limit $\lim_{\Delta y\rightarrow 0^+}E(X|y-\Delta y\leq Y\leq y+\Delta y)$ is still the first thing to consider, if $P(Y=y)=0$. Oct 21, 2017 at 17:02
• $E(X|Y=y)$ is a bit "abuse of notation", actually the expression $E[X|Y]|_{Y=y}$ is meant. So you consider $E[X|Y]$ as a function of $Y$ and then you set $Y=y$.
– Gono
Oct 21, 2017 at 17:05
• @Gono $E(X|Y)$ is a function $\Omega \to \mathbb R,$ though, isn't it? If $\Omega \ne \mathbb R,$ how can I plug in $Y$? Am I misunderstanding something? Oct 21, 2017 at 17:10
• If $X$ is a color variable that is "red" or "green" with probability 50-50, it does not make sense to talk about its "expectation value" $E(X)$. Oct 21, 2017 at 17:14
• $E[X|Y]$ always can be written as $g(Y)$ for a suitable measurable function $g$ (c.f. en.wikipedia.org/wiki/…) And $E[X|Y=y]$ then is $g(y)$
– Gono
Oct 21, 2017 at 17:21

A piece of your own, quite lucid, exposition whose importance might have escaped you is the fact that, since the random variable $E(X\mid Y)$ is, by definition, $\sigma(Y)$-measurable, there exists some measurable function $g$ such that $E(X\mid Y)=g(Y)$ almost surely. Then, indeed, it is customary to set $E(X\mid Y=y)=g(y)$ for every $y$.

But note this: if some function $g$ fits the bill, every other measurable function $\bar g$ such that $\bar g=g$ $P_Y$-almost surely, also does. Hence $E(X\mid Y=y)$ is not uniquely defined, pointwise. That is, except at the points $y$ such that $P(Y=y)\ne0$, and then $E(X\mid Y=y)=E(X\mathbf 1_{Y=y})/P(Y=y)$, so all is well.

This latitude in the choice of the function $g$ reflects the fact that the random variables $E(X\mid Y)$ can only be defined up to $P$-null sets and that, rigorously speaking, one should always write that $E(X\mid Y)=g(Y)$ almost surely, instead of simply that $E(X\mid Y)=g(Y)$.

Then, $E(X\mid Y)=g(Y)$ almost surely, $E(X\mid Y)=\bar g(Y)$ almost surely, and $g(Y)=\bar g(Y)$ almost surely (this is what the hypothesis that $g=\bar g$ $P_Y$-almost surely, amounts to), hence the latitude mentioned above does not lead to a contradiction.

This also explains why one rarely sees formulas involving $E(X\mid Y=y)$ in measure theoretic probability lectures, but always random variables $E(X\mid Y)$, uniquely defined up to $P$-null sets.

Example: Consider $X=Y$ uniform on $(0,1)$, then $g$ the identity function works, but also the function $\bar g:\mathbb R\to\mathbb R$ defined by $\bar g(y)=y\mathbb 1_{y\notin\mathbb Q}$. Then $g(y)\ne\bar g(y)$ for every rational number $y\ne0$. One sees that, for each specific $y$ such that $P(Y=y)=0$, the value of $g(y)=E(X\mid Y=y)$ can be anything without failing the definition. In the end, the only property that matters is that $E(X\mathbb 1_{Y\in B})=E(g(Y)\mathbb 1_{Y\in B})$ for every Borel set $B$ of $\mathbb R$.

• Thank you for your eloquent answer. I did not know that $E(X|Y)$ being $\sigma(Y)$ measurable implies the existence of such a $g.$ But I found an outline of the proof here: math.stackexchange.com/a/848004/451957 Oct 21, 2017 at 19:26
• Maybe one more question: Is it obvious that $g(y) = E(X\mathbf 1_{Y=y})/P(Y=y)$ when $P(Y=y)> 0?$ Oct 21, 2017 at 21:11
• Well, you might be aware that, if $\mathcal G$ is the sigma-algebra generated by a partition $\Omega=\bigcup\limits_kB_k$ with $P(B_k)\ne0$ for every $k$, then $$E(X\mid\mathcal G)=\sum_kE(X\mid B_k)\mathbf 1_{B_k}=\sum_k\frac{E(X\mathbf 1_{B_k})}{P(B_k)}\mathbf 1_{B_k}$$ This is the same formula.
– Did
Oct 21, 2017 at 21:18
• I think I understand this: If $Y$ takes on at most countably many values $y_1,y_2,\ldots,$ then $\Omega=\bigcup_{k=1}^\infty \{Y=y_k\}$ so that $\sigma(Y)$ consists of disjoint unions of these sets and $$E(X|Y)=E(X|\sigma(Y))=\sum_{k=1}^\infty E(X|Y=y_k)\mathbb 1_{Y=y_k} = \sum_{\substack{k=1\\ P(Y=y_k)>0}}^\infty \frac{E(X1_{Y=y_k})}{P(Y=y_k)}\mathbb 1_{Y=y_k}.$$ But if $Y$ may take on more than countably many values then how can I generate $\sigma(Y)$ like this? Oct 22, 2017 at 9:37
• You cannot (and I do not remember having suggested that one could or that this was necessary that one could).
– Did
Oct 22, 2017 at 14:07