Solution (source code)

= Solution

Write $d\mu=f(x)\,dx$, with $f\geq0$. Applying <polar coordinates> and <Fubini's theorem> gives, for bounded nonnegative measurable $h$,
$$
\int h\,d\widetilde\mu=\int_0^\infty h(r)g(r)\,dr,\qquad g(r)=\sigma_d r^{d-1}\int_{\mathbb S^{d-1}}f(r\theta)\,d\sigma(\theta)\quad(r>0).
$$
Also $\widetilde\mu(\{0\})=\mu(\{0\})=0$ by <absolute continuity of measures>. Extending $g$ by zero on the negative half-line proves
$$
\boxed{\widetilde\mu\ll\mathcal L^1.}
$$

Both radial <pushforward measures> have compact <support of a measure>, so <Brenier's theorem> on the line supplies a unique optimal <transport plan> and a <transport map> $\tau$, unique $\widetilde\mu$-almost everywhere, with
$$
\boxed{\begin{aligned}d_2^2(\widetilde\mu,\widetilde\nu)&=\min_{s_\#\widetilde\mu=\widetilde\nu}\int_0^\infty|r-s(r)|^2\,d\widetilde\mu(r)\\&=\int_0^\infty|r-\tau(r)|^2\,d\widetilde\mu(r).\end{aligned}}
$$
In one dimension, the <gradient> of a <convex function> is a <nondecreasing function>. Nonnegativity holds $\widetilde\mu$-almost everywhere because $\tau_\#\widetilde\mu=\widetilde\nu$ is carried by $[0,\infty)$. To choose a nonnegative, nondecreasing representative everywhere, let $F,G$ be the radial <cumulative distribution functions> and use the <monotone rearrangement>
$$
\boxed{\tau(r)=G^{-1}(F(r)),\qquad G^{-1}(u)=\inf\{s\geq0:G(s)\geq u\}\quad(0<u<1).}
$$
At $F(r)=0$ set $\tau(r)=0$, and at $F(r)=1$ use the largest point of the <support of a measure> $\widetilde\nu$. These choices preserve monotonicity and boundedness. Since $F$ is continuous, $F(R)$ has the <uniform distribution> on $(0,1)$ when $R$ has law $\widetilde\mu$, and the <quantile function> $G^{-1}$ sends this <uniform distribution> to $\widetilde\nu$. Thus this representative has the required <pushforward measure>, even if the target has atoms.