If

, then the right-hand side goes to infinity (it is greater than

), so that the equality holds.

Suppose now

. In order to take the limit as

, we have to justify

.

This can be written

. However, we have

, and the bounded convergence theorem shows that the right-hand sides converges to 0 since

.

-------------

There's another solution without taking a limit. This involves Fubini theorem for double series.

Indeed, if you write

\sum_{k=0}^\infty (1-F_X(k))=\sum_{k=0}^\infty \sum_{i=k+1}^\infty p(i) = \sum_{k=0}^\infty \sum_{i=0}^\infty {\bf 1}_{(i>k)} p(k)" alt="

\sum_{k=0}^\infty (1-F_X(k))=\sum_{k=0}^\infty \sum_{i=k+1}^\infty p(i) = \sum_{k=0}^\infty \sum_{i=0}^\infty {\bf 1}_{(i>k)} p(k)" />,

the equality amounts to interchange the sum signs, I let you get convinced of this.