What is the generalization of $\Pr[ x_1 < X \leq x_2, y_1 < Y \leq y_2]$ to three random variables? To n random variables? Given two random variables $X,Y$, it is well known that 
$\Pr[ x_1 < X \leq x_2, y_1 < Y \leq y_2]  = F_{X,Y}(x_2,y_2) - F_{X,Y}(x_1, y_2) - F_{X,Y}(x_2, x_1) + F_{X,Y}(x_1, y_1)$
Where $F_{XY}$ is the joint CDF of $X,Y$.
Is there a generalization of the above to three random variables $X,Y,Z$?
To $n$ variables $X_1, \ldots, X_n$?
I have looked at a few probability references but I couldn't find any. 
 A: Like with inclusion-exclusion,
$$
\mathbf{P}\{ a_1 < X_1 \le b_1,\dots,a_n < X_n \le b_n \} = \sum_{k = 0}^n (-1)^k \sum_{v \in S_k^{(n)}} F(v)
$$
where $S_k^{(n)} = \{(c_1,\dots,c_n) : c_i \in \{a_i, b_i\}, \text{ and } c_i = a_i \text{ for } k \text{ indices } i\}$.
One can prove this by induction:
\begin{align}
&\mathbf{P}\{ a_1 < X_1 \le b_1,\dots,a_n < X_n \le b_n, a_{n + 1} < X_{n + 1} \le b_{n + 1} \} \\
&\qquad= \mathbf{P}\{ a_1 < X_1 \le b_1,\dots,a_n < X_n, X_{n + 1} \le b_{n + 1} \} \\&\qquad- \mathbf{P}\{ a_1 < X_1 \le b_1,\dots,a_n < X_n, X_{n + 1} \le a_{n + 1} \} \\
&= \sum_{k = 0}^n (-1)^k \sum_{v \in S_k^{(n)}} F(v,b_{n+1}) - \sum_{k = 0}^n (-1)^k \sum_{v \in S_k^{(n)}} F(v,a_{n+1}) \\
&= \sum_{k = 0}^{n+1} (-1)^k \sum_{w \in S_k^{(n+1)}} F(w)
\end{align}
A: Use the inclusion-exclusion principle. For $P[(X,Y,Z)\in(x_{1},x_{2}]\times(y_{1},y_{2}]\times(z_{1},z_{2}]]=:P(C),$ we consider points in $A=(-\infty,x_{2}]\times(-\infty,y_{2}]\times(-\infty,z_{2}].$ We define the sets of points of $A$ with at least one coordinate less than the corresponding lower bound as 
\begin{align*}
A_{x}&=(-\infty,x_{1}]\times(-\infty,y_{2}]\times(-\infty,z_{2}],\\
A_{y}&=(-\infty,x_{2}]\times(-\infty,y_{1}]\times(-\infty,z_{2}],\\
A_{z}&=(-\infty,x_{2}]\times(-\infty,y_{2}]\times(-\infty,z_{1}].
\end{align*}
Similarly, we define the sets of points of $A$ with at least two coordinates less than their corresponding lower bounds as $$A_{x,y}=(-\infty,x_{1}]\times(-\infty,y_{1}]\times(-\infty,z_{2}],$$ as well as $A_{x,z}$ and $A_{y,z}.$ Finally, the set of points of $A$ with all coordinates less than or equal to their corresponding lower bounds is $$A_{x,y,z}=(-\infty,x_{1}]\times(-\infty,y_{1}]\times(-\infty,z_{1}].$$
Observe that $A_{x,y}=A_{x}\cap A_{y},$ and similarly for $A_{x,z},\,A_{y,z},$ and $A_{x,y,z}.$ Therefore, by inclusion-exclusion,
\begin{align*}
P(C)&=P(A)-P(A_{x})-P(A_{y})-P(A_{z})\\
&+P(A_{x,y})+P(A_{x,z})+P(A_{y,z})\\
&-P(A_{x,y,z}).
\end{align*}
Since each of the sets $P(A_{\bigstar})$ is just the value of $F_{X,Y,Z}$ at some point, we obtain the formula
\begin{align*}
P(C)&=F_{X,Y,Z}(x_{2},y_{2},z_{2})-F_{X,Y,Z}(x_{1},y_{2},z_{2})-F_{X,Y,Z}(x_{2},y_{1},z_{2})-F_{X,Y,Z}(x_{2},y_{2},z_{1})\\
&+F_{X,Y,Z}(x_{1},y_{1},z_{2})+F_{X,Y,Z}(x_{1},y_{2},z_{1})+F_{X,Y,Z}(x_{2},y_{1},z_{1})\\
&-F_{X,Y,Z}(x_{1},y_{1},z_{1}).
\end{align*}
We can repeat the same argument with $n$ variables to obtain a general formula, applying the general inclusion-exclusion formula. If $C=(x_{1}^{(1)},x_{2}^{(1)}]\times\cdots\times(x_{1}^{(n)},x_{2}^{(n)}],$ letting $A=(-\infty,x_{2}^{(1)}]\times\cdots\times(-\infty,x_{2}^{(n)}],$ and $$A_{i}=(-\infty,x_{2}^{(1)}]\times\cdots\times(-\infty,x_{1}^{(i)}]\times\cdots\times(-\infty,x_{2}^{(n)}]$$ for each $1\leq i\leq n,$ $C=A\setminus\bigcup_{i=1}^{n}A_{i}.$ Then $P(C)=P(A)-P(\bigcup_{i=1}^{n}A_{i}),$ and we may apply inclusion-exclusion to compute the probability of the union in terms of values of $F_{X_{1},\ldots,X_{n}}.$
