I have a basic question on conditional expectation. First I'll summarize my understandig of them (could be wrong).
On a probablity space $(\Omega,\mathcal{A},\mathbb{P})$ the conditional expectation $\mathbb{E}[ X \vert \mathcal{H} ]$ of an $\mathbb{P}$-integrable random number $X$ conditioned on a sub-$\sigma$-field $\mathcal{H}\subset \mathcal{A}$ is the almost sure unique $\mathbb{P}$-integrable and $\mathcal{H}$-measurable random number $E$ with
\begin{equation} \int_A E \; d\mathbb{P} = \int_A X \; d\mathbb{P}, \qquad\qquad \forall \; A\in\mathcal{H} \end{equation}
In particular $\mathbb{E}[X\vert \mathcal{H}] = \mathbb{E}X$ almost surely, if $X$ and $\mathcal{H}$ are independent.
If $\mathcal{H}=\sigma H$ for a random variable $H$ in some measurable space $(S,\mathcal{S})$, then $\mathbb{E}[ X \vert H ]=\mathbb{E}[X\vert \mathcal{H}]$ has the form $E = f\circ H$ for a $\mathcal{S}$/$\mathcal{B}$-measurable function $f:S\rightarrow \mathbb{R}$. One writes $\mathbb{E}[ X \vert H=s ] = f(s)$ for $s\in S$.
Now lets say $X$ is of the form $X=g(Y,H)$ for a measurable function $g$ and a random variable $Y$, where $Y$ is independent of $H$.
Now the question: What is $\mathbb{E}[ g(Y,H) \vert H=s ]$ ? is it $\mathbb{E}[ g(Y,s) ]$ ?
Let $\phi(s) = \mathbb E[g(Y, s)]$. Further let $B = H^{-1}(A)\in\sigma (H)$ for some suitable $A\in\mathcal S$. We want to show that $$ \int_B \phi(H) d\mathbb P = \int_B g(Y, H) d\mathbb P. $$
Say $Y$ maps into the measurable space $(T,\mathcal T)$. Then, we have \begin{align} \int_B \phi(H(\omega)) \;d\mathbb P(\omega) &= \int_\Omega 1_A(H(\omega)) \phi(H(\omega)) \;d\mathbb P(\omega) \\ &= \int_S 1_A(s) \phi(s) \;d(\mathbb P\circ H^{-1})(s) \\ &= \int_S 1_A(s) \int_T g(t, s) \;d(\mathbb P\circ Y^{-1})(t) \;d(\mathbb P\circ H^{-1})(s) \\ &= \int_{T\times S} 1_A(s) g(t, s) \;d(\mathbb P \circ (Y, H)^{-1})(t, s) \\ &= \int_\Omega 1_A(H(\omega)) g(Y(\omega), H(\omega)) \;d\mathbb P(\omega) \\ &= \int_B g(Y(\omega), H(\omega)) \;d\mathbb P(\omega). \\ \end{align} The 4th equation uses the fact that $Y,H$ are independent.