Solution (source code)

= Solution

Put $\nu=(T^\dagger)_\#\mu$ and use the two <Kantorovich potentials>
$$
u(x)=(1-\lambda)|x|^2,\qquad
v(y)=\left(1-\frac1\lambda\right)|y|^2.
$$
For every $x,y\in\mathbb R^d$,
$$
\begin{aligned}
|x-y|^2-u(x)-v(y)
&=\lambda|x|^2+\lambda^{-1}|y|^2-2x\cdot y\\
&=\lambda^{-1}|y-\lambda x|^2\geq0.
\end{aligned}
$$
Thus the pair is dual feasible, with equality precisely on $y=\lambda x$. Finite second <moments> make both potentials integrable; compactness of $X$ is more than sufficient. For any admissible <transport map> $T$, integrating the inequality and using its <pushforward measure> gives
$$
\int|x-T(x)|^2\,d\mu\geq\int u\,d\mu+\int v\,d\nu.
$$
The admissible map $T^\dagger(x)=\lambda x$ attains equality. Consequently
$$
\boxed{T^\dagger(x)=\lambda x\ \text{is optimal},\qquad\min\mathbb M=(1-\lambda)^2\int|x|^2\,d\mu.}
$$
The same certificate proves optimality of its graph <transport plan> among all <transport plans>. Notice that $u$ need not be a <convex function> when $\lambda>1$: it is a cost dual potential. The associated <convex> gradient potential is instead $\Phi(x)=\lambda|x|^2/2$.