Issue with inequalities involving probablities I'm reading this paper http://eccc.hpi-web.de/report/2016/044/download/, at page 7 you can see this equation:

$$ \sum_t \mathbb{E}_{w \in W} [|p_t - p_{t|w,w}|] = 2 \sum_t \mathbb{E}_{w \in W} [\max(0,p_t - p_{t|w,w})]$$

I think what we're using here is this:
$$a+b+|a-b| = 2 \max(a,b)$$

but with $a=0$ and $b=p_t-p_{t|w,w}$ we get:
$$p_t - p_{t|w,w} + |p_t - p_{t|w,w}| = 2\max(0,p_t - p_{t|w,w})$$
I know it's a bit of a silly question but I just can't figure it out, maybe I'm missing some fact about probabilities?
This uses the fact that the L1-norm between two probability distributions is equal to twice their total variation distance.

See https://en.wikipedia.org/wiki/Total_variation_distance_of_probability_measures

To prove the equality you take the subset A in the definition to be the set of points where $$p_t &gt; p_{t|w,w}.$$