Measurability of the Wasserstein distance of a Markov kernel Consider two Polish metric spaces $(\mathcal{A}, \Sigma_\mathcal{A})$ and $(\mathcal{B}, \Sigma_\mathcal{B})$ endowed with their Borel $\sigma$-algebras. Let
$$a\mapsto \mu_a$$
be a Markov kernel, that is $\mu_a$ is a probability measure on $(\mathcal{B}, \Sigma_\mathcal{B})$ for all $a\in A$, and for any measurable set $B\in\Sigma_\mathcal{B}$ we have that $a\mapsto \mu_A(B)$ is a measurable function from $\mathcal A$ to $[0, 1]$.
Let $\mathcal{P}_\mathcal{B}$ be the space of probability measures on $(\mathcal{B}, \Sigma_\mathcal{B})$ and fix $\nu\in\mathcal{P}_\mathcal{B}$. Let $\mathcal{W}$ denote the $1$-Wasserstein distance (wrt to the metric on $\mathcal{B}$) between probability measures in $\mathcal{P}_\mathcal{B}$. Is the mapping
$$a\mapsto \mathcal{W}(\mu_a, \nu)$$
a measurable map $\mathcal A\to \mathbb R$?
I think that one way to prove the measurability would be to exploit Corollary 5.22 in [1], which essentially tells you that if $a\mapsto\mu_a$ is measurable wrt the Borel $\sigma$-algebra induced on $\mathcal{P}_\mathcal{B}$ by the weak measure convergence, then $a\mapsto\pi_a$ is measurable, where $\pi_a$ is the optimal coupling between $\mu_a$ and $\nu$. It would then follow that $a\mapsto \mathcal{W}(\mu_a, \nu) = \mathbb E_{(A,A')\sim\pi_a}[d(A, A')]$ is measurable. But is it actually true that $a\mapsto\mu_a$ is measurable?
The main reason for the question is that I have often encounter expressions like
$$\int_\mathcal A \mathcal{W}(\mathbb P_B, \mathbb P_{B|A=a})\,\mathrm d\mathbb P_A(a)$$
(where $A, B$ are coupled random variables, with marginals $\mathbb P_A$ and $\mathbb P_B$, and $\mathbb P_{B|A=a}$ is a regular conditional probability) without any formal justification, see for instance [2] and the papers it builds on. But does this expression actually make sense? Is the integrand always measurable?
[1] Villani, Optimal transport, old and new, 2008.
[2] Rodríguez-Gálvez, Tighter expected generalization error bounds via Wasserstein Distance, 2021.
 A: Yes, $a \mapsto \mu_a$ is a measurable map from $\mathcal{A}$ to $\mathcal{P}_\mathcal{B}$.
The topology of weak convergence on $\mathcal{P}_B$ is induced by the maps of the form $\mathcal{P}_B \to \mathbb{R}, \,\nu \mapsto \nu\left(f\right)$, with $f \in C_b\left(\mathcal{B}\right)$ and
$$\nu(f) := \int_\mathcal{B} fd\nu,$$
and the Borel $\sigma$-algebra on $\mathcal{P}_\mathcal{B}$ is also generated by these functions. Thus it suffices to show that the maps $\mathcal{A} \to \mathbb{R}, \,a \mapsto \mu_a\left(f\right)$ are measurable for all $f \in C_b\left(\mathcal{B}\right)$.
Fix an $f \in C_b\left(\mathcal{B}\right)$. We can approximate $f$ by a sequence of simple functions $\left(f_n\right)$ such that $f_n \uparrow f$ uniformly. $a \mapsto \mu_a\left(f_n\right)$ is clearly measurable as the linear combination of measurable function. Then $a \mapsto \mu_a\left(f\right)$ is measurable as the limit of measurable functions,
$$ a \mapsto \mu_a\left(f\right) = \lim_{n\to \infty} \left(a\mapsto \mu_a\left(f_n\right)\right).$$
Also another way to verify that $a\mapsto \mathcal{W}\left(\mu_a, \nu\right)$ is measurable is to use the fact that $\mathcal{P}_{\mathcal{B}\times\mathcal{B}}$ is a Polish metric space
as $\mathcal{B}\times\mathcal{B}$ is.
That plus the fact that $$\pi \mapsto \int_{\mathcal{B}\times\mathcal{B}}d(x, y)\pi\left(dx, dy\right)$$
is continuous on $$\mathcal{P}_{\mathcal{B}\times\mathcal{B}}^1 :=\left\{\pi \in \mathcal{P}_{\mathcal{B}\times\mathcal{B}} : \int_{\mathcal{B}\times\mathcal{B}}\left[d\left(x', x\right) + d\left(y', y\right)\right]\pi\left(dx dy\right) < \infty\right\} $$
where $x', y' \in \mathcal{B}$ are any two points,
the following set is separable
$$\Pi^1\left(\mu_a, \nu\right)  := \left\{\pi \in \mathcal{P}_{\mathcal{B}\times\mathcal{B}}^1 : \pi\left(\mathcal{B} \times A\right) = \mu_a\left(A\right) \text{ and } \pi\left(A \times \mathcal{B}\right) = \nu\left(A\right) \; \forall A \in \mathcal{B}\right\} $$
and
$$\inf_{\pi \in \Pi^1\left(\mu_a, \nu\right)}\int_{\mathcal{B}\times\mathcal{B}}d(x, y)\pi\left(dx, dy\right) = \inf_{\pi \in Z}\int_{\mathcal{B}\times\mathcal{B}}d(x, y)\pi\left(dx, dy\right), $$
for a dense countable set $Z \subset \Pi^1\left(\mu_a, \nu\right)$. Thus the infimum does not pose any measurability problems.
