This is a simple question, but I'm having a hard time finding an answer elsewhere. Let's say that you have a binary random variable $X \in \{0, 1\}$ and a continuous random variable $Y \in \mathbb{R}$. I understand that if you want to find the CDF of $Y$, i.e. $P(Y \leq y)$, you can write it as: $$P(Y \leq y) = P(X = 0)P(Y \leq y | X = 0) + P(X = 1)P(Y \leq y | X = 1)$$ which is useful if $X$ and $Y$ are not independent.
Here's my question. Suppose that I have another continuous random variable $Z \in \mathbb{R}$ and that I want to find $P(Y \leq y | Z \leq z)$. Should I write it as: $$P(Y \leq y | Z \leq z) = P(X = 0)P(Y \leq y | X = 0 \cap Z \leq z) + P(X = 1)P(Y \leq y | X = 1 \cap Z \leq z)$$ or as: $$P(Y \leq y | Z \leq z) = P(X = 0 | Z \leq z)P(Y \leq y | X = 0 \cap Z \leq z) + P(X = 1 | Z \leq z)P(Y \leq y | X = 1 \cap Z \leq z)$$? In other words, does the conditionality on $Z$ also show up in the $P(X = 0)$ and $P(X = 1)$ or not?
My actual application for context if people are curious:
I have two independent random variables $M \in [0, \infty)$ and $\Theta \in [0, \frac{\pi}{2}]$ and their associated CDFs. I want to find the CDF of a third random variable $T \in [0, 1)$, which is related to the first two by the piecewise equation: $$T = \begin{cases} 0, & \Theta \geq \theta_{max} \cup M \leq \tan(\Theta) \\ g(M, \Theta), & \Theta \leq \theta_{max} \cap M \geq \tan(\Theta) \cap M\cos(\Theta) \leq A \\ h(M, \Theta), & \Theta \leq \theta_{max} \cap M \geq \tan(\Theta) \cap M\cos(\Theta) \geq A \end{cases}$$ where $A$ is a constant and $g(\cdot)$ and $h(\cdot)$ are continuous and monotonic in both $M$ and $\Theta$. I know how to find $P(T = 0)$, and I would like to find $P(T \leq t)$ for $t > 0$ using: $$P(T \leq t) = P(T = 0) + (1 - P(T = 0))[P(M\cos(\Theta) \leq A)P(T \leq t) | \Theta \leq \theta_{max} \cap M \geq \tan(\Theta) \cap M\cos(\Theta) \leq A) + P(M\cos(\Theta) \geq A)P(T \leq t) | \Theta \leq \theta_{max} \cap M \geq \tan(\Theta) \cap M\cos(\Theta) \geq A)]$$ but I'm not sure if the $P(M\cos(\Theta) \leq A)$ and $P(M\cos(\Theta) \geq A)$ should also be conditioned on $\Theta \leq \theta_{max} \cap M \geq \tan(\Theta)$.
It would be the second one. Let $A = \{Y \leq y\}$ and $B = \{Z\leq z\}$ and for $i\in\{0,1\}$ let $C_i = \{X=i\}$. Then you want to compute $P(A|B)$ (assuming $P(B\cap C_i)>0$ for each $i$). Then,
$$P(A|B) = \frac{P(A\cap B)}{P(B)}.$$
For $i\in\{0,1\}$,
$$P(C_i|B)P(A|B\cap C_i) = \frac{P(C_i\cap B)}{P(B)}\frac{P(A\cap B\cap C_i)}{P(B\cap C_i)} = \frac{P(A\cap B\cap C_i)}{P(B)} = P(A\cap C_i|B).$$
Then,
$$P(Y\leq y|Z\leq z) = P(A|B) = \sum_{i=0}^1P(A\cap C_i|B) = \sum_{i=0}^1P(X=i|Z\leq z)P(Y\leq y|\{Z\leq z\}\cap \{X=i\}).$$