Section 3.5 — two-qubit example: the code corrects only the subalgebra generated by and
ProvedADH2015.twoQubit_exampleLet the code subspace of two qubits be spanned by and , with logical operators (exchanging the two states) and . Then:
- and act within the code subspace;
- is realized on the first qubit by the bit flip : and for every code state;
- no operator acting on the first qubit alone satisfies for all code states, so cannot be realized on the first qubit;
- every operator that acts within the code subspace and has a representation on the first qubit acts on the code subspace as for some , i.e. the code corrects only the subalgebra generated by and ;
- is also realized on the second qubit, by (with the same two conditions).
The example shows that a code can protect a proper subalgebra of logical operators without correcting the erasure of a qubit, and that an abelian subalgebra (here generated by and ) can be represented on either of two complementary subsystems. This is the situation operator-algebra quantum error correction is designed to describe.
import Mathlib import Definitions.Def_ADH2015_defs open Matrix open scoped Kronecker
namespace ADH2015
theorem twoQubit_example :
ActsWithin twoQubitCode logicalX ∧ ActsWithin twoQubitCode logicalZ ∧
(∀ v ∈ twoQubitCode,
(pauliX ⊗ₖ (1 : Matrix Qubit Qubit ℂ)) *ᵥ v = logicalX *ᵥ v ∧
(pauliX ⊗ₖ (1 : Matrix Qubit Qubit ℂ))ᴴ *ᵥ v = logicalXᴴ *ᵥ v) ∧
(¬ ∃ M : Matrix Qubit Qubit ℂ, ∀ v ∈ twoQubitCode,
(M ⊗ₖ (1 : Matrix Qubit Qubit ℂ)) *ᵥ v = logicalZ *ᵥ v) ∧
(∀ O : Matrix (Qubit × Qubit) (Qubit × Qubit) ℂ, ActsWithin twoQubitCode O →
HasRepOnE twoQubitCode O →
∃ a b : ℂ, ∀ v ∈ twoQubitCode, O *ᵥ v = a • v + b • (logicalX *ᵥ v)) ∧
(∀ v ∈ twoQubitCode,
((1 : Matrix Qubit Qubit ℂ) ⊗ₖ pauliX) *ᵥ v = logicalX *ᵥ v ∧
((1 : Matrix Qubit Qubit ℂ) ⊗ₖ pauliX)ᴴ *ᵥ v = logicalXᴴ *ᵥ v) := by sorry
end ADH2015Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Read-back of ADH2015.twoQubit_example. The statement has no hypotheses and no free variables. It is a conjunction of six concrete claims about a fixed two-qubit system.
Setting. A qubit is the index set . Two-qubit vectors are functions , written in the basis order . In the first index is the first qubit and is the second. Operators are complex matrices indexed by such pairs, denotes the conjugate transpose, and is the matrix–vector product. For matrices the Kronecker product is , so applies to the first qubit and to the second. is the identity.
Definitions, unfolded.
- The code vectors are
- The code subspace is the complex linear span of , which is
the vectors with and . It has dimension 2.
- The logical is , with entries :
It satisfies and . It is real symmetric, so . It vanishes on the orthogonal complement of .
- The logical is :
It satisfies and , and .
- The Pauli is .
- flips the first qubit: . As a matrix,
- flips the second qubit: . As a matrix,
- Both matrices are real symmetric, hence self-adjoint, and each sends and .
- Acts within . An operator acts within if for every both and .
- Has a representation on . Here is the first qubit (the first tensor factor). The operator has a representation on if there is some complex matrix such that for every
Both equalities are required. Note that .
The six conjuncts.
- acts within : and for all .
- acts within : and for all .
- For every , both of the following hold:
The specific matrix on the first qubit therefore satisfies both equalities in the definition of "representation on " for . The statement gives this witness explicitly rather than invoking that definition. 4. There is no complex matrix such that for all . This non-existence claim concerns only the single equality ; no adjoint equality appears. It is therefore stronger than saying has no representation on in the two-equality sense defined above. 5. For every complex matrix : - if acts within (both and map into ), and - if has a representation on the first qubit (some with and for all ),
then there exist $a,b\in\mathbb{C}$ such that
The conclusion concerns only the action of $O$ on $C$. It does not mention $O^\dagger$, and it does not constrain $O$ outside $C$.
6. For every , both of the following hold:
This is the same claim as conjunct 3, with the Pauli acting on the second qubit instead.
Edge cases and scope.
- No hypotheses are involved, so nothing can be vacuous. In conjunct 5 the hypotheses are satisfiable; for example meets both of them by conjuncts 1 and 3.
- The constants are the real square root, viewed as complex numbers.
- Every "for all " ranges over the full 2-dimensional span. Every operator equality is required only on , never on all of .
- The statement contains no claim about representations on the second qubit in the formal sense. Conjunct 6 only gives the explicit witness for .
- The statement contains no claim about acting on the second qubit.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.