Indicator functions for random variables in d dimentional rectangles $a,b,c$ are vectors in $\Bbb{R}^d$ and $X$ is a random variable distributed in $\Bbb{R}^d$
and $N_a(c) = \sum_i \delta(c_i , a_i)$ and $\delta(x,x) = 1$ otherwise $0$
Assuming $a \leq b$   
$I(a,b](X) = \prod_{i=1}^dI(a_i , b_i](X_i)$ 
$(A)= \prod_{i=1}^dI(-\infty , b_i](X_i) - I(-\infty , a_i](X_i)$ 
$(B)= \sum_{c \in a \times b} (-1)^{N_a(c)} \prod_{i=1}^d I(-\infty , c_i](X_i)$
I am very confused as how goes from $(A)$ to $(B)$. Could I have some explanation? What would be some intuition or some intermediary steps? Any advice would be greatly appreciated 
 A: Let's break it down in simpler notation, what you have here is simply
$$\prod_{i=1}^d(y_i-x_i) \;\;\; (A)$$
where $y_i= I(-\infty , b_i](X_i)$ and $x_i= I(-\infty , a_i](X_i)$.
If you work that product out, you'll have 
$$\sum_{z\in x\times y} (-1)^{N_{x}(z)} \prod_{i=1}^d z_i$$
$z\in x\times y$ means that the $i$th component of z will be either equal to the $i$th component of $x$, either the $i$th of $y$. For each component of $x$, that you pick up in working out the product $(A)$, you also pick up a $-1$ sign. You don't for a component of $y$. That's what the factor $(-1)^{N_{x}(z)}$ is for. So, you get a sum over all possible mixes of components of products of those components from $1$ to $d$. 
Take for instance $d=2$, then $(A)$ becomes
$$(y_1-x_1)(y_2-x_2) = y_1y_2 - x_1 y_2 - x_2 y_1 + x_1 x_2 \\ = (-1)^0y_1y_2+(-1)^1 x_1y_2+ (-1)^1y_1x_2 + (-1)^0x_1x_2
\\ = (-1)^{N_x(y_1,y_2)}y_1y_2+(-1)^{N_x(x_1,y_2)} x_1y_2+ (-1)^{N_x(y_1,x_2)}y_1x_2 + (-1)^{N_x(x_1,x_2)}x_1x_2$$
I hope this clears it up.
