Let
$(\Omega, \mathcal F, \mathbb P)$ be a probability space.
$L_2(\Omega, \mathcal F, \mathbb R)$ be the Lebesgue space of square-integrable random variables from $(\Omega, \mathcal F, \mathbb P)$ to $(\mathbb R, \mathcal B(\mathbb R))$.
Then we define an inner product $\langle \cdot, \cdot \rangle_{L_2}$ by $$\langle X, Y \rangle_{L_2} \triangleq \int_\Omega X (\omega) Y (\omega) \mathrm d\mathbb P, \quad X, Y \in L_2(\Omega, \mathcal F, \mathbb R).$$
Then it's well-known that $L_2(\Omega, \mathcal F, \mathbb R)$ together with $\langle \cdot, \cdot \rangle_{L_2}$ is a Hilbert space. For $X,Y \in L_2(\Omega, \mathcal F, \mathbb R)$, the conditional expectation $\mathbb E[Y|X]$ of $Y$ given $X$ is defined as the orthogonal projection of $Y$ into the closed subspace $L_2(\Omega, \sigma(X), \mathbb R)$ of $L_2(\Omega, \mathcal F, \mathbb R)$. Then we also have $\mathbb E[Y|X] \in L_2(\Omega, \mathcal F, \mathbb R)$ is a random variable. In particular, $\mathbb E[Y |X=x] \triangleq \mathbb E[Y|1_{\{X=x\}}]$.
In my introductory probability, we define $\mathbb E[Y |X=x] \triangleq \frac{\mathbb E[Y1_{\{X=x\}}]}{\mathbb P[X=x]} \in \mathbb R$ if $\mathbb P[X=x] \neq 0$.
My questions:
How do we recover the classical real number $\mathbb E[Y |X=x]$ from the $L_2$-definition of $\mathbb E[Y |X=x]$?
In particular, what is the classical real value of $\mathbb E[Y |X=x]$ when $\mathbb P[X=x] = 0$?
The two definitions do not completely agree. $\sigma \{(X=x)\}= \{\emptyset, \Omega, (X=x), (X\neq x)\}$. According to the $L^{2}$ definition we get $E(Y|X=x)=\frac {E[Y1_{X=x}]} {P(X=x)} 1_{X=x}+\frac {E[Y1_{X\neq x}]} {P(X\neq x)} 1_{X\neq x}$ ( a two valued r.v. taking the value $\frac {EY1_{X=x}} {P(X=x)}$ on $(X=x)$ and the value $\frac {EY1_{X\neq x}} {P(X\neq x)}$ on $(X\neq x)$.
I am assuming that $0<P[X=x]<1$. $E[Y|X=x]=EY$ when $P[X=x]=0$ or $P[X=x]=1$. This is because $Y$ is independent of $\sigma (X)$ in this case.