# Verifying Shor's quantum error correction code

I know that Shor's 9 bit code can correct phase or bit flip, but I'd like to show that it can correct any type of error on a single qubit. I know that an arbitrary error can be expressed with the error base (phase flipe and bit flip), but I'm lacking the understanding of how does this assist me in deducing that any arbitrary error can be corrected?

$\newcommand{ket}{\left|#1\right>}$ Let’s suppose the error is the unitary $U$ applied on the $k$th qubit. We have \begin{align} U&=aI+bX+cY+dZ\\&=aI+bX+icXZ+dZ, \end{align} with $a,b,c,d$ being real numbers, $I$ is the identity, $X, Y, Z$ the Pauli operators. $X$ is a bit-flip, and $Z$ is a phase-flip. $Y=iXZ$ is a combination of phase and bit-flip.
Let’s look at a coherent version of Shor error correction, one where there is no measurement, but a set $A$ of 8 ancilla qubits, initially in the $\ket{0}$ state. Their final state, if measured in the computational basis, contains the code syndrome. The error correction is described by a unitary $V$ acting the 9 qubits of the code ($B$) and the 8 ancilla qubits. Since the code corrects both bit-flips and phase-flips, we have: \begin{align} V⋅(I\otimes I)\ket{\psi}_B\ket{0}_A&=\ket{\psi}_B\ket{0}_A\\ V⋅(X_k\otimes I)\ket{\psi}_B\ket{0}_A&=\ket{\psi}_B\ket{\phi_{k,X}}_A\\ V⋅(Z_k\otimes I)\ket{\psi}_B\ket{0}_A&=\ket{\psi}_B\ket{\phi_{k,Z}}_A\\ \end{align} The action of $Y_k=iX_kZ_k$ is also corrected, since it is a phase-flip followed by a bitflip $^*$ : \begin{align} V⋅(I_k\otimes I)\ket{\psi}_b\ket{0}_a&=iV⋅(X_k\otimes I)⋅(Z_k\otimes I)\ket{\psi}_b\ket{0}_a\\ &=\ket{\psi}_b\ket{\phi_{k,Y}}_a\\ \end{align}
If we apply this to an arbitrary error $U_k$ on the $k$th qubit, we have : $$V⋅(U_k\otimes I)\ket{\psi}_b\ket{0}_a=\ket{\psi}_b\left(a\ket0_a+b\ket{\phi_{k,X}}_A+c\ket{\phi_{k,Y}}_A+d\ket{\phi_{k,Z}}_A\right)$$ and the vector $\ket{\psi}_b$ is recovered.