Probability that the sum of two independent random variables is less than a certain value I would like to understand clearly why the following equality is true
$P[X+Y \leq z] = E_Y[P[X+Y] \leq z | Y]]$
I wrote the left part of the equation as follows:
$E_Y[P[X+Y] \leq z | Y]] = \sum_y y P[X+y \leq z]P(y)$
and I have tried with a toy example where $X$ and $Y$ are two $r.v$ that model the throw of a die and it works, but I would like to clearly understand why is it true, I know that is linked with the law of total probability right?
 A: It is clear that $E(1_A)=P(A)$ so
$$P(X+Y\leq z)=P(A)=E(1_A)\overset{(1)}{=}EE(1_A|Y)=E\bigg( E(1_A|Y)\bigg)=E\bigg(P(X+Y\leq z |Y)\bigg)$$
when $A=\{X+Y\leq z\}$
In $(1)$ we use Law_of_total_expectation.
Now you can 
$$E\bigg(P(X+Y\leq z |Y)\bigg)=\sum_{y} P(X+Y \leq z|Y=y) P_Y(y)=\sum_{y} P(X+y \leq z|Y=y) P_Y(y)$$
$$=\sum_{y} P(X \leq z-y|Y=y) P_Y(y)$$
since $X$ and $Y$ are independent 
$$=\sum_{y} P(X \leq z-y) P_Y(y)$$
A: $P[X+Y \le z] = \sum_{y \in Y}P[Y=y] \times P[X + y \le z] = \sum_{y \in Y}P[Y=y] \times P[X + Y \le z | Y=y] = E_Y[P(X + Y \le z | Y=y)]= E_Y[P(X + Y \le z | Y)]$
where the last equality is just a bit of notation.
A: In situations like this where a probability is involved it is often handsome to convert these probabilities to expectations by means of: $$P[A]=\mathbb E[1_A]$$
Doing so we find by means of the general rule $\mathbb E[Z]=\mathbb E[\mathbb E[Z\mid Y]]$ that:$$P\left[X+Y\leq z\right]=\mathbb{E}\mathbf{1}_{\left(-\infty.z\right]}\left(X+Y\right)=\mathbb{E}\left[\mathbb{E}\left[\mathbf{1}_{\left(-\infty.z\right]}\left(X+Y\right)\mid Y\right]\right]=$$$$\mathbb{E}\left[P\left[X+Y\leq z\mid Y\right]\right]$$
Here $P\left[X+Y\leq z\mid Y\right]$ is a random variable that is
measurable wrt $\sigma\left(Y\right)$ hence takes the shape $f\left(Y\right)$
for some function $f:\mathbb{R}\to\mathbb{R}$ that is Borel-measurable.
This function is determined by:
$$f\left(y\right)=P\left[X+Y\leq z\mid Y=y\right]=P\left[X+y\leq z\mid Y=y\right]=P\left[X\leq z-y\mid Y=y\right]$$
If moreover $X$ and $Y$ are independent then we can proceed  with:$$\cdots=P[X\leq z-y]$$
This leads to the observation that $$P[X+Y\leq z]=\mathbb Ef(Y)$$where $f(y)=P(X\leq z-y)$
