Let $(\Omega, \mathcal F, P)$ be a probability space, and let $\mathcal G \subseteq \mathcal F$ be a sub-$\sigma$-algebra of $\mathcal F$ and $X : \Omega \to \mathbb R$ a random variable. Then the conditional expection of $X$ conditioned on $\mathcal G$ is defined to be the a.e. unique random variable $Y$ such that


(i) $Y$ is $\mathcal G$-measurable, and


(ii) for each $A \in \mathcal G$ we have
$$
 E[X\cdot 1\_A] = E[Y\cdot 1\_A].
$$
And it is denoted as $Y := E[X | \mathcal G]$. For a random variable $Z$ the conditional expection conditioned on $Z$ is defined as $E[X | Z] := E[X | \sigma(Z)]$.


These two notions are equivalent, so now my question. Given a condtional expectation $E[X | \mathcal G]$ w.r.t. some sub-$\sigma$-algebra $\mathcal G$, how to find a random variable $Z$ such that
$$
 E[X | Z] = E[X | \mathcal G] \quad \mbox{a.e.}?
$$



Conversion between condtional expection conditioned on $\sigma$-algebra and on r.v
If you want a *real-valued* random variables $Z$, then $\mathcal G$ must be countably generated. (At least up to null sets.)


Suppose $\mathcal G$ is countably generated. We want to find a random variable $Z \colon \Omega \to \mathbb R$ such that $\sigma(Z) = \mathcal G$. Say $\mathcal G$ is generated by $A\_1, A\_2, \dots$. How about
$$
Z = \sum\_{k=1}^\infty 3^{-k} \mathbb 1\_{A\_k}
$$
(here $\mathbb 1\_A$ is the indicator function of $A$).


On the other hand, if $\mathcal G = \sigma(Z)$, then $\mathcal G$ is generated by
the countable family $E\_r = \{Z>r\}$, where $r$ ranges over the rationals.


