# Confusion on the probability of measuring first qubit of a separable mixed state

Let $$\rho = \sum_{x \in \{0,1\}^n} P_x |x \rangle\langle x|$$ be a separable mixed state over bit strings $$x$$ of size $$n$$. Suppose also that $$U = U_1 \otimes \cdots \otimes U_n$$ is a product of local unitaries. I am interested in calculating the probability that the first qubit of the state $$U\rho U^\dagger$$ is one. Call this probability $$P(\text{first qubit = |1 \rangle})$$. I approached this in two different ways, but the answers don't seem to agree, so I am confused which is right and why the other is wrong.

Approach One: Writing $$x = x_1 x_2 \dots x_n$$ with each $$x_i \in \{0,1\}$$, we have $$P(\text{first qubit = |1 \rangle}) = \sum_{x \in \{0,1\}^n} P(\text{first qubit = |1 \rangle} \mid x)P_x.$$ Here, the conditional probability is $$P(\text{first qubit = |1 \rangle} \mid x) = ||\Pi_1U|x \rangle||^2$$, where $$\Pi_1 = |1 \rangle\langle 1| \otimes I_{n-1}$$ is the projector onto the first qubit being $$|1 \rangle$$. Evaluating this probability, I obtain that $$P(\text{first qubit = |1 \rangle}) = \sum_{x \in \{0,1\}^n} |\langle 1 |U_1 |x_1 \rangle|^2 P_x.$$ Approach Two: The probability is $$P(\text{first qubit = |1 \rangle}) = \text{tr}(\Pi_1 U \rho U^\dagger).$$ Expanding this I obtain $$P(\text{first qubit = |1 \rangle}) = \sum_{x \in \{0,1\}^n} \sum_{z \in \{0,1\}^{n-1}}|\langle 1 | U_1 |x_1\rangle|^2 |\langle z |U_2 \otimes \cdots \otimes U_n |x_2x_3\dots x_n \rangle|^2 P_x.$$ It is not obvious to me that these two probabilities are the same. If they are not, what is my mistake?

They're the same because $$\sum_z |\langle z|\tilde U|\tilde x \rangle|^2=1$$ for any unitary $$\tilde U$$ and input $$|\tilde x\rangle$$. This follows directly from the normalization of probabilities: $$|\langle z|\tilde U|\tilde x \rangle|^2$$ is the probability of finding the outcome $$z$$ after evolving $$|\tilde x\rangle$$ through $$\tilde U$$.
Another reason why they are the same, equivalent to @glS's answer: resolution of identity $$\sum_{z \in \{0,1\}^{n-1}}|z\rangle\langle z|=I_{n-1}.$$ We can expand the absolute square in the second approach to show it agrees with the first: \begin{aligned} P(\text{first qubit = |1 \rangle}) &= \sum_{x \in \{0,1\}^n} \sum_{z \in \{0,1\}^{n-1}}|\langle 1 | U_1 |x_1\rangle|^2 |\langle z |U_2 \otimes \cdots \otimes U_n |x_2x_3\dots x_n \rangle|^2 P_x\\ &= \sum_{x \in \{0,1\}^n} \sum_{z \in \{0,1\}^{n-1}}|\langle 1 | U_1 |x_1\rangle|^2 \langle x_2x_3\dots x_n |U_n^\dagger \otimes \cdots \otimes U_2^\dagger |z \rangle\langle z |U_2 \otimes \cdots \otimes U_n |x_2x_3\dots x_n \rangle P_x\\ &= \sum_{x \in \{0,1\}^n} |\langle 1 | U_1 |x_1\rangle|^2 \langle x_2x_3\dots x_n |(U_n \otimes \cdots \otimes U_2)^\dagger I_{n-1} (|U_2 \otimes \cdots \otimes U_n) |x_2x_3\dots x_n \rangle P_x\\ &= \sum_{x \in \{0,1\}^n} |\langle 1 | U_1 |x_1\rangle|^2 \langle x_2x_3\dots x_n |x_2x_3\dots x_n \rangle P_x\\ &= \sum_{x \in \{0,1\}^n} |\langle 1 | U_1 |x_1\rangle|^2 P_x. \end{aligned}