Multidimensional distributions and rectangles Let $\mathbf{X}$ be a random vector whose distribution function is $F$.

Is there a simple way to prove that, if $A:=\prod_{i=1}^n(a_i,b_i]$, and $V=\prod_{i=1}^n\{a_i,b_i\}$ then
  \begin{equation}
P(A):=\sum_{\mathbf{v}\in V}\sigma(\mathbf{v})F(\mathbf{v})
\end{equation}
  being $\sigma(\mathbf{v})=(-1)^{\#a_i\in\mathbf{v}}$?

My idea approach is really messy, dividing the rectangle $\prod_{i=1}^n(-\infty,b_i]$ in $2^n$ disjoint rectangles, being $A$ one of them and then trying to prove that $F(\mathbf{b})-\sum_{\Gamma_1}\cdots\sum_{\Gamma_n}P(\mathbf{X}^{-1}(\prod_{i=1}^n\Gamma_i))=2P(A)$, and I'm having a really hard time trying to make it work. Any ideas?
 A: If you start by thinking about it in two dimensions, what you want to show is that $P(A) = F(b_1,b_2)-(F(a_1,b_2)+F(b_1,a_2))+F(a_1,a_2)$.
You can think of this as follows: Let $B$ be $(-\infty,b_1] \times (-\infty,b_2]$, $A_1$ be $(-\infty,b_1] \times (-\infty,a_2]$ and $A_2$ be $(-\infty,a_1] \times (-\infty,b_2]$. Then $P(A) = P(B) - P(A_1 \cup A_2)$, which is easy to see by drawing a picture.
You can then compute $P(A_1 \cup A_2)$ by using the inclusion-exclusion principle as follows: $P(A_1 \cup A_2) = P(A_1) + P(A_2) - P(A_1 \cap A_2)$. Since $A_1 \cap A_2 = (-\infty,a_1] \times (-\infty,a_2]$, you see that $P(B) = F(b_1,b_2)$, $P(A_1) = F(b_1,a_2)$, $P(A_2) = F(a_1,b_2)$ and $P(A_1 \cap A_2) = F(a_1,a_2)$, so $P(A) = P(B) - P(A_1 \cup A_2)$ will give you what you want.
I think you can extend this argument to higher dimensions by using the general version of the inclusion-exclusion principle. The idea is to start with $P(b_1,b_2,\ldots,b_n)$ and then use inclusion-exclusion to sequentially subtract-and-correct.
