TITLE: Measurability of a total variation metric
QUESTION [6 upvotes]: Let $X$ be a standard Borel space and let us denote by $\mathcal P(X)$ the space of Borel probability measures on $X$ endowed with the topology of weak convergence. Define $d:\mathcal P(X)\times \mathcal P(X)\to [0,1]$ by
$$
  d(p,q) := \sup_{A\in \mathcal B(X)}|p(A) - q(A)|
$$
to be the total variation metric on $\mathcal P(X)$. I wonder whether $d$ is a measurable function.
Since the topology induced by $d$ is stronger than the weak convergence, it is not a continuous function on $\mathcal P(X)$ and hence I can't use this argument to show the measurability. Perhaps, there is a way of showing measurability of $d$ based on the fact that the $\sigma$-algebra of $\mathcal P(X)$ can be equivalently defined as the one generated by evaluation maps $\theta_A(p):=p(A)$.

REPLY [2 votes]: Following up on the idea of Davide to express $d$ as a supremum over a countable collection of sets, let me give a purely measure-theoretical proof, which also holds true for a slightly more general case, and is based on Davide's question here.

The metric $d$ is a measurable function if the underlying measurable space  $(X,\mathfrak B_X)$ is separable.

The fact that $(X,\mathfrak B_X)$ is separable means that there exists a countable collection of sets that generates $\mathfrak B_X$. In particular, the algebra $\mathfrak A$ generated by this collection is countable as well.  It follows that for any finite positive measure $\mu$ on $(X,\mathfrak B_X)$, set $B\in \mathfrak B_X$ and positive real $\epsilon>0$ there exists a set $A\in \mathfrak A$ such that $\mu(A\Delta B)\leq\epsilon$. Note in particular, that the latter condition implies that $|\mu(A) - \mu(B)|\leq\epsilon$. Indeed, 
$$
  \mu(A) - \mu(B) = \mu(A\setminus B) - \mu(B\setminus A) \leq  \mu(A\setminus B) + \mu(B\setminus A) = \mu(A\Delta B)\leq \epsilon
$$
and the same applies to $\mu(B) - \mu(A)$.
Let us define $d'(p,q):= \sup_{A\in \mathfrak A}|p(A) - q(A)|$. Since $\mathfrak A$ is a countable collection, and $|p(A) - q(A)|$ is a measurable function of $(p,q)$ for any $A\in \mathfrak A$, we obtain that $d'$ is a measurable function as well. Let us show now that $d = d'$: clearly, $d\geq d'$. For the reverse inequality, let probability measures $p,q$ and a set $B\in \mathfrak B$ be arbitrary. Denote $\mu:= p+q$; for any $\epsilon>0$ there exists $A_\epsilon\in \mathfrak A$ such that $\mu(A_\epsilon\Delta B)\leq \epsilon$. In particular, $p(A_\epsilon\Delta B)\leq \epsilon$ and $q(A_\epsilon\Delta B)\leq \epsilon$ so that as above $|p(A_\epsilon) - p(B)|\leq\epsilon$ and $|q(A_\epsilon) - q(B)|\leq\epsilon$. Thus
$$
  |p(B) - q(B)|\leq |p(B) - p(A_\epsilon)| + |p(A_\epsilon) - q(A_\epsilon)| + |q(A_\epsilon) - q(B)|\leq d'(p,q) + 2\epsilon.
$$
Since $\epsilon>0$ is arbitrary here, we obtain $|p(B) - q(B)|\leq d'(p,q)$ and thus $d(p,q)\leq d'(p,q)$ as desired.