Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

p. 15, rules 1–4: the stabilizer and the Xˉ\bar XXˉ, Zˉ\bar ZZˉ operators after measuring AAA

Proved
HeisenbergRep.Knill.measurement_update

by iris · Oct 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

classical-simulationclifford-groupp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1quantum-informationstabilizer-formalism

Let ∣ψ⟩≠0|\psi\rangle\neq0∣ψ⟩=0, let SSS be a set of Pauli-group elements with N∣ψ⟩=∣ψ⟩N|\psi\rangle=|\psi\rangleN∣ψ⟩=∣ψ⟩ for all N∈SN\in SN∈S, let A=±P1⊗⋯⊗PnA=\pm P_1\otimes\cdots\otimes P_nA=±P1​⊗⋯⊗Pn​ be a Pauli operator with phase ±1\pm1±1, and let M∈SM\in SM∈S anticommute with AAA. Put ∣ψ′⟩=P+∣ψ⟩=12(I+A)∣ψ⟩|\psi'\rangle=P_+|\psi\rangle=\tfrac12(I+A)|\psi\rangle∣ψ′⟩=P+​∣ψ⟩=21​(I+A)∣ψ⟩, the state after the result +1+1+1, or after the result −1-1−1 and the correction by MMM. Then

  1. ∣ψ′⟩≠0|\psi'\rangle\neq0∣ψ′⟩=0;
  2. A∣ψ′⟩=∣ψ′⟩A|\psi'\rangle=|\psi'\rangleA∣ψ′⟩=∣ψ′⟩ (AAA joins the new stabilizer S′S'S′);
  3. M∣ψ′⟩≠∣ψ′⟩M|\psi'\rangle\neq|\psi'\rangleM∣ψ′⟩=∣ψ′⟩ (MMM leaves);
  4. every N∈SN\in SN∈S commuting with AAA satisfies N∣ψ′⟩=∣ψ′⟩N|\psi'\rangle=|\psi'\rangleN∣ψ′⟩=∣ψ′⟩;
  5. every N∈SN\in SN∈S anticommuting with AAA satisfies N∣ψ′⟩≠∣ψ′⟩N|\psi'\rangle\neq|\psi'\rangleN∣ψ′⟩=∣ψ′⟩, MN∣ψ′⟩=∣ψ′⟩MN|\psi'\rangle=|\psi'\rangleMN∣ψ′⟩=∣ψ′⟩, and MNMNMN commutes with AAA;
  6. every Pauli operator LLL commuting with every element of SSS and anticommuting with AAA (an Xˉj\bar X_jXˉj​ or Zˉj\bar Z_jZˉj​) has MLMLML commuting with AAA, and ML∣φ⟩=L∣φ⟩ML|\varphi\rangle=L|\varphi\rangleML∣φ⟩=L∣φ⟩ for every ∣φ⟩|\varphi\rangle∣φ⟩ fixed by all of SSS.

These are the rules by which the Heisenberg representation updates a stabilizer description under a Pauli measurement: identify MMM, remove it, add AAA, and replace each anticommuting NNN (generator or logical operator) by MNMNMN.

Differences from the source:

  • reading: measure an operator A ∈ P → A a PauliString with phase exponent 0 or 2 (A = ±P, Hermitian); reason: for phase ±i, ½(I + A) is not a projector and clause 2 fails (A = iZ, ψ = |+⟩, S = {I, X}, M = X)
  • reading: the state |ψ⟩ → ψ ≠ 0; reason: a state is a nonzero vector
  • generalization: S the stabilizer, N running over its generators → S any set of Pauli-group elements fixing ψ, N over all of S; reason: the stabilizer and any generating set of it are such sets
  • encoding: P+|ψ⟩ is in S′, A ∈ S′, M ∉ S′, N ∈ S′ → statements Aψ′ = ψ′, Mψ′ ≠ ψ′, Nψ′ = ψ′ about the unnormalized ψ′ = ½(I + A)ψ; reason: fixing a vector is invariant under nonzero scaling, and clause 1 gives ψ′ ≠ 0
  • reading: X̄_j, Z̄_j; MX̄_j "acts the same way" → L ∈ pauliGroup n commuting with every element of S; (ML)φ = Lφ for every φ fixed by S; reason: p. 9: the X̄, Z̄ are operators that commute with S; p. 15: operators are equivalent up to multiplication by stabilizer elements
Preamble
import Mathlib
import Definitions.Def_QAlgorithms_Defs_QECC
Formal statement
namespace HeisenbergRep.Knill

open QAlgorithms QAlgorithms.Stabilizer
open scoped Matrix

/-- **The stabilizer after measuring `A` (rules 1–4): `A` enters, `M` leaves, an anticommuting `N`
becomes `MN`, and `X̄_j` becomes `MX̄_j`.**
Gottesman, *The Heisenberg Representation of Quantum Computers*, arXiv:quant-ph/9807006v1, §7,
p. 15: "The state `P₊|ψ⟩` will always be in a `+1` eigenstate of `A`, so `A` is a member of the
new stabilizer `S′`. `M`, on the other hand, will not be in `S′`. The other generators will be in
`S′` if they commute with `A` … if `N ∈ S` does not commute with `A`, `N ∉ S′`; but `MN` does
commute with `A`, so `MN ∈ S′`. … even if `X̄_j` does not commute with `A`, `MX̄_j` does, and acts
the same way. … 1. Identify `M ∈ S` satisfying `{M, A} = 0`. 2. Remove `M` from the stabilizer
3. Add `A` to the stabilizer 4. For each `N`, where `N` runs over the other generators of `S` and
the `X̄` and `Z̄` operators, leave `N` alone if `[N, A] = 0`, and replace `N` with `MN` if
`{N, A} = 0`."

Let `ψ ≠ 0` be a vector of `ℂ^{2^n}`, `S` a set of elements of the Pauli group with `Nψ = ψ` for
every `N ∈ S`, `A = ±P_1 ⊗ ⋯ ⊗ P_n` a Pauli operator with phase `±1`, and `M ∈ S` with `MA = −AM`.
Let `ψ′ = P₊ψ = ½(I + A)ψ` be the (unnormalized) state after the measurement result `+1`, or
after the result `−1` and the correction by `M`. Then
1. `ψ′ ≠ 0`;
2. `Aψ′ = ψ′` (`A ∈ S′`);
3. `Mψ′ ≠ ψ′` (`M ∉ S′`);
4. every `N ∈ S` with `NA = AN` satisfies `Nψ′ = ψ′`;
5. every `N ∈ S` with `NA = −AN` satisfies `Nψ′ ≠ ψ′`, `(MN)ψ′ = ψ′`, and `MN` commutes with
   `A`;
6. every Pauli operator `L` that commutes with every element of `S` and anticommutes with `A` (an
   `X̄_j` or `Z̄_j`) has `ML` commuting with `A` and `(ML)φ = Lφ` for every `φ` fixed by every
   element of `S`.

**Formalization Note.** `A` is a `PauliString` with phase exponent `0` or `2` (Hermitian `A`): for
phase `±i`, `½(I + A)` is not a projector and clause 2 fails (`A = iZ`, `ψ = |+⟩`, `S = {I, X}`,
`M = X`). `S` is any set of Pauli-group elements stabilizing `ψ` (for instance the stabilizer or a
generating set), so "the other generators of `S`" are covered by "every `N ∈ S`". "Acts the same
way" is read as equality on the states fixed by `S`. -/
theorem measurement_update {n : ℕ} (ψ : EuclideanSpace ℂ (Qubits n)) (hψ : ψ ≠ 0)
    (S : Set (Matrix.unitaryGroup (Qubits n) ℂ)) (hSP : S ⊆ pauliGroup n)
    (hSψ : ∀ N ∈ S, act (N : Matrix (Qubits n) (Qubits n) ℂ) ψ = ψ)
    (A₀ : PauliString n) (hA₀ : A₀.phase = 0 ∨ A₀.phase = 2)
    (M : Matrix.unitaryGroup (Qubits n) ℂ) (hMS : M ∈ S)
    (hMA : (M : Matrix (Qubits n) (Qubits n) ℂ) * A₀.toMatrix =
      -(A₀.toMatrix * (M : Matrix (Qubits n) (Qubits n) ℂ))) :
    let ψ' := act ((2⁻¹ : ℂ) • (1 + A₀.toMatrix)) ψ
    ψ' ≠ 0 ∧
    act A₀.toMatrix ψ' = ψ' ∧
    act (M : Matrix (Qubits n) (Qubits n) ℂ) ψ' ≠ ψ' ∧
    (∀ N ∈ S, (N : Matrix (Qubits n) (Qubits n) ℂ) * A₀.toMatrix =
        A₀.toMatrix * (N : Matrix (Qubits n) (Qubits n) ℂ) →
      act (N : Matrix (Qubits n) (Qubits n) ℂ) ψ' = ψ') ∧
    (∀ N ∈ S, (N : Matrix (Qubits n) (Qubits n) ℂ) * A₀.toMatrix =
        -(A₀.toMatrix * (N : Matrix (Qubits n) (Qubits n) ℂ)) →
      act (N : Matrix (Qubits n) (Qubits n) ℂ) ψ' ≠ ψ' ∧
      act ((M * N : Matrix.unitaryGroup (Qubits n) ℂ) : Matrix (Qubits n) (Qubits n) ℂ) ψ' = ψ' ∧
      ((M * N : Matrix.unitaryGroup (Qubits n) ℂ) : Matrix (Qubits n) (Qubits n) ℂ) * A₀.toMatrix =
        A₀.toMatrix * ((M * N : Matrix.unitaryGroup (Qubits n) ℂ) : Matrix (Qubits n) (Qubits n) ℂ)) ∧
    (∀ L ∈ pauliGroup n, (∀ N ∈ S, L * N = N * L) →
      (L : Matrix (Qubits n) (Qubits n) ℂ) * A₀.toMatrix =
        -(A₀.toMatrix * (L : Matrix (Qubits n) (Qubits n) ℂ)) →
      ((M * L : Matrix.unitaryGroup (Qubits n) ℂ) : Matrix (Qubits n) (Qubits n) ℂ) * A₀.toMatrix =
          A₀.toMatrix * ((M * L : Matrix.unitaryGroup (Qubits n) ℂ) : Matrix (Qubits n) (Qubits n) ℂ) ∧
        ∀ φ : EuclideanSpace ℂ (Qubits n),
          (∀ N ∈ S, act (N : Matrix (Qubits n) (Qubits n) ℂ) φ = φ) →
          act ((M * L : Matrix.unitaryGroup (Qubits n) ℂ) : Matrix (Qubits n) (Qubits n) ℂ) φ =
            act (L : Matrix (Qubits n) (Qubits n) ℂ) φ) := by sorry

end HeisenbergRep.Knill
Source
Gottesman, The Heisenberg Representation of Quantum Computers, arXiv:quant-ph/9807006v1, §7, p. 15 (rules 1–4 and the two preceding paragraphs)
Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 1, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me