Proof:
Prove the contrapositive. Assume that there is an distinguisher D such that X and Y are not poly time indistinguishable. Define a hybrid random variable H_n^k = \Bigg(X_n^{(1)}, \dots, X_n^{(k)}, Y_n^{(k+1)}, \dots, Y_n^{(m)}\Bigg), where X_n^{(\cdot)} are i.i.d samples from X_n and Y_n^{(\cdot)} are i.i.d samples from Y_n. We can use D as a subroutine in another PPT algorithm D^\prime and show that X and Y are not computationally indistinguishable. Define D^\prime as follows:
- Sample k \xleftarrow{R} \{0, 1, \dots, m-1\}
- Remember X_n and Y_n are efficiently construnctible, therefore it is possible to sample i.i.d from X_n. Denote these samples with x_1, \dots, x_k. Similarly, let y_{k+2}, \dots, y_m denote m-k-1 i.i.d samples from Y_n.
- Define D^\prime(\alpha) = (x_1, \dots, x_k, \alpha, y_{k+2}, y_m) where \alpha is in the range of X_n and Y_n
By Bayes rule we have
\begin{align} \Pr{[D^\prime(X_n) = 1]} &= \frac{1}{m}\sum_{k}\Pr{\Big[ D(H_n^{(k+1)}) = 1\Big]} \end{align}
\begin{align} \Pr{[D^\prime(Y_n) = 1]} &= \frac{1}{m}\sum_{k}\Pr{\Big[ D(H_n^{(k)}) = 1\Big]} \end{align}
Therefore we get
\begin{align} |\Pr{[D^\prime(X_n) = 1]} - \Pr{[D^\prime(Y_n) = 1]}| &= \frac{1}{m}\Bigg| \sum_{k}\Pr{\Big[ D(H_n^{(k+1)}) = 1\Big]} - \Pr{\Big[ D(H_n^{(k)}) = 1\Big]}\Bigg| \\ &= \frac{1}{m}\Bigg|\Pr{\Big[ D(H_n^{(m)}) = 1\Big]} - \Pr{\Big[ D(H_n^{(0)}) = 1\Big]}\Bigg| \\ &\geq \frac{1}{m p(n)} \end{align}
The last line comes from our assumption that X and Y are not repeated time indistinguishable.