Why the two expressions of total variation distance are equivalent? In a stochastic processes textbook, I find the definition of total variation distance is $\|\pi - \nu\|_{TV} = \max\{|\pi(A) - \nu(A)|:A\subset S\}$ where $\pi$ and $\nu$ are two probability measures on $S$.
It then says it is easy to see that the maximum is obtained on the set $A = \{x:\pi(x) \ge \nu(x)\}$. Therefore $\|\pi -\nu\|_{TV} = \sum\limits_{\pi(x)\ge\nu(x)}(\pi(x) - \nu(x))$.
Why this statement is right? I thought according to the definition $\|\pi - \nu\|_{TV} = \|\pi - \nu\|_\infty$.
 A: I follow closely S. Roch, Chapter 1: Define $B:= \{x : \mu(x) \geq \nu(x)\}$. Then, for any $A \subseteq V$ we have that

\begin{equation*}
    \mu(A)-\nu(A) \leq \mu(A\cap B) - \nu(A \cap B) \leq \mu(B) - \nu(B),
\end{equation*}

were the first inequality comes from the monotonicity of the measures and the definition of $B$, and the same for the second inequality. Also, we have that, similarly,
\begin{align*}
    \nu(A) - \mu(A) \leq \nu(A \cap B^c) - \mu(A\cap B^c) \leq \nu(B^c) - \mu(B^c) \\= 1-\nu(B)-1+\mu(B) = \mu(B)-\nu(B).
\end{align*}
This means that
\begin{equation*}
   \vert\mu(A) - \nu(A)\vert \leq  \mu(B)-\nu(B) 
\end{equation*}
The equality is achieved when $A=B$. Hence we know that the supremum is given by this relation, we can simply re-write in the form of

\begin{equation}
    \mu(B) - \nu(B) = \frac{1}{2}\left(\mu(B)-\nu(B) + \nu(B^c) - \mu(B^c)\right) 
\end{equation}

But $$\frac{1}{2}(\mu(B)-\nu(B)) = \frac{1}{2}\sum_{x\in B}(\mu(x)-\nu(x))$$ and $$\frac{1}{2}(\nu(B^c)-\mu(B^c)) = \frac{1}{2}\sum_{x\in B^c}\vert \mu(x) - \nu(x)\vert$$ So finally we have that
\begin{equation*}
    \mu(B) - \nu(B) = \frac{1}{2}\sum_{x\in B}\vert \mu(x)-\nu(x)\vert + \frac{1}{2}\sum_{x\in B^c}\vert \mu(x) - \nu(x)\vert = \frac{1}{2}\sum_{x\in V}\vert \mu(x)-\nu(x) \vert.
\end{equation*}
