Does $$\mathbb E[f(X,Y)\mid X=x]=\mathbb E[f(x,Y)\mid X=x]\ \ ?$$
I know that if $X$ and $Y$ are independent, this hold, but does it still hold if they are not independent ?
I tried as follow :
suppose first $f(x,y)=h(x)g(y)$. Then $$\mathbb E[h(X)g(Y)\mid X]=h(X)\mathbb E[g(Y)\mid X]=h(X)\mathbb E[g(Y)\mid X]=h(X)\mathbb E[g(Y)]$$
So if $\varphi (x)=\mathbb E[h(X)g(Y)\mid X=x]$, then $$\varphi (X)=h(X)\mathbb E[g(Y)],$$ i.e. $$\mathbb E[h(X)g(Y)\mid X=x]=\varphi (x)=h(x)\mathbb E[g(Y)]=\mathbb E[h(x)g(Y)],$$ as wished. Now, can I do the same if $X$ and $Y$ are not independent ? (in this simple cas where $f(x,y)=h(x)g(y)$). If yes, does the general result hold whenever $f$ is bounded and measurable ?