[proofplan]
We prove that the two coordinate marginals of the weak limit $\gamma$ are still $\mu$ and $\nu$. The key observation is that every bounded continuous [test function](/page/Test%20Function) on $X$ can be pulled back to a bounded continuous test function on $X \times Y$ by the first coordinate projection. [Weak convergence](/page/Weak%20Convergence) of $\gamma_n$ then passes the marginal identity from $\gamma_n$ to $\gamma$. The same argument with the second coordinate projection identifies the second marginal.
[/proofplan]
[step:Declare the coordinate projections and the marginals of the weak limit]
Let
\begin{align*}
p_X: X \times Y &\to X
\end{align*}
be the first coordinate projection, defined by $p_X(x,y)=x$, and let
\begin{align*}
p_Y: X \times Y &\to Y
\end{align*}
be the second coordinate projection, defined by $p_Y(x,y)=y$.
Since $\gamma \in \mathcal{P}(X \times Y)$ by hypothesis, define its marginals by pushforward:
\begin{align*}
\gamma_X := (p_X)_{\#}\gamma \in \mathcal{P}(X),
\qquad
\gamma_Y := (p_Y)_{\#}\gamma \in \mathcal{P}(Y).
\end{align*}
To prove $\gamma \in \Pi(\mu,\nu)$, it remains to show $\gamma_X=\mu$ and $\gamma_Y=\nu$.
[/step]
[step:Identify the first marginal by testing against bounded continuous functions on $X$]
Let
\begin{align*}
f: X &\to \mathbb{R}
\end{align*}
be an arbitrary bounded [continuous function](/page/Continuous%20Function). Define the pullback test function
\begin{align*}
F: X \times Y &\to \mathbb{R}
\end{align*}
by $F(x,y)=f(p_X(x,y))=f(x)$. Since $p_X$ is continuous and $f$ is bounded and continuous, $F$ is bounded and continuous on $X \times Y$.
By weak convergence $\gamma_n \rightharpoonup \gamma$ in $\mathcal{P}(X \times Y)$,
\begin{align*}
\lim_{n \to \infty} \int_{X \times Y} F(x,y)\, d\gamma_n(x,y)
=
\int_{X \times Y} F(x,y)\, d\gamma(x,y).
\end{align*}
For each $n \in \mathbb{N}$, the measure $\gamma_n$ belongs to $\Pi(\mu,\nu)$, so its first marginal is $\mu$. Therefore the pushforward identity gives
\begin{align*}
\int_{X \times Y} F(x,y)\, d\gamma_n(x,y)
=
\int_X f(x)\, d\mu(x).
\end{align*}
Taking the limit in $n$ yields
\begin{align*}
\int_{X \times Y} F(x,y)\, d\gamma(x,y)
=
\int_X f(x)\, d\mu(x).
\end{align*}
By the definition of $\gamma_X=(p_X)_{\#}\gamma$,
\begin{align*}
\int_X f(x)\, d\gamma_X(x)
=
\int_{X \times Y} F(x,y)\, d\gamma(x,y).
\end{align*}
Hence
\begin{align*}
\int_X f(x)\, d\gamma_X(x)
=
\int_X f(x)\, d\mu(x)
\end{align*}
for every bounded continuous function $f:X\to\mathbb{R}$. Since $X$ is Polish, Borel probability measures on $X$ are determined by their integrals against bounded continuous real-valued functions. Thus $\gamma_X=\mu$.
[guided]
We want to prove that the first marginal of $\gamma$ is $\mu$. The definition of equality of marginals is a statement about measures on $X$, so we test against an arbitrary bounded continuous function
\begin{align*}
f: X &\to \mathbb{R}.
\end{align*}
The only convergence hypothesis we have concerns measures on $X \times Y$, so we convert $f$ into a function on the product. Define
\begin{align*}
F: X \times Y &\to \mathbb{R}
\end{align*}
by $F(x,y)=f(x)$. Equivalently, $F=f\circ p_X$, where $p_X:X\times Y\to X$ is the first coordinate projection. Since $p_X$ is continuous and $f$ is bounded and continuous, the composition $F$ is bounded and continuous on $X\times Y$.
Now the definition of weak convergence applies to this particular test function $F$:
\begin{align*}
\lim_{n \to \infty} \int_{X \times Y} F(x,y)\, d\gamma_n(x,y)
=
\int_{X \times Y} F(x,y)\, d\gamma(x,y).
\end{align*}
For every $n$, the assumption $\gamma_n\in\Pi(\mu,\nu)$ means precisely that the first pushforward marginal of $\gamma_n$ is $\mu$. Therefore integrating $f$ against that first marginal is the same as integrating $f\circ p_X$ against $\gamma_n$:
\begin{align*}
\int_{X \times Y} F(x,y)\, d\gamma_n(x,y)
=
\int_X f(x)\, d\mu(x).
\end{align*}
The right-hand side does not depend on $n$, so passing to the limit gives
\begin{align*}
\int_{X \times Y} F(x,y)\, d\gamma(x,y)
=
\int_X f(x)\, d\mu(x).
\end{align*}
By definition of the first marginal $\gamma_X=(p_X)_{\#}\gamma$, the left-hand side is
\begin{align*}
\int_{X \times Y} F(x,y)\, d\gamma(x,y)
=
\int_X f(x)\, d\gamma_X(x).
\end{align*}
Thus
\begin{align*}
\int_X f(x)\, d\gamma_X(x)
=
\int_X f(x)\, d\mu(x)
\end{align*}
for every bounded continuous function $f:X\to\mathbb{R}$. On a Polish space, Borel probability measures are uniquely determined by all bounded continuous real-valued test functions. Applying this uniqueness principle gives $\gamma_X=\mu$.
[/guided]
[/step]
[step:Identify the second marginal by the same weak convergence argument]
Let
\begin{align*}
g: Y &\to \mathbb{R}
\end{align*}
be an arbitrary bounded continuous function. Define
\begin{align*}
G: X \times Y &\to \mathbb{R}
\end{align*}
by $G(x,y)=g(p_Y(x,y))=g(y)$. Since $p_Y$ is continuous and $g$ is bounded and continuous, $G$ is bounded and continuous on $X \times Y$.
Weak convergence gives
\begin{align*}
\lim_{n \to \infty} \int_{X \times Y} G(x,y)\, d\gamma_n(x,y)
=
\int_{X \times Y} G(x,y)\, d\gamma(x,y).
\end{align*}
For each $n \in \mathbb{N}$, the second marginal of $\gamma_n$ is $\nu$, so
\begin{align*}
\int_{X \times Y} G(x,y)\, d\gamma_n(x,y)
=
\int_Y g(y)\, d\nu(y).
\end{align*}
Passing to the limit and using $\gamma_Y=(p_Y)_{\#}\gamma$, we obtain
\begin{align*}
\int_Y g(y)\, d\gamma_Y(y)
=
\int_Y g(y)\, d\nu(y).
\end{align*}
This holds for every bounded continuous function $g:Y\to\mathbb{R}$. Since $Y$ is Polish, Borel probability measures on $Y$ are determined by their bounded continuous real-valued test functions. Hence $\gamma_Y=\nu$.
[/step]
[step:Conclude that the weak limit is a transport plan]
We have shown that the first marginal of $\gamma$ is $\mu$ and the second marginal of $\gamma$ is $\nu$. Since $\gamma \in \mathcal{P}(X\times Y)$ and $\Pi(\mu,\nu)$ is the set of probability measures on $X\times Y$ with these two marginals, it follows that
\begin{align*}
\gamma \in \Pi(\mu,\nu).
\end{align*}
This proves the weak closedness of the set of transport plans.
[/step]