I am having trouble understanding $E[\cdot |X = x]$. Now I know measure theory and the theory of conditional expectations decently well. So I understand that $E[h(X,Y) | X]$ is a random variable of the form $g(X)$ and it makes sense to call $g(x)$ $E[h(X,Y) | X = x]$.
Now I have a couple of questions regarding this. First, the function $g(x)$ is only determined on the range of $X$. So does this mean that anytime anyone writes $E[\cdot | X= x]$ they are implicitly requiring that $x$ is indeed a value achieved by $x$? Next, it is sometimes be the case that $[X=x]$ is a null set and since $E[\cdot | X]$ is only determined upto null sets itself, does that cause any issues?
Also, and this is my main question, people often freely replace $E[h(X,Y) | X=x]$ with $E[h(x,Y)|X=x]$. Can you give me a proof of why this is valid?
$E( \cdot |X=x)$ is just a notation.For the last question, when $X$ and $Y$ are independent,$E[h(X,Y)|X]=(E[h(x,Y)])_{x=X}=g(X)$.So $E[h(X,Y)|X=x]=E[h(x,Y)]=g(x)$