Suppose $X$ and $Y$ are two continuous random vectors and $ m = |Y|$ is a discrete random variable that denotes the size of the continuous random vector $Y$, i.e. the number of its columns (the cardinality) is random.
$$p(\mathbf{Y}|\mathbf{X}) = \sum_{i=0}^{\infty}p(\mathbf{Y},i|\mathbf{X})\delta(i-|\mathbf{Y}|) = p(\mathbf{Y},|\mathbf{Y}||\mathbf{X}) = p(\mathbf{Y},m|\mathbf{X})$$
I need to know what probability principle or theorem is used to finish the proof above.