The phase of -1 generated on the ancilla is just a global phase. You can shift it to any qubit without affecting the statistics of the system. Nothing to do with entanglement.

Quantum mechanics is a mathematical framework that describes reality **insofar that it predicts the correct observable statistics** of a system. Shifting around a global phase factor from one qubit to another doesn't cause any deviation in the observable statistics and thus, they're all equivalent quantum states of the 5 qubits, **mathematically as well as physically**.

## $$-(|x\rangle\otimes |0\rangle) \equiv |x\rangle \otimes (-|0\rangle) \equiv (-|x\rangle)\otimes|0\rangle$$

As you're beginning to learn quantum computing you'll soon also hit another conceptual block.

Though your question doesn't ask about it, I'll briefly point out a couple of things. For some reason people seem to believe that state of control qubits should not change when a controlled-$U$ gate is applied. The actual statement is that *only* the standard basis states $|\{0, 1\}^c\rangle$ ($c$ being the number of control qubits) remain unaffected by controlled-$U$ gates.

If the control qubits are in a state that is different from one of the standard basis states, then theoretically their state could very well be affected. Moreover, as Niel de Beaudrap beautifully illustrates here, you should not attach too much significance to the standard basis!

The phenomenon is known as **phase kickback mechanism**:

If we apply a controlled-$U$ gate to $|\psi_k\rangle$ (an eigenstate of $U$; $e^{i\phi_k}$ being the eigenvalue), $|\psi_k\rangle$ is unchanged, and $|0\rangle\langle 0| + e^{i\phi_k}|1\rangle\langle 1|$ is applied to the *control* qubit.

For a detailed explanation, check DaftWullie's answer and the subsequent discussion in the comments.

Hi! Welcome to QCSE. How are you interpreting $\vert x\rangle -\vert 0\rangle$? If $\vert x\rangle$ is four qubits, and (the bottom) qubit $\vert 0\rangle$ is only one qubit, then it's not clear that you can subtract only one qubit from four. – Mark S – 2019-11-01T21:08:54.357

Hi! (Thanks for the edits.) I'm not interpreting it as subtracting |0⟩ from |⟩. I'm interpreting it as -|0⟩ "next to" |⟩. And what "next to" means, I have no idea! But it appears, from what I infer from the article, that |⟩−|0⟩ is the same as −|⟩|0⟩, so I assumed these objects follow the same rules as terms that are multiplied together (i.e. ()(−) is the same as −). – forte – 2019-11-01T21:27:49.880