Write . The Cauchy-Schwarz inequality gives because the two environment states are normalized. Immediately after the interaction, the joint quantum state is
Applying the last Hadamard gate gives
Since the environment is unobserved, the Born rule uses the squared norm of the environment-valued coefficient of :
Thus the Hadamard interference with environment overlap formula is
The plus sign follows from the explicitly chosen phase gate and the order of the inner product. Equivalently, before the last Hadamard gate the partial trace over the environment gives
The complex environment overlap in qubit dephasing both reduces the quantum coherence by and adds a relative quantum phase . Orthogonal environment states have and give for every . If , the quantum interference fringe has full contrast and is only shifted; the qubit has not become mixed. For , is immaterial.
Moving the interaction to between the first Hadamard gate and the phase gate gives
the identical joint quantum state. Therefore the expression is unchanged. This is the commutation of computational-basis dephasing and phase gates; it uses the specified population-preserving interaction with the same environment states, rather than an arbitrary model of quantum decoherence.