Replacing a random variable in a conditional expectation Suppose that $X$,$Y$, and $Y'$  are independent and identically distributed random variables defined on some probability space $(\Omega,\mathcal F,P)$. Assume that $f:\mathbb R^2\to\mathbb R$ is a measurable function so that
$$
f(X,Y)
$$
is a random variable. Consider the conditional expectation
$$
\operatorname E[f(X,Y)\mid\sigma(X)],
$$
where $\sigma(X)$ is the $\sigma$-algebra generated by $X$.

Is it true that $$\operatorname E[f(X,Y)\mid\sigma(X)]=\operatorname E[f(X,Y')\mid\sigma(X)]$$ almost surely? In other words, does the replacement of $Y$ with an independent and identically distributed copy $Y'$ change the conditional expectation? If it does not, how can we make sure that the conditional expectation remains unchanged?

Since the conditional expectation is with respect to the $\sigma$-algebra generated only by $X$, it seems that it should indeed be the case. Roughly speaking, the conditional expectation only depends on $X$ and we change $Y$ with an independent and identically distributed copy $Y'$. But I am trying to come up with some sort of a more rigorous argument.
Any help is much appreciated!
 A: Yes, it is true. For any Borel set $A$ in $\mathbb R$, $\int_{X^{-1}(A)} f(X,Y)dP=\int_{X^{-1}(A)} f(X,Y')dP$ because $(X,Y)$ has the same two dimensional distribution as $(X,Y')$.
$$\int_{X^{-1}(A)} f(X,Y)dP$$ $$=\int_{A\times \mathbb R} f(x,y)dF_X(x)dF_Y(y)$$$$=\int_{A\times \mathbb R} f(x,y)dF_X(x)dF_Y'(y)$$ $$=\int_{X^{-1}(A)} f(X,Y')dP$$
A: Under those circumstances $E[f(X,Y)|X]=\int f(X,y)dP_Y$.
Equality follows from being $P_Y=P_{{Y}'}$.
A: Maybe this answer is not very formal, but I think it may be convincing that the result generally holds.
$$E[f(X,Y)|X=\overline{x}]=\int p_{Y|X}(Y=y|X=\overline{x}) f(\overline{x},y) dy \ (1)$$
Now:
$$p_{Y|X}(Y=y|X=\overline{x})=(\text{independence of Y and X})=$$
$$=p_Y(y)=(\text{Y and Y' are identically dstributed})=p_{Y'}(y)=$$
$$=(\text{reverse previous steps})=p_{Y'|X}(Y'=y|X=\overline{x})$$
, so that substituting into (1):
$$E[f(X,Y)|X=\overline{x}]=\int p_{Y'|X}(Y'=y|X=\overline{x}) f(\overline{x},y) dy=E[f(X,Y')|X=\overline{x}]$$
from this we can conclude/be convinced that:
$$E[f(X,Y)|X]=E[f(X,Y')|X]$$
which is just a different way of writing:
$$E[f(X,Y)|\sigma(X)]=E[f(X,Y')|\sigma(X)]$$
