Sampling from an arbitrary distribution on Polish spaces Let $U\sim \text{Unif}(0,1)$, and let $\mu \in \mathcal{P}(\mathbb{R})$ be an arbitrary probability measure on $\mathbb{R}$. Then from $\mu$, we can derive an associated CDF $F(x) = \mu((-\infty,x])$. We consider the following inverse of $F$:
$$F^{-1}(u) = \inf\{x \in \mathbb{R}: F(x) \geq u\}.$$
Then it's easy to show that $F^{-1}(U)\sim \mu$. In other words, $F^{-1}(U)$ is a sample of a random variable distributed like $\mu$.
Is there a similar construction when we now assume that $\mu \in \mathcal{P}(S)$ is a probability distribution on some arbitrary Polish space $S$? That is, does there exist a random element $X$ taking values in some other Polish space $T$ and a mapping $\psi: \mathcal{P}(S) \to (T \to S)$ from probability measures on $S$ to measurable functions from $T$ to $S$ such that $\psi(\mu)(X)\sim \mu$ for all $\mu \in \mathcal{P}(S)$?
I would be interested in proofs that such a mapping exists (or even more interesting, doesn't), but it would be absolutely amazing if the proof was constructive. I'd also be interested in references to the literature where this problem may have already been addressed. Thank you!
 A: By "measurable", here, I presume you mean "Borel measurable" and that your probability measures are all Borel probability measures. If so, the answer is yes. In fact, you can always take $\ X\sim \text{Unif}(0,1)\ $.
Here's a theorem I proved in Differential Games with No Information, SIAM J. Control Optim., 15(2), p.242 (Theorem 5.1):

If $\ S\ $ is a complete separable metric space and $\ \mu\ $ a Borel probability measure on $\ S\ $, then there exists a Borel measurable function $\ \phi:(0,1)\rightarrow S\ $ which has $\ \mu\ $ as its distribution with respect to Lebesgue measure on $\ (0,1)\ $. That is, $\ \text{m}(\{\alpha\in(0,1); \phi(\alpha)\in A\})=$$\,\mu(A)\ $ for any Borel subset $\ A\ $ of $\ S\ $.

Here, I have replaced the symbols "$Z$" and "$\Pi$" which originally appeared in my statement of the theorem with "$S$" and "$\mu$", respectively.
All the heavy lifting in the theorem's proof comes from Section 1.2, The Isomorphism Theorem, in K.R.Parthasarathy, Probability Measures on Metric Spaces.  The key results from this book are Theorem 2.8, from which it follows that either $\ S\ $ is countable or has the same cardinality as $\ \mathbb{R}\ $, and the isomorphism theorem itself (Theorem 2.14).  The latter implies that when $\ S\ $ has the same cardinality as $\ \mathbb{R}\ $, there exists a Borel measurable bijection $\ \zeta:\mathbb{R}\rightarrow S\ $ such that $\ \zeta^{-1}\ $ is Borel measurable. Thus, if $\ \mu\ $ is a Borel probability measure on $\ S\ $, then $\ \mu_\mathbb{R}(A)=$$\mu(\zeta(A))\ $ defines a Borel probability measure on $\ \mathbb{R}\ $, and you already know that if $\ F\ $ is the distribution function of $\ \mu_\mathbb{R}\ $ then  $\ F^{-1}(X)\sim\mu_\mathbb{R}\ $ (where $\ X\sim \text{Unif}(0,1)\ $). It then follows that $\ \zeta    F^{-1}(X)\sim\mu\ $.
The proof of the theorem for the case when $\ S\ $ is countable is straightforward.
