Solution (source code)

= Solution

Let $X=\rho-\sigma=X_+-X_-$ be its positive-negative spectral decomposition and let $P$ project onto the support of $X_+$. Since $\operatorname{Tr}X=0$, $\operatorname{Tr}X_+=\operatorname{Tr}X_-=\|X\|_1/2$. Thus
$$
|\operatorname{Tr}(PX)|+|\operatorname{Tr}((I-P)X)|
=\operatorname{Tr}X_++\operatorname{Tr}X_-
=\boxed{\|\rho-\sigma\|_1}.
$$