A well known fact in probability is that a uniform random variable on $[0,1]$ can be used to simulate any other probability distribution on $\mathbb{R}$.

A standard way of doing this is to define, given $\mu$ a probability on $\mathbb{R}$, the random variable $F(u,\mu) = \min\lbrace x \in \mathbb{R}: \mu((-\infty,x]) \ge u\rbrace$. The random variable $F(u,\mu)$ has distribution $\mu$.

Suppose now that $(X,d)$ is a compact metric space and let $\mathcal{P}(X)$ be the space of Borel probability measures on $X$ endowed with the topology of weak convergence.

**I'm looking for a reference for the following statement:**

There exists a Borel function $F:[0,1]\times \mathcal{P}(X) \to X$ such that if $u$ is a random variable whose distribution is uniform on $[0,1]$ then for each $\mu$ the random variable $F(u,\mu)$ has distribution $\mu$.